smart-webcomponents-react 14.7.1 → 15.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +20 -24
- package/source/modules/smart.3dchart.js +2 -2
- package/source/modules/smart.accordion.js +1 -1
- package/source/modules/smart.array.js +2 -2
- package/source/modules/smart.barcode.js +1 -1
- package/source/modules/smart.breadcrumb.js +1 -1
- package/source/modules/smart.button.js +1 -1
- package/source/modules/smart.buttongroup.js +1 -1
- package/source/modules/smart.calendar.js +1 -1
- package/source/modules/smart.card.js +1 -1
- package/source/modules/smart.cardview.js +3 -3
- package/source/modules/smart.carousel.js +1 -1
- package/source/modules/smart.chart.js +2 -2
- package/source/modules/smart.checkbox.js +1 -1
- package/source/modules/smart.checkinput.js +1 -1
- package/source/modules/smart.chip.js +1 -1
- package/source/modules/smart.colorinput.js +1 -1
- package/source/modules/smart.colorpanel.js +2 -2
- package/source/modules/smart.colorpicker.js +2 -2
- package/source/modules/smart.combobox.js +2 -2
- package/source/modules/smart.common.js +2 -2
- package/source/modules/smart.countryinput.js +1 -1
- package/source/modules/smart.dateinput.js +1 -1
- package/source/modules/smart.daterangeinput.js +2 -2
- package/source/modules/smart.datetimepicker.js +2 -2
- package/source/modules/smart.dockinglayout.js +1 -1
- package/source/modules/smart.dropdownbutton.js +1 -1
- package/source/modules/smart.dropdownlist.js +2 -2
- package/source/modules/smart.editor.js +1 -1
- package/source/modules/smart.element.js +1 -1
- package/source/modules/smart.fileupload.js +2 -2
- package/source/modules/smart.form.js +1 -1
- package/source/modules/smart.formulaparser.js +1 -1
- package/source/modules/smart.ganttchart.js +3 -3
- package/source/modules/smart.gauge.js +1 -1
- package/source/modules/smart.grid.js +4 -4
- package/source/modules/smart.gridpanel.js +3 -3
- package/source/modules/smart.input.js +1 -1
- package/source/modules/smart.kanban.js +3 -3
- package/source/modules/smart.layout.js +1 -1
- package/source/modules/smart.led.js +1 -1
- package/source/modules/smart.listbox.js +1 -1
- package/source/modules/smart.listmenu.js +1 -1
- package/source/modules/smart.map.js +1 -1
- package/source/modules/smart.maskedtextbox.js +1 -1
- package/source/modules/smart.menu.js +1 -1
- package/source/modules/smart.multicomboinput.js +1 -1
- package/source/modules/smart.multiinput.js +1 -1
- package/source/modules/smart.multilinetextbox.js +2 -2
- package/source/modules/smart.multisplitbutton.js +2 -2
- package/source/modules/smart.numberinput.js +1 -1
- package/source/modules/smart.numerictextbox.js +2 -2
- package/source/modules/smart.pager.js +1 -1
- package/source/modules/smart.passwordinput.js +1 -1
- package/source/modules/smart.passwordtextbox.js +1 -1
- package/source/modules/smart.path.js +1 -1
- package/source/modules/smart.phoneinput.js +1 -1
- package/source/modules/smart.pivottable.js +3 -3
- package/source/modules/smart.progressbar.js +1 -1
- package/source/modules/smart.qrcode.js +1 -1
- package/source/modules/smart.querybuilder.js +2 -2
- package/source/modules/smart.radiobutton.js +1 -1
- package/source/modules/smart.rating.js +1 -1
- package/source/modules/smart.router.js +2 -2
- package/source/modules/smart.scheduler.js +3 -3
- package/source/modules/smart.scrollbar.js +1 -1
- package/source/modules/smart.slider.js +1 -1
- package/source/modules/smart.sortable.js +1 -1
- package/source/modules/smart.splitter.js +1 -1
- package/source/modules/smart.switchbutton.js +1 -1
- package/source/modules/smart.table.js +3 -3
- package/source/modules/smart.tabs.js +1 -1
- package/source/modules/smart.tank.js +1 -1
- package/source/modules/smart.textarea.js +1 -1
- package/source/modules/smart.textbox.js +2 -2
- package/source/modules/smart.timeinput.js +1 -1
- package/source/modules/smart.timepicker.js +1 -1
- package/source/modules/smart.toast.js +1 -1
- package/source/modules/smart.tooltip.js +1 -1
- package/source/modules/smart.tree.js +1 -1
- package/source/modules/smart.validator.js +1 -1
- package/source/modules/smart.window.js +2 -2
- package/source/smart.3dchart.js +1 -1
- package/source/smart.accordion.js +1 -1
- package/source/smart.ajax.js +1 -1
- package/source/smart.array.js +1 -1
- package/source/smart.barcode.js +1 -1
- package/source/smart.bootstrap.js +1 -1
- package/source/smart.breadcrumb.js +1 -1
- package/source/smart.button.js +1 -1
- package/source/smart.buttongroup.js +1 -1
- package/source/smart.calendar.js +1 -1
- package/source/smart.card.js +1 -1
- package/source/smart.cardview.js +1 -1
- package/source/smart.carousel.js +1 -1
- package/source/smart.chart.annotations.js +1 -1
- package/source/smart.chart.api.js +1 -1
- package/source/smart.chart.core.js +1 -1
- package/source/smart.chart.js +1 -1
- package/source/smart.chart.rangeselector.js +1 -1
- package/source/smart.chart.waterfall.js +1 -1
- package/source/smart.checkbox.js +1 -1
- package/source/smart.checkinput.js +1 -1
- package/source/smart.chip.js +1 -1
- package/source/smart.colorinput.js +1 -1
- package/source/smart.colorpanel.js +1 -1
- package/source/smart.colorpicker.js +1 -1
- package/source/smart.combobox.js +1 -1
- package/source/smart.complex.js +1 -1
- package/source/smart.core.js +1 -1
- package/source/smart.countryinput.js +1 -1
- package/source/smart.data.js +2 -2
- package/source/smart.date.js +1 -1
- package/source/smart.dateformatpanel.js +1 -1
- package/source/smart.dateinput.js +1 -1
- package/source/smart.daterangeinput.js +1 -1
- package/source/smart.datetimepicker.js +1 -1
- package/source/smart.dockinglayout.js +1 -1
- package/source/smart.draw.js +1 -1
- package/source/smart.dropdownbutton.js +1 -1
- package/source/smart.dropdownlist.js +2 -2
- package/source/smart.editor.js +1 -1
- package/source/smart.element.js +1 -1
- package/source/smart.elements.js +4 -4
- package/source/smart.export.js +1 -1
- package/source/smart.fileupload.js +1 -1
- package/source/smart.filter.js +1 -1
- package/source/smart.filterbuilder.js +1 -1
- package/source/smart.filterpanel.js +1 -1
- package/source/smart.form.js +1 -1
- package/source/smart.format.js +1 -1
- package/source/smart.formulaparser.js +1 -1
- package/source/smart.ganttchart.js +1 -1
- package/source/smart.gauge.js +1 -1
- package/source/smart.grid.cell.js +1 -1
- package/source/smart.grid.chart.js +1 -1
- package/source/smart.grid.column.js +1 -1
- package/source/smart.grid.core.js +2 -2
- package/source/smart.grid.dialog.js +1 -1
- package/source/smart.grid.edit.js +1 -1
- package/source/smart.grid.export.js +1 -1
- package/source/smart.grid.filter.js +1 -1
- package/source/smart.grid.group.js +1 -1
- package/source/smart.grid.js +1 -1
- package/source/smart.grid.menu.js +1 -1
- package/source/smart.grid.pager.js +1 -1
- package/source/smart.grid.reorder.js +1 -1
- package/source/smart.grid.resize.js +1 -1
- package/source/smart.grid.row.js +1 -1
- package/source/smart.grid.select.js +1 -1
- package/source/smart.grid.sort.js +1 -1
- package/source/smart.grid.toolbar.js +1 -1
- package/source/smart.grid.tree.js +1 -1
- package/source/smart.grid.view.js +1 -1
- package/source/smart.gridpanel.js +1 -1
- package/source/smart.input.js +1 -1
- package/source/smart.kanban.js +1 -1
- package/source/smart.layout.js +1 -1
- package/source/smart.led.js +1 -1
- package/source/smart.listbox.js +1 -1
- package/source/smart.listmenu.js +1 -1
- package/source/smart.map.js +1 -1
- package/source/smart.maskedtextbox.js +1 -1
- package/source/smart.math.js +1 -1
- package/source/smart.menu.js +1 -1
- package/source/smart.multicomboinput.js +1 -1
- package/source/smart.multiinput.js +1 -1
- package/source/smart.multilinetextbox.js +1 -1
- package/source/smart.multisplitbutton.js +1 -1
- package/source/smart.numberformatpanel.js +1 -1
- package/source/smart.numberinput.js +1 -1
- package/source/smart.numeric.js +1 -1
- package/source/smart.numerictextbox.js +1 -1
- package/source/smart.pager.js +1 -1
- package/source/smart.passwordinput.js +1 -1
- package/source/smart.passwordtextbox.js +1 -1
- package/source/smart.path.js +1 -1
- package/source/smart.phoneinput.js +1 -1
- package/source/smart.pivottable.js +1 -1
- package/source/smart.powerbutton.js +1 -1
- package/source/smart.progressbar.js +1 -1
- package/source/smart.qrcode.js +1 -1
- package/source/smart.radiobutton.js +1 -1
- package/source/smart.rating.js +1 -1
- package/source/smart.router.js +1 -1
- package/source/smart.scheduler.js +1 -1
- package/source/smart.scrollbar.js +1 -1
- package/source/smart.slider.js +1 -1
- package/source/smart.sortable.js +1 -1
- package/source/smart.splitter.js +1 -1
- package/source/smart.switchbutton.js +1 -1
- package/source/smart.table.js +1 -1
- package/source/smart.tabs.js +1 -1
- package/source/smart.tank.js +1 -1
- package/source/smart.textarea.js +1 -1
- package/source/smart.textbox.js +1 -1
- package/source/smart.tickintervalhandler.js +1 -1
- package/source/smart.timeinput.js +1 -1
- package/source/smart.timepicker.js +1 -1
- package/source/smart.toast.js +1 -1
- package/source/smart.tooltip.js +1 -1
- package/source/smart.tree.js +1 -1
- package/source/smart.validationpanel.js +1 -1
- package/source/smart.validator.js +1 -1
- package/source/smart.window.js +1 -1
- package/source/styles/components/smart.3dchart.css +1 -5
package/source/smart.elements.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
/* Smart UI v15.0.
|
|
2
|
+
/* Smart UI v15.0.1 (2023-01-20)
|
|
3
3
|
Copyright (c) 2011-2023 jQWidgets.
|
|
4
4
|
License: https://htmlelements.com/license/ */ //
|
|
5
5
|
|
|
6
6
|
!function(){const e="13.2.0",t=[];let n="Smart";if(window[n]&&window[n].Version){if(window[n].Version===e)return;if(window[n].Version!==e)n+=e;else{let e=2;for(;window[n];)n+=e.toString(),e++}}const r=navigator.userAgent.indexOf("Edge")>-1&&navigator.appVersion.indexOf("Edge")>-1;document.elementsFromPoint||(document.elementsFromPoint=document.msElementsFromPoint);class o{static isBoolean(e){return"boolean"==typeof e}static isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)}static isArray(e){return Array.isArray(e)}static isObject(e){return e&&("object"==typeof e||this.isFunction(e))||!1}static isDate(e){return e instanceof Date}static isString(e){return"string"==typeof e}static isNumber(e){return"number"==typeof e}static getType(e){const t=this,n=["Boolean","Number","String","Function","Array","Date","Object"].find((n=>{if(t["is"+n](e))return n}));return n?n.toLowerCase():void 0}}class i{static animate(e,t,r,o){const i=e;if(!i||i instanceof HTMLElement==0)return;if(0===i.getElementsByClassName("smart-ripple").length){const e=document.createElement("span");e.classList.add("smart-ripple"),e.setAttribute("role","presentation");let t=!0,r=null;if(window[n].EnableShadowDOM&&i.enableShadowDOM&&!0!==i.isInShadowDOM){for(let e=0;e<i.shadowRoot.host.shadowRoot.children.length;e++)"link"!==i.shadowRoot.host.shadowRoot.children[e].tagName.toLowerCase()&&(r=i.shadowRoot.host.shadowRoot.children[e]);i.shadowRoot.host.shadowRoot.querySelector(".smart-ripple")&&(t=!1)}else r=i.firstElementChild;t&&(r&&!r.noRipple&&r.offsetHeight>0?r.appendChild(e):i.appendChild(e))}let s=null;if(s=window[n].EnableShadowDOM&&i.shadowRoot?i.shadowRoot.host.shadowRoot.querySelector(".smart-ripple"):i.getElementsByClassName("smart-ripple")[0],!s)return;s.innerHTML="",s.classList.remove("smart-animate"),s.style.height=s.style.width=Math.max(i.offsetHeight,i.offsetWidth)+"px";const a=window.getComputedStyle(s.parentElement),l=parseInt(a.borderLeftWidth)||0,d=parseInt(a.borderTopWidth)||0,c=i.getBoundingClientRect(),u=t-(c.left+window.pageXOffset)-s.offsetWidth/2-l,p=r-(c.top+window.pageYOffset)-s.offsetHeight/2-d;s.style.left=u+"px",s.style.top=p+"px",s.classList.add("smart-animate"),s.addEventListener("animationend",(function e(){s.parentElement&&s.parentElement.removeChild(s),o&&o(),s.removeEventListener("animationend",e),s.removeEventListener("animationcancel",e)})),s.addEventListener("animationcancel",(function e(){s.parentElement&&s.parentElement.removeChild(s),o&&o(),s.removeEventListener("animationcancel",e),s.removeEventListener("animationend",e)}))}}class s{static easeInQuad(e,t,n,r){return n*(e/=r)*e+t}static easeOutQuad(e,t,n,r){return-n*(e/=r)*(e-2)+t}static easeInOutQuad(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t}static easeInCubic(e,t,n,r){return n*(e/=r)*e*e+t}static easeOutCubic(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}static easeInOutCubic(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e+t:n/2*((e-=2)*e*e+2)+t}static easeInQuart(e,t,n,r){return n*(e/=r)*e*e*e+t}static easeOutQuart(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t}static easeInOutQuart(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t}static easeInQuint(e,t,n,r){return n*(e/=r)*e*e*e*e+t}static easeOutQuint(e,t,n,r){return n*((e=e/r-1)*e*e*e*e+1)+t}static easeInOutQuint(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e*e+t:n/2*((e-=2)*e*e*e*e+2)+t}static easeInSine(e,t,n,r){return-n*Math.cos(e/r*(Math.PI/2))+n+t}static easeOutSine(e,t,n,r){return n*Math.sin(e/r*(Math.PI/2))+t}static easeInOutSine(e,t,n,r){return-n/2*(Math.cos(Math.PI*e/r)-1)+t}static easeInExpo(e,t,n,r){return 0===e?t:n*Math.pow(2,10*(e/r-1))+t}static easeOutExpo(e,t,n,r){return e===r?t+n:n*(1-Math.pow(2,-10*e/r))+t}static easeInOutExpo(e,t,n,r){return 0===e?t:e===r?t+n:(e/=r/2)<1?n/2*Math.pow(2,10*(e-1))+t:n/2*(2-Math.pow(2,-10*--e))+t}static easeInCirc(e,t,n,r){return-n*(Math.sqrt(1-(e/=r)*e)-1)+t}static easeOutCirc(e,t,n,r){return n*Math.sqrt(1-(e=e/r-1)*e)+t}static easeInOutCirc(e,t,n,r){return(e/=r/2)<1?-n/2*(Math.sqrt(1-e*e)-1)+t:n/2*(Math.sqrt(1-(e-=2)*e)+1)+t}static easeInElastic(e,t,n,r){let o=1.70158,i=0,s=n;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),s<Math.abs(n)?(s=n,o=i/4):o=i/(2*Math.PI)*Math.asin(n/s),-s*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/i)+t)}static easeOutElastic(e,t,n,r){let o=1.70158,i=0,s=n;return 0===e?t:1==(e/=r)?t+n:(i||(i=.3*r),s<Math.abs(n)?(s=n,o=i/4):o=i/(2*Math.PI)*Math.asin(n/s),s*Math.pow(2,-10*e)*Math.sin((e*r-o)*(2*Math.PI)/i)+n+t)}static easeInOutElastic(e,t,n,r){let o=1.70158,i=0,s=n;return 0===e?t:2==(e/=r/2)?t+n:(i||(i=r*(.3*1.5)),s<Math.abs(n)?(s=n,o=i/4):o=i/(2*Math.PI)*Math.asin(n/s),e<1?s*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/i)*-.5+t:s*Math.pow(2,-10*(e-=1))*Math.sin((e*r-o)*(2*Math.PI)/i)*.5+n+t)}static easeInBack(e,t,n,r,o){return void 0===o&&(o=1.70158),n*(e/=r)*e*((o+1)*e-o)+t}static easeOutBack(e,t,n,r,o){return void 0===o&&(o=1.70158),n*((e=e/r-1)*e*((o+1)*e+o)+1)+t}static easeInOutBack(e,t,n,r,o){return void 0===o&&(o=1.70158),(e/=r/2)<1?n/2*(e*e*((1+(o*=1.525))*e-o))+t:n/2*((e-=2)*e*((1+(o*=1.525))*e+o)+2)+t}static easeInBounce(e,t,n,r){return n-this.easeOutBounce(r-e,0,n,r)+t}static easeOutBounce(e,t,n,r){return(e/=r)<1/2.75?n*(7.5625*e*e)+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t}static easeInOutBounce(e,t,n,r){return e<r/2?.5*this.easeInBounce(2*e,0,n,r)+t:.5*this.easeOutBounce(2*e-r,0,n,r)+.5*n+t}}class a{static get isMobile(){const e=/(iphone|ipod|ipad|android|iemobile|blackberry|bada)/.test(window.navigator.userAgent.toLowerCase());return e||["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}static get Browser(){let e;const t=function(t){let n=t.indexOf(e);if(-1===n)return;const r=t.indexOf("rv:");return"Trident"===e&&-1!==r?parseFloat(t.substring(r+3)):parseFloat(t.substring(n+e.length+1))};let n={};return n[function(){const t=[{string:navigator.userAgent,subString:"Edge",identity:"Edge"},{string:navigator.userAgent,subString:"MSIE",identity:"IE"},{string:navigator.userAgent,subString:"Trident",identity:"IE"},{string:navigator.userAgent,subString:"Firefox",identity:"Firefox"},{string:navigator.userAgent,subString:"Opera",identity:"Opera"},{string:navigator.userAgent,subString:"OPR",identity:"Opera"},{string:navigator.userAgent,subString:"Chrome",identity:"Chrome"},{string:navigator.userAgent,subString:"Safari",identity:"Safari"}];for(let n=0;n<t.length;n++){let r=t[n].string;if(e=t[n].subString,-1!==r.indexOf(t[n].subString))return t[n].identity}return"Other"}()]=!0,n.version=t(navigator.userAgent)||t(navigator.appVersion)||"Unknown",n}static toCamelCase(e){return e.replace(/-([a-z])/g,(function(e){return e[1].toUpperCase()}))}static toDash(e){return e.split(/(?=[A-Z])/).join("-").toLowerCase()}static unescapeHTML(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}static escapeHTML(e){const t={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,(e=>t[e]))}static sanitizeHTML(e){if(e&&(e.indexOf("onclick")>=0||e.indexOf("onload")>=0||e.indexOf("onerror")>=0))return this.escapeHTML(e);const t=new RegExp("<s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)[^>]*>(.*?)<s*/s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)>","ig");return String(e).replace(t,(e=>this.escapeHTML(e)))}static createGUID(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}static getScriptLocation(){return"./"!==window[n].BaseUrl?window[n].BaseUrl:function(){if(document.currentScript){let e=document.currentScript.src,t=e.lastIndexOf("/");return e=e.substring(0,t),e}const e=new Error;let t="(",n=")";if(Smart.Utilities.Core.Browser.Safari&&(t="@",n="\n"),e.fileName)return e.fileName.replace("/smart.element.js","");let r=e.stack.split(t);return r=r[1],r=r.split(n)[0],r=r.split(":"),r.splice(-2,2),r=r.join(":"),r.replace("/smart.element.js","")}()}static CSSVariablesSupport(){return window.CSS&&window.CSS.supports&&window.CSS.supports("(--fake-var: 0)")}static assign(e,t){const n=e=>e&&"object"==typeof e&&!Array.isArray(e)&&null!==e;let r=Object.assign({},e);return n(e)&&n(t)&&Object.keys(t).forEach((o=>{n(t[o])?o in e?r[o]=this.assign(e[o],t[o]):Object.assign(r,{[o]:t[o]}):Object.assign(r,{[o]:t[o]})})),r}static html(e,t){const n=this;let r="",o=e.childNodes;if(!t){for(let e,t=0,i=o.length;t<i&&(e=o[t]);t++){const t=["strong"];if(e instanceof HTMLElement||e.tagName&&t.indexOf(e.tagName.toLowerCase())>=0){const t=e.tagName.toLowerCase(),o=e.attributes;let i="<"+t;for(let e,t=0;e=o[t];t++)i+=" "+e.name+'="'+e.value.replace(/[&\u00A0"]/g,y.Core.escapeHTML)+'"';i+=">",["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"][t]&&(r+=i),r=r+i+n.html(e)+"</"+t+">"}else{if(8===e.nodeType)continue;r+=e.textContent.replace(/[&\u00A0<>]/g,y.Core.escapeHTML)}}return r}{const n=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi;e.innerHTML=t.replace(n,"<$1></$2>")}}}let l=[];class d{static watch(e){switch(e.nodeName.toLowerCase()){case"smart-grid":case"smart-kanban":case"smart-table":case"smart-pivot-table":case"smart-scheduler":case"smart-tabs":case"smart-card-view":case"smart-list-box":case"smart-combo-box":case"smart-drop-down-list":case"smart-calendar":case"smart-gauge":case"smart-numeric-text-box":case"smart-menu":case"smart-tree":l.push(e);break;default:return}d.start()}static start(){d.isStarted||(d.isStarted=!0,d.interval&&clearInterval(d.interval),0===l.length||document.hidden?d.isStarted=!1:d.interval=setInterval((function(){d.observe()}),100))}static stop(){d.isStarted=!1,d.interval&&clearInterval(d.interval)}static observeElement(e){const t=e;if("test"===window.Smart.Mode||document.hidden)return void(d.interval&&clearInterval(d.interval));let n=e._computedStyle||"resize"!==t.hasStyleObserver?document.defaultView.getComputedStyle(t,null):{},r=!0,o="resize"!==t.hasStyleObserver?["paddingLeft","paddingRight","paddingTop","paddingBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","display","visibility","font-size","font-family","font-style","font-weight","max-height","min-height","max-width","min-width","overflow","overflow-x","overflow-y"]:[];if(e.styleProperties&&(o=o.concat(e.styleProperties)),e.observableStyleProperties&&(o=e.observableStyleProperties),!t._styleInfo){t._styleInfo=[];for(let e=0;e<o.length;e++){const r=o[e],i=r.startsWith("--")?n.getPropertyValue(r):n[r];t._styleInfo[r]=i}return}if(e.isHidden||"none"!==n.display&&(0!==e.offsetWidth&&0!==e.offsetHeight||(e.isHidden=!0)),e.isHidden){if(e.visibilityChangedHandler(),e.isHidden)return;r=!1}let i=[];for(let e=0;e<o.length;e++){const r=o[e],s=r.startsWith("--")?n.getPropertyValue(r):n[r];t._styleInfo[r]!==s&&(i[r]={oldValue:t._styleInfo[r],value:s},i.length++),t._styleInfo[r]=s}i.length>0&&(t.$.fireEvent("styleChanged",{styleProperties:i},{bubbles:!1,cancelable:!0}),i.display&&r&&t.$.fireEvent("resize",t,{bubbles:!1,cancelable:!0}))}static observe(){for(let e=0;e<l.length;e++){const t=l[e];this.observeElement(t)}}static unwatch(e){d.stop();const t=l.indexOf(e);-1!==t&&l.splice(t,1),d.start()}}let c=[];const u=[],p=["resize","down","up","move","tap","taphold","swipeleft","swiperight","swipetop","swipebottom"];class h{constructor(e){const t=this;t.target=e,t.$target=new f(e),t.$document=e.$document?e.$document:new f(document),t.id=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase();let n={handlers:{},boundEventTypes:[],listen:t.listen.bind(t),unlisten:t.unlisten.bind(t)};return t.tapHoldDelay=750,t.swipeMin=10,t.swipeMax=5e3,t.swipeDelay=1e3,t.tapHoldDelay=750,t.inputEventProperties=["clientX","clientY","pageX","pageY","screenX","screenY"],p.forEach((e=>{n[e]=t=>{n.handlers[e]=t},t[e]=e=>{if(!n.handlers[e.type]){if(("mousemove"===e.type||"pointermove"===e.type||"touchmove"===e.type)&&n.handlers.move){const r=t.createEvent(e,"move");n.handlers.move(r)}return!0}return n.handlers[e.type](e)}})),t.listen(),t.handlers=n.handlers,n}listen(e){const t=this;if("resize"===e&&t.target!==document&&t.target!==window&&!1!==t.target.hasResizeObserver)if(Smart.Utilities.Core.Browser.Firefox){if(!t.target.resizeObserver){let e,n,r,o=!1,i=t.target.offsetWidth,s=t.target.offsetHeight;const a=new ResizeObserver((()=>{if(!o)return void(o=!0);const a=new CustomEvent("resize",{bubbles:!1,cancelable:!0});n=t.target.offsetWidth,r=t.target.offsetHeight,e=n!==i||r!==s,t.target.requiresLayout&&(e=!0),e&&(t.resize(a),t.target.requiresLayout=!1)}));a.observe(t.target),t.target.resizeObserver=a}}else if(!t.target.resizeTrigger){const e=document.createElement("div");e.className="smart-resize-trigger-container",e.innerHTML='<div class="smart-resize-trigger-container"><div class="smart-resize-trigger"></div></div><div class="smart-resize-trigger-container"><div class="smart-resize-trigger-shrink"></div></div>',e.setAttribute("aria-hidden",!0),window[n].EnableShadowDOM&&t.target.shadowRoot?t.target.shadowRoot.appendChild(e):t.target.appendChild(e),t.target.resizeTrigger=e;const r=e.childNodes[0],o=r.childNodes[0],i=e.childNodes[1],s=function(){o.style.width="100000px",o.style.height="100000px",r.scrollLeft=1e5,r.scrollTop=1e5,i.scrollLeft=1e5,i.scrollTop=1e5};let a,l,d,c,u=t.target.offsetWidth,p=t.target.offsetHeight;if(0===u||0===p){const e=function(){s(),t.target.removeEventListener("resize",e)};t.target.addEventListener("resize",e),s()}else s();t.target.resizeHandler=function(){l||(l=requestAnimationFrame((function(){if(l=0,d=t.target.offsetWidth,c=t.target.offsetHeight,a=d!==u||c!==p,t.target.requiresLayout&&(a=!0),!a)return;u=d,p=c;const e=new CustomEvent("resize",{bubbles:!1,cancelable:!0});t.resize(e),t.target.requiresLayout=!1}))),s()},r.addEventListener("scroll",t.target.resizeHandler),i.addEventListener("scroll",t.target.resizeHandler)}t.isListening||(t.isListening=!0,t.isPressed=!1,t.isReleased=!1,t.isInBounds=!1,window.PointerEvent?(t.$target.listen("pointerdown.inputEvents"+t.id,t.pointerDown.bind(t)),t.$target.listen("pointerup.inputEvents"+t.id,t.pointerUp.bind(t)),t.$target.listen("pointermove.inputEvents"+t.id,t.pointerMove.bind(t)),t.$target.listen("pointercancel.inputEvents"+t.id,t.pointerCancel.bind(t))):("ontouchstart"in window&&(t.$target.listen("touchmove.inputEvents"+t.id,t.touchMove.bind(t)),t.$target.listen("touchstart.inputEvents"+t.id,t.touchStart.bind(t)),t.$target.listen("touchend.inputEvents"+t.id,t.touchEnd.bind(t)),t.$target.listen("touchcancel.inputEvents"+t.id,t.touchCancel.bind(t))),t.$target.listen("mousedown.inputEvents"+t.id,t.mouseDown.bind(t)),t.$target.listen("mouseup.inputEvents"+t.id,t.mouseUp.bind(t)),t.$target.listen("mousemove.inputEvents"+t.id,t.mouseMove.bind(t)),t.$target.listen("mouseleave.inputEvents"+t.id,t.mouseLeave.bind(t))),t.target._handleDocumentUp||(t.target._handleDocumentUp=t.handleDocumentUp.bind(t),t.target._handleDocumentUpId=t.id,t.$document.listen("mouseup.inputEvents"+t.target._handleDocumentUpId,t.target._handleDocumentUp)))}unlisten(e){const t=this;if(t.isListening=!1,window.PointerEvent?(t.$target.unlisten("pointerdown.inputEvents"+t.id),t.$target.unlisten("pointerup.inputEvents"+t.id),t.$target.unlisten("pointermove.inputEvents"+t.id),t.$target.unlisten("pointercancel.inputEvents"+t.id)):("ontouchstart"in window&&(t.$target.unlisten("touchstart.inputEvents"+t.id),t.$target.unlisten("touchmove.inputEvents"+t.id),t.$target.unlisten("touchend.inputEvents"+t.id),t.$target.unlisten("touchcancel.inputEvents"+t.id)),t.$target.unlisten("mousedown.inputEvents"+t.id),t.$target.unlisten("mouseup.inputEvents"+t.id),t.$target.unlisten("mousemove.inputEvents"+t.id),t.$target.unlisten("mouseleave.inputEvents"+t.id)),t.target._handleDocumentUp&&(t.$document.unlisten("mouseup.inputEvents"+t.target._handleDocumentUpId,t.target._handleDocumentUp),delete t.target._handleDocumentUp,delete t.target._handleDocumentUpId),"resize"===e)if(Smart.Utilities.Core.Browser.Firefox)t.target.resizeObserver&&(t.target.resizeObserver.unobserve(t.target),delete t.target.resizeObserver);else if(t.target.resizeTrigger){const e=t.target.resizeTrigger,n=e.childNodes[0],r=e.childNodes[1];n.removeEventListener("scroll",t.target.resizeHandler),r.removeEventListener("scroll",t.target.resizeHandler),t.target.resizeHandler=null,e.parentNode.removeChild(e),delete t.target.resizeTrigger}}handleDocumentUp(e){const t=this;t.isPressed=!1,t.isReleased=!1,t.resetSwipe(e)}createEvent(e,t){const n=this,r=e.touches,o=e.changedTouches,i=r&&r.length?r[0]:o&&o.length?o[0]:void 0,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,composed:void 0!==n.$target.element.getRootNode().host});if(s.originalEvent=e,i){for(let e=0;e<n.inputEventProperties.length;e++){const t=n.inputEventProperties[e];s[t]=i[t]}return s}for(let t in e)t in s||(s[t]=e[t]);return s}fireTap(e){const t=this;if(clearTimeout(this.tapHoldTimeout),!this.tapHoldFired&&this.isInBounds){const n=t.createEvent(e,"tap");t.tap(n)}}initTap(e){const t=this;t.isInBounds=!0,t.tapHoldFired=!1,t.tapHoldTimeout=setTimeout((function(){if(t.isInBounds){t.tapHoldFired=!0;const n=t.createEvent(e,"taphold");t.taphold(n)}}),t.tapHoldDelay)}pointerDown(e){return this.handleDown(e)}mouseDown(e){const t=this;if(!(t.isPressed||t.touchStartTime&&new Date-t.touchStartTime<500))return t.handleDown(e)}touchStart(e){const t=this;return t.touchStartTime=new Date,t.isTouchMoved=!0,t.handleDown(e)}mouseUp(e){const t=this;if(!(t.isReleased||t.touchEndTime&&new Date-t.touchEndTime<500))return t.handleUp(e)}handleDown(e){const t=this;t.isReleased=!1,t.isPressed=!0;const n=t.createEvent(e,"down");return(t.handlers.tap||t.handlers.taphold)&&t.initTap(n),(t.handlers.swipeleft||t.handlers.swiperight||t.handlers.swipetop||t.handlers.swipebottom)&&t.initSwipe(n),t.down(n)}handleUp(e){const t=this;t.isReleased=!0,t.isPressed=!1;const n=t.createEvent(e,"up"),r=t.up(n);return(t.handlers.tap||t.handlers.taphold)&&t.fireTap(n),t.resetSwipe(n),r}handleMove(e){const t=this;let n=t.move(e);return t.isPressed&&(t._maxSwipeVerticalDistance=Math.max(t._maxSwipeVerticalDistance,Math.abs(t._startY-e.pageY)),t._maxSwipeHorizontalDistance=Math.max(t._maxSwipeHorizontalDistance,Math.abs(t._startX-e.pageX)),n=t.handleSwipeEvents(e)),n}touchEnd(e){return this.touchEndTime=new Date,this.handleUp(e)}pointerUp(e){return this.handleUp(e)}pointerCancel(e){this.pointerUp(e)}touchCancel(e){this.touchEnd(e)}mouseLeave(){this.isInBounds=!1}mouseMove(e){if(!this.isTouchMoved)return this.handleMove(e)}pointerMove(e){return this.handleMove(e)}touchMove(e){const t=this,n=e.touches,r=e.changedTouches,o=n&&n.length?n[0]:r&&r.length?r[0]:void 0;for(let n=0;n<t.inputEventProperties.length;n++){const r=t.inputEventProperties[n];void 0===e[r]&&(e[r]=o[r])}return t.isTouchMoved=!0,t.handleMove(e)}handleSwipeEvents(e){const t=this;let n=!0;return(t.handlers.swipetop||t.handlers.swipebottom)&&(n=this.handleVerticalSwipeEvents(e)),!1===n||(t.handlers.swipeleft||t.handlers.swiperight)&&(n=this.handleHorizontalSwipeEvents(e)),n}handleVerticalSwipeEvents(e){let t,n;return t=e.pageY,n=t-this._startY,this.swiped(e,n,"vertical")}handleHorizontalSwipeEvents(e){let t,n;return t=e.pageX,n=t-this._startX,this.swiped(e,n,"horizontal")}swiped(e,t,n){const r=this;if(n=n||0,Math.abs(t)>=r.swipeMin&&!r._swipeEvent&&!r._swipeLocked){let o=t<0?"swipeleft":"swiperight";if("horizontal"===n?r._swipeEvent=r.createEvent(e,o):(o=t<0?"swipetop":"swipebottom",r._swipeEvent=r.createEvent(e,t<0?"swipetop":"swipebottom")),r[o]&&(r[o](this._swipeEvent),Math.abs(t)<=this.swipeMax))return e.stopImmediatePropagation(),!1}return!0}resetSwipe(){this._swipeEvent=null,clearTimeout(this._swipeTimeout)}initSwipe(e){const t=this;t._maxSwipeVerticalDistance=0,t._maxSwipeHorizontalDistance=0,t._startX=e.pageX,t._startY=e.pageY,t._swipeLocked=!1,t._swipeEvent=null,t._swipeTimeout=setTimeout((function(){t._swipeLocked=!0}),t.swipeDelay)}}class m{get scrollWidth(){const e=this;return e.horizontalScrollBar?e.horizontalScrollBar.max:-1}set scrollWidth(e){const t=this;e<0&&(e=0),t.horizontalScrollBar&&(t.horizontalScrollBar.max=e)}get scrollHeight(){const e=this;return e.verticalScrollBar?e.verticalScrollBar.max:-1}set scrollHeight(e){const t=this;e<0&&(e=0),t.verticalScrollBar&&(t.verticalScrollBar.max=e)}get scrollLeft(){const e=this;return e.horizontalScrollBar?e.horizontalScrollBar.value:-1}set scrollLeft(e){const t=this;e<0&&(e=0),t.horizontalScrollBar&&(t.horizontalScrollBar.value=e)}get scrollTop(){const e=this;return e.verticalScrollBar?e.verticalScrollBar.value:-1}set scrollTop(e){const t=this;e<0&&(e=0),t.verticalScrollBar&&(t.verticalScrollBar.value=e)}get vScrollBar(){return this.verticalScrollBar}get hScrollBar(){return this.horizontalScrollBar}constructor(e,t,n){const r=this;r.container=e,r.horizontalScrollBar=t,r.verticalScrollBar=n,r.disableSwipeScroll=!1,r.listen()}listen(){const e=this,t=a.isMobile,n=e.horizontalScrollBar,r=e.verticalScrollBar;let o,i,s,l,d,c,u,p;e.inputEvents=new h(e.container);const m=function(e){return{amplitude:0,delta:0,initialValue:0,min:0,max:e.max,previousValue:0,pointerPosition:0,targetValue:0,scrollBar:e,value:0,velocity:0}},f=m(n),g=m(r),w=function(){const t=e.container.touchVelocityCoefficient||50;c=Date.now(),u=c-l,l=c;const n=function(e){e.delta=e.value-e.previousValue,e.previousValue=e.value;let n=t*e.delta/(1+u);e.velocity=.8*n+.2*e.velocity};n(g),n(f)},b=function(e){return p.value=e>p.max?p.max:e<p.min?p.min:e,p.scrollBar.value=p.value,e>p.max?"max":e<p.min?"min":"value"};function v(){let t,n;p.amplitude&&(e.container.$.fireEvent("kineticScroll"),t=Date.now()-l,n=-p.amplitude*Math.exp(-t/500),n>5||n<-5?(b(p.targetValue+n),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(v)):b(p.targetValue))}let _;e.inputEvents.down((function(n){if(!t)return;const r=n.originalEvent.target,i=r&&r.closest?r.closest("smart-scroll-bar"):void 0;if(i===e.horizontalScrollBar||i===e.verticalScrollBar)return;s=!0,o=!1;const a=function(e,t){e.amplitude=0,e.pointerPosition=t,e.previousValue=e.value,e.value=e.scrollBar.value,e.initialValue=e.value,e.max=e.scrollBar.max};a(g,n.clientY),a(f,n.clientX),l=Date.now(),clearInterval(d),d=setInterval(w,500)})),e.inputEvents.up((function(){if(!s)return!0;if(clearInterval(d),e.disableSwipeScroll)return void(s=!1);const t=function(e){p=e,e.amplitude=.8*e.velocity,e.targetValue=Math.round(e.value+e.amplitude),l=Date.now(),cancelAnimationFrame(i),i=requestAnimationFrame(v),e.velocity=0};g.velocity>10||g.velocity<-10?t(g):(f.velocity>10||f.velocity<-10)&&t(f),s=!1})),e.inputEvents.move((function(t){if(!s)return!0;if(e.disableSwipeScroll)return;if(o&&(t.originalEvent.preventDefault(),t.originalEvent.stopPropagation()),f.visible=e.scrollWidth>0,g.visible=e.scrollHeight>0,!s||!f.visible&&!g.visible)return;const n=e.container.touchScrollRatio,r=e.container;let i,a;n&&("number"==typeof n?(i=-n,a=-n):"function"==typeof n&&(i=n(g.max,r.offsetHeight),a=n(f.max,r.offsetWidth))),g.ratio=i||-g.max/r.offsetHeight,g.delta=(t.clientY-g.pointerPosition)*g.ratio,f.ratio=a||-f.max/r.offsetWidth,f.delta=(t.clientX-f.pointerPosition)*f.ratio;let l="value";const d=function(t,n,r){return t.delta>5||t.delta<-5?(p=t,l=t.initialValue+t.delta>p.max?"max":t.initialValue+t.delta<p.min?"min":"value","min"===l&&0===t.initialValue||"max"===l&&t.initialValue===t.max||!t.visible||(e.container.$.fireEvent("kineticScroll"),b(t.initialValue+t.delta),w(),r.originalEvent.preventDefault(),r.originalEvent.stopPropagation(),o=!0,!1)):null};let c=d(g,t.clientY,t);if(null!==c)return c;{let e=d(f,t.clientX,t);if(null!==e)return e}})),e.scrollTo=function(t,n){const r=!1===n?f:g;let o=!1;l||(l=Date.now()),_||(_=Date.now()),Math.abs(Date.now()-_)>375?l=Date.now():o=!0,_=Date.now(),r.value=r.scrollBar.value,r.delta=t-r.value,r.max=r.scrollBar.max,t<=r.min&&(t=r.min),t>=r.max&&(t=r.max),r.targetValue=t;const s=t;let a=r.value;r.velocity=100*r.delta/(1+r.max),r.from=a;const d=function(e){return r.value=e>r.max?r.max:e<r.min?r.min:e,r.scrollBar.value=r.value,e>r.max?"max":e<r.min?"min":"value"},c=function(){let n,u=Date.now()-_,p=Math.min(1e3,Date.now()-l),h=r.velocity*Math.exp(p/175);if(o)(h<0&&r.value<=t||h>0&&r.value>=t)&&(h=0),(r.value+h<=r.min||r.value+h>=r.max)&&(h=0),h>.5||h<-.5?(d(r.value+h),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(c)):d(r.targetValue);else{if(u>=175)return cancelAnimationFrame(i),e.container.$.fireEvent("kineticScroll"),void(i=0);n=y.Animation.Easings.easeInSine(u,a,s-a,175),d(n),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(c)}};cancelAnimationFrame(i),i=requestAnimationFrame(c)},e.inputEvents.listen()}unlisten(){const e=this;e.inputEvents&&e.inputEvents.unlisten(),delete e.inputEvents}}class f{constructor(e){this.events={},this.handlers={},this.element=e}hasClass(e){const t=this,n=e.split(" ");for(let e=0;e<n.length;e++)if(!t.element.classList.contains(n[e]))return!1;return!0}addClass(e){const t=this;if(t.hasClass(e))return;const n=e.split(" ");for(let e=0;e<n.length;e++)t.element.classList.add(n[e]);t.isNativeElement||d.observeElement(t.element)}removeClass(e){const t=this;if(0===arguments.length)return void t.element.removeAttribute("class");const n=e.split(" ");for(let e=0;e<n.length;e++)t.element.classList.remove(n[e]);""===t.element.className&&t.element.removeAttribute("class"),t.isNativeElement||d.observeElement(t.element)}get isCustomElement(){const e=this;return!!e.element.tagName.startsWith(n)||e.element instanceof window[n].BaseElement==1||"DIV"!==e.element.tagName&&"SPAN"!==e.element.tagName&&"BUTTON"!==e.element.tagName&&"INPUT"!==e.element.tagName&&"UL"!==e.element.tagName&&"LI"!==e.element.tagName&&document.createElement(e.element.nodeName)instanceof window[n].BaseElement==1}get isNativeElement(){return!this.isCustomElement}dispatch(e){const t=this,n=t.events[e.type];let r=!1;if(n.length>1)for(let e=0;e<n.length;e++){const t=n[e];if(t.namespace&&t.namespace.indexOf("_")>=0){r=!0;break}}r&&n.sort((function(e,t){let n=e.namespace,r=t.namespace;return n=-1===n.indexOf("_")?0:parseInt(n.substring(n.indexOf("_")+1)),r=-1===r.indexOf("_")?0:parseInt(r.substring(r.indexOf("_")+1)),n<r?-1:n>r?1:0}));for(let r=0;r<n.length;r++){const o=n[r];if(e.namespace=o.namespace,e.context=o.context,e.defaultPrevented)break;const i=o.handler.apply(t.element,[e]);if(void 0!==i&&(e.result=i,!1===i)){e.preventDefault(),e.stopPropagation();break}}return e.result}fireEvent(e,t,n){const r=this;n||(n={bubbles:!0,cancelable:!0,composed:null!==r.element.getRootNode().host}),n.detail=t||{};const o=new CustomEvent(e,n);return o.originalStopPropagation=o.stopPropagation,o.stopPropagation=function(){return o.isPropagationStopped=!0,o.originalStopPropagation()},r.dispatchEvent(o),o}get isPassiveSupported(){const e=this;if(void 0!==e.supportsPassive)return e.supportsPassive;e.supportsPassive=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e.supportsPassive=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}return e.supportsPassive}dispatchEvent(e){const t=this,n=e.type,r=t.element.context,o=n.substring(0,1).toUpperCase()+n.substring(1);t.element.context=document,t.element["on"+o]?t.element["on"+o](e):t.element["on"+n.toLowerCase()]?t.element["on"+n.toLowerCase()](e):t.element.dispatchEvent(e),t.element.context=r}listen(e,t){const n=this,r=e.split("."),o=r.slice(1).join("."),i=r[0];n.events[i]||(n.events[i]=[]);const s={type:i,handler:t,context:n.element,namespace:o};p.indexOf(i)>=0&&(n.inputEvents||(n.inputEvents=new h(n.element)),n.inputEvents[i]((function(e){n.dispatchEvent(e)})),n.inputEvents.boundEventTypes.push(i),n.inputEvents.listen(i)),0===n.events[i].length&&(n.handlers[i]=n.dispatch.bind(n),"wheel"===i?n.element.addEventListener("wheel",n.handlers[i],!!n.isPassiveSupported&&{passive:!1}):"touchmove"===i||"touchstart"===i||"touchend"===i?n.element.addEventListener(i,n.handlers[i],!!n.isPassiveSupported&&{passive:!1}):n.element.addEventListener(i,n.handlers[i],!1)),n.events[i].push(s)}unlisten(e){const t=this,n=e.split("."),r=n.slice(1).join("."),o=n[0];let i=t.events[o];if(t.inputEvents&&t.inputEvents.boundEventTypes.indexOf(o)>=0&&(t.inputEvents.boundEventTypes.splice(t.inputEvents.boundEventTypes.indexOf(o),1),0===t.inputEvents.boundEventTypes.length&&t.inputEvents.unlisten(o)),i){for(let e=0;e<i.length;e++){if(""!==r){let e=i.findIndex((e=>e.namespace===r));i.splice(e,1);break}i=[]}0===i.length&&(t.element.removeEventListener(o,t.handlers[o]),t.events[o]=[],delete t.handlers[o])}}getAttributeValue(e,t){const n=this,r=n.element.getAttribute(e);if(n.isNativeElement)return n.deserialize(r,t);const o=n.element.propertyByAttributeName[e];return void 0===o.deserialize?n.deserialize(r,t,o.nullable):n.element[o.deserialize](r)}setAttributeValue(e,t,n){const r=this;let o,i=!1;if(r.isNativeElement){if(o=r.serialize(t,n),"boolean"===n&&["checked","selected","async","autofocus","autoplay","controls","defer","disabled","hidden","ismap","loop","multiple","open","readonly","required","scoped"].indexOf(e)>=0)return void(t?r.element.setAttribute(e,""):r.element.removeAttribute(e))}else{const s=r.element.propertyByAttributeName[e];i=!s||s.nullable,o=s&&s.serialize?r.element[s.serialize](t):r.serialize(t,n,i)}"array"!==n&&"object"!==n||"[]"!==o&&"{}"!==o?void 0===o?(r.element.removeAttribute(e),r.element.shadowRoot&&r.element.$.root&&r.element.$.root.removeAttribute(e)):(r.element.setAttribute(e,o),r.element.shadowRoot&&r.element.$.root&&r.element.$.root.setAttribute(e,o)):r.element.removeAttribute(e)}serialize(e,t,n){if(void 0===t&&(t=y.Types.getType(e)),void 0!==e&&(n||null!==e)){if(n&&null===e)return"null";if("string"===t)return e;if("boolean"===t||"bool"===t){if(!0===e||"true"===e||1===e||"1"===e)return"";if(!1===e||"false"===e||0===e||"0"===e)return}return"array"===t?JSON.stringify(e):["string","number","int","integer","float","date","any","function"].indexOf(t)>=0?e.toString():"object"===t?JSON.stringify(e):void 0}}deserialize(e,t,n){const r="null"===e;if(void 0!==e&&(!r||n)){if(r&&n)return null;if("boolean"===t||"bool"===t)return null!==e;if("number"===t||"float"===t)return"NaN"===e?NaN:"Infinity"===e?1/0:"-Infinity"===e?-1/0:parseFloat(e);if("int"===t||"integer"===t)return"NaN"===e?NaN:"Infinity"===e?1/0:"-Infinity"===e?-1/0:parseInt(e);if("string"===t)return e;if("any"===t)return e;if("date"===t)return new Date(e);if("function"===t){if("function"==typeof window[e])return window[e]}else if("array"===t||"object"===t)try{const t=JSON.parse(e);if(t)return t}catch(n){if(window[e]&&"object"==typeof window[e])return window[e];if("array"===t&&e.indexOf("[")>=0){if(e.indexOf("{")>=0){let t=e.replace(/{/gi,"").replace("[","").replace("]","").replace(/'/gi,"").replace(/"/gi,"").trim();t=t.split("},");for(let e=0;e<t.length;e++){let n={},r=t[e].trim().split(",");for(let e=0;e<r.length;e++){const t=r[e].split(":")[0].trim(),o=r[e].split(":")[1].trim();n[t]=o}t[e]=n}return t}return e.replace("[","").replace("]","").replace(/'/gi,"").replace(/"/gi,"").trim().split(",")}}}}}class g{static get Ripple(){return i}static get Easings(){return s}}class y{static get Types(){return o}static get Core(){return a}static get Animation(){return g}static get Scroll(){return m}static get InputEvents(){return h}static Extend(e){return new f(e)}static Assign(e,t){if(e.indexOf(".")>=0){const n=e.split(".");return y[n[0]]||(y[n[0]]={}),void(y[n[0]][n[1]]=t)}y[e]=t}}const w=y.Extend(document);let b=null;document.addEventListener("click",(()=>{d.start(),b&&clearTimeout(b),b=setTimeout((()=>{d.stop()}),1e4)})),document.addEventListener("mouseenter",(()=>{d.start()})),document.addEventListener("mouseleave",(()=>{d.stop()}));class v{}v.cache={};class _ extends HTMLElement{static get properties(){return{animation:{value:"advanced",type:"string",allowedValues:["none","simple","advanced"]},unfocusable:{value:!1,type:"boolean"},disabled:{value:!1,type:"boolean"},dataContext:{value:null,reflectToAttribute:!1,type:"any"},debugMode:{value:!0,type:"boolean",reflectToAttribute:!1},locale:{value:"en",type:"string",reflectToAttribute:!1},localizeFormatFunction:{value:null,type:"any",reflectToAttribute:!1},messages:{value:{en:{propertyUnknownName:"Invalid property name: '{{name}}'!",propertyUnknownType:"'{{name}}' property is with undefined 'type' member!",propertyInvalidValue:"Invalid '{{name}}' property value! Actual value: '{{actualValue}}', Expected value: '{{value}}'!",propertyInvalidValueType:"Invalid '{{name}}' property value type! Actual type: '{{actualType}}', Expected type: '{{type}}'!",methodInvalidValueType:"Invalid '{{name}}' method argument value type! Actual type: '{{actualType}}', Expected type: '{{type}}' for argument with index: '{{argumentIndex}}'!",methodInvalidArgumentsCount:"Invalid '{{name}}' method arguments count! Actual arguments count: '{{actualArgumentsCount}}', Expected at least: '{{argumentsCount}}' argument(s)!",methodInvalidReturnType:"Invalid '{{name}}' method return type! Actual type: '{{actualType}}', Expected type: '{{type}}'!",elementNotInDOM:"Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.",moduleUndefined:"Module is undefined.",missingReference:"{{elementType}}: Missing reference to '{{files}}'.",htmlTemplateNotSuported:"{{elementType}}: Web Browser doesn't support HTMLTemplate elements.",invalidTemplate:"{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM."}},reflectToAttribute:!1,inherit:!0,type:"object"},props:{value:null,reflectToAttribute:!1,isHierarchicalProperty:!0,type:"any"},readonly:{value:!1,type:"boolean"},renderMode:{value:"auto",type:"string",reflectToAttribute:!1,allowedValues:["auto","manual"]},rightToLeft:{value:!1,type:"boolean"},rethrowError:{value:!0,type:"boolean",reflectToAttribute:!1},theme:{value:window[n].Theme,type:"string"},visibility:{value:"visible",allowedValues:["visible","collapsed","hidden"],type:"string"},wait:{value:!1,type:"boolean"}}}getBindings(e,t){const n=this;let r=0,o={},i=(e=>{if(e instanceof HTMLElement)return n.parseAttributes(e);{let t=n.parseProperty(e.data?e.data.trim():null,"textContent",e);if(t)return n&&e.parentNode===n.$.content&&(t.value=""!==n.$.html?n.$.html:void 0,n.innerHTML=""),{textContent:t}}})(e);i&&(o.data=i),t||(o.mapping=[],t=o),e.getAttribute&&(o.nodeId=e.getAttribute("smart-id"),t&&i&&(t.mapping[o.nodeId]=i)),o.node=e,e.firstChild&&(o.children={});for(let i=e.firstChild;i;i=i.nextSibling)o.children[r++]=n.getBindings(i,t);return o}_addRemovePropertyBinding(e,t,n,r,o){if(!e||!t||!n)return;const i=this,s=i.bindings,a=n.getAttribute("smart-id"),l=e.indexOf("{{")>=0;let d=!1;(e=e.replace("{{","").replace("}}","").replace("[[","").replace("]]","")).indexOf("!")>=0&&(e=e.replace("!",""),d=!0);const c=i._properties[e],u={name:e,reflectToAttribute:c.reflectToAttribute,twoWay:l,type:c.type,not:d};if(o&&!r){const n={},r={name:e,targetPropertyName:t,reflectToAttribute:c.reflectToAttribute,twoWay:l,type:c.type,not:d};n[e]=r,s.mapping[a]=n}const p=function(e){for(let o in e){const s=e[o];if(s.nodeId===a){s.data||(s.data={}),r?(s.data[t]=null,delete s.data[t]):s.data[t]=u;break}if(s.children)p(s.children);else if(s.node&&s.node.children&&s.node===n.parentElement){const e=s.node;if(!e.firstChild)continue;s.children={};let t=0;for(let n=e.firstChild;n;n=n.nextSibling)s.children[t++]=i.getBindings(n);p(s.children)}}};p(s.children),r?delete i.boundProperties[e]:i.boundProperties[e]=!0,i.updateBoundNodes(e)}addPropertyBinding(e,t,n,r){this._addRemovePropertyBinding(e,t,n,!1,r)}removePropertyBinding(e,t,n,r){this._addRemovePropertyBinding(e,t,n,!0,r)}parseAttributes(e){const t=this;let n;for(let r=0;r<e.attributes.length;r++){const o=e.attributes[r],i=o.name,s=o.value;v.cache["toCamelCase"+i]||(v.cache["toCamelCase"+i]=y.Core.toCamelCase(i));const a=v.cache["toCamelCase"+i];if(i.indexOf("(")>=0){let r=i.substring(1,i.length-1);if(t&&!t.dataContext){t.templateListeners[e.getAttribute("smart-id")+"."+r]=s,e.removeAttribute(i);continue}{n||(n={});const e=s.substring(0,s.indexOf("("));n[a]={isEvent:!0,name:r,value:e};continue}}let l=t.parseProperty(s,i,e);l&&(n||(n={}),n[a]=l)}return n}parseProperty(e,t){if(!e||!e.length)return;const n=this;let r,o=e.length,i=0,s=0,a=0,l=!0;for(;s<o;){i=e.indexOf("{{",s);let t=e.indexOf("[[",s),n="}}";if(t>=0&&(i<0||t<i)&&(i=t,l=!1,n="]]"),a=i<0?-1:e.indexOf(n,i+2),a<0)return;r=r||{};let o=e.slice(i+2,a).trim();r.name=o,s=a+2}const d=r.name,c=n?n._properties[d]:null;return r.twoWay=l,r.ready=!1,n&&(d.indexOf("::")>=0?n.boundProperties[d.substring(0,d.indexOf("::"))]=!0:n.boundProperties[d]=!0),c?(r.type=c.type,r.reflectToAttribute=c.reflectToAttribute):(["checked","selected","async","autofocus","autoplay","controls","defer","disabled","hidden","ismap","loop","multiple","open","readonly","required","scoped"].indexOf(t)>=0?r.type="boolean":r.type="string",r.reflectToAttribute=!0),r}updateTextNodes(){const e=this;e.updateTextNode(e.shadowRoot||e,e.bindings,e)}updateTextNode(e,t,n){const r=this;if(!t)return;let o=0;for(let i=e.firstChild;i&&t.children;i=i.nextSibling)r.updateTextNode(i,t.children[o++],n);if(t&&t.data)for(let e in t.data){const r=t.data[e],o=r.name;"textContent"===e&&r.twoWay&&!r.updating&&void 0!==r.value&&(n[o]=r.value)}}updateBoundProperty(e,t){if(t.updating)return;const n=this;t.updating=!0,n[e]=t.value,t.updating=!1}updateBoundNodes(e){const t=this;if(t.updateBoundNode(t.shadowRoot||t,t.bindings,t,e),t.detachedChildren.length>0)for(let n=0;n<t.detachedChildren.length;n++){const r=t.detachedChildren[n],o=r.getAttribute("smart-id"),i=function(e){if(e.nodeId===o)return e;for(let t in e.children){const n=e.children[t];if((n.getAttribute?n.getAttribute("smart-id"):"")===o)return e;if(n.children){const e=i(n);if(e)return e}}return null},s=i(t.bindings);if(s)t.updateBoundNode(r,s,t,e,!0);else if(r.getAttribute&&t.bindings.mapping){const n=t,r=t.bindings;if(r)for(let o in r.mapping){const i=n.querySelector('[smart-id="'+o+'"]');if(i){const s=r.mapping[o];t.updateBoundData(i,s,n,e)}}}}}updateBoundMappedNodes(){const e=this,t=e.bindings,n=e;if(t.mapping)for(let r in t.mapping){let o=n.querySelector('[smart-id="'+r+'"]');if(n.shadowRoot&&(o=n.querySelector('[id="'+r+'"]'),o||(o=n.shadowRoot.querySelector('[id="'+r+'"]')||n.shadowRoot.querySelector('[smart-id="'+r+'"]'))),o){const i=t.mapping[r];e.updateBoundData(o,i,n)}else if(n.getAttribute("aria-controls")){let i=document.getElementById(n.getAttribute("aria-controls"));if(!i&&n.shadowRoot&&(i=n.shadowRoot.getElementById(n.getAttribute("aria-controls"))),o=i.querySelector('[smart-id="'+r+'"]'),o){const i=t.mapping[r];e.updateBoundData(o,i,n)}}}}updateBoundNode(e,t,n,r,o){const i=this;if(!t)return;let s=0;if(o){if(o&&!t.data)for(let a=e.firstChild;a&&t.children;a=a.nextSibling)if(a.getAttribute){const e=a.getAttribute("smart-id"),o=function(){for(let n in t.children)if(t.children[n].nodeId===e)return t.children[n]}();i.updateBoundNode(a,o,n,r),s++}else i.updateBoundNode(a,t.children[s++],n,r,o)}else for(let o=e.firstChild;o&&t.children;o=o.nextSibling)if(o.getAttribute){const e=o.getAttribute("smart-id"),a=function(){for(let n in t.children)if(t.children[n].nodeId===e)return t.children[n]}();i.updateBoundNode(o,a,n,r),s++}else i.updateBoundNode(o,t.children[s++],n,r);if(!t||!t.data)return;const a=t.data;i.updateBoundData(e,a,n,r)}updateBoundData(e,t,n,r){const o=this;for(let i in t){const s=t[i];let a=s.name;if(!s.updating&&(a.indexOf("::")>=0&&(a=a.substring(0,a.indexOf("::"))),void 0===r||r===a)){if(a.indexOf("(")>=0){let e=a.substring(a.indexOf("("));const t=a.substring(0,a.indexOf("("));if(e=e.substring(1,e.length-1),e=e.replace(/ /gi,""),e=e.split(","),e.length>0&&""!==e[0]){let r=[];for(let t=0;t<e.length;t++)r.push(n[e[t]]);s.value=n[t].apply(n,r)}else s.value=n[t]();s.type=typeof s.value}else s.value=n[a];if("innerHTML"===a){if(e[i].toString().trim()!==n[a].toString().trim()){if(window.smartBlazor&&e[i].indexOf("\x3c!--")>=0){(s.ready||n._properties[a].defaultValue!==s.value)&&(e[i]=s.value.toString());continue}(s.ready||n._properties[a].defaultValue!==s.value)&&(e[i]=s.value.toString().trim())}}else s.not?(e[i]=!s.value,s.targetPropertyName&&(e[s.targetPropertyName]=!s.value)):(e[i]=s.value,s.targetPropertyName&&(e[s.targetPropertyName]=s.value));if(e.$&&e.$.isNativeElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i],n=e.$.getAttributeValue(t,s.type);!s.reflectToAttribute||n===s.value&&s.ready||e.$.setAttributeValue(t,s.value,s.type),s.reflectToAttribute||e.$.setAttributeValue(t,null,s.type)}if(!s.ready){if(e.$&&e.$.isCustomElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i];e._properties||(e._beforeCreatedProperties=e._properties=e.propertyByAttributeName=[]),e._properties[i]||(e._properties[i]={attributeName:t},e._beforeCreatedProperties&&(e._beforeCreatedProperties[i]=e._properties[i]),e.propertyByAttributeName[t]=e._properties[i]);const n=e._properties[i];n.isUpdating=!0,s.reflectToAttribute&&(s.not?e.$.setAttributeValue(n.attributeName,!s.value,s.type):e.$.setAttributeValue(n.attributeName,s.value,s.type)),s.reflectToAttribute||e.$.setAttributeValue(n.attributeName,null,s.type),n.isUpdating=!1}if(s.twoWay){const t=function(t){if(s.value=t,e.$&&e.$.isNativeElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i],n=e.$.getAttributeValue(t,s.type);s.reflectToAttribute&&n!==s.value&&e.$.setAttributeValue(t,s.value,s.type),s.reflectToAttribute||e.$.setAttributeValue(t,null,s.type)}};if(s.name.indexOf("::")>=0){const n=s.name.indexOf("::"),r=s.name.substring(n+2);o["$"+e.getAttribute("smart-id")].listen(r,(function(){t(e[i]);const n=s.name.substring(0,s.name.indexOf("::"));o.updateBoundProperty(n,s)}))}if(e.$&&e.$.isCustomElement){e._properties[i]&&(e._properties[i].notify=!0),v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const n=v.cache["toDash"+i];o["$"+e.getAttribute("smart-id")].listen(n+"-changed",(function(e){let n=e.detail;t(n.value);const r=o.context;e.context!==document&&(o.context=o),o.updateBoundProperty(s.name,s),o.context=r}))}}}s.ready=!0}}}static clearCache(){this.cache={}}addMessages(e,t){Object.assign(this.messages[e],t)}localize(e,t){const n=this;if(!n.messages||!n.messages[n.locale])return;let r=n.messages[n.locale][e];if(""===r)return"";if(!r){const r=n.messages.en;if(r){let n=r[e];if(n){for(let e in t){let r=t[e];n=n.replace(new RegExp("{{"+e+"}}","g"),r)}return n}return e}}const o=r;for(let e in t){let n=t[e];r=r.replace(new RegExp("{{"+e+"}}","g"),n)}if(n.localizeFormatFunction){const i=n.localizeFormatFunction(o,r,t,e);if(void 0!==i)return i}return r}static get requires(){return{}}static get listeners(){return{"theme-changed":function(e){this.theme=e.detail.newValue}}}static get methods(){return{}}get classNamesMap(){return{animation:"smart-animate",rippleAnimation:"smart-ripple"}}get hasAnimation(){return"none"!==this.animation}get hasRippleAnimation(){return"none"!==this.animation&&"advanced"===this.animation}static get modules(){return window[n].Modules}get properties(){const e=this;return e._properties||(e._properties=[]),e._properties}get parents(){const e=this;let t=[],r=e.parentNode;for(;r&&9!==r.nodeType;)r instanceof HTMLElement==1&&t.push(r),r=r.parentNode;const o=e.getRootNode();if(o.host){const e=e=>{let t=[e],n=e.parentNode;for(;n&&9!==n.nodeType;)n instanceof HTMLElement==1&&t.push(n),n=n.parentNode;return t};t=t.concat(e(o.host))}return window[n].EnableShadowDOM&&e.isInShadowDOM&&e.shadowParent&&(t=t.concat(e.shadowParent.parents)),t}log(e){this._logger("log",e)}warn(e){this._logger("warn",e)}error(e){this._logger("error",e)}_logger(e,t){if(this.debugMode){const n=t instanceof Error?t.message:t.toString();console[e](n)}if(this.rethrowError&&"error"===e)throw t}get focused(){return this.contains(document.activeElement)}template(){return"<div></div>"}registered(){const e=this;e.onRegistered&&e.onRegistered()}created(){const e=this;e.isReady=!1,e._initElement(e),e._setModuleState("created"),e.onCreated&&e.onCreated()}completed(){const e=this;e.isCompleted=!0,e._onCompleted&&e._onCompleted(),e.onCompleted&&e.onCompleted()}whenReady(e){const t=this;t.isCompleted?e():(t.whenReadyCallbacks||(t.whenReadyCallbacks=[]),t.whenReadyCallbacks.push(e))}whenRendered(e){const t=this;t.isRendered?e():(t.whenRenderedCallbacks||(t.whenRenderedCallbacks=[]),t.whenRenderedCallbacks.push(e))}addThemeClass(){const e=this;""!==e.theme&&e.classList.add("smart-"+e.theme)}addDefaultClass(){const e=this;e.classList.add(n.toLowerCase()+"-element"),e.classList.add(e.nodeName.toLowerCase())}_renderShadowRoot(){const e=this;if(e.shadowRoot){e.$.root.classList.add(e.nodeName.toLowerCase());for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t];"class"===n.name||"id"===n.name||"style"===n.name||"tabindex"===n.name||n.name.indexOf("aria")>=0||e.$.root.setAttribute(n.name,n.value)}for(let t=0;t<e.classList.length;t++){const n=e.classList[t];"smart-element-init"!==n&&"smart-element"!==n&&"smart-hidden"!==n&&"smart-visibility-hidden"!==n&&e.$.root.classList.add(n)}}}render(){const e=this;if(!e.isRendered&&(e.isRendered=!0,e.isRendering=!1,e.context=document,e._renderShadowRoot(),e.whenRenderedCallbacks)){for(let t=0;t<e.whenRenderedCallbacks.length;t++)e.whenRenderedCallbacks[t]();e.whenRenderedCallbacks=[]}e.onRender&&e.onRender(),e.disabled&&e.setAttribute("aria-disabled",!0),e.readonly&&-1!==["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox"].indexOf(e.getAttribute("role"))&&e.setAttribute("aria-readonly",!0)}ready(){const e=this;if(e._setId(),e.addThemeClass(),e.addDefaultClass(),"collapsed"===e.visibility?e.classList.add("smart-hidden"):"hidden"===e.visibility&&e.classList.add("smart-visibility-hidden"),e.dataContext&&e.applyDataContext(),e.onReady&&e.onReady(),e.shadowRoot&&Smart(e._selector)){if(Smart(e._selector).styleUrls){const t=Smart(e._selector).styleUrls;for(let n=0;n<t.length;n++)e.importStyle(t[n])}if(Smart(e._selector).styles){const t=document.createElement("style");t.innerHTML=Smart(e._selector).styles,e.shadowRoot.insertBefore(t,e.shadowRoot.firstChild)}}Smart(e._selector)&&Smart(e._selector).ready&&Smart(e._selector).ready()}_setId(){const e=this;if(!e.id){const t=e.elementName;e.id=t.slice(0,1).toLowerCase()+t.slice(1)+Math.floor(65536*(1+Math.random())).toString(16).substring(1)}}checkLicense(){const e=this;"Evaluation"===window[n].License&&-1===window.location.hostname.indexOf("htmlelements")&&(e.logWatermark(),e.logLicense(),window[n].License="")}logWatermark(){const e=document.createElement("a");e.href="https://www.htmlelements.com/",e.innerHTML="https://www.htmlelements.com/",e.style.position="absolute",e.style.right="5px",e.style.bottom="5px",e.style.color="#fff",e.style.padding="20px",e.style.borderRadius="5px",e.style.background="#0C3D78",e.style.cursor="pointer",e.style.zIndex="999999",e.style.display="block",e.style.fontSize="24px",e.style.textDecoration="none",e.style.fontWeight="bold",e.style.opacity=0,e.style.transition="opacity .35s ease-in-out",e.id="watermark",document.getElementById("watermark")||setTimeout((()=>{document.getElementById("watermark")||(document.body.appendChild(e),setTimeout((()=>{e.style.opacity=1})),setTimeout((()=>{e.style.opacity=0,setTimeout((()=>{e.parentNode.removeChild(e)}),350)}),6e3))}),1e3)}logLicense(){console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("*jQWidgets License Key Not Found."),console.log("*This is an EVALUATION only Version, it is NOT Licensed for software projects intended for PRODUCTION."),console.log("*if you want to hide this message, please send an email to: sales@jqwidgets.com for a license."),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************")}get _selector(){const e=this;return e.id?"#"+e.id:e.classList.length>0?"."+e.classList[0]:""}applyDataContext(e){const t=this;let n="string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext;if(e&&(n=e,t.dataContext=e),n){if(!n._uid){n._uid=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase(),n._properties=[];for(let e in n){const r=n[e];"function"!=typeof r&&"_properties"!==e&&"_uid"!==e&&(n._properties[e]=r,Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:()=>n._properties[e],set(r){const o=n._properties[e];n._properties[e]=r;let i=[];i[e]={oldValue:o,value:r},i.length++,t.updatingDataContext=!0,w.fireEvent("dataContextPropertyChanged",{dataContext:n,properties:i},{bubbles:!1,cancelable:!0}),t.updatingDataContext=!1}}))}}if(t.dataContextProperties=t.parseAttributes(t),t.dataContextPropertiesMap={},t.dataContextListeners={},t.dataContextProperties){t.updatingDataContext=!0;for(let e in t.dataContextProperties){const r=t.dataContextProperties[e],o=r.name;if(r.propertyName=e,t.dataContextPropertiesMap[o]=e,v.cache["toDash"+e]||(v.cache["toDash"+e]=y.Core.toDash(o)),r.isEvent){const e=r.value;t.dataContextListeners[o]&&t.removeEventListener(o,t.dataContextListeners[o]),t.dataContextListeners[o]=function(t){n[e](t)},t.addEventListener(o,t.dataContextListeners[o])}if(o.indexOf(".")>=0){const r=o.split(".");let i=n[r[0]];for(let e=1;e<r.length;e++)i=i[r[e]];void 0!==i&&(t[e]=i)}else t[e]=n[o]}t.dataContextPropertyChangedHandler=function(e){const n=e.detail.properties;if(e.detail.dataContext===("string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext))for(let e in n){const r=t.dataContextPropertiesMap[e],o=t.context;r&&(t.context=document,t[r]=n[e].value,t.context=o)}},w.listen("dataContextPropertyChanged",t.dataContextPropertyChangedHandler),t.updatingDataContext=!1}else t.dataContextProperties=null}else{t.dataContextProperties=null;const e=function(){("string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext)&&(t.applyDataContext(),window.removeEventListener("load",e))};window.addEventListener("load",e)}}updateDataContextProperty(e){const t=this,n="string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext,r=t.dataContextProperties[e];if(!t.updatingDataContext&&r.twoWay){const o=r.name;if(o.indexOf(".")>=0){const r=o.split(".");let i=n[r[0]];for(let e=1;e<r.length;e++)i=i[r[e]];void 0!==i&&(i=t[e],c[n._uid]&&(c[n._uid][e]=i))}else n[o]=t[e],c[n._uid]&&(c[n._uid][e]=n[o])}}static get version(){return window[n].Version}initProperties(){const e=this;if(Smart(e._selector)&&Smart(e._selector).properties&&(e._initProperties=Smart(e._selector).properties),e.hasAttribute("props")&&!e.props?e._initProperties=window[e.getAttribute("props")]:e.props&&(e._initProperties=e.props),e._initProperties){const t=Object.keys(e._initProperties);for(let n=0;n<t.length;n++){const r=t[n],o=e._initProperties[r];if(void 0!==o){if(o.constructor===Smart.ObservableArray||o instanceof Smart.ObservableArray){e[r]=o.toArray();continue}if(o.constructor===Smart.DataAdapter||"smartDataAdapter"===o.constructor.name||"object"==typeof o&&Smart.DataAdapter&&o instanceof Smart.DataAdapter||o instanceof Smart.Observable||o.constructor===Smart.Observable||"object"!=typeof o||y.Types.isArray(o)||o instanceof Date){if(void 0===e[r]&&-1===["onReady","onAttached","onDetached","onCreated","onCompleted"].indexOf(r)){const t=e.localize("propertyUnknownName",{name:r});e.log(t)}e[r]=o;continue}}if("messages"!==r)if("dataSourceMap"!==r&&"rowCSSRules"!==r){if(o&&"object"==typeof o){const t=function(n,r){const o=Object.keys(n);for(let i=0;i<o.length;i++){const s=o[i],a=n[s],l=e._properties[r+"_"+s];if(l&&null===l.value){if(void 0===e[r+"_"+s]){const t=e.localize("propertyUnknownName",{name:r+"_"+s});e.log(t)}e[r+"_"+s]=a}else if("object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date)t(a,r+"_"+s);else{if(void 0===e[r+"_"+s]){const t=e.localize("propertyUnknownName",{name:r+"_"+s});e.log(t)}e[r+"_"+s]=a}}};t(o,r)}}else e[r]=o;else e[r]=Object.assign(e[r],o)}}}setProperties(e){const t=this,n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r],i=e[o];if(i.constructor===Smart.ObservableArray||i instanceof Smart.ObservableArray)t[o]=i.toArray();else if(i.constructor===Smart.DataAdapter||"smartDataAdapter"===i.constructor.name||"object"==typeof i&&Smart.DataAdapter&&i instanceof Smart.DataAdapter||i instanceof Smart.Observable||i.constructor===Smart.Observable||"object"!=typeof i||y.Types.isArray(i)||i instanceof Date){if(void 0===t[o]&&-1===["onReady","onAttached","onDetached","onCreated","onCompleted"].indexOf(o))continue;const e=t._properties[o];"int"===e.type||"number"===e.type&&"string"==typeof subPropertyValue?"int"===e.type?t[o]=parseInt(i):t[o]=parseFloat(i):t[o]=i}else if("messages"!==o&&"dataSourceMap"!==o){if("object"==typeof i){const e=function(n,r){const o=Object.keys(n);for(let i=0;i<o.length;i++){const s=o[i],a=n[s],l=t._properties[r+"_"+s];if(l&&null===l.value){if(void 0===t[r+"_"+s])continue;const e=t._properties[r+"_"+s];"int"===e.type||"number"===e.type&&"string"==typeof a?"int"===e.type?t[r+"_"+s]=parseInt(a):t[r+"_"+s]=parseFloat(a):t[r+"_"+s]=a}else if("object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date)e(a,r+"_"+s);else{if(void 0===t[r+"_"+s])continue;const e=t._properties[r+"_"+s];"int"===e.type||"number"===e.type&&"string"==typeof a?"int"===e.type?t[r+"_"+s]=parseInt(a):t[r+"_"+s]=parseFloat(a):t[r+"_"+s]=a}}};e(i,o)}}else t[o]=i}}setup(){const e=this;if(e.context=this,e.isReady&&!e.isCompleted)return;if(e.isReady)return e._setModuleState("attached"),e.isAttached=!0,e.attached(),e._handleListeners("listen"),void(e.context=document);e.ownerElement&&e.ownerElement.detachedChildren.indexOf(e)>=0&&e.ownerElement.detachedChildren.splice(e.ownerElement.detachedChildren.indexOf(e),1),e.isReady=!0,e.methods=e.getStaticMember("methods"),e.initProperties(),a.isMobile&&e.classList.add("smart-mobile");for(let t=0;t<e.attributes.length;t+=1){const n=e.propertyByAttributeName[e.attributes[t].name];if(!n)continue;let r=e.$.getAttributeValue(n.attributeName,n.type);const o=r?r.toString():"";if(!(o.indexOf("{{")>=0||o.indexOf("[[")>=0||"object"!==n.type&&"array"!==n.type&&(e.attributes[t].value.indexOf("{{")>=0||e.attributes[t].value.indexOf("[[")>=0)||void 0===r||n.value===r)){const o=y.Types.getType(r),i=e.attributes[t].value;if(("any"===n.type||"object"===n.type)&&""+e[n.name]===r)continue;if("array"===n.type&&e[n.name]&&JSON.stringify(e[n.name])===r)continue;if("number"===o&&isNaN(r)&&"NaN"!==i&&"Infinity"!==i&&"-Infinity"!==i){const t=e.localize("propertyInvalidValueType",{name:n.name,actualType:"string",type:n.type});e.log(t)}n.isUpdatingFromAttribute=!0,e[n.name]=r,n.isUpdatingFromAttribute=!1}}for(let t in e._properties){const n=e._properties[t];if("innerHTML"===t&&n.value===n.defaultValue&&(n.value=n.defaultValue=y.Core.html(e)),"boolean"!==n.type&&"bool"!==n.type||"false"===e.getAttribute(n.attributeName)&&(n.isUpdating=!0,e.setAttribute(n.attributeName,""),n.isUpdating=!1),n.defaultReflectToAttribute&&n.reflectToAttribute){if(n.defaultReflectToAttribute&&n.defaultReflectToAttributeConditions){let t=!0;for(let r=0;r<n.defaultReflectToAttributeConditions.length;r++){const o=n.defaultReflectToAttributeConditions[r];let i,s;for(let e in o)i=e,s=o[e];e._properties[i]&&e._properties[i].value!==s&&(t=!1)}if(!t)continue}n.isUpdating=!0,e.$.setAttributeValue(n.attributeName,n.value,n.type),n.isUpdating=!1}}const t=[];if(e.children.length>0)for(let n=0;n<e.children.length;n++){const r=e.children[n];y.Extend(r).isCustomElement&&t.push(r)}e.applyTemplate(),e.complete=function(){if(!e.templateBindingsReady){const t=e=>{e.templateBindingsReady||(e.templateBindingsReady=!0,e.updateTextNodes(),e.updateBoundNodes())};if(e.ownerElement){let n=e.ownerElement,r=[];for(;n;)r.push(n),n=n.ownerElement;for(let e=r.length-1;e>=0;e--)t(r[e]);t(e)}else t(e)}const t=()=>{if(e._setModuleState("ready"),e.ready(),"auto"!==e.renderMode||e.isRendered||e.render(),e.isAttached=!0,e._setModuleState("attached"),e.attached(),e._handleListeners("listen"),e.isHidden||0!==e.offsetWidth&&0!==e.offsetHeight||(e.isHidden=!0),e.completed(),e.isRendered&&(e.context=document),e.whenReadyCallbacks){for(let t=0;t<e.whenReadyCallbacks.length;t++)e.whenReadyCallbacks[t]();e.whenReadyCallbacks=[]}};if(e.wait)e.classList.add("smart-visibility-hidden");else if(e.classList.contains("smart-async"))requestAnimationFrame((()=>{t()}));else{const n=e.shadowParent;e.shadowParent=null;const r=e.parents;if(e.shadowParent=n,0===r.length)return;const o=()=>{let t=e.ownerElement,n=[];for(;t;)n.push(t),t=t.ownerElement;for(let e=n.length-1;e>=0;e--)n[e].updateBoundMappedNodes()};e.ownerElement&&"HTML"!==r[r.length-1].nodeName?e.getRootNode().host?t():e.ownerElement&&"HTML"===e.ownerElement.parents[e.ownerElement.parents.length-1].nodeName?(o(),t()):e.checkIsInDomInterval=setInterval((()=>{const n=e.parents;"HTML"===n[n.length-1].nodeName&&(clearInterval(e.checkIsInDomInterval),o(),t())}),100):t()}};let r=[].slice.call(e.querySelectorAll("[smart-id]")).concat(t);if(window[n].EnableShadowDOM&&!0!==e.isInShadowDOM&&(r=[].slice.call(e.shadowRoot.querySelectorAll("[smart-id]")).concat(t)),0===r.length)e.complete();else{e._completeListeners=0;for(let t=0;t<r.length;t++){const n=r[t];if(y.Extend(n).isCustomElement){const t=function(){e._completeListeners--,0===e._completeListeners&&(e.complete(),delete e._completeListeners)}.bind(e);n.isCompleted||n.isUtilityElement||!0===n.wait||(e._completeListeners++,n._onCompleted||(n.completeHandlers=[],n._onCompleted=function(){for(let e=0;e<n.completeHandlers.length;e++)n.completeHandlers[e]()}),n.completeHandlers.push(t))}}0===e._completeListeners&&e.complete()}}visibilityChangedHandler(){const e=this;e.isReady&&requestAnimationFrame((()=>{0===e.offsetWidth||0===e.offsetHeight?e.isHidden=!0:(e.isHidden=!1,e.$.fireEvent("resize",e,{bubbles:!1,cancelable:!0}))}))}attributeChangedCallback(e,t,n){const r=this,o=r.propertyByAttributeName[e];if("class"!==e&&"style"!==e||r.visibilityChangedHandler(),o||r.attributeChanged(e,t,n),r.onAttributeChanged&&r.onAttributeChanged(e,t,n),!o||o&&o.isUpdating)return;let i=r.$.getAttributeValue(o.attributeName,o.type);void 0!==n&&r[o.name]!==i&&(o.isUpdatingFromAttribute=!0,r[o.name]=void 0!==i?i:r._properties[o.name].defaultValue,o.isUpdatingFromAttribute=!1)}attributeChanged(e,t,n){}set hasStyleObserver(e){const t=this;void 0===t._hasStyleObserver&&(t._hasStyleObserver=e),e?d.watch(t):d.unwatch(t)}get hasStyleObserver(){const e=this;return void 0===e._hasStyleObserver||e._hasStyleObserver}attached(){const e=this;e.hasStyleObserver&&d.watch(e),e.onAttached&&e.onAttached(),Smart(e._selector)&&Smart(e._selector).attached&&Smart(e._selector).attached()}detached(){const e=this;e.hasStyleObserver&&d.unwatch(e),e._setModuleState("detached"),e.isAttached=!1,e.ownerElement&&-1===e.ownerElement.detachedChildren.indexOf(e)&&e.ownerElement.detachedChildren.push(e),e._handleListeners("unlisten"),e.onDetached&&e.onDetached(),Smart(e._selector)&&Smart(e._selector).detached&&Smart(e._selector).detached(),u&&u[e._selector]&&delete u[e._selector]}propertyChangedHandler(e,t,n){const r=this;t!==n&&("theme"===e&&(""!==t&&r.classList.remove("smart-"+t),""!==n&&r.classList.add("smart-"+n)),"visibility"===e?("collapsed"===t?r.classList.remove("smart-hidden"):"hidden"===t&&r.classList.remove("smart-visibility-hidden"),"collapsed"===n?r.classList.add("smart-hidden"):"hidden"===n&&r.classList.add("smart-visibility-hidden")):("disabled"===e||"readonly"===e)&&r._ariaPropertyChangedHandler(e,n),r.propertyChanged&&r.propertyChanged(e,t,n))}_ariaPropertyChangedHandler(e,t){const n=this;"readonly"===e&&-1===["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox"].indexOf(n.getAttribute("role"))||(t?n.setAttribute("aria-"+e,!0):n.removeAttribute("aria-"+e))}_handleListeners(e){const t=this,n=t.tagName.toLowerCase(),r=r=>{for(let o in r){const i=o.split(".");let s=i[0],a=t.$;if(i[1])if(s=i[1],a=t["$"+i[0]],"document"===i[0]){let e=t.smartId;""===e&&(e=y.Core.toCamelCase(n)),s=s+"."+e}else t.smartId&&(s=s+"."+t.smartId+"_"+t.parents.length);else t.smartId&&(s=s+"."+t.smartId);const l=r[o],d=function(e){const n=t.context;t.context=t,t[l]&&t[l].apply(t,[e]),t.context=n};a&&a[e](s,d)}};r(t.getStaticMember("listeners")),r(t.templateListeners),Smart(t._selector)&&Smart(t._selector).properties&&r(Smart(t._selector).listeners)}parseTemplate(){const e=this,n=e.template(),o=document.createDocumentFragment();if(t[e.nodeName]&&!r)return t[e.nodeName].cloneNode(!0);if(""===n)return null;let i=document.createElement("div");o.appendChild(i),i.innerHTML=n;let s=i.childNodes;i.parentNode.removeChild(i);for(let e=0;e<s.length;e++)o.appendChild(s[e]);return t[e.nodeName]=o,r?o:o.cloneNode(!0)}applyTemplate(){const e=this,t=e.parseTemplate();if(!t)return;if(!t.hasChildNodes)return;const n=t.childNodes[0],r=(t,n)=>{e["$"+t]=n.$=y.Extend(n),e.$[t]=n,n.ownerElement=e};let o=n;if(n.getElementsByTagName("content").length>0){let e=n.getElementsByTagName("content")[0];o=e.parentNode,o.removeChild(e)}else{const e=t.querySelectorAll("[inner-h-t-m-l]");e&&e.length>0&&(o=e[0])}e.$.template="template"===n.nodeName.toLowerCase()?n:n.querySelector("template");let i=t.querySelectorAll("[id]");0===i.length&&(i=t.querySelectorAll("*")),r("root",n),r("content",o),e.$.html=e.innerHTML.toString().trim();for(let t=0;t<i.length;t+=1){let n=i[t];""===n.id&&(n.id="child"+t),r(n.id,n),n.setAttribute("smart-id",n.id),e.shadowRoot?n.shadowParent=e:n.removeAttribute("id")}for(!1!==e.hasTemplateBindings?e.bindings=e.getBindings(t):e.bindings=[],e.$root.addClass("smart-container");e.childNodes.length;)o.appendChild(e.firstChild);if(e.appendTemplate(t),e.$.template){const t=document.createElement("div");t.classList.add("smart-template-container"),e.$.templateContainer=t,e.$.template.parentNode.insertBefore(t,e.$.template),e.refreshTemplate()}}refreshTemplate(){const e=this;if(!e.$.templateContainer)return;e.templateDetached(e.$.templateContainer);const t=e.$.template.content.cloneNode(!0);e.templateBindings=e.getBindings(t),e.templateProperties=[];let n=document.createDocumentFragment();const r=function(t,n,o){for(let i in t){const s=t[i],a=s.node.cloneNode();n.appendChild(a);let l=[],d=!1;if(s.data)for(let t in s.data){const r=s.data[t],i=r.name;if(e.templateProperties[i]=!0,a.removeAttribute(y.Core.toDash(t)),"*items"===t)l=e[i],d=!0;else if(i.indexOf("item.")>=0&&void 0!==o)r.value=o[i.substring("item.".length)],a[t]=r.value;else if(i.indexOf("item")>=0&&void 0!==o)r.value=o,a[t]=r.value;else if("*if"===t)if(i.indexOf("(")>=0){let t,r=i.substring(i.indexOf("("));const o=i.substring(0,i.indexOf("("));if(r=r.substring(1,r.length-1),r=r.replace(/ /gi,""),r=r.split(","),r.length>0&&""!==r[0]){let n=[];for(let t=0;t<r.length;t++)n.push(e[r[t]]);t=e[o].apply(e,n)}else t=e[o]();!1===t&&n.removeChild(a)}else e[i]||n.removeChild(a);else e.updateBoundNode(a,s,e,i)}if(l.length>0||d){for(let e=0;e<l.length;e++)s.children&&r(s.children,a,l[e]);if("number"==typeof l)for(let e=0;e<l;e++)s.children&&r(s.children,a,e)}else s.children&&r(s.children,a,o)}};r(e.templateBindings.children,n),e.$.templateContainer.innerHTML="",e.$.templateContainer.appendChild(n),e.templateAttached(e.$.templateContainer)}templateAttached(){}templateDetached(){}appendTemplate(e){this.appendChild(e)}defineElementModules(){const e=this,t=e.constructor.prototype;if("BaseElement"===t.elementName){t.modules=e.constructor.modules;const n=t.modules;for(let t=0;t<n.length;t+=1)e.addModule(n[t])}else{const n=t.modules;if(!n)return;for(let t=0;t<n.length;t+=1){const r=n[t],o=r.prototype;e.defineElementMethods(o.methodNames,o),e.defineElementProperties(r.properties)}}}watch(e,t){const n=this;n._watch=null!==e&&null!==t?{properties:e,propertyChangedCallback:t}:null}unwatch(){this._watch=null}set(e,t,n){const r=this,o=r.context;r.context=!0===n?document:r,r[e]=t,r.context=o}get(e){return this[e]}_setModuleState(e,t){const n=this,r="is"+e.substring(0,1).toUpperCase()+e.substring(1),o="on"+e.substring(0,1).toUpperCase()+e.substring(1);for(let i=0;i<n.modulesList.length;i++){const s=n.modulesList[i];s[r]=!0,s[e]&&s[e](t),s[o]&&s[o](t)}}addModule(e,t){const n=this;if(!e)return;const r=n.modules.slice(0),o=e.prototype,i=Object.getPrototypeOf(e);if(i.name&&i.name!==e.name&&n.addModule(i),!e.moduleName&&e.name&&(e.moduleName=e.name),-1===r.findIndex((t=>e.moduleName===t.moduleName))&&r.push(e),n.defineModule(e),n.defineElementMethods(o.methodNames,o),n.defineElementProperties(e.properties),n.constructor.prototype.modules=r,t)for(let t in Smart.Elements.tagNames){const r=Smart.Elements.tagNames[t];let o=Object.getPrototypeOf(r),i=[];for(;o!==HTMLElement;)i.push(o.prototype),o=Object.getPrototypeOf(o);i.indexOf(n)>=0&&r!==n&&r.prototype.addModule(e)}}defineModule(e){if(e.isDefined)return;e.prototype._initModule=function(e){this.ownerElement=e};const t=e.properties||{},n=Object.keys(t),r=Object.getOwnPropertyNames(e.prototype);e.prototype.methodNames=r;for(let r=0;r<n.length;r+=1){const o=n[r],i=t[o];Object.defineProperty(e.prototype,o,{configurable:!1,enumerable:!0,get(){return this.ownerElement?this.ownerElement[o]:i.value},set(e){this.ownerElement[o]=e}})}e.isDefined=!0}getStaticMember(e,t){const r=window[n][this.elementName],o=r[e];t||(t="");let i="array"===t?[]:"string"===t?"":{},s=Object.getPrototypeOf(r),a=[];for(;s[e];)a.push(s[e]),s=Object.getPrototypeOf(s);for(let e=a.length-1;e>=0;e--)if("array"===t)for(let t=0;t<a[e].length;t++)-1===i.indexOf(a[e][t])&&i.push(a[e][t]);else"string"===t?-1===i.indexOf(a[e])&&(i+=a[e]):i=y.Core.assign(i,a[e]);if("array"===t){for(let e=0;e<o.length;e++)-1===i.indexOf(o[e])&&i.push(o[e]);return i}return"string"===t?(-1===i.indexOf(o)&&(i+=o),i):y.Core.assign(i,o)}defineElementHierarchicalProperties(e,t){const n=this,r=[];!function(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const i=n[o];if("messages"===i)continue;const s=e[i],a=Object.keys(s),l=a.indexOf("value")>=0&&a.indexOf("type")>=0&&"object"==typeof s.value;if("propertyObject"===s.type||l){const e=function(n,o){if(!n.value)return;const i=Object.keys(n.value);for(let s=0;s<i.length;s++){const a=i[s],l=n.value[a],d=o+"_"+a;if("object"!=typeof l||null===l)break;const c=Object.keys(l);if(!(c.indexOf("value")>=0&&c.indexOf("type")>=0))break;if("array"!==n.type&&(n.isHierarchicalProperty=!0),l.parentPropertyName=o,t){const e=t._properties[d];if(n.value.hasOwnProperty(a)){if(e.isDefined)continue;delete n.value[a]}e.isDefined=!0,Object.defineProperty(n.value,a,{configurable:!1,enumerable:!0,get:()=>t._properties[d].value,set(e){t.updateProperty(t,t._properties[d],e)}})}r[d]||(r[d]=l,r.length++),("propertyObject"===l.type||"object"==typeof l.value&&"array"!==l.type)&&e(t?t._properties[d]:l,d)}};e(s,i)}}}(e),r.length>0&&!t&&n.defineElementProperties(r)}defineElement(){const e=this,t=e.constructor.prototype,n=e.getStaticMember("properties"),r=Object.getOwnPropertyNames(t);t.extendedProperties={},t.boundProperties={},t.templateListeners={},e.defineElementModules(),e.defineElementMethods(r,t),e.defineElementProperties(n),e.defineElementHierarchicalProperties(e.extendedProperties),t._initElement=function(){const e=this,n=t.extendedProperties,r=Object.keys(n),o=e.modules;e.$=y.Extend(e),e.$document=w,e.smartId=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase(),e.isCreated||(e.modulesList=[],e._properties=[],e._beforeCreatedProperties&&(e._properties=e._beforeCreatedProperties,delete e._beforeCreatedProperties),e.detachedChildren=[],e.propertyByAttributeName=[]);for(let t=0;t<o.length;t+=1){let n=new(0,o[t]);n._initModule(e),e.modulesList.push(n)}for(let t=0;t<r.length;t+=1){const o=r[t],i=n[o];let s=i.value;if(e._properties[o]){if(void 0!==e._properties[o].notify)continue;delete e._properties[o]}if(E&&"innerHTML"===o&&delete e[o],-1===window.navigator.userAgent.indexOf("PhantomJS")&&e.hasOwnProperty(o)&&(s=e[o],delete e[o]),"array"===i.type&&null!=s&&(s=s.slice(0)),"object"===i.type&&null!=s&&(s=Array.isArray(s)?s.slice(0):Object.assign({},s)),e._properties[o]={name:o,notify:i.notify,allowedValues:i.allowedValues,type:i.type,nullable:i.nullable,reflectToAttribute:i.reflectToAttribute,defaultReflectToAttribute:i.defaultReflectToAttribute,defaultReflectToAttributeConditions:i.defaultReflectToAttributeConditions,value:s,readOnly:i.readOnly,defaultValue:s,attributeName:i.attributeName,observer:i.observer,inherit:i.inherit,extend:i.extend,validator:i.validator},e.propertyByAttributeName[i.attributeName]=e._properties[o],!i.hasOwnProperty("type")){const t=e.localize("propertyUnknownType",{name:o});e.log(t)}if("any"===i.type||"propertyObject"===i.type)continue;const a=y.Types.getType(s);if(null!=s&&i.type!==a&&!i.validator){if("object"===i.type&&"array"===a)continue;if("number"===a&&["integer","int","float"].findIndex((e=>e===i.type))>=0)continue;const t=e.localize("propertyInvalidValueType",{name:o,actualType:a,type:i.type});e.log(t)}}e.defineElementHierarchicalProperties(e._properties,e),e.isCreated=!0},t.registered()}defineElementMethods(e,t){const n=this.constructor.prototype,r=function(e,t){const n=Array.prototype.slice.call(arguments,2),r=function(){if(!this.isReady&&"localize"!==t&&"localize"!==t&&"cloneNode"!==t&&"importStyle"!==t&&"log"!==t&&"parseAttributes"!==t){const e=this.localize("elementNotInDOM");this.log(e)}let r=this;for(let e=0;e<this.modulesList.length;e++){let n=this.modulesList[e];if(t in n){r=n;break}}const o=this.context,i=n.concat(Array.prototype.slice.call(arguments));let s=null;const a=function(e,t){return e===t||"number"===e&&("int"===t||"integer"===t||"float"===t)||"bool"===e&&"boolean"===t||"boolean"===e&&"bool"===t||"object"===e&&"any"===t||void 0};if(this.methods){const e=this.methods[t];if(e){const n=e.split(":");s=n[n.length-1].trim();const r=[],o=e.substring(1+e.indexOf("("),e.lastIndexOf(")")).split(",");let l="";for(let e=0;e<o.length;e++){const t=o[e];l+=t,t.indexOf(":")>=0?(r.push(l),l=""):l+=","}let d=r.length;for(let e=0;e<r.length;e++){const n=r[e].trim().split(":"),o=n[0].split("=")[0].trim().indexOf("?")>=0,s=n[1].indexOf("?")>=0,l=n[1].replace(/\?/gi,"").trim(),c=l.split("|");let u=n[0].split("=")[1];const p=y.Types.getType(i[e]);if(void 0===i[e]&&u){switch(u=u.trim(),l[0]){case"date":{let e=u.substring(u.indexOf("(")+1,u.lastIndexOf(")"));e=e.length>0?e.split(",").map((e=>parseInt(e))):[],u=0===e.length?new Date:new Date(e[0],e[1],e[2]);break}case"bool":case"boolean":u="true"===u||"1"===u;break;case"int":case"integer":u=parseInt(u);break;case"float":case"number":u=parseFloat(u);break;case"any":case"object":u=u.indexOf("{")>=0?JSON.parse(u):u}i.push(u)}else o&&d--;if(l!==p&&p){let n=!0;for(let e=0;e<c.length;e++)if(a(p,c[e])){n=!1;break}if(n&&(null!==i[e]||!s)){const n=this.localize("methodInvalidValueType",{name:t,actualType:p,type:l,argumentIndex:e});this.log(n)}}if(i.length<d){const e=this.localize("methodInvalidArgumentsCount",{name:t,actualArgumentsCount:i.length,argumentsCount:d});this.log(e)}}}}this.context=this;const l=e.apply(r,i);if(s){const e=void 0===y.Types.getType(l)?"void":y.Types.getType(l);if(!a(e,s)){const n=this.localize("methodInvalidReturnType",{name:t,actualType:e,type:s});this.log(n)}}return this.context=o,l};return r},o=["constructor","ready","created","render","attached","detached","appendChild","insertBefore","removeChild","connect","disconnectedCallback","connectedCallback","attributeChangedCallback","propertyChangedHandler","enableShadowDOM","isInShadowDOM","addPropertyBindings"];for(let i in e){let s=e[i];s&&s.startsWith&&s.startsWith("_")||void 0!==o.find((e=>e===s))||n.extendedProperties[s]||y.Types.isFunction(t[s])&&(n[s]=r(t[s],s))}}defineElementProperties(e){if(!e)return;const t=this,n=t.constructor.prototype,r=Object.keys(e),o=t.getStaticMember("properties");Object.assign(n.extendedProperties,e),t.updateProperty=function(e,t,n){const r=e;if(!t||t.readOnly)return;if(t.allowedValues){let e=!1;for(let r=0;r<t.allowedValues.length;r++)if(t.allowedValues[r]===n){e=!0;break}if(!e){const e=JSON.stringify(t.allowedValues).replace(/\[|\]/gi,"").replace(",",", ").replace(/"/gi,"'"),o="'"+n+"'",i=r.localize("propertyInvalidValue",{name:t.name,actualValue:o,value:e});return void r.log(i)}}const o=t.name,i=r._properties[o].value;if(t.validator&&r[t.validator]){const e=r.context;r.context=r;const o=r[t.validator](i,n);void 0!==o&&(n=o),r.context=e}if(i!==n){if(r.propertyChanging){const e=r.propertyChanging(o,i,n);if(!1===e||null===e)return}if(!t.hasOwnProperty("type")){const e=r.localize("propertyUnknownType",{name:o});r.log(e)}if("array"!==t.type||JSON.stringify(i)!==JSON.stringify(n)){if(null!=n&&"any"!==t.type&&"propertyObject"!==t.type&&t.type!==y.Types.getType(n)&&!t.validator||null===n&&!t.nullable){let e=!0;if("object"===t.type&&"array"===y.Types.getType(n)&&(e=!1),"number"===y.Types.getType(n)&&["integer","int","float"].findIndex((e=>e===t.type))>=0&&(e=!1),e){const e=r.localize("propertyInvalidValueType",{name:o,actualType:y.Types.getType(n),type:t.type});return void r.error(e)}}if(t.isUpdating=!0,t.isHierarchicalProperty){const e=function(t,n){if(!t)return;const o=Object.keys(t);for(let i=0;i<o.length;i++){const s=o[i],a=t[s];"object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date?e(a,n+"_"+s):r[n+"_"+s]=a}};e(n,o)}else r._properties[o].value=n;if(!t.isUpdatingFromAttribute&&t.reflectToAttribute&&r.$.setAttributeValue(t.attributeName,n,t.type),r.isReady&&(!r.ownerElement||r.ownerElement&&r.ownerElement.isReady)){if("wait"===o&&(n||!i||r.isCompleted||(r.classList.remove("smart-visibility-hidden"),r.ownerElement&&r.ownerElement.updateBoundMappedNodes(),r.updateBoundMappedNodes(),r.complete())),"renderMode"===o)return;if(r.context!==r&&!r.wait){const e=r.context;r.context=r,r.propertyChangedHandler(o,i,n),r.context=e,t.observer&&r[t.observer]&&(r.context=r,r[t.observer](i,n),r.context=document),r._watch&&r._watch.properties.indexOf(o)>=0&&r._watch.propertyChangedCallback(o,i,n)}const e=t.notify||r.boundProperties[o];e&&(r.$.fireEvent(t.attributeName+"-changed",{context:r.context,oldValue:i,value:r[o]}),r.boundProperties[o]&&r.updateBoundNodes(o)),e&&r.templateProperties&&r.templateProperties[o]&&r.refreshTemplate(),r.dataContextProperties&&("dataContext"===o?r.applyDataContext():r.dataContextProperties[o]&&r.updateDataContextProperty(o))}t.isUpdating=!1}}};for(let t=0;t<r.length;t+=1){const i=r[t],s=e[i],a=y.Core.toDash(i),l=s.type||"any",d=l.indexOf("?")>=0||"any"===l;d&&"any"!==l&&(s.type=l.substring(0,l.length-1)),s.nullable=d,s.attributeName=a.toLowerCase(),s.name=i,s.reflectToAttribute=void 0===s.reflectToAttribute||s.reflectToAttribute,s.inherit&&o[i]&&(s.value=o[i].value),s.extend&&o[i]&&y.Core.assign(s.value,o[i].value),n.hasOwnProperty(i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get(){if(this._properties[i])return this._properties[i].value},set(e){const t=this;t.updateProperty(t,t._properties[i],e)}})}}}let C=[],S=[],x=[],E=!1;const A=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);A&&parseInt(A[2],10)<=50&&(E=!0);class T{static register(e,t){const r=t.prototype;let o=a.toCamelCase(e).replace(/[a-z]+/,""),i=t.version||window[n].Version;if(window.customElements.get(e)&&window.customElements.get(e).version===i)return;let s=e;for(i=i.split(".");window.customElements.get(e);)e=s+"-"+i.join("."),i[2]=parseInt(i[2])+1;if(!C[e]){if(e.startsWith(n.toLowerCase()))C[e]=window[n][o]=window[n.toLowerCase()+o]=t;else{let r=e.split("-")[0];r=r.substring(0,1).toUpperCase()+r.substring(1),window[n][r]||(window[n][r]={}),C[e]=window[n][r][o]=window[r.toLowerCase()+o]=t,window[n][o]&&(o=a.toCamelCase(e)),window[n][o]=t}r.elementName=o,r.defineElement(),S[e]&&S[e](r),window.customElements.define(e,t)}}static registerElements(){const e=this;if(e.toRegister){e.isRegistering=!0;for(let t=0;t<e.toRegister.length;t++){const n=e.toRegister[t];e.register(n.tagName,n.element)}e.isRegistering=!1}}static get(e){if(C[e])return C[e]}static whenRegistered(e,t){if(!e)throw new Error("Syntax Error: Invalid tag name");const n=S[e],r=this.get(e),o=r?r.modules.length:3;try{n||r?!n&&r?(t(r.prototype),S[e]=void 0):n&&!r?S[e]=function(e){n(e),t(e)}:n&&r&&(r.proto&&(n(r.proto),t(r.proto)),S[e]=void 0):S[e]=function(e){try{t(e)}catch(e){const t=e instanceof Error?e.message:e.toString();console.log(t)}}}catch(e){const t=e instanceof Error?e.message:e.toString();console.log(t)}if(r&&o!==r.prototype.modules.length){const t=document.querySelectorAll(e);for(let e=0;e<t.length;e++){const n=t[e];n.isCreated&&n._initElement()}}}}T.lazyRegister=!1,T.tagNames=[];class P{constructor(){const e=this;e.name="observableArray",e.observables=arguments.length<3?null:arguments[2];const t=new Proxy(e,{deleteProperty:function(e,t){return delete e[t],!0},apply:function(e,t,n){return e.apply(t,n)},get:function(t,n){return t[n]||isNaN(parseInt(n))?t[n]:e.getItem(parseInt(n))},set:function(t,n,r){return t[n]||isNaN(parseInt(n))?(t[n]=r,!0):(e.setItem(parseInt(n),r),!0)}});if(e._addArgs={eventName:"change",object:t,action:"add",index:null,removed:new Array,addedCount:1},e._removeArgs={eventName:"change",object:t,action:"remove",index:null,removed:null,addedCount:0},arguments.length>=1&&Array.isArray(arguments[0])){e._array=[];const t=arguments[0];for(let n=0,r=t.length;n<r;n++){const r=e._getItem(e._array.length,t[n]);e._array.push(r)}}else e._array=Array.apply(null,arguments);return 2===arguments.length&&(e.notifyFn=arguments[1]),t}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;t.canNotify&&t.notifyFn&&t.notifyFn(e)}notify(e){e&&(this.notifyFn=e)}toArray(){return this._array}_getItem(e,t){const n=this;return"string"==typeof t||"number"==typeof t||void 0===t?t:new Proxy(t,{deleteProperty:function(e,t){return delete e[t],!0},set:function(t,r,o){const i=t[r];return t[r]=o,!n._canNotify||!1===t.canNotify||(n.observables&&!n.observables[r]||n._notify({eventName:"change",object:n,target:t,action:"update",index:e,path:e+"."+r,oldValue:i,newValue:o,propertyName:r}),!0)}})}getItem(e){return this._array[e]}setItem(e,t){const n=this,r=n._array[e];n._array[e]=n._getItem(e,t),n._notify({eventName:"change",object:n._array,action:"update",index:e,removed:[r],addedCount:1})}get length(){return this._array.length}set length(e){const t=this;o.isNumber(e)&&t._array&&t._array.length!==e&&t.splice(e,t._array.length-e)}toString(){return this._array.toString()}toLocaleString(){return this._array.toLocaleString()}concat(){const e=this;e._addArgs.index=e._array.length;const t=e._array.concat.apply(e._array,arguments);return new Smart.ObservableArray(t)}join(e){return this._array.join(e)}pop(){const e=this;e._removeArgs.index=e._array.length-1,delete e[e._array.length-1];const t=e._array.pop();return e._removeArgs.removed=[t],e._notify(e._removeArgs),e._notifyLengthChange(),t}push(){const e=this;if(e._addArgs.index=e._array.length,1===arguments.length&&Array.isArray(arguments[0])){const t=arguments[0];for(let n=0,r=t.length;n<r;n++){const r=e._getItem(e._array.length,t[n]);e._array.push(r)}}else{const t=e._getItem(e._addArgs.index,arguments[0]);e._array.push.apply(e._array,[t])}return e._addArgs.addedCount=e._array.length-e._addArgs.index,e._notify(e._addArgs),e._notifyLengthChange(),e._array.length}_notifyLengthChange(){const e=this;if(!e.canNotify)return;const t=e._createPropertyChangeData("length",e._array.length);e._notify(t)}_createPropertyChangeData(e,t,n){return{eventName:"change",object:this,action:e,value:t,oldValue:n}}reverse(){return this._array.reverse()}shift(){const e=this,t=e._array.shift();return e._removeArgs.index=0,e._removeArgs.removed=[t],e._notify(e._removeArgs),e._notifyLengthChange(),t}slice(e,t){return this._array.slice(e,t)}sort(e){return this._array.sort(e)}splice(e,t,n){const r=this,o=r._array.length;let i;if(n&&n.length)for(let o=0;o<n.length;o++)i=r._array.splice(e+o,t,n[o]);else i=r._array.splice.apply(r._array,arguments);if(n){let t=r.canNotify;if(r.canNotify=!1,n.length)for(let t=0;t<n.length;t++)r.setItem(e+t,n[t]);else r.setItem(e,n);r.canNotify=t,r._notify({eventName:"change",object:this,action:"add",index:e,added:i,addedCount:r._array.length>o?r._array.length-o:0})}else r._notify({eventName:"change",object:this,action:"remove",index:e,removed:i,addedCount:r._array.length>o?r._array.length-o:0});return r._array.length!==o&&r._notifyLengthChange(),i}unshift(){const e=this,t=e._array.length,n=e._array.unshift.apply(e._array,arguments);return e._addArgs.index=0,e._addArgs.addedCount=n-t,e._notify(this._addArgs),e._notifyLengthChange(),n}indexOf(e,t){const n=this;for(let r=t||0,o=n._array.length;r<o;r++)if(n._array[r]===e)return r;return-1}lastIndexOf(e,t){const n=this;for(let r=t||n._array.length-1;r>=0;r--)if(n._array[r]===e)return r;return-1}find(e,t){return this._array.find(e,t)}findIndex(e,t){return this._array.findIndex(e,t)}every(e,t){return this._array.every(e,t)}some(e,t){return this._array.some(e,t)}forEach(e,t){this._array.forEach(e,t)}map(e,t){return this._array.map(e,t)}filter(e,t){return this._array.filter(e,t)}reduce(e,t){return void 0!==t?this._array.reduce(e,t):this._array.reduce(e)}reduceRight(e,t){return void 0!==t?this._array.reduceRight(e,t):this._array.reduceRight(e)}move(e,t){this.splice(t,0,this.splice(e,1)[0])}}let D={};window[n]&&(D=window[n]),window[n]=function(e,t){let r=e;if(e){if(e.indexOf("#")>=0||e.indexOf(".")>=0)return u[e]?u[e]:t?(u[e]=new t,function(e,t){const n=t.properties;t._properties=[];const r=function(n,o){const i=Object.keys(n);for(let s=0;s<i.length;s++){const a=i[s],l=n[a];t._properties[o+a]=l,Array.isArray(l)?t._properties[o+a]=new P(l,(function(t){const n=a+"."+t.path,r=t.newValue,o=document.querySelector(e);if(o){const e=n.split(".");let t=o;for(let n=0;n<e.length;n++)t=t[e[n]];t=r}})):(Object.defineProperty(n,a,{configurable:!1,enumerable:!0,get:()=>t._properties[o+a],set(e){t._properties[o+a]=e}}),l&&"DataAdapter"===l.constructor.name||l&&"object"==typeof l&&Smart.DataAdapter&&l instanceof Smart.DataAdapter||"object"==typeof l&&l&&Object.keys(l).length>0&&r(l,o+a+"."))}};r(n,""),Object.defineProperty(t,"properties",{configurable:!1,enumerable:!0,get:()=>n});const o=document.querySelector(e);if(o&&o.isReady)for(let e in n)o[e]=n[e];else if(o){o.props={};for(let e in n)o.props[e]=n[e]}}(e,u[e]),u[e]):void 0;if(t){if(T.tagNames[e]=t,T.lazyRegister){T.toRegister||(T.toRegister=[]);const e=a.toCamelCase(r).replace(/[a-z]+/,"");return window[n][e]=t,void T.toRegister.push({tagName:r,element:t})}T.register(r,t)}}},window.addEventListener("load",(function(){const e=window[n].Elements.tagNames;let t=[];for(let r in e){const o=e[r];let i=document.querySelectorAll("["+r+"]");for(let e=0;e<i.length;e++){const t=i[e];t instanceof HTMLDivElement&&(t.__proto__=o.prototype,t.created(),t.connectedCallback()),t.classList.add("smart-element-ready")}let s=o.name;"Item"===s&&(s="ListItem"),i=document.querySelectorAll('[is="'+n.toLocaleLowerCase()+s+'"]');for(let e=0;e<i.length;e++)t.push(i[e])}if(t.length>0){const e=e=>{let t=[],n=e.parentNode;for(;n&&9!==n.nodeType;)n instanceof HTMLElement==1&&t.push(n),n=n.parentNode;return t};t.sort((function(t,n){let r=e(t).length,o=e(n).length;return r<o?1:r>o?-1:0}));for(let e=0;e<t.length;e++){const n=t[e],r=n.getAttribute("is");let o;o="smartItem"===r?new window.smartListItem(n):new window[r](n),o.removeAttribute("is")}}}));const L=function(){if("complete"===document.readyState&&"manual"!==window[n].RenderMode){x.sort((function(e,t){let n=e.element.parents.length,r=t.element.parents.length;return n<r?-1:n>r?1:0}));for(let e=0;e<x.length;e++)window[n].RenderMode="",x[e].element.isLoading=!1,x[e].callback(),window[n].RenderMode="";x=[],document.removeEventListener("readystatechange",L)}};Object.assign(window[n],{Elements:T,Modules:[],BaseElement:class extends _{static get observedAttributes(){let e=this,t=["external-style"];for(let n in e.prototype.extendedProperties){const r=e.prototype.extendedProperties[n];t.push(r.attributeName)}return t}static get styleUrls(){return[]}static get styles(){return""}get styleUrl(){return this._styleUrl}set styleUrl(e){this._styleUrl=e}get isInShadowDOM(){const e=this,t=e.getRootNode();return!e.hasAttribute("smart-blazor")&&t!==document&&t!==e}getShadowRootOrBody(){const e=this;return e.isInShadowDOM&&e.getRootNode().host?e.getRootNode().host.shadowRoot:document.body}get enableShadowDOM(){return window[n].EnableShadowDOM}importStyle(e,t){this._importStyle(e,t)}_importStyle(e,t){const n=this;if(!n.shadowRoot||!e)return;const r=e=>{const r=n.shadowRoot.children;for(let n=0;n<r.length;n++){const o=r[n];if(o instanceof HTMLLinkElement&&o.href===e)return t&&t(),null}const o=document.createElement("link");return o.rel="stylesheet",o.type="text/css",o.href=e,o.onload=t,o},o=(()=>{const e=n.shadowRoot.children;let t=null;for(let n=0;n<e.length;n++){const r=e[n];r instanceof HTMLLinkElement&&(t=r)}return t})(),i=(e,t)=>{t.parentNode.insertBefore(e,t.nextSibling)};if(Array.isArray(e)){const t=document.createDocumentFragment();for(let n=0;n<e.length;n++){const o=r(e[n]);o&&t.appendChild(o)}o?i(t,o):n.shadowRoot.insertBefore(t,n.shadowRoot.firstChild)}else{const t=r(e);if(!t)return;o?i(t,o):n.shadowRoot.insertBefore(t,n.shadowRoot.firstChild)}}attributeChanged(e,t,n){"style-url"===e&&(this.styleUrl=n)}attributeChangedCallback(e,t,n){this.isReady&&super.attributeChangedCallback(e,t,n)}constructor(e,t){super();const n=this;if(e){t&&(n._initProperties=t);const r=e=>{if("string"==typeof e?document.querySelector(e):e){const r="string"==typeof e?document.querySelector(e):e;if(r instanceof HTMLDivElement){const o=document.createElement(n.tagName);for(let e of r.attributes)o.setAttribute(e.name,r.getAttribute(e.name));for(;r.childNodes.length;)o.appendChild(r.firstChild);return"string"==typeof e&&(o.id=e.substring(1)),o._initProperties=t,r.parentNode&&r.parentNode.replaceChild(o,r),o}if(t){const e=r.context;if(r._initProperties=t,r.isReady){r.context=r;const n={},o={};for(let e in t)n[e]=r[e],o[e]=t[e];Object.getOwnPropertyNames(t).length>0&&(r.initProperties(),r.propertyChangedHandler(t,n,o)),r.context=e}}return r}};if("string"==typeof e){const t=document.querySelectorAll(e),n=[];if(t.length>1){for(let e=0;e<t.length;e++){const o=r(t[e]);n.push(o)}return n}}else if(e&&e.length>0){const t=e;if(t.length>1){for(let e=0;e<t.length;e++){const n=r(t[e]);C.push(n)}return C}}return r(e)}n._styleUrl="",n.isUtilityElement||n.created()}_getRootShadowParent(){let e=this.shadowParent;for(;e;){if(!e.shadowParent)return e;e=e.shadowParent}return e||this.shadowParent}_getStyleUrl(e){let t=y.Core.getScriptLocation()+window[n].StyleBaseUrl+e;return this.shadowParent&&(t=t.replace("scoped/","")),t}_getStyleUrls(){const e=this;e.nodeName.startsWith(n);const t=e.getStaticMember("styleUrls","array"),r=[];for(let n=0;n<t.length;n++){const o=t[n],i=e._getStyleUrl(o);r.push(i)}return r}_setupShadowRoot(){const e=this;e.classList.add("smart-element-init");const t=t=>{t.$.root&&(t.$.root.classList.add(n.toLowerCase()+"-element"),t.$.root.classList.add(e.nodeName.toLowerCase())),t.setup(),t.classList.remove("smart-element-init")};if(document.adoptedStyleSheets)if(window[n].AdoptedStyleSheets)window[n].AdoptedStyleSheetsLoaded?(e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets,t(e)):(e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets,window[n].AdoptedStyleSheetsLoadedQueue||(window[n].AdoptedStyleSheetsLoadedQueue=[]),window[n].AdoptedStyleSheetsLoadedQueue.push(e));else{const r=new CSSStyleSheet;let o=y.Core.getScriptLocation()+"/styles/smart.default.css";r.replace('@import url("'+o+'")').then((()=>{if(t(e),window[n].AdoptedStyleSheetsLoaded=!0,window[n].AdoptedStyleSheetsLoadedQueue){const e=window[n].AdoptedStyleSheetsLoadedQueue;for(let n=0;n<e.length;n++){const r=e[n];t(r)}delete window[n].AdoptedStyleSheetsLoadedQueue}})).catch((e=>{console.error("Failed to load:",e)})),window[n].AdoptedStyleSheets=[r],document.adoptedStyleSheets=[r],e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets}}connect(){const e=this;window[n].EnableShadowDOM&&!e.shadowRoot&&!0!==e.isInShadowDOM&&(e.attachShadow({mode:"open"}),e.shadowRoot&&e.$.root&&(e.shadowRoot.appendChild(e.$.root),e.$.root.classList.add(e.nodeName.toLowerCase()))),e.shadowRoot||e.shadowParent?e.shadowRoot?e._setupShadowRoot():(e.shadowParent&&window[n].EnableShadowDOM,e.setup()):e.setup()}connectedCallback(){const e=this;if(e.isLoading||e.isUtilityElement)return;e.classList.add("smart-element-init");const t=function(){e.classList.remove("smart-element-init")};if("complete"===document.readyState&&(void 0===window[n].isAngular&&(window[n].isAngular=null!==document.body.querySelector("[ng-version]")),window[n].isAngular))for(let t=0;t<e.parents.length&&!e.parents[t].nodeName.toLowerCase().startsWith(n.toLowerCase()+"-");t++)if(e.parents[t].hasAttribute("ng-version")&&!e.classList.contains("smart-angular")){window[n].RenderMode="manual";break}if("complete"===document.readyState&&"manual"!==window[n].RenderMode){const n=e.parents;n.length&&"HTML"===n[n.length-1].nodeName||e.getRootNode().host?(e.checkIsInDomTimer&&clearInterval(e.checkIsInDomTimer),t(),e.connect()):(e.checkIsInDomTimer&&clearInterval(e.checkIsInDomTimer),n.length>0&&(e.checkIsInDomTimer=setInterval((()=>{const n=e.parents;0===n.length&&clearInterval(e.checkIsInDomTimer),n.length>0&&"HTML"===n[n.length-1].nodeName&&(clearInterval(e.checkIsInDomTimer),t(),e.connect())}),100)))}else e.isLoading=!0,x.push({element:this,callback:function(){this.isReady||(t(),this.connect())}.bind(e)})}disconnectedCallback(){const e=this;e.isAttached?(e.shadowParent=null,e.detached()):e._resetShadowParent()}adoptedCallback(){this.setup()}appendTemplate(e){const t=this;t.shadowRoot?t.shadowRoot.appendChild(e):t.appendChild(e)}_resetShadowParent(){const e=this;if(!window[n].EnableShadowDOM||null===e.shadowParent)return;const t=[];let r=e.parentNode;for(;r&&9!==r.nodeType;){if(r instanceof HTMLElement==1)t.push(r);else if(11===r.nodeType&&r.host){r=r.host;continue}r=r.parentNode}for(let n=0;n<t.length;n++)if(t[n]===e.shadowParent)return;t.length>0&&"HTML"===t[t.length-1].nodeName&&(e.shadowParent=null)}},Utilities:y,Import:function(e,t){let n=0;const r=function(e,t){return new Promise((n=>{const r=document.createElement("script");r.src=e,r.onload=n;for(let e=0;e<document.head.children.length;e++){const r=document.head.children[e];if(r.src&&r.src.toString().indexOf(t)>=0)return void n()}document.head.appendChild(r)}))};return new Promise((o=>{const i=y.Core.getScriptLocation(),s=function(t){if(!e[t])return;const a=i+"/"+e[t];r(a,e[t]).then((function(){n++,n===e.length&&o(),s(t+1)}))};if(t)for(let t=0;t<e.length;t++){const s=i+"/"+e[t];r(s,e[t]).then((function(){n++,n===e.length&&o()}))}else s(0)}))},ObservableArray:P,Observable:class{constructor(e,t){const n=this;var r;return this.name="observable",e&&Object.assign(n,e),r=e,Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((e=>"constructor"===e||!!e.startsWith("_")||void(n[e]=r[e]))),new Proxy(n,{deleteProperty:function(e,t){return delete e[t],!0},get:function(e,t){return e[t]},set:function(e,r,o){const i=e[r];return i===o||(e[r]=o,!("notifyFn"!==r&&!r.startsWith("_")&&"canNotify"!==r&&(!t||-1!==t.indexOf(r))&&n.canNotify&&(n._notify({target:e,propertyName:r,oldValue:i,newValue:o}),0)))}})}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;if(t.canNotify&&t.notifyFn)for(let n=0;n<t.notifyFn.length;n++)t.notifyFn[n](e)}notify(e){const t=this;e&&(t.notifyFn||(t.notifyFn=[]),t.notifyFn.push(e))}},Component:class{constructor(e,t){const n=this.name;let r=null;return e?r=new window[n](e,t):(r=new window[n],r._initProperties=t),this._element=r,r}get name(){return"Component"}get element(){return this._element}},Theme:D.Theme||"",EnableShadowDOM:D.ShadowDom||!1,BaseUrl:"./",StyleBaseUrl:"/styles/default/",Version:e,Templates:t,RenderMode:D.RenderMode||"auto",Render:function(){const e=()=>{window[n].RenderMode="",L()};"complete"===document.readyState?e():(window.removeEventListener("load",e),window.addEventListener("load",e))},Data:u,Mode:D.Mode||"production",License:"Evaluation"});let O=window[n].Theme;"manual"!==window[n].RenderMode&&document.addEventListener("readystatechange",L),Object.defineProperty(window[n],"Theme",{configurable:!1,enumerable:!0,get:()=>O,set(e){const t=O;O=e,w.fireEvent("theme-changed",{oldValue:t,newValue:e},{bubbles:!0,cancelable:!0})}}),window[n]("smart-base-element",window[n].BaseElement),window[n]("smart-content-element",class extends window[n].BaseElement{static get properties(){return{content:{type:"any",reflectToAttribute:!1},innerHTML:{type:"string",reflectToAttribute:!1}}}template(){return"<div inner-h-t-m-l='[[innerHTML]]'></div>"}ready(){super.ready(),this.applyContent()}refresh(){}clearContent(){const e=this;for(;e.$.content.firstChild;)e.$.content.removeChild(e.$.content.firstChild)}applyContent(){const e=this;if(void 0===e.content)return void(e.content=e.$.content);if(""===e.content||null===e.content)return void e.clearContent();if(e.content instanceof HTMLElement)return e.clearContent(),void e.$.content.appendChild(e.content);const t=document.createDocumentFragment();let n=document.createElement("div");t.appendChild(n),e.content instanceof HTMLElement?n.appendChild(e.content):n.innerHTML=e.content;let r=Array.from(n.childNodes);n.parentNode.removeChild(n);for(let e=0;e<r.length;e++)t.appendChild(r[e]);e.clearContent(),e.$.content.appendChild(t)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const r=this;t!==n&&("innerHTML"===e&&(r.content=n,r.applyContent(),r.innerHTML=r.content=y.Core.html(r.$.content)),"content"===e&&r.applyContent())}}),window[n]("smart-scroll-viewer",class extends window[n].ContentElement{static get properties(){return{autoRefresh:{type:"boolean",value:!1},horizontalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},touchScrollRatio:{type:"any",value:null},touchVelocityCoefficient:{type:"number",value:50},verticalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]}}}static get listeners(){return{touchmove:"_touchmoveHandler",touchstart:"_touchstartHandler",wheel:"_mouseWheelHandler","document.up":"_upHandler"}}static get styleUrls(){return["smart.scrollviewer.css"]}template(){return'<div id="container" class="smart-container" role="presentation">\n <div id="scrollViewerContainer" class="smart-scroll-viewer-container" role="presentation">\n <div id="scrollViewerContentContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="smart-scroll-viewer-content-container" role="presentation">\n <content></content>\n </div>\n </div>\n <smart-scroll-bar id="verticalScrollBar" theme="[[theme]]" animation="[[animation]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]" orientation="vertical"></smart-scroll-bar>\n <smart-scroll-bar id="horizontalScrollBar" theme="[[theme]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]"></smart-scroll-bar>\n </div>'}appendChild(e){const t=this;if(e){if(!t.isCompleted||e.classList&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.$.scrollViewerContentContainer.appendChild(e)}}removeChild(e){const t=this;if(e){if(!t.isCompleted||e.classList&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.$.scrollViewerContentContainer.removeChild(e)}}removeAll(){const e=this;e.isCompleted&&(e.$.scrollViewerContentContainer.innerHTML="")}_horizontalScrollbarHandler(e){const t=this;t.$.scrollViewerContentContainer.style.left=(t.rightToLeft?1:-1)*t.scrollLeft+"px",e.stopPropagation&&e.stopPropagation(),t.onHorizontalChange&&t.onHorizontalChange(e)}_verticalScrollbarHandler(e){const t=this;t.$.scrollViewerContentContainer.style.top=-t.scrollTop+"px",e.stopPropagation&&e.stopPropagation(),t.onVerticalChange&&t.onVerticalChange(e)}_touchmoveHandler(e){const t=this;if(t._touchmoveInside&&e.cancelable)return e.preventDefault(),void e.stopPropagation();const n=t.scrollHeight>0,r=t.scrollWidth>0,o=t._touchCoords;if(!n&&!r||!o)return;const i=e.touches[0];let s,a,l,d;t._touchCoords=[i.pageX,i.pageY],n?(s=t.scrollTop,a=t.scrollHeight,l=i.pageY,d=o[1]):(s=t.scrollLeft,a=t.scrollWidth,l=i.pageX,d=o[0]);const c=parseFloat(l.toFixed(5)),u=parseFloat(d.toFixed(5));0===s&&c>=u||s===a&&c<=u||(l!==d&&(t._touchmoveInside=!0),e.cancelable&&(e.preventDefault(),e.stopPropagation()))}_touchstartHandler(e){const t=e.touches[0];this._touchCoords=[t.pageX,t.pageY]}_mouseWheelHandler(e){const t=this;if(!t.disabled&&(t.computedHorizontalScrollBarVisibility||t.computedVerticalScrollBarVisibility)){if(e.shiftKey&&t.computedHorizontalScrollBarVisibility){const n=t.scrollLeft;if(0===n&&e.deltaX<0||n===t.scrollHeight&&e.deltaX>0)return;return e.stopPropagation(),e.preventDefault(),void(t.scrollWidth>0&&t.scrollTo(void 0,t.scrollLeft+t._getScrollCoefficient(e,t.offsetWidth)))}if(t.computedVerticalScrollBarVisibility){const n=t.scrollTop;if(0===n&&e.deltaY<0||n===t.scrollHeight&&e.deltaY>0)return;e.stopPropagation(),e.preventDefault(),t.scrollHeight>0&&t.scrollTo(t.scrollTop+t._getScrollCoefficient(e,t.offsetHeight))}}}_overriddenHandler(){}_upHandler(){delete this._touchCoords,delete this._touchmoveInside}_getScrollCoefficient(e,t){const n=e.deltaMode,r=Math.abs(e.deltaY);let o;return 0===n?o=r<100/3?r:t:1===n?o=r<1?r*(100/3):t:2===n&&(o=t),e.deltaY<0?-o:o}applyContent(){super.applyContent(),this.refresh()}get computedHorizontalScrollBarVisibility(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?!e._scrollView.hScrollBar.$.hasClass("smart-hidden"):null}get computedVerticalScrollBarVisibility(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?!e._scrollView.vScrollBar.$.hasClass("smart-hidden"):null}scrollTo(e,t){const n=this;n._scrollView&&(void 0!==e&&n._scrollView.scrollTo(e),void 0!==t&&n._scrollView.scrollTo(t,!1))}refreshScrollBarsVisibility(){const e=this;e._scrollView&&(e._scrollView.hScrollBar.disabled=e.disabled,e._scrollView.vScrollBar.disabled=e.disabled,"disabled"===e.horizontalScrollBarVisibility&&(e._scrollView.hScrollBar.disabled=!0),"disabled"===e.verticalScrollBarVisibility&&(e._scrollView.vScrollBar.disabled=!0),e.scrollWidth>0?e._scrollView.hScrollBar.$.removeClass("smart-hidden"):"visible"!==e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.addClass("smart-hidden"),e.scrollHeight>0?e._scrollView.vScrollBar.$.removeClass("smart-hidden"):"visible"!==e.verticalScrollBarVisibility&&e._scrollView.vScrollBar.$.addClass("smart-hidden"),"hidden"===e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.addClass("smart-hidden"),"hidden"===e.verticalScrollBarVisibility&&e._scrollView.vScrollBar.$.addClass("smart-hidden"),"visible"===e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.removeClass("smart-hidden"),"visible"===e.verticalScrollBarVisibility&&(e._scrollView.vScrollBar.$.removeClass("smart-hidden"),e.disabled||(e._scrollView.vScrollBar.disabled=e.scrollHeight<=0)),e.computedHorizontalScrollBarVisibility&&e.computedVerticalScrollBarVisibility?(e._scrollView.hScrollBar.$.addClass("bottom-corner"),e._scrollView.vScrollBar.$.addClass("bottom-corner")):(e._scrollView.hScrollBar.$.removeClass("bottom-corner"),e._scrollView.vScrollBar.$.removeClass("bottom-corner")))}ready(){super.ready();const e=this;e.$.verticalScrollBar.onChange=t=>{t.detail=t,e._verticalScrollbarHandler(t)},e.$.horizontalScrollBar.onChange=t=>{t.detail=t,e._horizontalScrollbarHandler(t)},e.$.verticalScrollBar.setAttribute("aria-controls",e.id),e.$.horizontalScrollBar.setAttribute("aria-controls",e.id),e._customScrollView||(e._scrollView=new Smart.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.refresh()}refresh(){const e=this;function t(){const t=e.$.scrollViewerContainer.classList.contains("vscroll");e.$.scrollViewerContainer.classList.remove("vscroll");const n=e.$.scrollViewerContentContainer.offsetWidth-e.$.scrollViewerContainer.offsetWidth;return n>0&&"hidden"!==e.horizontalScrollBarVisibility||"visible"===e.horizontalScrollBarVisibility?e.$.scrollViewerContainer.classList.add("hscroll"):e.$.scrollViewerContainer.classList.remove("hscroll"),t&&e.$.scrollViewerContainer.classList.add("vscroll"),n}function n(){let t;const n=e.$.scrollViewerContainer.classList.contains("hscroll");if(e.$.scrollViewerContainer.classList.remove("hscroll"),Smart.Utilities.Core.Browser.Safari){const n=e.$.scrollViewerContentContainer.getBoundingClientRect().height,r=e.$.scrollViewerContainer.getBoundingClientRect().height;t=n&&r?parseInt(n)-parseInt(r):e.$.scrollViewerContentContainer.offsetHeight-e.$.scrollViewerContainer.offsetHeight}else t=e.$.scrollViewerContentContainer.offsetHeight-e.$.scrollViewerContainer.offsetHeight;return e.virtualScrollHeight&&(t=e.virtualScrollHeight),t>0&&"hidden"!==e.verticalScrollBarVisibility||"visible"===e.verticalScrollBarVisibility?e.$.scrollViewerContainer.classList.add("vscroll"):e.$.scrollViewerContainer.classList.remove("vscroll"),n&&e.$.scrollViewerContainer.classList.add("hscroll"),t}if(!e.$.scrollViewerContentContainer)return;"hidden"===e.verticalScrollBarVisibility&&e.$.scrollViewerContentContainer.setAttribute("disable-vertical",""),"hidden"===e.horizontalScrollBarVisibility&&e.$.scrollViewerContentContainer.setAttribute("disable-horizontal","");let r=e.scrollWidth,o=e.scrollHeight;e.scrollWidth=t(),e.scrollHeight=n(),e.scrollHeight&&o===e.scrollHeight||(e.scrollWidth=t()),e.scrollWidth&&r===e.scrollWidth||(e.scrollHeight=n()),e.computedVerticalScrollBarVisibility&&(e.scrollHeight+=e._scrollView.hScrollBar.offsetHeight),e.computedHorizontalScrollBarVisibility&&(e.scrollWidth+=e._scrollView.vScrollBar.offsetWidth),0===e.scrollHeight&&e.scrollWidth>0&&e.$.container.offsetHeight-e.$.content.offsetHeight<5&&(e.$.container.style.paddingBottom=e._scrollView.hScrollBar.offsetHeight+"px"),e.autoRefresh&&(e.$.scrollViewerContainer.scrollLeft=0,e.$.scrollViewerContainer.scrollTop=0)}attached(){const e=this;super.attached(),e._scrollView||e._customScrollView||(e._scrollView=new Smart.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar))}detached(){const e=this;super.detached(),e._scrollView&&(e._scrollView.unlisten(),delete e._scrollView)}get scrollWidth(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?1===e._scrollView.hScrollBar.max&&"visible"===e.horizontalScrollBarVisibility?0:e._scrollView.hScrollBar.max:-1}set scrollWidth(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.hScrollBar&&(0===e&&"visible"===t.horizontalScrollBarVisibility?t._scrollView.hScrollBar.max=0:t._scrollView.hScrollBar.max=e,t.refreshScrollBarsVisibility())}get scrollHeight(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?1===e._scrollView.vScrollBar.max&&"visible"===e.verticalScrollBarVisibility?0:e._scrollView.vScrollBar.max:0}set scrollHeight(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.vScrollBar&&(0===e&&"visible"===t.verticalScrollBarVisibility?t._scrollView.vScrollBar.max=1:t._scrollView.vScrollBar.max=e,t.refreshScrollBarsVisibility())}get scrollLeft(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?e._scrollView.hScrollBar.value:0}set scrollLeft(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.hScrollBar&&(t._scrollView.hScrollBar.value=e)}get scrollTop(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?e._scrollView.vScrollBar.value:0}set scrollTop(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.vScrollBar&&(t._scrollView.vScrollBar.value=e)}propertyChangedHandler(e,t,n){const r=this;super.propertyChangedHandler(e,t,n),"animation"!==e&&"theme"!==e&&r.refresh()}}),window[n].Utilities.Assign("PositionDetection",class{constructor(e,t,n,r){const o=this;if(t){const n="dropDown"+Math.floor(65536*(1+Math.random())).toString(16).substring(1);t.id=n,e.setAttribute("aria-owns",n)}o.context=e,o.dropDown=t,o.defaultParent=n,o.closeMethod=r}handleAutoPositioning(){const e=this,t=e.context;if("auto"!==t.dropDownPosition||t.disabled||t.isHidden)return;const n=window.requestAnimationFrame;let r,o=Date.now();return r=n((function i(){t.isHidden||document.hidden||(r=n(i),"auto"===t.dropDownPosition&&!t.disabled&&(t.isInShadowDOM?document.body.contains(t.shadowParent):document.body.contains(t))||cancelAnimationFrame(r),t.isHidden&&cancelAnimationFrame(r),Date.now()-o>=200&&(e.scrollHandler(),o=Date.now()))}))}checkBrowserBounds(e){const t=this.context;if("auto"===t.dropDownPosition&&!t.disabled)switch(e){case"vertically":this.checkBrowserBoundsVertically();break;case"horizontally":this.checkBrowserBoundsHorizontally();break;default:this.checkBrowserBoundsVertically(),this.checkBrowserBoundsHorizontally()}}checkBrowserBoundsHorizontally(){const e=this.context,t=this.dropDown;let n,r=0;a.isMobile||window.innerWidth===document.documentElement.clientWidth||(r=window.innerWidth-document.documentElement.clientWidth),null!==e._dropDownParent?n=!0:t.style.left="";const o=window.innerWidth-r;let i=e.getBoundingClientRect().left;if(i<0&&(t.style.left=(n?0:Math.abs(i))+"px",i=parseFloat(t.style.left)),i+t.offsetWidth>o){let e=i-Math.abs(o-i-t.offsetWidth);n&&(e+=window.pageXOffset),t.style.left=(n?e:e-i)+"px",window.innerWidth===document.documentElement.clientWidth&&(t.style.left=parseFloat(t.style.left)+r+"px"),n&&window.innerHeight===document.documentElement.clientHeight&&this.positionDropDown(!0)}}checkBrowserBoundsVertically(e){const t=this.context,n=this.dropDown,r=t._dropDownListPosition;e||(e=t.getBoundingClientRect()),0!==e.height&&(document.documentElement.clientHeight-Math.abs(e.top+e.height+n.offsetHeight)>=0?t._dropDownListPosition="bottom":e.top-n.offsetHeight>=0?t._dropDownListPosition="top":t._dropDownListPosition="overlay-center",this.updatePositionAttribute(r,t._dropDownListPosition))}scrollHandler(){const e=this.context;if(!e.parentElement)return;const t=e.getBoundingClientRect();if(t.top===e._positionTop)return;const n=e._dropDownListPosition;this.checkBrowserBoundsVertically(t),e._dropDownListPosition!==n&&this.positionDropDown(),e._positionTop=t.top}getDropDownParent(e){const t=this.context,n=this.dropDown;let r=t.dropDownAppendTo;t._positionedParent=null,null===r?t._dropDownParent=null:"body"===r||r===document.body?t.getRootNode().host?t._dropDownParent=t.getRootNode().host.shadowRoot:t._dropDownParent=document.body:r instanceof HTMLElement?t._dropDownParent=r:"string"==typeof r?(r=document.getElementById(r),r instanceof HTMLElement?t._dropDownParent=r:(t.dropDownAppendTo=null,t._dropDownParent=null)):(t.dropDownAppendTo=null,t._dropDownParent=null);let o=t._dropDownParent;if(null!==o){for(;o&&o instanceof HTMLElement&&"static"===window.getComputedStyle(o).position&&o!==t.getShadowRootOrBody();)o=o.parentElement;o===document.body?t._positionedParent=null:t._positionedParent=o,n&&(n.setAttribute("animation",t.animation),""!==t.theme&&n.$.addClass(t.theme),e&&(t._dropDownParent.appendChild(n),n.$.addClass("smart-drop-down-repositioned")),-1===t.detachedChildren.indexOf(n)&&t.detachedChildren.push(n))}}dropDownAppendToChangedHandler(){const e=this.context,t=this.dropDown,n=e._dropDownParent;this.getDropDownParent(),e._dropDownParent!==n&&(e[this.closeMethod](),["left","top","font-size","font-family","font-style","font-weight"].forEach((e=>t.style[e]=null)),null===e._dropDownParent?(this.defaultParent.appendChild(t),t.$.removeClass("smart-drop-down-repositioned")):(e._dropDownParent.appendChild(t),t.$.addClass("smart-drop-down-repositioned")))}dropDownPositionChangedHandler(){const e=this;e.dropDown.style.transition="none",e.context[e.closeMethod](),e.setDropDownPosition(),e.handleAutoPositioning()}dropDownAttached(e){const t=this.context;null!==t._dropDownParent&&(t._dropDownParent.appendChild(this.dropDown),this.handleAutoPositioning(),e&&t[e]())}dropDownDetached(){const e=this.context;null!==e._dropDownParent&&document.body.contains(this.dropDown)&&document.body.contains(e._dropDownParent)&&e._dropDownParent.removeChild(this.dropDown)}setDropDownPosition(){const e=this.context,t=e.dropDownPosition,n=e._dropDownListPosition;"auto"===t?this.checkBrowserBounds():e._dropDownListPosition=t,this.updatePositionAttribute(n,e._dropDownListPosition)}updatePositionAttribute(e,t){const n=this.context,r=this.dropDown;n.$.dropDownButton&&!n.$.dropDownButton.hasAttribute(t)&&(n.$.dropDownButton.removeAttribute(e),n.$.dropDownButton.setAttribute(t,"")),r.hasAttribute(t)||(r.style.transition="none",r.removeAttribute(e),r.setAttribute(t,""),requestAnimationFrame((function(){r.style.transition=null})))}positionDropDown(e){const t=this.context,n=this.dropDown;if(!t.opened||null===t._dropDownParent)return;const r=t.getBoundingClientRect();let o,i;if(this.customPositionDropDown){const e=this.customPositionDropDown(r);o=e.left,i=e.top}else switch(o=r.left,i=r.top,t._dropDownListPosition){case"bottom":i+=t.$.container.offsetHeight-1;break;case"center-bottom":i+=t.$.container.offsetHeight-1,o+=t.offsetWidth-n.offsetWidth/2;break;case"center-top":i-=n.offsetHeight-1,o+=t.offsetWidth-n.offsetWidth/2;break;case"top":i-=n.offsetHeight-1;break;case"overlay-bottom":break;case"overlay-center":i-=n.offsetHeight/2-t.offsetHeight/2;break;case"overlay-top":i-=n.offsetHeight-t.offsetHeight}const s=this.getDropDownOffset();n.style.top=i+s.y+"px",e||(n.style.left=o+s.x+"px")}getDropDownOffset(){const e=this.context._positionedParent;let t,n;if(e&&"#document-fragment"!==e.nodeName){const r=e.getBoundingClientRect();t=-r.left,n=-r.top}else t=window.pageXOffset,n=window.pageYOffset;return{x:t,y:n}}placeOverlay(){const e=this.context;if(!e.dropDownOverlay||e._overlay)return;const t=document.createElement("div");t.classList.add("smart-drop-down-overlay"),t.style.width=document.documentElement.scrollWidth+"px",t.style.height=document.documentElement.scrollHeight+"px",document.body.appendChild(t),e._overlay=t}removeOverlay(e){const t=this,n=t.context;n._overlay&&(n.hasAnimation&&e?requestAnimationFrame((function e(){t.dropDown.getBoundingClientRect().height>0?requestAnimationFrame(e):(document.body.removeChild(n._overlay),delete n._overlay)})):(document.body.removeChild(n._overlay),delete n._overlay))}}),window.Smart.Color=class{constructor(e){if(window.Smart._colors||(window.Smart._colors=[]),window.Smart._colors[e]){const t=window.Smart._colors[e];return this.hex=t.hex,this.r=t.r,this.g=t.g,void(this.b=t.b)}this.r=this.g=this.b=0,this.hex="";const t=this.getStandardizedColor(e);t&&(this.setHex(t.substring(1)),window.Smart._colors[e]={hex:this.hex,r:this.r,g:this.g,b:this.b})}getStandardizedColor(e){const t=document.createElement("canvas").getContext("2d");return t.fillStyle=e,t.fillStyle}getInvertedColor(){return""===this.hex?"transparent":255-(.299*this.r+.587*this.g+.114*this.b)<105?"Black":"White"}hexToRgb(e){let t="00",n="00",r="00";return 6===(e=this.validateHex(e)).length?(t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6)):(e.length>4&&(t=e.substring(4,e.length),e=e.substring(0,4)),e.length>2&&(n=e.substring(2,e.length),e=e.substring(0,2)),e.length>0&&(r=e.substring(0,e.length))),{r:this.hexToInt(t),g:this.hexToInt(n),b:this.hexToInt(r)}}validateHex(e){return(e=(e=new String(e).toUpperCase()).replace(/[^A-F0-9]/g,"0")).length>6&&(e=e.substring(0,6)),e}webSafeDec(e){return e=Math.round(e/51),e*=51}hexToWebSafe(e){let t,n,r;return 3===e.length?(t=e.substring(0,1),n=e.substring(1,1),r=e.substring(2,1)):(t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6)),this.intToHex(this.webSafeDec(this.hexToInt(t)))+this.intToHex(this.webSafeDec(this.hexToInt(n)))+this.intToHex(this.webSafeDec(this.hexToInt(r)))}rgbToWebSafe(e){return{r:this.webSafeDec(e.r),g:this.webSafeDec(e.g),b:this.webSafeDec(e.b)}}rgbToHex(e){return this.intToHex(e.r)+this.intToHex(e.g)+this.intToHex(e.b)}intToHex(e){let t=parseInt(e).toString(16);return 1===t.length&&(t="0"+t),t.toUpperCase()}hexToInt(e){return parseInt(e,16)}setRgb(e,t,n){let r=function(e){return e<0||e>255||isNaN(parseInt(e))?0:e};this.r=r(e),this.g=r(t),this.b=r(n),this.hex=this.rgbToHex(this)}setHex(e){this.hex=e;let t=this.hexToRgb(this.hex);this.r=t.r,this.g=t.g,this.b=t.b}}}();
|
|
7
7
|
Smart.Utilities.Assign("Complex",class{constructor(r,a){if("string"==typeof r)this.complexNumber=this.parseComplexNumber(r),this.realPart=this.complexNumber.realPart,this.imaginaryPart=this.complexNumber.imaginaryPart;else{if("number"!=typeof r)throw new Error("Can't create complex number");if(this.realPart=r,"number"==typeof a)this.imaginaryPart=a;else{if(void 0!==a)throw new Error("Can't create complex number: invalid imaginary part");this.imaginaryPart=0}this.complexNumber=this.parseComplexNumber(this.realPart,this.imaginaryPart)}}valueOf(){return 0===this.imaginaryPart?this.realPart:null}isNaN(){return isNaN(this.realPart)||isNaN(this.imaginaryPart)}isZero(){return!(0!==this.realPart&&"-0"!==this.realPart.toString()||0!==this.imaginaryPart&&"-0"!==this.imaginaryPart.toString())}isFinite(){return isFinite(this.realPart)&&isFinite(this.imaginaryPart)}isInfinite(){return!(this.isNaN()||this.isFinite())}parseComplexNumber(r,a){const t={realPart:0,imaginaryPart:0};if(null==r)t.realPart=t.imaginaryPart=0;else if(void 0!==a)t.realPart=r,t.imaginaryPart=a;else switch(typeof r){case"object":if("imaginaryPart"in r&&"realPart"in r)t.realPart=r.realPart,t.imaginaryPart=r.imaginaryPart;else{if(2!==r.length)throw SyntaxError("Invalid Complex Number Parameter");t.realPart=r[0],t.imaginaryPart=r[1]}break;case"string":{t.imaginaryPart=t.realPart=0;const a=r.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);let i=1,e=0;if(null===a)throw SyntaxError("Invalid Complex Number Parameter");for(let r=0;r<a.length;r++){const s=a[r];if(" "===s||"\t"===s||"\n"===s);else if("+"===s)i++;else if("-"===s)e++;else if("i"===s||"I"===s){if(i+e===0)throw SyntaxError("Invalid Complex Number Parameter");" "===a[r+1]||isNaN(a[r+1])?t.imaginaryPart+=parseFloat((e%2?"-":"")+"1"):(t.imaginaryPart+=parseFloat((e%2?"-":"")+a[r+1]),r++),i=e=0}else{if(i+e===0||isNaN(s))throw SyntaxError("Invalid Complex Number Parameter");"i"===a[r+1]||"I"===a[r+1]?(t.imaginaryPart+=parseFloat((e%2?"-":"")+s),r++):t.realPart+=parseFloat((e%2?"-":"")+s),i=e=0}}if(i+e>0)throw SyntaxError("Invalid Complex Number Parameter");break}case"number":t.imaginaryPart=0,t.realPart=r;break;default:throw SyntaxError("Invalid Complex Number Parameter")}return t}compare(r,a){const t=this.parseComplexNumber(r,a),i=this.parseComplexNumber("1e-16");return Math.abs(t.realPart-this.realPart)<=i&&Math.abs(t.imaginaryPart-this.imaginaryPart)<=i}toString(){let r=this.realPart,a=this.imaginaryPart,t="";return this.isNaN()?"NaN":this.isZero()?"0":this.isInfinite()?"Infinity":(0!==r&&(t+=r),0!==a&&(0!==r?t+=a<0?" - ":" + ":a<0&&(t+="-"),a=Math.abs(a),1!==a&&(t+=a),t+="i"),t||"0")}});
|
|
8
|
-
(()=>{Smart.DataAdapter=window.smartDataAdapter=class{constructor(e){e||(e={});const t=Object.assign(this,e);t.key=(65536*(1+Math.random())|0).toString(16).substring(1),t.$document=Smart.Utilities.Extend(document),t.boundSource=!1===t.observable||t.virtualDataSource?[]:new Smart.ObservableArray,t.dataItemById=[],void 0===t.allowAdd&&(t.allowAdd=!0),void 0===t.allowRemove&&(t.allowRemove=!0),void 0===t.allowUpdate&&(t.allowUpdate=!0),void 0===t.mapChar&&(t.mapChar="."),void 0!==e.observable||t.virtualDataSource?t.observable=!1:t.observable=!0,void 0===t.sanitizeHTML&&(t.sanitizeHTML="blackList"),t._expandedRowIds=[],e.dataSource||(t.dataSource=[]),e.dataFields||(t.dataFields=[]),e.dataSourceType||(t.dataSourceType="array"),e.id||(t.id=null),e.autoFetch||(t.autoFetch=!0),e.dataFields&&(t.dataFields=e.dataFields),Object.defineProperty(t,"groupBy",{configurable:!1,enumerable:!0,get:()=>t._groupBy?t._groupBy:[],set(e){const a=()=>{t.boundHierarchy=null,t.refreshHierarchy(),t.onGroup&&t.onGroup()};t._groupBy=new Smart.ObservableArray(e),t._groupBy.notify((function(){a()})),t.isInitialized&&a()}}),e.groupBy?e.groupBy.toArray?t.groupBy=e.groupBy.toArray():t.groupBy=e.groupBy:t.groupBy=[],e&&!1!==e.autoBind&&t.dataBind(),t.isInitialized=!0}beginUpdate(){this.isUpdating=!0}endUpdate(){const e=this;e.isUpdating=!1,e.refreshIndexes(),e.refreshHierarchy()}get expandHierarchy(){return void 0===this._expandHierarchy&&(this._expandHierarchy=!1),this._expandHierarchy}set expandHierarchy(e){const t=this;t._expandHierarchy=e,t.isInitialized&&t.refreshHierarchy()}_getDataField(e){switch(e.name){case"leaf":case"parent":case"expanded":case"checked":case"selected":case"level":case"icon":case"data":case"group":case"children":case"items":e.map?e.map=e.map.replace(e.name,"$"+e.name):e.map=e.name,e.name="$"+e.name}}get dataFields(){return this._dataFields}set dataFields(e){const t=this;return t._dataFields=t._getDataFieldObjects(e),t._dataFields}_getDataFieldObjects(e){const t=this;let a=[];if("number"==typeof e){const t="A".charCodeAt(0);let n="",r=0;for(let i=0;i<e;i++){const e=String.fromCharCode(t+r);r++;const i=n+e;a.push({name:i,dataType:"string"}),r>=26&&(r=0,n+="A")}}else if(Array.isArray(e)&&e.length>0)for(let n=0;n<e.length;n++){const r=e[n];if("string"==typeof r){const e=r.split(":"),t=e[0].trim(),n=e.length>1?e[1].trim():"string";a.push({name:t,dataType:n})}else a.push(r);t._getDataField(a[a.length-1])}return a}get dataSource(){const e=this;return e._dataSource||(e._dataSource=[]),e._dataSource}set dataSource(e){const t=this;t._dataSource=e,t.isInitialized&&(t.boundSource=!1===t.observable||t.virtualDataSource?[]:new Smart.ObservableArray,t.dataItemById=[],t.bindingCompleted=!1,t.dataBind(),t.refreshIndexes())}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;t.canNotify&&t.notifyFn&&t.notifyFn(e)}notify(e){e&&(this.notifyFn=e)}toArray(){const e=this;return!1===e.observable?e.boundSource:e.boundSource.toArray()}forEach(e){const t=this;if(e)if(t.boundHierarchy&&t.boundHierarchy.length>0){const a=(e=>{let t=[];for(;e;){t=t.concat(e);for(let a=0;a<e.length;a++)e[a].children&&(t=t.concat(e[a].children));e=e.children}return t})(t.boundHierarchy);for(let t=0;t<a.length;t++){e(a[t],t)}}else for(let a=0;a<t.boundSource.length;a++){e(t.boundSource[a],a)}}dataBind(){const t=this;t.bindingCompleted=!1,t.clear();const a=()=>{t.observable&&(t.boundSource.notify||(t.boundSource=new Smart.ObservableArray),t.boundSource.notify((function(e){if("update"===e.action&&e.path&&e.path.indexOf(".")>=0&&-1===e.path.indexOf("children")&&-1===e.path.indexOf("parent")&&-1===e.path.indexOf("loaded")&&-1===e.path.indexOf("level")&&-1===e.path.indexOf("leaf")&&-1===e.path.indexOf("expanded")){let a=!1;for(let n=0;n<t.dataFields.length;n++){const r=t.dataFields[n].name;e.path.indexOf(r)>=0&&(a=!0)}t._notify&&a&&t._notify({action:"update",data:e.target,index:e.index})}}))),t._onBindingComplete()};"string"==typeof t.dataSource&&(t.dataSource.indexOf(".json")>=0||"json"===t.dataSourceType)?(t.url=t.dataSource,t.dataSourceType="json",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".xml")>=0?(t.url=t.dataSource,t.dataSourceType="xml",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".xlsx")>=0?(t.url=t.dataSource,t.dataSourceType="xlsx",new e(t,(e=>{if(!e[0])return e=[],t._bindToArray(),void a();const n=Object.keys(e[0]),r={},i=[];if(!1!==t.exportHeader){let a=0;for(let e in n){r[n[e]]=t.dataFields[a++].name}for(let t=1;t<e.length;t++){const a=e[t],o={};for(let e in n){const t=n[e];o[r[t]]=a[t]}i.push(o)}t.dataSource=i}t._bindToArray(),a()}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".csv")>=0?(t.url=t.dataSource,t.dataSourceType="csv",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".tsv")>=0?(t.url=t.dataSource,t.dataSourceType="tsv",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&(t.dataSource.indexOf(".ics")>=0||t.dataSource.indexOf(".php")>=0&&"ics"===t.dataSourceType||t.dataSource.indexOf(".txt")>=0&&"ics"===t.dataSourceType)?(t.url=t.dataSource,t.dataSourceType="ics",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&(t.dataSource.indexOf("BEGIN:VCALENDAR")>=0||"ics"===t.dataSourceType)?(t._bindToICS(),a()):"string"==typeof t.dataSource&&(t.dataSource.indexOf("<?xml")>=0||"xml"===t.dataSourceType)?(t._bindToXML(),a()):"string"==typeof t.dataSource&&(t.dataSource.indexOf(" ")>=0||t.dataSource.indexOf(",")>=0||"tsv"===t.dataSourceType||"csv"===t.dataSourceType||"tab"===t.dataSourceType)?(t._bindToCSV(),a()):"array"===t.dataSourceType?(t._bindToArray(),a()):"json"===t.dataSourceType&&(t._bindToJSON(),a())}_bindToXML(){const e=this;let t=null,a=null;window.DOMParser&&(t=new DOMParser,a=t.parseFromString(e.dataSource,"text/xml")),void 0===e.root&&(e.root=""),void 0===e.record&&(e.record="");const n=a.querySelectorAll(e.root+" "+e.record),r=n.length,i=[];let o=e.dataFields?e.dataFields.length:0;if(0===o){const t=n[0],a=new Array;for(let e in t){const t=e;a[a.length]={name:t}}e.dataFields=a,o=a.length}for(let t=0;t<r;t++){const a=n[t],r={};if(void 0===a)break;if(e.id){const t=a.querySelector(e.id);r[e.id]=t.textContent}for(let t=0;t<o;t++){const n=e.dataFields[t],i=a.querySelector(n.map||n.name);r[n.name]=i.textContent}i[t]=r}e.canNotify=!1,e.dataSource=i,e.canNotify=!0,e._bindToArray()}static BindToCSV(e,t=!1){const a=""+e,n=-1===a.indexOf(",")?"\t":",",r=a.split("\r"),i=new Array,o=[];let d=a.split("\n"),l=d.length;1===l&&r.length>1&&(d=r,l=d.length);const s=!0===t;for(let e=0;e<l;e++){const t={},a=d[e].split(n);for(let n=0;n<a.length;n++){let r=o[n],i=a[n];if(r||(o.push({name:i.trim()}),r=o[o.length-1]),i=i.trim(),1!==e||s)switch(r.dataType){case"boolean":i="false"!==i;break;case"number":i=parseFloat(i);break;case"date":i=new Date(i)}else{let e="string";"false"===i||"true"===i?(e="boolean",i="false"!==i):isNaN(parseInt(i)&&-1===i.indexOf("/"))?(i.indexOf("-")>=0||i.indexOf("/")>=0||i.indexOf(":")>=0)&&"Invalid Date"!==new Date(i).toString()&&(e="date",i=new Date(i)):(e="number",i=parseFloat(i)),r.dataType||(r.dataType=e)}t[r.name]=i}(s||e>0)&&i.push(t)}return i}_bindToCSV(){const e=this,t=""+e.dataSource,a=-1===t.indexOf(",")?"\t":",",n=t.split("\r"),r=new Array;let i=t.split("\n"),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=e.dataFields.length>0;for(let t=0;t<o;t++){const n=i[t],o={},l=i[t].split(a);for(let a=0;a<l.length;a++){let r=e.dataFields[a],i=l[a];if(r||(e.dataFields.push({name:i.trim()}),r=e.dataFields[e.dataFields.length-1]),r.map&&(i=n[r.map]),i=i.trim(),1!==t||d)switch(r.dataType){case"boolean":i="false"!==i;break;case"number":i=parseFloat(i);break;case"date":i=new Date(i)}else{let e="string";"false"===i||"true"===i?(e="boolean",i="false"!==i):isNaN(parseInt(i)&&-1===i.indexOf("/"))?(i.indexOf("-")>=0||i.indexOf("/")>=0||i.indexOf(":")>=0)&&"Invalid Date"!==new Date(i).toString()&&(e="date",i=new Date(i)):(e="number",i=parseFloat(i)),r.dataType||(r.dataType=e)}o[r.map||r.name||a.toString()]=i}(d||t>0)&&r.push(o)}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_onBindingComplete(){const e=this;e._buildHierarchy(),e.onBindingComplete&&e.onBindingComplete({data:e.boundSource}),e._notify&&e._notify({action:"bindingComplete",data:e.boundSource}),e.bindingCompleted=!0}refreshHierarchy(){this.isUpdating||this._buildHierarchy()}find(){return this.boundSource.find.apply(this.boundSource,arguments)}onVirtualDataSourceRequested(e,t){const a=this;let n=t?t.first:1/0,r=t?t.last:1/0,i=t?t.row:null;if(void 0===n&&(n=1/0),void 0===r&&(r=1/0),a.virtualFirstIndex=n,a.virtualLastIndex=r,a.virtualDataSource){const o=function(r){void 0!==r.virtualDataSourceLength&&(a.virtualDataSourceLength=r.virtualDataSourceLength),new Smart.DataAdapter({dataSource:r.dataSource,dataFields:r.dataFields||a.dataFields,data:t,keyDataField:r.keyDataField,parentDataField:r.parentDataField,observable:!1,id:r.id||a.id,onBindingComplete(r){if(void 0===t.result&&(t.result=!0),a.virtualDataSourceOnExpand&&i)return a.groupBy.length>0?r.data&&r.data.length>0&&a.add(r.data):r.data&&r.data.length>0?a.add(r.data,i.$.id):i.leaf=!0,a.onFilter&&a.onFilter(),void e(t);n===1/0&&"scroll"===t.action?r.data&&r.data.length&&a.add(r.data):"filter"===t.action||"group"===t.action?(a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0):("add"===t.action||"update"===t.action||t.action,a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0),a.onFilter&&a.onFilter(),e(t)}})};let d={};if(t.sorting&&t.sorting.length>0){let e=[];for(let a in t.sorting)e.push(a+" "+t.sorting[a].sortOrder.toUpperCase());const a=" ORDER BY "+e.join(", ");d.orderBy=a}else d.orderBy="";if(void 0===n||void 0===r||0===n&&0===r)d.limit="";else{const e=r-n,t=" LIMIT "+e+" OFFSET "+n;d.limit=t,isNaN(e)&&(d.limit="")}if(t.grouping&&t.grouping.length>0){const e=" GROUP BY "+t.grouping[0];d.groupBy=e}else d.groupBy="";if(t.filtering&&t.filtering.length>0){const e=(e,t)=>{switch(t.condition){case"EMPTY":return e+" = ''";case"NOT_EMPTY":return e+" != ''";case"EQUAL":return e+" = '"+t.value+"'";case"NOT_EQUAL":return e+" != '"+t.value+"'";case"CONTAINS_CASE_SENSITIVE":case"CONTAINS":return e+" LIKE '%"+t.value+"%'";case"DOES_NOT_CONTAIN_CASE_SENSITIVE":case"DOES_NOT_CONTAIN":return e+" NOT LIKE '%"+t.value+"%'";case"STARTS_WITH_CASE_SENSITIVE":case"STARTS_WITH":return e+" LIKE '"+t.value+"%'";case"ENDS_WITH_CASE_SENSITIVE":case"ENDS_WITH":return e+" LIKE '%"+t.value+"'";case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL"}},a=(e,t)=>{switch(t.condition){case"EQUAL":return e+" = "+t.value;case"NOT_EQUAL":return e+" != "+t.value;case"GREATER_THAN":return e+" > "+t.value;case"GREATER_THAN_OR_EQUAL":return e+" >= "+t.value;case"LESS_THAN":return e+" < "+t.value;case"LESS_THAN_OR_EQUAL":return e+" <= "+t.value;case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL";case"RANGE":return"("+e+" >= "+t.value+" and "+e+" <= "+t.valueTo+")"}},n=(e,t,a)=>{if(a.operator){var n=e(t,a.condition1),r=e(t,a.condition2);return"("+n+" "+a.operator+" "+r+")"}return e(t,a)};let r=[];for(let i in t.filtering){const o=t.filtering[i];let d=o.filters,l=[],s=" AND ";for(let t=0;t<d.length;t++){const r=d[t];switch(r.type){case"stringFilter":l.push(n(e,i,r));break;case"numericFilter":case"dateFilter":case"booleanFilter":l.push(n(a,i,r))}1===o.logicalOperators[t]&&(s=" OR ")}r.push("("+l.join(s)+")")}if(r.length>0){let e=" AND ";t.filterOperator&&"or"===t.filterOperator.toLowerCase()&&(e=" OR "),d.where=" WHERE "+r.join(e)}else d.where=""}else d.where="";if("dataBind"===t.action&&a.virtualDataSourceOnExpand&&a.keyDataField&&a.parentDataField&&(d.where?d.where+=" AND "+a.parentDataField+" IS NULL":d.where=" WHERE "+a.parentDataField+" IS NULL"),"update"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+"='"+t.edit.row[n]+"'");d.update=" SET "+e.join(", ")+" WHERE "+a.id+"="+t.edit.row[a.id]}if("remove"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+" = '"+t.edit.row[n]+"'");d.remove=" WHERE "+a.id+"="+t.edit.row[a.id]}if("add"===t.action){const e=[],a=[];for(let n in t.edit.row)"$"!==n&&(a.push(n),e.push("'"+t.edit.row[n]+"'"));d.add=" ("+a.join(", ")+") VALUES ("+e.join(", ")+")"}"expand"===t.action?(a.groupDataField?d.where?d.where+=" AND "+a.groupDataField+" = '"+i[a.groupDataField]+"'":d.where=" WHERE "+a.groupDataField+" = '"+i[a.groupDataField]+"'":a.keyDataField&&a.parentDataField?d.where?d.where+=" AND "+a.parentDataField+" = "+i[a.keyDataField]:d.where=" WHERE "+a.parentDataField+" = "+i[a.keyDataField]:d.where?d.where+=" AND "+i.groupDataField+" = '"+i.label+"'":d.where=" WHERE "+i.groupDataField+" = '"+i.label+"'",d.where.indexOf("undefined")>=0&&(d.where=""),d.limit="",d.groupBy="",a.virtualDataSourceOnExpand(o,{first:n,last:r,row:t.row,sorting:t.sorting,filtering:t.filtering,grouping:t.grouping,action:t.action,query:d})):a.virtualDataSource(o,{first:n,last:r,sorting:t.sorting,filtering:t.filtering,filterOperator:t.filterOperator||"and",grouping:t.grouping,action:t.action,query:d})}else e()}add(e,t){const a=this;if(!e)return;let n=!0;const r=function(e){const r=a._getDataItem(e,a.boundSource.length);if(a.dataItemById[r.$.id])return void 0!==t&&(r.$.parentId=t),null;a[a.boundSource.length]=r,a.dataItemById[r.$.id]=r;const i=a.boundSource.push(r);return void 0!==t&&(r.$.parentId=t),i||(n=!1),r};if(e.length){let t=[];for(let a=0;a<e.length;a++){const n=r(e[a]);n&&t.push(n)}a._notify({action:"add",data:t})}else{const t=r(e);a._notify({action:"add",data:t})}return a.refreshHierarchy(),n}refreshIndexes(){const e=this;for(let t=0;t<e.boundSource.length;t++)e[t]=e.boundSource[t],e[t].$.index=t,e.dataItemById[e[t].$.id]=e[t];let t=e.boundSource.length;for(;e[t];)delete e[t],t++}removeLast(){const e=this;delete e[e.boundSource.length-1];const t=e.boundSource.pop();return delete e.dataItemById[t.$.id],e._notify({action:"removeLast",data:t}),e.refreshHierarchy(),t}removeById(e){const t=this,a=t.indexOf(t.dataItemById[e]);t.boundSource[a]&&t.removeAt(a)}remove(e){const t=this;let a=t.indexOf(e);-1===a&&e&&e.$&&(a=t.indexOf(t.dataItemById[e.$.id]));t.boundSource[a]&&t.removeAt(a)}removeAt(e){const t=this,a=t.boundSource[e];if(!a)throw new Error("Invalid Item Index");t.boundSource.splice(e,1),delete t.dataItemById[a.$.id],t.refreshIndexes(),t._notify({action:"remove",index:e,data:a}),t.refreshHierarchy()}update(e,t){const a=this;if(Smart.Utilities.Types.isArray(e)&&Smart.Utilities.Types.isArray(t)&&0===e.length&&0===t.length)return void a.refreshHierarchy();if(t.length&&e.length){let n=[];for(let r=0;r<e.length;r++){const i=a._getDataItem(t[r],e[r]),o=e[r];n.push(i),a.boundSource[o]=i,a[o]=a.boundSource[o],a.dataItemById[i.$.id]=a[o]}return a._notify({action:"update",index:e,data:n}),void a.refreshHierarchy()}const n=a._getDataItem(t,e),r=a.boundSource[e].$.id;return n.$.id=r,a.boundSource[e]=n,a[e]=a.boundSource[e],a.dataItemById[n.$.id]=a[e],a._notify({action:"update",index:e,data:n}),a.refreshHierarchy(),n}insert(e,t){const a=this;if(t.length){const n=[];for(let r=0;r<t.length;r++){const i=a._getDataItem(t[r],e+r);n.push(i)}t=n}else t=a._getDataItem(t,e);const n=a.boundSource.splice(e,0,t);return a.refreshIndexes(),a._notify({action:"insert",index:e,data:t}),a.refreshHierarchy(),n}move(e,t){if(t>e&&t-e==1||e===t)return;const a=this,n=a.boundSource.splice(e,1)[0];t>e?(t--,a.boundSource.splice(t,0,n)):a.boundSource.splice(t,0,n),a.refreshIndexes(),a._notify({action:"move",index:t,data:a.boundSource[t]}),a.refreshHierarchy()}indexOf(e){return this.boundSource.indexOf(e)}get length(){const e=this;return void 0!==e.virtualDataSourceLength?e.virtualDataSourceLength:e.dataSourceLength?e.dataSourceLength:"number"==typeof e.dataSource?e.dataSource:e.bindingCompleted?e.boundSource.length:e.dataSource&&"string"!=typeof e.dataSource&&e.dataSource.length?e.dataSource.length:e.boundSource.length}clear(){const e=this;if(!e.isInitialized)return e._cachedValues=[],void(e.dataItemById=[]);for(let t=0;t<e.boundSource.length;t++)delete e[t];e._expandedRowIds=[],e._cachedValues=[],e.boundSource=e.observable?new Smart.ObservableArray:[],e.dataItemById=[],e.refreshHierarchy()}_getId(e,t,a){if(null===e||void 0===e.name||!e.name||!t.getAttribute){if(e&&e.toString().length>0&&t.getAttribute){let a=t.getAttribute(e);if(null!==a&&a.toString().length>0)return a.trim().split(" ").join("").replace(/([ #;?%&,.+*~\':'!^$[\]()=>|\/@])/g,"");{let a=e.split(this.mapChar);if(a.length>1){let e=t;for(let t=0;t<a.length;t++)void 0!==e&&(e=e[a[t]]);if(void 0!==e)return e}else if(void 0!==t[e])return t[e]}}return a}{let n=t.getAttribute(e.name);if(null!==n&&n.toString().length>0)return n;if(e.map)try{let a=t.getAttribute(e.map);if(null!==a&&a.toString().length>0)return a}catch(e){return a}}}_buildHierarchy(){const e=this;if(e.reservedNames){const t=e.reservedNames;t.leaf||(t.leaf="leaf"),t.parent||(t.parent="parent"),t.expanded||(t.expanded="expanded"),t.checked||(t.checked="checked"),t.selected||(t.selected="selected"),t.level||(t.level="level"),t.data||(t.data="data")}else e.reservedNames={leaf:"leaf",parent:"parent",expanded:"expanded",checked:"checked",selected:"selected",level:"level",icon:"icon",data:"data"};const t=e.reservedNames;if(e.childrenDataField){const a=[];for(let n=0;n<e.boundSource.length;n++){const r=Object.assign({},e.boundSource[n]);if(!r)continue;a.push(r);const i=function(a){const n=e.childrenDataField.split(e.mapChar);let r=null;if(n.length>1){let e=a;for(let t=0;t<n.length;t++)void 0!==e&&(e=e[n[t]]);r=e}else r=a.children;a.children=r,(null===a.children||void 0===a.children||a.children&&0===a.children.length)&&(a[t.leaf]=!0)};i(r),r[t.level]=0,r.$||(r.$={}),r[t.parent]=null,r[t.data]=r,void 0===r[t.expanded]&&(r[t.expanded]=!1,e.expandHierarchy&&(r[t.expanded]=!0));const o=function(a,n){if(n)for(let r=0;r<n.length;r++){let d=e._getDataItem(n[r],r);if(d){if(i(d),!e.id){const e=function(){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()};d.$.id=e()}d[t.level]=a[t.level]+1,d[t.parent]=a,d[t.data]=Object.assign({},d),a&&(a.children[r]=d),void 0===d[t.expanded]&&(d[t.expanded]=!1,e.expandHierarchy&&(d[t.expanded]=!0)),o(d,d.children)}}else a.children=new Array};o(r,r.children)}if(e.boundHierarchy=a,!e._boundSourceUpdate){for(let t=0;t<e.boundHierarchy.length;t++){const a=e.boundHierarchy[t];if(a.children){const t=function(a){if(e.dataItemById[a.$.id]||(e.boundSource.canNotify=!1,e.dataItemById[a.$.id]=a,e.boundSource.canNotify=!0),a.children)for(let e=0;e<a.children.length;e++){const n=a.children[e];n.children&&t(n)}};t(a)}}e._boundSourceUpdate=!0}}if(e.xmlRoot&&"xml"===e.dataSourceType&&(e.boundHierarchy=this._getHierarchy("uid","_parentuid","children",null,e.boundSource)),e.keyDataField&&e.parentDataField)return["keyDataField","parentDataField"].forEach((t=>{switch(e[t]){case"parent":e[t]="$"+e[t]}})),void(e.boundHierarchy=this._getHierarchy(e.keyDataField,e.parentDataField,"children",null,e.boundSource));e.groupBy&&e.groupBy.length>0?e.boundHierarchy=this._getGroupHierarchy(e.groupBy,"children","label",null,"data",null,"parent",e.boundSource):e.virtualDataSourceOnExpand&&(e.boundHierarchy=this._getHierarchy("id","parentId","children",null,e.boundSource))}_getGroupHierarchy(e,t,a,n,r,i,o,d,l){let s=this;l||(l=0);let c=s.reservedNames;const u=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()};let f=new Array;for(let t=0;t<e.length;t++)f[t]=u();t||(t="children"),a||(a="group"),r||(r="item"),o||(o="parent"),void 0===i&&(i="value");const h=new Array,p=new Array;let g=0;const S=function(e){let t=e;if(n)for(let e in n){const a=n[e];a.name&&a.map&&(t[a.map]=t[a.name])}return t};let y=!1;for(let n=0;n<d.length;n++){let m=Object.assign({},S(d[n]));m[c.leaf]=!1;let T=new Array,b=0;for(let t=0;t<e.length;t++){const a=e[t],n=m[a];null!=n?((""===n||void 0===n&&0===t)&&(y=!0),T[b++]={value:n,group:a,hash:f[t]}):(T[b++]={value:null,group:a,hash:f[t]},0===t&&(y=!0))}if(T.length!==e.length)break;let x=null,v="";for(let e=0;e<T.length;e++){const n=T[e].value,d=T[e].group;if(v=v+"_"+T[e].hash+"_"+n,void 0===p[v]||null===p[v]){if(null===x){x={$:{}},x[c.level]=0,x[c.leaf]=!1,x[o]=null,x[a]=n,x[r]=m,x.groupDataField=d,x[d]||(x[d]=x.data[d]),void 0!==m[c.expanded]?x[c.expanded]=m[c.expanded]:(x[c.expanded]=!1,s.expandHierarchy&&(x[c.expanded]=!0)),i&&(x[i]=m[i]),x[t]=new Array;let e=h.length+l;this.id&&"number"!=typeof m.$.id&&!isFinite(m.$.id)||(e="Item"+e),void 0===x.$.id&&(x.$.id=e),s._expandedRowIds[x.$.id]&&(x[c.expanded]=!0),s.expandHierarchy&&s._collapsedIds&&s._collapsedIds[x.$.id]&&(x[c.expanded]=!1),h[g++]=x}else{const e={$:{}};e[c.level]=x[c.level]+1,e[o]=x,e[a]=n,e[t]=new Array,e[r]=m,e.groupDataField=d,e[c.leaf]=!1,e[d]||(e[d]=e.data[d]),void 0!==m[c.expanded]?e[c.expanded]=m[c.expanded]:(e[c.expanded]=!1,s.expandHierarchy&&(e[c.expanded]=!0)),i&&(e[i]=m[i]),void 0===e.$.id&&(e.$.id=x.$.id+"_"+x[t].length),s.expandHierarchy&&s._collapsedIds&&s._collapsedIds[e.$.id]&&(e[c.expanded]=!1),s._expandedRowIds[e.$.id]&&(e[c.expanded]=!0),x[t][x[t].length]=e,x=e}p[v]=x}else x=p[v]}m&&(m[c.leaf]=!0),null!==x?(null===this.id?void 0===m.$.id&&(m.$.id=x.$.id+"_"+x[t].length):void 0===m.$.id&&-1===m.$.id.toString().indexOf(x.$.id)&&(m.$.id=x.$.id+"_"+m.$.id),m[o]=x,m[c.level]=x[c.level]+1,x[t][x[t].length]=m):void 0===m.$.id&&(m.$.id=u())}if(y){let e=null,t=!1;for(let a=0;a<h.length;a++){const n=h[a];if(!n[n.groupDataField]){e=n,e.$.id.toString().startsWith("Item")&&(t=!0),h.splice(a,1);break}}if(e&&(h.push(e),t))for(let e=0;e<h.length;e++){const t=h[e];t.$.id="Item"+e,Object.keys(s._expandedRowIds).length>0&&(s._expandedRowIds[t.$.id]?t[c.expanded]=!0:t[c.expanded]=!1,s.expandHierarchy&&(t[c.expanded]=!0,s._collapsedIds&&s._collapsedIds[t.$.id]&&(t[c.expanded]=!1)))}}return h}_getHierarchy(e,t,a,n,r){const i=this,o=new Array;let d=this.boundSource;if(r&&(d=r),0===this.boundSource.length)return null;const l=null!==a?a:"children";let s=new Array,c=d,u=c.length,f=i.reservedNames;const h=function(e){let t=e;if(n)for(let e in n){const a=n[e];a.name&&a.map&&(t[a.map]=t[a.name])}return t};for(let a=0;a<u;a++){let n=c[a],r=n[t],o=n[e];"parentId"===t&&(r=n.$.parentId),"id"===e&&(o=n.$.id),n[l]=new Array,i.expandHierarchy&&void 0===n[f.expanded]&&(n[f.expanded]=i.expandHierarchy),s[o]={parentId:r,item:n}}for(let a=0;a<u;a++){const n=c[a];let r=n[t],i=n[e];if("parentId"===t&&(r=n.$.parentId),"id"===e&&(i=n.$.id),void 0!==s[r]){let e={parentId:r,item:s[i].item},t=s[r].item;t[l]||(t[l]=new Array);let a=t[l].length;e=e.item,f?e[f.parent]=t:e.parent=t;const n=h(e);t[l][a]=n,s[r].item=t,s[i].item=e}else{let e=s[i].item;f?void 0===e[f.parent]&&(e[f.parent]=null):void 0===e.parent&&(e.parent=null);const t=h(e);f?t[f.level]=0:t.level=0,o[o.length]=t}}if(0!==o.length){let e=function(t,a){for(let n=0;n<a.length;n++){const r=a[n];f?r[f.level]=t:r.level=t;const o=r[l];o&&o.length>0?(r.leaf=!1,e(t+1,o)):i.virtualDataSourceOnExpand?void 0===r.leaf&&(r.leaf=!1):f?r[f.leaf]=!0:r.leaf=!0}};e(0,o)}return o}summarize(e,t){const a=this;Array.isArray(e)||(e=[e]);let n=[];for(let t=0;t<e.length;t++){const a=e[t];for(let e in a){const t=a[e];n.push({dataField:e,functions:t})}}e=n;let r={},i=new Array;t||(t=a.boundSource);let o=t.length,d=0;if(0!==o&&void 0!==o){for(let a=0;a<o;a++){let n=t[a];if((!n||!n.$||!1!==n.$.filtered)&&n){d++;for(let t=0;t<e.length;t++){const o=e[t];let d=n[o.dataField];if(o.functions&&o.functions.length>0){r[o.dataField]=r[o.dataField]||{},i[o.dataField]=i[o.dataField]||0,i[o.dataField]++;const e=function(e){for(let t in e){let a=r[o.dataField][t];null==a&&(r[o.dataField][t]=0,a=0),"function"==typeof e[t]&&(a=e[t](a,d,o.dataField,n)),r[o.dataField][t]=a}},t=d;let l=parseFloat(d);l=!isNaN(l),t&&t.toDate&&(l=!1),"string"==typeof d&&d.startsWith("+")&&(l=!1),l&&(d=parseFloat(d)),"number"==typeof d&&isFinite(d)?o.functions.forEach((function(t){let n=r[o.dataField][t];if(null==n&&(n=0,"min"===t&&(n=9999999999999),"max"===t&&(n=-9999999999999),"median"===t&&(n=[])),"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t)n+=parseFloat(d);else if("product"===t)0===a?n=parseFloat(d):n*=parseFloat(d);else if("min"===t)n=Math.min(n,parseFloat(d));else if("max"===t)n=Math.max(n,parseFloat(d));else if("count"===t)n++;else if("median"===t)n.push(parseFloat(d));else if("blank"===t)n=r[o.dataField][t],null==n&&(n=0),d||n++;else if("filled"===t)n=r[o.dataField][t],null==n&&(n=0),void 0!==d&&n++;else if("unique"===t)n=r[o.dataField][t],null==n&&(n=[]),-1===n.indexOf(d)&&n.push(d);else if("object"==typeof t)return void e(t);r[o.dataField][t]=n})):o.functions.forEach((function(t){if("min"===t||"max"===t||"count"===t||"product"===t||"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t){if(null===d&&"count"!==t)return!0;let e=r[o.dataField][t];return null==e&&(e=0),r[o.dataField][t]=e,!0}if("blank"===t){let e=r[o.dataField][t];null==e&&(e=0),d||e++,r[o.dataField][t]=e}else if("filled"===t){let e=r[o.dataField][t];null==e&&(e=0),d&&e++,r[o.dataField][t]=e}else if("unique"===t){let e=r[o.dataField][t];null==e&&(e=[]),-1===e.indexOf(d)&&e.push(d),r[o.dataField][t]=e}"object"==typeof t&&e(t)}))}}}}for(let a=0;a<e.length;a++){const n=e[a];if(n.functions&&(!n.functions||0!==n.functions.length)){if(r[n.dataField]||(r[n.dataField]={},n.functions.forEach((function(e){r[n.dataField][e]=0}))),void 0!==r[n.dataField].avg){const e=r[n.dataField].avg,t=i[n.dataField];r[n.dataField].avg=0===t||void 0===t?0:e/t}else void 0!==r[n.dataField].count&&(r[n.dataField].count=d);if(void 0!==r[n.dataField].unique){const e=r[n.dataField].unique;r[n.dataField].unique=e.length}if(void 0!==r[n.dataField].median){let e=r[n.dataField].median;e.sort((function(e,t){return e-t})),r[n.dataField].median=.5*(e[Math.floor((e.length+1)/2)-1]+e[Math.ceil((e.length+1)/2)-1])}(r[n.dataField].stdev||r[n.dataField].stdevp||r[n.dataField].var||r[n.dataField].varp)&&n.functions.forEach((function(e){if("stdev"===e||"var"===e||"varp"===e||"stdevp"===e){const a=r[n.dataField][e],i=o,d=a/o;let l=0;for(let e=0;e<o;e++){let a=t[e][n.dataField];l+=(a-d)*(a-d)}let s="stdevp"===e||"varp"===e?i:i-1;0===s&&(s=1),"var"===e||"varp"===e?r[n.dataField][e]=l/s:"stdevp"!==e&&"stdev"!==e||(r[n.dataField][e]=Math.sqrt(l/s))}}))}}return r}}_getDataItem(e,t){const a=this,n={},r="number"==typeof a.dataSource||a.dataSourceLength;if(!e)return{$:{id:t,isEmpty:!0,index:t}};if("string"==typeof e&&(e={"":e}),r){for(let e=0;e<a.dataFields.length;e++){n[(a.dataFields?a.dataFields[e]:{}).name]=""}return n.$={},n.$.id=t,n.$.index=t,n}const i=e;if(void 0!==i.expanded&&(n.expanded=i.expanded,"true"===i.expanded||!0===i.expanded||1===i.expanded?n.expanded=!0:n.expanded=!1),a.childrenDataField?void 0!==i[a.childrenDataField]&&(n.children=i[a.childrenDataField]):void 0!==i.children?n.children=i.children:void 0!==i.items&&(n.children=i.items),void 0!==i.leaf&&(n.leaf=i.leaf),void 0!==i.level&&(n.level=i.level),a.keyDataField&&void 0!==i[a.keyDataField]&&(n[a.keyDataField]=i[a.keyDataField]),a.parentDataField&&void 0!==i[a.parentDataField]&&(n[a.parentDataField]=i[a.parentDataField]),0===a.dataFields.length){const t=Object.getOwnPropertyNames(e);for(let e=0;e<t.length;e++)"$"!==t[e]&&a.dataFields.push({name:t[e],dataType:"string"})}for(let t=0;t<a.dataFields.length;t++){const r=a.dataFields?a.dataFields[t]:{};let o="";if(null==r)continue;if(e.length&&(o=e[t]),r.map){let e=r.map.split(a.mapChar);if(e.length>0){let t=i;for(let a=0;a<e.length;a++)i&&t&&(t=t[e[a]]);o=t}else o=i[r.map]}null!=o?o=o.toString():void 0===o&&null!==o&&(o="");let d=!1;if(""===o&&(d=!0,o=e[r.name],void 0===r.dataType&&(r.dataType="any"),null!=o?"array"!==r.dataType&&("any"===r.dataType?o=Array.isArray(e[r.name])?[...e[r.name]]:"object"==typeof e[r.name]?Object.assign({},e[r.name]):e[r.name]:"date"!==r.dataType&&(o=o.toString())):o=void 0===o&&"any"===r.dataType?null:""),"[object Object]"===o&&r.map&&d&&(o=""),a._cachedValues[o+"_"+r.dataType])o=a._cachedValues[o+"_"+r.dataType];else{if("bool"===r.dataType||"boolean"===r.dataType)"true"===o||"1"===o?o=!0:"false"!==o&&"0"!==o||(o=!1);else if("number"===r.dataType)-1===o.indexOf(".")&&o.indexOf(",")>=0&&o.substring(1+o.indexOf(",")).length<3&&(o=o.replace(",",".")),o=a.$document.deserialize(""+o,r.dataType,!0);else if("date"===r.dataType)if(r.formatString&&Smart.Utilities.DateTime){o=Smart.Utilities.DateTime.ParseDate(o,r.formatString)}else o=a.$document.deserialize(""+o,r.dataType,!0);else"any"!==r.dataType&&(o="string"===r.dataType&&"null"===o?"null":a.$document.deserialize(""+o,r.dataType,!0));"any"!==r.dataType&&(a._cachedValues[o+"_"+r.dataType]=o)}"string"!==r.dataType&&"boolean"!==r.dataType&&"bool"!==r.dataType&&"any"!==r.dataType&&(isNaN(o)||o===-1/0||o===1/0)&&(o="date"===r.dataType||"number"===r.dataType?null:0),"parent"!==r.name&&"group"!==r.name&&"leaf"!==r.name&&"level"!==r.name?("string"===r.dataType&&/<.+?>/.test(o)&&o.replace&&("all"===a.sanitizeHTML?o=o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""):"blackList"===a.sanitizeHTML&&(o=window.Smart.Utilities.Core.sanitizeHTML(o))),n[r.name]=o):n.$[r.name]=o}let o=t;if(a.id){if(o=i[a.id],void 0===o){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};o=e()+e()}"object"==typeof o&&(o=t),i.$&&void 0!==i.$.id&&(o=i.$.id)}else if(!a.virtualDataSource&&a.dataItemById&&a.dataItemById[o])for(o=a.length;a.dataItemById[o];)o++;return n.$||(n.$={}),n.$.id=o,n.$.index=t,new Object(n)}_bindToArray(){const e=this,t="number"==typeof e.dataSource||e.dataSourceLength,a=[];e.boundSource.canNotify=!1;const n=t?"number"==typeof e.dataSource?e.dataSource:e.dataSource.length:e.observable?e.length:e.dataSource.length;for(let r=0;r<n;r++){const n=t?{}:e.dataSource[r],i=e._getDataItem(n,r);a.push(i)}if(t&&e.dataSourceLength&&e.dataSource.length>0)for(let t=0;t<e.dataSource.length;t++){const n=e.dataSource[t].cell,r=e.dataSource[t].value,i=n.replace(/[^0-9]/g,""),o=n.replace(/[0-9]/g,"");a[i-1][o]=r}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new Smart.ObservableArray(a),e.observable&&(e.boundSource=new Smart.ObservableArray(a));for(let t=0;t<n;t++)e.observable?e[t]=e.boundSource[t]:e[t]=a[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=a),e.boundSource.canNotify=!0}_bindToICS(){const e=this,t=""+e.dataSource,a=e.rowDelimiter||"\n",n=t.split("\r"),r=[];let i=t.split(a),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=function(e,t){var a=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z)?$/.exec(e);if(!a)throw new Error("Invalid UNTIL value: "+e);return t?new Date(a[1],a[2]-1,a[3],0,0,0,0):new Date(Date.UTC(a[1],a[2]-1,a[3],a[5]||0,a[6]||0,a[7]||0))};for(let e=0;e<o;e++){const t=i[e].trim();if(t.indexOf("BEGIN:VEVENT")>=0)var l={};else if(l)if(t.indexOf("BEGIN:VALARM")>=0)var s={};else{if(s){if(t.indexOf("ACTION")>=0){s.ACTION=t.substring(t.indexOf("ACTION")+7);continue}if(t.indexOf("DESCRIPTION")>=0){s.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);continue}if(t.indexOf("TRIGGER")>=0){s.TRIGGER=t.substring(t.indexOf("TRIGGER")+8);continue}if(t.indexOf("END:VALARM")>=0){l.ALARM||(l.ALARM=[]),l.ALARM.push(s),s=void 0;continue}}if(t.indexOf("SUMMARY")>=0)l.SUMMARY=t.substring(t.indexOf("SUMMARY")+8);else if(t.indexOf("LOCATION")>=0)l.LOCATION=t.substring(t.indexOf("LOCATION")+9);else if(t.indexOf("DESCRIPTION")>=0)l.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);else if(t.indexOf("RRULE")>=0)l.RRULE=t.substring(t.indexOf("RRULE")+6);else if(t.indexOf("RECURRENCE-ID")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID")+14);else if(t.indexOf("RECURRENCE-ID;VALUE=DATE")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID;VALUE=DATE")+25);else if(t.indexOf("EXDATE;VALUE=DATE")>=0){const e=t.substring(t.indexOf("EXDATE;VALUE=DATE")+20);l.EXDATE=e}else if(t.indexOf("EXDATE")>=0){const e=t.substring(t.indexOf("EXDATE")+7);l.EXDATE=e}else t.indexOf("DTEND;VALUE=DATE")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND;VALUE=DATE")+17),!0):t.indexOf("DTEND")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND")+6)):t.indexOf("DTSTART;VALUE=DATE")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART;VALUE=DATE")+19),!0):t.indexOf("DTSTART")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART")+8)):t.indexOf("UID")>=0?l.uid=l.UID=t.substring(t.indexOf("UID")+4):t.indexOf("STATUS")>=0?l.STATUS=t.substring(t.indexOf("STATUS")+7):t.indexOf("TITLE")>=0?l.TITLE=t.substring(t.indexOf("TITLE")+6):t.indexOf("CATEGORIES")>=0?l.CATEGORIES=t.substring(t.indexOf("CATEGORIES")+11):t.indexOf("END:VEVENT")>=0&&(r.push(l),l.ALARM&&(l.ALARM=JSON.stringify(l.ALARM)),s=void 0)}}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_bindToJSON(){const e=this,t=[],a=e.dataSource.length?e.dataSource:Object.entries(e.dataSource);e.boundSource.canNotify=!1;for(let n=0;n<a.length;n++){const r=a[n],i=e._getDataItem(r,n);t.push(i)}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new Smart.ObservableArray(t);for(let t=0;t<e.length;t++)e[t]=e.boundSource[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=t),e.boundSource.canNotify=!0}sortBy(e,t,a){const n=this;if(!t)for(let a=0;a<n.dataFields.length;a++){const r=n.dataFields[a];if(r.name===e){t=r.dataType;break}}if(n.boundHierarchy){if((!e||0===e.length)&&n.groupBy.length>0)return void n.refreshHierarchy();const r=(e=>{let t=[];for(;e;){t=t.concat(e);for(let a=0;a<e.length;a++)e[a].children&&(t=t.concat(e[a].children));e=e.children}return t})(n.boundHierarchy);if(r){r.find((e=>{if(e.summaryRow)return e}))&&n.refreshHierarchy()}const i=function(r){n._sort(r,e,a,t);for(let n=0;n<r.length;n++){const o=r[n];o.children&&i(o.children,e,a,t)}};i(n.boundHierarchy)}else n._sort(n.boundSource,e,a,t)}_createFilter(e,t){const a={"=":"EQUAL","<>":"NOT_EQUAL","!=":"NOT_EQUAL",not_like:"DOES_NOT_CONTAIN",like:"CONTAINS","<":"LESS_THAN",">":"GREATER_THAN","<=":"LESS_THAN_OR_EQUAL",">=":"GREATER_THAN_OR_EQUAL",equal:"EQUAL","not equal":"NOT_EQUAL","less than":"LESS_THAN","greater than":"GREATER_THAN","greater than or equal":"GREATER_THAN_OR_EQUAL","less than or equal":"LESS_THAN_OR_EQUAL","starts with":"STARTS_WITH","ends with":"ENDS_WITH",notEqual:"NOT_EQUAL",not_equal:"NOT_EQUAL",lessThan:"LESS_THAN",greaterThan:"GREATER_THAN",greaterThanOrEqual:"GREATER_THAN_OR_EQUAL",lessThanOrEqual:"LESS_THAN_OR_EQUAL",less_than:"LESS_THAN",greater_than:"GREATER_THAN",greater_than_or_equal:"GREATER_THAN_OR_EQUAL",less_than_or_equal:"LESS_THAN_OR_EQUAL",null:"null","":"EMPTY",isblank:"EMPTY",isnotblank:"NOT_EMPTY",isBlank:"EMPTY",isNotBlank:"NOT_EMPTY",CONTAINS:"CONTAINS",DOES_NOT_CONTAIN:"DOES_NOT_CONTAIN",contains:"CONTAINS",does_not_contain:"DOES_NOT_CONTAIN","not contains":"DOES_NOT_CONTAIN",notcontains:"DOES_NOT_CONTAIN",notContains:"DOES_NOT_CONTAIN",startswith:"STARTS_WITH",endswith:"ENDS_WITH",starts_with:"STARTS_WITH",ends_with:"ENDS_WITH",startsWith:"STARTS_WITH",endsWith:"ENDS_WITH",NULL:"NULL",NOT_NULL:"NOT_NULL"};let n=[];"string"==typeof t&&(t=[t]);for(let e=0;e<t.length;e++){const a=t[e],r=-1===a.indexOf('"')?a.split(" "):a.split('"');let i=[];for(let e=0;e<r.length;e++){const t=r[e];""!==t&&" "!==t&&i.push(t.trim())}n.push(i)}const r=new Smart.FilterGroup,i=[],o=[];for(let t=0;t<n.length;t++){const r=n[t];if(r.length>1){const t=new Smart.FilterGroup;let n="and",i=0;for(let o=0;o<r.length;o++){let d=r[o];if("and"!==d&&"or"!==d){if(i++,2===i){let l=a[r[o-1]];l||(l=r[o-1]),"number"===e&&(d=parseFloat(d)),"date"===e&&(d=new Date(d));const s=t.createFilter(e,d,l);i=0,n&&t.addFilter(n,s)}}else n=d}o.push(t)}else{let e=r[0];if(e&&a[e]&&(e="and"),"and"!==e&&"or"!==e)throw new Error('Filter Exprresion expects "AND" or "OR", but the token is: '+e);i.push(e)}}let d=0;if(1===o.length)return o[0];for(let e=0;e<o.length;e++){let t=i[d];(e+1)%2==0&&d++,t||(t="and"),r.addFilter(t,o[e])}return r}filterBy(e,...t){const a=this,n=(()=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}})(),r=a._createFilter(n,t);return a.boundSource.filter((t=>r.evaluate(t[e])))}_filter(e,t="and"){const a=this,n=[],r=[];if(0===e.length)return void a.clearFilter();const i=e=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}};let o,d;"and"===t?(o=!0,d=function(e,t,a){return e&&t.evaluate(a[t.dataField])}):(o=!1,d=function(e,t,a){return e||t.evaluate(a[t.dataField])});for(let t=0;t<e.length;t++){const o=e[t],d=o[0];let l=null;l=o[1]instanceof Smart.FilterGroup?o[1]:a._createFilter(i(d),o.splice(1)),l&&(r.push(d),l.dataField=d,n.push(l))}if(a.boundHierarchy){const e=function(e){let t=o;for(let a=0;a<n.length;a++){const r=n[a];t=d(t,r,e)}return e.$.filtered=t,t},t=function(n,r,i){let o=0;for(let a=0;a<n.length;a++){const i=n[a];e(i),i.$.filtered&&o++,i.children&&t(i.children,i,r)}o>0&&a.groupBy.length>0&&r?(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0)):o>0&&o!==n.length&&r?(r.$.filtered=null,i&&!i.$.filtered&&(i.$.filtered=null)):o>0&&o===n.length&&r&&(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0))};t(a.boundHierarchy,null,null)}else for(let e=0;e<a.boundSource.length;e++){const t=a.boundSource[e];let r=o;for(let e=0;e<n.length;e++){const a=n[e];r=d(r,a,t)}t.$.filtered=r}a.onFilter&&a.onFilter()}clearGroup(){const e=this;e.groupBy=[],e.boundHierarchy=null,e.refreshHierarchy(),e.onGroup&&e.onGroup()}clearFilter(){const e=this;for(let t=0;t<e.boundSource.length;t++){e.boundSource[t].$.filtered=!0}if(e.boundHierarchy){const t=function(e,a,n){for(let n=0;n<e.length;n++){const r=e[n];r.$.filtered=!0,r.$.filtered,r.children&&t(r.children,r,a)}a&&(a.$.filtered=!0,n&&!n.$.filtered&&(n.$.filtered=!0))};t(e.boundHierarchy,null,null)}e.onFilter&&e.onFilter()}clearSort(){this._sort(this.boundSource,[],[],[])}_sort(e,t,a,n,r,i){const o=this;let d=!1;if(0===e.length)return;if(e&&e.constructor&&e instanceof Smart.ObservableArray&&(d=!0),(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)&&!d&&!o.boundHierarchy)throw new Error("sort: Missing or Invalid arguments!");"string"==typeof t&&(t=[t]);const l=[],s=[];void 0===a&&(a=[]);const c=function(e,t){let a;switch(t||typeof e){case"string":a=(new Intl.Collator).compare;break;case"number":case"int":case"bigInt":case"float":case"double":a=function(e,t){return e-t};break;case"boolean":case"bool":a=function(e,t){return e===t?0:!1===e?-1:1};break;case"date":case"time":case"dateTime":a=e instanceof Date?function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0}:e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber?function(e,t){return e.compare(t)}:function(e,t){return e-t};break;case"object":if(e instanceof Date)a=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber)a=function(e,t){return e.compare(t)};else if(e instanceof Smart.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new Smart.Utilities.ComplexNumericProcessor;a=function(t,a){return e.compareComplexNumbers(t,a)}}}return a};for(let r=0;r<t.length;r++){void 0===a[r]||"asc"===a[r]||"ascending"===a[r]?l[r]=1:l[r]=-1;let d=e[0][t[r]];if(void 0===d&&e[0]&&e[0].children&&e[0].data&&(d=e[0].data[t[r]]),i&&i){const e=t[r];if(i[e]){s[r]=i[e];continue}}o.sortComparators&&o.sortComparators[t[r]]?s[r]=o.sortComparators[t[r]]:s[r]=c(d,n[r])}t.length>0&&r?r(e,t,a,s):e.sort((function(e,a){for(let n=0;n<t.length;n++){const r=s[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e.$.index?(e.$.index-a.$.index)*l[n]:0}return r*l[n]}if(0===t.length)return e.$.index<a.$.index?-1:e.$.index>a.$.index?1:0}));for(let t=0;t<e.length;t++)o[t]=e[t]}static Filter(e,t,a,n,r="and"){let i,o;"and"===r?(i=!0,o=function(e,t,a,r){return n?e&&n(t,a,r):e&&r.evaluate(t[a])}):(i=!1,o=function(e,t,a,r){return n?e||n(t,a,r):e||r.evaluate(t[a])});return e.filter((e=>{let n=i;for(let r=0;r<a.length;r++){const i=a[r],d=t[r];n=o(n,e,d,i)}return n}))}filter(e,t,a){Smart.DataAdapter.Filter(this.boundSource,e,t,a)}sort(e,t,a){Smart.DataAdapter.Sort(this.boundSource,e,t,a)}static Sort(e,t,a,n){const r=function(e){let t;switch(typeof e){case"string":if(e.indexOf("-")>=0||e.indexOf("/")>=0){const t=new Date(e);if(t&&"Invalid Date"!==t.toString()){return function(e,t){const a=new Date(e),n=new Date(t);return a||n?a?n?a.getTime()-n.getTime():1:-1:0}}}t=(new Intl.Collator).compare;break;case"number":t=function(e,t){return e-t};break;case"boolean":t=function(e,t){return e===t?0:!1===e?-1:1};break;case"object":if(e instanceof Date)t=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber)t=function(e,t){return e.compare(t)};else if(e instanceof Smart.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new Smart.Utilities.ComplexNumericProcessor;t=function(t,a){return e.compareComplexNumbers(t,a)}}else t=function(e,t){return e-t}}return t};if(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)return;"string"==typeof t&&(t=[t]);const i=[],o=[];void 0===a&&(a=[]);for(let n=0;n<t.length;n++)void 0===a[n]||"asc"===a[n]||"ascending"===a[n]?i[n]=1:i[n]=-1,o[n]=r(e[0][t[n]]);if(n)return void n(e,t,a,o);const d=e.slice(0);return d.sort((function(e,a){for(let n=0;n<t.length;n++){const r=o[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e._index?(e._index-a._index)*i[n]:0}return r*i[n]}})),d}};class e{constructor(e,t){const a=this;a.config=e,a.callback=t,!1!==e.autoFetch&&a.call(e)}call(e){const t=this;e||(e=t.config);let a="GET",n=e.url,r=null,i=!0;if(e.type&&(a=e.type),e.data)if("GET"===a){n+="?";for(let t in e.data)Object.prototype.hasOwnProperty.call(e.data,t)&&(n+=encodeURI(t+"="+e.data[t]+"&"));"&"===n.charAt(n.length-1)&&(n=n.slice(0,n.length-1))}else"POST"===a&&(r=JSON.stringify(e.data));e&&!1===e.async&&"xlsx"!==e.dataSourceType&&(i=!1),void 0!==window.fetch&&i?t.ajaxFetch(e,a,n,r):t.ajaxXMLHttpRequest(e,a,n,r,i)}ajaxFetch(e,t,a,n){const r=this,i={method:t};let o,d,l,s;switch(e.dataSourceType){case"json":o="json";break;case"xlsx":o="arrayBuffer";break;default:o="text"}if(e&&e.contentType&&(i.headers=new Headers({"Content-Type":e.contentType})),null!==n&&(i.body=n),e.timeout&&(l=setTimeout((function(){s=!0}),e.timeout)),e.beforeSend){if(!1===e.beforeSend(i,e))return}fetch(a,i).then((function(e){if(s)throw d=408,new Error("timeout");if(l&&clearTimeout(l),d=e.status,!e.ok)throw new Error(e.statusText);return e[o]()})).then((function(t){if("arrayBuffer"===o)return JSZip.loadAsync(t).then((function(t){return t.files["xl/worksheets/sheet1.xml"].async("text").then((function(a){return t.files["xl/sharedStrings.xml"].async("text").then((function(t){const n=r.parseXLSXData(a,t);r.ajaxComplete(e,n,d)}))}))}));r.ajaxComplete(e,t,d)})).catch((function(t){"JSZip is not defined"===t.message&&(t.message="JSZip is not defined. Please include a reference to JSZip to be able to load data from XLSX files."),e&&e.loadError&&e.loadError(d,t),r.callback&&r.callback(t,d)}))}ajaxXMLHttpRequest(e,t,a,n,r){const i=new XMLHttpRequest,o=this;if(i.open(t,a,r),i.ontimeout=function(){e&&e.loadError&&e.loadError(408,"timeout")},i.onload=function(){if(4===i.readyState){const t=i.status;let a=i.response;t>=200&&t<=299?("json"===e.dataSourceType&&(a=JSON.parse(a)),o.ajaxComplete(e,a,t)):e&&e.loadError&&e.loadError(t,a)}},i.onerror=function(){e&&e.loadError&&e.loadError(i.status,i.response)},e&&e.contentType&&i.setRequestHeader("Content-Type",e.contentType),r&&e.timeout&&(i.timeout=e.timeout),e.beforeSend){if(!1===e.beforeSend(i,e))return}i.send(n)}ajaxComplete(e,t,a){if(e){if(e.beforeLoadComplete){const a=e.beforeLoadComplete(t);a&&(t=a)}e.loadComplete&&e.loadComplete(t,a),this.callback&&this.callback(t,a)}}parseXLSXData(e,t){const a=new DOMParser,n=a.parseFromString(t,"text/xml"),r=Array.from(n.getElementsByTagName("si")),i=[],o=a.parseFromString(e,"text/xml"),d=Array.from(o.getElementsByTagName("row")),l=[];return r.forEach((function(e){let t=e.getElementsByTagName("t");if(1===t.length)i.push(t[0].innerHTML);else{let e="";t=Array.from(t),t.forEach((function(t){e+=t.innerHTML})),i.push(e)}})),d.forEach((function(e){const t={};Array.from(e.getElementsByTagName("c")).forEach((function(e){const a=e.getAttribute("r").match(/\D+/)[0],n=e.getAttribute("t"),r=e.getElementsByTagName("v")[0].innerHTML;let o;switch(n){case"s":o=i[parseFloat(r)];break;case"b":o=1===parseFloat(r);break;default:o=parseFloat(r)}t[a]=o})),l.push(t)})),l}}Smart.Ajax=window.Ajax=e})();
|
|
8
|
+
(()=>{Smart.DataAdapter=window.smartDataAdapter=class{constructor(e){e||(e={});const t=Object.assign(this,e);t.key=(65536*(1+Math.random())|0).toString(16).substring(1),t.$document=Smart.Utilities.Extend(document),t.boundSource=!1===t.observable||t.virtualDataSource?[]:new Smart.ObservableArray,t.dataItemById=[],void 0===t.allowAdd&&(t.allowAdd=!0),void 0===t.allowRemove&&(t.allowRemove=!0),void 0===t.allowUpdate&&(t.allowUpdate=!0),void 0===t.mapChar&&(t.mapChar="."),void 0!==e.observable||t.virtualDataSource?t.observable=!1:t.observable=!0,void 0===t.sanitizeHTML&&(t.sanitizeHTML="blackList"),t._expandedRowIds=[],e.dataSource||(t.dataSource=[]),e.dataFields||(t.dataFields=[]),e.dataSourceType||(t.dataSourceType="array"),e.id||(t.id=null),e.autoFetch||(t.autoFetch=!0),e.dataFields&&(t.dataFields=e.dataFields),Object.defineProperty(t,"groupBy",{configurable:!1,enumerable:!0,get:()=>t._groupBy?t._groupBy:[],set(e){const a=()=>{t.boundHierarchy=null,t.refreshHierarchy(),t.onGroup&&t.onGroup()};t._groupBy=new Smart.ObservableArray(e),t._groupBy.notify((function(){a()})),t.isInitialized&&a()}}),e.groupBy?e.groupBy.toArray?t.groupBy=e.groupBy.toArray():t.groupBy=e.groupBy:t.groupBy=[],e&&!1!==e.autoBind&&t.dataBind(),t.isInitialized=!0}beginUpdate(){this.isUpdating=!0}endUpdate(){const e=this;e.isUpdating=!1,e.refreshIndexes(),e.refreshHierarchy()}get expandHierarchy(){return void 0===this._expandHierarchy&&(this._expandHierarchy=!1),this._expandHierarchy}set expandHierarchy(e){const t=this;t._expandHierarchy=e,t.isInitialized&&t.refreshHierarchy()}_getDataField(e){switch(e.name){case"leaf":case"parent":case"expanded":case"checked":case"selected":case"level":case"icon":case"data":case"group":case"children":case"items":e.map?e.map=e.map.replace(e.name,"$"+e.name):e.map=e.name,e.name="$"+e.name}}get dataFields(){return this._dataFields}set dataFields(e){const t=this;return t._dataFields=t._getDataFieldObjects(e),t._dataFields}_getDataFieldObjects(e){const t=this;let a=[];if("number"==typeof e){const t="A".charCodeAt(0);let n="",r=0;for(let i=0;i<e;i++){const e=String.fromCharCode(t+r);r++;const i=n+e;a.push({name:i,dataType:"string"}),r>=26&&(r=0,n+="A")}}else if(Array.isArray(e)&&e.length>0)for(let n=0;n<e.length;n++){const r=e[n];if("string"==typeof r){const e=r.split(":"),t=e[0].trim(),n=e.length>1?e[1].trim():"string";a.push({name:t,dataType:n})}else a.push(r);t._getDataField(a[a.length-1])}return a}get dataSource(){const e=this;return e._dataSource||(e._dataSource=[]),e._dataSource}set dataSource(e){const t=this;t._dataSource=e,t.isInitialized&&(t.boundSource=!1===t.observable||t.virtualDataSource?[]:new Smart.ObservableArray,t.dataItemById=[],t.bindingCompleted=!1,t.dataBind(),t.refreshIndexes())}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;t.canNotify&&t.notifyFn&&t.notifyFn(e)}notify(e){e&&(this.notifyFn=e)}toArray(){const e=this;return!1===e.observable?e.boundSource:e.boundSource.toArray()}forEach(e){const t=this;if(e)if(t.boundHierarchy&&t.boundHierarchy.length>0){const a=(e=>{let t=[];for(;e;){t=t.concat(e);for(let a=0;a<e.length;a++)e[a].children&&(t=t.concat(e[a].children));e=e.children}return t})(t.boundHierarchy);for(let t=0;t<a.length;t++){e(a[t],t)}}else for(let a=0;a<t.boundSource.length;a++){e(t.boundSource[a],a)}}dataBind(){const t=this;t.bindingCompleted=!1,t.clear();const a=()=>{t.observable&&(t.boundSource.notify||(t.boundSource=new Smart.ObservableArray),t.boundSource.notify((function(e){if("update"===e.action&&e.path&&e.path.indexOf(".")>=0&&-1===e.path.indexOf("children")&&-1===e.path.indexOf("parent")&&-1===e.path.indexOf("loaded")&&-1===e.path.indexOf("level")&&-1===e.path.indexOf("leaf")&&-1===e.path.indexOf("expanded")){let a=!1;for(let n=0;n<t.dataFields.length;n++){const r=t.dataFields[n].name;e.path.indexOf(r)>=0&&(a=!0)}t._notify&&a&&t._notify({action:"update",data:e.target,index:e.index})}}))),t._onBindingComplete()};"string"==typeof t.dataSource&&(t.dataSource.indexOf(".json")>=0||"json"===t.dataSourceType)?(t.url=t.dataSource,t.dataSourceType="json",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".xml")>=0?(t.url=t.dataSource,t.dataSourceType="xml",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".xlsx")>=0?(t.url=t.dataSource,t.dataSourceType="xlsx",new e(t,(e=>{if(!e[0])return e=[],t._bindToArray(),void a();const n=Object.keys(e[0]),r={},i=[];if(!1!==t.exportHeader){let a=0;for(let e in n){r[n[e]]=t.dataFields[a++].name}for(let t=1;t<e.length;t++){const a=e[t],o={};for(let e in n){const t=n[e];o[r[t]]=a[t]}i.push(o)}t.dataSource=i}t._bindToArray(),a()}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".csv")>=0?(t.url=t.dataSource,t.dataSourceType="csv",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&t.dataSource.indexOf(".tsv")>=0?(t.url=t.dataSource,t.dataSourceType="tsv",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&(t.dataSource.indexOf(".ics")>=0||t.dataSource.indexOf(".php")>=0&&"ics"===t.dataSourceType||t.dataSource.indexOf(".txt")>=0&&"ics"===t.dataSourceType)?(t.url=t.dataSource,t.dataSourceType="ics",new e(t,(e=>{t.dataSource=e}))):"string"==typeof t.dataSource&&(t.dataSource.indexOf("BEGIN:VCALENDAR")>=0||"ics"===t.dataSourceType)?(t._bindToICS(),a()):"string"==typeof t.dataSource&&(t.dataSource.indexOf("<?xml")>=0||"xml"===t.dataSourceType)?(t._bindToXML(),a()):"string"==typeof t.dataSource&&(t.dataSource.indexOf(" ")>=0||t.dataSource.indexOf(",")>=0||"tsv"===t.dataSourceType||"csv"===t.dataSourceType||"tab"===t.dataSourceType)?(t._bindToCSV(),a()):"array"===t.dataSourceType?(t._bindToArray(),a()):"json"===t.dataSourceType&&(t._bindToJSON(),a())}_bindToXML(){const e=this;let t=null,a=null;window.DOMParser&&(t=new DOMParser,a=t.parseFromString(e.dataSource,"text/xml")),void 0===e.root&&(e.root=""),void 0===e.record&&(e.record="");const n=a.querySelectorAll(e.root+" "+e.record),r=n.length,i=[];let o=e.dataFields?e.dataFields.length:0;if(0===o){const t=n[0],a=new Array;for(let e in t){const t=e;a[a.length]={name:t}}e.dataFields=a,o=a.length}for(let t=0;t<r;t++){const a=n[t],r={};if(void 0===a)break;if(e.id){const t=a.querySelector(e.id);r[e.id]=t.textContent}for(let t=0;t<o;t++){const n=e.dataFields[t],i=a.querySelector(n.map||n.name);r[n.name]=i.textContent}i[t]=r}e.canNotify=!1,e.dataSource=i,e.canNotify=!0,e._bindToArray()}static BindToCSV(e,t=!1){const a=""+e,n=-1===a.indexOf(",")?"\t":",",r=a.split("\r"),i=new Array,o=[];let d=a.split("\n"),l=d.length;1===l&&r.length>1&&(d=r,l=d.length);const s=!0===t;for(let e=0;e<l;e++){const t={},a=d[e].split(n);for(let n=0;n<a.length;n++){let r=o[n],i=a[n];if(r||(o.push({name:i.trim()}),r=o[o.length-1]),i=i.trim(),1!==e||s)switch(r.dataType){case"boolean":i="false"!==i;break;case"number":i=parseFloat(i);break;case"date":i=new Date(i)}else{let e="string";"false"===i||"true"===i?(e="boolean",i="false"!==i):isNaN(parseInt(i)&&-1===i.indexOf("/"))?(i.indexOf("-")>=0||i.indexOf("/")>=0||i.indexOf(":")>=0)&&"Invalid Date"!==new Date(i).toString()&&(e="date",i=new Date(i)):(e="number",i=parseFloat(i)),r.dataType||(r.dataType=e)}t[r.name]=i}(s||e>0)&&i.push(t)}return i}_bindToCSV(){const e=this,t=""+e.dataSource,a=-1===t.indexOf(",")?"\t":",",n=t.split("\r"),r=new Array;let i=t.split("\n"),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=e.dataFields.length>0;for(let t=0;t<o;t++){const n=i[t],o={},l=i[t].split(a);for(let a=0;a<l.length;a++){let r=e.dataFields[a],i=l[a];if(r||(e.dataFields.push({name:i.trim()}),r=e.dataFields[e.dataFields.length-1]),r.map&&(i=n[r.map]),i=i.trim(),1!==t||d)switch(r.dataType){case"boolean":i="false"!==i;break;case"number":i=parseFloat(i);break;case"date":i=new Date(i)}else{let e="string";"false"===i||"true"===i?(e="boolean",i="false"!==i):isNaN(parseInt(i)&&-1===i.indexOf("/"))?(i.indexOf("-")>=0||i.indexOf("/")>=0||i.indexOf(":")>=0)&&"Invalid Date"!==new Date(i).toString()&&(e="date",i=new Date(i)):(e="number",i=parseFloat(i)),r.dataType||(r.dataType=e)}o[r.map||r.name||a.toString()]=i}(d||t>0)&&r.push(o)}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_onBindingComplete(){const e=this;e._buildHierarchy(),e.onBindingComplete&&e.onBindingComplete({data:e.boundSource}),e._notify&&e._notify({action:"bindingComplete",data:e.boundSource}),e.bindingCompleted=!0}refreshHierarchy(){this.isUpdating||this._buildHierarchy()}find(){return this.boundSource.find.apply(this.boundSource,arguments)}onVirtualDataSourceRequested(e,t){const a=this;let n=t?t.first:1/0,r=t?t.last:1/0,i=t?t.row:null;if(void 0===n&&(n=1/0),void 0===r&&(r=1/0),a.virtualFirstIndex=n,a.virtualLastIndex=r,a.virtualDataSource){const o=function(r){void 0!==r.virtualDataSourceLength&&(a.virtualDataSourceLength=r.virtualDataSourceLength),new Smart.DataAdapter({dataSource:r.dataSource,dataFields:r.dataFields||a.dataFields,data:t,keyDataField:r.keyDataField,parentDataField:r.parentDataField,observable:!1,id:r.id||a.id,onBindingComplete(r){if(void 0===t.result&&(t.result=!0),a.virtualDataSourceOnExpand&&i)return a.groupBy.length>0?r.data&&r.data.length>0&&a.add(r.data):r.data&&r.data.length>0?a.add(r.data,i.$.id):i.leaf=!0,a.onFilter&&a.onFilter(),void e(t);n===1/0&&"scroll"===t.action?r.data&&r.data.length&&a.add(r.data):"filter"===t.action||"group"===t.action?(a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0):("add"===t.action||"update"===t.action||t.action,a.canNotify=!1,a.dataSource=r.data,a.canNotify=!0),a.onFilter&&a.onFilter(),e(t)}})};let d={};if(t.sorting&&t.sorting.length>0){let e=[];for(let a in t.sorting)e.push(a+" "+t.sorting[a].sortOrder.toUpperCase());const a=" ORDER BY "+e.join(", ");d.orderBy=a}else d.orderBy="";if(void 0===n||void 0===r||0===n&&0===r)d.limit="";else{const e=r-n,t=" LIMIT "+e+" OFFSET "+n;d.limit=t,isNaN(e)&&(d.limit="")}if(t.grouping&&t.grouping.length>0){const e=" GROUP BY "+t.grouping[0];d.groupBy=e}else d.groupBy="";if(t.filtering&&t.filtering.length>0){const e=(e,t)=>{switch(t.condition){case"EMPTY":return e+" = ''";case"NOT_EMPTY":return e+" != ''";case"EQUAL":return e+" = '"+t.value+"'";case"NOT_EQUAL":return e+" != '"+t.value+"'";case"CONTAINS_CASE_SENSITIVE":case"CONTAINS":return e+" LIKE '%"+t.value+"%'";case"DOES_NOT_CONTAIN_CASE_SENSITIVE":case"DOES_NOT_CONTAIN":return e+" NOT LIKE '%"+t.value+"%'";case"STARTS_WITH_CASE_SENSITIVE":case"STARTS_WITH":return e+" LIKE '"+t.value+"%'";case"ENDS_WITH_CASE_SENSITIVE":case"ENDS_WITH":return e+" LIKE '%"+t.value+"'";case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL"}},a=(e,t)=>{switch(t.condition){case"EQUAL":return e+" = "+t.value;case"NOT_EQUAL":return e+" != "+t.value;case"GREATER_THAN":return e+" > "+t.value;case"GREATER_THAN_OR_EQUAL":return e+" >= "+t.value;case"LESS_THAN":return e+" < "+t.value;case"LESS_THAN_OR_EQUAL":return e+" <= "+t.value;case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL";case"RANGE":return"("+e+" >= "+t.value+" and "+e+" <= "+t.valueTo+")"}},n=(e,t,a)=>{if(a.operator){var n=e(t,a.condition1),r=e(t,a.condition2);return"("+n+" "+a.operator+" "+r+")"}return e(t,a)};let r=[];for(let i in t.filtering){const o=t.filtering[i];let d=o.filters,l=[],s=" AND ";for(let t=0;t<d.length;t++){const r=d[t];switch(r.type){case"stringFilter":l.push(n(e,i,r));break;case"numericFilter":case"dateFilter":case"booleanFilter":l.push(n(a,i,r))}1===o.logicalOperators[t]&&(s=" OR ")}r.push("("+l.join(s)+")")}if(r.length>0){let e=" AND ";t.filterOperator&&"or"===t.filterOperator.toLowerCase()&&(e=" OR "),d.where=" WHERE "+r.join(e)}else d.where=""}else d.where="";if("dataBind"===t.action&&a.virtualDataSourceOnExpand&&a.keyDataField&&a.parentDataField&&(d.where?d.where+=" AND "+a.parentDataField+" IS NULL":d.where=" WHERE "+a.parentDataField+" IS NULL"),"update"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+"='"+t.edit.row[n]+"'");d.update=" SET "+e.join(", ")+" WHERE "+a.id+"="+t.edit.row[a.id]}if("remove"===t.action){const e=[];for(let n in t.edit.row)"$"!==n&&n!==a.id&&e.push(n+" = '"+t.edit.row[n]+"'");d.remove=" WHERE "+a.id+"="+t.edit.row[a.id]}if("add"===t.action){const e=[],a=[];for(let n in t.edit.row)"$"!==n&&(a.push(n),e.push("'"+t.edit.row[n]+"'"));d.add=" ("+a.join(", ")+") VALUES ("+e.join(", ")+")"}"expand"===t.action?(a.groupDataField?d.where?d.where+=" AND "+a.groupDataField+" = '"+i[a.groupDataField]+"'":d.where=" WHERE "+a.groupDataField+" = '"+i[a.groupDataField]+"'":a.keyDataField&&a.parentDataField?d.where?d.where+=" AND "+a.parentDataField+" = "+i[a.keyDataField]:d.where=" WHERE "+a.parentDataField+" = "+i[a.keyDataField]:d.where?d.where+=" AND "+i.groupDataField+" = '"+i.label+"'":d.where=" WHERE "+i.groupDataField+" = '"+i.label+"'",d.where.indexOf("undefined")>=0&&(d.where=""),d.limit="",d.groupBy="",a.virtualDataSourceOnExpand(o,{first:n,last:r,row:t.row,sorting:t.sorting,filtering:t.filtering,grouping:t.grouping,action:t.action,query:d})):a.virtualDataSource(o,{first:n,last:r,sorting:t.sorting,filtering:t.filtering,filterOperator:t.filterOperator||"and",grouping:t.grouping,action:t.action,query:d})}else e()}add(e,t){const a=this;if(!e)return;let n=!0;const r=function(e){const r=a._getDataItem(e,a.boundSource.length);if(a.dataItemById[r.$.id])return void 0!==t&&(r.$.parentId=t),null;a[a.boundSource.length]=r,a.dataItemById[r.$.id]=r;const i=a.boundSource.push(r);return void 0!==t&&(r.$.parentId=t),i||(n=!1),r};if(e.length){let t=[];for(let a=0;a<e.length;a++){const n=r(e[a]);n&&t.push(n)}a._notify({action:"add",data:t})}else{const t=r(e);a._notify({action:"add",data:t})}return a.refreshHierarchy(),n}refreshIndexes(){const e=this;for(let t=0;t<e.boundSource.length;t++)e[t]=e.boundSource[t],e[t].$.index=t,e.dataItemById[e[t].$.id]=e[t];let t=e.boundSource.length;for(;e[t];)delete e[t],t++}removeLast(){const e=this;delete e[e.boundSource.length-1];const t=e.boundSource.pop();return delete e.dataItemById[t.$.id],e._notify({action:"removeLast",data:t}),e.refreshHierarchy(),t}removeById(e){const t=this,a=t.indexOf(t.dataItemById[e]);t.boundSource[a]&&t.removeAt(a)}remove(e){const t=this;let a=t.indexOf(e);-1===a&&e&&e.$&&(a=t.indexOf(t.dataItemById[e.$.id]));t.boundSource[a]&&t.removeAt(a)}removeAt(e){const t=this,a=t.boundSource[e];if(!a)throw new Error("Invalid Item Index");t.boundSource.splice(e,1),delete t.dataItemById[a.$.id],t.refreshIndexes(),t._notify({action:"remove",index:e,data:a}),t.refreshHierarchy()}update(e,t){const a=this;if(Smart.Utilities.Types.isArray(e)&&Smart.Utilities.Types.isArray(t)&&0===e.length&&0===t.length)return void a.refreshHierarchy();if(t.length&&e.length){let n=[];for(let r=0;r<e.length;r++){const i=a._getDataItem(t[r],e[r]),o=e[r];n.push(i),a.boundSource[o]=i,a[o]=a.boundSource[o],a.dataItemById[i.$.id]=a[o]}return a._notify({action:"update",index:e,data:n}),void a.refreshHierarchy()}const n=a._getDataItem(t,e),r=a.boundSource[e].$.id;return n.$.id=r,a.boundSource[e]=n,a[e]=a.boundSource[e],a.dataItemById[n.$.id]=a[e],a._notify({action:"update",index:e,data:n}),a.refreshHierarchy(),n}insert(e,t){const a=this;if(t.length){const n=[];for(let r=0;r<t.length;r++){const i=a._getDataItem(t[r],e+r);n.push(i)}t=n}else t=a._getDataItem(t,e);const n=a.boundSource.splice(e,0,t);return a.refreshIndexes(),a._notify({action:"insert",index:e,data:t}),a.refreshHierarchy(),n}move(e,t){if(t>e&&t-e==1||e===t)return;const a=this,n=a.boundSource.splice(e,1)[0];t>e?(t--,a.boundSource.splice(t,0,n)):a.boundSource.splice(t,0,n),a.refreshIndexes(),a._notify({action:"move",index:t,data:a.boundSource[t]}),a.refreshHierarchy()}indexOf(e){return this.boundSource.indexOf(e)}get length(){const e=this;return void 0!==e.virtualDataSourceLength?e.virtualDataSourceLength:e.dataSourceLength?e.dataSourceLength:"number"==typeof e.dataSource?e.dataSource:e.bindingCompleted?e.boundSource.length:e.dataSource&&"string"!=typeof e.dataSource&&e.dataSource.length?e.dataSource.length:e.boundSource.length}clear(){const e=this;if(!e.isInitialized)return e._cachedValues=[],void(e.dataItemById=[]);for(let t=0;t<e.boundSource.length;t++)delete e[t];e._expandedRowIds=[],e._cachedValues=[],e.boundSource=e.observable?new Smart.ObservableArray:[],e.dataItemById=[],e.refreshHierarchy()}_getId(e,t,a){if(null===e||void 0===e.name||!e.name||!t.getAttribute){if(e&&e.toString().length>0&&t.getAttribute){let a=t.getAttribute(e);if(null!==a&&a.toString().length>0)return a.trim().split(" ").join("").replace(/([ #;?%&,.+*~\':'!^$[\]()=>|\/@])/g,"");{let a=e.split(this.mapChar);if(a.length>1){let e=t;for(let t=0;t<a.length;t++)void 0!==e&&(e=e[a[t]]);if(void 0!==e)return e}else if(void 0!==t[e])return t[e]}}return a}{let n=t.getAttribute(e.name);if(null!==n&&n.toString().length>0)return n;if(e.map)try{let a=t.getAttribute(e.map);if(null!==a&&a.toString().length>0)return a}catch(e){return a}}}_buildHierarchy(){const e=this;if(e.reservedNames){const t=e.reservedNames;t.leaf||(t.leaf="leaf"),t.parent||(t.parent="parent"),t.expanded||(t.expanded="expanded"),t.checked||(t.checked="checked"),t.selected||(t.selected="selected"),t.level||(t.level="level"),t.data||(t.data="data")}else e.reservedNames={leaf:"leaf",parent:"parent",expanded:"expanded",checked:"checked",selected:"selected",level:"level",icon:"icon",data:"data"};const t=e.reservedNames;if(e.childrenDataField){const a=[];for(let n=0;n<e.boundSource.length;n++){const r=Object.assign({},e.boundSource[n]);if(!r)continue;a.push(r);const i=function(a){const n=e.childrenDataField.split(e.mapChar);let r=null;if(n.length>1){let e=a;for(let t=0;t<n.length;t++)void 0!==e&&(e=e[n[t]]);r=e}else r=a.children;a.children=r,(null===a.children||void 0===a.children||a.children&&0===a.children.length)&&(a[t.leaf]=!0)};i(r),r[t.level]=0,r.$||(r.$={}),r[t.parent]=null,r[t.data]=r,void 0===r[t.expanded]&&(r[t.expanded]=!1,e.expandHierarchy&&(r[t.expanded]=!0));const o=function(a,n){if(n)for(let r=0;r<n.length;r++){let d=e._getDataItem(n[r],r);if(d){if(i(d),!e.id){const e=function(){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()};d.$.id=e()}d[t.level]=a[t.level]+1,d[t.parent]=a,d[t.data]=Object.assign({},d),a&&(a.children[r]=d),void 0===d[t.expanded]&&(d[t.expanded]=!1,e.expandHierarchy&&(d[t.expanded]=!0)),o(d,d.children)}}else a.children=new Array};o(r,r.children)}if(e.boundHierarchy=a,!e._boundSourceUpdate){for(let t=0;t<e.boundHierarchy.length;t++){const a=e.boundHierarchy[t];if(a.children){const t=function(a){if(e.dataItemById[a.$.id]||(e.boundSource.canNotify=!1,e.dataItemById[a.$.id]=a,e.boundSource.canNotify=!0),a.children)for(let e=0;e<a.children.length;e++){const n=a.children[e];n.children&&t(n)}};t(a)}}e._boundSourceUpdate=!0}}if(e.xmlRoot&&"xml"===e.dataSourceType&&(e.boundHierarchy=this._getHierarchy("uid","_parentuid","children",null,e.boundSource)),e.keyDataField&&e.parentDataField)return["keyDataField","parentDataField"].forEach((t=>{switch(e[t]){case"parent":e[t]="$"+e[t]}})),void(e.boundHierarchy=this._getHierarchy(e.keyDataField,e.parentDataField,"children",null,e.boundSource));e.groupBy&&e.groupBy.length>0?e.boundHierarchy=this._getGroupHierarchy(e.groupBy,"children","label",null,"data",null,"parent",e.boundSource):e.virtualDataSourceOnExpand&&(e.boundHierarchy=this._getHierarchy("id","parentId","children",null,e.boundSource))}_getGroupHierarchy(e,t,a,n,r,i,o,d,l){let s=this;l||(l=0);let c=s.reservedNames;const u=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()};let f=new Array;for(let t=0;t<e.length;t++)f[t]=u();t||(t="children"),a||(a="group"),r||(r="item"),o||(o="parent"),void 0===i&&(i="value");const h=new Array,p=new Array;let g=0;const S=function(e){let t=e;if(n)for(let e in n){const a=n[e];a.name&&a.map&&(t[a.map]=t[a.name])}return t};let y=!1;for(let n=0;n<d.length;n++){let m=Object.assign({},S(d[n]));m[c.leaf]=!1;let T=new Array,b=0;for(let t=0;t<e.length;t++){const a=e[t],n=m[a];null!=n?((""===n||void 0===n&&0===t)&&(y=!0),T[b++]={value:n,group:a,hash:f[t]}):(T[b++]={value:null,group:a,hash:f[t]},0===t&&(y=!0))}if(T.length!==e.length)break;let x=null,v="";for(let e=0;e<T.length;e++){const n=T[e].value,d=T[e].group;if(v=v+"_"+T[e].hash+"_"+n,void 0===p[v]||null===p[v]){if(null===x){x={$:{}},x[c.level]=0,x[c.leaf]=!1,x[o]=null,x[a]=n,x[r]=m,x.groupDataField=d,x[d]||(x[d]=x.data[d]),void 0!==m[c.expanded]?x[c.expanded]=m[c.expanded]:(x[c.expanded]=!1,s.expandHierarchy&&(x[c.expanded]=!0)),i&&(x[i]=m[i]),x[t]=new Array;let e=h.length+l;this.id&&"number"!=typeof m.$.id&&!isFinite(m.$.id)||(e="Item"+e),void 0===x.$.id&&(x.$.id=e),s._expandedRowIds[x.$.id]&&(x[c.expanded]=!0),s.expandHierarchy&&s._collapsedIds&&s._collapsedIds[x.$.id]&&(x[c.expanded]=!1),h[g++]=x}else{const e={$:{}};e[c.level]=x[c.level]+1,e[o]=x,e[a]=n,e[t]=new Array,e[r]=m,e.groupDataField=d,e[c.leaf]=!1,e[d]||(e[d]=e.data[d]),void 0!==m[c.expanded]?e[c.expanded]=m[c.expanded]:(e[c.expanded]=!1,s.expandHierarchy&&(e[c.expanded]=!0)),i&&(e[i]=m[i]),void 0===e.$.id&&(e.$.id=x.$.id+"_"+x[t].length),s.expandHierarchy&&s._collapsedIds&&s._collapsedIds[e.$.id]&&(e[c.expanded]=!1),s._expandedRowIds[e.$.id]&&(e[c.expanded]=!0),x[t][x[t].length]=e,x=e}p[v]=x}else x=p[v]}m&&(m[c.leaf]=!0),null!==x?(null===this.id?void 0===m.$.id&&(m.$.id=x.$.id+"_"+x[t].length):void 0===m.$.id&&-1===m.$.id.toString().indexOf(x.$.id)&&(m.$.id=x.$.id+"_"+m.$.id),m[o]=x,m[c.level]=x[c.level]+1,x[t][x[t].length]=m):void 0===m.$.id&&(m.$.id=u())}if(y){let e=null,t=!1;for(let a=0;a<h.length;a++){const n=h[a];if(!n[n.groupDataField]){e=n,e.$.id.toString().startsWith("Item")&&(t=!0),h.splice(a,1);break}}if(e&&(h.push(e),t))for(let e=0;e<h.length;e++){const t=h[e];t.$.id="Item"+e,Object.keys(s._expandedRowIds).length>0&&(s._expandedRowIds[t.$.id]?t[c.expanded]=!0:t[c.expanded]=!1,s.expandHierarchy&&(t[c.expanded]=!0,s._collapsedIds&&s._collapsedIds[t.$.id]&&(t[c.expanded]=!1)))}}return h}_getHierarchy(e,t,a,n,r){const i=this,o=new Array;let d=this.boundSource;if(r&&(d=r),0===this.boundSource.length)return null;const l=null!==a?a:"children";let s=new Array,c=d,u=c.length,f=i.reservedNames;const h=function(e){let t=e;if(n)for(let e in n){const a=n[e];a.name&&a.map&&(t[a.map]=t[a.name])}return t};for(let a=0;a<u;a++){let n=c[a],r=n[t],o=n[e];"parentId"===t&&(r=n.$.parentId),"id"===e&&(o=n.$.id),n[l]=new Array,i.expandHierarchy&&void 0===n[f.expanded]&&(n[f.expanded]=i.expandHierarchy),s[o]={parentId:r,item:n}}for(let a=0;a<u;a++){const n=c[a];let r=n[t],i=n[e];if("parentId"===t&&(r=n.$.parentId),"id"===e&&(i=n.$.id),void 0!==s[r]){let e={parentId:r,item:s[i].item},t=s[r].item;t[l]||(t[l]=new Array);let a=t[l].length;e=e.item,f?e[f.parent]=t:e.parent=t;const n=h(e);t[l][a]=n,s[r].item=t,s[i].item=e}else{let e=s[i].item;f?void 0===e[f.parent]&&(e[f.parent]=null):void 0===e.parent&&(e.parent=null);const t=h(e);f?t[f.level]=0:t.level=0,o[o.length]=t}}if(0!==o.length){let e=function(t,a){for(let n=0;n<a.length;n++){const r=a[n];f?r[f.level]=t:r.level=t;const o=r[l];o&&o.length>0?(r.leaf=!1,e(t+1,o)):i.virtualDataSourceOnExpand?void 0===r.leaf&&(r.leaf=!1):f?r[f.leaf]=!0:r.leaf=!0}};e(0,o)}return o}summarize(e,t){const a=this;Array.isArray(e)||(e=[e]);let n=[];for(let t=0;t<e.length;t++){const a=e[t];for(let e in a){const t=a[e];n.push({dataField:e,functions:t})}}e=n;let r={},i=new Array;t||(t=a.boundSource);let o=t.length,d=0;if(0!==o&&void 0!==o){for(let a=0;a<o;a++){let n=t[a];if((!n||!n.$||!1!==n.$.filtered)&&n){d++;for(let t=0;t<e.length;t++){const o=e[t];let d=n[o.dataField];if(o.functions&&o.functions.length>0){r[o.dataField]=r[o.dataField]||{},i[o.dataField]=i[o.dataField]||0,i[o.dataField]++;const e=function(e){for(let t in e){let a=r[o.dataField][t];null==a&&(r[o.dataField][t]=0,a=0),"function"==typeof e[t]&&(a=e[t](a,d,o.dataField,n)),r[o.dataField][t]=a}},t=d;let l=parseFloat(d);l=!isNaN(l),t&&t.toDate&&(l=!1),"string"==typeof d&&d.startsWith("+")&&(l=!1),l&&(d=parseFloat(d)),"number"==typeof d&&isFinite(d)?o.functions.forEach((function(t){let n=r[o.dataField][t];if(null==n&&(n=0,"min"===t&&(n=9999999999999),"max"===t&&(n=-9999999999999),"median"===t&&(n=[])),"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t)n+=parseFloat(d);else if("product"===t)0===a?n=parseFloat(d):n*=parseFloat(d);else if("min"===t)n=Math.min(n,parseFloat(d));else if("max"===t)n=Math.max(n,parseFloat(d));else if("count"===t)n++;else if("median"===t)n.push(parseFloat(d));else if("blank"===t)n=r[o.dataField][t],null==n&&(n=0),d||n++;else if("filled"===t)n=r[o.dataField][t],null==n&&(n=0),void 0!==d&&n++;else if("unique"===t)n=r[o.dataField][t],null==n&&(n=[]),-1===n.indexOf(d)&&n.push(d);else if("object"==typeof t)return void e(t);r[o.dataField][t]=n})):o.functions.forEach((function(t){if("min"===t||"max"===t||"count"===t||"product"===t||"sum"===t||"avg"===t||"stdev"===t||"stdevp"===t||"var"===t||"varp"===t){if(null===d&&"count"!==t)return!0;let e=r[o.dataField][t];return null==e&&(e=0),r[o.dataField][t]=e,!0}if("blank"===t){let e=r[o.dataField][t];null==e&&(e=0),d||e++,r[o.dataField][t]=e}else if("filled"===t){let e=r[o.dataField][t];null==e&&(e=0),d&&e++,r[o.dataField][t]=e}else if("unique"===t){let e=r[o.dataField][t];null==e&&(e=[]),-1===e.indexOf(d)&&e.push(d),r[o.dataField][t]=e}"object"==typeof t&&e(t)}))}}}}for(let a=0;a<e.length;a++){const n=e[a];if(n.functions&&(!n.functions||0!==n.functions.length)){if(r[n.dataField]||(r[n.dataField]={},n.functions.forEach((function(e){r[n.dataField][e]=0}))),void 0!==r[n.dataField].avg){const e=r[n.dataField].avg,t=i[n.dataField];r[n.dataField].avg=0===t||void 0===t?0:e/t}else void 0!==r[n.dataField].count&&(r[n.dataField].count=d);if(void 0!==r[n.dataField].unique){const e=r[n.dataField].unique;r[n.dataField].unique=e.length}if(void 0!==r[n.dataField].median){let e=r[n.dataField].median;e.sort((function(e,t){return e-t})),r[n.dataField].median=.5*(e[Math.floor((e.length+1)/2)-1]+e[Math.ceil((e.length+1)/2)-1])}(r[n.dataField].stdev||r[n.dataField].stdevp||r[n.dataField].var||r[n.dataField].varp)&&n.functions.forEach((function(e){if("stdev"===e||"var"===e||"varp"===e||"stdevp"===e){const a=r[n.dataField][e],i=o,d=a/o;let l=0;for(let e=0;e<o;e++){let a=t[e][n.dataField];l+=(a-d)*(a-d)}let s="stdevp"===e||"varp"===e?i:i-1;0===s&&(s=1),"var"===e||"varp"===e?r[n.dataField][e]=l/s:"stdevp"!==e&&"stdev"!==e||(r[n.dataField][e]=Math.sqrt(l/s))}}))}}return r}}_getDataItem(e,t){const a=this,n={},r="number"==typeof a.dataSource||a.dataSourceLength;if(!e)return{$:{id:t,isEmpty:!0,index:t}};if("string"==typeof e&&(e={"":e}),r){for(let e=0;e<a.dataFields.length;e++){n[(a.dataFields?a.dataFields[e]:{}).name]=""}return n.$={},n.$.id=t,n.$.index=t,n}const i=e;if(void 0!==i.expanded&&(n.expanded=i.expanded,"true"===i.expanded||!0===i.expanded||1===i.expanded?n.expanded=!0:n.expanded=!1),a.childrenDataField?void 0!==i[a.childrenDataField]&&(n.children=i[a.childrenDataField]):void 0!==i.children?n.children=i.children:void 0!==i.items&&(n.children=i.items),void 0!==i.leaf&&(n.leaf=i.leaf),void 0!==i.level&&(n.level=i.level),a.keyDataField&&void 0!==i[a.keyDataField]&&(n[a.keyDataField]=i[a.keyDataField]),a.parentDataField&&void 0!==i[a.parentDataField]&&(n[a.parentDataField]=i[a.parentDataField]),0===a.dataFields.length){const t=Object.getOwnPropertyNames(e);for(let e=0;e<t.length;e++)"$"!==t[e]&&a.dataFields.push({name:t[e],dataType:"string"})}for(let t=0;t<a.dataFields.length;t++){const r=a.dataFields?a.dataFields[t]:{};let o="";if(null==r)continue;if(e.length&&(o=e[t]),r.map){let e=r.map.split(a.mapChar);if(e.length>0){let t=i;for(let a=0;a<e.length;a++)i&&t&&(t=t[e[a]]);o=t}else o=i[r.map]}null!=o?o=o.toString():void 0===o&&null!==o&&(o="");let d=!1;if(""===o&&(d=!0,o=e[r.name],void 0===r.dataType&&(r.dataType="any"),null!=o?"array"!==r.dataType&&("any"===r.dataType?o=Array.isArray(e[r.name])?[...e[r.name]]:"object"==typeof e[r.name]?Object.assign({},e[r.name]):e[r.name]:"date"!==r.dataType&&(o=o.toString())):o=void 0===o&&"any"===r.dataType?null:""),"[object Object]"===o&&r.map&&d&&(o=""),a._cachedValues[o+"_"+r.dataType])o=a._cachedValues[o+"_"+r.dataType];else{if("bool"===r.dataType||"boolean"===r.dataType)"true"===o||"1"===o?o=!0:"false"!==o&&"0"!==o||(o=!1);else if("number"===r.dataType)-1===o.indexOf(".")&&o.indexOf(",")>=0&&o.substring(1+o.indexOf(",")).length<3&&(o=o.replace(",",".")),o=a.$document.deserialize(""+o,r.dataType,!0);else if("date"===r.dataType)if(r.formatString&&Smart.Utilities.DateTime){o=Smart.Utilities.DateTime.ParseDate(o,r.formatString)}else o=a.$document.deserialize(""+o,r.dataType,!0);else"any"!==r.dataType&&(o="string"===r.dataType&&"null"===o?"null":a.$document.deserialize(""+o,r.dataType,!0));"any"!==r.dataType&&(a._cachedValues[o+"_"+r.dataType]=o)}"string"!==r.dataType&&"boolean"!==r.dataType&&"bool"!==r.dataType&&"any"!==r.dataType&&(isNaN(o)||o===-1/0||o===1/0)&&(o="date"===r.dataType||"number"===r.dataType?null:0),"parent"!==r.name&&"group"!==r.name&&"leaf"!==r.name&&"level"!==r.name?("string"===r.dataType&&/<.+?>/.test(o)&&o.replace&&("all"===a.sanitizeHTML?o=o.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""):"blackList"===a.sanitizeHTML&&(o=window.Smart.Utilities.Core.sanitizeHTML(o))),n[r.name]=o):n.$[r.name]=o}let o=t;if(a.id){if(o=i[a.id],void 0===o){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};o=e()+e()}"object"==typeof o&&(o=t),i.$&&void 0!==i.$.id&&(o=i.$.id)}else if(!a.virtualDataSource&&a.dataItemById&&a.dataItemById[o])for(o=a.length;a.dataItemById[o];)o++;return n.$||(n.$={}),n.$.id=o,n.$.index=t,new Object(n)}_bindToArray(){const e=this,t="number"==typeof e.dataSource||e.dataSourceLength,a=[];e.boundSource.canNotify=!1;const n=t?"number"==typeof e.dataSource?e.dataSource:e.dataSource.length:e.observable?e.length:e.dataSource.length;for(let r=0;r<n;r++){const n=t?{}:e.dataSource[r],i=e._getDataItem(n,r);a.push(i)}if(t&&e.dataSourceLength&&e.dataSource.length>0)for(let t=0;t<e.dataSource.length;t++){const n=e.dataSource[t].cell,r=e.dataSource[t].value,i=n.replace(/[^0-9]/g,""),o=n.replace(/[0-9]/g,"");a[i-1][o]=r}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new Smart.ObservableArray(a),e.observable&&(e.boundSource=new Smart.ObservableArray(a));for(let t=0;t<n;t++)e.observable?e[t]=e.boundSource[t]:e[t]=a[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=a),e.boundSource.canNotify=!0}_bindToICS(){const e=this,t=""+e.dataSource,a=e.rowDelimiter||"\n",n=t.split("\r"),r=[];let i=t.split(a),o=i.length;1===o&&n.length>1&&(i=n,o=i.length);const d=function(e,t){var a=/^(\d{4})(\d{2})(\d{2})(T(\d{2})(\d{2})(\d{2})Z)?$/.exec(e);if(!a)throw new Error("Invalid UNTIL value: "+e);return t?new Date(a[1],a[2]-1,a[3],0,0,0,0):new Date(Date.UTC(a[1],a[2]-1,a[3],a[5]||0,a[6]||0,a[7]||0))};for(let e=0;e<o;e++){const t=i[e].trim();if(t.indexOf("BEGIN:VEVENT")>=0)var l={};else if(l)if(t.indexOf("BEGIN:VALARM")>=0)var s={};else{if(s){if(t.indexOf("ACTION")>=0){s.ACTION=t.substring(t.indexOf("ACTION")+7);continue}if(t.indexOf("DESCRIPTION")>=0){s.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);continue}if(t.indexOf("TRIGGER")>=0){s.TRIGGER=t.substring(t.indexOf("TRIGGER")+8);continue}if(t.indexOf("END:VALARM")>=0){l.ALARM||(l.ALARM=[]),l.ALARM.push(s),s=void 0;continue}}if(t.indexOf("SUMMARY")>=0)l.SUMMARY=t.substring(t.indexOf("SUMMARY")+8);else if(t.indexOf("LOCATION")>=0)l.LOCATION=t.substring(t.indexOf("LOCATION")+9);else if(t.indexOf("DESCRIPTION")>=0)l.DESCRIPTION=t.substring(t.indexOf("DESCRIPTION")+12);else if(t.indexOf("RRULE")>=0)l.RRULE=t.substring(t.indexOf("RRULE")+6);else if(t.indexOf("RECURRENCE-ID")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID")+14);else if(t.indexOf("RECURRENCE-ID;VALUE=DATE")>=0)l.RECURRENCEID=t.substring(t.indexOf("RECURRENCE-ID;VALUE=DATE")+25);else if(t.indexOf("EXDATE;VALUE=DATE")>=0){const e=t.substring(t.indexOf("EXDATE;VALUE=DATE")+20);l.EXDATE=e}else if(t.indexOf("EXDATE")>=0){const e=t.substring(t.indexOf("EXDATE")+7);l.EXDATE=e}else t.indexOf("DTEND;VALUE=DATE")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND;VALUE=DATE")+17),!0):t.indexOf("DTEND")>=0?l.DTEND=d(t.substring(t.indexOf("DTEND")+6)):t.indexOf("DTSTART;VALUE=DATE")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART;VALUE=DATE")+19),!0):t.indexOf("DTSTART")>=0?l.DTSTART=d(t.substring(t.indexOf("DTSTART")+8)):t.indexOf("UID")>=0?l.uid=l.UID=t.substring(t.indexOf("UID")+4):t.indexOf("STATUS")>=0?l.STATUS=t.substring(t.indexOf("STATUS")+7):t.indexOf("TITLE")>=0?l.TITLE=t.substring(t.indexOf("TITLE")+6):t.indexOf("CATEGORIES")>=0?l.CATEGORIES=t.substring(t.indexOf("CATEGORIES")+11):t.indexOf("END:VEVENT")>=0&&(r.push(l),l.ALARM&&(l.ALARM=JSON.stringify(l.ALARM)),s=void 0)}}e.canNotify=!1,e.dataSource=r,e.canNotify=!0,e._bindToArray()}_bindToJSON(){const e=this,t=[],a=e.dataSource.length?e.dataSource:Object.entries(e.dataSource);e.boundSource.canNotify=!1;for(let n=0;n<a.length;n++){const r=a[n],i=e._getDataItem(r,n);t.push(i)}e.boundSource=!1===e.observable||e.virtualDataSource?[]:new Smart.ObservableArray(t);for(let t=0;t<e.length;t++)e[t]=e.boundSource[t],e.dataItemById[e[t].$.id]=e[t];!1===e.observable&&(e.boundSource=t),e.boundSource.canNotify=!0}sortBy(e,t,a){const n=this;if(!t)for(let a=0;a<n.dataFields.length;a++){const r=n.dataFields[a];if(r.name===e){t=r.dataType;break}}if(n.boundHierarchy){if((!e||0===e.length)&&n.groupBy.length>0)return void n.refreshHierarchy();const r=(e=>{let t=[];for(;e;){t=t.concat(e);for(let a=0;a<e.length;a++)e[a].children&&(t=t.concat(e[a].children));e=e.children}return t})(n.boundHierarchy);if(r){r.find((e=>{if(e.summaryRow)return e}))&&n.refreshHierarchy()}const i=function(r){n._sort(r,e,a,t);for(let n=0;n<r.length;n++){const o=r[n];o.children&&i(o.children,e,a,t)}};i(n.boundHierarchy)}else n._sort(n.boundSource,e,a,t)}_createFilter(e,t){const a={"=":"EQUAL","<>":"NOT_EQUAL","!=":"NOT_EQUAL",not_like:"DOES_NOT_CONTAIN",like:"CONTAINS","<":"LESS_THAN",">":"GREATER_THAN","<=":"LESS_THAN_OR_EQUAL",">=":"GREATER_THAN_OR_EQUAL",equal:"EQUAL","not equal":"NOT_EQUAL","less than":"LESS_THAN","greater than":"GREATER_THAN","greater than or equal":"GREATER_THAN_OR_EQUAL","less than or equal":"LESS_THAN_OR_EQUAL","starts with":"STARTS_WITH","ends with":"ENDS_WITH",notEqual:"NOT_EQUAL",not_equal:"NOT_EQUAL",lessThan:"LESS_THAN",greaterThan:"GREATER_THAN",greaterThanOrEqual:"GREATER_THAN_OR_EQUAL",lessThanOrEqual:"LESS_THAN_OR_EQUAL",less_than:"LESS_THAN",greater_than:"GREATER_THAN",greater_than_or_equal:"GREATER_THAN_OR_EQUAL",less_than_or_equal:"LESS_THAN_OR_EQUAL",null:"null","":"EMPTY",isblank:"EMPTY",isnotblank:"NOT_EMPTY",isBlank:"EMPTY",isNotBlank:"NOT_EMPTY",CONTAINS:"CONTAINS",DOES_NOT_CONTAIN:"DOES_NOT_CONTAIN",contains:"CONTAINS",does_not_contain:"DOES_NOT_CONTAIN","not contains":"DOES_NOT_CONTAIN",notcontains:"DOES_NOT_CONTAIN",notContains:"DOES_NOT_CONTAIN",startswith:"STARTS_WITH",endswith:"ENDS_WITH",starts_with:"STARTS_WITH",ends_with:"ENDS_WITH",startsWith:"STARTS_WITH",endsWith:"ENDS_WITH",NULL:"NULL",NOT_NULL:"NOT_NULL"};let n=[];"string"==typeof t&&(t=[t]);for(let e=0;e<t.length;e++){const a=t[e],r=-1===a.indexOf('"')?a.split(" "):a.split('"');let i=[];for(let e=0;e<r.length;e++){const t=r[e];""!==t&&" "!==t&&i.push(t.trim())}n.push(i)}const r=new Smart.FilterGroup,i=[],o=[];for(let t=0;t<n.length;t++){const r=n[t];if(r.length>1){const t=new Smart.FilterGroup;let n=r.length>2?"":"and",i=0,d=[];for(let o=0;o<r.length;o++){let l=r[o];if("and"!==l&&"or"!==l){if(i++,2===i){let s=a[r[o-1]];s||(s=r[o-1]),"number"===e&&(l=parseFloat(l)),"date"===e&&(l=new Date(l));const c=t.createFilter(e,l,s);if(i=0,d.push(c),n){for(let e=0;e<d.length;e++)t.addFilter(n,d[e]);d=[]}}}else n=l}o.push(t)}else{let e=r[0];if(e&&a[e]&&(e="and"),"and"!==e&&"or"!==e)throw new Error('Filter Exprresion expects "AND" or "OR", but the token is: '+e);i.push(e)}}let d=0;if(1===o.length)return o[0];for(let e=0;e<o.length;e++){let t=i[d];(e+1)%2==0&&d++,t||(t="and"),r.addFilter(t,o[e])}return r}filterBy(e,...t){const a=this,n=(()=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}})(),r=a._createFilter(n,t);return a.boundSource.filter((t=>r.evaluate(t[e])))}_filter(e,t="and"){const a=this,n=[],r=[];if(0===e.length)return void a.clearFilter();const i=e=>{for(let t=0;t<a.dataFields.length;t++){const n=a.dataFields[t];if(n.name===e)return n.dataType}};let o,d;"and"===t?(o=!0,d=function(e,t,a){return e&&t.evaluate(a[t.dataField])}):(o=!1,d=function(e,t,a){return e||t.evaluate(a[t.dataField])});for(let t=0;t<e.length;t++){const o=e[t],d=o[0];let l=null;l=o[1]instanceof Smart.FilterGroup?o[1]:a._createFilter(i(d),o.splice(1)),l&&(r.push(d),l.dataField=d,n.push(l))}if(a.boundHierarchy){const e=function(e){let t=o;for(let a=0;a<n.length;a++){const r=n[a];t=d(t,r,e)}return e.$.filtered=t,t},t=function(n,r,i){let o=0;for(let a=0;a<n.length;a++){const i=n[a];e(i),i.$.filtered&&o++,i.children&&t(i.children,i,r)}o>0&&a.groupBy.length>0&&r?(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0)):o>0&&o!==n.length&&r?(r.$.filtered=null,i&&!i.$.filtered&&(i.$.filtered=null)):o>0&&o===n.length&&r&&(r.$.filtered=!0,i&&!i.$.filtered&&(i.$.filtered=!0))};t(a.boundHierarchy,null,null)}else for(let e=0;e<a.boundSource.length;e++){const t=a.boundSource[e];let r=o;for(let e=0;e<n.length;e++){const a=n[e];r=d(r,a,t)}t.$.filtered=r}a.onFilter&&a.onFilter()}clearGroup(){const e=this;e.groupBy=[],e.boundHierarchy=null,e.refreshHierarchy(),e.onGroup&&e.onGroup()}clearFilter(){const e=this;for(let t=0;t<e.boundSource.length;t++){e.boundSource[t].$.filtered=!0}if(e.boundHierarchy){const t=function(e,a,n){for(let n=0;n<e.length;n++){const r=e[n];r.$.filtered=!0,r.$.filtered,r.children&&t(r.children,r,a)}a&&(a.$.filtered=!0,n&&!n.$.filtered&&(n.$.filtered=!0))};t(e.boundHierarchy,null,null)}e.onFilter&&e.onFilter()}clearSort(){this._sort(this.boundSource,[],[],[])}_sort(e,t,a,n,r,i){const o=this;let d=!1;if(0===e.length)return;if(e&&e.constructor&&e instanceof Smart.ObservableArray&&(d=!0),(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)&&!d&&!o.boundHierarchy)throw new Error("sort: Missing or Invalid arguments!");"string"==typeof t&&(t=[t]);const l=[],s=[];void 0===a&&(a=[]);const c=function(e,t){let a;switch(t||typeof e){case"string":a=(new Intl.Collator).compare;break;case"number":case"int":case"bigInt":case"float":case"double":a=function(e,t){return e-t};break;case"boolean":case"bool":a=function(e,t){return e===t?0:!1===e?-1:1};break;case"date":case"time":case"dateTime":a=e instanceof Date?function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0}:e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber?function(e,t){return e.compare(t)}:function(e,t){return e-t};break;case"object":if(e instanceof Date)a=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber)a=function(e,t){return e.compare(t)};else if(e instanceof Smart.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new Smart.Utilities.ComplexNumericProcessor;a=function(t,a){return e.compareComplexNumbers(t,a)}}}return a};for(let r=0;r<t.length;r++){void 0===a[r]||"asc"===a[r]||"ascending"===a[r]?l[r]=1:l[r]=-1;let d=e[0][t[r]];if(void 0===d&&e[0]&&e[0].children&&e[0].data&&(d=e[0].data[t[r]]),i&&i){const e=t[r];if(i[e]){s[r]=i[e];continue}}o.sortComparators&&o.sortComparators[t[r]]?s[r]=o.sortComparators[t[r]]:s[r]=c(d,n[r])}t.length>0&&r?r(e,t,a,s):e.sort((function(e,a){for(let n=0;n<t.length;n++){const r=s[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e.$.index?(e.$.index-a.$.index)*l[n]:0}return r*l[n]}if(0===t.length)return e.$.index<a.$.index?-1:e.$.index>a.$.index?1:0}));for(let t=0;t<e.length;t++)o[t]=e[t]}static Filter(e,t,a,n,r="and"){let i,o;"and"===r?(i=!0,o=function(e,t,a,r){return n?e&&n(t,a,r):e&&r.evaluate(t[a])}):(i=!1,o=function(e,t,a,r){return n?e||n(t,a,r):e||r.evaluate(t[a])});return e.filter((e=>{let n=i;for(let r=0;r<a.length;r++){const i=a[r],d=t[r];n=o(n,e,d,i)}return n}))}filter(e,t,a){Smart.DataAdapter.Filter(this.boundSource,e,t,a)}sort(e,t,a){Smart.DataAdapter.Sort(this.boundSource,e,t,a)}static Sort(e,t,a,n){const r=function(e){let t;switch(typeof e){case"string":if(e.indexOf("-")>=0||e.indexOf("/")>=0){const t=new Date(e);if(t&&"Invalid Date"!==t.toString()){return function(e,t){const a=new Date(e),n=new Date(t);return a||n?a?n?a.getTime()-n.getTime():1:-1:0}}}t=(new Intl.Collator).compare;break;case"number":t=function(e,t){return e-t};break;case"boolean":t=function(e,t){return e===t?0:!1===e?-1:1};break;case"object":if(e instanceof Date)t=function(e,t){return e||t?e?t?e.getTime()-t.getTime():1:-1:0};else if(e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber)t=function(e,t){return e.compare(t)};else if(e instanceof Smart.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new Smart.Utilities.ComplexNumericProcessor;t=function(t,a){return e.compareComplexNumbers(t,a)}}else t=function(e,t){return e-t}}return t};if(!e||!Array.isArray(e)||0===e.length||!t||Array.isArray(t)&&0===t.length)return;"string"==typeof t&&(t=[t]);const i=[],o=[];void 0===a&&(a=[]);for(let n=0;n<t.length;n++)void 0===a[n]||"asc"===a[n]||"ascending"===a[n]?i[n]=1:i[n]=-1,o[n]=r(e[0][t[n]]);if(n)return void n(e,t,a,o);const d=e.slice(0);return d.sort((function(e,a){for(let n=0;n<t.length;n++){const r=o[n](e[t[n]],a[t[n]]);if(0===r){if(t[n+1])continue;return void 0!==e._index?(e._index-a._index)*i[n]:0}return r*i[n]}})),d}};class e{constructor(e,t){const a=this;a.config=e,a.callback=t,!1!==e.autoFetch&&a.call(e)}call(e){const t=this;e||(e=t.config);let a="GET",n=e.url,r=null,i=!0;if(e.type&&(a=e.type),e.data)if("GET"===a){n+="?";for(let t in e.data)Object.prototype.hasOwnProperty.call(e.data,t)&&(n+=encodeURI(t+"="+e.data[t]+"&"));"&"===n.charAt(n.length-1)&&(n=n.slice(0,n.length-1))}else"POST"===a&&(r=JSON.stringify(e.data));e&&!1===e.async&&"xlsx"!==e.dataSourceType&&(i=!1),void 0!==window.fetch&&i?t.ajaxFetch(e,a,n,r):t.ajaxXMLHttpRequest(e,a,n,r,i)}ajaxFetch(e,t,a,n){const r=this,i={method:t};let o,d,l,s;switch(e.dataSourceType){case"json":o="json";break;case"xlsx":o="arrayBuffer";break;default:o="text"}if(e&&e.contentType&&(i.headers=new Headers({"Content-Type":e.contentType})),null!==n&&(i.body=n),e.timeout&&(l=setTimeout((function(){s=!0}),e.timeout)),e.beforeSend){if(!1===e.beforeSend(i,e))return}fetch(a,i).then((function(e){if(s)throw d=408,new Error("timeout");if(l&&clearTimeout(l),d=e.status,!e.ok)throw new Error(e.statusText);return e[o]()})).then((function(t){if("arrayBuffer"===o)return JSZip.loadAsync(t).then((function(t){return t.files["xl/worksheets/sheet1.xml"].async("text").then((function(a){return t.files["xl/sharedStrings.xml"].async("text").then((function(t){const n=r.parseXLSXData(a,t);r.ajaxComplete(e,n,d)}))}))}));r.ajaxComplete(e,t,d)})).catch((function(t){"JSZip is not defined"===t.message&&(t.message="JSZip is not defined. Please include a reference to JSZip to be able to load data from XLSX files."),e&&e.loadError&&e.loadError(d,t),r.callback&&r.callback(t,d)}))}ajaxXMLHttpRequest(e,t,a,n,r){const i=new XMLHttpRequest,o=this;if(i.open(t,a,r),i.ontimeout=function(){e&&e.loadError&&e.loadError(408,"timeout")},i.onload=function(){if(4===i.readyState){const t=i.status;let a=i.response;t>=200&&t<=299?("json"===e.dataSourceType&&(a=JSON.parse(a)),o.ajaxComplete(e,a,t)):e&&e.loadError&&e.loadError(t,a)}},i.onerror=function(){e&&e.loadError&&e.loadError(i.status,i.response)},e&&e.contentType&&i.setRequestHeader("Content-Type",e.contentType),r&&e.timeout&&(i.timeout=e.timeout),e.beforeSend){if(!1===e.beforeSend(i,e))return}i.send(n)}ajaxComplete(e,t,a){if(e){if(e.beforeLoadComplete){const a=e.beforeLoadComplete(t);a&&(t=a)}e.loadComplete&&e.loadComplete(t,a),this.callback&&this.callback(t,a)}}parseXLSXData(e,t){const a=new DOMParser,n=a.parseFromString(t,"text/xml"),r=Array.from(n.getElementsByTagName("si")),i=[],o=a.parseFromString(e,"text/xml"),d=Array.from(o.getElementsByTagName("row")),l=[];return r.forEach((function(e){let t=e.getElementsByTagName("t");if(1===t.length)i.push(t[0].innerHTML);else{let e="";t=Array.from(t),t.forEach((function(t){e+=t.innerHTML})),i.push(e)}})),d.forEach((function(e){const t={};Array.from(e.getElementsByTagName("c")).forEach((function(e){const a=e.getAttribute("r").match(/\D+/)[0],n=e.getAttribute("t"),r=e.getElementsByTagName("v")[0].innerHTML;let o;switch(n){case"s":o=i[parseFloat(r)];break;case"b":o=1===parseFloat(r);break;default:o=parseFloat(r)}t[a]=o})),l.push(t)})),l}}Smart.Ajax=window.Ajax=e})();
|
|
9
9
|
(()=>{const e=-1*(new Date).getTimezoneOffset(),t=[{id:"Local",offset:e,offsetHours:e/60,displayName:"",supportsDaylightSavingTime:!1},{id:"Dateline Standard Time",offset:-720,offsetHours:-12,displayName:"(UTC-12:00) International Date Line West",supportsDaylightSavingTime:!1},{id:"UTC-11",offset:-660,offsetHours:-11,displayName:"(UTC-11:00) Coordinated Universal Time-11",supportsDaylightSavingTime:!1},{id:"Hawaiteratoran Standard Time",offset:-600,offsetHours:-10,displayName:"(UTC-10:00) Hawaiterator",supportsDaylightSavingTime:!1},{id:"Alaskan Standard Time",offset:-540,offsetHours:-9,displayName:"(UTC-09:00) Alaska",supportsDaylightSavingTime:!0},{id:"Pacific Standard Time (Mexico)",offset:-480,offsetHours:-8,displayName:"(UTC-08:00) Baja California",supportsDaylightSavingTime:!0},{id:"Pacific Standard Time",offset:-480,offsetHours:-8,displayName:"(UTC-08:00) Pacific Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"US Mountain Standard Time",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Arizona",supportsDaylightSavingTime:!1},{id:"Mountain Standard Time (Mexico)",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Chihuahua, La Paz, Mazatlan",supportsDaylightSavingTime:!0},{id:"Mountain Standard Time",offset:-420,offsetHours:-7,displayName:"(UTC-07:00) Mountain Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"Central Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Central Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"Central America Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Central America",supportsDaylightSavingTime:!1},{id:"Canada Central Standard Time",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Saskatchewan",supportsDaylightSavingTime:!1},{id:"Central Standard Time (Mexico)",offset:-360,offsetHours:-6,displayName:"(UTC-06:00) Guadalajara, Mexico City, Monterrey",supportsDaylightSavingTime:!0},{id:"SA Pacific Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Bogota, Lima, Quito, Rio Branco",supportsDaylightSavingTime:!1},{id:"Eastern Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Eastern Time (US & Canada)",supportsDaylightSavingTime:!0},{id:"US Eastern Standard Time",offset:-300,offsetHours:-5,displayName:"(UTC-05:00) Indiana (East)",supportsDaylightSavingTime:!0},{id:"Venezuela Standard Time",offset:-270,offsetHours:-4.5,displayName:"(UTC-04:30) Caracas",supportsDaylightSavingTime:!1},{id:"Atlantic Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Atlantic Time (Canada)",supportsDaylightSavingTime:!0},{id:"Paraguay Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Asuncion",supportsDaylightSavingTime:!0},{id:"Central Brazilian Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Cuiaba",supportsDaylightSavingTime:!0},{id:"Pacific SA Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Santiago",supportsDaylightSavingTime:!0},{id:"SA Western Standard Time",offset:-240,offsetHours:-4,displayName:"(UTC-04:00) Georgetown, La Paz, Manaus, San Juan",supportsDaylightSavingTime:!1},{id:"Newfoundland Standard Time",offset:-210,offsetHours:-3.5,displayName:"(UTC-03:30) Newfoundland",supportsDaylightSavingTime:!0},{id:"SA Eastern Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Cayenne, Fortaleza",supportsDaylightSavingTime:!1},{id:"Argentina Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Buenos Aires",supportsDaylightSavingTime:!0},{id:"E. South America Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Brasilia",supportsDaylightSavingTime:!0},{id:"Bahia Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Salvador",supportsDaylightSavingTime:!0},{id:"Montevideo Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Montevideo",supportsDaylightSavingTime:!0},{id:"Greenland Standard Time",offset:-180,offsetHours:-3,displayName:"(UTC-03:00) Greenland",supportsDaylightSavingTime:!0},{id:"UTC-02",offset:-120,offsetHours:-2,displayName:"(UTC-02:00) Coordinated Universal Time-02",supportsDaylightSavingTime:!1},{id:"Mid-Atlantic Standard Time",offset:-120,offsetHours:-2,displayName:"(UTC-02:00) Mid-Atlantic - Old",supportsDaylightSavingTime:!0},{id:"Azores Standard Time",offset:-60,offsetHours:-1,displayName:"(UTC-01:00) Azores",supportsDaylightSavingTime:!0},{id:"Cape Verde Standard Time",offset:-60,offsetHours:-1,displayName:"(UTC-01:00) Cape Verde Is.",supportsDaylightSavingTime:!1},{id:"Morocco Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Casablanca",supportsDaylightSavingTime:!0},{id:"UTC",offset:0,offsetHours:0,displayName:"(UTC) Coordinated Universal Time",supportsDaylightSavingTime:!1},{id:"GMT Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Dublin, Edinburgh, Lisbon, London",supportsDaylightSavingTime:!0},{id:"Greenwich Standard Time",offset:0,offsetHours:0,displayName:"(UTC) Monrovia, Reykjavik",supportsDaylightSavingTime:!1},{id:"Central European Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb",supportsDaylightSavingTime:!0},{id:"Namibia Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Windhoek",supportsDaylightSavingTime:!0},{id:"W. Central Africa Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) West Central Africa",supportsDaylightSavingTime:!1},{id:"W. Europe Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna",supportsDaylightSavingTime:!0},{id:"Central Europe Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague",supportsDaylightSavingTime:!0},{id:"Romance Standard Time",offset:60,offsetHours:1,displayName:"(UTC+01:00) Brussels, Copenhagen, Madrid, Paris",supportsDaylightSavingTime:!0},{id:"FLE Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius",supportsDaylightSavingTime:!0},{id:"South Africa Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Harare, Pretoria",supportsDaylightSavingTime:!1},{id:"Turkey Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Istanbul",supportsDaylightSavingTime:!0},{id:"GTB Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Athens, Bucharest",supportsDaylightSavingTime:!0},{id:"Libya Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Tripoli",supportsDaylightSavingTime:!0},{id:"E. Europe Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) E. Europe",supportsDaylightSavingTime:!0},{id:"Jordan Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Amman",supportsDaylightSavingTime:!0},{id:"Middle East Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Beirut",supportsDaylightSavingTime:!0},{id:"Egypt Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Cairo",supportsDaylightSavingTime:!0},{id:"Syria Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Damascus",supportsDaylightSavingTime:!0},{id:"Israel Standard Time",offset:120,offsetHours:2,displayName:"(UTC+02:00) Jerusalem",supportsDaylightSavingTime:!0},{id:"Arab Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Kuwait, Riyadh",supportsDaylightSavingTime:!1},{id:"E. Africa Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Nairobi",supportsDaylightSavingTime:!1},{id:"Arabic Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Baghdad",supportsDaylightSavingTime:!0},{id:"Kaliningrad Standard Time",offset:180,offsetHours:3,displayName:"(UTC+03:00) Kaliningrad, Minsk",supportsDaylightSavingTime:!0},{id:"Iran Standard Time",offset:210,offsetHours:3.5,displayName:"(UTC+03:30) Tehran",supportsDaylightSavingTime:!0},{id:"Mauritius Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Port Louis",supportsDaylightSavingTime:!0},{id:"Georgian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Tbilisi",supportsDaylightSavingTime:!1},{id:"Caucasus Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Yerevan",supportsDaylightSavingTime:!0},{id:"Arabian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Abu Dhabi, Muscat",supportsDaylightSavingTime:!1},{id:"Azerbaijan Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Baku",supportsDaylightSavingTime:!0},{id:"Russian Standard Time",offset:240,offsetHours:4,displayName:"(UTC+04:00) Moscow, St. Petersburg, Volgograd",supportsDaylightSavingTime:!0},{id:"Afghanistan Standard Time",offset:270,offsetHours:4.5,displayName:"(UTC+04:30) Kabul",supportsDaylightSavingTime:!1},{id:"Pakistan Standard Time",offset:300,offsetHours:5,displayName:"(UTC+05:00) Islamabad, Karachi",supportsDaylightSavingTime:!0},{id:"West Asia Standard Time",offset:300,offsetHours:5,displayName:"(UTC+05:00) Ashgabat, Tashkent",supportsDaylightSavingTime:!1},{id:"India Standard Time",offset:330,offsetHours:5.5,displayName:"(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi",supportsDaylightSavingTime:!1},{id:"Sri Lanka Standard Time",offset:330,offsetHours:5.5,displayName:"(UTC+05:30) Sri Jayawardenepura",supportsDaylightSavingTime:!1},{id:"Nepal Standard Time",offset:345,offsetHours:5.75,displayName:"(UTC+05:45) Kathmandu",supportsDaylightSavingTime:!1},{id:"Central Asia Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Astana",supportsDaylightSavingTime:!1},{id:"Bangladesh Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Dhaka",supportsDaylightSavingTime:!0},{id:"Ekaterinburg Standard Time",offset:360,offsetHours:6,displayName:"(UTC+06:00) Ekaterinburg",supportsDaylightSavingTime:!0},{id:"Myanmar Standard Time",offset:390,offsetHours:6.5,displayName:"(UTC+06:30) Yangon (Rangoon)",supportsDaylightSavingTime:!1},{id:"SE Asia Standard Time",offset:420,offsetHours:7,displayName:"(UTC+07:00) Bangkok, Hanoi, Jakarta",supportsDaylightSavingTime:!1},{id:"N. Central Asia Standard Time",offset:420,offsetHours:7,displayName:"(UTC+07:00) Novosibirsk",supportsDaylightSavingTime:!0},{id:"Ulaanbaatar Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Ulaanbaatar",supportsDaylightSavingTime:!1},{id:"China Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi",supportsDaylightSavingTime:!1},{id:"Singapore Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Kuala Lumpur, Singapore",supportsDaylightSavingTime:!1},{id:"North Asia Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Krasnoyarsk",supportsDaylightSavingTime:!0},{id:"Taipei Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Taipei",supportsDaylightSavingTime:!1},{id:"W. Australia Standard Time",offset:480,offsetHours:8,displayName:"(UTC+08:00) Perth",supportsDaylightSavingTime:!0},{id:"Korea Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Seoul",supportsDaylightSavingTime:!1},{id:"North Asia East Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Irkutsk",supportsDaylightSavingTime:!0},{id:"Tokyo Standard Time",offset:540,offsetHours:9,displayName:"(UTC+09:00) Osaka, Sapporo, Tokyo",supportsDaylightSavingTime:!1},{id:"AUS Central Standard Time",offset:570,offsetHours:9.5,displayName:"(UTC+09:30) Darwin",supportsDaylightSavingTime:!1},{id:"Cen. Australia Standard Time",offset:570,offsetHours:9.5,displayName:"(UTC+09:30) Adelaide",supportsDaylightSavingTime:!0},{id:"West Pacific Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Guam, Port Moresby",supportsDaylightSavingTime:!1},{id:"Tasmania Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Hobart",supportsDaylightSavingTime:!0},{id:"E. Australia Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Brisbane",supportsDaylightSavingTime:!1},{id:"AUS Eastern Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Canberra, Melbourne, Sydney",supportsDaylightSavingTime:!0},{id:"Yakutsk Standard Time",offset:600,offsetHours:10,displayName:"(UTC+10:00) Yakutsk",supportsDaylightSavingTime:!0},{id:"Vladivostok Standard Time",offset:660,offsetHours:11,displayName:"(UTC+11:00) Vladivostok",supportsDaylightSavingTime:!0},{id:"Central Pacific Standard Time",offset:660,offsetHours:11,displayName:"(UTC+11:00) Solomon Is., New Caledonia",supportsDaylightSavingTime:!1},{id:"Magadan Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Magadan",supportsDaylightSavingTime:!0},{id:"Kamchatka Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Petropavlovsk-Kamchatsky - Old",supportsDaylightSavingTime:!0},{id:"Fiji Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Fiji",supportsDaylightSavingTime:!0},{id:"New Zealand Standard Time",offset:720,offsetHours:12,displayName:"(UTC+12:00) Auckland, Wellington",supportsDaylightSavingTime:!0},{id:"UTC+12",offset:720,offsetHours:12,displayName:"(UTC+12:00) Coordinated Universal Time+12",supportsDaylightSavingTime:!1},{id:"Tonga Standard Time",offset:780,offsetHours:13,displayName:"(UTC+13:00) Nuku'alofa",supportsDaylightSavingTime:!1},{id:"Samoa Standard Time",offset:780,offsetHours:13,displayName:"(UTC+13:00) Samoa",supportsDaylightSavingTime:!0}],a=[0,31,59,90,120,151,181,212,243,273,304,334,365],s=[0,31,60,91,121,152,182,213,244,274,305,335,366];Smart.Utilities.Assign("TimeSpan",class{constructor(){const e=this;if(e.ticksPerMillisecond=1e4,e.millisecondsPerTick=1e-4,e.ticksPerSecond=1e7,e.secondsPerTick=1e-7,e.ticksPerMinute=6e8,e.minutesPerTick=1/6e8,e.ticksPerHour=36e9,e.hoursPerTick=1/36e9,e.ticksPerDay=864e9,e.daysPerTick=1/864e9,e.millisPerSecond=1e3,e.millisPerMinute=6e4,e.millisPerHour=36e5,e.millisPerDay=864e5,e._ticks=0,1===arguments.length){if(isNaN(arguments[0]))throw new Error("Argument must be a number.");e._ticks=arguments[0]}else if(3===arguments.length)e._ticks=e.timeToMS(arguments[0],arguments[1],arguments[2],0);else if(4===arguments.length){const t=1e3*(3600*arguments[0]*24+3600*arguments[1]+60*arguments[2]+arguments[3])+0;e._ticks=t*e.ticksPerMillisecond}else if(5===arguments.length){const t=1e3*(3600*arguments[0]*24+3600*arguments[1]+60*arguments[2]+arguments[3])+arguments[4];e._ticks=t*e.ticksPerMillisecond}}ticks(){return this._ticks}days(){return parseInt(this._ticks/this.ticksPerDay)}timeToMS(e,t,a,s){return parseInt((3600*e+60*t+a+s/1e3)*this.ticksPerSecond)}hours(){return parseInt(this._ticks/this.ticksPerHour)%24}milliseconds(){return parseInt(this._ticks/this.ticksPerMillisecond)%1e3}minutes(){return parseInt(this._ticks/this.ticksPerMinute)%60}seconds(){return parseInt(this._ticks/this.ticksPerSecond)%60}totalDays(){return parseInt(this._ticks*this.daysPerTick)}totalHours(){return parseInt(this._ticks*this.hoursPerTick)}totalMilliseconds(){const e=this._ticks*this.millisecondsPerTick;return parseInt(e)}totalMinutes(){return parseInt(this._ticks*this.minutesPerTick)}totalSeconds(){return parseInt(this._ticks*this.secondsPerTick)}add(e){const t=this._ticks+e._ticks;return new Smart.Utilities.TimeSpan(t)}subtract(e){const t=this._ticks-e._ticks;return new Smart.Utilities.TimeSpan(t)}duration(){const e=this;return e._ticks>=0?new Smart.Utilities.TimeSpan(e._ticks):new Smart.Utilities.TimeSpan(-e._ticks)}equals(e){return this._ticks===e._ticks}valueOf(){return this._ticks}compare(e,t){return e._ticks>t._ticks?1:e._ticks<t._ticks?-1:0}interval(e,t){const a=e*t+(e>=0?.5:-.5);return new Smart.Utilities.TimeSpan(a*this.ticksPerMillisecond)}fromDays(e){return this.interval(e,this.millisPerDay)}fromHours(e){return this.interval(e,this.millisPerHour)}fromMilliseconds(e){return this.interval(e,1)}fromMinutes(e){return this.interval(e,this.millisPerMinute)}fromSeconds(e){return this.interval(e,this.millisPerSecond)}fromTicks(e){return new Smart.Utilities.TimeSpan(e)}toString(){return this.totalMilliseconds().toString()}negate(){return new Smart.Utilities.TimeSpan(-this._ticks)}}),Smart.Utilities.Assign("DateTime",class{constructor(){function e(e){const t=i.regexISOString.exec(e);r=new Smart.Utilities.DateTime(parseFloat(t[1]),parseFloat(t[2]),parseFloat(t[3]),parseFloat(t[4]),parseFloat(t[5]),parseFloat(t[6]),parseFloat(t[7]),0,0,0,0,0,0,0,"UTC")}const i=this;let r;if(i.ticksPerMillisecond=1e4,i.millisecondsPerTick=1e-4,i.ticksPerSecond=1e7,i.secondsPerTick=1e-7,i.ticksPerMinute=6e8,i.minutesPerTick=1/6e8,i.ticksPerHour=36e9,i.hoursPerTick=1/36e9,i.ticksPerDay=864e9,i.daysPerTick=1/864e9,i.millisPerSecond=1e3,i.millisPerMinute=6e4,i.millisPerHour=36e5,i.millisPerDay=864e5,i.daysPerYear=365,i.daysPer4Years=1461,i.daysPer100Years=36524,i.daysPer400Years=146097,i.daysTo1601=584388,i.daysTo1899=693593,i.daysTo10000=3652059,i.minTicks=0,i.maxTicks=3155378976e9,i.maxMillis=3155378976e5,i.datePartYear=0,i.datePartDayOfYear=1,i.datePartMonth=2,i.datePartDay=3,i.daysToMonth365=a,i.daysToMonth366=s,i.minValue=new Date(0),i.maxValue=new Date(3155378976e9),i.ticksMask=0x4000000000000000,i.flagsMask=0xc000000000000000,i.localMask=0x8000000000000000,i.ticksCeiling=0x4000000000000000,i.kindUnspecified=0,i.kindUtc=0x4000000000000000,i.kindLocal=0x8000000000000000,i.kindLocalAmbiguousDst=0xc000000000000000,i.kindShift=62,i.regexTrim=/^\s+|\s+$/g,i.regexInfinity=/^[+-]?infinity$/i,i.regexHex=/^0x[a-f0-9]+$/i,i.regexParseFloat=/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/,i.regexISOString=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}).(\d{3})Z$/,i.calendar={"/":"/",":":":",firstDay:0,days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],twoDigitYearMax:2029,patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",ISO:"yyyy-MM-dd hh:mm:ss",ISO2:"yyyy-MM-dd HH:mm:ss",ISO8601:"yyyy-MM-ddTHH:mm:ss.sssZ",d1:"dd.MM.yyyy",d2:"dd-MM-yyyy",zone1:"yyyy-MM-ddTHH:mm:ss-HH:mm",zone2:"yyyy-MM-ddTHH:mm:ss+HH:mm",custom:"yyyy-MM-ddTHH:mm:ss.fff",custom2:"yyyy-MM-dd HH:mm:ss.fff",FP:"yyyy-MM-dd HH:mm:ss:fff:uu:nn:pp:ee:aa:xx:oo",FPA:"yyyy/MM/dd HH:mm:ss:fffuunnppeeaaxxoo",FPA2:"yyyy-MM-dd HH:mm:ss:fffuunnppeeaaxxoo",FT:"HH:mm:ss:fff:uu:nn:pp:ee:aa:xx:oo",PP:"yyyy-MM-dd HH:mm:ss:fff:uu:nn:pp",PT:"HH:mm:ss:fff:uu:nn:pp"},percentsymbol:"%",currencysymbol:"$",currencysymbolposition:"before",decimalseparator:".",thousandsseparator:","},i.dateData=0,i.timeZone=null,i.timeZones=t,i._codeToUnit={u:"_microsecond",uu:"_microsecond",n:"_nanosecond",nn:"_nanosecond",p:"_picosecond",pp:"_picosecond",e:"_femtosecond",ee:"_femtosecond",a:"_attosecond",aa:"_attosecond",x:"_zeptosecond",xx:"_zeptosecond",o:"_yoctosecond",oo:"_yoctosecond"},i._smallUnits=["_microsecond","_nanosecond","_picosecond","_femtosecond","_attosecond","_zeptosecond","_yoctosecond"],i._microsecond=0,i._nanosecond=0,i._picosecond=0,i._femtosecond=0,i._attosecond=0,i._zeptosecond=0,i._yoctosecond=0,0===arguments.length){const e=new Date;i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else if(1===arguments.length){void 0===arguments[0]&&(arguments[0]="todayDate");if("number"==typeof arguments[0]&&isFinite(arguments[0])||"string"!=typeof arguments[0])if("number"==typeof arguments[0])i.dateData=arguments[0];else if(arguments[0]instanceof Date){const e=arguments[0];i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else i.dateData=arguments[0];else{let t;"today"===arguments[0]?t=new Date:"todayDate"===arguments[0]?(t=new Date,t.setHours(0,0,0,0)):i.regexISOString.test(arguments[0])?e(arguments[0]):t=i.tryparseDate(arguments[0]),t&&(i.dateData=i.dateToMS(t.getFullYear(),t.getMonth()+1,t.getDate())+i.timeToMS(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}}else if(2===arguments.length){void 0===arguments[0]&&(arguments[0]="todayDate");if("number"==typeof arguments[0]&&isFinite(arguments[0])||"string"!=typeof arguments[0])if("number"==typeof arguments[0])i.dateData=arguments[0];else if(arguments[0]instanceof Date){const e=arguments[0];i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else i.dateData=arguments[0];else{let t;"today"===arguments[0]?t=new Date:"todayDate"===arguments[0]?(t=new Date,t.setHours(0,0,0,0)):i.regexISOString.test(arguments[0])?e(arguments[0]):t=i.tryparseDate(arguments[0]),t&&(i.dateData=i.dateToMS(t.getFullYear(),t.getMonth()+1,t.getDate())+i.timeToMS(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()))}i.validateTimeZone(arguments[1])}else if(arguments.length>2)if("string"==typeof arguments[0]){const e=i.tryparseDate(arguments[0],arguments[2],arguments[1]);i.dateData=i.dateToMS(e.getFullYear(),e.getMonth()+1,e.getDate())+i.timeToMS(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}else{const e=arguments[0],t=arguments[7]||0,a=arguments[8]||0,s=arguments[9]||0,r=arguments[10]||0,n=arguments[11]||0,o=arguments[12]||0,d=arguments[13]||0,l=new Date(e,arguments[1]-1,arguments[2],arguments[3]||0,arguments[4]||0,arguments[5]||0,arguments[6]||0);e<1970&&l.setFullYear(e),i.dateData=i.dateToMS(l.getFullYear(),l.getMonth()+1,l.getDate())+i.timeToMS(l.getHours(),l.getMinutes(),l.getSeconds(),l.getMilliseconds()),i._microsecond=t,i._nanosecond=a,i._picosecond=s,i._femtosecond=r,i._attosecond=n,i._zeptosecond=o,i._yoctosecond=d,arguments[14]&&i.validateTimeZone(arguments[14])}if(i.timeZone||i.validateTimeZone("Local"),r){const e=r.toTimeZone(i.timeZone);i.dateData=e.dateData}}static isValidDate(e){const t=this.validateDate(e);return!(!t||t&&!t.dateData)}static validateDate(e,t,a){if(e instanceof Smart.Utilities.DateTime)return e;if(e instanceof Date)return new Smart.Utilities.DateTime(e);try{if("string"==typeof e&&a)return this.parseDateString(e,t,a);if(new RegExp(/^\d{1,2}\/\d{1,2}\/\d{4}(, \d{1,2}:\d{2}:\d{1,2} [A|P]M)?$/).test(e)){const t=new Date(e);if(!isNaN(t.getTime()))return new Smart.Utilities.DateTime(t)}if("string"==typeof e)return this.parseDateString(e,t,a);if("number"==typeof e)return new Smart.Utilities.DateTime(new Date(e))}catch(e){}return t}static parseDateString(e,t,a){const s=new Date(e);if(!isNaN(s.getTime()))return e&&"string"==typeof e&&a?new Smart.Utilities.DateTime(e,a,null):new Smart.Utilities.DateTime(s);const i=e.indexOf("Date("),r=e.indexOf("DateTime("),n=e.lastIndexOf(")");let o=e;if(-1===i&&-1===r||-1===n){const t=new Smart.Utilities.DateTime,s=t.parseDate(e,a);if(s)return o=new Smart.Utilities.DateTime(s),t.copySmallTimePartValues(o),o}else{if(o=-1!==i?e.slice(i+5,n):e.slice(r+9,n),o=o.replace(/'/g,"").replace(/"/g,"").replace(/^\s+|\s+$|\s+(?=\s)/g,""),""===o.trim())return new Smart.Utilities.DateTime;if(new RegExp(/(^(\d+)(\s*,\s*\d+)+(\s*,\s*[a-zA-Z ]+)?$)/g).test(o))return o=o.split(","),o.map((function(e,t){isNaN(o[t])?o[t]=e.trim():o[t]=parseInt(e)})),-1!==i&&o[1]++,o.unshift(null),o=new(Function.prototype.bind.apply(Smart.Utilities.DateTime,o)),o}if(""===o.trim())return t;if(!isNaN(o))return o=new Date(parseInt(o,10)),new Smart.Utilities.DateTime(o);try{const e=o.split(",");2===e.length?(e[1]=e[1].trim(),e.unshift(null),o=new(Function.prototype.bind.apply(Smart.Utilities.DateTime,e))):o=new Smart.Utilities.DateTime(o)}catch(e){o=t}return o}static fromFullTimeStamp(e){e=e.toString();const t=new Smart.Utilities.DateTime(parseFloat(e.slice(0,e.length-21)));let a=e.slice(e.length-21),s=0;for(;a.length>0;)t[t._smallUnits[s]]=parseInt(a.slice(0,3),10),a=a.slice(3),s++;return t}static getConstructorParameters(e){return[e.year(),e.month(),e.day(),e.hour(),e.minute(),e.second(),e.millisecond(),e._microsecond,e._nanosecond,e._picosecond,e._femtosecond,e._attosecond,e._zeptosecond,e._yoctosecond,e.timeZone]}static detectDisplayMode(e,t,a){if(e.calendar.patterns[t])return-1!==["d","D","M","Y","d1","d2"].indexOf(t)?"calendar":-1!==["t","T","FT","PT"].indexOf(t)?"timePicker":"default";const s=["d","M","y"],i=["h","H","m","s","t","f","u","n","p","e","a","x","o"],r=a.groups;let n=!1,o=!1;for(let e=0;e<r.length;e++){const t=r[e].charAt(0);if(-1!==s.indexOf(t)?n=!0:-1!==i.indexOf(t)&&(o=!0),n&&o)break}return n===o?"default":n?"calendar":"timePicker"}static getLocalizedNames(e){const t={names:[],namesAbbr:[],namesShort:[]},a={names:[],namesAbbr:[]};if(this[e])return this[e];for(let a=23;a<30;a++){const s=new Date(2017,6,a),i=s.toLocaleString(e,{weekday:"long"});t.names.push(i),t.namesAbbr.push(s.toLocaleString(e,{weekday:"short"})),t.namesShort.push(i.substring(0,2))}for(let t=0;t<12;t++){const s=new Date(2017,t,1).toLocaleString(e,{month:"long"});a.names.push(s),a.namesAbbr.push(s.substring(0,3))}return a.names.push(""),a.namesAbbr.push(""),this[e]={days:t,months:a},this[e]}internalMS(){return this.dateData}getDatePart(e){const t=this,a=t.internalMS();let s=parseInt(a/t.millisPerDay);const i=parseInt(s/t.daysPer400Years);s-=i*t.daysPer400Years;let r=parseInt(s/t.daysPer100Years);4===r&&(r=3),s-=r*t.daysPer100Years;const n=parseInt(s/t.daysPer4Years);s-=n*t.daysPer4Years;let o=parseInt(s/t.daysPerYear);if(4===o&&(o=3),e===t.datePartYear)return parseInt(400*i+100*r+4*n+o+1);if(s-=o*t.daysPerYear,e===t.datePartDayOfYear)return parseInt(s+1);const d=3===o&&(24!==n||3===r)?t.daysToMonth366:t.daysToMonth365;let l=s>>6;for(;s>=d[l];)l++;return e===t.datePartMonth?parseInt(l):parseInt(s-d[l-1]+1)}dayOfWeek(){const e=this.dateData;return parseInt(e/this.millisPerDay+1)%7}dayOfYear(){return this.getDatePart(this.datePartDayOfYear)}weekOfYear(e){const t=this.toDate(),a=e||this.calendar.firstDay,s=new Date(t.getFullYear(),0,1),i=Math.floor((t.getTime()-s.getTime()-6e4*(t.getTimezoneOffset()-s.getTimezoneOffset()))/864e5)+1;let r,n=s.getDay()-a;if(n=n>=0?n:n+7,n<4){if(r=Math.floor((i+n-1)/7)+1,r>52){let e=new Date(t.getFullYear()+1,0,1).getDay()-a;e=e>=0?e:e+7,r=e<4?1:53}}else r=Math.floor((i+n-1)/7);return r}subtract(e){const t=this;return new Smart.Utilities.TimeSpan(t.dateData*t.ticksPerMillisecond-e.dateData*t.ticksPerMillisecond)}dateToMS(e,t,a){const s=this;if(e>=1&&e<=9999&&t>=1&&t<=12){e=parseInt(e);const i=s.isLeapYear(e)?s.daysToMonth366:s.daysToMonth365;if(a>=1&&a<=i[t]-i[t-1]){const r=e-1;return(365*r+parseInt(r/4)-parseInt(r/100)+parseInt(r/400)+i[t-1]+a-1)*s.millisPerDay}}}isLeapYear(e){if(e<1||e>9999)throw new Error("Year out of Range");return e%4==0&&(e%100!=0||e%400==0)}timeToMS(e,t,a,s){const i=this;if(e>=0&&e<24&&t>=0&&t<60&&a>=0&&a<60){const r=parseInt(3600*e+60*t+a);return s>0&&s<1e3?r*i.millisPerSecond+s:r*i.millisPerSecond}}daysInMonth(e,t){if(t<1||t>12)throw new Error("Month out of Range");const a=this,s=a.isLeapYear(e)?a.daysToMonth366:a.daysToMonth365;return s[t]-s[t-1]}arrayIndexOf(e,t){return e.indexOf(t)}startsWith(e,t){return 0===e.indexOf(t)}endsWith(e,t){return e.substr(e.length-t.length)===t}trim(e){return(e+"").replace(this.regexTrim,"")}expandFormat(e,t){t=t||"F";let a,s=e.patterns,i=t.length;if(s[t])return s[t];if(1===i){if(a=s[t],!a)throw"Invalid date format string '"+t+"'.";t=a}else 2===i&&"%"===t.charAt(0)&&(t=t.charAt(1));return t}getEra(e,t){if(!t)return 0;if("string"==typeof e)return 0;let a,s=e.getTime();for(let e=0,i=t.length;e<i;e++)if(a=t[e].start,null===a||s>=a)return e;return 0}toUpper(e){return e.split(" ").join(" ").toUpperCase()}toUpperArray(e){const t=[];for(let a=0,s=e.length;a<s;a++)t[a]=this.toUpper(e[a]);return t}getEraYear(e,t,a,s){let i=e.getFullYear();return!s&&t.eras&&(i-="number"==typeof a?a:t.eras[a].offset),i}getDayIndex(e,t,a){const s=this,i=e.days;let r,n=e._upperDays;return n||(e._upperDays=n=[s.toUpperArray(i.names),s.toUpperArray(i.namesAbbr),s.toUpperArray(i.namesShort)]),t=t.toUpperCase(),a?(r=s.arrayIndexOf(n[1],t),-1===r&&(r=s.arrayIndexOf(n[2],t))):r=s.arrayIndexOf(n[0],t),r}getMonthIndex(e,t,a){const s=this;let i=e.months,r=e.monthsGenitive||e.months,n=e._upperMonths,o=e._upperMonthsGen;n||(e._upperMonths=n=[s.toUpperArray(i.names),s.toUpperArray(i.namesAbbr)],e._upperMonthsGen=o=[s.toUpperArray(r.names),s.toUpperArray(r.namesAbbr)]),t=s.toUpper(t);let d=s.arrayIndexOf(a?n[1]:n[0],t);return d<0&&(d=s.arrayIndexOf(a?o[1]:o[0],t)),d}appendPreOrPostMatch(e,t){let a=0,s=!1;for(let i=0,r=e.length;i<r;i++){const r=e.charAt(i);switch(r){case"'":s?t.push("'"):a++,s=!1;break;case"\\":s&&t.push("\\"),s=!s;break;default:t.push(r),s=!1}}return a}getTokenRegExp(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyyy|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|uu|u|nn|n|pp|p|ee|e|aa|a|xx|x|oo|o|i{1,24}|zzz|zz|z|gg|g/g}static ParseDate(e,t){return(new Smart.Utilities.DateTime).tryparseDate(e,null,t)}tryparseDate(e,t,a){const s=this;if(null==t&&(t=s.calendar),void 0!==a){if(Array.isArray(a))for(let i=0;i<a.length;i++){const r=s.parseDate(e,a[i],t);if(r)return r}const i=s.parseDate(e,a,t);if(i)return i}if(""===e)return null;if(null==e||e.substring||(e=e.toString()),null!=e&&"/Date("===e.substring(0,6)){const t=/^\/Date\((-?\d+)(\+|-)?(\d+)?\)\/$/;let a=new Date(+e.replace(/\/Date\((\d+)\)\//,"$1"));if("Invalid Date"===a){const t=e.match(/^\/Date\((\d+)([-+]\d\d)(\d\d)\)\/$/);a=null,t&&(a=new Date(1*t[1]+36e5*t[2]+6e4*t[3]))}if(null==a||"Invalid Date"===a||isNaN(a)){const a=t.exec(e);if(a){const e=new Date(parseInt(a[1]));if(a[2]){let t=parseInt(a[3]);"-"===a[2]&&(t=-t);const s=e.getUTCMinutes();e.setUTCMinutes(s-t)}if(!isNaN(e.valueOf()))return e}}return a}const i={smartdate:"yyyy-MM-dd HH:mm:ss",d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss",ISO:"yyyy-MM-dd hh:mm:ss",ISO2:"yyyy-MM-dd HH:mm:ss",ISO8601:"yyyy-MM-ddTHH:mm:ss.sssZ",d1:"dd.MM.yyyy",d2:"dd-MM-yyyy",d3:"MM-dd-yyyy",d4:"MM.dd.yyyy",zone1:"yyyy-MM-ddTHH:mm:ss-HH:mm",zone2:"yyyy-MM-ddTHH:mm:ss+HH:mm",custom:"yyyy-MM-ddTHH:mm:ss.fff",custom2:"yyyy-MM-dd HH:mm:ss.fff",custom3:"yyyy-MM-ddTHH:mm:ss.fff+HH:mm",custom4:"yyyy-MM-ddTHH:mm:ss.fff-HH:mm",custom5:"yyyy-MM-ddTHH:mm:ss.ffffff+HH:mm",custom6:"yyyy-MM-ddTHH:mm:ss.ffffff-HH:mm",iso:"yyyy-MM-ddTHH:mm:ssZ",iso2:"yyyy-MM-ddTHH:mm.fffZ",iso_date1:"yyyy-MM-dd",iso_date2:"yyyy-MM-dd",iso_date3:"yyyy-ddd",iso_date4:"yyyy-MM-dd HH:mm",iso_date5:"yyyy-MM-dd HH:mm Z",iso_date6:"yyyy-MMM-dd",iso_date7:"yyyy-MM",iso_date8:"yyyy-MMM",iso_date9:"yyyy-MMMM",iso_date10:"yyyy-MMMM-dd",iso_time1:"HH:mm:ss.tttt",iso_time2:"HH:mm:ss",iso_time3:"HH:mm",iso_time4:"HH",iso_time5:"yyyyyy-MM-dd",iso_time6:"yyyyyy-MM-dd"};for(let a in i){const r=s.parseDate(e,i[a],t);if(r)return r}const r=t.patterns;for(let a in r){const i=s.parseDate(e,r[a],t);if(i){if("ISO"===a){const a=s.parseDate(e,r.ISO2,t);if(a)return a}return i}}let n;if("string"==typeof e){const a=[":","/","-"," ",","];let i="",r=e=function(e,t,a){return a.replace(new RegExp(e,"g"),t)}(", ",",",e=s.trim(e));e.indexOf(":")>=0?(i=e.substring(e.indexOf(":")-2),i=s.trim(i),r=e.substring(0,e.indexOf(":")-2)):e.toUpperCase().indexOf("AM")>=0?(i=e.substring(e.toUpperCase().indexOf("AM")-2),i=s.trim(i),r=e.substring(0,e.toUpperCase().indexOf("AM")-2)):e.toUpperCase().indexOf("PM")>=0&&(i=e.substring(e.toUpperCase().indexOf("PM")-2),i=s.trim(i),r=e.substring(0,e.toUpperCase().indexOf("PM")-2));let o=new Date,d=!1;if(r){for(let e=0;e<a.length;e++)if(r.indexOf(a[e])>=0){n=r.split(a[e]);break}if(!n)return null;let e=new Array,i=new Array,l=new Array,f=null,m=null;for(let a=0;a<n.length;a++){const i=n[a],r=s.parseDate(i,"d",t)||s.parseDate(i,"dd",t)||s.parseDate(i,"ddd",t)||s.parseDate(i,"dddd",t);if(r&&(e.push(r.getDate()),i.length>2)){f=a;break}}for(let e=0;e<n.length;e++){const a=n[e],r=s.parseDate(a,"M",t)||s.parseDate(a,"MM",t)||s.parseDate(a,"MMM",t)||s.parseDate(a,"MMMM",t);if(r){if(null!=f&&f===e)continue;if(i.push(r.getMonth()),a.length>2){m=e;break}}}for(let e=0;e<n.length;e++){const a=n[e],i=s.parseDate(a,"yyyy",t);if(i){if(null!=f&&f===e)continue;if(null!=m&&m===e)continue;l.push(i.getFullYear())}}const c=new Array;for(let t=e.length-1;t>=0;t--)for(let a=0;a<i.length;a++)for(let s=0;s<l.length;s++){const r=new Date(l[s],i[a],e[t]);l[s]<1970&&r.setFullYear(l[s]),isNaN(r.getTime())||c.push(r)}c.length>0&&(o=c[0],d=!0)}if(i){const e=i.indexOf(":")>=0?i.split(":"):i,a=s.parseDate(i,"h:mm tt",t)||s.parseDate(i,"HH:mm:ss.fff",t)||s.parseDate(i,"HH:mm:ss.ff",t)||s.parseDate(i,"h:mm:ss tt",t)||s.parseDate(i,"HH:mm:ss.tttt",t)||s.parseDate(i,"HH:mm:ss",t)||s.parseDate(i,"HH:mm",t)||s.parseDate(i,"HH",t);let r=0,n=0,l=0,f=0;a&&!isNaN(a.getTime())?(r=a.getHours(),n=a.getMinutes(),l=a.getSeconds(),f=a.getMilliseconds()):(1===e.length&&(r=parseInt(e[0])),2===e.length&&(r=parseInt(e[0]),n=parseInt(e[1])),3===e.length&&(r=parseInt(e[0]),n=parseInt(e[1]),e[2].indexOf(".")>=0?(l=parseInt(e[2].toString().split(".")[0]),f=parseInt(e[2].toString().split(".")[1])):l=parseInt(e[2])),4===e.length&&(r=parseInt(e[0]),n=parseInt(e[1]),l=parseInt(e[2]),f=parseInt(e[3]))),!o||isNaN(r)||isNaN(n)||isNaN(l)||isNaN(f)||(o.setHours(r,n,l,f),d=!0)}if(d)return o}if(null!=e){n=[":","/","-"];let t=!0;for(let a=0;a<n.length;a++)-1!==e.indexOf(n[a])&&(t=!1);if(t){const t=new Number(e);if(!isNaN(t))return new Date(t)}}return null}getParseRegExp(e,t){const a=this;let s=e._parseRegExp;if(s){const e=s[t];if(e)return e}else e._parseRegExp=s={};let i,r=a.expandFormat(e,t).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1"),n=["^"],o=[],d=0,l=0,f=a.getTokenRegExp();for(;null!==(i=f.exec(r));){const e=r.slice(d,i.index);if(d=f.lastIndex,l+=a.appendPreOrPostMatch(e,n),l%2){n.push(i[0]);continue}let t,s=i[0],m=s.length;switch(s){case"dddd":case"ddd":case"MMMM":case"MMM":case"gg":case"g":t="(\\D+)";break;case"tt":case"t":t="(\\D*)";break;case"yyyyy":t="(\\d{1,4})";break;case"yyyy":t="(\\d{"+m+"})";break;case"fff":case"ff":case"f":t="(\\d{1,"+m+"})";break;case"dd":case"d":case"MM":case"M":case"yy":case"y":case"HH":case"H":case"hh":case"h":case"mm":case"m":case"ss":case"s":t="(\\d\\d?)";break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":t="(\\d{1,3})";break;case"zzz":t="([+-]?\\d\\d?:\\d{2})";break;case"zz":case"z":t="([+-]?\\d\\d?)";break;case"/":t="/";break;default:if(!/i{1,24}/.test(s))throw"Invalid date format pattern '"+s+"'.";t="(\\d{"+s.length+"})"}t&&n.push(t),"/"!==s&&o.push(i[0])}a.appendPreOrPostMatch(r.slice(d),n),n.push("$");const m={regExp:n.join("").replace(/\s+/g,"\\s+"),groups:o};return s[t]=m}outOfRange(e,t,a){return e<t||e>a}expandYear(e,t){const a=this,s=new Date,i=a.getEra(s);if(t<100){let r=e.twoDigitYearMax;r="string"==typeof r?(new Date).getFullYear()%100+parseInt(r,10):r;const n=a.getEraYear(s,e,i);(t+=n-n%100)>r&&(t-=100)}return t}padZeros(e,t){let a,s=e+"";return t>1&&s.length<t?(a=["0","00","000"][t-2]+s,a.substr(a.length-t,t)):(a=s,a)}parseDate(e,t,a){const s=this;null==a&&(a=s.calendar),e=s.trim(e);const i=a,r=s.getParseRegExp(i,t),n=new RegExp(r.regExp).exec(e);if(null===n)return null;let o,d=r.groups,l=null,f=null,m=null,c=null,u=null,p=0,y=0,g=0,h=0,T=null,M=!1;for(let e=0,t=d.length;e<t;e++){const t=n[e+1];if(t){const a=d[e],r=a.length,n=parseInt(t,10);switch(a){case"dd":case"d":if(c=n,s.outOfRange(c,1,31))return null;break;case"MMM":case"MMMM":case"MMMMM":case"MMMMMM":case"MMMMMMM":case"MMMMMMMM":if(m=s.getMonthIndex(i,t,3===r),s.outOfRange(m,0,11))return null;break;case"M":case"MM":if(m=n-1,s.outOfRange(m,0,11))return null;break;case"y":case"yy":case"yyyy":if(f=r<4?s.expandYear(i,n):n,s.outOfRange(f,0,9999))return null;break;case"h":case"hh":if(p=n,12===p&&(p=0),s.outOfRange(p,0,11))return null;break;case"H":case"HH":if(p=n,s.outOfRange(p,0,23))return null;break;case"m":case"mm":if(y=n,s.outOfRange(y,0,59))return null;break;case"s":case"ss":if(g=n,s.outOfRange(g,0,59))return null;break;case"tt":case"t":if(M=i.PM&&(t===i.PM[0]||t===i.PM[1]||t===i.PM[2]),!M&&(!i.AM||t!==i.AM[0]&&t!==i.AM[1]&&t!==i.AM[2]))return null;break;case"f":case"ff":case"fff":if(h=n*Math.pow(10,3-r),s.outOfRange(h,0,999))return null;break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":if(s.outOfRange(n,0,1e3))return null;s[s._codeToUnit[a]]=n;break;case"ddd":case"dddd":if(u=s.getDayIndex(i,t,3===r),s.outOfRange(u,0,6))return null;break;case"zzz":{const e=t.split(/:/);if(2!==e.length)return null;if(o=parseInt(e[0],10),s.outOfRange(o,-12,13))return null;const a=parseInt(e[1],10);if(s.outOfRange(a,0,59))return null;T=60*o+(s.startsWith(t,"-")?-a:a);break}case"z":case"zz":if(o=n,s.outOfRange(o,-12,13))return null;T=60*o;break;case"g":case"gg":{let e=t;if(!e||!i.eras)return null;e=this.trim(e.toLowerCase());for(let t=0,a=i.eras.length;t<a;t++)if(e===i.eras[t].nathat.toLowerCase()){l=t;break}if(null===l)return null;break}default:{let e=t;e.length%3==1?e+="00":e.length%3==2&&(e+="0"),h=parseInt(e.slice(0,3),10),e=e.slice(3);let a=0;for(;e.length>0;)s[s._smallUnits[a]]=parseInt(e.slice(0,3),10),e=e.slice(3),a++}}}}let S,D=new Date,H=i.convert;if(S=D.getFullYear(),null===f?f=S:i.eras&&(f+=i.eras[l||0].offset),null===m&&(m=0),null===c&&(c=1),H){if(D=H.toGregorian(f,m,c),null===D)return null}else{if(D.setFullYear(f,m,c),D.getDate()!==c)return null;if(null!==u&&D.getDay()!==u)return null}if(M&&p<12&&(p+=12),D.setHours(p,y,g,h),null!==T){const e=D.getMinutes()-(T+D.getTimezoneOffset());D.setHours(D.getHours()+parseInt(e/60,10),e%60)}return D}toString(e,t){const a=this;void 0===e&&(e="yyyy-MM-dd HH:mm:ss");const s=a.dateData.toString()+a.getFractionsOfSecondStamp()+e+(a.timeZone||"");if(Smart.Utilities.DateTime.cache&&Smart.Utilities.DateTime.cache[s]&&!1!==a.showTodayDateAsString)return Smart.Utilities.DateTime.cache[s];const i=a.toDate();if(null==t&&(t=a.calendar),"string"==typeof i)return i;if(!e||!e.length||"i"===e){let e;return e=a.formatDate(i,t.patterns.F,t),e}const r=t.eras,n="s"===e;e=a.expandFormat(t,e);const o=[];let d,l=0,f=a.getTokenRegExp();function m(e,t){if(void 0!==e.getMonth)switch(t){case 0:return e.getFullYear();case 1:return e.getMonth();case 2:return e.getDate()}}for(;;){const s=f.lastIndex,c=f.exec(e),u=e.slice(s,c?c.index:e.length);if(l+=a.appendPreOrPostMatch(u,o),!c)break;if(l%2){o.push(c[0]);continue}const p=c[0],y=p.length;let g;if(/i{1,24}/.test(p))o.push(a.getFirstNDigitsOfPrecision(p.length));else switch(p){case"ddd":case"dddd":{const e=3===y?t.days.namesAbbr:t.days.names;o.push(e[i.getDay()]);break}case"d":case"dd":o.push(a.padZeros(m(i,2),y));break;case"MMM":case"MMMM":g=m(i,1),o.push(t.months[3===y?"namesAbbr":"names"][g]);break;case"M":case"MM":o.push(a.padZeros(m(i,1)+1,y));break;case"y":case"yy":case"yyyy":g=a.getEraYear(i,t,a.getEra(i,r),n),y<4&&(g%=100),o.push(a.padZeros(g,y));break;case"h":case"hh":d=i.getHours()%12,0===d&&(d=12),o.push(a.padZeros(d,y));break;case"H":case"HH":o.push(a.padZeros(i.getHours(),y));break;case"m":case"mm":o.push(a.padZeros(i.getMinutes(),y));break;case"s":case"ss":o.push(a.padZeros(i.getSeconds(),y));break;case"t":case"tt":g=i.getHours()<12?t.AM?t.AM[0]:" ":t.PM?t.PM[0]:" ",o.push(1===y?g.charAt(0):g);break;case"f":case"ff":case"fff":o.push(a.padZeros(i.getMilliseconds(),3).substr(0,y));break;case"u":case"n":case"p":case"e":case"a":case"x":case"o":o.push(a[a._codeToUnit[p]]);break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":o.push(a.padZeros(a[a._codeToUnit[p]],3));break;case"z":case"zz":o.push((a.timeZoneOffsetHours>=0?"+":"-")+a.padZeros(Math.floor(Math.abs(a.timeZoneOffsetHours)),y));break;case"zzz":o.push((a.timeZoneOffsetHours>=0?"+":"-")+a.padZeros(Math.floor(Math.abs(a.timeZoneOffsetHours)),2)+":"+a.padZeros(60*Math.abs(a.timeZoneOffsetHours%1),2));break;case"g":case"gg":t.eras&&o.push(t.eras[a.getEra(i,r)].name);break;case"/":o.push(t["/"]);break;default:throw"Invalid date format pattern '"+p+"'."}}let c=o.join("");if(Smart.Utilities.DateTime.cache||(Smart.Utilities.DateTime.cache=new Array),a._today||(a._today=new Date),a.calendar&&a.calendar.today&&-1===e.indexOf(":")&&i.getFullYear()===a._today.getFullYear()&&i.getDate()===a._today.getDate()&&i.getMonth()===a._today.getMonth()){if(!1===a.showTodayDateAsString)return Smart.Utilities.DateTime.cache[s]=c,c;c=a.calendar.today}return Smart.Utilities.DateTime.cache[s]=c,c}getFractionsOfSecondStamp(){const e=this;return e._microsecond.toString()+e._nanosecond+e._picosecond+e._femtosecond+e._attosecond+e._zeptosecond+e._yoctosecond}getFirstNDigitsOfPrecision(e,t){const a=this;return(""+(!0!==t?a.padZeros(a.millisecond(),3):"")+a.padZeros(a._microsecond,3)+a.padZeros(a._nanosecond,3)+a.padZeros(a._picosecond,3)+a.padZeros(a._femtosecond,3)+a.padZeros(a._attosecond,3)+a.padZeros(a._zeptosecond,3)+a.padZeros(a._yoctosecond,3)).slice(0,e)}copySmallTimePartValues(e){const t=this;e._microsecond=t._microsecond,e._nanosecond=t._nanosecond,e._picosecond=t._picosecond,e._femtosecond=t._femtosecond,e._attosecond=t._attosecond,e._zeptosecond=t._zeptosecond,e._yoctosecond=t._yoctosecond}add(e,t,a){const s=this,i=s.internalMS();if(void 0===t){if(!1===a)return s.dateData=i+parseInt(e._ticks/s.ticksPerMillisecond),s;const t=new Smart.Utilities.DateTime(i+parseInt(e._ticks/s.ticksPerMillisecond));return s.copyTimeZone(t),s.copySmallTimePartValues(t),t}const r=e*t;if(r<=-s.maxMillis||r>=s.maxMillis)throw new Error("Out of Range");if(!1===a)return s.dateData=i+r,s;const n=new Smart.Utilities.DateTime(i+r);return s.copyTimeZone(n),s.copySmallTimePartValues(n),n}addDays(e,t){return this.add(e,this.millisPerDay,t)}clone(){const e=this,t=new Smart.Utilities.DateTime(e.dateData);return e.copyTimeZone(t),e.copySmallTimePartValues(t),t}clearTime(){const e=this,t=e.month(),a=e.year(),s=e.day(),i=new Smart.Utilities.DateTime(a,t,s,0,0,0,0);return e.copyTimeZone(i),i}addHours(e,t){return this.add(e,this.millisPerHour,t)}addDeciseconds(e,t){return this.add(100*e,1,t)}addCentiseconds(e,t){return this.add(10*e,1,t)}addMilliseconds(e,t){return this.add(e,1,t)}addMinutes(e,t){return this.add(e,this.millisPerMinute,t)}addMonths(e,t){const a=this;if(e<-12e4||e>12e4)throw new Error("Invalid Months Value");let s=parseInt(a.getDatePart(a.datePartYear)),i=parseInt(a.getDatePart(a.datePartMonth)),r=parseInt(a.getDatePart(a.datePartDay));if(e%12==0)s+=e/12;else{const t=i-1+e;t>=0?(i=t%12+1,s+=t/12):(i=12+(t+1)%12,s+=(t-11)/12),s=parseInt(s)}if(s<1||s>9999)throw new Error("Year out of range");const n=a.daysInMonth(s,i);if(r>n&&(r=n),!1===t)return a.dateData=a.dateToMS(s,i,r)+a.internalMS()%a.millisPerDay,a;const o=new Smart.Utilities.DateTime(a.dateToMS(s,i,r)+a.internalMS()%a.millisPerDay);return a.copyTimeZone(o),a.copySmallTimePartValues(o),o}addSeconds(e,t){return this.add(e,this.millisPerSecond,t)}addYears(e,t){return this.addMonths(12*e,t)}addMicroseconds(e,t){if(0===e)return;const a=this;let s,i;e<0&&0===a.hour()&&0===a.minute()&&0===a.second()&&0===a.millisecond()&&0===a._microsecond&&(s=parseInt(e/1e3,10)-1,i=1e3+e%1e3);const r=1e3*a.timeToMS(a.hour(),a.minute(),a.second(),a.millisecond())+a._microsecond,n=r+e;let o;if(void 0===s&&(s=parseInt(n/1e3,10)-parseInt(r/1e3,10)),void 0===i&&(i=parseInt(n%1e3,10)),0!==s&&(o=a.addMilliseconds(s,t)),!1!==t)return o||(o=a.clone()),o._microsecond=i,o;a._microsecond=i}addFractionsOfSecond(e,t,a,s,i){if(0===e)return;const r=this,n=1e3*r[s]+r[a],o=e+n;let d,l=parseInt(o/1e3,10)-parseInt(n/1e3,10),f=parseInt(o%1e3,10);if(e<0&&o<0&&f<0&&(l--,f=1e3+f),0!==l&&(d=r[i](l,t)),!1!==t)return d||(d=r.clone()),d[a]=f,d;r[a]=f}addNanoseconds(e,t){return this.addFractionsOfSecond(e,t,"_nanosecond","_microsecond","addMicroseconds")}addPicoseconds(e,t){return this.addFractionsOfSecond(e,t,"_picosecond","_nanosecond","addNanoseconds")}addFemtoseconds(e,t){return this.addFractionsOfSecond(e,t,"_femtosecond","_picosecond","addPicoseconds")}addAttoseconds(e,t){return this.addFractionsOfSecond(e,t,"_attosecond","_femtosecond","addFemtoseconds")}addZeptoseconds(e,t){return this.addFractionsOfSecond(e,t,"_zeptosecond","_attosecond","addAttoseconds")}addYoctoseconds(e,t){return this.addFractionsOfSecond(e,t,"_yoctosecond","_zeptosecond","addZeptoseconds")}getTimeZoneOffset(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1),s=e.getTimezoneOffset()<Math.max(t.getTimezoneOffset(),a.getTimezoneOffset());return{offset:-e.getTimezoneOffset()/60,dst:+s}}isInDaylightSavingTime(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1);return this.date().getTimezoneOffset()<Math.max(t.getTimezoneOffset(),a.getTimezoneOffset())}supportsDaylightSavingTime(){const e=new Date,t=new Date(e.getFullYear(),0,1),a=new Date(e.getFullYear(),6,1);return t.getTimezoneOffset()!==a.getTimezoneOffset()}date(){const e=this,t=e.month(),a=e.year(),s=e.day(),i=new Smart.Utilities.DateTime(a,t,s);return e.copyTimeZone(i),i}isWeekend(){return 0===this.dayOfWeek()||6===this.dayOfWeek()}toDate(e){const t=this,a=t.month(),s=t.year(),i=t.day(),r=t.hour(),n=t.minute(),o=t.second(),d=t.millisecond();let l=new Date(s,a-1,i);if(s<1970&&l.setFullYear(s),l.setHours(r,n,o,d),e){const a=t.timeZones.filter((function(t){return t.id===e}));if(a.length){let e=a[0].offset;const s=l.getTime();let i=60*l.getTimezoneOffset()*1e3;if(t.timeZone){const e=t.timeZones.filter((function(e){return e.id===t.timeZone}));e.length&&(i=60*-e[0].offset*1e3)}l=new Date(s+i+6e4*e)}}return l}toTimeZone(e){const t=this;let a=e;if(null==a&&(a="Local"),t.timeZone===a)return t.clone();const s=t.timeZones.filter((function(e){return e.id===a}));if(0===s.length)return t.clone();const i=this.toDate(a),r=new Smart.Utilities.DateTime(i);return r.timeZone=a,r.timeZoneOffset=s[0].offset,r.timeZoneOffsetHours=s[0].offsetHours,t.copySmallTimePartValues(r),r}day(){return this.getDatePart(this.datePartDay)}month(){return this.getDatePart(this.datePartMonth)}year(){return this.getDatePart(this.datePartYear)}millisecond(){return parseInt(this.internalMS()%1e3)}hour(){return parseInt(Math.floor(this.internalMS()/this.millisPerHour)%24)}minute(){return parseInt(this.internalMS()/this.millisPerMinute%60)}second(){return parseInt(this.internalMS()/this.millisPerSecond%60)}microsecond(){return this._microsecond}nanosecond(){return this._nanosecond}picosecond(){return this._picosecond}femtosecond(){return this._femtosecond}attosecond(){return this._attosecond}zeptosecond(){return this._zeptosecond}yoctosecond(){return this._yoctosecond}valueOf(){return this.dateData}equals(e){const t=this;return t.dateData===e.dateData&&t._microsecond===e._microsecond&&t._nanosecond===e._nanosecond&&t._picosecond===e._picosecond&&t._femtosecond===e._femtosecond&&t._attosecond===e._attosecond&&t._zeptosecond===e._zeptosecond&&t._yoctosecond===e._yoctosecond}equalDateParts(e){const t=this;return t.year()===e.year()&&t.month()===e.month()&&t.day()===e.day()}compare(e){const t=this;if(t.equals(e))return 0;const a=["dateData","_microsecond","_nanosecond","_picosecond","_femtosecond","_attosecond","_zeptosecond","_yoctosecond"];for(let s=0;s<a.length;s++){const i=a[s];if(t[i]>e[i])return 1;if(t[i]<e[i])return-1}return 0}toDateString(){return this.toDate().toDateString()}toLocaleDateString(){return this.toDate().toLocaleDateString(this.calendar.locale)}toLocaleString(){return this.toDate().toLocaleString(this.calendar.locale)}toLocaleTimeString(){return this.toDate().toLocaleTimeString(this.calendar.locale)}validateTimeZone(e){const t=this;if("string"!=typeof e)return;const a=t.timeZones.filter((function(t){return t.id===e}));0!==a.length&&(t.timeZone=e,t.timeZoneOffset=a[0].offset,t.timeZoneOffsetHours=a[0].offsetHours)}copyTimeZone(e){const t=this;e.timeZone=t.timeZone,e.timeZoneOffset=t.timeZoneOffset,e.timeZoneOffsetHours=t.timeZoneOffsetHours}getTimeStamp(){return new Smart.Utilities.BigNumber(this.dateData.toString()+this.getFirstNDigitsOfPrecision(void 0,!0))}})})();
|
|
10
10
|
Smart.Utilities.Assign("Draw",class{constructor(t,e){const i=this;i.host=t,i.renderEngine=e||"",i.refresh();const r=["clear","removeElement","attr","getAttr","line","circle","rect","path","pieslice","pieSlicePath","text","measureText"];for(let t in r)i._addFn(Smart.Utilities.Draw.prototype,r[t])}_addFn(t,e){t[e]||(t[e]=function(){return this.renderer[e].apply(this.renderer,arguments)})}_initRenderer(t){return this.createRenderer(this,t)}_internalRefresh(){const t=this;if(t.renderer||(t.host.innerHTML="",t._initRenderer(t.host)),"none"===window.getComputedStyle(t.host).display)return;const e=t.renderer;if(!e)return;const i=e.getRect();t._render({x:1,y:1,width:i.width,height:i.height})}_render(t){this._plotRect=t}refresh(){this._internalRefresh()}getSize(){const t=this._plotRect;return{width:t.width,height:t.height}}toGreyScale(t){if(-1===t.indexOf("#"))return t;const e=this.cssToRgb(t);e[0]=e[1]=e[2]=Math.round(.3*e[0]+.59*e[1]+.11*e[2]);const i=this.rgbToHex(e[0],e[1],e[2]);return"#"+i[0]+i[1]+i[2]}decToHex(t){return t.toString(16)}hexToDec(t){return parseInt(t,16)}rgbToHex(t,e,i){return[this.decToHex(t),this.decToHex(e),this.decToHex(i)]}hexToRgb(t,e,i){return[this.hexToDec(t),this.hexToDec(e),this.hexToDec(i)]}cssToRgb(t){return t.indexOf("rgb")<=-1?this.hexToRgb(t.substring(1,3),t.substring(3,5),t.substring(5,7)):t.substring(4,t.length-1).split(",")}hslToRgb(t){let e,i,r;const s=parseFloat(t[0]),n=parseFloat(t[1]),h=parseFloat(t[2]);if(0===n)e=i=r=h;else{const t=h<.5?h*(1+n):h+n-h*n,a=2*h-t;e=this.hueToRgb(a,t,s+1/3),i=this.hueToRgb(a,t,s),r=this.hueToRgb(a,t,s-1/3)}return[255*e,255*i,255*r]}hueToRgb(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+6*(e-t)*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}rgbToHsl(t){const e=parseFloat(t[0])/255,i=parseFloat(t[1])/255,r=parseFloat(t[2])/255,s=Math.max(e,i,r),n=Math.min(e,i,r);let h,a,o=(s+n)/2;if(s===n)h=a=0;else{const t=s-n;switch(a=o>.5?t/(2-s-n):t/(s+n),s){case e:h=(i-r)/t+(i<r?6:0);break;case i:h=(r-e)/t+2;break;case r:h=(e-i)/t+4}h/=6}return[h,a,o]}swap(t,e){const i=t;t=e,e=i}getNum(t){if(t.constructor!==Array){if(isNaN(t))return 0}else for(let e=0;e<t.length;e++)if(!isNaN(t[e]))return t[e];return 0}_ptRotate(t,e,i,r,s){const n=Math.sqrt(Math.pow(Math.abs(t-i),2)+Math.pow(Math.abs(e-r),2)),h=Math.asin((t-i)/n)+s;return{x:t=i+Math.cos(h)*n,y:e=r+Math.sin(h)*n}}log(t,e){return Math.log(t)/(e?Math.log(e):1)}_mod(t,e){const i=Math.abs(t>e?e:t);let r=1;if(0!==i)for(;i*r<100;)r*=10;return(t*=r)%(e*=r)/r}createRenderer(t,e){const i=t;let r=i.renderer=null;return document.createElementNS&&"HTML5"!==i.renderEngine&&(r=new Smart.Utilities.SvgRenderer(this)),null!==r||"HTML5"!==i.renderEngine&&void 0!==i.renderEngine||(r=new Smart.Utilities.HTML5Renderer(this)),r.init(e),i.renderer=r,r}getByPriority(t){let e;for(let i=0;i<t.length;i++){const r=t[i];if(null!=r&&""!==r){e=r;break}}return e}get(t,e,i){return void 0!==i?t[e][i]:t[e]}min(t,e){let i=NaN;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);(isNaN(i)||s<i)&&(i=s)}return i}max(t,e){let i=NaN;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);(isNaN(i)||s>i)&&(i=s)}return i}sum(t,e){let i=0;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);isNaN(s)||(i+=s)}return i}count(t,e){let i=0;for(let r=0;r<t.length;r++){const s=this.get(t,r,e);isNaN(s)||i++}return i}avg(t,e){return this.sum(t,e)/Math.max(1,this.count(t,e))}filter(t,e){if(!e)return t;const i=[];for(let r=0;r<t.length;r++)e(t[r])&&i.push(t[r]);return i}scale(t,e,i,r){if(isNaN(t))return NaN;if((t<Math.min(e.min,e.max)||t>Math.max(e.min,e.max))&&(!r||!0!==r.ignore_range))return NaN;let s=NaN,n=1;if(void 0===e.type||"logarithmic"!==e.type){let i=Math.abs(e.max-e.min);i||(i=1),n=Math.abs(t-Math.min(e.min,e.max))/i}else if("logarithmic"===e.type){let i=e.base;isNaN(i)&&(i=10);let r=Math.min(e.min,e.max);r<=0&&(r=1);let s=Math.max(e.min,e.max);s<=0&&(s=1);const h=this.log(s,i);s=Math.pow(i,h);const a=this.log(r,i);r=Math.pow(i,a);const o=this.log(t,i);n=Math.abs(o-a)/(h-a)}if("logarithmic"===i.type){let t=i.base;isNaN(t)&&(t=10);const e=this.log(i.max,t),r=this.log(i.min,t);i.flip&&(n=1-n);const h=Math.min(r,e)+n*Math.abs(e-r);s=Math.pow(t,h)}else s=Math.min(i.min,i.max)+n*Math.abs(i.max-i.min),i.flip&&(s=Math.max(i.min,i.max)-s+i.min);return s}axis(t,e,i){if(i<=1)return[e,t];(isNaN(i)||i<2)&&(i=2);let r=0;for(;Math.round(t)!==t&&Math.round(e)!==e&&r<10;)t*=10,e*=10,r++;let s=(e-t)/i;for(;r<10&&Math.round(s)!==s;)t*=10,e*=10,s*=10,r++;const n=[1,2,5];let h,a=0;for(;;){let t=a%n.length,e=Math.floor(a/n.length),i=Math.pow(10,e)*n[t];if(t=(a+1)%n.length,e=Math.floor((a+1)/n.length),h=Math.pow(10,e)*n[t],s>=i&&s<h)break;a++}const o=h,l=[];let d=this.renderer._rnd(t,o,!1);const c=r<=0?1:Math.pow(10,r);for(;d<e+o;)l.push(d/c),d+=o;return l}_widgetToImage(t,e,i,r,s){let n=t;if(!n)return!1;void 0!==i&&""!==i||(i="image."+e);let h=n.renderEngine,a=n.animation;if(n.animation="none",n.renderEngine="HTML5",n.renderEngine!==h)try{n.refresh()}catch(t){return n.renderEngine=h,n.refresh(),n.animation=a,!1}let o=n.renderer.getContainer().firstElementChild,l=!0;"function"==typeof r&&(l=r(t,o));let d=!0;return l&&(d=this.exportImage(t,o,e,i,s)),n.renderEngine!==h&&(n.renderEngine=h,n.refresh(),n.animation=a),d}_saveAsImage(t,e){return this._widgetToImage(this,t,e)}saveAsPNG(t){return this._saveAsImage("png",t)}saveAsJPEG(t){return this._saveAsImage("jpeg",t)}exportImage(t,e,i,r,s){if(!e)return!1;let n="pdf"===i.toLowerCase();n&&(i="jpeg"),void 0!==r&&""!==r||(r="image."+i);let h=!0;if("print"!==i){try{if(e)if(n){s=s||"portrait";const n={content:{image:e.toDataURL("image/"+i),width:Math.min(e.width/1.35,"portrait"===s?515:762)},pageOrientation:s};try{pdfMake.createPdf(n).download(r)}catch(e){t.error(t.localize("missingReference",{files:"pdfmake.min.js"}))}}else{Smart.Utilities.DataExporter||t.error(t.localize("missingReference",{files:"smart.export.js"}));const s=new Smart.Utilities.DataExporter;e.toBlob((function(t){s.downloadFile(t,i,r)}))}}catch(t){h=!1}return h}{const t=window.open("","","width=800,height=500"),i=t.document.open(),r='<!DOCTYPE html><html><head><meta charset="utf-8" /><title>jQWidgets Chart</title></head><body><img src="'+e.toDataURL()+'" /></html>';try{i.write(r),i.close(),setTimeout((function(){t.print(),t.close()}),100)}catch(t){}}}}),Smart.Utilities.Assign("Renderer",class{constructor(t){const e=this;e.draw=t,e._gradients={},e._toRadiansCoefficient=2*Math.PI/360}pieSlicePath(t,e,i,r,s,n,h){r||(r=1);const a=Math.abs(s-n),o=a>180?1:0;a>=360&&(n=s+359.99);const l=s*this._toRadiansCoefficient,d=n*this._toRadiansCoefficient;let c=t,p=t,u=e,g=e;const f=!isNaN(i)&&i>0;f&&(h=0);const m=Math.cos(l),_=Math.sin(l),x=Math.cos(d),M=Math.sin(d);if(h+i>0){if(h>0){const i=(a/2+s)*this._toRadiansCoefficient;t+=h*Math.cos(i),e-=h*Math.sin(i)}f&&(c=t+i*m,u=e-i*_,p=t+i*x,g=e-i*M)}const y=t+r*m,w=t+r*x,N=e-r*_,v=e-r*M;let b="";const C=Math.abs(Math.abs(n-s)-360)>.02;return f?(b="M "+p+","+g,b+=" a"+i+","+i,b+=" 0 "+o+",1 "+(c-p)+","+(u-g),b+=C?" L"+y+","+N:" M"+y+","+N,b+=" a"+r+","+r,b+=" 0 "+o+",0 "+(w-y)+","+(v-N),C&&(b+=" Z")):(b="M "+w+","+v,b+=" a"+r+","+r,b+=" 0 "+o+",1 "+(y-w)+","+(N-v),C&&(b+=" L"+t+","+e,b+=" Z")),b}measureText(t,e,i,r){const s=this._getTextParts(t,e,i),n=s.width;let h=s.height;!1===r&&(h/=.6);let a={};if(isNaN(e)&&(e=0),0===e)a={width:this._rup(n),height:this._rup(h)};else{const t=e*Math.PI*2/360,i=Math.abs(Math.sin(t)),r=Math.abs(Math.cos(t)),s=Math.abs(n*i+h*r),o=Math.abs(n*r+h*i);a={width:this._rup(o),height:this._rup(s)}}return r&&(a.textPartsInfo=s),a}alignTextInRect(t,e,i,r,s,n,h,a,o,l){const d=o*Math.PI*2/360,c=Math.sin(d),p=Math.cos(d),u=s*c,g=s*p;"center"===h||""===h||"undefined"===h?t+=i/2:"right"===h&&(t+=i),"center"===a||"middle"===a||""===a||"undefined"===a?e+=r/2:"bottom"===a?e+=r-n/2:"top"===a&&(e+=n/2);let f="middle";-1!==(l=l||"").indexOf("top")?f="top":-1!==l.indexOf("bottom")&&(f="bottom");let m="center";return-1!==l.indexOf("left")?m="left":-1!==l.indexOf("right")&&(m="right"),"center"===m?(t-=g/2,e-=u/2):"right"===m&&(t-=g,e-=u),"top"===f?(t-=n*c,e+=n*p):"middle"===f&&(t-=n*c/2,e+=n*p/2),{x:t=this._rup(t),y:e=this._rup(e)}}adjustColor(t,e){if("string"!=typeof t)return"#000000";if(-1===t.indexOf("#"))return t;const i=this.draw;let r=i.cssToRgb(t);const s=i.rgbToHsl(r);s[2]=Math.min(1,s[2]*e),s[1]=Math.min(1,s[1]*e*1.1),r=i.hslToRgb(s),t="#";for(let e=0;e<3;e++){let s=Math.round(r[e]);s=i.decToHex(s),1===s.toString().length&&(t+="0"),t+=s}return t.toUpperCase()}_rup(t){let e=Math.round(t);return t>e&&e++,e}_ptdist(t,e,i,r){return Math.sqrt((i-t)*(i-t)+(r-e)*(r-e))}_rnd(t,e,i,r){if(isNaN(t))return t;void 0===r&&(r=!0);let s=t-(!0===r?t%e:this._mod(t,e));return t===s?s:(i?t>s&&(s+=e):s>t&&(s-=e),1===e?Math.round(s):s)}_ptrnd(t){if(!document.createElementNS)return Math.round(t)===t?t:this._rnd(t,1,!1,!0);const e=this._rnd(t,.5,!1,!0);return.5!==Math.abs(e-Math.round(e))?e>t?e-.5:e+.5:e}_getContrastColor(t){if(void 0===t)return;let e=this.draw.hexToRgb(t.slice(1,3),t.slice(3,5),t.slice(5,7));return(.299*e[0]+.61*e[1]+.114*e[2])/255>.6?"#000000":"#FFFFFF"}}),Smart.Utilities.Assign("SvgRenderer",class extends Smart.Utilities.Renderer{constructor(t){super(t);const e=this;e._svgns="http://www.w3.org/2000/svg",e._openGroups=[],e._clipId=0}init(t){const e=document.createElement("div");e.className="drawContainer",e.onselectstart=function(){return!1},t.appendChild(e),this.host=t,this.container=e;try{const t=document.createElementNS(this._svgns,"svg");t.setAttribute("version","1.1"),t.setAttribute("width","100%"),t.setAttribute("height","100%"),t.setAttribute("overflow","hidden"),e.appendChild(t),this.canvas=t}catch(t){return!1}return this._id=(new Date).getTime(),this.clear(),!0}getType(){return"SVG"}refresh(){}getRect(){return{x:0,y:0,width:Math.max(this._rup(this.host.offsetWidth)-1,0),height:Math.max(this._rup(this.host.offsetHeight)-1,0)}}getContainer(){return this.container}clear(){for(;this.canvas.childNodes.length>0;)this.removeElement(this.canvas.firstElementChild);this._defaultParent=void 0,this._defs=document.createElementNS(this._svgns,"defs"),this._gradients={},this.canvas.appendChild(this._defs)}removeElement(t){if(void 0!==t)try{for(;t.firstChild;)this.removeElement(t.firstChild);t.parentNode?t.parentNode.removeChild(t):this.canvas.removeChild(t)}catch(t){}}beginGroup(){const t=this._activeParent(),e=document.createElementNS(this._svgns,"g");return t.appendChild(e),this._openGroups.push(e),e}endGroup(){0!==this._openGroups.length&&this._openGroups.pop()}_activeParent(){return 0===this._openGroups.length?this.canvas:this._openGroups[this._openGroups.length-1]}createClipRect(t){const e=document.createElementNS(this._svgns,"clipPath"),i=document.createElementNS(this._svgns,"rect");return this.attr(i,{x:t.x,y:t.y,width:t.width,height:t.height,fill:"none"}),this._clipId=this._clipId||0,e.id="cl"+this._id+"_"+(++this._clipId).toString(),e.appendChild(i),this._defs.appendChild(e),e}getWindowHref(){let t=window.location.href;return t?(t=t.replace(/([\('\)])/g,"\\$1"),t=t.replace(/#.*$/,""),t):t}setClip(t,e){const i="url("+this.getWindowHref()+"#"+e.id+")";return this.attr(t,{"clip-path":i})}addHandler(t,e,i){t.addEventListener(e,i)}removeHandler(){}on(t,e,i){this.addHandler(t,e,i)}off(t,e,i){this.removeHandler(t,e,i)}shape(t,e){const i=document.createElementNS(this._svgns,t);if(i){for(let t in e)i.setAttribute(t,e[t]);return this._activeParent().appendChild(i),i}}_getTextParts(t,e,i){const r={width:0,height:0,parts:[]};if(void 0===t)return r;const s=t.toString().split("<br>"),n=this._activeParent(),h=document.createElementNS(this._svgns,"text");this.attr(h,i);for(let t=0;t<s.length;t++){const e=s[t],i=h.ownerDocument.createTextNode(e);let a;h.appendChild(i),n.appendChild(h);try{a=h.getBBox()}catch(t){}const o=this._rup(a.width),l=this._rup(.6*a.height);h.removeChild(i),r.width=Math.max(r.width,o),r.height+=l+(t>0?4:0),r.parts.push({width:o,height:l,text:e})}return n.removeChild(h),r}_measureText(t,e,i,r){return super.measureText(t,e,i,r)}measureText(t,e,i){return this._measureText(t,e,i,!1)}text(t,e,i,r,s,n,h,a,o,l,d){const c=this._measureText(t,n,h,!0,this).textPartsInfo,p=c.parts,u=this._getContrastColor(arguments[11]);let g;if(o||(o="center"),l||(l="center"),(p.length>1||a)&&(g=this.beginGroup()),a){const t=this.createClipRect({x:this._rup(e)-1,y:this._rup(i)-1,width:this._rup(r)+2,height:this._rup(s)+2});this.setClip(g,t)}let f=this._activeParent(),m=0,_=0;m=c.width,_=c.height,(isNaN(r)||r<=0)&&(r=m),(isNaN(s)||s<=0)&&(s=_);const x=r||0,M=s||0;let y=0;if(!n||0===n){let t;i+=_,"center"===l||"middle"===l?i+=(M-_)/2:"bottom"===l&&(i+=M-_),r||(r=m),s||(s=_),f=this._activeParent();for(let r=p.length-1;r>=0;r--){t=document.createElementNS(this._svgns,"text"),this.attr(t,h),this.attr(t,{cursor:"default"});const s=t.ownerDocument.createTextNode(p[r].text);t.appendChild(s);let n=e;const a=p[r].width,l=p[r].height;"center"===o?n+=(x-a)/2:"right"===o&&(n+=x-a),this.attr(t,{x:this._rup(n),y:this._rup(i+y),width:this._rup(a),height:this._rup(l)}),void 0!==u&&(t.style.fill=u),f.appendChild(t),y-=p[r].height+4}return g?(this.endGroup(),g):t}const w=this.alignTextInRect(e,i,r,s,m,_,o,l,n,d);e=w.x,i=w.y;const N=this.shape("g",{transform:"translate("+e+","+i+")"}),v=this.shape("g",{transform:"rotate("+n+")"});N.appendChild(v),y=0;for(let t=p.length-1;t>=0;t--){const e=document.createElementNS(this._svgns,"text");this.attr(e,h),this.attr(e,{cursor:"default"});const i=e.ownerDocument.createTextNode(p[t].text);e.appendChild(i);let r=0;const s=p[t].width,n=p[t].height;"center"===o?r+=(c.width-s)/2:"right"===o&&(r+=c.width-s),this.attr(e,{x:this._rup(r),y:this._rup(y),width:this._rup(s),height:this._rup(n)}),v.appendChild(e),y-=n+4}return f.appendChild(N),g&&this.endGroup(),N}line(t,e,i,r,s){const n=this.shape("line",{x1:t,y1:e,x2:i,y2:r});return this.attr(n,s),n}path(t,e){const i=this.shape("path");return i.setAttribute("d",t),e&&this.attr(i,e),i}rect(t,e,i,r,s){t=this._ptrnd(t),e=this._ptrnd(e),i=Math.max(1,this._rnd(i,1,!1)),r=Math.max(1,this._rnd(r,1,!1));const n=this.shape("rect",{x:t,y:e,width:i,height:r});return s&&this.attr(n,s),n}circle(t,e,i,r){const s=this.shape("circle",{cx:t,cy:e,r:i});return r&&this.attr(s,r),s}pieslice(t,e,i,r,s,n,h,a){const o=this.pieSlicePath(t,e,i,r,s,n,h),l=this.shape("path");return l.setAttribute("d",o),a&&this.attr(l,a),l}attr(t,e){if(t&&e)for(let i in e)"textContent"===i?t.textContent=e[i]:"width"===i||"height"===i?t.setAttribute(i,Math.max(0,e[i])):t.setAttribute(i,e[i])}removeAttr(t,e){if(t&&e)for(let i in e)"textContent"===i?t.textContent="":t.removeAttribute(e[i])}getAttr(t,e){return t.getAttribute(e)}_toLinearGradient(t,e,i){const r="grd"+this._id+t.replace("#","")+(e?"v":"h"),s="url("+this.getWindowHref()+"#"+r+")";if(this._gradients[s])return s;const n=document.createElementNS(this._svgns,"linearGradient");this.attr(n,{x1:"0%",y1:"0%",x2:e?"0%":"100%",y2:e?"100%":"0%",id:r});for(let e=0;e<i.length;e++){const r=i[e],s=document.createElementNS(this._svgns,"stop"),h="stop-color:"+this.adjustColor(t,r[1]);this.attr(s,{offset:r[0]+"%",style:h}),n.appendChild(s)}return this._defs.appendChild(n),this._gradients[s]=!0,s}_toRadialGradient(t,e,i){const r="grd"+this._id+t.replace("#","")+"r"+(void 0!==i?i.key:""),s="url("+this.getWindowHref()+"#"+r+")";if(this._gradients[s])return s;const n=document.createElementNS(this._svgns,"radialGradient");void 0===i?this.attr(n,{cx:"50%",cy:"50%",r:"100%",fx:"50%",fy:"50%",id:r}):this.attr(n,{cx:i.x,cy:i.y,r:i.outerRadius,id:r,gradientUnits:"userSpaceOnUse"});for(let i=0;i<e.length;i++){const r=e[i],s=document.createElementNS(this._svgns,"stop"),h="stop-color:"+this.adjustColor(t,r[1]);this.attr(s,{offset:r[0]+"%",style:h}),n.appendChild(s)}return this._defs.appendChild(n),this._gradients[s]=!0,s}}),Smart.Utilities.Assign("HTML5Renderer",class extends Smart.Utilities.Renderer{constructor(t){super(t),this._renderers=new Smart.Utilities.HTML5RenderHelpers(this)}init(t){try{this.host=t;const e=document.createElement("div"),i=document.createElement("canvas");e.className="chartContainer",e.style.position="relative",e.onselectstart=function(){return!1},i.id="__smartCanvasWrap",i.style.width="100%",i.style.height="100%",e.appendChild(i),t.appendChild(e),this.canvas=i,i.width=t.offsetWidth,i.height=t.offsetHeight,this.ctx=i.getContext("2d"),this._elements={},this._maxId=0,this._gradientId=0,this._gradients={},this._currentPoint={x:0,y:0},this._lastCmd="",this._pos=0}catch(t){return!1}return!0}getType(){return"HTML5"}getContainer(){return this.host.getElementsByClassName("chartContainer")[0]}getRect(){return{x:0,y:0,width:this.canvas.width-1,height:this.canvas.height-1}}beginGroup(){}endGroup(){}setClip(){}createClipRect(){}addHandler(){}removeHandler(){}on(t,e,i){this.addHandler(t,e,i)}off(t,e,i){this.removeHandler(t,e,i)}clear(){this._elements={},this._maxId=0,this._renderers._gradients={},this._gradientId=0}removeElement(t){void 0!==t&&this._elements[t.id]&&delete this._elements[t.id]}shape(t,e){let i={type:t,id:this._maxId++};for(let t in e)i[t]=e[t];return this._elements[i.id]=i,i}attr(t,e){for(let i in e)t[i]=e[i]}removeAttr(t,e){for(let i in e)delete t[e[i]]}rect(t,e,i,r,s){if(isNaN(t))throw'Invalid value for "x"';if(isNaN(e))throw'Invalid value for "y"';if(isNaN(i))throw'Invalid value for "width"';if(isNaN(r))throw'Invalid value for "height"';let n=this.shape("rect",{x:t,y:e,width:i,height:r});return s&&this.attr(n,s),n}path(t,e){let i=this.shape("path",e);return this.attr(i,{d:t}),i}line(t,e,i,r,s){return this.path("M "+t+","+e+" L "+i+","+r,s)}circle(t,e,i,r){let s=this.shape("circle",{x:t,y:e,r:i});return r&&this.attr(s,r),s}pieslice(t,e,i,r,s,n,h,a){let o=this.path(this.pieSlicePath(t,e,i,r,s,n,h),a);return this.attr(o,{x:t,y:e,innerRadius:i,outerRadius:r,angleFrom:s,angleTo:n}),o}_getCSSStyle(t){const e=document.createElement("div");e.className=t,e.style.position="absolute",e.style.visibility="hidden",this.host.appendChild(e);let i=window.getComputedStyle(e);return i={color:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight},this.host.removeChild(e),i}_getTextParts(t,e,i){let r="Arial",s="10pt",n="";if(i&&i.class){let t=this._getCSSStyle(i.class);t.fontSize&&(s=t.fontSize),t.fontFamily&&(r=t.fontFamily),t.fontWeight&&(n=t.fontWeight)}this.ctx.font=n+" "+s+" "+r;let h={width:0,height:0,parts:[]},a=t.toString().split("<br>");for(let t=0;t<a.length;t++){let e=a[t],i=this.ctx.measureText(e).width,r=document.createElement("span");r.className="chart",r.font=this.ctx.font,r.textContent=e,this.host.appendChild(r);let s=.6*r.offsetHeight;this.host.removeChild(r),h.width=Math.max(h.width,this._rup(i)),h.height+=s+(t>0?4:0),h.parts.push({width:i,height:s,text:e})}return h}_measureText(t,e,i,r){return super.measureText(t,e,i,r)}measureText(t,e,i){return this._measureText(t,e,i,!1)}text(t,e,i,r,s,n,h,a,o,l,d){let c=this.shape("text",{text:t,x:e,y:i,width:r,height:s,angle:n,clip:a,halign:o,valign:l,rotateAround:d});if(h&&this.attr(c,h),c.fontFamily="Arial",c.fontSize="10pt",c.fontWeight="",c.color=this._getContrastColor(arguments[11]),h&&h.class){let t=this._getCSSStyle(h.class);c.fontFamily=t.fontFamily||c.fontFamily,c.fontSize=t.fontSize||c.fontSize,c.fontWeight=t.fontWeight||c.fontWeight,c.color=c.color||t.color}c.color=c.color||"#000000";let p=this._measureText(t,0,h,!0);return this.attr(c,{textPartsInfo:p.textPartsInfo,textWidth:p.width,textHeight:p.height}),(r<=0||isNaN(r))&&this.attr(c,{width:p.width}),(s<=0||isNaN(s))&&this.attr(c,{height:p.height}),c}_toLinearGradient(t,e,i){if(this._renderers._gradients[t])return t;let r=[];for(let e=0;e<i.length;e++)r.push({percent:i[e][0]/100,color:this.adjustColor(t,i[e][1])});let s="gr"+this._gradientId++;return this.createGradient(s,e?"vertical":"horizontal",r),s}_toRadialGradient(t,e){if(this._renderers._gradients[t])return t;let i=[];for(let r=0;r<e.length;r++)i.push({percent:e[r][0]/100,color:this.adjustColor(t,e[r][1])});let r="gr"+this._gradientId++;return this.createGradient(r,"radial",i),r}createGradient(t,e,i){this._renderers.createGradient(this,t,e,i)}refresh(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);for(let t in this._elements){let e=this._elements[t];this._renderers.setFillStyle(this,e),this._renderers.setStroke(this,e),this._renderers[this._elements[t].type](this.ctx,e)}}}),Smart.Utilities.Assign("HTML5RenderHelpers",class{constructor(t){this.HTML5Renderer=t,this._cmds="mlcazq"}ptrnd(t){if(.5===Math.abs(Math.round(t)-t))return t;let e=Math.round(t);return e<t&&(e-=1),e+.5}createGradient(t,e,i,r){t._gradients[e]={orientation:i,colorStops:r}}setStroke(t,e){let i=t.ctx,r=e["stroke-width"];i.strokeStyle=e.stroke||"transparent",i.lineWidth=0===r?.01:void 0!==r?r:1,void 0!==e["fill-opacity"]?i.globalAlpha=e["fill-opacity"]:void 0!==e.opacity?i.globalAlpha=e.opacity:i.globalAlpha=1,i.setLineDash&&(e["stroke-dasharray"]?i.setLineDash(e["stroke-dasharray"].split(",")):i.setLineDash([]))}setFillStyle(t,e){let i=t.ctx;if(i.fillStyle="transparent",void 0!==e["fill-opacity"]?i.globalAlpha=e["fill-opacity"]:void 0!==e.opacity?i.globalAlpha=e.opacity:i.globalAlpha=1,e.fill&&-1===e.fill.indexOf("#")&&t._gradients[e.fill]){let r,s="horizontal"!==t._gradients[e.fill].orientation,n="radial"===t._gradients[e.fill].orientation,h=this.ptrnd(e.x),a=this.ptrnd(e.y),o=this.ptrnd(e.x+(s?0:e.width)),l=this.ptrnd(e.y+(s?e.height:0));if(("circle"===e.type||"path"===e.type||"rect"===e.type)&&n){let t=this.ptrnd(e.x),s=this.ptrnd(e.y);const n=e.innerRadius||0,h=e.outerRadius||e.r||0;"rect"===e.type&&(t+=e.width/2,s+=e.height/2),r=i.createRadialGradient(t,s,n,t,s,h)}n||((isNaN(h)||isNaN(o)||isNaN(a)||isNaN(l))&&(h=0,a=0,o=s?0:i.canvas.width,l=s?i.canvas.height:0),r=i.createLinearGradient(h,a,o,l));let d=t._gradients[e.fill].colorStops;for(let t=0;t<d.length;t++)r.addColorStop(d[t].percent,d[t].color);i.fillStyle=r}else e.fill&&(i.fillStyle=e.fill)}rect(t,e){0!==e.width&&0!==e.height&&(t.fillRect(this.ptrnd(e.x),this.ptrnd(e.y),e.width,e.height),t.strokeRect(this.ptrnd(e.x),this.ptrnd(e.y),e.width,e.height))}circle(t,e){0!==e.r&&(t.beginPath(),t.arc(this.ptrnd(e.x),this.ptrnd(e.y),e.r,0,2*Math.PI,!1),t.closePath(),t.fill(),t.stroke())}_parsePoint(t){return{x:this._parseNumber(t),y:this._parseNumber(t)}}_parseNumber(t){let e,i=!1;for(e=this._pos;e<t.length;e++)if(t[e]>="0"&&t[e]<="9"||"."===t[e]||"e"===t[e]||"-"===t[e]&&!i||"-"===t[e]&&e>=1&&"e"===t[e-1])i=!0;else{if(i||" "!==t[e]&&","!==t[e])break;this._pos++}let r=parseFloat(t.substring(this._pos,e));if(!isNaN(r))return this._pos=e,r}_isRelativeCmd(t){return-1!==this._cmds.indexOf(t)}_parseCmd(t){for(let e=this._pos;e<t.length;e++){if(-1!==this._cmds.toLowerCase().indexOf(t[e].toLowerCase()))return this._pos=e+1,this._lastCmd=t[e],this._lastCmd;if(" "!==t[e]){if(t[e]>="0"&&t[e]<="9"){if(this._pos=e,""===this._lastCmd)break;return this._lastCmd}}else this._pos++}}_toAbsolutePoint(t){return{x:this._currentPoint.x+t.x,y:this._currentPoint.y+t.y}}path(t,e){let i,r=e.d;for(this._pos=0,this._lastCmd="",this._currentPoint={x:0,y:0},t.beginPath();this._pos<r.length;){let e=this._parseCmd(r);if(void 0===e)break;if("M"!==e&&"m"!==e)if("L"!==e&&"l"!==e)if("A"!==e&&"a"!==e)if("Z"!==e&&"z"!==e||void 0===i)if("C"!==e&&"c"!==e)if("Q"!==e&&"q"!==e);else{let e=this._parsePoint(r),i=this._parsePoint(r);t.quadraticCurveTo(e.x,e.y,i.x,i.y),this._currentPoint=i}else{let e=this._parsePoint(r),i=this._parsePoint(r),s=this._parsePoint(r);t.bezierCurveTo(e.x,e.y,i.x,i.y,s.x,s.y),this._currentPoint=s}else t.lineTo(i.x,i.y),this._currentPoint=i;else{let i=this._parseNumber(r),s=this._parseNumber(r),n=this._parseNumber(r)*(Math.PI/180),h=this._parseNumber(r),a=this._parseNumber(r),o=this._parsePoint(r);if(this._isRelativeCmd(e)&&(o=this._toAbsolutePoint(o)),0===i||0===s)continue;let l=this._currentPoint,d={x:Math.cos(n)*(l.x-o.x)/2+Math.sin(n)*(l.y-o.y)/2,y:-Math.sin(n)*(l.x-o.x)/2+Math.cos(n)*(l.y-o.y)/2},c=Math.pow(d.x,2)/Math.pow(i,2)+Math.pow(d.y,2)/Math.pow(s,2);c>1&&(i*=Math.sqrt(c),s*=Math.sqrt(c));let p=(h===a?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(s,2)-Math.pow(i,2)*Math.pow(d.y,2)-Math.pow(s,2)*Math.pow(d.x,2))/(Math.pow(i,2)*Math.pow(d.y,2)+Math.pow(s,2)*Math.pow(d.x,2)));isNaN(p)&&(p=0);let u={x:p*i*d.y/s,y:p*-s*d.x/i},g={x:(l.x+o.x)/2+Math.cos(n)*u.x-Math.sin(n)*u.y,y:(l.y+o.y)/2+Math.sin(n)*u.x+Math.cos(n)*u.y},f=function(t){return Math.sqrt(Math.pow(t[0],2)+Math.pow(t[1],2))},m=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(f(t)*f(e))},_=function(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(m(t,e))},x=_([1,0],[(d.x-u.x)/i,(d.y-u.y)/s]),M=[(d.x-u.x)/i,(d.y-u.y)/s],y=[(-d.x-u.x)/i,(-d.y-u.y)/s],w=_(M,y);m(M,y)<=-1&&(w=Math.PI),m(M,y)>=1&&(w=0),0===a&&w>0&&(w-=2*Math.PI),1===a&&w<0&&(w+=2*Math.PI);let N=i>s?i:s,v=i>s?1:i/s,b=i>s?s/i:1;t.translate(g.x,g.y),t.rotate(n),t.scale(v,b),t.arc(0,0,N,x,x+w,1-a),t.scale(1/v,1/b),t.rotate(-n),t.translate(-g.x,-g.y)}else{let e=this._parsePoint(r);if(void 0===e)break;t.lineTo(e.x,e.y),this._currentPoint=e}else{let e=this._parsePoint(r);if(void 0===e)break;t.moveTo(e.x,e.y),this._currentPoint=e,void 0===i&&(i=e)}}t.fill(),t.stroke(),t.closePath()}text(t,e){let i=this.ptrnd(e.x),r=this.ptrnd(e.y),s=this.ptrnd(e.width),n=this.ptrnd(e.height),h=e.halign,a=e.valign,o=e.angle,l=e.rotateAround,d=e.textPartsInfo,c=d.parts,p=e.clip;void 0===p&&(p=!0),t.save(),h||(h="center"),a||(a="center"),p&&(t.rect(i,r,s,n),t.clip());let u=e.textWidth,g=e.textHeight,f=s||0,m=n||0;if(t.fillStyle=e.color,t.font=e.fontWeight+" "+e.fontSize+" "+e.fontFamily,!o||0===o){r+=g,"center"===a||"middle"===a?r+=(m-g)/2:"bottom"===a&&(r+=m-g),s||(s=u),n||(n=g);let e=0;for(let s=c.length-1;s>=0;s--){let n=c[s],a=i,o=c[s].width;"center"===h?a+=(f-o)/2:"right"===h&&(a+=f-o),t.fillText(n.text,a,r+e),e-=n.height+(s>0?4:0)}return void t.restore()}let _=this.HTML5Renderer.alignTextInRect(i,r,s,n,u,g,h,a,o,l);i=_.x,r=_.y;let x=o*Math.PI*2/360;t.translate(i,r),t.rotate(x);let M=0,y=d.width;for(let e=c.length-1;e>=0;e--){let i=0;"center"===h?i+=(y-c[e].width)/2:"right"===h&&(i+=y-c[e].width),t.fillText(c[e].text,i,M),M-=c[e].height+4}t.restore()}}),Smart.Utilities.Assign("Plot",class{constructor(t){this.renderer=t}get(t,e,i){return void 0!==i?t[e][i]:t[e]}min(t,e){let i=NaN;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);(isNaN(i)||s<i)&&(i=s)}return i}max(t,e){let i=NaN;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);(isNaN(i)||s>i)&&(i=s)}return i}sum(t,e){let i=0;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);isNaN(s)||(i+=s)}return i}count(t,e){let i=0;for(let r=0;r<t.length;r++){let s=this.get(t,r,e);isNaN(s)||i++}return i}avg(t,e){return this.sum(t,e)/Math.max(1,this.count(t,e))}filter(t,e){if(!e)return t;let i=[];for(let r=0;r<t.length;r++)e(t[r])&&i.push(t[r]);return i}scale(t,e,i,r){if(isNaN(t))return NaN;if((t<Math.min(e.min,e.max)||t>Math.max(e.min,e.max))&&(!r||!0!==r.ignore_range))return NaN;let s=NaN,n=1;if(void 0===e.type||"logarithmic"!==e.type){let i=Math.abs(e.max-e.min);i||(i=1),n=Math.abs(t-Math.min(e.min,e.max))/i}else if("logarithmic"===e.type){let i=e.base;isNaN(i)&&(i=10);let r=Math.min(e.min,e.max);r<=0&&(r=1);let s=Math.max(e.min,e.max);s<=0&&(s=1);let h=Math.log(s)/Math.log(i);s=Math.pow(i,h);let a=Math.log(r)/Math.log(i);r=Math.pow(i,a);let o=Math.log(t)/Math.log(i);n=Math.abs(o-a)/(h-a)}if("logarithmic"===i.type){let t=i.base;isNaN(t)&&(t=10);let e=Math.log(i.max)/Math.log(t),r=Math.log(i.min)/Math.log(t);i.flip&&(n=1-n);let h=Math.min(r,e)+n*Math.abs(e-r);s=Math.pow(t,h)}else s=Math.min(i.min,i.max)+n*Math.abs(i.max-i.min),i.flip&&(s=Math.max(i.min,i.max)-s+i.min);return s}axis(t,e,i){if(i<=1)return[e,t];(isNaN(i)||i<2)&&(i=2);let r=0;for(;Math.round(t)!==t&&Math.round(e)!==e&&r<10;)t*=10,e*=10,r++;let s=(e-t)/i;for(;r<10&&Math.round(s)!==s;)t*=10,e*=10,s*=10,r++;let n,h=[1,2,5],a=0;for(;;){let t=a%h.length,e=Math.floor(a/h.length),i=Math.pow(10,e)*h[t];if(t=(a+1)%h.length,e=Math.floor((a+1)/h.length),n=Math.pow(10,e)*h[t],s>=i&&s<n)break;a++}let o=n,l=[],d=this.renderer._rnd(t,o,!1),c=r<=0?1:Math.pow(10,r);for(;d<e+o;)l.push(d/c),d+=o;return l}});
|
|
11
11
|
Smart.Utilities.Assign("DataExporter",class{constructor(e,t,a,o){const l=this;e||(e={}),l.style=e.style,l.header=e.header,l.exportHeader=void 0===e.exportHeader||e.exportHeader,l.hierarchical=e.hierarchical,l.expandChar=e.expandChar||"+",l.collapseChar=e.collapseChar||"-",l.pageOrientation=e.pageOrientation,l.allowNull=e.allowNull||!1,!l.hierarchical&&t&&t.length>0?l.groupBy=t:l.mergedCells=e.mergedCells,!l.groupBy&&a&&Object.keys(a).length>0&&(l.filterBy=a),o&&(l.conditionalFormatting=o),l.timeBetween1900And1970=new Date(1970,0,1,0,0,0).getTime()-new Date(1900,0,1,0,0,0).getTime()}downloadFile(e,t,a){let o;if(!a)return e;if(o=e instanceof Blob?e:new Blob([e],{type:t}),window.navigator.msSaveOrOpenBlob)window.navigator.msSaveOrOpenBlob(o,a);else{const e=document.createElement("a"),t=URL.createObjectURL(o);e.href=t,e.download=a,e.style.position="absolute",e.style.visibility="hidden",document.body.appendChild(e),e.click(),setTimeout((function(){document.body.removeChild(e),window.URL.revokeObjectURL(t)}),100)}}exportData(e,t,a,o){const l=this;if(l.actualHierarchy=l.hierarchical,t=t.toLowerCase(),l.exportHeader&&(l.header?(0===(e=e.slice(0)).length&&(l.actualHierarchy=!1),l.processComplexHeader(l.header,e,t)):1===e.length&&(l.actualHierarchy=!1)),0===e.length)return void console.warn("No data to export.");"xlsx"===t&&(l.xlsxStartIndex=l.complexHeader?l.complexHeader.length:+l.exportHeader),l.actualHierarchy&&(e=l.processHierarchicalData(e,t)),l.getDatafields(e),a&&a.slice(a.length-t.length-1,a.length)!=="."+t&&(a+="."+t);let r=null;switch(t){case"csv":r=l.exportToCSVAndTSV(e,{delimiter:", ",MIME:"text/csv",toRemove:2},a);break;case"html":r=l.exportToHTML(e,a);break;case"jpeg":case"png":l.exportToImage(e,a,t,o);break;case"json":r=l.exportToJSON(e,a);break;case"pdf":r=l.exportToPDF(e,a);break;case"tsv":r=l.exportToCSVAndTSV(e,{delimiter:"\t",MIME:"text/tab-separated-values",toRemove:1},a);break;case"xlsx":r=l.exportToXLSX(e,a);break;case"xml":r=l.exportToXML(e,a);break;case"md":r=l.exportToMD(e,a)}return o&&r&&o(r),delete l.complexHeader,r}exportToCSVAndTSV(e,t,a){const o=this,l=o.datafields;let r="";for(let a=0;a<e.length;a++){const n=e[a];let s="";for(let e=0;e<l.length;e++)o.actualHierarchy&&0===e?s+=('""'+t.delimiter).repeat(n._level-1)+'"'+n[l[e]]+'"'+t.delimiter+('""'+t.delimiter).repeat(o.maxLevel-n._level):s+='"'+n[l[e]]+'"'+t.delimiter;s=s.slice(0,s.length-t.toRemove)+"\n",r+=s}return this.downloadFile(r,t.MIME,a)}exportToHTML(e,t){const a=this,o=a.datafields,l=a.style;let r="",n=0,s="";e=a.processGroupingInformation(e),a.data=e,a.exportHeader&&(r=a.getHTMLHeader(o,e),n=1),arguments[2]&&(s=`<script type="text/javascript" src="${Array.from(document.getElementsByTagName("script")).find((e=>-1!==e.src.indexOf("html2canvas"))).src}"><\/script>`);let i=`<!DOCTYPE html>\n<html>\n<head>\n <meta charset="UTF-8">\n <style type="text/css">\n${a.getRowStyle()}${a.getColumnStyle()}\n </style>${s}${a.toggleableFunctionality()}\n</head>\n<body>\n <table${a.getTableStyle()}>${r}\n <tbody>\n`;const c={},p={},m=[];a.getMergedCellsInfo(c,p);e:for(let r=n;r<e.length;r++){const s=e[r],f=r-n;let d=a.getAlternationIndex(f," rowN"),h="",g="",u="",y=0;if(a.actualHierarchy)s._collapsed&&(h=" collapsed"),g=` level="${s._level}"`;else if(a.groupBy)for(let e=0;e<a.groupBy.length;e++){const t=a.groupBy[e],o=s[t],l=a.groups[t][o];if(u+=o,-1===m.indexOf(u)){i+=` <tr class="row">\n <td class="column group" style="padding-left: ${25*y}px;" colspan="${a.datafields.length}">${l}</td>\n </tr>`,m.push(u),r--;continue e}y++}let x=` <tr class="row row${f}${d}${h}"${g}`;t||(x+=' style="page-break-inside: avoid;"'),x+=">\n";for(let e=0;e<o.length;e++){const t=e+","+f;let r=1,n=1;if(c[t])r=c[t].colspan,n=c[t].rowspan;else if(p[t])continue;const i=o[e];let m=s[i],d="";if(a.actualHierarchy&&0===e){let e="";s._expanded?e=a.collapseChar:!1===s._expanded&&(e=a.expandChar),d=`<div class="toggle-element" style="margin-left: ${25*(s._level-1)+5}px;" expanded>${e}</div>`}m=a.getFormattedValue(m,i);let h="";if(l&&l.columns&&l.columns[i]&&l.columns[i][f]){const e=l.columns[i][f];h+=`border-color: ${e.border}; background-color: ${e.background}; color: ${e.color};"`}0===e&&y>1&&(h+=`padding-left: ${25*(y-1)}px;"`),h&&(h=` style="${h}"`),x+=` <td class="column column${i}"${h} colspan="${r}" rowspan="${n}">${d+m}</td>\n`}i+=x+" </tr>\n"}return i+=" </tbody>\n </table>\n</body>\n</html>",arguments[2]?i:this.downloadFile(i,"text/html",t)}exportToImage(e,t,a,o){try{html2canvas}catch(e){throw new Error("smart-grid: Missing reference to 'html2canvas.min.js'.")}let l=null;const r=this.exportToHTML(e,t,!0),n=document.createElement("iframe");return n.style.position="absolute",n.style.top=0,n.style.left=0,n.style.border="none",n.style.width="100%",n.style.height="100%",n.style.opacity=0,n.style.pointerEvents="none",document.body.appendChild(n),n.contentDocument.write(r),function e(){n.contentDocument.body&&n.contentDocument.body.firstElementChild?n.contentWindow.html2canvas(n.contentDocument.body.firstElementChild).then((e=>{const r=new Smart.Utilities.Draw(document.createElement("div"));l=e.toDataURL("image/png"),o?o(l):(document.body.appendChild(e),r.exportImage(void 0,e,a,t)),n.remove(),e.remove()})):requestAnimationFrame(e)}(),l}getMergedCellsInfo(e,t,a){const o=this;if(!o.mergedCells)return;const l=a&&0!==a[o.datafields.length-1];o.mergedCellsPDF=o.mergedCells.slice(0);for(let r=0;r<o.mergedCellsPDF.length;r++){const n=o.mergedCellsPDF[r];let s=n.colspan,i=n.rowspan;if(i<2&&s<2)continue;const c=n.cell[1];let p=n.cell[0];if(l&&s>1){const e=a[p],t=a[p+s-1],l=[];if(t>e){let r=e,n=p,m=0;e:for(let o=e;o<=t;o++){let e=n,t=0;for(;a[n]===r;)if(n++,m++,t++,m===s){l.push({start:e,span:t});break e}l.push({start:e,span:t}),r=a[n]}s=l[0].span;for(let e=1;e<l.length;e++)o.mergedCellsPDF.push({cell:[l[e].start,c],colspan:l[e].span,rowspan:i,originalCell:p})}}for(let a=p;a<p+s;a++)for(let o=c;o<c+i;o++){const l=a+","+o;a!==p||o!==c?t[l]=!0:e[l]={colspan:s,rowspan:i,originalCell:n.originalCell}}}}getAlternationIndex(e,t){if(!this.style)return"";const a=this.style.rows;return a&&a.alternationCount&&((void 0===a.alternationStart||e>=a.alternationStart)&&(void 0===a.alternationEnd||e<=a.alternationEnd)||a.alternationStart===a.alternationEnd)?t+e%a.alternationCount:""}getFormattedValue(e,t){const a=this,o=a.style;if(null===e)return a.allowNull?"null":"";if(t&&o&&o.columns&&o.columns[t]&&o.columns[t].format){if("number"==typeof e)return a.formatNumber(e,o.columns[t].format);if(e instanceof Date)return a.formatDate(e,o.columns[t].format)}else if(e instanceof Date)return a.formatDate(e,"d");return e}exportToJSON(e,t){return this.downloadFile(JSON.stringify(e,this.datafields.concat("rows")),"application/json",t)}exportToMD(e,t){const a=this.datafields;let o="";for(let t=0,l=e.length;t<l;t+=1)for(let l=0,r=a.length;l<r;l+=1){const r=e[t][a[l]];"string"==typeof r&&(o+=r)}return this.downloadFile(o,"application/text",t)}exportToPDF(e,t){try{pdfMake}catch(e){throw new Error("Missing reference to 'pdfmake.min.js'.")}const a=this,o=a.datafields,l=+a.exportHeader,r=[],n={},s={},i={},c=l?a.complexHeader?a.complexHeader.length:1:0,p={pageOrientation:a.pageOrientation||"portrait"};let m,f=[],d=[];function h(){let e=[];for(let t=0;t<m.length;t++)e.push([]);return e}e=a.processGroupingInformation(e),a.data=e,a.headerRows=c,a.getPDFStyle();const g=a.styleInfo;m=g?a.wrapPDFColumns(p,i):[{body:f,datafields:o}],l&&(f=a.getPDFHeader(o,m,i)),a.getMergedCellsInfo(n,s,i);e:for(let t=l;t<e.length;t++){const c=e[t];let p="",f=0;if(a.groupBy)for(let e=0;e<a.groupBy.length;e++){const o=a.groupBy[e],l=c[o],n=a.groups[o][l];if(p+=l,-1===r.indexOf(p)){a.createGroupHeaderRow(m,{text:n,style:["row","cell","group"],marginLeft:7.5*f}),r.push(p),t--;continue e}f++}const d=h(),g=t-l;let u=a.getAlternationIndex(g,"");for(let e=0;e<o.length;e++){const t=o[e],l={style:["row","row"+g,"cell","cell"+t]},r=i[e]||0;if(void 0!==u&&l.style.splice(1,0,"rowN"+u),a.mergedCellsPDF){const t=e+","+g,a=n[t];if(a){if(l.colSpan=a.colspan,l.rowSpan=a.rowspan,void 0!==a.originalCell){l.text="",l.style[l.style.length-1]="cell"+o[a.originalCell],d[r].push(l);continue}}else if(s[t]){d[r].push({});continue}}const p=a.getFormattedValue(c[t],t);l.text=p.toString(),a.getUniqueStylePDF(l,t,g),a.setIndentation(l,{j:e,currentRecord:c,value:p,outlineLevel:f}),d[r].push(l)}for(let e=0;e<m.length;e++)m[e].body.push(d[e])}if(g){for(let e=0;e<m.length;e++){const t=m[e].body;for(let a=c-1;a>=0;a--)t.unshift(f[e][a]);d.push({table:{headerRows:c,widths:m[e].widths,heights:function(e){return g.heights[e]?g.heights[e]:g.defaultHeight?g.defaultHeight:void 0},body:t},pageBreak:"after"})}delete d[m.length-1].pageBreak,p.styles=g.styles}else{const e=m[0].body;for(let t=c-1;t>=0;t--)e.unshift(f[0][t]);d=[{table:{headerRows:c,body:e}}],p.styles={header:{bold:!0},group:{bold:!0}}}p.content=d,pdfMake.createPdf(p).download(t),delete a.mergedCellsPDF,delete a.styleInfo}getPDFStyle(){const e=this,t=e.style;if(!t)return"";const a=e.data[0],o=t.header,l=t.columns,r=t.rows,n={heights:[],widths:Array(e.datafields.length).fill("*"),styles:{header:{},row:{},cell:{},group:{fillColor:"#FFFFFF",color:"#000000",bold:!0}}};function s(t,o){if(t)for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l))if(void 0===a[l])if("height"===l&&"header"===o)for(let a=0;a<e.headerRows;a++)n.heights[a]=parseInt(t[l],10)/e.headerRows/1.4;else e.storePDFStyle({prop:l,value:t[l],toUpdate:o});else for(let a in t[l]){if(!isNaN(a)||!Object.prototype.hasOwnProperty.call(t[l],a))continue;const r=t[l][a],s=e.datafields.indexOf(l);"width"===a&&"*"===n.widths[s]?n.widths[s]=r:e.storePDFStyle({prop:a,value:r,toUpdate:o+l})}}if(e.styleInfo=n,s(o,"header"),s(l,"cell"),r){for(let t in r){if(!Object.prototype.hasOwnProperty.call(r,t)||-1!==t.indexOf("alt"))continue;const a=r[t];if(isNaN(t))"height"===t?n.defaultHeight=parseFloat(a)/1.4:e.storePDFStyle({prop:t,value:a,toUpdate:"row"});else for(let o in a)Object.prototype.hasOwnProperty.call(a,o)&&("height"===o?n.heights[parseFloat(t)+e.headerRows]=parseFloat(a[o])/1.4:e.storePDFStyle({prop:o,value:a[o],toUpdate:"row"+t}))}if(r.alternationCount)for(let e=0;e<r.alternationCount;e++){const t={};r[`alternationIndex${e}Color`]&&(t.color=r[`alternationIndex${e}Color`]),r[`alternationIndex${e}BackgroundColor`]&&(t.fillColor=r[`alternationIndex${e}BackgroundColor`]),n.styles["rowN"+e]=t}}}storePDFStyle(e){const t=this;let a=t.styleInfo.styles[e.toUpdate];a||(a={},t.styleInfo.styles[e.toUpdate]=a);let o=e.value;switch(e.prop){case"backgroundColor":a.fillColor=o;break;case"color":a.color=o;break;case"fontSize":a.fontSize=parseFloat(o);break;case"fontStyle":"italic"===o&&(a.italics=!0);break;case"fontWeight":"bold"===o&&(a.bold=!0);break;case"textAlign":a.alignment=o}}wrapPDFColumns(e,t){const a=this,o=this.styleInfo,l="portrait"===e.pageOrientation?655:1155,r=[];let n=0;for(let e=0;e<o.widths.length;e++){let s,i=o.widths[e];if("*"===i?s=l/6:"string"==typeof i&&-1!==i.indexOf("%")?(s=Math.min(l,Math.floor(parseFloat(i)/100*l)),s===l&&(i="*")):(i=parseFloat(i),i>=l?(s=l,i="*"):(s=i,i/=1.4)),void 0===r[n]){const o=[];r[n]={body:o,width:s,widths:[i],datafields:[a.datafields[e]]},t[e]=n;continue}const c=r[n];c.width+s>l?(n++,e--):(t[e]=n,c.width+=s,c.widths.push(i),c.datafields.push(a.datafields[e]))}return r}getPDFHeader(e,t,a){const o=this,l=[],r=o.headerRows,n=[],s=[];let i,c,p=[];o.complexHeader?(i=o.complexHeader,c=o.complexDataFieldsHeader):(i=[Object.values(o.data[0])],c=i);for(let e=0;e<r;e++){const t=i[e],o=c[e];for(let l=0;l<t.length;l++){let r=a[l]||0;n[r]||(n[r]=[],s[r]=[]),n[r][e]||(n[r][e]=[],s[r][e]=[]),n[r][e].push(t[l]),s[r][e].push(o[l])}}function m(e,t,a,o){for(let l=0;l<r;l++){const n=e[l],s=t[l],i=[];for(let e=0;e<n.length;e++){const a=s[e];let c=1,p=1;if(s[e-1]&&s[e-1]===a||t[l-1]&&t[l-1][e]===a){i.push({});continue}let m=e+1;for(;s[m]&&s[m]===s[m-1];)c++,m++;for(m=l+1;t[m]&&t[m][e]===a;)p++,m++;const f=l===r-1||p+l===r?o.datafields[e]:null,d={text:n[e],colSpan:c,rowSpan:p};f?d.style=["header","header"+f]:(d.alignment="center",d.style="header"),i.push(d)}a.push(i)}}for(let e=0;e<t.length;e++)p=[],m(n[e],s[e],p,t[e]),l.push(p);return l}createGroupHeaderRow(e,t){for(let a=0;a<e.length;a++){const o=Object.assign({},t),l=e[a].datafields.length,r=[o];o.colSpan=l,r.length=l,r.fill({},1,l-1),e[a].body.push(r)}}getUniqueStylePDF(e,t,a){const o=this.style;if(!o||!o.columns||!o.columns[t])return;const l=o.columns[t][a];l&&(e.fillColor=function(e){const t=/rgba\((\d+),(\d+),(\d+)\,(\d*.\d+|\d+)\)/gi.exec(e.replace(/\s/g,""));if(null===t)return e;const a=parseFloat(t[1]).toString(16).toUpperCase(),o=parseFloat(t[2]).toString(16).toUpperCase(),l=parseFloat(t[3]).toString(16).toUpperCase();return"#"+"0".repeat(2-a.length)+a+"0".repeat(2-o.length)+o+"0".repeat(2-l.length)+l}(l.background),e.color=l.color.toLowerCase())}setIndentation(e,t){if(0!==t.j)return;const a=this;if(a.actualHierarchy){const o=t.currentRecord;void 0!==o._expanded?(e.marginLeft=25*(o._level-1),e.text=a.collapseChar+" "+t.value):e.marginLeft=25*(o._level-1)+6}else t.outlineLevel>1&&(e.marginLeft=7.5*(t.outlineLevel-1))}exportToXLSX(e,t){try{JSZip}catch(e){throw new Error("Missing reference to 'jszip.min.js'.")}const a=this;let o=a.style;if(e=a.processGroupingInformation(e,!0),a.data=e,a.getColumnsArray(),a.complexHeaderMergedCells=[],a.complexHeaderMergeInfo)for(let e in a.complexHeaderMergeInfo)if(Object.prototype.hasOwnProperty.call(a.complexHeaderMergeInfo,e)){const t=a.complexHeaderMergeInfo[e];if(t.from[0]===t.to[0]&&t.from[1]===t.to[1])continue;a.complexHeaderMergedCells.push({from:a.columnsArray[t.from[1]]+(t.from[0]+1),to:a.columnsArray[t.to[1]]+(t.to[0]+1)})}a.getConditionalFormatting(),o||(o=a.generateDefaultStyle(e));const l=a.generateSharedStrings(e),r=l.collection,n=l.xml,s=a.generateStyles(o),i=a.groupBy?a.generateSheet1WithGrouping(e,r):a.generateSheet1(e,r),c=a.generateAuxiliaryFiles(),p=new JSZip,m=p.folder("_rels"),f=p.folder("docProps"),d=p.folder("xl"),h=d.folder("_rels"),g=d.folder("theme"),u=d.folder("worksheets");m.file(".rels",c._relsRels),f.file("app.xml",c.docPropsAppXml),f.file("core.xml",c.docPropsCoreXml),h.file("workbook.xml.rels",c.xl_relsWorkbookXmlRels),g.file("theme1.xml",c.xlThemeTheme1Xml),u.file("sheet1.xml",i),d.file("sharedStrings.xml",n),d.file("styles.xml",s),d.file("workbook.xml",c.xlWorkbookXml),p.file("[Content_Types].xml",c.Content_TypesXml),p.generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}).then((function(e){return a.downloadFile(e,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",t)})),delete a.conditionalFormattingXLSX,delete a.complexHeaderMergeInfo,delete a.defaultRowHeight,delete a.rowHeight}processGroupingInformation(e,t){const a=this;if(!a.groupBy)return e;let o;if(e=e.slice(0),a.exportHeader&&(t&&a.complexHeader?(o=e.slice(0,a.complexHeader.length),e.splice(0,a.complexHeader.length)):(o=[e[0]],e.splice(0,1))),e.length>1){const t=function(e,t){let a;switch(t||typeof e){case"string":a=(new Intl.Collator).compare;break;case"number":a=function(e,t){return e-t};break;case"boolean":case"bool":a=function(e,t){return e===t?0:!1===e?-1:1};break;case"date":case"time":case"dateTime":e instanceof Date?a=function(e,t){return e.getTime()-t.getTime()}:(e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber)&&(a=function(e,t){return e.compare(t)});break;case"object":if(e instanceof Date)a=function(e,t){return e.getTime()-t.getTime()};else if(e instanceof Smart.Utilities.DateTime||e instanceof Smart.Utilities.BigNumber)a=function(e,t){return e.compare(t)};else if(e instanceof Smart.Utilities.Complex||window.NIComplex&&e instanceof window.NIComplex){const e=new Smart.Utilities.ComplexNumericProcessor;a=function(t,a){return e.compareComplexNumbers(t,a)}}}return a};!function(e,a,o,l){if(!e||!Array.isArray(e)||0===e.length||!a||Array.isArray(a)&&0===a.length)return;"string"==typeof a&&(a=[a]);const r=[],n=[];void 0===o&&(o=[]);for(let l=0;l<a.length;l++)void 0===o[l]||"asc"===o[l]||"ascending"===o[l]?r[l]=1:r[l]=-1,n[l]=t(e[0][a[l]]);l?l(e,a,o,n):e.sort((function(e,t){for(let o=0;o<a.length;o++){const l=n[o](e[a[o]],t[a[o]]);if(0===l){if(a[o+1])continue;return void 0!==e._index?(e._index-t._index)*r[o]:0}return l*r[o]}}))}(e,a.groupBy)}return o&&(e=o.concat(e)),a.getGroupLabels(e),e}exportToXML(e,t){const a=this.datafields.slice(0);let o='<?xml version="1.0" encoding="UTF-8" ?>\n<table>\n';return-1===a.indexOf("rows")&&a.push("rows"),o+=function e(t,o){let l="";for(let r=0;r<t.length;r++){const n=t[r];l+=o+"<row>\n";for(let t=0;t<a.length;t++){const r=a[t];if("rows"!==r)l+=o+` <${r}>${n[r]}</${r}>\n`;else{if(!n.rows)continue;l+=`${o} <rows>\n${e(n.rows,o+" ")}${o} </rows>\n`}}l+=o+"</row>\n"}return l}(e," ")+"</table>",this.downloadFile(o,"application/xml",t)}formatDate(e,t){if(!Smart.Utilities.DateTime)return e;try{return new Smart.Utilities.DateTime(e).toString(t)}catch(t){return e}}formatNumber(e,t){if(!Smart.Utilities.NumberRenderer)return e;const a=(new Smart.Utilities.NumberRenderer).formatNumber(e,t);return void 0===a?e:a}generateAuxiliaryFiles(){const e=(new Date).toISOString();return{_relsRels:'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Target="docProps/app.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/></Relationships>',docPropsAppXml:'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><Application>Microsoft Excel</Application><DocSecurity>0</DocSecurity><ScaleCrop>false</ScaleCrop><HeadingPairs><vt:vector size="2" baseType="variant"><vt:variant><vt:lpstr>Worksheets</vt:lpstr></vt:variant><vt:variant><vt:i4>1</vt:i4></vt:variant></vt:vector></HeadingPairs><TitlesOfParts><vt:vector size="1" baseType="lpstr"><vt:lpstr>Sheet1</vt:lpstr></vt:vector></TitlesOfParts><Company></Company><LinksUpToDate>false</LinksUpToDate><SharedDoc>false</SharedDoc><HyperlinksChanged>false</HyperlinksChanged><AppVersion>16.0300</AppVersion></Properties>',docPropsCoreXml:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><dc:creator>Smart HTML Elements</dc:creator><cp:lastModifiedBy>Smart HTML Elements</cp:lastModifiedBy><dcterms:created xsi:type="dcterms:W3CDTF">${e}</dcterms:created><dcterms:modified xsi:type="dcterms:W3CDTF">${e}</dcterms:modified></cp:coreProperties>`,xl_relsWorkbookXmlRels:'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships"><Relationship Id="rId3" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/><Relationship Id="rId2" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/><Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/><Relationship Id="rId4" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/></Relationships>',xlThemeTheme1Xml:'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<a:theme xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" name="Office Theme"><a:themeElements><a:clrScheme name="Office"><a:dk1><a:sysClr val="windowText" lastClr="000000"/></a:dk1><a:lt1><a:sysClr val="window" lastClr="FFFFFF"/></a:lt1><a:dk2><a:srgbClr val="44546A"/></a:dk2><a:lt2><a:srgbClr val="E7E6E6"/></a:lt2><a:accent1><a:srgbClr val="4472C4"/></a:accent1><a:accent2><a:srgbClr val="ED7D31"/></a:accent2><a:accent3><a:srgbClr val="A5A5A5"/></a:accent3><a:accent4><a:srgbClr val="FFC000"/></a:accent4><a:accent5><a:srgbClr val="5B9BD5"/></a:accent5><a:accent6><a:srgbClr val="70AD47"/></a:accent6><a:hlink><a:srgbClr val="0563C1"/></a:hlink><a:folHlink><a:srgbClr val="954F72"/></a:folHlink></a:clrScheme><a:fontScheme name="Office"><a:majorFont><a:latin typeface="Calibri Light" panose="020F0302020204030204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="游ゴシック Light"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="等线 Light"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Times New Roman"/><a:font script="Hebr" typeface="Times New Roman"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="MoolBoran"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Times New Roman"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/><a:font script="Armn" typeface="Arial"/><a:font script="Bugi" typeface="Leelawadee UI"/><a:font script="Bopo" typeface="Microsoft JhengHei"/><a:font script="Java" typeface="Javanese Text"/><a:font script="Lisu" typeface="Segoe UI"/><a:font script="Mymr" typeface="Myanmar Text"/><a:font script="Nkoo" typeface="Ebrima"/><a:font script="Olck" typeface="Nirmala UI"/><a:font script="Osma" typeface="Ebrima"/><a:font script="Phag" typeface="Phagspa"/><a:font script="Syrn" typeface="Estrangelo Edessa"/><a:font script="Syrj" typeface="Estrangelo Edessa"/><a:font script="Syre" typeface="Estrangelo Edessa"/><a:font script="Sora" typeface="Nirmala UI"/><a:font script="Tale" typeface="Microsoft Tai Le"/><a:font script="Talu" typeface="Microsoft New Tai Lue"/><a:font script="Tfng" typeface="Ebrima"/></a:majorFont><a:minorFont><a:latin typeface="Calibri" panose="020F0502020204030204"/><a:ea typeface=""/><a:cs typeface=""/><a:font script="Jpan" typeface="游ゴシック"/><a:font script="Hang" typeface="맑은 고딕"/><a:font script="Hans" typeface="等线"/><a:font script="Hant" typeface="新細明體"/><a:font script="Arab" typeface="Arial"/><a:font script="Hebr" typeface="Arial"/><a:font script="Thai" typeface="Tahoma"/><a:font script="Ethi" typeface="Nyala"/><a:font script="Beng" typeface="Vrinda"/><a:font script="Gujr" typeface="Shruti"/><a:font script="Khmr" typeface="DaunPenh"/><a:font script="Knda" typeface="Tunga"/><a:font script="Guru" typeface="Raavi"/><a:font script="Cans" typeface="Euphemia"/><a:font script="Cher" typeface="Plantagenet Cherokee"/><a:font script="Yiii" typeface="Microsoft Yi Baiti"/><a:font script="Tibt" typeface="Microsoft Himalaya"/><a:font script="Thaa" typeface="MV Boli"/><a:font script="Deva" typeface="Mangal"/><a:font script="Telu" typeface="Gautami"/><a:font script="Taml" typeface="Latha"/><a:font script="Syrc" typeface="Estrangelo Edessa"/><a:font script="Orya" typeface="Kalinga"/><a:font script="Mlym" typeface="Kartika"/><a:font script="Laoo" typeface="DokChampa"/><a:font script="Sinh" typeface="Iskoola Pota"/><a:font script="Mong" typeface="Mongolian Baiti"/><a:font script="Viet" typeface="Arial"/><a:font script="Uigh" typeface="Microsoft Uighur"/><a:font script="Geor" typeface="Sylfaen"/><a:font script="Armn" typeface="Arial"/><a:font script="Bugi" typeface="Leelawadee UI"/><a:font script="Bopo" typeface="Microsoft JhengHei"/><a:font script="Java" typeface="Javanese Text"/><a:font script="Lisu" typeface="Segoe UI"/><a:font script="Mymr" typeface="Myanmar Text"/><a:font script="Nkoo" typeface="Ebrima"/><a:font script="Olck" typeface="Nirmala UI"/><a:font script="Osma" typeface="Ebrima"/><a:font script="Phag" typeface="Phagspa"/><a:font script="Syrn" typeface="Estrangelo Edessa"/><a:font script="Syrj" typeface="Estrangelo Edessa"/><a:font script="Syre" typeface="Estrangelo Edessa"/><a:font script="Sora" typeface="Nirmala UI"/><a:font script="Tale" typeface="Microsoft Tai Le"/><a:font script="Talu" typeface="Microsoft New Tai Lue"/><a:font script="Tfng" typeface="Ebrima"/></a:minorFont></a:fontScheme><a:fmtScheme name="Office"><a:fillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:lumMod val="110000"/><a:satMod val="105000"/><a:tint val="67000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="103000"/><a:tint val="73000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="105000"/><a:satMod val="109000"/><a:tint val="81000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:satMod val="103000"/><a:lumMod val="102000"/><a:tint val="94000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:satMod val="110000"/><a:lumMod val="100000"/><a:shade val="100000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:lumMod val="99000"/><a:satMod val="120000"/><a:shade val="78000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:fillStyleLst><a:lnStyleLst><a:ln w="6350" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="12700" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln><a:ln w="19050" cap="flat" cmpd="sng" algn="ctr"><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:prstDash val="solid"/><a:miter lim="800000"/></a:ln></a:lnStyleLst><a:effectStyleLst><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst/></a:effectStyle><a:effectStyle><a:effectLst><a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr" rotWithShape="0"><a:srgbClr val="000000"><a:alpha val="63000"/></a:srgbClr></a:outerShdw></a:effectLst></a:effectStyle></a:effectStyleLst><a:bgFillStyleLst><a:solidFill><a:schemeClr val="phClr"/></a:solidFill><a:solidFill><a:schemeClr val="phClr"><a:tint val="95000"/><a:satMod val="170000"/></a:schemeClr></a:solidFill><a:gradFill rotWithShape="1"><a:gsLst><a:gs pos="0"><a:schemeClr val="phClr"><a:tint val="93000"/><a:satMod val="150000"/><a:shade val="98000"/><a:lumMod val="102000"/></a:schemeClr></a:gs><a:gs pos="50000"><a:schemeClr val="phClr"><a:tint val="98000"/><a:satMod val="130000"/><a:shade val="90000"/><a:lumMod val="103000"/></a:schemeClr></a:gs><a:gs pos="100000"><a:schemeClr val="phClr"><a:shade val="63000"/><a:satMod val="120000"/></a:schemeClr></a:gs></a:gsLst><a:lin ang="5400000" scaled="0"/></a:gradFill></a:bgFillStyleLst></a:fmtScheme></a:themeElements><a:objectDefaults/><a:extraClrSchemeLst/><a:extLst><a:ext uri="{05A4C25C-085E-4340-85A3-A5531E510DB2}"><thm15:themeFamily xmlns:thm15="http://schemas.microsoft.com/office/thememl/2012/main" name="Office Theme" id="{62F939B6-93AF-4DB8-9C6B-D6C7DFDC589F}" vid="{4A3C46E8-61CC-4603-A589-7422A47A8E4A}"/></a:ext></a:extLst></a:theme>',xlWorkbookXml:'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x15 xr xr6 xr10 xr2" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr6="http://schemas.microsoft.com/office/spreadsheetml/2016/revision6" xmlns:xr10="http://schemas.microsoft.com/office/spreadsheetml/2016/revision10" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2"><fileVersion appName="xl" lastEdited="7" lowestEdited="7" rupBuild="20325"/><workbookPr defaultThemeVersion="166925"/><mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"><mc:Choice Requires="x15"><x15ac:absPath url="C:UsersjqwidgetsDesktop" xmlns:x15ac="http://schemas.microsoft.com/office/spreadsheetml/2010/11/ac"/></mc:Choice></mc:AlternateContent><xr:revisionPtr revIDLastSave="0" documentId="13_ncr:1_{0DEDCB6D-5403-4CD8-AAA5-59B6D238A8B6}" xr6:coauthVersionLast="34" xr6:coauthVersionMax="34" xr10:uidLastSave="{00000000-0000-0000-0000-000000000000}"/><bookViews><workbookView xWindow="0" yWindow="0" windowWidth="19200" windowHeight="6950" xr2:uid="{0CB664E6-3800-4A88-B158-B46A682E7484}"/></bookViews><sheets><sheet name="Sheet1" sheetId="1" r:id="rId1"/></sheets><calcPr calcId="179021"/><extLst><ext uri="{140A7094-0E35-4892-8432-C4D2E57EDEB5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:workbookPr chartTrackingRefBase="1"/></ext></extLst></workbook>',Content_TypesXml:'<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="bin" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings"/><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/><Default Extension="xml" ContentType="application/xml"/><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml"/><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/><Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml"/><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml"/><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml"/><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml"/></Types>'}}generateDefaultStyle(e){const t=this,a={},o=t.datafields,l=t.complexHeader?e[t.complexHeader.length]:e[+t.exportHeader];if(!l)return a;for(let e=0;e<o.length;e++)l[o[e]]instanceof Date&&(a.columns||(a.columns=[]),a.columns[o[e]]={format:"d"});return a}generateGroupRow(e){const t=e.rowNumber,a="A"+t,o=` <row r="${t}" outlineLevel="${e.outlineLevel}" spans="1:${e.numberOfColumns}"${this.getCustomRowHeight(t-1)} x14ac:dyDescent="0.45">\n <c r="${a}" t="s" s="0">\n <v>${e.sharedStringIndex}</v>\n </c>\n </row>\n`;return e.mergedCells.push({from:a,to:this.columnsArray[e.numberOfColumns-1]+t}),o}generateSharedStrings(e){const t=this,a=t.datafields,o=[];let l="",r=0,n=0;function s(e){r++,-1===o.indexOf(e)&&(n++,o.push(e),e=(e=(e=(e=(e=e.replace(/&(?!amp;)/g,"&")).replace(/'/g,"'")).replace(/"/g,""")).replace(/>/g,">")).replace(/</g,"<"),l+=`<si><t>${e}</t></si>`)}for(let o=0;o<e.length;o++){const l=e[o];for(let e=0;e<a.length;e++){let o=l[a[e]];null!==o||t.allowNull||(o=""),"string"==typeof o&&s(o)}}if(t.groupLabels)for(let e=0;e<t.groupLabels.length;e++)s(t.groupLabels[e]);return l=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${r}" uniqueCount="${n}">${l}</sst>`,{collection:o,xml:l}}generateSheet1(e,t){const a=this,o=a.columnsArray.length,l=e.length,r=a.columnsArray[o-1]+l,n=a.datafields,s=a.getFilters(),i=[].concat(a.complexHeaderMergedCells);let c=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac xr xr2 xr3" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2" xmlns:xr3="http://schemas.microsoft.com/office/spreadsheetml/2016/revision3" xr:uid="{7F25248B-C640-4C64-AD47-C0EA0E5D90D0}">\n <sheetPr filterMode="${""!==s}" />\n <dimension ref="A1:${r}" />\n <sheetViews>\n <sheetView tabSelected="1" workbookViewId="0" />\n </sheetViews>\n <sheetFormatPr defaultRowHeight="14.5" x14ac:dyDescent="0.35" />${a.getCustomColumnWidths()}\n <sheetData>\n`;function p(e,t){return a.columnsArray[e]+t}for(let l=0;l<=e.length;l++){const r=e[l],s=l+1;let i="";if(a.actualHierarchy){const t=e[l-1];t&&t._collapsed&&(!r||t._level>r._level)&&(i=' collapsed="true"')}if(l===e.length){i&&(c+=` <row r="${s}" outlineLevel="${Math.max(e[l-1]._level-2,0)}" hidden="false" collapsed="true" />\n`);break}let m=` <row r="${s}"${a.getOutlineLevel(r)} hidden="${r._hidden||r._collapsed||!1}"${i} spans="1:${o}"${a.getCustomRowHeight(s-1)} x14ac:dyDescent="0.45">\n`;for(let e=0;e<n.length;e++){const o=a.getXLSXCellStyle(p(e,s));m+=a.getActualCellData(r[n[e]],{r:p(e,s),s:o},t)}m+=" </row>\n",c+=m}return c+=` </sheetData>${a.conditionalFormattingXLSX.conditions}${s}${a.getMergedCells(i)}\n <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" />\n <pageSetup paperSize="9" orientation="portrait" r:id="rId1" />\n</worksheet>`,c}generateSheet1WithGrouping(e,t){const a=this,o=a.columnsArray.length,l=e.length,r=a.columnsArray[o-1]+l,n=a.datafields,s=[].concat(a.complexHeaderMergedCells);let i=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac xr xr2 xr3" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr2="http://schemas.microsoft.com/office/spreadsheetml/2015/revision2" xmlns:xr3="http://schemas.microsoft.com/office/spreadsheetml/2016/revision3" xr:uid="{7F25248B-C640-4C64-AD47-C0EA0E5D90D0}">\n <dimension ref="A1:${r}" />\n <sheetViews>\n <sheetView tabSelected="1" workbookViewId="0" />\n </sheetViews>\n <sheetFormatPr defaultRowHeight="14.5" x14ac:dyDescent="0.35" />${a.getCustomColumnWidths()}\n <sheetData>\n`,c=0,p=[];function m(e,t){return a.columnsArray[e]+t}e:for(let l=0;l<e.length;l++){const r=e[l],f=l+1+c;let d=0,h="";if(!a.exportHeader||!a.complexHeader&&0!==l||a.complexHeader&&l>=a.complexHeader.length){let e="";for(let n=0;n<a.groupBy.length;n++){const m=a.groupBy[n],h=r[m],g=a.groups[m][h];if(e+=h,-1===p.indexOf(e)){let r=t.indexOf(g);i+=a.generateGroupRow({rowNumber:f,outlineLevel:d,numberOfColumns:o,sharedStringIndex:r,mergedCells:s}),p.push(e),l--,c++;continue e}d++}h=` outlineLevel="${d}"`}let g=` <row r="${f}"${h} spans="1:${o}"${a.getCustomRowHeight(f-1)} x14ac:dyDescent="0.45">\n`;for(let e=0;e<n.length;e++){const o=a.getXLSXCellStyle(m(e,l+1));g+=a.getActualCellData(r[n[e]],{r:m(e,f),s:o},t)}g+=" </row>\n",i+=g}return i+=` </sheetData>${a.getMergedCells(s)}\n <pageMargins left="0.7" right="0.7" top="0.75" bottom="0.75" header="0.3" footer="0.3" />\n <pageSetup paperSize="9" orientation="portrait" r:id="rId1" />\n</worksheet>`,i}getActualCellData(e,t,a){const o=t.r,l=t.s||' s="0"';return null!==e||this.allowNull||(e=""),"string"==typeof e?` <c r="${o}" t="s"${l}>\n <v>${a.indexOf(e)}</v>\n </c>\n`:"boolean"==typeof e?` <c r="${o}" t="b"${l}>\n <v>${+e}</v>\n </c>\n`:e instanceof Date?` <c r="${o}"${l}>\n <v>${2+Math.round(this.timeBetween1900And1970/864e5)+(e.getTime()-60*e.getTimezoneOffset()*1e3)/864e5}</v>\n </c>\n`:` <c r="${o}"${l}>\n <v>${e}</v>\n </c>\n`}getColumnsArray(){const e=this.datafields.length,t=[];function a(e){return e<26?"":String.fromCharCode(64+Math.floor(e/26))}for(let o=0;o<e;o++)t.push(a(o)+String.fromCharCode(65+(o<26?o:o%26)));this.columnsArray=t}getColumnStyle(){const e=this,t=e.style;if(!t)return" .header { border: 1px solid black; padding: 5px; }\n .column { border: 1px solid black; padding: 5px; }\n .group { background-color: #FFFFFF; color: #000000; font-weight: bold; }";let a;a=t.removeDefault?{header:"",column:"",group:""}:{header:"border: 1px solid black; padding: 5px; ",column:"white-space: nowrap; overflow: hidden; border: 1px solid black; padding: 5px; ",group:"background-color: #FFFFFF; color: #000000; font-weight: bold; "};const o=e.data[0];let l="";const r=t.header||{};for(let t in r){if(!Object.prototype.hasOwnProperty.call(r,t))continue;const l=r[t];if(o[t]){a["header"+t]||(a["header"+t]="");for(let e in l)if(Object.prototype.hasOwnProperty.call(l,e)){const o=Smart.Utilities.Core.toDash(e)+": "+l[e]+"; ";a["header"+t]+=o,"width"===e&&(a["column"+t]||(a["column"+t]=""),a["column"+t]+=o)}}else"height"===t&&e.complexHeader?a.header+="height: "+parseInt(r[t],10)/e.complexHeader.length+"px; ":a.header+=Smart.Utilities.Core.toDash(t)+": "+r[t]+"; "}const n=t.columns||{};for(let e in n){if(!Object.prototype.hasOwnProperty.call(n,e))continue;const t=n[e];if(o[e]){a["column"+e]||(a["column"+e]="");for(let o in t)isNaN(o)&&Object.prototype.hasOwnProperty.call(t,o)&&"format"!==o&&(a["column"+e]+=Smart.Utilities.Core.toDash(o)+": "+t[o]+"; ")}else a.column+=Smart.Utilities.Core.toDash(e)+": "+t+"; "}for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&(l+=` .${e} { ${a[e]}}\n`);return t.custom&&(l+=`${t.custom}\n`),l}getCustomColumnWidths(){const e=this;if(!e.style||!e.columnWidth||0===e.columnWidth.length)return"";let t="\n <cols>\n";for(let a=0;a<e.columnWidth.length;a++){let o=e.columnWidth[a];void 0!==o&&(o=Math.round(parseFloat(o))/7,t+=` <col min="${a+1}" max="${a+1}" width="${o}" customWidth="1" />\n`)}return t+=" </cols>",t}getCustomFilter(e,t){let a,o="equal";switch(e instanceof Date&&(e=(e.getTime()+this.timeBetween1900And1970)/864e5+2),t=t.toUpperCase()){case"EMPTY":a="";break;case"NOT_EMPTY":a="",o="notEqual";break;case"CONTAINS":case"CONTAINS_CASE_SENSITIVE":a=`*${e}*`;break;case"DOES_NOT_CONTAIN":case"DOES_NOT_CONTAIN_CASE_SENSITIVE":a=`*${e}*`,o="notEqual";break;case"STARTS_WITH":case"STARTS_WITH_CASE_SENSITIVE":a=`${e}*`;break;case"ENDS_WITH":case"ENDS_WITH_CASE_SENSITIVE":a=`*${e}`;break;case"EQUAL":case"EQUAL_CASE_SENSITIVE":a=e;break;case"NULL":a=null;break;case"NOT_NULL":a=null,o="notEqual";break;case"NOT_EQUAL":a=e,o="notEqual";break;case"LESS_THAN":a=e,o="lessThan";break;case"LESS_THAN_OR_EQUAL":a=e,o="lessThanOrEqual";break;case"GREATER_THAN":a=e,o="greaterThan";break;case"GREATER_THAN_OR_EQUAL":a=e,o="greaterThanOrEqual"}return` <customFilter val="${a}" operator="${o}"/>\n`}getCustomRowHeight(e){const t=this;return t.style&&(t.rowHeight[e]||t.defaultRowHeight)||""}getDatafields(e){const t=e[0],a=[];for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&"_"!==e.charAt(0)&&a.push(e);this.datafields=a}getFilters(){const e=this,t=e.filterBy;if(!t)return"";let a="";for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){const l=e.datafields.indexOf(o);if(-1===l)continue;const r=t[o],n=r.filters;a+=` <filterColumn colId="${l}">\n <customFilters and="${!r.operator}">\n`;for(let t=0;t<n.length;t++)a+=e.getCustomFilter(n[t].value,n[t].condition);a+=" </customFilters>\n </filterColumn>"}return a?(a=`\n <autoFilter ref="A1:${e.columnsArray[e.columnsArray.length-1]+e.data.length}">\n${a}\n </autoFilter>`,a):""}getGroupLabels(e){const t=this,a=void 0!==t.xlsxStartIndex?t.xlsxStartIndex:+t.exportHeader,o={},l=[];for(let r=a;r<e.length;r++){const n=e[r];for(let r=0;r<t.groupBy.length;r++){const s=t.groupBy[r],i=n[s];let c=o[s];void 0===c&&(o[s]={},c=o[s]),void 0===c[i]&&(c[i]=(t.exportHeader?e[a-1][s]:s)+": "+i,l.push(c[i]))}}t.groups=o,t.groupLabels=l}getHTMLHeader(e,t){const a=this;let o="\n <thead>\n";if(!a.complexHeader){o+=" <tr>\n";for(let a=0;a<e.length;a++){const l=e[a];o+=` <th class="header header${l}">${t[0][l]}</th>\n`}return o+=" </tr>\n </thead>",o}for(let t=0;t<a.complexDataFieldsHeader.length;t++){const l=a.complexDataFieldsHeader[t];o+=" <tr>\n";for(let r=0;r<l.length;r++){const n=l[r];let s=1,i=1;if(l[r-1]&&l[r-1]===n||a.complexDataFieldsHeader[t-1]&&a.complexDataFieldsHeader[t-1][r]===n)continue;let c=r+1;for(;l[c]&&l[c]===l[c-1];)s++,c++;for(c=t+1;a.complexDataFieldsHeader[c]&&a.complexDataFieldsHeader[c][r]===n;)i++,c++;o+=` <th class="header${t===a.complexHeader.length-1||i+t===a.complexHeader.length?" header"+e[r]:""}" colspan="${s}" rowspan="${i}">${a.complexHeader[t][r]}</th>\n`}o+=" </tr>\n"}return o+=" </thead>",o}getConditionalFormatting(){const e=this,t=e.conditionalFormatting;if(!t)return void(e.conditionalFormattingXLSX={conditions:"",styles:""});const a=[];let o="",l="";for(let r=t.length-1;r>=0;r--){const n=t[r],s=e.columnsArray[e.datafields.indexOf(n.column)],i=s+(e.xlsxStartIndex+1),c=i+":"+s+e.data.length,p=n.background+n.color,m=e.getConditionalAttributes(n,i);let f=a.indexOf(p);-1===f&&(l+=` <dxf>\n <font>\n <b val="0"/>\n <i val="0"/>\n <color rgb="${"White"===n.color?"FFFFFFFF":"FF000000"}"/>\n <sz val="10"/>\n </font>\n <fill>\n <patternFill>\n <bgColor rgb="${e.toARGB(n.background)}"/>\n </patternFill>\n </fill>\n </dxf>\n`,f=a.length,a.push(p)),o+=` <conditionalFormatting sqref="${c}">\n <cfRule dxfId="${f}" text="${m.text}" rank="${m.rank}" percent="${m.percent}" bottom="${m.bottom}" equalAverage="${m.equalAverage}" aboveAverage="${m.aboveAverage}"${m.operator}${m.timePeriod} priority="${r+2}" type="${m.type}">\n${m.formula} </cfRule>\n </conditionalFormatting>\n`}l=` <dxfs count="${a.length}">\n${l} </dxfs>`,e.conditionalFormattingXLSX={conditions:o,styles:l}}getConditionalAttributes(e,t){let a=e.condition,o=e.comparator,l="",r=0,n=0,s=0,i=0,c="",p="",m="",f="";switch(a){case"equal":c="equal",m="cellIs",f=` <formula>${o}</formula>\n`;break;case"lessThan":c="lessThan",m="cellIs",f=` <formula>${o}</formula>\n`;break;case"greaterThan":c="greaterThan",m="cellIs",f=` <formula>${o}</formula>\n`;break;case"notEqual":c="notEqual",m="cellIs",f=` <formula>${o}</formula>\n`;break;case"between":c="between",m="cellIs",f=` <formula>${e.min}</formula>\n <formula>${e.max}</formula>\n`;break;case"duplicate":m="duplicateValues",f=" <formula>0</formula>\n";break;case"topNItems":r=o,m="top10";break;case"bottomNItems":r=o,s=1,m="top10";break;case"topNPercent":r=o,n=1,m="top10";break;case"bottomNPercent":r=o,n=1,s=1,m="top10";break;case"aboveAverage":i=1,m="aboveAverage",f=" <formula>0</formula>\n";break;case"belowAverage":m="aboveAverage",f=" <formula>0</formula>\n";break;case"contains":l=o,c="containsText",m="containsText",f=` <formula>NOT(ISERROR(SEARCH("${o}",${t})))</formula>\n`;break;case"doesNotContain":l=o,c="notContains",m="notContainsText",f=` <formula>ISERROR(SEARCH("${o}",${t}))</formula>\n`;break;case"dateOccur":p=` timePeriod="${o}"`,m="timePeriod"}return c&&(c=` operator="${c}" `),{text:l,rank:r,percent:n,bottom:s,equalAverage:0,aboveAverage:i,operator:c,timePeriod:p,type:m,formula:f}}getMergedCells(e){const t=this;let a="";for(let t=0;t<e.length;t++)e[t].from!==e[t].to&&(a+=`\n <mergeCell ref="${e[t].from}:${e[t].to}" />\n`);if(t.mergedCells)for(let e=0;e<t.mergedCells.length;e++){const o=t.mergedCells[e];o.rowspan<2&&o.colspan<2||(a+=`\n <mergeCell ref="${t.columnsArray[o.cell[0]]+(o.cell[1]+t.xlsxStartIndex+1)}:${t.columnsArray[o.cell[0]+o.colspan-1]+(o.cell[1]+t.xlsxStartIndex+o.rowspan)}" />\n`)}return a&&(a=`\n <mergeCells count="${e.length}">${a} </mergeCells>`),a}getNumFmtIndex(e,t){let a=t.collection.indexOf(e);return-1===a?(a=t.collection.length+100,t.collection.push(e),t.xml+=`<numFmt numFmtId="${a}" formatCode="${e}"/>`):a+=100,a}getOutlineLevel(e){return this.actualHierarchy&&1!==e._level?` outlineLevel="${e._level-1}"`:""}getRowStyle(){const e=this.style;if(!e)return"";const t=e.rows;if(!t)return"";const a={row:""};let o="";for(let e in t){if(!Object.prototype.hasOwnProperty.call(t,e)||"alternationCount"===e||"alternationStart"===e||"alternationEnd"===e)continue;const o=t[e];if(-1===e.indexOf("alt"))if(isNaN(e))a.row+=Smart.Utilities.Core.toDash(e)+": "+t[e]+"; ";else{a["row"+e]||(a["row"+e]="");for(let t in o)Object.prototype.hasOwnProperty.call(o,t)&&(a["row"+e]+=Smart.Utilities.Core.toDash(t)+": "+o[t]+"; ")}else{const t=e.slice(16,17),l=e.slice(17);a["rowN"+t]||(a["rowN"+t]=""),a["rowN"+t]+="Color"===l?"color : "+o+"; ":"BorderColor"===l?"border-color : "+o+"; ":"background-color : "+o+"; "}}let l=Object.keys(a);l.sort((function(e,t){if("row"===e)return-1;if("row"===t)return 1;const a=!isNaN(e.slice(3)),o=!isNaN(t.slice(3));return a&&!o?1:!a&&o?-1:+(e<t)}));for(let e=0;e<l.length;e++)o+=` .${l[e]} { ${a[l[e]]}}\n`;return o}getTableStyle(){const e=this.style;if(!e)return' style="table-layout: fixed; border: 1px solid black; border-collapse: collapse;"';let t="table-layout: fixed; ";for(let a in e)Object.prototype.hasOwnProperty.call(e,a)&&-1===["header","columns","rows","removeDefault","custom"].indexOf(a)&&(t+=Smart.Utilities.Core.toDash(a)+": "+e[a]+"; ");return t&&(t=' style="'+t+'"'),t}getXLSXCellStyle(e){const t=this;return void 0!==t.cellStyleMapping[e]?` s="${t.cellStyleMapping[e]}"`:""}getXLSXFormat(e,t){if("number"==typeof t){if(!/^([a-zA-Z]\d*)$/g.test(e))return e;let t=parseFloat(e.slice(1))||0,a=t>0?"."+"0".repeat(t):"";switch(e=e.slice(0,1)){case"C":case"c":return"$#,0"+a;case"D":case"d":return t?"0".repeat(t):"0";case"E":case"e":return"0"+a+e+"000";case"F":case"f":return"0"+a;case"N":case"n":return"#,0"+a;case"P":case"p":return"#,0"+a+" %";default:return}}else if(t instanceof Date){switch(e){case"d":return"m/d/yyyy";case"D":return"nnnnmmmm dd, yyyy";case"t":return"h:m AM/PM";case"T":return"h:mm:ss AM/PM";case"f":return"nnnnmmmm dd, yyyy h:m AM/PM";case"F":return"nnnnmmmm dd, yyyy h:mm:ss AM/PM";case"M":return"mmmm d";case"Y":return"yyyy mmmm";case"FP":case"PP":return"yyyy-mm-dd hh:mm:ss";case"FT":case"PT":return"hh:mm:ss"}return e=(e=(e=(e=e.replace(/f|u|n|p|e|a|x|o/gi,"")).replace(/tt/gi,"AM/PM")).replace(/:{2,}|:\s|:$|\.$/g,"")).trim()}}processColumnStyle(e){const t=this,a=e.header,o=e.columns,l=t.data[0],r=t.xlsxStartIndex;if(t.columnWidth=[],r&&a)for(let e=0;e<t.columnsArray.length;e++){const o=t.columnsArray[e],n=o+r,s=a[t.datafields[e]];for(let e in a)if(Object.prototype.hasOwnProperty.call(a,e)&&void 0===l[e])if(t.complexHeader)for(let l=0;l<t.complexHeader.length;l++)"height"!==e?t.storeCellStyle(o+(l+1),e,a[e]):t.rowHeight[l]=` ht="${parseFloat(a.height)/t.complexHeader.length/2}"`;else{if("height"===e){t.rowHeight[0]=` ht="${parseFloat(a.height)/2}"`;continue}t.storeCellStyle(n,e,a[e])}if(s)for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){if("width"===a){t.columnWidth[e]=s.width;continue}t.storeCellStyle(n,a,s[a])}}else if(a)for(let e=0;e<t.columnsArray.length;e++){const o=a[t.datafields[e]];o&&void 0!==o.width&&(t.columnWidth[e]=o.width)}if(!o)return"";for(let e=r;e<t.data.length;e++)for(let a=0;a<t.columnsArray.length;a++){const r=t.columnsArray[a]+(e+1),n=t.datafields[a],s=o[n];for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&void 0===l[e]&&t.storeCellStyle(r,e,o[e]);if(s)for(let a in s)isNaN(a)&&Object.prototype.hasOwnProperty.call(s,a)&&t.storeCellStyle(r,a,s[a],t.data[e][n])}}processComplexHeader(e,t,a){const o=this,l={},r=-1!==["html","jpeg","pdf","png","xlsx"].indexOf(a)&&e.columngroups,n=[],s={},i={},c=[],p=[];let m=0;function f(t){for(let a=0;a<e.columngroups.length;a++){const o=e.columngroups[a];if(o.name===t)return o}}function d(e,t){const a=[];for(;e;){if(a.unshift(e[t]),!e.parentGroup)return a;e=f(e.parentGroup)}}if(r){for(let t=0;t<e.columngroups.length;t++){const a=e.columngroups[t],o=d(a,"label");s[a.name]=o,i[a.name]=d(a,"name"),m=Math.max(m,o.length)}m++;for(let e=0;e<m;e++)c[e]=[],p[e]=[]}for(let t=0;t<e.columns.length;t++){const a=e.columns[t];if(l[a.dataField]=a.label,!r)continue;if(n[t]=a.dataField,c[m-1][t]=a.label,p[m-1][t]=a.dataField,!a.columnGroup)continue;const o=s[a.columnGroup],f=i[a.columnGroup];if(o)for(let e=0;e<o.length;e++)c[e][t]=o[e],p[e][t]=f[e]}if(c.length>1){const e=Object.keys(l).length;for(let o=0;o<m-1;o++){const l={};for(let t=0;t<e;t++){if(void 0===c[o][t]){let e=o+1;for(;void 0===c[e][t];)e++;c[o][t]=c[e][t],p[o][t]=p[e][t]}l[n[t]]=c[o][t]}"xlsx"===a&&t.splice(o,0,l)}if(o.complexHeader=c,o.complexDataFieldsHeader=p,"xlsx"!==a)t.unshift(l);else{t.splice(m-1,0,l);const a={};for(let t=0;t<m;t++)for(let o=0;o<e;o++){const e=p[t][o];if(a[e]){const l=a[e].to;if(t-l[0]>1||o-l[1]>1){a[e+Math.random().toString(36)]=a[e],a[e]={from:[t,o],to:[t,o]};continue}a[e].to=[t,o]}else a[e]={from:[t,o]},a[e].to=a[e].from}o.complexHeaderMergeInfo=a}}else t.unshift(l)}processHierarchicalData(e,t){const a=this,o="xlsx"!==t?+a.exportHeader:a.xlsxStartIndex,l={},r=[];let n=0,s=!1;if(void 0===e[o]._keyDataField)return a.processNestedData(e,t,o);for(let t=o;t<e.length;t++){const a=Object.assign({},e[t]);let o=a._parentDataField;void 0===o&&(o=null),void 0===l[o]?l[o]=[a]:l[o].push(a)}if(o)for(let a=0;a<o;a++)r.push(Object.assign({},e[a])),-1===["json","pdf","xml"].indexOf(t)&&(r[a]._level=1);return"json"!==t&&"xml"!==t?function e(t,a,o){const i=l[t];if(n=Math.max(n,a),void 0!==i)for(let t=0;t<i.length;t++){const n=i[t],c=n._keyDataField;n._collapsed=o,n._level=a,r.push(n),l[c]&&(s=!0,n._expanded=void 0===n._expanded||n._expanded,e(c,a+1,o||!n._expanded))}}(null,1,!1):function e(a,o,r){const i=l[a];if(n=Math.max(n,o),void 0!==i)for(let a=0;a<i.length;a++){const n=i[a],c=n._keyDataField;let p;if("json"===t){p={};for(let e in n)Object.prototype.hasOwnProperty.call(n,e)&&"_"!==e.charAt(0)&&(p[e]=n[e])}else p=Object.assign({},n);r.push(p),l[c]&&(s=!0,p.rows=[],e(c,o+1,p.rows))}}(null,1,r),s||(a.actualHierarchy=!1),a.maxLevel=n,r}processNestedData(e,t,a){const o=this,l=[];let r=0,n=!1;if(a)for(let o=0;o<a;o++)l.push(Object.assign({},e[o])),-1===["json","pdf","xml"].indexOf(t)&&(l[o]._level=1);return"json"!==t&&"xml"!==t?function e(t,a,o,s){r=Math.max(r,o);for(let r=t;r<a.length;r++){const t=Object.assign({},a[r]);t._collapsed=s,t._level=o,l.push(t),t.children&&t.children.length>0&&(n=!0,t._expanded=void 0===t._expanded||t._expanded,e(0,t.children,o+1,s||!t._expanded)),delete t.children}}(a,e,1,!1):function e(t,a,o,s){r=Math.max(r,s);for(let r=t;r<a.length;r++){const t=Object.assign({},a[r]);1===s?l[r]=t:o[r]=t,t.children&&t.children.length>0&&(n=!0,t.rows=[],e(0,t.children,t.rows,s+1)),delete t.children}}(a,e,void 0,1),n||(o.actualHierarchy=!1),o.maxLevel=r,l}processRowStyle(e){const t=this,a=e.rows;if(t.rowHeight=[],!a)return;const o=t.xlsxStartIndex;function l(e,a,l){for(let r=0;r<t.columnsArray.length;r++){const n=t.columnsArray[r]+(e+1+o);t.storeCellStyle(n,a,l)}}a.height&&(t.defaultRowHeight=` ht="${parseFloat(a.height)/2}"`);for(let e=o;e<t.data.length;e++){const r=e-o;for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&-1===e.indexOf("alt")&&isNaN(e)&&"height"!==e&&l(r,e,a[e]);if(a.alternationCount&&((void 0===a.alternationStart||r>=a.alternationStart)&&(void 0===a.alternationEnd||r<=a.alternationEnd)||a.alternationStart===a.alternationEnd)){const e=(r-(a.alternationStart||0))%a.alternationCount;a[`alternationIndex${e}Color`]&&l(r,"color",a[`alternationIndex${e}Color`]),a[`alternationIndex${e}BorderColor`]&&l(r,"borderColor",a[`alternationIndex${e}BorderColor`]),a[`alternationIndex${e}BackgroundColor`]&&l(r,"backgroundColor",a[`alternationIndex${e}BackgroundColor`])}if(a[r])for(let o in a[r])if(Object.prototype.hasOwnProperty.call(a[r],o)){if("height"===o){t.rowHeight[e]=` ht="${parseFloat(a[r].height)/2}"`;continue}l(r,o,a[r][o])}}}storeCellStyle(e,t,a){const o=this.styleMap[e];switch(t){case"backgroundColor":o.fills.fgColor=a;break;case"color":o.fonts.color=a;break;case"fontFamily":o.fonts.name=a.replace(/"/g,"'");break;case"fontSize":o.fonts.sz=parseFloat(a);break;case"fontStyle":"italic"===a?o.fonts.i=!0:delete o.fonts.i;break;case"fontWeight":"bold"===a?o.fonts.b=!0:delete o.fonts.b;break;case"numFmt":o.numFmt=a;break;case"textAlign":o.alignment.horizontal=a;break;case"textDecoration":"underline"===a?o.fonts.u=!0:delete o.fonts.u;break;case"verticalAlign":"middle"===a&&(a="center"),o.alignment.vertical=a}}toARGB(e){e=e.replace(/\s/g,"");const t=/rgb\((\d+),(\d+),(\d+)\)/gi.exec(e);if(null!==t){const e=parseFloat(t[1]).toString(16).toUpperCase(),a=parseFloat(t[2]).toString(16).toUpperCase(),o=parseFloat(t[3]).toString(16).toUpperCase();return"FF"+"0".repeat(2-e.length)+e+"0".repeat(2-a.length)+a+"0".repeat(2-o.length)+o}const a=/rgba\((\d+),(\d+),(\d+)\,(\d*.\d+|\d+)\)/gi.exec(e);if(null!==a){const e=Math.round(255*parseFloat(a[4])).toString(16).toUpperCase(),t=parseFloat(a[1]).toString(16).toUpperCase(),o=parseFloat(a[2]).toString(16).toUpperCase(),l=parseFloat(a[3]).toString(16).toUpperCase();return"0".repeat(2-e.length)+e+"0".repeat(2-t.length)+t+"0".repeat(2-o.length)+o+"0".repeat(2-l.length)+l}const o=/^#(.)(.)(.)$/gi.exec(e);if(null!==o){const e=o[1].toUpperCase(),t=o[2].toUpperCase(),a=o[3].toUpperCase();return"FF"+e+e+t+t+a+a}return"FF"+e.toUpperCase().slice(1)}toggleableFunctionality(){const e=this;return e.actualHierarchy?`\n <style type="text/css">\n .toggle-element {\n width: 5px;\n height: 1px;\n padding-right: 5px;\n float: left;\n text-align: right;\n cursor: pointer;\n user-select: none;\n }\n\n .collapsed {\n display: none;\n }\n </style>\n <script type="text/javascript">\n window.onload = function () {\n var expandChar = '${e.expandChar}',\n collapseChar = '${e.collapseChar}',\n toggleElements = document.getElementsByClassName('toggle-element');\n\n function getParent(child) {\n var prevSibling = child.previousElementSibling;\n\n while (prevSibling) {\n if (child.getAttribute('level') > prevSibling.getAttribute('level')) {\n return prevSibling;\n }\n\n prevSibling = prevSibling.previousElementSibling;\n }\n\n }\n\n function getFirstCollapsedAncestor(child) {\n var parent = getParent(child);\n\n while (parent) {\n if (parent.firstElementChild.firstElementChild.innerHTML === expandChar) {\n return parent;\n }\n\n parent = getParent(parent);\n }\n }\n\n for (var i = 0; i < toggleElements.length; i++) {\n toggleElements[i].addEventListener('click', function (event) {\n var expanded = this.innerHTML === collapseChar,\n row = this.parentElement.parentElement,\n sibling = row.nextElementSibling;\n\n if (expanded) {\n this.innerHTML = expandChar;\n }\n else {\n this.innerHTML = collapseChar;\n }\n\n while (sibling && row.getAttribute('level') < sibling.getAttribute('level')) {\n if (expanded) {\n sibling.style.display = 'none';\n }\n else {\n var firstCollapsedAncestor = getFirstCollapsedAncestor(sibling);\n\n if (!firstCollapsedAncestor || firstCollapsedAncestor === row) {\n sibling.classList.remove('collapsed');\n sibling.style.display = null;\n }\n\n }\n\n sibling = sibling.nextElementSibling;\n }\n });\n }\n }\n <\/script>`:""}generateStyles(e){const t=this;if(t.cellStyleMapping={},0===Object.keys(e).length&&!t.complexHeader)return`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac x16r2 xr" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision"><fonts count="1" x14ac:knownFonts="1"><font><sz val="11"/><color theme="1"/><name val="Calibri"/><family val="2"/><charset val="204"/><scheme val="minor"/></font></fonts><fills count="2"><fill><patternFill patternType="none"/></fill><fill><patternFill patternType="gray125"/></fill></fills><borders count="1"><border><left/><right/><top/><bottom/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0" xfId="0"/></cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>${t.conditionalFormattingXLSX.styles||'<dxfs count="0"/>'}<tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/><extLst><ext uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerStyles defaultSlicerStyle="SlicerStyleLight1"/></ext><ext uri="{9260A510-F301-46a8-8635-F512D64BE5F5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:timelineStyles defaultTimelineStyle="TimeSlicerStyleLight1"/></ext></extLst></styleSheet>`;t.styleMap={};for(let e=0;e<t.data.length;e++)for(let a=0;a<t.columnsArray.length;a++)t.styleMap[t.columnsArray[a]+(e+1)]={numFmts:{},fonts:{},fills:{},borders:{},alignment:{}};if(e&&e.columns)for(let a=0;a<t.columnsArray.length;a++){const o=t.datafields[a];if(!e.columns[o]||!e.columns[o].format)continue;const l=t.getXLSXFormat(e.columns[o].format,t.data[1][o]),r=t.getXLSXFormat(e.columns[o].format,t.data[t.data.length-1][o]);r?e.columns[o].numFmt=r:l&&(e.columns[o].numFmt=l)}t.processRowStyle(e),t.processColumnStyle(e);const a={};for(let e=0;e<t.complexHeaderMergedCells.length;e++){const o=t.complexHeaderMergedCells[e];parseFloat(o.to[1])!==t.complexHeader.length?(t.styleMap[o.from].alignment.horizontal="center",t.styleMap[o.from].alignment.vertical="center"):a[o.to]=o.from}const o={xml:'<font><sz val="11" /><color theme="1" /><name val="Calibri" /><family val="2" /><charset val="204" /><scheme val="minor" /></font>',collection:["default"]},l={xml:'<fill><patternFill patternType="none" /></fill><fill><patternFill patternType="gray125" /></fill>',collection:["default","gray125"]},r={xml:"",collection:[]},n={xml:'<xf fontId="0" fillId="0" borderId="1"/>',collection:["default"]};for(let e=0;e<t.data.length;e++)for(let s=0;s<t.columnsArray.length;s++){const i=t.columnsArray[s]+(e+1),c=t.styleMap[i];let p="",m="",f="",d=[],h=[],g=[],u=[];for(let e in c.fonts)if(Object.prototype.hasOwnProperty.call(c.fonts,e)){const a=c.fonts[e];switch(e){case"color":d[0]=a,p+=`<color rgb="${t.toARGB(a)}" />`;break;case"name":d[1]=a,p+=`<name val="${a}" />`;break;case"sz":d[2]=a,p+=`<sz val="${a}" />`;break;case"i":d[3]=a,p+="<i />";break;case"b":d[4]=a,p+="<b />";break;case"u":d[5]=a,p+="<u />"}}for(let e in c.fills)if(Object.prototype.hasOwnProperty.call(c.fills,e)){const a=c.fills[e];switch(e){case"fgColor":h[0]=a,m+=`<fgColor rgb="${t.toARGB(a)}" />`}}for(let e in c.alignment)if(Object.prototype.hasOwnProperty.call(c.alignment,e)){const t=c.alignment[e];switch(e){case"horizontal":g[0]=t,f+=`horizontal="${t}" `;break;case"vertical":g[1]=t,f+=`vertical="${t}" `}}if(d=d.toString(),h=h.toString(),""!==p){let e=o.collection.indexOf(d);-1===e&&(e=o.collection.length,o.xml+="<font>"+p+"</font>",o.collection.push(d)),u[0]=e}if(""!==m){let e=l.collection.indexOf(h);-1===e&&(e=l.collection.length,l.xml+='<fill><patternFill patternType="solid">'+m+"</patternFill></fill>",l.collection.push(h)),u[1]=e}g.length>0&&(u[2]=f),void 0!==c.numFmt&&(u[3]=t.getNumFmtIndex(c.numFmt,r));const y=u.toString();if(""!==y){let e=n.collection.indexOf(y);if(-1===e){let t="<xf ";e=n.collection.length,void 0!==u[0]&&(t+=`fontId="${u[0]}" `),void 0!==u[1]&&(t+=`fillId="${u[1]}" `),void 0!==u[3]&&(t+=`numFmtId="${u[3]}" `),void 0!==u[2]?t+=`applyAlignment="1" borderId="1"><alignment ${f}/></xf>`:t+=' borderId="1"/>',n.xml+=t,n.collection.push(y)}t.cellStyleMapping[a[i]||i]=e}}return r.collection.length&&(r.xml=`<numFmts count="${r.collection.length}">${r.xml}</numFmts>`),`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="x14ac x16r2 xr" xmlns:x14ac="http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac" xmlns:x16r2="http://schemas.microsoft.com/office/spreadsheetml/2015/02/main" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision">${r.xml}<fonts count="${o.collection.length}" x14ac:knownFonts="1">${o.xml}</fonts><fills count="${l.collection.length}">${l.xml}</fills><borders count="2"><border><left/><right/><top/><bottom/></border><border><left style="hair"/><right style="hair"/><top style="hair"/><bottom style="hair"/><diagonal/></border></borders><cellStyleXfs count="1"><xf numFmtId="0" fontId="0" fillId="0" borderId="0"/></cellStyleXfs><cellXfs count="${n.collection.length}">${n.xml}</cellXfs><cellStyles count="1"><cellStyle name="Normal" xfId="0" builtinId="0"/></cellStyles>${t.conditionalFormattingXLSX.styles}<dxfs count="0"/><tableStyles count="0" defaultTableStyle="TableStyleMedium2" defaultPivotStyle="PivotStyleLight16"/><extLst><ext uri="{EB79DEF2-80B8-43e5-95BD-54CBDDF9020C}" xmlns:x14="http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"><x14:slicerStyles defaultSlicerStyle="SlicerStyleLight1"/></ext><ext uri="{9260A510-F301-46a8-8635-F512D64BE5F5}" xmlns:x15="http://schemas.microsoft.com/office/spreadsheetml/2010/11/main"><x15:timelineStyles defaultTimelineStyle="TimeSlicerStyleLight1"/></ext></extLst></styleSheet>`}});
|
|
@@ -37,7 +37,7 @@ Smart.Chart&&(Smart.Chart.prototype._moduleAnnotations=!0,Smart.Chart.prototype.
|
|
|
37
37
|
Smart.Chart&&(Smart.Chart.prototype._moduleApi=!0,Smart.Chart.prototype.getItemsCount=function(t,e){const r=this.seriesGroups[t];if(!this._isSerieVisible(t,e))return 0;const i=this._renderData;return!r||!i||i.length<=t?0:r.series[e]?i[t].offsets[e].length:0},Smart.Chart.prototype.getXAxisRect=function(t){const e=this._renderData;if(e&&!(e.length<=t)&&e[t].xAxis)return e[t].xAxis.rect},Smart.Chart.prototype.getXAxisLabels=function(t){const e=[];let r=this._renderData;if(!r||r.length<=t)return e;if(r=r[t].xAxis,!r)return e;const i=this.seriesGroups[t];if(i.polar||i.spider){for(let t=0;t<r.polarLabels.length;t++){const i=r.polarLabels[t];e.push({offset:{x:i.x,y:i.y},value:i.value})}return e}const s=this._getXAxis(t),o=this.getXAxisRect(t),a="top"===s.position||"right"===s.position,n="horizontal"===i.orientation;for(let t=0;t<r.data.length;t++)n?e.push({offset:{x:o.x+(a?0:o.width),y:o.y+r.data.data[t]},value:r.data.xvalues[t]}):e.push({offset:{x:o.x+r.data.data[t],y:o.y+(a?o.height:0)},value:r.data.xvalues[t]});return e},Smart.Chart.prototype.getValueAxisRect=function(t){const e=this._renderData;if(e&&!(e.length<=t)&&e[t].valueAxis)return e[t].valueAxis.rect},Smart.Chart.prototype.getValueAxisLabels=function(t){const e=[];let r=this._renderData;if(!r||r.length<=t)return e;if(r=r[t].valueAxis,!r)return e;const i=this._getValueAxis(t),s="top"===i.position||"right"===i.position,o=this.seriesGroups[t],a="horizontal"===o.orientation;if(o.polar||o.spider){for(let t=0;t<r.polarLabels.length;t++){const i=r.polarLabels[t];e.push({offset:{x:i.x,y:i.y},value:i.value})}return e}for(let t=0;t<r.items.length;t++)a?e.push({offset:{x:r.itemOffsets[r.items[t]].x+r.itemWidth/2,y:r.rect.y+(s?r.rect.height:0)},value:r.items[t]}):e.push({offset:{x:r.rect.x+r.rect.width,y:r.itemOffsets[r.items[t]].y+r.itemWidth/2},value:r.items[t]});return e},Smart.Chart.prototype.getPlotAreaRect=function(){return this._plotRect},Smart.Chart.prototype.getRect=function(){return this._rect},Smart.Chart.prototype.showToolTip=function(t,e,r,i,s){const o=this.getItemCoord(t,e,r);isNaN(o.x)||isNaN(o.y)||this._startTooltipTimer(t,e,r,o.x,o.y,i,s)},Smart.Chart.prototype.hideToolTip=function(t){isNaN(t)&&(t=0);const e=this;e._cancelTooltipTimer(),setTimeout((function(){e._hideToolTip(0)}),t)});
|
|
38
38
|
Smart.Chart&&(Smart.Chart.prototype._moduleRangeSelector=!0,Smart.Chart.prototype._renderXAxisRangeSelector=function(e,t){const i=this,r=i.seriesGroups[e],s=i._getXAxis(e),o=s?s.rangeSelector:void 0;if(!i._isSelectorRefresh){const e=(o&&o.renderTo?o.renderTo:i).getElementsByClassName("smart-chart-range-selector")[0];e&&e.parentElement.removeChild(e)}if(!s||!1===s.visible||"spider"===r.type)return!1;if(!i._isGroupVisible(e))return!1;if(!o)return!1;let a="horizontal"===r.orientation;o.renderTo&&(a=!1),i.rightToLeft&&(s.flip=!0);let l=a?i.offsetHeight:i.offsetWidth;l-=4;const n=this._getXAxisStats(e,s,l);let h=s.position;if(o.renderTo&&o.position&&(h=o.position),!this._isSelectorRefresh){const i=o.renderTo,r=document.createElement("div");if(r.className="smart-chart-range-selector smart-unselectable",r.style.position="absolute",r.style.backgroundColor="transparent",r.style.onselectstart=function(){return!1},i)i.appendChild(r),r.style.width=i.offsetWidth+"px",r.style.height=i.offsetHeight+"px",t.width=i.offsetWidth,t.height=i.offsetHeight;else{this.renderer.getContainer().appendChild(r);const e=this._selectorGetSize(s);a?(r.style.left=1+t.x+("right"!==h?-e:t.width)+"px",r.style.top="0",r.style.height=l+"px",r.style.width=e+"px",t.height=e):(r.style.left="2px",r.style.top=t.y+("top"!==h?t.height:-e)+"px",r.style.height=e+"px",r.style.width=l-1+"px")}r.parentDiv=r.parentElement,this._refreshSelector(e,s,n,r,t,a)}return this._isSelectorRefresh=!1,!0},Smart.Chart.prototype._refreshSelector=function(e,t,i,r,s,o){const a=this,l={},n=t.rangeSelector;for(let e in n)l[e]=n[e];delete l.padding;let h=l.minValue,d=l.maxValue;isNaN(h)&&(h=Math.min(i.min.valueOf(),i.dsRange.min.valueOf())),isNaN(d)&&(d=Math.max(i.max.valueOf(),i.dsRange.max.valueOf())),this._isDate(i.min)&&(h=new Date(h)),this._isDate(i.max)&&(d=new Date(d));let p=t.position;n.renderTo&&n.position&&(p=n.position),l.dataField=t.dataField,delete l.rangeSelector,l.type=t.type,l.baseUnit=null!==n.baseUnit?n.baseUnit:t.baseUnit,l.minValue=h,l.maxValue=d,l.flip=t.flip,l.position=p;let g=2,u=2,c=2,f=2;n.renderTo||(g=o?0:s.x,u=o?0:this._rect.width-s.x-s.width,c=o?s.y:5,f=o?this._paddedRect.height-this._plotRect.height:5);let m=n.padding;m=null!=m||n.renderTo?{left:m&&m.left?m.left:g,top:m&&m.top?m.top:c,right:m&&m.right?m.right:u,bottom:m&&m.bottom?m.bottom:f}:{left:g,top:c,right:u,bottom:f};let x=n.dataField;for(let e=0;null==x&&e<this.seriesGroups.length;e++)for(let t=0;null==x&&t<this.seriesGroups[e].series.length;t++)x=this.seriesGroups[e].series[t].dataField;const y={parentChart:this,padding:m,_isRangeSelectorInstance:!0,theme:this.theme,caption:n.caption,description:n.description,titlePadding:n.titlePadding,colorScheme:n.colorScheme||this.colorScheme,backgroundColor:n.backgroundColor||this.backgroundColor||a._getThemeColor("background"),backgroundImage:n.backgroundImage,showBorderLine:null!==n.showBorderLine?n.showBorderLine:!!n.renderTo,borderLineWidth:n.borderLineWidth||this.borderLineWidth,borderLineColor:n.borderLineColor||this.borderLineColor||a._getThemeColor("line"),rightToLeft:null!==n.rightToLeft?n.rightToLeft:this.rightToLeft,greyScale:null!==n.greyScale?n.greyScale:this.greyScale,renderEngine:this.renderEngine,showLegend:!1,animation:"none",enableEvents:!1,showToolTips:!1,dataSource:this.dataSource,xAxis:l,seriesGroups:[{orientation:o?"horizontal":"vertical",valueAxis:{visible:!1},type:n.serieType,skipOverlappingPoints:n.skipOverlappingPoints,columnSeriesOverlap:n.columnSeriesOverlap,columnsGapPercent:n.columnsGapPercent,seriesGapPercent:n.seriesGapPercent,series:[{dataField:x,opacity:.8,lineWidth:1}]}]};n.seriesGroups&&(y.seriesGroups=n.seriesGroups),n.valueAxis.visible&&(y.valueAxis=n.valueAxis),y.showBorderLine||(y.borderLineWidth=1,y.borderLineColor=a._get([this.backgroundColor,this.background,a._getThemeColor("background")]),y.showBorderLine=!0),a._supressBindingRefresh=!0,r.innerHTML="";const _=document.createElement("smart-chart");_.rightToLeft=a.rightToLeft,_.parentDiv=r;for(let e in y)_[e]=y[e];r.appendChild(_),a._rangeSelectorInstances[e]=_,a._supressBindingRefresh=!1;const S=function(){if(!_._plotRect)return;const t=_._paddedRect;if(t.height=_._plotRect.height,o||"top"!==p){if(o){const e=_._renderData[0].xAxis.rect.width;t.width-=e,"right"!==p&&(t.x+=e)}}else t.y+=_._renderData[0].xAxis.rect.height;if(a._createSliderElements(e,r,t,n,{min:l.minValue,max:l.maxValue}),a._rangeSelectorEventData={groupIndex:e,renderTo:r,swapXY:o},a.hasAttribute("aria-owns")){const e=a.getAttribute("aria-owns");a.setAttribute("aria-owns",e+" "+_.id)}else a.setAttribute("aria-owns",_.id)};_.isRendered?S():_.whenRendered((()=>{S()}))},Smart.Chart.prototype._createSliderElements=function(e,t,i,r,s){const o=this,a=t.getElementsByClassName("slider")[0];a&&a.parentElement.removeChild(a);const l=r.selectedRangeColor||"blue",n=o._get([r.selectedRangeOpacity,.1]),h=o._get([r.unselectedRangeOpacity,.5]),d=r.unselectedRangeColor||"white",p=r.rangeLineColor||"grey",g=document.createElement("div");for(g.className="slider",g.style.position="absolute",g.style.background=l,g.style.opacity=n,g.style.left=i.x+"px",g.style.top=i.y+"px",g.style.width=i.width+"px",g.style.height=i.height+"px",t.appendChild(g);this._sliders.length<e+1;)this._sliders.push({});function u(e,t){const i=document.createElement("div");return i.className="slider",i.style.position="absolute",i.style.background=e,i.style.opacity=t,i}function c(){const e=document.createElement("div");return e.className="slider",e.style.position="absolute",e.style.background="#FFFFFF",e.style.borderStyle="solid",e.style.borderWidth="1px",e.style.borderRadius="3px",e.style.borderColor=p,e.setAttribute("role","slider"),e.setAttribute("aria-controls",o.id),e}const f=g.getBoundingClientRect(),m=t.getBoundingClientRect();this._sliders[e]={element:g,host:t.firstElementChild,_sliderInitialAbsoluteRect:{x:f.left,y:f.top,width:i.width,height:i.height},_hostInitialAbsolutePos:{x:m.left,y:m.top},getRect:function(){const e=t.getBoundingClientRect();return{x:e.left-this._hostInitialAbsolutePos.x+this._sliderInitialAbsoluteRect.x,y:e.top-this._hostInitialAbsolutePos.y+this._sliderInitialAbsoluteRect.y,width:this._sliderInitialAbsoluteRect.width,height:this._sliderInitialAbsoluteRect.height}},rect:i,left:u(d,h),right:u(d,h),leftTop:u(p,h),rightTop:u(p,h),leftBorder:u(p,h),leftBar:c(),rightBorder:u(p,h),rightBar:c()};const x=this._sliders[e];t.appendChild(x.left),t.appendChild(x.right),t.appendChild(x.leftTop),t.appendChild(x.rightTop),t.appendChild(x.leftBorder),t.appendChild(x.rightBorder),t.appendChild(x.leftBar),t.appendChild(x.rightBar);const y=this._renderData[e].xAxis.data.axisStats,_=y.min.valueOf(),S=y.max.valueOf();"number"==typeof y.min?(x.leftBar.setAttribute("aria-valuemin",s.min),x.leftBar.setAttribute("aria-valuemax",s.max),x.leftBar.setAttribute("aria-valuenow",_),x.rightBar.setAttribute("aria-valuemin",s.min),x.rightBar.setAttribute("aria-valuemax",s.max),x.rightBar.setAttribute("aria-valuenow",S)):(x.leftBar.setAttribute("aria-valuemin",s.min.getTime()),x.leftBar.setAttribute("aria-valuemax",s.max.getTime()),x.leftBar.setAttribute("aria-valuenow",y.min.getTime()),x.leftBar.setAttribute("aria-valuetext",y.min.toLocaleString()),x.rightBar.setAttribute("aria-valuemin",s.min.getTime()),x.rightBar.setAttribute("aria-valuemax",s.max.getTime()),x.rightBar.setAttribute("aria-valuenow",y.max.getTime()),x.rightBar.setAttribute("aria-valuetext",y.max.toLocaleString()));let b=this._valueToOffset(e,_),v=this._valueToOffset(e,S);if(b>v){const e=v;v=b,b=e}"horizontal"!==this.seriesGroups[e].orientation?(g.style.left=Math.round(i.x+b)+"px",g.style.top=i.y+"px",g.style.width=Math.round(v-b)+"px",g.style.height=i.height+"px"):(g.style.left=i.x+"px",g.style.top=Math.round(i.y+b)+"px",g.style.width=i.width+"px",g.style.height=Math.round(v-b)+"px"),this._setSliderPositions(e,b,v)},Smart.Chart.prototype._setSliderPositions=function(e,t,i){const r=this.seriesGroups[e],s=this._getXAxis(e),o=s.rangeSelector;let a="horizontal"===r.orientation;s.rangeSelector.renderTo&&(a=!1);let l=s.position;o.renderTo&&o.position&&(l=o.position);const n=this._sliders[e],h=a?"top":"left",d=a?"left":"top",p=a?"height":"width",g=a?"width":"height",u=a?"y":"x",c=a?"x":"y",f=n.rect;n.startOffset=t,n.endOffset=i,n.left.style[h]=f[u]+"px",n.left.style[d]=f[c]+"px",n.left.style[p]=t+"px",n.left.style[g]=f[g]+"px",n.right.style[h]=f[u]+i+"px",n.right.style[d]=f[c]+"px",n.right.style[p]=f[p]-i+1+"px",n.right.style[g]=f[g]+"px",n.leftTop.style[h]=f[u]+"px",n.leftTop.style[d]=f[c]+(a&&"right"===l||!a&&"top"!==l?0:f[g])+"px",n.leftTop.style[p]=t+"px",n.leftTop.style[g]="1px",n.rightTop.style[h]=f[u]+i+"px",n.rightTop.style[d]=f[c]+(a&&"right"===l||!a&&"top"!==l?0:f[g])+"px",n.rightTop.style[p]=f[p]-i+1+"px",n.rightTop.style[g]="1px",n.leftBorder.style[h]=f[u]+t+"px",n.leftBorder.style[d]=f[c]+"px",n.leftBorder.style[p]="1px",n.leftBorder.style[g]=f[g]+"px";let m=f[g]/4;m>20&&(m=20),m<3&&(m=3),n.leftBar.style[h]=f[u]+t-3+"px",n.leftBar.style[d]=f[c]+f[g]/2-m/2+"px",n.leftBar.style[p]="5px",n.leftBar.style[g]=m+"px",n.rightBorder.style[h]=f[u]+i+"px",n.rightBorder.style[d]=f[c]+"px",n.rightBorder.style[p]="1px",n.rightBorder.style[g]=f[g]+"px",n.rightBar.style[h]=f[u]+i-3+"px",n.rightBar.style[d]=f[c]+f[g]/2-m/2+"px",n.rightBar.style[p]="5px",n.rightBar.style[g]=m+"px"},Smart.Chart.prototype._resizeState={},Smart.Chart.prototype._onSliderMouseDown=function(e){e.stopImmediatePropagation(),e.stopPropagation();const t=this;t._sliders[t._rangeSelectorEventData.groupIndex]&&(void 0!==t._resizeState.state&&null!==t._resizeState.state||t._testAndSetReadyResize(e),"ready"===t._resizeState.state&&(t._draggingRangeSelector=!0,t._resizeState.state="resizing"))},Smart.Chart.prototype._valueToOffset=function(e,t){const i=this.seriesGroups[e],r=this._sliders[e],s=r.host._renderData[0].xAxis.data.axisStats,o=s.min.valueOf();let a=s.max.valueOf()-o;0===a&&(a=1);const l=this._getXAxis(e),n="horizontal"===i.orientation?"height":"width",h=(t.valueOf()-o)/a;return r.getRect()[n]*(l.flip?1-h:h)},Smart.Chart.prototype._offsetToValue=function(e,t){const i=this._sliders[e],r=this.seriesGroups[e],s=this._getXAxis(e),o="horizontal"===r.orientation?"height":"width";let a=i.getRect()[o];0===a&&(a=1);const l=i.host._renderData[0].xAxis.data.axisStats,n=l.min.valueOf(),h=l.max.valueOf();let d=t/a*(h-n)+n;return!0===s.flip&&(d=h-t/a*(h-n)),this._isDate(l.min)||this._isDate(l.max)?d=new Date(d):((void 0===s.dataField||null===s.dataField||l.useIndeces)&&(d=Math.round(d)),d<l.min&&(d=l.min),d>l.max&&(d=l.max)),d},Smart.Chart.prototype._onSliderMouseUp=function(e){const t=this,i=t._rangeSelectorEventData.groupIndex,r=t._rangeSelectorEventData.swapXY,s=t._sliders[i];if(delete t._draggingRangeSelector,!s)return;if("resizing"!==t._resizeState.state)return;e.stopImmediatePropagation(),e.stopPropagation(),t._resizeState={},t.style.cursor="default";const o=r?"top":"left",a=r?"y":"x",l=s.element.getBoundingClientRect()[o],n=l+(r?s.element.offsetHeight:s.element.offsetWidth),h=s.getRect();let d=t._offsetToValue(i,l-h[a]),p=t._offsetToValue(i,n-h[a]);!s.host._renderData[0].xAxis.data.axisStats.isTimeUnit&&p.valueOf()-d.valueOf()>864e5&&(d.setHours(0,0,0,0),p.setDate(p.getDate()+1),p.setHours(0,0,0,0));const g=t._getXAxis(i);if(g.flip){const e=d;d=p,p=e}for(let e=0;e<t.seriesGroups.length;e++)t._getXAxis(e)===g&&(t._selectorRange[e]={min:d,max:p});t._isSelectorRefresh=!0;const u=t.animation;t.$.fireEvent("rangeSelectionChanging",{instance:t,minValue:d,maxValue:p}),t.animation="none",t.update(),t.animation=u,t.$.fireEvent("rangeSelectionChanged",{instance:t,minValue:d,maxValue:p}),"number"==typeof d?(s.leftBar.setAttribute("aria-valuenow",d),s.rightBar.setAttribute("aria-valuenow",p)):(s.leftBar.setAttribute("aria-valuenow",d.getTime()),s.leftBar.setAttribute("aria-valuetext",d.toLocaleString()),s.rightBar.setAttribute("aria-valuenow",p.getTime()),s.rightBar.setAttribute("aria-valuetext",p.toLocaleString()))},Smart.Chart.prototype._onSliderMouseMove=function(e){const t=this,i=t._rangeSelectorEventData.groupIndex,r=t._sliders[i],s=t._rangeSelectorEventData.swapXY;if(!r)return;const o=r.getRect(),a=r.element,l={left:e.clientX,top:e.clientY},n=a.getBoundingClientRect(),h=s?"top":"left",d=parseFloat(getComputedStyle(a)[h]),p=s?"height":"width",g=s?"y":"x";if("resizing"===t._resizeState.state){if(e.stopImmediatePropagation(),e.stopPropagation(),"left"===t._resizeState.side){let e=Math.round(l[h]-n[h]),t=o[g];if(n[h]+e>=t&&n[h]+e<=t+o[p]){let t=parseInt(d),i=Math.max(2,(s?a.offsetHeight:a.offsetWidth)-e);a.style[p]=i+"px",a.style[h]=t+e+"px"}}else if("right"===t._resizeState.side){let e=s?a.offsetHeight:a.offsetWidth,t=Math.round(l[h]-n[h]-e),i=o[g];if(n[h]+e+t>=i&&n[h]+t+e<=i+o[p]){let i=Math.max(2,e+t);a.style[p]=i+"px"}}else if("move"===t._resizeState.side){let e=s?a.offsetHeight:a.offsetWidth,i=parseInt(d),r=Math.round(l[h]-t._resizeState.startPos);n[h]+r>=o[g]&&n[h]+r+e<=o[g]+o[p]&&(t._resizeState.startPos=l[h],a.style[h]=i+r+"px")}const u=parseInt(d)-r.rect[g],c=u+(s?a.offsetHeight:a.offsetWidth);t._setSliderPositions(i,u,c)}else t._testAndSetReadyResize(e)},Smart.Chart.prototype._testAndSetReadyResize=function(e){const t=this,i=t._rangeSelectorEventData,r=i.renderTo,s=i.groupIndex,o=t._sliders[s],a=i.swapXY,l=o.getRect(),n=o.element,h={left:e.clientX,top:e.clientY},d=n.getBoundingClientRect(),p=a?"left":"top",g=a?"top":"left",u=a?"width":"height",c=t._isTouchDevice?30:5;h[p]>=d[p]&&h[p]<=d[p]+l[u]?Math.abs(h[g]-d[g])<=c?(r.style.cursor=a?"row-resize":"col-resize",t._resizeState={state:"ready",side:"left"}):Math.abs(h[g]-d[g]-(a?n.offsetHeight:n.offsetWidth))<=c?(r.style.cursor=a?"row-resize":"col-resize",t._resizeState={state:"ready",side:"right"}):h[g]+c>d[g]&&h[g]-c<d[g]+(a?n.offsetHeight:n.offsetWidth)?(r.style.cursor="pointer",t._resizeState={state:"ready",side:"move",startPos:h[g]}):(r.style.cursor="default",t._resizeState={}):(r.style.cursor="default",t._resizeState={})},Smart.Chart.prototype._selectorGetSize=function(e){return e.rangeSelector.renderTo?0:e.rangeSelector.size||this._paddedRect.height/3});
|
|
39
39
|
Smart.Chart&&(Smart.Chart.prototype._moduleWaterfall=!0,Smart.Chart.prototype._isSummary=function(t,e){const a=this.seriesGroups[t];for(let i=0;i<a.series.length;i++)if(void 0!==a.series[i].summary&&void 0!==this._getDataValue(e,a.series[i].summary,t))return!0;return!1},Smart.Chart.prototype._applyWaterfall=function(t,e,a,i,s,r,o,l,u){const f=this.seriesGroups[a];if(0===t.length)return t;let n=i;const N={},h=[];let m;const v=[];for(let t=0;t<f.series.length;t++)v.push(this._isSerieVisible(a,t));const c={};for(let f=0;f<e;f++){let e=i,p=0;const _=this._isSummary(a,f);for(let a=0;a<t.length;a++){if(!v[a])continue;let g=0;if(_){g=e===i?s:0,t[a][f].value=N[a],t[a][f].summary=!0,m=t[a][f].value<g,l&&(m=!m);let n=0;n=isNaN(r)?this._getDataPointOffsetDiff(t[a][f].value,g,g,NaN,o,i,l):this._getDataPointOffsetDiff(t[a][f].value+p,0===p?s:p,g||s,r,o,i,l),t[a][f].to=e+(m?n:-n),t[a][f].from=e,u&&(p+=t[a][f].value,e=t[a][f].to);continue}const y=u?-1:a;if(isNaN(t[a][f].value))continue;void 0===c[y]&&(g=s,c[y]=!0),m=t[a][f].value<g,l&&(m=!m);let D=NaN;D=u?n:0===f?i:t[a][h[a]].to;let S=0;S=isNaN(r)?this._getDataPointOffsetDiff(t[a][f].value,g,g,NaN,o,i,l):this._getDataPointOffsetDiff(t[a][f].value+(isNaN(N[y])?0:N[y]),isNaN(N[y])?s:N[y],g||s,r,o,D,l),t[a][f].to=n=D+(m?S:-S),t[a][f].from=D,isNaN(N[y])?N[y]=t[a][f].value:N[y]+=t[a][f].value,-1===y&&(isNaN(N[a])?N[a]=t[a][f].value:N[a]+=t[a][f].value),u||(h[a]=f)}}return t});
|
|
40
|
-
Smart("smart-drop-down-list",class extends Smart.ContentElement{static get properties(){return{autoCloseDelay:{value:100,type:"number"},dataSource:{value:null,type:"any",reflectToAttribute:!1},displayLoadingIndicator:{value:!1,type:"boolean"},displayMember:{value:"",type:"string"},displayMode:{allowedValues:["outlined","filled","underlined"],value:"outlined",type:"string"},dropDownAppendTo:{value:null,type:"any"},dropDownButtonPosition:{allowedValues:["none","left","right","top","bottom"],value:"right",defaultReflectToAttribute:!0,type:"string"},dropDownMinHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownMaxHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownOpenMode:{allowedValues:["none","default","dropDownButton","auto"],value:"default",type:"string"},dropDownOverlay:{value:!1,type:"boolean"},dropDownPlaceholder:{value:"No Items",type:"string"},dropDownPosition:{allowedValues:["auto","top","bottom","overlay-top","overlay-center","overlay-bottom","center-bottom","center-top"],value:"auto",type:"string"},dropDownMinWidth:{value:"",type:"any",validator:"_propertyValidator"},dropDownWidth:{value:"",type:"any",validator:"_propertyValidator"},dropDownMaxWidth:{value:"",type:"any",validator:"_propertyValidator"},filterable:{value:!1,type:"boolean"},filterInputPlaceholder:{value:"",type:"string"},filterCallback:{value:null,type:"function?"},filterMode:{value:"startsWithIgnoreCase",allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase","custom"],type:"string"},grouped:{value:!1,type:"boolean"},groupMember:{value:"",type:"string"},hint:{value:"",type:"string"},horizontalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},incrementalSearchDelay:{value:700,type:"number?"},incrementalSearchMode:{value:"startsWithIgnoreCase",allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string"},itemMeasureMode:{value:"auto",allowedValues:["auto","precise"],type:"string"},inputMember:{value:"label",type:"string"},itemTemplate:{value:null,type:"any"},itemHeight:{value:null,type:"number?"},label:{value:"",type:"string"},loadingIndicatorPlaceholder:{value:"Loading...",type:"string"},loadingIndicatorPosition:{value:"center",allowedValues:["bottom","center","top"],type:"string"},messages:{extend:!0,value:{en:{invalidNode:'{{elementType}}: Invalid parameter "{{node}}" when calling {{method}}.'}},type:"object"},name:{value:"",type:"string"},opened:{value:!1,type:"boolean"},placeholder:{value:"",type:"string"},resizeMode:{value:"none",allowedValues:["none","horizontal","vertical","both"],type:"string"},resizeIndicator:{value:!1,type:"boolean"},selectionDisplayMode:{value:"plain",allowedValues:["plain","placeholder","tokens"],type:"string"},selectionMode:{value:"zeroAndOne",allowedValues:["none","oneOrManyExtended","zeroOrMany","oneOrMany","zeroOrOne","zeroAndOne","one","checkBox","radioButton"],type:"string"},selectedIndexes:{value:[],type:"array"},selectedValues:{value:[],type:"array"},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},tokenTemplate:{value:null,type:"any"},type:{value:"list",type:"string",defaultReflectToAttribute:!0,readonly:!0},valueMember:{value:"",type:"string"},virtualized:{value:!1,type:"boolean"},verticalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]}}}static get listeners(){return{"actionButton.down":"_buttonsDownHandler","actionButton.mouseenter":"_buttonsMouseEventsHandler","actionButton.mouseleave":"_buttonsMouseEventsHandler","actionButton.focus":"_buttonsFocusHandler","actionButton.blur":"_buttonsFocusHandler","document.selectstart":"_selectStartHandler","document.dragstart":"_dragStartHandler","document.down":"_documentDownHandler","document.up":"_documentUpHandler","document.move":"_documentMoveHandler","dropDownButton.down":"_buttonsDownHandler","dropDownButton.mouseenter":"_buttonsMouseEventsHandler","dropDownButton.mouseleave":"_buttonsMouseEventsHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler",focus:"_focusEventHandler",blur:"_blurEventHandler","dropDownButton.focus":"_buttonsFocusHandler","dropDownButton.blur":"_buttonsFocusHandler","dropDownContainer.transitionend":"_dropDownTransitionendHandler","listBox.change":"_listBoxChangeHandler","listBox.itemClick":"_listBoxItemClickHandler","listBox.keydown":"_listBoxKeyDownHandler","listBox.bindingComplete":"_bindingCompleteHandler",mouseenter:"_mouseEnterHandler",mouseleave:"_mouseLeaveHandler",resize:"_resizeHandler","resizeBar.move":"_resizeBarMoveHandler",styleChanged:"_styleChangedHandler",wheel:"_mouseWheelHandler"}}template(){return'<div id="container" role="presentation">\n <span class="smart-label" id="label">[[label]]</span>\n <div id="content" class="smart-content" role="presentation">\n <div class="smart-buttons-container" id="buttonsContainer" role="presentation">\n <span id="actionButton" class ="smart-action-button" role="presentation">[[placeholder]]</span>\n <span id="dropDownButton" class="smart-drop-down-button">\n <span class ="smart-drop-down-button-icon" id="arrow" aria-hidden="true"></span>\n </span>\n </div>\n <div id="dropDownContainer" class="smart-drop-down smart-drop-down-container smart-visibility-hidden" role="presentation">\n <smart-list-box id="listBox" unfocusable\n animation="[[animation]]"\n data-source="[[dataSource]]"\n disabled="[[disabled]]"\n display-loading-indicator="[[displayLoadingIndicator]]"\n display-member="[[displayMember]]"\n filterable="[[filterable]]"\n filter-callback="[[filterCallback]]"\n filter-mode="[[filterMode]]"\n filter-input-placeholder="[[filterInputPlaceholder]]"\n grouped="[[grouped]]"\n group-member="[[groupMember]]"\n item-height="[[itemHeight]]"\n item-measure-mode="[[itemMeasureMode]]"\n item-template="[[itemTemplate]]"\n incremental-search-delay="[[incrementalSearchDelay]]"\n incremental-search-mode="[[incrementalSearchMode]]"\n loading-indicator-placeholder="[[loadingIndicatorPlaceholder]]"\n loading-indicator-position="[[loadingIndicatorPosition]]"\n name="[[name]]"\n placeholder="[[dropDownPlaceholder]]"\n right-to-left="[[rightToLeft]]"\n readonly="[[readonly]]"\n selected-indexes="{{selectedIndexes}}"\n selection-mode="[[selectionMode]]"\n selected-values="{{selectedValues}}"\n sorted="[[sorted]]"\n sort-direction="[[sortDirection]]"\n theme="[[theme]]"\n value-member="[[valueMember]]"\n horizontal-scroll-bar-visibility="[[horizontalScrollBarVisibility]]"\n vertical-scroll-bar-visibility="[[verticalScrollBarVisibility]]"\n virtualized="[[virtualized]]">\n <content></content>\n </smart-list-box>\n <div id="resizeBar" class="smart-drop-down-resize-bar" aria-label="Resize">\n <div></div>\n </div>\n </div>\n </div>\n <span class="smart-hint smart-hidden" id="hint">[[hint]]</span>\n </div>'}static get styleUrls(){return["smart.dropdownlist.css","smart.dropdown.css"]}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const n=this;switch(e){case"animation":n.$.dropDownContainer.setAttribute("animation",n.animation);break;case"disabled":n._setFocusable(),n.close(),n._positionDetection.handleAutoPositioning();break;case"dataSource":case"displayMember":case"inputMember":n.$.actionButton&&(n.$.actionButton.innerHTML=n.placeholder),n._setDropDownSize(),n._positionDetection.checkBrowserBounds("vertically"),n._positionDetection.positionDropDown(),n._positionDetection.checkBrowserBounds("horizontally");break;case"dropDownAppendTo":n._positionDetection.dropDownAppendToChangedHandler();break;case"dropDownOpenMode":n._setFocusable(),n.$dropDownContainer.addClass("smart-visibility-hidden"),n.$.dropDownContainer.setAttribute("drop-down-open-mode",o),n.$.dropDownButton.removeAttribute("selected"),n.removeAttribute("drop-down-button-focus"),n.removeAttribute("action-button-focus"),n.opened=!1,n._ariaButton&&n._ariaButton.setAttribute("aria-expanded",!1),n._setAriaRelations();break;case"dropDownOverlay":o||n._positionDetection.removeOverlay();break;case"dropDownPosition":n._positionDetection.dropDownPositionChangedHandler();break;case"dropDownMinWidth":case"dropDownWidth":case"dropDownMaxWidth":case"dropDownHeight":case"dropDownMinHeight":case"dropDownMaxHeight":n._setDropDownSize();break;case"filterable":n.$.listBox.filterable=o,n._dropDownSize&&"auto"===n._dropDownSize.height&&n._setDropDownSize();break;case"label":if(!n._ariaButton)return;o?n._ariaButton.setAttribute("aria-labelledby",n.$.label.id):"DropDownList"===n.elementName&&n._ariaButton.setAttribute("aria-labelledby",n.$.actionButton.id);break;case"opened":if(n.disabled||n.readonly)return;o?n.open():n.close();break;case"placeholder":n._applySelection();break;case"readonly":n.close();break;case"resizeIndicator":o?n.$.dropDownContainer.setAttribute("resize-indicator",""):n.$.dropDownContainer.removeAttribute("resize-indicator");break;case"resizeMode":n.$.dropDownContainer.setAttribute("resize-mode",n.resizeMode);break;case"selectedValues":case"selectedIndexes":0===o.length?n.$.actionButton.innerHTML=n.placeholder:n._applySelection();break;case"selectionMode":n.$.listBox&&(n.$.listBox[e]=o,"checkBox"!==o&&"radioButton"!==o&&"checkBox"!==t&&"radioButton"!==t||n._setDropDownSize());break;case"selectionDisplayMode":n._applySelection();break;case"tokenTemplate":n._tokenTemplate=n._validateTemplate(n.tokenTemplate),n._applySelection();break;case"unfocusable":n._setFocusable()}}_updateTargetValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const o=e.dataset.property,n=e.value;o&&void 0!==t[o]&&(t[o]=n)}}}appendChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e?(t.$.listBox.appendChild(e),t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize()):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"appendChild",node:"node"}))}attached(){const e=this;super.attached(),e.isCompleted&&e.$.dropDownContainer&&(e._positionDetection.dropDownAttached("_setDropDownSize"),e._positionDetection.checkBrowserBounds(),e.selectedIndexes&&e._applySelection())}detached(){const e=this;super.detached(),e.$.dropDownContainer&&(e.close(),e._positionDetection&&e._positionDetection.dropDownDetached())}clearItems(){const e=this;e.$.listBox&&(e.$.listBox.clearItems(),e.$.actionButton.innerHTML=e.placeholder)}clearSelection(){const e=this;e.$.listBox&&(e.$.listBox.clearSelection(),e.$.actionButton.innerHTML=e.placeholder)}close(){const e=this;e.$dropDownContainer.hasClass("smart-visibility-hidden")||e.$.fireEvent("closing").defaultPrevented||(e.$dropDownContainer.addClass("smart-visibility-hidden"),e.$.fireEvent("close"),e.$.dropDownButton&&e.$.dropDownButton.removeAttribute("selected"),e.opened=!1,e._ariaButton&&e._ariaButton.setAttribute("aria-expanded",!1),e._preventDropDownClose=!1,e._positionDetection.removeOverlay(!0),e.$.listBox.removeAttribute("focus"),e._edgeMacFF&&!e.hasAnimation&&e.$.dropDownContainer&&(e.$.dropDownContainer.style.top=e.$.dropDownContainer.style.left="",e.$dropDownContainer.addClass("not-in-view")))}cloneNode(){const e=this;if(!e.$.listBox)return;let t=HTMLElement.prototype.cloneNode.apply(e,Array.prototype.slice.call(arguments,0,1));return t.dataSource=e.dataSource,t}ensureVisible(e){this.$.listBox&&this.$.listBox.ensureVisible(e)}getItem(e){if(this.$.listBox)return this.$.listBox.getItem(e)}get items(){const e=this;return e.$&&e.$.listBox?e.$.listBox.items:[]}get _focusedItem(){const e=this;return e.$&&e.$.listBox?e.$.listBox._focusedItem:null}insert(e,t){const o=this;o.$.listBox&&(o.$.listBox.insert(e,t),o._applySelection(),o._dropDownSize&&"auto"===o._dropDownSize.height&&o._setDropDownSize())}insertBefore(e,t){const o=this;if(!o.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(o,e.concat(Array.prototype.slice.call(arguments)))}e&&t?o.$.listBox&&(o.$.listBox.insertBefore(e,t),o._dropDownSize&&"auto"===o._dropDownSize.height&&o._setDropDownSize()):o.error(o.localize("invalidNode",{elementType:o.nodeName.toLowerCase(),method:"insertBefore",node:"newNode/referenceNode"}))}toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this,t=function(){for(let t=0;t<e.items.length;t++)if(!e.items[t].disabled)return e.items[t]};if(!e.disabled&&e.offsetHeight&&e.$dropDownContainer.hasClass("smart-visibility-hidden")){if(e.$dropDownContainer.hasClass("not-in-view")&&e.$dropDownContainer.removeClass("not-in-view"),e.$.dropDownContainer.style.transition=null,e.dropDownAppendTo){const t=e.getBoundingClientRect();if(e.$.container.contains(e.$.dropDownContainer)){let t=0;const o=setInterval((function(){const n=e.getBoundingClientRect();t++,n.top===e._positionTop&&t<10||(e.open(),clearInterval(o),e._positionTop=n.top)}),100);return}t.top!==e._positionTop&&(e._positionTop=t.top)}e.$.fireEvent("opening").defaultPrevented||(e._shadowDOMStylesDelay&&(e._setDropDownSize(),delete e._shadowDOMStylesDelay),e.opened=!0,e._ariaButton&&e._ariaButton.setAttribute("aria-expanded",!0),e.$.listBox.setAttribute("focus",""),e._positionDetection.placeOverlay(),e._positionDetection.checkBrowserBounds("vertically"),e._positionDetection.positionDropDown(),e._positionDetection.checkBrowserBounds("horizontally"),e.$dropDownContainer.removeClass("smart-visibility-hidden"),e.$.fireEvent("open"),e.$.dropDownButton&&("dropDownButton"===e.dropDownOpenMode?e.$.dropDownButton.setAttribute("selected",""):e.$.dropDownButton.removeAttribute("selected")),(e.$.listBox&&!e._focusedItem||e._focusedItem&&!e._focusedItem._focused)&&(e.selectedIndexes.length>0?e._focus(e.items[e.selectedIndexes[0]]):e._focus(t)),e.$.input&&!Smart.Utilities.Core.isMobile&&e.$.input.focus())}}ready(){super.ready()}render(){const e=this;e.rightToLeft&&(e.dropDownButtonPosition="right"===e.dropDownButtonPosition?"left":"right"),e.classList.add("smart-drop-down-box"),e.$.dropDownContainer&&(e._positionDetection=new Smart.Utilities.PositionDetection(e,e.$.dropDownContainer,e.$.container,"close"),e._positionDetection.getDropDownParent(!0),e._positionDetection.setDropDownPosition(),e._calculateDropDownSize(),e.$.dropDownContainer.setAttribute("resize-mode",e.resizeMode),e.$.dropDownContainer.setAttribute("drop-down-open-mode",e.dropDownOpenMode),e.resizeIndicator&&e.$.dropDownContainer.setAttribute("resize-indicator",""),e._positionDetection.handleAutoPositioning()),e.opened&&e.open(),e._positionTop=e.getBoundingClientRect().top,e._edgeMacFF=Smart.Utilities.Core.Browser.Edge||Smart.Utilities.Core.Browser.Firefox&&-1!==navigator.platform.toLowerCase().indexOf("mac"),e._edgeMacFF&&e.hasAnimation&&e.$.dropDownContainer&&e.$dropDownContainer.addClass("not-in-view"),e.$.label&&!e.$.label.id&&(e.$.label.id=e.id+"Label"),e.$.actionButton&&!e.$.actionButton.id&&(e.$.actionButton.id=e.id+"ActionButton"),e.$.hint&&!e.$.hint.id&&(e.$.hint.id=e.id+"Hint"),e._createElement(),super.render()}removeAt(e){const t=this;t.$.listBox&&(t.$.listBox.removeAt(e),t._applySelection(),t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize())}removeChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e&&e instanceof Smart.ListItem?(t.$.listBox.removeChild(e),t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize()):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"removeChild",node:"node"}))}get value(){const e=this;return e.isRendered&&e.$.listBox?e.$.listBox.value:null}set value(e){const t=this;return t.isRendered&&t.$.listBox?void(t.$.listBox.value=e):null}select(e){this.$.listBox&&this.$.listBox.select(e)}_setFocusable(){const e=this;if(e.disabled||e.unfocusable)return e.removeAttribute("tabindex"),e.$.actionButton.removeAttribute("tabindex"),void e.$.dropDownButton.removeAttribute("tabindex");let t=e.tabIndex>0?e.tabIndex:0;e.tabIndex=t,"dropDownButton"===e.dropDownOpenMode?(e.removeAttribute("tabindex"),e.$.actionButton.setAttribute("tabindex",t),e.$.dropDownButton.setAttribute("tabindex",t)):(e.$.actionButton.removeAttribute("tabindex"),e.$.dropDownButton.removeAttribute("tabindex"))}static get requires(){return{"Smart.ListBox":"smart.listbox.js"}}unselect(e){this.$.listBox&&this.$.listBox.unselect(e)}update(e,t){const o=this;o.$.listBox&&(o.$.listBox.update(e,t),o._applySelection())}_resizeBarMoveHandler(e){"touchmove"===e.originalEvent.type&&e.originalEvent.preventDefault()}_createToken(){const e=this;let t,o=!1;const n=document.createDocumentFragment(),i=e.selectedIndexes[e.selectedIndexes.length-1];"plain"!==e.selectionDisplayMode||"one"!==e.selectionMode&&"zeroAndOne"!==e.selectionMode&&"zeroOrOne"!==e.selectionMode&&"radioButton"!==e.selectionMode?"tokens"===e.selectionDisplayMode?1===e.selectedIndexes.length&&["oneOrManyExtended","oneOrMany","zeroAndOne","one","radioButton"].indexOf(e.selectionMode)>-1?t="":(t="✖",o=!0):t=1===e.selectedIndexes.length?"":",":t="";const r=e.selectedIndexes,a=e.$.listBox._items;for(let s=0;s<r.length;s++){const l=r[s];a[l]&&n.appendChild(e._applyTokenTemplate(a[l][e.inputMember],"tokens"!==e.selectionDisplayMode&&l===i?"":t,o))}return n}_applySelection(){const e=this;if("placeholder"!==e.selectionDisplayMode&&0!==e.selectedIndexes.length){if(e.$.listBox._items&&0!==e.$.listBox._items.length)if("plain"!==e.selectionDisplayMode)e.$.actionButton.innerHTML="",e.$.actionButton.appendChild(e._createToken());else{const t=e.$.listBox.selectedIndexes,o=e.$.listBox._items;let n=[];for(let i=0;i<t.length;i++){const r=t[i];o[r]&&n.push(o[r][e.inputMember])}e.$.actionButton.innerHTML=n.length?`<span class="smart-token">${n.join(", ").trim()}</span>`:""}}else e.$.actionButton.innerHTML=e.placeholder}_applyTokenTemplate(e,t,o){const n=this,i=document.createElement("span"),r=function(){return"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+e+`</span><span class='smart-drop-down-list-unselect-button' role="button"${o?' aria-label="Unselect"':""}>${t}</span>`};if(i.classList.add("smart-token"),n._tokenTemplate){let e=document.importNode(n._tokenTemplate.content,!0);const t=e.childNodes.length,o=/{{\w+}}/g;let a;for(let n=0;n<t;n++)a=o.exec(e.childNodes[n].innerHTML),a&&(e.childNodes[n].innerHTML=e.childNodes[n].innerHTML.replace(a[0],r())),e.childNodes[n].outerHTML&&(i.innerHTML+=e.childNodes[n].outerHTML)}else"function"==typeof n.tokenTemplate?n.tokenTemplate(i,{label:e,iconSeparator:t}):i.innerHTML=r();return i}_bindingCompleteHandler(){const e=this;e.$.listBox&&requestAnimationFrame((()=>{e._setDropDownSize(),e._positionDetection.checkBrowserBounds()}))}_buttonsDownHandler(e){const t=this;if(!t.disabled){if(t.hasRippleAnimation)if(t.$.buttonsContainer&&"dropDownButton"!==t.dropDownOpenMode){const o=t.$.buttonsContainer;o.firstElementChild.noRipple=!0,Smart.Utilities.Animation.Ripple.animate(o,e.pageX,e.pageY),o.firstElementChild.noRipple=!1}else Smart.Utilities.Animation.Ripple.animate(e.target,e.pageX,e.pageY);t._preventsSelectStart=!0,t.tagName.toLowerCase().indexOf("smart-drop-down-")>-1&&"dropDownButton"===t.dropDownOpenMode&&e.target===t.$.actionButton&&t.$.actionButton.setAttribute("active",""),t.opened&&(t._preventDropDownClose=!0)}}_buttonsMouseEventsHandler(e){const t=this;t.disabled||("mouseenter"===e.type?(t.setAttribute("hover",""),e.target.setAttribute("hover",""),"dropDownButton"===t.dropDownOpenMode&&e.target===t.$.dropDownButton&&t.setAttribute("drop-down-button-hover","")):(t.removeAttribute("hover"),t.removeAttribute("drop-down-button-hover"),e.target.removeAttribute("hover")))}_calculateDropDownSize(){const e=this;e._dropDownSize={};const t=window.getComputedStyle(e.$.dropDownContainer),o=parseFloat(t.getPropertyValue("border-top-width").trim()),n=parseFloat(t.getPropertyValue("border-bottom-width").trim()),i=parseFloat(t.getPropertyValue("margin-top").trim()),r=parseFloat(t.getPropertyValue("margin-bottom").trim()),a=parseFloat(t.getPropertyValue("padding-top").trim()),s=parseFloat(t.getPropertyValue("padding-bottom").trim());Smart.Utilities.Core.CSSVariablesSupport()&&(e._dropDownSize.width=t.getPropertyValue("--smart-drop-down-list-drop-down-width").trim(),e._dropDownSize.height=t.getPropertyValue("--smart-drop-down-list-drop-down-height").trim()),(!e._dropDownSize.width||e._dropDownSize.width.indexOf("initial")>-1)&&(e._dropDownSize.width=e.offsetWidth),e._dropDownSize.height||(e._dropDownSize.height="auto"),e._dropDownSize.minHeight=parseFloat(t.getPropertyValue("min-height").trim()),e._dropDownSize.maxHeight=parseFloat(t.getPropertyValue("max-height").trim()),e._dropDownSize.borderWidth=(isNaN(o)?0:o)+(isNaN(n)?0:n),e._dropDownSize.paddingWidth=(isNaN(a)?0:a)+(isNaN(s)?0:s),e._dropDownSize.marginWidth=(isNaN(i)?0:i)+(isNaN(r)?0:r)}_createElement(){const e=this;e._tokenTemplate=e._validateTemplate(e.tokenTemplate),e._applySelection(),e._setDropDownSize(),e._setFocusable(),e.$.arrow.noRipple=!0,e._shadowDOMStylesDelay=e.shadowRoot,e._setAriaRelations(!0)}_documentDownHandler(e){const t=this;if(t.disabled||t.readonly)return;let o=e.originalEvent.target;if(o===t._overlay&&(t._overlayDown=!0),t.shadowRoot){o=e.originalEvent.composedPath()[0];let n=o.getRootNode().host;for(;n;)n.closest(".smart-drop-down-container")===t.$.dropDownContainer&&(t._isDropDownClicked=!0),n=n.getRootNode().host}else t.isInShadowDOM&&(o=e.originalEvent.composedPath()[0]),t._isDropDownClicked=o.closest(".smart-drop-down-container")===t.$.dropDownContainer;if(t._buttonClicked=o.closest(".smart-action-button")||o.closest(".smart-drop-down-button"),t.$.listBox){let n=o.closest("smart-list-item");t.$.listBox.contains(n)||(n=void 0),t.hasRippleAnimation&&n&&Smart.Utilities.Animation.Ripple.animate(n,e.pageX,e.pageY),(n||o===t.$.listBox.$.filterInput||o.closest(".smart-token"))&&(t._preventDropDownClose=!0)}if(t._isDropDownClicked&&(t._preventDropDownClose=!0),o!==t.$.resizeBar||"none"===t.resizeMode)return;t._resizeDetails||(t._resizeDetails={});const n=t.$.dropDownContainer.getBoundingClientRect();t._resizeDetails.started=!0,t._resizeDetails.x=e.pageX,t._resizeDetails.y=e.pageY,t._resizeDetails.width=t.$.dropDownContainer.offsetWidth,t._resizeDetails.height=t.$.dropDownContainer.offsetHeight,t._resizeDetails.offsetXL=e.clientX-n.left,t._resizeDetails.offsetXR=n.left+t.$.dropDownContainer.offsetWidth-e.clientX,t._resizeDetails.offsetY=n.top+t.$.dropDownContainer.offsetHeight-e.clientY,t._resizeDetails.offsetYtop=e.clientY-n.top,t._preventDropDownClose=!0}_documentMoveHandler(e){const t=this,o=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if("auto"===t.dropDownOpenMode&&null!==t.dropDownAppendTo&&(t.contains(o)||t.$.dropDownContainer.contains(o)?t._isElementHovered=!0:(t._isElementHovered=!1,t._autoClose())),!t._resizeDetails||t._resizeDetails&&!t._resizeDetails.started)return;t.setAttribute("resizing",""),t._resizeDetails.resizeEventFired||(t.$.fireEvent("resizeStart",{position:{left:e.pageX,top:e.pageY}}),t._resizeDetails.resizeEventFired=!0);const n=document.documentElement,i=t.$.dropDownContainer.getBoundingClientRect(),r=t.getBoundingClientRect(),a=t.$.dropDownContainer.hasAttribute("top")?"top":"bottom";let s;function l(){if(s=e.pageY-t._resizeDetails.y,"bottom"===a)t._resizeDetails.height=Math.min(n.clientHeight-i.top-6,Math.max(0,t._resizeDetails.height+s)),t._resizeDetails.y=Math.max(i.top+n.scrollTop-t._resizeDetails.offsetY,Math.min(n.clientHeight+n.scrollTop-1.5*t._resizeDetails.offsetY,e.pageY));else{if(t._resizeDetails.height=Math.min(t._dropDownSize.maxHeight,Math.max(0,Math.min(r.top,t._resizeDetails.height-s))),s=Math.max(0,i.top+(i.height-Math.max(t._dropDownSize.minHeight,t._resizeDetails.height))),t.dropDownAppendTo){const e=Math.abs(parseFloat(getComputedStyle(t.$.dropDownContainer).getPropertyValue("margin-bottom")))||0;t.$.dropDownContainer.style.top=t.dropDownAppendTo?e+s+"px":""}const o=r.top+n.scrollTop+t._resizeDetails.offsetYtop;t._resizeDetails.y=Math.max(t._resizeDetails.offsetYtop,Math.min(o,Math.max(o-t._dropDownSize.maxHeight,e.pageY)))}t.$.dropDownContainer.style.height=t._resizeDetails.height+"px"}function d(){s=e.pageX-t._resizeDetails.x,t._resizeDetails.width=Math.min(n.clientWidth-i.left-6,Math.max(0,t._resizeDetails.width+s)),t.$.dropDownContainer.style.width=t._resizeDetails.width+"px",t._resizeDetails.x=Math.max(i.left+n.scrollLeft-t._resizeDetails.offsetXR,Math.min(n.clientWidth+n.scrollLeft-1.5*t._resizeDetails.offsetXR,e.pageX))}switch(t.resizeMode){case"vertical":l();break;case"horizontal":d();break;case"both":d(),l()}}_documentUpHandler(e){const t=this;if(t.$.actionButton.removeAttribute("active"),t._resizeDetails&&t._resizeDetails.started)return t._resizeDetails.started=t._resizeDetails.resizeEventFired=!1,t.removeAttribute("resizing"),t._preventDropDownClose=!1,t.focus(),void t.$.fireEvent("resizeEnd",{position:{left:e.pageX,top:e.pageY}});if(t.disabled||t._isDropDownClicked||t.readonly)return void delete t._isDropDownClicked;if(t._overlayDown)return t.close(),void delete t._overlayDown;let o=e.originalEvent.target,n=o.closest?o.closest("smart-drop-down-list"):void 0;if((t.enableShadowDOM||t.isInShadowDOM)&&(o=e.originalEvent.composedPath()[0],n=o.getRootNode().host),t._preventsSelectStart=!1,void 0===o||o===t.$.resizeBar)return;if("tokens"===t.selectionDisplayMode&&o.classList.contains("smart-drop-down-list-selection-label")&&n===t){"none"!==t.dropDownOpenMode&&t.open();let e=t.$.listBox._items.filter((e=>e[t.inputMember].toString()===o.textContent))[0];return t.$.listBox._scrollView.scrollTop=e.offsetTop,void t._focus(e)}if("tokens"===t.selectionDisplayMode&&o.classList.contains("smart-drop-down-list-unselect-button")&&n===t){if(1===t.selectedIndexes.length&&["zeroOrMany","zeroOrOne","checkBox"].indexOf(t.selectionMode)<0)return;return void t.unselect(t.$.listBox._items.filter((e=>e[t.inputMember].toString()===o.previousElementSibling.textContent))[0])}const i=o.closest(".smart-action-button");let r;if(t._buttonClicked&&("dropDownButton"===t.dropDownOpenMode&&i&&t._buttonClicked===t.$.actionButton?t.$.fireEvent("actionButtonClick"):o.closest(".smart-drop-down-button")!==t._buttonClicked&&i!==t._buttonClicked||(r=!0,t.$.fireEvent("dropDownButtonClick"))),t._buttonClicked=void 0,i===t.$.actionButton||o.closest(".smart-drop-down-button")===t.$.dropDownButton)return"dropDownButton"===t.dropDownOpenMode&&i===t.$.actionButton?void t.close():void(t.$dropDownContainer.hasClass("smart-visibility-hidden")&&"none"!==t.dropDownOpenMode&&r&&"pointercancel"!==e.originalEvent.type?t.open():t.close());o=t._getUpEventTarget(o),void 0!==o&&("dropDownContainer"!==o&&"item"!==o||"item"===o&&"checkBox"!==t.selectionMode&&t.selectionMode.indexOf("Many")<0)&&t.close()}_dragStartHandler(e){this._resizeDetails&&this._resizeDetails.started&&e.preventDefault()}_dropDownTransitionendHandler(){const e=this;e._edgeMacFF&&!e.opened&&e.hasAnimation&&(e.$.dropDownContainer.style.top=e.$.dropDownContainer.style.left="",e.$dropDownContainer.addClass("not-in-view"))}_focus(e){this.$.listBox._focus(e)}_blurEventHandler(){const e=this;e.$.dropDownButton&&(e.removeAttribute("focus"),e.$.dropDownButton.removeAttribute("focus")),e.$.actionButton&&(e.removeAttribute("focus"),e.$.actionButton.removeAttribute("focus")),e.nodeName&&"smart-drop-down-list"===e.nodeName.toLowerCase()&&!e._preventDropDownClose&&e.close()}_focusEventHandler(){const e=this;e.$.dropDownButton&&(e.setAttribute("focus",""),e.$.dropDownButton.setAttribute("focus","")),e.$.actionButton&&(e.setAttribute("focus",""),e.$.actionButton.setAttribute("focus","")),e.removeAttribute("drop-down-button-focus"),e.removeAttribute("action-button-focus")}_buttonsFocusHandler(e){const t=this;e.target===t.$.dropDownButton?"focus"===e.type?t.setAttribute("drop-down-button-focus",""):(t.removeAttribute("drop-down-button-focus"),t.nodeName&&"smart-drop-down-list"===t.nodeName.toLowerCase()&&!t._preventDropDownClose&&t.close()):"focus"===e.type?t.setAttribute("action-button-focus",""):t.removeAttribute("action-button-focus")}_getUpEventTarget(e){const t=this;let o=e;for(o=void 0===o.parentElement?o.getRootNode().host:o.parentElement;o;){if(o===t.$.dropDownContainer){o="dropDownContainer";break}o=void 0===o.parentElement?o.getRootNode().host:o.parentElement}return o}_keyDownHandler(e){const t=this,o=t.enableShadowDOM&&t.shadowRoot.activeElement||document.activeElement,n=t.enableShadowDOM?e.composedPath()[0]:e.target;if(!(t.$.listBox&&n===t.$.listBox.$.filterInput||o!==t&&o!==t.$.dropDownButton&&o!==t.$.actionButton))switch(e.key){case"Enter":case" ":e.preventDefault(),n!==t.$.actionButton&&(t._keyPressed=!0,t.opened?(t._focusedItem&&t.select(t._focusedItem),("Enter"===e.key&&["none"].indexOf(t.selectionMode)<0||" "===e.key&&["none","zeroAndOne","one","radioButton"].indexOf(t.selectionMode)>-1)&&t.close()):t.opened||t.readonly||"none"===t.dropDownOpenMode||t.open()),"dropDownButton"===t.dropDownOpenMode&&n.setAttribute("active","");break;case"End":case"Home":case"PageUp":case"PageDown":case"ArrowUp":case"ArrowDown":if(t.readonly)return;if(e.altKey)return t._keyPressed=!1,void(t.$dropDownContainer.hasClass("smart-visibility-hidden")?t.open():t.close());e.preventDefault(),t.$.listBox._handleKeyStrokes(e.key);break;case"Escape":e.preventDefault(),t.close();break;default:if(t.readonly)return;"oneOrManyExtended"===t.selectionMode&&(t.$.listBox._keysPressed[e.key]=!0),t.$.listBox._applyIncrementalSearch(e.key)}}_keyUpHandler(e){const t=this,o=t.enableShadowDOM?e.composedPath()[0]:e.target;t.$.listBox&&o===t.$.listBox.$.filterInput||("Enter"!==e.key&&" "!==e.key||(o.removeAttribute("active"),t.$dropDownContainer.hasClass("smart-visibility-hidden")||(t._keyPressed=!1)),t.$.listBox&&"oneOrManyExtended"===t.selectionMode&&(t.$.listBox._keysPressed[e.key]=!1))}_listBoxChangeHandler(e){const t=this;if(e.target===t.$.listBox){if((t.dropDownAppendTo||t.enableShadowDOM)&&t.$.fireEvent("change",e.detail),"list"===t.autoComplete&&e.detail){const o=t.$.listBox._items[e.detail.index];t._lastSelectedItem=o&&o.selected?o:void 0}t._applySelection(t.selectionMode,e.detail),t._updateTargetValue()}else e.stopPropagation()}_listBoxItemClickHandler(e){const t=this;(t.dropDownAppendTo||t.enableShadowDOM)&&t.$.fireEvent(e.type,e.detail),"checkBox"!==t.selectionMode&&t.selectionMode.indexOf("Many")<0&&t.close(),Smart.Utilities.Core.isMobile||t.focus(),delete t._isDropDownClicked}_listBoxKeyDownHandler(e){const t=this;if("Enter"===e.key)return t.close(),"dropDownButton"===t.dropDownOpenMode?t.$.dropDownButton.focus():t.focus(),void e.stopPropagation();"Escape"!==e.key||t.close()}_mouseEnterHandler(){const e=this;e._isElementHovered=!0,e.tagName.toLowerCase().indexOf("smart-drop-down-")>-1&&"auto"===e.dropDownOpenMode&&!e.disabled&&!e.readonly&&e.open()}_mouseLeaveHandler(){const e=this;e.removeAttribute("hover"),e._isElementHovered=!1,"auto"!==e.dropDownOpenMode||e.disabled||e.readonly||e._autoClose()}_mouseWheelHandler(e){const t=this;t.disabled||t.readonly||t.items&&0===t.items.length||t.$dropDownContainer&&!t.$dropDownContainer.hasClass("smart-visibility-hidden")||t.$.listBox&&(e.preventDefault(),t.$.listBox._handleKeyStrokes(e.deltaY>0?"ArrowDown":"ArrowUp"))}_autoClose(){const e=this;e._autoCloseTimeout=setTimeout(function(){e._isElementHovered||e.close(),clearTimeout(e._autoCloseTimeout)}.bind(e),e.autoCloseDelay)}_propertyValidator(e,t){return"number"!=typeof t&&"string"!=typeof t?e:t}_resizeHandler(){this.refresh()}refresh(){const e=this;"none"===e.resizeMode&&(e._calculateDropDownSize(),e._setDropDownSize())}_selectStartHandler(e){this._preventsSelectStart&&e.preventDefault()}_setAriaRelations(e){const t=this;let o,n;"dropDownButton"!==t.dropDownOpenMode?(o=t.$.dropDownButton,o.setAttribute("aria-hidden",!0),n=t,t.$.actionButton.removeAttribute("role")):(o=t,n=t.$.dropDownButton,n.removeAttribute("aria-hidden"),t.$.actionButton.setAttribute("role","button")),t._ariaButton=n,n.setAttribute("role","button"),n.setAttribute("aria-haspopup","listbox"),n.setAttribute("aria-owns",t.$.listBox.id),n.setAttribute("aria-describedby",t.$.hint.id),t.label?n.setAttribute("aria-labelledby",t.$.label.id):"DropDownList"===t.elementName&&n.setAttribute("aria-labelledby",t.$.actionButton.id),o.setAttribute("role","presentation"),o.removeAttribute("aria-owns"),e?n.setAttribute("aria-expanded",t.opened):(o.removeAttribute("aria-describedby"),o.removeAttribute("aria-expanded"),o.removeAttribute("aria-haspopup"),o.removeAttribute("aria-labelledby"))}_setDropDownSize(){const e=this,t=e.$.listBox;let o;if(e._dropDownSize||e._calculateDropDownSize(),["dropDownMinWidth","dropDownMaxWidth"].forEach((t=>{e.$.dropDownContainer.style[t.replace("dropDown","").replace(/^./,"m")]="initial"===e[t]?e.offsetWidth+"px":e[t]?parseFloat(e[t])+(e[t].toString().endsWith("%")?"%":"px"):null})),["dropDownMinHeight","dropDownMaxHeight"].forEach((t=>{e.$.dropDownContainer.style[t.replace("dropDown","").replace(/^./,"m")]=e[t]?parseFloat(e[t])+(e[t].toString().endsWith("%")?"%":"px"):null})),e.dropDownWidth?"auto"!==e.dropDownWidth?e.$.dropDownContainer.style.width=("initial"===e.dropDownWidth?e.offsetWidth:parseFloat(e.dropDownWidth))+"px":e.$.dropDownContainer.style.width="auto":e.$.dropDownContainer.style.width="auto"===e._dropDownSize.width?"auto":(parseFloat(e._dropDownSize.width)||0)+"px",e.dropDownHeight&&"auto"!==e.dropDownHeight)e.$.dropDownContainer.style.height=parseFloat(e.dropDownHeight)+((e.dropDownHeight+"").indexOf("%")>-1?"%":"px");else if(!e.$.listBox||"auto"!==e._dropDownSize.height&&"auto"!==e.dropDownHeight)e.$.dropDownContainer.style.height=e._dropDownSize.height;else{e.$.dropDownContainer.style.height="";let n=0;if(t.$.itemsContainer&&(n=2*parseInt(window.getComputedStyle(t.$.itemsContainer).getPropertyValue("--smart-list-item-vertical-offset"))),isNaN(n)&&(n=6),o=n,t.items&&t.items.length>0?t.items.map((e=>o+=e.height||e.offsetHeight)):o=t.$.placeholder?t.$.placeholder.offsetHeight:200,e.filterable){const e=t.$.filterInputContainer;o+=e.offsetHeight+e.offsetTop}o=o+e._dropDownSize.paddingWidth+e._dropDownSize.borderWidth,e.$.dropDownContainer.style.height=o+"px"}if(t){if(void 0===o||!t.$)return void t._refreshLayout();const n=t.$.horizontalScrollBar?t.$.horizontalScrollBar.offsetHeight:0,i=Math.max(0,e._dropDownSize.minHeight-(o-n));i&&(e.$.dropDownContainer.style.height=o+i+"px"),!e.opened&&e.virtualized&&t.refresh()}}_styleChangedHandler(e){const t=this;if(t.dropDownAppendTo){const o=e.detail.styleProperties,n=["font-size","font-family","font-style","font-weight"];for(let e=0;e<n.length;e++)o[n[e]]&&(t.$.dropDownContainer.style[n[e]]=o[n[e]].value)}"auto"===t._dropDownSize.height&&t._setDropDownSize()}_validateTemplate(e){const t=this;if(e&&"function"!=typeof e)if("content"in document.createElement("template")){if(e instanceof HTMLTemplateElement||(e=document.getElementById(e)),null!==e&&"content"in e)return e;t.error(t.localize("invalidTemplate",{elementType:t.nodeName.toLowerCase(),property:"tokenTemplate"}))}else t.error(t.localize("htmlTemplateNotSuported",{elementType:t.nodeName.toLowerCase()}))}});
|
|
40
|
+
Smart("smart-drop-down-list",class extends Smart.ContentElement{static get properties(){return{autoCloseDelay:{value:100,type:"number"},dataSource:{value:null,type:"any",reflectToAttribute:!1},displayLoadingIndicator:{value:!1,type:"boolean"},displayMember:{value:"",type:"string"},displayMode:{allowedValues:["outlined","filled","underlined"],value:"outlined",type:"string"},dropDownAppendTo:{value:null,type:"any"},dropDownButtonPosition:{allowedValues:["none","left","right","top","bottom"],value:"right",defaultReflectToAttribute:!0,type:"string"},dropDownMinHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownMaxHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownOpenMode:{allowedValues:["none","default","dropDownButton","auto"],value:"default",type:"string"},dropDownOverlay:{value:!1,type:"boolean"},dropDownPlaceholder:{value:"No Items",type:"string"},dropDownPosition:{allowedValues:["auto","top","bottom","overlay-top","overlay-center","overlay-bottom","center-bottom","center-top"],value:"auto",type:"string"},dropDownMinWidth:{value:"",type:"any",validator:"_propertyValidator"},dropDownWidth:{value:"",type:"any",validator:"_propertyValidator"},dropDownMaxWidth:{value:"",type:"any",validator:"_propertyValidator"},filterable:{value:!1,type:"boolean"},filterInputPlaceholder:{value:"",type:"string"},filterCallback:{value:null,type:"function?"},filterMode:{value:"startsWithIgnoreCase",allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase","custom"],type:"string"},grouped:{value:!1,type:"boolean"},groupMember:{value:"",type:"string"},hint:{value:"",type:"string"},horizontalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},incrementalSearchDelay:{value:700,type:"number?"},incrementalSearchMode:{value:"startsWithIgnoreCase",allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string"},itemMeasureMode:{value:"auto",allowedValues:["auto","precise"],type:"string"},inputMember:{value:"label",type:"string"},itemTemplate:{value:null,type:"any"},itemHeight:{value:null,type:"number?"},label:{value:"",type:"string"},loadingIndicatorPlaceholder:{value:"Loading...",type:"string"},loadingIndicatorPosition:{value:"center",allowedValues:["bottom","center","top"],type:"string"},messages:{extend:!0,value:{en:{invalidNode:'{{elementType}}: Invalid parameter "{{node}}" when calling {{method}}.'}},type:"object"},name:{value:"",type:"string"},opened:{value:!1,type:"boolean"},placeholder:{value:"",type:"string"},resizeMode:{value:"none",allowedValues:["none","horizontal","vertical","both"],type:"string"},resizeIndicator:{value:!1,type:"boolean"},selectionDisplayMode:{value:"plain",allowedValues:["plain","placeholder","tokens"],type:"string"},selectionMode:{value:"zeroAndOne",allowedValues:["none","oneOrManyExtended","zeroOrMany","oneOrMany","zeroOrOne","zeroAndOne","one","checkBox","radioButton"],type:"string"},selectedIndexes:{value:[],type:"array"},selectedValues:{value:[],type:"array"},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},tokenTemplate:{value:null,type:"any"},type:{value:"list",type:"string",defaultReflectToAttribute:!0,readonly:!0},valueMember:{value:"",type:"string"},virtualized:{value:!1,type:"boolean"},verticalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]}}}static get listeners(){return{"actionButton.down":"_buttonsDownHandler","actionButton.mouseenter":"_buttonsMouseEventsHandler","actionButton.mouseleave":"_buttonsMouseEventsHandler","actionButton.focus":"_buttonsFocusHandler","actionButton.blur":"_buttonsFocusHandler","document.selectstart":"_selectStartHandler","document.dragstart":"_dragStartHandler","document.down":"_documentDownHandler","document.up":"_documentUpHandler","document.move":"_documentMoveHandler","dropDownButton.down":"_buttonsDownHandler","dropDownButton.mouseenter":"_buttonsMouseEventsHandler","dropDownButton.mouseleave":"_buttonsMouseEventsHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler",focus:"_focusEventHandler",blur:"_blurEventHandler","dropDownButton.focus":"_buttonsFocusHandler","dropDownButton.blur":"_buttonsFocusHandler","dropDownContainer.transitionend":"_dropDownTransitionendHandler","listBox.change":"_listBoxChangeHandler","listBox.itemClick":"_listBoxItemClickHandler","listBox.keydown":"_listBoxKeyDownHandler","listBox.bindingComplete":"_bindingCompleteHandler",mouseenter:"_mouseEnterHandler",mouseleave:"_mouseLeaveHandler",resize:"_resizeHandler","resizeBar.move":"_resizeBarMoveHandler",styleChanged:"_styleChangedHandler",wheel:"_mouseWheelHandler"}}template(){return'<div id="container" role="presentation">\n <span class="smart-label" id="label">[[label]]</span>\n <div id="content" class="smart-content" role="presentation">\n <div class="smart-buttons-container" id="buttonsContainer" role="presentation">\n <span id="actionButton" class ="smart-action-button" role="presentation">[[placeholder]]</span>\n <span id="dropDownButton" class="smart-drop-down-button">\n <span class ="smart-drop-down-button-icon" id="arrow" aria-hidden="true"></span>\n </span>\n </div>\n <div id="dropDownContainer" class="smart-drop-down smart-drop-down-container smart-visibility-hidden" role="presentation">\n <smart-list-box id="listBox" unfocusable\n animation="[[animation]]"\n data-source="[[dataSource]]"\n disabled="[[disabled]]"\n display-loading-indicator="[[displayLoadingIndicator]]"\n display-member="[[displayMember]]"\n filterable="[[filterable]]"\n filter-callback="[[filterCallback]]"\n filter-mode="[[filterMode]]"\n filter-input-placeholder="[[filterInputPlaceholder]]"\n grouped="[[grouped]]"\n group-member="[[groupMember]]"\n item-height="[[itemHeight]]"\n item-measure-mode="[[itemMeasureMode]]"\n item-template="[[itemTemplate]]"\n incremental-search-delay="[[incrementalSearchDelay]]"\n incremental-search-mode="[[incrementalSearchMode]]"\n loading-indicator-placeholder="[[loadingIndicatorPlaceholder]]"\n loading-indicator-position="[[loadingIndicatorPosition]]"\n name="[[name]]"\n placeholder="[[dropDownPlaceholder]]"\n right-to-left="[[rightToLeft]]"\n readonly="[[readonly]]"\n selected-indexes="{{selectedIndexes}}"\n selection-mode="[[selectionMode]]"\n selected-values="{{selectedValues}}"\n sorted="[[sorted]]"\n sort-direction="[[sortDirection]]"\n theme="[[theme]]"\n value-member="[[valueMember]]"\n horizontal-scroll-bar-visibility="[[horizontalScrollBarVisibility]]"\n vertical-scroll-bar-visibility="[[verticalScrollBarVisibility]]"\n virtualized="[[virtualized]]">\n <content></content>\n </smart-list-box>\n <div id="resizeBar" class="smart-drop-down-resize-bar" aria-label="Resize">\n <div></div>\n </div>\n </div>\n </div>\n <span class="smart-hint smart-hidden" id="hint">[[hint]]</span>\n </div>'}static get styleUrls(){return["smart.dropdownlist.css","smart.dropdown.css"]}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const n=this;switch(e){case"animation":n.$.dropDownContainer.setAttribute("animation",n.animation);break;case"disabled":n._setFocusable(),n.close(),n._positionDetection.handleAutoPositioning();break;case"dataSource":case"displayMember":case"inputMember":n.$.actionButton&&(n.$.actionButton.innerHTML=n.placeholder),n._setDropDownSize(),n._positionDetection.checkBrowserBounds("vertically"),n._positionDetection.positionDropDown(),n._positionDetection.checkBrowserBounds("horizontally");break;case"dropDownAppendTo":n._positionDetection.dropDownAppendToChangedHandler();break;case"dropDownOpenMode":n._setFocusable(),n.$dropDownContainer.addClass("smart-visibility-hidden"),n.$.dropDownContainer.setAttribute("drop-down-open-mode",o),n.$.dropDownButton.removeAttribute("selected"),n.removeAttribute("drop-down-button-focus"),n.removeAttribute("action-button-focus"),n.opened=!1,n._ariaButton&&n._ariaButton.setAttribute("aria-expanded",!1),n._setAriaRelations();break;case"dropDownOverlay":o||n._positionDetection.removeOverlay();break;case"dropDownPosition":n._positionDetection.dropDownPositionChangedHandler();break;case"dropDownMinWidth":case"dropDownWidth":case"dropDownMaxWidth":case"dropDownHeight":case"dropDownMinHeight":case"dropDownMaxHeight":n._setDropDownSize();break;case"filterable":n.$.listBox.filterable=o,n._dropDownSize&&"auto"===n._dropDownSize.height&&n._setDropDownSize();break;case"label":if(!n._ariaButton)return;o?n._ariaButton.setAttribute("aria-labelledby",n.$.label.id):"DropDownList"===n.elementName&&n._ariaButton.setAttribute("aria-labelledby",n.$.actionButton.id);break;case"opened":if(n.disabled||n.readonly)return;o?n.open():n.close();break;case"placeholder":n._applySelection();break;case"readonly":n.close();break;case"resizeIndicator":o?n.$.dropDownContainer.setAttribute("resize-indicator",""):n.$.dropDownContainer.removeAttribute("resize-indicator");break;case"resizeMode":n.$.dropDownContainer.setAttribute("resize-mode",n.resizeMode);break;case"selectedValues":case"selectedIndexes":0===o.length?n.$.actionButton.innerHTML=n.placeholder:n._applySelection();break;case"selectionMode":n.$.listBox&&(n.$.listBox[e]=o,"checkBox"!==o&&"radioButton"!==o&&"checkBox"!==t&&"radioButton"!==t||n._setDropDownSize());break;case"selectionDisplayMode":n._applySelection();break;case"tokenTemplate":n._tokenTemplate=n._validateTemplate(n.tokenTemplate),n._applySelection();break;case"unfocusable":n._setFocusable()}}_updateTargetValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const o=e.dataset.property,n=e.value;o&&void 0!==t[o]&&(t[o]=n)}}}appendChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e?(t.$.listBox.appendChild(e),t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize()):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"appendChild",node:"node"}))}attached(){const e=this;super.attached(),e.isCompleted&&e.$.dropDownContainer&&(e._positionDetection.dropDownAttached("_setDropDownSize"),e._positionDetection.checkBrowserBounds(),e.selectedIndexes&&e._applySelection())}detached(){const e=this;super.detached(),e.$.dropDownContainer&&(e.close(),e._positionDetection&&e._positionDetection.dropDownDetached())}clearItems(){const e=this;e.$.listBox&&(e.$.listBox.clearItems(),e.$.actionButton.innerHTML=e.placeholder)}clearSelection(){const e=this;e.$.listBox&&(e.$.listBox.clearSelection(),e.$.actionButton.innerHTML=e.placeholder)}close(){const e=this;e.$dropDownContainer.hasClass("smart-visibility-hidden")||e.$.fireEvent("closing").defaultPrevented||(e.$dropDownContainer.addClass("smart-visibility-hidden"),e.$.fireEvent("close"),e.$.dropDownButton&&e.$.dropDownButton.removeAttribute("selected"),e.opened=!1,e._ariaButton&&e._ariaButton.setAttribute("aria-expanded",!1),e._preventDropDownClose=!1,e._positionDetection.removeOverlay(!0),e.$.listBox.removeAttribute("focus"),e._edgeMacFF&&!e.hasAnimation&&e.$.dropDownContainer&&(e.$.dropDownContainer.style.top=e.$.dropDownContainer.style.left="",e.$dropDownContainer.addClass("not-in-view")))}cloneNode(){const e=this;if(!e.$.listBox)return;let t=HTMLElement.prototype.cloneNode.apply(e,Array.prototype.slice.call(arguments,0,1));return t.dataSource=e.dataSource,t}ensureVisible(e){this.$.listBox&&this.$.listBox.ensureVisible(e)}getItem(e){if(this.$.listBox)return this.$.listBox.getItem(e)}get items(){const e=this;return e.$&&e.$.listBox?e.$.listBox.items:[]}get _focusedItem(){const e=this;return e.$&&e.$.listBox?e.$.listBox._focusedItem:null}insert(e,t){const o=this;o.$.listBox&&(o.$.listBox.insert(e,t),o._applySelection(),o._dropDownSize&&"auto"===o._dropDownSize.height&&o._setDropDownSize())}insertBefore(e,t){const o=this;if(!o.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(o,e.concat(Array.prototype.slice.call(arguments)))}e&&t?o.$.listBox&&(o.$.listBox.insertBefore(e,t),o._dropDownSize&&"auto"===o._dropDownSize.height&&o._setDropDownSize()):o.error(o.localize("invalidNode",{elementType:o.nodeName.toLowerCase(),method:"insertBefore",node:"newNode/referenceNode"}))}toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this,t=function(){for(let t=0;t<e.items.length;t++)if(!e.items[t].disabled)return e.items[t]};if(!e.disabled&&e.offsetHeight&&e.$dropDownContainer.hasClass("smart-visibility-hidden")){if(e.$dropDownContainer.hasClass("not-in-view")&&e.$dropDownContainer.removeClass("not-in-view"),e.$.dropDownContainer.style.transition=null,e.dropDownAppendTo){const t=e.getBoundingClientRect();if(e.$.container.contains(e.$.dropDownContainer)){let t=0;const o=setInterval((function(){const n=e.getBoundingClientRect();t++,n.top===e._positionTop&&t<10||(e.open(),clearInterval(o),e._positionTop=n.top)}),100);return}t.top!==e._positionTop&&(e._positionTop=t.top)}e.$.fireEvent("opening").defaultPrevented||(e._shadowDOMStylesDelay&&(e._setDropDownSize(),delete e._shadowDOMStylesDelay),e.opened=!0,e._ariaButton&&e._ariaButton.setAttribute("aria-expanded",!0),e.$.listBox.setAttribute("focus",""),e._positionDetection.placeOverlay(),e._positionDetection.checkBrowserBounds("vertically"),e._positionDetection.positionDropDown(),e._positionDetection.checkBrowserBounds("horizontally"),e.$dropDownContainer.removeClass("smart-visibility-hidden"),e.$.fireEvent("open"),e.$.dropDownButton&&("dropDownButton"===e.dropDownOpenMode?e.$.dropDownButton.setAttribute("selected",""):e.$.dropDownButton.removeAttribute("selected")),(e.$.listBox&&!e._focusedItem||e._focusedItem&&!e._focusedItem._focused)&&(e.selectedIndexes.length>0?e._focus(e.items[e.selectedIndexes[0]]):e._focus(t)),e.$.input&&!Smart.Utilities.Core.isMobile&&e.$.input.focus())}}ready(){super.ready()}render(){const e=this;e.rightToLeft&&(e.dropDownButtonPosition="right"===e.dropDownButtonPosition?"left":"right"),e.classList.add("smart-drop-down-box"),e.$.dropDownContainer&&(e._positionDetection=new Smart.Utilities.PositionDetection(e,e.$.dropDownContainer,e.$.container,"close"),e._positionDetection.getDropDownParent(!0),e._positionDetection.setDropDownPosition(),e._calculateDropDownSize(),e.$.dropDownContainer.setAttribute("resize-mode",e.resizeMode),e.$.dropDownContainer.setAttribute("drop-down-open-mode",e.dropDownOpenMode),e.resizeIndicator&&e.$.dropDownContainer.setAttribute("resize-indicator",""),e._positionDetection.handleAutoPositioning()),e.opened&&e.open(),e._positionTop=e.getBoundingClientRect().top,e._edgeMacFF=Smart.Utilities.Core.Browser.Edge||Smart.Utilities.Core.Browser.Firefox&&-1!==navigator.platform.toLowerCase().indexOf("mac"),e._edgeMacFF&&e.hasAnimation&&e.$.dropDownContainer&&e.$dropDownContainer.addClass("not-in-view"),e.$.label&&!e.$.label.id&&(e.$.label.id=e.id+"Label"),e.$.actionButton&&!e.$.actionButton.id&&(e.$.actionButton.id=e.id+"ActionButton"),e.$.hint&&!e.$.hint.id&&(e.$.hint.id=e.id+"Hint"),e._createElement(),super.render()}removeAt(e){const t=this;t.$.listBox&&(t.$.listBox.removeAt(e),t._applySelection(),t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize())}removeChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e&&e instanceof Smart.ListItem?(t.$.listBox.removeChild(e),t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize()):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"removeChild",node:"node"}))}get value(){const e=this;return e.isRendered&&e.$.listBox?e.$.listBox.value:null}set value(e){const t=this;return t.isRendered&&t.$.listBox?void(t.$.listBox.value=e):null}select(e){this.$.listBox&&this.$.listBox.select(e)}_setFocusable(){const e=this;if(e.disabled||e.unfocusable)return e.removeAttribute("tabindex"),e.$.actionButton.removeAttribute("tabindex"),void e.$.dropDownButton.removeAttribute("tabindex");let t=e.tabIndex>0?e.tabIndex:0;e.tabIndex=t,"dropDownButton"===e.dropDownOpenMode?(e.removeAttribute("tabindex"),e.$.actionButton.setAttribute("tabindex",t),e.$.dropDownButton.setAttribute("tabindex",t)):(e.$.actionButton.removeAttribute("tabindex"),e.$.dropDownButton.removeAttribute("tabindex"))}static get requires(){return{"Smart.ListBox":"smart.listbox.js"}}unselect(e){this.$.listBox&&this.$.listBox.unselect(e)}update(e,t){const o=this;o.$.listBox&&(o.$.listBox.update(e,t),o._applySelection())}_resizeBarMoveHandler(e){"touchmove"===e.originalEvent.type&&e.originalEvent.preventDefault()}_createToken(){const e=this;let t,o=!1;const n=document.createDocumentFragment(),i=e.selectedIndexes[e.selectedIndexes.length-1];"plain"!==e.selectionDisplayMode||"one"!==e.selectionMode&&"zeroAndOne"!==e.selectionMode&&"zeroOrOne"!==e.selectionMode&&"radioButton"!==e.selectionMode?"tokens"===e.selectionDisplayMode?1===e.selectedIndexes.length&&["oneOrManyExtended","oneOrMany","zeroAndOne","one","radioButton"].indexOf(e.selectionMode)>-1?t="":(t="✖",o=!0):t=1===e.selectedIndexes.length?"":",":t="";const r=e.selectedIndexes,a=e.$.listBox._items;for(let s=0;s<r.length;s++){const l=r[s];a[l]&&n.appendChild(e._applyTokenTemplate(a[l][e.inputMember],"tokens"!==e.selectionDisplayMode&&l===i?"":t,o))}return n}_applySelection(){const e=this;if("placeholder"!==e.selectionDisplayMode&&0!==e.selectedIndexes.length){if(e.$.listBox._items&&0!==e.$.listBox._items.length)if("plain"!==e.selectionDisplayMode)e.$.actionButton.innerHTML="",e.$.actionButton.appendChild(e._createToken());else{const t=e.$.listBox.selectedIndexes,o=e.$.listBox._items;let n=[];for(let i=0;i<t.length;i++){const r=t[i];o[r]&&n.push(o[r][e.inputMember])}e.$.actionButton.innerHTML=n.length?`<span class="smart-token">${n.join(", ").trim()}</span>`:""}}else e.$.actionButton.innerHTML=e.placeholder}_applyTokenTemplate(e,t,o){const n=this,i=document.createElement("span"),r=function(){return"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+e+`</span><span class='smart-drop-down-list-unselect-button' role="button"${o?' aria-label="Unselect"':""}>${t}</span>`};if(i.classList.add("smart-token"),n._tokenTemplate){let e=document.importNode(n._tokenTemplate.content,!0);const t=e.childNodes.length,o=/{{\w+}}/g;let a;for(let n=0;n<t;n++)a=o.exec(e.childNodes[n].innerHTML),a&&(e.childNodes[n].innerHTML=e.childNodes[n].innerHTML.replace(a[0],r())),e.childNodes[n].outerHTML&&(i.innerHTML+=e.childNodes[n].outerHTML)}else"function"==typeof n.tokenTemplate?n.tokenTemplate(i,{label:e,iconSeparator:t}):i.innerHTML=r();return i}_bindingCompleteHandler(){const e=this;e.$.listBox&&requestAnimationFrame((()=>{e._setDropDownSize(),e._positionDetection.checkBrowserBounds()}))}_buttonsDownHandler(e){const t=this;if(!t.disabled){if(t.hasRippleAnimation)if(t.$.buttonsContainer&&"dropDownButton"!==t.dropDownOpenMode){const o=t.$.buttonsContainer;o.firstElementChild.noRipple=!0,Smart.Utilities.Animation.Ripple.animate(o,e.pageX,e.pageY),o.firstElementChild.noRipple=!1}else Smart.Utilities.Animation.Ripple.animate(e.target,e.pageX,e.pageY);t._preventsSelectStart=!0,t.tagName.toLowerCase().indexOf("smart-drop-down-")>-1&&"dropDownButton"===t.dropDownOpenMode&&e.target===t.$.actionButton&&t.$.actionButton.setAttribute("active",""),t.opened&&(t._preventDropDownClose=!0)}}_buttonsMouseEventsHandler(e){const t=this;t.disabled||("mouseenter"===e.type?(t.setAttribute("hover",""),e.target.setAttribute("hover",""),"dropDownButton"===t.dropDownOpenMode&&e.target===t.$.dropDownButton&&t.setAttribute("drop-down-button-hover","")):(t.removeAttribute("hover"),t.removeAttribute("drop-down-button-hover"),e.target.removeAttribute("hover")))}_calculateDropDownSize(){const e=this;e._dropDownSize={};const t=window.getComputedStyle(e.$.dropDownContainer),o=parseFloat(t.getPropertyValue("border-top-width").trim()),n=parseFloat(t.getPropertyValue("border-bottom-width").trim()),i=parseFloat(t.getPropertyValue("margin-top").trim()),r=parseFloat(t.getPropertyValue("margin-bottom").trim()),a=parseFloat(t.getPropertyValue("padding-top").trim()),s=parseFloat(t.getPropertyValue("padding-bottom").trim());Smart.Utilities.Core.CSSVariablesSupport()&&(e._dropDownSize.width=t.getPropertyValue("--smart-drop-down-list-drop-down-width").trim(),e._dropDownSize.height=t.getPropertyValue("--smart-drop-down-list-drop-down-height").trim()),(!e._dropDownSize.width||e._dropDownSize.width.indexOf("initial")>-1)&&(e._dropDownSize.width=e.offsetWidth),e._dropDownSize.height||(e._dropDownSize.height="auto"),e._dropDownSize.minHeight=parseFloat(t.getPropertyValue("min-height").trim()),e._dropDownSize.maxHeight=parseFloat(t.getPropertyValue("max-height").trim()),e._dropDownSize.borderWidth=(isNaN(o)?0:o)+(isNaN(n)?0:n),e._dropDownSize.paddingWidth=(isNaN(a)?0:a)+(isNaN(s)?0:s),e._dropDownSize.marginWidth=(isNaN(i)?0:i)+(isNaN(r)?0:r)}_createElement(){const e=this;e._tokenTemplate=e._validateTemplate(e.tokenTemplate),e._applySelection(),e._setDropDownSize(),e._setFocusable(),e.$.arrow.noRipple=!0,e._shadowDOMStylesDelay=e.shadowRoot,e._setAriaRelations(!0)}_documentDownHandler(e){const t=this;if(t.disabled||t.readonly)return;let o=e.originalEvent.target;if(o===t._overlay&&(t._overlayDown=!0),t.shadowRoot){o=e.originalEvent.composedPath()[0];let n=o.getRootNode().host;for(;n;)n.closest(".smart-drop-down-container")===t.$.dropDownContainer&&(t._isDropDownClicked=!0),n=n.getRootNode().host}else t.isInShadowDOM&&(o=e.originalEvent.composedPath()[0]),t._isDropDownClicked=o.closest(".smart-drop-down-container")===t.$.dropDownContainer;if(t._buttonClicked=o.closest(".smart-action-button")||o.closest(".smart-drop-down-button"),t.$.listBox){let n=o.closest("smart-list-item");t.$.listBox.contains(n)||(n=void 0),t.hasRippleAnimation&&n&&Smart.Utilities.Animation.Ripple.animate(n,e.pageX,e.pageY),(n||o===t.$.listBox.$.filterInput||o.closest(".smart-token"))&&(t._preventDropDownClose=!0)}if(t._isDropDownClicked&&(t._preventDropDownClose=!0),o!==t.$.resizeBar||"none"===t.resizeMode)return;t._resizeDetails||(t._resizeDetails={});const n=t.$.dropDownContainer.getBoundingClientRect();t._resizeDetails.started=!0,t._resizeDetails.x=e.pageX,t._resizeDetails.y=e.pageY,t._resizeDetails.width=t.$.dropDownContainer.offsetWidth,t._resizeDetails.height=t.$.dropDownContainer.offsetHeight,t._resizeDetails.offsetXL=e.clientX-n.left,t._resizeDetails.offsetXR=n.left+t.$.dropDownContainer.offsetWidth-e.clientX,t._resizeDetails.offsetY=n.top+t.$.dropDownContainer.offsetHeight-e.clientY,t._resizeDetails.offsetYtop=e.clientY-n.top,t._preventDropDownClose=!0}_documentMoveHandler(e){const t=this,o=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if("auto"===t.dropDownOpenMode&&null!==t.dropDownAppendTo&&(t.contains(o)||t.$.dropDownContainer.contains(o)?t._isElementHovered=!0:(t._isElementHovered=!1,t._autoClose())),!t._resizeDetails||t._resizeDetails&&!t._resizeDetails.started)return;t.setAttribute("resizing",""),t._resizeDetails.resizeEventFired||(t.$.fireEvent("resizeStart",{position:{left:e.pageX,top:e.pageY}}),t._resizeDetails.resizeEventFired=!0);const n=document.documentElement,i=t.$.dropDownContainer.getBoundingClientRect(),r=t.getBoundingClientRect(),a=t.$.dropDownContainer.hasAttribute("top")?"top":"bottom";let s;function l(){if(s=e.pageY-t._resizeDetails.y,"bottom"===a)t._resizeDetails.height=Math.min(n.clientHeight-i.top-6,Math.max(0,t._resizeDetails.height+s)),t._resizeDetails.y=Math.max(i.top+n.scrollTop-t._resizeDetails.offsetY,Math.min(n.clientHeight+n.scrollTop-1.5*t._resizeDetails.offsetY,e.pageY));else{if(t._resizeDetails.height=Math.min(t._dropDownSize.maxHeight,Math.max(0,Math.min(r.top,t._resizeDetails.height-s))),s=Math.max(0,i.top+(i.height-Math.max(t._dropDownSize.minHeight,t._resizeDetails.height))),t.dropDownAppendTo){const e=Math.abs(parseFloat(getComputedStyle(t.$.dropDownContainer).getPropertyValue("margin-bottom")))||0;t.$.dropDownContainer.style.top=t.dropDownAppendTo?e+s+"px":""}const o=r.top+n.scrollTop+t._resizeDetails.offsetYtop;t._resizeDetails.y=Math.max(t._resizeDetails.offsetYtop,Math.min(o,Math.max(o-t._dropDownSize.maxHeight,e.pageY)))}t.$.dropDownContainer.style.height=t._resizeDetails.height+"px"}function d(){s=e.pageX-t._resizeDetails.x,t._resizeDetails.width=Math.min(n.clientWidth-i.left-6,Math.max(0,t._resizeDetails.width+s)),t.$.dropDownContainer.style.width=t._resizeDetails.width+"px",t._resizeDetails.x=Math.max(i.left+n.scrollLeft-t._resizeDetails.offsetXR,Math.min(n.clientWidth+n.scrollLeft-1.5*t._resizeDetails.offsetXR,e.pageX))}switch(t.resizeMode){case"vertical":l();break;case"horizontal":d();break;case"both":d(),l()}}_documentUpHandler(e){const t=this;if(t.$.actionButton.removeAttribute("active"),t._resizeDetails&&t._resizeDetails.started)return t._resizeDetails.started=t._resizeDetails.resizeEventFired=!1,t.removeAttribute("resizing"),t._preventDropDownClose=!1,t.focus(),void t.$.fireEvent("resizeEnd",{position:{left:e.pageX,top:e.pageY}});if(t.disabled||t._isDropDownClicked||t.readonly)return void delete t._isDropDownClicked;if(t._overlayDown)return t.close(),void delete t._overlayDown;let o=e.originalEvent.target,n=o.closest?o.closest("smart-drop-down-list"):void 0;if((t.enableShadowDOM||t.isInShadowDOM)&&(o=e.originalEvent.composedPath()[0],n=o.getRootNode().host),t._preventsSelectStart=!1,void 0===o||o===t.$.resizeBar)return;if("tokens"===t.selectionDisplayMode&&o.classList.contains("smart-drop-down-list-selection-label")&&n===t){"none"!==t.dropDownOpenMode&&t.open();let e=t.$.listBox._items.filter((e=>e[t.inputMember].toString()===o.textContent))[0];return t.$.listBox._scrollView.scrollTop=e.offsetTop,void t._focus(e)}if("tokens"===t.selectionDisplayMode&&o.classList.contains("smart-drop-down-list-unselect-button")&&n===t){if(1===t.selectedIndexes.length&&["zeroOrMany","zeroOrOne","checkBox"].indexOf(t.selectionMode)<0)return;return void t.unselect(t.$.listBox._items.filter((e=>e[t.inputMember].toString()===o.previousElementSibling.textContent))[0])}const i=o.closest(".smart-action-button");let r;if(t._buttonClicked&&("dropDownButton"===t.dropDownOpenMode&&i&&t._buttonClicked===t.$.actionButton?t.$.fireEvent("actionButtonClick"):o.closest(".smart-drop-down-button")!==t._buttonClicked&&i!==t._buttonClicked||(r=!0,t.$.fireEvent("dropDownButtonClick"))),t._buttonClicked=void 0,i===t.$.actionButton||o.closest(".smart-drop-down-button")===t.$.dropDownButton)return"dropDownButton"===t.dropDownOpenMode&&i===t.$.actionButton?void t.close():void(t.$dropDownContainer.hasClass("smart-visibility-hidden")&&"none"!==t.dropDownOpenMode&&r&&"pointercancel"!==e.originalEvent.type?t.open():t.close());o=t._getUpEventTarget(o),void 0!==o&&("dropDownContainer"!==o&&"item"!==o||"item"===o&&"checkBox"!==t.selectionMode&&t.selectionMode.indexOf("Many")<0)&&t.close()}_dragStartHandler(e){this._resizeDetails&&this._resizeDetails.started&&e.preventDefault()}_dropDownTransitionendHandler(){const e=this;e._edgeMacFF&&!e.opened&&e.hasAnimation&&(e.$.dropDownContainer.style.top=e.$.dropDownContainer.style.left="",e.$dropDownContainer.addClass("not-in-view"))}_focus(e){this.$.listBox._focus(e)}_blurEventHandler(){const e=this;e.$.dropDownButton&&(e.removeAttribute("focus"),e.$.dropDownButton.removeAttribute("focus")),e.$.actionButton&&(e.removeAttribute("focus"),e.$.actionButton.removeAttribute("focus")),e.nodeName&&"smart-drop-down-list"===e.nodeName.toLowerCase()&&!e._preventDropDownClose&&e.close()}_focusEventHandler(){const e=this;e.$.dropDownButton&&(e.setAttribute("focus",""),e.$.dropDownButton.setAttribute("focus","")),e.$.actionButton&&(e.setAttribute("focus",""),e.$.actionButton.setAttribute("focus","")),e.removeAttribute("drop-down-button-focus"),e.removeAttribute("action-button-focus")}_buttonsFocusHandler(e){const t=this;e.target===t.$.dropDownButton?"focus"===e.type?t.setAttribute("drop-down-button-focus",""):(t.removeAttribute("drop-down-button-focus"),t.nodeName&&"smart-drop-down-list"===t.nodeName.toLowerCase()&&!t._preventDropDownClose&&t.close()):"focus"===e.type?t.setAttribute("action-button-focus",""):t.removeAttribute("action-button-focus")}_getUpEventTarget(e){const t=this;let o=e;for(o=void 0===o.parentElement?o.getRootNode().host:o.parentElement;o;){if(o===t.$.dropDownContainer){o="dropDownContainer";break}o=void 0===o.parentElement?o.getRootNode().host:o.parentElement}return o}_keyDownHandler(e){const t=this,o=t.enableShadowDOM&&t.shadowRoot.activeElement||document.activeElement,n=t.enableShadowDOM?e.composedPath()[0]:e.target;if(!(t.$.listBox&&n===t.$.listBox.$.filterInput||o!==t&&o!==t.$.dropDownButton&&o!==t.$.actionButton)||"Tab"===e.key)switch(e.key){case"Tab":if(t.filterable&&t.opened){const o=function(){for(let e=0;e<t.items.length;e++)if(!t.items[e].disabled)return t.items[e]};t.$.listBox.$.filterInput&&!Smart.Utilities.Core.isMobile&&document.activeElement!==t.$.listBox.$.filterInput?(t.$.listBox.$.filterInput.focus(),t._preventDropDownClose=!0):t.$.listBox&&(t.focus(),t.selectedIndexes.length>0?t._focus(t.items[t.selectedIndexes[0]]):t._focus(o),t._preventDropDownClose=!0),e.preventDefault()}break;case"Enter":case" ":e.preventDefault(),n!==t.$.actionButton&&(t._keyPressed=!0,t.opened?(t._focusedItem&&t.select(t._focusedItem),("Enter"===e.key&&["none"].indexOf(t.selectionMode)<0||" "===e.key&&["none","zeroAndOne","one","radioButton"].indexOf(t.selectionMode)>-1)&&t.close()):t.opened||t.readonly||"none"===t.dropDownOpenMode||t.open()),"dropDownButton"===t.dropDownOpenMode&&n.setAttribute("active","");break;case"End":case"Home":case"PageUp":case"PageDown":case"ArrowUp":case"ArrowDown":if(t.readonly)return;if(e.altKey)return t._keyPressed=!1,void(t.$dropDownContainer.hasClass("smart-visibility-hidden")?t.open():t.close());e.preventDefault(),t.$.listBox._handleKeyStrokes(e.key);break;case"Escape":e.preventDefault(),t.close();break;default:if(t.readonly)return;"oneOrManyExtended"===t.selectionMode&&(t.$.listBox._keysPressed[e.key]=!0),t.$.listBox._applyIncrementalSearch(e.key)}}_keyUpHandler(e){const t=this,o=t.enableShadowDOM?e.composedPath()[0]:e.target;t.$.listBox&&o===t.$.listBox.$.filterInput||("Enter"!==e.key&&" "!==e.key||(o.removeAttribute("active"),t.$dropDownContainer.hasClass("smart-visibility-hidden")||(t._keyPressed=!1)),t.$.listBox&&"oneOrManyExtended"===t.selectionMode&&(t.$.listBox._keysPressed[e.key]=!1))}_listBoxChangeHandler(e){const t=this;if(e.target===t.$.listBox){if((t.dropDownAppendTo||t.enableShadowDOM)&&t.$.fireEvent("change",e.detail),"list"===t.autoComplete&&e.detail){const o=t.$.listBox._items[e.detail.index];t._lastSelectedItem=o&&o.selected?o:void 0}t._applySelection(t.selectionMode,e.detail),t._updateTargetValue()}else e.stopPropagation()}_listBoxItemClickHandler(e){const t=this;(t.dropDownAppendTo||t.enableShadowDOM)&&t.$.fireEvent(e.type,e.detail),"checkBox"!==t.selectionMode&&t.selectionMode.indexOf("Many")<0&&t.close(),Smart.Utilities.Core.isMobile||t.focus(),delete t._isDropDownClicked}_listBoxKeyDownHandler(e){const t=this;if("Enter"===e.key)return t.close(),"dropDownButton"===t.dropDownOpenMode?t.$.dropDownButton.focus():t.focus(),void e.stopPropagation();"Escape"!==e.key||t.close()}_mouseEnterHandler(){const e=this;e._isElementHovered=!0,e.tagName.toLowerCase().indexOf("smart-drop-down-")>-1&&"auto"===e.dropDownOpenMode&&!e.disabled&&!e.readonly&&e.open()}_mouseLeaveHandler(){const e=this;e.removeAttribute("hover"),e._isElementHovered=!1,"auto"!==e.dropDownOpenMode||e.disabled||e.readonly||e._autoClose()}_mouseWheelHandler(e){const t=this;t.disabled||t.readonly||t.items&&0===t.items.length||t.$dropDownContainer&&!t.$dropDownContainer.hasClass("smart-visibility-hidden")||t.$.listBox&&(e.preventDefault(),t.$.listBox._handleKeyStrokes(e.deltaY>0?"ArrowDown":"ArrowUp"))}_autoClose(){const e=this;e._autoCloseTimeout=setTimeout(function(){e._isElementHovered||e.close(),clearTimeout(e._autoCloseTimeout)}.bind(e),e.autoCloseDelay)}_propertyValidator(e,t){return"number"!=typeof t&&"string"!=typeof t?e:t}_resizeHandler(){this.refresh()}refresh(){const e=this;"none"===e.resizeMode&&(e._calculateDropDownSize(),e._setDropDownSize())}_selectStartHandler(e){this._preventsSelectStart&&e.preventDefault()}_setAriaRelations(e){const t=this;let o,n;"dropDownButton"!==t.dropDownOpenMode?(o=t.$.dropDownButton,o.setAttribute("aria-hidden",!0),n=t,t.$.actionButton.removeAttribute("role")):(o=t,n=t.$.dropDownButton,n.removeAttribute("aria-hidden"),t.$.actionButton.setAttribute("role","button")),t._ariaButton=n,n.setAttribute("role","button"),n.setAttribute("aria-haspopup","listbox"),n.setAttribute("aria-owns",t.$.listBox.id),n.setAttribute("aria-describedby",t.$.hint.id),t.label?n.setAttribute("aria-labelledby",t.$.label.id):"DropDownList"===t.elementName&&n.setAttribute("aria-labelledby",t.$.actionButton.id),o.setAttribute("role","presentation"),o.removeAttribute("aria-owns"),e?n.setAttribute("aria-expanded",t.opened):(o.removeAttribute("aria-describedby"),o.removeAttribute("aria-expanded"),o.removeAttribute("aria-haspopup"),o.removeAttribute("aria-labelledby"))}_setDropDownSize(){const e=this,t=e.$.listBox;let o;if(e._dropDownSize||e._calculateDropDownSize(),["dropDownMinWidth","dropDownMaxWidth"].forEach((t=>{e.$.dropDownContainer.style[t.replace("dropDown","").replace(/^./,"m")]="initial"===e[t]?e.offsetWidth+"px":e[t]?parseFloat(e[t])+(e[t].toString().endsWith("%")?"%":"px"):null})),["dropDownMinHeight","dropDownMaxHeight"].forEach((t=>{e.$.dropDownContainer.style[t.replace("dropDown","").replace(/^./,"m")]=e[t]?parseFloat(e[t])+(e[t].toString().endsWith("%")?"%":"px"):null})),e.dropDownWidth?"auto"!==e.dropDownWidth?e.$.dropDownContainer.style.width=("initial"===e.dropDownWidth?e.offsetWidth:parseFloat(e.dropDownWidth))+"px":e.$.dropDownContainer.style.width="auto":e.$.dropDownContainer.style.width="auto"===e._dropDownSize.width?"auto":(parseFloat(e._dropDownSize.width)||0)+"px",e.dropDownHeight&&"auto"!==e.dropDownHeight)e.$.dropDownContainer.style.height=parseFloat(e.dropDownHeight)+((e.dropDownHeight+"").indexOf("%")>-1?"%":"px");else if(!e.$.listBox||"auto"!==e._dropDownSize.height&&"auto"!==e.dropDownHeight)e.$.dropDownContainer.style.height=e._dropDownSize.height;else{e.$.dropDownContainer.style.height="";let n=0;if(t.$.itemsContainer&&(n=2*parseInt(window.getComputedStyle(t.$.itemsContainer).getPropertyValue("--smart-list-item-vertical-offset"))),isNaN(n)&&(n=6),o=n,t.items&&t.items.length>0?t.items.map((e=>o+=e.height||e.offsetHeight)):o=t.$.placeholder?t.$.placeholder.offsetHeight:200,e.filterable){const e=t.$.filterInputContainer;o+=e.offsetHeight+e.offsetTop}o=o+e._dropDownSize.paddingWidth+e._dropDownSize.borderWidth,e.$.dropDownContainer.style.height=o+"px"}if(t){if(void 0===o||!t.$)return void t._refreshLayout();const n=t.$.horizontalScrollBar?t.$.horizontalScrollBar.offsetHeight:0,i=Math.max(0,e._dropDownSize.minHeight-(o-n));i&&(e.$.dropDownContainer.style.height=o+i+"px"),!e.opened&&e.virtualized&&t.refresh()}}_styleChangedHandler(e){const t=this;if(t.dropDownAppendTo){const o=e.detail.styleProperties,n=["font-size","font-family","font-style","font-weight"];for(let e=0;e<n.length;e++)o[n[e]]&&(t.$.dropDownContainer.style[n[e]]=o[n[e]].value)}"auto"===t._dropDownSize.height&&t._setDropDownSize()}_validateTemplate(e){const t=this;if(e&&"function"!=typeof e)if("content"in document.createElement("template")){if(e instanceof HTMLTemplateElement||(e=document.getElementById(e)),null!==e&&"content"in e)return e;t.error(t.localize("invalidTemplate",{elementType:t.nodeName.toLowerCase(),property:"tokenTemplate"}))}else t.error(t.localize("htmlTemplateNotSuported",{elementType:t.nodeName.toLowerCase()}))}});
|
|
41
41
|
Smart("smart-combo-box",class extends Smart.DropDownList{static get properties(){return{autoComplete:{allowedValues:["none","manual","auto","inline","list"],type:"string",value:"none"},autoCompleteDelay:{value:100,type:"number"},autoOpenShortcutKey:{value:[],type:"array"},dropDownOpenMode:{allowedValues:["none","default","dropDownButton","auto"],value:"dropDownButton",defaultReflectToAttribute:!0,type:"string"},escKeyMode:{allowedValues:["clearValue","firstPossibleValue","none","previousValue"],type:"string",value:"none"},inputPurpose:{type:"string",value:"off"},minLength:{type:"number",value:2},maxLength:{type:"number",value:-1},value:{value:"",type:"string"}}}static get listeners(){return{"input.focus":"_inputFocusHandler","input.blur":"_inputFocusHandler","dropDownButton.focus":"_dropDownButtonFocusHandler","dropDownButton.blur":"_dropDownButtonFocusHandler","input.change":"_inputChangeEventHandler","input.mouseenter":"_buttonsMouseEventsHandler","input.mouseleave":"_buttonsMouseEventsHandler","document.down":"_documentDownHandler","document.up":"_documentUpHandler","document.selectstart":"_selectStartHandler","dropDownButton.down":"_buttonsDownHandler","dropDownButton.mouseenter":"_buttonsMouseEventsHandler","dropDownButton.mouseleave":"_buttonsMouseEventsHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler","listBox.change":"_listBoxChangeHandler","listBox.itemClick":"_listBoxItemClickHandler","listBox.keydown":"_listBoxKeyDownHandler",wheel:"_mouseWheelHandler"}}static get styleUrls(){return["smart.combobox.css"]}template(){return'<div id="container" role="presentation">\n <span class="smart-label" id="label">[[label]]</span>\n <div id="content" class="smart-content" role="presentation">\n <div class="smart-buttons-container" id="buttonsContainer" role="presentation">\n <span id="actionButton" class="smart-action-button" role="presentation">\n <input name="[[name]]" class="smart-input" id="input" placeholder="[[placeholder]]" autocomplete="[[inputPurpose]]" role="textbox" aria-label="[[placeholder]]" />\n <div class="smart-combo-box-auto-complete-string" id="autoCompleteString"></div>\n </span>\n <span id="dropDownButton" class="smart-drop-down-button" role="button" aria-label="Toggle popup">\n <span class="smart-drop-down-button-icon" id="arrow" aria-hidden="true"></span>\n </span>\n </div>\n <div id="dropDownContainer" class="smart-drop-down smart-drop-down-container smart-visibility-hidden" role="presentation">\n <smart-list-box id="listBox" unfocusable\n animation="[[animation]]"\n data-source="[[dataSource]]"\n disabled="[[disabled]]"\n display-loading-indicator="[[displayLoadingIndicator]]"\n display-member="[[displayMember]]"\n filterable="[[filterable]]"\n filter-callback="[[filterCallback]]"\n filter-mode="[[filterMode]]"\n filter-input-placeholder="[[filterInputPlaceholder]]"\n grouped="[[grouped]]"\n group-member="[[groupMember]]"\n item-height="[[itemHeight]]"\n item-measure-mode="[[itemMeasureMode]]"\n item-template="[[itemTemplate]]"\n incremental-search-delay="[[incrementalSearchDelay]]"\n incremental-search-mode="[[incrementalSearchMode]]"\n loading-indicator-placeholder="[[loadingIndicatorPlaceholder]]"\n loading-indicator-position="[[loadingIndicatorPosition]]"\n placeholder="[[dropDownPlaceholder]]"\n readonly="[[readonly]]"\n right-to-left="[[rightToLeft]]"\n selected-indexes="{{selectedIndexes}}"\n selection-mode="[[selectionMode]]"\n selected-values="{{selectedValues}}"\n sorted="[[sorted]]"\n theme="[[theme]]"\n value-member="[[valueMember]]"\n horizontal-scroll-bar-visibility="[[horizontalScrollBarVisibility]]"\n vertical-scroll-bar-visibility="[[verticalScrollBarVisibility]]"\n virtualized="[[virtualized]]">\n <content></content>\n </smart-list-box>\n <div id="resizeBar" class="smart-drop-down-resize-bar" aria-label="Resize">\n <div></div>\n </div>\n </div>\n </div>\n <span class="smart-hint" id="hint">[[hint]]</span>\n </div>'}render(){super.render();const e=this;e.value!==e.$.input.value&&(e.$.input.value=e.value)}propertyChangedHandler(e,t,o){const n=this;switch(e){case"autoComplete":if("list"===o){n.$.listBox.$.filterInput.value="";let e=n.$.listBox.context;n.$.listBox.context=n.$.listBox,n.$.listBox._filterItems(!0),n.$.listBox.context=e,n._setDropDownSize()}n._autoComplete(!0),n._setAriaAutocomplete();break;case"dataSource":case"displayMember":n._clearSelection(!0),n._setDropDownSize(),n._positionDetection.checkBrowserBounds("vertically"),n._positionDetection.positionDropDown(),n._positionDetection.checkBrowserBounds("horizontally");break;case"maxLength":n.$.input.setAttribute("maxlength",n.maxLength);break;case"disabled":n.$.input.disabled=o,n._setFocusable(),n.close(),n._positionDetection&&n._positionDetection.handleAutoPositioning(),n._ariaPropertyChangedHandler("disabled",o);break;case"readonly":n.$.input.readOnly=o,n.close(),n._ariaPropertyChangedHandler("readonly",o);break;case"selectedValues":case"selectedIndexes":n._clearSelection(!0);break;case"selectionMode":case"selectionDisplayMode":n._clearSelection(),n._applySelectionDisplayMode(),"tokens"===n.selectionDisplayMode&&(n._currentSelection=void 0),n._applySelection(n.selectionMode),"selectionMode"===e&&super.propertyChangedHandler(e,t,o);break;case"tokenTemplate":if(n.$.selectionField)for(;"SPAN"===n.$.selectionField.firstElementChild.nodeName;)n.$.selectionField.removeChild(n.$.selectionField.firstElementChild);n._tokenTemplate=n._validateTemplate(n.tokenTemplate),n._applySelection();break;case"value":n.clearSelection(),n.value=n.$.input.value=n._oldValue=o,n._queryItems(!0),n._currentSelection&&!n._currentSelection.length&&(n.$.fireEvent("change",{oldValue:t,value:n.$.input.value,addedItems:[],removedItems:[],selected:[],disabled:[],index:[],label:[]}),n._updateTargetValue());break;default:super.propertyChangedHandler(e,t,o)}}clearItems(){this.$.listBox.clearItems(),this._clearSelection(!0)}clearSelection(){this.$.listBox.clearSelection(),this._clearSelection(!arguments[0])}blur(){this.$.input.blur()}close(){super.close(),this.$.input.removeAttribute("aria-controls")}focus(){this.$.input.focus()}open(){super.open(),this.$.input.setAttribute("aria-controls",this.$.listBox.id)}_setFocusable(){const e=this;if(!e.disabled&&!e.unfocusable){let t=e.tabIndex>0?e.tabIndex:0;return e.$.input.tabIndex=t,void("dropDownButton"===e.dropDownOpenMode?e.$.dropDownButton.setAttribute("tabindex",t):e.$.dropDownButton.removeAttribute("tabindex"))}e.$.input.tabIndex=-1,e.$.dropDownButton.removeAttribute("tabindex")}_autoComplete(e){const t=this;if("list"===t.autoComplete)return;if(0===t.$.listBox._items.length&&"function"!=typeof t.dataSource)return void t.close();const o=t.$.input.value.length<t.minLength?"":"escaped"===t.displayMode?t._toDefaultDisplayMode(t.$.input.value):t.$.input.value;let n;1===t.$.listBox.selectedValues.length&&(n=t.$.listBox.getItem(t.$.listBox.selectedValues[0])),t.$.autoCompleteString.textContent="",t.$.listBox.$.filterInput.value="none"===t.autoComplete||t.$.input.value.length<t.minLength?"":o;let i=t.$.listBox.context;t.$.listBox.context=t.$.listBox,t.$.listBox._filterItems(!!e,(function(){if(!t.$.listBox.isAttached||!t.$.input)return;const e=t.enableShadowDOM?t.shadowRoot.activeElement:document.activeElement;if(t._setDropDownSize(),t.opened&&(t._positionDetection.positionDropDown(),t._positionDetection.checkBrowserBounds()),t.$.listBox._filteredItems&&t.$.listBox._filteredItems.length>0){if(t.$.listBox._scrollView.scrollTop=t.$.listBox._filteredItems[0].offsetTop,"none"!==t.autoComplete&&t.$.input.value.length>=t.minLength&&!function(e){for(let t=0;t<e.length;t++)if(e[t]._focused&&e[t].hasAttribute&&e[t].hasAttribute("focus"))return!0}(t.$.listBox._filteredItems)&&t._focus(t.$.listBox._filteredItems[0]),e===t.$.input&&"inline"===t.autoComplete&&t.$.input.value.length>=t.minLength&&t._updateAutoCompleteHelper(),n&&n[t.inputMember]===t.$.listBox._filteredItems[0][t.inputMember]&&n.value===t.$.listBox._filteredItems[0].value&&(t.$.listBox.context=t.$.listBox,t.$.listBox._select(t.$.listBox._filteredItems[0],!0),t.$.listBox.context=i),o!==t.$.listBox._filteredItems[0][t.inputMember]||Smart.TextBox&&t instanceof Smart.TextBox&&"auto"===t.dropDownOpenMode){if(t._closedFromKeyCombination)return void(t._closedFromKeyCombination=!1);if(o.length<t.minLength&&!(Smart.TextBox&&t instanceof Smart.TextBox&&"auto"===t.dropDownOpenMode))return void t.close();t.isCompleted&&"none"!==t.dropDownOpenMode&&e===t.$.input&&t.open()}}else t["function"==typeof t.dataSource?"open":"close"]()}),Smart.TextBox&&t instanceof Smart.TextBox&&"auto"===t.dropDownOpenMode),t.$.listBox.context=i}_updateAutoCompleteHelper(){const e=this,t=e.$.autoCompleteString;if(t.style.width=e.$.input.offsetWidth+"px",t.style.height=e.$.input.offsetHeight+"px",t.style.left=e.$.input.offsetLeft+"px",t.style.top=e.$.input.offsetTop+"px",t.style.paddingLeft=e.selectedIndexes.length>0?0:null,!e._focusedItem)return void(t.textContent="");const o=e.$.input.value,n=e._focusedItem[e.inputMember];n.length!==o.length&&0===n.toLowerCase().indexOf(o.toLowerCase())&&(t.textContent=e.$.input.value+n.slice(o.length))}_applySelection(e,t){const o=this;if(o.$.selectionField||(o.$.selectionField=o.$.actionButton),o.$.autoCompleteString.textContent="",0!==o.selectedIndexes.length){if(o.$.listBox._items&&0!==o.$.listBox._items.length)if("one"===o.selectionMode||"zeroAndOne"===o.selectionMode||"zeroOrOne"===o.selectionMode||"radioButton"===o.selectionMode){if(o._currentSelection&&o._currentSelection.length>o.selectedIndexes.length)return o._currentSelection=o.selectedIndexes.map((e=>o.$.listBox._items[e][o.inputMember])),o.$.input.value=o._currentSelection.toString(),void(o._oldValue=o.value=o._currentSelection.toString());o._clearSelection(),o._currentSelection=o.selectedIndexes.map((e=>o.$.listBox._items[e][o.inputMember])),o.$.input.value=o._currentSelection.toString(),o._oldValue=o.value=o._currentSelection.toString(),o.$.container.setAttribute("has-value",""),"none"!==o.autoComplete&&"function"!=typeof o.dataSource&&(o._autoComplete(!0),o._keyboardNavigation||o.close())}else{for(o.$.input.value="",o.$.input.placeholder="",o.$.container.setAttribute("has-value","");"SPAN"===o.$.selectionField.firstElementChild.nodeName;)o.$.selectionField.removeChild(o.$.selectionField.firstElementChild);let e,t,n=document.createDocumentFragment();t=1!==o.selectedIndexes.length||"oneOrManyExtended"!==o.selectionMode&&"oneOrMany"!==o.selectionMode?"tokens"===o.selectionDisplayMode?"✖":",":"",o.selectedIndexes.map((i=>{e=o._applyTokenTemplate(o.$.listBox._items[i][o.inputMember],t),e._value=o.$.listBox._items[i].value,n.appendChild(e)})),o.$.selectionField.insertBefore(n,o.$.input),o._currentSelection=o.selectedIndexes.map((e=>o.$.listBox._items[e][o.inputMember])),o._oldValue=o.value=o._currentSelection.toString(),o._positionDetection.positionDropDown()}}else o._clearSelection(t&&t.index>-1&&o.$.input.value===o.$.listBox._items[t.index][o.inputMember])}_applySelectionDisplayMode(){const e=this;"one"===e.selectionMode||"zeroAndOne"===e.selectionMode||"zeroOrOne"===e.selectionMode||"radioButton"===e.selectionMode?e.$.removeClass("auto-height"):e.$.addClass("auto-height")}_bindingCompleteHandler(){this._queryItems(),this._setDropDownSize()}_buttonsMouseEventsHandler(e){const t=this;t.disabled||t.readonly||("mouseenter"===e.type?(e.target.setAttribute("hover",""),t.setAttribute("hover",""),"auto"!==t.dropDownOpenMode||Smart.TextBox&&t instanceof Smart.TextBox?"dropDownButton"===t.dropDownOpenMode&&e.target===t.$.dropDownButton&&t.setAttribute("drop-down-button-hover",""):e.target===t.$.dropDownButton?(t.open(),t.$.input.focus()):t.close()):(e.target.removeAttribute("hover"),t.removeAttribute("hover"),t.removeAttribute("drop-down-button-hover")))}_createElement(){const e=this;e.classList.add("smart-drop-down-box"),e._tokenTemplate=e._validateTemplate(e.tokenTemplate),e._applySelectionDisplayMode(),e._applySelection(e.selectionMode),"none"!==e.autoComplete&&e._autoComplete(!0),e._setDropDownSize(),e.$.input.disabled=e.disabled,e.$.input.readOnly=e.readonly,e._setFocusable(),e.$.input.value.length>0&&0===e.selectedIndexes.length&&(e.$.container.setAttribute("has-value",""),e._oldValue=e.value=e.$.input.value),e.maxLength>0&&e.$.input.setAttribute("maxlength",e.maxLength),e.$.arrow.noRipple=!0,e.checkLicense(),e._setAriaRelations(!0)}_clearSelection(e){const t=this;if(e&&(t.$.input.value="",t.value=""),t.$.input.placeholder=t.placeholder,t.$.autoCompleteString.textContent="",t._currentSelection=[],t.$.selectionField)for(;"SPAN"===t.$.selectionField.firstElementChild.nodeName;)t.$.selectionField.removeChild(t.$.selectionField.firstElementChild);"none"!==t.autoComplete&&"list"!==t.autoComplete&&t.$.input.value.length>0&&(t._autoCompleteTimer&&clearTimeout(t._autoCompleteTimer),"function"!=typeof t.dataSource&&(t._autoCompleteTimer=setTimeout((function(){t._autoComplete(!0)}),t.autoCompleteDelay))),t.$.input.value.length||t.$.container.removeAttribute("has-value")}_documentDownHandler(e){const t=this;super._documentDownHandler(e);let o=e.originalEvent.target;(t.shadowRoot||t.isInShadowDOM)&&(o=e.originalEvent.composedPath()[0]),o!==t.$.dropDownButton||"none"===t.dropDownOpenMode||Smart.Utilities.Core.isMobile||requestAnimationFrame((()=>t.$.input.focus()))}_documentUpHandler(e){const t=this;let o=e.originalEvent.target,n=o.closest?o.closest("smart-combo-box"):void 0;(t.shadowRoot||t.isInShadowDOM)&&(o=e.originalEvent.composedPath()[0],n=o.getRootNode().host);const i=o;if(t._resizeDetails&&t._resizeDetails.started)return t._resizeDetails.started=t._resizeDetails.resizeEventFired=!1,t.removeAttribute("resizing"),t._dropDownResized=!0,void t.$.fireEvent("resizeEnd",{position:{left:e.pageX,top:e.pageY}});if(t.disabled||t._isDropDownClicked||t.readonly)return void delete t._isDropDownClicked;if(t._overlayDown)return t.close(),void delete t._overlayDown;if(o===t.$.input||void 0===o||o===t.$.resizeBar)return;if(o===t.$.selectionField)return void t.$.input.focus();if(o===t.$.dropDownButton&&"none"!==t.dropDownOpenMode)return t._preventDropDownClose=!0,o===t._buttonClicked&&t.$dropDownContainer.hasClass("smart-visibility-hidden")&&"pointercancel"!==e.originalEvent.type?t.open():t.close(),Smart.Utilities.Core.isMobile||requestAnimationFrame((()=>t.$.input.focus())),void(t._buttonClicked=void 0);const l=o.closest(".smart-drop-down-list-selection-label");if(l&&n===t&&"none"!==t.dropDownOpenMode){const e=t.$.listBox._items.filter((e=>e[t.inputMember].toString()===l.innerHTML))[0];if(!e||t.$.fireEvent("tokenClick",{index:t.$.listBox._items.indexOf(e),label:e.label,value:e.value}).defaultPrevented)return;return t.open(),t.$.input.focus(),t.$.listBox.ensureVisible(e),void t._focus(e)}if("tokens"===t.selectionDisplayMode&&o.closest(".smart-drop-down-list-unselect-button")&&n===t){if(1===t.selectedIndexes.length&&["zeroOrMany","zeroOrOne","checkBox"].indexOf(t.selectionMode)<0)return;return t.unselect(t.$.listBox._items.filter((e=>e[t.inputMember].toString()===o.previousElementSibling.innerHTML))[0]),void t.$.input.focus()}o=t._getUpEventTarget(o),void 0!==o?((!t.$dropDownContainer.hasClass("smart-visibility-hidden")&&"dropDownContainer"!==o&&"item"!==o||"item"===o&&t.selectionMode.indexOf("Many")<0&&"checkBox"!==t.selectionMode)&&t.close(),("item"===o||"dropDownContainer"===o&&i!==t.$.listBox.$.filterInput)&&t.$.input.focus()):t.$.input.focus()}_dropDownButtonFocusHandler(e){const t=this;"focus"===e.type?("dropDownButton"!==t.dropDownOpenMode&&t.$.input.focus(),t.setAttribute("focus","")):t.removeAttribute("focus")}_inputFocusHandler(e){const t=this;if(!t.disabled)if("focus"===e.type)t.setAttribute("focus",""),t._buttonClicked||(t._oldValue=t.$.input.value),t.$.fireEvent("focus");else{if(t.removeAttribute("focus"),t.$.fireEvent("blur"),""!==e.target.value||0!==t.selectedIndexes.length&&""===e.target.value?t.$.container.setAttribute("has-value",""):t.$.container.removeAttribute("has-value"),t._preventDropDownClose||(t.opened&&("auto"===t.autoComplete||"inline"===t.autoComplete)&&t.$.input.value.length>0&&t._focusedItem&&!t._focusedItem.selected&&t.select(t._focusedItem),t.close()),!t._handleAutoCompleteModeList())return;"previousValue"===t.escKeyMode&&(t.value=t.$.input.value)}}_handleAutoCompleteModeList(){const e=this;if("list"===e.autoComplete&&!e._buttonClicked){if(e.opened&&e._isDropDownClicked)return!1;if(e.$.autoCompleteString.textContent="",e._lastSelectedItem)e._lastSelectedItem.selected||e.select(e._lastSelectedItem);else if(e.$.input.value.length&&e._oldValue){const t=e.$.listBox._queryItems(e._oldValue,e.incrementalSearchMode);for(let o=0;o<t.length;o++)if(!t[o].hidden){t[o].selected||e.select(t[o]),e._focus(t[o]);break}e.value=e.$.input.value=e._oldValue}else e.value=e.$.input.value=""}}_inputChangeEventHandler(e){const t=this;e.stopPropagation(),t._preventInputChangeEvent?delete t._preventInputChangeEvent:t._isDropDownClicked||t._oldValue===t.$.input.value||(t.$.fireEvent("change",{oldValue:t._oldValue,value:t.$.input.value,addedItems:[],removedItems:[],selected:[],disabled:[],index:[],label:[]}),t._updateTargetValue())}_keyDownHandler(e){const t=this,o=t.enableShadowDOM?e.composedPath()[0]:e.target;if(t.disabled||t.readonly||o===t.$.listBox.$.filterInput)return;const n="function"==typeof t._focusedItem?t._focusedItem():t._focusedItem;switch(e.key){case"Enter":if(delete t._preventInputChangeEvent,o===t.$.input&&n&&t.opened){if(n.selected&&"list"===t.autoComplete)return t.close(),t._unfocus(),void t._handleAutoCompleteModeList();n.disabled||(t.select(n),t._preventInputChangeEvent=!0),!t.$dropDownContainer.hasClass("smart-visibility-hidden")&&t.selectionMode.indexOf("one")>-1&&(t.close(),t._unfocus())}else o===t.$.dropDownButton?(t.$.dropDownButton.setAttribute("active",""),t.$dropDownContainer.hasClass("smart-visibility-hidden")&&"none"!==t.dropDownOpenMode?t.open():t.close(),t.$.input.focus()):t.close();return void t._handleAutoCompleteModeList();case"Escape":switch(t.escKeyMode){case"none":t.$dropDownContainer.hasClass("smart-visibility-hidden")||(t.close(),t._unfocus());break;case"clearValue":t.value=t.$.input.value="",t.close();break;case"previousValue":t.$.input.value=t._oldValue;break;case"firstPossibleValue":{const e=t.$.listBox._items.find((e=>!e.disabled&&!e.hidden&&!e.readonly));if(e){const o=e[t.inputMember];t.$.input.value===o&&t.close(),t.$.input.value=o}t.close();break}}break;case"End":case"Home":case"PageUp":case"PageDown":case"ArrowUp":case"ArrowDown":if(!0===t._autoOpenOnKeyDown(e))return;if(e.altKey){if(t._closedFromKeyCombination=!0,t.$dropDownContainer.hasClass("smart-visibility-hidden")&&"none"!==t.dropDownOpenMode){if("ArrowDown"===e.key&&t.open(),!t.opened)return;if(0===t.items.length)return;0===t.selectedIndexes.length?t._focus(t.items[0]):t.selectedIndexes.length>0&&!t.$.listBox._items[t.selectedIndexes[t.selectedIndexes.length-1]].hidden&&t._focus(t.items[t.selectedIndexes[t.selectedIndexes.length-1]])}else t.close();return}if(o===t.$.input&&t.$dropDownContainer.hasClass("smart-visibility-hidden"))return void(e.ctrlKey&&(e.preventDefault(),t._handleKeyStroke(e.key)));if(("PageUp"===e.key||"PageDown"===e.key)&&!n||o===t.$.listBox.$.filterInput)return;if(e.preventDefault(),!n||n&&!n._focused)return void t._focus(t.items[0]);t._handleKeyStroke(e.key),"inline"!==t.autoComplete&&"list"!==t.autoComplete||t._updateAutoCompleteHelper();break;case"Backspace":if(t.$.input.previousElementSibling){if(0===t.$.input.value.length){if(1===t.selectedIndexes.length&&["zeroOrMany","zeroOrOne","checkBox"].indexOf(t.selectionMode)<0)return;const e=t.$.listBox.getItem(t.$.input.previousElementSibling._value);e?t.unselect(e):t.$.selectionField.firstElementChild&&"SPAN"===t.$.selectionField.firstElementChild.nodeName&&t.$.selectionField.removeChild(t.$.selectionField.firstElementChild)}return}t.selectedIndexes.length>1&&t.clearSelection(!0);break;default:if(o===t.$.input&&"oneOrManyExtended"===t.selectionMode&&(t.$.listBox._keysPressed[e.key]=!0),!0===t._autoOpenOnKeyDown(e))return}}_handleKeyStroke(e){const t=this,o=t.$.listBox;if("none"===t.autoComplete)return void o._handleKeyStrokes(e);const n=t.items;switch(e){case"ArrowLeft":case"ArrowUp":t._handleArrowKeys(!0);break;case"ArrowRight":case"ArrowDown":t._handleArrowKeys(!1);break;case"Home":case"End":{if(0===n.length)return;const i="Home"===e;t._focus(i?n[0]:n[n.length-1]),o.scrollTop=i?0:o.scrollHeight;break}case"PageUp":t._pageUpKeyHandler(n);break;case"PageDown":t._pageDownKeyHandler(n)}o._recycle()}_handleArrowKeys(e){const t=this,o=t.$.listBox;let n;if(t._focusedItem)n=t.$.listBox._indexOf(t._focusedItem),t._focusedItem._focused=!1;else{if(0===t.selectedIndexes.length)return;n=t.selectedIndexes[t.selectedIndexes.length-1]}const i=e?o._getPreviousItem(n):o._getNextItem(n);t._focus(i),"list"===t.autoComplete&&o._items[n]!==i&&(t._keyboardNavigation=!0,o.clearSelection(),o.select(i),delete t._keyboardNavigation),t.ensureVisible(i)}_pageDownKeyHandler(e){const t=this,o=t.$.listBox;let n,i=o._items[t.selectedIndexes[t.selectedIndexes.length-1]];o._focusedItem&&(i=o._focusedItem);const l=o._indexOf(i);let s=i.top+o.$.itemsContainer.offsetHeight-i.height;for(let t=l;t<e.length;t++)if(e[t].top>=s){n=e[t];break}n||(n=e[e.length-1]),t._focus(n),(n.height+n.top>o.$.itemsContainer.scrollTop+o.$.itemsContainer.offsetHeight||n.top<o.$.itemsContainer.scrollTop)&&(o.scrollTop=n.top-o.$.itemsContainer.offsetHeight+n.height)}_pageUpKeyHandler(e){const t=this,o=t.$.listBox;let n=o._items[t.selectedIndexes[t.selectedIndexes.length-1]];o._focusedItem&&(n=o._focusedItem);const i=n.top-o.$.itemsContainer.offsetHeight;let l;for(let t=o._indexOf(n);t>0;t--)if(e[t].top<=i){l=e[t];break}l||(l=e[0]),o._focus(l),o.scrollTop=l.top,0===o._indexOf(l)&&(o.scrollTop=0)}_autoOpenOnKeyDown(e){const t=this;if(t.opened||!t.opened&&t.autoOpenShortcutKey.indexOf(e.key)<0)return;t.selectedIndexes.length&&t._focus(t.items[t.selectedIndexes[t.selectedIndexes.length-1]]);const o="function"==typeof t._focusedItem?t._focusedItem():t._focusedItem;return t.open(),(!o||o&&!o._focused)&&("ArrowDown"===e.key?t._focus(t.items[0]):"ArrowUp"===e.key&&t._focus(t.items[t.items.length-1]),t.ensureVisible(t._focusedItem)),!0}_keyUpHandler(e){const t=this,o=t.enableShadowDOM?e.composedPath()[0]:e.target;if(!(t.disabled||"none"===t.escKeyMode&&"Escape"===e.key||o===t.$.listBox.$.filterInput))if(delete t._preventInputChangeEvent,o===t.$.input&&"oneOrManyExtended"===t.selectionMode&&(t.$.listBox._keysPressed[e.key]=!1),["one","zeroAndOne","radioButton","zeroOrOne"].indexOf(t.selectionMode)>-1&&1===t.selectedIndexes.length&&t.$.input.value!==(t._currentSelection?t._currentSelection[0]:void 0)&&t.unselect(t.$.listBox._items[t.selectedIndexes[0]]),"Enter"!==e.key){if(o===t.$.input&&e.key.indexOf("Arrow")<0&&["Control","Shift"].indexOf(e.key)<0){if(t.value===t.$.input.value)return;if(t._currentSelection?t.value=t._currentSelection.toString()+(t._currentSelection.length>0?",":"")+t.$.input.value:t.value=t.$.input.value,t.$.autoCompleteString.textContent="",t._closedFromKeyCombination)return void(t._closedFromKeyCombination=!1);if("none"!==t.autoComplete&&"list"!==t.autoComplete?(t.$.input.value!==(t._currentSelection?t._currentSelection.toString():void 0)||t.$.listBox._filteredItems&&t.$.listBox._filteredItems.length!==t.$.listBox._items.length)&&(t._autoCompleteTimer&&clearTimeout(t._autoCompleteTimer),t._autoCompleteTimer=setTimeout((function(){t._autoComplete(!0)}),t.autoCompleteDelay)):(t.$.input.value.length>0&&t._queryItems(),!t._focusedItem||"Escape"===e.key&&"firstPossibleValue"===t.escKeyMode||(t.open()," "!==e.key&&(t.$.listBox._scrollView.scrollTop=t._focusedItem.offsetTop))),"none"!==t.autoComplete&&"list"!==t.autoComplete&&t.$.listBox._filteredItems&&t.$.listBox._filteredItems.length===t.$.listBox._items.length)return void t.close()}}else t.$.dropDownButton.removeAttribute("active")}_queryItems(e){const t=this;if(!t.value||!t.$.input)return void t.close();let o=t.$.listBox._queryItems(t.$.input.previousElementSibling?t.$.input.value:t.value,t.incrementalSearchMode);0===o.length&&t._unfocus();for(let n=0;n<o.length;n++)if(!o[n].hidden){e&&!o[n].selected&&t.select(o[n]),t._focus(o[n]);break}"list"===t.autoComplete&&(t.enableShadowDOM?t.shadowRoot.activeElement:document.activeElement)===t.$.input&&t.$.input.value.length>=t.minLength?(t._lastSelectedItem=t._focusedItem,t._updateAutoCompleteHelper()):t._lastSelectedItem=void 0}_selectStartHandler(e){this._resizeDetails&&this._resizeDetails.started&&e.preventDefault()}_unfocus(){const e=this;e._focusedItem&&(e._focusedItem._focused=!1,e.$.listBox._focusedItem=void 0)}_setAriaRelations(){const e=this;e.setAttribute("role","combobox"),e.setAttribute("aria-describedby",e.$.hint.id),e.setAttribute("aria-expanded",e.opened),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-labelledby",e.$.label.id),e._ariaButton=e,e._setAriaAutocomplete()}_setAriaAutocomplete(){const e=this.autoComplete,t=this.$.input;"none"===e?t.setAttribute("aria-autocomplete","none"):"auto"===e||"manual"===e?t.setAttribute("aria-autocomplete","list"):t.setAttribute("aria-autocomplete","both")}});
|
|
42
42
|
Smart("smart-drop-down-button",class extends Smart.ContentElement{static get properties(){return{autoCloseDelay:{value:100,type:"number"},placeholderTemplate:{value:"",type:"any"},dropDownAppendTo:{value:null,type:"any"},dropDownButtonPosition:{allowedValues:["none","left","right","top","bottom"],value:"right",type:"string"},dropDownHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownMaxHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownMaxWidth:{value:"",type:"any",validator:"_propertyValidator"},dropDownMinHeight:{value:"",type:"any",validator:"_propertyValidator"},dropDownMinWidth:{value:"",type:"any",validator:"_propertyValidator"},dropDownOpenMode:{allowedValues:["none","default","dropDownButton","auto"],value:"default",type:"string"},dropDownOverlay:{value:!1,type:"boolean"},dropDownPlaceholder:{value:"No Items",type:"string"},dropDownPosition:{allowedValues:["auto","top","bottom","overlay-top","overlay-center","overlay-bottom","center-bottom","center-top"],value:"auto",type:"string"},dropDownWidth:{value:"",type:"any",validator:"_propertyValidator"},hint:{value:"",type:"string"},horizontalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},label:{value:"",type:"string"},messages:{extend:!0,value:{en:{invalidNode:'smart-drop-down-button: Invalid parameter "{{node}}" when calling {{method}}.'}},type:"object"},name:{value:"",type:"string"},opened:{value:!1,type:"boolean"},placeholder:{value:"",type:"string"},resizeIndicator:{value:!1,type:"boolean"},resizeMode:{value:"none",allowedValues:["none","horizontal","vertical","both"],type:"string"},verticalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]}}}static get listeners(){return{"actionButton.down":"_buttonsDownHandler","actionButton.mouseenter":"_buttonsMouseEventsHandler","actionButton.mouseleave":"_buttonsMouseEventsHandler","document.selectstart":"_selectStartHandler","document.dragstart":"_dragStartHandler","document.down":"_documentDownHandler","document.up":"_documentUpHandler","document.move":"_documentMoveHandler","dropDownButton.down":"_buttonsDownHandler","dropDownButton.mouseenter":"_buttonsMouseEventsHandler","dropDownButton.mouseleave":"_buttonsMouseEventsHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler",focus:"_focusEventHandler",blur:"_blurEventHandler","dropDownContainer.transitionend":"_dropDownTransitionendHandler",mouseenter:"_mouseEnterHandler",mouseleave:"_mouseLeaveHandler",resize:"_resizeHandler","resizeBar.move":"_resizeBarMoveHandler",styleChanged:"_styleChangedHandler"}}template(){return'<div id="container" role="presentation">\n <span class="smart-label" id="label">[[label]]</span>\n <div id="content" class="smart-content" role="presentation">\n <div id="buttonsContainer" class="smart-buttons-container" role="presentation">\n <span id="actionButton" class="smart-action-button">[[placeholder]]</span>\n <span id="dropDownButton" class="smart-drop-down-button">\n <span class="smart-drop-down-button-icon" id="arrow" aria-hidden="true"></span>\n </span>\n </div>\n <div id="dropDownContainer" class="smart-drop-down smart-drop-down-container smart-visibility-hidden" role="dialog">\n <smart-scroll-viewer id="scrollViewer" inner-h-t-m-l=\'[[innerHTML]]\'\n right-to-left="[[rightToLeft]]"\n horizontal-scroll-bar-visibility="[[horizontalScrollBarVisibility]]"\n vertical-scroll-bar-visibility="[[verticalScrollBarVisibility]]">\n <content></content>\n </smart-scroll-viewer>\n <div id="resizeBar" class="smart-drop-down-resize-bar" aria-label="Resize">\n <div></div>\n </div>\n </div>\n </div>\n <span class="smart-hidden smart-hint" id="hint">[[hint]]</span>\n </div>'}static get styleUrls(){return["smart.scrollviewer.css","smart.dropdown.css","smart.dropdownbutton.css"]}attached(){const e=this;super.attached(),e.isCompleted&&e.$.dropDownContainer&&(e._positionDetection.dropDownAttached("_setDropDownSize"),e._positionDetection.checkBrowserBounds())}detached(){const e=this;super.detached(),e.$.dropDownContainer&&(e.close(),e._positionDetection.dropDownDetached())}propertyChangedHandler(e,t,o){const n=this;switch(e){case"disabled":case"unfocusable":n._setFocusable();break;case"dropDownAppendTo":n._positionDetection.dropDownAppendToChangedHandler();break;case"dropDownHeight":case"dropDownMaxHeight":case"dropDownMaxWidth":case"dropDownMinHeight":case"dropDownMinWidth":case"dropDownWidth":n._setDropDownSize();break;case"dropDownOpenMode":n._setFocusable(),n.close(),n._setAriaRelations();break;case"dropDownOverlay":o||n._positionDetection.removeOverlay();break;case"dropDownPlaceholder":n.$.dropDownContainer.hasAttribute("empty")&&(n.$.scrollViewer.$.scrollViewerContentContainer.innerHTML=o,n.opened&&n.$.scrollViewer.refresh());break;case"dropDownPosition":n._positionDetection.dropDownPositionChangedHandler();break;case"innerHTML":""===o.trim()?(n.$.dropDownContainer.setAttribute("empty",""),requestAnimationFrame((()=>n.$.scrollViewer.$.scrollViewerContentContainer.innerHTML=n.dropDownPlaceholder))):(n.$.dropDownContainer.removeAttribute("empty"),n.$.scrollViewer.$.scrollViewerContentContainer.innerHTML=o),n.opened&&n.$.scrollViewer.refresh();break;case"opened":o?n.open():n.close();break;case"placeholder":""!==t&&""!==o||n._setFocusable();break;case"resizeIndicator":o?n.$.dropDownContainer.setAttribute("resize-indicator",""):n.$.dropDownContainer.removeAttribute("resize-indicator");break;case"resizeMode":n.$.dropDownContainer.setAttribute("resize-mode",n.resizeMode),n.opened&&n.$.scrollViewer.refresh();break;case"label":o?n._ariaButton.setAttribute("aria-labelledby",n.$.label.id):"DropDownButton"===n.elementName&&n._ariaButton.setAttribute("aria-labelledby",n.$.actionButton.id)}}appendChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e?(t.$.scrollViewer.appendChild(e),t.opened&&t.$.scrollViewer.refresh()):t.error(t.localize("invalidNode",{method:"removeChild",node:"node"}))}removeChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e?t.$.dropDownContainer.contains(e)&&(t.$.scrollViewer.removeChild(e),t.opened&&t.$.scrollViewer.refresh()):t.error(t.localize("invalidNode",{method:"removeChild",node:"node"}))}removeAll(){const e=this;e.isCompleted&&e.$.scrollViewer.removeAll()}_open(){const e=this;if(!e.disabled&&e.offsetHeight&&e.$dropDownContainer.hasClass("smart-visibility-hidden")){if(e.$dropDownContainer.hasClass("not-in-view")&&e.$dropDownContainer.removeClass("not-in-view"),e.$.dropDownContainer.style.transition=null,e.dropDownAppendTo&&e.dropDownAppendTo.length>0){const t=e.getBoundingClientRect();if(e.$.container.contains(e.$.dropDownContainer)){let t=0;const o=setInterval((function(){const n=e.getBoundingClientRect();t++,n.top===e._positionTop&&t<10||(e.open(),clearInterval(o),e._positionTop=n.top)}),100);return}t.top!==e._positionTop&&(e._positionTop=t.top)}e.$.fireEvent("opening").defaultPrevented||(e.opened=!0,e._ariaButton.setAttribute("aria-expanded",!0),e._positionDetection.placeOverlay(),e._positionDetection.checkBrowserBounds("vertically"),e._positionDetection.positionDropDown(),e._positionDetection.checkBrowserBounds("horizontally"),e.$dropDownContainer.removeClass("smart-visibility-hidden"),e.$.fireEvent("open"),e.$.dropDownButton&&("dropDownButton"===e.dropDownOpenMode?e.$.dropDownButton.setAttribute("selected",""):e.$.dropDownButton.removeAttribute("selected")),e.$.input&&e.$.input.focus())}}toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this,t=document.querySelectorAll("smart-drop-down-button, smart-color-picker");for(let o=0;o<t.length;o++)t[o]!==e&&t[o].opened&&t[o].close();e._open(),e.$.scrollViewer.refresh()}scrollTo(e,t){this.isCompleted&&this.$.scrollViewer.scrollTo(e,t)}ready(){super.ready()}_applyPlaceholderTemplate(){const e=this;if(e.placeholderTemplate){const t=document.createElement("div");let o;if("string"==typeof e.placeholderTemplate&&e.placeholderTemplate.startsWith("#")&&(o=document.querySelector(e.placeholderTemplate)),"function"==typeof e.placeholderTemplate){const t=e.placeholderTemplate();t&&(e.$.actionButton.innerHTML=t)}o instanceof HTMLTemplateElement?t.appendChild(o.content.cloneNode(!0)):o instanceof HTMLElement?t.appendChild(o):t.innerHTML=e.placeholderTemplate,e.$.actionButton.innerHTML=t.innerHTML}}render(){const e=this;if(e.rightToLeft&&(e.dropDownButtonPosition="right"===e.dropDownButtonPosition?"left":"right"),e.classList.add("smart-drop-down-box"),e._edgeMacFF=Smart.Utilities.Core.Browser.Edge||Smart.Utilities.Core.Browser.Firefox&&-1!==navigator.platform.toLowerCase().indexOf("mac"),e._positionDetection=new Smart.Utilities.PositionDetection(e,e.$.dropDownContainer,e.$.container,"close"),e._positionDetection.getDropDownParent(!0),e._positionDetection.setDropDownPosition(),e._calculateDropDownSize(),e.$.dropDownContainer.setAttribute("resize-mode",e.resizeMode),e.resizeIndicator&&e.$.dropDownContainer.setAttribute("resize-indicator",""),e._positionDetection.handleAutoPositioning(),e.$.label&&!e.$.label.id&&(e.$.label.id=e.id+"Label"),e.$.actionButton&&!e.$.actionButton.id&&(e.$.actionButton.id=e.id+"ActionButton"),e.$.hint&&!e.$.hint.id&&(e.$.hint.id=e.id+"Hint"),e.dropDownAppendTo)for(let t=0;t<e.classList.length;t++){const o=e.classList[t];e.$.dropDownContainer.classList.add(o)}e._applyPlaceholderTemplate(),e._createElement(),e.opened?e.open():e.hasAnimation&&e._edgeMacFF&&e.$dropDownContainer.addClass("not-in-view"),e._positionTop=e.getBoundingClientRect().top,super.render()}_setAriaRelations(e){const t=this;let o,n;"dropDownButton"!==t.dropDownOpenMode?(o=t.$.dropDownButton,o.setAttribute("aria-hidden",!0),n=t,t.$.actionButton.removeAttribute("role")):(o=t,n=t.$.dropDownButton,n.removeAttribute("aria-hidden"),t.$.actionButton.setAttribute("role","button")),t._ariaButton=n,n.setAttribute("role","button"),n.setAttribute("aria-haspopup","dialog"),n.setAttribute("aria-owns",t.$.dropDownContainer.id),n.setAttribute("aria-describedby",t.$.hint.id),t.label?n.setAttribute("aria-labelledby",t.$.label.id):"DropDownButton"===t.elementName&&n.setAttribute("aria-labelledby",t.$.actionButton.id),o.setAttribute("role","presentation"),o.removeAttribute("aria-owns"),e?n.setAttribute("aria-expanded",t.opened):(o.removeAttribute("aria-describedby"),o.removeAttribute("aria-expanded"),o.removeAttribute("aria-haspopup"),o.removeAttribute("aria-labelledby"))}_setDropDownSize(){const e=this;e._dropDownSize||e._calculateDropDownSize(),["dropDownMinWidth","dropDownMinHeight","dropDownMaxWidth","dropDownMaxHeight"].forEach((t=>{e.$.dropDownContainer.style[t.replace("dropDown","").replace(/^./,"m")]=e[t]?e[t]+(e[t].toString().endsWith("%")?"%":"px"):null})),e.dropDownWidth?"auto"!==e.dropDownWidth?e.$.dropDownContainer.style.width=("initial"===e.dropDownWidth?e.offsetWidth:parseFloat(e.dropDownWidth))+"px":e.$.dropDownContainer.style.width="auto":e.$.dropDownContainer.style.width="auto"===e._dropDownSize.width?"auto":(parseFloat(e._dropDownSize.width)||0)+"px",e.dropDownHeight&&"auto"!==e.dropDownHeight?e.$.dropDownContainer.style.height=parseFloat(e.dropDownHeight)+((e.dropDownHeight+"").indexOf("%")>-1?"%":"px"):e.$.dropDownContainer.style.height=e._dropDownSize.height}_setFocusable(){const e=this;if(e.disabled||e.unfocusable)return e.removeAttribute("tabindex"),e.$.actionButton.removeAttribute("tabindex"),void e.$.dropDownButton.removeAttribute("tabindex");let t=e.tabIndex>0?e.tabIndex:0;"dropDownButton"===e.dropDownOpenMode?(e.removeAttribute("tabindex"),e.$.actionButton.setAttribute("tabindex",t),e.$.dropDownButton.setAttribute("tabindex",t)):(e.$.actionButton.removeAttribute("tabindex"),e.$.dropDownButton.removeAttribute("tabindex"),e.tabIndex=t)}_calculateDropDownSize(){const e=this;e._dropDownSize={};const t=window.getComputedStyle(e.$.dropDownContainer),o=parseFloat(t.getPropertyValue("border-top-width").trim()),n=parseFloat(t.getPropertyValue("border-bottom-width").trim()),r=parseFloat(t.getPropertyValue("margin-top").trim()),i=parseFloat(t.getPropertyValue("margin-bottom").trim()),a=parseFloat(t.getPropertyValue("padding-top").trim()),s=parseFloat(t.getPropertyValue("padding-bottom").trim());Smart.Utilities.Core.CSSVariablesSupport()&&(e._dropDownSize.width=t.getPropertyValue("--smart-drop-down-list-drop-down-width").trim(),e._dropDownSize.height=t.getPropertyValue("--smart-drop-down-list-drop-down-height").trim()),(!e._dropDownSize.width||e._dropDownSize.width.indexOf("initial")>-1)&&(e._dropDownSize.width=e.offsetWidth),e._dropDownSize.height||(e._dropDownSize.height="auto"),e._dropDownSize.minHeight=parseFloat(t.getPropertyValue("min-height").trim()),e._dropDownSize.maxHeight=parseFloat(t.getPropertyValue("max-height").trim()),e._dropDownSize.borderWidth=(isNaN(o)?0:o)+(isNaN(n)?0:n),e._dropDownSize.paddingWidth=(isNaN(a)?0:a)+(isNaN(s)?0:s),e._dropDownSize.marginWidth=(isNaN(r)?0:r)+(isNaN(i)?0:i)}_createElement(){const e=this;""===e.innerHTML.trim()&&(e.$.dropDownContainer.setAttribute("empty",""),e.$.scrollViewer.$.scrollViewerContentContainer.innerHTML=e.dropDownPlaceholder),e._setDropDownSize(),e._setFocusable(),e._setAriaRelations(!0),e.$.arrow.noRipple=!0}_dragStartHandler(e){this._resizeDetails&&this._resizeDetails.started&&e.preventDefault()}_dropDownTransitionendHandler(){const e=this;e._edgeMacFF&&!e.opened&&e.hasAnimation&&(e.$.dropDownContainer.style.top=e.$.dropDownContainer.style.left="",e.$dropDownContainer.addClass("not-in-view"))}_blurEventHandler(){const e=this;e.hasAttribute("focus")&&(e.$.dropDownButton&&(e.removeAttribute("focus"),e.$.dropDownButton.removeAttribute("focus")),e.$.actionButton&&(e.removeAttribute("focus"),e.$.actionButton.removeAttribute("focus")),e.$.fireEvent("blur"))}_focusEventHandler(){const e=this;e.hasAttribute("focus")||(e.$.dropDownButton&&(e.setAttribute("focus",""),e.$.dropDownButton.setAttribute("focus","")),e.$.actionButton&&(e.setAttribute("focus",""),e.$.actionButton.setAttribute("focus","")),e.$.fireEvent("focus"))}_getUpEventTarget(e){const t=this;let o=e;if(o===t.$.dropDownContainer)return"dropDownContainer";for(o=void 0===o.parentElement?o.getRootNode().host:o.parentElement;o;){if(o===t.$.dropDownContainer){o="dropDownContainer";break}o=void 0===o.parentElement?o.getRootNode().host:o.parentElement}return o}close(){const e=this;e.$dropDownContainer.hasClass("smart-visibility-hidden")||e.$.fireEvent("closing").defaultPrevented||(e.$dropDownContainer.addClass("smart-visibility-hidden"),e.$.fireEvent("close"),e.$.dropDownButton&&e.$.dropDownButton.removeAttribute("selected"),e.opened=!1,e._ariaButton.setAttribute("aria-expanded",!1),e._preventDropDownClose=!1,e._positionDetection.removeOverlay(!0),e._edgeMacFF&&!e.hasAnimation&&(e.$.dropDownContainer.style.top=e.$.dropDownContainer.style.left="",e.$dropDownContainer.addClass("not-in-view")))}_documentUpHandler(e){const t=this,o=t.hasAttribute("resizing");if(t.$.actionButton.removeAttribute("active"),t._resizeDetails&&t._resizeDetails.started)return t._resizeDetails.started=t._resizeDetails.resizeEventFired=!1,t.removeAttribute("resizing"),t._preventDropDownClose=!1,t.focus(),void t.$.fireEvent("resizeEnd",{position:{left:e.pageX,top:e.pageY}});if(t.disabled||t._isDropDownClicked||t.readonly)return void delete t._isDropDownClicked;if(t._overlayDown)return t.close(),void delete t._overlayDown;let n=e.originalEvent.target;if(t.isInShadowDOM&&(n=e.originalEvent.composedPath()[0]),t._preventsSelectStart=!1,void 0===n||n===t.$.resizeBar)return;const r=n.closest(".smart-action-button");let i;if(t._buttonClicked&&("dropDownButton"===t.dropDownOpenMode&&r&&t._buttonClicked===t.$.actionButton?t.$.fireEvent("actionButtonClick"):n.closest(".smart-drop-down-button")!==t._buttonClicked&&r!==t._buttonClicked||(i=!0,t.$.fireEvent("dropDownButtonClick"))),t._buttonClicked=void 0,!t.editable&&r===t.$.actionButton||n.closest(".smart-drop-down-button")===t.$.dropDownButton)return"dropDownButton"===t.dropDownOpenMode&&r===t.$.actionButton?void t.close():void(t.$dropDownContainer.hasClass("smart-visibility-hidden")&&"none"!==t.dropDownOpenMode&&i&&"pointercancel"!==e.originalEvent.type?t.open():t.close());n=t._getUpEventTarget(n),void 0!==n&&(("dropDownContainer"!==n&&"item"!==n||"item"===n&&"checkBox"!==t.selectionMode&&t.selectionMode.indexOf("Many")<0)&&t.close(),o&&t.$.scrollViewer&&t.$.scrollViewer.refresh())}_keyDownHandler(e){const t=this,o=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement;if(!(t.disabled||t.readonly||o!==t&&o!==t.$.dropDownButton&&o!==t.$.actionButton))switch(e.key){case"Enter":case" ":e.preventDefault(),e.target!==t.$.actionButton&&(t.opened&&"Enter"===e.key?t.close():t.opened||t.readonly||"none"===t.dropDownOpenMode||t.open()),"dropDownButton"===t.dropDOwnOpenMode&&e.target.setAttribute("active","");break;case"End":t.$.scrollViewer.scrollTop=t.$.scrollViewer.scrollHeight;break;case"Home":t.$.scrollViewer.scrollTop=0;break;case"PageUp":case"PageDown":t.$.scrollViewer.scrollTop+=(e.key.indexOf("Down")>-1?1:-1)*t.$.dropDownContainer.offsetHeight;break;case"ArrowUp":case"ArrowDown":if(e.altKey)return void(t.disabled||t.readonly||"none"===t.dropDownOpenMode||(t.$dropDownContainer.hasClass("smart-visibility-hidden")?t.open():t.close()));e.preventDefault(),t.$.scrollViewer.scrollTop+=10*(e.key.indexOf("Down")>-1?1:-1);break;case"Escape":e.preventDefault(),t.close()}}_keyUpHandler(e){const t=this.isInShadowDOM?e.composedPath()[0]:e.target;"Enter"!==e.key&&" "!==e.key||t.removeAttribute("active")}_propertyValidator(e,t){return"number"!=typeof t&&"string"!=typeof t?e:t}_mouseEnterHandler(){const e=this;e._isElementHovered=!0,"auto"!==e.dropDownOpenMode||e.disabled||e.readonly||e.open()}_mouseLeaveHandler(){const e=this;e.removeAttribute("hover"),e._isElementHovered=!1,"auto"!==e.dropDownOpenMode||e.disabled||e.readonly||e._autoClose()}_autoClose(){const e=this;e._autoCloseTimeout=setTimeout(function(){e._isElementHovered||e.close(),clearTimeout(e._autoCloseTimeout)}.bind(e),e.autoCloseDelay)}_documentMoveHandler(e){const t=this,o=t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if("auto"===t.dropDownOpenMode&&null!==t.dropDownAppendTo&&(t.contains(o)||t.$.dropDownContainer.contains(o)?t._isElementHovered=!0:(t._isElementHovered=!1,t._autoClose())),!t._resizeDetails||t._resizeDetails&&!t._resizeDetails.started)return;t.setAttribute("resizing",""),t._resizeDetails.resizeEventFired||(t.$.fireEvent("resizeStart",{position:{left:e.pageX,top:e.pageY}}),t._resizeDetails.resizeEventFired=!0);const n=document.documentElement,r=t.$.dropDownContainer.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.$.dropDownContainer.hasAttribute("top")?"top":"bottom";let s;function l(){if(s=e.pageY-t._resizeDetails.y,"bottom"===a)t._resizeDetails.height=Math.min(n.clientHeight-r.top-6,Math.max(0,t._resizeDetails.height+s)),t._resizeDetails.y=Math.max(r.top+n.scrollTop-t._resizeDetails.offsetY,Math.min(n.clientHeight+n.scrollTop-1.5*t._resizeDetails.offsetY,e.pageY));else{if(t._resizeDetails.height=Math.min(t._dropDownSize.maxHeight,Math.max(0,Math.min(i.top,t._resizeDetails.height-s))),s=Math.max(0,r.top+(r.height-Math.max(t._dropDownSize.minHeight,t._resizeDetails.height))),t.dropDownAppendTo&&t.dropDownAppendTo.length>0){const e=Math.abs(parseFloat(getComputedStyle(t.$.dropDownContainer).getPropertyValue("margin-bottom")))||0;t.$.dropDownContainer.style.top=t.dropDownAppendTo&&t.dropDownAppendTo.length>0?e+s+"px":""}const o=i.top+n.scrollTop+t._resizeDetails.offsetYtop;t._resizeDetails.y=Math.max(t._resizeDetails.offsetYtop,Math.min(o,Math.max(o-t._dropDownSize.maxHeight,e.pageY)))}t.$.dropDownContainer.style.height=t._resizeDetails.height+"px"}function d(){s=e.pageX-t._resizeDetails.x,t._resizeDetails.width=Math.min(n.clientWidth-r.left-6,Math.max(0,t._resizeDetails.width+s)),t.$.dropDownContainer.style.width=t._resizeDetails.width+"px",t._resizeDetails.x=Math.max(r.left+n.scrollLeft-t._resizeDetails.offsetXR,Math.min(n.clientWidth+n.scrollLeft-1.5*t._resizeDetails.offsetXR,e.pageX))}switch(t.resizeMode){case"vertical":l();break;case"horizontal":d();break;case"both":d(),l()}}_documentDownHandler(e){const t=this;if(t.disabled||t.readonly)return;let o=e.originalEvent.target;if(o===t._overlay&&(t._overlayDown=!0),t.isInShadowDOM){o=e.originalEvent.composedPath()[0];let n=o;for(;n;){if(n.closest(".smart-drop-down-container")===t.$.dropDownContainer){t._isDropDownClicked=!0;break}n=n.getRootNode().host}}else t._isDropDownClicked=o.closest(".smart-drop-down-container")===t.$.dropDownContainer;if(t._buttonClicked=o.closest(".smart-action-button")||o.closest(".smart-drop-down-button"),t._isDropDownClicked&&(t._preventDropDownClose=!0),o!==t.$.resizeBar||"none"===t.resizeMode)return;t._resizeDetails||(t._resizeDetails={});const n=t.$.dropDownContainer.getBoundingClientRect();t._resizeDetails.started=!0,t._resizeDetails.x=e.pageX,t._resizeDetails.y=e.pageY,t._resizeDetails.width=t.$.dropDownContainer.offsetWidth,t._resizeDetails.height=t.$.dropDownContainer.offsetHeight,t._resizeDetails.offsetXL=e.clientX-n.left,t._resizeDetails.offsetXR=n.left+t.$.dropDownContainer.offsetWidth-e.clientX,t._resizeDetails.offsetY=n.top+t.$.dropDownContainer.offsetHeight-e.clientY,t._resizeDetails.offsetYtop=e.clientY-n.top,t._preventDropDownClose=!0}_resizeHandler(){this.refresh()}refresh(){const e=this;"none"===e.resizeMode&&(e._calculateDropDownSize(),e._setDropDownSize())}_resizeBarMoveHandler(e){"touchmove"===e.originalEvent.type&&e.originalEvent.preventDefault()}_styleChangedHandler(e){const t=this;if(t.dropDownAppendTo&&t.dropDownAppendTo.length>0){const o=e.detail.styleProperties,n=["font-size","font-family","font-style","font-weight"];for(let e=0;e<n.length;e++)o[n[e]]&&(t.$.dropDownContainer.style[n[e]]=o[n[e]].value)}t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize()}_buttonsDownHandler(e){const t=this;if(!t.disabled){if(t.hasRippleAnimation)if("dropDownButton"===t.dropDownOpenMode)Smart.Utilities.Animation.Ripple.animate(e.target,e.pageX,e.pageY);else if(e.target===t.$.dropDownButton||!t.editable){const o=t.$.buttonsContainer;o.firstElementChild.noRipple=!0,Smart.Utilities.Animation.Ripple.animate(o,e.pageX,e.pageY),o.firstElementChild.noRipple=!1}t._preventsSelectStart=!0,"dropDownButton"===t.dropDownOpenMode&&e.target===t.$.actionButton&&"smart-drop-down-button"===t.tagName.toLowerCase()&&t.$.actionButton.setAttribute("active",""),t.opened&&(t._preventDropDownClose=!0)}}_buttonsMouseEventsHandler(e){const t=this;t.disabled||("mouseenter"===e.type?(t.setAttribute("hover",""),e.target.setAttribute("hover","")):(t.removeAttribute("hover"),e.target.removeAttribute("hover")))}_selectStartHandler(e){this._preventsSelectStart&&e.preventDefault()}});
|
|
43
43
|
Smart("smart-multi-split-button",class extends Smart.DropDownList{static get properties(){return{buttonsDataSource:{value:[],type:"array"},dropDownOpenMode:{allowedValues:["none","dropDownButton","auto"],value:"dropDownButton",type:"string"}}}template(){return'<div id="container" role="presentation">\n <span class="smart-label" id="label">[[label]]</span>\n <div id="content" class="smart-content" role="presentation">\n <div id="actionButton" class ="smart-input smart-action-button" role="presentation">\n <template>\n <div class="smart-multi-split-button-buttons" *items={{buttonsDataSource}} role="presentation"><span class="smart-action-split-button" inner-H-T-M-L={{item}} role="button"></span></div>\n </template>\n </div>\n <span id="dropDownButton" class="smart-drop-down-button" role="button" aria-label="Toggle popup">\n <span class ="smart-drop-down-button-icon" id="arrow" aria-hidden="true"></span>\n </span>\n <div id="dropDownContainer" class="smart-drop-down smart-drop-down-container smart-visibility-hidden" role="presentation">\n <smart-list-box id="listBox" unfocusable\n animation="[[animation]]"\n data-source="[[dataSource]]"\n disabled="[[disabled]]"\n display-loading-indicator="[[displayLoadingIndicator]]"\n display-member="[[displayMember]]"\n filterable="[[filterable]]"\n filter-mode="[[filterMode]]"\n filter-input-placeholder="[[filterInputPlaceholder]]"\n grouped="[[grouped]]"\n group-member="[[groupMember]]"\n item-height="[[itemHeight]]"\n item-template="[[itemTemplate]]"\n incremental-search-delay="[[incrementalSearchDelay]]"\n incremental-search-mode="[[incrementalSearchMode]]"\n loading-indicator-placeholder="[[loadingIndicatorPlaceholder]]"\n loading-indicator-position="[[loadingIndicatorPosition]]"\n name="[[name]]"\n placeholder="[[dropDownPlaceholder]]"\n readonly="[[readonly]]"\n right-to-left="[[rightToLeft]]"\n selected-indexes="{{selectedIndexes}}"\n selection-mode="[[selectionMode]]"\n selected-values="{{selectedValues}}"\n sorted="[[sorted]]"\n theme="[[theme]]"\n value-member="[[valueMember]]"\n horizontal-scroll-bar-visibility="[[horizontalScrollBarVisibility]]"\n vertical-scroll-bar-visibility="[[verticalScrollBarVisibility]]"\n virtualized="[[virtualized]]">\n <content></content>\n </smart-list-box>\n <div id="resizeBar" class="smart-drop-down-resize-bar" aria-label="Resize">\n <div></div>\n </div>\n </div>\n </div>\n <span class="smart-hint" id="hint">[[hint]]</span>\n </div>'}static get listeners(){return{"actionButton.down":"_buttonsDownHandler","actionButton.mouseenter":"_buttonsMouseEventsHandler","actionButton.move":"_buttonsMouseEventsHandler","actionButton.mouseleave":"_buttonsMouseEventsHandler","dropDownButton.mouseenter":"_dropDownButtonMouseEventsHandler","dropDownButton.mouseleave":"_dropDownButtonMouseEventsHandler","actionButton.focus":"_focusEventHandler","actionButton.blur":"_blurEventHandler","dropDownButton.focus":"_focusEventHandler","dropDownButton.blur":"_blurEventHandler"}}static get styleUrls(){return["smart.dropdown.css","smart.multisplitbutton.css"]}_blurEventHandler(){const t=this;t.removeAttribute("focus"),t._preventDropDownClose||t.close()}_focusEventHandler(){this.setAttribute("focus","")}_documentUpHandler(t){const e=this;super._documentUpHandler(t);const n=(e.shadowRoot||e).querySelectorAll(".smart-action-split-button");for(let t=0;t<n.length;t++)n[t].removeAttribute("active");e.removeAttribute("active")}_dropDownButtonMouseEventsHandler(t){const e=this;"mouseleave"===t.type?(e.$.dropDownButton.removeAttribute("hover"),e.removeAttribute("hover")):(e.$.dropDownButton.setAttribute("hover",""),e.setAttribute("hover",""))}_buttonsDownHandler(t){const e=this,n=(e.shadowRoot||e).querySelectorAll(".smart-action-split-button");for(let o=0;o<n.length;o++){const r=n[o].getBoundingClientRect();"mouseleave"!==t.type?(e.setAttribute("active",""),n[o].removeAttribute("active"),r.left<=t.pageX&&t.pageX<=r.width+r.left&&(n[o].setAttribute("active",""),e.$.fireEvent("buttonClick",{index:o,label:e.buttonsDataSource[o]}))):(n[o].removeAttribute("active"),e.removeAttribute("active",""))}}_buttonsMouseEventsHandler(t){const e=this,n=(e.shadowRoot||e).querySelectorAll(".smart-action-split-button");for(let o=0;o<n.length;o++){const r=n[o].getBoundingClientRect();"mouseleave"!==t.type?(e.setAttribute("hover",""),n[o].removeAttribute("hover"),r.left<=t.pageX&&t.pageX<=r.width+r.left&&n[o].setAttribute("hover","")):(n[o].removeAttribute("hover"),e.removeAttribute("hover",""))}}_applySelection(){const t=this;if(0===t.buttonsDataSource.length){if("placeholder"===t.selectionDisplayMode||0===t.selectedIndexes.length)return void((t.shadowRoot||t).querySelector(".smart-template-container").innerHTML=t.placeholder);if(!t.$.listBox._items||0===t.$.listBox._items.length)return;(t.shadowRoot||t).querySelector(".smart-template-container").innerHTML='<div class="smart-multi-split-button-buttons"><span class="smart-action-split-button"></span></div>',t.$.actionButton.querySelector(".smart-action-split-button").appendChild(t._createToken())}}propertyChangedHandler(t,e,n){const o=this;"dataSource"===t||"displayMember"===t?(o._setDropDownSize(),o._positionDetection.checkBrowserBounds("vertically"),o._positionDetection.positionDropDown(),o._positionDetection.checkBrowserBounds("horizontally")):super.propertyChangedHandler(t,e,n)}_setAriaRelations(){const t=this;t.setAttribute("role","group"),t.setAttribute("aria-describedby",t.$.hint.id),t.setAttribute("aria-labelledby",t.$.label.id),t.getElementsByClassName("smart-template-container")[0].setAttribute("role","presentation");const e=t._ariaButton=t.$.dropDownButton;e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-expanded",t.opened),e.setAttribute("aria-owns",t.$.listBox.id)}});
|
|
@@ -62,7 +62,7 @@ Smart.Utilities.Assign("Grid.Dialog",class{_openImagePreviewDialog(e){const t=th
|
|
|
62
62
|
Smart.Utilities.Assign("Grid.Export",class{exportData(t,e){const o=this,a=new Smart.Utilities.DataExporter({exportHeader:o.dataExport.header}),r=[];a.expandChar=o.dataExport.expandChar,a.collapseChar=o.dataExport.collapseChar,a.pageOrientation=o.dataExport.pageOrientation,a.style=o.dataExport.style,a.filterBy=o.dataExport.filterBy,a.groupBy=o.dataExport.groupBy;const n=o.columns.toArray().slice(0).filter((t=>!1!==t.allowExport));if(a.header={columns:n,columngroups:o.columnGroups.slice(0)},!o.dataExport.style){const e=window.getComputedStyle(o),n=window.getComputedStyle(o.columns.length>0&&o.columns[0].element?o.columns[0].element:o.$.columnHeader),l=window.getComputedStyle(o.$.columnHeader);if(0!==o.offsetWidth&&0!==o.offsetHeight){const i=t=>{const e=t.fontSize,o=t.borderRightColor,a=t.backgroundColor,r=t.color,n=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f");function l(t){return(t=t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))?"#"+i(t[1])+i(t[2])+i(t[3]).toUpperCase():"#ffffff"}function i(t){return isNaN(t)?"00":n[(t-t%16)/16]+n[t%16]}return{borderColor:l(o),fontSize:e,fontFamily:"Helvetica",color:l(r),backgroundColor:l(a)}},d=i(e),s=i(n),c=i(l),p={height:o.$.columnHeader.offsetHeight+"px",border:"1px solid "+d.borderColor,fontFamily:c.fontFamily,fontSize:c.fontSize,color:c.color,backgroundColor:s.backgroundColor,fontWeight:"400"},f={border:"1px solid "+d.borderColor,fontFamily:d.fontFamily,fontSize:d.fontSize},u={height:o.rowMinHeight+"px"};for(let e=0;e<o.columns.length;e++){const a=o.columns[e];if(!a.allowExport)continue;if(!a.visible)continue;p[a.dataField]={textAlign:a.align,width:a.computedWidth+"px",format:a.cellsFormat||""};let n=a.cellsFormat||"";n||("date"===a.dataType?n="d":"dateTime"===a.dataType?n="D":"time"===a.dataType&&(n="t"));const l={textAlign:a.cellsAlign,format:n};if(f[a.dataField]=l,o.dataExport.view&&-1!==["html","jpeg","pdf","png"].indexOf(t)&&(a.template||a.formatFunction))for(let t=0;t<o.rows.length;t++){const e=o.rows[t];let n=o.rows[t]["column_"+a.dataField];if(o.dataExport.viewStart&&t<o.dataExport.viewStart||o.dataExport.viewEnd&&t>o.dataExport.viewEnd)continue;if(!n||e&&e.element&&e.element.classList.contains("smart-hidden")){const t=o._rowElements[0];if(!t)continue;if(e.element=t,e.grid=o,e.render(),n=e["column_"+a.dataField],!n)continue}const i={};i.border=n.borderColor,i.background=n.background,i.color=n.color;const d=void 0!==o.dataExport.viewStart?t-o.dataExport.viewStart:t;r[t]=Object.assign({},e.data),r[t][a.dataField]=n.element.textContent,l[d]=i}}o.appearance.alternationCount>0&&(u.alternationCount=o.appearance.alternationCount,u.alternationStart=o.appearance.alternationStart,u.alternationEnd=o.appearance.alternationEnd,u.alternationIndex0Color=d.color,u.alternationIndex0BackgroundColor=d.backgroundColor,u.alternationIndex1Color=d.color,u.alternationIndex1BackgroundColor="#F5F5F5"),a.style={border:"1px solid "+d.borderColor,borderCollapse:"collapse",header:p,columns:f,rows:u}}}const l=!o.rowHierarchy||o.grouping.enabled?o.rows.toArray():o.rowHierarchy,i=o.dataExport.rowIds,d=null!==i;let s=[];if(o.dataExport.view)o._recyclingRows.forEach(((t,e)=>{if(o.dataExport.viewStart&&e<o.dataExport.viewStart||o.dataExport.viewEnd&&e>o.dataExport.viewEnd)return!0;r[e]?s.push(r[e]):s.push(t.data)}));else{for(let e=0;e<l.length;e++){const a=l[e];if(a.visible&&(!1!==a.filtered||void 0===a.filtered)){if(d&&-1===i.indexOf(a.id))continue;const e={};for(let r=0;r<o.columns.length;r++){const n=o.columns[r];if(!n.allowExport)continue;const l=n.dataField;let i=a.data[l];if("taskChecklist"===l)if(i){const t=i.map((t=>{let e=t.text;return t.completed?e="✓ "+e:e+="X "+e,e}));i=t.toString()}else i="";if("taskUserId"===l){const t=o.users.find((t=>t.id===parseInt(i)||parseInt(t.id)===parseInt(i)));t&&(i=t.name)}if(void 0===i)if("createdBy"===n.template){const t=o.users.find((t=>t.id===a.createdBy));if(t){const o=t,a="string"==typeof o?o:o.name;e[l]=a}else e[l]=""}else if("createdTime"===n.template){const t=a.getCell(l).getFormattedValue(a.createdTime,"d")+" "+a.getCell(l).getFormattedValue(a.createdTime,"t");e[l]=t}else if("modifiedBy"===n.template){const t=o.users.find((t=>t.id===a.modifiedBy));if(t){const o=t,a="string"==typeof o?o:o.name;e[l]=a}else e[l]=""}else if("modifiedTime"===n.template){const t=a.getCell(l).getFormattedValue(a.modifiedTime,"d")+" "+a.getCell(l).getFormattedValue(a.modifiedTime,"t");e[l]=t}else e[l]="";else if(i&&i.indexOf&&(i.indexOf("{")>=0||"[]"===i)){const t=i.indexOf("{")>=0||"[]"===i?JSON.parse(i):i.split(", "),o=[];for(let e=0;e<t.length;e++)"string"==typeof t[e]?o.push(t[e]):o.push(t[e].label);e[l]=o.join(",")}else if("csv"===t||"tsv"===t)if(n.cellsFormat){const t=a.getCell(l).getFormattedValue(i,n.cellsFormat);e[l]=t}else e[l]=i;else e[l]=i}s.push(e)}}l!==o.rowHierarchy||d||(s=o.dataSource.boundHierarchy,a.hierarchical=!0)}!o.dataExport.groupBy&&o.grouping.enabled&&o.dataSource&&o.dataSource.groupBy&&(a.groupBy=o.dataSource.groupBy&&o.dataSource.groupBy.toArray?o.dataSource.groupBy.toArray():null),o.checkLicense(!0);const c=a.exportData(s,t,o.dataExport.fileName,e);return o.dataExport.view&&o._recycle(!1),c}print(){const t=this,e=t.dataExport.fileName;t.dataExport.fileName=null;const o=t.exportData("html"),a=window.open("","","width=800,height=500"),r=a.document.open(),n='<!DOCTYPE html><html><head><meta charset="utf-8" /><title>'+e+"</title></head><body>"+o+"</body></html>";try{r.write(n),r.close(),setTimeout((function(){a.print(),a.close()}),100)}catch(t){}t.dataExport.fileName=e}});
|
|
63
63
|
Smart.Utilities.Assign("Grid.Chart",class{_getChartDataFields(e){const t=this,i=e[0];let a,n=!0,o=[];for(let e in i)"$"!==e&&("string"===t.dataSource.dataFields.find((t=>t.name===e)).dataType?0===t.columns.findIndex((t=>t.dataField===e))&&(a=e):(n=!1,o.push({dataField:e,displayText:e})));return{xAxisDataField:a,series:o,stringOnly:n}}createChart(e,t){const i=this,a=i.getSelection(),n=a.rows,o=a.columns,s=a.cells,l=document.createElement("smart-chart"),r=[],d={};let c,h=[],g=[];if(s&&s.length>1&&s.forEach((e=>{-1===h.indexOf(e.row.index)&&h.push(e.row.index),-1===g.indexOf(e.dataField)&&g.push(e.dataField)})),t)r.concat(t);else for(let e=0;e<i.dataSource.length;e++){const t={};if(n){if(!n.find((t=>t.row.index===e)))continue}else{if(o){o.forEach((a=>{t[a.dataField]=i.dataSource[e][a.dataField]})),r.push(t);continue}if(s&&s.length>1){if(-1===h.indexOf(e))continue;g.forEach((a=>{t[a]=i.dataSource[e][a]})),r.push(t);continue}}i.columns.forEach((a=>t[a.dataField]=i.dataSource[e][a.dataField])),r.push(t)}const f=i._getChartDataFields(r);if(f.stringOnly){if(i.header.visible&&i.$.header.firstElementChild){const t=i.enableShadowDOM?i.shadowRoot.getElementById(e):i.querySelector("#"+e);i.$.header.firstElementChild.classList.add("warning"),t&&t.classList.add("warning"),setTimeout((function(){i.$.header.firstElementChild.classList.remove("warning"),t&&t.classList.remove("warning")}),1e3)}}else{if(c=f.series,l.caption="",l.description="",l.clip=!1,l.showLegend=!0,l.showBorderLine=!1,l.padding={left:5,top:10,right:5,bottom:5},l.dataSource=r,l.xAxis={dataField:f.xAxisDataField,gridLines:{visible:!0}},l.valueAxis={displayValueAxis:!0,description:i.charting.description,axisSize:"auto",formatSettings:i.charting.formatSettings},l.colorScheme=i.charting.colorScheme,l.seriesGroups=[d],d.formatSettings=i.charting.formatSettings,d.series=c,"line"===e)c.forEach((function(e){e.symbolSize=8,e.symbolType="square"}));else if("pie"===e){const e=c[0].dataField;delete d.formatSettings,d.formatFunction=function(e,t){return isNaN(e)&&"object"==typeof e?t:e},d.showLabels=!0,c.length=0,c.push({dataField:e,displayText:f.xAxisDataField,initialAngle:0})}else if("bar"===e)e="column",d.orientation="horizontal",l.xAxis.textRotationAngle=90,l.valueAxis.textRotationAngle=30,l.valueAxis.flip=!0;else if("area"===e){let e=1;for(let t=0;t<c.length;t++)c[t].opacity=e,e-=.2,e=Math.max(.3,e)}if(d.type=e,i.onChartInit&&i.onChartInit(l),i.charting.appendTo){const e="string"===i.charting.appendTo?document.querySelector(i.charting.appendTo):i.charting.appendTo;e&&e.appendChild(l)}else i._openChartDialog(l,e)}}_openChartDialog(e,t){const i=this;if(!i.charting.dialog.enabled)return!1;const a=i._dialogChart||i._createDialog(i.charting.dialog),n=t.substring(0,1).toUpperCase()+t.substring(1),o="{{message}}"===i.charting.dialog.header?i.localize("dialogChartHeader",{value:n}):i.charting.dialog.header;e.style.width="100%",e.style.height="100%",a.header.innerHTML=o,a.content.innerHTML="",a.content.style.width="100%",a.content.style.height="100%",a.btnCancel.classList.add("smart-hidden"),i._dialogChart||(a.modal=!0,a.onOpen=function(){i.charting.dialog.visible=!0},a.onClose=function(){i.charting.dialog.visible=!1},a.btnConfirm.onclick=function(){a.close()},a.btnClose.onclick=function(){a.close()},a.onkeydown=function(e){"Escape"===e.key&&a.close()},i._dialogChart=a),a.open(),setTimeout((function(){a.btnConfirm.focus(),a.content.appendChild(e)}),100)}});
|
|
64
64
|
Smart("smart-grid-toolbar",class extends Smart.DataView{template(){return'<div id="container" role="presentation">\n <div id="header" class="smart-data-view-header" role="toolbar">\n <div id="viewsButton" class="smart-data-view-header-button smart-data-view-views-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Views"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="customizeButton" class="smart-data-view-header-button smart-data-view-customize-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Customize cards"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="filterButton" class="smart-data-view-header-button smart-data-view-filter-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Filter"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="sortButton" class="smart-data-view-header-button smart-data-view-sort-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Sort"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="groupButton" class="smart-data-view-header-button smart-data-view-group-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Group"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="formatButton" class="smart-data-view-header-button smart-data-view-format-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Format"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="deleteButton" class="smart-data-view-header-button smart-data-view-delete-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Delete"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="downloadButton" class="smart-data-view-header-button smart-data-view-download-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Download"><div class="smart-tool-label" role="presentation"></div></div>\n <div id="searchButton" class="smart-data-view-header-button smart-data-view-search-button smart-unselectable" role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Search"></div>\n <div id="headerDropDown" owner class="smart-data-view-header-drop-down smart-visibility-hidden" role="dialog">\n <div id="customize" class="smart-hidden" role="presentation"></div>\n <div id="filter" class="smart-hidden" role="presentation"></div>\n <div id="sort" class="smart-hidden" role="presentation"></div>\n <div id="group" class="smart-hidden" role="presentation"></div>\n <div id="format" class="smart-hidden" role="presentation"></div>\n <div id="search" class="smart-data-view-search-box smart-hidden" role="presentation">\n <input type="text" id="searchInput" spellcheck="false" aria-label="Search" />\n <div id="searchLabel" class="smart-data-view-search-label smart-unselectable"></div>\n <div id="searchPrev" class="smart-data-view-search-prev" role="button" aria-label="Previous"></div>\n <div id="searchNext" class="smart-data-view-search-next" role="button" aria-label="Next"></div>\n <div id="searchClose" class="smart-data-view-search-close" role="button" aria-label="Close search box"></div>\n </div>\n </div>\n </div>\n </div>'}refreshTools(){const e=this;if(e.isRendered&&e.grid&&(e.grid.offsetWidth<600?e.querySelectorAll(".smart-tool-label").forEach((e=>{e.classList.add("smart-hidden")})):e.querySelectorAll(".smart-tool-label").forEach((e=>{e.classList.remove("smart-hidden")})),e.refreshHeaderDropDownPosition(),e.grid)){const t=e.grid;if(t.dataSource&&t.dataSource.boundSource){const a=t.dataSource&&t.dataSource.virtualDataSource&&!t.dataSource.virtualDataSourceOnExpand&&t.dataSource.length>t.virtualModeCachedRowsCount&&"infinite"!==t.scrolling;if(e.dataSource&&t.dataSource&&e.dataSource.length!==t.dataSource.length||a)if(a){const a=Array.isArray(t.dataSource.boundSource)?t.dataSource.boundSource:t.dataSource.boundSource.toArray();e.dataSource=new Smart.DataAdapter({observable:!1,dataSource:[...a],dataFields:t.dataSource.dataFields})}else e.dataSource=t.dataSource;(t=>{const a=t?"add":"remove";e.$.filterButton.classList[a]("smart-disabled"),e.$.sortButton.classList[a]("smart-disabled"),e.$.groupButton.classList[a]("smart-disabled"),e.$.formatButton.classList[a]("smart-disabled"),e.$.searchButton.classList[a]("smart-disabled"),e.$.downloadButton.classList[a]("smart-disabled")})(e.dataSource&&0===e.dataSource.length),0===t.columns.length?e.$.customizeButton.classList.add("smart-disabled"):e.$.customizeButton.classList.remove("smart-disabled")}}}get hasStyleObserver(){return!1}render(){const e=this;e._appliedFiltering={filters:[],operator:"and"},e._appliedSorting={dataFields:[],dataTypes:[],orderBy:[]},e._localizeHeader(),e._getInnerElementMessages(),super.render()}openFormatPanel(){const e=this,t=e.dataSource;if(!t||0===t.length||e.disabled||"none"===e.headerPosition)return;let a;if(e._refreshColumns("format"),e.grid.closeMenu(),e._editInfo&&e._editInfo.window.close(),e._closeDownloadMenu(),e._closeViewsMenu(),e.$.headerDropDown.classList.add("format-panel"),e.$.headerDropDown.classList.remove("customize-panel","sort-panel","search-panel","filter-panel"),e.$.format.classList.remove("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.group&&e.$.group.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e._closeSearchPanel(),e._formatPartCreated)a=e.$.format.firstElementChild,a.columns=e.columns,a.dataSource=e.dataSource,a.locale=e.locale,a.messages=e._innerElementMessages.formattingPanel,a.rightToLeft=e.rightToLeft;else{a=document.createElement("smart-formatting-panel"),a.animation=e.animation,a.columns=e.columns,a.dataSource=e.dataSource,a.locale=e.locale,a.messages=e._innerElementMessages.formattingPanel,a.rightToLeft=e.rightToLeft,a.theme=e.theme,a.unfocusable=!1,a.ownerElement=e,a.dropDownAppendTo="body",e._formattingPanel=a,e.$.format.appendChild(a);const t=document.createElement("div");t.className="smart-format-panel smart-grid-panel-container-footer",t.setAttribute("role","presentation"),t.innerHTML=`<div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation"><span class="smart-grid-panel-cancel-button" role="button">${e.localize("cancel")}</span><span class="smart-grid-panel-apply-button" role="button">${e.localize("apply")}</span></div>`,e._formattingPanel.$.apply=t.querySelector(".smart-grid-panel-apply-button"),e._formattingPanel.$.cancel=t.querySelector(".smart-grid-panel-cancel-button"),e.$.format.appendChild(t),e._formatPartCreated=!0,t.applyButton=t.querySelector(".smart-grid-panel-apply-button"),t.cancelButton=t.querySelector(".smart-grid-panel-cancel-button"),t.applyButton.onclick=()=>{a.$.fireEvent("apply"),e.grid._conditionalFormattingChanged=!0,e.grid._conditionalFormatting=a.apply(),e.grid.conditionalFormatting=a.getItems(),e.grid._recycle(!1),e.grid._conditionalFormattingChanged=!1},t.cancelButton.onclick=()=>{a.$.fireEvent("cancel")},e.grid.conditionalFormatting&&(a.items=e.grid.conditionalFormatting)}a.focus(),e._openHeaderDropDown(e.$.formatButton)}_openHeaderDropDown(e){const t=this;t.$.headerDropDown.parentElement!==document.body&&(document.body.appendChild(t.$.headerDropDown),t.$.headerDropDown.addEventListener("apply",(e=>{const a=t._getDropDownType();t._applyHandler(e),t.grid.$.fireEvent("batchChange",{type:a})})),t.$.headerDropDown.addEventListener("cancel",(()=>{const e=t._getDropDownType();t.closePanel(),t.grid.$.fireEvent("batchCancel",{type:e})}))),super._openHeaderDropDown(e),t.refreshHeaderDropDownPosition(e)}refreshHeaderDropDownPosition(e){const t=this;if(!t.$.headerDropDown||t.$.headerDropDown&&!t.$.headerDropDown.classList.contains("open"))return void(t._dropDownTarget=e);e?t._dropDownTarget=e:t._dropDownTarget&&(e=t._dropDownTarget);const a=t.grid.parentElement,o=a?a.scrollTop:0;t.$.headerDropDown.style.top=t.grid.offset(t.grid).top+t.grid.$.header.offsetHeight-o+"px";const n=()=>{if(e){const a=t.grid.offset(e);a.left+t.$.headerDropDown.offsetWidth<document.body.scrollLeft+document.body.offsetWidth?t.$.headerDropDown.style.left=a.left+"px":t.$.headerDropDown.style.left=document.body.scrollLeft+document.body.offsetWidth-t.$.headerDropDown.offsetWidth+"px"}else t.$.headerDropDown.style.left=t.grid.offset(t.grid).left+"px"};t.grid.offsetWidth<600&&t.$.headerDropDown.offsetWidth>t.grid.offsetWidth?(t.$.headerDropDown.style.width="90%",t.$.headerDropDown.style.left=t.grid.offset(t.grid).left+"px"):(t.$.headerDropDown.style.width="",n())}openFilterPanel(e){const t=this,a=t.dataSource;t._refreshColumns("filter");const o=this.columns.map((e=>{const t=Object.assign({},e),o=a.dataFields.find((e=>e.name===t.dataField));return o&&(t.dataType=o.dataType),t})).filter((e=>e.allowFilter));if(super.openFilterPanel(o,null),t._closeDownloadMenu(),t._closeViewsMenu(),t.grid.closeMenu(),e){const a=t.$.headerDropDown.querySelector("smart-multi-column-filter-panel");a.$.itemsContainer.appendChild(a._createItem(t.columns.find((t=>t.dataField===e.dataField)),"string"===e.dataType?"CONTAINS":"EQUAL",""));const o=a.querySelectorAll(".smart-grid-panel-item");setTimeout((()=>{o[o.length-1].querySelector(".editor").focus()}),350)}}openSortPanel(e){const t=this,a=t.dataSource;t._refreshColumns("sort");const o=t.columns.map((e=>{const o=Object.assign({},e),n=t._appliedSorting.dataFields.indexOf(o.dataField),s=a.dataFields.find((e=>e.name===o.dataField));return s&&(o.dataType=s.dataType,o.sortIndex=n,-1!==n&&(o.sortDirection=t._appliedSorting.orderBy[n])),o})).filter((e=>e.allowSort));if(e&&t._appliedSorting&&-1===t._appliedSorting.dataFields.indexOf(e.dataField)){const a=o.find((t=>t.dataField===e.dataField));a.sortDirection="ascending",a.sortIndex=t._appliedSorting.dataFields.length}super.openSortPanel(o),t._closeDownloadMenu(),t._closeViewsMenu();const n=t.grid;n.closeMenu();const s=t.$.headerDropDown.querySelector("smart-sort-panel");if(!s)return;s.grid=n,s.$.maintainSortContainer.classList.remove("smart-hidden"),n.sorting.maintainSort?s.$.maintainSortContainer.firstElementChild.setAttribute("active",""):s.$.maintainSortContainer.firstElementChild.removeAttribute("active"),s._changeApplyButtonText();const i=s.$.inputNotSorted,r=()=>{const e=s.querySelectorAll(".smart-grid-panel-item");"many"===t.grid.sorting.mode||e.length<1?i.classList.remove("smart-visibility-hidden"):e.length>=1&&i.classList.add("smart-visibility-hidden")};s.onDataSourceChange=()=>{r()},r()}openCustomizePanel(){const e=this;if(e.disabled||"none"===e.headerPosition)return;e._closeDownloadMenu(),e._closeViewsMenu(),e._refreshColumns("customize");let t=e.columns;const a=e.grid;a.closeMenu(),a.appearance.showColumnGroupsInColumnPanel&&(t=[],a.columns.forEach((e=>{if(!e.columnGroup){const a={label:e.label,dataField:e.dataField,level:0,parentDataField:null,dataType:e.dataType||"string",columnGroup:e.columnGroup||null,allowHide:void 0===e.allowHide||e.allowHide,allowSort:void 0===e.allowSort||e.allowSort,allowFilter:void 0===e.allowFilter||e.allowFilter,allowGroup:void 0===e.allowGroup||e.allowGroup,visible:void 0===e.visible||e.visible};t.push(a)}})),a._columnGroups.forEach((e=>{const a={dataField:e.name,label:e.label,level:0,disableDrag:!0,disableToggle:!1,allowHide:!0};if(t.push(a),e.columns){let o=e.columns.length,n=0,s=[],i=[];e.columns.forEach((a=>{const r={label:a.label,dataField:a.dataField,level:1,parentDataField:e.name,dataType:a.dataType||"string",columnGroup:a.columnGroup||null,allowHide:void 0===a.allowHide||a.allowHide,allowSort:void 0===a.allowSort||a.allowSort,allowFilter:void 0===a.allowFilter||a.allowFilter,allowGroup:void 0===a.allowGroup||a.allowGroup,visible:void 0===a.visible||a.visible};!1===r.allowHide&&(o--,i.push(r.dataField)),r.visible||(n++,s.push(r.dataField)),t.push(r)})),o<=0&&(a.allowHide=!1,a.disableToggle=!0),e.columns.length===n||o===n&&i.toString()!==s.toString()?a.visible=!1:a.visible=!0}})));const o=e.$.customize,n=t.map((t=>{const a={};return a.visible=t.visible,a.label=t.label,a.dataField=t.dataField,-1!==[e.coverField,e.titleField].indexOf(a.dataField)?a.disableToggle=!0:a.disableToggle=!1,void 0!==t.level&&(a.level=t.level),t.disableDrag&&(a.disableDrag=!0),t.parentDataField&&(a.parentDataField=t.parentDataField),t.allowHide||(a.disableToggle=!0),a}));let s;if(e._closeDialog(),e.$.headerDropDown.classList.add("customize-panel"),e.$.headerDropDown.classList.remove("filter-panel","sort-panel","search-panel","group-panel","format-panel"),o.classList.remove("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e.$.group.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e._closeSearchPanel(),e._customizePartCreated)s=o.querySelector("smart-column-panel"),s.locale=e.locale,s.messages=e._innerElementMessages.columnPanel,s.set("dataSource",n),s.propertyChangedHandler("dataSource",void 0,n),s.rightToLeft=e.rightToLeft;else{const t=document.createDocumentFragment(),a=document.createElement("smart-column-panel");a.rightToLeft=e.rightToLeft,a.animation=e.animation,a.dataSource=n,a.locale=e.locale,a.messages=e._innerElementMessages.columnPanel,a.theme=e.theme,t.appendChild(a),e.$.customize.appendChild(t),e._customizePartCreated=!0}e._changedVisibility=new Map,e._openHeaderDropDown(e.$.customizeButton)}_applyFilter(e,t){const a=this;a.grid.beginUpdate(),a.grid.context=a.grid,a.grid.clearFilter();for(let t=0;t<e.length;t++){const o=e[t],n=o[0],s=o[1];a.grid.columnByDataField[n].filter=s}a.grid._filterOperator=t,a.grid.endUpdate(),a.grid.refreshFilters(),a.grid.context=document,a.grid.autoSaveState()}_applySort(){const e=this,t=e._appliedSorting;e.grid.beginUpdate(),e.grid.sorting.maintainSort=t.maintainSort,e.grid.context=e.grid,e.grid.clearSort();for(let a=0;a<t.dataFields.length;a++)e.grid.sortBy(t.dataFields[a],t.orderBy[a]);e.grid.endUpdate(),e.grid.context=document,e.grid.autoSaveState()}_getDropDownType(){const e=this;let t=null;return e.$.headerDropDown.classList.contains("filter-panel")?t="filter":e.$.headerDropDown.classList.contains("sort-panel")?t="sort":e.$.headerDropDown.classList.contains("search-panel")?t="search":e.$.headerDropDown.classList.contains("group-panel")?t="group":e.$.headerDropDown.classList.contains("format-panel")?t="format":e.$.headerDropDown.classList.contains("customize-panel")&&(t="customize"),t}_applyHandler(e){const t=this,a=e.target,o=e.detail,n=t.$.customize;if(t.grid&&"kanban"===t.grid.view&&t.grid._kanban&&n.contains(a))return t.grid._kanban._applyHandler(e,"customize"),void t.closePanel();n.contains(a)?t._applyColumns(o.value,o.moves):t.$.filter.contains(a)?t.addFilter(o.filters,o.operator,o.value):t.$.sort.contains(a)&&t.addSort(o.sortByInfo),t.closePanel()}_documentUpHandler(e){const t=this;let a=e.originalEvent.target;const o=t.grid.$.header;if(t.shadowRoot&&a===t&&(a=e.originalEvent.composedPath()[0]),t._closeDownloadMenu(),t._closeViewsMenu(),!("none"===t.headerPosition||t.$.headerDropDown.classList.contains("smart-visibility-hidden")||t.$.headerDropDown.classList.contains("search-panel")||a!==o&&o.contains(a))){const n=a.closest("smart-scroll-viewer"),s=a.closest(".smart-drop-down");if((!n||!o.contains(n.ownerElement))&&(!s||s.ownerElement&&!o.contains(s.ownerElement))){const a=e.originalEvent.composedPath();for(let e=0;e<a.length;e++){const t=a[e];if(t&&t.classList&&t.classList.contains("smart-data-view-header-drop-down"))return;if(t&&t.classList&&t.classList.contains("smart-formatting-panel-popup"))return}if(n&&n.ownerElement){const e=n.ownerElement.parents;for(let t=0;t<e.length;t++){const a=e[t];if(a&&a.classList&&a.classList.contains("smart-data-view-header-drop-down"))return}}if(s&&s.ownerElement){const e=s.ownerElement.parents;for(let t=0;t<e.length;t++){const a=e[t];if(a&&a.classList&&a.classList.contains("smart-data-view-header-drop-down"))return}}if(t.$.headerDropDown.querySelector("[open]"))return;t.closePanel()}}}_refreshColumns(e){const t=this,a=t.grid;let o,n=new Map;if("kanban"===a.view&&a._kanban)switch(e){case"customize":return o=a._kanban._getCustomizeColumnPanelDataSource(),o=JSON.parse(JSON.stringify(o)),t._refreshCustomizeButton(),void(t.columns=o)}o=Array.isArray(a.columns)?[...a.columns]:[...a.columns.toArray()],o=o.filter((t=>!1!==t._visible&&!(("filter"===e||"sort"===e)&&("sort"===e&&!t.sortOrder||"filter"===e&&!t.filter)&&!1===t.visible))),o=o.map((e=>{let t=e.allowHide;return a.grouping&&a.grouping.autoHideGroupColumn&&a.dataSource.groupBy.indexOf(e.dataField)>=0&&(t=!1),{label:e.label,dataField:e.dataField,dataType:e.dataType||"string",columnGroup:e.columnGroup||null,allowHide:void 0===e.allowHide||t,allowSort:void 0===e.allowSort||e.allowSort,allowFilter:void 0===e.allowFilter||e.allowFilter,allowGroup:void 0===e.allowGroup||e.allowGroup,visible:void 0===e.visible||e.visible,sortIndex:void 0!==e.sortIndex&&null!==e.sortIndex?e.sortIndex:-1,sortDirection:void 0!==e.sortOrder?e.sortOrder:null}})),o=JSON.parse(JSON.stringify(o)),o.forEach((e=>{let t=e.columnGroup?e.columnGroup+"."+e.label:e.label,a=1;for(;n.get(t);)t=e.columnGroup?e.columnGroup+"."+e.label+` (${a})`:e.label+` (${a})`,a++;n.set(t,e),e.label=t})),t.columns=o,t._refreshCustomizeButton()}_init(e){const t=this;if(t.grid=e,e.dataSource&&e.dataSource.boundSource){t._refreshColumns("init");const a=Array.isArray(e.dataSource.boundSource)?e.dataSource.boundSource:e.dataSource.boundSource.toArray();t.dataSource=new Smart.DataAdapter({observable:!1,dataSource:[...a],dataFields:e.dataSource.dataFields})}t.grid._openRowSettingsDialog=t._openRowSettingsDialog,t.rightToLeft=t.grid.rightToLeft,t.refreshTools(),t.$.headerDropDown.onclick=e=>{t.grid._headerClickHandler(e),e.stopPropagation(),e.preventDefault()},t.grid.removeEventListener("change",t._refreshFromSelection),t.grid.addEventListener("change",t._refreshFromSelection),e.header.onInit&&e.header.onInit(t)}_removeMenu(){const e=this;if(e.downloadMenu){const t=e.downloadMenu.querySelector("smart-menu");t&&e.downloadMenu.removeChild(t)}}_removeViewsMenu(){const e=this;if(e.viewsMenu){const t=e.viewsMenu.querySelector("smart-menu");t&&e.viewsMenu.removeChild(t)}}_createViewsMenuItems(){const e=this,t=e.grid;e._removeViewsMenu();const a=document.createElement("smart-menu"),o=document.createDocumentFragment();a.classList.add("smart-grid-views-menu"),a.checkable=!0,a.checkboxes=!0,a.style.width="100%",a.mode="vertical",a.dropDownAppendTo="body",a.rightToLeft=t.rightToLeft;const n=(e,a,o)=>{const n=document.createElement("smart-menu-item");let s="#D50000",i="smart-icon-table-alt";switch(a){case"grid":s="#3f51b5",i="smart-icon-table-alt","grid"===t.view&&o&&(n.setAttribute("focus",""),n.checked=!0);break;case"kanban":s="#C40093",i="smart-icon-kanban","kanban"===t.view&&o&&(n.setAttribute("focus",""),n.checked=!0)}return n.label='<span style="color: '+s+'" class="smart-grid-icon '+i+'"></span>'+e,n.value=a,n};if(o.appendChild(n(t.localize("viewGrid"),"grid",!0)),o.appendChild(n(t.localize("viewKanban"),"kanban",!0)),a.appendChild(o),e.viewsMenu.insertBefore(a,e.viewsMenu.children[e.viewsMenu.children.length-1]),e.viewsMenu.onpointerup=()=>!1,t.stateSettings.enabled){if(!e.viewsMenu.querySelector(".smart-grid-view-chooser-container")){const a=document.createElement("div");a.classList.add("smart-grid-view-chooser-container");const o=document.createElement("div");o.classList.add("new-view");const n=document.createElement("smart-button");n.style.setProperty("--smart-background-color","#3f51b5"),n.style.setProperty("--smart-border","#3f51b5"),n.style.setProperty("--smart-button-padding","4px 12px"),n.innerHTML='<span class="smart-grid-icon smart-icon-plus"></span>'+t.localize("saveView"),n.onpointerdown=a=>{a.stopPropagation(),a.preventDefault(),t.beginUpdate();const o=t.view;t.stateSettings.current||(t.stateSettings.current=e.viewsMenu._input.value),t.saveState(),t.stateSettings.current=e.viewsMenu._input.value,e._closeViewsMenu(),t.resetState(),"grid"!==o&&(delete t.columnByDataField.taskStatus,e._setView(o)),t.saveState(),t.endUpdate()};const s=document.createElement("div");s.classList.add("smart-grid-view-storage"),a.appendChild(s);const i=document.createElement("smart-input");i.classList.add("underlined"),i.onkeyup=i.onchange=()=>{t.stateSettings.storage[i.value]?n.disabled=!0:n.disabled=!1},i.value=t.localize("viewGrid")+1,o.appendChild(i);const r=document.createElement("div");o.appendChild(r),r.appendChild(n),a.appendChild(o),e.viewsMenu._storage=s,e.viewsMenu._input=i,e.viewsMenu.appendChild(a)}const a=t.stateSettings.storage,o=e.viewsMenu._storage;o.innerHTML="";const n=document.createElement("label"),s=t.localize("noView");if(n.innerHTML='<span class="smart-grid-icon smart-icon-clock"></span>'+s,o.appendChild(n),a){let s=1;const i=document.createDocumentFragment(),r=(a,o,n)=>{const s=document.createElement("smart-menu-item");let i="smart-icon-table-alt";switch(o){case"grid":i="smart-icon-table-alt";break;case"kanban":i="smart-icon-kanban"}return s.value=n,s.valueName=a,a===t.stateSettings.current?(s.checked=!0,s.label='<span class="smart-grid-icon '+i+'"></span>'+a+"</span>"):s.label='<span class="smart-grid-icon '+i+'"></span>'+a+'<span class="smart-grid-icon smart-icon-delete"></span>',s.onpointerdown=a=>{if(a.target&&a.target.classList.contains("smart-icon-delete")){const e=a.target.closest("smart-menu-item");delete t.stateSettings.storage[e.valueName],t.stateSettings.current===e.valueName&&(t.stateSettings.current=""),e.remove()}else{const o=a.target.closest("smart-menu-item");t.loadState(o.valueName),e._closeViewsMenu()}},s};for(let e in a){const t=a[e];s++,i.appendChild(r(e,t.view,t))}if(s){const e=t.localize("myView");n.innerHTML='<span class="smart-grid-icon smart-icon-clock"></span>'+e;const a=document.createElement("smart-menu");a.style.width="100%",a.mode="vertical",a.classList.add("smart-grid-views-menu"),a.checkable=!0,a.checkboxes=!0,a.checkMode="radioButton",a.disableAutoCheck=!0,a.rightToLeft=t.rightToLeft,a.appendChild(i),o.appendChild(a)}e.viewsMenu._input.value=t.localize("myView")+s}}a.onItemClick=a=>{e._setView(a.detail.value),e._closeViewsMenu(),t.autoSaveState()}}_setView(e){const t=this,a=t.grid;if(a.view!==e){if("kanban"===e){const e=a.context;a.context=a,a.view="kanban",a.context=e,a._kanbanInitialized&&a.columnByDataField.taskStatus?(a._showKanbanView(),t._refresh()):(delete a._kanbanInitialized,a._initKanbanView("dynamic"))}else"grid"===e&&(a.view="grid",a._hideKanbanView(),t._refresh());a.$.fireEvent("viewChanged",{view:e}),t._refresh()}}_createMenuItems(){const e=this,t=e.grid;e._removeMenu();const a=document.createElement("smart-menu"),o=document.createDocumentFragment();a.mode="vertical",a.dropDownAppendTo="body",a.classList.add("smart-grid-download-menu"),a.rightToLeft=t.rightToLeft;const n=(e,t)=>{const a=document.createElement("smart-menu-item");let o="#D50000";switch(t){case"csv":o="#3f51b5";break;case"pdf":o="#f4511e";break;case"xlsx":o="#0b8043";break;case"json":o="#8e24aa"}const n='<span style="position: absolute; top: 0px; font-size: 10px; color: '+o+'">'+t+"</span>";return a.label='<span style="color: '+o+'" class="smart-grid-icon smart-icon-docs"></span>'+n+e,a.value=t,a};o.appendChild(n(t.localize("download")+" CSV","csv")),o.appendChild(n(t.localize("download")+" XLSX","xlsx")),o.appendChild(n(t.localize("download")+" JSON","json")),a.appendChild(o),e.downloadMenu.appendChild(a),a.onItemClick=e=>{const a=new Date;t.dataExport.fileName="data_"+a.getFullYear()+"-"+a.getMonth()+"-"+a.getDate(),t.exportData(e.detail.value)}}closePanel(){const e=this;super.closePanel(),e.grid&&e.grid.focus(),e.downloadMenu&&e.downloadMenu.classList.contains("open")?e._closeDownloadMenu():e.viewsMenu&&e.viewsMenu.classList.contains("open")&&e._closeViewsMenu()}_closeDownloadMenu(){const e=this,t=e.downloadMenu;t&&(t.parentNode&&(t.classList.remove("open"),setTimeout((()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),100)),e.$.downloadButton.classList.remove("selected"),e.$.downloadButton.removeAttribute("aria-expanded"),t.classList.remove("open"))}_openDownloadMenu(){const e=this;if(e.grid.editing.isEditing&&e.grid.cancelEdit(),e.downloadMenu&&e.downloadMenu.classList.contains("open"))return void e._closeDownloadMenu();e.$.headerDropDown.classList.remove("group-panel","customize-panel","filter-panel","sort-panel","search-panel","format-panel"),e.$.group.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e.closePanel(),e.$.downloadButton.classList.add("selected"),e.$.downloadButton.setAttribute("aria-expanded",!0),e.downloadMenu||(e.downloadMenu=document.createElement("div"),e.downloadMenu.classList.add("smart-grid-column-menu","smart-grid-download-menu"),e.downloadMenu.setAttribute("theme",e.getAttribute("theme")),e.downloadMenu.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)),e.downloadMenu.classList.add("smart-animate"),e._createMenuItems(),e.downloadMenu.style.height="auto",e.isInShadowDOM?e.getRootNode().appendChild(e.downloadMenu):document.body.appendChild(e.downloadMenu);const t=e.$.downloadButton.getBoundingClientRect();let a=t.left+window.pageXOffset,o=t.bottom+window.pageYOffset;a+e.downloadMenu.offsetWidth>window.innerWidth&&(a=t.right+window.pageXOffset-e.downloadMenu.offsetWidth,a+e.downloadMenu.offsetWidth>window.innerWidth&&(a=window.innerWidth-e.downloadMenu.offsetWidth)),e.downloadMenu.style.left=a+"px",e.downloadMenu.style.top=o+"px",e.downloadMenu.classList.remove("smart-hidden"),e.downloadMenu.classList.add("open")}_closeViewsMenu(){const e=this,t=e.viewsMenu;t&&(t.parentNode&&(t.classList.remove("open"),setTimeout((()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}),100)),t.classList.remove("open"),e.$.viewsButton.classList.remove("selected"),e.$.viewsButton.removeAttribute("aria-expanded"))}_openViewsMenu(){const e=this;if(e.grid.editing.isEditing&&e.grid.cancelEdit(),e.viewsMenu&&e.viewsMenu.classList.contains("open"))return void e._closeViewsMenu();e.$.headerDropDown.classList.remove("group-panel","customize-panel","filter-panel","sort-panel","search-panel","format-panel"),e.$.group.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e.closePanel(),e.$.viewsButton.classList.add("selected"),e.$.viewsButton.setAttribute("aria-expanded",!0),e.viewsMenu||(e.viewsMenu=document.createElement("div"),e.viewsMenu.classList.add("smart-grid-column-menu","smart-grid-download-menu","smart-grid-view-chooser"),e.viewsMenu.setAttribute("theme",e.getAttribute("theme")),e.viewsMenu.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)),e.viewsMenu.classList.add("smart-animate"),e._createViewsMenuItems("views"),e.viewsMenu.style.height="auto",e.isInShadowDOM?e.getRootNode().appendChild(e.viewsMenu):document.body.appendChild(e.viewsMenu);const t=e.$.viewsButton.getBoundingClientRect();let a=t.left+window.pageXOffset,o=t.bottom+window.pageYOffset;a+e.viewsMenu.offsetWidth>window.innerWidth&&(a=t.right+window.pageXOffset-e.downloadMenu.offsetWidth,a+e.viewsMenu.offsetWidth>window.innerWidth&&(a=window.innerWidth-e.viewsMenu.offsetWidth)),e.viewsMenu.style.left=a+"px",e.viewsMenu.style.top=o+"px",e.viewsMenu.classList.remove("smart-hidden"),e.viewsMenu.classList.add("open")}_refresh(){const e=this,t=e.grid;e._refreshColumns("refresh");let a=!1;for(let t=0;t<e.columns.length;t++)if("number"===e.columns[t].dataType){a=!0;break}if(t.header.buttons.indexOf("sort")>=0&&t.sorting.enabled?e.$.sortButton.classList.remove("smart-hidden"):e.$.sortButton.classList.add("smart-hidden"),t.header.buttons.indexOf("filter")>=0&&t.filtering.enabled?e.$.filterButton.classList.remove("smart-hidden"):e.$.filterButton.classList.add("smart-hidden"),t.header.buttons.indexOf("group")>=0&&t.grouping.enabled?e.$.groupButton.classList.remove("smart-hidden"):e.$.groupButton.classList.add("smart-hidden"),t.header.buttons.indexOf("columns")>=0?e.$.customizeButton.classList.remove("smart-hidden"):e.$.customizeButton.classList.add("smart-hidden"),t.header.buttons.indexOf("search")>=0?e.$.searchButton.classList.remove("smart-hidden"):e.$.searchButton.classList.add("smart-hidden"),t.header.buttons.indexOf("format")>=0&&a?e.$.formatButton.classList.remove("smart-hidden"):e.$.formatButton.classList.add("smart-hidden"),t.header.buttons.indexOf("delete")>=0?e.$.deleteButton.classList.remove("smart-hidden"):e.$.deleteButton.classList.add("smart-hidden"),t.header.buttons.indexOf("download")>=0?e.$.downloadButton.classList.remove("smart-hidden"):e.$.downloadButton.classList.add("smart-hidden"),t.header.buttons.indexOf("views")>=0?e.$.viewsButton.classList.remove("smart-hidden"):e.$.viewsButton.classList.add("smart-hidden"),e.$.downloadButton.onpointerup=a=>{t.closeMenu(),e._openDownloadMenu(),a.stopPropagation()},e.$.viewsButton.onpointerup=a=>{t.closeMenu(),e._openViewsMenu(),a.stopPropagation()},t._sortedColumns){const a=[],o=[],n=[];for(let e=0;e<t._sortedColumns.length;e++){const s=t._sortedColumns[e];a.push(s.dataField),o.push(s.sortOrder),n.push(s.dataType)}e._appliedSorting={dataFields:a,dataTypes:n,orderBy:o},e._refreshSortButton()}if("grid"===t.view){const a={filters:[],operator:"and"},o=t.getFilteredColumns();if(o)for(let e in o){const t=o[e];for(let o=0;o<t.filters.length;o++){const n=t.filters[o];a.filters.push([e,n.condition,n.value])}}e._appliedFiltering&&(a.operator=e._appliedFiltering.operator),e._appliedFiltering=a,e._refreshFilterButton()}else e.$.sortButton.classList.add("smart-hidden"),e.$.filterButton.classList.add("smart-hidden");e._appliedGrouping?e._appliedGrouping.dataFields=t.dataSource.groupBy:e._appliedGrouping={dataFields:t.dataSource.groupBy,expandAll:!1,collapseAll:!1},e._refreshGroupButton(),e._refreshDeleteButton(),e._refreshDownloadButton(),e._refreshCustomizeButton(),e._refreshViewsButton(),e.refreshTools()}_refreshViewsButton(){const e=this;let t=e.grid.localize("viewGrid");switch(e.grid.view){case"kanban":t=e.grid.localize("viewKanban"),e.$.viewsButton.classList.add("kanban");break;case"grid":e.$.viewsButton.classList.remove("kanban"),t=e.grid.localize("viewGrid")}e.$.viewsButton.innerHTML='<div class="smart-tool-label" role="presentation">'+t+"</div>"}_refreshDownloadButton(){this.$.downloadButton.innerHTML='<div class="smart-tool-label" role="presentation">'+this.grid.localize("download")+"</div>"}_openRowSettingsDialog(e){let t=this;t.getSelectedRows||(t=t.grid);const a=t.editing.dialog.enabled,o=t.editing.mode,n=t.context;t.context=t,t.editing.dialog.enabled=!0,t.editing.mode="row",t._settingsDialogRowId=e,t.beginEdit(e),t._endToolbarEdit?(t.removeEventListener("endEdit",t._endToolbarEdit,null),t.removeEventListener("cancelEdit",t._endToolbarEdit,null)):t._endToolbarEdit=()=>{t.context=t,t.editing.dialog.enabled=a,t.editing.mode=o,t.editing.isEditing=!1,t.context=n,delete t._settingsDialogRowId,delete t._dialogEdit},t.addEventListener("endEdit",t._endToolbarEdit),t.addEventListener("cancelEdit",t._endToolbarEdit)}_refreshDeleteButton(){let e=this;if(e.getSelectedRows||(e=e.grid),-1===e.header.buttons.indexOf("delete"))return;const t=e.getSelectedRows().length,a=e.querySelector("smart-grid-toolbar").$.deleteButton;0!==t?(a.classList.remove("smart-hidden"),a.firstElementChild.innerHTML=1===t?e.localize("deleteByOne"):e.localize("deleteByMultiple",{n:t}),a.classList.add("selected"),a.onclick=()=>{const t=e.getSelectedRows().map((e=>e[0]));this.grid.removeRow(t)}):a.classList.add("smart-hidden")}_refreshFromSelection(){this.querySelector("smart-grid-toolbar")._refreshDeleteButton()}openGroupPanel(e){const t=this;let a;const o=t.grid;if("kanban"===o.view)return;t.$.headerDropDown.classList.add("group-panel"),t.$.headerDropDown.classList.remove("customize-panel","filter-panel","sort-panel","search-panel","format-panel"),t.$.group.classList.remove("smart-hidden"),t.$.filter.classList.add("smart-hidden"),t.$.customize.classList.add("smart-hidden"),t.$.sort.classList.add("smart-hidden"),t.$.search.classList.add("smart-hidden"),t.$.format.classList.add("smart-hidden"),t._closeDownloadMenu(),t._closeViewsMenu(),t._refreshColumns("group"),o.closeMenu();const n=t.columns.map((e=>{const a=Object.assign({},e);if(t._appliedGrouping&&t._appliedGrouping.dataFields){const e=t._appliedGrouping.dataFields.indexOf(a.dataField);a.groupIndex=e}return a})).filter((e=>e.allowGroup));e&&t._appliedGrouping&&-1===t._appliedGrouping.dataFields.indexOf(e.dataField)&&(n.find((t=>t.dataField===e.dataField)).groupIndex=t._appliedGrouping.dataFields.length),t._groupPartCreated?(a=t.$.group.firstElementChild,a.rightToLeft=t.rightToLeft,a.dataSource=n,a.locale=t.locale,a.messages=t._innerElementMessages.groupPanel):(a=document.createElement("smart-group-panel"),a.rightToLeft=t.rightToLeft,a.animation=t.animation,a.locale=t.locale,a.messages=t._innerElementMessages.groupPanel,a.theme=t.theme,a.dataSource=n,t.$.group.appendChild(a),t._groupPartCreated=!0,a.onExpandAll=()=>{if(t._appliedGrouping.expandAll)return t._appliedGrouping.expandAll=!1,void a.querySelector(".smart-group-panel-expand-button").removeAttribute("active");t._appliedGrouping.expandAll=!0,t._appliedGrouping.collapseAll=!1,a.querySelector(".smart-group-panel-expand-button").setAttribute("active",""),a.querySelector(".smart-group-panel-collapse-button").removeAttribute("active")},a.onCollapseAll=()=>{if(t._appliedGrouping.collapseAll)return t._appliedGrouping.collapseAll=!1,void a.querySelector(".smart-group-panel-collapse-button").removeAttribute("active");t._appliedGrouping.expandAll=!1,t._appliedGrouping.collapseAll=!0,a.querySelector(".smart-group-panel-collapse-button").setAttribute("active",""),a.querySelector(".smart-group-panel-expand-button").removeAttribute("active")},a.addEventListener("apply",(e=>{const a=e.detail.sortByInfo,n=t._appliedGrouping.dataFields;t._appliedGrouping.dataFields=a.dataFields;const s=o.onRowInserted;if(o.onRowInserted=null,o.beginUpdate(),o.grouping.autoHideGroupColumn&&n)for(let e=0;e<n.length;e++){const t=o.columnByDataField[n[e]];t&&(t.visible=!0)}o.clearGroups();for(let e=0;e<a.dataFields.length;e++){const t=a.dataFields[e];o.addGroup(t)}t._appliedGrouping.expandAll&&o.expandAllRows(),t._appliedGrouping.collapseAll&&o.collapseAllRows(),o.autoSaveState(),o.endUpdate();const i=[];for(let e=0;e<o.dataSource.groupBy.length;e++)i.push(o.dataSource.groupBy[e]);o.$.fireEvent("group",{groups:i}),o.paging.enabled&&o._refreshPagesCount(),o.onRowInserted=s}))),t._refreshGroupButton(),t._openHeaderDropDown(t.$.groupButton)}_refreshGroupButton(){const e=this,t=e._appliedGrouping.dataFields?e._appliedGrouping.dataFields.length:0;if(e.grid&&"kanban"===e.grid.view){e.$.groupButton.onclick=()=>{"kanban"===e.grid.view&&e.grid._initKanbanView("dynamic")};const t=e.grid.columnByDataField[e.grid._stackedBy];t?(e.$.groupButton.firstElementChild.innerHTML=e.localize("groupedBy",{column:t.label}),e.$.groupButton.classList.add("grouped")):e.$.groupButton.classList.remove("grouped")}else{if(0===t){const t=e.localize("group");return e.$.groupButton.firstElementChild.innerHTML!==t&&(e.$.groupButton.firstElementChild.innerHTML=t),void e.$.groupButton.classList.remove("grouped")}e.$.groupButton.firstElementChild.innerHTML=1===t?e.localize("groupedByOne"):e.localize("groupedByMultiple",{n:t}),e.$.groupButton.classList.add("grouped")}}openSearchPanel(){this._openSearchPanel()}_closeSearchPanel(){this._search("",!1),super._closeSearchPanel()}_openSearchPanel(){const e=this,t=e.grid;e.$.headerDropDown.classList.add("search-panel"),e.$.headerDropDown.classList.remove("customize-panel","filter-panel","sort-panel","group-panel","format-panel"),e.$.search.classList.remove("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.group.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.format.classList.add("smart-hidden"),e._openHeaderDropDown(e.$.searchButton),e._closeDownloadMenu(),e._closeViewsMenu(),t.closeMenu();const a=[],o=t.getVisibleRows();for(let e=0;e<o.length;e++)a.push(Object.assign(o[e].data));const n=new Smart.DataAdapter({id:"id",observable:!1,dataSource:a,dataFields:t.dataSource.dataFields});e._searchInfo={source:n,stringDataFields:e.dataSource.dataFields.filter((e=>"string"===e.dataType)).map((e=>e.name))},""!==e.$.searchInput.value&&e._search(e.$.searchInput.value,!1)}_search(e,t=!0){const a=this;if(!a._searchInfo)return;if(a._searchInfo.query=e,""===e)return a.$.search.classList.remove("matches","no-matches"),delete a._searchInfo.foundIdsArray,delete a._searchInfo.foundIdsObject,delete a._searchInfo.highlighted,a.grid.highlighted=null,void a.grid._recycle(!1);const o=a._searchInfo.source,n=[],s=[],i={};a._searchInfo.stringDataFields.forEach((t=>{const a=new Smart.Utilities.FilterGroup,o=a.createFilter("string",e,"CONTAINS");a.addFilter("or",o),n.push([t,a])})),o._filter(n,"or");for(let e=0;e<o.length;e++){const t=o[e];!1!==t.$.filtered&&(s.push(t.$.id),i[t.$.id]=!0)}if(a._searchInfo.foundIdsArray=s,a._searchInfo.foundIdsObject=i,a.grid.highlighted=null,s.length>0)return a.$.search.classList.remove("no-matches"),a.$.search.classList.add("matches"),a.$.searchLabel.innerHTML=a.localize("found",{nth:t?1:0,n:s.length}),a._searchInfo.highlighted=s[0],a.grid.highlighted=a._searchInfo.highlighted,a.grid.ensureVisible(a._searchInfo.highlighted),void a.grid._recycle(!1);a.$.search.classList.remove("matches"),a.$.search.classList.add("no-matches"),a.$.searchLabel.innerHTML=a.localize("found",{nth:0,n:0})}_refreshCustomizeButton(){const e=this,t=e.grid;let a=0;if("kanban"===t.view&&t._kanban)return e.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+t._kanban.localize("customize")+"</div>",e.$.customizeButton.classList.remove("hidden"),void e.$.customizeButton.classList.add("smart-hidden");for(let e=0;e<t.columns.length;e++){const o=t.columns[e];o.autoGenerated||!1!==o._visible&&(t.grouping&&t.grouping.autoHideGroupColumn&&t.dataSource.groupBy.indexOf(o.dataField)>=0||o.visible||a++)}a>0?(e.$.customizeButton.innerHTML=1===a?'<div class="smart-tool-label" role="presentation">'+t.localize("customizeOne",{n:a})+"</div>":'<div class="smart-tool-label" role="presentation">'+t.localize("customizeHidden",{n:a})+"</div>",e.$.customizeButton.classList.add("hidden")):(e.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+t.localize("customize")+"</div>",e.$.customizeButton.classList.remove("hidden"))}_applyColumns(e,t){const a=this,o=a.grid;o.beginUpdate();let n=0,s=[],i=[],r=[];const l=o.onColumnChange;o.onColumnChange=null;for(let t in e){const a=e[t],l=o.columnByDataField[a.dataField];l&&(l.visible!==a.visible&&(s.push(a),i.push(l.visible),r.push(a.visible)),l.visible=a.visible,a.visible||n++)}o.onColumnChange=l,o.onColumnChange&&o.onColumnChange(s,"visible",i,r),n>0?(a.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+o.localize("customizeHidden",{n})+"</div>",a.$.customizeButton.classList.add("hidden")):(a.$.customizeButton.innerHTML='<div class="smart-tool-label" role="presentation">'+o.localize("customize")+"</div>",a.$.customizeButton.classList.remove("hidden"));for(let e=0;e<t.length;e++){const a=t[e],n=a.oldIndex,s=a.newIndex,i=o.columns[s+1],r=o.columns[s-1],l=o.columns[n];i?l.columnGroup=i.columnGroup:r&&(l.columnGroup=r.columnGroup),o.reorderColumns(n,s,!0)}o.endUpdate();const d=o.grouping.enabled;d&&o._filters&&o.refreshFilters(d),o.autoSaveState()}});
|
|
65
|
-
Smart("smart-grid",class extends Smart.ScrollViewer{static get properties(){return{appearance:{value:{alternationStart:{value:0,type:"int"},alternationEnd:{value:0,type:"int"},alternationCount:{value:0,type:"int"},allowHover:{value:!1,type:"boolean",defaultReflectToAttribute:!0},allowHeaderHover:{value:!0,type:"boolean",defaultReflectToAttribute:!0},allowRowToggleAnimation:{value:!1,type:"boolean"},allowRowDetailToggleAnimation:{value:!1,type:"boolean"},allowSortAnimation:{value:!1,type:"boolean"},allowColumnLabelAnimation:{value:!0,type:"boolean"},allowCheckBoxesSelectionAnimation:{value:!0,type:"boolean"},allowColumnMenuAnimation:{value:!0,type:"boolean"},allowColumnSortButtonAnimation:{value:!0,type:"boolean"},allowColumnActionButtonAnimation:{value:!0,type:"boolean"},allowColumnFilterButtonAnimation:{value:!0,type:"boolean"},allowColumnStickyPosition:{value:!1,type:"boolean"},autoShowColumnSortButton:{value:!0,type:"boolean"},autoShowColumnActionButton:{value:!0,type:"boolean"},autoGenerateRowLabelMode:{value:"number",type:"string"},autoGenerateColumnLabelMode:{value:"letter",type:"string"},autoShowColumnFilterButton:{value:!0,type:"boolean"},displayLoadingIndicator:{value:!1,type:"boolean"},loadingIndicatorPlaceholder:{value:"Loading...",type:"string"},placeholder:{value:"No Rows",type:"string"},sortAnimationDuration:{value:500,type:"number"},showRowHeader:{value:!1,type:"boolean"},showRowStatus:{value:!1,type:"boolean"},showRowHeaderNumber:{value:!1,type:"boolean"},showRowHeaderEditIcon:{value:!0,type:"boolean",defaultReflectToAttribute:!0},showRowHeaderDragIcon:{value:!1,type:"boolean"},showColumnHeaderDragIcon:{value:!1,type:"boolean"},showRowHeaderSelectIcon:{value:!1,type:"boolean"},showRowHeaderFocusIcon:{value:!1,type:"boolean"},showColumnHeaderLines:{value:!0,type:"boolean",defaultReflectToAttribute:!0},showColumnLines:{value:!0,type:"boolean",defaultReflectToAttribute:!0},showRowLines:{value:!0,type:"boolean",defaultReflectToAttribute:!0},showFilterColumnBackground:{value:!1,type:"boolean"},showSortColumnBackground:{value:!1,type:"boolean"},showFrozenColumnBackground:{value:!0,type:"boolean"},showFrozenRowBackground:{value:!0,type:"boolean"},showColumnSortButton:{value:!0,type:"boolean"},showColumnFilterButton:{value:!0,type:"boolean"},showColumnDescriptionButton:{value:!1,type:"boolean"},showColumnIcon:{value:!1,type:"boolean"},showColumnCustomButton:{value:!1,type:"boolean"},showColumnActionButton:{value:!0,type:"boolean"},showColumnGroupsInColumnPanel:{value:!1,type:"boolean"},showTooltips:{value:!1,type:"boolean"},showTooltipsOverflow:{value:!0,type:"boolean"},showResizeTooltips:{value:!0,type:"boolean"},showHorizontalScrollBarOnFixedColumns:{value:!1,type:"boolean"},showVerticalScrollBarOnFixedColumns:{value:!1,type:"boolean"},showTreeRowHeader:{value:!1,type:"boolean"},showTodayDateAsString:{value:!0,type:"boolean"}},type:"object"},behavior:{value:{allowColumnAutoSizeOnDoubleClick:{value:!0,type:"boolean"},allowRowAutoSizeOnDoubleClick:{value:!0,type:"boolean"},allowColumnReorder:{value:!1,type:"boolean"},allowColumnFreeze:{value:!0,type:"boolean"},allowRowReorder:{value:!1,type:"boolean"},doubleClickTimingDelay:{value:300,type:"number"},columnResizeMode:{value:"none",type:"string",allowedValues:["none","split","growAndShrink"]},rowResizeMode:{value:"none",type:"string",allowedValues:["none","split","growAndShrink"]}},type:"object"},layout:{value:{allowCellsWrap:{value:!1,type:"boolean"},allowCellsWrapShortcut:{value:!0,type:"boolean"},autoGenerateColumnWidth:{value:null,type:"number?"},autoSizeNewColumn:{value:!1,type:"boolean",reflectToAttribute:!1},autoSizeNewColumnMinWidth:{value:180,type:"number",reflectToAttribute:!1},columnWidth:{value:null,type:"any",reflectToAttribute:!1},columnHeight:{value:null,type:"any",reflectToAttribute:!1},columnMinHeight:{value:30,type:"any",reflectToAttribute:!1},isDirty:{value:!1,type:"boolean"},loadingIndicatorPosition:{value:"center",allowedValues:["bottom","center","top"],type:"string"},rowMinHeight:{value:30,type:"number"},rowHeight:{value:null,type:"any",reflectToAttribute:!1}},type:"object"},dataExport:{value:{header:{value:!0,type:"boolean"},filterBy:{value:null,type:"object"},groupBy:{value:null,type:"object"},style:{value:null,type:"object"},fileName:{value:"smartGrid",type:"string?"},pageOrientation:{value:"portrait",type:"string"},expandChar:{value:"+",type:"string"},collapseChar:{value:"-",type:"string"},view:{value:!1,type:"boolean"},viewStart:{value:null,type:"number?"},viewEnd:{value:null,type:"number?"},rowIds:{value:null,type:"array?"}},type:"object"},clipboard:{value:{enabled:{value:!0,type:"boolean"},autoFillMode:{value:"copy",allowedValues:["none","copy","fillSeries"],type:"string"},onPasteValue:{value:null,type:"any"}},type:"object"},conditionalFormatting:{value:null,type:"array?",reflectToAttribute:!1},columns:{value:[],type:"any",reflectToAttribute:!1},contextMenu:{value:{selector:{value:"",type:"string"},enabled:{value:!1,type:"boolean"},width:{value:150,type:"number"},height:{value:null,type:"number?"},dataSource:{value:{contextMenuItemDelete:{value:{command:{value:"contextMenuItemDeleteCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"},icon:{value:"smart-icon-delete",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},contextMenuItemEdit:{value:{command:{value:"contextMenuItemEditCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"},icon:{value:"smart-icon-mode-edit",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},contextMenuItemCustom:{value:{command:{value:null,type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"boolean"},icon:{value:"smart-icon-settings",type:"string"},label:{value:"",type:"string"}},type:"object",reflectToAttribute:!1}},type:"object",reflectToAttribute:!1}},type:"object",reflectToAttribute:!1},columnMenu:{value:{autoClose:{value:!0,type:"boolean"},dataSource:{value:{columnMenuCustomizeType:{value:{command:{value:"customizeTypeCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-settings",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemClone:{value:{command:{value:"duplicateCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-duplicate",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemInsertLeft:{value:{command:{value:"insertLeftCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-insert-left",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemInsertRight:{value:{command:{value:"insertRightCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-insert-right",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemSortAsc:{value:{command:{value:"sortAscCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-sort-name-up",type:"string"},iconAlt:{value:"smart-icon-sort-number-up",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemSortDesc:{value:{command:{value:"sortDescCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-sort-name-down",type:"string"},iconAlt:{value:"smart-icon-sort-number-down",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemRemoveSort:{value:{command:{value:"removeSortCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-cancel-circled",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemSort:{value:{command:{value:"addSortCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-sort",type:"string"},iconAlt:{value:"smart-icon-sort",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemFilter:{value:{command:{value:"addFilterCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-add-filter",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemRemoveFilter:{value:{command:{value:"removeFilterCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-cancel-circled",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemGroupBy:{value:{command:{value:"groupByCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-group",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemRemoveGroupBy:{value:{command:{value:"removeGroupByCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-ungroup",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemHide:{value:{command:{value:"hideColumnCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-visibility-off",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemDelete:{value:{command:{value:"deleteColumnCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-delete",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1}},type:"object",reflectToAttribute:!1},visible:{value:!1,type:"boolean"},enabled:{value:!0,type:"boolean"},width:{value:250,type:"number"},height:{value:null,type:"number?"}},type:"object",reflectToAttribute:!1},columnGroups:{value:[],type:"array",reflectToAttribute:!1},charting:{value:{appendTo:{value:null,type:"any"},enabled:{value:!1,type:"boolean"},colorScheme:{value:"scheme01",type:"string"},description:{value:"",type:"string"},dialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:400,type:"any"},width:{value:400,type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"},formatSettings:{value:{},type:"object"}},type:"object"},view:{value:"grid",allowedValues:["grid","kanban"],type:"string"},currentUser:{value:null,type:"any"},dataSource:{value:null,type:"any",reflectToAttribute:!1},dataSourceMap:{value:{checklist:"checklist",color:"color",comments:"comments",dueDate:"dueDate",id:"id",priority:"priority",progress:"progress",startDate:"startDate",status:"status",swimlane:"swimlane",tags:"tags",text:"text",description:"description",userId:"userId",history:"history",createdUserId:"createdUserId",createdDate:"createdDate",updatedUserId:"updatedUserId",updatedDate:"updatedDate"},type:"any",reflectToAttribute:!1},dataSourceSettings:{value:{autoGenerateColumns:{value:!1,type:"boolean"},sanitizeHTML:{value:"blackList",allowedValues:["all","blackList","none"],type:"string"},root:{value:"",type:"string"},record:{value:"",type:"string"},keyDataField:{value:"",type:"string"},parentDataField:{value:"",type:"string"},childrenDataField:{value:"",type:"string"},groupBy:{value:[],type:"array"},dataFields:{value:[],type:"array"},mapChar:{value:".",type:"string"},id:{value:"",type:"string"},virtualDataSource:{value:null,type:"any"},virtualDataSourceOnExpand:{value:null,type:"any"}},type:"object"},uploadSettings:{value:{url:{value:"",type:"string",reflectToAttribute:!1},removeUrl:{value:"",type:"string",reflectToAttribute:!1},existsUrl:{value:"",type:"string",reflectToAttribute:!1},name:{value:"userfile[]",type:"string",reflectToAttribute:!1},uploadMaxCount:{value:5,type:"number",reflectToAttribute:!1},uploadMaxSize:{value:2097152,type:"number",reflectToAttribute:!1},data:{value:null,type:"object",reflectToAttribute:!1},onUploadStarted:{value:null,type:"any",reflectToAttribute:!1},onUploadCompleted:{value:null,type:"any",reflectToAttribute:!1},onUploadRemove:{value:null,type:"any",reflectToAttribute:!1},onUploadError:{value:null,type:"any",reflectToAttribute:!1},onChange:{value:null,type:"any",reflectToAttribute:!1},onProgress:{value:null,type:"any",reflectToAttribute:!1},onAbort:{value:null,type:"any",reflectToAttribute:!1},onError:{value:null,type:"any",reflectToAttribute:!1},onSetHeaders:{value:null,type:"any",reflectToAttribute:!1},singleFilePost:{value:!0,type:"boolean",reflectToAttribute:!1}},reflectToAttribute:!1,type:"object"},grouping:{value:{enabled:{value:!1,type:"boolean",reflectToAttribute:!1},allowCollapse:{value:!1,type:"boolean",reflectToAttribute:!1},autoHideGroupColumn:{value:!1,type:"boolean",reflectToAttribute:!1},autoExpandAll:{value:!1,type:"boolean",reflectToAttribute:!1},autoExpandToLevel:{value:0,type:"number",reflectToAttribute:!1},onGroupDefaultExpanded:{value:null,type:"any",reflectToAttribute:!1},expandMode:{value:"buttonClick",type:"string",allowedValues:["buttonClick","rowClick"],reflectToAttribute:!1},renderMode:{type:"string",value:"advanced",allowedValues:["basic","compact","advanced","multipleColumns"]},groupBy:{value:[],type:"array",reflectToAttribute:!1},groupRowHeight:{value:50,type:"any",reflectToAttribute:!1},toggleButtonIndent:{value:27,type:"number",reflectToAttribute:!1},groupIndent:{value:27,type:"number",reflectToAttribute:!1},groupBar:{value:{visible:{value:!1,type:"boolean",reflectToAttribute:!1},allowColumnDragDrop:{value:!0,type:"boolean",reflectToAttribute:!0},allowColumnCloseButtons:{value:!0,type:"boolean",reflectToAttribute:!0}},type:"object"},formatFunction:{value:null,type:"any",reflectToAttribute:!1},summaryRow:{value:{inline:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"}},type:"object"}},type:"object"},messages:{extend:!0,value:{en:{invalidColumnProperty:'{{elementType}}: Invalid property name "{{propertyName}}" set for Column: "{{type}}"',invalidRowProperty:'{{elementType}}: Invalid property name "{{propertyName}}" set for Row"',invalidCellValue:'Invalid cell value "{{value}}", Validation rule: "{{validationRule}}"',invalidValue:"Invalid value",invalidMinValue:"{{value}} above {{min}} must be filled out",invalidMaxValue:"{{value}} below {{max}} must be filled out",invalidMinLengthValue:"{{value}} is shorter than the minimum length of {{min}} characters",invalidMaxLengthValue:"{{value}} is longer than the maximum length of {{max}} characters",requiredValue:"{{value}} must be filled out",frozenColumns:"{{elementType}}: To Pin/Freeze a column group, all columns within it should be frozen.",frozenRows:"{{elementType}}: To Pin/Freeze a special cell, all rows within it should be frozen.",columnGroups:"{{elementType}}: Please, check the initialization of the smartGrid's columns array. The columns in a column group are expected to be siblings in the columns array.",viewGrid:"Grid",viewKanban:"Kanban",kanbanNone:"Blank",kanbanDescription:'Start from a project board with columns generated by the "{{column}}" column options.',kanbanNoneDescription:"Create a new column and start from scratch with a completely blank project board. You can add columns and configure settings yourself.",kanbanBasic:"Template",kanbanBasicDescription:'Create a new column and start from a project board with columns for "To do", "in progress" and "Done".',uncategorized:"Uncategorized",toDo:"To do",inProgress:"In progress",done:"Done",min:"Min: {{value}}",max:"Max: {{value}} ",sum:"Sum: {{value}} ",avg:"Avg: {{value}} ",cells:"{{value}} cells selected",rows:"{{value}} rows",oneRow:"1 row",unique:"Unique: {{value}}",blank:"Empty: {{value}}",filled:"Filled: {{value}}",summary:"Summary",countSummary:"Count",minSummary:"Min",maxSummary:"Max",avgSummary:"Avg",blankSummary:"Empty",uniqueSummary:"Unique",filledSummary:"Filled",sumSummary:"Sum",completed:"Tasks Completed: {{value}}",count:"Count: {{value}} ",pagerFirstButton:"First",pagerLastButton:"Last",pagerPreviousButton:"Previous",pagerNextButton:"Next",pagerNavigateToLabel:"Go to:",pagerPageSizeLabel:"Show:",pagerNavigateToInputPlaceholder:"",pagerEllipsis:"...",pagerSummaryString:"of",pagerSummaryPrefix:"of",pagerSummarySuffix:"",columnMenuCustomizeType:"Column settings",columnMenuItemClone:"Clone column",columnMenuItemInsertLeft:"Insert left",columnMenuItemInsertRight:"Insert right",columnMenuItemSortAsc:"Sort {{mode}}",columnMenuItemSortDesc:"Sort {{mode}}",columnMenuItemRemoveSort:"Remove Sort",columnMenuItemFilter:"Filter column",columnMenuItemSort:"Sort column",columnMenuItemRemoveFilter:"Remove Filter",columnMenuItemGroupBy:"Group column",columnMenuItemRemoveGroupBy:"Remove Group",columnMenuItemHide:"Hide column",columnMenuItemShow:"Show column",columnMenuItemDelete:"Delete column",columnResizeTooltip:"width: {{value}}px",rowResizeTooltip:"height: {{value}}px",commandBarAddRow:"Add",commandBarDeleteRow:"Delete row",commandBarBatchRevert:"Revert",commandBarBatchSave:"Save",commandBarFilter:"Filter",commandBarSort:"Sort",commandBarSearch:"Search",commandBarCustomize:"Customize",commandBarGroup:"Group",commandColumnEdit:"Edit",commandColumnDelete:"Delete",commandColumnCancel:"Cancel",commandColumnUpdate:"Update",contextMenuItemDelete:"Delete row",contextMenuItemEditCell:"Edit cell",contextMenuItemEditRow:"Edit row",commandColumnMenu:"",expandRow:"Expand row (Shift + Enter)",expandRowComments:"Expand row and see {{value}} comments",collapseRow:"Collapse row",addNewRow:"Click here to add a new row",addNewRowAlt:"<span>Add new empty row</span> <code>Shift</code> + <code>Space</code>",addNewRowAltSmall:"Add new empty row",addNewColumn:"Click here to add a new column",dialogChartHeader:"{{value}} Chart",dialogRowDetailHeader:"Row Id: {{value}}",dialogDescriptionHeader:"Column: {{value}}",dialogRowDetailButtonConfirm:"OK",dialogRowDetailButtonCancel:"CANCEL",dialogEditHeaderDisabled:"Record with Id: {{value}}",dialogEditHeader:"Edit Record with Id: {{value}}",dialogExpandRowHeader:"Edit Record",dialogAddButtonConfirm:"ADD",dialogAddButtonCancel:"CANCEL",dialogEditButtonConfirm:"OK",dialogEditButtonCancel:"CANCEL",dialogFilterButtonConfirm:"FILTER",dialogFilterButtonCancel:"CLEAR",dialogDeleteButtonConfirm:"DELETE",dialogDeleteButtonCancel:"CANCEL",dialogEditColumn:"Column: {{value}}",dialogNewColumn:"New column",dialogAddColumn:"Add Column",dialogAddColumnStatus:"Choose a grouping column",dialogAddColumnStatusDescription:"Represent the status of each record",dialogAddColumnStatusNotes:"Your records will be grouped based on this column",dialogAddHeader:"Add Row",dialogDeleteHeader:"Delete Row",dialogFilterHeader:"Filter by",dialogFilterMinLabel:"Min",dialogFilterMaxLabel:"Max",dialogImageHeader:"Image",dialogImageDrop:"or drag and drop image(s) to upload",dialogImageUpload:"Select Image(s) to Upload",dialogImageURL:"You can also provide the URL to an image",dialogImageURLUpload:"Upload",dialogImageLink:"Link (URL)",dialogImageDevice:"My Device",dialogImageSize:'No image currently added. The "{{value}}" image cannot be uploaded. Maximum image size is {{fileSize}}.',dialogImageCount:'The following images cannot be added "{{files}}". Maximum images allowed is {{fileCount}}.',dialogImageFileUpload:"No images currently selected for upload",dialogAttachmentHeader:"Files",dialogAttachmentDrop:"or drag and drop files(s) to upload",dialogAttachmentUpload:"Select File(s) to Upload",dialogAttachmentURL:"You can also provide the URL to an Attachment",dialogAttachmentURLUpload:"Upload",dialogAttachmentLink:"Link (URL)",dialogAttachmentDevice:"My Device",dialogAttachmentSize:'No file currently added. The "{{value}}" file cannot be uploaded. Maximum files size is {{fileSize}}.',dialogAttachmentCount:'The following files cannot be added "{{files}}". Maximum files allowed is {{fileCount}}.',dialogAttachmentFileUpload:"No files currently selected for upload",dialogAddColumnName:"Name",dialogAddColumnNameInfo:"Name of the column. The name of the column will be displayed in the column header.",dialogAddColumnDescription:"Description",dialogAddColumnDescriptionInfo:"Description of the column. When the description is set, an icon will be displayed in the column header. A tooltip with the description will be displayed when you point at the icon.",dialogAddColumnNamePlaceholder:"Column name (optional)",dialogAddColumnDescriptionPlaceholder:"Describe this column (optional)",dialogAddColumnType:"Type",dialogAddColumnTypeInfo:'Type of the data in the column. Unlike a spreadsheet, Columns have specific "types" that allow you to store rich content in each record. For example, a table can contain records (rows) with images, long texts, checkboxes.',dialogAddColumnTypeText:"Text",dialogAddColumnTypeMultilineText:"Multiline text",dialogAddColumnTypeImage:"Image",dialogAddColumnTypeNumber:"Number",dialogAddColumnTypeSelect:"Select",dialogAddColumnTypeMultipleSelect:"Multiple Select",dialogAddColumnTypeDate:"Date",dialogAddColumnTypeCheckBox:"CheckBox",dialogAddColumnTypeCreatedTime:"Created time",dialogAddColumnTypeLastUpdatedTime:"Last modified time",dialogAddColumnTypeCreatedBy:"Created by",dialogAddColumnTypeLastUpdatedBy:"Last modified by",dialogAddColumnTypeCollaborator:"Collaborator",dialogAddColumnTypeSlider:"Slider",dialogAddColumnTypeAutoNumber:"Auto Number",dialogAddColumnTypeURL:"URL",dialogAddColumnTypeEmail:"Email",dialogAddColumnTypePassword:"Password",dialogAddColumnTypePhone:"Phone",dialogAddColumnTypeStartDate:"Start Date",dialogAddColumnTypeDueDate:"Due Date",dialogAddColumnTypeProgress:"Progress",dialogAddColumnTypePriority:"Priority",dialogAddColumnTypeDescription:"Description",dialogAddColumnTypeTags:"Tags",dialogAddColumnTypeName:"Name",dialogAddColumnTypeColor:"Color",dialogAddColumnTypeChecklist:"Checklist",dialogAddColumnTypeAssigned:"Assignee",dialogAddColumnTypeAttachment:"Attachment",dialogAddColumnDateFormat:"Date format",dialogAddColumnDateFormatInfo:"Choose the dates display format",dialogAddColumnDateFormatShort:"Short",dialogAddColumnDateFormatLong:"Long",dialogAddColumnDateFormatEU:"EU",dialogAddColumnDateFormatISO:"ISO",dialogAddColumnDateFormatAS:"AS",dialogAddColumnDateFormatFull:"Full",dialogAddColumnDateFormatSlash:"Slash",dialogAddColumnDateFormatHyphen:"Hyphen",dialogAddColumnDateFormatDot:"Dot",dialogAddColumnTimeFormat:"Time format",dialogAddColumnTimeFormatInfo:"Choose the time display format",dialogAddColumnTimeFormatHour:"hour",dialogAddColumnAllowTimeFormat:"Include a time field",dialogAddColumnCustomDateSeparator:"Set a custom separator",dialogAddColumnNumberFormat:"Number format",dialogAddColumnNumberFormatInfo:"Choose the number display format",dialogAddColumnNumberFormatInteger:"Integer",dialogAddColumnNumberFormatNumber:"Number",dialogAddColumnNumberFormatPercent:"Percent",dialogAddColumnNumberFormatPercentRounded:"Percent(rounded)",dialogAddColumnNumberFormatScientific:"Scientific",dialogAddColumnNumberFormatEngineering:"Engineering",dialogAddColumnNumberFormatAccounting:"Accounting",dialogAddColumnNumberFormatUnit:"Unit",dialogAddColumnNumberFormatUnitInfo:"Units of measurement",dialogAddColumnNumberFormatUnitAcre:"Acre",dialogAddColumnNumberFormatUnitCelsius:"Celsius",dialogAddColumnNumberFormatUnitFahrenheit:"Fahrenheit",dialogAddColumnNumberFormatUnitPercent:"Percent",dialogAddColumnNumberFormatUnitDegree:"Degree",dialogAddColumnNumberFormatUnitMegaByte:"Mega byte",dialogAddColumnNumberFormatUnitCentimeter:"Centimeter",dialogAddColumnNumberFormatUnitMeter:"Meter",dialogAddColumnNumberFormatUnitKilometer:"Kilometer",dialogAddColumnNumberFormatUnitMile:"Mile",dialogAddColumnNumberFormatUnitKilogram:"Kilogram",dialogAddColumnNumberFormatUnitPound:"Pound",dialogAddColumnNumberFormatUnitLiter:"Liter",dialogAddColumnNumberFormatUnitGallon:"Gallon",dialogAddColumnNumberFormatUnitSecond:"Second",dialogAddColumnNumberFormatUnitMinute:"Minute",dialogAddColumnNumberFormatUnitHour:"Hour",dialogAddColumnNumberFormatUnitDay:"Day",dialogAddColumnNumberFormatUnitWeek:"Week",dialogAddColumnNumberFormatUnitMonth:"Month",dialogAddColumnNumberFormatUnitYear:"Year",dialogAddColumnNumberFormatCurrency:"Currency",dialogAddColumnNumberFormatCurrencyRounded:"Currency(rounded)",dialogAddColumnNumberFormatCurrencyInfo:"Choose the currency display format",dialogAddColumnMinLength:"Minimum length",dialogAddColumnMinLengthInfo:"Minimum text length",dialogAddColumnMaxLength:"Maximum length",dialogAddColumnMaxLengthInfo:"Maximum text length",dialogAddColumnMinValue:"Minimum value",dialogAddColumnMinValueInfo:"Minimum number",dialogAddColumnMaxValue:"Maximum value",dialogAddColumnMaxValueInfo:"Maximum number",dialogAddColumnMinDate:"Minimum date",dialogAddColumnMinDateInfo:"Minimum date",dialogAddColumnMaxDate:"Maximum date",dialogAddColumnMaxDateInfo:"Maximum date",dialogAddColumnColorItems:"Color items",dialogAddColumnListItems:"List items",dialogAddColumnAlign:"Align",dialogAddColumnAlignLeft:"Left",dialogAddColumnAlignRight:"Right",dialogAddColumnAlignCenter:"Center",dialogAddColumnAlignInfo:"Table cells text alignment",dialogAddColumnResizable:"Resizable",dialogAddColumnResizableInfo:"Select if you want to make the column resizable",dialogAddColumnRequired:"Required",dialogAddColumnRequiredInfo:"Select if you want to make the column required",dialogAddColumnSortable:"Sortable",dialogAddColumnSortableInfo:"Select if you want to sort by this column",dialogAddColumnFilterable:"Filterable",dialogAddColumnFilterableInfo:"Select if you want to filter by this column",dialogAddColumnEditable:"Editable",dialogAddColumnEditableInfo:"Select if you want to edit by this column",dialogAddColumnMultipleCollaborators:"Multiple Collaborators",dialogAddColumnMultipleCollaboratorsInfo:"Select if you want to allow multiple collaborators",dialogAddColumnCheckItems:"Show Checkbox",priority_low:"Low",priority_average:"Average",priority_high:"High",priority_critical:"Critical",bold:"Bold",fontStyle:"Font Style",italic:"Italic",send:"Send",copy:"copy",status:"Status",underline:"Underline",comments:"Comments",comment:"Comment",noComments:"No comments to this record yet",guestUser:"Guest",background:"Background",starred:"Starred",resetFormat:"Reset Format",notStarred:"Not starred",color:"Color",coloredItems:"Colored items",conditionalFormatting:"Conditional Formatting",groupBarLabel:"Drag a column header here to group by that column",dialogDeleteContent:"Are you sure you want to delete this row?",detailsTab:"Details",commentsTab:"Comments",historyTab:"History",historyEvent:"Event",historyAuthor:"Author",historyDetails:"Details",range:'Changed {{column}} from "{{oldValue}}" to "{{newValue}}"',nullRange:'Changed {{column}} to "{{newValue}}"',rowCreated:"Row Created",propertyUpdated:'"{{value}}" updated',propertyRemoved:'"{{value}}" removed',dropImages:"Drop images here",addImages:"Add images",dropFiles:"Drop files here",addFiles:"Add files",unassigned:"Unassigned",historyDate:"Date",calendar:{"/":"/",":":":",firstDay:0,days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],currencySymbol:"$",currency:"USD",currencySymbolPosition:"before",decimalSeparator:".",thousandsSeparator:","},CONTAINS:"Contains",DOES_NOT_CONTAIN:"Does not contain",ENDS_WITH:"Ends with",EQUAL:"Equal",GREATER_THAN:"Greater than",GREATER_THAN_OR_EQUAL:"Greater than or equal",LESS_THAN:"Less than",LESS_THAN_OR_EQUAL:"Less than or equal",NOT_EQUAL:"Not equal",RANGE:"Range",CLEAR_FILTER:"Clear Filter",STARTS_WITH:"Starts with",addFilter:"+ Add filter",and:"And",apply:"Apply",applyOnce:"Apply once",booleanFirst:"☐",booleanLast:"☑",cancel:"Cancel",CONTAINS_CASE_SENSITIVE:"Contains (case sensitive)",dateFirst:"1",dateLast:"9",DOES_NOT_CONTAIN_CASE_SENSITIVE:"does not contain (case sensitive)",EMPTY:"empty",ENDS_WITH_CASE_SENSITIVE:"ends with (case sensitive)",EQUAL_CASE_SENSITIVE:"equal (case sensitive)",filter:"Filter",customize:"Hide columns",customizeOne:"1 hidden column",customizeHidden:"{{n}} hidden columns",filteredByMultiple:"{{n}} filters",filteredByOne:"1 filter",filterValuePlaceholder:"Value",find:"Find a field",findInView:"Find in view",firstBy:"Sort by",found:"{{nth}} of {{n}}",from:"from",noFilters:"No filters applied",noResults:"No results",noSorting:"No sorting applied",NOT_EMPTY:"not empty",NOT_NULL:"not null",NULL:"null",numberFirst:"1",numberLast:"9",ok:"OK",or:"Or",pickAnother:"Pick another field to sort by",maintainSort:"Maintain sort",sort:"Sort",group:"Group",sortedByMultiple:"Sorted by {{n}} columns",sortedByOne:"Sorted by 1 column",STARTS_WITH_CASE_SENSITIVE:"starts with (case sensitive)",stringFirst:"A",stringLast:"Z",thenBy:"then by",where:"Where",collapseAll:"Collapse all",expandAll:"Expand all",noGrouping:"No grouping",groupedByMultiple:"{{n}} groups",groupedByOne:"1 group",groupedBy:"Grouped by {{column}}",deleteByMultiple:"Delete {{n}} rows",deleteByOne:"Delete 1 row",download:"Download",firstByGroup:"Group by",expandRecord:"Expand row",pickAnotherGroupBy:"Pick another field to group by",add:"Add condition",all:"All columns",between:"Between",close:"Close",column:"Column:",condition:"Condition:",equal:"equal",fontFamily:"Font family:",fontSize:"Font size:",format:"Format:",greaterThan:"greater than",highlight:"Highlight",lessThan:"less Than",notEqual:"not equal",remove:"Remove condition",secondValue:"Second value:",text:"Text",value:"Value:",addCondition:"Add Condition",addGroup:"Add Group",blanks:"(Blanks)",clear:"Clear",contains:"contains",containsCaseSensitive:"contains (case sensitive)",dateTabLabel:"DATE",doesNotContain:"does not contain",doesNotContainCaseSensitive:"does not contain (case sensitive)",empty:"empty",endsWith:"ends with",endsWithCaseSensitive:"ends with (case sensitive)",equalCaseSensitive:"equal (case sensitive)",greaterThanOrEqual:"greater than or equal",lessThanOrEqual:"less than or equal",mismatchedProperties:'smartFilterPanel: The "filterType" and the data type of the selected "dataField" are mismatched.',missingProperty:'smartFilterPanel: When mode is \'excel\', either "data" and "dataField" or "dataSource" of type Array have to be set.',notEmpty:"not empty",notNull:"not null",null:"null ",placeholderBoolean:"Select value",placeholderDate:"Enter date",placeholderNumber:"Enter number",placeholderTime:"Enter time",placeholderValue:"Enter value",selectAll:"(Select All)",showRows:"Show rows where:",startsWith:"starts with",startsWithCaseSensitive:"starts with (case sensitive)",matchCase:"Match Case",timeTabLabel:"TIME",today:"Today",formatColumn:"Format Column",formating:"Conditional Formatting",reset:"Reset",filteredRecords:"All rows are filtered",duplicateCells:"Clone column cells and settings",duplicateSettings:"Clone column settings",views:"Views",noView:"No view",myView:"My views",saveView:"New view"}},type:"object"},onCellValue:{value:null,type:"any",reflectToAttribute:!1},onCellUpdate:{value:null,type:"any",reflectToAttribute:!1},onCellRender:{value:null,type:"any",reflectToAttribute:!1},onBeforeInit:{value:null,type:"any",reflectToAttribute:!1},onInit:{value:null,type:"any",reflectToAttribute:!1},onAfterInit:{value:null,type:"any",reflectToAttribute:!1},onKey:{value:null,type:"any",reflectToAttribute:!1},onRender:{value:null,type:"any",reflectToAttribute:!1},onLoad:{value:null,type:"any",reflectToAttribute:!1},onChartInit:{value:null,type:"any",reflectToAttribute:!1},onComment:{value:null,type:"any",reflectToAttribute:!1},onRowInit:{value:null,type:"any",reflectToAttribute:!1},onRowClass:{value:null,type:"any",reflectToAttribute:!1},onRowChange:{value:null,type:"any",reflectToAttribute:!1},onRowDetailInit:{value:null,type:"any",reflectToAttribute:!1},onRowDetailUpdated:{value:null,type:"any",reflectToAttribute:!1},onRowInserted:{value:null,type:"any",reflectToAttribute:!1},onRowRemoved:{value:null,type:"any",reflectToAttribute:!1},onRowUpdate:{value:null,type:"any",reflectToAttribute:!1},onRowUpdated:{value:null,type:"any",reflectToAttribute:!1},onRowStarred:{value:null,type:"any",reflectToAttribute:!1},onRowHistory:{value:null,type:"any",reflectToAttribute:!1},onRowStyle:{value:null,type:"any",reflectToAttribute:!1},onRowResize:{value:null,type:"any",reflectToAttribute:!1},onColumnInit:{value:null,type:"any",reflectToAttribute:!1},onColumnInserted:{value:null,type:"any",reflectToAttribute:!1},onColumnRemoved:{value:null,type:"any",reflectToAttribute:!1},onColumnResize:{value:null,type:"any",reflectToAttribute:!1},onColumnReorder:{value:null,type:"any",reflectToAttribute:!1},onColumnSummaryChange:{value:null,type:"any",reflectToAttribute:!1},onColumnUpdated:{value:null,type:"any",reflectToAttribute:!1},onColumnClone:{value:null,type:"any",reflectToAttribute:!1},onColumnChange:{value:null,type:"any",reflectToAttribute:!1},onCommand:{value:null,reflectToAttribute:!1,type:"any"},filtering:{value:{enabled:{value:!1,type:"boolean"},operator:{value:"and",type:"string"},filter:{value:[],type:"array",reflectToAttribute:!1},filterRow:{value:{visible:{value:!1,type:"boolean"},menuVisible:{value:!1,type:"boolean"},applyMode:{value:"auto",type:"string",allowedValues:["auto","click"]},autoApplyModeDelay:{value:500,type:"number"}},type:"object"},filterMenu:{value:{visible:{value:!0,type:"boolean"},buttons:{value:["cancel","clear","filter"],type:"array"},dataSource:{value:null,type:"any"},width:{value:250,type:"number"},height:{value:200,type:"number"},mode:{value:"default",allowedValues:["default","excel"],type:"string"},messages:{value:null,type:"object"}},type:"object"}},type:"object"},editing:{value:{allowRowHeaderEdit:{value:!1,type:"boolean"},allowColumnHeaderEdit:{value:!1,type:"boolean"},autoUpdateFilterAndSort:{value:!0,type:"boolean"},active:{value:!1,readonly:!0,type:"boolean"},enabled:{value:!1,type:"boolean"},batch:{value:!1,type:"boolean"},action:{value:"click",type:"string",allowedValues:["none","click","doubleClick"]},commandKeys:{value:{commandKeyCancel:{value:{command:"commandKeyCancelCommand",key:"Escape"},type:"object"},commandKeyUpdate:{value:{command:"commandKeyUpdateCommand",key:"Enter | Tab"},type:"object"}},type:"object"},commandBar:{value:{visible:{value:!1,type:"boolean"},position:{value:"near",allowedValues:["near","far","both"],type:"string"},displayMode:{value:"labelAndIcon",allowedValues:["label","icon","labelAndIcon"],type:"string"},dataSource:{value:{commandBarAddRow:{value:{command:{value:"commandBarAddRowCommand",type:"any"},icon:{value:"smart-icon-plus",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!1,type:"any"}},type:"object"},commandBarDeleteRow:{value:{command:{value:"commandBarDeleteRowCommand",type:"any"},icon:{value:"smart-icon-delete",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!1,type:"any"}},type:"object"},commandBarBatchSave:{value:{command:{value:"commandBarBatchSaveCommand",type:"any"},icon:{value:"smart-icon-ok-squared",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!0,type:"any"}},type:"object"},commandBarBatchRevert:{value:{command:{value:"commandBarBatchRevertCommand",type:"any"},icon:{value:"smart-icon-reload",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!0,type:"any"}},type:"object"}},type:"object"}},type:"object"},commandColumn:{value:{visible:{value:!1,type:"boolean"},inline:{value:!1,type:"boolean"},position:{value:"far",allowedValues:["near","far"],type:"string"},displayMode:{value:"icon",allowedValues:["label","icon","labelAndIcon"],type:"string"},dataSource:{value:{commandColumnMenu:{value:{command:{value:"commandColumnMenuCommand",type:"any"},icon:{value:"smart-icon-menu",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!1,type:"any"}},type:"object"},commandColumnEdit:{value:{command:{value:"commandColumnEditCommand",type:"any"},icon:{value:"smart-icon-mode-edit",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:"auto",type:"any"}},type:"object"},commandColumnDelete:{value:{command:{value:"commandColumnDeleteCommand",type:"any"},icon:{value:"smart-icon-delete",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!0,type:"any"}},type:"object"},commandColumnUpdate:{value:{command:{value:"commandColumnUpdateCommand",type:"any"},icon:{value:"smart-icon-ok-squared",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:"auto",type:"any"}},type:"object"},commandColumnCancel:{value:{command:{value:"commandColumnCancelCommand",type:"any"},icon:{value:"smart-icon-cancel-circled",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:"auto",type:"any"}},type:"object"},commandColumnRowMenu:{value:{command:{value:"commandColumnRowMenuCommand",type:"any",reflectToAttribute:!1},icon:{value:"smart-icon-ellipsis-vert",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!1,type:"any"}},type:"object"},commandColumnCustom:{value:{command:{value:"",type:"any"},icon:{value:"smart-icon-ellipsis-vert",type:"string"},label:{value:"",type:"string"},visible:{value:!1,type:"any"}},type:"object"}},type:"object"},width:{value:null,type:"number?"}},reflectToAttribute:!1,type:"object"},mode:{value:"cell",allowedValues:["cell","row"],type:"string"},addNewColumn:{value:{visible:{value:!1,type:"boolean"}},type:"object"},addNewRow:{value:{position:{value:"both",allowedValues:["near","far","both"],type:"string"},visible:{value:!1,type:"boolean"},autoEdit:{value:!0,type:"boolean"},autoCreate:{value:!1,type:"boolean"},autoSave:{value:!0,type:"boolean"},label:{value:"{{message}}",type:"string"},displayMode:{value:"row",allowedValues:["row","button"],type:"string"}},type:"object"},dialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:"auto",type:"any"},width:{value:"auto",type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!1,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"},addDialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:"auto",type:"any"},width:{value:"auto",type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!1,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"},addColumnDialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:"auto",type:"any"},width:{value:430,type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!1,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"},deleteDialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:"auto",type:"any"},width:{value:"auto",type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!1,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"}},type:"object"},paging:{value:{enabled:{value:!1,type:"boolean"},spinner:{value:{enabled:{value:!1,type:"boolean"},step:{value:1,type:"number"}},type:"object"},pageHierarchySize:{value:2,type:"int"},pageSize:{value:10,type:"int"},pageIndex:{value:0,type:"int",validator:"pageIndexValidator"}},type:"object"},pager:{value:{autoEllipsis:{value:"both",allowedValues:["none","before","after","both"],type:"string"},position:{value:"far",allowedValues:["near","far","both"],type:"string"},template:{value:"",type:"string"},pageSizeSelector:{value:{visible:{value:!1,type:"boolean"},dataSource:{value:[10,20,50],type:"object"},position:{value:"far",allowedValues:["near","far"],type:"string"}},type:"object"},summary:{value:{position:{value:"far",allowedValues:["near","far"],type:"string"},visible:{value:!1,type:"boolean"}},type:"object"},navigationButtons:{value:{position:{value:"both",allowedValues:["near","far","both"],type:"string"},prevNextButtons:{value:{visible:{value:!0,type:"boolean"}},type:"object"},firstLastButtons:{value:{visible:{value:!0,type:"boolean"}},type:"object"},labels:{value:{visible:{value:!1,type:"boolean"}},type:"object"}},type:"object"},navigationInput:{value:{position:{value:"far",allowedValues:["near","far"],type:"string"},visible:{value:!1,type:"boolean"}},type:"object"},pageIndexSelectors:{value:{visible:{value:!0,type:"boolean"},dataSource:{value:10,type:"any"}},type:"object"},visible:{value:!1,type:"boolean"}},type:"object",reflectToAttribute:!1},rowDetail:{value:{enabled:{value:!1,type:"boolean"},height:{value:200,type:"number"},position:{value:"near",allowedValues:["near","far"],type:"string"},template:{value:"",type:"any",reflectToAttribute:!1},visible:{value:!0,type:"boolean"},dialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:300,type:"any"},width:{value:360,type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!1,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"}},type:"object"},rowCSSRules:{value:null,type:"any"},summaryRow:{value:{position:{value:"far",allowedValues:["near","far"],type:"string"},visible:{value:!1,type:"boolean"},editing:{value:!1,type:"boolean"},template:{value:"",type:"string"}},type:"object"},scrolling:{value:"physical",allowedValues:["physical","virtual","infinite","deferred"],type:"string"},columnHeader:{value:{visible:{value:!0,type:"boolean"}},type:"object"},groupHeader:{value:{visible:{value:!1,type:"boolean"},template:{value:"",type:"string"}},type:"object"},header:{value:{visible:{value:!1,type:"boolean"},template:{value:"",type:"any"},buttons:{value:["columns","filter","group","sort","format","search"],type:"array"},onInit:{value:null,reflectToAttribute:!1,type:"any"}},type:"object"},footer:{value:{visible:{value:!1,type:"boolean"},template:{value:"",type:"any"}},type:"object"},stateSettings:{value:{enabled:{value:!0,type:"boolean",reflectToAttribute:!1},current:{value:"",type:"string",reflectToAttribute:!1},storage:{value:null,type:"any",reflectToAttribute:!1},autoSave:{value:!1,type:"boolean",reflectToAttribute:!1},autoLoad:{value:!1,type:"boolean",reflectToAttribute:!1},options:{value:[],type:"array",reflectToAttribute:!1},onStateChange:{value:null,type:"any",reflectToAttribute:!1}},type:"object",reflectToAttribute:!1},checkBoxes:{value:{visible:{value:!1,type:"boolean"},hasThreeStates:{value:!1,type:"boolean"}},type:"object"},selection:{value:{enabled:{value:!1,type:"boolean"},allowRowHeaderSelection:{value:!1,type:"boolean"},allowColumnHeaderSelection:{value:!1,type:"boolean"},allowRowSelection:{value:!0,type:"boolean"},allowCellSelection:{value:!1,type:"boolean"},allowDragSelection:{value:!0,type:"boolean"},allowDragSelectionAutoScroll:{value:!0,type:"boolean"},allowCellDragSelectionHandle:{value:!0,type:"boolean"},allowCellDragDropSelectionHandle:{value:!0,type:"boolean"},allowCellDragSelectionAutoFill:{value:!0,type:"boolean"},selectAllMode:{value:"page",allowedValues:["none","page","all"],type:"string"},mode:{value:"many",type:"string",allowedValues:["one","many","extended"]},action:{value:"click",type:"string",allowedValues:["none","click","doubleClick"]},checkBoxes:{value:{enabled:{value:!1,type:"boolean"},autoShow:{value:!1,type:"boolean"},action:{value:"click",type:"string",allowedValues:["none","click","doubleClick"]},selectAllMode:{value:"page",allowedValues:["none","page","all"],type:"string"},position:{value:"near",allowedValues:["near","far"],type:"string"}},type:"object"},selected:{value:"",type:"string"},tabKeyBehavior:{value:"default",allowedValues:["none","default"],type:"string"},defaultSelection:{value:!1,type:"boolean"}},type:"object"},sorting:{value:{enabled:{value:!1,type:"boolean"},sort:{value:[],type:"array"},mode:{value:"one",allowedValues:["one","many"],type:"string"},maintainSort:{value:!0,type:"boolean"},commandKey:{value:"",allowedValues:["","Shift","Control","Alt"],type:"string"},sortToggleThreeStates:{value:!0,type:"boolean"},sortToggleOnClick:{value:!0,type:"boolean"},sortToggleOnClickAndCommandKey:{value:!1,type:"boolean"}},type:"object"},storeHistory:{value:!1,type:"boolean"},storeHistoryItems:{value:20,type:"number"},users:{value:[],type:"array",reflectToAttribute:!1},virtualModeCachedRowsCount:{value:100,type:"int"}}}static get requires(){return{}}static get styleUrls(){return["smart.menu.css","smart.filterpanel.css","smart.pager.css","smart.grid.css","smart.textbox.css"]}template(){return"<div class='smart-container'id='container' disabled='[[disabled]]' role='grid'>\n <div id='header' role=\"toolbar\" class='smart-grid-header smart-hidden'>\n </div>\n <div id='groupHeader' role=\"presentation\" class='smart-grid-group-header smart-hidden'></div>\n <div id='headerPager' top class='smart-grid-pager smart-hidden'></div>\n <div id='headerCommandBar' header top class='smart-grid-header smart-grid-command-bar smart-hidden'></div>\n <div id='content' class='smart-grid-content'>\n <div id='columnHeader' role=\"rowgroup\" class='smart-grid-column-header'>\n <div id='columnNearContainer' role=\"row\" class='near smart-hidden smart-grid-column-header-cell-container'>\n </div>\n <div id='columnContainer' role=\"row\" class='center smart-grid-column-header-cell-container'>\n </div>\n <div id='columnFarContainer' role=\"row\" class='far smart-hidden smart-grid-column-header-cell-container'>\n </div>\n </div>\n <div id='scrollView' role=\"rowgroup\" class ='smart-grid-scroll-view'>\n <div id='rowNearContainer' role=\"presentation\" class='near smart-hidden smart-grid-row-container'>\n </div>\n <div id='rowContainer' role=\"presentation\" class='center smart-grid-row-container'>\n </div>\n <div id='rowFarContainer' role=\"presentation\" class='far smart-hidden smart-grid-row-container'>\n </div>\n <div id='placeholder' class ='smart-hidden smart-placeholder smart-grid-placeholder'></div>\n <smart-scroll-bar right-to-left=\"[[rightToLeft]]\" theme=\"[[theme]]\" id='verticalScrollBar' class='smart-grid-scroll-bar' wait disabled='[[disabled]]' orientation='vertical'></smart-scroll-bar>\n <smart-scroll-bar right-to-left=\"[[rightToLeft]]\" theme=\"[[theme]]\" id='horizontalScrollBar' class='smart-grid-scroll-bar' wait disabled='[[disabled]]'></smart-scroll-bar>\n </div>\n <div id='filterFooter' class='smart-grid-filter-footer smart-hidden'></div>\n </div>\n <div class=\"smart-grid-view-content smart-hidden\" id=\"viewContent\"></div>\n <div id='loadingIndicatorContainer' class='smart-loader-container'>\n <span id='loadingIndicator' class='smart-grid-loader smart-loader'></span>\n <span id='loadingIndicatorPlaceholder' class ='smart-loader-label smart-hidden'></span>\n </div>\n <div id='footerCommandBar' footer class='smart-grid-footer smart-grid-command-bar smart-hidden'></div>\n <div id='footerPager' class='smart-grid-pager smart-hidden'></div>\n <div id='footer' class='smart-grid-footer smart-hidden'></div>\n </div>"}static get listeners(){return{focus:"_focusHandler",blur:"_blurHandler",wheel:"_mouseWheelHandler","document.up":"_upHandler","document.down":"_downHandler","document.move":"_moveHandler","document.scroll":"_scrollHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler",resize:"_resizeHandler","header.click":"_headerClickHandler","columnHeader.down":"_columnDownHandler","columnHeader.click":"_columnClickHandler","columnHeader.move":"_columnMoveHandler","columnHeader.mouseleave":"_columnMouseLeaveHandler","rowNearContainer.down":"_rowDownHandler","rowContainer.down":"_rowDownHandler","rowFarContainer.down":"_rowDownHandler","container.selectstart":"_selectStartHandler",styleChanged:"_styleChangedHandler",swipeleft:"_swipeLeftHandler",swiperight:"_swipeRightHandler",contextmenu:"_contextMenuHandler"}}_contextMenuHandler(e){if(this.contextMenu.enabled)return e.preventDefault(),e.stopPropagation(),!1}get _tabindex(){return this.disabled||this.unfocusable?"":' tabindex="0"'}pageIndexValidator(e,t){const o=this;if(t<0)return 0;if(o.dataSource){if(o.dataSource.virtualDataSource)return t;const e=Math.ceil(o.dataSource.length/o._pageSize);if(t>e-1)return e-1}}_offsetTop(e){return e?e.offsetTop+this._offsetTop(e.offsetParent):0}_offsetLeft(e){return e?e.offsetLeft+this._offsetLeft(e.offsetParent):0}offset(e){return{left:this._offsetLeft(e),top:this._offsetTop(e)}}getBoundingRect(e){const t=this;let o=window.pageXOffset,a=window.pageYOffset,l=e.getBoundingClientRect();if(e!==document.body){let l=e.parentNode;for(;l!==document.body&&l;){l&&(o+=l.scrollLeft,a+=l.scrollTop);let e=l;l?(l=l.parentNode,t.enableShadowDOM&&l===t.shadowRoot?l=t:!t.isInShadowDOM||l!==t.getRootNode()&&e!==t.getRootNode()||(l=t.getRootNode().host)):t.isInShadowDOM&&(l=t.getRootNode().host)}}return{bottom:l.bottom+a,height:l.height,left:l.left+o,right:l.right+o,top:l.top+a,width:l.width}}_downHandler(e){this._downTarget=e.originalEvent.target}_removeCellContentPopup(){const e=this;e._cellContentPopup&&(e._cellContentPopup.remove(),e._cellContentPopup=null),e._cellContentPopupTimer&&(clearTimeout(e._cellContentPopupTimer),e._cellContentPopupTimer=null)}_upHandler(e){const t=this,o=t.getBoundingRect(t);super._upHandler(),t._tapTimer&&clearTimeout(t._tapTimer);const a=()=>{t.editing.isEditing&&!t.editing.dialog.enabled&&setTimeout((()=>{if(!e.defaultPrevented){if(t.editing.editCell&&t.editing.editCell.editor.instance){const o=t.editing.editCell.editor.instance;if(o.element&&o.element.hasAttribute("aria-owns")){const t=o.element.getAttribute("aria-owns"),a=document.getElementById(t);if(a&&a.contains(e.originalEvent.target))return}if(t.editing.editCell.editor.instance.blur(e),e.defaultPrevented)return}t.endEdit()}}),50)};if(!e.originalEvent||(e.originalEvent.target===t.$.scrollView&&t._downTarget===e.originalEvent.target&&a(),!e.originalEvent.target.closest(".smart-grid-dialog"))){if(e.pageX<o.left||e.pageX>o.right||e.pageY<o.top||e.pageY>o.bottom){let o=!1,l=e.originalEvent.target;for(;l;)if(l=l.parentNode,l===t){o=!0;break}if(o)return t._dragSelectionEnd(e),t._endResize(e),void t._endDrag(e);if(t._summaryRowDialog&&t._summaryRowDialog.classList.contains("open")&&t._summaryRowDialog.confirm(),t._inputOverlay&&(t._inputOverlay.classList.remove("smart-input-overlay-on"),setTimeout((()=>{t._inputOverlay&&(t._inputOverlay.parentNode&&t._inputOverlay.parentNode.removeChild(t._inputOverlay),t._inputOverlay=null)}),t.behavior.doubleClickTimingDelay)),a(),t.menu){let o,a,l,n;if(t.enableShadowDOM||t.isInShadowDOM?(o=e.originalEvent.composedPath()[0],a=function(){let e=o.getRootNode().host;for(;e;){if(e===t)return e;e=e.getRootNode().host}}(),l=t.menu.contains(o)||t.menu.firstElementChild.shadowRoot.contains(o),n=t.menu.firstElementChild.shadowRoot):(o=e.originalEvent.target,a=t.contains(o),l=t.menu.contains(o),n=t.menu),!a&&!l){const e=n.querySelectorAll("smart-drop-down-list"),a=n.querySelectorAll("smart-date-time-picker"),l=n.querySelectorAll("smart-date-input"),i=n.querySelectorAll("smart-input");for(let t=0;t<e.length;t++)if(e[t].$.dropDownContainer.contains(o))return;for(let e=0;e<a.length;e++)if(a[e].$.dropDownContainer.contains(o))return;for(let e=0;e<l.length;e++)if(l[e].$.scrollView.contains(o))return;for(let e=0;e<i.length;e++)if(i[e].$.scrollView.contains(o))return;return void t.closeMenu()}}}t._summaryRowDialog&&t._summaryRowDialog.classList.contains("open")&&t._summaryRowDialog.confirm(),t._dragSelectionEnd(e),t._endResize(e),t._endDrag(e)}}_nextColumn(e){const t=this;for(let o=0;o<t.viewColumns.length;o++){const a=t.viewColumns[o];if(a.visibleIndex===e.visibleIndex+1)return a}return null}_nextRow(e){const t=this._recyclingRows,o=t.indexOf(e);return o>=0?t[o+1]:null}_moveHandler(e){const t=this;if(t.isInitialized&&t._selection){if(t.selection.enabled&&t.selection.allowDragSelection&&!t.editing.isEditing&&(!t._selection.selectionRect||t._selection.selectionRect&&!t._selection.selectionRect.captured)&&(t._dragSelection(e),e.originalEvent)){const o=e.originalEvent.target.closest?e.originalEvent.target:void 0;Smart.Utilities.Core.isMobile&&o&&o.closest("smart-grid")===t&&e.originalEvent.preventDefault()}t.isScrolling||("none"===t.behavior.columnResizeMode||t.classList.contains("smart-grid-row-resize-mode")||t._columnMoveResizeHandler(e),"none"===t.behavior.rowResizeMode||t.classList.contains("smart-grid-column-resize-mode")||t._rowMoveResizeHandler(e),t._drag(e))}}_hideActionButtons(){const e=this;if(e._columnElements){for(let t=0;t<e._columnElements.length;t++){const o=e._columnElements[t],a=o.column;a&&a.autoShowActionButton&&o._hideActionButton()}for(let t=0;t<e._frozenNearColumns.length;t++){const o=e._frozenNearColumns[t],a=o.element;o&&o.autoShowActionButton&&a._hideActionButton()}}}_columnMouseLeaveHandler(){this._hideActionButtons()}_columnMoveHandler(e){const t=this;if(!t.isInitialized)return;if(t._columnResizeStartLine||t._rowResizeStartLine)return;const o=(o,a)=>{if(o&&o.autoShowActionButton){const l=a.getBoundingClientRect(),n=t.offset(a),i=t.parentElement,r=i?i.scrollTop:0;if(n.left<=e.pageX&&n.left+l.width-6>=e.pageX)if(n.top-r<=e.pageY&&n.top-r+l.height>=e.pageY){if(!t.hasColumnMenu(o))return;a._showActionButton()}else a._hideActionButton();else a._hideActionButton()}};for(let e=0;e<t._columnElements.length;e++){const a=t._columnElements[e];o(a.column,a)}for(let e=0;e<t._frozenNearColumns.length;e++){const a=t._frozenNearColumns[e];o(a,a.element)}}_headerClickHandler(e){const t=this;if(t.$.headerBar){const o=t.isInShadowDOM||t.shadowRoot?e.composedPath()[0]:e.target;t.$.headerBar._headerClickHandler(o,t)}}_columnClickHandler(e){const t=this;if(t._overlay)return;if(void 0===e.clientX)return;const o=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let a=null,l=null;const n=new Date-t._columnClickTime<t.behavior.doubleClickTimingDelay;t._columnClickTime=new Date;for(let e=0;e<o.length;e++){const t=o[e];if(t.classList.contains("smart-action-button"))return;if(t.getAttribute("data-field")){a=t.getAttribute("data-field"),l=t;break}}if(a){const o=l.column;if(!o)return;if(e.srcElement.classList.contains("smart-filter-button"))return;if("_addNewColumn"===o.dataField)return void t._openAddColumnDialog();if(Smart.Utilities.Core.isMobile)n&&t.sorting.sortToggleOnClick&&o.allowSortToggleOnClick&&t.sorting.enabled&&t.sortBy(a),t._columnMoveHandler(e),e.originalEvent&&e.originalEvent.preventDefault();else if(!n&&t.sorting.sortToggleOnClick&&o.allowSortToggleOnClick&&t.sorting.enabled){if("none"!==t.behavior.columnResizeMode&&"col-resize"===o.element.style.cursor)return;if(t._canSort=!0,""!==t.sorting.commandKey){if("Alt"===t.sorting.commandKey&&!1===e.altKey&&(t._canSort=!1),"Shift"===t.sorting.commandKey&&!1===e.shiftKey&&(t._canSort=!1),"Control"===t.sorting.commandKey&&!1===e.metaKey&&!1===e.ctrlKey&&(t._canSort=!1),"Control"!==t.sorting.commandKey&&e.ctrlKey)return;if(!0===t.sorting.sortToggleOnClickAndCommandKey&&!t._canSort)return}t.sortBy(a)}}}_columnDownHandler(e){const t=this,o=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let a=null,l=null;const n=new Date-t._clickTime<t.behavior.doubleClickTimingDelay;t.$.headerBar&&t.$.headerBar.closePanel(),t._doubleClickHandler(e);for(let e=0;e<o.length;e++){const t=o[e];if(t.classList.contains("smart-action-button"))return;if(t.getAttribute("data-field")){a=t.getAttribute("data-field"),l=t;break}}if(a){const o=l.column;if(!o)return;if("_commandColumn"===a)return void(t.editing.commandColumn.dataSource.commandColumnMenu.visible&&t._applyCommand(t.editing.commandColumn.dataSource.commandColumnMenu.command));const i=function(l){const n=o.selectionColumn?t.selection.checkBoxes.action===l&&t.selection.enabled:t.selection.action===l&&t.selection.enabled;if("col-resize"!==o.element.style.cursor&&(!t.appearance.showColumnHeaderDragIcon||!e.originalEvent.target.classList.contains("smart-drag-handle"))&&n){if(t.editing.enabled&&t.editing.editColumn===o)return;if(e.shiftKey||e.ctrlKey?t._dragSelectionStartDataField=null:t._dragSelectionStartDataField=a,"_checkBoxColumn"===a)return void t._toggleColumnSelection(o);"_rowHeaderColumn"===a&&t.selection.enabled&&t.selection.allowRowHeaderSelection&&t.appearance.showRowHeaderSelectIcon&&(t.areAllRowsSelected()?t.clearSelection():t.selectAllRows(),o.refresh()),t.selection.allowColumnHeaderSelection&&o.allowSelect&&t._setSelection(null,o.dataField,e)}};if(t.editing.isEditing&&t.endEdit(),i("click"),t.$.fireEvent("columnClick",{column:o,dataField:o.dataField}),n&&(t.$.fireEvent("columnDoubleClick",{column:o,dataField:o.dataField}),i("doubleClick"),t._onColumnDoubleClick(o,e)),t._columnToResizeElement&&!t._columnResizeLine)return t._columnDownResizeHandler(e),void(t._clickTime=new Date);if(t._beginDrag(e,o),o.menu)return void(t._clickTime=new Date)}t.closeMenu(),t._clickTime=new Date}addTransformMoveStyle(e,t,o,a,l,n){e.style.opacity=n,e.style["transition-duration"]=t,e.style.transform="translate3d("+o+"px,"+a+"px,"+l+"px)"}removeTransformMoveStyle(e){e.style.opacity="",e.style["transition-duration"]="",e.style.transform=""}_rowDownHandler(e){const t=this;if(t._inputOverlay&&t._inputOverlay.classList.remove("smart-input-overlay-on"),t._doubleClickHandler(e),t._closeMenu(t.menu),t._rowResizeHandler(e),t._removeCellContentPopup(),t._toggledRow&&t.appearance.allowRowToggleAnimation)return;if(e.target&&!e.target.classList.contains("smart-grid-row-container")&&!e.target.classList.contains("smart-grid-selection-overlay")&&!e.target.classList.contains("smart-selection-overlay-content"))return;let o=e.clientX,a=e.clientY;e.touches&&(o=e.touches[0].clientX,a=e.touches[0].clientY);const l=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(o,a);let n=null,i=null,r=null,s=null;t._lastPointerDownTime=new Date;for(let e=0;e<l.length;e++){const t=l[e];if(t.hasAttribute("toggle-button")&&(i=t),t.hasAttribute("checkbox")&&(r=t),s||"smart-grid-cell"!==t.nodeName.toLowerCase()||(s=t),!n&&"smart-grid-row"===t.nodeName.toLowerCase()){n=t;break}}if(n&&s){const o=s?s.cell:null;if(o.row.filterRow||t._closeMenu(t.filterRowMenu),i&&o&&!o.column.rowDetailColumn&&i!==o.row.toggleDetailButton&&!i.classList.contains("row-detail"))n.row.toggle(e);else if(t.rowDetail.enabled&&t.rowDetail.visible&&i&&o&&o.column.rowDetailColumn){const e=n.row;e.showDetail?t.hideDetail(e.id):t.showDetail(e.id)}else{const o=n.row,a=s?s.cell:null;a.column._treeColumn&&r&&(o.checked=!o.checked),a.element===o.header&&t.behavior.allowRowReorder&&t._beginDrag(e,o),t._tapTimer&&clearTimeout(t._tapTimer),t._tapTimer=setTimeout((function(){t._clickedRow===n&&t.$.fireEvent("rowTap",{row:o,id:o.id,originalEvent:e.originalEvent}),t._clickedCell===s&&t.$.fireEvent("cellTap",{cell:a,id:o.id,dataField:a.column.dataField,originalEvent:e.originalEvent})}),t.behavior.doubleClickTimingDelay);const l=function(l){if(!t.selection.enabled||o.autoGenerated||!0!==o.allowSelect)return void delete t.__selectionStarted;if(o.header&&"row-resize"===o.header.style.cursor){const a=t.offset(o.header);if(t._rowToResize&&a.left<=e.originalEvent.pageX&&e.originalEvent.pageX<=a.left+o.header.offsetWidth)return;o.header.style.cursor=""}const i=t.editing.isEditing;if(i&&t.editing.editCell&&t.editing.editCell.row.id===o.id&&t.editing.editCell.column.dataField===a.column.dataField)return;if(i&&t.editing.editRow&&t.editing.editRow.id===o.id)return;const r=()=>{t.focus(),setTimeout((function(){t.focus()}),50)};if(t.selection.action===l){if(e.shiftKey||e.ctrlKey||!t.selection.allowRowHeaderSelection&&a.column.autoGenerated?t._dragSelectionStartRow=null:t._dragSelectionStartRow=n.row,e.shiftKey||e.ctrlKey?t._dragSelectionStartDataField=null:t._dragSelectionStartDataField=a.column.dataField,a.column.rowHeaderColumn&&!t.selection.allowRowHeaderSelection)return t._dragSelectionStartRow=null,void r();t._setSelection(o.id,a.column.dataField,e),r()}else a.column.selectionColumn&&t.selection.checkBoxes.enabled&&t.selection.checkBoxes.action===l&&(t._setSelection(o.id,a.column.dataField,e),r())},i=a.selected;t._clickTime||(t._clickTime=new Date);const d=t._clickedCell===s&&new Date-t._clickTime<t.behavior.doubleClickTimingDelay,u=e.originalEvent?e.originalEvent:e,c=3===u.which;if(c||"_commandColumn"===a.column.dataField||l("click"),t.$.fireEvent("rowClick",{row:o,id:o.id,isRightClick:c,originalEvent:u,pageX:parseInt(u.pageX),pageY:parseInt(u.pageY)}),t.$.fireEvent("cellClick",{cell:a,id:o.id,dataField:a.column.dataField,isRightClick:c,originalEvent:u,pageX:parseInt(u.pageX),pageY:parseInt(u.pageY)}),c&&t.contextMenu.enabled)return t.contextMenu.id=o.id,t.contextMenu.dataField=a.column.dataField,t._focusCell(o.id,a.column.dataField),t.openContextMenu(u.pageX+10,u.pageY+10),void(t.contextMenu.selector&&(u.stopPropagation(),u.preventDefault()));if(o.autoGenerated||a.column.autoGenerated||"checkBox"===a.template&&e.originalEvent&&e.originalEvent.target&&e.originalEvent.target.classList.contains("smart-input"))t._onRowClick(o.index,o,e),t._onCellClick(a,e);else if(t.selection.enabled)if(t.selection.allowCellSelection)if("extended"===t.selection.mode){if(!0===i&&i===a.selected&&!t.selection.isDragging){const l=t._selection.focusedCell;l&&t._clickedCell&&l.id===a.row.id&&l.dataField===a.column.dataField&&l.id===t._clickedCell.cell.row.id&&l.dataField===t._clickedCell.cell.column.dataField&&(t._onRowClick(o.index,o,e),t._onCellClick(a,e))}}else d||(t._onRowClick(o.index,o,e),t._onCellClick(a,e));else if(t.selection.allowRowSelection)if("extended"===t.selection.mode){if(!0===i&&i===a.selected&&!t.selection.isDragging){const l=t._selection.focusedCell;t._clickedCell&&l.id===a.row.id&&l.id===t._clickedCell.cell.row.id&&(t._onRowClick(o.index,o,e),t._onCellClick(a,e))}}else d||(t._onRowClick(o.index,o,e),t._onCellClick(a,e));else t._onRowClick(o.index,o,e),t._onCellClick(a,e);else t._onRowClick(o.index,o,e),t._onCellClick(a,e);new Date-t._clickTime<t.behavior.doubleClickTimingDelay&&(t._clickedRow===n&&(t._onRowDoubleClick(o.index,o,e,e),t.$.fireEvent("rowDoubleClick",{row:o,id:o.id,isRightClick:c,originalEvent:e.originalEvent,pageX:parseInt(u.pageX),pageY:parseInt(u.pageY)}),l("doubleClick")),t._clickedCell===s&&(t._onCellDoubleClick(a,e),t.$.fireEvent("cellDoubleClick",{cell:a,id:o.id,dataField:a.column.dataField,isRightClick:c,originalEvent:e.originalEvent,pageX:parseInt(u.pageX),pageY:parseInt(u.pageY)}))),t._clickedRow=n,t._clickedCell=s,t._clickTime=new Date,t.layout.allowCellsWrapShortcut&&t._clickedCell.hasAttribute("focus")&&t._clickedCell.hasAttribute("selected")&&e.shiftKey&&(t._cellContentPopupTimer&&clearTimeout(t._cellContentPopupTimer),t.selection.isDragging?t._removeCellContentPopup():a.autoWrap())}}}showDetail(e){const t=this.rowById[e];t&&(t.showDetail=!0)}hideDetail(e){const t=this.rowById[e];t&&(t.showDetail=!1)}_focusHandler(){this._focused=!0}_blurHandler(){this._focused=!1}_notify(e,t,o){const a=this;if(a.notifyFn)for(let l=0;l<a.notifyFn.length;l++)a.notifyFn[l](e,t,o)}notify(e){const t=this;e&&(t.notifyFn||(t.notifyFn=[]),t.notifyFn.push(e))}_applyTemplate(e,t){let o=null;if(null!==e&&""!==e)if(e&&"function"==typeof e)e(t);else if((e.startsWith("#")||e.startsWith("."))&&(o=document.querySelector(e)),o)t.innerHTML="",o instanceof HTMLElement&&!(o instanceof HTMLTemplateElement)?t.appendChild(o):t.appendChild(o.content.cloneNode(!0).firstElementChild);else{const o=function(e){const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild}(e);o&&(t.innerHTML="",t.appendChild(o))}else t.innerHTML=""}propertyChangedHandler(e,t,o){const a=this;if(a.isInitialized){switch(a._notify(e,t,o),e){case"onRowInserted":return;case"view":return void(a.$.headerBar&&a.$.headerBar._setView&&a.$.headerBar._setView(o));case"users":case"currentUser":a._refreshCurrentUser();break;case"summaryRow_visible":{for(let e=0;e<a.columns.length;e++)a._summaryRowCount=Math.max(a._summaryRowCount,a.columns[e].summary.length);const e=a.onRowInserted;a.onRowInserted=null,a._renderRows(!0),a.onRowInserted=e;break}case"conditionalFormatting":return a._renderConditionalFormatting(),void a.refresh();case"appearance_displayLoadingIndicator":return void a._setLoadingIndicatorVisibility();case"appearance_placeholder":return void(a.$.placeholder.innerHTML=o);case"appearance_showColumnHeaderLines":case"appearance_showColumnLines":case"appearance_showRowLines":return void a._recycle();case"appearance_allowColumnStickyPosition":o?a._stickHeader():a._unstickHeader();break;case"appearance_showColumnIcon":for(let e=0;e<a.columns.length;e++)a.columns[e].setProperty("showIcon",a.appearance.showColumnIcon);a._recycle();break;case"appearance_showRowHeaderNumber":case"appearance_showRowHeader":{a._initializeRowNumberColumn();const e=a._frozenNearColumns[0];e.rowHeaderColumn&&e.element&&!e.element.parentNode&&a.$.columnNearContainer.appendChild(e.element),a.refresh();break}case"header_visible":a.header.visible&&""===a.header.template&&(a.$.header.innerHTML='<smart-grid-toolbar header-position="top"></smart-grid-toolbar>',a.$.headerBar=a.$.header.firstElementChild,a.$.headerBar._init(a),a.header.onInit&&a.header.onInit(a.$.headerBar));break;case"header_buttons":a.header.visible&&""===a.header.template&&a._refreshHeaderBar();break;case"header_template":a._applyTemplate(o,a.$.header);break;case"footer_template":a._applyTemplate(o,a.$.footer);break;case"layout_columnWidth":case"columnWidth":{a.columns.canNotify=!1;let e=parseInt(o);if(isNaN(e)&&(e=null),e>=30||null===e)for(let t=0;t<a.columns.length;t++)a.columns[t].width=e;a.columns.canNotify=!0,a.refresh();break}case"checkBoxes_visible":return void a._recycle();case"checkBoxes_hasThreeStates":return a.rows.canNotify=!1,a._applyThreeStates(a.rowHierarchy),a.rows.canNotify=!0,void a._recycle();case"columnHeader_visible":a.__columnHeaderHeight=null,a.refresh();break;case"selection_checkBoxes_enabled":a._selectionColumn.visible=o;break;case"selection_checkBoxes_autoShow":a._selectionColumn.element&&(o?a._selectionColumn.element.setAttribute("auto-show",""):a._selectionColumn.element.removeAttribute("auto-show"));break;case"selection_checkBoxes_position":{let e=a.viewColumns.indexOf(a._selectionColumn);a.viewColumns.canNotify=!1,a.viewColumns.splice(e,1);const t=a._frozenNearColumns.indexOf(a._selectionColumn),l=a._frozenFarColumns.indexOf(a._selectionColumn);if(t>=0&&a._frozenNearColumns.splice(t,1),l>=0&&a._frozenFarColumns.splice(l,1),"far"===o)a._selectionColumn.canNotify=!1,a._selectionColumn.freeze="far",a._selectionColumn.canNotify=!0,a._frozenFarColumns.splice(0,0,a._selectionColumn),a.viewColumns.push(a._selectionColumn),a.$.columnFarContainer.appendChild(a._selectionColumn.element);else{let e=0,t=0;for(let o=0;o<a.viewColumns.length&&(a.viewColumns[o].autoGenerated||a.viewColumns[o].dataField!==a.columns[t++].dataField);o++)a.viewColumns[o].autoGenerated&&e++;a._selectionColumn.canNotify=!1,a._selectionColumn.freeze="near",a._selectionColumn.canNotify=!0,a._frozenNearColumns.splice(e,0,a._selectionColumn),a.viewColumns.splice(e,0,a._selectionColumn),a.$.columnNearContainer.appendChild(a._selectionColumn.element)}a.viewColumns.canNotify=!0;break}case"selection_mode":if(a._selection&&(a._selection.focusedCell=null),a.selection.allowCellSelection)a.clearSelection();else if("one"===o){const e=a.getSelection();if(a.clearSelection(),e.rows&&e.rows[0]){e.rows[0].row.selected=!0;const t=a.rowById[e.rows[0].row.id].getCell(a.columns[0].dataField);a._selection.focusedCell={id:t.row.id,dataField:t.column.dataField,value:t.value,index:t.row.index}}}break;case"grouping_groupBy":return a.dataSource&&a.dataSource.groupBy&&(a.dataSource.groupBy=o),void a.refresh();case"sorting_enabled":return void a.refresh();case"sorting_maintainSort":return void a._recycle(!1);case"filtering_enabled":return o&&0===a._filterPanels.length&&a._createFilterPanels(),void(a.header.visible&&a.refresh());case"filtering_filterRow_visible":return a._initializeRows(),a._initializeRowElements(),void a.refresh();case"filtering_operator":return void a.refreshFilters();case"filtering_filter":for(let e=0;e<a.columns.length;e++){const t=a.columns[e];t.canNotify=!1,t.setProperty("filter",null),t.canNotify=!0}for(let e=0;e<a.filtering.filter.length;e++){const t=a.filtering.filter[e];if(t&&t.splice){const e=t[0],o=t.splice(1);let l=null;if(o instanceof Smart.FilterGroup)l=o;else{const t=a.columnByDataField[e];t&&(l=a.dataSource._createFilter(t.dataType,o))}l&&a.addFilter(e,l,!1)}}return void a.refreshFilters();case"messages":case"locale":{if(a.columns)for(let e=0;e<a.columns.length;e++)a.columns[e]._cellsCachedValues=[];a._dialogEdit&&(a._dialogEdit.close(),a._dialogEdit=null),a._dialogDelete&&(a._dialogDelete.close(),a._dialogDelete=null),a._dialogAddRow&&(a._dialogAddRow.close(),a._dialogAddRow=null);const e=a.$.headerPager.querySelector("smart-pager"),t=a.$.footerPager.querySelector("smart-pager");e&&(e.locale=a.locale),t&&(t.locale=a.locale);const o=(e,t)=>{a._handleFilterMenuClick(e,t)};a._filterInfo||(a._filterInfo={}),a._filterInfo.stringConditions=[{icon:"smart-icon-contains",command:o,value:"CONTAINS",label:a.localize("CONTAINS")},{icon:"smart-icon-does-not-contain",command:o,value:"DOES_NOT_CONTAIN",label:a.localize("DOES_NOT_CONTAIN")},{icon:"smart-icon-starts-with",command:o,value:"STARTS_WITH",label:a.localize("STARTS_WITH")},{icon:"smart-icon-ends-with",command:o,value:"ENDS_WITH",label:a.localize("ENDS_WITH")},{icon:"smart-icon-equals",command:o,value:"EQUAL",label:a.localize("EQUAL")},{icon:"smart-icon-delete",command:o,value:"CLEAR_FILTER",label:a.localize("CLEAR_FILTER")}],a._filterInfo.numberAndDateConditions=[{icon:"smart-icon-equals",command:o,value:"EQUAL",label:a.localize("EQUAL")},{icon:"smart-icon-not-equal",command:o,value:"NOT_EQUAL",label:a.localize("NOT_EQUAL")},{icon:"smart-icon-less-than",command:o,value:"LESS_THAN",label:a.localize("LESS_THAN")},{icon:"smart-icon-less-than-equal",command:o,value:"LESS_THAN_OR_EQUAL",label:a.localize("LESS_THAN_OR_EQUAL")},{icon:"smart-icon-greater-than",command:o,value:"GREATER_THAN",label:a.localize("GREATER_THAN")},{icon:"smart-icon-greater-than-equal",command:o,value:"GREATER_THAN_OR_EQUAL",label:a.localize("GREATER_THAN_OR_EQUAL")},{icon:"smart-icon-between",command:o,value:"RANGE",label:a.localize("RANGE")},{icon:"smart-icon-delete",command:o,value:"CLEAR_FILTER",label:a.localize("CLEAR_FILTER")}],a._refreshHeaderBar(),a.$.headerBar&&(a.$.headerBar.messages=a.messages,a.$.headerBar.locale=a.locale,a.$.headerBar._localizeHeader(),a.$.headerBar._getInnerElementMessages()),a._recycle();break}case"paging_spinner_enabled":a._refresh();break;case"pager_visible":return a._renderPagers(),void a._refreshPaging(!1);case"paging_pageIndex":case"pager_position":case"paging_enabled":return void a._refreshPaging(!0);case"paging_pageSize":return void a._refreshPaging(!1);case"columns":{a.__measuredColumnHeight=null,a.editing&&a.editing.isEditing&&a.cancelEdit(),a._cellEditors=[];let e=!1;if(t&&t.length)for(let o=0;o<t.length;o++)if(t[o].freeze){e=!0;break}if(a.columns&&a.columns.length)for(let t=0;t<a.columns.length;t++)if(a.columns[t].freeze){e=!0;break}if(e&&a._initializeRowElements(),a.columns&&a._sortedColumns){const e=[];a.columns.forEach((t=>{t.sortOrder&&e.push(t)})),a._sortedColumns=JSON.parse(JSON.stringify(e))}if(a._renderColumns(),a._refreshHeaderBar(),a.columns&&a.filtering.enabled){a.beginUpdate();for(let e=0;e<a.columns.length;e++){const t=a.columns[e];if(t.canNotify=!1,a.removeFilter(t.dataField),t.filtered=!1,t.canNotify=!0,t.filter){let e=null,o=t.filter;e=o instanceof Smart.FilterGroup?o:a.dataSource._createFilter(t.dataType||"string",o),e&&a.addFilter(t.dataField,e,!1)}}a.refreshFilters(),a.endUpdate()}return a.layout.isDirty=!0,a._resetCachedLayout(),void a._refreshLayout()}case"columnGroups":if(a._columnGroups=[],a._columnHeights=0,a.viewColumns)for(let e=0;e<a.viewColumns.length;e++){const t=a.viewColumns[e],o=t.element;t.top=0,t.level=0,o&&(o.style.top="",o.style.height="",o.style.lineHeight="")}return a.columns.canNotify=!1,a.columns=a._initColumns,a._renderColumns(),a.columns.canNotify=!0,a.__columnHeaderHeight=null,void a.refresh();case"dataSource":if(delete a._isFirstVirtualDataSourceRequest,"dataSource"===e&&t&&o){const e=a.dataSource&&a.dataSource.virtualDataSource&&!a.dataSource.virtualDataSourceOnExpand&&"infinite"!==a.scrolling;if(t instanceof Smart.DataAdapter&&!e&&t.length===o.length&&t.length>0&&o.length>0&&!a.dataSourceSettings.parentDataField&&!t.parentDataField){if(a.dataSource=t,a._cachedDataSource===o)return;return setTimeout((()=>{a.beginUpdate();for(let e=0;e<o.length;e++){const t=o[e],l=a.dataSource[e].$.id;a._updateRow(l,t,!0)}delete a.__autoRowHeight,a._virtualOnExpandCache=[],a._cellsMerge=[],a._cellStyles=[];const e=a._filters,t=a._sortedColumns;if(a.clearSort(),a.filtering.filterRow)for(let e=0;e<a.columns.length;e++)a.columns[e]._filterEditorInitialized=!1;for(let e=0;e<a.columns.length;e++)delete a.columns[e]._cellsCachedValues;t&&a._refreshSort(t),e&&e.length>0&&(a._filters=null,a.refreshFilters()),a.endUpdate()})),a._cachedDataSource=o,void(a.header.visible&&""===a.header.template&&a.$.headerBar._init(a))}}return a.dataBind(),void(a.header.visible&&""===a.header.template&&a.$.headerBar._init(a));case"rowDetail_dialog_width":case"rowDetail_dialog_height":case"rowDetail_dialog_enabled":case"rowDetail_dialog_visible":return;case"rowDetail_height":case"rowDetail_enabled":{a.beginUpdate(),a.rows.canNotify=!1;const e=a.appearance.allowRowDetailToggleAnimation;a.appearance.allowRowDetailToggleAnimation=!1;for(let e=0;e<a._recyclingRows.length;e++){const t=a._recyclingRows[e];t.height=null,t.setProperty("showDetail",!1),t.detailHeight=a.rowDetail.height}if(a.rows.canNotify=!0,a.rowDetail.enabled){let t=!1;for(let e=0;e<a.viewColumns.length;e++)if(a.viewColumns[e].rowDetailColumn){t=!0;break}if(!t)return a.appearance.allowRowDetailToggleAnimation=e,a.endUpdate(),void a._renderColumns(!0)}else for(let e=0;e<a.viewColumns.length;e++){const t=a.viewColumns[e];if(t.rowDetailColumn){t.visible=!1;break}}return a.appearance.allowRowDetailToggleAnimation=e,void a.endUpdate()}case"rowDetail_visible":for(let e=0;e<a.viewColumns.length;e++){const t=a.viewColumns[e];if(t.rowDetailColumn){t.visible=o;break}}return;case"displayLoadingIndicator":return void a._setLoadingIndicatorVisibility();case"filterable":return void a._refreshLayout();case"layout_allowCellsWrap":{const e=a.columns.canNotify;a.columns.canNotify=!1;for(let e=0;e<a.columns.length;e++)a.columns[e].cellsWrap=o;return a.layout.isDirty=!0,a._resetCachedLayout(),a._refreshLayout(),a.refresh(),void(a.columns.canNotify=e)}case"layout_columnMinHeight":case"layout_rowMinHeight":case"layout_columnHeight":case"layout_rowHeight":return a.layout.isDirty=!0,a._resetCachedLayout(),a._refreshLayout(),void a.refresh();case"rightToLeft":return void a.refresh();case"selectionMode":return;case"editing_addNewColumn_visible":a._addNewColumn?(a._addNewColumn.visible=o,a.refresh()):a._renderColumns();break;case"editing_addNewRow_displayMode":{"row"===a.editing.addNewRow.displayMode&&a.editing.addNewRow._addButton&&(a.editing.addNewRow._addButton.remove(),delete a.editing.addNewRow._addButton);const e=a._scrollView.vScrollBar;return e.style.height="",e.style.top="",e.style.setProperty("--smart-scroll-bar-near-size","0px"),a._renderAddNewRow(),void a.refresh(!0)}case"editing_addNewRow_label":case"editing_addNewRow_visible":case"editing_addNewRow_position":return!1===a.editing.addNewRow.visible&&"button"===a.editing.addNewRow.displayMode&&(a.editing.addNewRow._addButton&&a.editing.addNewRow._addButton.remove(),a._newRow&&a._newRow.element.classList.add("smart-hidden")),a._renderAddNewRow(),void a.refresh();case"editing_enabled":o?a.removeAttribute("aria-readonly"):a.setAttribute("aria-readonly",!0);break;case"editing_dialog_visible":return;case"editing_commandBar_dataSource_commandBarAddRow_visible":case"editing_commandBar_dataSource_commandBarDeleteRow_visible":case"editing_commandBar_dataSource_commandBarBatchSave_visible":case"editing_commandBar_dataSource_commandBarBatchRevert_visible":case"editing_commandBar_visible":case"editing_commandBar_displayMode":case"editing_commandBar_position":a._renderCommandBar();break;case"editing_commandColumn_position":a._renderColumns(!0);break;case"editing_commandColumn_visible":return void a.refresh(!0);case"editing_commandColumn_inline":return a._commandColumn.visible=a.editing.commandColumn.visible&&!a.editing.commandColumn.inline,void a.refresh(!0);case"editing_commandColumn_dataSource_commandColumnCustom_label":case"editing_commandColumn_dataSource_commandColumnCustom_icon":case"editing_commandColumn_dataSource_commandColumnCustom_visible":case"editing_commandColumn_dataSource_commandColumnUpdate_label":case"editing_commandColumn_dataSource_commandColumnUpdate_icon":case"editing_commandColumn_dataSource_commandColumnUpdate_visible":case"editing_commandColumn_dataSource_commandColumnEdit_label":case"editing_commandColumn_dataSource_commandColumnEdit_icon":case"editing_commandColumn_dataSource_commandColumnEdit_visible":case"editing_commandColumn_dataSource_commandColumnDelete_label":case"editing_commandColumn_dataSource_commandColumnDelete_icon":case"editing_commandColumn_dataSource_commandColumnDelete_visible":case"editing_commandColumn_displayMode":return delete a.__cellsCommandTemplate,void a.refresh(!0)}a.refresh()}}ready(){super.ready();const e=this,t=e._scrollView.vScrollBar,o=e._scrollView.hScrollBar;t.hasStyleObserver=!1,o.hasStyleObserver=!1,t.hasResizeObserver=!1,o.hasResizeObserver=!1,t.wait=!1,o.wait=!1,t.onChange=e._verticalScrollbarHandler.bind(e),o.onChange=e._horizontalScrollbarHandler.bind(e),e.setFocusable(!0),e.$.loadingIndicatorPlaceholder.innerHTML=e.appearance.loadingIndicatorPlaceholder,e.$.placeholder.innerHTML=e.appearance.placeholder,e._setLoadingIndicatorVisibility(),e._cellsMerge=[],e._cellStyles=[],e.checkLicense()}_createFilterPanels(){const e=this;if(e._filterPanels){if(e._filterPanels.length>0)return}else e._filterPanels=[];e.filtering.enabled&&0===e._filterPanels.length&&requestAnimationFrame((()=>{const t=document.createElement("smart-filter-panel"),o=document.createElement("smart-filter-panel"),a=document.createElement("smart-filter-panel"),l=document.createElement("smart-filter-panel");o.filterType="boolean",a.filterType="numeric",l.filterType="date",e._filterPanels.bool=o,e._filterPanels.date=l,e._filterPanels.numeric=a,e._filterPanels.string=t;for(let t in e._filterPanels){const o=e._filterPanels[t];o.rightToLeft=e.rightToLeft,o.classList.add("smart-hidden"),e.$.content.appendChild(o),o.parentNode.removeChild(o)}}))}_applyScrolling(){const e=this,t=e._scrollView.vScrollBar;requestAnimationFrame((()=>{switch(t.largeStep=e.$.scrollView.offsetHeight,e.scrolling){case"physical":case"infinite":case"virtual":t.step=e.layout.rowMinHeight,t.mechanicalAction="switchWhileDragging";break;case"deferred":t.step=10,t.mechanicalAction="switchWhenReleased";break;case"logical":t.step=e.layout.rowMinHeight,t.mechanicalAction="switchWhileDragging"}}))}_measureRowElement(e){const t=new Smart.Grid.Row({data:e,index:999999,grid:this});if(!t)return null;const o=t.createElement();return o.classList.add("smart-grid-measure-row"),this.$.scrollView.appendChild(o),o.style.height="",o.style.lineHeight="",o.style.height="",o.style.lineHeight="",t._isMeasureRow=!0,t.render(),o}get _autoRowHeight(){const e=this;if(e.__autoRowHeight)return e.__autoRowHeight;let t=e.layout.rowMinHeight;if(!e.dataSource||e.dataSource&&0===e.dataSource.length)return t;const o=new Smart.Grid.Row({index:0,grid:e}),a=o.createElement();e.$.scrollView.appendChild(a),e.removeAttribute("grouped"),e.removeAttribute("tree"),e.grouping.enabled&&e.dataSource.groupBy&&e.dataSource.groupBy.length>0?e.setAttribute("grouped",""):e.dataSource.boundHierarchy&&e.setAttribute("tree","");const l={};for(let t=0;t<e.dataSource.dataFields.length;t++)l[e.dataSource.dataFields[t].name]="ABCDEFHIJLMNOPQRSTUVWXYZ1234567910|";o.data=l,o._isMeasureRow=!0,o.render(),a.style.height="",a.style.lineHeight="",t=Math.max(a.offsetHeight,t);for(let e=0;e<a.children.length;e++)a.children[e].style.height="";for(let l=0;l<a.children[1].children.length;l++){if(a.children[1].children[l].style.height="auto",e.columns[0]){const t=o.getCell(e.columns[0].dataField);t&&t.render()}t=Math.max(t,8+a.children[1].children[l].offsetHeight);break}return e.$.scrollView.removeChild(a),e.__autoRowHeight=t,e.layout.rowMinHeight&&t<e.layout.rowMinHeight&&(e.__autoRowHeight=e.layout.rowMinHeight),t}get _scrollHeight(){const e=this;let t=e._recyclingRows,o=0,a=e._autoRowHeight,l=0,n=0;if(e.__scrollHeight)return e.__scrollHeight;if(0===t.length||0===e.columns.length||!e.hasVisibleColumn())return 0;e.rows.canNotify=!1;const i=e._measureRowElement(t[0].data),r=t.length;for(let s=0;s<r;s++){let r=t[s];if(!r.visible||!1===r.filtered){r.height=0,r.cellHeight=0,r.top=o;continue}const d=e.rowDetail.enabled&&r.showDetail&&!e.rowDetail.dialog.enabled;if((!r.height||!r.cellHeight||d||"auto"===r.height||"auto"===r._height||"auto"===e.layout.rowHeight||e.layout.isDirty)&&!r.expandHeight){if(r.detailHeight||(r.detailHeight=200),e.layout.rowHeight){if(e.layout.rowHeight)if("number"==typeof e.layout.rowHeight)e.layout.rowHeight<e.layout.rowMinHeight&&(e.layout.rowHeight=e.layout.rowMinHeight),r.height=e.layout.rowHeight,r.computedHeight&&(r.height=r.computedHeight),r.minHeight>r.height&&(r.height=r.minHeight),void 0!==r.label&&"advanced"===e.grouping.renderMode&&(r.height=e.grouping.groupRowHeight),r.cellHeight=r.height,e.rowDetail.enabled&&r.showDetail&&!e.rowDetail.dialog.enabled&&(r.height+=r.detailHeight);else if("auto"===e.layout.rowHeight){e.layout.rowHeight<e.layout.rowMinHeight&&(e.layout.rowHeight=e.layout.rowMinHeight),r.element=i,r.grid=e,r.element&&r.element.classList.contains("smart-hidden")&&r.element.classList.remove("smart-hidden");const t=r.data&&e.isRendered?r._autoSize(r):a,o=r.canNotify;r.canNotify=!1,r.height=t,r.computedHeight&&(r.height=r.computedHeight),void 0!==r.label&&"advanced"===e.grouping.renderMode&&(r.height=e.grouping.groupRowHeight),r.cellHeight=r.height,e.rowDetail.enabled&&r.showDetail&&!e.rowDetail.dialog.enabled&&(r.height+=r.detailHeight),r.canNotify=o}else e.layout.rowHeight(s,r),r.height||(r.height=a),r.cellHeight=r.height,e.rowDetail.enabled&&r.showDetail&&!e.rowDetail.dialog.enabled&&(r.height+=r.detailHeight)}else{if("auto"===r.height||"auto"===r._height){r.element=i,r.element&&r.element.classList.contains("smart-hidden")&&r.element.classList.remove("smart-hidden");const t=r.data&&e.isRendered?r._autoSize(r):a;r.height=t,r._height="auto"}else r.height=a;void 0===r.label||r.summaryRow||"advanced"!==e.grouping.renderMode||(r.height=e.grouping.groupRowHeight),r.computedHeight&&(r.height=r.computedHeight),r.cellHeight=r.height,e.rowDetail.enabled&&r.showDetail&&!e.rowDetail.dialog.enabled&&(r.height+=r.detailHeight)}e._rowGap&&s<e.rows.length-1&&(r.height+=e._rowGap)}!0===r.freeze||"near"===r.freeze?r.visible&&(l+=r.height):"far"===r.freeze&&r.visible&&(n+=r.height),r.freeze&&r.visible?r.top=o:(r.top!==o&&(r.top=o),r.expandHeight?o+=r.cellHeight:o+=r.height)}if(e._summaryRowCount&&e.summaryRow.visible&&(o+=1*a),e.editing.addNewRow&&"button"===e.editing.addNewRow.displayMode&&(o+=1*a),e.filtering&&e.filtering.filterRow.visible&&(l+=a),e.dataSource&&e.dataSource.virtualDataSource&&!1===e.paging.enabled){let t=e.dataSource.length>e.virtualModeCachedRowsCount?e.virtualModeCachedRowsCount:e.dataSource.length;"infinite"===e.scrolling&&(t=e.dataSource.length),"virtual"===e.scrolling&&t>=e.virtualModeCachedRowsCount&&(o=e.rows[0]?e.rows[0].height*e.dataSource.length:e.layout.rowMinHeight*e.dataSource.length)}return e.__scrollHeight=o,e.__frozenNearHeight=l,e.__frozenFarHeight=n,e._scrollView.scrollHeight=o-e.$.scrollView.offsetHeight+l+n,o=e.__scrollHeight+l+n-1,e.grouping.enabled&&e.dataSource.groupBy.length>0&&e.grouping.groupIndent>0&&"advanced"===e.grouping.renderMode&&(o+=parseInt(e.grouping.groupIndent/2)),e.__scrollHeight=o,i.remove(),t[0]&&delete t[0]._isMeasureRow,e.rows.canNotify=!0,o}_measureColumnHeight(){const e=this;if(e.__measuredColumnHeight)return e.__measuredColumnHeight;const t=document.createElement("smart-grid-column");t.style.height="auto",t.style.position="static";const o=document.createElement("div");o.classList.add("smart-label"),o.innerHTML="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRwWxXyYzZ1234567890",t.appendChild(o),e.$.columnHeader.appendChild(t);let a=e.$.columnHeader.offsetHeight;return e.$.columnHeader.removeChild(t),e._columnHeights&&e._columnHeights.length>1&&(a=e._columnHeights[0]),a<e.layout.columnMinHeight&&(a=e.layout.columnMinHeight),e.__measuredColumnHeight=a,a}_initializeColumnGroupsHierarchy(){const e=this;let t=0;e.$.columnContainer.innerHTML="";const o=JSON.parse(JSON.stringify(e.columnGroups));if(o.length>0){for(let t=0;t<o.length;t++)o[t].parent=null,o[t].groups=null,o[t].labelTemplate=e.columnGroups[t].labelTemplate;for(let t=0;t<e.viewColumns.length;t++)e.viewColumns[t].parent=null,e.viewColumns[t].groups=null;const a=function(e){for(let t=0;t<o.length;t++){let a=o[t];if(a.name===e)return a}return null},l=function(e){let t=new Array;if(e.columnGroup&&t.push(e),e.groups)for(let o=0;o<e.groups.length;o++)if(e.groups[o].columnGroup)t.push(e.groups[o]);else if(e.groups[o].groups){let a=l(e.groups[o]);for(let e=0;e<a.length;e++)t.push(a[e])}return t};for(let e=0;e<o.length;e++){let t=o[e];if(t.groups||(t.groups=null),t.parentGroup){let e=a(t.parentGroup);e&&(t.parent=e,e.groups||(e.groups=new Array),-1===e.groups.indexOf(t)&&e.groups.push(t))}}for(let t=0;t<e.viewColumns.length;t++){let o=e.viewColumns[t];if(o.columnGroup){let e=a(o.columnGroup);e&&(e.groups||(e.groups=new Array),o.parent=e,-1===e.groups.indexOf(o)&&e.groups.push(o))}}for(let o=0;o<e.viewColumns.length;o++){const a=e.viewColumns[o];let l=a;for(a.level=0;l.parent;)l=l.parent,a.level++;l=a;let n=a.level;for(t=Math.max(t,a.level);l.parent;)l=l.parent,l&&(l.level=--n)}for(let t=0;t<o.length;t++){const a=o[t],n=l(a);a.columns=n;let i=new Array,r=0,s="near";0===n.length&&(r=-1,a.visible=!1);for(let t=0;t<n.length;t++)i.push(e.viewColumns.indexOf(n[t])),n[t].freeze&&("far"===n[t].freeze&&(s="far"),r++);r===n.length?a.freeze=s:r>0&&r<n.length&&(e.classList.add("smart-visibility-hidden"),e.error(e.localize("frozenColumns",{elementType:"Grid"}))),i.sort((function(e,t){return(e=parseInt(e))<(t=parseInt(t))?-1:e>t?1:0}));for(let t=1;t<i.length;t++)i[t]!==i[t-1]+1&&(e.classList.add("smart-visibility-hidden"),e.error(e.localize("columnGroups",{elementType:"Grid"})))}}e._columnGroupsLevel=1+t,e._columnGroups=o}_refreshColumnHeights(){const e=this;e.$.columnHeader.style.height="",e._viewColumnsHeight=e._measureColumnHeight(),e._columnHeights=[];let t=0;for(let o=0;o<e._columnGroupsLevel;o++){let a=e._viewColumnsHeight;e.layout.columnHeight&&(a="number"==typeof e.layout.columnHeight?e.layout.columnHeight?e.layout.columnHeight:e._viewColumnsHeight:e.layout.columnHeight?e.columnHeight(o):e._viewColumnsHeight),a<e.layout.columnMinHeight&&(a=e.layout.columnMinHeight),a?(e._columnHeights.push(a),t+=a):(t+=e._viewColumnsHeight,e._columnHeights.push(e._viewColumnsHeight))}e._columnHeaderHeight=e._columnGroupsLevel*e._viewColumnsHeight,e._columnHeaderHeight=t,e.$.columnHeader.style.height=e._columnHeaderHeight+"px";const o=function(t){let o=0;for(let a=0;a<t.level;a++)o+=e._columnHeights[a];return o},a=function(t){let a=o(t),l=e._columnHeaderHeight-a;for(let o=t.level+1;o<e._columnHeights.length;o++){const a=o;for(let o=0;o<e.viewColumns.length;o++){const n=e.viewColumns[o];let i=!1;if(n.level===a){let o=n;for(;o.parent;){if(o.parent===t){l=e._columnHeights[a],i=!0;break}o=o.parent}if(i)break}}}return l};for(let t=0;t<e.viewColumns.length;t++){const l=e.viewColumns[t],n=a(l);l.computedHeight=n,l.top=o(l)}for(let t=0;t<e._columnGroupsLevel-1;t++)for(let l=0;l<e._columnGroups.length;l++){const n=e._columnGroups[l];if(n.level!==t)continue;if(n.groups){const e=a(n),t=o(n);n.top=t,n.computedHeight=e}const i=n.element;i&&(i.style.width=n.computedWidth+"px",e.rightToLeft?i.style.right=n.left+"px":i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=n.computedHeight+"px",i.style.lineHeight=n.computedHeight+"px")}}_refreshColumnWidths(){const e=this;e.__clientSize=null;const t=e.$.verticalScrollBar.offsetWidth>0?e.$.verticalScrollBar.offsetWidth:0,o=e.dataSource.groupBy||[];let a=e.grouping.enabled&&"advanced"===e.grouping.renderMode?e.grouping.groupIndent*(1+o.length):0,l=0;e.selection.checkBoxes.enabled&&(l=e._selectionColumn.computedWidth?e._selectionColumn.computedWidth:e._selectionColumn.minWidth);const n=e._clientSize.width-t-a;let i=0,r=[],s=0,d=0,u=0;if(e.editing.enabled&&!e.editing.commandColumn.inline){const t=function(){const t=document.createElement("div"),o=document.createElement("div"),a=e.editing.commandColumn.dataSource;let l=0,n="",i=0;o.classList.add("smart-label");for(let t in a){const o=a[t];let l=!1;if("commandColumnMenu"===t)continue;let r=!1;l||(!0===o.visible?(i++,r=!0):"auto"===o.visible&&((e.editing.editRow||e.editing.editCell)&&!e.editing.dialog.enabled||"commandColumnEdit"!==t?!e.editing.editRow&&!e.editing.editCell||e.editing.dialog.enabled||("commandColumnUpdate"===t||"commandColumnCancel"===t)&&(i++,r=!0):(i++,r=!0)),l=!0),r&&"icon"!==e.editing.commandColumn.displayMode&&(n+="<span>"+("{{messages}}"===o.label?e.localize(t):o.label)+"</span>")}return o.innerHTML="<span>"+n+"</span>",t.appendChild(o),t.style.width="auto",t.style.position="static",e.$.columnHeader.appendChild(t),l=10+o.firstChild.offsetWidth,e.$.columnHeader.removeChild(t),"icon"===e.editing.commandColumn.displayMode?l=20+20*i:"labelAndIcon"===e.editing.commandColumn.displayMode?l+=25*i:l+=10*i,l};if(e._commandColumn.visible=e.editing.commandColumn.visible,e.editing.commandColumn.visible){const o=e.editing.commandColumn.width?e.editing.commandColumn.width:t();e.columns.canNotify=!1,e._commandColumn.width=o,e.columns.canNotify=!0}}for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];let a;"number"==typeof o.width?a=o.width:o.width&&o.width.toString().indexOf("%")>=0?(a=parseFloat(o.width)/100,a*=n-l):o.width&&(o.width.toString().indexOf("em")>=0||o.width.toString().indexOf("pt")>=0||o.width.toString().indexOf("fr")>=0)?(a=parseFloat(o.width),a*=16):"auto"===o.width?a=o._autoSize():o.visible&&(r.push(o),a=0),o.overflowWidth&&(a-=o.overflowWidth),o.visible&&(i+=a),a<o.minWidth&&(a=o.minWidth),o.computedWidth=a}if(r){let e=n-i,t=0;e<0&&(e=60*r.length);for(let o=0;o<r.length;o++){const a=r[o];let l;l=e/r.length,o===r.length-1&&(l=e-t),a.overflowWidth&&(l-=a.overflowWidth),l<a.minWidth&&(l=a.minWidth),a.computedWidth=l,t+=l}}for(let t=0;t<e.viewColumns.length;t++){let o=e.viewColumns[t];o.visible&&(a>0&&!o.autoGenerated&&(o.computedWidth+=a,a=0),o.freeze?!0===o.freeze||"near"===o.freeze?(o.left=s,u+=o.computedWidth,s+=o.computedWidth):"far"===o.freeze&&(o.left=d,d+=o.computedWidth):(o.left=u,u+=o.computedWidth))}for(let t=0;t<e._columnGroupsLevel-1;t++)for(let o=0;o<e._columnGroups.length;o++){const a=e._columnGroups[o];if(a.level!==t)continue;let l=99999;if(a.groups){const e=function(t){let o=0;for(let a=0;a<t.groups.length;a++){let n=t.groups[a];n.groups?o+=e(n):n.visible&&(l=Math.min(n.left,l),o+=n.computedWidth)}return o};a.computedWidth=e(a),a.left=l}}}_createColumnHeaderCellElements(){const e=this,t=e.$.columnContainer,o=document.createDocumentFragment();let a=0;e._columnElements=[],e.$.columnContainer.innerHTML="",e.$.columnNearContainer.innerHTML="",e.$.columnFarContainer.innerHTML="",e.rightToLeft?(e.$.columnNearContainer.classList.remove("near"),e.$.columnNearContainer.classList.add("far"),e.$.columnFarContainer.classList.remove("far"),e.$.columnFarContainer.classList.add("near")):(e.$.columnNearContainer.classList.remove("far"),e.$.columnNearContainer.classList.add("near"),e.$.columnFarContainer.classList.remove("near"),e.$.columnFarContainer.classList.add("far"));for(let t=0;t<e._frozenNearColumns.length;t++)e._frozenNearColumns[t].createElement();for(let t=0;t<e._frozenFarColumns.length;t++)e._frozenFarColumns[t].createElement();for(let t=0;t<e.viewColumns.length;t++){const l=e.viewColumns[t];if(l.freeze)continue;const n=l.createElement();void 0!==l.computedWidth?(a+=l.computedWidth,e._columnElements.push(n),a<2*e._clientSize.width&&o.appendChild(n)):(e._columnElements.push(n),o.appendChild(n))}for(let t=0;t<e._columnGroups.length;t++){const a=e._columnGroups[t],l=new Smart.Grid.Column({visible:void 0===a.visible||a.visible,allowSort:!1,allowFilter:!1,allowSelect:!1,grid:e,dataField:a.name,label:a.label,labelTemplate:a.labelTemplate,align:a.align,verticalAlign:a.verticalAlign,showIcon:!1});a.column=l;const n=l.createElement();n.style.width=a.computedWidth+"px",e.rightToLeft?n.style.right=a.right+"px":n.style.left=a.left+"px",n.style.top=a.top+"px",n.style.height=a.computedHeight+"px",n.style.lineHeight=a.computedHeight+"px",o.appendChild(n),a.element=n,a.grid=this,n.onpointerdown=t=>{if(e.selection.allowColumnHeaderSelection){const t=function(e){let o=new Array;if(e.columnGroup&&o.push(e),e.groups)for(let a=0;a<e.groups.length;a++)if(e.groups[a].columnGroup)o.push(e.groups[a]);else if(e.groups[a].groups){let l=t(e.groups[a]);for(let e=0;e<l.length;e++)o.push(l[e])}return o},o=t(a);e._selectColumnsRange(o[0].dataField,o[o.length-1].dataField)}}}e.htmlColumnLastChild||(e.htmlColumnLastChild=document.createElement("smart-grid-column"),e.htmlColumnLastChild.classList.add("top-far-corner"),e.htmlColumnLastChild.onpointerdown=e=>{e.stopPropagation(),e.preventDefault()},e.$.columnHeader.appendChild(e.htmlColumnLastChild)),t.appendChild(o),t.style.width=e._computedColumnsWidth+"px",e._refreshFrozenColumns()}_refreshFrozenColumns(){const e=this;e.$.columnNearContainer.style.width=e._frozenColumnsNearWidth+"px",e.$.columnFarContainer.style.width=e._frozenColumnsFarWidth+"px";for(let t=0;t<e._columnGroups.length;t++){const o=e._columnGroups[t];o.freeze&&o.element&&(!0===o.freeze||"near"===o.freeze?e.$.columnNearContainer.appendChild(o.element):"far"===o.freeze&&e.$.columnFarContainer.appendChild(o.element))}for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];o.freeze&&o.element&&(!0===o.freeze||"near"===o.freeze?e.$.columnNearContainer.appendChild(o.element):"far"===o.freeze&&e.$.columnFarContainer.appendChild(o.element))}}get _clientSize(){const e=this;if(e.__clientSize)return e.__clientSize;const t=getComputedStyle(e.$.container),o=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),a=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),l=parseFloat(t.borderLeftWidth)+parseFloat(t.borderRightWidth),n=parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth);return e.__clientSize={width:e.$.container.offsetWidth-o-l,height:e.$.container.offsetHeight-a-n},e.__clientSize}_initializeRowElements(){const e=this;if(!e.rows)return;e.rows.canNotify=!1;let t=0,o=e._clientSize.height;e.$.rowNearContainer.innerHTML="",e.$.rowFarContainer.innerHTML="",e.$.rowContainer.innerHTML="",e._rowElements=[],e._overflowOffset=Math.max(o,300),e.rightToLeft?(e.$.rowNearContainer.classList.remove("near"),e.$.rowNearContainer.classList.add("far"),e.$.rowFarContainer.classList.remove("far"),e.$.rowFarContainer.classList.add("near")):(e.$.rowFarContainer.classList.remove("near"),e.$.rowFarContainer.classList.add("far"),e.$.rowNearContainer.classList.remove("far"),e.$.rowNearContainer.classList.add("near"));const a=e.offsetHeight;e.$.container.classList.add("smart-hidden");const l=e.offsetHeight;e.$.container.classList.remove("smart-hidden"),"hidden"!==e.verticalScrollBarVisibility&&a===l||(o=e._scrollHeight);const n=function(){const a=document.createDocumentFragment();if(e.rows&&0===e.rows.length)return;for(let l=0;l<e.rows.length;l++){const n=e.rows[l];if(n.freeze&&n.visible)continue;const i=n.createElement();if(a.appendChild(i),t+=e.layout.rowMinHeight,t>e._overflowOffset+o)break}e.$.rowContainer.appendChild(a);const l=e.$.rowContainer.children;for(let t=0;t<l.length;t++){const o=l[t];e.rows[t]&&(e.rows[t].element=o),e._rowElements[t]=o}};for(let t=0;t<e._frozenNearRows.length;t++){const o=e._frozenNearRows[t];o.grid=e;const a=o.createElement();o.element=a,e.$.rowNearContainer.appendChild(a)}for(let t=0;t<e._frozenFarRows.length;t++){const o=e._frozenFarRows[t];o.grid=e;const a=o.createElement();o.element=a,e.$.rowFarContainer.appendChild(a)}n();let i=0;for(;t<1.5*o&&++i<50;)n();e.rows.canNotify=!0}_refreshSummary(e){const t=this;t.summaryRow.visible&&(t._summaryUpdateTimer&&clearTimeout(t._summaryUpdateTimer),t._summaryUpdateTimer=setTimeout((()=>{!0!==t.editing.isEditing&&(t._calculateSummary(),!1!==e&&t._recycle(!1,!0,!1))}),100))}_initializeRows(){const e=this;let t=0;e._frozenNearDefaultRows=[],e._frozenFarDefaultRows=[],e.rows=[],e.rowById=[],e._frozenFarRows=[],e._frozenNearRows=[];let o=new Date;const a=function(){let t=[],o=!1;for(let a=0;a<e.columns.length;a++){const l=e.columns[a];let n={};l.summary&&l.summary.length>0&&(o=!0,n[l.dataField]=l.summary,t.push(n))}if(!o)return void(e._summaryItems=[]);const a=e.getSelectedRowIds();if(a.length>=1){const o=[];for(let t=0;t<a.length;t++){const l=e.dataSource.dataItemById[a[t]];l&&o.push(l)}e._summaryItems=e.dataSource.summarize(t,o)}else if(e._selection&&e._selection.cells&&Object.keys(e._selection.cells).length>2){const o=e.getSelectedCells(!1),a=[],l=[];for(let t=0;t<o.length;t++){const n=o[t],i=n[0],r=e.dataSource.dataItemById[i];-1===a.indexOf(r)&&a.push(r),-1===l.indexOf(n[1])&&l.push(n[1])}e._summaryItems=e.dataSource.summarize(t,a);const n=Object.keys(e._summaryItems);for(let t=0;t<n.length;t++){const o=n[t];-1===l.indexOf(o)&&delete e._summaryItems[o]}}else e._summaryItems=e.dataSource.summarize(t)};e._calculateSummary=a;const l=e.columns?e.columns.filter((e=>void 0!==e.getCellValue)):[],n=function(a,n,i){let r=null;if(e.isInitialized&&(o=new Date),r=a?a.grid?a:new Smart.Grid.Row({data:a,index:n,grid:e,createdBy:e.currentUser,createdDate:o}):new Smart.Grid.Row({data:{},index:n,grid:e,createdBy:e.currentUser,createdDate:o}),l)for(let e=0;e<l.length;e++){const t=l[e],o=t.getCellValue(r.id,t.dataField,a);void 0!==o&&(r.data[t.dataField]=o)}if(e.rowById[r.id]&&(r.id=e.rows.length,e.rowById[r.id])){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};r.id=e()}if(e.onRowInit){e.onRowInit(n,r,e),30!==r.height&&(r.cellHeight=r.height);for(let t in r)-1!==r.properties.indexOf(t)||t.startsWith("_")||e.error(e.localize("invalidRowProperty",{elementType:"Grid",propertyName:t}))}if(r.selected&&(e._selection.rows[r.id]=!0,e._selection.indexes[r.index]=r.index),r.freeze&&r.visible){if(!0===r.freeze||"near"===r.freeze){e.rows.splice(t++,0,r);const o=e.rows[t-1];-1===e._frozenNearRows.indexOf(o)&&e._frozenNearRows.push(o)}else if("far"===r.freeze){e.rows.push(r);const t=e.rows[e.rows.length-1];-1===e._frozenFarRows.indexOf(t)&&e._frozenFarRows.push(t)}}else e.rows[n]?e.rows.splice(n,0,r):e.rows.push(r),r.data&&r.data.$&&(r.data.$.history=r.history,r.data.$.starred=r.starred,r.data.$.comments=r.comments,r.data.$.style=r.style);if(!("virtual"===e.scrolling||e.paging.enabled&&e.dataSource&&e.dataSource.virtualDataSource))if(e.onRowInserted){const t=void 0===n?e.rows[e.rows.length-1]:e.rows[n],o=o=>{const a=t;if(void 0!==o&&Array.isArray(o)&&(o=o[0]),void 0===o){if(e.rowById[a.id]){const t=e.dataSource.dataItemById[a.id],o=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};a.id=o(),a.data&&a.data.$?a.data.$.id=a.id:a.data.id=a.id,e._getId()&&(a.data[e._getId()]=a.id),t&&(e.dataSource.dataItemById[a.id]=a.data)}e.rowById[a.id]=a}else{const t=e.dataSource.dataItemById[a.id];a.id=o,a.data&&a.data.$?a.data.$.id=a.id:a.data.id=a.id;const l=e._getId();l&&(a.data[e._getId()]=a.id),t&&(t[l]=o,e.dataSource.dataItemById[a.id]=t,a.data=t),e.rowById[a.id]=a}-1!==a.index&&void 0!==a.index||(a.index=e.rows.length),e._setAddUndoRedo(a),!e.editing.isEditing&&e.isInitialized&&e._recycle(!1,!0),e._onRowInserted&&e._onRowInserted(a),i&&i(a)};if(void 0===n&&(n=e.rows.length-1,void 0!==t.index&&-1!==t.index||(t.index=n)),e.isInitialized){e._rowInsertTimer&&clearTimeout(e._rowInsertTimer),e._rowInsert||(e._rowInsert=[]),e._rowInsert.push({row:t,index:n});const a=e._keyboardAdd?300:150;e._rowInsertTimer=setTimeout((()=>{if(1===e._rowInsert.length)e.onRowInserted([n],[t],o,e),delete e._rowInsert,delete e._undoRedoAction;else{let t=[],o=[];for(let a=0;a<e._rowInsert.length;a++)t.push(e._rowInsert[a].index),o.push(e._rowInsert[a].row);delete e._rowInsert,e.onRowInserted(t,o,(t=>{e.beginUpdate();for(let a=0;a<o.length;a++){const l=o[a],n=t?t[a]:void 0;if(void 0!==n){const t=e.dataSource.dataItemById[l.id];l.id=l.data.id=n;const o=e._getId();o&&(l.data[e._getId()]=l.id),e.rowById[l.id]=l,t&&(t[o]=n,e.dataSource.dataItemById[l.id]=t,l.data=t)}e._setAddUndoRedo(l),-1!==l.index&&void 0!==l.index||(l.index=e.rows.length),e._onRowInserted&&e._onRowInserted(l),i&&i(l)}delete e._undoRedoAction,e.endUpdate(!1)}),e)}}),a)}else e.onRowInserted([n],[t],o,e)}else{const t=void 0===n?e.rows[e.rows.length-1]:e.rows[n];void 0===n&&(n=e.rows.length-1,void 0!==t.index&&-1!==t.index||(t.index=n)),i&&i(t)}},i=function(){const t=e.rows[e.rows.length-1];e.rows.pop(),e.onRowRemoved&&e.onRowRemoved([t.id],[t.index],e),e._setRemoveUndoRedo(t)},r=function(t){const o=e.rows[t];o.selected&&o.setProperty("selected",!1),e.rows.splice(t,1),e.onRowRemoved&&e.onRowRemoved([o.id],[t],e),e._setRemoveUndoRedo(o)};e._add=n,e._removeLastRow=i,e._removeAt=r,e._rowHeight=e._autoRowHeight;const s=e.dataSource.length;if(e.setAttribute("aria-rowcount",s),e.dataSource&&e.dataSource.virtualDataSource&&!e.dataSource.virtualDataSourceOnExpand&&e.dataSource.length>e.virtualModeCachedRowsCount&&"infinite"!==e.scrolling){let t=e.dataSource.length>e.virtualModeCachedRowsCount?e.virtualModeCachedRowsCount:e.dataSource.length;"infinite"===e.scrolling&&(t=e.dataSource.length);for(let o=0;o<t;o++){const t=e.dataSource[o];n(t,o)}}else for(let t=0;t<e.dataSource.length;t++){const o=e.dataSource[t];n(o,t)}for(let t=0;t<e._frozenFarRows.length;t++){const o=e._frozenFarRows[t];e.rows.splice(e.rows.indexOf(o),1),e.rows.push(o)}if(a(),e.dataSource.notify((function(t){if(e.dataSource._updating)return;const o=t.data;e.rows.canNotify=!1;let l=!1;switch(t.action){case"add":if(!o)return;if(void 0!==o.length)for(let t=0;t<o.length;t++)n(o[t],e.dataSource.length-o.length+t);else n(o,e.dataSource.length-1);break;case"update":if(o.length){let o=[],a=[],i=[];for(let r=0;r<i.length;r++){const s=t.index[r];e.rows[s]?(e.rows[s].data=i[r],o.push(s),a.push(e.rows[s]),i.push(e.rows[s].data)):(n(i[r],i[r].$.index),l=!0)}e.onRowUpdated&&e.onRowUpdated(o,a,i,e)}else{const a=t.index;e.rows[a]?e.rows[a].data=o:n(o,e.dataSource.length-1),e.onRowUpdated&&e.onRowUpdated([a],[e.rows[a]],[e.rows[a].data],e)}break;case"insert":n(o,t.index);for(let t=0;t<e.rows.length;t++)e.rows[t].index=t;break;case"remove":r(t.index);break;case"removeLast":i();break;case"bindingComplete":if(e.dataSource&&e.dataSource.url||e.dataSource&&!e.dataSource.virtualDataSource){if(e.appearance.displayLoadingIndicator=!1,e._setLoadingIndicatorVisibility(),e._toggledRow=null,e.dataSource.length!==s){if(e.paging.enabled){const t=e.$.headerPager.querySelector("smart-pager"),o=e.$.footerPager.querySelector("smart-pager");t&&(t.pagesCount=Math.ceil(e.dataSource.length/e._pageSize)),o&&(o.pagesCount=Math.ceil(e.dataSource.length/e._pageSize))}e._initializeRows(),e._initializeRowElements(),e.refresh()}e._recycle(),e.onLoad&&(e.onLoad(),e.onLoad())}}a(),("update"!==t.action||l)&&e._refreshLayout(),e._recycle(),e.rows.canNotify=!0})),e._observeRows(),e.summaryRow.visible){const t=new Smart.Grid.Row({height:e.layout.rowMinHeight,freeze:"near",visible:"near"===e.summaryRow.position,summaryRowIndex:0,summaryRow:!0}),o=new Smart.Grid.Row({height:e.layout.rowMinHeight,freeze:"far",visible:"far"===e.summaryRow.position,summaryRowIndex:0,summaryRow:!0});"near"===e.summaryRow.position&&e._frozenNearRows.splice(0,0,t),"far"===e.summaryRow.position&&e._frozenFarRows.push(o)}if(e.filtering.enabled&&e.filtering.filterRow.visible){const t=new Smart.Grid.Row({freeze:!0,autoGenerated:!0,filterRow:!0});e._frozenNearRows.splice(0,0,t)}e._renderAddNewRow()}_observeRows(){const e=this;e._frozenNearRows=[],e._frozenFarRows=[],e.rows=new Smart.ObservableArray(e.rows,null,{allowToggle:!0,allowResize:!0,allowCheck:!0,allowSelect:!0,allowReorder:!0,expanded:!0,selected:!0,checked:!0,visible:!0,enabled:!0,minHeight:!0,height:!0,freeze:!0,showDetail:!0,data:!0,visibleIndex:!0,index:!0,comments:!0,style:!0,starred:!0,updatedBy:!0,updatedDate:!0,createdDate:!0,createdBy:!0,history:!0});for(let t=0;t<e.rows.length;t++){const o=e.rows[t];!0===o.freeze||"near"===o.freeze?e._frozenNearRows.push(o):"far"===o.freeze&&e._frozenFarRows.push(o),e.rowById[e.rows[t].id]=o}e.rows.notify((function(t){if(!e.rows.canNotify)return;const o=t.action;if("length"===o)return;if(t.path)return e.rows.canNotify=!1,(e.rowById[t.target.id]||"selected"===t.propertyName)&&(a=t.target,l=t.propertyName,n=t.oldValue,i=t.newValue,n===i&&"selected"!==l&&"showDetail"!==l||(a.propertyChanged(l,n,i),e.onRowChange&&a.properties.indexOf(l)>=0&&e.onRowChange(a,l,n,i,e))),void(e.rows.canNotify=!0);var a,l,n,i;if(e.rows.canNotify=!1,!e.dataSource)return;switch(e.dataSource.canNotify=!1,o){case"add":{const o=function(o){let a=e.rows[o];if(a instanceof Smart.Grid.Row==0){a=new Smart.Grid.Row(a);const l=e.rows.canNotify;e.rows.canNotify=!1,t.object[o]=a,a=t.object[o],e.rows.canNotify=l}if(a.grid=e,e.dataSource&&e.dataSource.virtualDataSource){e.rows.canNotify=!1;for(let t=0;t<e.rows.length;t++){const o=e.dataSource.boundSource[t],a=e.rows[t];o&&(a.data=o,a.id=o.$.id),e.rowById[a.id]=a}e.rows.canNotify=!0}else(()=>{if(0===e.dataSource.length&&e.dataSource.dataFields&&0===e.dataSource.dataFields.length&&e.columns&&e.columns.length){let t=[];for(let o=0;o<e.columns.length;o++){const a=e.columns[o];t.push({name:a.dataField,dataType:a.dataType||"string"})}e.dataSource.dataFields=t}o<e.dataSource.length?e.dataSource.insert(o,e.rows[o].data):e.dataSource.add(e.rows[o].data),e.dataSource[o]&&(a.data=e.dataSource[o],void 0!==e.dataSource[o].$.id&&(a.id=e.dataSource[o].$.id,e.rowById[a.id]=a),a.data.$&&a.history&&(a.data.$.history=a.history)),-1!==a.index&&void 0!==a.index||(a.index=o),a.selected&&(e._selection.rows[a.id]=!0,e._selection.indexes[a.index]=a.index),a.freeze&&(!0===a.freeze||"near"===a.freeze?e._frozenNearRows.push(a):"far"===a.freeze&&e._frozenFarRows.push(a))})()};for(let e=0;e<t.addedCount;e++)o(t.index+e);break}case"update":if(t.target){const o=e.rowById[t.target.id],a=e.rows.indexOf(o);e.dataSource.update(a,o)}else{const o=e.rows.indexOf(t.index);e.dataSource.update(t.index,o)}break;case"remove":{if(e.dataSource&&e.dataSource.virtualDataSource){e.rows.canNotify=!1;const o=t.removed&&t.removed.length>0?t.removed[0]:null;o&&delete e.rowById[o.id];for(let t=0;t<e.dataSource.boundSource.length;t++){const o=e.dataSource.boundSource[t],a=e.rows[t];a.data=o,a.id=o.$.id,e.rowById[a.id]=a}return e.rows.canNotify=!0,void e.refresh()}const o=t.removed&&t.removed.length>0?t.removed[0]:null;o&&delete e.rowById[o.id],e.dataSource.removeAt(t.index);break}}if(e.dataSource.canNotify=!0,e.rows.canNotify=!0,!o)return;let r=e.isInitialized&&e._rowElements&&e._rowElements.length<e.rows.length;"add"===o&&1===t.addedCount&&r&&e._rowElements.length>0&&e._rowElements[e._rowElements.length-1].classList.contains("smart-hidden")&&(r=!1),r&&e._initializeRowElements(),e.refresh(),e._refreshPagesCount(),e._sortedColumns&&e._sortedColumns.length>0&&e.refreshSort()}))}render(){const e=this,t=()=>0===e.offsetWidth||0===e.offsetHeight;if(t())return requestAnimationFrame((()=>{e.isInitialized||t()||e._render()})),e.setAttribute("role","grid"),e.editing.enabled||e.setAttribute("aria-readonly",!0),void super.render();const o=e.context;e.context=e,e.setAttribute("role","grid"),e.editing.enabled||e.setAttribute("aria-readonly",!0),e._undoRedo=[],e._refreshCurrentUser(),e._render(),e.context=o,super.render()}_renderColumns(e){const t=this;t._initializeColumns(),t._initializeColumnGroupsHierarchy(),t._refreshColumnsResponsiveVisibility(),t._createColumnHeaderCellElements(),t._renderColumnGroupHeaders(),!1!==e&&t._refresh()}_renderRows(e){const t=this;t._initializeRows(),t._initializeRowElements(),!1!==e&&t._refresh()}_render(){const e=this;if(e.isInitialized||(e.onBeforeInit&&(e.onBeforeInit(e),e.onBeforeInit=null),e.$.fireEvent("beforeInit",{grid:e}),e.header.visible&&e.header.buttons.indexOf("views")>=0&&e._updateKanbanTaskFields()),(()=>{if(null===e.dataSource)e.dataSource=new Smart.DataAdapter;else if(Array.isArray(e.dataSource)||"string"==typeof e.dataSource){let t=[];if(e.dataSourceSettings.dataFields&&e.dataSourceSettings.dataFields.length>0)e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource,dataSourceType:e.dataSourceSettings.dataSourceType,dataFields:e.dataSourceSettings.dataFields,keyDataField:e.dataSourceSettings.keyDataField,parentDataField:e.dataSourceSettings.parentDataField,childrenDataField:e.dataSourceSettings.childrenDataField,groupBy:e.dataSourceSettings.groupBy||e.grouping.groupBy,mapChar:e.dataSourceSettings.mapChar,root:e.dataSourceSettings.root,record:e.dataSourceSettings.record,autoGenerateColumns:e.autoGenerateColumns,id:e.dataSourceSettings.id,virtualDataSource:e.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:e.dataSourceSettings.virtualDataSourceOnExpand});else if(e.columns&&e.columns.length){for(let o=0;o<e.columns.length;o++){const a=e.columns[o];t.push({name:a.dataField,dataType:a.dataType||"string"})}e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource,dataFields:t,dataSourceType:e.dataSourceSettings.dataSourceType,keyDataField:e.dataSourceSettings.keyDataField,parentDataField:e.dataSourceSettings.parentDataField,childrenDataField:e.dataSourceSettings.childrenDataField,groupBy:e.dataSourceSettings.groupBy||e.grouping.groupBy,mapChar:e.dataSourceSettings.mapChar,root:e.dataSourceSettings.root,record:e.dataSourceSettings.record,autoGenerateColumns:e.autoGenerateColumns,id:e.dataSourceSettings.id,virtualDataSource:e.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:e.dataSourceSettings.virtualDataSourceOnExpand})}else e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource})}})(),e._selection={rows:[],indexes:[],columns:[],cells:[]},e.dataSource&&e.dataSource.url&&(e.appearance.displayLoadingIndicator=!0,e._setLoadingIndicatorVisibility(),e.dataSource.data={sorting:e.getSortedColumns(),filtering:e.getFilteredColumns(),grouping:e.grouping.groupBy}),e.filtering.filterRow)for(let t=0;t<e.columns.length;t++)e.columns[t]._filterEditorInitialized&&(e.columns[t]._filterEditorInitialized=!1);const t=!e.isInitialized;if(t&&(e.onInit&&(e.onInit(e),e.onInit=null),e.$.fireEvent("init",{grid:e})),e._renderColumns(!1),e._renderRows(!1),e._renderPagers(),e._renderCommandBar(),e._renderConditionalFormatting(),t&&e.grouping.enabled&&e.grouping.groupBy.length&&e.dataSource&&(e.dataSource.groupBy=e.grouping.groupBy),e.appearance.allowColumnStickyPosition&&e._stickHeader(),e.header.visible&&""===e.header.template){const t=document.createElement("smart-grid-toolbar");t.headerPosition="top",t.messages=e.messages,t.locale=e.locale,e.$.header.appendChild(t),e.$.headerBar=e.$.header.firstElementChild,e.$.headerBar._init(e)}if(e.isInitialized)e.refreshFilters();else{const t=[];for(let o=0;o<e.viewColumns.length;o++){const a=e.viewColumns[o];a.allowSort&&a.sortOrder&&t.push(a)}if(0===t.length&&e.sorting.sort)for(let o=0;o<e.sorting.sort.length;o++){const a=e.sorting.sort[o],l=Object.keys(a)[0],n=a[l],i=e.columnByDataField[l];i&&(t.push(i),i.sortOrder=n||"asc")}t.sort(((e,t)=>e.sortIndex-t.sortIndex));for(let o=0;o<t.length;o++){const a=t[o],l=e.appearance.allowSortAnimation;e.appearance.allowSortAnimation=!1,e.sortBy(a.dataField,a.sortOrder),e.appearance.allowSortAnimation=l}if(e.filtering.filter.length>0){for(let t=0;t<e.filtering.filter.length;t++){const o=e.filtering.filter[t];if(o){const t=o[0],a=o.splice(1);let l=null;if(a instanceof Smart.FilterGroup)l=a;else{const o=e.columnByDataField[t];o&&(l=e.dataSource._createFilter(o.dataType,a))}l&&e.addFilter(t,l,!1)}}e.refreshFilters()}else{for(let t=0;t<e.columns.length;t++){const o=e.columns[t];if(o.filter){let t=null,a=o.filter;t=a instanceof Smart.FilterGroup?a:e.dataSource._createFilter(o.dataType,a),t&&e.addFilter(o.dataField,t,!1)}}e.refreshFilters()}}if(e.viewColumns.canNotify=!0,e.isInitialized=!0,("virtual"===e.scrolling||e.paging.enabled&&e.dataSource&&e.dataSource.virtualDataSource||e.dataSource&&e.dataSource.virtualDataSource)&&e._virtualDataRequest("dataBind"),""!==e.header.template&&e._applyTemplate(e.header.template,e.$.header),""!==e.footer.template&&e._applyTemplate(e.footer.template,e.$.footer),e._createFilterPanels(),e._refresh(),e._applyScrolling(),e.grouping.enabled&&e.grouping.autoExpandAll&&e.rowHierarchy?e.expandAllRows():e.grouping.enabled&&e.grouping.autoExpandToLevel&&e.rowHierarchy&&e.expandRowsToGroupLevel(e.grouping.autoExpandToLevel),e.onRender&&(e.onRender(t),e.onRender=null),e.isRendered=!0,"auto"===e.layout.rowHeight&&(e._refreshLayout(),e._recycle()),t){if(e.stateSettings.autoLoad){const t=e.stateSettings.current?e.stateSettings.current:e.stateSettings.current="smartGrid"+e.id,o=e.stateSettings.storage[t];o&&e._loadState(o)}if(e.onAfterInit&&(e.onAfterInit(e),e.onAfterInit=null),e.$.fireEvent("afterInit",{grid:e}),e.isRendering=!1,e.whenRenderedCallbacks){for(let t=0;t<e.whenRenderedCallbacks.length;t++)e.whenRenderedCallbacks[t]();e.whenRenderedCallbacks=[]}!e.dataSource||e.dataSource.url||e.dataSource.virtualDataSource||e.onLoad&&e.onLoad(e)}"kanban"===e.view&&e._initKanbanView()}get _viewRows(){const e=this;if(e.__viewRows)return e.__viewRows;e._nearRowsAdded||(e._nearRowsAdded=[],e._farRowsAdded=[]);const t=e.rows.toArray?e.rows.toArray():[],o=e.rowHierarchy?e.rowHierarchy:t,a=[].concat(e._frozenNearDefaultRows,e._nearRowsAdded,o,e._farRowsAdded,e._frozenFarDefaultRows);return e.__viewRows=a,a}_toHex(e){if(-1!==e.indexOf("#"))return e;const t=/rgb\((\d+), (\d+), (\d+)\)/g.exec(e);return t?"#"+(parseFloat(t[1]).toString(16).padStart(2,"0")+parseFloat(t[2]).toString(16).padStart(2,"0")+parseFloat(t[3]).toString(16).padStart(2,"0")).toUpperCase():"#FFFFFF"}_renderConditionalFormatting(){const e=this,t=e.conditionalFormatting;if(!t||0===t.length)return;if(!e._defaults){const t=getComputedStyle(e);e._defaults={fontFamily:t.fontFamily,fontSize:t.fontSize,text:e._toHex(t.color),highlight:e._toHex(t.backgroundColor)}}e._formatter||(e._formatter=new Smart.Utilities.ConditionalFormatter(e.dataSource));const o=e._defaults,a=e._formatter,l=[],n=function(t){if("all"===t){if(e.columns&&e.columns.map){const t=[];for(let o=0;o<e.columns.length;o++){const a=e.columns[o];a.dataField.startsWith("task")||a.autoGenerated||"number"!==a.dataType&&"date"!==a.dataType||t.push(a.dataField)}return t}return[]}return[t]};for(let e=0;e<t.length;e++){t[e]=Object.assign({column:"all",condition:"lessThan",firstValue:0,secondValue:1,fontFamily:o.fontFamily,fontSize:o.fontSize,text:o.text,highlight:o.highlight},t[e]);const i=t[e],r=n(i.column),s=i.condition;a.color=i.highlight,a.comparator=i.firstValue,a.min=i.firstValue,a.max=i.secondValue;const d=a.format(s,r);for(let e in d){const t=d[e];for(let e in t){const o=t[e];o.color=i.text,o.fontFamily=i.fontFamily,o.fontSize=i.fontSize}}l.push(d)}if(e._formattingPanel&&(e._formattingPanel.items=t),0===l.length)return l[0];const i={};for(let e=0;e<l.length;e++){const t=l[e];for(let e in t){const o=t[e];if(0!==Object.keys(o).length){i[e]||(i[e]={});for(let t in o)i[e][t]=Object.assign({},i[e][t],o[t])}}}e._conditionalFormatting=i}_stickHeader(){const e=this;e._stickyHeaderHandler=function(){e._handleStickyHeader()},e.$.columnHeader.style.top="",e.$.columnHeader.classList.remove("smart-columns-sticky");let t=e.parentNode;for(e.isInShadowDOM&&t===e.getRootNode()&&(t=e.getRootNode().host);t!==document&&t;)t.addEventListener("scroll",e._stickyHeaderHandler),t=t.parentNode,e.isInShadowDOM&&t===e.getRootNode()&&(t=e.getRootNode().host);try{null!==window.top&&window.top!==window.self&&window.top.document.addEventListener("scroll",e._stickyHeaderHandler)}catch(e){}e._handleStickyHeader()}_unstickHeader(){const e=this;e.$.columnHeader.style.top="",e.$.columnHeader.classList.remove("smart-columns-sticky");let t=e.parentNode;for(;t!==document.body;)t.removeEventListener("scroll",e._stickyHeaderHandler),t=t.parentNode,e.isInShadowDOM&&t===e.getRootNode()&&(t=e.getRootNode().host);try{(""!==document.referrer||window.frameElement)&&null!==window.top&&window.top!==window.self&&window.top.document.removeEventListener("scroll",e._stickyHeaderHandler)}catch(e){}}_handleStickyHeader(){const e=this;if(e.appearance.allowColumnStickyPosition)if(e.$.columnHeader.classList.add("smart-columns-sticky"),0===document.scrollTop&&0===e.parentElement.scrollTop)e.$.columnHeader.style.top="";else{let t=e.parentNode,o=0;for(;t!==document.body;)o+=parseInt(t.scrollTop),t=t.parentNode,e.isInShadowDOM&&t===e.getRootNode()&&(t=e.getRootNode().host);const a=parseInt(e.clientTop+o);e.$.columnHeader.style.top=a+"px";let l=0;window.top!==window.self&&parseInt(window.top.scrollY)>parseInt(e._offsetTop(window.frameElement))&&(l=parseInt(window.top.scrollY)-parseInt(e._offsetTop(window.frameElement))),window.scrollY+l>e.offsetTop&&(e.$.columnHeader.style.top=parseInt(window.scrollY)-parseInt(e.offsetTop)+a+l+"px")}}_scrollHandler(){this._handleStickyHeader()}_initializeRowNumberColumn(){const e=this;if(e._frozenNearColumns&&e._frozenNearColumns.length>0&&e._frozenNearColumns[0].rowHeaderColumn)return void(e._frozenNearColumns[0].visible=e.appearance.showRowHeaderNumber||e.appearance.showRowHeader);const t=new Smart.Grid.Column({dataField:"_rowHeaderColumn",label:"",allowSelect:!1,freeze:!0,visible:!0,grid:e,autoGenerated:!0,rowHeaderColumn:!0,cellsAlign:"center"}),o=e.rows?e.rows.length:e.dataSource?e.dataSource.length:0;let a=e.appearance.showRowHeaderNumber?t._measureSize(o):30;e.layout.autoGenerateColumnWidth&&(a=e.layout.autoGenerateColumnWidth),t.width=a,t.createElement();const l=new Smart.Observable(t,t.observables);e.viewColumns.splice(0,0,l),e._frozenNearColumns.splice(0,0,l)}_initializeColumns(){const e=this;if("number"==typeof e.columns){const t=[],o="A".charCodeAt(0);let a="",l=0;for(let n=0;n<e.columns;n++){let i=n+1;const r=String.fromCharCode(o+l);l++;const s=a+r;"number"!==e.appearance.autoGenerateColumnLabelMode&&(i=a+r),t.push({align:"center",label:i,dataField:s,width:100}),l>=26&&(l=0,a+="A")}e._boundColumns=t}else e._boundColumns=Array.isArray(e.columns)?[...e.columns]:[...e.columns.toArray()];e._initColumns=e.columns,e.columnByDataField=[],e.viewColumns=[],e.columns=new Smart.ObservableArray,e._frozenFarColumns=[],e._frozenNearColumns=[],e._summaryRowCount=1;let t=0;const o=function(t){if(e.dataSource.dataFields){const o=e.dataSource.dataFields.find((e=>{if(e.name===t.dataField)return e})),a=o&&o.dataType||"string";t.dataType||(t.dataType=a)}};if(0===e._boundColumns.length&&e.dataSource&&e.dataSource[0]&&!1!==e.dataSource.autoGenerateColumns){const t=e.dataSource[0];if(t.$&&t.$.isEmpty&&e.dataSource.dataFields)for(let t=0;t<e.dataSource.dataFields.length;t++){const o=e.dataSource.dataFields[t],a=e._boundColumns.length,l={index:a,visibleIndex:a,label:o.name,dataField:o.name,dataType:o.dataType};e._boundColumns.push(l)}else for(let a in t){if(a.startsWith("_")||"$"===a)continue;const t=e._boundColumns.length,l={index:t,visibleIndex:t,label:a,dataField:a};o(l),e._boundColumns.push(l)}}for(let a=0;a<e._boundColumns.length;a++){let l=e._boundColumns[a];if("string"==typeof l){if(e.dataSource.dataFields){const t=e.dataSource.dataFields.find((e=>{if(e.name===l)return e}));l={label:l,dataField:l,dataType:t&&t.dataType||"string"}}}else o(l);l.visibleIndex=a,l.index=a,l.grid=e,l.label&&/<.+?>/.test(l.label)&&l.label.replace&&("all"===e.dataSourceSettings.sanitizeHTML?l.label=l.label.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""):"blackList"===e.dataSourceSettings.sanitizeHTML&&(l.label=window.Smart.Utilities.Core.escapeHTML(l.label)));const n=new Smart.Grid.Column(l);e.onColumnInit&&e.onColumnInit(a,n);for(let t in n)-1!==n.properties.indexOf(t)||t.startsWith("_")||e.error(e.localize("invalidColumnProperty",{elementType:"Grid",propertyName:t,type:n.dataField||"Column"}));n.grid=e,e.columns.push(n);const i=e.columns[e.columns.length-1];e._summaryRowCount=Math.max(e._summaryRowCount,n.summary.length),n.freeze?!0===n.freeze||"near"===n.freeze?(e.viewColumns.splice(t++,0,i),e._frozenNearColumns.push(i)):"far"===n.freeze&&e._frozenFarColumns.push(i):e.viewColumns.push(i),e.columnByDataField[n.dataField]?(i.parent=e.columnByDataField[n.dataField],e.columnByDataField[n.dataField].children||(e.columnByDataField[n.dataField].children=[]),e.columnByDataField[n.dataField].children.push(i),n.valueField=n.dataField,n.dataField+="_"+e.columnByDataField[n.dataField].children.length,n.displayField=n.valueField,e.columnByDataField[n.dataField]=i):e.columnByDataField[n.dataField]=i,e.onColumnInserted&&!e.isInitialized&&e.onColumnInserted(a,n.getState())}e.viewColumns=e.viewColumns.concat(e._frozenFarColumns),e.setAttribute("aria-colcount",e._boundColumns.length);let a=0;if((e.appearance.showRowHeaderNumber||e.appearance.showRowHeader)&&(e._initializeRowNumberColumn(),a++),e.rowDetail.enabled){const t=20,o=new Smart.Grid.Column({dataField:"_rowDetailColumn",allowSelect:!1,visible:e.rowDetail.visible,label:"",grid:e,freeze:!0,rowDetailColumn:!0,autoGenerated:!0,cellsAlign:"center",width:t,minWidth:t}),l=new Smart.Observable(o,o.observables);"near"===e.rowDetail.position?(o.freeze="near",l.freeze="near",e.viewColumns.splice(a,0,l),e._frozenNearColumns.splice(a,0,l)):(e.viewColumns.push(l),e._frozenFarColumns.splice(0,0,l)),a++}const l=new Smart.Grid.Column({dataField:"_adaptiveColumn",allowSelect:!1,visible:!1,label:"",grid:e,freeze:"far",adaptiveColumn:!0,autoGenerated:!0,cellsAlign:"center",width:30}),n=new Smart.Observable(l,l.observables);n.canNotify=!1,e.viewColumns.push(n),e._frozenFarColumns.splice(0,0,n);const i=new Smart.Grid.Column({dataField:"_commandColumn",allowSelect:!1,visible:e.editing.enabled&&e.editing.commandColumn.visible&&!e.editing.commandColumn.inline,label:"",grid:e,freeze:"far",commandColumn:!0,autoGenerated:!0,align:"center",cellsAlign:"center",width:""}),r=new Smart.Observable(i,i.observables);r.canNotify=!1,"near"===e.editing.commandColumn.position?(i.freeze="near",r.freeze="near",e.viewColumns.splice(a,0,r),e._frozenNearColumns.splice(a,0,r)):(e.viewColumns.push(r),e._frozenFarColumns.splice(0,0,r)),e._commandColumn=r;const s=new Smart.Grid.Column({allowSelect:!1,visible:e.selection.enabled&&e.selection.checkBoxes.enabled,dataField:"_checkBoxColumn",label:"",freeze:e.selection.checkBoxes.position,grid:e,selectionColumn:!0,autoGenerated:!0,cellsAlign:"center",width:32}),d=new Smart.Observable(s,s.observables);if("near"===s.freeze?(e.viewColumns.splice(a,0,d),e._frozenNearColumns.splice(a,0,d)):(e.viewColumns.push(d),e._frozenFarColumns.splice(0,0,d)),e._selectionColumn=d,e._selectionColumn.canNotify=!1,e.editing.addNewColumn.visible){const t=new Smart.Grid.Column({dataField:"_addNewColumn",allowSelect:!1,visible:!0,title:e.localize("addNewColumn"),label:"",cellsClassName:"smart-add-new-column",className:"smart-add-new-column smart-icon smart-grid-icon show smart-icon-plus",grid:e,adaptiveColumn:!1,autoGenerated:!0,cellsAlign:"center",width:90}),o=new Smart.Observable(t,t.observables);e.viewColumns.push(o),e._addNewColumn=o,e._addNewColumn.canNotify=!1}e._observeColumns(),e._templateColumns()}get styleProperties(){return["grid-template-columns","--smart-grid-row-height","--smart-grid-column-header-height","--smart-grid-group-header-height","--smart-grid-filter-footer-height","--smart-grid-group-row-vertical","--smart-grid-group-row-horizontal-offset","--smart-grid-freeze-splitter-size","--smart-grid-resize-line-size","--smart-grid-footer-height","--smart-grid-header-height"]}_templateColumns(){const e=this,t=getComputedStyle(e),o=t.getPropertyValue("--smart-grid-template-columns").trim();if(e._rowGap=0,e._columnGap=0,e._maxHeight=parseInt(t.maxHeight),e._minHeight=parseInt(t.minHeight),"none"!==o){let t=0;for(let o=0;o<e.viewColumns.length;o++)e.viewColumns[o].autoGenerated&&(t+=e.viewColumns[o].visible?e.viewColumns[o].width:0);let a=[];const l=document.createElement("div");l.style.display="grid",l.style.gridTemplateColumns=o;for(let t=0;t<e.columns.length;t++)l.innerHTML+="<div></div>";l.style.width=e.clientWidth-t+"px",e.$.root.appendChild(l);const n=o.split(" ");for(let t=0;t<e.columns.length;t++)a[t]=l.children[t].offsetWidth,"auto"===n[t]&&(a[t]=null);l.parentNode.removeChild(l);let i=0;for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];o.autoGenerated||a[i]&&(o.width=o.templateWidth=a[i++])}}else for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];o.autoGenerated||o.templateWidth&&(o.width=o.templateWidth=null)}}setColumns(e){const t=this;if(null===e)return void(t.columns=[]);t.beginUpdate(),t.columns.canNotify=!1;let o=[],a=[];for(let a=0;a<e.length;a++){const l=e[a];let n=!0;for(let e=0;e<t.columns.length;e++)if(t.columns[e].dataField===l.dataField){n=!1;break}n&&o.push(l)}const l=e.map((e=>e.dataField));for(let e=0;e<t.columns.length;e++){const o=t.columns[e];-1===l.indexOf(o.dataField)&&a.push(o)}a.forEach((e=>{const o=t.columns.indexOf(e);o>=0&&t.columns.splice(o,1)}));for(let e=0;e<o.length;e++)t.columns.push(o[e]);if(t.columns.canNotify=!0,t.endUpdate(),t._columnGroups=[],t._columnHeights=0,t.viewColumns)for(let e=0;e<t.viewColumns.length;e++){const o=t.viewColumns[e],a=o.element;o.top=0,o.level=0,a&&(a.style.top="",a.style.height="",a.style.lineHeight="")}t._renderColumns(),t.__columnHeaderHeight=null,t.refresh()}onAttached(){const e=this;e._scrollView||(e._scrollView=new Smart.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.isRendered&&e.isCompleted&&e._render()}onDetached(){const e=this;if(!e.isRendered)return;["_dialogChart","_dialogAddRow","_dialogEdit","_dialogDelete","_dialogRowDetail","_dialogAddColumn"].forEach((t=>{e[t]&&(e[t].close(),e[t]=null)})),e.menu&&(e.menu.ownerElement=null,e.menu.remove(),e.menu=null);const t=e.querySelector("smart-grid-toolbar");if(t){const e=t.$.headerDropDown;e&&e.remove()}e._resetCachedLayout();const o=e._scrollView.hScrollBar,a=e._scrollView.vScrollBar;if(a.ownerElement=null,o.ownerElement=null,a.onChange=null,o.onChange=null,e._scrollView&&(e._scrollView.unlisten(),delete e._scrollView),e._columnElements)for(let t=0;t<e._columnElements.length;t++)e._columnElements[t]._detach();if(e._columnElements=null,e._rowElements)for(let t=0;t<e._rowElements.length;t++)e._rowElements[t]._detach();e._rowElements=null,e.rows=[],e.rowById=[],e._initColumns=[],e.columnByDataField=[],e.viewColumns=[],e._columnToResizeElement=null;let l=Array.isArray(e.columns)?[...e.columns]:[...e.columns.toArray()];l=l.map((e=>e.data?(void 0!==e.data.visibleIndex&&delete e.data.visibleIndex,void 0!==e.data.index&&delete e.data.index,void 0!==e.data.grid&&delete e.data.grid,e.data):e)),e.rows.notifyFn=null,e.columns.notifyFn=null,e.columns.notify=null,e.columns._array=[],e.columns=l,e._boundColumns=[],e._filterPanels=[],e._frozenFarColumns=[],e._frozenNearColumns=[],e._frozenNearDefaultRows=[],e._frozenFarDefaultRows=[],e._frozenFarRows=[],e._frozenNearRows=[],e._selection={rows:[],indexes:[],columns:[],cells:[]},e.__autoHeightRows=null,e._visibleRows=null,e.__viewRows=null,e.__clientSize=null,e.__scrollHeight=null,e.__scrollWidth=null,e.__parentCells=null,e._selectionColumn=null,e._adaptiveColumn=null,e._commandColumn=null,delete e._columnFarContainerComputedStyle,delete e._columnContainerComputedStyle,delete e._columnNearContainerComputedStyle,e._inputOverlay&&(e._inputOverlay.parentNode&&e._inputOverlay.parentNode.removeChild(e._inputOverlay),e._inputOverlay=null),e._firstVisibleColumn=null,e._lastVisibleColumn=null,e._toggledRow=null,Smart(e._selector)&&(delete Smart(e._selector)._properties,Smart(e._selector)),delete e._selector,delete e._initProperties}_observeColumns(){const e=this,t=function(t,o,a,l){a===l&&"selected"!==o||(t.propertyChanged(o,a,l),e.onColumnChange&&t.stateProps.indexOf(o)>=0&&e.onColumnChange(t,o,a,l))};for(let o=0;o<e.viewColumns.length;o++){const a=e.viewColumns[o];a.rowHeaderColumn||(a.onAction=function(){e._openMenu(this)}),a.autoGenerated&&a.notify((function(e){a.canNotify=!1,t(a,e.propertyName,e.oldValue,e.newValue),a.canNotify=!0}))}e.columns.notify((function(o){let a=null;if(o.path)return e.columns.canNotify=!1,t(o.target,o.propertyName,o.oldValue,o.newValue),void(e.columns.canNotify=!0);e.columns.canNotify=!1;let l=0;switch(o.action){case"length":return void(e.columns.canNotify=!0);case"add":{const t=function(t){if(a=o.object[t],a instanceof Smart.Grid.Column==0){a=new Smart.Grid.Column(a);const l=e.columns.canNotify;e.columns.canNotify=!1,o.object[t]=a,a=o.object[t],e.columns.canNotify=l}a.grid=e,a.onAction=function(){e._openMenu(this)},a.freeze?e._frozenNearColumns.push(a):"far"===a.freeze&&e._frozenFarColumns.push(a);let l=e.viewColumns.length-e._frozenFarColumns.length,n=0;if(e._frozenNearColumns.forEach((e=>{e.autoGenerated&&n++})),t<e.columns.length?e.viewColumns.splice(t+n,0,a):e.viewColumns.splice(l,0,a),e.columnByDataField[a.dataField]){e.columnByDataField[a.dataField].children.push(a),a.parent=e.columnByDataField[a.dataField],a.valueField=a.dataField;const t=a.dataField+"_"+a.parent.children.length;e.columnByDataField[t]=a,a.dataField=t}else e.columnByDataField[a.dataField]=a;if(e.dataSource&&e.dataSource.dataFields){let t=!1;for(let o=0;o<e.dataSource.dataFields.length;o++)e.dataSource.dataFields[o].name===a.dataField&&(t=!0);t||e.dataSource.dataFields.push({name:a.dataField,dataType:a.dataType||"string"})}if(!e._dragDrop&&e.onColumnInserted){e._onColumnInsertData||(e._onColumnInsertData=[],e._onColumnInsertIndexes=[]);const o=a.getState();o.dataField=a.dataField,e._onColumnInsertData.push(o),e._onColumnInsertIndexes.push(t),e._onColumnInsertTimer&&clearTimeout(e._onColumnInsertTimer),e._onColumnInsertTimer=setTimeout((()=>{e.onColumnInserted(e._onColumnInsertIndexes,e._onColumnInsertData),delete e._onColumnInsertIndexes,delete e._onColumnInsertData}),50)}};delete e.__measuredColumnHeight;for(let e=0;e<o.addedCount;e++)t(o.index+e);break}case"update":a=o.object[o.index],a instanceof Smart.Grid.Column==0&&(a=new Smart.Grid.Column(a)),a.grid=e;for(let t=0;t<o.index;t++)e.viewColumns[t].autoGenerated&&l++;e.viewColumns[l+o.index]=a,e.columnByDataField[a.dataField]=a,e.onColumnUpdated&&e.onColumnUpdated(o.index,a);break;case"remove":{a=o.removed[0];let t=o.index,n=e.viewColumns.indexOf(a);if(-1===n){for(let o=0;o<=t;o++)e.viewColumns[o].autoGenerated&&l++;e.viewColumns.splice(l+t,1)}else e.viewColumns.splice(n,1);if(a&&(a.filter&&e.removeFilter(a.dataField),a.sortOrder&&e.removeSort(a.dataField),e.removeGroup(a.dataField),delete e.columnByDataField[a.dataField]),e._dragDrop||e.onColumnRemoved&&e.onColumnRemoved(o.index,a),e.columnGroups&&(e._columnGroups=[],e._columnHeights=0,e.viewColumns))for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t],a=o.element;o.top=0,o.level=0,a&&(a.style.top="",a.style.height="",a.style.lineHeight="")}break}}e._initializeColumnGroupsHierarchy(),e._refreshColumnsResponsiveVisibility(),e._createColumnHeaderCellElements(),e._templateColumns(),e.refresh(),e.columnGroups&&e._columnGroups.length>0&&e._renderColumnGroupHeaders(),e.columns.canNotify=!0}))}get _scrollWidth(){const e=this;if(e.__scrollWidth)return e.__scrollWidth;let t=0;for(let o=0;o<e.viewColumns.length;o++){const a=e.viewColumns[o];a.visible&&(t+=a.computedWidth)}return t=parseInt(t),e.__scrollWidth=t,e._scrollView.scrollWidth=t-e._clientSize.width,e.__scrollWidth}_horizontalScrollbarHandler(){const e=this;e.closeMenu(),e.isScrolling=!0,e.isHScrolling=!0,requestAnimationFrame((()=>{if(e.filtering.enabled&&e.filtering.filterRow.visible)for(let t=0;t<e.columns.length;t++)e.columns[t]._filterEditorInitialized&&(e.columns[t]._filterEditorInitialized=!1);e._summaryRowDialog&&e._summaryRowDialog.classList.contains("open")&&e._summaryRowDialog.close(),e._recycle(),e.isScrolling=!1,e.isHScrolling=!1}))}_mouseWheelHandler(e){const t=this;if(t._scrollView.hScrollBar.$.hasClass("smart-hidden")&&t._scrollView.vScrollBar.$.hasClass("smart-hidden"))return;if(t._isUpdating)return;if(t.editing.isEditing)return;const o=t.querySelector("smart-grid-toolbar");if(!o||!o.$.headerDropDown.classList.contains("open"))if(t.disabled||t._scrollView.vScrollBar.$.hasClass("smart-hidden")||e.shiftKey||!e.deltaY){if(!t.disabled&&!t._scrollView.hScrollBar.$.hasClass("smart-hidden")&&e.deltaX){const o=t.scrollLeft;if(0===o&&e.deltaX<0||o===t.scrollWidth&&e.deltaX>0)return;e.stopPropagation(),e.preventDefault();let a=3*t.layout.rowMinHeight;e.deltaX<=0&&(a=-3*t.layout.rowMinHeight),Math.abs(e.deltaX)>=100?t._scrollView.scrollLeft+=a:t._scrollView.scrollLeft+=e.deltaX}}else{const o=t.scrollTop;if(0===o&&e.deltaY<0||o===t.scrollHeight&&e.deltaY>0)return;e.stopPropagation(),e.preventDefault();let a=3*t.layout.rowMinHeight;e.deltaY<=0&&(a=-3*t.layout.rowMinHeight),Math.abs(e.deltaY)>=100?t._scrollView.scrollTop+=a:t._scrollView.scrollTop+=e.deltaY}}_refresh(){const e=this;if(e._isUpdating)return;const t=e.$.verticalScrollBar.offsetWidth;e.removeAttribute("grouped"),e.removeAttribute("tree");let o=!0;e.__autoHeightRows&&(e.__autoHeightRows=null,e._refreshColumnsResponsiveVisibility(),e._recycle(),o=!1),e._groups||(e._groups=[]),e.grouping.enabled&&e.dataSource.groupBy&&e.dataSource.groupBy.length>=0&&("advanced"===e.grouping.renderMode?e.setAttribute("grouped",""):e.setAttribute("tree",""),e._groups||(e._groups=[].concat(e.dataSource.groupBy.toArray())||[]),e._renderGroupBar()),e.grouping.enabled&&e.dataSource.groupBy&&0===e.dataSource.groupBy.length?e.$.breadcrumb&&(e.$.breadcrumb.dataSource=[]):e.dataSource.boundHierarchy&&(e.setAttribute("tree",""),e.setAttribute("role","treegrid")),(e.isInitialized||o)&&e._refreshColumnsResponsiveVisibility(),e._refreshLayout(),t!==e.$.verticalScrollBar.offsetWidth&&(e.__scrollWidth=null,e._refreshColumnsResponsiveVisibility(),e._refreshScrollBars(),0===e.$.verticalScrollBar.offsetWidth&&e.isRendered&&requestAnimationFrame((()=>{e._refreshScrollBars()}))),e._refreshSelection(),e._recycle(),e._refreshHeaderBar(),e._recyclingRows&&0===e._recyclingRows.length&&(e.$.placeholder.classList.remove("smart-hidden"),e.scrollHeight=0,e.$.placeholder.innerHTML=e.appearance.placeholder,e._filters&&e._filters.length&&(e.$.placeholder.innerHTML=`<span class="smart-grid-icon show smart-icon-filter" style="\n font-size: calc(2 * var(--smart-font-size));\n cursor: default;\n margin-right: 10px;\n "></span>${e.localize("filteredRecords")}`)),requestAnimationFrame((()=>{e._width=e.offsetWidth,e._height=e.offsetHeight}))}_refreshHeaderBar(){const e=this;e.$.headerBar&&e.header.visible&&e.$.headerBar._refresh()}_resizeHandler(e){const t=this;if((t.enableShadowDOM?e.composedPath()[0]:e.target)===t&&!t._isUpdatingScrollBars){if(!t.isInitialized)return void t._render();if(!1===t._resizeHandling||!t.offsetHeight)return;t._isUpdatingScrollBars=!0,t._autoHeight=!1,t.$.content&&t.$.content.classList.remove("auto-height");const e=t._rowElements?t._rowElements.length*t.layout.rowMinHeight:0;(e>0||"grid"!==t.view)&&(t.offsetHeight>=e?(t._refreshLayout(),t._initializeRowElements()):"grid"!==t.view&&t._refreshLayout()),t.refresh(),t.$.headerBar&&t.$.headerBar.refreshTools(),t._dialogAddColumn&&t._dialogAddColumn.classList.contains("open")&&t._dialogAddColumn.refresh(),t._isUpdatingScrollBars=!1}}_refreshColumnsResponsiveVisibility(){const e=this,t=e.$.columnContainer,o=e.$.columnNearContainer,a=e.$.columnFarContainer;let l=0,n=0,i=0,r=!1;const s=e.columns.canNotify;e.columns.canNotify=!1;for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];o.setProperty("_treeColumn",!1,!1),e.grouping.enabled&&e.grouping.autoHideGroupColumn&&e.dataSource.groupBy&&e.dataSource.groupBy.indexOf(o.dataField)>=0&&o.setProperty("visible",!1,!1),o.visible&&!o.autoGenerated&&!r&&e.dataSource.boundHierarchy&&(o.setProperty("_treeColumn",!0,!1),r=!0)}e._refreshColumnWidths(),e.columns.canNotify=s;let d=0,u=0;for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];o.visible&&(o.freeze&&(!0===o.freeze||"near"===o.freeze?(l+=o.computedWidth,o.autoGenerated&&(d+=o.computedWidth)):"far"===o.freeze&&(n+=o.computedWidth,o.autoGenerated&&(u+=o.computedWidth))),i+=o.computedWidth)}t.style.width=i+"px",o.style.width=l+"px",a.style.width=n+"px",a.classList.remove("smart-hidden"),o.classList.remove("smart-hidden"),0===n&&a.classList.add("smart-hidden"),0===l&&o.classList.add("smart-hidden"),a.classList.remove("border-collapse"),n===u&&a.classList.add("border-collapse"),e._autoGeneratedColumnsNearWidth=d,e._autoGeneratedColumnsFarWidth=u,e._computedColumnsWidth=i,e._frozenColumnsNearWidth=l,e._frozenColumnsFarWidth=n}_selectStartHandler(e){const t=this;t.isScrolling||t.editing.isEditing||"grid"!==t.view||t.selection.defaultSelection||e.preventDefault()}setFocusable(e){const t=this;!t.disabled&&e?t.tabIndex=0:t.removeAttribute("tabindex")}_setLoadingIndicatorVisibility(){const e=this;e.appearance.displayLoadingIndicator?e.$.loadingIndicatorContainer.classList.remove("smart-visibility-hidden"):e.$.loadingIndicatorContainer.classList.add("smart-visibility-hidden")}_refreshElementsVisibility(){const e=this,t=function(e,t){e&&(t?e.classList.remove("smart-hidden"):e.classList.add("smart-hidden"))};if(t(e.$.placeholder,!e.rows||e.rows&&0===e.rows.length||0===e.columns.length),t(e.$.footer,e.footer.visible),t(e.$.header,e.header.visible),t(e.$.groupHeader,e.groupHeader.visible||e.grouping.groupBar.visible),t(e.$.columnHeader,e.columnHeader.visible&&e.columns.length>0),t(e.$.headerCommandBar,e.editing.commandBar.visible&&"far"!==e.editing.commandBar.position),t(e.$.footerCommandBar,e.editing.commandBar.visible&&"near"!==e.editing.commandBar.position),t(e.$.breadcrumb,e.groupHeader.visible||e.grouping.groupBar.visible),e.htmlColumnLastChild.classList.add("smart-visibility-hidden"),e.pager&&e.pager.visible&&e.paging.enabled)switch(e.pager.position){case"near":t(e.$.headerPager,!0),t(e.$.footerPager,!1);break;case"far":t(e.$.headerPager,!1),t(e.$.footerPager,!0);break;case"both":t(e.$.headerPager,!0),t(e.$.footerPager,!0)}else t(e.$.footerPager,!1),t(e.$.headerPager,!1);e._refreshRowHierarchy()}_getId(){const e=this;return e.dataSource&&e.dataSource.id?e.dataSource.id:e.dataSourceSettings.id?e.dataSourceSettings.id:void 0}_refreshRowHierarchy(e,t=!1){const o=this;o.rowHierarchy=null;let a=0,l=!1;if(!o.grouping.enabled&&o.dataSource.groupBy&&o.dataSource.groupBy.length>0&&(l=!0),o.grouping.enabled&&o.dataSource.groupBy&&0===o.dataSource.groupBy.length)return;let n=!1;if(o.grouping.enabled&&o.dataSource.groupBy&&o.dataSource.groupBy.length>0&&o.dataSource.virtualDataSourceOnExpand&&(n=!0),o.dataSource.boundHierarchy){const i=o.dataSource.reservedNames,r=function(e){return new Smart.Grid.Row({data:e,grid:o,index:o.rows.length})};let s=0;const d=function(t,a){for(let u=0;u<t.length;u++){const c=t[u];let m=o.rowById[c.$.id];if(n&&(m=o.rows[s],m||(m=r(c),o.rows.push(m)),c[i.leaf]?m.id=c.$.id:m.id="Group_"+c.$.id,o.rowById[m.id]=m),m||(m=r(c),o.rowById[m.id]=m),m.data=c,m.leaf=c[i.leaf]||!1,m.level=c[i.level],m.groupDataField=c.groupDataField,!m.groupDataField&&o.appearance.showTreeRowHeader&&(m.groupDataField=o.columns[m.level].dataField),m.label=c.label,m.children=[],m.data&&(m.filtered=void 0===m.data.$.filtered||m.data.$.filtered),c.summaryRow&&(m.summaryRow=!0),(null===o._toggledRow||o._toggledRow&&o._toggledRow.id!==m.id)&&(m.expandHeight=0),c.parent?(m.parent=o.rowById[c.parent.$.id],m.parentId=c.parent.$.id):(m.parent=null,m.parentId=null),o.grouping.onGroupDefaultExpanded&&!o.isRendered){const e=o.grouping.onGroupDefaultExpanded(c);e&&(m.expanded=c[i.expanded]=e)}o.appearance.allowRowToggleAnimation||void 0!==c[i.expanded]&&(m.expanded=c[i.expanded]);let g=!!e||m.expanded;l&&(g=!0);const p=o.dataSource&&o.dataSource.id||o.dataSourceSettings.id;if(p&&!m.data[p]&&o.grouping.enabled&&o.dataSource&&o.dataSource.groupBy.length){const e=o.dataSource.groupBy[m.level];c.parent&&c.parent.expanded&&(""===m.data[e]&&o.dataSource.id&&!m.data.data[o.dataSource.id]||m.leaf&&!m.data[p])&&(s++,m.filtered=!1)}if(!0===m.visible&&!1!==m.filtered)if(s++,g||c[i.leaf])if(a.push(m),c.children&&c.children.length>0){const e=d(c.children,new Array);0===e.length&&(m.leaf=!0);for(let t=0;t<e.length;t++)a.push(e[t]);m.children=e}else c.children&&0===c.children.length&&(o.dataSource.virtualDataSource&&o.dataSource.virtualDataSourceOnExpand?m.data._loaded&&(m.leaf=!0):m.leaf=!0);else if(a.push(m),c.children&&c.children.length>0){const e=d(c.children,new Array);0===e.length&&(m.leaf=!0),m.children=e}else c.children&&0===c.children.length&&(o.dataSource.virtualDataSource&&o.dataSource.virtualDataSourceOnExpand?m.data._loaded&&(m.leaf=!0):m.leaf=!0)}return a};let u=o.dataSource.boundHierarchy;if(o.paging.enabled&&!t){let e=[];const t=e=>{let a=[];if(0===o.dataSource.groupBy.length)return e;for(let o=0;o<e.length;o++){const l=e[o];(!l.$||void 0===l.$.filtered||l.$.filtered)&&(a.push(l),l.children&&(a=a.concat(t(l.children))))}return a};if(o.dataSource&&!o.dataSource.virtualDataSource){for(let o=0;o<u.length;o++){let a=u[o],l=!a.$||void 0===a.$.filtered||a.$.filtered;!l&&null!==l||0!==a.level||a.parent||(t(a.children).length,e.push(a))}u=e.slice(o.paging.pageIndex*o._pageSize,(o.paging.pageIndex+1)*o._pageSize)}}o.rowHierarchy=d(u,new Array);let c=[];for(let e=0;e<o.rowHierarchy.length;e++){const t=o.rowHierarchy[e],l=t.canNotify;t.leaf&&c.push(t),t.canNotify=!1,o.grouping.enabled&&o.dataSource&&o.dataSource.groupBy.length?t.leaf?t.visibleIndex=a++:t.visibleIndex=-1:t.visibleIndex=a++,t.canNotify=l}if(l&&(o.rowHierarchy=c),o._rowElements.length<o.rowHierarchy.length&&!o._toggledRow&&o._initializeRowElements(),o.grouping.summaryRow.visible&&!o.grouping.summaryRow.inline){const e=function(t,o,a,l){if(0!==t&&o.length>0&&o[o.length-1]&&!o[o.length-1].summaryRow){let e={label:" ",boundSource:[],groupDataField:a.data.groupDataField,$:{},summaryRow:!0,leaf:!0,level:t,expandHeight:0,siblings:o};e.$.id="SubRow"+l+"_"+a.data.$.id,a&&(e.parent=a.data,e.parentId=a.data.$.id),e.data=Object.assign(e),o.push(e)}for(let t=0;t<o.length;t++)o[t]&&o[t].data&&o[t].data.children&&e(o[t].level+1,o[t].data.children,o[t],t)};e(0,o.rowHierarchy,null,0)}}}applyContent(){}_refreshContentHeight(){const e=this;let t=e._clientSize.height;const o=window.scrollY;let a,l,n=!1;if((!e._contentHeight||e._maxHeight||e._autoHeight||e.__autoHeight||"hidden"===e.verticalScrollBarVisibility)&&(n=!0),n&&(a=e.offsetHeight,e.$.container.classList.add("smart-hidden"),l=e.offsetHeight,e.$.container.classList.remove("smart-hidden")),window.scrollY!==o&&window.scrollTo(window.scrollX,o),"hidden"===e.verticalScrollBarVisibility||a!==l||e._minHeight&&e._minHeight===a)return t=e._scrollHeight+e.$.columnHeader.offsetHeight+e.$.filterFooter.offsetHeight,e.header.visible&&(t+=e.$.header.offsetHeight),e.summaryRow.visible&&(t+=e.layout.rowMinHeight),0===e._recyclingRows.length&&0===e._scrollHeight&&(t+=e.$.scrollView.offsetTop),e.editing.addNewRow.visible&&1===e._recyclingRows.length&&(t+=e.$.scrollView.offsetTop),e._minHeight>t&&(t=e._minHeight),e.$.content.style.height=t+"px",e._contentHeight=t,void(e._maxHeight<t?(e._autoHeight=!1,e.$.content.classList.remove("auto-height"),e.$.content.style.height=e._maxHeight+"px",e.header.visible?(e.$.content.style.height=e._maxHeight-e.$.header.offsetHeight+"px",e._contentHeight=e._maxHeight-e.$.header.offsetHeight):e._contentHeight=e._maxHeight):(e._autoHeight=!0,e.__autoHeight=!0,e.$.content.classList.add("auto-height"),e.header.visible?(e._contentHeight=t-e.$.header.offsetHeight,e.$.content.style.height=e._contentHeight+"px"):e.summaryRow.visible&&(e.$.content.style.height=e._contentHeight+"px")));e.header.visible&&(t-=e.$.header.offsetHeight),(e.groupHeader.visible||e.grouping.groupBar.visible)&&(t-=e.$.groupHeader.offsetHeight),e.footer.visible&&(t-=e.$.footer.offsetHeight),e.pager.visible&&(t-=e.$.headerPager.offsetHeight,t-=e.$.footerPager.offsetHeight),e.editing.enabled&&e.editing.commandBar.visible&&(t-=e.$.headerCommandBar.offsetHeight,t-=e.$.footerCommandBar.offsetHeight),e.$.content.style.height!==t+"px"&&(e.$.content.style.height=t+"px"),e.$.viewContent.style.height!==t+"px"&&(e.$.viewContent.style.height=t+"px"),e._contentHeight=t}appendChild(){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(this,e.concat(Array.prototype.slice.call(arguments)))}removeChild(){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(this,e.concat(Array.prototype.slice.call(arguments)))}get _contentBorder(){const e=this;if(e.__contentBorder)return e.__contentBorder;const t=getComputedStyle(e.$.content),o={left:parseFloat(t.borderLeftWidth)+parseFloat(t.borderRightWidth),top:parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth)};return e.__contentBorder=o,o}_refreshLayout(){const e=this,t=e.rows;if(e._layoutSuspended)return;e._visibleRows=null,e.__viewRows=null,e.__clientSize=null,e.__scrollHeight=null,e.__scrollWidth=null,e.__parentCells=null,e.$.columnFarContainer.classList.remove("vscroll"),e.$.columnNearContainer.classList.remove("vscroll"),e.$.scrollView.classList.remove("hscroll"),e.$.scrollView.classList.remove("vscroll"),e._refreshElementsVisibility(),e._refreshColumnHeights(),e._refreshContentHeight();const o=()=>{e.$.placeholder.classList.remove("smart-hidden"),e.$.placeholder.innerHTML=e.appearance.placeholder,e._filters&&e._filters.length&&(e.$.placeholder.innerHTML=e.localize("filteredRecords")),e.__filterFooterOffsetHeight||(e.__filterFooterOffsetHeight=e.$.filterFooter.classList.contains("smart-hidden")?0:e.$.filterFooter.offsetHeight),!e.__columnHeaderHeight&&e.$.columnHeader.offsetHeight&&(e.__columnHeaderHeight=e.$.columnHeader.offsetHeight);let t=e._contentHeight-e.__filterFooterOffsetHeight-e.__columnHeaderHeight;e.$.scrollView.style.height=t+"px",e.scrollWidth=0,e.scrollHeight=0,e.clearSelection(),e._showAddNewRowButton("float"),e.$.content.classList.contains("auto-height")&&(e.$.placeholder.style.height=t+"px")};if(t&&t.url)e._showAddNewRowButton("float");else{if(!t||null===t||0===t.length||0===e.columns.length)return o(),0!==e.columns.length&&e.hasVisibleColumn()?e.editing.addNewColumn._addButton&&e.editing.addNewColumn._addButton.classList.remove("show"):(e._showAddNewColumnButton(),e.$.columnHeader.classList.add("smart-hidden"),e.__columnHeaderHeight=0),void e._refreshScrollBars();e._showAddNewRowButton("float"),e.editing.addNewColumn._addButton&&e.editing.addNewColumn._addButton.classList.remove("show")}0!==e.columns.length&&e.hasVisibleColumn()?e.editing.addNewColumn._addButton&&e.editing.addNewColumn._addButton.classList.remove("show"):(o(),0!==e.columns.length&&e.hasVisibleColumn()||(e._showAddNewColumnButton(),e.$.columnHeader.classList.add("smart-hidden"),e.__columnHeaderHeight=0),e._showAddNewColumnButton()),!e.__columnHeaderHeight&&e.$.columnHeader.offsetHeight&&(e.__columnHeaderHeight=e.$.columnHeader.offsetHeight),e.__filterFooterOffsetHeight||(e.__filterFooterOffsetHeight=e.$.filterFooter.classList.contains("smart-hidden")?0:e.$.filterFooter.offsetHeight);let a=e._contentHeight-e.__filterFooterOffsetHeight-e.__columnHeaderHeight;if(e.$.scrollView.style.height=a+"px",e.htmlColumnLastChild.style.height=e.__columnHeaderHeight+"px",e.paging.spinner.enabled&&e.paging.enabled){if(!e.pageScroll){const t=document.createElement("smart-scroll-bar");t.orientation="vertical",t.style.height="100%",t.style.width="100%",t.max=Math.ceil(e.dataSource.length/e._pageSize),t.step=e.paging.spinner.step,t.largeStep=e.paging.spinner.step,t.setAttribute("spinner",""),t.setAttribute("smart-id","spinner"),t.ownerElement=e,e.addPropertyBinding("[[paging_spinner_step]]","step",t,e.$.columnHeader),t.addEventListener("change",(function(t){e.paging.pageIndex=t.detail.value})),e.pageScroll=t}e.htmlColumnLastChild.appendChild(e.pageScroll)}else e.htmlColumnLastChild.innerHTML="";e._refreshScrollBars()}_refreshScrollBars(){const e=this;if(!e._scrollView)return;const t=e._scrollView.vScrollBar,o=e._scrollView.hScrollBar,a=e._contentHeight-e.__filterFooterOffsetHeight-e.__columnHeaderHeight,l=e.$.scrollView.offsetWidth,n=e._scrollWidth-l-e._contentBorder.left,i=e._scrollHeight-a-e._contentBorder.top,r=e._columnNearContainerComputedStyle?e._columnNearContainerComputedStyle:getComputedStyle(e.$.columnNearContainer),s=e._columnFarContainerComputedStyle?e._columnFarContainerComputedStyle:getComputedStyle(e.$.columnFarContainer),d=parseInt(e.$.columnNearContainer.style.width)+parseInt(r.borderRightWidth),u=parseInt(e.$.columnFarContainer.style.width)+parseInt(s.borderLeftWidth);if(e.__frozenNearWidth=d,e.__frozenFarWidth=u,e._columnNearContainerComputedStyle=r,e._columnFarContainerComputedStyle=s,e._refreshHorizontalScrollBarVisibility(n),e._refreshVerticalScrollBarVisibility(i),t.style.height=a+"px",e.computedVerticalScrollBarVisibility?(e.__scrollBarSize||(e.__scrollBarSize=t.offsetWidth),e.__scrollWidth+=e.__scrollBarSize,e._refreshHorizontalScrollBarVisibility(e._scrollWidth-l-1),e.rightToLeft?e.$.columnNearContainer.classList.add("vscroll"):e.$.columnFarContainer.classList.add("vscroll"),e._refreshVerticalScrollBarVisibility(i),e.htmlColumnLastChild.classList.remove("smart-visibility-hidden"),e.$.scrollView.classList.add("has-vscroll")):e.$.scrollView.classList.remove("has-vscroll"),o.style.width=l+"px",e.rightToLeft?o.style.right="0px":o.style.left="0px",e.computedVerticalScrollBarVisibility&&e.computedHorizontalScrollBarVisibility&&(o.style.width=l-t.offsetWidth+"px",t.style.height=a-o.offsetHeight+"px"),e.computedHorizontalScrollBarVisibility?(e.$.scrollView.classList.add("hscroll"),e._autoHeight?(e.$.content.style.height="auto",e.$.scrollView.style.height="auto",e.$.scrollView.style.paddingBottom=o.offsetHeight+"px",e.$.placeholder.style.marginTop=o.offsetHeight+"px",e.summaryRow.visible&&(e.$.scrollView.style.paddingBottom=o.offsetHeight+e.layout.rowMinHeight+"px")):(e.$.scrollView.style.paddingBottom="",e.$.placeholder.style.marginTop="")):e.$.scrollView.classList.remove("hscroll"),(e.__frozenNearHeight>0||e._frozenNearRows&&e._frozenNearRows.length>0)&&!e.appearance.showVerticalScrollBarOnFixedColumns){const o=getComputedStyle(e.$.rowNearContainer),a=e.__frozenNearHeight+parseInt(o.borderBottomWidth);t.style.height=parseInt(t.style.height)-a+"px",t.style.top=a+"px",t.style.setProperty("--smart-scroll-bar-near-size",a+"px")}else e.appearance.showVerticalScrollBarOnFixedColumns&&(t.style.top="0px");if((e.__frozenFarHeight>0||e._frozenFarRows&&e._frozenFarRows.length>0)&&!e.appearance.showVerticalScrollBarOnFixedColumns){const o=getComputedStyle(e.$.rowFarContainer),a=-2+e.__frozenFarHeight+parseInt(o.borderTopWidth);t.style.height=parseInt(t.style.height)-a+"px",t.style.setProperty("--smart-scroll-bar-far-size",a+"px"),0===e.__frozenNearHeight&&(t.style.top="0px")}(d>0||u>0)&&!e.appearance.showHorizontalScrollBarOnFixedColumns&&(o.style.width=parseInt(o.style.width)-d-u+"px",e.rightToLeft?o.style.right=d+"px":o.style.left=d+"px",o.style.setProperty("--smart-scroll-bar-near-size",d+parseInt(r.borderRightWidth)+"px"),o.style.setProperty("--smart-scroll-bar-far-size",u+parseInt(r.borderLeftWidth)+"px"),e.computedVerticalScrollBarVisibility&&(e.__scrollBarSize||(e.__scrollBarSize=t.offsetWidth),o.style.setProperty("--smart-scroll-bar-far-size",u+e.__scrollBarSize+"px"))),t.refresh(),o.refresh()}_refreshHorizontalScrollBarVisibility(e){const t=this;t.scrollWidth=e,t.computedHorizontalScrollBarVisibility||(t.scrollLeft=0)}_refreshVerticalScrollBarVisibility(e){const t=this;if(t._autoHeight)return t.scrollTop=0,void(t.scrollHeight=0);t.computedHorizontalScrollBarVisibility&&(e+=t.$.horizontalScrollBar.offsetHeight),t.scrollHeight=e,t.paging.enabled&&t.paging.spinner.visible&&t.$.verticalScrollBarVisibility.classList.remove("smart-hidden"),t.computedVerticalScrollBarVisibility||(t.scrollTop=0)}_styleChangedHandler(e){const t=this;if(!e.detail.styleProperties.overflow&&!t.classList.contains("smart-grid-resize-mode")){if(e.detail.styleProperties["grid-template-columns"])return t._templateColumns(),void t.refresh();if(e.detail.styleProperties["font-size"])return t.layout.isDirty=!0,t._resetCachedLayout(),void t.refresh();(e.detail.styleProperties["--smart-grid-row-height"]||e.detail.styleProperties["--smart-font-size"]||e.detail.styleProperties["--smart-grid-column-header-height"]||e.detail.styleProperties["--smart-grid-group-header-height"]||e.detail.styleProperties["--smart-grid-filter-footer-height"]||e.detail.styleProperties["--smart-grid-group-row-vertical"]||e.detail.styleProperties["--smart-grid-group-row-horizontal-offset"]||e.detail.styleProperties["--smart-grid-freeze-splitter-size"]||e.detail.styleProperties["--smart-grid-resize-line-size"]||e.detail.styleProperties["--smart-grid-footer-height"]||e.detail.styleProperties["--smart-grid-header-height"])&&(t.layout.isDirty=!0),t.offsetWidth&&t.offsetHeight>0&&(t._resetCachedLayout(),t._refreshLayout(),t._recycle())}}_resetCachedLayout(){const e=this;delete e._columnHeights,e.__cellsCommandTemplate=null,e.__autoRowHeight=null,e.__autoHeightRows=null,e.__measuredColumnHeight=null,e.__columnHeaderHeight=null,e.__filterFooterOffsetHeight=null}_swipeLeftHandler(){}_swipeRightHandler(){}_getRowIndexByPosition(e){const t=this;return(o=>{let a=0,l=o.length-1;if(e<=0)return 0;const n=o[o.length-1];if(-1!==n.top&&n.top<=e)return o.length-1;for(;;){const n=Math.floor((a+l)/2),i=o[n];if(t._isRowInPosition(i,e))return n;i.top<e?a=n+1:i.top>e?l=n-1:a=n+1}})(t._recyclingRows)}_getVirtualRowIndexByPosition(e){let t=this.rows[0].height;const o=(e,o)=>0!==t&&e<=o&&e+t>o;return(a=>{let l=0,n=a.length-1;if(e<=0)return 0;const i=(a.length-1)*t;if(-1!==i&&i<=e)return a.length-1;for(;;){const a=Math.floor((l+n)/2),i=a*t;if(o(i,e))return a;i<e?l=a+1:i>e?n=a-1:l=a+1}})(this.dataSource)}getRows(){return this.getViewRows()}getViewRows(){const e=this;return e.rowHierarchy?e.rowHierarchy:e.getVisibleRows()}getColumns(){const e=this,t=[];if(!e.isInitialized)return t;if(e.columns)for(let o=0;o<e.columns.length;o++){const a=e.columns[o].getState();t.push(a)}return t}resetState(){const e=this;e._isUpdating=0,e.beginUpdate(),e.clearSort(),e.clearFilter(),e.clearGroups(),e.clearSelection(),e.columns.canNotify=!1;let t=[],o=!1;for(let a=0;a<e.columns.length;a++){const l=e.columns[a];l.visible=!0,l.width=180,l.freeze=!1,delete l.statusColumn,t[l.index]=l,l.index!==a&&(o=!0)}o&&(e.columns=t),e.columns.canNotify=!0,e._scrollView.scrollLeft=e._scrollView.scrollTop=0,e.paging.enabled&&(e.paging.pageIndex=0),e.$.headerBar&&e.$.headerBar._setView&&e.$.headerBar._setView("grid"),e.endUpdate(),o&&(e._renderColumns(),e._refreshHeaderBar())}_loadState(e){const t=this;let o=!1;if(t.stateSettings.loading=!0,e.expandedRows&&Object.keys(e.expandedRows).length>0){o=!0,t.beginUpdate();const a=[];if(e.groups){t.dataSource.groupBy=e.groups,t._refreshRowHierarchy();for(let o in e.expandedRows)a["Item"+o.replaceAll(".","_")]=!0,t._expandCollapseGroup(o,!0)}t.dataSource&&(t.dataSource._expandedRowIds=a)}if(e.paging&&t.paging.enabled&&(t.paging.index=e.paging.index,t.paging.size=e.paging.size),e.columns&&e.columns.length>0){o||(o=!0,t.beginUpdate());for(let o=0;o<e.columns.length;o++){const a=e.columns[o];if(a.dataField){const e=t.columnByDataField[a.dataField];e&&(e.width=a.width,e.freeze=a.freeze,e.visible=a.visible)}}}if(e.sort&&Object.keys(e.sort).length>0){o||(o=!0,t.beginUpdate());const a=t.appearance.allowSortAnimation;t.appearance.allowSortAnimation=!1;for(let o in e.sort){const a=e.sort[o].sortOrder,l=t.columnByDataField[o];t.sortBy(l.dataField,a)}t.appearance.allowSortAnimation=a}if(e.filter&&Object.keys(e.filter).length>0){o||(o=!0,t.beginUpdate());for(let o in e.filter){const a=e.filter[o];a&&t.addFilter(o,a,!1)}}o&&(t.endUpdate(!1,!1),t._refresh()),e.view&&t.view!==e.view&&t.$.headerBar&&t.$.headerBar._setView&&t.$.headerBar._setView(e.view),Object.keys(e.filter).length>0&&t.refreshFilters(),e.name&&(t.stateSettings.current=e.name),t.stateSettings.loading=!1}loadState(e){const t=this;if(e){if(t.stateSettings.loading=!0,t._isUpdating=0,t.beginUpdate(),t.clearSort(),t.clearFilter(),t.clearGroups(),t.clearSelection(),t._scrollView.scrollLeft=t._scrollView.scrollTop=0,t.paging.enabled&&(t.paging.pageIndex=0),t.endUpdate(!1,!1),"string"==typeof e){const o=t.stateSettings.storage[e];o&&t._loadState(o)}else t._loadState(e);t.stateSettings.loading=!1}else if(!t.stateSettings.autoSave){let e=t.getCurrentState();e&&t.loadState(e)}}saveState(e,t){const o=this;let a=o.getCurrentState(),l=t;!t&&o.stateSettings.options.length&&(t=o.stateSettings.options);const n=o.getState(t);let i;if(e?(i=e,o.stateSettings.current||(o.stateSettings.current=e)):i=o.stateSettings.current?o.stateSettings.current:o.stateSettings.current="smartGrid"+o.id,a&&l)for(let e in l)a[l[e]]=n[l[e]];else a=n;return a.name=i,window.localStorage.setItem(i,JSON.stringify(a)),o.stateSettings.storage||(o.stateSettings.storage={}),o.stateSettings.storage[o.stateSettings.current]=a,o.stateSettings.onStateChange&&o.stateSettings.onStateChange(a,i),a}getCurrentState(){const e=this,t=e.stateSettings.current;return e.stateSettings.storage||(e.stateSettings.storage={}),e.stateSettings.storage[t]?e.stateSettings.storage[t]:null}getState(e){const t=this;if(e&&!e.includes)return;const o=!e||e&&e.includes("sort")?t.getSortedColumns():null,a=!e||e&&e.includes("filter")?t.getFilteredColumns():null,l=!e||e&&e.includes("groups")?t.getGroups():null,n=!e||e&&e.includes("selection")?t.getSelectedCells():null,i=!e||e&&e.includes("selection")?t.getSelectedRows():null,r=!e||e&&e.includes("pager")?t.$.headerPager.querySelector("smart-pager"):null;let s=0;r&&(s=r.pagesCount);const d={sort:o,filter:a,groups:l,paging:{count:s,index:t.paging.pageIndex,size:t._pageSize},selectedCells:n,selectedRows:i};t.header.visible&&t.header.buttons.indexOf("views")>=0&&(d.kanban=t.getKanbanState(),d.view=t.view);const u=[];if(!e||e&&e.includes("columns")){for(let e=0;e<t.columns.length;e++){const o=t.columns[e];u.push({dataField:o.dataField,width:o.computedWidth,visible:o.visible,freeze:o.freeze})}d.columns=u}if((!e||e&&e.includes("expandedRows"))&&t.dataSource&&t.dataSource._expandedRowIds){let e={};for(let o in t.dataSource._expandedRowIds){let t=""+o;t=t.replace("Item","").replace(/_/gi,"."),e[t]=!0}d.expandedRows=e}if(e){const t={};for(let o in e){const a=e[o];d[a]&&(t[a]=d[a])}return t}return d}get _pageSize(){const e=this;return e.dataSource&&e.grouping.enabled&&e.dataSource.groupBy.length>0?e.paging.pageHierarchySize:e.paging.pageSize}get _recyclingRows(){const e=this;if(e.rowHierarchy)return e.rowHierarchy;let t=e.getVisibleRows();if(e.paging.enabled)if(e.dataSource.virtualDataSource)t=t.slice(0,e._pageSize);else if(t=t.slice(e.paging.pageIndex*e._pageSize,(e.paging.pageIndex+1)*e._pageSize),e.editing.addNewRow&&e.editing.addNewRow.visible&&"button"!==e.editing.addNewRow.displayMode){let t=e.getVisibleRows();return t=0===e.paging.pageIndex&&"far"!==e.editing.addNewRow.position?t.slice(1+e.paging.pageIndex*e._pageSize,1+(e.paging.pageIndex+1)*e._pageSize):0===e.paging.pageIndex&&"far"===e.editing.addNewRow.position?t.slice(e.paging.pageIndex*e._pageSize,1+(e.paging.pageIndex+1)*e._pageSize):t.slice(1+e.paging.pageIndex*e._pageSize,1+(e.paging.pageIndex+1)*e._pageSize),[].concat(e._frozenNearDefaultRows,e._nearRowsAdded,t,e._farRowsAdded,e._frozenFarDefaultRows)}return t}_isRowInPosition(e,t){const o=e.top,a=e.top+e.height,l=o<=t&&a>t;return 0!==e.height&&l}_renderColumnGroupHeaders(){const e=this;for(let t=0;t<e._columnGroups.length;t++){const o=e._columnGroups[t];o.column.render(),o.column.allowReorder=!1,o.column.element.setAttribute("columnHeader",""),0===o.columns.length&&o.column.element.classList.add("smart-hidden"),0===t&&0===e.columns.indexOf(o.columns[0])&&o.column.element.classList.add("smart-grid-column-border-collapse")}}hasVisibleColumn(){const e=this;for(let t=e.viewColumns.length-1;t>=0;t--){const o=e.viewColumns[t];if(o.visible&&!o.autoGenerated)return!0}return!1}_isLastVisibleColumn(e){const t=this;for(let o=t.viewColumns.length-1;o>=0;o--){const a=t.viewColumns[o];if(a.visible)return a===e}return!1}_clearCachedTemplates(){const e=this;if(e._cachedTemplates&&Object.keys(e._cachedTemplates).length>0){e._tableCachedTemplates||(e._tableCachedTemplates=document.createElement("div"),e._tableCachedTemplates.style.display="none",document.body.appendChild(e._tableCachedTemplates));const t=document.createDocumentFragment();for(let o in e._cachedTemplates)t.appendChild(e._cachedTemplates[o]);e._tableCachedTemplates.appendChild(t)}}_recycle(e,t,o){const a=this;if(a._layoutSuspended||!1===a.isAttached)return;if(a._isUpdating)return;if(a.editing.isEditing&&(a.endEdit(),a._isUpdating))return;a._recycleValues=void 0===o||o,a._removeCellContentPopup(),a._inputOverlay&&(a._inputOverlay.parentNode&&a._inputOverlay.parentNode.removeChild(a._inputOverlay),a._inputOverlay=null),a._selection.selectionRect&&a._refreshCellSelectionRect();const l=a._scrollView.scrollTop;let n,i=a._getRowIndexByPosition(l),r=a._recyclingRows,s=r[i],d=s?s.top:0,u=0,c=0,m=0,g=0;if(a._cellRowSpan&&a._cellRowSpan.maxSpan>0){let e=0;if(i>=5?e=5:i>=4?e=4:i>=3?e=3:i>=2?e=2:i>=1&&(e=1),e>0){const t=r[i-e];t&&(s=t,d=s?s.top:0,m=e*s.height,i-=e)}}a._cellRowSpan=[];for(let e=0;e<a._cellsMerge.length;e++){const t=a._cellsMerge[e],o=r.indexOf(t.row);if(i>o&&i<=o+t.rowSpan&&(i=o,s=t.row,m=Math.max(m,d-s.top),d=s.top,a.$.rowContainer.style.top=a.__frozenNearHeight-l+d+"px"),t.colSpan>1)for(let e=0;e<a.viewColumns.length;e++){const o=a.viewColumns[e];let l=o.autoGenerated?o:a.columnByDataField[o.dataField];if(l.visible&&l.left+l.computedWidth-a._scrollView.scrollLeft>=u&&l.left-l.computedWidth-a._scrollView.scrollLeft<a._clientSize.width){let e=a.columnByDataField[t.column.dataField];g=Math.max(g,l.left-e.left+l.computedWidth);break}}}a.isHScrolling&&a._clearCachedTemplates();let p=null;if(!1!==e||a._cellsMerge.length>0){for(let e=0;e<a._columnElements.length;e++){const t=a._columnElements[e];if(!t.parentNode)break;t.set("column",null,!1),t.classList.add("smart-visibility-hidden")}for(let e=0;e<a._columnGroups.length;e++){const t=a._columnGroups[e],o=t.element;o&&(a.rightToLeft?o.style.right=t.right+"px":o.style.left=t.left+"px",o.style.width=t.computedWidth+"px")}a._firstVisibleColumn=null,a._lastVisibleColumn=null;for(let e=0;e<a.viewColumns.length;e++){let t=a.viewColumns[e];if(t.visible&&(a._firstVisibleColumn||(a._firstVisibleColumn=t),a._lastVisibleColumn=t),t.element&&(t===a._firstVisibleColumn||t.rowDetailColumn?t.element.classList.add("smart-grid-column-border-collapse"):t.element.classList.remove("smart-grid-column-border-collapse"),t.element.removeAttribute("aria-colindex")),t.freeze){if(!0!==t.freeze&&"near"!==t.freeze||t.visible&&(u+=t.computedWidth),!t.element)continue;t.visible?(t.element.classList.remove("smart-visibility-hidden"),t.render()):t.element.classList.add("smart-visibility-hidden")}else if(t.visible&&t.left+t.computedWidth-a._scrollView.scrollLeft>=u-g&&t.left-t.computedWidth-a._scrollView.scrollLeft<a._clientSize.width){const o=a._columnElements[c++];o&&(o.set("column",t,!1),o.parentNode||a.$.columnContainer.appendChild(o),p||(p=t,a._firstRenderedColumn=t),t.element=o,t.render(),o.setAttribute("aria-colindex",e+1),void 0===n&&(n=t.left))}}}if(void 0===n&&(n=0),a.rightToLeft){const e=a._scrollView.scrollWidth-a._scrollView.scrollLeft-a._scrollView.vScrollBar.offsetWidth;a.$.columnContainer.style.right=e+"px",e<=0&&!a._scrollView.scrollWidth&&(a.$.columnContainer.style.right=-a.offsetWidth+a._computedColumnsWidth+"px")}else a.$.columnContainer.style.left=-a._scrollView.scrollLeft+"px";if(a.$.rowContainer.style.top=a.__frozenNearHeight-l+d+"px",a.isScrolling&&!a.isHScrolling&&(a._scrollUpdate&&clearTimeout(a._scrollUpdate),a._scrollUpdate=setTimeout((function(){a.isScrolling||(a.$.rowContainer.style.top=parseInt(a.$.rowContainer.style.top)+.01+"px")}),50)),!1===t)return;if(!a._rowElements)return;const h=a.dataSource&&a.dataSource.virtualDataSource&&!a.dataSource.virtualDataSourceOnExpand&&a.dataSource.length>a.virtualModeCachedRowsCount&&"infinite"!==a.scrolling;if(i>=0){c=0;let e=Math.max(a._clientSize.height,a._overflowOffset),t=0;h&&(a.rowById=[],a.rows&&a.rows.length>0&&void 0===a.rows[a.rows.length-1].top&&(a.rows[a.rows.length-1].top=(a.rows.length-1)*a.rows[0].height),a.rows&&a.rows.length>0&&(t=a._getVirtualRowIndexByPosition(l),d=t*a.rows[0].height,a.$.rowContainer.style.top=a.__frozenNearHeight-l+d+"px",a.paging.enabled||(i=0)),a.paging.enabled&&(t=a.paging.pageIndex*a._pageSize));for(let o=i;o<r.length;o++){const n=r[o];if(0===n.height||!n.visible||!1===n.filtered||n.freeze&&n.visible)continue;const s=n.height;if(n.expandHeight&&(e+=a.offsetHeight+n.expandHeight),!(d+s>=l-m&&d<=l+e||a._autoHeight))break;{const e=a._rowElements[c++];if(!e)break;if(e.setAttribute("aria-rowindex",t+o+1),n.element=e,n.grid=a,h){if(n.index=o+t,n.visibleIndex=o+t,a.selection.enabled&&a._selection){const e=a._selection.indexes,t=n.canNotify;n.canNotify=!1,n.selected=e.indexOf(n.index)>=0,n.canNotify=t}a.paging.enabled?(n.data=a.dataSource[i+c-1],n.data&&(n.id=n.data.$.id,a.rowById[n.id]=n)):(n.data=a.dataSource[c-1],n.data&&(n.id=n.data.$.id,a.rowById[n.id]=n))}n.render()}d+=s}}a._renderFrozenRows();let f=c;if(c<a._rowElements.length)for(let e=c;e<a._rowElements.length;e++){const e=a._rowElements[c++];e.classList.add("smart-hidden"),e.removeAttribute("aria-rowindex")}a.editing.addNewRow&&a.editing.addNewRow.visible&&"button"===a.editing.addNewRow.displayMode&&a._rowElements[f]&&(a._newRow||(a._newRow=new Smart.Grid.Row({data:{},index:9999999,grid:a,addNewRow:!0,inline:!0,autoGenerated:!0})),a._newRow.element=a._rowElements[f],a._newRow.element.classList.remove("smart-hidden"),a._newRow.render()),h&&a._selection.selectionRect&&a._refreshCellSelectionRect()}_renderFrozenRows(){const e=this;let t=!1,o=!1;0===e._frozenNearRows.length?e.$.rowNearContainer.classList.add("smart-hidden"):e.$.rowNearContainer.classList.remove("smart-hidden");for(let o=0;o<e._frozenNearRows.length;o++){const a=e._frozenNearRows[o];a.visible||(a.element=e.$.rowNearContainer.children[o],a.element||(a.element=a.createElement(),e.$.rowNearContainer.appendChild(a.element)),a.element.classList.add("smart-hidden")),a.visible&&a.filtered&&(t=!0,a.element=e.$.rowNearContainer.children[o],a.element||(a.element=a.createElement(),e.$.rowNearContainer.appendChild(a.element)),a.render())}t||e.$.rowNearContainer.classList.add("smart-hidden"),0===e._frozenFarRows.length?e.$.rowFarContainer.classList.add("smart-hidden"):e.$.rowFarContainer.classList.remove("smart-hidden");for(let t=0;t<e._frozenFarRows.length;t++){const a=e._frozenFarRows[t];a.visible&&(o=!0),a.element=e.$.rowFarContainer.children[t],a.element||(a.element=a.createElement(),e.$.rowFarContainer.appendChild(a.element)),a.render()}o||e.$.rowFarContainer.classList.add("smart-hidden"),0!==e.columns.length&&e.hasVisibleColumn()||(e.$.rowNearContainer.classList.add("smart-hidden"),e.$.rowFarContainer.classList.add("smart-hidden"));const a=e.rows;a&&null!==a&&0!==a.length||(e.$.rowNearContainer.classList.add("smart-hidden"),e.$.rowFarContainer.classList.add("smart-hidden"))}_recycleRotate(e,t,o,a,l){const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();let r=0,s=0;return 0===i.width?(e.innerHTML=l,!1):(n.left>i.left&&(r=i.left-n.left),n.top<i.top&&(s=i.top-n.top),"left"!==o&&""!==o||(r=4),"center"===o&&(r+=i.width/2-n.width/2),"right"===o&&(r+=i.width-n.width-4),"top"!==a&&""!==a||(s=4),"center"!==a&&"middle"!==a||(s+=i.height/2-n.height/2),"bottom"===a&&(s+=i.height-n.height-4),t.style.left=r+"px",t.style.top=s+"px",!0)}_virtualDataRequest(e,t){const o=this;let a=-1,l=-1;if(!o._rowElements&&"infinite"!==o.scrolling)return;if("virtual"===o.scrolling){for(let e=0;e<o._rowElements.length;e++){const t=o._rowElements[e],n=t.row,i=0===e?n.visibleIndex:a+e;t.classList.contains("smart-hidden")||(-1===a&&(a=i),-1!==i&&(l=1+i))}0===o._rowElements.length&&(a=0,l=Math.max(20,parseInt(o.offsetHeight/o.layout.rowMinHeight*1.5)))}else"infinite"===o.scrolling?(a=1/0,l=1/0):(a=0,l=o.dataSource.length);l!==1/0&&(o.dataSource.virtualDataSourceLength||o.dataSource.length)&&(l=Math.min(l,o.dataSource.length)),o.paging.enabled&&(a=o.paging.pageIndex*o._pageSize,l=a+o._pageSize),o._toggledRow||(o.appearance.displayLoadingIndicator=!0,o._setLoadingIndicatorVisibility()),o._groups||(o._groups=[].concat(o.dataSource.groupBy.toArray())||[]);const n={first:a,last:l,edit:o._editInfo,sorting:o.getSortedColumns(),filtering:o.getFilteredColumns(),grouping:o._groups,row:o._toggledRow?o._toggledRow.data:null,action:e},i=o.dataSource.length,r=o.dataSource.boundSource.length;void 0===o._isFirstVirtualDataSourceRequest&&(o._isFirstVirtualDataSourceRequest=!0),o.dataSource.onVirtualDataSourceRequested((function(e){if(o.appearance.displayLoadingIndicator=!1,o._setLoadingIndicatorVisibility(),o._toggledRow=null,!e)return o._initializeRows(),o._initializeRowElements(),o.refresh(),o._refreshPagesCount(),void(o._autoHeight&&o._initializeRowElements());if("add"===e.action)return void(t&&t(e.result));if("update"===e.action)return void(t&&t(e.result));if("remove"===e.action)return void(t&&t(e.result));const a=o.context;if(o.context=o,o._isFirstVirtualDataSourceRequest&&0===o._initColumns.length&&(o.columns.canNotify=!1,o.columns=[],o._renderColumns(),o.columns.canNotify=!0),"scroll"===e.action)if("infinite"===o.scrolling)o._recycle(!1,!1);else{const t=e.first>=0?e.first:0,a=e.last!==1/0?e.last:0;let l=0;for(let e=t;e<a;e++)o.rows[e]&&(o.rows[e].data=o.dataSource[l++]);o._recycle(!1,!1)}else if(o.dataSource.length!==i||o.dataSource.boundSource.length!==r||o._isFirstVirtualDataSourceRequest||"expand"===e.action||"filter"===e.action||"sort"===e.action||"pageIndexChange"===e.action||"pageSizeChange"===e.action||"sort"===e.action||"group"===e.action){if(o.paging.enabled&&o.$.headerPager.querySelector("smart-pager")&&(o.$.headerPager.querySelector("smart-pager").pagesCount=Math.ceil(o.dataSource.length/o._pageSize),o.$.footerPager.querySelector("smart-pager").pagesCount=Math.ceil(o.dataSource.length/o._pageSize)),o._initializeRows(),o._initializeRowElements(),o.refresh(),o._refreshPagesCount(),o._autoHeight&&o._initializeRowElements(),o.filtering.filterRow)for(let e=0;e<o.columns.length;e++)o.columns[e]._filterEditorInitialized&&(o.columns[e]._filterEditorInitialized=!1)}else o.dataSource.virtualDataSourceOnExpand&&o.refresh();o._isFirstVirtualDataSourceRequest&&o.onLoad&&(o.onLoad(o),delete o.onLoad),o._isFirstVirtualDataSourceRequest=!1,o._recycle(),o.context=a,o._onDataUpdated&&o._onDataUpdated()}),n)}_createAddNewRowButton(){const e=this,t=document.createElement("div");return t.className="smart-grid-add-row-button smart-grid-icon smart-icon-plus",t.title=e.localize("addNewRow"),e._addNewGridRow=t.onclick=()=>{e._addRowTimer&&clearTimeout(e._addRowTimer),e._addRowTimer=setTimeout((()=>{if(e.dataSource&&e.dataSource.virtualDataSource)return void e._insertNewRowAfter();const t={};for(let o=0;o<e.columns.length;o++){const a=e.columns[o];void 0!==a.defaultValue&&(t[a.dataField]=a.defaultValue)}e._addingNewRow=!0,e._add(t),e._scrollView.vScrollBar.value=e._scrollView.vScrollBar.max,e.closeMenu(),e._addingNewRow=!1}),0)},t}addColumn(e){const t=this;if(e){if("string"==typeof e){const o=t._getKanbanTaskField(e);return void(o&&t.columns.push(o))}t.columns.push(e)}}addNewColumn(e){e&&this.columns.push(e)}_createAddNewColumnButton(){const e=this,t=document.createElement("div");return t.className="smart-grid-add-column-button smart-grid-icon smart-icon-plus",t.title=e.localize("addNewColumn"),t.onclick=()=>{e._openAddColumnDialog(),e.addEventListener("closeColumnDialog",(()=>{e.layout.isDirty=!0,e._resetCachedLayout(),e._refreshLayout()}))},t}_showAddNewRowButton(e){const t=this;if(!t.columns.length)return;if("grid"!==t.view&&t.editing.addNewRow._addButton)return t.editing.addNewRow._addButton.remove(),void delete t.editing.addNewRow._addButton;if("float"===e&&t.computedVerticalScrollBarVisibility&&t.editing.addNewRow._addButton&&!t.editing.addNewRow._addButton.classList.contains("show"))return;if("float"===e&&t._addingNewRow)return;const o=()=>{t.editing.addNewRow._addButton&&t.editing.addNewRow._addButton&&("float"!==e&&(t.appearance.showRowHeader||t.appearance.showRowHeaderNumber)?t.editing.addNewRow._addButton.classList.remove("float"):t.computedVerticalScrollBarVisibility?t.computedVerticalScrollBarVisibility&&"float"===e&&t.editing.addNewRow._addButton.classList.add("float"):t.editing.addNewRow._addButton.classList.add("float"),t.computedHorizontalScrollBarVisibility?t.pager.visible?t.editing.addNewRow._addButton.style.bottom="68px":t.editing.addNewRow._addButton.style.bottom="20px":t.pager.visible?t.editing.addNewRow._addButton.style.bottom="48px":t.editing.addNewRow._addButton.style.bottom="")};t.editing.addNewRow.visible&&"button"===t.editing.addNewRow.displayMode&&(t.editing.addNewRow._addButton||(t.editing.addNewRow._addButton=t._createAddNewRowButton(),t.appendChild(t.editing.addNewRow._addButton)),requestAnimationFrame((()=>{t.editing.addNewRow._addButton&&(t.editing.addNewRow._addButton.classList.add("show"),o())})))}_showAddNewColumnButton(){const e=this,t=()=>{e.editing.addNewColumn._addButton.classList.add("float")};e.editing.addNewColumn.visible&&(e.editing.addNewColumn._addButton||(e.editing.addNewColumn._addButton=e._createAddNewColumnButton(),e.appendChild(e.editing.addNewColumn._addButton)),requestAnimationFrame((()=>{e.editing.addNewColumn._addButton.classList.add("show"),t()})))}_verticalScrollbarHandler(e){const t=this;t.menu&&t.menu.column&&t.closeMenu(),t.isScrolling=!0,t._scrollTimer&&clearTimeout(t._scrollTimer),t._layoutSuspended||(t._scrollTimer=setTimeout((()=>{if(t._recycle(!1),t.isScrolling=!1,e.max===e.value&&e.max>0){if(t.$.fireEvent("scrollBottomReached"),"infinite"===t.scrolling)return t.appearance.displayLoadingIndicator=!0,t._setLoadingIndicatorVisibility(),t._virtualScrollTimer&&clearTimeout(t._virtualScrollTimer),void(t._virtualScrollTimer=setTimeout((()=>{t._virtualDataRequest("scroll"),t.appearance.displayLoadingIndicator=!1,t._setLoadingIndicatorVisibility()}),50));t.editing.addNewRow._addButton&&t.editing.addNewRow._addButton.classList.remove("show")}else t.editing.addNewRow.visible&&"button"===t.editing.addNewRow.displayMode&&t.editing.addNewRow._addButton&&e.max>0&&(t.editing.addNewRow._addButton.classList.add("show"),t.editing.addNewRow._addButton.classList.remove("scroll"),t.editing.addNewRow._addButton.classList.add("float"));"virtual"===t.scrolling&&(t.appearance.displayLoadingIndicator=!0,t._setLoadingIndicatorVisibility(),t._virtualScrollTimer&&clearTimeout(t._virtualScrollTimer),t._virtualScrollTimer=setTimeout((()=>{t._virtualDataRequest("scroll"),t.appearance.displayLoadingIndicator=!1,t._setLoadingIndicatorVisibility()}),50)),e.min===e.value&&t.$.fireEvent("scrollTopReached")})))}getVerticalScrollMax(){return this.scrollHeight}getHorizontalScrollMax(){return this.scrollWidth}getHorizontalScrollValue(){return this.scrollLeft}setHorizontalScrollValue(e){this.scrollLeft=e}getVerticalScrollValue(){return this.scrollTop}setVerticalScrollValue(e){this.scrollTop=e}clearRows(){const e=this;e.dataSource=new Smart.DataAdapter({dataSource:[]}),e.rowHierarchy=null,e._visibleRows=null,e.__viewRows=null,e.rows.canNotify=!1,e.rows.length=0,e.rows.canNotify=!0,e.clearSelection(),e._refresh()}isEmpty(){const e=this;return!!(null===e.dataSource||e.dataSource&&e.dataSource.dataFields&&0===e.dataSource.length&&0===e.dataSource.dataSource.length&&!e.dataSource.virtualDataSource)}setRowStyle(e,t){const o=this,a=o.rowById[e];a&&(a.style=t,o._recycle(!1,!0))}setCellStyle(e,t,o){const a=this,l=a.rowById[e];if(l){const e=l.getCell(t);if(e){const t=e.canNotify;if(e.canNotify=!1,o)for(let t in o)void 0!==e[t]&&(e[t]=o[t]);else e.background=null,e.color=null,e.fontSize=null,e.fontFamily=null,e.fontWeight=null,e.textDecoration=null,e.fontStyle=null;e.canNotify=t,a._recycle(!1,!0)}}}dataBind(){const e=this;if(delete e.__autoRowHeight,e._virtualOnExpandCache=[],e._cellsMerge=[],e._cellStyles=[],null===e.dataSource||e.dataSource&&e.dataSource.dataFields&&0===e.dataSource.length&&0===e.dataSource.dataSource.length&&!e.dataSource.virtualDataSource)e.clearRows();else if(Array.isArray(e.dataSource))if(e.dataSourceSettings.dataFields&&e.dataSourceSettings.dataFields.length>0)e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource,dataSourceType:e.dataSourceSettings.dataSourceType,dataFields:e.dataSourceSettings.dataFields,keyDataField:e.dataSourceSettings.keyDataField,parentDataField:e.dataSourceSettings.parentDataField,childrenDataField:e.dataSourceSettings.childrenDataField,groupBy:e.dataSourceSettings.groupBy||e.grouping.groupBy,mapChar:e.dataSourceSettings.mapChar,root:e.dataSourceSettings.root,record:e.dataSourceSettings.record,autoGenerateColumns:e.autoGenerateColumns,id:e.dataSourceSettings.id,virtualDataSource:e.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:e.dataSourceSettings.virtualDataSourceOnExpand});else if(e.columns&&e.columns.length){let t=[];for(let o=0;o<e.columns.length;o++){const a=e.columns[o];t.push({name:a.dataField,dataType:a.dataType||"string"})}e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource,dataFields:t,dataSourceType:e.dataSourceSettings.dataSourceType,keyDataField:e.dataSourceSettings.keyDataField,parentDataField:e.dataSourceSettings.parentDataField,childrenDataField:e.dataSourceSettings.childrenDataField,groupBy:e.dataSourceSettings.groupBy||e.grouping.groupBy,mapChar:e.dataSourceSettings.mapChar,root:e.dataSourceSettings.root,record:e.dataSourceSettings.record,autoGenerateColumns:e.autoGenerateColumns,id:e.dataSourceSettings.id,virtualDataSource:e.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:e.dataSourceSettings.virtualDataSourceOnExpand})}else e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource});const t=e._filters,o=e._sortedColumns;if(e.clearSort(),e.filtering.filterRow)for(let t=0;t<e.columns.length;t++)e.columns[t]._filterEditorInitialized=!1;for(let t=0;t<e.columns.length;t++)delete e.columns[t]._cellsCachedValues;e._initColumns&&0===e._initColumns.length&&(e.columns=[],e._renderColumns(!0)),e._renderRows(),"virtual"===e.scrolling||e.paging.enabled&&e.dataSource&&e.dataSource.virtualDataSource||e.dataSource&&e.dataSource.virtualDataSource?e._virtualDataRequest("dataBind"):e.paging.enabled&&(!e.dataSource||e.dataSource&&!e.dataSource.url)&&e._refreshPagesCount(),o&&e._refreshSort(o),t&&t.length>0&&(e._filters=null,e.refreshFilters())}refresh(e){const t=this;t.isInitialized&&(e&&(t._initializeRows(),t._initializeRowElements()),t._refresh(),t._refreshSummary())}refreshView(){this._recycle()}beginUpdate(){const e=this;e._isUpdating||(e._isUpdating=0),e._isUpdating++}endUpdate(e,t){const o=this;o._isUpdating--,o._isUpdating<0&&(o._isUpdating=0),!1!==e?o.refresh():!1!==t&&o.refreshView()}}),Smart.Grid.Extend=function(e){if(!e)return;const t=Object.getOwnPropertyNames(e.prototype);for(let o in t){const a=t[o];"constructor"!==a&&(Smart.Grid.prototype[a]=e.prototype[a])}},Smart.Grid.Extend(Smart.Utilities.Grid.Resize),Smart.Grid.Extend(Smart.Utilities.Grid.Reorder),Smart.Grid.Extend(Smart.Utilities.Grid.Pager),Smart.Grid.Extend(Smart.Utilities.Grid.Filter),Smart.Grid.Extend(Smart.Utilities.Grid.Sort),Smart.Grid.Extend(Smart.Utilities.Grid.Menu),Smart.Grid.Extend(Smart.Utilities.Grid.Select),Smart.Grid.Extend(Smart.Utilities.Grid.Edit),Smart.Grid.Extend(Smart.Utilities.Grid.Dialog),Smart.Grid.Extend(Smart.Utilities.Grid.Group),Smart.Grid.Extend(Smart.Utilities.Grid.Tree),Smart.Grid.Extend(Smart.Utilities.Grid.Export),Smart.Grid.Extend(Smart.Utilities.Grid.Chart),Smart.Grid.Extend(Smart.Utilities.Grid.View),Smart.Grid.Cell=Smart.Utilities.Grid.Cell,Smart.Grid.Row=Smart.Utilities.Grid.Row,Smart.Grid.Column=Smart.Utilities.Grid.Column;
|
|
65
|
+
Smart("smart-grid",class extends Smart.ScrollViewer{static get properties(){return{appearance:{value:{alternationStart:{value:0,type:"int"},alternationEnd:{value:0,type:"int"},alternationCount:{value:0,type:"int"},allowHover:{value:!1,type:"boolean",defaultReflectToAttribute:!0},allowHeaderHover:{value:!0,type:"boolean",defaultReflectToAttribute:!0},allowRowToggleAnimation:{value:!1,type:"boolean"},allowRowDetailToggleAnimation:{value:!1,type:"boolean"},allowSortAnimation:{value:!1,type:"boolean"},allowColumnLabelAnimation:{value:!0,type:"boolean"},allowCheckBoxesSelectionAnimation:{value:!0,type:"boolean"},allowColumnMenuAnimation:{value:!0,type:"boolean"},allowColumnSortButtonAnimation:{value:!0,type:"boolean"},allowColumnActionButtonAnimation:{value:!0,type:"boolean"},allowColumnFilterButtonAnimation:{value:!0,type:"boolean"},allowColumnStickyPosition:{value:!1,type:"boolean"},autoShowColumnSortButton:{value:!0,type:"boolean"},autoShowColumnActionButton:{value:!0,type:"boolean"},autoGenerateRowLabelMode:{value:"number",type:"string"},autoGenerateColumnLabelMode:{value:"letter",type:"string"},autoShowColumnFilterButton:{value:!0,type:"boolean"},displayLoadingIndicator:{value:!1,type:"boolean"},loadingIndicatorPlaceholder:{value:"Loading...",type:"string"},placeholder:{value:"No Rows",type:"string"},sortAnimationDuration:{value:500,type:"number"},showRowHeader:{value:!1,type:"boolean"},showRowStatus:{value:!1,type:"boolean"},showRowHeaderNumber:{value:!1,type:"boolean"},showRowHeaderEditIcon:{value:!0,type:"boolean",defaultReflectToAttribute:!0},showRowHeaderDragIcon:{value:!1,type:"boolean"},showColumnHeaderDragIcon:{value:!1,type:"boolean"},showRowHeaderSelectIcon:{value:!1,type:"boolean"},showRowHeaderFocusIcon:{value:!1,type:"boolean"},showColumnHeaderLines:{value:!0,type:"boolean",defaultReflectToAttribute:!0},showColumnLines:{value:!0,type:"boolean",defaultReflectToAttribute:!0},showRowLines:{value:!0,type:"boolean",defaultReflectToAttribute:!0},showFilterColumnBackground:{value:!1,type:"boolean"},showSortColumnBackground:{value:!1,type:"boolean"},showFrozenColumnBackground:{value:!0,type:"boolean"},showFrozenRowBackground:{value:!0,type:"boolean"},showColumnSortButton:{value:!0,type:"boolean"},showColumnFilterButton:{value:!0,type:"boolean"},showColumnDescriptionButton:{value:!1,type:"boolean"},showColumnIcon:{value:!1,type:"boolean"},showColumnCustomButton:{value:!1,type:"boolean"},showColumnActionButton:{value:!0,type:"boolean"},showColumnGroupsInColumnPanel:{value:!1,type:"boolean"},showTooltips:{value:!1,type:"boolean"},showTooltipsOverflow:{value:!0,type:"boolean"},showResizeTooltips:{value:!0,type:"boolean"},showHorizontalScrollBarOnFixedColumns:{value:!1,type:"boolean"},showVerticalScrollBarOnFixedColumns:{value:!1,type:"boolean"},showTreeRowHeader:{value:!1,type:"boolean"},showTodayDateAsString:{value:!0,type:"boolean"}},type:"object"},behavior:{value:{allowColumnAutoSizeOnDoubleClick:{value:!0,type:"boolean"},allowRowAutoSizeOnDoubleClick:{value:!0,type:"boolean"},allowColumnReorder:{value:!1,type:"boolean"},allowColumnFreeze:{value:!0,type:"boolean"},allowRowReorder:{value:!1,type:"boolean"},doubleClickTimingDelay:{value:300,type:"number"},columnResizeMode:{value:"none",type:"string",allowedValues:["none","split","growAndShrink"]},rowResizeMode:{value:"none",type:"string",allowedValues:["none","split","growAndShrink"]}},type:"object"},layout:{value:{allowCellsWrap:{value:!1,type:"boolean"},allowCellsWrapShortcut:{value:!0,type:"boolean"},autoGenerateColumnWidth:{value:null,type:"number?"},autoSizeNewColumn:{value:!1,type:"boolean",reflectToAttribute:!1},autoSizeNewColumnMinWidth:{value:180,type:"number",reflectToAttribute:!1},columnWidth:{value:null,type:"any",reflectToAttribute:!1},columnHeight:{value:null,type:"any",reflectToAttribute:!1},columnMinHeight:{value:30,type:"any",reflectToAttribute:!1},isDirty:{value:!1,type:"boolean"},loadingIndicatorPosition:{value:"center",allowedValues:["bottom","center","top"],type:"string"},rowMinHeight:{value:30,type:"number"},rowHeight:{value:null,type:"any",reflectToAttribute:!1}},type:"object"},dataExport:{value:{header:{value:!0,type:"boolean"},filterBy:{value:null,type:"object"},groupBy:{value:null,type:"object"},style:{value:null,type:"object"},fileName:{value:"smartGrid",type:"string?"},pageOrientation:{value:"portrait",type:"string"},expandChar:{value:"+",type:"string"},collapseChar:{value:"-",type:"string"},view:{value:!1,type:"boolean"},viewStart:{value:null,type:"number?"},viewEnd:{value:null,type:"number?"},rowIds:{value:null,type:"array?"}},type:"object"},clipboard:{value:{enabled:{value:!0,type:"boolean"},autoFillMode:{value:"copy",allowedValues:["none","copy","fillSeries"],type:"string"},onPasteValue:{value:null,type:"any"}},type:"object"},conditionalFormatting:{value:null,type:"array?",reflectToAttribute:!1},columns:{value:[],type:"any",reflectToAttribute:!1},contextMenu:{value:{selector:{value:"",type:"string"},enabled:{value:!1,type:"boolean"},width:{value:150,type:"number"},height:{value:null,type:"number?"},dataSource:{value:{contextMenuItemDelete:{value:{command:{value:"contextMenuItemDeleteCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"},icon:{value:"smart-icon-delete",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},contextMenuItemEdit:{value:{command:{value:"contextMenuItemEditCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"},icon:{value:"smart-icon-mode-edit",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},contextMenuItemCustom:{value:{command:{value:null,type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"boolean"},icon:{value:"smart-icon-settings",type:"string"},label:{value:"",type:"string"}},type:"object",reflectToAttribute:!1}},type:"object",reflectToAttribute:!1}},type:"object",reflectToAttribute:!1},columnMenu:{value:{autoClose:{value:!0,type:"boolean"},dataSource:{value:{columnMenuCustomizeType:{value:{command:{value:"customizeTypeCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-settings",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemClone:{value:{command:{value:"duplicateCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-duplicate",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemInsertLeft:{value:{command:{value:"insertLeftCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-insert-left",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemInsertRight:{value:{command:{value:"insertRightCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-insert-right",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemSortAsc:{value:{command:{value:"sortAscCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-sort-name-up",type:"string"},iconAlt:{value:"smart-icon-sort-number-up",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemSortDesc:{value:{command:{value:"sortDescCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-sort-name-down",type:"string"},iconAlt:{value:"smart-icon-sort-number-down",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemRemoveSort:{value:{command:{value:"removeSortCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-cancel-circled",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemSort:{value:{command:{value:"addSortCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-sort",type:"string"},iconAlt:{value:"smart-icon-sort",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemFilter:{value:{command:{value:"addFilterCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-add-filter",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemRemoveFilter:{value:{command:{value:"removeFilterCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-cancel-circled",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemGroupBy:{value:{command:{value:"groupByCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-group",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemRemoveGroupBy:{value:{command:{value:"removeGroupByCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:"auto",type:"any"},icon:{value:"smart-icon-ungroup",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemHide:{value:{command:{value:"hideColumnCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-visibility-off",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1},columnMenuItemDelete:{value:{command:{value:"deleteColumnCommand",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"any"},icon:{value:"smart-icon-delete",type:"string"},label:{value:"{{messages}}",type:"string"}},type:"object",reflectToAttribute:!1}},type:"object",reflectToAttribute:!1},visible:{value:!1,type:"boolean"},enabled:{value:!0,type:"boolean"},width:{value:250,type:"number"},height:{value:null,type:"number?"}},type:"object",reflectToAttribute:!1},columnGroups:{value:[],type:"array",reflectToAttribute:!1},charting:{value:{appendTo:{value:null,type:"any"},enabled:{value:!1,type:"boolean"},colorScheme:{value:"scheme01",type:"string"},description:{value:"",type:"string"},dialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:400,type:"any"},width:{value:400,type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!0,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"},formatSettings:{value:{},type:"object"}},type:"object"},view:{value:"grid",allowedValues:["grid","kanban"],type:"string"},currentUser:{value:null,type:"any"},dataSource:{value:null,type:"any",reflectToAttribute:!1},dataSourceMap:{value:{checklist:"checklist",color:"color",comments:"comments",dueDate:"dueDate",id:"id",priority:"priority",progress:"progress",startDate:"startDate",status:"status",swimlane:"swimlane",tags:"tags",text:"text",description:"description",userId:"userId",history:"history",createdUserId:"createdUserId",createdDate:"createdDate",updatedUserId:"updatedUserId",updatedDate:"updatedDate"},type:"any",reflectToAttribute:!1},dataSourceSettings:{value:{autoGenerateColumns:{value:!1,type:"boolean"},sanitizeHTML:{value:"blackList",allowedValues:["all","blackList","none"],type:"string"},root:{value:"",type:"string"},record:{value:"",type:"string"},keyDataField:{value:"",type:"string"},parentDataField:{value:"",type:"string"},childrenDataField:{value:"",type:"string"},groupBy:{value:[],type:"array"},dataFields:{value:[],type:"array"},mapChar:{value:".",type:"string"},id:{value:"",type:"string"},virtualDataSource:{value:null,type:"any"},virtualDataSourceOnExpand:{value:null,type:"any"}},type:"object"},uploadSettings:{value:{url:{value:"",type:"string",reflectToAttribute:!1},removeUrl:{value:"",type:"string",reflectToAttribute:!1},existsUrl:{value:"",type:"string",reflectToAttribute:!1},name:{value:"userfile[]",type:"string",reflectToAttribute:!1},uploadMaxCount:{value:5,type:"number",reflectToAttribute:!1},uploadMaxSize:{value:2097152,type:"number",reflectToAttribute:!1},data:{value:null,type:"object",reflectToAttribute:!1},onUploadStarted:{value:null,type:"any",reflectToAttribute:!1},onUploadCompleted:{value:null,type:"any",reflectToAttribute:!1},onUploadRemove:{value:null,type:"any",reflectToAttribute:!1},onUploadError:{value:null,type:"any",reflectToAttribute:!1},onChange:{value:null,type:"any",reflectToAttribute:!1},onProgress:{value:null,type:"any",reflectToAttribute:!1},onAbort:{value:null,type:"any",reflectToAttribute:!1},onError:{value:null,type:"any",reflectToAttribute:!1},onSetHeaders:{value:null,type:"any",reflectToAttribute:!1},singleFilePost:{value:!0,type:"boolean",reflectToAttribute:!1}},reflectToAttribute:!1,type:"object"},grouping:{value:{enabled:{value:!1,type:"boolean",reflectToAttribute:!1},allowCollapse:{value:!1,type:"boolean",reflectToAttribute:!1},autoHideGroupColumn:{value:!1,type:"boolean",reflectToAttribute:!1},autoExpandAll:{value:!1,type:"boolean",reflectToAttribute:!1},autoExpandToLevel:{value:0,type:"number",reflectToAttribute:!1},onGroupDefaultExpanded:{value:null,type:"any",reflectToAttribute:!1},expandMode:{value:"buttonClick",type:"string",allowedValues:["buttonClick","rowClick"],reflectToAttribute:!1},renderMode:{type:"string",value:"advanced",allowedValues:["basic","compact","advanced","multipleColumns"]},groupBy:{value:[],type:"array",reflectToAttribute:!1},groupRowHeight:{value:50,type:"any",reflectToAttribute:!1},toggleButtonIndent:{value:27,type:"number",reflectToAttribute:!1},groupIndent:{value:27,type:"number",reflectToAttribute:!1},groupBar:{value:{visible:{value:!1,type:"boolean",reflectToAttribute:!1},allowColumnDragDrop:{value:!0,type:"boolean",reflectToAttribute:!0},allowColumnCloseButtons:{value:!0,type:"boolean",reflectToAttribute:!0}},type:"object"},formatFunction:{value:null,type:"any",reflectToAttribute:!1},summaryRow:{value:{inline:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"}},type:"object"}},type:"object"},messages:{extend:!0,value:{en:{invalidColumnProperty:'{{elementType}}: Invalid property name "{{propertyName}}" set for Column: "{{type}}"',invalidRowProperty:'{{elementType}}: Invalid property name "{{propertyName}}" set for Row"',invalidCellValue:'Invalid cell value "{{value}}", Validation rule: "{{validationRule}}"',invalidValue:"Invalid value",invalidMinValue:"{{value}} above {{min}} must be filled out",invalidMaxValue:"{{value}} below {{max}} must be filled out",invalidMinLengthValue:"{{value}} is shorter than the minimum length of {{min}} characters",invalidMaxLengthValue:"{{value}} is longer than the maximum length of {{max}} characters",requiredValue:"{{value}} must be filled out",frozenColumns:"{{elementType}}: To Pin/Freeze a column group, all columns within it should be frozen.",frozenRows:"{{elementType}}: To Pin/Freeze a special cell, all rows within it should be frozen.",columnGroups:"{{elementType}}: Please, check the initialization of the smartGrid's columns array. The columns in a column group are expected to be siblings in the columns array.",viewGrid:"Grid",viewKanban:"Kanban",kanbanNone:"Blank",kanbanDescription:'Start from a project board with columns generated by the "{{column}}" column options.',kanbanNoneDescription:"Create a new column and start from scratch with a completely blank project board. You can add columns and configure settings yourself.",kanbanBasic:"Template",kanbanBasicDescription:'Create a new column and start from a project board with columns for "To do", "in progress" and "Done".',uncategorized:"Uncategorized",toDo:"To do",inProgress:"In progress",done:"Done",min:"Min: {{value}}",max:"Max: {{value}} ",sum:"Sum: {{value}} ",avg:"Avg: {{value}} ",cells:"{{value}} cells selected",rows:"{{value}} rows",oneRow:"1 row",unique:"Unique: {{value}}",blank:"Empty: {{value}}",filled:"Filled: {{value}}",summary:"Summary",countSummary:"Count",minSummary:"Min",maxSummary:"Max",avgSummary:"Avg",blankSummary:"Empty",uniqueSummary:"Unique",filledSummary:"Filled",sumSummary:"Sum",completed:"Tasks Completed: {{value}}",count:"Count: {{value}} ",pagerFirstButton:"First",pagerLastButton:"Last",pagerPreviousButton:"Previous",pagerNextButton:"Next",pagerNavigateToLabel:"Go to:",pagerPageSizeLabel:"Show:",pagerNavigateToInputPlaceholder:"",pagerEllipsis:"...",pagerSummaryString:"of",pagerSummaryPrefix:"of",pagerSummarySuffix:"",columnMenuCustomizeType:"Column settings",columnMenuItemClone:"Clone column",columnMenuItemInsertLeft:"Insert left",columnMenuItemInsertRight:"Insert right",columnMenuItemSortAsc:"Sort {{mode}}",columnMenuItemSortDesc:"Sort {{mode}}",columnMenuItemRemoveSort:"Remove Sort",columnMenuItemFilter:"Filter column",columnMenuItemSort:"Sort column",columnMenuItemRemoveFilter:"Remove Filter",columnMenuItemGroupBy:"Group column",columnMenuItemRemoveGroupBy:"Remove Group",columnMenuItemHide:"Hide column",columnMenuItemShow:"Show column",columnMenuItemDelete:"Delete column",columnResizeTooltip:"width: {{value}}px",rowResizeTooltip:"height: {{value}}px",commandBarAddRow:"Add",commandBarDeleteRow:"Delete row",commandBarBatchRevert:"Revert",commandBarBatchSave:"Save",commandBarFilter:"Filter",commandBarSort:"Sort",commandBarSearch:"Search",commandBarCustomize:"Customize",commandBarGroup:"Group",commandColumnEdit:"Edit",commandColumnDelete:"Delete",commandColumnCancel:"Cancel",commandColumnUpdate:"Update",contextMenuItemDelete:"Delete row",contextMenuItemEditCell:"Edit cell",contextMenuItemEditRow:"Edit row",commandColumnMenu:"",expandRow:"Expand row (Shift + Enter)",expandRowComments:"Expand row and see {{value}} comments",collapseRow:"Collapse row",addNewRow:"Click here to add a new row",addNewRowAlt:"<span>Add new empty row</span> <code>Shift</code> + <code>Space</code>",addNewRowAltSmall:"Add new empty row",addNewColumn:"Click here to add a new column",dialogChartHeader:"{{value}} Chart",dialogRowDetailHeader:"Row Id: {{value}}",dialogDescriptionHeader:"Column: {{value}}",dialogRowDetailButtonConfirm:"OK",dialogRowDetailButtonCancel:"CANCEL",dialogEditHeaderDisabled:"Record with Id: {{value}}",dialogEditHeader:"Edit Record with Id: {{value}}",dialogExpandRowHeader:"Edit Record",dialogAddButtonConfirm:"ADD",dialogAddButtonCancel:"CANCEL",dialogEditButtonConfirm:"OK",dialogEditButtonCancel:"CANCEL",dialogFilterButtonConfirm:"FILTER",dialogFilterButtonCancel:"CLEAR",dialogDeleteButtonConfirm:"DELETE",dialogDeleteButtonCancel:"CANCEL",dialogEditColumn:"Column: {{value}}",dialogNewColumn:"New column",dialogAddColumn:"Add Column",dialogAddColumnStatus:"Choose a grouping column",dialogAddColumnStatusDescription:"Represent the status of each record",dialogAddColumnStatusNotes:"Your records will be grouped based on this column",dialogAddHeader:"Add Row",dialogDeleteHeader:"Delete Row",dialogFilterHeader:"Filter by",dialogFilterMinLabel:"Min",dialogFilterMaxLabel:"Max",dialogImageHeader:"Image",dialogImageDrop:"or drag and drop image(s) to upload",dialogImageUpload:"Select Image(s) to Upload",dialogImageURL:"You can also provide the URL to an image",dialogImageURLUpload:"Upload",dialogImageLink:"Link (URL)",dialogImageDevice:"My Device",dialogImageSize:'No image currently added. The "{{value}}" image cannot be uploaded. Maximum image size is {{fileSize}}.',dialogImageCount:'The following images cannot be added "{{files}}". Maximum images allowed is {{fileCount}}.',dialogImageFileUpload:"No images currently selected for upload",dialogAttachmentHeader:"Files",dialogAttachmentDrop:"or drag and drop files(s) to upload",dialogAttachmentUpload:"Select File(s) to Upload",dialogAttachmentURL:"You can also provide the URL to an Attachment",dialogAttachmentURLUpload:"Upload",dialogAttachmentLink:"Link (URL)",dialogAttachmentDevice:"My Device",dialogAttachmentSize:'No file currently added. The "{{value}}" file cannot be uploaded. Maximum files size is {{fileSize}}.',dialogAttachmentCount:'The following files cannot be added "{{files}}". Maximum files allowed is {{fileCount}}.',dialogAttachmentFileUpload:"No files currently selected for upload",dialogAddColumnName:"Name",dialogAddColumnNameInfo:"Name of the column. The name of the column will be displayed in the column header.",dialogAddColumnDescription:"Description",dialogAddColumnDescriptionInfo:"Description of the column. When the description is set, an icon will be displayed in the column header. A tooltip with the description will be displayed when you point at the icon.",dialogAddColumnNamePlaceholder:"Column name (optional)",dialogAddColumnDescriptionPlaceholder:"Describe this column (optional)",dialogAddColumnType:"Type",dialogAddColumnTypeInfo:'Type of the data in the column. Unlike a spreadsheet, Columns have specific "types" that allow you to store rich content in each record. For example, a table can contain records (rows) with images, long texts, checkboxes.',dialogAddColumnTypeText:"Text",dialogAddColumnTypeMultilineText:"Multiline text",dialogAddColumnTypeImage:"Image",dialogAddColumnTypeNumber:"Number",dialogAddColumnTypeSelect:"Select",dialogAddColumnTypeMultipleSelect:"Multiple Select",dialogAddColumnTypeDate:"Date",dialogAddColumnTypeCheckBox:"CheckBox",dialogAddColumnTypeCreatedTime:"Created time",dialogAddColumnTypeLastUpdatedTime:"Last modified time",dialogAddColumnTypeCreatedBy:"Created by",dialogAddColumnTypeLastUpdatedBy:"Last modified by",dialogAddColumnTypeCollaborator:"Collaborator",dialogAddColumnTypeSlider:"Slider",dialogAddColumnTypeAutoNumber:"Auto Number",dialogAddColumnTypeURL:"URL",dialogAddColumnTypeEmail:"Email",dialogAddColumnTypePassword:"Password",dialogAddColumnTypePhone:"Phone",dialogAddColumnTypeStartDate:"Start Date",dialogAddColumnTypeDueDate:"Due Date",dialogAddColumnTypeProgress:"Progress",dialogAddColumnTypePriority:"Priority",dialogAddColumnTypeDescription:"Description",dialogAddColumnTypeTags:"Tags",dialogAddColumnTypeName:"Name",dialogAddColumnTypeColor:"Color",dialogAddColumnTypeChecklist:"Checklist",dialogAddColumnTypeAssigned:"Assignee",dialogAddColumnTypeAttachment:"Attachment",dialogAddColumnDateFormat:"Date format",dialogAddColumnDateFormatInfo:"Choose the dates display format",dialogAddColumnDateFormatShort:"Short",dialogAddColumnDateFormatLong:"Long",dialogAddColumnDateFormatEU:"EU",dialogAddColumnDateFormatISO:"ISO",dialogAddColumnDateFormatAS:"AS",dialogAddColumnDateFormatFull:"Full",dialogAddColumnDateFormatSlash:"Slash",dialogAddColumnDateFormatHyphen:"Hyphen",dialogAddColumnDateFormatDot:"Dot",dialogAddColumnTimeFormat:"Time format",dialogAddColumnTimeFormatInfo:"Choose the time display format",dialogAddColumnTimeFormatHour:"hour",dialogAddColumnAllowTimeFormat:"Include a time field",dialogAddColumnCustomDateSeparator:"Set a custom separator",dialogAddColumnNumberFormat:"Number format",dialogAddColumnNumberFormatInfo:"Choose the number display format",dialogAddColumnNumberFormatInteger:"Integer",dialogAddColumnNumberFormatNumber:"Number",dialogAddColumnNumberFormatPercent:"Percent",dialogAddColumnNumberFormatPercentRounded:"Percent(rounded)",dialogAddColumnNumberFormatScientific:"Scientific",dialogAddColumnNumberFormatEngineering:"Engineering",dialogAddColumnNumberFormatAccounting:"Accounting",dialogAddColumnNumberFormatUnit:"Unit",dialogAddColumnNumberFormatUnitInfo:"Units of measurement",dialogAddColumnNumberFormatUnitAcre:"Acre",dialogAddColumnNumberFormatUnitCelsius:"Celsius",dialogAddColumnNumberFormatUnitFahrenheit:"Fahrenheit",dialogAddColumnNumberFormatUnitPercent:"Percent",dialogAddColumnNumberFormatUnitDegree:"Degree",dialogAddColumnNumberFormatUnitMegaByte:"Mega byte",dialogAddColumnNumberFormatUnitCentimeter:"Centimeter",dialogAddColumnNumberFormatUnitMeter:"Meter",dialogAddColumnNumberFormatUnitKilometer:"Kilometer",dialogAddColumnNumberFormatUnitMile:"Mile",dialogAddColumnNumberFormatUnitKilogram:"Kilogram",dialogAddColumnNumberFormatUnitPound:"Pound",dialogAddColumnNumberFormatUnitLiter:"Liter",dialogAddColumnNumberFormatUnitGallon:"Gallon",dialogAddColumnNumberFormatUnitSecond:"Second",dialogAddColumnNumberFormatUnitMinute:"Minute",dialogAddColumnNumberFormatUnitHour:"Hour",dialogAddColumnNumberFormatUnitDay:"Day",dialogAddColumnNumberFormatUnitWeek:"Week",dialogAddColumnNumberFormatUnitMonth:"Month",dialogAddColumnNumberFormatUnitYear:"Year",dialogAddColumnNumberFormatCurrency:"Currency",dialogAddColumnNumberFormatCurrencyRounded:"Currency(rounded)",dialogAddColumnNumberFormatCurrencyInfo:"Choose the currency display format",dialogAddColumnMinLength:"Minimum length",dialogAddColumnMinLengthInfo:"Minimum text length",dialogAddColumnMaxLength:"Maximum length",dialogAddColumnMaxLengthInfo:"Maximum text length",dialogAddColumnMinValue:"Minimum value",dialogAddColumnMinValueInfo:"Minimum number",dialogAddColumnMaxValue:"Maximum value",dialogAddColumnMaxValueInfo:"Maximum number",dialogAddColumnMinDate:"Minimum date",dialogAddColumnMinDateInfo:"Minimum date",dialogAddColumnMaxDate:"Maximum date",dialogAddColumnMaxDateInfo:"Maximum date",dialogAddColumnColorItems:"Color items",dialogAddColumnListItems:"List items",dialogAddColumnAlign:"Align",dialogAddColumnAlignLeft:"Left",dialogAddColumnAlignRight:"Right",dialogAddColumnAlignCenter:"Center",dialogAddColumnAlignInfo:"Table cells text alignment",dialogAddColumnResizable:"Resizable",dialogAddColumnResizableInfo:"Select if you want to make the column resizable",dialogAddColumnRequired:"Required",dialogAddColumnRequiredInfo:"Select if you want to make the column required",dialogAddColumnSortable:"Sortable",dialogAddColumnSortableInfo:"Select if you want to sort by this column",dialogAddColumnFilterable:"Filterable",dialogAddColumnFilterableInfo:"Select if you want to filter by this column",dialogAddColumnEditable:"Editable",dialogAddColumnEditableInfo:"Select if you want to edit by this column",dialogAddColumnMultipleCollaborators:"Multiple Collaborators",dialogAddColumnMultipleCollaboratorsInfo:"Select if you want to allow multiple collaborators",dialogAddColumnCheckItems:"Show Checkbox",priority_low:"Low",priority_average:"Average",priority_high:"High",priority_critical:"Critical",bold:"Bold",fontStyle:"Font Style",italic:"Italic",send:"Send",copy:"copy",status:"Status",underline:"Underline",comments:"Comments",comment:"Comment",noComments:"No comments to this record yet",guestUser:"Guest",background:"Background",starred:"Starred",resetFormat:"Reset Format",notStarred:"Not starred",color:"Color",coloredItems:"Colored items",conditionalFormatting:"Conditional Formatting",groupBarLabel:"Drag a column header here to group by that column",dialogDeleteContent:"Are you sure you want to delete this row?",detailsTab:"Details",commentsTab:"Comments",historyTab:"History",historyEvent:"Event",historyAuthor:"Author",historyDetails:"Details",range:'Changed {{column}} from "{{oldValue}}" to "{{newValue}}"',nullRange:'Changed {{column}} to "{{newValue}}"',rowCreated:"Row Created",propertyUpdated:'"{{value}}" updated',propertyRemoved:'"{{value}}" removed',dropImages:"Drop images here",addImages:"Add images",dropFiles:"Drop files here",addFiles:"Add files",unassigned:"Unassigned",historyDate:"Date",calendar:{"/":"/",":":":",firstDay:0,days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December",""],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""]},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],currencySymbol:"$",currency:"USD",currencySymbolPosition:"before",decimalSeparator:".",thousandsSeparator:","},CONTAINS:"Contains",DOES_NOT_CONTAIN:"Does not contain",ENDS_WITH:"Ends with",EQUAL:"Equal",GREATER_THAN:"Greater than",GREATER_THAN_OR_EQUAL:"Greater than or equal",LESS_THAN:"Less than",LESS_THAN_OR_EQUAL:"Less than or equal",NOT_EQUAL:"Not equal",RANGE:"Range",CLEAR_FILTER:"Clear Filter",STARTS_WITH:"Starts with",addFilter:"+ Add filter",and:"And",apply:"Apply",applyOnce:"Apply once",booleanFirst:"☐",booleanLast:"☑",cancel:"Cancel",CONTAINS_CASE_SENSITIVE:"Contains (case sensitive)",dateFirst:"1",dateLast:"9",DOES_NOT_CONTAIN_CASE_SENSITIVE:"does not contain (case sensitive)",EMPTY:"empty",ENDS_WITH_CASE_SENSITIVE:"ends with (case sensitive)",EQUAL_CASE_SENSITIVE:"equal (case sensitive)",filter:"Filter",customize:"Hide columns",customizeOne:"1 hidden column",customizeHidden:"{{n}} hidden columns",filteredByMultiple:"{{n}} filters",filteredByOne:"1 filter",filterValuePlaceholder:"Value",find:"Find a field",findInView:"Find in view",firstBy:"Sort by",found:"{{nth}} of {{n}}",from:"from",noFilters:"No filters applied",noResults:"No results",noSorting:"No sorting applied",NOT_EMPTY:"not empty",NOT_NULL:"not null",NULL:"null",numberFirst:"1",numberLast:"9",ok:"OK",or:"Or",pickAnother:"Pick another field to sort by",maintainSort:"Maintain sort",sort:"Sort",group:"Group",sortedByMultiple:"Sorted by {{n}} columns",sortedByOne:"Sorted by 1 column",STARTS_WITH_CASE_SENSITIVE:"starts with (case sensitive)",stringFirst:"A",stringLast:"Z",thenBy:"then by",where:"Where",collapseAll:"Collapse all",expandAll:"Expand all",noGrouping:"No grouping",groupedByMultiple:"{{n}} groups",groupedByOne:"1 group",groupedBy:"Grouped by {{column}}",deleteByMultiple:"Delete {{n}} rows",deleteByOne:"Delete 1 row",download:"Download",firstByGroup:"Group by",expandRecord:"Expand row",pickAnotherGroupBy:"Pick another field to group by",add:"Add condition",all:"All columns",between:"Between",close:"Close",column:"Column:",condition:"Condition:",equal:"equal",fontFamily:"Font family:",fontSize:"Font size:",format:"Format:",greaterThan:"greater than",highlight:"Highlight",lessThan:"less Than",notEqual:"not equal",remove:"Remove condition",secondValue:"Second value:",text:"Text",value:"Value:",addCondition:"Add Condition",addGroup:"Add Group",blanks:"(Blanks)",clear:"Clear",contains:"contains",containsCaseSensitive:"contains (case sensitive)",dateTabLabel:"DATE",doesNotContain:"does not contain",doesNotContainCaseSensitive:"does not contain (case sensitive)",empty:"empty",endsWith:"ends with",endsWithCaseSensitive:"ends with (case sensitive)",equalCaseSensitive:"equal (case sensitive)",greaterThanOrEqual:"greater than or equal",lessThanOrEqual:"less than or equal",mismatchedProperties:'smartFilterPanel: The "filterType" and the data type of the selected "dataField" are mismatched.',missingProperty:'smartFilterPanel: When mode is \'excel\', either "data" and "dataField" or "dataSource" of type Array have to be set.',notEmpty:"not empty",notNull:"not null",null:"null ",placeholderBoolean:"Select value",placeholderDate:"Enter date",placeholderNumber:"Enter number",placeholderTime:"Enter time",placeholderValue:"Enter value",selectAll:"(Select All)",showRows:"Show rows where:",startsWith:"starts with",startsWithCaseSensitive:"starts with (case sensitive)",matchCase:"Match Case",timeTabLabel:"TIME",today:"Today",formatColumn:"Format Column",formating:"Conditional Formatting",reset:"Reset",filteredRecords:"All rows are filtered",duplicateCells:"Clone column cells and settings",duplicateSettings:"Clone column settings",views:"Views",noView:"No view",myView:"My views",saveView:"New view"}},type:"object"},onCellValue:{value:null,type:"any",reflectToAttribute:!1},onCellUpdate:{value:null,type:"any",reflectToAttribute:!1},onCellRender:{value:null,type:"any",reflectToAttribute:!1},onBeforeInit:{value:null,type:"any",reflectToAttribute:!1},onInit:{value:null,type:"any",reflectToAttribute:!1},onAfterInit:{value:null,type:"any",reflectToAttribute:!1},onKey:{value:null,type:"any",reflectToAttribute:!1},onRender:{value:null,type:"any",reflectToAttribute:!1},onLoad:{value:null,type:"any",reflectToAttribute:!1},onChartInit:{value:null,type:"any",reflectToAttribute:!1},onComment:{value:null,type:"any",reflectToAttribute:!1},onRowInit:{value:null,type:"any",reflectToAttribute:!1},onRowClass:{value:null,type:"any",reflectToAttribute:!1},onRowChange:{value:null,type:"any",reflectToAttribute:!1},onRowDetailInit:{value:null,type:"any",reflectToAttribute:!1},onRowDetailUpdated:{value:null,type:"any",reflectToAttribute:!1},onRowInserted:{value:null,type:"any",reflectToAttribute:!1},onRowRemoved:{value:null,type:"any",reflectToAttribute:!1},onRowUpdate:{value:null,type:"any",reflectToAttribute:!1},onRowUpdated:{value:null,type:"any",reflectToAttribute:!1},onRowStarred:{value:null,type:"any",reflectToAttribute:!1},onRowHistory:{value:null,type:"any",reflectToAttribute:!1},onRowStyle:{value:null,type:"any",reflectToAttribute:!1},onRowResize:{value:null,type:"any",reflectToAttribute:!1},onColumnInit:{value:null,type:"any",reflectToAttribute:!1},onColumnInserted:{value:null,type:"any",reflectToAttribute:!1},onColumnRemoved:{value:null,type:"any",reflectToAttribute:!1},onColumnResize:{value:null,type:"any",reflectToAttribute:!1},onColumnReorder:{value:null,type:"any",reflectToAttribute:!1},onColumnSummaryChange:{value:null,type:"any",reflectToAttribute:!1},onColumnUpdated:{value:null,type:"any",reflectToAttribute:!1},onColumnClone:{value:null,type:"any",reflectToAttribute:!1},onColumnChange:{value:null,type:"any",reflectToAttribute:!1},onCommand:{value:null,reflectToAttribute:!1,type:"any"},filtering:{value:{enabled:{value:!1,type:"boolean"},operator:{value:"and",type:"string"},filter:{value:[],type:"array",reflectToAttribute:!1},filterRow:{value:{visible:{value:!1,type:"boolean"},menuVisible:{value:!1,type:"boolean"},applyMode:{value:"auto",type:"string",allowedValues:["auto","click"]},autoApplyModeDelay:{value:500,type:"number"}},type:"object"},filterMenu:{value:{visible:{value:!0,type:"boolean"},buttons:{value:["cancel","clear","filter"],type:"array"},dataSource:{value:null,type:"any"},width:{value:250,type:"number"},height:{value:200,type:"number"},mode:{value:"default",allowedValues:["default","excel"],type:"string"},messages:{value:null,type:"object"}},type:"object"}},type:"object"},editing:{value:{allowRowHeaderEdit:{value:!1,type:"boolean"},allowColumnHeaderEdit:{value:!1,type:"boolean"},autoUpdateFilterAndSort:{value:!0,type:"boolean"},active:{value:!1,readonly:!0,type:"boolean"},enabled:{value:!1,type:"boolean"},batch:{value:!1,type:"boolean"},action:{value:"click",type:"string",allowedValues:["none","click","doubleClick"]},commandKeys:{value:{commandKeyCancel:{value:{command:"commandKeyCancelCommand",key:"Escape"},type:"object"},commandKeyUpdate:{value:{command:"commandKeyUpdateCommand",key:"Enter | Tab"},type:"object"}},type:"object"},commandBar:{value:{visible:{value:!1,type:"boolean"},position:{value:"near",allowedValues:["near","far","both"],type:"string"},displayMode:{value:"labelAndIcon",allowedValues:["label","icon","labelAndIcon"],type:"string"},dataSource:{value:{commandBarAddRow:{value:{command:{value:"commandBarAddRowCommand",type:"any"},icon:{value:"smart-icon-plus",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!1,type:"any"}},type:"object"},commandBarDeleteRow:{value:{command:{value:"commandBarDeleteRowCommand",type:"any"},icon:{value:"smart-icon-delete",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!1,type:"any"}},type:"object"},commandBarBatchSave:{value:{command:{value:"commandBarBatchSaveCommand",type:"any"},icon:{value:"smart-icon-ok-squared",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!0,type:"any"}},type:"object"},commandBarBatchRevert:{value:{command:{value:"commandBarBatchRevertCommand",type:"any"},icon:{value:"smart-icon-reload",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!0,type:"any"}},type:"object"}},type:"object"}},type:"object"},commandColumn:{value:{visible:{value:!1,type:"boolean"},inline:{value:!1,type:"boolean"},position:{value:"far",allowedValues:["near","far"],type:"string"},displayMode:{value:"icon",allowedValues:["label","icon","labelAndIcon"],type:"string"},dataSource:{value:{commandColumnMenu:{value:{command:{value:"commandColumnMenuCommand",type:"any"},icon:{value:"smart-icon-menu",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!1,type:"any"}},type:"object"},commandColumnEdit:{value:{command:{value:"commandColumnEditCommand",type:"any"},icon:{value:"smart-icon-mode-edit",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:"auto",type:"any"}},type:"object"},commandColumnDelete:{value:{command:{value:"commandColumnDeleteCommand",type:"any"},icon:{value:"smart-icon-delete",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!0,type:"any"}},type:"object"},commandColumnUpdate:{value:{command:{value:"commandColumnUpdateCommand",type:"any"},icon:{value:"smart-icon-ok-squared",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:"auto",type:"any"}},type:"object"},commandColumnCancel:{value:{command:{value:"commandColumnCancelCommand",type:"any"},icon:{value:"smart-icon-cancel-circled",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:"auto",type:"any"}},type:"object"},commandColumnRowMenu:{value:{command:{value:"commandColumnRowMenuCommand",type:"any",reflectToAttribute:!1},icon:{value:"smart-icon-ellipsis-vert",type:"string"},label:{value:"{{messages}}",type:"string"},visible:{value:!1,type:"any"}},type:"object"},commandColumnCustom:{value:{command:{value:"",type:"any"},icon:{value:"smart-icon-ellipsis-vert",type:"string"},label:{value:"",type:"string"},visible:{value:!1,type:"any"}},type:"object"}},type:"object"},width:{value:null,type:"number?"}},reflectToAttribute:!1,type:"object"},mode:{value:"cell",allowedValues:["cell","row"],type:"string"},addNewColumn:{value:{visible:{value:!1,type:"boolean"}},type:"object"},addNewRow:{value:{position:{value:"both",allowedValues:["near","far","both"],type:"string"},visible:{value:!1,type:"boolean"},autoEdit:{value:!0,type:"boolean"},autoCreate:{value:!1,type:"boolean"},autoSave:{value:!0,type:"boolean"},label:{value:"{{message}}",type:"string"},displayMode:{value:"row",allowedValues:["row","button"],type:"string"}},type:"object"},dialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:"auto",type:"any"},width:{value:"auto",type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!1,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"},addDialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:"auto",type:"any"},width:{value:"auto",type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!1,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"},addColumnDialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:"auto",type:"any"},width:{value:430,type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!1,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"},deleteDialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:"auto",type:"any"},width:{value:"auto",type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!1,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"}},type:"object"},paging:{value:{enabled:{value:!1,type:"boolean"},spinner:{value:{enabled:{value:!1,type:"boolean"},step:{value:1,type:"number"}},type:"object"},pageHierarchySize:{value:2,type:"int"},pageSize:{value:10,type:"int"},pageIndex:{value:0,type:"int",validator:"pageIndexValidator"}},type:"object"},pager:{value:{autoEllipsis:{value:"both",allowedValues:["none","before","after","both"],type:"string"},position:{value:"far",allowedValues:["near","far","both"],type:"string"},template:{value:"",type:"string"},pageSizeSelector:{value:{visible:{value:!1,type:"boolean"},dataSource:{value:[10,20,50],type:"object"},position:{value:"far",allowedValues:["near","far"],type:"string"}},type:"object"},summary:{value:{position:{value:"far",allowedValues:["near","far"],type:"string"},visible:{value:!1,type:"boolean"}},type:"object"},navigationButtons:{value:{position:{value:"both",allowedValues:["near","far","both"],type:"string"},prevNextButtons:{value:{visible:{value:!0,type:"boolean"}},type:"object"},firstLastButtons:{value:{visible:{value:!0,type:"boolean"}},type:"object"},labels:{value:{visible:{value:!1,type:"boolean"}},type:"object"}},type:"object"},navigationInput:{value:{position:{value:"far",allowedValues:["near","far"],type:"string"},visible:{value:!1,type:"boolean"}},type:"object"},pageIndexSelectors:{value:{visible:{value:!0,type:"boolean"},dataSource:{value:10,type:"any"}},type:"object"},visible:{value:!1,type:"boolean"}},type:"object",reflectToAttribute:!1},rowDetail:{value:{enabled:{value:!1,type:"boolean"},height:{value:200,type:"number"},position:{value:"near",allowedValues:["near","far"],type:"string"},template:{value:"",type:"any",reflectToAttribute:!1},visible:{value:!0,type:"boolean"},dialog:{value:{header:{value:"{{message}}",type:"string"},height:{value:300,type:"any"},width:{value:360,type:"any"},left:{value:"center",type:"any"},top:{value:"center",type:"any"},enabled:{value:!1,type:"boolean"},visible:{value:!1,type:"boolean"}},type:"object"}},type:"object"},rowCSSRules:{value:null,type:"any"},summaryRow:{value:{position:{value:"far",allowedValues:["near","far"],type:"string"},visible:{value:!1,type:"boolean"},editing:{value:!1,type:"boolean"},template:{value:"",type:"string"}},type:"object"},scrolling:{value:"physical",allowedValues:["physical","virtual","infinite","deferred"],type:"string"},columnHeader:{value:{visible:{value:!0,type:"boolean"}},type:"object"},groupHeader:{value:{visible:{value:!1,type:"boolean"},template:{value:"",type:"string"}},type:"object"},header:{value:{visible:{value:!1,type:"boolean"},template:{value:"",type:"any"},buttons:{value:["columns","filter","group","sort","format","search"],type:"array"},onInit:{value:null,reflectToAttribute:!1,type:"any"}},type:"object"},footer:{value:{visible:{value:!1,type:"boolean"},template:{value:"",type:"any"}},type:"object"},stateSettings:{value:{enabled:{value:!0,type:"boolean",reflectToAttribute:!1},current:{value:"",type:"string",reflectToAttribute:!1},storage:{value:null,type:"any",reflectToAttribute:!1},autoSave:{value:!1,type:"boolean",reflectToAttribute:!1},autoLoad:{value:!1,type:"boolean",reflectToAttribute:!1},options:{value:[],type:"array",reflectToAttribute:!1},onStateChange:{value:null,type:"any",reflectToAttribute:!1}},type:"object",reflectToAttribute:!1},checkBoxes:{value:{visible:{value:!1,type:"boolean"},hasThreeStates:{value:!1,type:"boolean"}},type:"object"},selection:{value:{enabled:{value:!1,type:"boolean"},allowRowHeaderSelection:{value:!1,type:"boolean"},allowColumnHeaderSelection:{value:!1,type:"boolean"},allowRowSelection:{value:!0,type:"boolean"},allowCellSelection:{value:!1,type:"boolean"},allowDragSelection:{value:!0,type:"boolean"},allowDragSelectionAutoScroll:{value:!0,type:"boolean"},allowCellDragSelectionHandle:{value:!0,type:"boolean"},allowCellDragDropSelectionHandle:{value:!0,type:"boolean"},allowCellDragSelectionAutoFill:{value:!0,type:"boolean"},selectAllMode:{value:"page",allowedValues:["none","page","all"],type:"string"},mode:{value:"many",type:"string",allowedValues:["one","many","extended"]},action:{value:"click",type:"string",allowedValues:["none","click","doubleClick"]},checkBoxes:{value:{enabled:{value:!1,type:"boolean"},autoShow:{value:!1,type:"boolean"},action:{value:"click",type:"string",allowedValues:["none","click","doubleClick"]},selectAllMode:{value:"page",allowedValues:["none","page","all"],type:"string"},position:{value:"near",allowedValues:["near","far"],type:"string"}},type:"object"},selected:{value:"",type:"string"},tabKeyBehavior:{value:"default",allowedValues:["none","default"],type:"string"},defaultSelection:{value:!1,type:"boolean"}},type:"object"},sorting:{value:{enabled:{value:!1,type:"boolean"},sort:{value:[],type:"array"},mode:{value:"one",allowedValues:["one","many"],type:"string"},maintainSort:{value:!0,type:"boolean"},commandKey:{value:"",allowedValues:["","Shift","Control","Alt"],type:"string"},sortToggleThreeStates:{value:!0,type:"boolean"},sortToggleOnClick:{value:!0,type:"boolean"},sortToggleOnClickAndCommandKey:{value:!1,type:"boolean"}},type:"object"},storeHistory:{value:!1,type:"boolean"},storeHistoryItems:{value:20,type:"number"},users:{value:[],type:"array",reflectToAttribute:!1},virtualModeCachedRowsCount:{value:100,type:"int"}}}static get requires(){return{}}static get styleUrls(){return["smart.menu.css","smart.filterpanel.css","smart.pager.css","smart.grid.css","smart.textbox.css"]}template(){return"<div class='smart-container'id='container' disabled='[[disabled]]' role='grid'>\n <div id='header' role=\"toolbar\" class='smart-grid-header smart-hidden'>\n </div>\n <div id='groupHeader' role=\"presentation\" class='smart-grid-group-header smart-hidden'></div>\n <div id='headerPager' top class='smart-grid-pager smart-hidden'></div>\n <div id='headerCommandBar' header top class='smart-grid-header smart-grid-command-bar smart-hidden'></div>\n <div id='content' class='smart-grid-content'>\n <div id='columnHeader' role=\"rowgroup\" class='smart-grid-column-header'>\n <div id='columnNearContainer' role=\"row\" class='near smart-hidden smart-grid-column-header-cell-container'>\n </div>\n <div id='columnContainer' role=\"row\" class='center smart-grid-column-header-cell-container'>\n </div>\n <div id='columnFarContainer' role=\"row\" class='far smart-hidden smart-grid-column-header-cell-container'>\n </div>\n </div>\n <div id='scrollView' role=\"rowgroup\" class ='smart-grid-scroll-view'>\n <div id='rowNearContainer' role=\"presentation\" class='near smart-hidden smart-grid-row-container'>\n </div>\n <div id='rowContainer' role=\"presentation\" class='center smart-grid-row-container'>\n </div>\n <div id='rowFarContainer' role=\"presentation\" class='far smart-hidden smart-grid-row-container'>\n </div>\n <div id='placeholder' class ='smart-hidden smart-placeholder smart-grid-placeholder'></div>\n <smart-scroll-bar right-to-left=\"[[rightToLeft]]\" theme=\"[[theme]]\" id='verticalScrollBar' class='smart-grid-scroll-bar' wait disabled='[[disabled]]' orientation='vertical'></smart-scroll-bar>\n <smart-scroll-bar right-to-left=\"[[rightToLeft]]\" theme=\"[[theme]]\" id='horizontalScrollBar' class='smart-grid-scroll-bar' wait disabled='[[disabled]]'></smart-scroll-bar>\n </div>\n <div id='filterFooter' class='smart-grid-filter-footer smart-hidden'></div>\n </div>\n <div class=\"smart-grid-view-content smart-hidden\" id=\"viewContent\"></div>\n <div id='loadingIndicatorContainer' class='smart-loader-container'>\n <span id='loadingIndicator' class='smart-grid-loader smart-loader'></span>\n <span id='loadingIndicatorPlaceholder' class ='smart-loader-label smart-hidden'></span>\n </div>\n <div id='footerCommandBar' footer class='smart-grid-footer smart-grid-command-bar smart-hidden'></div>\n <div id='footerPager' class='smart-grid-pager smart-hidden'></div>\n <div id='footer' class='smart-grid-footer smart-hidden'></div>\n </div>"}static get listeners(){return{focus:"_focusHandler",blur:"_blurHandler",wheel:"_mouseWheelHandler","document.up":"_upHandler","document.down":"_downHandler","document.move":"_moveHandler","document.scroll":"_scrollHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler",resize:"_resizeHandler","header.click":"_headerClickHandler","columnHeader.down":"_columnDownHandler","columnHeader.click":"_columnClickHandler","columnHeader.move":"_columnMoveHandler","columnHeader.mouseleave":"_columnMouseLeaveHandler","rowNearContainer.down":"_rowDownHandler","rowContainer.down":"_rowDownHandler","rowFarContainer.down":"_rowDownHandler","container.selectstart":"_selectStartHandler",styleChanged:"_styleChangedHandler",swipeleft:"_swipeLeftHandler",swiperight:"_swipeRightHandler",contextmenu:"_contextMenuHandler"}}_contextMenuHandler(e){if(this.contextMenu.enabled)return e.preventDefault(),e.stopPropagation(),!1}get _tabindex(){return this.disabled||this.unfocusable?"":' tabindex="0"'}pageIndexValidator(e,t){const o=this;if(t<0)return 0;if(o.dataSource){if(o.dataSource.virtualDataSource)return t;const e=Math.ceil(o.dataSource.length/o._pageSize);if(t>e-1)return e-1}}_offsetTop(e){return e?e.offsetTop+this._offsetTop(e.offsetParent):0}_offsetLeft(e){return e?e.offsetLeft+this._offsetLeft(e.offsetParent):0}offset(e){return{left:this._offsetLeft(e),top:this._offsetTop(e)}}getBoundingRect(e){const t=this;let o=window.pageXOffset,a=window.pageYOffset,l=e.getBoundingClientRect();if(e!==document.body){let l=e.parentNode;for(;l!==document.body&&l;){l&&(o+=l.scrollLeft,a+=l.scrollTop);let e=l;l?(l=l.parentNode,t.enableShadowDOM&&l===t.shadowRoot?l=t:!t.isInShadowDOM||l!==t.getRootNode()&&e!==t.getRootNode()||(l=t.getRootNode().host)):t.isInShadowDOM&&(l=t.getRootNode().host)}}return{bottom:l.bottom+a,height:l.height,left:l.left+o,right:l.right+o,top:l.top+a,width:l.width}}_downHandler(e){this._downTarget=e.originalEvent.target}_removeCellContentPopup(){const e=this;e._cellContentPopup&&(e._cellContentPopup.remove(),e._cellContentPopup=null),e._cellContentPopupTimer&&(clearTimeout(e._cellContentPopupTimer),e._cellContentPopupTimer=null)}_upHandler(e){const t=this,o=t.getBoundingRect(t);super._upHandler(),t._tapTimer&&clearTimeout(t._tapTimer);const a=()=>{t.editing.isEditing&&!t.editing.dialog.enabled&&setTimeout((()=>{if(!e.defaultPrevented){if(t.editing.editCell&&t.editing.editCell.editor.instance){const o=t.editing.editCell.editor.instance;if(o.element&&o.element.hasAttribute("aria-owns")){const t=o.element.getAttribute("aria-owns"),a=document.getElementById(t);if(a&&a.contains(e.originalEvent.target))return}if(t.editing.editCell.editor.instance.blur(e),e.defaultPrevented)return}t.endEdit()}}),50)};if(!e.originalEvent||(e.originalEvent.target===t.$.scrollView&&t._downTarget===e.originalEvent.target&&a(),!e.originalEvent.target.closest(".smart-grid-dialog"))){if(e.pageX<o.left||e.pageX>o.right||e.pageY<o.top||e.pageY>o.bottom){let o=!1,l=e.originalEvent.target;for(;l;)if(l=l.parentNode,l===t){o=!0;break}if(o)return t._dragSelectionEnd(e),t._endResize(e),void t._endDrag(e);if(t._summaryRowDialog&&t._summaryRowDialog.classList.contains("open")&&t._summaryRowDialog.confirm(),t._inputOverlay&&(t._inputOverlay.classList.remove("smart-input-overlay-on"),setTimeout((()=>{t._inputOverlay&&(t._inputOverlay.parentNode&&t._inputOverlay.parentNode.removeChild(t._inputOverlay),t._inputOverlay=null)}),t.behavior.doubleClickTimingDelay)),a(),t.menu){let o,a,l,n;if(t.enableShadowDOM||t.isInShadowDOM?(o=e.originalEvent.composedPath()[0],a=function(){let e=o.getRootNode().host;for(;e;){if(e===t)return e;e=e.getRootNode().host}}(),l=t.menu.contains(o)||t.menu.firstElementChild.shadowRoot.contains(o),n=t.menu.firstElementChild.shadowRoot):(o=e.originalEvent.target,a=t.contains(o),l=t.menu.contains(o),n=t.menu),!a&&!l){const e=n.querySelectorAll("smart-drop-down-list"),a=n.querySelectorAll("smart-date-time-picker"),l=n.querySelectorAll("smart-date-input"),i=n.querySelectorAll("smart-input");for(let t=0;t<e.length;t++)if(e[t].$.dropDownContainer.contains(o))return;for(let e=0;e<a.length;e++)if(a[e].$.dropDownContainer.contains(o))return;for(let e=0;e<l.length;e++)if(l[e].$.scrollView.contains(o))return;for(let e=0;e<i.length;e++)if(i[e].$.scrollView.contains(o))return;return void t.closeMenu()}}}t._summaryRowDialog&&t._summaryRowDialog.classList.contains("open")&&t._summaryRowDialog.confirm(),t._dragSelectionEnd(e),t._endResize(e),t._endDrag(e)}}_nextColumn(e){const t=this;for(let o=0;o<t.viewColumns.length;o++){const a=t.viewColumns[o];if(a.visibleIndex===e.visibleIndex+1)return a}return null}_nextRow(e){const t=this._recyclingRows,o=t.indexOf(e);return o>=0?t[o+1]:null}_moveHandler(e){const t=this;if(t.isInitialized&&t._selection){if(t.selection.enabled&&t.selection.allowDragSelection&&!t.editing.isEditing&&(!t._selection.selectionRect||t._selection.selectionRect&&!t._selection.selectionRect.captured)&&(t._dragSelection(e),e.originalEvent)){const o=e.originalEvent.target.closest?e.originalEvent.target:void 0;Smart.Utilities.Core.isMobile&&o&&o.closest("smart-grid")===t&&e.originalEvent.preventDefault()}t.isScrolling||("none"===t.behavior.columnResizeMode||t.classList.contains("smart-grid-row-resize-mode")||t._columnMoveResizeHandler(e),"none"===t.behavior.rowResizeMode||t.classList.contains("smart-grid-column-resize-mode")||t._rowMoveResizeHandler(e),t._drag(e))}}_hideActionButtons(){const e=this;if(e._columnElements){for(let t=0;t<e._columnElements.length;t++){const o=e._columnElements[t],a=o.column;a&&a.autoShowActionButton&&o._hideActionButton()}for(let t=0;t<e._frozenNearColumns.length;t++){const o=e._frozenNearColumns[t],a=o.element;o&&o.autoShowActionButton&&a._hideActionButton()}}}_columnMouseLeaveHandler(){this._hideActionButtons()}_columnMoveHandler(e){const t=this;if(!t.isInitialized)return;if(t._columnResizeStartLine||t._rowResizeStartLine)return;const o=(o,a)=>{if(o&&o.autoShowActionButton){const l=a.getBoundingClientRect(),n=t.offset(a),i=t.parentElement,r=i?i.scrollTop:0;if(n.left<=e.pageX&&n.left+l.width-6>=e.pageX)if(n.top-r<=e.pageY&&n.top-r+l.height>=e.pageY){if(!t.hasColumnMenu(o))return;a._showActionButton()}else a._hideActionButton();else a._hideActionButton()}};for(let e=0;e<t._columnElements.length;e++){const a=t._columnElements[e];o(a.column,a)}for(let e=0;e<t._frozenNearColumns.length;e++){const a=t._frozenNearColumns[e];o(a,a.element)}}_headerClickHandler(e){const t=this;if(t.$.headerBar){const o=t.isInShadowDOM||t.shadowRoot?e.composedPath()[0]:e.target;t.$.headerBar._headerClickHandler(o,t)}}_columnClickHandler(e){const t=this;if(t._overlay)return;if(void 0===e.clientX)return;const o=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let a=null,l=null;const n=new Date-t._columnClickTime<t.behavior.doubleClickTimingDelay;t._columnClickTime=new Date;for(let e=0;e<o.length;e++){const t=o[e];if(t.classList.contains("smart-action-button"))return;if(t.getAttribute("data-field")){a=t.getAttribute("data-field"),l=t;break}}if(a){const o=l.column;if(!o)return;if(e.srcElement.classList.contains("smart-filter-button"))return;if("_addNewColumn"===o.dataField)return void t._openAddColumnDialog();if(Smart.Utilities.Core.isMobile)n&&t.sorting.sortToggleOnClick&&o.allowSortToggleOnClick&&t.sorting.enabled&&(t.sortBy(a),t.autoSaveState()),t._columnMoveHandler(e),e.originalEvent&&e.originalEvent.preventDefault();else if(!n&&t.sorting.sortToggleOnClick&&o.allowSortToggleOnClick&&t.sorting.enabled){if("none"!==t.behavior.columnResizeMode&&"col-resize"===o.element.style.cursor)return;if(t._canSort=!0,""!==t.sorting.commandKey){if("Alt"===t.sorting.commandKey&&!1===e.altKey&&(t._canSort=!1),"Shift"===t.sorting.commandKey&&!1===e.shiftKey&&(t._canSort=!1),"Control"===t.sorting.commandKey&&!1===e.metaKey&&!1===e.ctrlKey&&(t._canSort=!1),"Control"!==t.sorting.commandKey&&e.ctrlKey)return;if(!0===t.sorting.sortToggleOnClickAndCommandKey&&!t._canSort)return}t.sortBy(a),t.autoSaveState()}}}_columnDownHandler(e){const t=this,o=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(e.clientX,e.clientY);let a=null,l=null;const n=new Date-t._clickTime<t.behavior.doubleClickTimingDelay;t.$.headerBar&&t.$.headerBar.closePanel(),t._doubleClickHandler(e);for(let e=0;e<o.length;e++){const t=o[e];if(t.classList.contains("smart-action-button"))return;if(t.getAttribute("data-field")){a=t.getAttribute("data-field"),l=t;break}}if(a){const o=l.column;if(!o)return;if("_commandColumn"===a)return void(t.editing.commandColumn.dataSource.commandColumnMenu.visible&&t._applyCommand(t.editing.commandColumn.dataSource.commandColumnMenu.command));const i=function(l){const n=o.selectionColumn?t.selection.checkBoxes.action===l&&t.selection.enabled:t.selection.action===l&&t.selection.enabled;if("col-resize"!==o.element.style.cursor&&(!t.appearance.showColumnHeaderDragIcon||!e.originalEvent.target.classList.contains("smart-drag-handle"))&&n){if(t.editing.enabled&&t.editing.editColumn===o)return;if(e.shiftKey||e.ctrlKey?t._dragSelectionStartDataField=null:t._dragSelectionStartDataField=a,"_checkBoxColumn"===a)return void t._toggleColumnSelection(o);"_rowHeaderColumn"===a&&t.selection.enabled&&t.selection.allowRowHeaderSelection&&t.appearance.showRowHeaderSelectIcon&&(t.areAllRowsSelected()?t.clearSelection():t.selectAllRows(),o.refresh()),t.selection.allowColumnHeaderSelection&&o.allowSelect&&t._setSelection(null,o.dataField,e)}};if(t.editing.isEditing&&t.endEdit(),i("click"),t.$.fireEvent("columnClick",{column:o,dataField:o.dataField}),n&&(t.$.fireEvent("columnDoubleClick",{column:o,dataField:o.dataField}),i("doubleClick"),t._onColumnDoubleClick(o,e)),t._columnToResizeElement&&!t._columnResizeLine)return t._columnDownResizeHandler(e),void(t._clickTime=new Date);if(t._beginDrag(e,o),o.menu)return void(t._clickTime=new Date)}t.closeMenu(),t._clickTime=new Date}addTransformMoveStyle(e,t,o,a,l,n){e.style.opacity=n,e.style["transition-duration"]=t,e.style.transform="translate3d("+o+"px,"+a+"px,"+l+"px)"}removeTransformMoveStyle(e){e.style.opacity="",e.style["transition-duration"]="",e.style.transform=""}_rowDownHandler(e){const t=this;if(t._inputOverlay&&t._inputOverlay.classList.remove("smart-input-overlay-on"),t._doubleClickHandler(e),t._closeMenu(t.menu),t._rowResizeHandler(e),t._removeCellContentPopup(),t._toggledRow&&t.appearance.allowRowToggleAnimation)return;if(e.target&&!e.target.classList.contains("smart-grid-row-container")&&!e.target.classList.contains("smart-grid-selection-overlay")&&!e.target.classList.contains("smart-selection-overlay-content"))return;let o=e.clientX,a=e.clientY;e.touches&&(o=e.touches[0].clientX,a=e.touches[0].clientY);const l=(t.enableShadowDOM?t.shadowRoot:t.getRootNode()).elementsFromPoint(o,a);let n=null,i=null,r=null,s=null;t._lastPointerDownTime=new Date;for(let e=0;e<l.length;e++){const t=l[e];if(t.hasAttribute("toggle-button")&&(i=t),t.hasAttribute("checkbox")&&(r=t),s||"smart-grid-cell"!==t.nodeName.toLowerCase()||(s=t),!n&&"smart-grid-row"===t.nodeName.toLowerCase()){n=t;break}}if(n&&s){const o=s?s.cell:null;if(o.row.filterRow||t._closeMenu(t.filterRowMenu),i&&o&&!o.column.rowDetailColumn&&i!==o.row.toggleDetailButton&&!i.classList.contains("row-detail"))n.row.toggle(e);else if(t.rowDetail.enabled&&t.rowDetail.visible&&i&&o&&o.column.rowDetailColumn){const e=n.row;e.showDetail?t.hideDetail(e.id):t.showDetail(e.id)}else{const o=n.row,a=s?s.cell:null;a.column._treeColumn&&r&&(o.checked=!o.checked),a.element===o.header&&t.behavior.allowRowReorder&&t._beginDrag(e,o),t._tapTimer&&clearTimeout(t._tapTimer),t._tapTimer=setTimeout((function(){t._clickedRow===n&&t.$.fireEvent("rowTap",{row:o,id:o.id,originalEvent:e.originalEvent}),t._clickedCell===s&&t.$.fireEvent("cellTap",{cell:a,id:o.id,dataField:a.column.dataField,originalEvent:e.originalEvent})}),t.behavior.doubleClickTimingDelay);const l=function(l){if(!t.selection.enabled||o.autoGenerated||!0!==o.allowSelect)return void delete t.__selectionStarted;if(o.header&&"row-resize"===o.header.style.cursor){const a=t.offset(o.header);if(t._rowToResize&&a.left<=e.originalEvent.pageX&&e.originalEvent.pageX<=a.left+o.header.offsetWidth)return;o.header.style.cursor=""}const i=t.editing.isEditing;if(i&&t.editing.editCell&&t.editing.editCell.row.id===o.id&&t.editing.editCell.column.dataField===a.column.dataField)return;if(i&&t.editing.editRow&&t.editing.editRow.id===o.id)return;const r=()=>{t.focus(),setTimeout((function(){t.focus()}),50)};if(t.selection.action===l){if(e.shiftKey||e.ctrlKey||!t.selection.allowRowHeaderSelection&&a.column.autoGenerated?t._dragSelectionStartRow=null:t._dragSelectionStartRow=n.row,e.shiftKey||e.ctrlKey?t._dragSelectionStartDataField=null:t._dragSelectionStartDataField=a.column.dataField,a.column.rowHeaderColumn&&!t.selection.allowRowHeaderSelection)return t._dragSelectionStartRow=null,void r();t._setSelection(o.id,a.column.dataField,e),r()}else a.column.selectionColumn&&t.selection.checkBoxes.enabled&&t.selection.checkBoxes.action===l&&(t._setSelection(o.id,a.column.dataField,e),r())},i=a.selected;t._clickTime||(t._clickTime=new Date);const d=t._clickedCell===s&&new Date-t._clickTime<t.behavior.doubleClickTimingDelay,u=e.originalEvent?e.originalEvent:e,c=3===u.which;if(c||"_commandColumn"===a.column.dataField||l("click"),t.$.fireEvent("rowClick",{row:o,id:o.id,isRightClick:c,originalEvent:u,pageX:parseInt(u.pageX),pageY:parseInt(u.pageY)}),t.$.fireEvent("cellClick",{cell:a,id:o.id,dataField:a.column.dataField,isRightClick:c,originalEvent:u,pageX:parseInt(u.pageX),pageY:parseInt(u.pageY)}),c&&t.contextMenu.enabled)return t.contextMenu.id=o.id,t.contextMenu.dataField=a.column.dataField,t._focusCell(o.id,a.column.dataField),t.openContextMenu(u.pageX+10,u.pageY+10),void(t.contextMenu.selector&&(u.stopPropagation(),u.preventDefault()));if(o.autoGenerated||a.column.autoGenerated||"checkBox"===a.template&&e.originalEvent&&e.originalEvent.target&&e.originalEvent.target.classList.contains("smart-input"))t._onRowClick(o.index,o,e),t._onCellClick(a,e);else if(t.selection.enabled)if(t.selection.allowCellSelection)if("extended"===t.selection.mode){if(!0===i&&i===a.selected&&!t.selection.isDragging){const l=t._selection.focusedCell;l&&t._clickedCell&&l.id===a.row.id&&l.dataField===a.column.dataField&&l.id===t._clickedCell.cell.row.id&&l.dataField===t._clickedCell.cell.column.dataField&&(t._onRowClick(o.index,o,e),t._onCellClick(a,e))}}else d||(t._onRowClick(o.index,o,e),t._onCellClick(a,e));else if(t.selection.allowRowSelection)if("extended"===t.selection.mode){if(!0===i&&i===a.selected&&!t.selection.isDragging){const l=t._selection.focusedCell;t._clickedCell&&l.id===a.row.id&&l.id===t._clickedCell.cell.row.id&&(t._onRowClick(o.index,o,e),t._onCellClick(a,e))}}else d||(t._onRowClick(o.index,o,e),t._onCellClick(a,e));else t._onRowClick(o.index,o,e),t._onCellClick(a,e);else t._onRowClick(o.index,o,e),t._onCellClick(a,e);new Date-t._clickTime<t.behavior.doubleClickTimingDelay&&(t._clickedRow===n&&(t._onRowDoubleClick(o.index,o,e,e),t.$.fireEvent("rowDoubleClick",{row:o,id:o.id,isRightClick:c,originalEvent:e.originalEvent,pageX:parseInt(u.pageX),pageY:parseInt(u.pageY)}),l("doubleClick")),t._clickedCell===s&&(t._onCellDoubleClick(a,e),t.$.fireEvent("cellDoubleClick",{cell:a,id:o.id,dataField:a.column.dataField,isRightClick:c,originalEvent:e.originalEvent,pageX:parseInt(u.pageX),pageY:parseInt(u.pageY)}))),t._clickedRow=n,t._clickedCell=s,t._clickTime=new Date,t.layout.allowCellsWrapShortcut&&t._clickedCell.hasAttribute("focus")&&t._clickedCell.hasAttribute("selected")&&e.shiftKey&&(t._cellContentPopupTimer&&clearTimeout(t._cellContentPopupTimer),t.selection.isDragging?t._removeCellContentPopup():a.autoWrap())}}}showDetail(e){const t=this.rowById[e];t&&(t.showDetail=!0)}hideDetail(e){const t=this.rowById[e];t&&(t.showDetail=!1)}_focusHandler(){this._focused=!0}_blurHandler(){this._focused=!1}_notify(e,t,o){const a=this;if(a.notifyFn)for(let l=0;l<a.notifyFn.length;l++)a.notifyFn[l](e,t,o)}notify(e){const t=this;e&&(t.notifyFn||(t.notifyFn=[]),t.notifyFn.push(e))}_applyTemplate(e,t){let o=null;if(null!==e&&""!==e)if(e&&"function"==typeof e)e(t);else if((e.startsWith("#")||e.startsWith("."))&&(o=document.querySelector(e)),o)t.innerHTML="",o instanceof HTMLElement&&!(o instanceof HTMLTemplateElement)?t.appendChild(o):t.appendChild(o.content.cloneNode(!0).firstElementChild);else{const o=function(e){const t=document.createElement("template");return e=e.trim(),t.innerHTML=e,t.content.firstChild}(e);o&&(t.innerHTML="",t.appendChild(o))}else t.innerHTML=""}propertyChangedHandler(e,t,o){const a=this;if(a.isInitialized){switch(a._notify(e,t,o),e){case"onRowInserted":return;case"view":return void(a.$.headerBar&&a.$.headerBar._setView&&a.$.headerBar._setView(o));case"users":case"currentUser":a._refreshCurrentUser();break;case"summaryRow_visible":{for(let e=0;e<a.columns.length;e++)a._summaryRowCount=Math.max(a._summaryRowCount,a.columns[e].summary.length);const e=a.onRowInserted;a.onRowInserted=null,a._renderRows(!0),a.onRowInserted=e;break}case"conditionalFormatting":return a._renderConditionalFormatting(),void a.refresh();case"appearance_displayLoadingIndicator":return void a._setLoadingIndicatorVisibility();case"appearance_placeholder":return void(a.$.placeholder.innerHTML=o);case"appearance_showColumnHeaderLines":case"appearance_showColumnLines":case"appearance_showRowLines":return void a._recycle();case"appearance_allowColumnStickyPosition":o?a._stickHeader():a._unstickHeader();break;case"appearance_showColumnIcon":for(let e=0;e<a.columns.length;e++)a.columns[e].setProperty("showIcon",a.appearance.showColumnIcon);a._recycle();break;case"appearance_showRowHeaderNumber":case"appearance_showRowHeader":{a._initializeRowNumberColumn();const e=a._frozenNearColumns[0];e.rowHeaderColumn&&e.element&&!e.element.parentNode&&a.$.columnNearContainer.appendChild(e.element),a.refresh();break}case"header_visible":a.header.visible&&""===a.header.template&&(a.$.header.innerHTML='<smart-grid-toolbar header-position="top"></smart-grid-toolbar>',a.$.headerBar=a.$.header.firstElementChild,a.$.headerBar._init(a),a.header.onInit&&a.header.onInit(a.$.headerBar));break;case"header_buttons":a.header.visible&&""===a.header.template&&a._refreshHeaderBar();break;case"header_template":a._applyTemplate(o,a.$.header);break;case"footer_template":a._applyTemplate(o,a.$.footer);break;case"layout_columnWidth":case"columnWidth":{a.columns.canNotify=!1;let e=parseInt(o);if(isNaN(e)&&(e=null),e>=30||null===e)for(let t=0;t<a.columns.length;t++)a.columns[t].width=e;a.columns.canNotify=!0,a.refresh();break}case"checkBoxes_visible":return void a._recycle();case"checkBoxes_hasThreeStates":return a.rows.canNotify=!1,a._applyThreeStates(a.rowHierarchy),a.rows.canNotify=!0,void a._recycle();case"columnHeader_visible":a.__columnHeaderHeight=null,a.refresh();break;case"selection_checkBoxes_enabled":a._selectionColumn.visible=o;break;case"selection_checkBoxes_autoShow":a._selectionColumn.element&&(o?a._selectionColumn.element.setAttribute("auto-show",""):a._selectionColumn.element.removeAttribute("auto-show"));break;case"selection_checkBoxes_position":{let e=a.viewColumns.indexOf(a._selectionColumn);a.viewColumns.canNotify=!1,a.viewColumns.splice(e,1);const t=a._frozenNearColumns.indexOf(a._selectionColumn),l=a._frozenFarColumns.indexOf(a._selectionColumn);if(t>=0&&a._frozenNearColumns.splice(t,1),l>=0&&a._frozenFarColumns.splice(l,1),"far"===o)a._selectionColumn.canNotify=!1,a._selectionColumn.freeze="far",a._selectionColumn.canNotify=!0,a._frozenFarColumns.splice(0,0,a._selectionColumn),a.viewColumns.push(a._selectionColumn),a.$.columnFarContainer.appendChild(a._selectionColumn.element);else{let e=0,t=0;for(let o=0;o<a.viewColumns.length&&(a.viewColumns[o].autoGenerated||a.viewColumns[o].dataField!==a.columns[t++].dataField);o++)a.viewColumns[o].autoGenerated&&e++;a._selectionColumn.canNotify=!1,a._selectionColumn.freeze="near",a._selectionColumn.canNotify=!0,a._frozenNearColumns.splice(e,0,a._selectionColumn),a.viewColumns.splice(e,0,a._selectionColumn),a.$.columnNearContainer.appendChild(a._selectionColumn.element)}a.viewColumns.canNotify=!0;break}case"selection_mode":if(a._selection&&(a._selection.focusedCell=null),a.selection.allowCellSelection)a.clearSelection();else if("one"===o){const e=a.getSelection();if(a.clearSelection(),e.rows&&e.rows[0]){e.rows[0].row.selected=!0;const t=a.rowById[e.rows[0].row.id].getCell(a.columns[0].dataField);a._selection.focusedCell={id:t.row.id,dataField:t.column.dataField,value:t.value,index:t.row.index}}}break;case"grouping_groupBy":return a.dataSource&&a.dataSource.groupBy&&(a.dataSource.groupBy=o),void a.refresh();case"sorting_enabled":return void a.refresh();case"sorting_maintainSort":return void a._recycle(!1);case"filtering_enabled":return o&&0===a._filterPanels.length&&a._createFilterPanels(),void(a.header.visible&&a.refresh());case"filtering_filterRow_visible":return a._initializeRows(),a._initializeRowElements(),void a.refresh();case"filtering_operator":return void a.refreshFilters();case"filtering_filter":for(let e=0;e<a.columns.length;e++){const t=a.columns[e];t.canNotify=!1,t.setProperty("filter",null),t.canNotify=!0}for(let e=0;e<a.filtering.filter.length;e++){const t=a.filtering.filter[e];if(t&&t.splice){const e=t[0],o=t.splice(1);let l=null;if(o instanceof Smart.FilterGroup)l=o;else{const t=a.columnByDataField[e];t&&(l=a.dataSource._createFilter(t.dataType,o))}l&&a.addFilter(e,l,!1)}}return void a.refreshFilters();case"messages":case"locale":{if(a.columns)for(let e=0;e<a.columns.length;e++)a.columns[e]._cellsCachedValues=[];a._dialogEdit&&(a._dialogEdit.close(),a._dialogEdit=null),a._dialogDelete&&(a._dialogDelete.close(),a._dialogDelete=null),a._dialogAddRow&&(a._dialogAddRow.close(),a._dialogAddRow=null);const e=a.$.headerPager.querySelector("smart-pager"),t=a.$.footerPager.querySelector("smart-pager");e&&(e.locale=a.locale),t&&(t.locale=a.locale);const o=(e,t)=>{a._handleFilterMenuClick(e,t)};a._filterInfo||(a._filterInfo={}),a._filterInfo.stringConditions=[{icon:"smart-icon-contains",command:o,value:"CONTAINS",label:a.localize("CONTAINS")},{icon:"smart-icon-does-not-contain",command:o,value:"DOES_NOT_CONTAIN",label:a.localize("DOES_NOT_CONTAIN")},{icon:"smart-icon-starts-with",command:o,value:"STARTS_WITH",label:a.localize("STARTS_WITH")},{icon:"smart-icon-ends-with",command:o,value:"ENDS_WITH",label:a.localize("ENDS_WITH")},{icon:"smart-icon-equals",command:o,value:"EQUAL",label:a.localize("EQUAL")},{icon:"smart-icon-delete",command:o,value:"CLEAR_FILTER",label:a.localize("CLEAR_FILTER")}],a._filterInfo.numberAndDateConditions=[{icon:"smart-icon-equals",command:o,value:"EQUAL",label:a.localize("EQUAL")},{icon:"smart-icon-not-equal",command:o,value:"NOT_EQUAL",label:a.localize("NOT_EQUAL")},{icon:"smart-icon-less-than",command:o,value:"LESS_THAN",label:a.localize("LESS_THAN")},{icon:"smart-icon-less-than-equal",command:o,value:"LESS_THAN_OR_EQUAL",label:a.localize("LESS_THAN_OR_EQUAL")},{icon:"smart-icon-greater-than",command:o,value:"GREATER_THAN",label:a.localize("GREATER_THAN")},{icon:"smart-icon-greater-than-equal",command:o,value:"GREATER_THAN_OR_EQUAL",label:a.localize("GREATER_THAN_OR_EQUAL")},{icon:"smart-icon-between",command:o,value:"RANGE",label:a.localize("RANGE")},{icon:"smart-icon-delete",command:o,value:"CLEAR_FILTER",label:a.localize("CLEAR_FILTER")}],a._refreshHeaderBar(),a.$.headerBar&&(a.$.headerBar.messages=a.messages,a.$.headerBar.locale=a.locale,a.$.headerBar._localizeHeader(),a.$.headerBar._getInnerElementMessages()),a._recycle();break}case"paging_spinner_enabled":a._refresh();break;case"pager_visible":return a._renderPagers(),void a._refreshPaging(!1);case"paging_pageIndex":case"pager_position":case"paging_enabled":return void a._refreshPaging(!0);case"paging_pageSize":return void a._refreshPaging(!1);case"columns":{a.__measuredColumnHeight=null,a.editing&&a.editing.isEditing&&a.cancelEdit(),a._cellEditors=[];let e=!1;if(t&&t.length)for(let o=0;o<t.length;o++)if(t[o].freeze){e=!0;break}if(a.columns&&a.columns.length)for(let t=0;t<a.columns.length;t++)if(a.columns[t].freeze){e=!0;break}if(e&&a._initializeRowElements(),a.columns&&a._sortedColumns){const e=[];a.columns.forEach((t=>{t.sortOrder&&e.push(t)})),a._sortedColumns=JSON.parse(JSON.stringify(e))}if(a._renderColumns(),a._refreshHeaderBar(),a.columns&&a.filtering.enabled){a.beginUpdate();for(let e=0;e<a.columns.length;e++){const t=a.columns[e];if(t.canNotify=!1,a.removeFilter(t.dataField),t.filtered=!1,t.canNotify=!0,t.filter){let e=null,o=t.filter;e=o instanceof Smart.FilterGroup?o:a.dataSource._createFilter(t.dataType||"string",o),e&&a.addFilter(t.dataField,e,!1)}}a.refreshFilters(),a.endUpdate()}return a.layout.isDirty=!0,a._resetCachedLayout(),void a._refreshLayout()}case"columnGroups":if(a._columnGroups=[],a._columnHeights=0,a.viewColumns)for(let e=0;e<a.viewColumns.length;e++){const t=a.viewColumns[e],o=t.element;t.top=0,t.level=0,o&&(o.style.top="",o.style.height="",o.style.lineHeight="")}return a.columns.canNotify=!1,a.columns=a._initColumns,a._renderColumns(),a.columns.canNotify=!0,a.__columnHeaderHeight=null,void a.refresh();case"dataSource":if(delete a._isFirstVirtualDataSourceRequest,"dataSource"===e&&t&&o){const e=a.dataSource&&a.dataSource.virtualDataSource&&!a.dataSource.virtualDataSourceOnExpand&&"infinite"!==a.scrolling;if(t instanceof Smart.DataAdapter&&!e&&t.length===o.length&&t.length>0&&o.length>0&&!a.dataSourceSettings.parentDataField&&!t.parentDataField){if(a.dataSource=t,a._cachedDataSource===o)return;return setTimeout((()=>{a.beginUpdate();for(let e=0;e<o.length;e++){const t=o[e],l=a.dataSource[e].$.id;a._updateRow(l,t,!0)}delete a.__autoRowHeight,a._virtualOnExpandCache=[],a._cellsMerge=[],a._cellStyles=[];const e=a._filters,t=a._sortedColumns;if(a.clearSort(),a.filtering.filterRow)for(let e=0;e<a.columns.length;e++)a.columns[e]._filterEditorInitialized=!1;for(let e=0;e<a.columns.length;e++)delete a.columns[e]._cellsCachedValues;t&&a._refreshSort(t),e&&e.length>0&&(a._filters=null,a.refreshFilters()),a.endUpdate()})),a._cachedDataSource=o,void(a.header.visible&&""===a.header.template&&a.$.headerBar._init(a))}}return a.dataBind(),void(a.header.visible&&""===a.header.template&&a.$.headerBar._init(a));case"rowDetail_dialog_width":case"rowDetail_dialog_height":case"rowDetail_dialog_enabled":case"rowDetail_dialog_visible":return;case"rowDetail_height":case"rowDetail_enabled":{a.beginUpdate(),a.rows.canNotify=!1;const e=a.appearance.allowRowDetailToggleAnimation;a.appearance.allowRowDetailToggleAnimation=!1;for(let e=0;e<a._recyclingRows.length;e++){const t=a._recyclingRows[e];t.height=null,t.setProperty("showDetail",!1),t.detailHeight=a.rowDetail.height}if(a.rows.canNotify=!0,a.rowDetail.enabled){let t=!1;for(let e=0;e<a.viewColumns.length;e++)if(a.viewColumns[e].rowDetailColumn){t=!0;break}if(!t)return a.appearance.allowRowDetailToggleAnimation=e,a.endUpdate(),void a._renderColumns(!0)}else for(let e=0;e<a.viewColumns.length;e++){const t=a.viewColumns[e];if(t.rowDetailColumn){t.visible=!1;break}}return a.appearance.allowRowDetailToggleAnimation=e,void a.endUpdate()}case"rowDetail_visible":for(let e=0;e<a.viewColumns.length;e++){const t=a.viewColumns[e];if(t.rowDetailColumn){t.visible=o;break}}return;case"displayLoadingIndicator":return void a._setLoadingIndicatorVisibility();case"filterable":return void a._refreshLayout();case"layout_allowCellsWrap":{const e=a.columns.canNotify;a.columns.canNotify=!1;for(let e=0;e<a.columns.length;e++)a.columns[e].cellsWrap=o;return a.layout.isDirty=!0,a._resetCachedLayout(),a._refreshLayout(),a.refresh(),void(a.columns.canNotify=e)}case"layout_columnMinHeight":case"layout_rowMinHeight":case"layout_columnHeight":case"layout_rowHeight":return a.layout.isDirty=!0,a._resetCachedLayout(),a._refreshLayout(),void a.refresh();case"rightToLeft":return void a.refresh();case"selectionMode":return;case"editing_addNewColumn_visible":a._addNewColumn?(a._addNewColumn.visible=o,a.refresh()):a._renderColumns();break;case"editing_addNewRow_displayMode":{"row"===a.editing.addNewRow.displayMode&&a.editing.addNewRow._addButton&&(a.editing.addNewRow._addButton.remove(),delete a.editing.addNewRow._addButton);const e=a._scrollView.vScrollBar;return e.style.height="",e.style.top="",e.style.setProperty("--smart-scroll-bar-near-size","0px"),a._renderAddNewRow(),void a.refresh(!0)}case"editing_addNewRow_label":case"editing_addNewRow_visible":case"editing_addNewRow_position":return!1===a.editing.addNewRow.visible&&"button"===a.editing.addNewRow.displayMode&&(a.editing.addNewRow._addButton&&a.editing.addNewRow._addButton.remove(),a._newRow&&a._newRow.element.classList.add("smart-hidden")),a._renderAddNewRow(),void a.refresh();case"editing_enabled":o?a.removeAttribute("aria-readonly"):a.setAttribute("aria-readonly",!0);break;case"editing_dialog_visible":return;case"editing_commandBar_dataSource_commandBarAddRow_visible":case"editing_commandBar_dataSource_commandBarDeleteRow_visible":case"editing_commandBar_dataSource_commandBarBatchSave_visible":case"editing_commandBar_dataSource_commandBarBatchRevert_visible":case"editing_commandBar_visible":case"editing_commandBar_displayMode":case"editing_commandBar_position":a._renderCommandBar();break;case"editing_commandColumn_position":a._renderColumns(!0);break;case"editing_commandColumn_visible":return void a.refresh(!0);case"editing_commandColumn_inline":return a._commandColumn.visible=a.editing.commandColumn.visible&&!a.editing.commandColumn.inline,void a.refresh(!0);case"editing_commandColumn_dataSource_commandColumnCustom_label":case"editing_commandColumn_dataSource_commandColumnCustom_icon":case"editing_commandColumn_dataSource_commandColumnCustom_visible":case"editing_commandColumn_dataSource_commandColumnUpdate_label":case"editing_commandColumn_dataSource_commandColumnUpdate_icon":case"editing_commandColumn_dataSource_commandColumnUpdate_visible":case"editing_commandColumn_dataSource_commandColumnEdit_label":case"editing_commandColumn_dataSource_commandColumnEdit_icon":case"editing_commandColumn_dataSource_commandColumnEdit_visible":case"editing_commandColumn_dataSource_commandColumnDelete_label":case"editing_commandColumn_dataSource_commandColumnDelete_icon":case"editing_commandColumn_dataSource_commandColumnDelete_visible":case"editing_commandColumn_displayMode":return delete a.__cellsCommandTemplate,void a.refresh(!0)}a.refresh()}}ready(){super.ready();const e=this,t=e._scrollView.vScrollBar,o=e._scrollView.hScrollBar;t.hasStyleObserver=!1,o.hasStyleObserver=!1,t.hasResizeObserver=!1,o.hasResizeObserver=!1,t.wait=!1,o.wait=!1,t.onChange=e._verticalScrollbarHandler.bind(e),o.onChange=e._horizontalScrollbarHandler.bind(e),e.setFocusable(!0),e.$.loadingIndicatorPlaceholder.innerHTML=e.appearance.loadingIndicatorPlaceholder,e.$.placeholder.innerHTML=e.appearance.placeholder,e._setLoadingIndicatorVisibility(),e._cellsMerge=[],e._cellStyles=[],e.checkLicense()}_createFilterPanels(){const e=this;if(e._filterPanels){if(e._filterPanels.length>0)return}else e._filterPanels=[];e.filtering.enabled&&0===e._filterPanels.length&&requestAnimationFrame((()=>{const t=document.createElement("smart-filter-panel"),o=document.createElement("smart-filter-panel"),a=document.createElement("smart-filter-panel"),l=document.createElement("smart-filter-panel");o.filterType="boolean",a.filterType="numeric",l.filterType="date",e._filterPanels.bool=o,e._filterPanels.date=l,e._filterPanels.numeric=a,e._filterPanels.string=t;for(let t in e._filterPanels){const o=e._filterPanels[t];o.rightToLeft=e.rightToLeft,o.classList.add("smart-hidden"),e.$.content.appendChild(o),o.parentNode.removeChild(o)}}))}_applyScrolling(){const e=this,t=e._scrollView.vScrollBar;requestAnimationFrame((()=>{switch(t.largeStep=e.$.scrollView.offsetHeight,e.scrolling){case"physical":case"infinite":case"virtual":t.step=e.layout.rowMinHeight,t.mechanicalAction="switchWhileDragging";break;case"deferred":t.step=10,t.mechanicalAction="switchWhenReleased";break;case"logical":t.step=e.layout.rowMinHeight,t.mechanicalAction="switchWhileDragging"}}))}_measureRowElement(e){const t=new Smart.Grid.Row({data:e,index:999999,grid:this});if(!t)return null;const o=t.createElement();return o.classList.add("smart-grid-measure-row"),this.$.scrollView.appendChild(o),o.style.height="",o.style.lineHeight="",o.style.height="",o.style.lineHeight="",t._isMeasureRow=!0,t.render(),o}get _autoRowHeight(){const e=this;if(e.__autoRowHeight)return e.__autoRowHeight;let t=e.layout.rowMinHeight;if(!e.dataSource||e.dataSource&&0===e.dataSource.length)return t;const o=new Smart.Grid.Row({index:0,grid:e}),a=o.createElement();e.$.scrollView.appendChild(a),e.removeAttribute("grouped"),e.removeAttribute("tree"),e.grouping.enabled&&e.dataSource.groupBy&&e.dataSource.groupBy.length>0?e.setAttribute("grouped",""):e.dataSource.boundHierarchy&&e.setAttribute("tree","");const l={};for(let t=0;t<e.dataSource.dataFields.length;t++)l[e.dataSource.dataFields[t].name]="ABCDEFHIJLMNOPQRSTUVWXYZ1234567910|";o.data=l,o._isMeasureRow=!0,o.render(),a.style.height="",a.style.lineHeight="",t=Math.max(a.offsetHeight,t);for(let e=0;e<a.children.length;e++)a.children[e].style.height="";for(let l=0;l<a.children[1].children.length;l++){if(a.children[1].children[l].style.height="auto",e.columns[0]){const t=o.getCell(e.columns[0].dataField);t&&t.render()}t=Math.max(t,8+a.children[1].children[l].offsetHeight);break}return e.$.scrollView.removeChild(a),e.__autoRowHeight=t,e.layout.rowMinHeight&&t<e.layout.rowMinHeight&&(e.__autoRowHeight=e.layout.rowMinHeight),t}get _scrollHeight(){const e=this;let t=e._recyclingRows,o=0,a=e._autoRowHeight,l=0,n=0;if(e.__scrollHeight)return e.__scrollHeight;if(0===t.length||0===e.columns.length||!e.hasVisibleColumn())return 0;e.rows.canNotify=!1;const i=e._measureRowElement(t[0].data),r=t.length;for(let s=0;s<r;s++){let r=t[s];if(!r.visible||!1===r.filtered){r.height=0,r.cellHeight=0,r.top=o;continue}const d=e.rowDetail.enabled&&r.showDetail&&!e.rowDetail.dialog.enabled;if((!r.height||!r.cellHeight||d||"auto"===r.height||"auto"===r._height||"auto"===e.layout.rowHeight||e.layout.isDirty)&&!r.expandHeight){if(r.detailHeight||(r.detailHeight=200),e.layout.rowHeight){if(e.layout.rowHeight)if("number"==typeof e.layout.rowHeight)e.layout.rowHeight<e.layout.rowMinHeight&&(e.layout.rowHeight=e.layout.rowMinHeight),r.height=e.layout.rowHeight,r.computedHeight&&(r.height=r.computedHeight),r.minHeight>r.height&&(r.height=r.minHeight),void 0!==r.label&&"advanced"===e.grouping.renderMode&&(r.height=e.grouping.groupRowHeight),r.cellHeight=r.height,e.rowDetail.enabled&&r.showDetail&&!e.rowDetail.dialog.enabled&&(r.height+=r.detailHeight);else if("auto"===e.layout.rowHeight){e.layout.rowHeight<e.layout.rowMinHeight&&(e.layout.rowHeight=e.layout.rowMinHeight),r.element=i,r.grid=e,r.element&&r.element.classList.contains("smart-hidden")&&r.element.classList.remove("smart-hidden");const t=r.data&&e.isRendered?r._autoSize(r):a,o=r.canNotify;r.canNotify=!1,r.height=t,r.computedHeight&&(r.height=r.computedHeight),void 0!==r.label&&"advanced"===e.grouping.renderMode&&(r.height=e.grouping.groupRowHeight),r.cellHeight=r.height,e.rowDetail.enabled&&r.showDetail&&!e.rowDetail.dialog.enabled&&(r.height+=r.detailHeight),r.canNotify=o}else e.layout.rowHeight(s,r),r.height||(r.height=a),r.cellHeight=r.height,e.rowDetail.enabled&&r.showDetail&&!e.rowDetail.dialog.enabled&&(r.height+=r.detailHeight)}else{if("auto"===r.height||"auto"===r._height){r.element=i,r.element&&r.element.classList.contains("smart-hidden")&&r.element.classList.remove("smart-hidden");const t=r.data&&e.isRendered?r._autoSize(r):a;r.height=t,r._height="auto"}else r.height=a;void 0===r.label||r.summaryRow||"advanced"!==e.grouping.renderMode||(r.height=e.grouping.groupRowHeight),r.computedHeight&&(r.height=r.computedHeight),r.cellHeight=r.height,e.rowDetail.enabled&&r.showDetail&&!e.rowDetail.dialog.enabled&&(r.height+=r.detailHeight)}e._rowGap&&s<e.rows.length-1&&(r.height+=e._rowGap)}!0===r.freeze||"near"===r.freeze?r.visible&&(l+=r.height):"far"===r.freeze&&r.visible&&(n+=r.height),r.freeze&&r.visible?r.top=o:(r.top!==o&&(r.top=o),r.expandHeight?o+=r.cellHeight:o+=r.height)}if(e._summaryRowCount&&e.summaryRow.visible&&(o+=1*a),e.editing.addNewRow&&"button"===e.editing.addNewRow.displayMode&&(o+=1*a),e.filtering&&e.filtering.filterRow.visible&&(l+=a),e.dataSource&&e.dataSource.virtualDataSource&&!1===e.paging.enabled){let t=e.dataSource.length>e.virtualModeCachedRowsCount?e.virtualModeCachedRowsCount:e.dataSource.length;"infinite"===e.scrolling&&(t=e.dataSource.length),"virtual"===e.scrolling&&t>=e.virtualModeCachedRowsCount&&(o=e.rows[0]?e.rows[0].height*e.dataSource.length:e.layout.rowMinHeight*e.dataSource.length)}return e.__scrollHeight=o,e.__frozenNearHeight=l,e.__frozenFarHeight=n,e._scrollView.scrollHeight=o-e.$.scrollView.offsetHeight+l+n,o=e.__scrollHeight+l+n-1,e.grouping.enabled&&e.dataSource.groupBy.length>0&&e.grouping.groupIndent>0&&"advanced"===e.grouping.renderMode&&(o+=parseInt(e.grouping.groupIndent/2)),e.__scrollHeight=o,i.remove(),t[0]&&delete t[0]._isMeasureRow,e.rows.canNotify=!0,o}_measureColumnHeight(){const e=this;if(e.__measuredColumnHeight)return e.__measuredColumnHeight;const t=document.createElement("smart-grid-column");t.style.height="auto",t.style.position="static";const o=document.createElement("div");o.classList.add("smart-label"),o.innerHTML="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRwWxXyYzZ1234567890",t.appendChild(o),e.$.columnHeader.appendChild(t);let a=e.$.columnHeader.offsetHeight;return e.$.columnHeader.removeChild(t),e._columnHeights&&e._columnHeights.length>1&&(a=e._columnHeights[0]),a<e.layout.columnMinHeight&&(a=e.layout.columnMinHeight),e.__measuredColumnHeight=a,a}_initializeColumnGroupsHierarchy(){const e=this;let t=0;e.$.columnContainer.innerHTML="";const o=JSON.parse(JSON.stringify(e.columnGroups));if(o.length>0){for(let t=0;t<o.length;t++)o[t].parent=null,o[t].groups=null,o[t].labelTemplate=e.columnGroups[t].labelTemplate;for(let t=0;t<e.viewColumns.length;t++)e.viewColumns[t].parent=null,e.viewColumns[t].groups=null;const a=function(e){for(let t=0;t<o.length;t++){let a=o[t];if(a.name===e)return a}return null},l=function(e){let t=new Array;if(e.columnGroup&&t.push(e),e.groups)for(let o=0;o<e.groups.length;o++)if(e.groups[o].columnGroup)t.push(e.groups[o]);else if(e.groups[o].groups){let a=l(e.groups[o]);for(let e=0;e<a.length;e++)t.push(a[e])}return t};for(let e=0;e<o.length;e++){let t=o[e];if(t.groups||(t.groups=null),t.parentGroup){let e=a(t.parentGroup);e&&(t.parent=e,e.groups||(e.groups=new Array),-1===e.groups.indexOf(t)&&e.groups.push(t))}}for(let t=0;t<e.viewColumns.length;t++){let o=e.viewColumns[t];if(o.columnGroup){let e=a(o.columnGroup);e&&(e.groups||(e.groups=new Array),o.parent=e,-1===e.groups.indexOf(o)&&e.groups.push(o))}}for(let o=0;o<e.viewColumns.length;o++){const a=e.viewColumns[o];let l=a;for(a.level=0;l.parent;)l=l.parent,a.level++;l=a;let n=a.level;for(t=Math.max(t,a.level);l.parent;)l=l.parent,l&&(l.level=--n)}for(let t=0;t<o.length;t++){const a=o[t],n=l(a);a.columns=n;let i=new Array,r=0,s="near";0===n.length&&(r=-1,a.visible=!1);for(let t=0;t<n.length;t++)i.push(e.viewColumns.indexOf(n[t])),n[t].freeze&&("far"===n[t].freeze&&(s="far"),r++);r===n.length?a.freeze=s:r>0&&r<n.length&&(e.classList.add("smart-visibility-hidden"),e.error(e.localize("frozenColumns",{elementType:"Grid"}))),i.sort((function(e,t){return(e=parseInt(e))<(t=parseInt(t))?-1:e>t?1:0}));for(let t=1;t<i.length;t++)i[t]!==i[t-1]+1&&(e.classList.add("smart-visibility-hidden"),e.error(e.localize("columnGroups",{elementType:"Grid"})))}}e._columnGroupsLevel=1+t,e._columnGroups=o}_refreshColumnHeights(){const e=this;e.$.columnHeader.style.height="",e._viewColumnsHeight=e._measureColumnHeight(),e._columnHeights=[];let t=0;for(let o=0;o<e._columnGroupsLevel;o++){let a=e._viewColumnsHeight;e.layout.columnHeight&&(a="number"==typeof e.layout.columnHeight?e.layout.columnHeight?e.layout.columnHeight:e._viewColumnsHeight:e.layout.columnHeight?e.columnHeight(o):e._viewColumnsHeight),a<e.layout.columnMinHeight&&(a=e.layout.columnMinHeight),a?(e._columnHeights.push(a),t+=a):(t+=e._viewColumnsHeight,e._columnHeights.push(e._viewColumnsHeight))}e._columnHeaderHeight=e._columnGroupsLevel*e._viewColumnsHeight,e._columnHeaderHeight=t,e.$.columnHeader.style.height=e._columnHeaderHeight+"px";const o=function(t){let o=0;for(let a=0;a<t.level;a++)o+=e._columnHeights[a];return o},a=function(t){let a=o(t),l=e._columnHeaderHeight-a;for(let o=t.level+1;o<e._columnHeights.length;o++){const a=o;for(let o=0;o<e.viewColumns.length;o++){const n=e.viewColumns[o];let i=!1;if(n.level===a){let o=n;for(;o.parent;){if(o.parent===t){l=e._columnHeights[a],i=!0;break}o=o.parent}if(i)break}}}return l};for(let t=0;t<e.viewColumns.length;t++){const l=e.viewColumns[t],n=a(l);l.computedHeight=n,l.top=o(l)}for(let t=0;t<e._columnGroupsLevel-1;t++)for(let l=0;l<e._columnGroups.length;l++){const n=e._columnGroups[l];if(n.level!==t)continue;if(n.groups){const e=a(n),t=o(n);n.top=t,n.computedHeight=e}const i=n.element;i&&(i.style.width=n.computedWidth+"px",e.rightToLeft?i.style.right=n.left+"px":i.style.left=n.left+"px",i.style.top=n.top+"px",i.style.height=n.computedHeight+"px",i.style.lineHeight=n.computedHeight+"px")}}_refreshColumnWidths(){const e=this;e.__clientSize=null;const t=e.$.verticalScrollBar.offsetWidth>0?e.$.verticalScrollBar.offsetWidth:0,o=e.dataSource.groupBy||[];let a=e.grouping.enabled&&"advanced"===e.grouping.renderMode?e.grouping.groupIndent*(1+o.length):0,l=0;e.selection.checkBoxes.enabled&&(l=e._selectionColumn.computedWidth?e._selectionColumn.computedWidth:e._selectionColumn.minWidth);const n=e._clientSize.width-t-a;let i=0,r=[],s=0,d=0,u=0;if(e.editing.enabled&&!e.editing.commandColumn.inline){const t=function(){const t=document.createElement("div"),o=document.createElement("div"),a=e.editing.commandColumn.dataSource;let l=0,n="",i=0;o.classList.add("smart-label");for(let t in a){const o=a[t];let l=!1;if("commandColumnMenu"===t)continue;let r=!1;l||(!0===o.visible?(i++,r=!0):"auto"===o.visible&&((e.editing.editRow||e.editing.editCell)&&!e.editing.dialog.enabled||"commandColumnEdit"!==t?!e.editing.editRow&&!e.editing.editCell||e.editing.dialog.enabled||("commandColumnUpdate"===t||"commandColumnCancel"===t)&&(i++,r=!0):(i++,r=!0)),l=!0),r&&"icon"!==e.editing.commandColumn.displayMode&&(n+="<span>"+("{{messages}}"===o.label?e.localize(t):o.label)+"</span>")}return o.innerHTML="<span>"+n+"</span>",t.appendChild(o),t.style.width="auto",t.style.position="static",e.$.columnHeader.appendChild(t),l=10+o.firstChild.offsetWidth,e.$.columnHeader.removeChild(t),"icon"===e.editing.commandColumn.displayMode?l=20+20*i:"labelAndIcon"===e.editing.commandColumn.displayMode?l+=25*i:l+=10*i,l};if(e._commandColumn.visible=e.editing.commandColumn.visible,e.editing.commandColumn.visible){const o=e.editing.commandColumn.width?e.editing.commandColumn.width:t();e.columns.canNotify=!1,e._commandColumn.width=o,e.columns.canNotify=!0}}for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];let a;"number"==typeof o.width?a=o.width:o.width&&o.width.toString().indexOf("%")>=0?(a=parseFloat(o.width)/100,a*=n-l):o.width&&(o.width.toString().indexOf("em")>=0||o.width.toString().indexOf("pt")>=0||o.width.toString().indexOf("fr")>=0)?(a=parseFloat(o.width),a*=16):"auto"===o.width?a=o._autoSize():o.visible&&(r.push(o),a=0),o.overflowWidth&&(a-=o.overflowWidth),o.visible&&(i+=a),a<o.minWidth&&(a=o.minWidth),o.computedWidth=a}if(r){let e=n-i,t=0;e<0&&(e=60*r.length);for(let o=0;o<r.length;o++){const a=r[o];let l;l=e/r.length,o===r.length-1&&(l=e-t),a.overflowWidth&&(l-=a.overflowWidth),l<a.minWidth&&(l=a.minWidth),a.computedWidth=l,t+=l}}for(let t=0;t<e.viewColumns.length;t++){let o=e.viewColumns[t];o.visible&&(a>0&&!o.autoGenerated&&(o.computedWidth+=a,a=0),o.freeze?!0===o.freeze||"near"===o.freeze?(o.left=s,u+=o.computedWidth,s+=o.computedWidth):"far"===o.freeze&&(o.left=d,d+=o.computedWidth):(o.left=u,u+=o.computedWidth))}for(let t=0;t<e._columnGroupsLevel-1;t++)for(let o=0;o<e._columnGroups.length;o++){const a=e._columnGroups[o];if(a.level!==t)continue;let l=99999;if(a.groups){const e=function(t){let o=0;for(let a=0;a<t.groups.length;a++){let n=t.groups[a];n.groups?o+=e(n):n.visible&&(l=Math.min(n.left,l),o+=n.computedWidth)}return o};a.computedWidth=e(a),a.left=l}}}_createColumnHeaderCellElements(){const e=this,t=e.$.columnContainer,o=document.createDocumentFragment();let a=0;e._columnElements=[],e.$.columnContainer.innerHTML="",e.$.columnNearContainer.innerHTML="",e.$.columnFarContainer.innerHTML="",e.rightToLeft?(e.$.columnNearContainer.classList.remove("near"),e.$.columnNearContainer.classList.add("far"),e.$.columnFarContainer.classList.remove("far"),e.$.columnFarContainer.classList.add("near")):(e.$.columnNearContainer.classList.remove("far"),e.$.columnNearContainer.classList.add("near"),e.$.columnFarContainer.classList.remove("near"),e.$.columnFarContainer.classList.add("far"));for(let t=0;t<e._frozenNearColumns.length;t++)e._frozenNearColumns[t].createElement();for(let t=0;t<e._frozenFarColumns.length;t++)e._frozenFarColumns[t].createElement();for(let t=0;t<e.viewColumns.length;t++){const l=e.viewColumns[t];if(l.freeze)continue;const n=l.createElement();void 0!==l.computedWidth?(a+=l.computedWidth,e._columnElements.push(n),a<2*e._clientSize.width&&o.appendChild(n)):(e._columnElements.push(n),o.appendChild(n))}for(let t=0;t<e._columnGroups.length;t++){const a=e._columnGroups[t],l=new Smart.Grid.Column({visible:void 0===a.visible||a.visible,allowSort:!1,allowFilter:!1,allowSelect:!1,grid:e,dataField:a.name,label:a.label,labelTemplate:a.labelTemplate,align:a.align,verticalAlign:a.verticalAlign,showIcon:!1});a.column=l;const n=l.createElement();n.style.width=a.computedWidth+"px",e.rightToLeft?n.style.right=a.right+"px":n.style.left=a.left+"px",n.style.top=a.top+"px",n.style.height=a.computedHeight+"px",n.style.lineHeight=a.computedHeight+"px",o.appendChild(n),a.element=n,a.grid=this,n.onpointerdown=t=>{if(e.selection.allowColumnHeaderSelection){const t=function(e){let o=new Array;if(e.columnGroup&&o.push(e),e.groups)for(let a=0;a<e.groups.length;a++)if(e.groups[a].columnGroup)o.push(e.groups[a]);else if(e.groups[a].groups){let l=t(e.groups[a]);for(let e=0;e<l.length;e++)o.push(l[e])}return o},o=t(a);e._selectColumnsRange(o[0].dataField,o[o.length-1].dataField)}}}e.htmlColumnLastChild||(e.htmlColumnLastChild=document.createElement("smart-grid-column"),e.htmlColumnLastChild.classList.add("top-far-corner"),e.htmlColumnLastChild.onpointerdown=e=>{e.stopPropagation(),e.preventDefault()},e.$.columnHeader.appendChild(e.htmlColumnLastChild)),t.appendChild(o),t.style.width=e._computedColumnsWidth+"px",e._refreshFrozenColumns()}_refreshFrozenColumns(){const e=this;e.$.columnNearContainer.style.width=e._frozenColumnsNearWidth+"px",e.$.columnFarContainer.style.width=e._frozenColumnsFarWidth+"px";for(let t=0;t<e._columnGroups.length;t++){const o=e._columnGroups[t];o.freeze&&o.element&&(!0===o.freeze||"near"===o.freeze?e.$.columnNearContainer.appendChild(o.element):"far"===o.freeze&&e.$.columnFarContainer.appendChild(o.element))}for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];o.freeze&&o.element&&(!0===o.freeze||"near"===o.freeze?e.$.columnNearContainer.appendChild(o.element):"far"===o.freeze&&e.$.columnFarContainer.appendChild(o.element))}}get _clientSize(){const e=this;if(e.__clientSize)return e.__clientSize;const t=getComputedStyle(e.$.container),o=parseFloat(t.paddingLeft)+parseFloat(t.paddingRight),a=parseFloat(t.paddingTop)+parseFloat(t.paddingBottom),l=parseFloat(t.borderLeftWidth)+parseFloat(t.borderRightWidth),n=parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth);return e.__clientSize={width:e.$.container.offsetWidth-o-l,height:e.$.container.offsetHeight-a-n},e.__clientSize}_initializeRowElements(){const e=this;if(!e.rows)return;e.rows.canNotify=!1;let t=0,o=e._clientSize.height;e.$.rowNearContainer.innerHTML="",e.$.rowFarContainer.innerHTML="",e.$.rowContainer.innerHTML="",e._rowElements=[],e._overflowOffset=Math.max(o,300),e.rightToLeft?(e.$.rowNearContainer.classList.remove("near"),e.$.rowNearContainer.classList.add("far"),e.$.rowFarContainer.classList.remove("far"),e.$.rowFarContainer.classList.add("near")):(e.$.rowFarContainer.classList.remove("near"),e.$.rowFarContainer.classList.add("far"),e.$.rowNearContainer.classList.remove("far"),e.$.rowNearContainer.classList.add("near"));const a=e.offsetHeight;e.$.container.classList.add("smart-hidden");const l=e.offsetHeight;e.$.container.classList.remove("smart-hidden"),"hidden"!==e.verticalScrollBarVisibility&&a===l||(o=e._scrollHeight);const n=function(){const a=document.createDocumentFragment();if(e.rows&&0===e.rows.length)return;for(let l=0;l<e.rows.length;l++){const n=e.rows[l];if(n.freeze&&n.visible)continue;const i=n.createElement();if(a.appendChild(i),t+=e.layout.rowMinHeight,t>e._overflowOffset+o)break}e.$.rowContainer.appendChild(a);const l=e.$.rowContainer.children;for(let t=0;t<l.length;t++){const o=l[t];e.rows[t]&&(e.rows[t].element=o),e._rowElements[t]=o}};for(let t=0;t<e._frozenNearRows.length;t++){const o=e._frozenNearRows[t];o.grid=e;const a=o.createElement();o.element=a,e.$.rowNearContainer.appendChild(a)}for(let t=0;t<e._frozenFarRows.length;t++){const o=e._frozenFarRows[t];o.grid=e;const a=o.createElement();o.element=a,e.$.rowFarContainer.appendChild(a)}n();let i=0;for(;t<1.5*o&&++i<50;)n();e.rows.canNotify=!0}_refreshSummary(e){const t=this;t.summaryRow.visible&&(t._summaryUpdateTimer&&clearTimeout(t._summaryUpdateTimer),t._summaryUpdateTimer=setTimeout((()=>{!0!==t.editing.isEditing&&(t._calculateSummary(),!1!==e&&t._recycle(!1,!0,!1))}),100))}_initializeRows(){const e=this;let t=0;e._frozenNearDefaultRows=[],e._frozenFarDefaultRows=[],e.rows=[],e.rowById=[],e._frozenFarRows=[],e._frozenNearRows=[];let o=new Date;const a=function(){let t=[],o=!1;for(let a=0;a<e.columns.length;a++){const l=e.columns[a];let n={};l.summary&&l.summary.length>0&&(o=!0,n[l.dataField]=l.summary,t.push(n))}if(!o)return void(e._summaryItems=[]);const a=e.getSelectedRowIds();if(a.length>=1){const o=[];for(let t=0;t<a.length;t++){const l=e.dataSource.dataItemById[a[t]];l&&o.push(l)}e._summaryItems=e.dataSource.summarize(t,o)}else if(e._selection&&e._selection.cells&&Object.keys(e._selection.cells).length>2){const o=e.getSelectedCells(!1),a=[],l=[];for(let t=0;t<o.length;t++){const n=o[t],i=n[0],r=e.dataSource.dataItemById[i];-1===a.indexOf(r)&&a.push(r),-1===l.indexOf(n[1])&&l.push(n[1])}e._summaryItems=e.dataSource.summarize(t,a);const n=Object.keys(e._summaryItems);for(let t=0;t<n.length;t++){const o=n[t];-1===l.indexOf(o)&&delete e._summaryItems[o]}}else e._summaryItems=e.dataSource.summarize(t)};e._calculateSummary=a;const l=e.columns?e.columns.filter((e=>void 0!==e.getCellValue)):[],n=function(a,n,i){let r=null;if(e.isInitialized&&(o=new Date),r=a?a.grid?a:new Smart.Grid.Row({data:a,index:n,grid:e,createdBy:e.currentUser,createdDate:o}):new Smart.Grid.Row({data:{},index:n,grid:e,createdBy:e.currentUser,createdDate:o}),l)for(let e=0;e<l.length;e++){const t=l[e],o=t.getCellValue(r.id,t.dataField,a);void 0!==o&&(r.data[t.dataField]=o)}if(e.rowById[r.id]&&(r.id=e.rows.length,e.rowById[r.id])){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};r.id=e()}if(e.onRowInit){e.onRowInit(n,r,e),30!==r.height&&(r.cellHeight=r.height);for(let t in r)-1!==r.properties.indexOf(t)||t.startsWith("_")||e.error(e.localize("invalidRowProperty",{elementType:"Grid",propertyName:t}))}if(r.selected&&(e._selection.rows[r.id]=!0,e._selection.indexes[r.index]=r.index),r.freeze&&r.visible){if(!0===r.freeze||"near"===r.freeze){e.rows.splice(t++,0,r);const o=e.rows[t-1];-1===e._frozenNearRows.indexOf(o)&&e._frozenNearRows.push(o)}else if("far"===r.freeze){e.rows.push(r);const t=e.rows[e.rows.length-1];-1===e._frozenFarRows.indexOf(t)&&e._frozenFarRows.push(t)}}else e.rows[n]?e.rows.splice(n,0,r):e.rows.push(r),r.data&&r.data.$&&(r.data.$.history=r.history,r.data.$.starred=r.starred,r.data.$.comments=r.comments,r.data.$.style=r.style);if(!("virtual"===e.scrolling||e.paging.enabled&&e.dataSource&&e.dataSource.virtualDataSource))if(e.onRowInserted){const t=void 0===n?e.rows[e.rows.length-1]:e.rows[n],o=o=>{const a=t;if(void 0!==o&&Array.isArray(o)&&(o=o[0]),void 0===o){if(e.rowById[a.id]){const t=e.dataSource.dataItemById[a.id],o=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};a.id=o(),a.data&&a.data.$?a.data.$.id=a.id:a.data.id=a.id,e._getId()&&(a.data[e._getId()]=a.id),t&&(e.dataSource.dataItemById[a.id]=a.data)}e.rowById[a.id]=a}else{const t=e.dataSource.dataItemById[a.id];a.id=o,a.data&&a.data.$?a.data.$.id=a.id:a.data.id=a.id;const l=e._getId();l&&(a.data[e._getId()]=a.id),t&&(t[l]=o,e.dataSource.dataItemById[a.id]=t,a.data=t),e.rowById[a.id]=a}-1!==a.index&&void 0!==a.index||(a.index=e.rows.length),e._setAddUndoRedo(a),!e.editing.isEditing&&e.isInitialized&&e._recycle(!1,!0),e._onRowInserted&&e._onRowInserted(a),i&&i(a)};if(void 0===n&&(n=e.rows.length-1,void 0!==t.index&&-1!==t.index||(t.index=n)),e.isInitialized){e._rowInsertTimer&&clearTimeout(e._rowInsertTimer),e._rowInsert||(e._rowInsert=[]),e._rowInsert.push({row:t,index:n});const a=e._keyboardAdd?300:150;e._rowInsertTimer=setTimeout((()=>{if(1===e._rowInsert.length)e.onRowInserted([n],[t],o,e),delete e._rowInsert,delete e._undoRedoAction;else{let t=[],o=[];for(let a=0;a<e._rowInsert.length;a++)t.push(e._rowInsert[a].index),o.push(e._rowInsert[a].row);delete e._rowInsert,e.onRowInserted(t,o,(t=>{e.beginUpdate();for(let a=0;a<o.length;a++){const l=o[a],n=t?t[a]:void 0;if(void 0!==n){const t=e.dataSource.dataItemById[l.id];l.id=l.data.id=n;const o=e._getId();o&&(l.data[e._getId()]=l.id),e.rowById[l.id]=l,t&&(t[o]=n,e.dataSource.dataItemById[l.id]=t,l.data=t)}e._setAddUndoRedo(l),-1!==l.index&&void 0!==l.index||(l.index=e.rows.length),e._onRowInserted&&e._onRowInserted(l),i&&i(l)}delete e._undoRedoAction,e.endUpdate(!1)}),e)}}),a)}else e.onRowInserted([n],[t],o,e)}else{const t=void 0===n?e.rows[e.rows.length-1]:e.rows[n];void 0===n&&(n=e.rows.length-1,void 0!==t.index&&-1!==t.index||(t.index=n)),i&&i(t)}},i=function(){const t=e.rows[e.rows.length-1];e.rows.pop(),e.onRowRemoved&&e.onRowRemoved([t.id],[t.index],e),e._setRemoveUndoRedo(t)},r=function(t){const o=e.rows[t];o.selected&&o.setProperty("selected",!1),e.rows.splice(t,1),e.onRowRemoved&&e.onRowRemoved([o.id],[t],e),e._setRemoveUndoRedo(o)};e._add=n,e._removeLastRow=i,e._removeAt=r,e._rowHeight=e._autoRowHeight;const s=e.dataSource.length;if(e.setAttribute("aria-rowcount",s),e.dataSource&&e.dataSource.virtualDataSource&&!e.dataSource.virtualDataSourceOnExpand&&e.dataSource.length>e.virtualModeCachedRowsCount&&"infinite"!==e.scrolling){let t=e.dataSource.length>e.virtualModeCachedRowsCount?e.virtualModeCachedRowsCount:e.dataSource.length;"infinite"===e.scrolling&&(t=e.dataSource.length);for(let o=0;o<t;o++){const t=e.dataSource[o];n(t,o)}}else for(let t=0;t<e.dataSource.length;t++){const o=e.dataSource[t];n(o,t)}for(let t=0;t<e._frozenFarRows.length;t++){const o=e._frozenFarRows[t];e.rows.splice(e.rows.indexOf(o),1),e.rows.push(o)}if(a(),e.dataSource.notify((function(t){if(e.dataSource._updating)return;const o=t.data;e.rows.canNotify=!1;let l=!1;switch(t.action){case"add":if(!o)return;if(void 0!==o.length)for(let t=0;t<o.length;t++)n(o[t],e.dataSource.length-o.length+t);else n(o,e.dataSource.length-1);break;case"update":if(o.length){let o=[],a=[],i=[];for(let r=0;r<i.length;r++){const s=t.index[r];e.rows[s]?(e.rows[s].data=i[r],o.push(s),a.push(e.rows[s]),i.push(e.rows[s].data)):(n(i[r],i[r].$.index),l=!0)}e.onRowUpdated&&e.onRowUpdated(o,a,i,e)}else{const a=t.index;e.rows[a]?e.rows[a].data=o:n(o,e.dataSource.length-1),e.onRowUpdated&&e.onRowUpdated([a],[e.rows[a]],[e.rows[a].data],e)}break;case"insert":n(o,t.index);for(let t=0;t<e.rows.length;t++)e.rows[t].index=t;break;case"remove":r(t.index);break;case"removeLast":i();break;case"bindingComplete":if(e.dataSource&&e.dataSource.url||e.dataSource&&!e.dataSource.virtualDataSource){if(e.appearance.displayLoadingIndicator=!1,e._setLoadingIndicatorVisibility(),e._toggledRow=null,e.dataSource.length!==s){if(e.paging.enabled){const t=e.$.headerPager.querySelector("smart-pager"),o=e.$.footerPager.querySelector("smart-pager");t&&(t.pagesCount=Math.ceil(e.dataSource.length/e._pageSize)),o&&(o.pagesCount=Math.ceil(e.dataSource.length/e._pageSize))}e._initializeRows(),e._initializeRowElements(),e.refresh()}e._recycle(),e.onLoad&&(e.onLoad(),e.onLoad())}}a(),("update"!==t.action||l)&&e._refreshLayout(),e._recycle(),e.rows.canNotify=!0})),e._observeRows(),e.summaryRow.visible){const t=new Smart.Grid.Row({height:e.layout.rowMinHeight,freeze:"near",visible:"near"===e.summaryRow.position,summaryRowIndex:0,summaryRow:!0}),o=new Smart.Grid.Row({height:e.layout.rowMinHeight,freeze:"far",visible:"far"===e.summaryRow.position,summaryRowIndex:0,summaryRow:!0});"near"===e.summaryRow.position&&e._frozenNearRows.splice(0,0,t),"far"===e.summaryRow.position&&e._frozenFarRows.push(o)}if(e.filtering.enabled&&e.filtering.filterRow.visible){const t=new Smart.Grid.Row({freeze:!0,autoGenerated:!0,filterRow:!0});e._frozenNearRows.splice(0,0,t)}e._renderAddNewRow()}_observeRows(){const e=this;e._frozenNearRows=[],e._frozenFarRows=[],e.rows=new Smart.ObservableArray(e.rows,null,{allowToggle:!0,allowResize:!0,allowCheck:!0,allowSelect:!0,allowReorder:!0,expanded:!0,selected:!0,checked:!0,visible:!0,enabled:!0,minHeight:!0,height:!0,freeze:!0,showDetail:!0,data:!0,visibleIndex:!0,index:!0,comments:!0,style:!0,starred:!0,updatedBy:!0,updatedDate:!0,createdDate:!0,createdBy:!0,history:!0});for(let t=0;t<e.rows.length;t++){const o=e.rows[t];!0===o.freeze||"near"===o.freeze?e._frozenNearRows.push(o):"far"===o.freeze&&e._frozenFarRows.push(o),e.rowById[e.rows[t].id]=o}e.rows.notify((function(t){if(!e.rows.canNotify)return;const o=t.action;if("length"===o)return;if(t.path)return e.rows.canNotify=!1,(e.rowById[t.target.id]||"selected"===t.propertyName)&&(a=t.target,l=t.propertyName,n=t.oldValue,i=t.newValue,n===i&&"selected"!==l&&"showDetail"!==l||(a.propertyChanged(l,n,i),e.onRowChange&&a.properties.indexOf(l)>=0&&e.onRowChange(a,l,n,i,e))),void(e.rows.canNotify=!0);var a,l,n,i;if(e.rows.canNotify=!1,!e.dataSource)return;switch(e.dataSource.canNotify=!1,o){case"add":{const o=function(o){let a=e.rows[o];if(a instanceof Smart.Grid.Row==0){a=new Smart.Grid.Row(a);const l=e.rows.canNotify;e.rows.canNotify=!1,t.object[o]=a,a=t.object[o],e.rows.canNotify=l}if(a.grid=e,e.dataSource&&e.dataSource.virtualDataSource){e.rows.canNotify=!1;for(let t=0;t<e.rows.length;t++){const o=e.dataSource.boundSource[t],a=e.rows[t];o&&(a.data=o,a.id=o.$.id),e.rowById[a.id]=a}e.rows.canNotify=!0}else(()=>{if(0===e.dataSource.length&&e.dataSource.dataFields&&0===e.dataSource.dataFields.length&&e.columns&&e.columns.length){let t=[];for(let o=0;o<e.columns.length;o++){const a=e.columns[o];t.push({name:a.dataField,dataType:a.dataType||"string"})}e.dataSource.dataFields=t}o<e.dataSource.length?e.dataSource.insert(o,e.rows[o].data):e.dataSource.add(e.rows[o].data),e.dataSource[o]&&(a.data=e.dataSource[o],void 0!==e.dataSource[o].$.id&&(a.id=e.dataSource[o].$.id,e.rowById[a.id]=a),a.data.$&&a.history&&(a.data.$.history=a.history)),-1!==a.index&&void 0!==a.index||(a.index=o),a.selected&&(e._selection.rows[a.id]=!0,e._selection.indexes[a.index]=a.index),a.freeze&&(!0===a.freeze||"near"===a.freeze?e._frozenNearRows.push(a):"far"===a.freeze&&e._frozenFarRows.push(a))})()};for(let e=0;e<t.addedCount;e++)o(t.index+e);break}case"update":if(t.target){const o=e.rowById[t.target.id],a=e.rows.indexOf(o);e.dataSource.update(a,o)}else{const o=e.rows.indexOf(t.index);e.dataSource.update(t.index,o)}break;case"remove":{if(e.dataSource&&e.dataSource.virtualDataSource){e.rows.canNotify=!1;const o=t.removed&&t.removed.length>0?t.removed[0]:null;o&&delete e.rowById[o.id];for(let t=0;t<e.dataSource.boundSource.length;t++){const o=e.dataSource.boundSource[t],a=e.rows[t];a.data=o,a.id=o.$.id,e.rowById[a.id]=a}return e.rows.canNotify=!0,void e.refresh()}const o=t.removed&&t.removed.length>0?t.removed[0]:null;o&&delete e.rowById[o.id],e.dataSource.removeAt(t.index);break}}if(e.dataSource.canNotify=!0,e.rows.canNotify=!0,!o)return;let r=e.isInitialized&&e._rowElements&&e._rowElements.length<e.rows.length;"add"===o&&1===t.addedCount&&r&&e._rowElements.length>0&&e._rowElements[e._rowElements.length-1].classList.contains("smart-hidden")&&(r=!1),r&&e._initializeRowElements(),e.refresh(),e._refreshPagesCount(),e._sortedColumns&&e._sortedColumns.length>0&&e.refreshSort()}))}render(){const e=this,t=()=>0===e.offsetWidth||0===e.offsetHeight;if(t())return requestAnimationFrame((()=>{e.isInitialized||t()||e._render()})),e.setAttribute("role","grid"),e.editing.enabled||e.setAttribute("aria-readonly",!0),void super.render();const o=e.context;e.context=e,e.setAttribute("role","grid"),e.editing.enabled||e.setAttribute("aria-readonly",!0),e._undoRedo=[],e._refreshCurrentUser(),e._render(),e.context=o,super.render()}_renderColumns(e){const t=this;t._initializeColumns(),t._initializeColumnGroupsHierarchy(),t._refreshColumnsResponsiveVisibility(),t._createColumnHeaderCellElements(),t._renderColumnGroupHeaders(),!1!==e&&t._refresh()}_renderRows(e){const t=this;t._initializeRows(),t._initializeRowElements(),!1!==e&&t._refresh()}_render(){const e=this;if(e.isInitialized||(e.onBeforeInit&&(e.onBeforeInit(e),e.onBeforeInit=null),e.$.fireEvent("beforeInit",{grid:e}),e.header.visible&&e.header.buttons.indexOf("views")>=0&&e._updateKanbanTaskFields()),(()=>{if(null===e.dataSource)e.dataSource=new Smart.DataAdapter;else if(Array.isArray(e.dataSource)||"string"==typeof e.dataSource){let t=[];if(e.dataSourceSettings.dataFields&&e.dataSourceSettings.dataFields.length>0)e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource,dataSourceType:e.dataSourceSettings.dataSourceType,dataFields:e.dataSourceSettings.dataFields,keyDataField:e.dataSourceSettings.keyDataField,parentDataField:e.dataSourceSettings.parentDataField,childrenDataField:e.dataSourceSettings.childrenDataField,groupBy:e.dataSourceSettings.groupBy||e.grouping.groupBy,mapChar:e.dataSourceSettings.mapChar,root:e.dataSourceSettings.root,record:e.dataSourceSettings.record,autoGenerateColumns:e.autoGenerateColumns,id:e.dataSourceSettings.id,virtualDataSource:e.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:e.dataSourceSettings.virtualDataSourceOnExpand});else if(e.columns&&e.columns.length){for(let o=0;o<e.columns.length;o++){const a=e.columns[o];t.push({name:a.dataField,dataType:a.dataType||"string"})}e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource,dataFields:t,dataSourceType:e.dataSourceSettings.dataSourceType,keyDataField:e.dataSourceSettings.keyDataField,parentDataField:e.dataSourceSettings.parentDataField,childrenDataField:e.dataSourceSettings.childrenDataField,groupBy:e.dataSourceSettings.groupBy||e.grouping.groupBy,mapChar:e.dataSourceSettings.mapChar,root:e.dataSourceSettings.root,record:e.dataSourceSettings.record,autoGenerateColumns:e.autoGenerateColumns,id:e.dataSourceSettings.id,virtualDataSource:e.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:e.dataSourceSettings.virtualDataSourceOnExpand})}else e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource})}})(),e._selection={rows:[],indexes:[],columns:[],cells:[]},e.dataSource&&e.dataSource.url&&(e.appearance.displayLoadingIndicator=!0,e._setLoadingIndicatorVisibility(),e.dataSource.data={sorting:e.getSortedColumns(),filtering:e.getFilteredColumns(),grouping:e.grouping.groupBy}),e.filtering.filterRow)for(let t=0;t<e.columns.length;t++)e.columns[t]._filterEditorInitialized&&(e.columns[t]._filterEditorInitialized=!1);const t=!e.isInitialized;if(t&&(e.onInit&&(e.onInit(e),e.onInit=null),e.$.fireEvent("init",{grid:e})),e._renderColumns(!1),e._renderRows(!1),e._renderPagers(),e._renderCommandBar(),e._renderConditionalFormatting(),t&&e.grouping.enabled&&e.grouping.groupBy.length&&e.dataSource&&(e.dataSource.groupBy=e.grouping.groupBy),e.appearance.allowColumnStickyPosition&&e._stickHeader(),e.header.visible&&""===e.header.template){const t=document.createElement("smart-grid-toolbar");t.headerPosition="top",t.messages=e.messages,t.locale=e.locale,e.$.header.appendChild(t),e.$.headerBar=e.$.header.firstElementChild,e.$.headerBar._init(e)}if(e.isInitialized)e.refreshFilters();else{let t=!1;if(e.stateSettings.autoLoad){const o=e.stateSettings.current?e.stateSettings.current:e.stateSettings.current="smartGrid"+e.id;(e.stateSettings.storage?e.stateSettings.storage[o]:window.localStorage.getItem(o))&&(t=!0)}if(!t){const t=[];for(let o=0;o<e.viewColumns.length;o++){const a=e.viewColumns[o];a.allowSort&&a.sortOrder&&t.push(a)}if(0===t.length&&e.sorting.sort)for(let o=0;o<e.sorting.sort.length;o++){const a=e.sorting.sort[o],l=Object.keys(a)[0],n=a[l],i=e.columnByDataField[l];i&&(t.push(i),i.sortOrder=n||"asc")}t.sort(((e,t)=>e.sortIndex-t.sortIndex));for(let o=0;o<t.length;o++){const a=t[o],l=e.appearance.allowSortAnimation;e.appearance.allowSortAnimation=!1,e.sortBy(a.dataField,a.sortOrder),e.appearance.allowSortAnimation=l}if(e.filtering.filter.length>0){for(let t=0;t<e.filtering.filter.length;t++){const o=e.filtering.filter[t];if(o){const t=o[0],a=o.splice(1);let l=null;if(a instanceof Smart.FilterGroup)l=a;else{const o=e.columnByDataField[t];o&&(l=e.dataSource._createFilter(o.dataType,a))}l&&e.addFilter(t,l,!1)}}e.refreshFilters()}else{for(let t=0;t<e.columns.length;t++){const o=e.columns[t];if(o.filter){let t=null,a=o.filter;t=a instanceof Smart.FilterGroup?a:e.dataSource._createFilter(o.dataType,a),t&&e.addFilter(o.dataField,t,!1)}}e.refreshFilters()}}}if(e.viewColumns.canNotify=!0,e.isInitialized=!0,("virtual"===e.scrolling||e.paging.enabled&&e.dataSource&&e.dataSource.virtualDataSource||e.dataSource&&e.dataSource.virtualDataSource)&&e._virtualDataRequest("dataBind"),""!==e.header.template&&e._applyTemplate(e.header.template,e.$.header),""!==e.footer.template&&e._applyTemplate(e.footer.template,e.$.footer),e._createFilterPanels(),e._refresh(),e._applyScrolling(),e.grouping.enabled&&e.grouping.autoExpandAll&&e.rowHierarchy?e.expandAllRows():e.grouping.enabled&&e.grouping.autoExpandToLevel&&e.rowHierarchy&&e.expandRowsToGroupLevel(e.grouping.autoExpandToLevel),e.onRender&&(e.onRender(t),e.onRender=null),e.isRendered=!0,"auto"===e.layout.rowHeight&&(e._refreshLayout(),e._recycle()),t){if(e.stateSettings.autoLoad){const t=e.stateSettings.current?e.stateSettings.current:e.stateSettings.current="smartGrid"+e.id;let o=e.stateSettings.storage?e.stateSettings.storage[t]:window.localStorage.getItem(t);o&&("string"==typeof o&&(o=JSON.parse(o)),e._loadState(o))}if(e.onAfterInit&&(e.onAfterInit(e),e.onAfterInit=null),e.$.fireEvent("afterInit",{grid:e}),e.isRendering=!1,e.whenRenderedCallbacks){for(let t=0;t<e.whenRenderedCallbacks.length;t++)e.whenRenderedCallbacks[t]();e.whenRenderedCallbacks=[]}!e.dataSource||e.dataSource.url||e.dataSource.virtualDataSource||e.onLoad&&e.onLoad(e)}"kanban"===e.view&&e._initKanbanView()}get _viewRows(){const e=this;if(e.__viewRows)return e.__viewRows;e._nearRowsAdded||(e._nearRowsAdded=[],e._farRowsAdded=[]);const t=e.rows.toArray?e.rows.toArray():[],o=e.rowHierarchy?e.rowHierarchy:t,a=[].concat(e._frozenNearDefaultRows,e._nearRowsAdded,o,e._farRowsAdded,e._frozenFarDefaultRows);return e.__viewRows=a,a}_toHex(e){if(-1!==e.indexOf("#"))return e;const t=/rgb\((\d+), (\d+), (\d+)\)/g.exec(e);return t?"#"+(parseFloat(t[1]).toString(16).padStart(2,"0")+parseFloat(t[2]).toString(16).padStart(2,"0")+parseFloat(t[3]).toString(16).padStart(2,"0")).toUpperCase():"#FFFFFF"}_renderConditionalFormatting(){const e=this,t=e.conditionalFormatting;if(!t||0===t.length)return;if(!e._defaults){const t=getComputedStyle(e);e._defaults={fontFamily:t.fontFamily,fontSize:t.fontSize,text:e._toHex(t.color),highlight:e._toHex(t.backgroundColor)}}e._formatter||(e._formatter=new Smart.Utilities.ConditionalFormatter(e.dataSource));const o=e._defaults,a=e._formatter,l=[],n=function(t){if("all"===t){if(e.columns&&e.columns.map){const t=[];for(let o=0;o<e.columns.length;o++){const a=e.columns[o];a.dataField.startsWith("task")||a.autoGenerated||"number"!==a.dataType&&"date"!==a.dataType||t.push(a.dataField)}return t}return[]}return[t]};for(let e=0;e<t.length;e++){t[e]=Object.assign({column:"all",condition:"lessThan",firstValue:0,secondValue:1,fontFamily:o.fontFamily,fontSize:o.fontSize,text:o.text,highlight:o.highlight},t[e]);const i=t[e],r=n(i.column),s=i.condition;a.color=i.highlight,a.comparator=i.firstValue,a.min=i.firstValue,a.max=i.secondValue;const d=a.format(s,r);for(let e in d){const t=d[e];for(let e in t){const o=t[e];o.color=i.text,o.fontFamily=i.fontFamily,o.fontSize=i.fontSize}}l.push(d)}if(e._formattingPanel&&(e._formattingPanel.items=t),0===l.length)return l[0];const i={};for(let e=0;e<l.length;e++){const t=l[e];for(let e in t){const o=t[e];if(0!==Object.keys(o).length){i[e]||(i[e]={});for(let t in o)i[e][t]=Object.assign({},i[e][t],o[t])}}}e._conditionalFormatting=i}_stickHeader(){const e=this;e._stickyHeaderHandler=function(){e._handleStickyHeader()},e.$.columnHeader.style.top="",e.$.columnHeader.classList.remove("smart-columns-sticky");let t=e.parentNode;for(e.isInShadowDOM&&t===e.getRootNode()&&(t=e.getRootNode().host);t!==document&&t;)t.addEventListener("scroll",e._stickyHeaderHandler),t=t.parentNode,e.isInShadowDOM&&t===e.getRootNode()&&(t=e.getRootNode().host);try{null!==window.top&&window.top!==window.self&&window.top.document.addEventListener("scroll",e._stickyHeaderHandler)}catch(e){}e._handleStickyHeader()}_unstickHeader(){const e=this;e.$.columnHeader.style.top="",e.$.columnHeader.classList.remove("smart-columns-sticky");let t=e.parentNode;for(;t!==document.body;)t.removeEventListener("scroll",e._stickyHeaderHandler),t=t.parentNode,e.isInShadowDOM&&t===e.getRootNode()&&(t=e.getRootNode().host);try{(""!==document.referrer||window.frameElement)&&null!==window.top&&window.top!==window.self&&window.top.document.removeEventListener("scroll",e._stickyHeaderHandler)}catch(e){}}_handleStickyHeader(){const e=this;if(e.appearance.allowColumnStickyPosition)if(e.$.columnHeader.classList.add("smart-columns-sticky"),0===document.scrollTop&&0===e.parentElement.scrollTop)e.$.columnHeader.style.top="";else{let t=e.parentNode,o=0;for(;t!==document.body;)o+=parseInt(t.scrollTop),t=t.parentNode,e.isInShadowDOM&&t===e.getRootNode()&&(t=e.getRootNode().host);const a=parseInt(e.clientTop+o);e.$.columnHeader.style.top=a+"px";let l=0;window.top!==window.self&&parseInt(window.top.scrollY)>parseInt(e._offsetTop(window.frameElement))&&(l=parseInt(window.top.scrollY)-parseInt(e._offsetTop(window.frameElement))),window.scrollY+l>e.offsetTop&&(e.$.columnHeader.style.top=parseInt(window.scrollY)-parseInt(e.offsetTop)+a+l+"px")}}_scrollHandler(){this._handleStickyHeader()}_initializeRowNumberColumn(){const e=this;if(e._frozenNearColumns&&e._frozenNearColumns.length>0&&e._frozenNearColumns[0].rowHeaderColumn)return void(e._frozenNearColumns[0].visible=e.appearance.showRowHeaderNumber||e.appearance.showRowHeader);const t=new Smart.Grid.Column({dataField:"_rowHeaderColumn",label:"",allowSelect:!1,freeze:!0,visible:!0,grid:e,autoGenerated:!0,rowHeaderColumn:!0,cellsAlign:"center"}),o=e.rows?e.rows.length:e.dataSource?e.dataSource.length:0;let a=e.appearance.showRowHeaderNumber?t._measureSize(o):30;e.layout.autoGenerateColumnWidth&&(a=e.layout.autoGenerateColumnWidth),t.width=a,t.createElement();const l=new Smart.Observable(t,t.observables);e.viewColumns.splice(0,0,l),e._frozenNearColumns.splice(0,0,l)}_initializeColumns(){const e=this;if("number"==typeof e.columns){const t=[],o="A".charCodeAt(0);let a="",l=0;for(let n=0;n<e.columns;n++){let i=n+1;const r=String.fromCharCode(o+l);l++;const s=a+r;"number"!==e.appearance.autoGenerateColumnLabelMode&&(i=a+r),t.push({align:"center",label:i,dataField:s,width:100}),l>=26&&(l=0,a+="A")}e._boundColumns=t}else e._boundColumns=Array.isArray(e.columns)?[...e.columns]:[...e.columns.toArray()];e._initColumns=e.columns,e.columnByDataField=[],e.viewColumns=[],e.columns=new Smart.ObservableArray,e._frozenFarColumns=[],e._frozenNearColumns=[],e._summaryRowCount=1;let t=0;const o=function(t){if(e.dataSource.dataFields){const o=e.dataSource.dataFields.find((e=>{if(e.name===t.dataField)return e})),a=o&&o.dataType||"string";t.dataType||(t.dataType=a)}};if(0===e._boundColumns.length&&e.dataSource&&e.dataSource[0]&&!1!==e.dataSource.autoGenerateColumns){const t=e.dataSource[0];if(t.$&&t.$.isEmpty&&e.dataSource.dataFields)for(let t=0;t<e.dataSource.dataFields.length;t++){const o=e.dataSource.dataFields[t],a=e._boundColumns.length,l={index:a,visibleIndex:a,label:o.name,dataField:o.name,dataType:o.dataType};e._boundColumns.push(l)}else for(let a in t){if(a.startsWith("_")||"$"===a)continue;const t=e._boundColumns.length,l={index:t,visibleIndex:t,label:a,dataField:a};o(l),e._boundColumns.push(l)}}for(let a=0;a<e._boundColumns.length;a++){let l=e._boundColumns[a];if("string"==typeof l){if(e.dataSource.dataFields){const t=e.dataSource.dataFields.find((e=>{if(e.name===l)return e}));l={label:l,dataField:l,dataType:t&&t.dataType||"string"}}}else o(l);l.visibleIndex=a,l.index=a,l.grid=e,l.label&&/<.+?>/.test(l.label)&&l.label.replace&&("all"===e.dataSourceSettings.sanitizeHTML?l.label=l.label.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""):"blackList"===e.dataSourceSettings.sanitizeHTML&&(l.label=window.Smart.Utilities.Core.escapeHTML(l.label)));const n=new Smart.Grid.Column(l);e.onColumnInit&&e.onColumnInit(a,n);for(let t in n)-1!==n.properties.indexOf(t)||t.startsWith("_")||e.error(e.localize("invalidColumnProperty",{elementType:"Grid",propertyName:t,type:n.dataField||"Column"}));n.grid=e,e.columns.push(n);const i=e.columns[e.columns.length-1];e._summaryRowCount=Math.max(e._summaryRowCount,n.summary.length),n.freeze?!0===n.freeze||"near"===n.freeze?(e.viewColumns.splice(t++,0,i),e._frozenNearColumns.push(i)):"far"===n.freeze&&e._frozenFarColumns.push(i):e.viewColumns.push(i),e.columnByDataField[n.dataField]?(i.parent=e.columnByDataField[n.dataField],e.columnByDataField[n.dataField].children||(e.columnByDataField[n.dataField].children=[]),e.columnByDataField[n.dataField].children.push(i),n.valueField=n.dataField,n.dataField+="_"+e.columnByDataField[n.dataField].children.length,n.displayField=n.valueField,e.columnByDataField[n.dataField]=i):e.columnByDataField[n.dataField]=i,e.onColumnInserted&&!e.isInitialized&&e.onColumnInserted(a,n.getState())}e.viewColumns=e.viewColumns.concat(e._frozenFarColumns),e.setAttribute("aria-colcount",e._boundColumns.length);let a=0;if((e.appearance.showRowHeaderNumber||e.appearance.showRowHeader)&&(e._initializeRowNumberColumn(),a++),e.rowDetail.enabled){const t=20,o=new Smart.Grid.Column({dataField:"_rowDetailColumn",allowSelect:!1,visible:e.rowDetail.visible,label:"",grid:e,freeze:!0,rowDetailColumn:!0,autoGenerated:!0,cellsAlign:"center",width:t,minWidth:t}),l=new Smart.Observable(o,o.observables);"near"===e.rowDetail.position?(o.freeze="near",l.freeze="near",e.viewColumns.splice(a,0,l),e._frozenNearColumns.splice(a,0,l)):(e.viewColumns.push(l),e._frozenFarColumns.splice(0,0,l)),a++}const l=new Smart.Grid.Column({dataField:"_adaptiveColumn",allowSelect:!1,visible:!1,label:"",grid:e,freeze:"far",adaptiveColumn:!0,autoGenerated:!0,cellsAlign:"center",width:30}),n=new Smart.Observable(l,l.observables);n.canNotify=!1,e.viewColumns.push(n),e._frozenFarColumns.splice(0,0,n);const i=new Smart.Grid.Column({dataField:"_commandColumn",allowSelect:!1,visible:e.editing.enabled&&e.editing.commandColumn.visible&&!e.editing.commandColumn.inline,label:"",grid:e,freeze:"far",commandColumn:!0,autoGenerated:!0,align:"center",cellsAlign:"center",width:""}),r=new Smart.Observable(i,i.observables);r.canNotify=!1,"near"===e.editing.commandColumn.position?(i.freeze="near",r.freeze="near",e.viewColumns.splice(a,0,r),e._frozenNearColumns.splice(a,0,r)):(e.viewColumns.push(r),e._frozenFarColumns.splice(0,0,r)),e._commandColumn=r;const s=new Smart.Grid.Column({allowSelect:!1,visible:e.selection.enabled&&e.selection.checkBoxes.enabled,dataField:"_checkBoxColumn",label:"",freeze:e.selection.checkBoxes.position,grid:e,selectionColumn:!0,autoGenerated:!0,cellsAlign:"center",width:32}),d=new Smart.Observable(s,s.observables);if("near"===s.freeze?(e.viewColumns.splice(a,0,d),e._frozenNearColumns.splice(a,0,d)):(e.viewColumns.push(d),e._frozenFarColumns.splice(0,0,d)),e._selectionColumn=d,e._selectionColumn.canNotify=!1,e.editing.addNewColumn.visible){const t=new Smart.Grid.Column({dataField:"_addNewColumn",allowSelect:!1,visible:!0,title:e.localize("addNewColumn"),label:"",cellsClassName:"smart-add-new-column",className:"smart-add-new-column smart-icon smart-grid-icon show smart-icon-plus",grid:e,adaptiveColumn:!1,autoGenerated:!0,cellsAlign:"center",width:90}),o=new Smart.Observable(t,t.observables);e.viewColumns.push(o),e._addNewColumn=o,e._addNewColumn.canNotify=!1}e._observeColumns(),e._templateColumns()}get styleProperties(){return["grid-template-columns","--smart-grid-row-height","--smart-grid-column-header-height","--smart-grid-group-header-height","--smart-grid-filter-footer-height","--smart-grid-group-row-vertical","--smart-grid-group-row-horizontal-offset","--smart-grid-freeze-splitter-size","--smart-grid-resize-line-size","--smart-grid-footer-height","--smart-grid-header-height"]}_templateColumns(){const e=this,t=getComputedStyle(e),o=t.getPropertyValue("--smart-grid-template-columns").trim();if(e._rowGap=0,e._columnGap=0,e._maxHeight=parseInt(t.maxHeight),e._minHeight=parseInt(t.minHeight),"none"!==o){let t=0;for(let o=0;o<e.viewColumns.length;o++)e.viewColumns[o].autoGenerated&&(t+=e.viewColumns[o].visible?e.viewColumns[o].width:0);let a=[];const l=document.createElement("div");l.style.display="grid",l.style.gridTemplateColumns=o;for(let t=0;t<e.columns.length;t++)l.innerHTML+="<div></div>";l.style.width=e.clientWidth-t+"px",e.$.root.appendChild(l);const n=o.split(" ");for(let t=0;t<e.columns.length;t++)a[t]=l.children[t].offsetWidth,"auto"===n[t]&&(a[t]=null);l.parentNode.removeChild(l);let i=0;for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];o.autoGenerated||a[i]&&(o.width=o.templateWidth=a[i++])}}else for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];o.autoGenerated||o.templateWidth&&(o.width=o.templateWidth=null)}}setColumns(e){const t=this;if(null===e)return void(t.columns=[]);t.beginUpdate(),t.columns.canNotify=!1;let o=[],a=[];for(let a=0;a<e.length;a++){const l=e[a];let n=!0;for(let e=0;e<t.columns.length;e++)if(t.columns[e].dataField===l.dataField){n=!1;break}n&&o.push(l)}const l=e.map((e=>e.dataField));for(let e=0;e<t.columns.length;e++){const o=t.columns[e];-1===l.indexOf(o.dataField)&&a.push(o)}a.forEach((e=>{const o=t.columns.indexOf(e);o>=0&&t.columns.splice(o,1)}));for(let e=0;e<o.length;e++)t.columns.push(o[e]);if(t.columns.canNotify=!0,t.endUpdate(),t._columnGroups=[],t._columnHeights=0,t.viewColumns)for(let e=0;e<t.viewColumns.length;e++){const o=t.viewColumns[e],a=o.element;o.top=0,o.level=0,a&&(a.style.top="",a.style.height="",a.style.lineHeight="")}t._renderColumns(),t.__columnHeaderHeight=null,t.refresh()}onAttached(){const e=this;e._scrollView||(e._scrollView=new Smart.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.isRendered&&e.isCompleted&&e._render()}onDetached(){const e=this;if(!e.isRendered)return;["_dialogChart","_dialogAddRow","_dialogEdit","_dialogDelete","_dialogRowDetail","_dialogAddColumn"].forEach((t=>{e[t]&&(e[t].close(),e[t]=null)})),e.menu&&(e.menu.ownerElement=null,e.menu.remove(),e.menu=null);const t=e.querySelector("smart-grid-toolbar");if(t){const e=t.$.headerDropDown;e&&e.remove()}e._resetCachedLayout();const o=e._scrollView.hScrollBar,a=e._scrollView.vScrollBar;if(a.ownerElement=null,o.ownerElement=null,a.onChange=null,o.onChange=null,e._scrollView&&(e._scrollView.unlisten(),delete e._scrollView),e._columnElements)for(let t=0;t<e._columnElements.length;t++)e._columnElements[t]._detach();if(e._columnElements=null,e._rowElements)for(let t=0;t<e._rowElements.length;t++)e._rowElements[t]._detach();e._rowElements=null,e.rows=[],e.rowById=[],e._initColumns=[],e.columnByDataField=[],e.viewColumns=[],e._columnToResizeElement=null;let l=Array.isArray(e.columns)?[...e.columns]:[...e.columns.toArray()];l=l.map((e=>e.data?(void 0!==e.data.visibleIndex&&delete e.data.visibleIndex,void 0!==e.data.index&&delete e.data.index,void 0!==e.data.grid&&delete e.data.grid,e.data):e)),e.rows.notifyFn=null,e.columns.notifyFn=null,e.columns.notify=null,e.columns._array=[],e.columns=l,e._boundColumns=[],e._filterPanels=[],e._frozenFarColumns=[],e._frozenNearColumns=[],e._frozenNearDefaultRows=[],e._frozenFarDefaultRows=[],e._frozenFarRows=[],e._frozenNearRows=[],e._selection={rows:[],indexes:[],columns:[],cells:[]},e.__autoHeightRows=null,e._visibleRows=null,e.__viewRows=null,e.__clientSize=null,e.__scrollHeight=null,e.__scrollWidth=null,e.__parentCells=null,e._selectionColumn=null,e._adaptiveColumn=null,e._commandColumn=null,delete e._columnFarContainerComputedStyle,delete e._columnContainerComputedStyle,delete e._columnNearContainerComputedStyle,e._inputOverlay&&(e._inputOverlay.parentNode&&e._inputOverlay.parentNode.removeChild(e._inputOverlay),e._inputOverlay=null),e._firstVisibleColumn=null,e._lastVisibleColumn=null,e._toggledRow=null,Smart(e._selector)&&(delete Smart(e._selector)._properties,Smart(e._selector)),delete e._selector,delete e._initProperties}_observeColumns(){const e=this,t=function(t,o,a,l){a===l&&"selected"!==o||(t.propertyChanged(o,a,l),e.onColumnChange&&t.stateProps.indexOf(o)>=0&&e.onColumnChange(t,o,a,l))};for(let o=0;o<e.viewColumns.length;o++){const a=e.viewColumns[o];a.rowHeaderColumn||(a.onAction=function(){e._openMenu(this)}),a.autoGenerated&&a.notify((function(e){a.canNotify=!1,t(a,e.propertyName,e.oldValue,e.newValue),a.canNotify=!0}))}e.columns.notify((function(o){let a=null;if(o.path)return e.columns.canNotify=!1,t(o.target,o.propertyName,o.oldValue,o.newValue),void(e.columns.canNotify=!0);e.columns.canNotify=!1;let l=0;switch(o.action){case"length":return void(e.columns.canNotify=!0);case"add":{const t=function(t){if(a=o.object[t],a instanceof Smart.Grid.Column==0){a=new Smart.Grid.Column(a);const l=e.columns.canNotify;e.columns.canNotify=!1,o.object[t]=a,a=o.object[t],e.columns.canNotify=l}a.grid=e,a.onAction=function(){e._openMenu(this)},a.freeze?e._frozenNearColumns.push(a):"far"===a.freeze&&e._frozenFarColumns.push(a);let l=e.viewColumns.length-e._frozenFarColumns.length,n=0;if(e._frozenNearColumns.forEach((e=>{e.autoGenerated&&n++})),t<e.columns.length?e.viewColumns.splice(t+n,0,a):e.viewColumns.splice(l,0,a),e.columnByDataField[a.dataField]){e.columnByDataField[a.dataField].children.push(a),a.parent=e.columnByDataField[a.dataField],a.valueField=a.dataField;const t=a.dataField+"_"+a.parent.children.length;e.columnByDataField[t]=a,a.dataField=t}else e.columnByDataField[a.dataField]=a;if(e.dataSource&&e.dataSource.dataFields){let t=!1;for(let o=0;o<e.dataSource.dataFields.length;o++)e.dataSource.dataFields[o].name===a.dataField&&(t=!0);t||e.dataSource.dataFields.push({name:a.dataField,dataType:a.dataType||"string"})}if(!e._dragDrop&&e.onColumnInserted){e._onColumnInsertData||(e._onColumnInsertData=[],e._onColumnInsertIndexes=[]);const o=a.getState();o.dataField=a.dataField,e._onColumnInsertData.push(o),e._onColumnInsertIndexes.push(t),e._onColumnInsertTimer&&clearTimeout(e._onColumnInsertTimer),e._onColumnInsertTimer=setTimeout((()=>{e.onColumnInserted(e._onColumnInsertIndexes,e._onColumnInsertData),delete e._onColumnInsertIndexes,delete e._onColumnInsertData}),50)}};delete e.__measuredColumnHeight;for(let e=0;e<o.addedCount;e++)t(o.index+e);break}case"update":a=o.object[o.index],a instanceof Smart.Grid.Column==0&&(a=new Smart.Grid.Column(a)),a.grid=e;for(let t=0;t<o.index;t++)e.viewColumns[t].autoGenerated&&l++;e.viewColumns[l+o.index]=a,e.columnByDataField[a.dataField]=a,e.onColumnUpdated&&e.onColumnUpdated(o.index,a);break;case"remove":{a=o.removed[0];let t=o.index,n=e.viewColumns.indexOf(a);if(-1===n){for(let o=0;o<=t;o++)e.viewColumns[o].autoGenerated&&l++;e.viewColumns.splice(l+t,1)}else e.viewColumns.splice(n,1);if(a&&(a.filter&&e.removeFilter(a.dataField),a.sortOrder&&e.removeSort(a.dataField),e.removeGroup(a.dataField),delete e.columnByDataField[a.dataField]),e._dragDrop||e.onColumnRemoved&&e.onColumnRemoved(o.index,a),e.columnGroups&&(e._columnGroups=[],e._columnHeights=0,e.viewColumns))for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t],a=o.element;o.top=0,o.level=0,a&&(a.style.top="",a.style.height="",a.style.lineHeight="")}break}}e._initializeColumnGroupsHierarchy(),e._refreshColumnsResponsiveVisibility(),e._createColumnHeaderCellElements(),e._templateColumns(),e.refresh(),e.columnGroups&&e._columnGroups.length>0&&e._renderColumnGroupHeaders(),e.columns.canNotify=!0}))}get _scrollWidth(){const e=this;if(e.__scrollWidth)return e.__scrollWidth;let t=0;for(let o=0;o<e.viewColumns.length;o++){const a=e.viewColumns[o];a.visible&&(t+=a.computedWidth)}return t=parseInt(t),e.__scrollWidth=t,e._scrollView.scrollWidth=t-e._clientSize.width,e.__scrollWidth}_horizontalScrollbarHandler(){const e=this;e.closeMenu(),e.isScrolling=!0,e.isHScrolling=!0,requestAnimationFrame((()=>{if(e.filtering.enabled&&e.filtering.filterRow.visible)for(let t=0;t<e.columns.length;t++)e.columns[t]._filterEditorInitialized&&(e.columns[t]._filterEditorInitialized=!1);e._summaryRowDialog&&e._summaryRowDialog.classList.contains("open")&&e._summaryRowDialog.close(),e._recycle(),e.isScrolling=!1,e.isHScrolling=!1}))}_mouseWheelHandler(e){const t=this;if(t._scrollView.hScrollBar.$.hasClass("smart-hidden")&&t._scrollView.vScrollBar.$.hasClass("smart-hidden"))return;if(t._isUpdating)return;if(t.editing.isEditing)return;const o=t.querySelector("smart-grid-toolbar");if(!o||!o.$.headerDropDown.classList.contains("open"))if(t.disabled||t._scrollView.vScrollBar.$.hasClass("smart-hidden")||e.shiftKey||!e.deltaY){if(!t.disabled&&!t._scrollView.hScrollBar.$.hasClass("smart-hidden")&&e.deltaX){const o=t.scrollLeft;if(0===o&&e.deltaX<0||o===t.scrollWidth&&e.deltaX>0)return;e.stopPropagation(),e.preventDefault();let a=3*t.layout.rowMinHeight;e.deltaX<=0&&(a=-3*t.layout.rowMinHeight),Math.abs(e.deltaX)>=100?t._scrollView.scrollLeft+=a:t._scrollView.scrollLeft+=e.deltaX}}else{const o=t.scrollTop;if(0===o&&e.deltaY<0||o===t.scrollHeight&&e.deltaY>0)return;e.stopPropagation(),e.preventDefault();let a=3*t.layout.rowMinHeight;e.deltaY<=0&&(a=-3*t.layout.rowMinHeight),Math.abs(e.deltaY)>=100?t._scrollView.scrollTop+=a:t._scrollView.scrollTop+=e.deltaY}}_refresh(){const e=this;if(e._isUpdating)return;const t=e.$.verticalScrollBar.offsetWidth;e.removeAttribute("grouped"),e.removeAttribute("tree");let o=!0;e.__autoHeightRows&&(e.__autoHeightRows=null,e._refreshColumnsResponsiveVisibility(),e._recycle(),o=!1),e._groups||(e._groups=[]),e.grouping.enabled&&e.dataSource.groupBy&&e.dataSource.groupBy.length>=0&&("advanced"===e.grouping.renderMode?e.setAttribute("grouped",""):e.setAttribute("tree",""),e._groups||(e._groups=[].concat(e.dataSource.groupBy.toArray())||[]),e._renderGroupBar()),e.grouping.enabled&&e.dataSource.groupBy&&0===e.dataSource.groupBy.length?e.$.breadcrumb&&(e.$.breadcrumb.dataSource=[]):e.dataSource.boundHierarchy&&(e.setAttribute("tree",""),e.setAttribute("role","treegrid")),(e.isInitialized||o)&&e._refreshColumnsResponsiveVisibility(),e._refreshLayout(),t!==e.$.verticalScrollBar.offsetWidth&&(e.__scrollWidth=null,e._refreshColumnsResponsiveVisibility(),e._refreshScrollBars(),0===e.$.verticalScrollBar.offsetWidth&&e.isRendered&&requestAnimationFrame((()=>{e._refreshScrollBars()}))),e._refreshSelection(),e._recycle(),e._refreshHeaderBar(),e._recyclingRows&&0===e._recyclingRows.length&&(e.$.placeholder.classList.remove("smart-hidden"),e.scrollHeight=0,e.$.placeholder.innerHTML=e.appearance.placeholder,e._filters&&e._filters.length&&(e.$.placeholder.innerHTML=`<span class="smart-grid-icon show smart-icon-filter" style="\n font-size: calc(2 * var(--smart-font-size));\n cursor: default;\n margin-right: 10px;\n "></span>${e.localize("filteredRecords")}`)),requestAnimationFrame((()=>{e._width=e.offsetWidth,e._height=e.offsetHeight}))}_refreshHeaderBar(){const e=this;e.$.headerBar&&e.header.visible&&e.$.headerBar._refresh()}_resizeHandler(e){const t=this;if((t.enableShadowDOM?e.composedPath()[0]:e.target)===t&&!t._isUpdatingScrollBars){if(!t.isInitialized)return void t._render();if(!1===t._resizeHandling||!t.offsetHeight)return;t._isUpdatingScrollBars=!0,t._autoHeight=!1,t.$.content&&t.$.content.classList.remove("auto-height");const e=t._rowElements?t._rowElements.length*t.layout.rowMinHeight:0;(e>0||"grid"!==t.view)&&(t.offsetHeight>=e?(t._refreshLayout(),t._initializeRowElements()):"grid"!==t.view&&t._refreshLayout()),t.refresh(),t.$.headerBar&&t.$.headerBar.refreshTools(),t._dialogAddColumn&&t._dialogAddColumn.classList.contains("open")&&t._dialogAddColumn.refresh(),t._isUpdatingScrollBars=!1}}_refreshColumnsResponsiveVisibility(){const e=this,t=e.$.columnContainer,o=e.$.columnNearContainer,a=e.$.columnFarContainer;let l=0,n=0,i=0,r=!1;const s=e.columns.canNotify;e.columns.canNotify=!1;for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];o.setProperty("_treeColumn",!1,!1),e.grouping.enabled&&e.grouping.autoHideGroupColumn&&e.dataSource.groupBy&&e.dataSource.groupBy.indexOf(o.dataField)>=0&&o.setProperty("visible",!1,!1),o.visible&&!o.autoGenerated&&!r&&e.dataSource.boundHierarchy&&(o.setProperty("_treeColumn",!0,!1),r=!0)}e._refreshColumnWidths(),e.columns.canNotify=s;let d=0,u=0;for(let t=0;t<e.viewColumns.length;t++){const o=e.viewColumns[t];o.visible&&(o.freeze&&(!0===o.freeze||"near"===o.freeze?(l+=o.computedWidth,o.autoGenerated&&(d+=o.computedWidth)):"far"===o.freeze&&(n+=o.computedWidth,o.autoGenerated&&(u+=o.computedWidth))),i+=o.computedWidth)}t.style.width=i+"px",o.style.width=l+"px",a.style.width=n+"px",a.classList.remove("smart-hidden"),o.classList.remove("smart-hidden"),0===n&&a.classList.add("smart-hidden"),0===l&&o.classList.add("smart-hidden"),a.classList.remove("border-collapse"),n===u&&a.classList.add("border-collapse"),e._autoGeneratedColumnsNearWidth=d,e._autoGeneratedColumnsFarWidth=u,e._computedColumnsWidth=i,e._frozenColumnsNearWidth=l,e._frozenColumnsFarWidth=n}_selectStartHandler(e){const t=this;t.isScrolling||t.editing.isEditing||"grid"!==t.view||t.selection.defaultSelection||e.preventDefault()}setFocusable(e){const t=this;!t.disabled&&e?t.tabIndex=0:t.removeAttribute("tabindex")}_setLoadingIndicatorVisibility(){const e=this;e.appearance.displayLoadingIndicator?e.$.loadingIndicatorContainer.classList.remove("smart-visibility-hidden"):e.$.loadingIndicatorContainer.classList.add("smart-visibility-hidden")}_refreshElementsVisibility(){const e=this,t=function(e,t){e&&(t?e.classList.remove("smart-hidden"):e.classList.add("smart-hidden"))};if(t(e.$.placeholder,!e.rows||e.rows&&0===e.rows.length||0===e.columns.length),t(e.$.footer,e.footer.visible),t(e.$.header,e.header.visible),t(e.$.groupHeader,e.groupHeader.visible||e.grouping.groupBar.visible),t(e.$.columnHeader,e.columnHeader.visible&&e.columns.length>0),t(e.$.headerCommandBar,e.editing.commandBar.visible&&"far"!==e.editing.commandBar.position),t(e.$.footerCommandBar,e.editing.commandBar.visible&&"near"!==e.editing.commandBar.position),t(e.$.breadcrumb,e.groupHeader.visible||e.grouping.groupBar.visible),e.htmlColumnLastChild.classList.add("smart-visibility-hidden"),e.pager&&e.pager.visible&&e.paging.enabled)switch(e.pager.position){case"near":t(e.$.headerPager,!0),t(e.$.footerPager,!1);break;case"far":t(e.$.headerPager,!1),t(e.$.footerPager,!0);break;case"both":t(e.$.headerPager,!0),t(e.$.footerPager,!0)}else t(e.$.footerPager,!1),t(e.$.headerPager,!1);e._refreshRowHierarchy()}_getId(){const e=this;return e.dataSource&&e.dataSource.id?e.dataSource.id:e.dataSourceSettings.id?e.dataSourceSettings.id:void 0}_refreshRowHierarchy(e,t=!1){const o=this;o.rowHierarchy=null;let a=0,l=!1;if(!o.grouping.enabled&&o.dataSource.groupBy&&o.dataSource.groupBy.length>0&&(l=!0),o.grouping.enabled&&o.dataSource.groupBy&&0===o.dataSource.groupBy.length)return;let n=!1;if(o.grouping.enabled&&o.dataSource.groupBy&&o.dataSource.groupBy.length>0&&o.dataSource.virtualDataSourceOnExpand&&(n=!0),o.dataSource.boundHierarchy){const i=o.dataSource.reservedNames,r=function(e){return new Smart.Grid.Row({data:e,grid:o,index:o.rows.length})};let s=0;const d=function(t,a){for(let u=0;u<t.length;u++){const c=t[u];let m=o.rowById[c.$.id];if(n&&(m=o.rows[s],m||(m=r(c),o.rows.push(m)),c[i.leaf]?m.id=c.$.id:m.id="Group_"+c.$.id,o.rowById[m.id]=m),m||(m=r(c),o.rowById[m.id]=m),m.data=c,m.leaf=c[i.leaf]||!1,m.level=c[i.level],m.groupDataField=c.groupDataField,!m.groupDataField&&o.appearance.showTreeRowHeader&&(m.groupDataField=o.columns[m.level].dataField),m.label=c.label,m.children=[],m.data&&(m.filtered=void 0===m.data.$.filtered||m.data.$.filtered),c.summaryRow&&(m.summaryRow=!0),(null===o._toggledRow||o._toggledRow&&o._toggledRow.id!==m.id)&&(m.expandHeight=0),c.parent?(m.parent=o.rowById[c.parent.$.id],m.parentId=c.parent.$.id):(m.parent=null,m.parentId=null),o.grouping.onGroupDefaultExpanded&&!o.isRendered){const e=o.grouping.onGroupDefaultExpanded(c);e&&(m.expanded=c[i.expanded]=e)}o.appearance.allowRowToggleAnimation||void 0!==c[i.expanded]&&(m.expanded=c[i.expanded]);let g=!!e||m.expanded;l&&(g=!0);const p=o.dataSource&&o.dataSource.id||o.dataSourceSettings.id;if(p&&!m.data[p]&&o.grouping.enabled&&o.dataSource&&o.dataSource.groupBy.length){const e=o.dataSource.groupBy[m.level];c.parent&&c.parent.expanded&&(""===m.data[e]&&o.dataSource.id&&!m.data.data[o.dataSource.id]||m.leaf&&!m.data[p])&&(s++,m.filtered=!1)}if(!0===m.visible&&!1!==m.filtered)if(s++,g||c[i.leaf])if(a.push(m),c.children&&c.children.length>0){const e=d(c.children,new Array);0===e.length&&(m.leaf=!0);for(let t=0;t<e.length;t++)a.push(e[t]);m.children=e}else c.children&&0===c.children.length&&(o.dataSource.virtualDataSource&&o.dataSource.virtualDataSourceOnExpand?m.data._loaded&&(m.leaf=!0):m.leaf=!0);else if(a.push(m),c.children&&c.children.length>0){const e=d(c.children,new Array);0===e.length&&(m.leaf=!0),m.children=e}else c.children&&0===c.children.length&&(o.dataSource.virtualDataSource&&o.dataSource.virtualDataSourceOnExpand?m.data._loaded&&(m.leaf=!0):m.leaf=!0)}return a};let u=o.dataSource.boundHierarchy;if(o.paging.enabled&&!t){let e=[];const t=e=>{let a=[];if(0===o.dataSource.groupBy.length)return e;for(let o=0;o<e.length;o++){const l=e[o];(!l.$||void 0===l.$.filtered||l.$.filtered)&&(a.push(l),l.children&&(a=a.concat(t(l.children))))}return a};if(o.dataSource&&!o.dataSource.virtualDataSource){for(let o=0;o<u.length;o++){let a=u[o],l=!a.$||void 0===a.$.filtered||a.$.filtered;!l&&null!==l||0!==a.level||a.parent||(t(a.children).length,e.push(a))}u=e.slice(o.paging.pageIndex*o._pageSize,(o.paging.pageIndex+1)*o._pageSize)}}o.rowHierarchy=d(u,new Array);let c=[];for(let e=0;e<o.rowHierarchy.length;e++){const t=o.rowHierarchy[e],l=t.canNotify;t.leaf&&c.push(t),t.canNotify=!1,o.grouping.enabled&&o.dataSource&&o.dataSource.groupBy.length?t.leaf?t.visibleIndex=a++:t.visibleIndex=-1:t.visibleIndex=a++,t.canNotify=l}if(l&&(o.rowHierarchy=c),o._rowElements.length<o.rowHierarchy.length&&!o._toggledRow&&o._initializeRowElements(),o.grouping.summaryRow.visible&&!o.grouping.summaryRow.inline){const e=function(t,o,a,l){if(0!==t&&o.length>0&&o[o.length-1]&&!o[o.length-1].summaryRow){let e={label:" ",boundSource:[],groupDataField:a.data.groupDataField,$:{},summaryRow:!0,leaf:!0,level:t,expandHeight:0,siblings:o};e.$.id="SubRow"+l+"_"+a.data.$.id,a&&(e.parent=a.data,e.parentId=a.data.$.id),e.data=Object.assign(e),o.push(e)}for(let t=0;t<o.length;t++)o[t]&&o[t].data&&o[t].data.children&&e(o[t].level+1,o[t].data.children,o[t],t)};e(0,o.rowHierarchy,null,0)}}}applyContent(){}_refreshContentHeight(){const e=this;let t=e._clientSize.height;const o=window.scrollY;let a,l,n=!1;if((!e._contentHeight||e._maxHeight||e._autoHeight||e.__autoHeight||"hidden"===e.verticalScrollBarVisibility)&&(n=!0),n&&(a=e.offsetHeight,e.$.container.classList.add("smart-hidden"),l=e.offsetHeight,e.$.container.classList.remove("smart-hidden")),window.scrollY!==o&&window.scrollTo(window.scrollX,o),"hidden"===e.verticalScrollBarVisibility||a!==l||e._minHeight&&e._minHeight===a)return t=e._scrollHeight+e.$.columnHeader.offsetHeight+e.$.filterFooter.offsetHeight,e.header.visible&&(t+=e.$.header.offsetHeight),e.summaryRow.visible&&(t+=e.layout.rowMinHeight),0===e._recyclingRows.length&&0===e._scrollHeight&&(t+=e.$.scrollView.offsetTop),e.editing.addNewRow.visible&&1===e._recyclingRows.length&&(t+=e.$.scrollView.offsetTop),e._minHeight>t&&(t=e._minHeight),e.$.content.style.height=t+"px",e._contentHeight=t,void(e._maxHeight<t?(e._autoHeight=!1,e.$.content.classList.remove("auto-height"),e.$.content.style.height=e._maxHeight+"px",e.header.visible?(e.$.content.style.height=e._maxHeight-e.$.header.offsetHeight+"px",e._contentHeight=e._maxHeight-e.$.header.offsetHeight):e._contentHeight=e._maxHeight):(e._autoHeight=!0,e.__autoHeight=!0,e.$.content.classList.add("auto-height"),e.header.visible?(e._contentHeight=t-e.$.header.offsetHeight,e.$.content.style.height=e._contentHeight+"px"):e.summaryRow.visible&&(e.$.content.style.height=e._contentHeight+"px")));e.header.visible&&(t-=e.$.header.offsetHeight),(e.groupHeader.visible||e.grouping.groupBar.visible)&&(t-=e.$.groupHeader.offsetHeight),e.footer.visible&&(t-=e.$.footer.offsetHeight),e.pager.visible&&(t-=e.$.headerPager.offsetHeight,t-=e.$.footerPager.offsetHeight),e.editing.enabled&&e.editing.commandBar.visible&&(t-=e.$.headerCommandBar.offsetHeight,t-=e.$.footerCommandBar.offsetHeight),e.$.content.style.height!==t+"px"&&(e.$.content.style.height=t+"px"),e.$.viewContent.style.height!==t+"px"&&(e.$.viewContent.style.height=t+"px"),e._contentHeight=t}appendChild(){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(this,e.concat(Array.prototype.slice.call(arguments)))}removeChild(){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(this,e.concat(Array.prototype.slice.call(arguments)))}get _contentBorder(){const e=this;if(e.__contentBorder)return e.__contentBorder;const t=getComputedStyle(e.$.content),o={left:parseFloat(t.borderLeftWidth)+parseFloat(t.borderRightWidth),top:parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth)};return e.__contentBorder=o,o}_refreshLayout(){const e=this,t=e.rows;if(e._layoutSuspended)return;e._visibleRows=null,e.__viewRows=null,e.__clientSize=null,e.__scrollHeight=null,e.__scrollWidth=null,e.__parentCells=null,e.$.columnFarContainer.classList.remove("vscroll"),e.$.columnNearContainer.classList.remove("vscroll"),e.$.scrollView.classList.remove("hscroll"),e.$.scrollView.classList.remove("vscroll"),e._refreshElementsVisibility(),e._refreshColumnHeights(),e._refreshContentHeight();const o=()=>{e.$.placeholder.classList.remove("smart-hidden"),e.$.placeholder.innerHTML=e.appearance.placeholder,e._filters&&e._filters.length&&(e.$.placeholder.innerHTML=e.localize("filteredRecords")),e.__filterFooterOffsetHeight||(e.__filterFooterOffsetHeight=e.$.filterFooter.classList.contains("smart-hidden")?0:e.$.filterFooter.offsetHeight),!e.__columnHeaderHeight&&e.$.columnHeader.offsetHeight&&(e.__columnHeaderHeight=e.$.columnHeader.offsetHeight);let t=e._contentHeight-e.__filterFooterOffsetHeight-e.__columnHeaderHeight;e.$.scrollView.style.height=t+"px",e.scrollWidth=0,e.scrollHeight=0,e.clearSelection(),e._showAddNewRowButton("float"),e.$.content.classList.contains("auto-height")&&(e.$.placeholder.style.height=t+"px")};if(t&&t.url)e._showAddNewRowButton("float");else{if(!t||null===t||0===t.length||0===e.columns.length)return o(),0!==e.columns.length&&e.hasVisibleColumn()?e.editing.addNewColumn._addButton&&e.editing.addNewColumn._addButton.classList.remove("show"):(e._showAddNewColumnButton(),e.$.columnHeader.classList.add("smart-hidden"),e.__columnHeaderHeight=0),void e._refreshScrollBars();e._showAddNewRowButton("float"),e.editing.addNewColumn._addButton&&e.editing.addNewColumn._addButton.classList.remove("show")}0!==e.columns.length&&e.hasVisibleColumn()?e.editing.addNewColumn._addButton&&e.editing.addNewColumn._addButton.classList.remove("show"):(o(),0!==e.columns.length&&e.hasVisibleColumn()||(e._showAddNewColumnButton(),e.$.columnHeader.classList.add("smart-hidden"),e.__columnHeaderHeight=0),e._showAddNewColumnButton()),!e.__columnHeaderHeight&&e.$.columnHeader.offsetHeight&&(e.__columnHeaderHeight=e.$.columnHeader.offsetHeight),e.__filterFooterOffsetHeight||(e.__filterFooterOffsetHeight=e.$.filterFooter.classList.contains("smart-hidden")?0:e.$.filterFooter.offsetHeight);let a=e._contentHeight-e.__filterFooterOffsetHeight-e.__columnHeaderHeight;if(e.$.scrollView.style.height=a+"px",e.htmlColumnLastChild.style.height=e.__columnHeaderHeight+"px",e.paging.spinner.enabled&&e.paging.enabled){if(!e.pageScroll){const t=document.createElement("smart-scroll-bar");t.orientation="vertical",t.style.height="100%",t.style.width="100%",t.max=Math.ceil(e.dataSource.length/e._pageSize),t.step=e.paging.spinner.step,t.largeStep=e.paging.spinner.step,t.setAttribute("spinner",""),t.setAttribute("smart-id","spinner"),t.ownerElement=e,e.addPropertyBinding("[[paging_spinner_step]]","step",t,e.$.columnHeader),t.addEventListener("change",(function(t){e.paging.pageIndex=t.detail.value})),e.pageScroll=t}e.htmlColumnLastChild.appendChild(e.pageScroll)}else e.htmlColumnLastChild.innerHTML="";e._refreshScrollBars()}_refreshScrollBars(){const e=this;if(!e._scrollView)return;const t=e._scrollView.vScrollBar,o=e._scrollView.hScrollBar,a=e._contentHeight-e.__filterFooterOffsetHeight-e.__columnHeaderHeight,l=e.$.scrollView.offsetWidth,n=e._scrollWidth-l-e._contentBorder.left,i=e._scrollHeight-a-e._contentBorder.top,r=e._columnNearContainerComputedStyle?e._columnNearContainerComputedStyle:getComputedStyle(e.$.columnNearContainer),s=e._columnFarContainerComputedStyle?e._columnFarContainerComputedStyle:getComputedStyle(e.$.columnFarContainer),d=parseInt(e.$.columnNearContainer.style.width)+parseInt(r.borderRightWidth),u=parseInt(e.$.columnFarContainer.style.width)+parseInt(s.borderLeftWidth);if(e.__frozenNearWidth=d,e.__frozenFarWidth=u,e._columnNearContainerComputedStyle=r,e._columnFarContainerComputedStyle=s,e._refreshHorizontalScrollBarVisibility(n),e._refreshVerticalScrollBarVisibility(i),t.style.height=a+"px",e.computedVerticalScrollBarVisibility?(e.__scrollBarSize||(e.__scrollBarSize=t.offsetWidth),e.__scrollWidth+=e.__scrollBarSize,e._refreshHorizontalScrollBarVisibility(e._scrollWidth-l-1),e.rightToLeft?e.$.columnNearContainer.classList.add("vscroll"):e.$.columnFarContainer.classList.add("vscroll"),e._refreshVerticalScrollBarVisibility(i),e.htmlColumnLastChild.classList.remove("smart-visibility-hidden"),e.$.scrollView.classList.add("has-vscroll")):e.$.scrollView.classList.remove("has-vscroll"),o.style.width=l+"px",e.rightToLeft?o.style.right="0px":o.style.left="0px",e.computedVerticalScrollBarVisibility&&e.computedHorizontalScrollBarVisibility&&(o.style.width=l-t.offsetWidth+"px",t.style.height=a-o.offsetHeight+"px"),e.computedHorizontalScrollBarVisibility?(e.$.scrollView.classList.add("hscroll"),e._autoHeight?(e.$.content.style.height="auto",e.$.scrollView.style.height="auto",e.$.scrollView.style.paddingBottom=o.offsetHeight+"px",e.$.placeholder.style.marginTop=o.offsetHeight+"px",e.summaryRow.visible&&(e.$.scrollView.style.paddingBottom=o.offsetHeight+e.layout.rowMinHeight+"px")):(e.$.scrollView.style.paddingBottom="",e.$.placeholder.style.marginTop="")):e.$.scrollView.classList.remove("hscroll"),(e.__frozenNearHeight>0||e._frozenNearRows&&e._frozenNearRows.length>0)&&!e.appearance.showVerticalScrollBarOnFixedColumns){const o=getComputedStyle(e.$.rowNearContainer),a=e.__frozenNearHeight+parseInt(o.borderBottomWidth);t.style.height=parseInt(t.style.height)-a+"px",t.style.top=a+"px",t.style.setProperty("--smart-scroll-bar-near-size",a+"px")}else e.appearance.showVerticalScrollBarOnFixedColumns&&(t.style.top="0px");if((e.__frozenFarHeight>0||e._frozenFarRows&&e._frozenFarRows.length>0)&&!e.appearance.showVerticalScrollBarOnFixedColumns){const o=getComputedStyle(e.$.rowFarContainer),a=-2+e.__frozenFarHeight+parseInt(o.borderTopWidth);t.style.height=parseInt(t.style.height)-a+"px",t.style.setProperty("--smart-scroll-bar-far-size",a+"px"),0===e.__frozenNearHeight&&(t.style.top="0px")}(d>0||u>0)&&!e.appearance.showHorizontalScrollBarOnFixedColumns&&(o.style.width=parseInt(o.style.width)-d-u+"px",e.rightToLeft?o.style.right=d+"px":o.style.left=d+"px",o.style.setProperty("--smart-scroll-bar-near-size",d+parseInt(r.borderRightWidth)+"px"),o.style.setProperty("--smart-scroll-bar-far-size",u+parseInt(r.borderLeftWidth)+"px"),e.computedVerticalScrollBarVisibility&&(e.__scrollBarSize||(e.__scrollBarSize=t.offsetWidth),o.style.setProperty("--smart-scroll-bar-far-size",u+e.__scrollBarSize+"px"))),t.refresh(),o.refresh()}_refreshHorizontalScrollBarVisibility(e){const t=this;t.scrollWidth=e,t.computedHorizontalScrollBarVisibility||(t.scrollLeft=0)}_refreshVerticalScrollBarVisibility(e){const t=this;if(t._autoHeight)return t.scrollTop=0,void(t.scrollHeight=0);t.computedHorizontalScrollBarVisibility&&(e+=t.$.horizontalScrollBar.offsetHeight),t.scrollHeight=e,t.paging.enabled&&t.paging.spinner.visible&&t.$.verticalScrollBarVisibility.classList.remove("smart-hidden"),t.computedVerticalScrollBarVisibility||(t.scrollTop=0)}_styleChangedHandler(e){const t=this;if(!e.detail.styleProperties.overflow&&!t.classList.contains("smart-grid-resize-mode")){if(e.detail.styleProperties["grid-template-columns"])return t._templateColumns(),void t.refresh();if(e.detail.styleProperties["font-size"])return t.layout.isDirty=!0,t._resetCachedLayout(),void t.refresh();(e.detail.styleProperties["--smart-grid-row-height"]||e.detail.styleProperties["--smart-font-size"]||e.detail.styleProperties["--smart-grid-column-header-height"]||e.detail.styleProperties["--smart-grid-group-header-height"]||e.detail.styleProperties["--smart-grid-filter-footer-height"]||e.detail.styleProperties["--smart-grid-group-row-vertical"]||e.detail.styleProperties["--smart-grid-group-row-horizontal-offset"]||e.detail.styleProperties["--smart-grid-freeze-splitter-size"]||e.detail.styleProperties["--smart-grid-resize-line-size"]||e.detail.styleProperties["--smart-grid-footer-height"]||e.detail.styleProperties["--smart-grid-header-height"])&&(t.layout.isDirty=!0),t.offsetWidth&&t.offsetHeight>0&&(t._resetCachedLayout(),t._refreshLayout(),t._recycle())}}_resetCachedLayout(){const e=this;delete e._columnHeights,e.__cellsCommandTemplate=null,e.__autoRowHeight=null,e.__autoHeightRows=null,e.__measuredColumnHeight=null,e.__columnHeaderHeight=null,e.__filterFooterOffsetHeight=null}_swipeLeftHandler(){}_swipeRightHandler(){}_getRowIndexByPosition(e){const t=this;return(o=>{let a=0,l=o.length-1;if(e<=0)return 0;const n=o[o.length-1];if(-1!==n.top&&n.top<=e)return o.length-1;for(;;){const n=Math.floor((a+l)/2),i=o[n];if(t._isRowInPosition(i,e))return n;i.top<e?a=n+1:i.top>e?l=n-1:a=n+1}})(t._recyclingRows)}_getVirtualRowIndexByPosition(e){let t=this.rows[0].height;const o=(e,o)=>0!==t&&e<=o&&e+t>o;return(a=>{let l=0,n=a.length-1;if(e<=0)return 0;const i=(a.length-1)*t;if(-1!==i&&i<=e)return a.length-1;for(;;){const a=Math.floor((l+n)/2),i=a*t;if(o(i,e))return a;i<e?l=a+1:i>e?n=a-1:l=a+1}})(this.dataSource)}getRows(){return this.getViewRows()}getViewRows(){const e=this;return e.rowHierarchy?e.rowHierarchy:e.getVisibleRows()}getColumns(){const e=this,t=[];if(!e.isInitialized)return t;if(e.columns)for(let o=0;o<e.columns.length;o++){const a=e.columns[o].getState();t.push(a)}return t}resetState(){const e=this;e._isUpdating=0,e.beginUpdate(),e.clearSort(),e.clearFilter(),e.clearGroups(),e.clearSelection(),e.columns.canNotify=!1;let t=[],o=!1;for(let a=0;a<e.columns.length;a++){const l=e.columns[a];l.visible=!0,l.width=180,l.freeze=!1,delete l.statusColumn,t[l.index]=l,l.index!==a&&(o=!0)}o&&(e.columns=t),e.columns.canNotify=!0,e._scrollView.scrollLeft=e._scrollView.scrollTop=0,e.paging.enabled&&(e.paging.pageIndex=0),e.$.headerBar&&e.$.headerBar._setView&&e.$.headerBar._setView("grid"),e.endUpdate(),o&&(e._renderColumns(),e._refreshHeaderBar())}_loadState(e){const t=this;let o=!1;if(t.stateSettings.loading=!0,e.expandedRows&&Object.keys(e.expandedRows).length>0){o=!0,t.beginUpdate();const a=[];if(e.groups){t.dataSource.groupBy=e.groups,t._refreshRowHierarchy();for(let o in e.expandedRows)a["Item"+o.replaceAll(".","_")]=!0,t._expandCollapseGroup(o,!0)}t.dataSource&&(t.dataSource._expandedRowIds=a)}if(e.paging&&t.paging.enabled&&(t.paging.index=e.paging.index,t.paging.size=e.paging.size),e.columns&&e.columns.length>0){o||(o=!0,t.beginUpdate());for(let o=0;o<e.columns.length;o++){const a=e.columns[o];if(a.dataField){const e=t.columnByDataField[a.dataField];e&&(e.width=a.width,e.freeze=a.freeze,e.visible=a.visible)}}}if(e.sort&&Object.keys(e.sort).length>0){o||(o=!0,t.beginUpdate());const a=t.appearance.allowSortAnimation;t.appearance.allowSortAnimation=!1;let l=t.columns.canNotify;t.columns.canNotify=!1;for(let e=0;e<t.columns.length;e++)t.columns[e].sortOrder="";t.columns.canNotify=l;for(let o in e.sort)if(e.sort[o]){const a=e.sort[o].sortOrder,l=t.columnByDataField[o];t.sortBy(l.dataField,a)}t.appearance.allowSortAnimation=a}if(e.filter&&Object.keys(e.filter).length>0){o||(o=!0,t.beginUpdate());for(let o in e.filter){const a=e.filter[o];a&&t.addFilter(o,a,!1)}}o&&(t.endUpdate(!1,!1),t._refresh()),e.view&&t.view!==e.view&&t.$.headerBar&&t.$.headerBar._setView&&t.$.headerBar._setView(e.view),Object.keys(e.filter).length>0&&t.refreshFilters(),e.name&&(t.stateSettings.current=e.name),t.stateSettings.loading=!1}loadState(e){const t=this;if(e){if(t.stateSettings.loading=!0,t._isUpdating=0,t.beginUpdate(),t.clearSort(),t.clearFilter(),t.clearGroups(),t.clearSelection(),t._scrollView.scrollLeft=t._scrollView.scrollTop=0,t.paging.enabled&&(t.paging.pageIndex=0),t.endUpdate(!1,!1),"string"==typeof e){const o=t.stateSettings.storage[e];o&&t._loadState(o)}else t._loadState(e);t.stateSettings.loading=!1}else if(!t.stateSettings.autoSave){let e=t.getCurrentState();e&&t.loadState(e)}}saveState(e,t){const o=this;let a=o.getCurrentState(),l=t;!t&&o.stateSettings.options.length&&(t=o.stateSettings.options);const n=o.getState(t);let i;if(e?(i=e,o.stateSettings.current||(o.stateSettings.current=e)):i=o.stateSettings.current?o.stateSettings.current:o.stateSettings.current="smartGrid"+o.id,a&&l)for(let e in l)a[l[e]]=n[l[e]];else a=n;a.name=i;const r=function e(t,o=0,a=10){if(o>a)return"Object";const l={};if(t&&t instanceof Smart.FilterGroup)return t=t.toString();for(let n in t){let i=t[n];if(i instanceof Node)i={id:i.id};else if(i instanceof Window)i="Window";else if(i instanceof Date)i=i.toJSON();else{if(i&&Array.isArray(i)&&void 0!==i[0]&&("string"==typeof i[0]||"number"==typeof i[0]||i[0]instanceof Date||"boolean"==typeof i[0])){l[n]=i;continue}if(i&&Array.isArray(i)&&0===i.length){l[n]=i;continue}if(i&&i&&Array.isArray(i)&&void 0!==i[0]&&"object"==typeof i[0]&&"path"!==n&&!(i[0]instanceof HTMLElement))for(let t=0;t<i.length;t++)i[t]=e(i[t],o+1,a);else i instanceof Object&&(i=e(i,o+1,a))}l[n]=i}return o?l:JSON.stringify(l)}(a);return window.localStorage.setItem(i,r),o.stateSettings.storage||(o.stateSettings.storage={}),o.stateSettings.storage[o.stateSettings.current]=a,o.stateSettings.onStateChange&&o.stateSettings.onStateChange(a,i),a}getCurrentState(){const e=this,t=e.stateSettings.current;return e.stateSettings.storage||(e.stateSettings.storage={}),e.stateSettings.storage[t]?e.stateSettings.storage[t]:null}getState(e){const t=this;if(e&&!e.includes)return;const o=!e||e&&e.includes("sort")?t.getSortedColumns():null,a=!e||e&&e.includes("filter")?t.getFilteredColumns():null,l=!e||e&&e.includes("groups")?t.getGroups():null,n=!e||e&&e.includes("selection")?t.getSelectedCells():null,i=!e||e&&e.includes("selection")?t.getSelectedRows():null,r=!e||e&&e.includes("pager")?t.$.headerPager.querySelector("smart-pager"):null;let s=0;r&&(s=r.pagesCount);const d={sort:o,filter:a,groups:l,paging:{count:s,index:t.paging.pageIndex,size:t._pageSize},selectedCells:n,selectedRows:i};t.header.visible&&t.header.buttons.indexOf("views")>=0&&(d.kanban=t.getKanbanState(),d.view=t.view);const u=[];if(!e||e&&e.includes("columns")){for(let e=0;e<t.columns.length;e++){const o=t.columns[e];u.push({dataField:o.dataField,width:o.computedWidth,visible:o.visible,freeze:o.freeze})}d.columns=u}if((!e||e&&e.includes("expandedRows"))&&t.dataSource&&t.dataSource._expandedRowIds){let e={};for(let o in t.dataSource._expandedRowIds){let t=""+o;t=t.replace("Item","").replace(/_/gi,"."),e[t]=!0}d.expandedRows=e}if(e){const t={};for(let o in e){const a=e[o];d[a]&&(t[a]=d[a])}return t}return d}get _pageSize(){const e=this;return e.dataSource&&e.grouping.enabled&&e.dataSource.groupBy.length>0?e.paging.pageHierarchySize:e.paging.pageSize}get _recyclingRows(){const e=this;if(e.rowHierarchy)return e.rowHierarchy;let t=e.getVisibleRows();if(e.paging.enabled)if(e.dataSource.virtualDataSource)t=t.slice(0,e._pageSize);else if(t=t.slice(e.paging.pageIndex*e._pageSize,(e.paging.pageIndex+1)*e._pageSize),e.editing.addNewRow&&e.editing.addNewRow.visible&&"button"!==e.editing.addNewRow.displayMode){let t=e.getVisibleRows();return t=0===e.paging.pageIndex&&"far"!==e.editing.addNewRow.position?t.slice(1+e.paging.pageIndex*e._pageSize,1+(e.paging.pageIndex+1)*e._pageSize):0===e.paging.pageIndex&&"far"===e.editing.addNewRow.position?t.slice(e.paging.pageIndex*e._pageSize,1+(e.paging.pageIndex+1)*e._pageSize):t.slice(1+e.paging.pageIndex*e._pageSize,1+(e.paging.pageIndex+1)*e._pageSize),[].concat(e._frozenNearDefaultRows,e._nearRowsAdded,t,e._farRowsAdded,e._frozenFarDefaultRows)}return t}_isRowInPosition(e,t){const o=e.top,a=e.top+e.height,l=o<=t&&a>t;return 0!==e.height&&l}_renderColumnGroupHeaders(){const e=this;for(let t=0;t<e._columnGroups.length;t++){const o=e._columnGroups[t];o.column.render(),o.column.allowReorder=!1,o.column.element.setAttribute("columnHeader",""),0===o.columns.length&&o.column.element.classList.add("smart-hidden"),0===t&&0===e.columns.indexOf(o.columns[0])&&o.column.element.classList.add("smart-grid-column-border-collapse")}}hasVisibleColumn(){const e=this;for(let t=e.viewColumns.length-1;t>=0;t--){const o=e.viewColumns[t];if(o.visible&&!o.autoGenerated)return!0}return!1}_isLastVisibleColumn(e){const t=this;for(let o=t.viewColumns.length-1;o>=0;o--){const a=t.viewColumns[o];if(a.visible)return a===e}return!1}_clearCachedTemplates(){const e=this;if(e._cachedTemplates&&Object.keys(e._cachedTemplates).length>0){e._tableCachedTemplates||(e._tableCachedTemplates=document.createElement("div"),e._tableCachedTemplates.style.display="none",document.body.appendChild(e._tableCachedTemplates));const t=document.createDocumentFragment();for(let o in e._cachedTemplates)t.appendChild(e._cachedTemplates[o]);e._tableCachedTemplates.appendChild(t)}}_recycle(e,t,o){const a=this;if(a._layoutSuspended||!1===a.isAttached)return;if(a._isUpdating)return;if(a.editing.isEditing&&(a.endEdit(),a._isUpdating))return;a._recycleValues=void 0===o||o,a._removeCellContentPopup(),a._inputOverlay&&(a._inputOverlay.parentNode&&a._inputOverlay.parentNode.removeChild(a._inputOverlay),a._inputOverlay=null),a._selection.selectionRect&&a._refreshCellSelectionRect();const l=a._scrollView.scrollTop;let n,i=a._getRowIndexByPosition(l),r=a._recyclingRows,s=r[i],d=s?s.top:0,u=0,c=0,m=0,g=0;if(a._cellRowSpan&&a._cellRowSpan.maxSpan>0){let e=0;if(i>=5?e=5:i>=4?e=4:i>=3?e=3:i>=2?e=2:i>=1&&(e=1),e>0){const t=r[i-e];t&&(s=t,d=s?s.top:0,m=e*s.height,i-=e)}}a._cellRowSpan=[];for(let e=0;e<a._cellsMerge.length;e++){const t=a._cellsMerge[e],o=r.indexOf(t.row);if(i>o&&i<=o+t.rowSpan&&(i=o,s=t.row,m=Math.max(m,d-s.top),d=s.top,a.$.rowContainer.style.top=a.__frozenNearHeight-l+d+"px"),t.colSpan>1)for(let e=0;e<a.viewColumns.length;e++){const o=a.viewColumns[e];let l=o.autoGenerated?o:a.columnByDataField[o.dataField];if(l.visible&&l.left+l.computedWidth-a._scrollView.scrollLeft>=u&&l.left-l.computedWidth-a._scrollView.scrollLeft<a._clientSize.width){let e=a.columnByDataField[t.column.dataField];g=Math.max(g,l.left-e.left+l.computedWidth);break}}}a.isHScrolling&&a._clearCachedTemplates();let p=null;if(!1!==e||a._cellsMerge.length>0){for(let e=0;e<a._columnElements.length;e++){const t=a._columnElements[e];if(!t.parentNode)break;t.set("column",null,!1),t.classList.add("smart-visibility-hidden")}for(let e=0;e<a._columnGroups.length;e++){const t=a._columnGroups[e],o=t.element;o&&(a.rightToLeft?o.style.right=t.right+"px":o.style.left=t.left+"px",o.style.width=t.computedWidth+"px")}a._firstVisibleColumn=null,a._lastVisibleColumn=null;for(let e=0;e<a.viewColumns.length;e++){let t=a.viewColumns[e];if(t.visible&&(a._firstVisibleColumn||(a._firstVisibleColumn=t),a._lastVisibleColumn=t),t.element&&(t===a._firstVisibleColumn||t.rowDetailColumn?t.element.classList.add("smart-grid-column-border-collapse"):t.element.classList.remove("smart-grid-column-border-collapse"),t.element.removeAttribute("aria-colindex")),t.freeze){if(!0!==t.freeze&&"near"!==t.freeze||t.visible&&(u+=t.computedWidth),!t.element)continue;t.visible?(t.element.classList.remove("smart-visibility-hidden"),t.render()):t.element.classList.add("smart-visibility-hidden")}else if(t.visible&&t.left+t.computedWidth-a._scrollView.scrollLeft>=u-g&&t.left-t.computedWidth-a._scrollView.scrollLeft<a._clientSize.width){const o=a._columnElements[c++];o&&(o.set("column",t,!1),o.parentNode||a.$.columnContainer.appendChild(o),p||(p=t,a._firstRenderedColumn=t),t.element=o,t.render(),o.setAttribute("aria-colindex",e+1),void 0===n&&(n=t.left))}}}if(void 0===n&&(n=0),a.rightToLeft){const e=a._scrollView.scrollWidth-a._scrollView.scrollLeft-a._scrollView.vScrollBar.offsetWidth;a.$.columnContainer.style.right=e+"px",e<=0&&!a._scrollView.scrollWidth&&(a.$.columnContainer.style.right=-a.offsetWidth+a._computedColumnsWidth+"px")}else a.$.columnContainer.style.left=-a._scrollView.scrollLeft+"px";if(a.$.rowContainer.style.top=a.__frozenNearHeight-l+d+"px",a.isScrolling&&!a.isHScrolling&&(a._scrollUpdate&&clearTimeout(a._scrollUpdate),a._scrollUpdate=setTimeout((function(){a.isScrolling||(a.$.rowContainer.style.top=parseInt(a.$.rowContainer.style.top)+.01+"px")}),50)),!1===t)return;if(!a._rowElements)return;const h=a.dataSource&&a.dataSource.virtualDataSource&&!a.dataSource.virtualDataSourceOnExpand&&a.dataSource.length>a.virtualModeCachedRowsCount&&"infinite"!==a.scrolling;if(i>=0){c=0;let e=Math.max(a._clientSize.height,a._overflowOffset),t=0;h&&(a.rowById=[],a.rows&&a.rows.length>0&&void 0===a.rows[a.rows.length-1].top&&(a.rows[a.rows.length-1].top=(a.rows.length-1)*a.rows[0].height),a.rows&&a.rows.length>0&&(t=a._getVirtualRowIndexByPosition(l),d=t*a.rows[0].height,a.$.rowContainer.style.top=a.__frozenNearHeight-l+d+"px",a.paging.enabled||(i=0)),a.paging.enabled&&(t=a.paging.pageIndex*a._pageSize));for(let o=i;o<r.length;o++){const n=r[o];if(0===n.height||!n.visible||!1===n.filtered||n.freeze&&n.visible)continue;const s=n.height;if(n.expandHeight&&(e+=a.offsetHeight+n.expandHeight),!(d+s>=l-m&&d<=l+e||a._autoHeight))break;{const e=a._rowElements[c++];if(!e)break;if(e.setAttribute("aria-rowindex",t+o+1),n.element=e,n.grid=a,h){if(n.index=o+t,n.visibleIndex=o+t,a.selection.enabled&&a._selection){const e=a._selection.indexes,t=n.canNotify;n.canNotify=!1,n.selected=e.indexOf(n.index)>=0,n.canNotify=t}a.paging.enabled?(n.data=a.dataSource[i+c-1],n.data&&(n.id=n.data.$.id,a.rowById[n.id]=n)):(n.data=a.dataSource[c-1],n.data&&(n.id=n.data.$.id,a.rowById[n.id]=n))}n.render()}d+=s}}a._renderFrozenRows();let f=c;if(c<a._rowElements.length)for(let e=c;e<a._rowElements.length;e++){const e=a._rowElements[c++];e.classList.add("smart-hidden"),e.removeAttribute("aria-rowindex")}a.editing.addNewRow&&a.editing.addNewRow.visible&&"button"===a.editing.addNewRow.displayMode&&a._rowElements[f]&&(a._newRow||(a._newRow=new Smart.Grid.Row({data:{},index:9999999,grid:a,addNewRow:!0,inline:!0,autoGenerated:!0})),a._newRow.element=a._rowElements[f],a._newRow.element.classList.remove("smart-hidden"),a._newRow.render()),h&&a._selection.selectionRect&&a._refreshCellSelectionRect()}_renderFrozenRows(){const e=this;let t=!1,o=!1;0===e._frozenNearRows.length?e.$.rowNearContainer.classList.add("smart-hidden"):e.$.rowNearContainer.classList.remove("smart-hidden");for(let o=0;o<e._frozenNearRows.length;o++){const a=e._frozenNearRows[o];a.visible||(a.element=e.$.rowNearContainer.children[o],a.element||(a.element=a.createElement(),e.$.rowNearContainer.appendChild(a.element)),a.element.classList.add("smart-hidden")),a.visible&&a.filtered&&(t=!0,a.element=e.$.rowNearContainer.children[o],a.element||(a.element=a.createElement(),e.$.rowNearContainer.appendChild(a.element)),a.render())}t||e.$.rowNearContainer.classList.add("smart-hidden"),0===e._frozenFarRows.length?e.$.rowFarContainer.classList.add("smart-hidden"):e.$.rowFarContainer.classList.remove("smart-hidden");for(let t=0;t<e._frozenFarRows.length;t++){const a=e._frozenFarRows[t];a.visible&&(o=!0),a.element=e.$.rowFarContainer.children[t],a.element||(a.element=a.createElement(),e.$.rowFarContainer.appendChild(a.element)),a.render()}o||e.$.rowFarContainer.classList.add("smart-hidden"),0!==e.columns.length&&e.hasVisibleColumn()||(e.$.rowNearContainer.classList.add("smart-hidden"),e.$.rowFarContainer.classList.add("smart-hidden"));const a=e.rows;a&&null!==a&&0!==a.length||(e.$.rowNearContainer.classList.add("smart-hidden"),e.$.rowFarContainer.classList.add("smart-hidden"))}_recycleRotate(e,t,o,a,l){const n=t.getBoundingClientRect(),i=e.getBoundingClientRect();let r=0,s=0;return 0===i.width?(e.innerHTML=l,!1):(n.left>i.left&&(r=i.left-n.left),n.top<i.top&&(s=i.top-n.top),"left"!==o&&""!==o||(r=4),"center"===o&&(r+=i.width/2-n.width/2),"right"===o&&(r+=i.width-n.width-4),"top"!==a&&""!==a||(s=4),"center"!==a&&"middle"!==a||(s+=i.height/2-n.height/2),"bottom"===a&&(s+=i.height-n.height-4),t.style.left=r+"px",t.style.top=s+"px",!0)}_virtualDataRequest(e,t){const o=this;let a=-1,l=-1;if(!o._rowElements&&"infinite"!==o.scrolling)return;if("virtual"===o.scrolling){for(let e=0;e<o._rowElements.length;e++){const t=o._rowElements[e],n=t.row,i=0===e?n.visibleIndex:a+e;t.classList.contains("smart-hidden")||(-1===a&&(a=i),-1!==i&&(l=1+i))}0===o._rowElements.length&&(a=0,l=Math.max(20,parseInt(o.offsetHeight/o.layout.rowMinHeight*1.5)))}else"infinite"===o.scrolling?(a=1/0,l=1/0):(a=0,l=o.dataSource.length);l!==1/0&&(o.dataSource.virtualDataSourceLength||o.dataSource.length)&&(l=Math.min(l,o.dataSource.length)),o.paging.enabled&&(a=o.paging.pageIndex*o._pageSize,l=a+o._pageSize),o._toggledRow||(o.appearance.displayLoadingIndicator=!0,o._setLoadingIndicatorVisibility()),o._groups||(o._groups=[].concat(o.dataSource.groupBy.toArray())||[]);const n={first:a,last:l,edit:o._editInfo,sorting:o.getSortedColumns(),filtering:o.getFilteredColumns(),grouping:o._groups,row:o._toggledRow?o._toggledRow.data:null,action:e},i=o.dataSource.length,r=o.dataSource.boundSource.length;void 0===o._isFirstVirtualDataSourceRequest&&(o._isFirstVirtualDataSourceRequest=!0),o.dataSource.onVirtualDataSourceRequested((function(e){if(o.appearance.displayLoadingIndicator=!1,o._setLoadingIndicatorVisibility(),o._toggledRow=null,!e)return o._initializeRows(),o._initializeRowElements(),o.refresh(),o._refreshPagesCount(),void(o._autoHeight&&o._initializeRowElements());if("add"===e.action)return void(t&&t(e.result));if("update"===e.action)return void(t&&t(e.result));if("remove"===e.action)return void(t&&t(e.result));const a=o.context;if(o.context=o,o._isFirstVirtualDataSourceRequest&&0===o._initColumns.length&&(o.columns.canNotify=!1,o.columns=[],o._renderColumns(),o.columns.canNotify=!0),"scroll"===e.action)if("infinite"===o.scrolling)o._recycle(!1,!1);else{const t=e.first>=0?e.first:0,a=e.last!==1/0?e.last:0;let l=0;for(let e=t;e<a;e++)o.rows[e]&&(o.rows[e].data=o.dataSource[l++]);o._recycle(!1,!1)}else if(o.dataSource.length!==i||o.dataSource.boundSource.length!==r||o._isFirstVirtualDataSourceRequest||"expand"===e.action||"filter"===e.action||"sort"===e.action||"pageIndexChange"===e.action||"pageSizeChange"===e.action||"sort"===e.action||"group"===e.action){if(o.paging.enabled&&o.$.headerPager.querySelector("smart-pager")&&(o.$.headerPager.querySelector("smart-pager").pagesCount=Math.ceil(o.dataSource.length/o._pageSize),o.$.footerPager.querySelector("smart-pager").pagesCount=Math.ceil(o.dataSource.length/o._pageSize)),o._initializeRows(),o._initializeRowElements(),o.refresh(),o._refreshPagesCount(),o._autoHeight&&o._initializeRowElements(),o.filtering.filterRow)for(let e=0;e<o.columns.length;e++)o.columns[e]._filterEditorInitialized&&(o.columns[e]._filterEditorInitialized=!1)}else o.dataSource.virtualDataSourceOnExpand&&o.refresh();o._isFirstVirtualDataSourceRequest&&o.onLoad&&(o.onLoad(o),delete o.onLoad),o._isFirstVirtualDataSourceRequest=!1,o._recycle(),o.context=a,o._onDataUpdated&&o._onDataUpdated()}),n)}_createAddNewRowButton(){const e=this,t=document.createElement("div");return t.className="smart-grid-add-row-button smart-grid-icon smart-icon-plus",t.title=e.localize("addNewRow"),e._addNewGridRow=t.onclick=()=>{e._addRowTimer&&clearTimeout(e._addRowTimer),e._addRowTimer=setTimeout((()=>{if(e.dataSource&&e.dataSource.virtualDataSource)return void e._insertNewRowAfter();const t={};for(let o=0;o<e.columns.length;o++){const a=e.columns[o];void 0!==a.defaultValue&&(t[a.dataField]=a.defaultValue)}e._addingNewRow=!0,e._add(t),e._scrollView.vScrollBar.value=e._scrollView.vScrollBar.max,e.closeMenu(),e._addingNewRow=!1}),0)},t}addColumn(e){const t=this;if(e){if("string"==typeof e){const o=t._getKanbanTaskField(e);return void(o&&t.columns.push(o))}t.columns.push(e)}}addNewColumn(e){e&&this.columns.push(e)}_createAddNewColumnButton(){const e=this,t=document.createElement("div");return t.className="smart-grid-add-column-button smart-grid-icon smart-icon-plus",t.title=e.localize("addNewColumn"),t.onclick=()=>{e._openAddColumnDialog(),e.addEventListener("closeColumnDialog",(()=>{e.layout.isDirty=!0,e._resetCachedLayout(),e._refreshLayout()}))},t}_showAddNewRowButton(e){const t=this;if(!t.columns.length)return;if("grid"!==t.view&&t.editing.addNewRow._addButton)return t.editing.addNewRow._addButton.remove(),void delete t.editing.addNewRow._addButton;if("float"===e&&t.computedVerticalScrollBarVisibility&&t.editing.addNewRow._addButton&&!t.editing.addNewRow._addButton.classList.contains("show"))return;if("float"===e&&t._addingNewRow)return;const o=()=>{t.editing.addNewRow._addButton&&t.editing.addNewRow._addButton&&("float"!==e&&(t.appearance.showRowHeader||t.appearance.showRowHeaderNumber)?t.editing.addNewRow._addButton.classList.remove("float"):t.computedVerticalScrollBarVisibility?t.computedVerticalScrollBarVisibility&&"float"===e&&t.editing.addNewRow._addButton.classList.add("float"):t.editing.addNewRow._addButton.classList.add("float"),t.computedHorizontalScrollBarVisibility?t.pager.visible?t.editing.addNewRow._addButton.style.bottom="68px":t.editing.addNewRow._addButton.style.bottom="20px":t.pager.visible?t.editing.addNewRow._addButton.style.bottom="48px":t.editing.addNewRow._addButton.style.bottom="")};t.editing.addNewRow.visible&&"button"===t.editing.addNewRow.displayMode&&(t.editing.addNewRow._addButton||(t.editing.addNewRow._addButton=t._createAddNewRowButton(),t.appendChild(t.editing.addNewRow._addButton)),requestAnimationFrame((()=>{t.editing.addNewRow._addButton&&(t.editing.addNewRow._addButton.classList.add("show"),o())})))}_showAddNewColumnButton(){const e=this,t=()=>{e.editing.addNewColumn._addButton.classList.add("float")};e.editing.addNewColumn.visible&&(e.editing.addNewColumn._addButton||(e.editing.addNewColumn._addButton=e._createAddNewColumnButton(),e.appendChild(e.editing.addNewColumn._addButton)),requestAnimationFrame((()=>{e.editing.addNewColumn._addButton.classList.add("show"),t()})))}_verticalScrollbarHandler(e){const t=this;t.menu&&t.menu.column&&t.closeMenu(),t.isScrolling=!0,t._scrollTimer&&clearTimeout(t._scrollTimer),t._layoutSuspended||(t._scrollTimer=setTimeout((()=>{if(t._recycle(!1),t.isScrolling=!1,e.max===e.value&&e.max>0){if(t.$.fireEvent("scrollBottomReached"),"infinite"===t.scrolling)return t.appearance.displayLoadingIndicator=!0,t._setLoadingIndicatorVisibility(),t._virtualScrollTimer&&clearTimeout(t._virtualScrollTimer),void(t._virtualScrollTimer=setTimeout((()=>{t._virtualDataRequest("scroll"),t.appearance.displayLoadingIndicator=!1,t._setLoadingIndicatorVisibility()}),50));t.editing.addNewRow._addButton&&t.editing.addNewRow._addButton.classList.remove("show")}else t.editing.addNewRow.visible&&"button"===t.editing.addNewRow.displayMode&&t.editing.addNewRow._addButton&&e.max>0&&(t.editing.addNewRow._addButton.classList.add("show"),t.editing.addNewRow._addButton.classList.remove("scroll"),t.editing.addNewRow._addButton.classList.add("float"));"virtual"===t.scrolling&&(t.appearance.displayLoadingIndicator=!0,t._setLoadingIndicatorVisibility(),t._virtualScrollTimer&&clearTimeout(t._virtualScrollTimer),t._virtualScrollTimer=setTimeout((()=>{t._virtualDataRequest("scroll"),t.appearance.displayLoadingIndicator=!1,t._setLoadingIndicatorVisibility()}),50)),e.min===e.value&&t.$.fireEvent("scrollTopReached")})))}getVerticalScrollMax(){return this.scrollHeight}getHorizontalScrollMax(){return this.scrollWidth}getHorizontalScrollValue(){return this.scrollLeft}setHorizontalScrollValue(e){this.scrollLeft=e}getVerticalScrollValue(){return this.scrollTop}setVerticalScrollValue(e){this.scrollTop=e}clearRows(){const e=this;e.dataSource=new Smart.DataAdapter({dataSource:[]}),e.rowHierarchy=null,e._visibleRows=null,e.__viewRows=null,e.rows.canNotify=!1,e.rows.length=0,e.rows.canNotify=!0,e.clearSelection(),e._refresh()}isEmpty(){const e=this;return!!(null===e.dataSource||e.dataSource&&e.dataSource.dataFields&&0===e.dataSource.length&&0===e.dataSource.dataSource.length&&!e.dataSource.virtualDataSource)}setRowStyle(e,t){const o=this,a=o.rowById[e];a&&(a.style=t,o._recycle(!1,!0))}setCellStyle(e,t,o){const a=this,l=a.rowById[e];if(l){const e=l.getCell(t);if(e){const t=e.canNotify;if(e.canNotify=!1,o)for(let t in o)void 0!==e[t]&&(e[t]=o[t]);else e.background=null,e.color=null,e.fontSize=null,e.fontFamily=null,e.fontWeight=null,e.textDecoration=null,e.fontStyle=null;e.canNotify=t,a._recycle(!1,!0)}}}dataBind(){const e=this;if(delete e.__autoRowHeight,e._virtualOnExpandCache=[],e._cellsMerge=[],e._cellStyles=[],null===e.dataSource||e.dataSource&&e.dataSource.dataFields&&0===e.dataSource.length&&0===e.dataSource.dataSource.length&&!e.dataSource.virtualDataSource)e.clearRows();else if(Array.isArray(e.dataSource))if(e.dataSourceSettings.dataFields&&e.dataSourceSettings.dataFields.length>0)e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource,dataSourceType:e.dataSourceSettings.dataSourceType,dataFields:e.dataSourceSettings.dataFields,keyDataField:e.dataSourceSettings.keyDataField,parentDataField:e.dataSourceSettings.parentDataField,childrenDataField:e.dataSourceSettings.childrenDataField,groupBy:e.dataSourceSettings.groupBy||e.grouping.groupBy,mapChar:e.dataSourceSettings.mapChar,root:e.dataSourceSettings.root,record:e.dataSourceSettings.record,autoGenerateColumns:e.autoGenerateColumns,id:e.dataSourceSettings.id,virtualDataSource:e.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:e.dataSourceSettings.virtualDataSourceOnExpand});else if(e.columns&&e.columns.length){let t=[];for(let o=0;o<e.columns.length;o++){const a=e.columns[o];t.push({name:a.dataField,dataType:a.dataType||"string"})}e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource,dataFields:t,dataSourceType:e.dataSourceSettings.dataSourceType,keyDataField:e.dataSourceSettings.keyDataField,parentDataField:e.dataSourceSettings.parentDataField,childrenDataField:e.dataSourceSettings.childrenDataField,groupBy:e.dataSourceSettings.groupBy||e.grouping.groupBy,mapChar:e.dataSourceSettings.mapChar,root:e.dataSourceSettings.root,record:e.dataSourceSettings.record,autoGenerateColumns:e.autoGenerateColumns,id:e.dataSourceSettings.id,virtualDataSource:e.dataSourceSettings.virtualDataSource,virtualDataSourceOnExpand:e.dataSourceSettings.virtualDataSourceOnExpand})}else e.dataSource=new Smart.DataAdapter({dataSource:e.dataSource});const t=e._filters,o=e._sortedColumns;if(e.clearSort(),e.filtering.filterRow)for(let t=0;t<e.columns.length;t++)e.columns[t]._filterEditorInitialized=!1;for(let t=0;t<e.columns.length;t++)delete e.columns[t]._cellsCachedValues;e._initColumns&&0===e._initColumns.length&&(e.columns=[],e._renderColumns(!0)),e._renderRows(),"virtual"===e.scrolling||e.paging.enabled&&e.dataSource&&e.dataSource.virtualDataSource||e.dataSource&&e.dataSource.virtualDataSource?e._virtualDataRequest("dataBind"):e.paging.enabled&&(!e.dataSource||e.dataSource&&!e.dataSource.url)&&e._refreshPagesCount(),o&&e._refreshSort(o),t&&t.length>0&&(e._filters=null,e.refreshFilters())}refresh(e){const t=this;t.isInitialized&&(e&&(t._initializeRows(),t._initializeRowElements()),t._refresh(),t._refreshSummary())}refreshView(){this._recycle()}beginUpdate(){const e=this;e._isUpdating||(e._isUpdating=0),e._isUpdating++}endUpdate(e,t){const o=this;o._isUpdating--,o._isUpdating<0&&(o._isUpdating=0),!1!==e?o.refresh():!1!==t&&o.refreshView()}}),Smart.Grid.Extend=function(e){if(!e)return;const t=Object.getOwnPropertyNames(e.prototype);for(let o in t){const a=t[o];"constructor"!==a&&(Smart.Grid.prototype[a]=e.prototype[a])}},Smart.Grid.Extend(Smart.Utilities.Grid.Resize),Smart.Grid.Extend(Smart.Utilities.Grid.Reorder),Smart.Grid.Extend(Smart.Utilities.Grid.Pager),Smart.Grid.Extend(Smart.Utilities.Grid.Filter),Smart.Grid.Extend(Smart.Utilities.Grid.Sort),Smart.Grid.Extend(Smart.Utilities.Grid.Menu),Smart.Grid.Extend(Smart.Utilities.Grid.Select),Smart.Grid.Extend(Smart.Utilities.Grid.Edit),Smart.Grid.Extend(Smart.Utilities.Grid.Dialog),Smart.Grid.Extend(Smart.Utilities.Grid.Group),Smart.Grid.Extend(Smart.Utilities.Grid.Tree),Smart.Grid.Extend(Smart.Utilities.Grid.Export),Smart.Grid.Extend(Smart.Utilities.Grid.Chart),Smart.Grid.Extend(Smart.Utilities.Grid.View),Smart.Grid.Cell=Smart.Utilities.Grid.Cell,Smart.Grid.Row=Smart.Utilities.Grid.Row,Smart.Grid.Column=Smart.Utilities.Grid.Column;
|
|
66
66
|
Smart("smart-menu-item",class extends Smart.BaseElement{static get properties(){return{checked:{value:!1,type:"boolean"},label:{value:"",type:"any"},level:{value:null,type:"number?"},separator:{value:!1,type:"boolean"},shortcut:{value:"",type:"string"},value:{value:null,type:"any"}}}get enableShadowDOM(){return!1}template(){return""}ready(){const e=this;if(super.ready(),e.$.addClass("smart-unselectable"),e.setAttribute("role","menuitem"),e.checked&&e.setAttribute("aria-checked",!0),!1===e.isDirty)return;const t=e.closest("smart-menu, smart-tree");t&&t.isRendered&&(cancelAnimationFrame(Smart.Menu.processTimer),Smart.Menu.processTimer=requestAnimationFrame((()=>{t._lazyInitItems()})))}propertyChangedHandler(e,t,n){const o=this;if(super.propertyChangedHandler(e,t,n),"smart-tree-item"===o.tagName.toLowerCase())return;const i=o.menu,r=o.parentItem,a=r||i;if("label"===e)return""===n?void(o.label=t):(o.setAttribute("aria-label",n),void(i&&i._setItemLabel(o,n)));if(!i)return;if("separator"===e)return void i._refreshCheckableItems(a);if("disabled"!==e||!1===n||!o.checked)return;super.propertyChangedHandler(e,t,n),o.checked=!1;const s=a.checkMode;"radioButton"===s?i._validateRadioButtonSelection(r,o.level,[]):"checkbox"!==s&&i._refreshCheckableItems(a)}}),Smart("smart-menu-items-group",class extends Smart.BaseElement{static get properties(){return{checkable:{value:!1,type:"boolean"},checked:{value:!1,type:"boolean"},checkMode:{value:"checkbox",type:"string"},dropDownHeight:{value:null,type:"number?"},expanded:{value:!1,type:"boolean"},label:{value:"",type:"any"},level:{value:null,type:"number?"},separator:{value:!1,type:"boolean"},value:{value:null,type:"any"}}}get enableShadowDOM(){return!1}template(){return""}ready(){const e=this;if(super.ready(),e.$.addClass("smart-unselectable"),e.setAttribute("role","menuitem"),e.setAttribute("aria-haspopup",!0),e.setAttribute("aria-expanded",e.expanded),e.checked&&e.setAttribute("aria-checked",!0),!1===e.isDirty)return;const t=e.closest("smart-menu, smart-tree");t&&t.isRendered&&(cancelAnimationFrame(Smart.Menu.processTimer),Smart.Menu.processTimer=requestAnimationFrame((()=>{t._lazyInitItems()})))}propertyChangedHandler(e,t,n){const o=this;if(super.propertyChangedHandler(e,t,n),"smart-tree-items-group"===o.tagName.toLowerCase())return;const i=o.menu,r=o.parentItem,a=r||i;if("label"===e)return""===n?void(o.label=t):(o.setAttribute("aria-label",n),void(i&&i._setItemLabel(o,n)));if(i&&-1!==["checkable","checkMode","disabled","separator"].indexOf(e))switch(e){case"checkable":n?o.itemContainer.setAttribute("checkable",""):o.itemContainer.removeAttribute("checkable"),i._isContainerOpened(o.container.level,o.container)&&"tree"!==i.mode&&!i._minimized&&i._closeSubContainers(o.level+2),i._updateItemRoles(o);break;case"checkMode":o.itemContainer.setAttribute("check-mode",n),i._changeToRadioButtonMode(n,o.itemContainer,o),i._updateItemRoles(o);break;case"disabled":{if(Smart.ListMenu&&i instanceof Smart.ListMenu){if(i._view)for(;o.contains(i._view);)i._backButtonClickHandler()}else i._isContainerOpened(o.container.level,o.container)&&i._closeSubContainers(o.level+1,o.container);if(!o.checked)return;o.checked=!1;const e=a.checkMode;"radioButton"===e?i._validateRadioButtonSelection(r,o.level,[]):"checkbox"!==e&&i._refreshCheckableItems(a);break}case"separator":i._refreshCheckableItems(a)}}}),Smart("smart-menu",class extends Smart.BaseElement{static get properties(){return{autoCloseDelay:{value:100,type:"number"},autoFocusOnMouseenter:{value:!1,type:"boolean"},checkable:{value:!1,type:"boolean"},checkboxes:{value:!1,type:"boolean"},checkMode:{value:"checkbox",type:"string"},closeAction:{value:"up",allowedValues:["up","down","none"],type:"string"},disableAutoCheck:{value:!1,type:"boolean"},dataSource:{value:null,type:"array?",reflectToAttribute:!1},displayMember:{value:"label",type:"string"},dropDownAppendTo:{value:null,type:"any?"},dropDownOverlay:{value:!1,type:"boolean"},dropDownPosition:{value:"auto",allowedValues:["top-left","top-right","bottom-left","bottom-right","overlay-left","overlay-right","auto"],type:"string"},enableMouseWheelAction:{value:!1,type:"boolean"},innerHTML:{type:"string",reflectToAttribute:!1},itemsMember:{value:"items",type:"string"},minimizeIconTemplate:{value:null,type:"string?"},minimizeWidth:{value:null,type:"number?"},mode:{value:"horizontal",allowedValues:["horizontal","vertical","dropDown","tree"],type:"string"},opened:{value:!1,type:"boolean"},overflow:{value:"auto",allowedValues:["auto","hidden","scroll"],type:"string"},preventCloseOnCheck:{value:!1,type:"boolean"},selectionMode:{value:"click",allowedValues:["click","mouseenter"],type:"string"},valueMember:{value:"value",type:"string"}}}static get listeners(){return{"container.click":"_selectionHandler",keydown:"_keydownHandler",mouseenter:"_mouseenterHandler",mouseleave:"_mouseleaveHandler","container.mouseout":"_mouseoutMouseoverHandler","container.mouseover":"_mouseoutMouseoverHandler",resize:"_resizeHandler",transitionend:"_transitionendHandler","hamburgerIcon.click":"_hamburgerIconClickHandler","mainContainer.click":"_mainContainerHandler","mainContainer.mouseleave":"_mainContainerHandler","mainContainer.mouseout":"_mainContainerHandler","mainContainer.mouseover":"_mainContainerHandler","document.down":"_documentDownHandler","document.up":"_documentUpHandler"}}static get requires(){return{"Smart.RepeatButton":"smart.button.js"}}static get styleUrls(){return["smart.button.css","smart.menu.css"]}get items(){return this._menuItems}template(){return'<div id="container" role="presentation">\n <div id="minimizedHeader" class="smart-header smart-minimized-header smart-hidden" role="presentation">\n <div id="hamburgerIcon" class="smart-hamburger-icon smart-hidden" role="button" aria-label="Toggle minimized menu" aria-haspopup="true">\n <div id="hamburgerIconLineTop" class="smart-hamburger-icon-line smart-hamburger-icon-line-top" role="presentation"></div>\n <div id="hamburgerIconLineCenter" class="smart-hamburger-icon-line smart-hamburger-icon-line-center" role="presentation"></div>\n <div id="hamburgerIconLineBottom" class="smart-hamburger-icon-line smart-hamburger-icon-line-bottom" role="presentation"></div>\n <div id="customIconContainer" class="smart-hamburger-icon-custom-container smart-hidden" role="presentation"></div>\n </div>\n </div>\n <smart-repeat-button id="scrollButtonNear" class="smart-menu-scroll-button smart-spin-button smart-scroll-button-near smart-hidden" animation="[[animation]]" unfocusable right-to-left="[[rightToLeft]]">\n <div id="arrowNear" class="smart-arrow" aria-hidden="true"></div>\n </smart-repeat-button>\n <div id="mainContainer" class="smart-menu-main-container" role="presentation">\n <content></content>\n </div>\n <smart-repeat-button id="scrollButtonFar" class="smart-menu-scroll-button smart-spin-button smart-scroll-button-far smart-hidden" animation="[[animation]]" unfocusable right-to-left="[[rightToLeft]]">\n <div id="arrowFar" class="smart-arrow" aria-hidden="true"></div>\n </smart-repeat-button>\n </div>'}attached(){const e=this;if(super.attached(),!e.isCompleted||!e.isRendered||"tree"===e._element||Smart.ListMenu&&e instanceof Smart.ListMenu)return;const t=e._scrollInfo;if(null!==e.dropDownAppendTo){if(e._minimized)e._dropDownParent.appendChild(e.$.mainContainer);else for(let t=0;t<e._containersInBody.length;t++)e._dropDownParent.appendChild(e._containersInBody[t]);"dropDown"===e.mode&&(e._dropDownParent===e.parentElement?e._dynamicallyReparented?delete e._dynamicallyReparented:e._positionRelativeTo=null:(e._positionRelativeTo=e.parentElement,e._dynamicallyReparented=!0,setTimeout((function(){e._dropDownParent.appendChild(e)}),0)))}t&&t.forEach((function(e,t){t.scrollLeft=e.left,t.scrollTop=e.top}))}detached(){const e=this;super.detached(),"tree"===e._element||Smart.ListMenu&&e instanceof Smart.ListMenu||(e._close(),null!==e.dropDownAppendTo&&(e._minimized?e._dropDownParent.removeChild(e.$.mainContainer):e._removeContainersInBody()))}ready(){super.ready()}render(){const e=this;e._element="menu",e._edgeMacFF=Smart.Utilities.Core.Browser.Edge||Smart.Utilities.Core.Browser.Firefox&&-1!==navigator.platform.toLowerCase().indexOf("mac"),e._containers=[],e._containersInBody=[],e._openedContainers=[],e._containersFixedHeight=[],e._menuItemsGroupsToExpand=[],e._additionalScrollButtons=[],e._scrollInfo=new Map,e._createElement(),super.render()}addItem(e,t){const n=this;if(!(e instanceof Smart.MenuItem||e instanceof Smart.MenuItemsGroup))if("string"==typeof e){const t=document.createElement("smart-menu-item");t.label=e,e=t}else{if(!e||!e.label)return;{const t=document.createElement("smart-menu-item");t.label=e.label,e=t}}let o,i,r;if(e.isDirty=!1,void 0===t)o=n,i=1,r=t=n.$.mainContainer;else{if((t=n.getItem(t))instanceof Smart.MenuItemsGroup==0)return;o=t,i=t.level+1,r=t.itemContainer}if(n._createItemHTMLStructure(e,i,t,r.childElementCount,0),e instanceof Smart.MenuItemsGroup&&(n._processHTML(e,i+1),n._checkContainersLength()),r.appendChild(e),n._checkOverflowAddRemove(e.level,r),e instanceof Smart.MenuItemsGroup&&("tree"===n.mode||n._minimized)){const t=e.getElementsByClassName("smart-menu-items-group-arrow");for(let e=0;e<t.length;e++)t[e].className="smart-menu-items-group-arrow down smart-arrow-down";n._expandItemsByDefault()}n._refreshCheckableItems(o)}checkItem(e){void 0===(e=this.getItem(e))||e.checked||e.disabled||e.templateApplied||this._toggleItem(e)}clear(){const e=this;e.$.mainContainer.innerHTML="",e._removeContainersInBody(),e._menuItems={},e._containers=[],e._containersInBody=[],e._openedContainers=[],e._containersFixedHeight=[],e._menuItemsGroupsToExpand=[],e._additionalScrollButtons=[]}clickItem(e){const t=this;"string"==typeof e&&(e=t.getItem(e)),e&&e.nodeName&&t._selectionHandler({type:"click",isTrusted:!0,target:e,stopPropagation:()=>{},preventDefault:()=>{}})}close(){const e=this;"dropDown"!==e.mode||!1===e.opened&&e.$.hasClass("smart-visibility-hidden")||(e.$.fireEvent("closing",arguments[0]||{trigger:"programmatic"}).defaultPrevented?e.opened=!0:(e.opened=!1,e.$.addClass("smart-visibility-hidden"),e._close(),e.$.fireEvent("close")))}collapseItem(e,t){const n=this,o=n.animation,i=!1===t&&n.hasAnimation;if(void 0===e)return i&&(n.animation="none"),n._close(),void(i&&setTimeout((function(){n.animation=o}),0));if(void 0===(e=n.getItem(e))||e instanceof Smart.MenuItem)return;const r=e.level;if(n._openedContainers[r+1]&&n._isContainerOpened(r+1,e.container)){const t=n.mode;i&&(n.animation="none"),n._closeSubContainers(r+1,e.container,void 0,!1!==arguments[2]),1!==r&&"tree"!==t||n._checkOverflow(n.$.mainContainer,"horizontal"===t,[n.$.scrollButtonNear,n.$.scrollButtonFar]),i&&(n.animation=o)}}expandItem(e,t){const n=this;if(void 0===(e=n.getItem(e))||e instanceof Smart.MenuItemsGroup&&n._isContainerOpened(e.level+1,e.container)&&n._isBranchExpanded(e))return;void 0!==Smart.Menu.processTimer&&n._lazyInitItems();const o=[e],i=n.animation,r=!1===t&&n.hasAnimation;let a=e.parentItem;for(r&&(n.animation="none"),n._discardKeyboardHover();a;)o.unshift(a),a=a.parentItem;for(let e=0;e<o.length;e++){const t=o[e];if(e===o.length-1&&t instanceof Smart.MenuItem){t.disabled||t.templateApplied||n._hoverViaKeyboard(t);break}n._isContainerOpened(t.container.level,t.container)||n._menuItemsGroupSelectionHandler(t,{target:t,type:"expand",isTrusted:!0},arguments[2])}r&&(n.animation=i)}getItem(e){const t=this;let n;if(null!=e&&t._menuItems){if("string"==typeof e){if(/^[0-9]*([.]?[0-9]*)*$/gm.test(e))return t._menuItems[e];if(n=t.$.mainContainer.querySelector('[id="'+e+'"]'),null===n)return t._menuItems[e]}else{if(!isNaN(e))return t._menuItems[e.toString()];n=e}if((n instanceof Smart.MenuItem||n instanceof Smart.MenuItemsGroup)&&(t.contains(n)||t.$.mainContainer.contains(n)||n.parentElement.parentElement.ownerElement===t))return n}}maximize(){const e=this;if(!e._minimized)return;const t=e.animation;if(e.$.mainContainer.style.marginTop="",e.$.mainContainer.style.marginLeft="",e.enableShadowDOM&&!e.$.mainContainer.id&&(e.$.mainContainer.id=e.$.mainContainer.getAttribute("smart-id")),"none"!==t&&(e.animation="none"),e._positionDetection.removeOverlay(),e._closeSubContainers(2),e.$minimizedHeader.addClass("smart-hidden"),e._minimized=!1,e._minimizedDropDownOpened&&(e.$hamburgerIcon.removeClass("smart-close-button"),e._minimizedDropDownOpened=!1),null!==e.dropDownAppendTo&&e._appendMinimizedContainerToMenu(e.$.mainContainer,e.$.scrollButtonFar),"tree"!==e.mode){e.$mainContainer.addClass("smart-menu-main-container"),e.$mainContainer.removeClass("smart-menu-minimized-items-container");const t=e.$.mainContainer.getElementsByClassName("smart-menu-items-group-arrow");for(let n=0;n<t.length;n++)e._setArrowDirection(t[n],t[n].parentElement.parentElement.level+1);null!==e.dropDownAppendTo&&e._moveDropDownsToExternalContainer(),e._applyContainerFixedHeight()}e.$mainContainer.removeClass("smart-visibility-hidden"),e.$hamburgerIcon.addClass("smart-hidden"),e.removeAttribute("minimized"),e._checkOverflow(e.$.mainContainer,"horizontal"===e.mode,[e.$.scrollButtonNear,e.$.scrollButtonFar]),"none"!==t&&setTimeout((function(){e.animation=t}),0),e.$.mainContainer.removeAttribute("drop-down"),e.$.hamburgerIcon.removeAttribute("aria-expanded"),e.$.hamburgerIcon.removeAttribute("aria-owns"),e.$.mainContainer.setAttribute("role","presentation"),e.$.mainContainer.removeAttribute("aria-orientation"),e.setAttribute("role","menu"),e.setAttribute("aria-orientation","horizontal"===e.mode?"horizontal":"vertical")}minimize(){const e=this;if(e._minimized||"dropDown"===e.mode)return;e.$minimizedHeader.removeClass("smart-hidden");const t=null!==e.dropDownAppendTo,n=e.animation,o=e.hasAnimation;if(o&&(e.animation="none"),e._positionDetection.removeOverlay(),e._closeSubContainers(2),o&&t&&(e.animation=n),"tree"!==e.mode&&(t&&e._moveDropDownsToMenu(),e._removeContainerFixedHeight()),e._hideMainContainerScrollButtons(),e.$mainContainer.removeClass("smart-menu-main-container"),e.$mainContainer.addClass("smart-visibility-hidden"),e.enableShadowDOM&&e.$.mainContainer.removeAttribute("id"),e._edgeMacFF&&(e.$.mainContainer.style.left="",e.$.mainContainer.style.top="",e.$mainContainer.addClass("not-in-view")),e.$hamburgerIcon.removeClass("smart-hidden"),t&&e._appendMinimizedContainerToExternalElement(e.$.mainContainer),setTimeout((function(){e.$mainContainer.addClass("smart-menu-minimized-items-container"),o&&!t&&(e.animation=n)}),0),e._minimized=!0,e.setAttribute("minimized",""),"tree"!==e.mode)for(let t=0;t<e._containers.length;t++){const n=e._containers[t];n.level>2&&e._setArrowDirection(n.menuItemsGroup.children[0].children[1],n.level)}e.$.mainContainer.setAttribute("drop-down",""),e.setAttribute("role","presentation"),e.removeAttribute("aria-orientation"),e.$.hamburgerIcon.setAttribute("aria-expanded",!1),e.$.hamburgerIcon.setAttribute("aria-owns",e.$.mainContainer.id),e.$.mainContainer.setAttribute("role","menu"),e.$.mainContainer.setAttribute("aria-orientation","vertical")}open(e,t){const n=this;if("dropDown"!==n.mode)return;if(n.$.fireEvent("opening").defaultPrevented)return void(n.opened=!1);let o;if(n.opened=!0,n._positionRelativeTo){const i=n._positionRelativeTo.getBoundingClientRect();e+=i.left,t+=i.top,n._positionedParent?(o=n._positionedParent.getBoundingClientRect(),e-=o.left,t-=o.top):(e+=window.pageXOffset,t+=window.pageYOffset)}let i=e+n.offsetWidth-document.documentElement.clientWidth,r=t+n.offsetHeight-document.documentElement.clientHeight;o?(i+=o.left,r+=o.top):(i-=window.pageXOffset,r-=window.pageYOffset),i>0?e-=i:e=o?Math.max(e,-o.left):Math.max(e,window.pageXOffset),r>0?t-=r:t=o?Math.max(t,-o.top):Math.max(t,window.pageYOffset),n.style.right="",isNaN(e)||(n.rightToLeft&&(n.style.right="initial"),n.style.left=e+"px"),isNaN(t)||(n.style.top=t+"px"),n.$.removeClass("smart-visibility-hidden"),n.$.fireEvent("open"),n.hasAnimation||(n._checkOverflowOnOpen&&(n._checkOverflow(n.$.mainContainer,!1,[n.$.scrollButtonNear,n.$.scrollButtonFar]),delete n._checkOverflowOnOpen),n._noAutoFocus||n.focus())}removeItem(e){const t=this;if(void 0===(e=t.getItem(e)))return;const n=e.parentElement,o=e.parentItem||t;if(e instanceof Smart.MenuItemsGroup){const n=e.container;if(t._isContainerOpened(n.level,n)&&t._closeSubContainers(n.level,n),1===e.level){const e=t._containersInBody.indexOf(n);-1!==e&&(t._containersInBody.splice(e,1),null===t.dropDownAppendTo||"tree"===t.mode||t._minimized||t._dropDownParent.removeChild(n))}}n.removeChild(e),t._refreshContainersArrays(),t._menuItems={},t._refreshItemPaths(t.$.mainContainer,!0),t._checkOverflowAddRemove(e.level,n),t._refreshCheckableItems(o)}uncheckItem(e){void 0===(e=this.getItem(e))||!e.checked||e.disabled||e.templateApplied||this._toggleItem(e)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const o=this;if("tree"!==o._element)switch(e){case"animation":o.$.mainContainer.setAttribute("animation",n),o._additionalScrollButtons.forEach((function(e){e[0].animation=n,e[1].animation=n})),null!==o._dropDownParent&&o._containers.forEach((function(e){e.setAttribute("animation",n)}));break;case"checkable":"tree"===o.mode||o._minimized?o._minimized&&null!==o.dropDownAppendTo&&r("checkable",o.$.mainContainer,n):o._closeSubContainers(2),o._updateItemRoles(o);break;case"checkboxes":if(o._close(),null!==o.dropDownAppendTo){for(let e=0;e<o._containers.length;e++)r("checkboxes",o._containers[e],n);o._minimized&&r("checkboxes",o.$.mainContainer,n)}o._updateItemRoles();break;case"checkMode":o._changeToRadioButtonMode(n,o.$.mainContainer),o._minimized&&null!==o.dropDownAppendTo&&o.$.mainContainer.setAttribute("check-mode",n),o._updateItemRoles(o);break;case"dataSource":{let e=!1;o._minimized&&(o.maximize(),e=!0),o._removeContainersInBody(),o._containersInBody=[],o._menuItems={},o._processDataSource(),o._checkContainersLength(),e?o.minimize():i(),o._expandItemsByDefault(),o._refreshCheckableItems(),o._suppressResizeHandler=!0,setTimeout((()=>delete o._suppressResizeHandler),500);break}case"innerHTML":o.$.mainContainer.innerHTML=n,o._lazyInitItems();break;case"dropDownAppendTo":{const e=o._dropDownParent;if(o._positionDetection.getDropDownParent(),o._dropDownParent===e||"tree"===o.mode&&!o._minimized)return;if(o._close(),o._minimized)return void(null===n?o._appendMinimizedContainerToMenu(o.$.mainContainer,o.$.scrollButtonFar):o._appendMinimizedContainerToExternalElement(o.$.mainContainer));if(null!==o._dropDownParent&&null===e)o._moveDropDownsToExternalContainer();else if(null===o._dropDownParent&&null!==e)o._moveDropDownsToMenu();else if(null!==o._dropDownParent&&null!==e)for(let e=0;e<o._containersInBody.length;e++)o._dropDownParent.appendChild(o._containersInBody[e]);null!==n||o.$mainContainer.hasClass("simple")?o._checkOverflow(o.$.mainContainer,"horizontal"===o.mode,[o.$.scrollButtonNear,o.$.scrollButtonFar]):o._hideMainContainerScrollButtons();for(let e=0;e<o._containersFixedHeight.length;e++)o._containersFixedHeight[e].itemContainer.checkOverflow=!0;"dropDown"===o.mode&&(o.close({trigger:"internal"}),o._reparentMenu(!0,e));break}case"dropDownOverlay":n||o._positionDetection.removeOverlay();break;case"disabled":n&&o._close(),o._setFocusable(),o.$.scrollButtonNear.disabled=n,o.$.scrollButtonFar.disabled=n,n||null===o.dropDownAppendTo&&!o.$mainContainer.hasClass("simple")&&"tree"!==o.mode||o._updateScrollButtonVisibility(o.$.mainContainer,"horizontal"===o.mode,[o.$.scrollButtonNear,o.$.scrollButtonFar]);break;case"dropDownPosition":case"mode":{if("mode"===e){if(delete o._dynamicallyReparented,"tree"===t||o._minimized?(o._closeSubContainersTreeMode(2,void 0,void 0,void 0,!0),o._openedContainers=[]):o._closeSubContainersDefaultMode(2),o._discardKeyboardHover(!0),o._minimized&&o._minimizedDropDownOpened&&(o.$mainContainer.addClass("smart-visibility-hidden"),o.$hamburgerIcon.removeClass("smart-close-button"),o.$.hamburgerIcon.setAttribute("aria-expanded",!1),o._minimizedDropDownOpened=!1),"horizontal"!==n&&"horizontal"!==t||o._changeScrollButtonsArrows(),o._minimized)return void("dropDown"===n&&(o.mode=t));o.setAttribute("aria-orientation","horizontal"===o.mode?"horizontal":"vertical"),!1===o.opened&&("dropDown"===n?o.$.addClass("smart-visibility-hidden"):"dropDown"===t&&o.$.removeClass("smart-visibility-hidden")),"tree"===t?(null!==o.dropDownAppendTo&&o._moveDropDownsToExternalContainer(),o.$mainContainer.addClass("smart-menu-main-container"),o.$mainContainer.removeClass("smart-menu-minimized-items-container"),o._applyContainerFixedHeight()):"tree"===n&&(null!==o.dropDownAppendTo&&o._moveDropDownsToMenu(),o._applyTreeMode()),"auto"===o.overflow&&o._hideMainContainerScrollButtons(),i()}if("tree"===o.mode||o._minimized)return o._minimizedDropDownOpened&&o._close(),void(o._minimized&&null!==o.dropDownAppendTo&&o.$.mainContainer.setAttribute(o.properties[e].attributeName,n));"dropDownPosition"===e&&o._close();const r=o._containers.map((e=>e.menuItemsGroup));for(let e=0;e<r.length;e++){const t=r[e];o._setArrowDirection(t.children[0].children[1],t.level+1)}if(null!==o.dropDownAppendTo)for(let t=0;t<o._containers.length;t++){const i=o._containers[t];i.setAttribute(Smart.Utilities.Core.toDash(e),n),i.level>2&&o._setArrowDirection(i.menuItemsGroup.children[0].children[1],i.level)}break}case"minimizeIconTemplate":o._applyMinimizeIconTemplate(n,t);break;case"minimizeWidth":o._resizeHandler();break;case"opened":n?o.open():o.close({trigger:"internal"});break;case"overflow":o._handleOverflowChange();break;case"rightToLeft":if("tree"!==o.mode){const e=o._containers.map((e=>e.menuItemsGroup));for(let t=0;t<e.length;t++){const n=e[t];o._setArrowDirection(n.children[0].children[1],n.level+1)}if(null!==o.dropDownAppendTo){n?o.$.mainContainer.setAttribute("right-to-left",""):o.$.mainContainer.removeAttribute("right-to-left");for(let e=0;e<o._containers.length;e++){const t=o._containers[e];n?t.setAttribute("right-to-left",""):t.removeAttribute("right-to-left"),t.level>2&&o._setArrowDirection(t.menuItemsGroup.children[0].children[1],t.level)}}}break;case"theme":if(null===o.dropDownAppendTo||Smart.ListMenu&&o instanceof Smart.ListMenu)return;if(o._minimized)""!==t&&o.$mainContainer.removeClass(t),""!==n&&o.$mainContainer.addClass(n);else for(let e=0;e<o._containers.length;e++){const i=o._containers[e];""!==t&&i.classList.remove(t),""!==n&&i.classList.add(n)}break;case"unfocusable":o._setFocusable()}function i(){null===o.dropDownAppendTo&&"tree"!==o.mode||o._checkOverflow(o.$.mainContainer,"horizontal"===o.mode,[o.$.scrollButtonNear,o.$.scrollButtonFar])}function r(e,t,n){n?t.setAttribute(e,""):t.removeAttribute(e)}}_addOpenedContainer(e,t){const n=this;if("tree"===n.mode||n._minimized){n._openedContainers[e]||(n._openedContainers[e]=[]);const o=t.menuItemsGroup;return o.set("expanded",!0),o.setAttribute("aria-expanded",!0),n._updateState&&n._updateState("expanded",o.id,!0),n._openedContainers[e].push(t)}n._openedContainers[e]=t}_appendMinimizedContainerToExternalElement(e){const t=this;e.ownerElement=t,t._dropDownParent.appendChild(e),e.setAttribute("animation",t.animation),""!==t.theme&&e.$.addClass(t.theme),e.$.addClass("smart-menu-drop-down smart-drop-down"),e.$.addClass("smart-drop-down-repositioned"),e.setAttribute("check-mode",t.checkMode),e.setAttribute("drop-down-position",t.dropDownPosition),e.setAttribute("mode",t.mode),e.setAttribute("loading-indicator-position",t.loadingIndicatorPosition),t.rightToLeft&&e.setAttribute("right-to-left",""),t.checkable&&e.setAttribute("checkable",""),t.checkboxes&&e.setAttribute("checkboxes",""),t.$.view&&t.detachedChildren.indexOf(t.$.view)&&t.detachedChildren.push(t.$.view)}_appendMinimizedContainerToMenu(e,t){const n=this;delete e.ownerElement,n.$.container.insertBefore(e,t),e.removeAttribute("animation"),""!==n.theme&&e.$.removeClass(n.theme),e.$.removeClass("smart-menu-drop-down smart-drop-down"),e.$.removeClass("smart-drop-down-repositioned"),e.removeAttribute("checkable"),e.removeAttribute("checkboxes"),e.removeAttribute("check-mode"),e.removeAttribute("drop-down-position"),e.removeAttribute("mode"),e.removeAttribute("loading-indicator-position"),e.removeAttribute("style"),e.removeAttribute("right-to-left")}_applyContainerFixedHeight(){const e=this;for(let t=0;t<e._containers.length;t++){const n=e._containers[t];-1!==e._containersFixedHeight.indexOf(n)?(n.style.height=n.menuItemsGroup.dropDownHeight+"px",n.itemContainer.checkOverflow=!0):n.style.height=""}}_applyGrouping(e,t){const n=this;let o;o=e===n.$.mainContainer?Array.from(e.children):Array.from(e.container.firstElementChild.children);for(let e=0;e<o.length;e++){const i=o[e];i.originalIndex=e,i instanceof Smart.MenuItemsGroup&&void 0===t&&n._applyGrouping(i)}n._sortItems(e)}_applyMinimizeIconTemplate(e,t){const n=this;if(null===e){if(null===t)return;n.$customIconContainer.addClass("smart-hidden"),n.$.customIconContainer.innerHTML="",n.$hamburgerIconLineTop.removeClass("smart-hidden"),n.$hamburgerIconLineCenter.removeClass("smart-hidden"),n.$hamburgerIconLineBottom.removeClass("smart-hidden")}else{const o=document.getElementById(e);if(null!==o&&"template"===o.tagName.toLowerCase()){const e=document.importNode(o.content,!0);n.$hamburgerIconLineTop.addClass("smart-hidden"),n.$hamburgerIconLineCenter.addClass("smart-hidden"),n.$hamburgerIconLineBottom.addClass("smart-hidden"),n.$.customIconContainer.innerHTML="",n.$.customIconContainer.appendChild(e),n.$customIconContainer.removeClass("smart-hidden")}else n.minimizeIconTemplate=t}}_applyTreeMode(){const e=this,t=e.$.mainContainer.getElementsByClassName("smart-menu-items-group-arrow");if(e.$mainContainer.removeClass("smart-menu-main-container"),e.$mainContainer.addClass("smart-menu-minimized-items-container"),e.isCompleted&&e.isRendered)for(let e=0;e<t.length;e++)t[e].className="smart-menu-items-group-arrow down";e._removeContainerFixedHeight()}_arrowLeftHandler(e,t,n,o){const i=this;1===e?"horizontal"===t&&i._levelOneNavigate("_getLastEnabledChild",n,o):2===e?i._levelOneNavigateFromLowerLevel("_getPreviousEnabledChild",n):i._escapeHandler(n,e,o)}_arrowRightHandler(e,t,n,o){const i=this;1===e?"horizontal"===t?i._levelOneNavigate("_getFirstEnabledChild",n,o):i._levelOneOpenDropDown(n):n instanceof Smart.MenuItemsGroup?i._selectionHandler({target:n,isTrusted:!0}):i._levelOneNavigateFromLowerLevel("_getNextEnabledChild",n)}_browserBoundsDetection(e){const t=this;if("tree"===t.mode&&!t._minimized)return;if(e.style.marginTop="",e.style.marginLeft="","auto"!==t.dropDownPosition)return;const n=1===window.devicePixelRatio?document.documentElement.clientWidth:window.innerWidth,o=1===window.devicePixelRatio?document.documentElement.clientHeight:window.innerHeight,i=e.getBoundingClientRect(),r=n-i.left-e.offsetWidth,a=o-i.top-e.offsetHeight;r<10&&(e.style.marginLeft=Math.min(r-10,-10)+"px"),a<10&&(e.style.marginTop=Math.min(a-10,-10)+"px")}_changeScrollButtonsArrows(){const e=this;"horizontal"===e.mode?(e.$.scrollButtonNear.setAttribute("aria-label","Scroll left"),e.$.scrollButtonFar.setAttribute("aria-label","Scroll right"),e.$arrowNear.removeClass("smart-arrow-up"),e.$arrowFar.removeClass("smart-arrow-down"),e.$arrowNear.addClass("smart-arrow-left"),e.$arrowFar.addClass("smart-arrow-right")):(e.$.scrollButtonNear.setAttribute("aria-label","Scroll up"),e.$.scrollButtonFar.setAttribute("aria-label","Scroll down"),e.$arrowNear.removeClass("smart-arrow-left"),e.$arrowFar.removeClass("smart-arrow-right"),e.$arrowNear.addClass("smart-arrow-up"),e.$arrowFar.addClass("smart-arrow-down"))}_changeToRadioButtonMode(e,t,n){if("radioButton"===e){const e=[];for(let n=0;n<t.childElementCount;n++){const o=t.children[n];!o.checked||o.disabled||o.templateApplied||e.push(o)}this._validateRadioButtonSelection(n,n?n.level+1:1,e)}}_checkContainersLength(e){const t=this;0===t._containers.length?(t.$mainContainer.addClass("simple"),e||t._checkOverflow(t.$.mainContainer,"horizontal"===t.mode,[t.$.scrollButtonNear,t.$.scrollButtonFar])):e||(t.$mainContainer.removeClass("simple"),null===t.dropDownAppendTo&&"tree"!==t.mode&&t.$mainContainer.removeClass("scroll-buttons-shown one-button-shown"))}_checkOverflow(e,t,n){const o=this,i=o.$.mainContainer,r=e===i?o.overflow:"auto";if(o._minimized||"hidden"===r||null===o.dropDownAppendTo&&"tree"!==o.mode&&e===i&&!i.classList.contains("simple"))return;if("dropDown"===o.mode&&!o.opened)return void(o._checkOverflowOnOpen=!0);const a=e.scrollLeft,s=a/(e.scrollWidth-e.offsetWidth),l=e.scrollTop,d=l/(e.scrollHeight-e.offsetHeight);let m,c,u;"auto"===r&&(e.classList.remove("scroll-buttons-shown"),e.classList.remove("one-button-shown"),n[0].$.addClass("smart-hidden"),n[1].$.addClass("smart-hidden")),t?(m=Math.round(e.scrollWidth)>Math.round(e.offsetWidth),c=s>0,u=s<1):(m=Math.round(e.scrollHeight)>Math.round(e.offsetHeight),c=d>0,u=d<1),m?"auto"===r?(e.classList.add("scroll-buttons-shown"),c&&n[0].$.removeClass("smart-hidden"),u&&n[1].$.removeClass("smart-hidden"),!1===(c&&u)&&e.classList.add("one-button-shown"),o.disabled||(n[0].disabled=!1,n[1].disabled=!1),e.scrollLeft=a,e.scrollTop=l):(n[0].$.removeClass("smart-hidden"),n[1].$.removeClass("smart-hidden"),o.disabled?(n[0].disabled=!0,n[1].disabled=!0):(n[0].disabled=!c,n[1].disabled=!u)):"scroll"===r&&(n[0].disabled=!0,n[1].disabled=!0),e===i&&"tree"!==o.mode&&o._close(),o._scrollInfo.set(e,{left:e.scrollLeft,top:e.scrollTop})}_checkOverflowAddRemove(e,t){const n=this;1===e&&null!==n.dropDownAppendTo||"tree"===n.mode?n._checkOverflow(n.$.mainContainer,"horizontal"===n.mode,[n.$.scrollButtonNear,n.$.scrollButtonFar]):e>1&&t.dropDownHeightSet&&(n._isContainerOpened(e,t.container)?n._checkOverflow(t,!1,[t.container.children[0],t.container.children[2]]):t.checkOverflow=!0)}_close(){const e=this;e._positionDetection.removeOverlay(),e._closeSubContainers(2),e._discardKeyboardHover(!0),e._minimized&&e._minimizedDropDownOpened&&(e.$mainContainer.addClass("smart-visibility-hidden"),e._edgeMacFF&&(e.$.mainContainer.style.left="",e.$.mainContainer.style.top="",e.$mainContainer.addClass("not-in-view")),e.$hamburgerIcon.removeClass("smart-close-button"),e.$.hamburgerIcon.setAttribute("aria-expanded",!1),e._minimizedDropDownOpened=!1)}_closeSubContainers(e,t,n,o){const i=this;"tree"===i.mode||i._minimized?i._closeSubContainersTreeMode(e,t,n,o):i._closeSubContainersDefaultMode(e,t,n)}_closeSubContainersDefaultMode(e,t,n){const o=this,i=o._openedContainers;function r(t){const r=i[t].menuItemsGroup;n&&t===e||(r.$.removeClass("focus"),r.removeAttribute("focus"),r.$.removeClass("hover"),r.removeAttribute("hover")),r.$.removeClass("smart-menu-items-group-opened"),r.$.removeClass("smart-menu-items-group-expanded"),r.setAttribute("aria-expanded",!1),i[t].$.addClass("smart-visibility-hidden"),o._edgeMacFF&&2===t&&!o.hasAnimation&&(i[t].style.left="",i[t].style.top="",i[t].$.addClass("not-in-view")),o._minimized&&o._browserBoundsDetection(o.$.mainContainer),o.$.fireEvent("collapse",{item:r,label:r.label,path:r.path,value:r.value,children:r.itemContainer.children}),i[t]=void 0}for(let t=i.length-1;t>=e;t--)void 0!==i[t]&&r(t)}_closeSubContainersTreeMode(e,t,n,o,i){const r=this;if(o){const e=t.menuItemsGroup;if(r.$.fireEvent("collapsing",{item:e,label:e.label,path:e.path,value:e.value,children:t.itemContainer.children}).defaultPrevented)return}if(void 0===t)return void r._collapseAll(!1,i);const a=t.menuItemsGroup;if(a.set("expanded",!1),a.setAttribute("aria-expanded",!1),"menu"===r._element)if(n){const e=r.$.mainContainer.getElementsByClassName("focus")[0];e&&(e.$.removeClass("focus"),e.removeAttribute("focus")),a.$.addClass("focus"),a.setAttribute("focus",""),r._focusedViaKeyboard=a}else a.$.removeClass("focus"),a.removeAttribute("focus");else r._updateState("expanded",a.id,!1);if(a.$.removeClass("smart-"+r._element+"-items-group-opened"),i||!r.hasAnimation?(a.$.removeClass("smart-"+r._element+"-items-group-expanded"),a.setAttribute("aria-expanded",!1),t.$.addClass("smart-visibility-hidden"),r._minimized&&r._browserBoundsDetection(r.$.mainContainer)):r._collapseSection(t),o){const e={item:a,label:a.label,path:a.path,value:a.value,children:a.itemContainer.children};r.toggleCallback?(e.type="collapse",r.toggleCallback(e)):r.$.fireEvent("collapse",e)}if(!r._openedContainers[e])return;const s=r._openedContainers[e].indexOf(t);-1!==s&&r._openedContainers[e].splice(s,1)}_collapseAll(e,t){const n=this;for(let o=n._openedContainers.length-1;o>=2&&void 0!==n._openedContainers[o];o--)for(let i=n._openedContainers[o].length-1;i>=0;i--)n._closeSubContainersTreeMode(o,n._openedContainers[o][i],void 0,e,t);n.hasAnimation||n._checkOverflow(n.$.mainContainer,!1,[n.$.scrollButtonNear,n.$.scrollButtonFar]);for(let e=n._openedContainers.length-1;e>=2;e--){const t=n._openedContainers[e];if(void 0!==t&&0!==t.length)break;n._openedContainers.splice(e,1)}2===n._openedContainers.length&&(n._openedContainers=[])}_collapseSection(e){const t=this,n=e.scrollHeight+"px";t._treeAnimationInProgress=e,e.style.transition="none",requestAnimationFrame((function(){"tree"===t.mode||t._minimized?(e.style.height=n,e.style.transition="",requestAnimationFrame((function(){e.style.height="0px","smart-tree"===t.tagName.toLowerCase()&&e.$.addClass("smart-visibility-hidden"),"0px"===n&&t._transitionendHandlerCollapse(t,e)}))):e.style.transition=""})),e.addEventListener("transitionend",t._transitionendHandlerCollapse)}_createElement(){const e=this,t=e.mode;e.setAttribute("role","menu"),e.$.mainContainer.id=e.id+"MainContainer",e.setAttribute("aria-orientation","horizontal"===e.mode?"horizontal":"vertical"),e._positionDetection=new Smart.Utilities.PositionDetection(e),e._positionDetection.getDropDownParent(),e._reparentMenu(),e.disabled&&(e.$.scrollButtonNear.disabled=!0,e.$.scrollButtonFar.disabled=!0),null===e.dataSource&&e.$.mainContainer.firstElementChild instanceof HTMLUListElement&&e._processUList();const n=(e.shadowRoot||e).querySelectorAll("smart-menu-item, smart-menu-items-group"),o=function(){const n=e.animation;e._changeScrollButtonsArrows(),e._setFocusable(),"dropDown"===t&&!1===e.opened&&(e.hasAnimation?(e.animation="none",e.$.addClass("smart-visibility-hidden"),e.animation=n):e.$.addClass("smart-visibility-hidden")),e._menuItems={},e.$.mainContainer.setAttribute("animation",n),null===e.dataSource?e._processHTML(e.$.mainContainer,1):e._processDataSource(),e._checkContainersLength(!0),null===e.dropDownAppendTo&&!e.$mainContainer.hasClass("simple")&&"tree"!==e.mode||"scroll"!==e.overflow||(e.$mainContainer.addClass("scroll-buttons-shown"),e.$scrollButtonNear.removeClass("smart-hidden"),e.$scrollButtonFar.removeClass("smart-hidden"),e._updateScrollButtonVisibility(e.$.mainContainer,"horizontal"===t,[e.$.scrollButtonNear,e.$.scrollButtonFar])),e._applyMinimizeIconTemplate(e.minimizeIconTemplate,null),"tree"===t&&e._applyTreeMode(),null!==e.minimizeWidth&&e.offsetWidth<=e.minimizeWidth?e.minimize():e._checkOverflow(e.$.mainContainer,"horizontal"===t,[e.$.scrollButtonNear,e.$.scrollButtonFar]),e._expandItemsByDefault(),e._refreshCheckableItems(),e.__onCompleted&&(e._onCompleted=e.__onCompleted,e.__onCompleted=null,e._onCompleted())};0===n.length||e.enableShadowDOM||e.isInShadowDOM?o():(e._onCompleted&&(e.__onCompleted=e._onCompleted,e._onCompleted=null),e._ensureItemsReady(n,o))}_ensureItemsReady(e,t){const n=this,o=function(){const n=function(t){for(let n=0;n<e.length;n++)e[n].context="node"===t?e[n]:document};n("node"),t(),n()};if(0===e.length)o();else{n._nodesReadyListeners=0;for(let t=0;t<e.length;t++){const i=e[t],r=function(){const e=n.context;n.context=n,n._nodesReadyListeners--,0===n._nodesReadyListeners&&(o(),delete n._nodesReadyListeners),n.context=e}.bind(n);i.isCompleted||(n._nodesReadyListeners++,i.completeHandlers=[],i._onCompleted=r)}0===n._nodesReadyListeners&&o()}}_createItemHTMLStructure(e,t,n,o){const i=this,r="smart-"+i._element+"-item-label-container",a="smart-"+i._element+"-item-label-element",s=document.createDocumentFragment(),l=e.children;let d,m,c,u;for(let e=0;e<l.length;e++){const t=l[e];if(t.classList&&(t.classList&&t.classList.contains(r)?d=t:t.classList&&t.classList.contains(a)&&(m=t),d&&m))break}if(d){const t=d.querySelector("."+a);if(null!==t){e.insertBefore(t.firstElementChild,e.children[0]);const n="smart-"+i._element+"-drop-down",o="smart-"+i._element+"-item-container",r=e.querySelector("."+n);if(r){const t=e.querySelector("."+o);for(;t.childNodes.length;)e.appendChild(t.firstChild);r.remove()}}d.remove()}m&&m.remove(),d=document.createElement("div"),m=document.createElement("div");let p=document.createElement("span");e.menu=i,t>1?(e.originalIndex=o,c=n.path+"."+e.originalIndex,e.parentItem=n,u=n):(e.originalIndex=o,c=""+o,u=i),i.checkboxes&&u.checkable&&("checkbox"===u.checkMode?e.setAttribute("role","menuitemcheckbox"):"radioButton"===u.checkMode&&e.setAttribute("role","menuitemradio")),e.path=c,i._menuItems[c]=e,d.className=r,m.className=a,"tree"===i._element&&i._setIndentation(d,t,i.rightToLeft?"paddingRight":"paddingLeft");const h=Array.from(e.childNodes);for(let e=0;e<h.length;e++){const t=h[e];if(t instanceof Smart.MenuItem||t instanceof Smart.MenuItemsGroup)break;p.appendChild(t)}if(""===p.innerHTML.trim()){const t=e.label||e.getAttribute("label");t&&""!==t?i._setLabel(t,p,e,!0):(e.set("label","Item "+o),p.innerHTML="Item "+o)}else e.set("label",p.innerHTML.trim());if(e.setAttribute("aria-label",e.label),e instanceof Smart.MenuItemsGroup&&void 0===e.titleLabel&&(e.titleLabel=e.label),m.appendChild(p),s.appendChild(m),e.set("level",t),e.set("shortcut",e.shortcut||e.getAttribute("shortcut")||""),e.shortcut&&e instanceof Smart.MenuItem){const t=document.createElement("div");t.id=e.id+"Shortcut",t.className="smart-"+i._element+"-item-shortcut",t.innerHTML=e.shortcut,s.appendChild(t),e.setAttribute("aria-describedby",t.id)}d.appendChild(s),e.insertBefore(d,e.children[0]),e.id||(e.id=i.id+"ItemP"+e.path.replace(/\./g,"_")+"L"+e.label.replace(/[^a-zA-Z0-9\-\_]/g,""))}_createMenuItemsGroupContainer(e,t){const n=this,o=e.children,i="smart-"+n._element+"-drop-down",r="smart-"+n._element+"-item-container";let a,s;for(let e=0;e<o.length;e++){const t=o[e];if(t.classList&&(t.classList&&t.classList.contains(i)?a=t:t.classList&&t.classList.contains(r)&&(s=t),a&&s))break}if(a||(a=document.createElement("div")),s||(s=document.createElement("div")),a.innerHTML=s.innerHTML="",a.id=e.id+"Container",a.className="smart-"+n._element+"-drop-down smart-visibility-hidden",n._edgeMacFF&&2===t&&"tree"!==n.mode&&(a.className+=" not-in-view"),a.$||(a.$=Smart.Utilities.Extend(a)),a.level=t,a.setAttribute("level",t),"menu"===n._element?(e.setAttribute("aria-owns",a.id),a.setAttribute("role","menu")):a.setAttribute("role","group"),a.menuItemsGroup=e,s.className=r,s.$||(s.$=Smart.Utilities.Extend(s)),s.container=a,s.menuItemsGroup=e,e.checkable&&s.setAttribute("checkable",""),s.setAttribute("check-mode",e.checkMode),s.setAttribute("role","presentation"),a.itemContainer=s,a.contains(s)||a.appendChild(s),null!==e.dropDownHeight){let t=a.querySelector(".smart-spin-button.smart-scroll-button-near"),o=a.querySelector(".smart-spin-button.smart-scroll-button-far");t||(t=document.createElement("smart-repeat-button")),o||(o=document.createElement("smart-repeat-button")),t.className="smart-menu-scroll-button smart-spin-button smart-scroll-button-near smart-hidden",t.setAttribute("aria-label","Scroll up"),t.innerHTML='<div class="smart-arrow smart-arrow-up" aria-hidden="true"></div>',t.animation=n.animation,t.unfocusable=!0,t.rightToLeft=n.rightToLeft,o.className="smart-menu-scroll-button smart-spin-button smart-scroll-button-far smart-hidden",o.setAttribute("aria-label","Scroll down"),o.innerHTML='<div class="smart-arrow smart-arrow-down" aria-hidden="true"></div>',o.animation=n.animation,o.unfocusable=!0,o.rightToLeft=n.rightToLeft,a.contains(t)||a.insertBefore(t,s),a.contains(o)||a.appendChild(o),a.$.addClass("drop-down-height-set"),s.dropDownHeightSet=!0,s.checkOverflow=!0,a.style.height=e.dropDownHeight+"px",n._containersFixedHeight.push(a),n._additionalScrollButtons.push([t,o])}return a}_discardKeyboardHover(e){const t=this;t._focusedViaKeyboard&&(!e&&t._focusedViaKeyboard instanceof Smart.MenuItemsGroup&&t._isContainerOpened(t._focusedViaKeyboard.level+1,t._focusedViaKeyboard.container)||(t._focusedViaKeyboard.$.removeClass("focus"),t._focusedViaKeyboard.removeAttribute("focus"),t._focusedViaKeyboard.$.removeClass("hover"),t._focusedViaKeyboard.removeAttribute("hover"),t._focusedViaKeyboard=void 0))}_documentDownHandler(e){const t=this;"down"===t.closeAction&&t._closeOnDocumentInteraction(e.originalEvent)}_documentUpHandler(e){const t=this,n=e.originalEvent.target;if(t.disabled||t.displayLoadingIndicator||!n.closest)return;const o="up"===t.closeAction&&t._closeOnDocumentInteraction(e.originalEvent);if(o)return;let i,r;if(t.isInShadowDOM?(i=t.isInShadowDOM?t.getRootNode().activeElement:t.shadowRoot&&t.shadowRoot.activeElement||document.activeElement,r=t.$.container.contains(e.originalEvent.composedPath()[0])):(i=document.activeElement,r=t.contains(n)),!o&&t!==i&&null===i.closest("[template-applied]")){if(r||n.closest(".smart-list-menu-view")===t.$.view)return void t.focus();const e=n.closest(".smart-drop-down-repositioned");e&&e.ownerElement===t&&t.focus()}}_closeOnDocumentInteraction(e){const t=this,n=e.target;let o,i;if(t.isInShadowDOM?(o=e.composedPath()[0],i=t.$.container.contains(o)):i=t.contains(n),"dropDown"===t.mode&&t.opened){const e=n.closest(".smart-drop-down-repositioned");if(!(i||e&&e.ownerElement===t))return t.close({trigger:"interaction",target:t.isInShadowDOM?o:n}),!0}const r=(o||n).closest(".smart-input-drop-down-menu");return(!r||!t.contains(r.ownerElement))&&(!i&&null===n.closest(".smart-menu-drop-down")||o&&o===t.$.mainContainer||n===t.$.mainContainer?("tree"===t.mode||t._close(),!0):void 0)}_ensureVisible(e){const t=this;if(t._minimized)return;const n=t.mode,o=t.$.mainContainer;let i,r;if("tree"!==n&&e.parentElement!==o){if(null===e.dropDownHeight)return;i=e.parentElement,r=[i.container.children[0],i.container.children[2]]}else i=o,r=[t.$.scrollButtonNear,t.$.scrollButtonFar];if(i===o&&(null===t.dropDownAppendTo&&"tree"!==t.mode&&!o.classList.contains("simple")||!i.$.hasClass("scroll-buttons-shown")&&"hidden"!==t.overflow))return;const a=i.getBoundingClientRect(),s=e.getBoundingClientRect();function l(t,n,o){let r=e.firstElementChild[o]+t-i[o];r<0&&(r=t),i["scroll"+n]=r}function d(n,a){let s=e["offset"+n],d=i[a];"Top"!==n||i===o||r[0].$.hasClass("smart-hidden")||(s-=r[0][a]),l(s,n,a),t._updateScrollButtonVisibility(i,"Left"===n,r),d!==i[a]&&l(s,n,a)}"tree"!==n?(i===o&&"horizontal"===n&&(a.left>s.left||a.right<s.right)?d("Left","offsetWidth"):(a.top>s.top||a.bottom<s.bottom)&&d("Top","offsetHeight"),t._scrollInfo.set(i,{left:i.scrollLeft,top:i.scrollTop})):t._ensureVisibleTreeMode(e,s,i,a,0)}_ensureVisibleTreeMode(e,t,n,o,i){const r=this;if(("menu"===r._element||"scrollButtons"===r.scrollMode)&&!n.$.hasClass("scroll-buttons-shown")&&"hidden"!==r.overflow)return;const a=n.offsetHeight,s=r.$scrollButtonNear.hasClass("smart-hidden");let l;if(o.top>t.top)l=r._getOffsetTop(e);else{let n=e.expanded?e.firstElementChild.offsetHeight+parseInt(window.getComputedStyle(e.children[1]).marginTop,10):e.offsetHeight;if("tree"===r._element&&(n+=parseFloat(getComputedStyle(r).getPropertyValue("--smart-tree-item-vertical-offset"))||0),!(o.bottom<t.top+n))return;l=r._getOffsetTop(e)-a+n+i}"tree"===r._element&&"0"===e.path&&(l-=parseFloat(getComputedStyle(r).getPropertyValue("--smart-tree-item-vertical-offset"))),n.scrollTop=l,"menu"!==r._element&&"scrollButtons"!==r.scrollMode||r._updateScrollButtonVisibility(n,!1,[r.$.scrollButtonNear,r.$.scrollButtonFar]),"auto"===r.overflow&&s&&!r.$scrollButtonNear.hasClass("smart-hidden")&&(n.scrollTop+=a-n.offsetHeight),r._scrollInfo.set(n,{left:n.scrollLeft,top:n.scrollTop})}_escapeHandler(e,t,n){e&&(e.$.removeClass("focus"),e.removeAttribute("focus")),this._closeSubContainers(t,void 0,void 0,!0),this._hoverViaKeyboard(n.menuItemsGroup)}_expandItemsByDefault(e){const t=this;if(0===t._menuItemsGroupsToExpand.length&&!e||"tree"!==t.mode&&!t._minimized)return;const n=t.hasAnimation,o=t.animation;n&&(t.animation="none"),e&&t._collapseAll(!1);for(let e=0;e<t._menuItemsGroupsToExpand.length;e++)t.expandItem(t._menuItemsGroupsToExpand[e].path,void 0,!1);n&&(t.animation=o),t._menuItemsGroupsToExpand=[]}_expandSection(e){const t=this,n=e.style.height,o=e.scrollHeight+"px";e.style.height=o,t._treeAnimationInProgress=e,n!==o&&(parseFloat(n)||parseFloat(o))?e.addEventListener("transitionend",t._transitionendHandlerExpand):t._transitionendHandlerExpand(t,e)}_filterInputKeyupHandler(){const e=this;e._filterTimer&&clearTimeout(e._filterTimer),e._filterTimer=setTimeout((function(){const t=e.context;e.context=e,e._applyFilter(e.$.filterInput.value,e._view),e._checkOverflow(),e.context=t}),300)}_findItem(e,t){if(""===t)return e;const n=e[this.filterMember||"label"];if("string"!=typeof n)return null;switch(this.filterMode){case"startsWith":if(0===n.indexOf(t))return e;break;case"startsWithIgnoreCase":if(0===n.toLowerCase().indexOf(t.toLowerCase()))return e;break;case"doesNotContain":if(n.indexOf(t)<0)return e;break;case"doesNotContainIgnoreCase":if(n.toLowerCase().indexOf(t.toLowerCase())<0)return e;break;case"contains":if(n.indexOf(t)>-1)return e;break;case"containsIgnoreCase":if(n.toLowerCase().indexOf(t.toLowerCase())>-1)return e;break;case"equals":if(0===n.localeCompare(t))return e;break;case"equalsIgnoreCase":if(0===n.toLowerCase().localeCompare(t.toLowerCase()))return e;break;case"endsWith":if(n.endsWith(t))return e;break;case"endsWithIgnoreCase":if(n.toLowerCase().endsWith(t.toLowerCase()))return e}return null}_getFirstEnabledChild(e){const t=e.children;for(let e=0;e<t.length;e++)if(this._isChildEnabled(t[e]))return t[e]}_getLastEnabledChild(e){const t=e.children;for(let e=t.length-1;e>=0;e--)if(this._isChildEnabled(t[e]))return t[e]}_getNextEnabledChild(e){if(e)for(;e.nextElementSibling;){const t=e.nextElementSibling;if(this._isChildEnabled(t))return t;e=t}}_getOffsetTop(e){if(!e)return 0;let t=e.offsetTop;for(;e.offsetParent!==this.$.mainContainer;){if(!(e=e.offsetParent))return t;t+=e.offsetTop}return t}_getPreviousEnabledChild(e){if(e)for(;e.previousElementSibling;){const t=e.previousElementSibling;if(this._isChildEnabled(t))return t;e=t}}_hamburgerIconClickHandler(e,t){e&&e.stopPropagation();const n=this;if(void 0===t&&(t=Smart.ListMenu&&n instanceof Smart.ListMenu?n.$.view:n.$.mainContainer),!n.disabled)if(n._minimizedDropDownOpened)n._close();else{if(n._positionDetection.placeOverlay(),null!==n.dropDownAppendTo){const e=n.dropDownPosition,o=n.getBoundingClientRect(),i=n._positionDetection.getDropDownOffset();-1!==e.indexOf("right")||"auto"===e?n.rightToLeft?(t.style.right="initial",t.style.left=o.left+o.width-t.offsetWidth-i.x+"px"):(t.style.left=o.left+i.x+"px",t.style.right="initial"):-1!==e.indexOf("left")&&(t.style.left=o.right-t.offsetWidth+i.x+"px",t.style.right="initial"),-1!==e.indexOf("bottom")||-1!==e.indexOf("overlay")||"auto"===e?t.style.top=o.bottom+i.y+"px":-1!==e.indexOf("top")&&(t.style.top=o.top+i.y+"px")}else t.style.right="";n._edgeMacFF&&t.$.removeClass("not-in-view"),t.$.removeClass("smart-visibility-hidden"),n.$hamburgerIcon.addClass("smart-close-button"),n.$.hamburgerIcon.setAttribute("aria-expanded",!0),n._minimizedDropDownOpened=!0,n._browserBoundsDetection(t)}}_handleOverflowChange(){const e=this,t=e.$.mainContainer;if((e._minimized||null===e.dropDownAppendTo&&!t.classList.contains("simple")&&"tree"!==e.mode)&&!(Smart.ListMenu&&e instanceof Smart.ListMenu))return;const n=e.overflow;let o;"horizontal"===e.mode?(o=!0,t.scrollLeft=0):(o=!1,t.scrollTop=0),"hidden"===n?(t.classList.remove("scroll-buttons-shown"),e.$scrollButtonNear.addClass("smart-hidden"),e.$scrollButtonFar.addClass("smart-hidden")):(e.$.scrollButtonNear.disabled=e.disabled,e.$.scrollButtonFar.disabled=e.disabled,"auto"===n?(e.$scrollButtonNear.addClass("smart-hidden"),e.$scrollButtonFar.addClass("smart-hidden"),e._checkOverflow(t,o,[e.$.scrollButtonNear,e.$.scrollButtonFar])):(t.classList.add("scroll-buttons-shown"),t.classList.remove("one-button-shown"),e.$scrollButtonNear.removeClass("smart-hidden"),e.$scrollButtonFar.removeClass("smart-hidden"),e._updateScrollButtonVisibility(t,o,[e.$.scrollButtonNear,e.$.scrollButtonFar]))),e._scrollInfo.set(t,{left:t.scrollLeft,top:t.scrollTop})}_hideMainContainerScrollButtons(){const e=this;e.$scrollButtonNear.addClass("smart-hidden"),e.$scrollButtonFar.addClass("smart-hidden"),e.$mainContainer.removeClass("scroll-buttons-shown"),e.$mainContainer.removeClass("one-button-shown")}_hoverViaKeyboard(e){e&&(e.$.addClass("focus"),e.setAttribute("focus",""),this._focusedViaKeyboard=e,this._ensureVisible(e))}_isBranchExpanded(e){if("tree"!==this.mode)return!0;let t=!0;for(;e.parentItem;)t=t&&e.parentItem.expanded,e=e.parentItem;return t}_isChildEnabled(e){return!(e.disabled||e.templateApplied||e.hidden||e instanceof HTMLDivElement||0===e.offsetHeight)}_isContainerOpened(e,t){const n=this;return"tree"===n.mode||n._minimized?(n._openedContainers[e]||(n._openedContainers[e]=[]),-1!==n._openedContainers[e].indexOf(t)):n._openedContainers[e]===t}_keydownHandler(e){const t=this;let n=e.key;if(t.getRootNode().activeElement!==t||-1===["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Enter","Escape","Home"," "].indexOf(n)||t.disabled)return;e.preventDefault();const o=t.mode;if("tree"===o||t._minimized)return void t._keydownHandlerTreeMode(n);const i=t.dropDownPosition,r=-1!==i.indexOf("left"),a="top-left"===i||"top-right"===i,s=t._openedContainers;let l,d=t.$.mainContainer,m=1;for(let e=s.length-1;e>=0;e--)if(void 0!==s[e]){d=s[e],m=d.level,d=d.itemContainer;break}switch(l=d.querySelector('[focus][level="'+m+'"]'),t.rightToLeft&&("ArrowLeft"===n?n="ArrowRight":"ArrowRight"===n&&(n="ArrowLeft")),n){case"ArrowDown":1===m?"horizontal"!==o||a?"horizontal"!==o&&t._levelOneNavigate("_getFirstEnabledChild",l,d):t._levelOneOpenDropDown(l):t._navigate("_getNextEnabledChild",l,d);break;case"ArrowLeft":r?1===m?"horizontal"===o?t._levelOneNavigate("_getLastEnabledChild",l,d):t._levelOneOpenDropDown(l):l instanceof Smart.MenuItemsGroup?t._selectionHandler({target:l,isTrusted:!0}):t._levelOneNavigateFromLowerLevel("_getPreviousEnabledChild",l):t._arrowLeftHandler(m,o,l,d);break;case"ArrowRight":r?1===m?"horizontal"===o&&t._levelOneNavigate("_getFirstEnabledChild",l,d):2===m?t._levelOneNavigateFromLowerLevel("_getNextEnabledChild",l):t._escapeHandler(l,m,d):t._arrowRightHandler(m,o,l,d);break;case"ArrowUp":1===m?"horizontal"===o&&a?t._levelOneOpenDropDown(l):"horizontal"!==o&&t._levelOneNavigate("_getLastEnabledChild",l,d):t._navigate("_getPreviousEnabledChild",l,d);break;case"End":case"Home":{const e="End"===n?t._getLastEnabledChild(d):t._getFirstEnabledChild(d);if(!e||l===e)return;l&&(l.$.removeClass("focus"),l.removeAttribute("focus")),t._hoverViaKeyboard(e);break}case"Enter":l&&t._selectionHandler({target:l,isTrusted:!0});break;case"Escape":m>1?(2===m&&t._positionDetection.removeOverlay(),t._escapeHandler(l,m,d)):"dropDown"===o&&t.opened&&t.close({trigger:"interaction",target:"Escape"});break;case" ":l&&t._toggleItem(l)}}_keydownHandlerTreeMode(e){const t=this,n=Array.from(t.$.mainContainer.querySelectorAll("smart-menu-item, smart-menu-items-group")),o=t.$.mainContainer.getElementsByClassName("focus")[0];function i(e){const n=e.level;return!1===e.disabled&&!0!==e.templateApplied&&(1===n||n>1&&t._isContainerOpened(n,e.parentElement.container)&&e.getBoundingClientRect().height>0)}function r(e){for(let r=e;r<n.length;r++){const e=n[r];if(i(e)){if(o){if(o===e)break;o.$.removeClass("focus"),o.removeAttribute("focus")}t._hoverViaKeyboard(e);break}}}function a(e){for(let r=e;r>=0;r--){const e=n[r];if(i(e)){if(o){if(o===e)break;o.$.removeClass("focus"),o.removeAttribute("focus")}t._hoverViaKeyboard(e);break}}}function s(){o.level>1&&(o.$.removeClass("focus"),o.removeAttribute("focus"),t._hoverViaKeyboard(o.parentItem))}let l;switch(e){case"ArrowDown":l=o?n.indexOf(o)+1:0,r(l);break;case"ArrowLeft":if(!o)return;if(o instanceof Smart.MenuItem)s();else{if(t._isContainerOpened(o.level+1,o.container))return void t._closeSubContainers(o.level+1,o.container,!0,!0);s()}break;case"ArrowRight":if(!o||o instanceof Smart.MenuItem)return;t._isContainerOpened(o.level+1,o.container)?(o.$.removeClass("focus"),o.removeAttribute("focus"),t._hoverViaKeyboard(t._getFirstEnabledChild(o.itemContainer))):t._selectionHandler({target:o,type:"keydown",isTrusted:!0},o);break;case"ArrowUp":l=o?n.indexOf(o)-1:n.length-1,a(l);break;case"End":a(n.length-1);break;case"Enter":t._minimized&&!t._minimizedDropDownOpened?t._hamburgerIconClickHandler(void 0,t.$.mainContainer):o&&t._selectionHandler({target:o,type:"keydown",isTrusted:!0});break;case"Escape":t._minimized&&t._minimizedDropDownOpened&&t._close();break;case"Home":r(0);break;case" ":o&&t._toggleItem(o)}}_lazyInitItems(){const e=this;e._inLazyInit||(e._inLazyInit=!0,e._menuItems={},e._processHTML(e.$.mainContainer,1),e._expandItemsByDefault(),e._refreshCheckableItems(),cancelAnimationFrame(Smart.Menu.processTimer),delete Smart.Menu.processTimer,e._inLazyInit=!1,e.$.scrollViewer&&e.$.scrollViewer.refresh())}_levelOneNavigate(e,t,n){const o=this;if(t)"_getLastEnabledChild"===e?o._navigate("_getPreviousEnabledChild",t,n):o._navigate("_getNextEnabledChild",t,n);else{const t=o[e](n);t&&o._hoverViaKeyboard(t)}}_levelOneNavigateFromLowerLevel(e,t){const n=this,o=n[e](n._openedContainers[2].menuItemsGroup);o&&(t&&(t.$.removeClass("focus"),t.removeAttribute("focus")),n._closeSubContainers(2),o instanceof Smart.MenuItemsGroup?n._selectionHandler({target:o,isTrusted:!0}):n._hoverViaKeyboard(o))}_levelOneOpenDropDown(e){e&&e instanceof Smart.MenuItemsGroup&&this._selectionHandler({target:e,isTrusted:!0})}_mainContainerHandler(e){const t=this;if(t._minimized&&null!==t.dropDownAppendTo)switch(e.type){case"click":t._selectionHandler(e);break;case"mouseleave":t._mouseleaveHandler(e);break;case"mouseout":case"mouseover":t._mouseoutMouseoverHandler(e)}}_menuItemSelectionHandler(e,t){const n=this;function o(){n.enableShadowDOM&&(n.shadowRoot.activeElement||document.activeElement)!==n&&null!==n.dropDownAppendTo&&"click"===t.type&&!n.shadowRoot.contains(e)?n.focus():document.activeElement===n||null===n.dropDownAppendTo||"click"!==t.type||n.contains(e)||n.focus()}if(e.disabled||e.templateApplied)o();else{if(!n._toggleItem(e)){if(n.$.fireEvent("itemClick",{item:e,label:e.label,value:e.value}),t.target&&"A"!==t.target.nodeName){const t=e.querySelector("a");t&&t.click()}if("tree"!==n.mode&&(n._close(),"dropDown"===n.mode))return n._ripple(e,t),void n.close({trigger:"interaction",target:e})}n._ripple(e,t),o()}}_menuItemsGroupSelectionHandler(e,t,n){const o=this,i=o.mode,r=e.container,a=r.level,s="tree"!==i&&!o._minimized;if(o._treeAnimationInProgress===r)return;if(o._discardKeyboardHover(),o.getRootNode().activeElement===o||null===o.dropDownAppendTo||"click"!==t.type||o.contains(t.target)||o.focus(),"click"===t.type&&(!t.target.classList.contains("smart-"+o._element+"-items-group-arrow")&&o._toggleItem(e)||"mouseenter"===o.selectionMode&&"tree"!==i&&!o._minimized))return;let l=o.hasAnimation;if(o._isContainerOpened(a,r))o._closeSubContainers(a,r,!0,!1!==n),s&&e.hasAttribute("focus")&&(o._focusedViaKeyboard=e);else{if(o.$.fireEvent("expanding",{item:e,label:e.label,path:e.path,value:e.value,children:e.itemContainer.children}).defaultPrevented)return;if(o._positionDetection.placeOverlay(),s&&o._closeSubContainers(a),l&&!s&&("expand"!==t.type&&(o._ensureVisibleOnTransitionend=e),o._expandSection(r)),o._edgeMacFF&&2===a&&s&&r.$.removeClass("not-in-view"),r.$.removeClass("smart-visibility-hidden"),s||"expand"!==t.type){if(s)"keydown"===t.type&&(o._focusedViaKeyboard=e);else{const t=o.$.mainContainer.getElementsByClassName("focus")[0];t&&(t.$.removeClass("focus"),t.removeAttribute("focus")),o._focusedViaKeyboard=e}e.$.addClass("focus"),e.setAttribute("focus","")}if(e.$.addClass("smart-"+o._element+"-items-group-opened"),e.$.addClass("smart-"+o._element+"-items-group-expanded"),e.setAttribute("aria-expanded",!0),o._addOpenedContainer(a,r),s){if(o._ensureVisible(e),e.level>1&&e.parentElement.dropDownHeightSet){const t=o.dropDownPosition,n=e.getBoundingClientRect().top-e.parentElement.container.getBoundingClientRect().top;-1!==t.indexOf("bottom")||"auto"===t?r.style.top=n+"px":-1!==t.indexOf("top")?r.style.top=n+e.offsetHeight+"px":r.style.top=n+e.offsetHeight/2+"px"}r.itemContainer.checkOverflow&&r.itemContainer.dropDownHeightSet&&(o._checkOverflow(r.itemContainer,!1,[r.children[0],r.children[2]]),delete r.itemContainer.checkOverflow)}o._positionExternalContainer(r,e),"tree"===i||o._minimized?l||o._browserBoundsDetection(o.$.mainContainer):o._browserBoundsDetection(r),void 0===t.type&&o._hoverViaKeyboard(o._getFirstEnabledChild(e.itemContainer)),!1!==n&&o.$.fireEvent("expand",{item:e,label:e.label,path:e.path,value:e.value,children:e.itemContainer.children})}s?o._ripple(e,t):"tree"!==i||l||(o._checkOverflow(o.$.mainContainer,!1,[o.$.scrollButtonNear,o.$.scrollButtonFar]),o._minimized||"expand"===t.type||o._ensureVisible(e))}_mouseenterHandler(){const e=this;e.autoFocusOnMouseenter&&e.getRootNode().activeElement!==e&&e.focus()}_mouseleaveHandler(e){const t=this;if("mouseenter"===t.selectionMode&&"tree"!==t.mode&&!t._minimized){if(null!==t.dropDownAppendTo&&e.relatedTarget)if(t.contains(e.target)){const n=e.relatedTarget.closest(".smart-menu-drop-down");if(n&&n.ownerElement===t)return}else if(t.contains(e.relatedTarget))return;t._isElementHovered=!1,t._autoCloseTimeout=setTimeout((function(){const e=t.context;clearTimeout(t._autoCloseTimeout),t._isElementHovered||(t.context=t,t._close(),t.context=e)}),t.autoCloseDelay)}}_mouseoutMouseoverHandler(e){const t=this;if(t.disabled||t.displayLoadingIndicator)return;let n=e.target.closest("smart-menu-item")||e.target.closest("smart-menu-items-group");if(t.enableShadowDOM&&(n=e.composedPath()[0].closest("smart-menu-item")||e.composedPath()[0].closest("smart-menu-items-group")||n),"mouseover"===e.type&&(t._isElementHovered=!0),null!==n&&!n.disabled&&!n.templateApplied&&("tree"!==t.mode&&!t._minimized||!n.hasAttribute("focus")||!e.relatedTarget||e.target.parentElement!==e.relatedTarget&&e.relatedTarget.parentElement!==e.target))if(t._discardKeyboardHover(!1),"mouseover"===e.type){"mouseenter"!==t.selectionMode||"tree"===t.mode||t._minimized||(n instanceof Smart.MenuItemsGroup&&!n.hasAttribute("hover")?t._selectionHandler(e,n):n instanceof Smart.MenuItem&&t._closeSubContainers(n.level+1));const o=e.target.closest(".smart-menu-drop-down");(!o||o&&!n.contains(o))&&(n.$.addClass("hover"),n.setAttribute("hover",""),t._discardKeyboardHover(!0))}else{if("tree"!==t.mode&&!t._minimized&&("mouseenter"===t.selectionMode&&e.relatedTarget===t.$.mainContainer&&t._close(),n instanceof Smart.MenuItemsGroup&&n.container&&!n.container.$.hasClass("smart-visibility-hidden")))return;n.$.removeClass("hover"),n.removeAttribute("hover")}}_moveDropDownsToExternalContainer(){const e=this;for(let t=0;t<e._containersInBody.length;t++){const n=e._containersInBody[t];e._dropDownParent.appendChild(n),n.$.listen("click",e._selectionHandler.bind(e)),n.$.listen("mouseleave",e._mouseleaveHandler.bind(e)),n.$.listen("mouseout",e._mouseoutMouseoverHandler.bind(e)),n.$.listen("mouseover",e._mouseoutMouseoverHandler.bind(e))}for(let t=0;t<e._containers.length;t++){const n=e._containers[t];n.ownerElement=e,""!==e.theme&&n.classList.add(e.theme),e.rightToLeft&&n.setAttribute("right-to-left",""),n.classList.add("smart-drop-down-repositioned"),n.setAttribute("mode",e.mode),n.setAttribute("drop-down-position",e.dropDownPosition),e.checkboxes&&n.setAttribute("checkboxes","")}}_moveDropDownsToMenu(){const e=this;for(let t=0;t<e._containersInBody.length;t++){const n=e._containersInBody[t];n.$.unlisten("click"),n.$.unlisten("mouseleave"),n.$.unlisten("mouseout"),n.$.unlisten("mouseover"),n.style.left="",n.style.right="",n.style.top="",n.style.marginLeft="",n.style.marginTop="",n.menuItemsGroup.appendChild(n)}for(let t=0;t<e._containers.length;t++){const n=e._containers[t];""!==e.theme&&n.classList.remove(e.theme),n.classList.remove("smart-drop-down-repositioned"),n.removeAttribute("mode"),n.removeAttribute("drop-down-position"),n.removeAttribute("checkboxes"),n.removeAttribute("right-to-left")}}_navigate(e,t,n){const o=this;if(!t)return void("_getNextEnabledChild"===e?o._hoverViaKeyboard(o._getFirstEnabledChild(n)):o._hoverViaKeyboard(o._getLastEnabledChild(n)));const i=o[e](t);i&&(t.$.removeClass("focus"),t.removeAttribute("focus"),o._hoverViaKeyboard(i))}_positionExternalContainer(e,t){const n=this;if(null===n.dropDownAppendTo||2!==e.level)return;const o=n.dropDownPosition,i=n.mode,r=t.getBoundingClientRect(),a=n._positionDetection.getDropDownOffset(),s=r.top+a.y,l=r.bottom+a.y;let d=r.left+a.x,m=r.right+a.x;switch(e.style.top=e.style.left=e.style.right="",n.rightToLeft&&(e.style.right="initial"),-1!==o.indexOf("left")?(d-=e.offsetWidth,"horizontal"!==i&&"overlay-left"!==o||(d+=r.width),e.style.left=d+"px",e.style.right="initial"):"horizontal"===i||"overlay-right"===o?e.style.left=d+"px":n.rightToLeft?e.style.left=m-e.offsetWidth+"px":e.style.left=d+r.width+"px",o){case"bottom-right":case"bottom-left":case"auto":e.style.top="horizontal"===i?l+"px":s+"px";break;case"top-right":case"top-left":e.style.top="horizontal"===i?s-e.offsetHeight+"px":l-e.offsetHeight+"px";break;case"overlay-right":case"overlay-left":e.style.top=s+r.height/2+"px"}}_processDataSource(){const e=this,t=e.dataSource,n=e.displayMember,o=e.itemsMember,i=e.valueMember,r=e.$.mainContainer,a=document.createDocumentFragment();function s(t,r){let a;if(Array.isArray(t[o])&&t[o].length>0){a=document.createElement("smart-"+e._element+"-items-group"),!0===t.checkable&&a.set("checkable",!0),"string"==typeof t.checkMode&&a.set("checkMode",t.checkMode),t.dropDownHeight&&a.set("dropDownHeight",t.dropDownHeight),!0===t.expanded&&"tree"===e.mode&&(a.set("expanded",!0),a.setAttribute("aria-expanded",!0));for(let e=0;e<t[o].length;e++)s(t[o][e],a)}else a=document.createElement("smart-"+e._element+"-item"),void 0!==t.shortcut&&a.set("shortcut",t.shortcut),t.customAttribute&&a.setAttribute(t.customAttribute,"");a.isDirty=!1,void 0!==t.id&&/^[A-Za-z]+[\w\-\:\.]*$/.test(t.id)&&(a.id=t.id),!0===t.checked&&(a.set("checked",!0),a.setAttribute("aria-checked",!0)),!0===t.disabled&&a.set("disabled",!0),void 0!==t[n]?a.set("label",t[n]):"string"==typeof t[o]&&a.set("label",t[o]),!0===t.selected&&a.set("selected",!0),!0===t.separator&&a.set("separator",!0),void 0!==t[i]&&a.set("value",t[i]),r.appendChild(a)}r.innerHTML="",r instanceof Smart.ScrollViewer&&r.removeAll();for(let e=0;e<t.length;e++)s(t[e],a);e.$.mainContainer.appendChild(a),e._processHTML(e.$.mainContainer,1)}_processHTML(e,t,n){const o=this;let i,r;t>1&&(i=o._createMenuItemsGroupContainer(e,t),r=i.itemContainer,(e.expanded||e.hasAttribute("expanded"))&&"tree"===o.mode?o._menuItemsGroupsToExpand.push(e):(e.set("expanded",!1),e.removeAttribute("expanded"),e.setAttribute("aria-expanded",!1)));const a=Array.from(e.children),s=[],l=document.createDocumentFragment();let d=0;for(let n=0;n<a.length;n++){if(t>1&&0===n){d++;continue}const i=a[n];i instanceof Smart.MenuItem||i instanceof Smart.MenuItemsGroup?(o._createItemHTMLStructure(i,t,e,n-d),(i.checked||i.hasAttribute("checked"))&&(i.disabled||i.hasAttribute("disabled")||i.templateApplied?(i.set("checked",!1),i.removeAttribute("checked"),i.removeAttribute("aria-checked")):s.push(i)),t>1&&l.appendChild(i),i instanceof Smart.MenuItemsGroup&&o._processHTML(i,t+1)):(i.parentElement.removeChild(i),d++)}if(t>1){if(r.appendChild(l),e.container=i,e.itemContainer=r,e instanceof Smart.MenuItemsGroup){const n=document.createElement("div");n.className="smart-"+o._element+"-items-group-arrow","menu"===o._element?n.setAttribute("role","presentation"):(n.setAttribute("role","button"),n.setAttribute("aria-label","Toggle")),o._setArrowDirection(n,t),e.firstElementChild.appendChild(n)}o._containers.push(i),2===t&&(o._containersInBody.push(i),o._edgeMacFF&&i.addEventListener("transitionend",(function(e){e.target===this&&this.$.hasClass("smart-visibility-hidden")&&(this.style.left="",this.style.top="",this.$.addClass("not-in-view"))}))),null===o.dropDownAppendTo||"tree"===o.mode||o._minimized?e.appendChild(i):(i.ownerElement=o,o.rightToLeft?i.setAttribute("right-to-left",""):i.removeAttribute("right-to-left"),i.classList.add("smart-drop-down-repositioned"),i.setAttribute("mode",o.mode),i.setAttribute("drop-down-position",o.dropDownPosition),o.checkboxes&&i.setAttribute("checkboxes",""),""!==o.theme&&i.$.addClass(o.theme),i.setAttribute("animation",o.animation),2===t?(o._dropDownParent.appendChild(i),i.$.listen("click",o._selectionHandler.bind(o)),i.$.listen("mouseleave",o._mouseleaveHandler.bind(o)),i.$.listen("mouseout",o._mouseoutMouseoverHandler.bind(o)),i.$.listen("mouseover",o._mouseoutMouseoverHandler.bind(o))):e.appendChild(i))}o._validateRadioButtonSelection(e,t,s),o._sortItems&&!1!==n&&o._sortItems(e)}_processUList(){const e=this,t=new RegExp(/<li>(.(?!<\/li>)|\n)*?<ul>/),n=new RegExp(/<\/ul>(.|\n)*?<\/li>/);let o=e.$.mainContainer.firstElementChild.innerHTML;for(o=o.replace(/\r?\n|\r/g,""),o=o.replace(/<li(.|\n)*?>/g,"<li>"),o=o.replace(/<li><\/li>/g,"<li> </li>"),o=o.replace(/<ul(.|\n)*?>/g,"<ul>");t.test(o);){const n=t.exec(o),i="<smart-"+e._element+"-items-group>"+n[0].slice(4,n[0].length-4);o=o.replace(n[0],i)}for(;n.test(o);){const t=n.exec(o),i="</smart-"+e._element+"-items-group>";o=o.replace(t[0],i)}o=o.replace(/li>/g,"smart-"+e._element+"-item>"),e.$.mainContainer.innerHTML=o}_refreshContainersArrays(){const e=this;for(let t=e._containers.length-1;t>=0;t--){const n=e._containers[t];if(!document.body.contains(n)){e._containers.splice(t,1);const o=e._containersFixedHeight.indexOf(n);o>-1&&(e._containersFixedHeight.splice(o,1),e._additionalScrollButtons.splice(o,1))}}e._checkContainersLength()}_refreshItemPaths(e,t,n,o){const i=this;let r;r=t?e:e.container.itemContainer;const a=n?n(e):r.children;for(let r=0;r<a.length;r++){const s=a[r];let l;o&&(s.originalIndex=r),l=t?""+r:e.path+"."+r,s.path=l,i._menuItems[l]=s,s instanceof Smart.MenuItemsGroup&&i._refreshItemPaths(s,void 0,n,o)}}_removeContainerFixedHeight(){const e=this;for(let t=0;t<e._containersFixedHeight.length;t++){const n=e._containersFixedHeight[t];n.style.height="",n.itemContainer.$.removeClass("scroll-buttons-shown"),n.itemContainer.$.removeClass("one-button-shown"),n.children[0].$.addClass("smart-hidden"),n.children[2].$.addClass("smart-hidden"),n.itemContainer.checkOverflow=!0}}_removeContainersInBody(){const e=this;if(null!==e.dropDownAppendTo&&!e._minimized)for(let t=0;t<e._containersInBody.length;t++)e._containersInBody[t].remove()}_reparentMenu(e,t){const n=this;if("dropDown"===n.mode&&(null!==n._dropDownParent||e)&&n._dropDownParent!==n.parentElement){if(e&&null!==t){if(null===n._dropDownParent)return n._positionRelativeTo.appendChild(n),void(n._positionRelativeTo=null)}else n._positionRelativeTo=n.parentElement;n._dropDownParent.appendChild(n)}}refresh(){const e=this;if(e._suppressResizeHandler)return void delete e._suppressResizeHandler;const t=e.minimizeWidth,n=e.mode;if(null!==t&&"dropDown"!==n){if(e.offsetWidth<=t&&!e._minimized)return void e.minimize();e.offsetWidth>t&&e.maximize()}(null!==e.dropDownAppendTo||"tree"===n||e.$mainContainer.hasClass("simple"))&&e._checkOverflow(e.$.mainContainer,"horizontal"===n,[e.$.scrollButtonNear,e.$.scrollButtonFar])}_resizeHandler(){this.refresh()}_ripple(e,t){if(this.hasRippleAnimation&&"click"===t.type)return Smart.Utilities.Animation.Ripple.animate(e,t.pageX,t.pageY),!0}_scroll(e){if(e.closest("[template-applied]"))return;const t=this,n=t.$.mainContainer,o=t.mode,i=e.classList.contains("smart-scroll-button-near")?-1:1;let r;if(e.parentElement===t.$.container)r=n,"tree"!==o&&t._closeSubContainers(2),"horizontal"===t.mode?(n.scrollLeft=n.scrollLeft+10*i,t._updateScrollButtonVisibility(n,!0,[t.$.scrollButtonNear,t.$.scrollButtonFar])):(n.scrollTop=n.scrollTop+10*i,t._updateScrollButtonVisibility(n,!1,[t.$.scrollButtonNear,t.$.scrollButtonFar]));else{const n=e.parentElement,o=n.itemContainer;r=o,t._closeSubContainers(n.level+1),o.scrollTop=o.scrollTop+10*i,t._updateScrollButtonVisibility(o,!1,[n.children[0],n.children[2]])}t._scrollInfo.set(r,{left:r.scrollLeft,top:r.scrollTop})}_selectionHandler(e,t){const n=this,o=e.target;if(o.closest("[template-applied]")&&e.stopPropagation(),!n.disabled&&!n.displayLoadingIndicator){if(void 0===t){if("click"===e.type){const t=o.closest("smart-repeat-button");if(t)return void n._scroll(t,e)}if(!e.isTrusted)return;const i=o.closest("smart-"+n._element+"-item");if(i)return void n._menuItemSelectionHandler(i,e);if((t=o.closest("smart-"+n._element+"-items-group"))&&(o===t.container||o===t.container.firstElementChild))return}t&&!t.disabled&&n._menuItemsGroupSelectionHandler(t,e)}}_setArrowDirection(e,t){const n=this,o=n.mode;"tree"===o||n._minimized?e.className="smart-"+n._element+"-items-group-arrow down smart-arrow-down":"overlay"!==n.dropDownPosition.slice(0,7)?2===t&&"horizontal"===o?"top"!==n.dropDownPosition.slice(0,3)?e.className="smart-menu-items-group-arrow down smart-arrow-down":e.className="smart-menu-items-group-arrow up smart-arrow-up":e.className="smart-menu-items-group-arrow "+(n.rightToLeft?"left smart-arrow-left":"right smart-arrow-right"):e.className="smart-menu-items-group-arrow minus"}_setFocusable(){const e=this;if(e.disabled||e.unfocusable)return void e.removeAttribute("tabindex");const t=e.getAttribute("tabindex");(null===t||t<0)&&e.setAttribute("tabindex",0)}_setItemLabel(e,t){const n=this,o=n.context,i=e.querySelector(".smart-menu-item-label-element>span");n.context=n,n._setLabel(t,i,e,!0),n._checkOverflow(n.$.mainContainer,"horizontal"===n.mode,[n.$.scrollButtonNear,n.$.scrollButtonFar]),n.context=o}_setLabel(e,t,n,o){const i=document.getElementById(e);if(null!==i&&"template"===i.tagName.toLowerCase()){const r=document.importNode(i.content,!0);if(n instanceof Smart.MenuItem)t.appendChild(r),o&&(n.setAttribute("template-applied",""),n.templateApplied=!0);else if(Smart.ListMenu&&this instanceof Smart.ListMenu){const e=new RegExp(/{{title="(.*)"}}/);for(let t=0;t<r.childNodes.length;t++)e.test(r.childNodes[t].innerHTML)?(n.titleLabel=e.exec(r.childNodes[t].innerHTML)[1],r.childNodes[t].innerHTML=r.childNodes[t].innerHTML.replace(e,"")):e.test(r.childNodes[t].textContent)&&(n.titleLabel=e.exec(r.childNodes[t].textContent)[1],r.childNodes[t].textContent=r.childNodes[t].textContent.replace(e,""));void 0===n.titleLabel&&(n.titleLabel=r.textContent),t.appendChild(r)}else t.innerHTML=e,n.titleLabel=e}else t.innerHTML=e,n instanceof Smart.MenuItemsGroup&&(n.titleLabel=e)}_toggleItem(e){const t=this;if(t.checkboxes){const n=1===e.level?t:e.parentItem;if(n.checkable){const o=t._getItemCheckableInfo(e,n);let i=!1;return"none"!==o.checkMode&&("checkbox"===o.checkMode?(i=!0,e.set("checked",!e.checked),e.checked?e.setAttribute("aria-checked",!0):e.removeAttribute("aria-checked"),t.$.fireEvent("itemCheckChange",{item:e,label:e.label,value:e.value,checked:e.checked})):"radioButton"!==o.checkMode||e.checked||(i=!0,e.set("checked",!0),e.setAttribute("aria-checked",!0),t._uncheckSiblings(e,o.siblings),t.$.fireEvent("itemCheckChange",{item:e,label:e.label,value:e.value,checked:!0})),e instanceof Smart.MenuItem&&i&&t.$.fireEvent("itemClick",{item:e,label:e.label,value:e.value}),"tree"===t.mode||"ListMenu"===t.elementName||t.preventCloseOnCheck||(t._close(),t.close()),!0)}}return!1}_getItemCheckableInfo(e,t){const n=Array.from(e.parentElement.children),o=t.checkMode.replace(/\s/g,"").split(",");let i,r;if(1===o.length)i=o[0],r=n;else{let t=0,a=!1;r=[];for(let o=0;o<n.length;o++){const i=n[o];if(r.push(i),i===e&&(a=!0),i.separator){if(!0===a)break;t++,r=[]}}i=o[t]}return{checkMode:i,siblings:r}}_refreshCheckableItems(e){const t=this,n=!t.checkboxes;(e?[e]:[t].concat(t._containers.map((e=>e.menuItemsGroup)))).forEach((e=>{const o=Array.from((e===t?t.$.mainContainer:e.itemContainer).children);let i=e.checkMode.replace(/\s/g,"").split(",");if(n||!e.checkable||1===i.length)return void o.forEach((e=>e.removeAttribute("check-type")));let r=0;i=i.map((e=>-1===["checkbox","radioButton","none"].indexOf(e)?"none":e));let a=[],s=[];for(let e=0;e<o.length;e++){const n=o[e];let l=i[r];if(void 0===l&&(l=i[r]="none"),"none"!==l&&t._isChildEnabled(n)||(n.checked=!1,n.removeAttribute("aria-checked")),"none"===l?n.setAttribute("role","menuitem"):"checkbox"===l?n.setAttribute("role","menuitemcheckbox"):"radioButton"===l&&(n.setAttribute("role","menuitemradio"),a.push(n),n.checked&&s.push(n)),n.setAttribute("check-type",l),n.separator){if(a.length>0)if(s.length>1)for(let e=0;e<s.length-1;e++)s[e].checked=!1;else if(0===s.length)for(let e=0;e<a.length;e++)if(t._isChildEnabled(a[e])){a[e].checked=!0;break}a=[],s=[],r++}}e.checkMode=i.join(", ")}))}_transitionendHandler(e){const t=this;"dropDown"===t.mode&&t.opened&&e.target===t&&"opacity"===e.propertyName&&(t._checkOverflowOnOpen&&(t._checkOverflow(t.$.mainContainer,!1,[t.$.scrollButtonNear,t.$.scrollButtonFar]),delete t._checkOverflowOnOpen),t.getRootNode().activeElement===t||t._noAutoFocus||t.focus())}_transitionendHandlerCollapse(){let e,t;if(1===arguments.length){if("visibility"===arguments[0].propertyName)return;t=this,e=t.menuItemsGroup.menu}else e=arguments[0],t=arguments[1];t.menuItemsGroup.$.removeClass("smart-"+e._element+"-items-group-expanded"),t.menuItemsGroup.setAttribute("aria-expanded",!1),t.removeEventListener("transitionend",e._transitionendHandlerCollapse),t.style.height=null,t.$.addClass("smart-visibility-hidden"),e._checkOverflow(e.$.mainContainer,!1,[e.$.scrollButtonNear,e.$.scrollButtonFar]),e._minimized&&e._browserBoundsDetection(e.$.mainContainer),delete e._treeAnimationInProgress}_transitionendHandlerExpand(){let e,t;if(1===arguments.length){if("visibility"===arguments[0].propertyName)return;t=this,e=t.menuItemsGroup.menu}else e=arguments[0],t=arguments[1];t.removeEventListener("transitionend",e._transitionendHandlerExpand),t.style.height=null,e._checkOverflow(e.$.mainContainer,!1,[e.$.scrollButtonNear,e.$.scrollButtonFar]),e._minimized&&e._browserBoundsDetection(e.$.mainContainer),e._ensureVisibleOnTransitionend&&(e._ensureVisible(e._ensureVisibleOnTransitionend),delete e._ensureVisibleOnTransitionend),delete e._treeAnimationInProgress}_uncheckSiblings(e,t){for(let n=0;n<t.length;n++){const o=t[n];o!==e&&o.checked&&(o.set("checked",!1),o.removeAttribute("aria-checked"),this.$.fireEvent("itemCheckChange",{item:o,label:o.label,value:o.value,checked:!1}))}}_unsortItems(e,t){const n=this;let o,i,r=[];e===n.$.mainContainer?(i=e,o=e.children):(i=e.container.firstElementChild,o=i.children);for(let e=0;e<o.length;e++){const i=o[e];r[i.originalIndex]=i,i instanceof Smart.MenuItemsGroup&&void 0===t&&n._unsortItems(i)}if(!(r.length<2))for(let e=0;e<r.length;e++)i.appendChild(r[e])}_updateItemRoles(e){const t=this;for(let n in t._menuItems){const o=t._menuItems[n],i=o.parentItem||t;e&&i!==e||(t.checkboxes&&i.checkable?o.setAttribute("role","checkbox"===i.checkMode?"menuitemcheckbox":"menuitemradio"):o.setAttribute("role","menuitem"))}t._refreshCheckableItems(e)}_updateScrollButtonVisibility(e,t,n){const o=this,i=o.overflow,r=e===o.$.mainContainer;if(r&&"hidden"===i)return;let a,s,l,d=!0,m=!0;if(t?(a="scrollLeft",s="offsetWidth",l="scrollWidth"):(a="scrollTop",s="offsetHeight",l="scrollHeight"),0===Math.round(e[a])&&(d=!1),Math.round(e[s]+e[a])>=Math.round(e[l])&&(m=!1),r&&"auto"!==i)"scroll"!==i||o.disabled||(n[0].disabled=!d,n[1].disabled=!m);else{if(d&&m)return n[0].$.removeClass("smart-hidden"),n[1].$.removeClass("smart-hidden"),void e.classList.remove("one-button-shown");d?n[0].$.removeClass("smart-hidden"):n[0].$.addClass("smart-hidden"),m?n[1].$.removeClass("smart-hidden"):n[1].$.addClass("smart-hidden"),e.classList.add("one-button-shown")}}_validateRadioButtonSelection(e,t,n){const o=this;if(o.checkboxes){let i,r;if(1===t?(i=o,r=o.$.mainContainer):(i=e,r=e.itemContainer),"radioButton"===i.checkMode&&i.checkable)if(n.length>1)for(let e=n.length-2;e>=0;e--)n[e].set("checked",!1),n[e].removeAttribute("aria-checked");else if(0===n.length){const e=o._getFirstEnabledChild(r);e&&!o.disableAutoCheck&&(e.set("checked",!0),e.setAttribute("aria-checked",!0))}}}});
|
|
67
67
|
(()=>{class e extends HTMLElement{constructor(){super(),this._properties={min:50,label:"Item",modifiers:["resize","drag","close"],size:null}}_setProperty(e,t){const i=this;if(i._properties[e]===t)return;if(i._properties[e]=t,i._updating=!0,"disabled"===e||"modifiers"===e?t?i.setAttribute(e,t):i.removeAttribute(e):null===t?i.removeAttribute(e):i.setAttribute(e,t),!i.isCompleted)return;const r=i.closest("smart-layout");r&&(r._resizeDetails||r._updating||!r.isRendered||r.refresh()),i._updating=!1}get label(){return this._properties.label}set label(e){this._setProperty("label",e)}get modifiers(){return this._properties.modifiers}set modifiers(e){this._setProperty("modifiers",e)}get min(){return this._properties.min}set min(e){this._setProperty("min",e)}get size(){return this._properties.size}set size(e){null!==e?"string"==typeof e?this._setProperty("size",e):this._setProperty("size",Math.max(this.min,e)):this._setProperty("size",e)}static get observedAttributes(){return["min","size","label","modifiers"]}attributeChangedCallback(e,t,i){const r=this;if(t!==i&&r.isCompleted)if("size"===e){if(!r._updating){if(null===i)return void(this[e]=null);r[e]=Math.max(r.min,parseInt(i))}}else r[e]=i}connectedCallback(){this.isCompleted||this.render()}whenRendered(e){const t=this;t.isRendered?e():(t.whenRenderedCallbacks||(t.whenRenderedCallbacks=[]),t.whenRenderedCallbacks.push(e))}render(){const e=this;e.hasAttribute("data-id")||e.setAttribute("data-id","id"+Math.random().toString(16).slice(2)),e.hasAttribute("label")||e.setAttribute("label",e.label),e.hasAttribute("min")||e.setAttribute("min",e.min),e.hasAttribute("label")||e.setAttribute("label",e.label),e.hasAttribute("modifiers")||e.setAttribute("modifiers",e.modifiers);for(let t=0;t<e.attributes.length;t++){const i=e.attributes[t],r=i.name,s=i.value;isNaN(s)||"min"!==r&&"size"!==r?e._properties[r]=s:e._properties[r]=parseInt(s)}if(e.classList.add("smart-layout-item"),e.isCompleted=!0,e.whenRenderedCallbacks){for(let t=0;t<e.whenRenderedCallbacks.length;t++)e.whenRenderedCallbacks[t]();e.whenRenderedCallbacks=[]}}}class t extends e{constructor(){super(),this._properties.label="Group",this._properties.orientation="vertical"}get orientation(){return this._properties.orientation}set orientation(e){this._setProperty("orientation",e)}static get observedAttributes(){return["min","size","modifiers","orientation","position"]}render(){const e=this;super.render(),e.className="smart-layout-group",e.hasAttribute("orientation")?e._properties.orientation=e.getAttribute("orientation"):e.setAttribute("orientation",e._properties.orientation)}}class i extends t{constructor(){super(),this._properties.position="top",this._properties.label="TabGroup"}get position(){return this._properties.position}set position(e){this._setProperty("position",e)}render(){const e=this;super.render(),!e.hasAttribute("position")&&e.position&&e.setAttribute("position","top")}static get observedAttributes(){return["min","size","modifiers","orientation","position"]}}class r extends t{constructor(){super(),this._properties.label="TabItem"}}customElements.define("smart-layout-group",t),customElements.define("smart-layout-item",e),customElements.define("smart-tab-layout-group",i),customElements.define("smart-tab-layout-item",r),Smart("smart-layout",class extends Smart.ContentElement{static get properties(){return{allowLiveSplit:{value:!1,type:"boolean"},allowContextMenu:{value:!1,type:"boolean"},contextMenuDataSource:{value:["select","delete"],type:"any"},dataSource:{reflectToAttribute:!1,value:null,type:"any"},messages:{value:{en:{select:"Select Parent",delete:"Delete"}},type:"object",extend:!0},orientation:{value:"vertical",type:"string"},selectedIndex:{value:null,type:"any"}}}static get listeners(){return{contextmenu:"_contextMenuHandler","document.down":"_documentDownHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler","document.selectstart":"_documentSelectStartHandler",mouseleave:"_leaveHandler",mouseenter:"_enterHandler",dragStart:"_dragStart","document.keyup":"_keyUpHandler"}}_dragStart(e){e.stopPropagation(),e.preventDefault()}_leaveHandler(){const e=this;e._resizeDetails||(e._handleButtonsVisibility(null),e._hideSplitter(),requestAnimationFrame((()=>{e.classList.remove("outline")})))}_enterHandler(){const e=this;e._resizeDetails||(e._handleButtonsVisibility(e._selectedItem),e._updateSplitter(),requestAnimationFrame((()=>{e.classList.add("outline")})))}template(){return'<div id="container" role="presentation"><smart-layout-group data-id="root" id="itemsContainer"><content></content></smart-layout-group><div root-splitter id="splitter" class="smart-layout-splitter"></div>'}propertyChangedHandler(e,t,i){const r=this;switch(e){case"contextMenuDataSource":r._contextMenu&&(r._closeContextMenu(),r._contextMenu.innerHTML="");break;case"orientation":r.$.itemsContainer&&(r.$.itemsContainer.orientation=r.orientation);break;case"dataSource":r.dataBind();break;case"selectedIndex":r._handleItemClick(r.getItem(i+""),!0);break;default:super.propertyChangedHandler(e,t,i)}}dataBind(){const e=this;e.$.itemsContainer.innerHTML="";let t="";const i=(e,r)=>{for(let s=0;s<e.length;s++){const n=e[s],o=n.size,a=n.min,l=n.modifiers,d=n.type,c=n.position,u=n.orientation?n.orientation:"vertical";let p="";if(void 0!==o&&(p+=`size="${o}" `),void 0!==a&&(p+=`min="${a}" `),void 0!==l&&(p+=`modifiers="${l}" `),void 0!==c&&(p+=`position="${c}" `),n.items)p+=`orientation=${u} `,"tabs"===d?(t+=`<smart-tab-layout-group ${p}>`,i(n.items,!0),t+="</smart-tab-layout-group>"):(t+=`<smart-layout-group ${p}>`,i(n.items),t+="</smart-layout-group>");else{const e=n.content||"";t+=r?`<smart-tab-layout-item ${p}>`+e+"</smart-tab-layout-item>":`<smart-layout-item ${p}>`+e+"</smart-layout-item>"}}};i(e.dataSource),e.$.itemsContainer.innerHTML=t,e.refresh()}render(){const e=this;e.setAttribute("role","group"),e.selectedIndex&&e._handleItemClick(e.getItem(e.selectedIndex+""),!0),e.checkLicense();const t=()=>{e.dataSource?e.dataBind():e.dataSource=e._getDataSource(e._getLayout()),e.$.itemsContainer.orientation=e.orientation,super.render(),e.refresh(),e._updateSplitter()};"complete"===document.readyState?t():window.addEventListener("load",(()=>{t()}))}getItem(e){if(null==e)return;e=(e+"").split(".");let t,i=this._getDataSource(this._getLayout());for(let r=0;r<e.length&&(t=i[e[r]],t);r++)i=t.items;return t}_contextMenuHandler(e){const i=this;let r=e.target;if(i.allowContextMenu&&r.closest){if(r.closest(".smart-layout-context-menu"))return void e.preventDefault();let s=i.querySelector("[selected][data-id]");if(s||(s=r.closest(".smart-layout-item")||r.closest(".smart-layout-group")),!s)return;e.preventDefault(),i._createContextMenu();const n=i._contextMenu.children;for(let e=0;e<n.length;e++){const i=n[e];"delete"===i.getAttribute("value")?s.hasAttribute("index")&&"0"===s.getAttribute("index")?i.setAttribute("disabled",""):i.removeAttribute("disabled"):"select"===i.getAttribute("value")&&(s.hasAttribute("index")&&"0"===s.getAttribute("index")||!(s.parentElement instanceof t)?i.setAttribute("disabled",""):i.removeAttribute("disabled"))}i._openContextMenu(s,e.pageX,e.pageY)}}_createContextMenu(){const e=this;let t=e._contextMenu;if(t||(t=document.createElement("div"),t.classList.add("smart-layout-context-menu","smart-visibility-hidden"),e._contextMenu=t),!t.innerHTML){const i=e.contextMenuDataSource;for(let r=0;r<i.length;r++){const s=i[r];let n,o;"object"==typeof s?(n=s.label,o=s.value):o=n=s+"",t.innerHTML+=`<div class="smart-layout-context-menu-item" value="${o}">${e.localize(n)||n}</div>`}}}_openContextMenu(e,t,i){const r=this,s=r._contextMenu;if(!s||!s.classList.contains("smart-visibility-hidden"))return;r.$.fireEvent("opening").defaultPrevented||e.parentElement&&(s._target=e,r._opening=!0,r.$.container.appendChild(s),r._positionContextMenu(t,i),s.classList.remove("smart-visibility-hidden"),r.$.fireEvent("open"))}_closeContextMenu(){const e=this,t=e._contextMenu;if(!t||t.classList.contains("smart-visibility-hidden"))return;e.$.fireEvent("closing").defaultPrevented||(delete e._opening,e.hasAnimation&&t.addEventListener("transitionend",e._contextMenuTransitionEndHandler.bind(e),{once:!0}),t.classList.add("smart-visibility-hidden"),e.$.fireEvent("close"))}_contextMenuTransitionEndHandler(){const e=this,t=e._contextMenu;t&&!e._opening&&t.parentElement&&e.$.container.removeChild(t)}_positionContextMenu(e,t){const i=this._contextMenu;if(!i)return;const r=this.$.container.getBoundingClientRect();e-=r.left+window.pageXOffset,t-=r.top+window.pageYOffset,e+i.offsetWidth>r.width&&(e-=e+i.offsetWidth-r.width),t+i.offsetHeight>r.height&&(t-=t+i.offsetHeight-r.height),i.style.left=e+"px",i.style.top=t+"px"}_documentDownHandler(e){const t=this,i=e.originalEvent.target;t.contains(i)&&i.closest&&(t._target=i,t._updateSplitter())}_documentMoveHandler(e){const t=this,s=e.originalEvent.target,n=t._contextMenu;if(n&&!Smart.Utilities.Core.isMobile){if(n.querySelector(".smart-layout-context-menu-item[hover]")){const e=n.children;for(let t=0;t<e.length;t++)e[t].removeAttribute("hover")}n.contains(s)&&s.closest&&s.closest(".smart-layout-context-menu-item")&&s.setAttribute("hover","")}if(t._dragDetails){const s=Math.abs(t._dragDetails.pageX-e.pageX);if(Math.abs(t._dragDetails.pageY-e.pageY)<=5&&s<=5)return;t._dragDetails.feedback.parentElement||(document.body.appendChild(t._dragDetails.feedback),document.body.appendChild(t._dragDetails.overlay),setTimeout((()=>{t._dragDetails.feedback.classList.add("dragging")}),100)),t._dragDetails.dragging=!0,t._dragDetails.feedback.style.left=e.pageX-t._dragDetails.feedback.offsetWidth/2-5+"px",t._dragDetails.feedback.style.top=e.pageY-t._dragDetails.feedback.offsetHeight/2-5+"px";const n=document.elementsFromPoint(e.pageX,e.pageY);let o=null,a=!1;for(let e=0;e<n.length;e++){const s=n[e];if(!t._dragDetails.feedback.contains(s)){if(s.classList.contains("smart-layout-tab-strip")){if(t._dragDetails.element.contains(s))continue;o=s.parentElement,a=!0;break}if((s.parentElement!==t._dragDetails.parent&&s!==t._dragDetails.parent||1!==t._dragDetails.layoutGroup.items.length)&&!t._dragDetails.element.contains(s)){if(s instanceof r){o=s.parentElement;break}if(s instanceof i){o=s;break}}}}const l=(i,r)=>{const s=t.offset(i);let n=null,o=50,a=r,l=r;r?o=0:(l=i.offsetWidth/3,a=i.offsetHeight/3);const d=[{left:s.left,top:s.top,right:s.left+o,bottom:s.top+o,position:"top"},{left:s.left+o,top:s.top,right:s.left+i.offsetWidth-o,bottom:s.top+a-o,position:"top"},{left:s.left+i.offsetWidth-o,top:s.top,right:s.left+i.offsetWidth,bottom:s.top+o,position:"top"},{left:s.left,top:s.top+o,right:s.left+l,bottom:s.top+i.offsetHeight-o,position:"left"},{left:s.left+i.offsetWidth-l,top:s.top+o,right:s.left+i.offsetWidth,bottom:s.top+i.offsetHeight-o,position:"right"},{left:s.left,top:s.top+i.offsetHeight-o,right:s.left+o,bottom:s.top+i.offsetHeight,position:"bottom"},{left:s.left+o,top:s.top+i.offsetHeight-a+o,right:s.left+i.offsetWidth-o,bottom:s.top+i.offsetHeight,position:"bottom"},{left:s.left+i.offsetWidth-o,top:s.top+i.offsetHeight-o,right:s.left+i.offsetWidth,bottom:s.top+i.offsetHeight,position:"bottom"}];for(let t=0;t<d.length;t++){const i=d[t];if(i.left<=e.pageX&&e.pageX<=i.right&&i.top<=e.pageY&&e.pageY<=i.bottom){n=i.position;break}}return n},d=t.querySelector("smart-layout-group");let c=l(d,10),u=null;c?u=d:o?a?o!==t._dragDetails.parent&&(c="center",u=o):(c=l(o)||"center",u=o):t._handleDropArea(null),u&&(t._dragDetails.current=u,t._dragDetails.position=c,t._handleDropArea(u,c))}if(t._resizeDetails){const i=Math.abs(t._resizeDetails.clientX-e.clientX),r=Math.abs(t._resizeDetails.clientY-e.clientY),s=t._resizeDetails.splitter,n=t._resizeDetails.item,o=t._resizeDetails.itemRect,a=t._resizeDetails.previousItemRect,l=t._resizeDetails.previousItem,d=t._resizeDetails.nextItemRect,c=t._resizeDetails.nextItem,u=parseInt(n.getAttribute("min")),p=e=>{e.classList.contains("smart-visibility-hidden")||(e.style.right="",e.style.top="",e.style.left="",e.style.bottom="")};if(p(s),p(t.$.splitter),s.classList.remove("error"),s.classList.add("active"),!t._resizeDetails.dragging){if(s.classList.contains("horizontal")&&r<=5)return;if(s.classList.contains("vertical")&&i<=5)return;t._resizeDetails.dragging=!0}let m={clientPos:"clientX",pos:"x",size:"width",near:"left",far:"right",offsetSize:"offsetWidth"};s.classList.contains("horizontal")&&(m={clientPos:"clientY",pos:"y",size:"height",near:"top",far:"bottom",offsetSize:"offsetHeight"});const f=e=>{const i=t.offset(e),r=t.offset(t);t.$.splitter.style.width=e.offsetWidth+"px",t.$.splitter.style.height=e.offsetHeight+"px",t.$.splitter.className=e.className,t.$.splitter.style.left=i.left-r.left+"px",t.$.splitter.style.top=i.top-r.top+"px",e.setAttribute("drag",""),t.$.splitter.setAttribute("drag","")};if(s.classList.contains("last")){let i=e[m.clientPos]-t._resizeDetails.splitterRect[m.pos],r=o[m.size]-u;if(i>r&&(i=r,s.classList.add("error")),a){const e=parseInt(l.getAttribute("min"));let t=a[m.size]-e;i<-t&&(i=-t,s.classList.add("error"))}s.style[m.near]=i+"px";const d=n[m.offsetSize]-i;if(n.setAttribute("size",d),l){const e=n[m.offsetSize]+l[m.offsetSize]-d;l.setAttribute("size",e)}}else{let i=-e[m.clientPos]+t._resizeDetails.splitterRect[m.pos],r=o[m.size]-u;if(i>r&&(i=r,s.classList.add("error")),d){const e=parseInt(c.getAttribute("min"));let t=-d[m.size]+e;i<t&&(i=t,s.classList.add("error"))}s.style[m.far]=i+"px";const a=n[m.offsetSize]-i;if(n.setAttribute("size",a),c){const e=c[m.offsetSize]+n[m.offsetSize]-a;c.setAttribute("size",e)}}f(s)}}_offsetTop(e){return e?e.offsetTop+this._offsetTop(e.offsetParent):0}_offsetLeft(e){return e?e.offsetLeft+this._offsetLeft(e.offsetParent):0}offset(e){return{left:this._offsetLeft(e),top:this._offsetTop(e)}}_keyUpHandler(e){const t=this;if("Escape"===e.key){if(t._dragDetails&&(t._dragDetails.feedback.remove(),t._dragDetails.overlay.remove(),t._dragDetails=null,t._handleDropArea(null)),t._resizeDetails){const e=t._resizeDetails;return e.splitter.classList.contains("last")?e.previousItem.size=e.previousItemSize:e.nextItem.size=e.nextItem.previousItemSize,e.item.size=e.itemSize,t.refresh(),t._handleItemClick(e.item),void(t._resizeDetails=null)}}else"Delete"===e.key&&t._selectedItem&&t._removeLayoutItem(t._selectedItem)}_endDrag(){const e=this;if(e._handleDropArea(null),!e._dragDetails.dragging)return void(e._dragDetails=null);const t=e._dragDetails.current,i=e._dragDetails.element,r=e._dragDetails.position;if(e._handleDropArea(null),t){if(e._addTabLayoutItem(t,r,i),e._removeLayoutItem(i),t.parentElement&&1===Array.from(t.parentElement.parentElement.children).filter((e=>!!e.classList.contains("smart-layout-group"))).length){const i=t.parentElement,r=i.parentElement,s=r.parentElement;if("root"!==r.getAttribute("data-id")&&"root"!==s.getAttribute("data-id")&&s!==e){const e=Array.from(s.children).indexOf(i.parentElement);e>=0?s.insertBefore(i,s.children[e]):s.appendChild(i),r.remove()}}e.refresh(),e._updateSplitter(),requestAnimationFrame((()=>{e.classList.add("outline"),e.querySelectorAll(".smart-element").forEach((e=>{e.$.fireEvent("resize")}))}))}e.$.fireEvent("stateChange",{type:"insert",item:i}),e._dragDetails.feedback.remove(),e._dragDetails.overlay.remove(),e._dragDetails=null}_documentUpHandler(e){const t=this,i=Smart.Utilities.Core.isMobile,s=i?document.elementFromPoint(e.pageX-window.pageXOffset,e.pageY-window.pageYOffset):e.originalEvent.target;if(2!==e.button){if(t._dragDetails&&t._endDrag(e),t._resizeDetails){const e=t._resizeDetails;return e.item&&(e.item.style.overflow=""),e.previousItem&&(e.previousItem.style.overflow=""),e.nextItem&&(e.nextItem.style.overflow=""),t.refresh(),t._handleItemClick(e.item),t._resizeDetails=null,void t.querySelectorAll(".smart-element").forEach((e=>{e.$.fireEvent("resize")}))}if(t.contains(s)&&(t.classList.add("outline"),t._target&&!s.item&&(s instanceof r?t._handleItemClick(s):t._handleItemClick(s.closest(".smart-layout-item"))),t._target)){if(t._target!==s)return void delete t._target;if(!e.button&&s.closest(".smart-layout-buttons-container")){const i=e.originalEvent.target;t._handleButtonClick(i.item,i.position)}else s.closest(".smart-layout-context-menu")&&(!i&&!e.button||i)&&t._handleMenuItemClick(s.closest(".smart-layout-context-menu-item"));delete t._target}}}_documentSelectStartHandler(e){this._target&&e.preventDefault()}_getDataSource(i,r,s){const n=this;let o=[];s||(s=0),r||(r="");for(let a=0;a<i.length;a++){const l=i[a],d={label:l.label,id:l.getAttribute("data-id"),orientation:l.orientation,size:l.size,min:l.min,type:l.type,modifiers:l.modifiers,position:l.position};if(l.removeAttribute("index"),l instanceof t){if(o.push(d),d.index=""!==r?r+"."+s:s.toString(),l.setAttribute("index",d.index),l.items){const e=n._getDataSource(l.items,d.index,0);d.items=e}}else if(l instanceof e)if(l.items){const e=n._getDataSource(l.items,r,s);o=o.concat(e)}else d.index=""!==r?r+"."+s:s.toString(),l.setAttribute("index",d.index),o.push(d);s++}return o}_getLayout(){const e=this,i=arguments.length?arguments[0]:e.$.itemsContainer;e._buttons&&e._buttons.remove(),e._dropArea&&e._dropArea.remove();const r=e.querySelectorAll(".smart-layout-splitter");for(let t=0;t<r.length;t++){const i=r[t];i!==e.$.splitter&&i.remove()}i.items=Array.from(i.children),i.items=i.items.filter((e=>e!==i.tabs&&e.hasAttribute("data-id")));const s=i.items.map((function(i){if(i.classList.contains("smart-layout-tab-strip"))return null;const r=i,s=i instanceof t?i:null;return s&&(r.items=e._getLayout(s)),r}));if(i!==e.$.itemsContainer)return s.filter((e=>null!==e&&e!==i.tabs));const n=[],o=i;return o.items=s.filter((e=>null!==e&&e!==i.tabs)),n.push(o),n}_updateSplitter(){const e=this;e._buttons&&e._dragDetails&&e._buttons.remove(),e._removeSplitter();const t=e.querySelectorAll("[data-id]");for(let i=0;i<t.length;i++){const r=t[i];if("root"!==r.getAttribute("data-id")){if(r.hasAttribute("role")){const e=r.getAttribute("role");if("gridcell"===e||"row"===e||"columnheader"===e||"rowheader"===e)continue}r.setAttribute("hover",""),e._handleSplitter(r)}}}_hideSplitter(){const e=this.querySelectorAll("[data-id]");for(let t=0;t<e.length;t++){e[t].removeAttribute("hover")}}_removeSplitter(){const e=this,t=e.querySelectorAll(".smart-layout-splitter");for(let i=0;i<t.length;i++){const r=t[i];r!==e.$.splitter&&r.remove()}e._hideSplitter()}_handleItemClick(e){const t=this,i=t.selectedIndex;let r=null;return e?(r=e instanceof HTMLElement?e:t.querySelector("[data-id="+e.id+"]"),r&&r.readonly?(t._closeContextMenu(),void(t.selectedIndex=null)):(t.querySelectorAll("[data-id]").forEach((e=>e.removeAttribute("selected"))),t._closeContextMenu(),void(r?(t.selectedIndex=r.getAttribute("index"),r.setAttribute("selected",""),r.setAttribute("hover",""),t._selectedItem=r,r.classList.contains("smart-hidden")&&t.refresh(),t._handleButtonsVisibility(r),i!==t.selectedIndex&&t.$.fireEvent("change",{selectedIndex:t.selectedIndex,oldSelectedIndex:i}),t._updateSplitter()):t.refresh()))):(t._closeContextMenu(),t.selectedIndex=null,t.querySelectorAll("[data-id]").forEach((e=>e.removeAttribute("selected"))),void(t._selectedItem=null))}_handleButtonClick(e,t){const i=this,r=i._addLayoutItem(e,t);i.$.fireEvent("stateChange",{type:"insert",item:r}),i._handleItemClick(r,!0)}_handleMenuItemClick(e){const t=this;if(!e||e.hasAttribute("disabled"))return;const i=e.getAttribute("value"),r=t._contextMenu;t.$.fireEvent("menuItemClick",{target:r?r._target:null,item:e,label:e.textContent,value:i});const s=r._target;s&&("select"===i&&t._handleItemClick(s.parentElement?s.parentElement:s),"delete"===i&&t._removeLayoutItem(s))}_removeLayoutItem(t){const i=this;if("root"!==t.getAttribute("data-id")){if(t instanceof e&&1===t.parentElement.items.length){let e=t.parentElement,r=e;for(;e&&e.items&&1===e.items.length&&"root"!==e.getAttribute("data-id");)r=e,e=e.parentElement;"root"!==r.getAttribute("data-id")?r.remove():i.allowLiveSplit&&r.appendChild(document.createElement("smart-layout-item"))}else t.remove();i.refresh(),i.$.fireEvent("stateChange",{type:"delete",item:t})}}refresh(){const e=this;if(e._isUpdating)return;e.dataSource=e._getDataSource(e._getLayout()),e.$.splitter.className="smart-visibility-hidden smart-layout-splitter";const t=t=>{const s=e.getItem(t.getAttribute("index"));if(!s)return;t.style.gridTemplateColumns="",t.style.gridTemplateRows="";let n="",o=0,a=0;if(t instanceof i){t.tabs&&t.tabs.remove();const i=document.createElement("div");i.classList.add("smart-layout-tab-strip"),e._selectedItem&&t.contains(e._selectedItem)&&e._selectedItem instanceof r&&(t.selectedIndex=Math.max(0,t.items.indexOf(e._selectedItem))),t.selectedIndex>=t.children.length&&(t.selectedIndex=0);for(let r=0;r<t.children.length;r++){const n=t.children[r],o=e.getItem(n.getAttribute("index"));if(!o)continue;const a=document.createElement("div");a.classList.add("smart-layout-tab"),a.innerHTML="<label>"+o.label+'</label><span class="smart-close-button"></span>',i.appendChild(a),n.setAttribute("tab",""),n.classList.add("smart-hidden"),a.content=n,a.item=o,a.group=s,n.modifiers?-1===n.modifiers.indexOf("close")&&a.querySelector(".smart-close-button").classList.add("smart-hidden"):a.querySelector(".smart-close-button").classList.add("smart-hidden"),void 0!==t.selectedIndex&&r!==t.selectedIndex||(a.classList.add("selected"),n.classList.remove("smart-hidden"),t.selectedIndex=r),a.onpointerup=function(i){i.target.classList.contains("smart-close-button")&&a.close&&(t.selectedIndex=0,e._removeLayoutItem(e._selectedItem),e._handleItemClick(parent))},a.onpointerdown=function(t){const i=this.closest(".smart-layout-group");e._handleItemClick(this.content),a.close=!1,t.target.classList.contains("smart-close-button")?a.close=!0:o.modifiers&&o.modifiers.indexOf("drag")>=0&&e._beginDrag(i,this,t)}}t.tabs=i,"top"===s.position||"left"===s.position?t.insertBefore(i,t.firstChild):t.appendChild(i)}else{for(var l=0;l<t.children.length;l++){var d=t.children[l];if(d.hasAttribute("size")){var c=d.getAttribute("size"),u=parseFloat(c),p="vertical"===t.orientation?t.offsetWidth:t.offsetHeight,m=c.indexOf("%")>=0?parseFloat(c):parseFloat(u/p*100);if(o+=m,a++,a===t.children.length){if(o<100){n+="1fr ",o=100;continue}o>100&&(o-=m,m=100-o,o=100)}else if(o>100||0===m){a=t.children.length,o=0;break}n+=m+"% "}else n+="1fr "}if(a===t.children.length&&(o<99||o>100)){n="";for(let e=0;e<t.children.length;e++){t.children[e].removeAttribute("size"),n+="1fr "}}"vertical"===t.orientation?t.style.gridTemplateColumns=n:t.style.gridTemplateRows=n}t.items=Array.from(t.children),t.items=t.items.filter((e=>e!==t.tabs))},s=e.querySelectorAll(".smart-layout-group");for(let e=0;e<s.length;e++)t(s[e])}_beginDrag(e,t,i){const r=this;r._dragDetails&&r._dragDetails.feedback.remove();const s=document.createElement("div"),n=document.createElement("div"),o=e.querySelector(".smart-layout-tab-strip");let a="";if(o)for(let t=0;t<Array.from(o.children).length;t++)t===e.selectedIndex&&(a=o.children[t].innerText);s.innerHTML=`<smart-layout><smart-tab-layout-group><smart-tab-layout-item label="${a}"></smart-tab-layout-item></smart-tab-layout-group></smart-layout>`,r._feedback=s,r._feedback.classList.add("smart-layout-feedback","smart-layout"),n.classList.add("smart-layout-overlay"),r._dragDetails={element:t.content,item:t.item,layoutGroup:t.group,parent:e,overlay:n,feedback:s,pageX:i.pageX,pageY:i.pageY}}moveChildren(e,t){t.innerHTML="";let i=e;for(;i.firstChild;){const e=i.firstChild;t.appendChild(e)}}createLayoutItem(e,t){const i=this;return"layoutItem"!==e&&e?"tabLayoutItem"!==e&&e?"tabLayoutGroup"===e?(e=>{const t=document.createElement("smart-tab-layout-group"),r="top"===e||"bottom"===e?"horizontal":"vertical";return t.setAttribute("orientation",r),t.orientation=r,i.$.fireEvent("createGroup",{item:t,type:"tabLayoutGroup"}),t})(t):(e=>{const t=document.createElement("smart-layout-group"),r="top"===e||"bottom"===e?"horizontal":"vertical";return i.$.fireEvent("createGroup",{item:t,type:"layoutGroup"}),t.setAttribute("orientation",r),t.orientation=r,t})(t):(()=>{const e=document.createElement("smart-tab-layout-item");return e.innerHTML="",i.$.fireEvent("createItem",{item:e,type:"tabLayoutItem"}),e})():(()=>{const e=document.createElement("smart-layout-item");return e.innerHTML="",i.$.fireEvent("createItem",{item:e,type:"layoutItem"}),e})()}_addTabLayoutItem(s,n,o){const a=this,l=a.createLayoutItem("tabLayoutItem"),d=s.closest("smart-tab-layout-group");let c;o&&(l.label=o.label,l.modifiers=o.modifiers,a.moveChildren(o,l));const u=e=>{for(let t=0;t<e.children.length;t++){e.children[t].removeAttribute("size")}e.removeAttribute("size")},p=e=>{if(s.removeAttribute("size"),s.querySelector("smart-layout-group"))a._addLayoutItem(s.querySelector("smart-layout-group"),e);else{c=a.createLayoutItem("layoutGroup",e);const t=a.createLayoutItem();a.moveChildren(s,t),"top"===e||"left"===e?(c.appendChild(a.createLayoutItem()),c.appendChild(t)):(c.appendChild(t),c.appendChild(a.createLayoutItem())),s.appendChild(c)}},m=(e,t)=>{const i=s.parentElement,r=s,n=a.createLayoutItem("layoutGroup",t);i.insertBefore(n,r),"top"===t||"left"===t?(n.append(e),n.appendChild(r)):(n.appendChild(r),n.append(e)),"root"===r.getAttribute("data-id")&&(r.setAttribute("data-id",n.getAttribute("data-id")),n.setAttribute("data-id","root"),a.$.itemsContainer=n),u(r),u(i)};if(o)switch(n){case"center":if(s instanceof i||s instanceof r)d.appendChild(l);else{const i=a.createLayoutItem("tabLayoutGroup","top");i.appendChild(l),s instanceof t&&!(s instanceof r)?(s.appendChild(i),u(s)):s instanceof e&&(c=a.createLayoutItem("layoutGroup"),s.parentElement.insertBefore(c,s),c.appendChild(s),c.appendChild(i),u(c))}break;case"left":case"right":{const e=a.createLayoutItem("tabLayoutGroup","top");e.appendChild(l),"root"===s.getAttribute("data-id")?(e.position=n,m(e,n)):m(e,n)}break;case"top":case"bottom":{const e=a.createLayoutItem("tabLayoutGroup","top");e.appendChild(l),"root"===s.getAttribute("data-id")?(e.position=n,m(e,n)):m(e,n);break}}else{switch(n){case"center":s instanceof i||s instanceof r?d.appendChild(l):p();break;case"left":case"right":if(s instanceof i){const e=s.querySelector("smart-tab-layout-item");e&&"left"===n?s.insertBefore(l,e):s.appendChild(l)}else if(s instanceof r){const e=a.createLayoutItem("tabLayoutGroup","top"),t=s.parentElement;e.appendChild(l),c=a.createLayoutItem("layoutGroup"),t.parentElement.insertBefore(c,t),"right"===n?(c.appendChild(t),c.appendChild(e)):"left"===n&&(c.appendChild(e),c.appendChild(t))}else if(o){const i=a.createLayoutItem("tabLayoutGroup","top");i.appendChild(l),s instanceof t?s.insertBefore(s.firstChild,i):s instanceof e&&(c=a.createLayoutItem("layoutGroup"),c.orientation=d.orientation,c.setAttribute("orientation",d.orientation),s.removeAttribute("size"),s.parentElement.insertBefore(c,s),c.appendChild(s),c.appendChild(i))}else p(n);break;case"top":case"bottom":s instanceof i?(c=a.createLayoutItem("layoutGroup","top"),s.removeAttribute("size"),s.parentElement.insertBefore(c,s),"top"===n?(c.appendChild(a.createLayoutItem()),c.appendChild(s)):(c.appendChild(s),c.appendChild(a.createLayoutItem()))):p(n)}a.refresh()}}_addLayoutItem(s,n,o){const a=this;if(!s)return;const l=e=>{for(let t=0;t<e.children.length;t++){e.children[t].removeAttribute("size")}e.removeAttribute("size")};if(s instanceof r||s instanceof i||o&&o instanceof r)return a._addTabLayoutItem(s,n,o);const d=a.createLayoutItem(),c=s.closest(".smart-layout-group");let u;if(o&&a.moveChildren(o,d),"center"===n){if(s instanceof t)return u=c,u.appendChild(d),l(u),a.refresh(),d;if(s instanceof e)return u=a.createLayoutItem("layoutGroup"),u.orientation=c.orientation,u.setAttribute("orientation",c.orientation),s.removeAttribute("size"),s.parentElement.insertBefore(u,s),u.appendChild(s),u.appendChild(d),a.refresh(),u}if("vertical"===c.orientation&&("left"===n||"right"===n)||"horizontal"===c.orientation&&("top"===n||"bottom"===n))if(u=c,s instanceof t)"left"===n||"top"===n?u.insertBefore(d,u.children[0]):u.appendChild(d),l(s);else{const e=u.items,t=Math.max(0,e.indexOf(s)+("top"===n||"left"===n?0:1));u.insertBefore(d,e[t]),l(u)}else if(s instanceof t){const e=s.parentElement,t=s,i=a.createLayoutItem("layoutGroup",n);e.insertBefore(i,t),"top"===n||"left"===n?(i.append(d),i.appendChild(t)):(i.appendChild(t),i.append(d)),"root"===t.getAttribute("data-id")&&(t.setAttribute("data-id",i.getAttribute("data-id")),i.setAttribute("data-id","root"),a.$.itemsContainer=i),l(e)}else u=a.createLayoutItem("layoutGroup",n),c.insertBefore(u,s),"top"===n||"left"===n?(u.appendChild(d),u.appendChild(s)):(u.appendChild(s),u.appendChild(d)),l(u);return a.refresh(),d}_handleButtonsVisibility(e){const t=this;if(t._buttons||(t._buttons=document.createElement("div"),t._buttons.classList.add("smart-layout-buttons-container"),t._buttons.innerHTML='<div role="button" position="top"></div>\n <div role="button" position="bottom"></div>\n <div role="button" position="center"></div>\n <div role="button" position="left"></div>\n <div role="button" position="right"></div>'),e||!t._buttons.parentElement){if(e){const i=e._buttonPosition||[],r=t._buttons.children;for(let t=0;t<r.length;t++){const s=r[t];s.position=s.getAttribute("position"),s.item=e,i.length&&i.indexOf(s.getAttribute("position"))<0?s.classList.add("smart-hidden"):s.classList.remove("smart-hidden"),s.onmouseenter=()=>{s.setAttribute("hover","")},s.onmouseleave=()=>{s.removeAttribute("hover")}}t.allowLiveSplit&&t._buttons.parentElement!==e&&e.appendChild(t._buttons)}}else t._buttons.parentElement.removeChild(t._buttons)}_handleDropArea(e,t="center"){const i=this,r=e=>{switch(e){case"left":i._dropArea.style.top="0px",i._dropArea.style.left="0px",i._dropArea.style.width="50%",i._dropArea.style.height="100%";break;case"right":i._dropArea.style.top="0px",i._dropArea.style.left="calc(100% - 50%)",i._dropArea.style.width="50%",i._dropArea.style.height="100%";break;case"top":i._dropArea.style.top="0px",i._dropArea.style.left="0px",i._dropArea.style.width="100%",i._dropArea.style.height="50%";break;case"bottom":i._dropArea.style.top="calc(100% - 50%)",i._dropArea.style.left="0px",i._dropArea.style.width="100%",i._dropArea.style.height="50%";break;case"center":i._dropArea.style.top="0px",i._dropArea.style.left="0px",i._dropArea.style.width="100%",i._dropArea.style.height="100%"}};i._dropArea&&i._dropArea.parentElement===e?r(t):(i._dropArea&&i._dropArea.remove(),i._dragDetails&&e&&(i._dropArea=document.createElement("div"),i._dropArea.classList.add("smart-layout-drop-area"),e.appendChild(i._dropArea),i._dropArea.style.opacity=1,r(t)))}_handleSplitter(e){const t=this;if(!e)return;if(e.hasAttribute("tab")&&(e=e.parentElement),e._splitter&&e._splitter.remove(),e._splitter||(e._splitter=document.createElement("div")),t._dragDetails&&t._dragDetails.dragging)return void e._splitter.remove();if(-1===e.modifiers.indexOf("resize"))return;e.appendChild(e._splitter);const i=e.parentElement;if(i){e._splitter.className="smart-layout-splitter",e._splitter.item=e,e._splitter.removeAttribute("drag");const r=i.orientation;e.nextElementSibling&&e.nextElementSibling.hasAttribute("data-id")?e._splitter.classList.add(r):e.previousElementSibling&&e.previousElementSibling.hasAttribute("data-id")&&(e._splitter.classList.add(r),e._splitter.classList.add("last"));(e=>{e.style.top="",e.style.left="",e.style.bottom="",e.style.right="",e.onpointerdown=e=>{const i=e.target.item;i.style.overflow="hidden",t._resizeDetails={splitter:e.target,splitterRect:e.target.getBoundingClientRect(),itemRect:i.getBoundingClientRect(),item:i,itemSize:i.size,group:i.parentElement,clientX:e.clientX,clientY:e.clientY},t._selectedItem!==i&&(t.querySelectorAll("[data-id]").forEach((e=>e.removeAttribute("selected"))),t.selectedIndex=i.getAttribute("index"),i.setAttribute("selected",""),t._selectedItem=i,t._handleButtonsVisibility(i)),i.previousElementSibling&&i.previousElementSibling.hasAttribute("data-id")?(t._resizeDetails.previousItemRect=i.previousElementSibling.getBoundingClientRect(),t._resizeDetails.previousItem=i.previousElementSibling,t._resizeDetails.previousItemSize=i.previousElementSibling.size,t._resizeDetails.previousItem.style.overflow="hidden"):(t._resizeDetails.previousItemRect=null,t._resizeDetails.previousItem=null),i.nextElementSibling&&i.nextElementSibling.hasAttribute("data-id")?(t._resizeDetails.nextItemRect=i.nextElementSibling.getBoundingClientRect(),t._resizeDetails.nextItem=i.nextElementSibling,t._resizeDetails.nextItemSize=i.nextElementSibling.size,t._resizeDetails.nextItem.style.overflow="hidden"):(t._resizeDetails.nextItemRect=null,t._resizeDetails.nextItem=null)}})(e._splitter)}}})})();
|
|
68
68
|
Smart("smart-list-menu",class extends Smart.Menu{static get properties(){return{displayLoadingIndicator:{value:!1,type:"boolean"},dropDownPosition:{value:"auto",allowedValues:["top-left","top-right","bottom-left","bottom-right","auto"],type:"string"},enableMouseWheelAction:{value:!0,type:"boolean"},filterable:{value:!1,type:"boolean"},filterInputPlaceholder:{value:"",type:"string"},filterMember:{value:"label",type:"string"},filterMode:{value:"containsIgnoreCase",allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string"},grouped:{value:!1,type:"boolean"},loadingIndicatorPlaceholder:{value:"Loading...",type:"string"},loadingIndicatorPosition:{value:"center",allowedValues:["bottom","center","top"],type:"string"},scrollMode:{value:"scrollButtons",allowedValues:["scrollbar","scrollButtons"],type:"string"}}}static get listeners(){return{resize:"_resizeHandler","backButton.click":"_backButtonClickHandler","filterInput.keyup":"_filterInputKeyupHandler","mainContainer.down":"_mainContainerDownHandler","mainContainer.move":"_mainContainerMoveHandler","mainContainer.swipeleft":"_mainContainerSwipeHandler","mainContainer.swiperight":"_mainContainerSwipeHandler","mainContainer.touchmove":"_mainContainerTouchmoveHandler","mainContainer.touchstart":"_mainContainerTouchstartHandler","view.click":"_viewHandler","view.mouseout":"_viewHandler","view.mouseover":"_viewHandler","view.transitionend":"_viewHandler"}}static get styleUrls(){return["smart.listmenu.css"]}template(){return`<div id="container" role="presentation">\n <div id="hamburgerIcon" class="smart-hamburger-icon smart-hidden" role="button" aria-label="Toggle minimized menu" aria-haspopup="true">\n <div id="hamburgerIconLineTop" class="smart-hamburger-icon-line smart-hamburger-icon-line-top" role="presentation"></div>\n <div id="hamburgerIconLineCenter" class="smart-hamburger-icon-line smart-hamburger-icon-line-center" role="presentation"></div>\n <div id="hamburgerIconLineBottom" class="smart-hamburger-icon-line smart-hamburger-icon-line-bottom" role="presentation"></div>\n <div id="customIconContainer" class="smart-hamburger-icon-custom-container smart-hidden" role="presentation"></div>\n </div>\n <div id="view" class="smart-list-menu-view" role="presentation">\n <div id="header" class="smart-header smart-hidden" role="heading" aria-level="1">\n <smart-button id="backButton" animation="[[animation]]" disabled="[[disabled]]" unfocusable right-to-left="[[rightToLeft]]" aria-label="Back">\n <div id="backButtonArrow" class="smart-arrow ${this.rightToLeft?"smart-arrow-right":"smart-arrow-left"}" aria-hidden="true"></div>\n </smart-button>\n <div id="title" class="smart-title"></div>\n </div>\n <div class="smart-list-menu-filter-input-container smart-hidden" id="filterInputContainer" role="presentation"><input id="filterInput" class="smart-filter-input" disabled="[[disabled]]" placeholder="[[filterInputPlaceholder]]" type="text" role="searchbox" aria-label="[[filterInputPlaceholder]]" /></div>\n <smart-repeat-button id="scrollButtonNear" class="smart-menu-scroll-button smart-spin-button smart-scroll-button-near smart-hidden" animation="[[animation]]" unfocusable aria-label="Scroll up">\n <div id="arrowNear" class="smart-arrow smart-arrow-up" right-to-left="[[rightToLeft]]"></div>\n </smart-repeat-button>\n <smart-scroll-viewer id="mainContainer" class="smart-menu-main-container" horizontal-scroll-bar-visibility="hidden" right-to-left="[[rightToLeft]]" role="presentation">\n <content></content>\n </smart-scroll-viewer>\n <smart-repeat-button id="scrollButtonFar" class="smart-menu-scroll-button smart-spin-button smart-scroll-button-far smart-hidden" animation="[[animation]]" unfocusable right-to-left="[[rightToLeft]]" aria-label="Scroll down">\n <div id="arrowFar" class="smart-arrow smart-arrow-down"></div>\n </smart-repeat-button>\n <div id="loadingIndicatorContainer" class="smart-loader-container smart-hidden" role="presentation">\n <span id="loadingIndicator" class="smart-loader" role="img" aria-label="[[loadingIndicatorPlaceholder]]"></span>\n <span id="loadingIndicatorPlaceHolder" class="smart-loader-label smart-hidden">[[loadingIndicatorPlaceholder]]</span>\n </div>\n </div>\n </div>`}attached(){const e=this;super.attached(),e.isCompleted&&null!==e.dropDownAppendTo&&e._minimized&&e._dropDownParent.appendChild(e.$.view)}detached(){const e=this;super.detached(),e._close(),null!==e.dropDownAppendTo&&e._minimized&&e._dropDownParent.removeChild(e.$.view)}addItem(e,t){const i=this;if(!(e instanceof Smart.MenuItem||e instanceof Smart.MenuItemsGroup))return;let r,n,o,a;if(void 0===t)r=void 0,n=1,o=t=i.$.mainContainer,a=i._topLevelFilter;else{if("string"==typeof t&&(t=i.getItem(t)),void 0===t||!(t instanceof Smart.MenuItemsGroup)||!i.contains(t)&&t.closest(".smart-list-menu-view")!==i.$.view)return;r=t,n=t.level+1,o=t.itemContainer,a=t.filter}if(i._createItemHTMLStructure(e,n,t,i._getCurrentViewItems(r).length,0),e instanceof Smart.MenuItemsGroup&&i._processHTML(e,n+1),i._view!==t&&!t.$.hasClass("smart-hidden")&&t.offsetHeight>0&&t.offsetWidth>0&&(!i._view&&!i.$.mainContainer.contains(t)||i._view&&!i._view.contains(t))&&e.$.addClass("smart-hidden"),i.grouped){let e;e=o instanceof Smart.ScrollViewer&&o.isRendered?Array.from(o.$.scrollViewerContentContainer.children):Array.from(o.children);for(let t=e.length-1;t>=0;t--)e[t].$.hasClass("smart-list-menu-group-label")&&o.removeChild(e[t]);i._unsortItems(t,!0)}if(o.appendChild(e),i.grouped){const e=i._view;i._applyGrouping(t,!0),i._home(),e&&i.changePage(e.path)}i.filterable&&void 0!==a&&""!==a&&null===i._findItem(e,a)&&(e.$.addClass("smart-hidden"),e.hidden=!0),i._toggleFilterInputGroupLabelVisibility(),i._checkOverflow()}back(e){const t=this,i=t.animation,r=!1===e&&"none"!==i;r&&(t.animation="none"),t._backButtonClickHandler(),r&&(t.animation=i)}changePage(e){const t=this,i=t.getItem(e);if(void 0===i||i instanceof Smart.MenuItem||i.hidden)return;const r=[i];let n=i.parentItem,o=0;for(t._discardKeyboardHover();n;)r.unshift(n),n=n.parentItem;if(t._view){const e=r.indexOf(t._view);-1===e?t._home():o=e+1}for(let e=o;e<r.length&&!r[e].disabled&&!r[e].hidden;e++)t._menuItemsGroupSelectionHandler(r[e],{type:"expand"},!0)}maximize(){const e=this;if(e._minimized){if(e._positionDetection.removeOverlay(),e._minimized=!1,e._minimizedDropDownOpened&&(e.$hamburgerIcon.removeClass("smart-close-button"),e._minimizedDropDownOpened=!1),null!==e.dropDownAppendTo&&e._appendMinimizedContainerToMenu(e.$.view,null),e.$view.removeClass("smart-visibility-hidden"),e.$view.removeClass("smart-list-menu-view-minimized"),e.$hamburgerIcon.addClass("smart-hidden"),e.removeAttribute("minimized"),e.enableShadowDOM){e.$.view.id=e.$.view.getAttribute("smart-id");const t=e.$.view.querySelectorAll("[smart-id]");for(let e=0;e<t.length;e++)t[e].id=t[e].getAttribute("smart-id")}e.$.mainContainer.scrollTop=0,e._checkOverflow(),e.$.hamburgerIcon.removeAttribute("aria-expanded"),e.$.hamburgerIcon.removeAttribute("aria-owns"),e.$.view.setAttribute("role","presentation"),e.$.view.removeAttribute("aria-orientation"),e.setAttribute("role","menu")}}minimize(){const e=this;if(!e._minimized){if(e.$view.addClass("smart-visibility-hidden"),e.enableShadowDOM){e.$.view.removeAttribute("id");const t=e.$.view.querySelectorAll("[smart-id]");for(let e=0;e<t.length;e++)t[e].removeAttribute("id")}e._edgeMacFF&&e.$view.addClass("not-in-view"),e.$hamburgerIcon.removeClass("smart-hidden"),setTimeout((function(){null!==e.dropDownAppendTo&&e._appendMinimizedContainerToExternalElement(e.$.view),e.$view.addClass("smart-list-menu-view-minimized"),e.$.mainContainer.scrollTop=0,e._checkOverflow()}),0),e._minimized=!0,e.setAttribute("minimized",""),e.setAttribute("role","presentation"),e.removeAttribute("aria-orientation"),e.$.hamburgerIcon.setAttribute("aria-expanded",!1),e.$.hamburgerIcon.setAttribute("aria-owns",e.$.view.id),e.$.view.setAttribute("role","menu"),e.$.view.setAttribute("aria-orientation","vertical")}}removeItem(e){const t=this;if("string"==typeof e&&(e=t.getItem(e)),void 0===e||!(e instanceof Smart.MenuItem||e instanceof Smart.MenuItemsGroup)||!t.contains(e)&&e.closest(".smart-list-menu-view")!==t.$.view)return;const i=e.parentElement;for(;e.contains(t._view);)t._backButtonClickHandler(void 0,!0);const r=t._view;t.grouped&&(t._home(),t._discardGrouping()),i.removeChild(e),t._menuItems={},t._refreshItemPaths(t.$.mainContainer,!0,(function(e){return t._getCurrentViewItems(e===t.$.mainContainer?void 0:e)})),t.grouped&&(t._applyGrouping(t.$.mainContainer),r&&t.changePage(r.path)),t._toggleFilterInputGroupLabelVisibility(),t._checkOverflow()}propertyChangedHandler(e,t,i){if("disabled"===e||"dropDownOverlay"===e||"minimizeIconTemplate"===e||"minimizeWidth"===e||"unfocusable"===e)return void super.propertyChangedHandler(e,t,i);const r=this;switch(e){case"animation":r.$.view.setAttribute("animation",i);break;case"checkable":case"checkboxes":r._minimized&&null!==r.dropDownAppendTo&&(i?r.$.view.setAttribute(e,""):r.$.view.removeAttribute(e));break;case"checkMode":{const e=r.$.mainContainer;r._changeToRadioButtonMode(i,e.isRendered?e.$.scrollViewerContentContainer:e),r._minimized&&null!==r.dropDownAppendTo&&r.$.view.setAttribute("check-mode",i);break}case"dataSource":{r.$header.addClass("smart-hidden"),r.$mainContainer.removeClass("header-shown"),r._view=void 0;const e=r.querySelectorAll("smart-menu-items-group");e.length>0&&e.forEach((e=>{e.remove()})),r._menuItems={},r._topLevelFilter="",r._processDataSource(),r._toggleFilterInputGroupLabelVisibility(),r._checkOverflow();break}case"displayLoadingIndicator":if(i){const e=r.$.mainContainer.querySelector("[hover]");e&&e.removeAttribute("hover"),r._discardKeyboardHover(),r.$loadingIndicatorContainer.removeClass("smart-hidden")}else r.$loadingIndicatorContainer.addClass("smart-hidden");break;case"dropDownAppendTo":{const e=r._dropDownParent;if(r._positionDetection.getDropDownParent(),r._dropDownParent===e||!r._minimized)return;r._close(),null===i?r._appendMinimizedContainerToMenu(r.$.view,null):r._appendMinimizedContainerToExternalElement(r.$.view),r.$.mainContainer.scrollTop=0,r._checkOverflow();break}case"dropDownPosition":r._close(),r._minimized&&null!==r.dropDownAppendTo&&r.$.view.setAttribute("drop-down-position",i);break;case"filterable":if(r._toggleFilterInputGroupLabelVisibility(!0),!1===i){""!==r._topLevelFilter&&r._applyFilter("");for(let e=r._filteredLowerLevelGroups.length-1;e>=0;e--)r._applyFilter("",r._filteredLowerLevelGroups[e])}r._checkOverflow();break;case"filterMode":if(!r.filterable)return;""!==r._topLevelFilter&&r._applyFilter(r._topLevelFilter);for(let e=r._filteredLowerLevelGroups.length-1;e>=0;e--)r._applyFilter(r._filteredLowerLevelGroups[e].filter,r._filteredLowerLevelGroups[e]);break;case"grouped":r._home(),i?r._applyGrouping(r.$.mainContainer):r._discardGrouping(),r._toggleFilterInputGroupLabelVisibility(!1,!0),r._checkOverflow();break;case"loadingIndicatorPosition":null!==r.dropDownAppendTo&&r._minimized&&r.$.view.setAttribute("loading-indicator-position",i),"center"===i?r.$loadingIndicatorPlaceHolder.addClass("smart-hidden"):r.$loadingIndicatorPlaceHolder.removeClass("smart-hidden");break;case"overflow":r.$.mainContainer.verticalScrollBarVisibility="scroll"===i?"visible":i,r._handleOverflowChange();break;case"rightToLeft":i?(r.$backButtonArrow.removeClass("smart-arrow-left"),r.$backButtonArrow.addClass("smart-arrow-right")):(r.$backButtonArrow.removeClass("smart-arrow-right"),r.$backButtonArrow.addClass("smart-arrow-left")),i?r.$.view.setAttribute("right-to-left",""):r.$.view.removeAttribute("right-to-left"),Array.prototype.forEach.call(r.$.mainContainer.querySelectorAll(".smart-menu-items-group-arrow"),(e=>e.className="smart-menu-items-group-arrow "+(r.rightToLeft?"smart-arrow-left left":"smart-arrow-right right")));break;case"scrollMode":r.$.mainContainer.verticalScrollBarVisibility="scrollButtons"===i?"hidden":"scroll"===r.overflow?"visible":r.overflow,r._checkOverflow();break;case"theme":super.propertyChangedHandler(e,t,i),null!==r.dropDownAppendTo&&r._minimized&&(""!==t&&r.$view.removeClass(t),i&&r.$view.addClass(i))}}_appendGroupLabels(e,t){for(let i=0;i<e.length;i++){const r=document.createElement("div");r.$=Smart.Utilities.Extend(r),r.className="smart-list-menu-group-label",r.setAttribute("role","heading"),r.setAttribute("aria-level",1),r.innerHTML=e[i],r.groupChildren=t[i],t[i][0].parentElement.insertBefore(r,t[i][0]);for(let e=0;e<t[i].length;e++)t[i][e].groupLabel=r}}_applyFilter(e,t){const i=this,r=i._getCurrentViewItems(t);for(let n=0;n<r.length;n++){const o=i._findItem(r[n],e);o&&o.hidden?(o.hidden=!1,(t===i._view||void 0!==i._view&&void 0!==t&&!t.contains(i._view)||void 0===i._view)&&o.$.removeClass("smart-hidden")):o||(r[n].hidden=!0,r[n].$.addClass("smart-hidden"))}if(t){t.filter=e;const r=i._filteredLowerLevelGroups.indexOf(t);""===e?-1!==r&&i._filteredLowerLevelGroups.splice(r,1):-1===r&&i._filteredLowerLevelGroups.push(t)}else i._topLevelFilter=e}_backButtonClickHandler(e,t){const i=this,r=i._view;if(e&&e.stopPropagation(),!r||i.disabled&&e||i.displayLoadingIndicator||i._inTransition)return;let n=i.hasAnimation,o=i.animation,a=!1;n&&t&&(n=!1,a=!0,i.animation="none"),i._discardKeyboardHover(),i.$scrollButtonNear.addClass("smart-hidden"),i.$scrollButtonFar.addClass("smart-hidden"),i.$mainContainer.removeClass("scroll-buttons-shown"),r.firstElementChild.classList.remove("smart-hidden"),n?(i._inTransition=!0,r.container.$.addClass("no-transition"),r.container.$.addClass("smart-hidden"),r.$.addClass("right"),r.$.removeClass("right"),r.container.$.removeClass("no-transition")):(r.$.removeClass("smart-menu-items-group-opened"),r.container.$.addClass("smart-hidden")),i._showHideMenuItemsGroupSiblings(r,"removeClass",n),n?setTimeout((function(){r.container.style.top=r.parentElement.getBoundingClientRect().top-r.getBoundingClientRect().top+"px"}),0):a&&(i.animation=o),1===r.level?(i.$header.addClass("smart-hidden"),i.$mainContainer.removeClass("header-shown"),i._view=void 0):(i.$.title.innerHTML=r.parentItem.titleLabel,i._view=r.parentItem),i._toggleFilterInputGroupLabelVisibility(),i.$.mainContainer.scrollTop=0,n||i._checkOverflow(),e&&i.focus()}_bounceBottom(e){const t=this,i=t.$.mainContainer;function r(){i.scrollTop-=5,i.scrollTop>e?window.requestAnimationFrame(r):t.$mainContainer.removeClass("bounce-bottom")}t.$mainContainer.addClass("bounce-bottom"),window.requestAnimationFrame((function e(){i.scrollTop+=5,i.scrollTop!==i.scrollHeight-i.offsetHeight?window.requestAnimationFrame(e):window.requestAnimationFrame(r)}))}_bounceTop(){const e=this,t=e.$.mainContainer;function i(){t.scrollTop+=5,50!==t.scrollTop?window.requestAnimationFrame(i):(t.scrollTop=0,e.$mainContainer.removeClass("bounce-top"))}e.$mainContainer.addClass("bounce-top"),window.requestAnimationFrame((function e(){t.scrollTop-=5,t.scrollTop>0?window.requestAnimationFrame(e):window.requestAnimationFrame(i)}))}_checkOverflow(){const e=this,t=e.overflow,i=e.$.mainContainer,r=i instanceof Smart.ScrollViewer?i.$.content:i;if(r){if("hidden"!==t&&"scrollButtons"===e.scrollMode){const n=Math.round(r.scrollHeight)>Math.round(i.offsetHeight),o=Math.round(i.scrollTop)>0,a=Math.round(i.offsetHeight+i.scrollTop)<Math.round(r.scrollHeight);e.$.mainContainer.verticalScrollBarVisibility="hidden",n?"auto"===t?(e.$mainContainer.hasClass("scroll-buttons-shown")||e.$mainContainer.addClass("scroll-buttons-shown"),o?e.$scrollButtonNear.removeClass("smart-hidden"):e.$scrollButtonNear.addClass("smart-hidden"),a?e.$scrollButtonFar.removeClass("smart-hidden"):e.$scrollButtonFar.addClass("smart-hidden"),!1===(o&&a)?e.$mainContainer.addClass("one-button-shown"):e.$mainContainer.removeClass("one-button-shown"),e.disabled||(e.$.scrollButtonNear.disabled=!1,e.$.scrollButtonFar.disabled=!1)):(e.$scrollButtonNear.removeClass("smart-hidden"),e.$scrollButtonFar.removeClass("smart-hidden"),e.disabled?(e.$.scrollButtonNear.disabled=!0,e.$.scrollButtonFar.disabled=!0):(e.$.scrollButtonNear.disabled=!o,e.$.scrollButtonFar.disabled=!a)):!n&&"auto"===t&&e.$mainContainer.hasClass("scroll-buttons-shown")?(e.$mainContainer.removeClass("scroll-buttons-shown"),e.$mainContainer.removeClass("one-button-shown"),e.$scrollButtonNear.addClass("smart-hidden"),e.$scrollButtonFar.addClass("smart-hidden")):n||"scroll"!==t||(e.$.scrollButtonNear.disabled=!0,e.$.scrollButtonFar.disabled=!0)}else"scrollbar"===e.scrollMode&&(e.$mainContainer.removeClass("scroll-buttons-shown"),e.$mainContainer.removeClass("one-button-shown"),e.$scrollButtonNear.addClass("smart-hidden"),e.$scrollButtonFar.addClass("smart-hidden"));i.refresh()}}_updateScrollButtonVisibility(e,t,i){const r=this,n=r.overflow,o=r.$.mainContainer,a=e===r.$.mainContainer,s=a?o.$.content:e;if(a&&"hidden"===n)return void o.refresh();let l,d,c,m=!0,u=!0;if(t?(l="scrollLeft",d="offsetWidth",c="scrollWidth"):(l="scrollTop",d="offsetHeight",c="scrollHeight"),0===Math.round(e[l])&&(m=!1),Math.round(e[d]+e[l])>=Math.round(s[c])&&(u=!1),a&&"auto"!==n)"scroll"!==n||r.disabled||(i[0].disabled=!m,i[1].disabled=!u);else{if(m&&u)return i[0].$.removeClass("smart-hidden"),i[1].$.removeClass("smart-hidden"),e.classList.remove("one-button-shown"),void o.refresh();m?i[0].$.removeClass("smart-hidden"):i[0].$.addClass("smart-hidden"),u?i[1].$.removeClass("smart-hidden"):i[1].$.addClass("smart-hidden"),e.classList.add("one-button-shown")}o.refresh()}_close(){const e=this;e._discardKeyboardHover(!0),e._minimized&&e._minimizedDropDownOpened&&(e._positionDetection.removeOverlay(),e.$view.addClass("smart-visibility-hidden"),e._edgeMacFF&&(e.$.view.style.left="",e.$.view.style.top="",e.$view.addClass("not-in-view")),e.$hamburgerIcon.removeClass("smart-close-button"),e._minimizedDropDownOpened=!1,e.$.hamburgerIcon.setAttribute("aria-expanded",!1))}_createElement(){const e=this,t=e.$.mainContainer;e.$.title.id||(e.$.title.id=e.id+"Title"),e.$.view.id||(e.$.view.id=e.id+"View"),e.setAttribute("role","menu"),e.setAttribute("aria-labelledby",e.$.title.id),e.setAttribute("aria-orientation","vertical"),e.$.header.setAttribute("aria-labelledby",e.$.title.id),e.mode="vertical",t.verticalScrollBarVisibility="scroll"===e.overflow?"visible":e.overflow,t.refresh=e._scrollViewerRefresh,t._mouseWheelHandler=e._mouseWheelHandler.bind(e),t.onVerticalChange=()=>{"scrollButtons"===e.scrollMode&&e._updateScrollButtonVisibility(t,!1,[e.$.scrollButtonNear,e.$.scrollButtonFar]),t.scrollTop===t.scrollHeight&&e.$.fireEvent("scrollBottomReached")},e._positionDetection=new Smart.Utilities.PositionDetection(e),e._positionDetection.getDropDownParent(),null===e.dataSource&&e.$.mainContainer.firstElementChild instanceof HTMLUListElement&&e._processUList();const i=e.getElementsByTagName("smart-menu-item"),r=function(){e._setFocusable(),e._menuItems={},e._topLevelFilter="",e._filteredLowerLevelGroups=[],e.$.view.setAttribute("animation",e.animation),null===e.dataSource?e._processHTML(void 0,1):e._processDataSource(),e._toggleFilterInputGroupLabelVisibility(),"scroll"===e.overflow&&(e.$mainContainer.addClass("scroll-buttons-shown"),e.$scrollButtonNear.removeClass("smart-hidden"),e.$scrollButtonFar.removeClass("smart-hidden"),e._updateScrollButtonVisibility(e.$.mainContainer,!1,[e.$.scrollButtonNear,e.$.scrollButtonFar])),e._applyMinimizeIconTemplate(e.minimizeIconTemplate,null),null!==e.minimizeWidth&&e.offsetWidth<=e.minimizeWidth?e.minimize():e._checkOverflow(),e.displayLoadingIndicator&&e.$loadingIndicatorContainer.removeClass("smart-hidden"),"center"!==e.loadingIndicatorPosition&&e.$loadingIndicatorPlaceHolder.removeClass("smart-hidden"),e.__onCompleted&&(e._onCompleted=e.__onCompleted,e.__onCompleted=null,e._onCompleted())};0===i.length?r():(e._onCompleted&&(e.__onCompleted=e._onCompleted,e._onCompleted=null),e._ensureItemsReady(i,r))}_createMenuItemsGroupContainer(e,t){const i=document.createElement("div"),r=document.createElement("div");return i.className="smart-menu-drop-down smart-hidden",i.$=Smart.Utilities.Extend(i),i.level=t,i.setAttribute("level",t),i.setAttribute("role","menu"),i.menuItemsGroup=e,r.className="smart-menu-item-container",r.$=Smart.Utilities.Extend(r),r.container=i,r.menuItemsGroup=e,e.checkable&&r.setAttribute("checkable",""),r.setAttribute("check-mode",e.checkMode),i.itemContainer=r,i.appendChild(r),i}_discardGrouping(){const e=this,t=Array.from(e.$.view.getElementsByClassName("smart-list-menu-group-label"));for(let e=0;e<t.length;e++){let i=t[e];i.parentElement.removeChild(i)}e._unsortItems(e.$.mainContainer)}_discardKeyboardHover(){const e=this;e._focusedViaKeyboard&&(e._focusedViaKeyboard===e.$.backButton?(e.$.backButton.removeAttribute("hover"),e.$.backButton.$.button.removeAttribute("hover")):(e._focusedViaKeyboard.removeAttribute("focus"),e._focusedViaKeyboard.removeAttribute("hover")),e._focusedViaKeyboard=void 0)}_documentUpHandler(e){const t=this,i=e.originalEvent.target,r=e=>{"right"===e&&!t.rightToLeft||"left"===e&&t.rightToLeft?t._backButtonClickHandler():t._swipeDetails.target&&t._selectionHandler({target:t._swipeDetails.target},t._swipeDetails.target,!0)};if(delete t._dragStartDetails,t._swipeDetails){const i="pointercancel"===e.originalEvent.type;return"left"===t._swipeDetails.direction?(i||t._swipeDetails.start>e.pageX&&t._swipeDetails.start-e.pageX>t.offsetWidth/4)&&r(t._swipeDetails.direction):(i||t._swipeDetails.start<e.pageX&&e.pageX-t._swipeDetails.start>t.offsetWidth/4)&&r(t._swipeDetails.direction),void delete t._swipeDetails}i===t.$.filterInput||t.disabled||t.displayLoadingIndicator||!i.closest||(t.contains(i)||i.closest(".smart-list-menu-view")===t.$.view?!t.contains(i)&&i.closest(".smart-list-menu-view")!==t.$.view||t===document.activeElement||t.focus():t._close())}_ensureVisible(e){const t=this,i=t.$.mainContainer;if(!i.$.hasClass("scroll-buttons-shown")&&"hidden"!==t.overflow)return;const r=i.getBoundingClientRect(),n=e.getBoundingClientRect(),o=[t.$.scrollButtonNear,t.$.scrollButtonFar],a=i.scrollTop;(r.top>n.top||r.bottom<n.bottom)&&(i.scrollTop=e.offsetTop,t._updateScrollButtonVisibility(i,!1,o)),t._fireScrollBottomReachedEvent(a)}_fireScrollBottomReachedEvent(e){const t=this.$.mainContainer,i=t.scrollTop;e!==i&&i===t.scrollHeight-t.offsetHeight&&this.$.fireEvent("scrollBottomReached")}_getCurrentViewItems(e){const t=this;let i;if(void 0===e&&(i=t.$.mainContainer,i instanceof Smart.ScrollViewer&&(i=i.isRendered?i.$.scrollViewerContentContainer:i)),t.grouped){if(void 0===e)return Array.from(i.children).filter((e=>e instanceof Smart.MenuItem||e instanceof Smart.MenuItemsGroup));{const t=e.container.firstElementChild.children,i=[];for(let e=0;e<t.length;e++){let r=t[e];(r instanceof Smart.MenuItem||r instanceof Smart.MenuItemsGroup)&&i.push(r)}return i}}return void 0===e?i.children:e.container.firstElementChild.children}_sortItems(e){const t=this;if(!t.grouped)return;const i=[],r=t.$.mainContainer,n=[];let o;e instanceof Smart.MenuItemsGroup?o=e.container.firstElementChild:e===t.$.mainContainer&&(o=r instanceof Smart.ScrollViewer?r.$.content:r);const a=Array.from(o.children);a.sort((function(e,t){return e.label.localeCompare(t.label)}));for(let e=a.length-1;e>=0;e--)o.insertBefore(a[e],o.firstElementChild);for(let e=0;e<a.length;e++){const t=a[e],r=t.label.charAt(0),o=i.indexOf(r.toUpperCase());-1===o?(i.push(r.toUpperCase()),n.push([t])):n[o].push(t)}t._appendGroupLabels(i,n)}_home(){const e=this;for(;e._view;)e._backButtonClickHandler(void 0,!0)}_keydownHandler(e){const t=this,i=e.key;if(((t.shadowRoot||t.getRootNode()).activeElement||document.activeElement)!==t||-1===["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Enter","Escape","Home"," "].indexOf(i)||t.disabled||t.displayLoadingIndicator)return;e.preventDefault();const r=t._view,n=t.$.mainContainer;let o;o=r?r.itemContainer:n.isRendered?n.$.scrollViewerContentContainer:n;const a=t.$.backButton.hasAttribute("hover")?t.$.backButton:o.querySelector("[focus]");switch(i){case"ArrowDown":t._navigate("_getNextEnabledChild",a,o);break;case"ArrowLeft":case"ArrowRight":if("ArrowLeft"===i&&!t.rightToLeft||"ArrowRight"===i&&t.rightToLeft){t._backButtonClickHandler();break}("ArrowRight"===i&&!t.rightToLeft||"ArrowLeft"===i&&t.rightToLeft)&&a&&a instanceof Smart.MenuItemsGroup&&t._menuItemsGroupSelectionHandler(a,{type:"keydown"});break;case"ArrowUp":t._navigate("_getPreviousEnabledChild",a,o);break;case"End":case"Home":{if(r&&"Home"===i)return t.$.mainContainer.scrollTop=0,t._checkOverflow(),t.$.backButton.setAttribute("hover",""),t.$.backButton.$.button.setAttribute("hover",""),t._focusedViaKeyboard=t.$.backButton,void(a&&a.removeAttribute("focus"));const e="End"===i?t._getLastEnabledChild(o):t._getFirstEnabledChild(o);if(!e||a===e)return;a&&(a===t.$.backButton?(t.$.backButton.removeAttribute("hover"),t.$.backButton.$.button.removeAttribute("hover")):a.removeAttribute("focus")),t._hoverViaKeyboard(e);break}case"Enter":t._minimized&&!t._minimizedDropDownOpened?t._hamburgerIconClickHandler(void 0,t.$.view):a&&(a===t.$.backButton?t._backButtonClickHandler():t._selectionHandler({target:a}));break;case"Escape":t._minimized&&t._minimizedDropDownOpened&&!t._view?t._close():t._backButtonClickHandler();break;case" ":a&&(a===t.$.backButton?t._backButtonClickHandler():t._toggleItem(a))}}_mainContainerDownHandler(e){const t=this;!Smart.Utilities.Core.isMobile||t.disabled||t.displayLoadingIndicator||(t._dragStartDetails={startY:e.pageY,x:e.pageX,y:e.pageY,startTime:Date.now(),target:e.originalEvent.target})}_mainContainerHandler(){}_mainContainerMoveHandler(){}_mainContainerSwipeHandler(e){const t=this;if(!Smart.Utilities.Core.isMobile||t.disabled||t.displayLoadingIndicator||Math.abs(t._dragStartDetails.startY-e.pageY)>2)return;const i=e.originalEvent.target,r=i.closest("smart-menu-item"),n=i.closest("smart-menu-items-group");if("swiperight"===e.type&&!t.rightToLeft||"swipeleft"===e.type&&t.rightToLeft){const i=r||n;i&&(delete t._dragStartDetails,t._swipeDetails={direction:e.type.replace("swipe",""),start:e.pageX,target:i})}else("swipeleft"===e.type&&!t.rightToLeft||"swiperight"===e.type&&t.rightToLeft&&n&&null===r)&&(delete t._dragStartDetails,t._swipeDetails={direction:e.type.replace("swipe",""),start:e.pageX,target:n})}_mainContainerTouchmoveHandler(){}_mainContainerTouchstartHandler(){}_getRootDetails(e,t){const i=this;if(!e)return;if(!i.enableShadowDOM)return{activeElement:e.activeElement,isInsideElement:i.contains(t.target)};let r,n;for(;e&&(!r&&e.activeElement&&(r=e.activeElement),e.host===i&&(n=!0),e!==document);)e=e.host?e.host.getRootNode():e.getRootNode();return{activeElement:r,isInsideElement:n}}_menuItemsGroupSelectionHandler(e,t,i){const r=this,n=e.container,o=n.level,a=r._getRootDetails(t.target?t.target.getRootNode():null,t);if(r._view===e)return;if(r._discardKeyboardHover(),a&&a.activeElement!==r&&null!==r.dropDownAppendTo&&"click"===t.type&&!a.isInsideElement&&r.focus(),r._inTransition)return;if("click"===t.type&&!t.target.classList.contains("smart-menu-items-group-arrow")&&r._toggleItem(e))return void r._ripple(e,t);let s=r.hasAnimation,l=r.animation,d=!1;s&&i&&(s=!1,d=!0,r.animation="none"),2===o&&(r.$header.removeClass("smart-hidden"),r.$mainContainer.addClass("header-shown")),r.$.title.innerHTML=e.titleLabel,r._view=e,r._toggleFilterInputGroupLabelVisibility(),e.removeAttribute("hover"),e.removeAttribute("focus"),e.$.addClass("smart-menu-items-group-opened"),r._showHideMenuItemsGroupSiblings(e,"addClass",s),s?(r._inTransition=!0,e.firstElementChild.classList.add("animate"),setTimeout((function(){n.style.top=e.parentElement.getBoundingClientRect().top-e.getBoundingClientRect().top+"px"}),0)):e.firstElementChild.classList.add("smart-hidden"),n.$.removeClass("smart-hidden"),d&&(r.animation=l),r.$.mainContainer.scrollTop=0,s||r._checkOverflow(),r.$.fireEvent("expand",{item:e,label:e.label,path:e.path,value:e.value})}_mouseoutMouseoverHandler(e){const t=this;if(t.disabled||t.displayLoadingIndicator)return;const i=e.target.closest("smart-menu-item")||e.target.closest("smart-menu-items-group");null===i||t._view&&i.level<=t._view.level||i.disabled||i.templateApplied||(t._discardKeyboardHover(),"mouseover"===e.type?(i.setAttribute("hover",""),t._discardKeyboardHover(!0)):i.removeAttribute("hover"))}_navigate(e,t,i){const r=this;if(!t)return void("_getNextEnabledChild"===e?r._view?(r.$.backButton.setAttribute("hover",""),r.$.backButton.$.button.setAttribute("hover",""),r._focusedViaKeyboard=r.$.backButton):r._hoverViaKeyboard(r._getFirstEnabledChild(i)):r._hoverViaKeyboard(r._getLastEnabledChild(i)));let n;if("_getNextEnabledChild"===e&&t===r.$.backButton){if(n=r._getFirstEnabledChild(i),!n)return;r.$.backButton.removeAttribute("hover"),r.$.backButton.$.button.removeAttribute("hover")}else{if("_getPreviousEnabledChild"===e&&r._view&&t===r._getFirstEnabledChild(i))return r.$.backButton.setAttribute("hover",""),r.$.backButton.$.button.setAttribute("hover",""),r._focusedViaKeyboard=r.$.backButton,void t.removeAttribute("focus");n=r[e](t)}n&&(t.removeAttribute("focus"),r._hoverViaKeyboard(n))}_processHTML(e,t){const i=this,r=i.$.mainContainer;let n,o,a;void 0===e&&(e=i.$.mainContainer),t>1&&(n=i._createMenuItemsGroupContainer(e,t),o=n.itemContainer),a=e===r?Array.from((r instanceof Smart.ScrollViewer?r.$.content:r).children):Array.from(e.children);const s=[];let l=0;for(let r=0;r<a.length;r++){if(t>1&&0===r){l++;continue}const n=a[r];n instanceof Smart.MenuItem||n instanceof Smart.MenuItemsGroup?(i._createItemHTMLStructure(n,t,e,r-l),n.checked&&(n.disabled||n.templateApplied?n.checked=!1:s.push(n)),t>1&&o.appendChild(n),n instanceof Smart.MenuItemsGroup&&i._processHTML(n,t+1)):(n.parentElement.removeChild(n),l++)}if(t>1){if(e.container=n,e.itemContainer=o,e instanceof Smart.MenuItemsGroup){const t=document.createElement("div");t.className="smart-menu-items-group-arrow "+(i.rightToLeft?"smart-arrow-left left":"smart-arrow-right right"),e.children[0].appendChild(t)}e.appendChild(n)}i._validateRadioButtonSelection(e,t,s),i._sortItems(e)}_resizeHandler(){this.refresh()}refresh(){const e=this,t=e.minimizeWidth;if(null!==t){if(!e._minimized&&e.offsetWidth<=t)return void e.minimize();if(e._minimized&&e.offsetWidth>t)return void e.maximize()}e._checkOverflow()}_scroll(e){const t=this,i=t.$.mainContainer,r=e.classList.contains("smart-scroll-button-near")?-1:1,n=i.scrollTop;i.scrollTop=i.scrollTop+10*r,"scrollbar"!==t.scrollMode&&n!==i.scrollTop&&(t._updateScrollButtonVisibility(i,!1,[t.$.scrollButtonNear,t.$.scrollButtonFar]),t._fireScrollBottomReachedEvent(n))}_selectionHandler(e,t,i){const r=this,n=e.target;if(!r.disabled&&!r.displayLoadingIndicator){if(r._swipeDetails&&!i)return delete r._dragStartDetails,void delete r._swipeDetails;if(void 0===t){if("click"===e.type){const t=n.closest("smart-repeat-button");if(t)return void r._scroll(t,e)}const i=n.closest("smart-menu-item");if(i)return i.disabled||i.templateApplied||(r._toggleItem(i)||r.$.fireEvent("itemClick",{item:i,label:i.label,value:i.value}),r._ensureVisible(i),r._ripple(i,e)),void o();if((t=n.closest("smart-menu-items-group"))&&(n===t.container||n===t.container.firstElementChild))return}t&&!t.disabled&&r._menuItemsGroupSelectionHandler(t,e)}function o(){const t=r._getRootDetails(n.getRootNode(),e);t&&t.activeElement!==r&&null!==r.dropDownAppendTo&&"click"===e.type&&!t.isInsideElement&&r.focus()}}_showHideMenuItemsGroupSiblings(e,t,i){const r=e.parentElement.children;for(let n=0;n<r.length;n++){const o=r[n];o!==e&&(o.hidden||(i?"addClass"===t?o.$.addClass("animate"):(o.$.removeClass("smart-hidden"),o.$.addClass("right"),setTimeout((function(){o.$.removeClass("right")}),0)):o.$[t]("smart-hidden")))}}_toggleFilterInputGroupLabelVisibility(e,t){const i=this,r=i._getCurrentViewItems(i._view).length;if(!0!==t){const e=!i.$filterInputContainer.hasClass("smart-hidden");i.filterable&&r>1?(e||(i.$mainContainer.addClass("filter-input-shown"),i.$filterInputContainer.removeClass("smart-hidden")),i._view?i.$.filterInput.value=i._view.filter||"":i.$.filterInput.value=i._topLevelFilter):e&&(i.$mainContainer.removeClass("filter-input-shown"),i.$filterInputContainer.addClass("smart-hidden"))}if(!e&&i.grouped&&r>0){const e=i._view?i._view.container.firstElementChild.firstElementChild.$:i.$.mainContainer.$.content.firstElementChild.$;1===r?e.addClass("smart-hidden"):e.removeClass("smart-hidden")}}_viewHandler(e){const t=this;if("transitionend"===e.type){const i=e.target;if(i===t.$.view||t.$.backButton.contains(i))return;return i.classList.contains("animate")&&(i.classList.remove("animate"),i.classList.add("smart-hidden")),i.classList.contains("smart-menu-drop-down")&&(i.style.top=""),i.classList.contains("smart-menu-items-group-opened")&&i.classList.remove("smart-menu-items-group-opened"),cancelAnimationFrame(t._refreshScroll),t._refreshScroll=requestAnimationFrame((()=>{t._checkOverflow(),cancelAnimationFrame(t._refreshScroll),delete t._refreshScroll})),void(t._inTransition=!1)}if(t._minimized&&null!==t.dropDownAppendTo)switch(e.type){case"click":t._selectionHandler(e);break;case"mouseout":case"mouseover":t._mouseoutMouseoverHandler(e)}}_mouseWheelHandler(e){let t=this;if(t.enableMouseWheelAction&&!t.disabled&&!t.displayLoadingIndicator&&(t=t.$.mainContainer,t.scrollHeight>0)){const i=t.scrollTop;if(0===i&&e.deltaY<0||i===t.scrollHeight&&e.deltaY>0)return;e.stopPropagation(),e.preventDefault(),t.scrollTo(t.scrollTop+t._getScrollCoefficient(e,t.offsetHeight))}}_scrollViewerRefresh(){const e=this;e.$.scrollViewerContentContainer&&(e.scrollWidth=0,e.scrollHeight=function(){let t;const i=e.$.scrollViewerContainer.classList.contains("hscroll");if(e.$.scrollViewerContainer.classList.remove("hscroll"),Smart.Utilities.Core.Browser.Safari){const i=e.$.scrollViewerContentContainer.getBoundingClientRect().height,r=e.$.scrollViewerContainer.getBoundingClientRect().height;t=i&&r?parseInt(i)-parseInt(r):e.$.scrollViewerContentContainer.scrollHeight-e.$.scrollViewerContainer.offsetHeight}else t=e.$.scrollViewerContentContainer.scrollHeight-e.$.scrollViewerContainer.offsetHeight;return t>0&&"hidden"!==e.verticalScrollBarVisibility||"visible"===e.verticalScrollBarVisibility?e.$.scrollViewerContainer.classList.add("vscroll"):e.$.scrollViewerContainer.classList.remove("vscroll"),i&&e.$.scrollViewerContainer.classList.add("hscroll"),t}(),e.computedVerticalScrollBarVisibility&&(e.scrollHeight+=e._scrollView.hScrollBar.offsetHeight))}});
|