UNPKG

smart-webcomponents

Version:

Web Components & Custom Elements for Professional Web Applications

377 lines 1.3 MB
/* Smart UI v22.0.10 (2025-02-10) 
Copyright (c) 2011-2024 jQWidgets. 
License: https://htmlelements.com/license/ */ //

 (function(){ if (typeof document === 'undefined') { return; } 


/* Smart UI v19.1.1 (2024-June) 
Copyright (c) 2011-2024 jQWidgets. 
License: https://htmlelements.com/license/ */


/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ 2612:
/***/ (() => {

Smart("smart-button",class extends Smart.ContentElement{static get properties(){return{value:{type:"string"},name:{type:"string"},type:{value:"button",type:"string"},clickMode:{allowedValues:["hover","press","release","pressAndRelease"],type:"string",value:"release"}}}static get styleUrls(){return["smart.button.css"]}template(){return"<button class=\"smart-button smart-unselectable\" inner-h-t-m-l='[[innerHTML]]' id='button' type='[[type]]' name='[[name]]' value='[[value]]' disabled='[[disabled]]' role=\"presentation\"></button>"}refresh(){}static get listeners(){return{"button.down":"_downHandler","button.mouseenter":"_mouseEnterHandler","button.mouseleave":"_mouseLeaveHandler","button.touchend":"_touchEndHandler","button.click":"_clickHandler","button.up":"_upHandler",up:"_upHandler","button.focus":"_focusHandler","button.blur":"_blurHandler"}}focus(){const e=this;e.$.button?e.$.button.focus():HTMLElement.prototype.focus.call(e)}blur(){const e=this;e.$.button?e.$.button.blur():HTMLElement.prototype.blur.call(e)}_upHandler(e){const t=this;if(e.stopPropagation(),t.$.setAttributeValue("active",!1),t.dataset.target){const n=document.querySelector(t.dataset.target);let a=t.dataset.toggle,r=t.dataset.arguments;const i="smart-window".toLowerCase();if(n&&n.nodeName.toLowerCase()===i&&"modal"===a&&(a="openModal"),"tab"===a||"pill"===a||"list"===a){const e=this.closest(".nav, .list-group"),a='[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]',r=!e||"UL"!==e.nodeName&&"OL"!==e.nodeName?e.children(".active"):e.querySelectorAll("li > .active");if(e){const n=e.querySelectorAll(a);for(let e=0;e<n.length;e++)n[e].classList.remove("primary");for(let e=0;e<r.length;e++)r[e].classList.remove("active");let i=t.parentNode;for(;i;){if("LI"===i.nodeName){i.classList.add("active");break}i=i.parentNode}t.classList.add("primary")}return n.parentNode.querySelectorAll(".active").forEach((e=>{e.classList.remove("active"),e.classList.add("smart-hidden")})),n.classList.add("active"),void n.classList.remove("smart-hidden")}a&&n&&!n[a]&&"collapse"===a&&(setTimeout((()=>{n.classList.contains("smart-hidden")?n.classList.remove("smart-hidden"):n.classList.add("smart-hidden")})),e.originalEvent.preventDefault()),a&&n&&!n[a]&&"dropdown"===a?(setTimeout((()=>{n.opened=!n.opened})),e.originalEvent.preventDefault()):a&&n&&n[a]&&(setTimeout((()=>{r?n[a](r):n[a]()}),50),e.originalEvent.preventDefault())}}_focusHandler(){this.$.setAttributeValue("focus",!0),this.$.fireEvent("focus")}_blurHandler(){this.$.setAttributeValue("focus",!1),this.$.fireEvent("blur")}_clickHandler(e){const t=this;("release"!==t.clickMode&&"pressAndRelease"!==t.clickMode||t.readonly)&&(e.preventDefault(),e.stopPropagation())}_downHandler(e){const t=this;if(!(t.disabled||(t.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t,e.pageX,e.pageY),t.$.setAttributeValue("active",!0),"press"!==t.clickMode&&"pressAndRelease"!==t.clickMode||t.readonly))){if(t.hasAttribute("smart-blazor"))return void t.$.dispatchEvent(new Event("click"));const n="buttons"in e?e.buttons:e.which;t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY})}}_mouseEnterHandler(e){const t=this;if(!t.readonly&&(t.$button.setAttributeValue("hover",!0),t.$.setAttributeValue("hover",!0),"hover"===t.clickMode)){const n="buttons"in e?e.buttons:e.which;if(t.hasAttribute("smart-blazor"))return void t.$.dispatchEvent(new Event("click"));t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY})}}_touchEndHandler(){const e=this;setTimeout((function(){e.$button.setAttributeValue("hover",!1),e.$.setAttributeValue("hover",!1)}),300)}_mouseLeaveHandler(){this.$button.setAttributeValue("hover",!1),this.$.setAttributeValue("hover",!1)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const a=this;"disabled"===e?(a._setFocusable(),a.$button&&a.$button.setAttributeValue("hover",!1),a.$.setAttributeValue("hover",!1),a instanceof Smart.RepeatButton&&a._stopRepeat()):"unfocusable"===e&&a._setFocusable()}_setFocusable(){const e=this,t=e.$.button?e.$.button:e;if(e.disabled||e.unfocusable)return t.removeAttribute("tabindex"),void(t.tabIndex=-1);t.tabIndex=e.tabIndex>0?e.tabIndex:0}ready(){const e=this;super.ready(),e.setAttribute("role","button"),e._setFocusable(),e.enableShadowDOM&&e.$.hiddenInput&&e.appendChild(e.$.hiddenInput)}}),Smart("smart-repeat-button",class extends Smart.Button{static get properties(){return{delay:{value:50,type:"number"},initialDelay:{value:150,type:"number"}}}static get listeners(){return{"button.down":"_startRepeat","button.mouseenter":"_overriddenHandler","button.mouseleave":"_overriddenHandler","button.pointerenter":"_updateInBoundsFlag","button.pointerleave":"_updateInBoundsFlag","button.touchmove":"_touchmoveHandler","document.up":"_stopRepeat"}}_clickHandler(e){const t=this;("release"!==t.clickMode||t.preventDefaultClick||t.readonly||t.disabled)&&(e.preventDefault(),e.stopPropagation(),t.preventDefaultClick=!1)}_updateInBoundsFlag(e){const t=this;-1!==e.type.indexOf("leave")?(t._isPointerInBounds=!1,t.$button.setAttributeValue("hover",!1),t.$.setAttributeValue("hover",!1)):(t._isPointerInBounds=!0,t.$button.setAttributeValue("hover",!0),t.$.setAttributeValue("hover",!0)),1!==("buttons"in e?e.buttons:e.which)&&t._stopRepeat(e)}_startRepeat(e){const t=this;t.setAttribute("active",""),t._initialTimer||t.readonly||(t._initialTimer=setTimeout((function(){t._repeatTimer=setInterval((()=>{if(t._isPointerInBounds){if(t.hasAttribute("smart-blazor"))return t.$.dispatchEvent(new Event("click")),void(t.preventDefaultClick=!0);const n="buttons"in e?e.buttons:e.which;t.$.fireEvent("click",{buttons:n,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY}),t.preventDefaultClick=!0}}),t.delay)}),t.initialDelay))}_stopRepeat(e){const t=this;t.readonly||e&&("pointercancel"===e.type||e.originalEvent&&"pointercancel"===e.originalEvent.type)||(t.$.setAttributeValue("active",!1),t._repeatTimer&&(clearInterval(t._repeatTimer),t._repeatTimer=null),t._initialTimer&&(clearTimeout(t._initialTimer),t._initialTimer=null))}_touchmoveHandler(e){this.preventDefaultClick&&e.cancelable&&(e.preventDefault(),e.stopPropagation())}_overriddenHandler(){}}),Smart("smart-toggle-button",class extends Smart.Button{static get properties(){return{checked:{value:!1,type:"boolean?"},falseContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminateContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminate:{value:!1,type:"boolean"},trueContent:{value:"",reflectToAttribute:!1,type:"string"},indeterminateTemplate:{value:null,type:"any"},trueTemplate:{value:null,type:"any"},falseTemplate:{value:null,type:"any"},type:{value:"toggle",type:"string",defaultReflectToAttribute:!0,readonly:!0}}}static get listeners(){return{keydown:"_keyHandler",keyup:"_keyHandler",dragstart:"_dragStartHandler","button.click":"_buttonClickHandler","button.mouseenter":"_buttonMouseEnterHandler","button.mouseleave":"_buttonMouseLeaveHandler","document.up":"_documentUpHandler"}}ready(){super.ready(),this._setAriaState(),this._updateGroupValue()}_setAriaState(){const e=this,t=e.checked;null!==t?e.setAttribute("aria-pressed",t):e.setAttribute("aria-pressed","mixed")}_buttonClickHandler(){}_buttonMouseLeaveHandler(){this.removeAttribute("hover")}_buttonMouseEnterHandler(){const e=this;e.setAttribute("hover",""),e.disabled||e.readonly||"hover"!==e.clickMode||(e._changeCheckState("pointer"),e.focus(),e._updateHidenInputNameAndValue())}_documentUpHandler(e){const t=this;t._pressed&&(t._pressed=!1,t.disabled||t.readonly||"press"===t.clickMode||"pointercancel"===e.originalEvent.type||(t._changeCheckState("pointer"),t.focus(),t._updateHidenInputNameAndValue()))}_downHandler(e){const t=this;t.disabled||t.readonly||(t.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t,e.pageX,e.pageY),t._pressed=!0,"press"!==t.clickMode&&"pressAndRelease"!==t.clickMode||(t._changeCheckState("pointer"),t.hasAttribute("smart-blazor")?t.$.dispatchEvent(new Event("click")):t.$.fireEvent("click"),t._updateHidenInputNameAndValue()),"press"===t.clickMode&&(e.preventDefault(),e.stopPropagation()))}_dragStartHandler(e){e.preventDefault()}_keyHandler(e){const t=this;if(!0!==t.disabled&&!t.readonly&&32===e.keyCode){if("keydown"===e.type)return void e.preventDefault();if("none"===t.switchMode)return;t._changeCheckState("keyboard"),t._updateHidenInputNameAndValue()}}_updateGroupValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const n=document.querySelectorAll('[data-target="'+e.dataset.target+'"]'),a=[];if(e.checked){const n=e.dataset.property,a=e.dataset.value;if(n&&void 0!==t[n]){let e=a;"true"===e&&(e=!0),"false"===e&&(e=!1),t[n]=e}}for(let t=0;t<n.length;t++){const r=n[t];r.checked&&(r.name?(a.push(r.name),e.id&&r.setAttribute("data-id",e.id)):e.id&&a.push(e.id))}t.value=a.toString(),e._targetDispatchTimer&&clearTimeout(e._targetDispatchTimer),e._targetDispatchTimer=setTimeout((()=>{t.dispatchEvent(new Event("change"))}),100)}}}_changeCheckState(e){const t=this;let n=null;null===t.checked?t.checked=!0:(n=t.checked,t.checked=!t.checked),t._handleTextSelection(),t.$.fireEvent("change",{value:t.checked,oldValue:n,changeType:e}),t.checked?t.$.fireEvent("checkValue",{changeType:e}):t.$.fireEvent("uncheckValue",{changeType:e}),t._updateGroupValue(),t._setAriaState()}_handleTextSelection(){const e=this;e.$.addClass("smart-unselectable"),e.timer&&clearTimeout(e.timer),e.timer=setTimeout((()=>e.$.removeClass("smart-unselectable")),500)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const a=this;if("checked"===e)return a.$.fireEvent("change",{value:n,oldValue:t,changeType:"api"}),void a._setAriaState();switch(e){case"trueTemplate":a._handleTemplate(!0);break;case"falseTemplate":a._handleTemplate(!1);break;case"indeterminateTemplate":a._handleTemplate()}}_htmlBindOnInitialization(){const e=this;e._bindContentProperty("trueContent","smart-true-content"),e._bindContentProperty("falseContent","smart-false-content"),e._bindContentProperty("indeterminateContent","smart-indeterminate-content")}_bindContentProperty(e,t){const n=this;if(!n.$[e+"Container"])return;let a=document.createElement("div");a.innerHTML=n.innerHTML;let r,i=a.getElementsByClassName(t);if(i.length>0)for(let e=0;e<i.length;e++)r=i[e];""===n[e]&&(n[e]=void 0===r?"":r.outerHTML),n.$[e+"Container"].innerHTML=n[e]}_updateContentProperties(){const e=this;function t(t){e.$[t+"Container"]&&(e[t]=e.$[t+"Container"].innerHTML)}t("trueContent"),t("falseContent"),t("indeterminateContent")}_updateHidenInputValue(){const e=this;if(!e.$.hiddenInput)return;let t;t=null===e.checked?"null":!1===e.checked?"off":e.value||"on",e.$.hiddenInput.setAttribute("value",t)}_updateHidenInputName(){const e=this;if(!e.$.hiddenInput)return;let t=!1===e.checked?"":e.name||"";e.$.hiddenInput.setAttribute("name",t)}_updateHidenInputNameAndValue(){this._updateHidenInputName(),this._updateHidenInputValue()}_handleTemplate(e,t){const n=this;let a,r,i;if(!0===e?(a=n.trueTemplate,r=n.$.trueContentContainer,i=n.trueContent):!1===e?(a=n.falseTemplate,r=n.$.falseContentContainer,i=n.falseContent):(a=n.indeterminateTemplate,r=n.$.indeterminateContentContainer,i=n.indeterminateContent),t&&(r.innerHTML=i||""),null===a||!a)return;if("function"==typeof a)return void a(r,{value:i});if(!("content"in document.createElement("template")))return void n.error(n.localize("htmlTemplateNotSuported",{elementType:n.nodeName.toLowerCase()}));if(a=document.getElementById(a),null===a||!("content"in a))return void n.error(n.localize("invalidTemplate",{elementType:n.nodeName.toLowerCase(),property:"template"}));const o=a.content,l=o.childNodes.length,s=/{{\w+}}/g;let u,d=[];for(let e=0;e<l;e++)for(u=s.exec(o.childNodes[e].innerHTML);u;)d.push({childNodeIndex:e,bindingString:u[0]}),u=s.exec(o.childNodes[e].innerHTML);const c=d.length;let p,h,m=document.importNode(a.content,!0);for(let e=0;e<c;e++){p=m.childNodes[d[e].childNodeIndex],h=d.length;for(let t=0;t<h;t++)p.innerHTML=p.innerHTML.replace(d[e].bindingString,i)}r.innerHTML="";for(let e=0;e<m.childNodes.length;e++)m.childNodes[e].outerHTML&&(r.innerHTML+=m.childNodes[e].outerHTML)}});

/***/ }),

/***/ 5810:
/***/ (() => {

Smart("smart-calendar",class extends Smart.BaseElement{static get properties(){return{animationSettings:{value:null,type:"object"},calendarMode:{value:"default",allowedValues:["default","classic"],type:"string"},dayNameFormat:{value:"firstTwoLetters",allowedValues:["narrow","firstTwoLetters","long","short"],type:"string"},dateFormatFunction:{value:null,type:"function"},disableAutoNavigation:{value:!1,type:"boolean"},disableMouseWheel:{value:!1,type:"boolean"},displayMode:{value:"month",allowedValues:["month","year","decade"],type:"string"},displayModeView:{value:"table",allowedValues:["table","list"],type:"string"},dropDownHeight:{value:"200",type:"string"},dropDownWidth:{value:"",type:"string"},firstDayOfWeek:{value:0,type:"number",defaultValue:0,validator:"_firstDayOfWeekValidator"},footerTemplate:{value:null,type:"any"},headerTemplate:{value:null,type:"any"},hideDayNames:{value:!1,type:"boolean"},hideOtherMonthDays:{value:!1,type:"boolean"},hideTooltipArrow:{value:!1,type:"boolean"},importantDates:{value:[],type:"array",defaultValue:[]},importantDatesTemplate:{value:null,type:"any"},max:{value:new Date(2100,0,1),type:"any",defaultValue:new Date(2100,0,1)},min:{value:new Date(1900,0,1),type:"any",defaultValue:new Date(1900,0,1)},months:{value:1,type:"number",defaultValue:1,validator:"_monthsValidator"},monthNameFormat:{value:"long",allowedValues:["narrow","firstTwoLetters","long","short","2-digit","numeric"],type:"string"},name:{value:"",type:"string"},restrictedDates:{value:[],type:"array",defaultValue:[]},scrollButtonsNavigationMode:{value:"landscape",allowedValues:["portrait","landscape"],type:"string"},scrollButtonsPosition:{value:"both",allowedValues:["near","far","both"],type:"string"},selectedDates:{value:[],reflectToAttribute:!1,type:"array"},selectionMode:{value:"default",allowedValues:["none","default","one","oneExtended","many","zeroOrMany","oneOrMany","zeroOrOne","week","range"],type:"string"},spinButtonsDelay:{value:200,type:"number"},spinButtonsInitialDelay:{value:0,type:"number"},titleTemplate:{value:null,type:"any"},tooltip:{value:!1,type:"boolean"},tooltipArrow:{value:!0,type:"boolean"},tooltipArrowDirection:{allowedValues:["bottom","top","left","right","none"],value:"bottom",type:"string"},tooltipDelay:{value:100,type:"number"},tooltipOffset:{value:[],type:"array"},tooltipPosition:{value:"auto",allowedValues:["auto","bottom","top","left","right","absolute"],type:"string"},tooltipTemplate:{value:null,type:"any"},view:{value:"portrait",allowedValues:["landscape","portrait"],type:"string"},viewSections:{value:["header"],type:"array"},weekNumbers:{value:!1,type:"boolean"},weeks:{value:6,type:"number",defaultValue:6,validator:"_weeksValidator"},yearFormat:{value:"numeric",allowedValues:["2-digit","numeric"],type:"string"}}}static get listeners(){return{"container.down":"_downHandler","document.up":"_documentUpHandler","body.move":"_moveHandler","container.wheel":"_containerWheelHandler","body.focus":"_bodyFocusStateHandler","body.blur":"_bodyBlurStateHandler","header.click":"_headerClickHandler","header.change":"_headerChangeHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler",mouseenter:"_mouseEventsHandler",mouseleave:"_mouseEventsHandler","container.mouseover":"_mouseEventsHandler","container.mouseout":"_mouseEventsHandler","container.open":"_popupEventHandler","container.close":"_popupEventHandler"}}static get methods(){return{select:"select(date=new Date(): date|string): void",clearSelection:"clearSelection(): void",today:"today(): date",navigate:"navigate(step: date|string|int): bool"}}static get styleUrls(){return["smart.calendar.css"]}template(){return'<div id="container" role="presentation">\n                    <div id="title" class="smart-calendar-title" role="heading" aria-level="1">\n                        <div id="yearContainer" class="smart-calendar-year-container" role="button"></div>\n                        <div id="dateContainer" class="smart-calendar-date-container smart-calendar-selected" role="button"></div>\n                    </div>\n                    <div id="calendarContainer" class="smart-calendar-container">\n                        <div id="header" class="smart-calendar-header">\n                            <smart-repeat-button prev-month class="smart-calendar-button" id="previousMonthButton" animation="[[animation]]" initial-delay="[[spinButtonsInitialDelay]]" delay="[[spinButtonsDelay]]" disabled="[[disabled]]" readonly="[[readonly]]" right-to-left="[[rightToLeft]]" aria-label="Previous month">\n                                <span aria-hidden="true"></span>\n                            </smart-repeat-button>\n                            <div id="dateElement" class="smart-calendar-date-element" role="presentation">\n                                <div id="defaultHeaderDate" role="button"></div>\n                                <div id="classicHeaderDate">\n                                    <div id="monthElement" class="smart-calendar-month-element" disabled="[[disabled]]" role="presentation">\n                                    </div>\n                                    <input class="smart-calendar-year-element" id="yearElement" disabled="[[disabled]]" readonly="[[readonly]]" aria-label="Year" />\n                                    <span class="smart-calendar-year-elements">\n                                        <smart-repeat-button next-year class="smart-calendar-button" id="nextYearButton" animation="[[animation]]" initial-delay="[[spinButtonsInitialDelay]]" delay="[[spinButtonsDelay]]" disabled="[[disabled]]" readonly="[[readonly]]" right-to-left="[[rightToLeft]]" aria-label="Next year">\n                                            <span aria-hidden="true"></span>\n                                        </smart-repeat-button>\n                                        <smart-repeat-button prev-year class="smart-calendar-button" id="previousYearButton" animation="[[animation]]" initial-delay="[[spinButtonsInitialDelay]]" delay="[[spinButtonsDelay]]" disabled="[[disabled]]" readonly="[[readonly]]" right-to-left="[[rightToLeft]]" aria-label="Previous year">\n                                            <span aria-hidden="true"></span>\n                                        </smart-repeat-button>\n                                    </span>\n                                </div>\n                            </div>\n                            <smart-repeat-button next-month class="smart-calendar-button" id="nextMonthButton" animation="[[animation]]" initial-delay="[[spinButtonsInitialDelay]]" delay="[[spinButtonsDelay]]" disabled="[[disabled]]" readonly="[[readonly]]" right-to-left="[[rightToLeft]]" aria-label="Next month">\n                                <span aria-hidden="true"></span>\n                            </smart-repeat-button>\n                        </div>\n                        <div id="body" class="smart-content smart-calendar-body" role="presentation">\n                            <div id="monthsContainer" class="smart-calendar-months-container" role="presentation">\n                              <div id="month" class="smart-calendar-month" role="grid">\n                                   <div id="monthName" class="smart-calendar-month-name"></div>\n                                   <div id="weekTitles" class="smart-calendar-week-titles" role="row">\n                                       <div class="smart-calendar-week-title" role="columnheader"></div>\n                                       <div class="smart-calendar-week-title" role="columnheader"></div>\n                                       <div class="smart-calendar-week-title" role="columnheader"></div>\n                                       <div class="smart-calendar-week-title" role="columnheader"></div>\n                                       <div class="smart-calendar-week-title" role="columnheader"></div>\n                                       <div class="smart-calendar-week-title" role="columnheader"></div>\n                                       <div class="smart-calendar-week-title" role="columnheader"></div>\n                                       <div class="smart-calendar-week-title" role="columnheader"></div>\n                                   </div>\n                                   <div id="weeks" class="smart-calendar-weeks" role="rowgroup">\n                                        <div class="smart-calendar-week" role="row">\n                                           <div class="smart-calendar-week-number" role="rowheader"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                        </div>\n                                        <div class="smart-calendar-week" role="row">\n                                           <div class="smart-calendar-week-number" role="rowheader"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                       </div>\n                                       <div class="smart-calendar-week" role="row">\n                                           <div class="smart-calendar-week-number" role="rowheader"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                       </div>\n                                       <div class="smart-calendar-week" role="row">\n                                           <div class="smart-calendar-week-number" role="rowheader"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                       </div>\n                                       <div class="smart-calendar-week" role="row">\n                                           <div class="smart-calendar-week-number" role="rowheader"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                       </div>\n                                       <div class="smart-calendar-week" role="row">\n                                           <div class="smart-calendar-week-number" role="rowheader"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"></div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                           <div class="smart-calendar-cell" role="gridcell"> </div>\n                                       </div>\n                                   </div>\n                                </div>\n                            </div>\n                            <div id="dateViewContainer" class="smart-calendar-date-view-container smart-hidden">\n                                    <div class="smart-calendar-cell" role="button"></div>\n                                    <div class="smart-calendar-cell" role="button"></div>\n                                    <div class="smart-calendar-cell" role="button"></div>\n                                    <div class="smart-calendar-cell" role="button"></div>\n                                    <div class="smart-calendar-cell" role="button"></div>\n                                    <div class="smart-calendar-cell" role="button"></div>\n                                    <div class="smart-calendar-cell" role="button"></div>\n                                    <div class="smart-calendar-cell" role="button"></div>\n                                    <div class="smart-calendar-cell" role="button"></div>\n                                    <div class="smart-calendar-cell" role="button"></div>\n                                    <div class="smart-calendar-cell" role="button"></div>\n                                    <div class="smart-calendar-cell" role="button"></div>\n                            </div>\n                            <div id="monthsSeparator" class="smart-calendar-month-separator"></div>\n                            <div id="nextMonthsContainer" class="smart-calendar-next-months-container" aria-hidden="true"></div>\n                            <div id="animationPanel" class="smart-calendar-animation-panel smart-hidden"></div>\n                        </div>\n                        <div id="footer" class="smart-calendar-footer smart-hidden">\n                            <div id="selectedDatesRange"></div>\n                        </div>\n                        <input id="hiddenInput" type="hidden" name="[[name]]">\n                    </div>\n                </div>'}_updateTargetValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const a=e.dataset.property,n=e.selectedDates.toString();a&&void 0!==t[a]&&(t[a]=n)}}}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"animationSettings":n._applyAnimationSettings();break;case"disabled":case"unfocusable":n._setFocusable();break;case"calendarMode":case"dropDownWidth":case"dropDownHeight":n.displayMode="month",n._refreshHeaderElements(),n._refreshCalendarMode(),n._setDisplayModeContent();break;case"dayNameFormat":n._refreshDayOfWeekTitles(n.$.month);break;case"dateFormatFunction":{let e=n.$.monthsContainer.children;for(let t=0;t<e.length;t++)e[t].firstElementChild.innerHTML=a?a(e[t]._date):n._monthsNames[e[t]._date.getMonth()]+" "+e[t]._date.toLocaleDateString(n.locale,{year:n.yearFormat});n._refreshHeaderTitle();break}case"displayMode":if("classic"===n.calendarMode&&"month"!==a){n[e]="month";break}n._setDisplayMode(t,a);break;case"displayModeView":n._applyAnimationSettings(!0),"month"!==n.displayMode&&n._setDisplayModeContent();break;case"firstDayOfWeek":n._handleMonths(),n._refreshDayOfWeekTitles();break;case"hideTooltipArrow":n.$.tooltip&&(n.$.tooltip.arrow=!a);break;case"titleTemplate":case"headerTemplate":case"footerTemplate":n._handleLayoutTemplate(n.$[e.split(/[T]/)[0]],a),"titleTemplate"===e?n._refreshTitle():"headerTemplate"===e?n._refreshHeaderTitle():n._refreshFooter();break;case"importantDates":n.importantDates=n._getValidDates(a),n._refreshImportantDates();break;case"importantDatesTemplate":n._handleImportantDateTemplate(),n._refreshImportantDates();break;case"locale":n._refreshMonthNames(),n._refreshDayOfWeekTitles(),n._refreshHeaderTitle(),n._refreshTitle(),n._refreshFooter(),n.displayMode&&"month"!==n.displayMode&&n._setDisplayModeContent();break;case"max":case"min":n._validateMinMax(e,a,t),n._validateSelectedDates(),n._noFocusingRequired=!1,n._refreshHeaderElements();break;case"months":n._handleMonths();break;case"monthNameFormat":n._refreshCalendarMode(),n._refreshHeaderTitle();break;case"restrictedDates":n._setRestrictedDates(n.restrictedDates=n._getValidDates(a));break;case"rightToLeft":n._refreshDayOfWeekTitles(),n._handleMonths();break;case"scrollButtonsNavigationMode":n._setScrollButtonsNavigationMode();break;case"selectedDates":if(n._clearSelection(!0),n._validateSelectedDates(n._getValidDates(a)),n._applySelectionMode(!0),n._viewDates){let e=n.selectedDates[n.selectedDates.length-1];n._isDateInView(e)?n.selectedDates.map((e=>n._selectDate(e,!0,!0))):n._handleMonths(e)}n._refreshFooter(),n._setWeeksVisibility(n.$.monthsContainer),n.$.hiddenInput.value=n.selectedDates.toString(),n.isInitialized&&(n.$.fireEvent("change",{value:n.selectedDates}),n._updateTargetValue()),n._refreshTitle(),"month"!==n.displayMode&&n._setDisplayModeContent();break;case"selectionMode":n._applySelectionMode(!1,t),n._refreshTitle();break;case"tooltip":n._handleTooltip();break;case"tooltipArrow":case"tooltipArrowDirection":case"tooltipDelay":case"tooltipOffset":case"tooltipPosition":case"tooltipTemplate":if(n.$.tooltip){const t=e.replace("tooltip","");n.$.tooltip[t.charAt(0).toLowerCase()+t.slice(1)]=a}break;case"view":n._refreshTitle();break;case"viewSections":a.indexOf("title")>-1?n.$title.removeClass("smart-hidden"):n.$title.addClass("smart-hidden"),n._refreshTitle(),a.indexOf("header")>-1?n.$header.removeClass("smart-hidden"):n.$header.addClass("smart-hidden"),n._refreshHeaderTitle(),a.indexOf("footer")>-1?n.$footer.removeClass("smart-hidden"):n.$footer.addClass("smart-hidden"),n._refreshFooter(),n._setFocusable();break;case"weeks":n._setWeeksVisibility(n.$.monthsContainer);break;case"yearFormat":if(n._refreshCalendarMode(),n._refreshFooter(),n.months>1&&"month"===n.displayMode){let e=n._animationStarted?n.$.nextMonthsContainer.children:n.$.monthsContainer.children;for(let t=0;t<e.length;t++)e[t].firstElementChild.innerHTML=n.dateFormatFunction?n.dateFormatFunction(e[t]._date):n._monthsNames[e[t]._date.getMonth()]+" "+e[t]._date.toLocaleDateString(n.locale,{year:a})}n._refreshTitle(),n._refreshHeaderTitle()}}ready(){super.ready();const e=this;e._keysPressed={},e._applyAnimationSettings(),e.importantDates=e._getValidDates(e.importantDates),e.restrictedDates=e._getValidDates(e.restrictedDates)}render(){const e=this;e.setAttribute("role","dialog"),e._refreshMonthNames(),e._validateMinMax(),e._validateSelectedDates(e._getValidDates(e.selectedDates)),e._handleLayoutTemplate(e.$.title,e.titleTemplate),e._handleLayoutTemplate(e.$.header,e.headerTemplate),e._handleLayoutTemplate(e.$.footer,e.footerTemplate),e._handleImportantDateTemplate(),e._setFocusable(),e._refreshDayOfWeekTitles(),e._applySelectionMode(!0),e._handleMonths(0===e.selectedDates.length?new Date((new Date).setHours(0,0,0,0)):e.selectedDates[e.selectedDates.length-1]),e._handleTooltip(),e._updateViewSectionsVisibility(),e._setScrollButtonsNavigationMode(),e._refreshCalendarMode(),e._setDisplayMode(),e._refreshTitle(),e._refreshFooter(),e._refreshImportantDates(),e.$.monthElement&&e.$.monthElement._setDropDownSize&&e.$.monthElement._setDropDownSize(),e._changeEventFired=0,e.$.hiddenInput.value=e.selectedDates.toString(),e.shadowRoot&&e.appendChild(e.$.hiddenInput),e.isInitialized=!0,super.render()}refresh(){this.isInitialized&&this.render()}_updateViewSectionsVisibility(){const e=this;e.viewSections.indexOf("title")>-1?e.$title.removeClass("smart-hidden"):e.$title.addClass("smart-hidden"),e.viewSections.indexOf("header")>-1?e.$header.removeClass("smart-hidden"):e.$header.addClass("smart-hidden"),e.viewSections.indexOf("footer")>-1?e.$footer.removeClass("smart-hidden"):e.$footer.addClass("smart-hidden")}clearSelection(){this._clearSelection()}_setFocusable(){const e=this;let t=e.tabIndex>0?e.tabIndex:0;function a(e,a){if(a)return e&&e instanceof a?("function"==typeof e._setFocusable&&e.isCompleted?e.unfocusable=t<=-1:e.setAttribute("tabindex",t),e):e||void 0}(e.disabled||e.unfocusable)&&(t=-1),e.$.previousMonthButton=a(e.$.previousMonthButton,Smart.Button),e.$.nextMonthButton=a(e.$.nextMonthButton,Smart.Button),e.$.nextYearButton=a(e.$.nextYearButton,Smart.Button),e.$.previousYearButton=a(e.$.previousYearButton,Smart.Button),e.$.monthElement=a(e.$.monthElement,Smart.Input),e.$.yearElement=a(e.$.yearElement,HTMLInputElement),e.viewSections.indexOf("title")>-1&&(e.$.dateContainer.setAttribute("tabindex",t),e.$.yearContainer.setAttribute("tabindex",t)),e.$.body.setAttribute("tabindex",t),"default"===e.calendarMode?e.$.dateElement.setAttribute("tabindex",t):e.$.dateElement.removeAttribute("tabindex"),e.unfocusable?e.removeAttribute("tabindex"):e.tabIndex=e.readonly&&!e.disabled?e.tabIndex>0?e.tabIndex:0:t}static get requires(){return{"Smart.DropDownList":"smart.dropdownlist.js","Smart.ListBox":"smart.listbox.js","Smart.RepeatButton":"smart.button.js","Smart.Tooltip":"smart.tooltip.js"}}navigate(e){const t=this;let a,n,l;if(e){if("number"==typeof e){if(e=parseInt(e),isNaN(e)||0===e)return!1;if(6!==t.weeks&&0!==t.weeks&&"month"===t.displayMode){let l,i;t._focusedCell||t._focusCell();const s=[].slice.call(t._focusedCell.closest(".smart-calendar-weeks").children).filter((e=>!e.classList.contains("smart-hidden")));e<0?(i=s[0].querySelectorAll(".smart-calendar-cell"),l=t.rightToLeft?i[i.length-1]:i[0]):(i=s[s.length-1].querySelectorAll(".smart-calendar-cell"),l=t.rightToLeft?i[0]:i[i.length-1]),n=new Date(l.value),n.setDate(n.getDate()+e),a=n}else a=t._getNextDate(e)}else{if(a=e=t._getValidDate(e),l=!0,isNaN(a.getTime()))return!1;const i=t._viewDates[0];if(i&&a.getMonth()===i.getMonth()&&a.getFullYear()===i.getFullYear())return!1;6!==t.weeks&&0!==t.weeks&&"month"===t.displayMode&&(n=a)}return!(!a||t.$.fireEvent("navigationChanging",{value:new Date(a),type:t.displayMode}).defaultPrevented||("month"!==t.displayMode?(!l&&t.hasAnimation?(t.$nextMonthsContainer.addClass("smart-calendar-date-view-container"),"list"===t.displayModeView?t._setDisplayModeContent(a):t._navigationDate&&t._navigationDate.getTime()===a.getTime()||t._animateNavigation(a,e)):t._setDisplayModeContent(a),t.$.fireEvent("navigationChange",{value:new Date(a),type:t.displayMode}),0):(t.hasAnimation?(t._animateNavigation(a,e),t.$nextMonthsContainer.hasClass("smart-date-view-container")&&t.$nextMonthsContainer.removeClass("smart-date-view-container")):(t._handleMonths(a),t._refreshHeaderElements(),t._refreshHeaderTitle()),n&&(t._focusCell(t._getCellByDate(n,t._animationStarted?t.$.nextMonthsContainer:void 0),!0),t._updateWeeksVisibility(e)),t.$.fireEvent("navigationChange",{value:new Date(a),type:t.displayMode}),0)))}}set value(e){this._select(e)}get value(){return this.selectedDates&&this.selectedDates.length>0?this.selectedDates[0]:null}select(e){this._select(e)}_select(e){const t=this;t._viewDates&&void 0!==t._viewDates[0]&&"none"!==t.selectionMode&&e&&(e=t._getValidDate(e))instanceof Date&&("one"===t.selectionMode&&t.selectedDates.map(Number).indexOf(e.getTime())>-1||e.getTime()<t.min.getTime()||e.getTime()>t.max.getTime()||("one"!==t.selectionMode&&"default"!==t.selectionMode&&"zeroOrOne"!==t.selectionMode||t._clearSelection(!0),t._selectDate(e),1!==t.selectedDates.length||t._isDateInView(t.selectedDates[0])||t._handleMonths(t.selectedDates[0])))}today(){const e=this;let t=new Date;return t.setHours(0,0,0,0),t.getTime()<e.min.getTime()||t.getTime()>e.max.getTime()?t=new Date(e.max):e._selectDate(t),e._handleMonths(t),t}_animateNavigation(e,t,a){const n=this;n._navigationDate=e,n._animationSettings||n._applyAnimationSettings(),n.$animationPanel.addClass("smart-hidden"),n.$.dateViewContainer.style.transform="",n.$.dateViewContainer.style.opacity="",n.$.monthsContainer.style.transform="",n.$.monthsContainer.style.opacity="";const l="month"!==n.displayMode?n.$.dateViewContainer:n.$.monthsContainer,i=n.$.body[n._animationSettings.scrollMax]-n.$.body[n._animationSettings.size];n._scrollStep=n.$.body[n._animationSettings.size]*n._animationSettings.startSpeed,n._animationStarted&&n._getMonthCells(n.$.monthsContainer,n.rightToLeft).map((e=>{n._setCellState(e,"restricted",!1),n._setCellState(e,"selected",!1),n._setCellState(e,"otherMonth",!1),n._setCellState(e,"focus",!1),n._setCellState(e,"important",!1),n._setCellState(e,"today",!1),n._setCellState(e,"disabled",!1),n._setCellState(e,"hover",!1)})),n._animationStarted=!0,"month"!==n.displayMode?(n._setCellState(n._focusedCell,"focus",!1),n._setDisplayModeContent(e,n.$.nextMonthsContainer)):n._handleMonths(e,n.$.nextMonthsContainer),n.rightToLeft&&(t*=-1),a||(t>0?(l.style.order=1,n.$.nextMonthsContainer.style.order=3,(!n._animationStarted||n._animationStarted&&n.$.body[n._animationSettings.scrollSize]>n.$.body[n._animationSettings.scrollMax]*n._animationSettings.resetThreshold*2)&&(n.$.body[n._animationSettings.scrollSize]=0)):(l.style.order=3,n.$.nextMonthsContainer.style.order=1,(!n._animationStarted||n._animationStarted&&n.$.body[n._animationSettings.scrollSize]<n.$.body[n._animationSettings.scrollMax]*n._animationSettings.resetThreshold)&&(n.$.body[n._animationSettings.scrollSize]=n.$.body[n._animationSettings.scrollMax]))),cancelAnimationFrame(n._animationId),n._animationId=requestAnimationFrame((function e(){let a=t>0?n.$.body[n._animationSettings.scrollSize]>=i:0===n.$.body[n._animationSettings.scrollSize],l=n._scrollStep/2;a?n._animateNavigationCompleted():(t>0&&n.$.body[n._animationSettings.scrollSize]>i*n._animationSettings.easeThreshold?(l=Math.max(n.$.body[n._animationSettings.scrollSize]/n._animationSettings.stepEaseSize,Math.abs(l-(i-n.$.body[n._animationSettings.scrollSize])*n._animationSettings.step)),n._scrollStep=n._scrollStep*n._animationSettings.step+l):t<0&&n.$.body[n._animationSettings.scrollSize]<i*n._animationSettings.easeThreshold&&(l=Math.max(n.$.body[n._animationSettings.scrollMax]/n._animationSettings.stepEaseSize,Math.abs(l-n.$.body[n._animationSettings.scrollSize]*n._animationSettings.step)),n._scrollStep=n._scrollStep*n._animationSettings.step+l),n.$.body[n._animationSettings.scrollSize]+=t>0?n._scrollStep:-n._scrollStep,n._animationId=requestAnimationFrame(e))}))}_animateNavigationCompleted(){const e=this;let t,a,n,l="month"!==e.displayMode?e.$.dateViewContainer:e.$.monthsContainer;if(cancelAnimationFrame(e._animationId),"month"!==e.displayMode){let i=[].slice.call(l.children).indexOf(e._focusedCell);l.innerHTML=e.$.nextMonthsContainer.innerHTML;let s,o=l.children[i];a=l.children,n=e.$.nextMonthsContainer.children;for(let t=0;t<a.length;t++)a[t].value=n[t].value,a[t].restricted=n[t].restricted,a[t].important=n[t].important,a[t].otherMonth=n[t].otherMonth,a[t].value.getTime()<=e.max.getTime()&&(s=a[t]);t=o&&o.value.getTime()>=e.max.getTime()?s.value:e._focusedCell?e._focusedCell.value:void 0}else{let i=l.children,s=e.$.nextMonthsContainer.children;e._focusedCell&&e.$.nextMonthsContainer.contains(e._focusedCell)&&(t=e._focusedCell.value);for(let t=0;t<i.length&&s[t]._date;t++){i[t]._date=s[t]._date,i[t].innerHTML=s[t].innerHTML,a=e._getMonthCells(i[t]),n=e._getMonthCells(s[t]);for(let e=0;e<a.length;e++)a[e].value=n[e].value,a[e].restricted=n[e].restricted,a[e].important=n[e].important,a[e].otherMonth=n[e].otherMonth,a[e].removeAttribute("focus")}e._selectedCells.length>0&&(e._selectedCells=e._selectedCells.map((t=>e._getCellByDate(t.value))).filter((e=>void 0!==e)))}e._focusCell(e._getCellByDate(t)),l.style.order=1,e.$.nextMonthsContainer.style.order=3,e.$.body[e._animationSettings.scrollSize]=0,e._animationStarted=!1,delete e._navigationDate}_applyAnimationSettings(e){const t=this;t._animationSettings=t.animationSettings?t.animationSettings:t._animationSettings||{},"portrait"===t.scrollButtonsNavigationMode?(t._animationSettings.scrollMax="scrollHeight",t._animationSettings.size="offsetHeight",t._animationSettings.scrollSize="scrollTop"):(t._animationSettings.scrollMax="scrollWidth",t._animationSettings.size="offsetWidth",t._animationSettings.scrollSize="scrollLeft"),e||(t._animationSettings.startSpeed=t._animationSettings.startSpeed?t._animationSettings.startSpeed:.2,t._animationSettings.easeThreshold=t._animationSettings.easeThreshold?t._animationSettings.easeThreshold:.5,t._animationSettings.step=t._animationSettings.step?t._animationSettings.step:.25,t._animationSettings.stepEaseSize=t._animationSettings.stepEaseSize?t._animationSettings.stepEaseSize:200,t._animationSettings.resetThreshold=t._animationSettings.resetThreshold?t._animationSettings.resetThreshold:.2)}_applySelectionMode(e,t){const a=this;let n=[],l=!!e,i=a.selectionMode;function s(e,t){const n=a.$.monthsContainer.children;for(let l=0;l<n.length;l++)a._getMonthCells(n[l]).map((n=>{a._setCellState(n,e,t)}))}switch("many"===i&&"range"===i||s("hover",!1),a._newRangeSelectionStarted=a.selectedDates.length>0&&"range"===i,-1!==["default","many","zeroOrMany","oneOrMany","week","range"].indexOf(i)?Array.from(a.getElementsByClassName("smart-calendar-month")).forEach((e=>e.setAttribute("aria-multiselectable",!0))):Array.from(a.getElementsByClassName("smart-calendar-month")).forEach((e=>e.removeAttribute("aria-multiselectable"))),"none"!==i&&"none"!==t||s("selected",!1),i){case"none":return void a._clearSelection(l);case"range":return void(a.selectedDates.length>1&&a._selectMultipleDates(a.selectedDates[0],a.selectedDates[a.selectedDates.length-1]));case"many":case"default":case"oneOrMany":if(0===a.selectedDates.length){n.push(new Date(Math.min(Math.max(a.min.getTime(),(new Date).setHours(0,0,0,0)),a.max.getTime())));break}return;case"oneExtended":case"one":if(1===a.selectedDates.length)return;a.selectedDates.length>1?(n.push(a.selectedDates[a.selectedDates.length-1]),a._clearSelection(l)):n.push(new Date(Math.min(Math.max(a.min.getTime(),(new Date).setHours(0,0,0,0)),a.max.getTime())));break;case"zeroOrOne":if(a.selectedDates.length>1){n.push(a.selectedDates[a.selectedDates.length-1]),a._clearSelection(l);break}return;case"zeroOrMany":return;case"week":if(a.selectedDates.length>=1){let e=a.selectedDates[a.selectedDates.length-1];for(let t=0;t<7;t++)n.push(new Date(e)),e.setDate(e.getDate()+1);a._clearSelection(l)}}if(a.selectedDates=[],e)return void(a.selectedDates=n);const o=n.length;for(let e=0;e<o;e++)a._selectDate(n[e],e<o-1)}__clearSelection(){const e=this,t=e.selectionMode,a=e.context;if(e.context=e,e.set("selectedDates",[]),e._selectedCells&&e._selectedCells.map((t=>{e._setCellState(t,"selected",!1)})),e.selectedDates=[],e._selectedCells=[],"many"===t||"range"===t){const t=e.$.monthsContainer.children;for(let a=0;a<t.length;a++)e._getMonthCells(t[a]).map((t=>{e._setCellState(t,"hover",!1)}))}e.$.footer&&e._refreshFooter(),e.$.hiddenInput.value=e.selectedDates.toString(),e.context=a}_clearSelection(e){const t=this,a=t.selectedDates.slice(0),n=t.selectionMode;if(t.isRendered){if(t._selectedCells&&t._selectedCells.map((e=>{t._setCellState(e,"selected",!1)})),t.selectedDates=[],t._selectedCells=[],"many"===n||"range"===n){const e=t.$.monthsContainer.children;for(let a=0;a<e.length;a++)t._getMonthCells(e[a]).map((e=>{t._setCellState(e,"hover",!1)}))}t.$.footer&&t._refreshFooter(),t.$.hiddenInput.value=t.selectedDates.toString(),!e&&t.isInitialized&&a.length&&(t.$.fireEvent("change",{value:[]}),t._updateTargetValue()),t.$.title&&t._refreshTitle()}else t.set("selectedDates",[])}_bodyBlurStateHandler(e){this._bodyStateHandler(e),this.$.fireEvent("blur")}_bodyFocusStateHandler(e){this._bodyStateHandler(e),this.$.fireEvent("focus")}_bodyStateHandler(e){const t=this;if(t._focusedCell){if("blur"===e.type||"focus"===e.type&&t._noFocusingRequired)return t._noFocusingRequired=!1,void t._setCellState(t._focusedCell,"focus",!1);if("month"!==t.displayMode)return void("focus"!==e.type||t.$.dateViewContainer.querySelector("smart-calendar-cell[focus]")||t._setCellState(t._focusedCell||t.$.dateViewContainer.querySelector(".smart-calendar-cell"),"focus",!0))}"focus"===e.type&&t._focusCell()}_containerWheelHandler(e){const t=this;if(t.disabled||t.readonly||"month"!==t.displayMode&&"list"===t.displayModeView)return;if(t.disableMouseWheel)return;let a,n;n=document.activeElement,t.shadowRoot?n=t.shadowRoot.activeElement:t.isInShadowDOM&&(n=t.getRootNode().activeElement),t.$.yearElement===n&&(a=12),(n&&t.shadowRoot||n.closest("smart-calendar")===t)&&(a=e.target===t.$.yearElement?12:1),a&&(e.preventDefault(),a=12===a?a:a*t.months,e.deltaY>0?t.navigate(-a):t.navigate(a))}_downHandler(e){const t=this;let a=e.originalEvent.target;if(t._dragStartDetails=void 0,t.disabled||t.readonly)return;if(t.hasRippleAnimation&&(a.value instanceof Date||a.parentElement&&a.parentElement.classList.contains("smart-calendar-title")||a.parentElement===t.$.dateElement)&&Smart.Utilities.Animation.Ripple.animate(a,e.pageX,e.pageY),a=e.originalEvent.target.closest(".smart-calendar-header"),e.originalEvent.target.closest(".smart-calendar-year-container")&&"decade"!==t.displayMode){if("classic"===t.calendarMode)return;return void t._showDateView("year")}if(e.originalEvent.target.closest(".smart-calendar-date-container")&&"month"!==t.displayMode){if("classic"===t.calendarMode)return;return void t._displayModeHandler("list"===t.displayModeView?t.$.listViewContainer.querySelector("li.active"):t._focusedCell,"month")}if(t._animationStarted&&t._animateNavigationCompleted(),Smart.Utilities.Core.isMobile&&e.originalEvent.target.closest(".smart-calendar-body")===t.$.body)return void(t._dragStartDetails={x:e.pageX,y:e.pageY,startTime:Date.now(),target:e.originalEvent.target});if(a=e.originalEvent.target,a.closest(".smart-calendar-week")||a.parentElement===t.$.dateViewContainer){for(;a&&!(a.value instanceof Date);)a=a.parentElement;return void(a&&("month"!==t.displayMode?t._displayModeHandler(a):t._weeksDownHandler(e,a)))}if(a.closest(".smart-calendar-month-element"))return;if(e.originalEvent.stopPropagation(),"list"===t.displayModeView&&"month"!==t.displayMode)return a=(t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target).closest("smart-list-item"),void(a&&t._displayModeHandler(a));const n=document.scrollingElement||document.documentElement,l=n.scrollLeft,i=n.scrollTop;t.unfocusable||t.focus(),window.scrollTo(l,i)}_displayModeHandler(e,t){const a=this;if(a._animationStarted&&a._animateNavigationCompleted(),e instanceof HTMLElement&&e.closest(".smart-calendar-week")&&e.otherMonth){if("decade"===a.displayMode&&(e.value.getFullYear()<a.min.getFullYear()||e.value.getFullYear()>a.max.getFullYear()))return;if("year"===a.displayMode&&(e.value.getFullYear()<a.min.getFullYear()||e.value.getFullYear()===a.min.getFullYear()&&e.value.getMonth()<a.min.getMonth()||e.value.getFullYear()>a.max.getFullYear()||e.value.getFullYear()===a.max.getFullYear()&&e.value.getMonth()>a.max.getMonth()))return}switch(t=t||a.displayMode){case"year":t="month";break;case"decade":t="year"}if(a.displayMode===t)return;const n=a.$.listViewContainer,l=n&&n.contains(e);a.$.fireEvent("displayModeChanging",{oldDisplayMode:a.displayMode,newDisplayMode:t}).defaultPrevented||(a.set("displayMode",t),a.$nextMonthsContainer.removeClass("smart-calendar-date-view-container"),e.parentElement!==a.$.dateViewContainer||e.disabled||e.restricted||a._focusCell(e),a.hasAnimation?(l&&e instanceof HTMLLIElement?e.offsetHeight?a.$.animationPanel.style.transformOrigin=e.offsetWidth/2+"px "+(e.offsetTop+e.offsetHeight/2)+"px":a.$.animationPanel.style.transformOrigin=n.offsetLeft+n.offsetWidth/2+"px "+(n.offsetTop+n.offsetHeight/2)+"px":(a.$.dateViewContainer.style.order=1,a.$.nextMonthsContainer.style.order=3,e=a._focusedCell,a.$.animationPanel.style.transformOrigin=e.offsetLeft+e.offsetWidth/2+"px "+(e.offsetTop+e.offsetHeight/2)+"px"),a._animateView(1,e)):a._setDisplayModeContent(e.value instanceof Date?e.value:new Date(e.getAttribute("value")||e.value)))}_animateView(e,t){const a=this;let n,l,i=t instanceof Date?t:new Date(t.getAttribute("value")||t.value),s=!1,o=1,r=1;const d=a.$.listViewContainer;"list"===a.displayModeView?n=d.contains(t)?d:l="month"!==a.displayMode?a.$.monthsContainer:d:t.value instanceof Date||(t=a._focusedCell?a._focusedCell:a._selectedCells.length>0?a._selectedCells[a._selectedCells.length-1]:a._getCellByDate(new Date)),n||(n=t.parentElement===a.$.dateViewContainer?a.$.dateViewContainer:a.$.monthsContainer),l||(l="month"===a.displayMode?a.$.monthsContainer:"list"===a.displayModeView?d:a.$.dateViewContainer),l.style.transformOrigin=a.$.animationPanel.style.transformOrigin,n===d?(a.$.animationPanel.innerHTML="",a.$.animationPanel.appendChild(n.cloneNode(!0))):a.$.animationPanel.innerHTML=n.innerHTML,a._setDisplayModeContent(i),n.style.order=1,a.$.nextMonthsContainer.style.order=3,a.$.body[a._animationSettings.scrollSize]=0,a.$.animationPanel.style.width=a.$.body.offsetWidth+"px",a.$.animationPanel.style.height=a.$.body.offsetHeight+"px",a.$.animationPanel.style.transform="scale(1)",a.$.animationPanel.style.opacity=1,a.$animationPanel.removeClass("smart-hidden"),l.style.opacity="0",l.style.transform="scale(3.5)",n.$.hasClass("smart-calendar-date-view-container")?a.$animationPanel.addClass("smart-calendar-date-view-container"):a.$animationPanel.removeClass("smart-calendar-date-view-container"),cancelAnimationFrame(a._animationId),a._animationId=requestAnimationFrame((function t(){if((e>0&&o>=3.5||e<0&&o<=0)&&(s=!0),s){if(cancelAnimationFrame(a._animationId),a.$animationPanel.addClass("smart-hidden"),a.$.animationPanel.style.transform="",a.$.animationPanel.style.opacity="",n.style.order=1,a.$.nextMonthsContainer.style.order=3,a.$.body[a._animationSettings.scrollSize]=0,l.style.transform="",l.style.opacity="",a.unfocusable)return;"month"===a.displayMode?a.$.body.focus():"list"===a.displayModeView&&a.focus()}else a.$.animationPanel.style.opacity=r,l.style.opacity=1-r,r-=.05,e>0?(a.$.animationPanel.style.transform="scale("+o+")",l.style.transform="scale("+Math.min((o-1)/2,1)+")",o+=.125):(a.$.animationPanel.style.transform="scale("+Math.max(o,0)+")",l.style.transform="scale("+Math.max(1+o,1)+")",o-=.06),a._animationId=requestAnimationFrame(t)}))}_documentUpHandler(e){const t=this;let a=e.originalEvent.target;if((t.isInShadowDOM||t.shadowRoot&&a===t)&&(a=e.originalEvent.composedPath()[0]),t._newRangeSelectionStarted&&!t.$.container.contains(a)&&delete t._newRangeSelectionStarted,a&&a.classList&&a.classList.contains("smart-calendar-cell")&&t._dragStartDetails&&(e.originalEvent.stopPropagation(),e.originalEvent.preventDefault(),e.preventDefault()),!Smart.Utilities.Core.isMobile||!t._dragStartDetails||e.originalEvent.target.closest(".smart-calendar-list-view"))return;delete t._previousIteration;const n=Date.now();let l={};(t.isInShadowDOM||t.shadowRoot&&a===t)&&(a=e.originalEvent.composedPath()[0]),"portrait"===t.scrollButtonsNavigationMode?(l.coordinate="y",l.direction="pageY"):(l.coordinate="x",l.direction="pageX");const i=t._dragStartDetails.step*(t.rightToLeft?-1:1);if(Math.abs(t._dragStartDetails[l.coordinate]-e[l.direction])<=10){if(a="list"===t.displayModeView&&"month"!==t.displayMode?a.closest("smart-list-item"):a,!a)return void(t._dragStartDetails=void 0);if("month"!==t.displayMode)return t._displayModeHandler(a),"portrait"===t.scrollButtonsNavigationMode?t.$.body.scrollTop=0:t.$.body.scrollLeft=0,void(t._dragStartDetails=void 0);if(t._weeksDownHandler(e,a),!t.disableAutoNavigation&&a.otherMonth)return}else{const a=Math.abs((e[l.direction]-t._dragStartDetails[l.coordinate])/(n-t._dragStartDetails.startTime));if(a>1){const e=parseInt(a);for(let a=0;a<e;a++)if(!t.navigate(i)){t._cancelAnimation();break}return void(t._dragStartDetails=void 0)}}if(!t.hasAnimation)return t.navigate(t._dragStartDetails.step),void(t._dragStartDetails=void 0);let s=("month"!==t.displayMode?t.$.dateViewContainer[t._animationSettings.scrollMax]:t.$.monthsContainer[t._animationSettings.scrollMax])+t.$.monthsSeparator[t._animationSettings.size];if(t._dragStartDetails.step>0&&t.$.body[t._animationSettings.scrollSize]>s*t._animationSettings.easeThreshold||t._dragStartDetails.step<0&&t.$.body[t._animationSettings.scrollSize]<s*t._animationSettings.easeThreshold)return t._animateNavigation(t._dragStartDetails.navigationDate,i,!0),6!==t.weeks&&0!==t.weeks&&"month"===t.displayMode&&t._updateWeeksVisibility(i,t._getCellByDate(t._dragStartDetails.navigationDate,t.$.nextMonthsContainer)),t.$.fireEvent("navigationChange",{value:new Date(t._dragStartDetails.navigationDate),type:t.displayMode}),void(t._dragStartDetails=void 0);t._cancelAnimation(),t._dragStartDetails=void 0}_cancelAnimation(){const e=this,t="month"!==e.displayMode?e.$.dateViewContainer:e.$.monthsContainer;let a=e.$.animationPanel.style.transform,n=e.$.animationPanel.style.opacity;a&&(a=parseFloat(a.substring(a.indexOf("(")+1||0,a.indexOf(")")))),t.style.order=1,e.$.nextMonthsContainer.style.order=3,e.$.body[e._animationSettings.scrollSize]=0,e._animationId=requestAnimationFrame((function t(){if(!a||a>=3.5){cancelAnimationFrame(e._animationId),e.$animationPanel.addClass("smart-hidden"),e.$.animationPanel.style.transform="",e.$.animationPanel.style.opacity="";const t="month"===e.displayMode?e.$.monthsContainer:e.$.listViewContainer;return t.style.transform="",t.style.opacity="",e.unfocusable||("month"===e.displayMode?e.$.body.focus():"list"===e.displayModeView&&e.focus()),void(e._animationStarted=!1)}e.$.animationPanel.style.opacity=n-=.25,e.$.animationPanel.style.transform="scale("+(a+=.5)+")",e._animationId=requestAnimationFrame(t)}))}_focusCell(e,t){const a=this;if(a._focusedCell&&a._setCellState(a._focusedCell,"focus",!1),a.disabled||a.readonly)return;if(e){if("month"!==a.displayMode)return a._setCellState(e,"focus",!0),void(a._focusedCell=e);if(e.disabled||e.restricted)return;return t||a._setCellState(e,"focus",!0),void(a._focusedCell=e)}if("month"!==a.displayMode&&0===a.$.monthsContainer.offsetHeight)return;const n=a._selectedCells[a._selectedCells.length-1];if(n&&n.offsetHeight)a._setCellState(n,"focus",!0),a._focusedCell=n;else{const e=a.$.monthsContainer.children;if(!e[0]._date||a.min.getTime<e[0]._date.getTime())return;const t=a._getMonthCells(e[0],a.rightToLeft);for(let e=0;e<t.length;e++){const n=t[e];if(!n.otherMonth){if(n.disabled||n.restricted||!n.offsetHeight)continue;a._focusedCell=n;break}}}a._focusedCell&&a._setCellState(a._focusedCell,"focus",!0)}_getDays(e,t){const a=t.length;let n=[];if(a>0)for(let l=0;l<a;l++)t[l].getFullYear()===e.getFullYear()&&t[l].getMonth()===e.getMonth()&&n.push(t[l].getDate());return n}_getCellByDate(e,t){const a=this;if(!(e instanceof Date))return;if(t||(t=a.$.monthsContainer),"month"!==a.displayMode){if("list"===a.displayModeView)return;let t=arguments[1]?a.$.nextMonthsContainer.children:a.$.dateViewContainer.children;for(let n=0;n<t.length;n++)if("year"!==a.displayMode){if(t[n].value.getFullYear()===e.getFullYear())return t[n]}else if(t[n].value.getMonth()===e.getMonth())return t[n];return}let n,l,i=t.children;for(let t=0;t<i.length;t++)if(e.getFullYear()===i[t]._date.getFullYear()&&e.getMonth()===i[t]._date.getMonth()){n=i[t];break}if(n){l=a._getMonthCells(n);for(let t=0;t<l.length;t++)if((!l[t].otherMonth||l[t].hover)&&l[t].value.getMonth()===e.getMonth()&&l[t].value.getDate()===e.getDate())return l[t]}}_getMonthCells(e,t){const a=e.getElementsByClassName("smart-calendar-week");let n=[];if(t)for(let e=0;e<a.length;e++){let t=a[e].children;for(let e=t.length-1;e>0;e--)t[e].classList.contains("smart-calendar-cell")&&n.push(t[e])}else for(let e=0;e<a.length;e++){let t=a[e].children;for(let e=1;e<t.length;e++)t[e].classList.contains("smart-calendar-cell")&&n.push(t[e])}return n}_getWeekNumber(e){const t=this;let a,n=new Date(e.getFullYear(),0,1),l=Math.round((e.getTime()-n.getTime()-6e4*(e.getTimezoneOffset()-n.getTimezoneOffset()))/864e5)+1,i=n.getDay()-t.firstDayOfWeek;return i=i>=0?i:i+7,i<4?(a=Math.floor((l+i-1)/7)+1,a>52&&(n=new Date(e.getFullYear()+1,0,1),i=n.getDay()-t.firstDayOfWeek,i=i>=0?i:i+7,a=i<4?1:53)):a=Math.round((l+i-1)/7),a}_handleDateSelection(e){const t=this;if(void 0!==e&&!e.disabled&&!e.restricted)switch(t.selectionMode){case"none":t._focusCell(e);break;case"oneExtended":case"one":case"default":if(t._keysPressed.Control)return t.selectedDates.length>1||1===t.selectedDates.length&&!e.selected?void t._selectDate(e.value):void t._focusCell(e);if(t._keysPressed.Shift)return void t._selectMultipleDates(new Date(t.selectedDates[0]),e);t._clearSelection(!0),t._selectDate(e.value,t._selectedCells.indexOf(e.value)>-1);break;case"many":{if(0===t.selectedDates.length)return void t._selectDate(e.value);const a=t.selectedDates[t.selectedDates.length-1];let n=new Date(t.selectedDates[0]);if(e.value.getTime()===n.getTime()||e.value.getTime()===a.getTime())return t._clearSelection(),void t._focusCell(e);t.selectedDates.length>0&&t._selectMultipleDates(n,e);break}case"range":{if(t.selectedDates.length>1&&!t._keysPressed.Control&&!t._newRangeSelectionStarted&&t._clearSelection(!0),0===t.selectedDates.length||t._keysPressed.Control&&t.selectedDates.length>1&&!t._newRangeSelectionStarted){if(e.value&&t.selectedDates.find((t=>t.getTime()===e.value.getTime())))return;return t._newRangeSelectionStarted=!0,void t._selectDate(e.value)}const a=t.selectedDates[t.selectedDates.length-1];let n=t._keysPressed.Control||t._newRangeSelectionStarted?a:new Date(t.selectedDates[0]);t.selectedDates.length>0&&t._selectMultipleDates(n,e),delete t._newRangeSelectionStarted;break}case"zeroOrMany":t._selectDate(e.value);break;case"oneOrMany":if(1===t.selectedDates.length&&e.selected)return void t._focusCell(e);t._selectDate(e.value);break;case"zeroOrOne":if(1===t.selectedDates.length&&e.selected)return void t._selectDate(e.value);t._clearSelection(!0),t._selectDate(e.value);break;case"week":{if(e.selected&&(e.value.getTime()===t.selectedDates[0].getTime()||e.value.getTime()===t.selectedDates[t.selectedDates.length-1].getTime()))return t._clearSelection(),void t._focusCell(e);t._clearSelection(!0);let a=new Date(e.value);t._selectDate(a);for(let e=1;e<7;e++)a.setDate(a.getDate()+1),t._selectDate(a);t._isDateInView(a)||t.navigate(1);break}}}_handleImportantDateTemplate(){const e=this;if(e._importantDatesTemplate=e._validateTemplate("importantDatesTemplate",e.importantDatesTemplate),!e._importantDatesTemplate||!e._importantDatesTemplate.content)return;let t=e._importantDatesTemplate.content;const a=t.childNodes.length,n=/{{\w+}}/g;let l;e._bindingDetails=[];for(let i=0;i<a;i++)if(l=n.exec(t.childNodes[i].innerHTML),l)return void e._bindingDetails.push({childNodeIndex:i,bindingString:l[0]})}_handleLayoutTemplate(e,t){const a=this,n=a._validateTemplate(e.$.hasClass("smart-header")?"headerTemplate":e.$.hasClass("smart-calendar-footer")?"footerTemplate":"titleTemplate",t);if(!n||!n.content)return void("function"==typeof t&&t(e,{}));a._layoutTemplates||(a._layoutTemplates=[]);let l=document.importNode(n.content,!0);e.innerHTML="";const i=l.childNodes.length,s=/{{\w+}}/g;let o,r=[];for(let e=0;e<i;e++)o=s.exec(l.childNodes[e].innerHTML),o&&r.push({childNodeIndex:e,bindingString:o[0]});if(a._layoutTemplates=a._layoutTemplates.filter((t=>t.selector!==e)),a._layoutTemplates.push({selector:e,template:n,bindings:r}),a.shadowRoot)return e.innerHTML="<slot></slot>",void a.appendChild(l);e.appendChild(l)}_handleCalendarCellHover(e,t){const a=this;if(!a._animationStarted){if("month"===a.displayMode)if("mouseover"===e.type&&("many"===a.selectionMode||"range"===a.selectionMode&&a._newRangeSelectionStarted)&&a.selectedDates.length>0){const e=a.$.monthsContainer.children;for(let t=0;t<e.length;t++)a._getMonthCells(e[t]).map((e=>{a._setCellState(e,"hover",!1)}));let n=new Date("range"===a.selectionMode?a.selectedDates[a.selectedDates.length-1]:a.selectedDates[0]),l=new Date(t.value),i=t;const s=n.getTime()>l.getTime()?-1:1,o=function(){i=a._getCellByDate(n),!i||i.selected||i.restricted||a._setCellState(i,"hover",!0)};if(n.getTime()!==l.getTime()){for(n.setDate(n.getDate()+s);n.getTime()!==l.getTime();)o(),n.setDate(n.getDate()+s);o()}}else a._setCellState(t,"hover",!1);"mouseover"!==e.type||t.otherMonth?a._setCellState(t,"hover",!1):a._setCellState(t,"hover",!0)}}_handleMonths(e,t){const a=this;let n;function l(e){let t,n=e.children.length,l=document.createDocumentFragment();for(;n<a.months;n++)t=a.$.month.cloneNode(!1),t.innerHTML=a.$.month.innerHTML,l.appendChild(t);return l}function i(t){let n=t.children;for(let t=0;t<n.length;t++)a._setMonth(e,n[t]),e.setMonth(e.getMonth()+1);a._setWeeksVisibility(t),a._refreshHeaderElements(),a._refreshHeaderTitle(),a.tooltip&&a.$.tooltip&&a.$.tooltip.close(),a.$.body===document.activeElement&&a._focusCell()}if(e||(e=a._viewDates&&a._viewDates.length>0?a._viewDates[0]:new Date),e=new Date(Math.min(Math.max(a.min.getTime(),e.getTime()),a.max.getTime())),t||(t=a.$.monthsContainer),a._selectedCells=[],a.hasAnimation){for(n=a.$.nextMonthsContainer.children,n.length>0&&n[0].value instanceof Date&&(a.$.nextMonthsContainer.innerHTML="");a.$.nextMonthsContainer.childElementCount<a.months;)a.$.nextMonthsContainer.appendChild(l(a.$.nextMonthsContainer));for(;a.$.nextMonthsContainer.childElementCount>a.months;)a.$.nextMonthsContainer.removeChild(n[a.$.nextMonthsContainer.childElementCount-1]);if(arguments[1]===a.$.nextMonthsContainer)return void i(a.$.nextMonthsContainer)}if(n=a.$.monthsContainer.children,n.length>a.months){for(;a.$.monthsContainer.childElementCount>a.months;)a.$.monthsContainer.removeChild(n[a.$.monthsContainer.childElementCount-1]),a._viewDates.pop();i(a.$.monthsContainer)}else a.$.monthsContainer.children.length!==a.months?(a._viewDates=[],a.$.monthsContainer.appendChild(l(a.$.monthsContainer)),i(a.$.monthsContainer)):i(a.$.monthsContainer)}_headerChangeHandler(e){const t=this;if(e.stopPropagation(),t.disabled||t.readonly)return;if(e.target.ownerElement===t.$.monthElement&&0!==t._changeEventFired)return void t._changeEventFired--;const a=t.displayMode;e.target===t.$.yearElement&&(t._viewDates[0].setFullYear(Math.min(Math.max(t.min.getFullYear(),isNaN(parseInt(t.$.yearElement.value))?0:parseInt(t.$.yearElement.value)),t.max.getFullYear())),t._handleMonths(t._viewDates[0])),!t.$.monthElement||e.target!==t.$.monthElement&&e.target.ownerElement!==t.$.monthElement||(t._handleMonths(new Date(t.$.monthsContainer.children[0]._date.getFullYear(),t.$.monthElement.selectedIndex,1)),"month"!==a&&t._setDisplayMode(t.displayMode,t.displayMode="month"))}_headerClickHandler(e){const t=this;if(t.disabled||t.readonly)return;let a=e.target.closest("smart-repeat-button");if(!a||!a.disabled){switch(a){case t.$.previousMonthButton:return t._isInteractiveNavigation=!0,void t.navigate(-1*t.months*(t.rightToLeft?-1:1));case t.$.nextMonthButton:return t._isInteractiveNavigation=!0,void t.navigate(1*t.months*(t.rightToLeft?-1:1));case t.$.previousYearButton:return void t.navigate(-12);case t.$.nextYearButton:return void t.navigate(12)}"classic"!==t.calendarMode&&e.target.closest(".smart-calendar-date-element")&&(t._animationStarted&&t._animateNavigationCompleted(),t._isInteractiveNavigation=!0,t._showDateView())}}_selectMultipleDates(e,t){const a=this;if(t instanceof HTMLElement&&(t=t.value),a._newRangeSelectionStarted?a._selectDate(e,!0):a._clearSelection(!0),"range"!==a.selectionMode||t.getTime()!==e.getTime()){if((e=new Date(e)).getTime()<t.getTime())for(;e.getTime()<=t.getTime();)a.selectedDates.find((t=>t.getTime()===e.getTime()))||a._selectDate(e,!0),e.setDate(e.getDate()+1);else if(e.getTime()>t.getTime())for(;e.getTime()>=t.getTime();)a.selectedDates.find((t=>t.getTime()===e.getTime()))||a._selectDate(e,!0),e.setDate(e.getDate()-1);else a._selectDate(t,!0);a.$.hiddenInput.value=a.selectedDates.toString(),a._refreshFooter(),a.isInitialized&&(a.$.fireEvent("change",{value:a.selectedDates}),a._updateTargetValue()),a._refreshTitle()}}_setDisplayMode(e,t,a){const n=this;if(n.$nextMonthsContainer.removeClass("smart-calendar-date-view-container"),0!==arguments.length&&n.hasAnimation)if(n._animationStarted&&(n.displayMode=e,n._animateNavigationCompleted(),n.displayMode=t),"month"===e&&"year"===t||"year"===e&&"decade"===t)n.displayMode=e,n._showDateView(a?void 0:n.displayMode);else if("month"===e&&"decade"===t)n._showDateView(n.displayMode="year");else{let e;"list"===n.displayModeView?(e=n.$.listViewContainer.querySelector("li.active"),n.$.animationPanel.style.transformOrigin=e.offsetLeft+e.offsetWidth/2+"px "+(e.offsetTop>0?e.offsetTop-e.offsetHeight/2:e.offsetTop+e.offsetHeight/2)+"px"):(n.$.dateViewContainer.style.order=1,n.$.nextMonthsContainer.style.order=3,e=n._focusedCell,n.$.animationPanel.style.transformOrigin=e.offsetLeft+e.offsetWidth/2+"px "+(e.offsetTop+e.offsetHeight/2)+"px"),n._animateView(1,e)}else{if("classic"===n.calendarMode)return void(n.displayMode="month");if("month"!==n.displayMode&&(n.$monthsContainer.addClass("smart-hidden"),n.$dateViewContainer.hasClass("smart-hidden")&&n.$dateViewContainer.removeClass("smart-hidden")),!n.isCompleted&&"month"===n.displayMode)return;n._setDisplayModeContent()}}_setDisplayModeContent(e,t){const a=this;let n=e&&"Invalid Date"!==e.toString()?e:a.selectedDates.length>0?a.selectedDates[a.selectedDates.length-1]:new Date;n.setTime(Math.min(Math.max(n.getTime(),a.min.getTime()),a.max.getTime())),n.setHours(0,0,0,0);const l=a._prepareView(n);if(!l)return;let i;t?(a.$.nextMonthsContainer.innerHTML=a.$.dateViewContainer.innerHTML,i=a.$.nextMonthsContainer):i=a.$.dateViewContainer;const s=i.children;let o;for(let e=0;e<s.length;e++){const t=s[e];t.innerHTML=l.viewContent[e],t.value=l.dates[e],"year"===a.displayMode?(t.value.getFullYear()<a.min.getFullYear()||t.value.getFullYear()===a.min.getFullYear()&&t.value.getMonth()<a.min.getMonth()||t.value.getFullYear()>a.max.getFullYear()||t.value.getFullYear()===a.max.getFullYear()&&t.value.getMonth()>a.max.getMonth()?a._setCellState(t,"otherMonth",!0):a._setCellState(t,"otherMonth",!1),n.getFullYear()===t.value.getFullYear()&&n.getMonth()===t.value.getMonth()&&(o=t)):"decade"===a.displayMode&&(0===e||e===s.length-1||t.value.getFullYear()<a.min.getFullYear()||t.value.getFullYear()>a.max.getFullYear()?a._setCellState(t,"otherMonth",!0):a._setCellState(t,"otherMonth",!1),n.getFullYear()===t.value.getFullYear()&&(o=t)),a._setCellState(t,"hover",!1),a._setCellState(t,"focus",!1)}if(o.otherMonth)for(let e=0;e<s.length;e++)if(!s[e].otherMonth){o=s[e];break}a._mobileScrolling||(a._focusedCell&&a._setCellState(a._focusedCell,"focus",!1),a._focusedCell=o,a._focusCell(a._focusedCell),a._refreshHeaderTitle(),a._refreshHeaderElements(),a.$.fireEvent("displayModeChange"),a._isInteractiveNavigation?a._isInteractiveNavigation=void 0:(a._setCellState(o,"focus",!0),setTimeout((function(){a.unfocusable||(a.$.body.focus(),a._focusCell(a._focusedCell))}),0)))}_prepareView(e){const t=this,a=t.$.listViewContainer;let n,l,i=[],s=[];function o(e,t,a){let n=new Date(e,t+1,0),l=n.getDate();return a>l?n.setDate(l):n.setDate(a),n}if("month"===t.displayMode)return t.$nextMonthsContainer.hasClass("smart-date-view-container")&&t.$nextMonthsContainer.removeClass("smart-date-view-container"),a&&a.classList.add("smart-hidden"),t.$dateViewContainer.hasClass("smart-visibility-hidden")&&t.$dateViewContainer.removeClass("smart-visibility-hidden"),t._isDateInView(e)||t._handleMonths(e),t.$header.hasClass("smart-hidden")&&t.$header.removeClass("smart-hidden"),t.$body.hasClass("smart-calendar-list-view")&&t.$body.removeClass("smart-calendar-list-view"),t.$dateContainer.addClass("smart-calendar-selected"),t.$yearContainer.removeClass("smart-calendar-selected"),t.$dateViewContainer.addClass("smart-hidden"),t.$monthsContainer.removeClass("smart-hidden"),t._refreshHeaderTitle(),t.$.body.setAttribute("tabindex",t.tabIndex>0?t.tabIndex:0),t._refreshHeaderElements(),t.unfocusable||t.$.body.focus(),t._focusCell(t._getCellByDate(e)),void t.$.fireEvent("displayModeChange");if("list"===t.displayModeView)return t._setDisplayModeListContent(e),void t.$.fireEvent("displayModeChange");if(t.$header.hasClass("smart-hidden")&&t.$header.removeClass("smart-hidden"),t.$dateViewContainer.hasClass("smart-visibility-hidden")&&t.$dateViewContainer.removeClass("smart-visibility-hidden"),a&&a.classList.add("smart-hidden"),t.$.body.setAttribute("tabindex",t.tabIndex>0?t.tabIndex:0),"year"===t.displayMode){let a=new Date;for(let n=0;n<12;n++)a=o(a.getFullYear(),n,a.getDate()),i.push(a.toLocaleDateString(t.locale,{month:"short"})),s.push(o(e.getFullYear(),n,e.getDate()))}else{n=e?e.getFullYear():t._viewDates[0].getFullYear(),l=n%10,0!==l&&(n-=l),n-=1;for(let t=0;t<12;t++)i.push(n+""),s.push(new Date(n,e.getMonth(),e.getDate())),++n}return{viewContent:i,dates:s}}_setDisplayModeListContent(e){const t=this;let a=[];function n(e,t,a){let n=new Date(e,t+1,0),l=n.getDate();return a>l?n.setDate(l):n.setDate(a),n}if(t.$dateViewContainer.addClass("smart-visibility-hidden"),"year"===t.displayMode){let l=new Date;for(let i=0;i<12;i++)l=n(l.getFullYear(),i,l.getDate()),a.push({label:l.toLocaleDateString(t.locale,{month:"short"}),value:n(e.getFullYear(),i,e.getDate()).toDateString()});t.$yearContainer.removeClass("smart-calendar-selected"),t.$dateContainer.addClass("smart-calendar-selected")}else{let n=t.min.getFullYear(),l=t.max.getFullYear();l=Math.min(t.max.getFullYear(),e.getFullYear()+10),n=Math.max(t.min.getFullYear(),l-10);for(let t=n;t<l;t++)a.push({label:t.toString(),value:new Date(t,e.getMonth(),e.getDate()).toDateString()});t.$yearContainer.addClass("smart-calendar-selected"),t.$dateContainer.removeClass("smart-calendar-selected")}t._prepareListViewer(a,e.toDateString()),t._refreshHeaderTitle(),t._refreshHeaderElements(),t.unfocusable||t.focus()}_prepareListViewer(e=[],t){const a=this,n=a.$.body;let l=a.$.listViewContainer;l||(a.$.listViewContainer=l=document.createElement("smart-scroll-viewer"),l.classList.add("smart-input-drop-down-menu","smart-calendar-list-view"),l.ensureVisible=a._listViewerEnsureVisible.bind(a),l._handleKeyStrokes=a._listViewerKeyStrokesHandler.bind(a),l._setActiveDescendant=a._listViewerSetActiveDescendant.bind(a));let i=l.querySelector("ul");i||(i=document.createElement("ul"),i.onclick=a._listViewContainerItemClickHandler.bind(a),l.appendChild(i)),n.contains(l)&&n.removeChild(l),i.innerHTML="";for(let a=0;a<e.length;a++){const n=e[a],s=n.label,o=n.value,r=document.createElement("li"),d=document.createElement("a");t===o?(r.setAttribute("aria-selected",!0),r.classList.add("active"),t=r):r.setAttribute("aria-selected",!1),r.id=l.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),r.setAttribute("value",o),r.setAttribute("role","option"),r.setAttribute("aria-label",s),d.innerHTML=s,d.setAttribute("aria-hidden",!0),r.appendChild(d),i.appendChild(r)}l.classList.remove("smart-hidden"),n.classList.add("smart-calendar-list-view"),n.removeAttribute("tabindex"),n.insertBefore(l,a.$.animationPanel),l.refresh(),l.ensureVisible()}_listViewerEnsureVisible(){const e=this.$.listViewContainer,t=e.querySelector(".active");if(!t)return;const a=Array.from(e.querySelectorAll("li"));t.offsetTop+t.offsetHeight>=e.scrollTop+e.offsetHeight&&(e.scrollTop=t.offsetTop+t.offsetHeight),(t.offsetTop<=e.scrollTop||t.offsetTop>=e.scrollTop+e.offsetHeight)&&(e.scrollTop=t.offsetTop),0===a.indexOf(t)?e.scrollTop=0:a.indexOf(t)===a.length-1&&(e.scrollTop=e.scrollHeight)}_listViewerKeyStrokesHandler(e){if(["ArrowUp","ArrowDown"].indexOf(e)<0)return;event.preventDefault();const t=this.$.listViewContainer,a=t.querySelector(".active");if(!a){const e=t.querySelector("li");return e.classList.add("active"),void t._setActiveDescendant(e)}const n=a["ArrowDown"===e?"nextElementSibling":"previousElementSibling"];n&&(a.classList.remove("active"),n.classList.add("active"),t._setActiveDescendant(n),t.ensureVisible())}_listViewerSetActiveDescendant(e){const t=this.$.listViewContainer;e?t.setAttribute("aria-activedescendant",e.id):t.removeAttribute("aria-activedescendant")}_listViewContainerItemClickHandler(e){const t=this,a=e.target.closest("li");a&&"list"===t.displayModeView&&"month"!==t.displayMode&&t._displayModeHandler(a)}_isDateInView(e){const t=this;if(!e)return!1;for(let a=0;a<t._viewDates.length;a++)if(e.getFullYear()===t._viewDates[a].getFullYear()&&e.getMonth()===t._viewDates[a].getMonth()){let a=t._getCellByDate(e,t._animationStarted?t.$.nextMonthsContainer:void 0);if(!a)return;return!(a.otherMonth||!a.offsetHeight||a.classList.contains("smart-visibility-hidden"))}return!1}_keyDownHandler(e){const t=this;if(t.disabled||t.readonly)return;const a=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement;switch(a){case t.$.yearElement:"Escape"===e.key&&t._refreshHeaderElements();break;case t.$.dateElement:if("default"===t.calendarMode&&" "===e.key||"Enter"===e.key)return e.preventDefault(),t._isInteractiveNavigation=!0,void t._showDateView();t._focusedCell||t._focusCell(),e.key.indexOf("Arrow")>-1&&t.$.dateElement===a&&!t.unfocusable&&t.$.body.focus(),t._navigateDays(e);break;case t.$.body:" "===e.key&&e.preventDefault(),t._navigateDays(e);break;case t.$.yearContainer:if(" "!==e.key&&"Enter"!==e.key||"decade"===t.displayMode||(e.preventDefault(),t._isInteractiveNavigation=!0,t._showDateView("year")),e.key.indexOf("Arrow")>-1){if(e.preventDefault(),t._focusedCell||t._focusCell(),"month"!==t.displayMode&&"list"===t.displayModeView)return t.unfocusable||t.focus(),void t.$.listViewContainer._handleKeyStrokes(e.key);t._navigateDays(e)}break;case t.$.dateContainer:if(" "!==e.key&&"Enter"!==e.key||"month"===t.displayMode||(e.preventDefault(),t._displayModeHandler("list"===t.displayModeView?t.$.listViewContainer.querySelector("li.active"):t._focusedCell,"month")),e.key.indexOf("Arrow")>-1){if(t._focusedCell||t._focusCell(),"month"!==t.displayMode&&"list"===t.displayModeView)return t.unfocusable||t.focus(),void t.$.listViewContainer._handleKeyStrokes(e.key);t._navigateDays(e)}break;default:if("month"!==t.displayMode&&"list"===t.displayModeView)return["Arrow","End","Home","Page"].indexOf(e.key)&&e.preventDefault()," "===e.key||"Enter"===e.key||e.ctrlKey&&("ArrowUp"===e.key||"ArrowDown"===e.key)?void t._navigateDays(e):void t.$.listViewContainer._handleKeyStrokes(e.key);e.key.indexOf("Arrow")>-1&&(t._focusedCell||t._focusCell(),t._navigateDays(e))}}_showDateView(e){const t=this;switch(e=e||t.displayMode){case"month":e="year";break;case"year":e="decade"}if(t.displayMode===e)return;if(t.$.fireEvent("displayModeChanging",{oldDisplayMode:t.displayMode,newDisplayMode:e}).defaultPrevented)return;let a;if(t.displayMode=e,"list"===t.displayModeView&&"month"!==t.displayMode){t._setDisplayModeListContent(t._focusedCell?t._focusedCell.value:t._viewDates[0]);const e=t.$.listViewContainer;e.classList.remove("smart-hidden"),a=e.querySelector("li.active"),a.offsetHeight?t.$.animationPanel.style.transformOrigin=a.offsetLeft+a.offsetWidth/2+"px "+(a.offsetTop>0?a.offsetTop-a.offsetHeight/2:a.offsetTop+a.offsetHeight/2)+"px":t.$.animationPanel.style.transformOrigin=e.offsetLeft+e.offsetWidth/2+"px "+(a.offsetTop>0?a.offsetTop-a.offsetHeight/2:e.offsetTop+e.offsetHeight/2)+"px"}else t._focusedCell||t._focusCell(),a=t._focusedCell,t.$.animationPanel.style.transformOrigin=a.offsetLeft+a.offsetWidth/2+"px "+(a.offsetTop+a.offsetHeight/2)+"px";t.$monthsContainer.addClass("smart-hidden"),t.$dateViewContainer.hasClass("smart-hidden")&&t.$dateViewContainer.removeClass("smart-hidden"),"decade"===t.displayMode&&(t.$yearContainer.addClass("smart-calendar-selected"),t.$dateContainer.removeClass("smart-calendar-selected")),t.hasAnimation?t._animateView(-1,a):t._setDisplayModeContent(t._focusedCell?t._focusedCell.value:t._viewDates[0])}_keyUpHandler(e){const t=this;t.disabled||t.readonly||"default"!==t.selectionMode&&"range"!==t.selectionMode||"Shift"!==e.key&&"Control"!==e.key||(t._keysPressed[e.key]=!1)}_handleTooltip(){const e=this,t=e.tooltip;let a=e.$.tooltip;t?(a||(a=document.createElement("smart-tooltip"),a.tooltipTemplate=e.tooltipTemplate,a.arrow=e.tooltipArrow,a.arrowDirection=e.tooltipArrowDirection,a.offset=e.tooltipOffset,a.position=e.tooltipPosition,a.delay=e.tooltipDelay,a.rightToLeft=e.rightToLeft,a.openMode="manual",e.$.tooltip=a),a.parentElement||e.$.calendarContainer.appendChild(a)):a&&a.remove()}_mouseEventsHandler(e){const t=this;if(t.disabled||t.readonly)return;const a=t.$.tooltip;if("mouseenter"===e.type)return void t.$.setAttributeValue("hover",!0);if("mouseleave"===e.type){if(t.$.setAttributeValue("hover",!1),t._newRangeSelectionStarted&&"range"===t.selectionMode){const e=t.$.monthsContainer.children;for(let a=0;a<e.length;a++)t._getMonthCells(e[a]).map((e=>{t._setCellState(e,"hover",!1)}))}return void(t.tooltip&&a&&a.close())}const n=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target;if(!n.closest(".smart-calendar-week"))return void(t.tooltip&&a&&(clearTimeout(t._tooltipAutoCloseTimeout),a[a.contains(n)?"open":"close"]()));const l=n.closest(".smart-calendar-cell");if(!l)return;if(Smart.Utilities.Core.isMobile||t._handleCalendarCellHover(e,l),!t.tooltip&&a)return void a.close();const i=l.hasAttribute("important");if(clearTimeout(t._tooltipAutoCloseTimeout),i&&a&&"mouseover"===e.type)return a.selector=l,void(a.selector!==l?a.close():(t.tooltipTemplate||(a.innerHTML=0===a.innerHTML.trim().length?"Important day!":a.innerHTML),a.open(),t.$.fireEvent("open",{target:a,value:new Date(l.value)})));t._tooltipAutoCloseTimeout=setTimeout(function(){!a||"mouseout"!==e.type&&l&&i||a.close(),clearTimeout(t._tooltipAutoCloseTimeout)}.bind(t),t.tooltipDelay)}_popupEventHandler(e){const t=this,a=t.$.tooltip;if(e.stopPropagation(),e.target!==t.$.monthElement)if(e.target===a)if("close"!==e.type);else{const e=a.selector;t.$.fireEvent("close",{target:a,value:e?new Date(e.value):null})}else t.$.fireEvent(e.type,{target:e.target})}_moveHandler(e){const t=this;if(!Smart.Utilities.Core.isMobile||!t._dragStartDetails||"list"===t.displayModeView&&"month"!==t.displayMode)return;e.originalEvent.preventDefault(),e.preventDefault(),e.stopPropagation();const a={x:Math.round(e.pageX),y:Math.round(e.pageY)};let n,l,i;if(n="portrait"===t.scrollButtonsNavigationMode?a.y>t._dragStartDetails.y?-1*t.months:1*t.months:a.x<t._dragStartDetails.x?1*t.months:-1*t.months,t._previousIteration&&n===t._previousIteration.step)l=t._previousIteration.date;else if(6!==t.weeks&&0!==t.weeks&&"month"===t.displayMode){let e,a;t._focusedCell||t._focusCell();const i=[].slice.call(t._focusedCell.closest(".smart-calendar-weeks").children).filter((e=>!e.classList.contains("smart-hidden")));if(i.length){let s;!t.rightToLeft&&n<0||t.rightToLeft&&n>0?(s=i[0].querySelectorAll(".smart-calendar-cell"),a=t.rightToLeft?s[s.length-1]:s[0]):(s=i[i.length-1].querySelectorAll(".smart-calendar-cell"),a=t.rightToLeft?s[0]:s[s.length-1]),e=new Date(a.value),e.setDate(e.getDate()+n*(t.rightToLeft?-1:1)),l=e}else l=t._getNextDate(n*(t.rightToLeft?-1:1))}else l=t._getNextDate(n*(t.rightToLeft?-1:1));if(!l)return;if(!t._dragStartDetails.navigationDate&&t.$.fireEvent("navigationChanging",{value:new Date(l),type:t.displayMode}).defaultPrevented)return t._cancelAnimation(),void(t._dragStartDetails=void 0);if(t._dragStartDetails.step=n,t._dragStartDetails.navigationDate=new Date(l),!t.hasAnimation)return;if(t._previousIteration={step:n,date:l},t._mobileScrolling=!0,"month"!==t.displayMode)t.$nextMonthsContainer.addClass("smart-calendar-date-view-container"),i=t.$.dateViewContainer,t.$.nextMonthsContainer.children[0].value instanceof Date&&t.$.nextMonthsContainer.children[1].value.getFullYear()===l.getFullYear()||t._setDisplayModeContent(l,t.$.nextMonthsContainer);else if(t.$nextMonthsContainer.hasClass("smart-calendar-date-view-container")&&t.$nextMonthsContainer.removeClass("smart-calendar-date-view-container"),i=t.$.monthsContainer,!t.$.nextMonthsContainer.children[0]._date||t.$.nextMonthsContainer.children[0]._date.getTime()!==l.getTime()){let e=t.$.nextMonthsContainer.children;for(let a=0;a<e.length;a++)l.setMonth(t._dragStartDetails.navigationDate.getMonth()+a*(t.rightToLeft?-1:1)),t._setMonth(new Date(l),e[a],!0)}6!==t.weeks&&0!==t.weeks&&"month"===t.displayMode&&t._updateWeeksVisibility(n*(t.rightToLeft?-1:1),t._getCellByDate(l,t.$.nextMonthsContainer)),delete t._mobileScrolling,n<0?(i.style.order=3,t.$.nextMonthsContainer.style.order=1,t.$.body[t._animationSettings.scrollSize]=t.$.body[t._animationSettings.scrollMax]):(i.style.order=1,t.$.nextMonthsContainer.style.order=3,t.$.body[t._animationSettings.scrollSize]=0);const s="portrait"===t.scrollButtonsNavigationMode?"y":"x";Math.abs(t._dragStartDetails[s]-a[s])>5&&(t.$.body[t._animationSettings.scrollSize]+=2*-(a[s]-t._dragStartDetails[s]))}_getNextDate(e){const t=this;let a;if("month"!==t.displayMode){let n;const l=t._focusedCell&&t._focusedCell.value.getFullYear();if("list"===t.displayModeView)a=new Date(t.$.listViewContainer.querySelector("li").getAttribute("value"));else{let e=t._animationStarted?t.$.nextMonthsContainer:t.$.dateViewContainer;a=new Date("year"===t.displayMode?e.children[0].value:e.children[1].value)}n="year"===t.displayMode?1:0!==e?10:1,a.setFullYear(a.getFullYear()+(e>0?n:-n)),a.getTime()<t.min.getTime()&&(a=t.min),a.getTime()>t.max.getTime()&&(a=t.max);const i="month"!==t.displayMode&&"list"===t.displayModeView;if(a.getFullYear()<t.min.getFullYear()||a.getFullYear()>t.max.getFullYear()||!i&&l===a.getFullYear())return}else{let n=t._viewDates[0];if(a=new Date(n),a.setDate(1),a.setMonth(a.getMonth()+e),a.setTime(Math.min(Math.max(a.getTime(),t.min.getTime()),t.max.getTime())),n.getMonth()===a.getMonth()&&n.getFullYear()===a.getFullYear())return}return a}_navigateDays(e){const t=this;let a="ArrowUp"===e.key||"ArrowDown"===e.key?7:1,n="ArrowUp"===e.key||"ArrowLeft"===e.key||"PageUp"===e.key?-1:1;switch(e.key){case"ArrowUp":case"ArrowLeft":case"ArrowDown":case"ArrowRight":if(!t._handleArrowKeys(e,a,n))return;break;case" ":case"Enter":{if("month"!==t.displayMode)return void t._displayModeHandler("list"===t.displayModeView?t.$.listViewContainer.querySelector("li.active"):t._focusedCell);const e=t._focusedCell;if("oneExtended"===t.selectionMode&&e)return t._clearSelection(!0),void t._selectDate(e.value,t._selectedCells.indexOf(e.value)>-1);break}case"Control":case"Shift":return"default"===t.selectionMode&&(t._keysPressed[e.key]=!0),void("range"===t.selectionMode&&(t._keysPressed[e.key]="Control"===e.key));case"Home":case"End":{e.preventDefault();let a,n=function(t){if("Home"===e.key){for(let e=0;e<t.length;e++)if(!t[e].otherMonth&&(!t[e].disabled||!t[e].restricted)&&t[e].offsetHeight)return t[e]}else for(let e=t.length-1;e>=0;e--)if(!t[e].otherMonth&&(!t[e].disabled||!t[e].restricted)&&t[e].offsetHeight)return t[e]};if(a="month"!==t.displayMode?n(t.$.dateViewContainer.children):n(t._getMonthCells(t._focusedCell.closest(".smart-calendar-month"),t.rightToLeft)),!a)return;if(t._focusCell(a),"month"!==t.displayMode)return;break}case"PageUp":case"PageDown":if(!t._handlePageUpDownKeys(e,n))return;break;default:return}"oneExtended"!==t.selectionMode&&t._focusedCell&&t._handleDateSelection(t._focusedCell)}_handleArrowKeys(e,t,a){const n=this;let l;if("month"!==n.displayMode||n._animationStarted||n.unfocusable||n.$.body.focus(),n._focusedCell||n._focusCell(n._getCellByDate(new Date)),e.altKey)return;if(e.ctrlKey){if("ArrowDown"===e.key||"ArrowUp"===e.key){if("classic"===n.calendarMode)return;let t;switch(n.displayMode){case"month":t="ArrowDown"===e.key?"month":"year";break;case"year":t="ArrowDown"===e.key?"month":"decade";break;case"decade":t="ArrowDown"===e.key?"year":"decade"}if(t!==n.displayMode){const e=n.displayMode;n.displayMode=t,n._setDisplayMode(e,t,"month"===e),n._keysPressed&&delete n._keysPressed.Control}}return}if(e.preventDefault(),!n.rightToLeft||"ArrowLeft"!==e.key&&"ArrowRight"!==e.key||(a*=-1),"month"!==n.displayMode&&"list"!==n.displayModeView){const i=n._animationStarted?n.$.nextMonthsContainer.children:n.$.dateViewContainer.children;if(t="ArrowUp"===e.key||"ArrowDown"===e.key?4:1,"year"===n.displayMode){const e=n._focusedCell.value.getMonth()+a*t;let i=new Date(n._focusedCell.value.getFullYear(),e+1,0);n._focusedCell.value.getDate()<=i.getDate()&&(i=n._focusedCell.value),l=new Date(n._focusedCell.value.getFullYear(),e,i.getDate())}else l=new Date(n._focusedCell.value.getFullYear()+a*t,n._focusedCell.value.getMonth(),n._focusedCell.value.getDate());if("year"===n.displayMode){if(l.getFullYear()<n.min.getFullYear()||l.getFullYear()===n.min.getFullYear()&&l.getMonth()<n.min.getMonth()||l.getFullYear()>n.max.getFullYear()||l.getFullYear()===n.max.getFullYear()&&l.getMonth()>n.max.getMonth())return;l.getTime()>i[i.length-1].value.getTime()?n.navigate(1):l.getTime()<i[0].value.getTime()&&n.navigate(-1)}else{if(l.getFullYear()<n.min.getFullYear()||l.getFullYear()>n.max.getFullYear())return;if(l.getFullYear()<i[1].value.getFullYear()||l.getFullYear()>i[10].value.getFullYear()){let t=n._focusedCell;n.navigate(a),"ArrowUp"!==e.key&&"ArrowDown"!==e.key||(t===i[3]||t===i[4]||t===i[7]||t===i[8]?l.setFullYear(l.getFullYear()+2*a):l.setFullYear(l.getFullYear()-2*a))}}return void n._focusCell(n._getCellByDate(l,n._animationStarted?n.$.nextMonthsContainer:void 0))}if(!n._focusedCell)return;const i=n.restrictedDates.map(Number);for(l=new Date(n._focusedCell.value.getFullYear(),n._focusedCell.value.getMonth(),n._focusedCell.value.getDate()+a*t,0,0,0,0);i.indexOf(l.getTime())>-1;)l.setDate(l.getDate()+a);if(l.getTime()<n.min.getTime()||l.getTime()>n.max.getTime())return;n._isDateInView(l)||n.navigate(a*n.months);let s=n._getCellByDate(l,n._animationStarted?n.$.nextMonthsContainer:void 0);return n._focusCell(s),n._updateWeeksVisibility(a),!(["zeroOrMany","oneOrMany","none","many","week","range"].indexOf(n.selectionMode)>-1)||void 0}_handlePageUpDownKeys(e,t){const a=this;let n;if(e.preventDefault(),"month"!==a.displayMode){if(n=a._focusedCell,!a.navigate(t))return;for(;n&&n.classList.contains("smart-visibility-hidden");)n=null===n.previousElementSibling?n.nextElementSibling:n.previousElementSibling;return a._focusCell(n),void(a.hasAnimation&&"decade"===a.displayMode&&a._focusedCell.value.setFullYear(a._focusedCell.value.getFullYear()+10*t))}n=new Date(a._focusedCell.value.getFullYear(),a._focusedCell.value.getMonth()+t,1,0,0,0,0);let l=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return a._focusedCell.value.getDate()>l?n.setDate(l):n.setDate(a._focusedCell.value.getDate()),a._isDateInView(n)||a.navigate(n),a._animationStarted?a._focusCell(a._getCellByDate(n,a.$.nextMonthsContainer)):a._focusCell(a._getCellByDate(n)),!0}_selectDate(e,t,a){const n=this;if(void 0===n._viewDates||"none"===n.selectionMode)return;let l,i=n.selectedDates.slice(0),s=n._getCellByDate(e,n._animationStarted?n.$.nextMonthsContainer:void 0);s&&n._selectCell(s),(e=new Date(e)).setHours(0,0,0,0),l=i.map(Number).indexOf(e.getTime()),n.restrictedDates.map(Number).indexOf(e.getTime())>-1||e.getTime()<n.min.getTime()||e.getTime()>n.max.getTime()||(l>-1?i.splice(l,1):i.push(e),a||(n.selectedDates=i),n._refreshFooter(),n.$.hiddenInput.value=n.selectedDates.toString(),!t&&n.isInitialized&&(n.$.fireEvent("change",{value:[e]}),n._updateTargetValue()),n._refreshTitle())}_selectCell(e){const t=this;if(!e||t.restrictedDates.map(Number).indexOf(e.value.getTime())>-1||t.disableAutoNavigation&&!1===e.otherMonth||e.value.getTime()<t.min.getTime()||e.value.getTime()>t.max.getTime())return;const a=t._selectedCells.indexOf(e);a>-1?(t._setCellState(e,"selected",!1),t._selectedCells.splice(a,1)):(t._setCellState(e,"selected",!0),t._selectedCells.push(e)),t._focusCell(e)}_refreshDayOfWeekTitles(){const e=this;let t,a=[],n=new Date;function l(t){let a;return"firstTwoLetters"===e.dayNameFormat?(a=new Intl.DateTimeFormat(e.locale,{weekday:"long"}).format(t),a=8206===a.charCodeAt(0)?a.substring(1,3):a.substring(0,2)):a=new Intl.DateTimeFormat(e.locale,{weekday:e.dayNameFormat}).format(t),a}for(let e=1;e<8;e++)n.setDate(e),t={number:n.getDay(),name:l(n)},a.push(t);a.sort(((e,t)=>e.number>t.number?1:-1));const i=e.$.monthsContainer.children;let s,o;for(let t=0;t<i.length;t++)if(s=i[t].getElementsByClassName("smart-calendar-week-titles")[0].children,o=e.firstDayOfWeek>6?0:e.firstDayOfWeek,e.rightToLeft)for(let e=s.length-1;e>=1;e--)s[e].textContent=a[o++].name,o=o>6?0:o;else for(let e=1;e<s.length;e++)s[e].textContent=a[o++].name,o=o>6?0:o;if(e.hasAnimation){const t=e.$.monthsContainer.getElementsByClassName("smart-calendar-week-titles")[0].innerHTML,a=e.$.nextMonthsContainer.getElementsByClassName("smart-calendar-week-titles");for(let e=0;e<a.length;e++)a[e].innerHTML=t}}_refreshCalendarMode(){const e=this;if(!e.headerTemplate)if(e._refreshMonthNames(),"default"===e.calendarMode){e.$classicHeaderDate.addClass("smart-hidden"),e.$defaultHeaderDate.removeClass("smart-hidden");const t=e._viewDates.slice(0).sort(((e,t)=>e.getTime()-t.getTime())),a=t[0],n=t[t.length-1];a.setDate(2);let l=e.monthNameFormat;"firstTwoLetters"===l&&(l="long");let i=a.toLocaleDateString(e.locale,{year:e.yearFormat,month:l});e.months>1&&(n.setDate(2),i+=" - "+n.toLocaleDateString(e.locale,{year:e.yearFormat,month:l})),e.$.defaultHeaderDate.innerHTML=i,e.unfocusable||e.$.dateElement.setAttribute("tabindex",e.tabIndex>0?e.tabIndex:0)}else e.$defaultHeaderDate.addClass("smart-hidden"),e.$classicHeaderDate.removeClass("smart-hidden"),e.$.dateElement.removeAttribute("tabindex")}_refreshFooter(){const e=this;if(!(e.viewSections.indexOf("footer")<0||0===e.$.footer.offsetHeight))if(e.footerTemplate){if("function"==typeof e.footerTemplate)return;let a=e._layoutTemplates.filter((t=>t.selector===e.$.footer))[0],n=document.importNode(a.template.content,!0);if(a.bindings.length>0){let e=n.childNodes[a.bindings[0].childNodeIndex];a.selector.childNodes[a.bindings[0].childNodeIndex].innerHTML=e.innerHTML.replace(a.bindings[0].bindingString,t())}}else e.$.selectedDatesRange.innerHTML=t();function t(){if(0===e.selectedDates.length)return"";if(1===e.selectedDates.length)return e.selectedDates[0].toLocaleDateString(e.locale,{year:e.yearFormat,weekday:"short",month:"short",day:"numeric"});{let t=e.selectedDates.slice(0).sort(((e,t)=>e.getTime()-t.getTime()));return t[0].toLocaleDateString(e.locale,{year:e.yearFormat,weekday:"short",month:"short",day:"numeric"})+" - "+t[t.length-1].toLocaleDateString(e.locale,{year:e.yearFormat,weekday:"short",month:"short",day:"numeric"})}}}_refreshImportantDates(){const e=this;if("month"===e.displayMode){e._clearImportantDates();for(let t=0;t<e.importantDates.length;t++)e._setImportantDate(e.importantDates[t])}}_clearImportantDates(){const e=this,t=e.$.monthsContainer.children;for(let a=0;a<t.length;a++)e._getMonthCells(t[a]).map((t=>{e._setCellState(t,"important",!1)}))}_setImportantDate(e,t){const a=this,n=a._getCellByDate(e);t||(t=n),t&&(a._setCellState(t,"important",!0),a._applyImportantDateTemplate(t))}_applyImportantDateTemplate(e){const t=this;if(!t._importantDatesTemplate)return"function"==typeof t.importantDatesTemplate?void t.importantDatesTemplate(e,{value:e.value}):void(e.innerHTML=e.value.getDate()+"");let a=document.importNode(t._importantDatesTemplate.content,!0);if(t._bindingDetails&&t._bindingDetails.length>0){let n=a.childNodes[t._bindingDetails[0].childNodeIndex];n.innerHTML=n.innerHTML.replace(t._bindingDetails[0].bindingString,e.value.getDate())}e.innerHTML="";for(let t=0;t<a.childNodes.length;t++)a.childNodes[t].outerHTML&&(e.innerHTML+=a.childNodes[t].outerHTML)}_setMonth(e,t,a){const n=this,l=n._getDays(e,n.selectedDates),i=n._getDays(e,n.importantDates),s=n._getDays(e,n.restrictedDates);e.setDate(1),t||(t=n.$.month),t._date=new Date(e),a||((!n._viewDates||n._viewDates.length>=n.months)&&(n._viewDates=[]),n._viewDates.push(new Date(e)));let o=((e=new Date(e)).getDay()-n.firstDayOfWeek+7)%7;e.setDate(0);let r=e.getDate();if(e.setDate(32),e.setDate(1),e.setDate(32),n._selectedCells)for(let e=0;e<n._selectedCells.length;e++)n._selectedCells[e].closest(".smart-calendar-month")===t&&n._setCellState(n._selectedCells[e],"selected",!1);n._setMonthContent(e,t,{previusMonthDays:r,firstDayOfWeek:o,selectedDates:l,importantDates:i,restrictedDates:s})}_setMonthContent(e,t,a){const n=this,l=32-e.getDate(),i=n._getMonthCells(t,n.rightToLeft),s=t._date.getMonth(),o=t._date.getFullYear(),r=new Date;let d,c=1,m=1;r.setHours(0,0,0,0),i.map((e=>{n._setCellState(e,"restricted",!1),n._setCellState(e,"selected",!1),n._setCellState(e,"otherMonth",!1),n._setCellState(e,"focus",!1),n._setCellState(e,"important",!1),n._setCellState(e,"today",!1),n._setCellState(e,"disabled",!1),n._setCellState(e,"hover",!1)}));for(let e=0;e<i.length;e++){const h=i[e];e===a.firstDayOfWeek&&m<=l?(h.className="smart-calendar-cell",h.value=new Date(o,s,m),h.innerHTML=h.value.getDate().toString(),a.restrictedDates.indexOf(m)>-1||h.value.getTime()<n.min.getTime()||h.value.getTime()>n.max.getTime()?n._setCellState(h,"restricted",!0):a.selectedDates.indexOf(m)>-1&&(n._setCellState(h,"selected",!0),n._selectedCells.indexOf(h)<0&&n._selectedCells.push(h)),a.importantDates.indexOf(m)>-1&&(n._setImportantDate(h.value,h),a.importantDates.splice(a.importantDates.indexOf(m),1)),h.value.getTime()===r.getTime()&&n._setCellState(h,"today",!0),a.firstDayOfWeek++,m++):(1===m?(h.value=new Date(o,s-1,++a.previusMonthDays-a.firstDayOfWeek),d=!!(h.value.getTime()<n.min.getTime()||t.previousElementSibling)):(h.value=new Date(o,s+1,c++),d=!!(h.value.getTime()>n.max.getTime()||t.nextElementSibling)),h.innerHTML=h.value.getDate().toString(),n._setCellState(h,"otherMonth",!0),d?h.classList.add("smart-visibility-hidden"):h.classList.remove("smart-visibility-hidden"))}n.months>1&&(t.firstElementChild.innerHTML=n.dateFormatFunction?n.dateFormatFunction(t._date):n._monthsNames[s]+" "+t._date.toLocaleDateString(n.locale,{year:n.yearFormat})),n._setMonthWeekNumbers(t)}_refreshMonthNames(){const e=this;let t,a=new Date;function n(t){let a=e.monthNameFormat;"firstTwoLetters"===a&&(a="long");let n=new Intl.DateTimeFormat(e.locale,{month:a}).format(t);return"firstTwoLetters"===e.monthNameFormat&&(n=8206===n.charCodeAt(0)?n.substring(0,2):n.substring(1,3)),n}a.setDate(1),e._monthsNames=[];for(let l=0;l<12;l++)a.setMonth(l),t=n(a),e._monthsNames.push(t);if("classic"===e.calendarMode&&e.$.monthElement){let t=e.$.monthsContainer.children;if(e.$.monthElement.dataSource&&(e._changeEventFired=1),e.shadowRoot?e._setMonthElementPropertyInShadowDOM("dataSource",e._monthsNames):e.$.monthElement.dataSource=e._monthsNames,e._viewDates){for(let a=0;a<t.length;a++)t[a].firstElementChild.textContent=e._monthsNames[t[a]._date.getMonth()]+" "+t[a]._date.getFullYear();e._changeEventFired=1,e.shadowRoot?e._setMonthElementPropertyInShadowDOM("selectedIndex",e._viewDates.map((e=>e.getMonth()))[0]):e.$.monthElement.selectedIndex=e._viewDates.map((e=>e.getMonth()))[0]}}}_setMonthWeekNumbers(e){const t=this,a=function(e){for(let t=1;t<e.children.length;t++)if(!e.children[t].classList.contains("smart-visibility-hidden"))return!0};let n=e.getElementsByClassName("smart-calendar-week");n=[].slice.call(n);for(let l=0;l<n.length;l++){if(!a(n[l])){n[l].children[0].innerHTML="";continue}const i=n[l].children[1],s=i.otherMonth?i.value.getTime()>e._date.getTime()?1:-1:0;n[l].children[0].innerHTML=t._getWeekNumber(new Date(e._date.getFullYear(),e._date.getMonth()+s,i.value.getDate()))}}_setRestrictedDates(e){const t=this,a=t.$.monthsContainer.children;for(let e=0;e<a.length;e++)t._getMonthCells(a[e]).map((e=>{t._setCellState(e,"restricted",!1)}));if(t._viewDates){const a=function(e){for(let a=0;a<t._viewDates.length;a++)if(t._viewDates[a].getFullYear()===e.getFullYear()&&t._viewDates[a].getMonth()===e.getMonth())return!0};for(let n=0;n<e.length;n++)if(a(e[n])){const a=t._getCellByDate(e[n]);t._setCellState(a,"restricted",!0)}}}_setScrollButtonsNavigationMode(){const e=this;"landscape"!==e.scrollButtonsNavigationMode?(e.$.previousMonthButton&&(e.$.previousMonthButton.$.button.firstElementChild.className="smart-arrow-down smart-arrow"),e.$.nextMonthButton&&(e.$.nextMonthButton.$.button.firstElementChild.className="smart-arrow-up smart-arrow")):(e.$.previousMonthButton&&(e.$.previousMonthButton.$.button.firstElementChild.className="smart-arrow-left smart-arrow"),e.$.nextMonthButton&&(e.$.nextMonthButton.$.button.firstElementChild.className="smart-arrow-right smart-arrow")),e._applyAnimationSettings(!0)}_refreshTitle(){const e=this;let t=e.selectedDates.length>0?e.selectedDates[e.selectedDates.length-1]:new Date;if(e.titleTemplate){if("function"==typeof e.titleTemplate)return;let a=e._layoutTemplates.filter((t=>t.selector===e.$.title))[0],n=document.importNode(a.template.content,!0);if(a.bindings.length>0){let l=n.childNodes[a.bindings[0].childNodeIndex];return t=t.toLocaleDateString(e.locale,{year:e.yearFormat,weekday:"short",month:"short",day:"numeric"}),void(a.selector.childNodes[a.bindings[0].childNodeIndex].innerHTML=l.innerHTML.replace(a.bindings[0].bindingString,t))}}e.$.title.children[0].innerHTML=t.toLocaleDateString(e.locale,{year:e.yearFormat}),e.$.title.children[1].innerHTML="landscape"===e.view?t.toLocaleDateString(e.locale,{weekday:"short"})+",</br>"+t.toLocaleDateString(e.locale,{month:"short",day:"numeric"}):t.toLocaleDateString(e.locale,{weekday:"short"})+", "+t.toLocaleDateString(e.locale,{month:"short",day:"numeric"})}_setWeeksVisibility(e){const t=this,a=e.children;let n;function l(e){(function(e){for(let t=1;t<e.children.length;t++)if(!e.children[t].classList.contains("smart-visibility-hidden"))return!1;return!0})(e)||n>=t.weeks?e.classList.add("smart-hidden"):n<t.weeks&&(e.classList.remove("smart-hidden"),n++)}for(let e=0;e<a.length;e++){let i=a[e].getElementsByClassName("smart-calendar-week");i=[].slice.call(i);let s=t._selectedCells.filter((t=>t.closest(".smart-calendar-month")===a[e]));if(6!==t.weeks)if(n=0,s.length>0){let e=s[s.length-1],t=i.indexOf(e.parentElement);for(let e=t;e<i.length;e++)l(i[e]);for(let e=t-1;e>=0;e--)l(i[e])}else for(let e=0;e<i.length;e++)l(i[e]);else i.map((e=>e.classList.remove("smart-hidden")))}}_refreshHeaderElements(){const e=this,t=document.activeElement.closest("smart-calendar")===e,a=e._animationStarted?e.$.nextMonthsContainer:e.$.dateViewContainer;let n,l,i=e._viewDates[e._viewDates.length-1],s=e._viewDates.map((e=>e.getFullYear()));if("month"===e.displayMode||"list"!==e.displayModeView){if("classic"===e.calendarMode&&e.$.monthElement&&e.$.monthElement instanceof HTMLDivElement){const t=document.createElement("smart-input");t.setAttribute("smart-id","monthElement"),t.classList.add("smart-calendar-month-element"),t.dropDownPosition="bottom",t.selectionMode="one",t.disabled=e.disabled,t.rightToLeft=e.rightToLeft,t.theme=e.theme,t.dropDownWidth=e.dropDownWidth,t.dropDownHeight=e.dropDownHeight,t.readonly=!0,t.dropDownButtonPosition="right";const a=e.$.monthElement;e.$.monthElement.parentNode.insertBefore(t,e.$.monthElement),e.$.monthElement=t,a.remove()}if(e.$.previousMonthButton&&!e.disabled&&("month"!==e.displayMode&&e.$.dateViewContainer.children[0].value?l="year"===e.displayMode?a.children[0].value.getFullYear()-1:a.children[1].value.getFullYear()-1:e._viewDates[0].getMonth()-1<0?(n=11,l=e._viewDates[0].getFullYear()-1):(n=e._viewDates[0].getMonth()-1,l=e._viewDates[0].getFullYear()),e.$.previousMonthButton.disabled=l<e.min.getFullYear()||l===e.min.getFullYear()&&n<e.min.getMonth(),e.$.previousMonthButton.disabled&&t&&e.$.body.focus()),e.$.nextMonthButton&&!e.disabled&&("month"!==e.displayMode&&e.$.dateViewContainer.children[0].value?l="year"===e.displayMode?a.children[0].value.getFullYear()+1:a.children[1].value.getFullYear()+11:i.getMonth()+1>11?(n=0,l=i.getFullYear()+1):(n=i.getMonth()+1,l=i.getFullYear()),e.$.nextMonthButton.disabled=l>e.max.getFullYear()||l===e.max.getFullYear()&&n>e.max.getMonth(),e.$.nextMonthButton.disabled&&t&&e.$.body.focus()),"classic"===e.calendarMode&&e.$.monthElement){let t=[...e._monthsNames];if(s.indexOf(e.min.getFullYear())>-1)for(let a=0;a<e.min.getMonth();a++)t[a]="";if(s.indexOf(e.max.getFullYear())>-1)for(let a=e.max.getMonth()+1;a<t.length;a++)t[a]="";t=t.filter((e=>""!==e));const a=Math.max(0,e.$.monthElement.selectedIndex);e.$.monthElement.dataSource=t,e._changeEventFired=0!==e.$.monthElement.selectedIndex,e.shadowRoot?e._setMonthElementPropertyInShadowDOM("selectedIndex",e._viewDates[0].getMonth()):e.$.monthElement.selectedIndex=a,e._changeEventFired=0}e.$.previousYearButton&&!e.disabled&&(l=e._viewDates[0].getFullYear()-1,e.$.previousYearButton.disabled=l<e.min.getFullYear(),e.$.previousYearButton.disabled&&t&&e.$.body.focus()),e.$.nextYearButton&&!e.disabled&&(l=i.getFullYear()+1,e.$.nextYearButton.disabled=l>e.max.getFullYear(),e.$.nextYearButton.disabled&&t&&e.$.body.focus()),e.$.yearElement&&(e.$.yearElement.value=s[0],e.$.yearElement.disabled=i.getFullYear()+1>e.max.getFullYear()&&e._viewDates[0].getFullYear()-1<e.min.getFullYear())}}_setMonthElementPropertyInShadowDOM(e,t){const a=this.$.monthElement,n=a.context;a.context=document,this.$.monthElement[e]=t,a.context=n}_refreshHeaderTitle(){const e=this;let t;function a(){if("month"!==e.displayMode){if("list"===e.displayModeView){const a=e.$.listViewContainer;if(!a)return;const n=a.querySelectorAll("li");if(!n.length)return"";let l;a.querySelector("li.active")&&(l=a.querySelector("li.active").getAttribute("value")),t="year"===e.displayMode?new Date(l||n[0].getAttribute("value")).getFullYear():new Date(n[0].getAttribute("value")).getFullYear()+" - "+new Date(n[n.length-1].getAttribute("value")).getFullYear()}else if(e.$.dateViewContainer.children[0].value){let a=e._animationStarted?e.$.nextMonthsContainer.children:e.$.dateViewContainer.children;t="year"===e.displayMode?a[0].value.getFullYear():a[1].value.getFullYear()+" - "+a[a.length-2].value.getFullYear()}if(t)return t}const a=e._viewDates.slice(0).sort(((e,t)=>e.getTime()-t.getTime())),n=a[0],l=a[a.length-1];n.setDate(2);let i=e.monthNameFormat;return"firstTwoLetters"===i&&(i="long"),t=n.toLocaleDateString(e.locale,{year:e.yearFormat,month:i}),e.months>1&&(l.setDate(2),t+=" - "+l.toLocaleDateString(e.locale,{year:e.yearFormat,month:i})),t}if("default"===e.calendarMode&&(e.$.defaultHeaderDate.innerHTML=a()),"function"==typeof e.headerTemplate||!e._layoutTemplates)return;let n=e._layoutTemplates.filter((t=>t.selector===e.$.header))[0];if(!n)return;let l=document.importNode(n.template.content,!0);if(n.bindings.length>0){const t=l.childNodes[n.bindings[0].childNodeIndex];(e.shadowRoot?e:n.selector).childNodes[n.bindings[0].childNodeIndex].innerHTML=t.innerHTML.replace(n.bindings[0].bindingString,e.dateFormatFunction?e.dateFormatFunction(e._viewDates):a())}}_updateWeeksVisibility(e,t){const a=this;let n=(t||a._focusedCell).parentElement;function l(){for(let e=o;e<s.length;e++)if(s[e].classList.contains("smart-hidden")&&!r(s[e])&&(s[e].classList.remove("smart-hidden"),d++,d===a.weeks))return!0}function i(){for(let e=o;e>=0;--e)if(s[e].classList.contains("smart-hidden")&&!r(s[e])&&(s[e].classList.remove("smart-hidden"),d++,d===a.weeks))return!0}if(!t&&!n.classList.contains("smart-hidden"))return;const s=[].slice.call(n.parentElement.children),o=s.indexOf(n),r=function(e){for(let t=1;t<e.children.length;t++)if(!e.children[t].classList.contains("smart-visibility-hidden"))return!1;return!0};let d=0;if(s.map((e=>e.classList.add("smart-hidden"))),e>0){if(l())return;i()}else{if(i())return;l()}}_getValidDates(e){let t=[];function a(e){if(e instanceof Date)return e;if(Smart.Utilities.DateTime&&e instanceof Smart.Utilities.DateTime)return e.toDate();if("string"==typeof e){if("new Date()"===e.trim()||"new Smart.Utilities.DateTime()"===e.trim())return new Date;let t=/(\d+[,-.\/]{1}\s*\d+[,-.\/]{1}\s*\d+)/;const a=()=>(e=e.replace(/[,-.\/]/g,",").split(",")).length>2?e=new Date(parseInt(e[0]),parseInt(e[1])-1,parseInt(e[2])):new Date;return t.test(e)&&(e=t.exec(e)[0].replace(/[,-.\/]/g,",").split(","))?new Date(parseInt(e[0]),parseInt(e[1])-1,parseInt(e[2])):a()}}if(void 0===e)return null;if(Array.isArray(e))for(let n=0;n<e.length;n++)t.push(a(e[n]));else t.push(a(e));return t=t.filter((e=>e&&"Invalid Date"!==e.toDateString())),t.map((e=>e.setHours(0,0,0,0))),t}_getValidDate(e){const t=this._getValidDates(e);return t.length>0?t[0]:null}_validateSelectedDates(e){const t=this;let a=[];e||(e=t.selectedDates);let n=e.slice(0),l=function(e){for(let a=0;a<t.restrictedDates.length;a++)if(t.restrictedDates[a].getTime()===e.getTime())return!0};t.selectedDates=n.filter((function(e){if(e.getTime()>=t.min.getTime()&&e.getTime()<=t.max.getTime()&&!l(e))return!0;a.push(e)})),t._viewDates&&(a.map((e=>t._selectDate(e))),t._focusCell())}_validateMinMax(e,t,a){const n=this;switch(e){case"min":t=n._getValidDate(n[e]),n.min=t||a||n.properties.min.defaultValue;break;case"max":t=n._getValidDate(n[e]),n.max=t||a||n.properties.max.defaultValue;break;default:t=n._getValidDate(n.min),n.min=t||a||n.properties.min.defaultValue,t=n._getValidDate(n.max),n.max=t||a||n.properties.max.defaultValue}n.min=n.min.getTime()>n.max.getTime()?n.max:n.min,n.min.setHours(0,0,0,0),n.max.setHours(0,0,0,0);let l,i=n.$.monthsContainer.children;if(n._viewDates){if(n._viewDates[0].getTime()>n.max.getTime()||n._viewDates[0].getTime()<n.min.getTime())return void n._handleMonths();for(let e=0;e<i.length;e++){l=n._getMonthCells(i[e]);for(let t=0;t<l.length;t++){const a=l[t];if(a.value.getTime()>=n.min.getTime()&&a.value.getTime()<=n.max.getTime())n._setCellState(a,"restricted",!1),a.value.getMonth()===i[e]._date.getMonth()?a.classList.remove("smart-visibility-hidden"):n.hideOtherMonthDays||(n._setCellState(a,"otherMonth",!0),a.classList.remove("smart-visibility-hidden")),"month"!==n.displayMode&&n._setCellState(a,"otherMonth",!1);else{if(a.otherMonth){if(a.classList.contains("smart-visibility-hidden")){n._setCellState(a,"restricted",!1);continue}}else n._setCellState(a,"restricted",!0);"month"!==n.displayMode&&(a.classList.remove("smart-visibility-hidden"),n._setCellState(a,"otherMonth",!0))}}}}}_setCellState(e,t,a){e[t]=a;const n=Smart.Utilities.Core.toDash(t);a?(e.setAttribute(n,""),"selected"===t?e.setAttribute("aria-selected",!0):"today"===t?e.setAttribute("aria-current","date"):"restricted"===t?e.removeAttribute("aria-selected"):"disabled"===t&&(e.removeAttribute("aria-selected"),e.setAttribute("aria-disabled",!0))):(e.removeAttribute(n),"selected"===t?"none"===this.selectionMode||e.restricted||e.disabled?e.removeAttribute("aria-selected"):e.setAttribute("aria-selected",!1):"today"===t?e.removeAttribute("aria-current"):"restricted"!==t||e.disabled?"disabled"===t&&(e.removeAttribute("aria-disabled"),e.restricted||e.setAttribute("aria-selected",!1)):e.setAttribute("aria-selected",!1))}_validateTemplate(e,t){if(null===t||!t)return;if("function"==typeof t)return;const a=this;if("content"in document.createElement("template")){if("string"==typeof t&&(t=document.getElementById(t)),null!==t&&"content"in t)return t;a.error(a.localize("invalidTemplate",{elementType:a.nodeName.toLowerCase(),property:e}))}else a.error(a.localize("htmlTemplateNotSuported",{elementType:a.nodeName.toLowerCase()}))}_weeksDownHandler(e,t){const a=this,n=t.value;let l;if(a.$.body.contains(t))if(t.otherMonth&&(l=t.value.getTime()>t.closest(".smart-calendar-month")._date.getTime()?1:-1),n&&a.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t,e.pageX,e.pageY),l){if(a._isDateInView(n))return;a.disableAutoNavigation||a.navigate(l*a.months)}else(t=a._getCellByDate(n))&&(t.disabled||t.restricted)||a._handleDateSelection(t)}_firstDayOfWeekValidator(e,t){return Math.min(Math.max(0,isNaN(t)?6:t),6)}_weeksValidator(e,t){return Math.min(Math.max(1,isNaN(t)?6:t),6)}_monthsValidator(e,t){return Math.min(Math.max(1,isNaN(t)?1:t),12)}});

/***/ }),

/***/ 2864:
/***/ (() => {

Smart("smart-check-input",class extends Smart.MultiInput{static get properties(){return{inverted:{type:"boolean",value:!1}}}uncheckAll(){this.selectedValues=[]}checkAll(){const e=this;let t=[];for(let l=0;l<e.dataSource.length;l++){const s=e.dataSource[l].value||e.dataSource[l].label;t.push(s)}e.selectedValues=t}_performSelect(e){const t=this;if(!e)return void t.close();const l=e.target?e.target.closest("li"):e;if(!l)return;t._selectedItems||(t._selectedItems=[]),l.classList.toggle("selected");const s=l.classList.contains("selected"),a={label:l.getAttribute("data-label"),value:l.getAttribute("value")},i=t.$.menu.children;for(let e=0;e<i.length;e++)i[e].classList.remove("active");if(s)t._selectedItems.push(a),t._setActiveDescendant(l),l.classList.add("active"),l.setAttribute("aria-selected",!0);else{const e=t._selectedItems.findIndex((e=>e.label===a.label&&e.value===a.value));e>-1&&t._selectedItems.splice(e,1),l.classList.remove("active"),l.setAttribute("aria-selected",!1)}l.setAttribute("aria-selected",s);const c=t._selectedItems,n=t.value,r=t.$.input.dataValue;let[u,d]=[[],[]];for(let e=0;e<c.length;e++){const t=c[e];u.push(t.label),d.push(t.value)}t.set("selectedValues",c.map((e=>e.value))),u=u.join(", "),t.set("value",u),t.$.input.dataValue=d=d.join(", "),u===n&&d===r||t.$.fireEvent("change",{value:d,label:u,oldValue:r,oldLabel:n})}_render(e){const t=this,l=e.map((function(e){let l=e,s=e;"object"==typeof e&&(l=e.label,s=e.value||l);const a=document.createElement("li"),i=document.createElement("a");return i.href="#",a.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),a.setAttribute("data-label",l),a.setAttribute("value",s),a.setAttribute("role","option"),a.setAttribute("aria-selected",!1),a.setAttribute("aria-label",l),i.innerHTML=t.highlighter?t.highlighter(l):t._highlighter(l),i.setAttribute("aria-hidden",!0),e.color&&(a.classList.add("color"),a.style.setProperty("--smart-primary",e.color)),e.icon&&(i.classList.add("icon"),i.classList.add(e.icon)),a.appendChild(i),a}));t.$.menu.innerHTML="";let s=[],a=[],i=t._selectedItems;i||(i=t._selectedItems=[]);const c=i.length;i.length&&i.forEach((e=>{a.push(e.label),s.push(e.value)})),s=s.concat((t.$.input.dataValue||t.$.input.value).split(",").map((e=>e.trim()))),a=a.concat(t.$.input.value.split(",").map((e=>e.trim())));for(let e=0;e<l.length;e++){const n=l[e],r=n.getAttribute("value"),u=n.getAttribute("data-label"),d=c?s.indexOf(r):a.indexOf(u);d>-1&&a[d]===u&&(n.classList.add("selected"),n.setAttribute("aria-selected",!0),t._setActiveDescendant(n),i.findIndex((e=>e.label===u&&e.value===r))<0&&i.push({label:n.getAttribute("data-label"),value:n.getAttribute("value")})),t.$.menu.appendChild(n)}t.set("selectedValues",i.map((e=>e.value)))}_next(){const e=this;let t=e._selectedItems?e._selectedItems[e._selectedItems.length-1]:void 0;t&&(t=e.$.menu.querySelector(`.active[data-label="${t.label}"][value="${t.value}"]`));const l=t||e.$.menu.querySelector(".active");if(!l){const t=e.$.menu.firstElementChild;return t.classList.add("active","focused"),void e._setActiveDescendant(t)}const s=e.$.menu.children;for(let e=0;e<s.length;e++)s[e].classList.remove("active","focused");e._setActiveDescendant();let a=l.nextElementSibling;a||(a=e.$.menu.firstElementChild),a.classList.add("active","focused"),e._setActiveDescendant(a),e.ensureVisible()}_prev(){const e=this;let t=e._selectedItems?e._selectedItems[e._selectedItems.length-1]:void 0;t&&(t=e.$.menu.querySelector(`.active[data-label="${t.label}"][value="${t.value}"]`));const l=t||e.$.menu.querySelector(".active");if(!l){const t=e.$.menu.firstElementChild;return t.classList.add("active","focused"),void e._setActiveDescendant(t)}const s=e.$.menu.children;for(let e=0;e<s.length;e++)s[e].classList.remove("active","focused");e._setActiveDescendant();let a=l.previousElementSibling;a||(a=e.$.menu.lastElementChild),a.classList.add("active","focused"),e._setActiveDescendant(a),e.ensureVisible()}_keyUpHandler(e){const t=this;if(!e.shiftKey)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return;t._performSelect(t.$.menu.querySelector(".active")),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault()),t.readonly||(t.$.input.dataValue=t.$.input.value)}}_createElement(){super._createElement(),this.$.menu.setAttribute("aria-multiselectable",!0),this.$.scrollView.classList.add("smart-check-input-drop-down-menu")}});

/***/ }),

/***/ 4896:
/***/ (() => {

Smart("smart-color-input",class extends Smart.Input{static get properties(){return{dataSource:{type:"any",value:null},displayMode:{value:"default",allowedValues:["default","grid"],type:"string"},dropDownHeight:{type:"any",value:"auto"},messages:{value:{en:{standardColors:"Standard colors",themeShadeColors:"",themeColors:"Theme colors"}},type:"object",extend:!0},placeholder:{value:"Please Select Color",type:"string"},valueDisplayMode:{value:"default",allowedValues:["default","colorBox","colorCode"],type:"string"},valueFormat:{value:"hex",allowedValues:["rgb","rgba","hex"],type:"string"}}}static get listeners(){return{"input.focus":"_focusHandler","input.blur":"_blurHandler","input.keydown":"_keyDownHandler","input.keyup":"_keyUpHandler","input.keypress":"_keyPressHandler","input.select":"_inputSelectHandler","input.change":"_inputChangeHandler","dropDownButton.down":"_dropDownButtonDownHandler","inputContainer.down":"_downHandler","document.up":"_documentUpHandler"}}template(){return'<div id="inputContainer" role="presentation">\n                    <div class="smart-content">\n                        <div class="smart-buttons-container" role="presentation" id="buttonsContainer">\n                            <div class="smart-action-button" id="actionButton">\n                                <div id="colorSampleContainer" class="smart-color-box color-picker-sample-container" role="presentation">\n                                    <div id="colorSample" class="color-picker-sample"></div>\n                                </div>\n                                <input class="smart-input smart-color-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\'\n                                    value=\'[[value]]\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" spellcheck="false" />\n                            </div>\n                            <div id="dropDownButton" tabindex=-1 class="smart-drop-down-button" role="button" aria-label="Toggle popup">\n                                <div id="arrow" class="smart-drop-down-button-icon" aria-hidden="true"></div>\n                            </div>\n                        </div>\n                        <span id="hint" class="smart-hint smart-hidden" inner-h-t-m-l="[[hint]]"></span>\n                    </div>\n                </div>'}open(){const e=this;let t;e.dropDownDataSource?(e.query="",t="function"==typeof e.dataSource?e.dataSource(e.query):e.dataSource):t="function"==typeof e.dropDownDataSource?e.dropDownDataSource(e.query):e.dropDownDataSource,e._process(t);const r=e.$.menu.querySelector(".color-sample.selected");if(r){const t=e.$.input.dataValue,a=e.$.menu.querySelectorAll(".color-sample");for(let o=0;o<a.length;o++){const l=a[o],n=l.getAttribute("data-label"),s=l.getAttribute("value");if(void 0!==t&&s===t||void 0===t&&n===e.$.input.value){r.removeAttribute("aria-current"),r.classList.remove("selected"),l.classList.add("selected"),l.setAttribute("aria-current",!0),e._setActiveDescendant(l),e.$.input.dataValue=s;break}}}e.ensureVisible(),e.$.input.focus(),setTimeout((function(){e.$.input.focus()}),25)}_blurHandler(){const e=this;e.opened||(e.removeAttribute("focus"),e.$.actionButton.removeAttribute("focus"),e.$.dropDownButton.removeAttribute("focus")),delete e._preventLookup,e._isValidColor(e.value)||(e.$.input.value=e.$.input.dataValue=e.value="",e.$colorSampleContainer.addClass("no-color"))}_focusHandler(){const e=this;e.setAttribute("focus",""),e.$.actionButton.setAttribute("focus",""),e.$.dropDownButton.setAttribute("focus",""),e.readonly||0!==e.minLength||0!==e.$.input.value.length||e._preventLookup?delete e._preventLookup:e._lookup()}_lookup(e){const t=this;let r=[];t.query=t.$.input.value,t.$.input.readonly&&(t._incrementalSearchQuery||(t._incrementalSearchQuery=""),t._incrementalSearchQuery+=e.key,t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t.query=t._incrementalSearchQuery,t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),700)),t.query.length<t.minLength?t.close():(r="function"==typeof t.dataSource?t.dataSource(t.query):t.dataSource,clearTimeout(t._autoCompleteTimeout),t._autoCompleteTimeout=setTimeout((function(){const e=t.context;t.context=t,t._process(r),t.context=e}),t.autoCompleteDelay))}_getDefaultColors(){let e=this._generateColors();if("grid"===this.displayMode)return e;let t=[];for(let r=0;r<e.length;r++)t=t.concat(Object.values(e[r])[0]);return t}_generateColors(){const e=this;return"default"===e.displayMode?e._defaultModeColors?e._defaultModeColors:e._defaultModeColors=[{themeColors:["#FFFFFF","#000000","#E6E6E6","#495469","#5671C2","#D48439","#A5A5A5","#EEC328","#7399D3","#85AA4C"]},{themeShadeColors:["#F2F2F2","#808080","#D0CECE","#D6DCE4","#DDEBF7","#FCE4D6","#EBEBEB","#FFF2CC","#DDE5F7","#E2EFDA","#D8D8D8","#595959","#AEAAAA","#ACB9CA","#BDD7EE","#F6CAAD","#DBDBDB","#FFE699","#B4C6E7","#C6E0B4","#BFBFBF","#404040","#757171","#8497B0","#9BC2E6","#F4B084","#C0C0C0","#FFD966","#8EA9DB","#A9D08E","#A6A6A6","#262626","#312F2F","#333F4F","#2F75B5","#C65911","#7B7B7B","#BF8F00","#305496","#548235","#808080","#0D0D0D","#161616","#222B35","#1F4E78","#833C0C","#525252","#806000","#203764","#375623"]},{standardColors:["#A52A0D","#DB3A15","#EEC328","#FEFE33","#A6CD57","#62AC54","#65ADEE","#3F6FBE","#10205F","#64379E"]}]:e._gridColors?e._gridColors:e._gridColors=["rgba(255, 255, 255, 0)","rgb(0, 0, 0)","rgb(153, 51, 0)","rgb(51, 51, 0)","rgb(0, 51, 0)","rgb(0, 51, 102)","rgb(0, 0, 128)","rgb(51, 51, 153)","rgb(51, 51, 51)","rgb(128, 0, 0)","rgb(255, 102, 0)","rgb(128, 128, 0)","rgb(0, 128, 0)","rgb(0, 128, 128)","rgb(0, 0, 255)","rgb(102, 102, 153)","rgb(128, 128, 128)","rgb(255, 0, 0)","rgb(255, 153, 0)","rgb(153, 204, 0)","rgb(51, 153, 102)","rgb(51, 204, 204)","rgb(51, 102, 255)","rgb(128, 0, 128)","rgb(153, 153, 153)","rgb(255, 0, 255)","rgb(255, 204, 0)","rgb(255, 255, 0)","rgb(0, 255, 0)","rgb(0, 255, 255)","rgb(0, 204, 255)","rgb(153, 51, 102)","rgb(192, 192, 192)","rgb(255, 153, 204)","rgb(255, 204, 153)","rgb(255, 255, 153)","rgb(204, 255, 204)","rgb(204, 255, 255)","rgb(153, 204, 255)","rgb(204, 153, 255)","rgb(255, 255, 255)"]}_downHandler(e){const t=this;(t.readonly||e.originalEvent.target.closest(".smart-color-box"))&&t._dropDownButtonDownHandler(e)}_documentUpHandler(e){const t=this,r=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;r===t||r.closest&&r.closest(".smart-buttons-container")===t.$.buttonsContainer||(t.$.scrollView.contains(r.shadowParent||r)?t._isPointerDown&&(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),t.$.input.focus()):(t.opened&&(t._preventLookup=!0),t._isPointerDown=!1,"manual"!==t.dropDownOpenMode&&t.close()))}_formatValue(e){const t=this;if(!t._isValidColor(e))return"";const r=t._getRGBA(e);switch(t.valueFormat){case"hex":e=t._rgbArrayToHEX([r.r,r.g,r.b,r.a]);break;case"rgb":e="rgb("+r.r+", "+r.g+", "+r.b+")";break;case"rgba":e=null!==r.r&&null!==r.g&&null!==r.b?"rgba("+r.r+", "+r.g+", "+r.b+", "+r.a+")":null}return e||null}_getRGBA(e){const t=this,r=e||t.value;let a=1;r&&(t._isRGBA(r)&&/rgba\((\d*.\d+|\d+),(\d*.\d+|\d+),(\d*.\d+|\d+)\,(\d*.\d+|\d+)\)/gi.test(r.replace(/\s/g,""))?a=/rgba\((\d*.\d+|\d+),(\d*.\d+|\d+),(\d*.\d+|\d+)\,(\d*.\d+|\d+)\)/gi.exec(r.replace(/\s/g,""))[4]:t._isHEX(e)&&/(^#[0-9A-F]{8}$)/gi.test(e.replace(/\s/g,""))&&(a=parseInt(/(^#[0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2}$)/gi.exec(e.replace(/\s/g,""))[4],16)/255),a=Math.min(1,Math.max(0,parseFloat(a))),isNaN(a)&&(a=1)),e=t._HSVtoRGBA(t._colorToHSV(r),a);const o=/rgba\((\d*.\d+|\d+),(\d*.\d+|\d+),(\d*.\d+|\d+)\,(\d*.\d+|\d+)\)/gi.exec(e.replace(/\s/g,""));return{r:parseInt(o[1]),g:parseInt(o[2]),b:parseInt(o[3]),a:parseFloat(o[4])}}_colorToHSV(e){if(!this._isValidColor(e))return;e=this._toRGBA(e).replace(/\s/g,"");const t=/rgba\((\d*.\d+|\d+),(\d*.\d+|\d+),(\d*.\d+|\d+)\,(\d*.\d+|\d+)\)/gi.exec(e),r=Math.min(255,Math.max(0,parseFloat(t[1])))/255,a=Math.min(255,Math.max(0,parseFloat(t[2])))/255,o=Math.min(255,Math.max(0,parseFloat(t[3])))/255;let l={h:0,s:0,v:0},n=0,s=0;if(r>=a&&r>=o?(s=r,n=a>o?o:a):a>=o&&a>=r?(s=a,n=r>o?o:r):(s=o,n=a>r?r:a),l.v=s,l.s=s?(s-n)/s:0,l.s){const e=s-n;l.h=r===s?(a-o)/e:a===s?2+(o-r)/e:4+(r-a)/e,l.h=60*l.h,l.h<0&&(l.h+=360)}else l.h=0;return l.s=parseFloat(l.s),l.v=parseFloat(l.v),l}_rgbArrayToHEX(e){let t="#";if(Array.isArray(e)&&null===e[0])return null;for(let r=0;r<3;r++){let a=parseInt(e[r]).toString(16).toUpperCase();a=1===a.length?0+a:a,t+=a}let r=parseFloat(e[3]);return isNaN(r)||(r=parseInt(255*r).toString(16).toUpperCase(),"FF"!==r&&(t=t.slice(0,7)+(1===r.length?0+r:r))),t}_HSVtoRGBA(e,t){const r=(e=e||{h:0,s:0,v:0}).h,a=e.s,o=e.v;let l,n,s,i=o*a,d=r/60,c=i*(1-Math.abs(d%2-1));d>=0&&d<=1?[l,n,s]=[i,c,0]:d>=1&&d<=2?[l,n,s]=[c,i,0]:d>=2&&d<=3?[l,n,s]=[0,i,c]:d>=3&&d<=4?[l,n,s]=[0,c,i]:d>=4&&d<=5?[l,n,s]=[c,0,i]:d>=5&&d<=6&&([l,n,s]=[i,0,c]);const u=o-i;return"rgba("+Math.round(255*(l+u))+", "+Math.round(255*(n+u))+", "+Math.round(255*(s+u))+", "+(void 0!==t?t:this._getRGBA().a||0)+")"}_toRGBA(e,t){const r=this;let a=r.value;function o(e){const r=/^#(.)(.)(.)$/gi.exec(e),a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i.exec(e),o=r?parseInt(r[1]+r[1],16):parseInt(a[1],16),l=r?parseInt(r[2]+r[2],16):parseInt(a[2],16),n=r?parseInt(r[3]+r[3],16):parseInt(a[3],16),s=r?parseInt(r[4]+r[4],16):parseInt(a[4],16);return t?"rgba("+o+", "+l+", "+n+", 1)":"rgba("+o+", "+l+", "+n+", "+(isNaN(s)?"1":s/255)+")"}if(r._isRGBA(e))return t?"rgba("+e.match(/(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})/gi)+", 1)":e;if(r._isValidColorName(e))a=o(r._cssColorNamesHEX[e.trim().toLowerCase()]);else if(r._isHEX(e))a=o(e);else{if(!r._isRGB(e))return!1;a=e.toLowerCase(),a=a.replace("rgb","rgba"),a=a.replace(")",", 1)")}return a}_isHEX(e){return/(^#[0-9A-F]{3}$)|(^#[0-9A-F]{6}$)|(^#[0-9A-F]{8}$)/i.test(e)}_isRGB(e){return/rgb\((\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\)/i.test(e)}_isValidColorName(e){return!(!e||void 0===this._cssColorNamesHEX[e.trim().toLowerCase()])}_isRGBA(e){return/rgba\((\d*.\d+|\d+)\s*,\s*(\d*.\d+|\d+)\s*,\s*(\d*.\d+|\d+)\s*,\s*(\d*.\d+|\d+)\)/i.test(e)}_isValidColor(e){return this._isHEX(e)||this._isRGB(e)||this._isRGBA(e)||this._isValidColorName(e)}_performSelect(e){const t=this;let r,a,o;t.opened?(r=t.$.menu.querySelector(".selected")||t.$.menu.querySelector(".color-sample"),a=r.getAttribute("data-label"),o=r.getAttribute("value")):a=o=t.$.input.value;const l=e||t.value,n=t.$.input.dataValue;t.set("value",t.$.colorSample.style.backgroundColor=t._formatValue(a)),t.$.input.dataValue=o,t.setAttribute("data-value",o),t._isValidColor(t.value)?(t.$colorSampleContainer.removeClass("no-color"),t.$.colorSample.setAttribute("aria-label",t.value)):(t.$colorSampleContainer.addClass("no-color"),t.$.colorSample.setAttribute("aria-label","No color")),r&&(r.classList.add("selected"),r.setAttribute("aria-current",!0)),!t.isRendered||a===l&&o===n||(t.$.fireEvent("change",{value:o,label:a,oldValue:n,oldLabel:l}),t._updateTargetValue()),t.close()}_process(e){const t=this;if(e||(e=[]),"string"==typeof(e=e.slice(0))&&(e=t.$.deserialize(e,"array")),t.matcher)e=e.filter((e=>t.matcher(e)>-1));else if(t.query){let r=[];for(let e in t._cssColorNamesHEX)t._matcher(e,!0)>-1&&r.push(t._cssColorNamesHEX[e]);if(r.length)e=r;else if(e.length||null!==t.dataSource&&void 0!==t.dataSource)e=e.filter((e=>t._matcher(e)>-1));else{let r=t._generateColors();"default"===t.displayMode&&(r=[].concat.apply([],r.map((e=>Object.values(e)[0])))),e=r.filter((e=>t._matcher(e)>-1))}}!e.length&&t.opened&&t.close(),t.query.length>0&&!e.length||!e.length&&null!==t.dataSource&&void 0!==t.dataSource||(t.query.length>0?t._render(e.slice(0,t.items)):t._render(e),t._open(),t._refreshMenu(),t.ensureVisible())}_matcher(e,t){const r=this,a=r.query;if(e=t?e.label||e:r._formatValue(e.label||e),!a)return-1;switch(r.queryMode){case"startsWith":return e.startsWith(a);case"startsWithIgnoreCase":return e.toLowerCase().startsWith(a.toLowerCase());case"doesNotContain":return e.indexOf(a)<0;case"doesNotContainIgnoreCase":return e.toLowerCase().indexOf(a.toLowerCase())<0;case"contains":return e.indexOf(a)>-1;default:case"containsIgnoreCase":return e.toLowerCase().indexOf(a.toLowerCase());case"equals":return 0===e.localeCompare(a);case"equalsIgnoreCase":return 0===e.toLowerCase().localeCompare(a.toLowerCase());case"endsWith":return e.endsWith(a);case"endsWithIgnoreCase":return e.toLowerCase().endsWith(a.toLowerCase())}}_render(e){const t=this;if(t.$.menu.innerHTML="",e.length)t.$.menu.appendChild(t._createColorGroup(t._createColorSamples(e))),t.additionalColors&&t.$.menu.appendChild(t._createColorGroup(t._createColorSamples(t.additionalColors)));else if((null===t.dataSource||void 0===t.dataSource)&&!t.query.length)if(e=t._generateColors(),"default"===t.displayMode){const e=t._generateColors();for(let r=0;r<e.length;r++){const a=Object.keys(e[r])[0],o=Object.values(e[r])[0],l=document.createElement("div");l.classList.add("standard-colors-label"),l.innerHTML=t.localize(a),l.id=t.id+a+"Label",t.$.menu.appendChild(l),t.$.menu.appendChild(t._createColorGroup(t._createColorSamples(o),a+"Label"))}}else t.$.menu.appendChild(t._createColorGroup(t._createColorSamples(e)))}_createColorGroup(e,t){const r=this,a=document.createElement("div");function o(){const e=r.$.menu.getElementsByClassName("selected");e[0]&&(e[0].removeAttribute("aria-current"),e[0].classList.remove("selected")),this.classList.add("selected"),this.setAttribute("aria-current",!0),r._setActiveDescendant(this)}a.classList.add("grid-samples-container"),a.setAttribute("role","menu"),t&&a.setAttribute("aria-labelledby",r.id+t);for(let t=0;t<e.length;t++){const l=e[t];a.appendChild(l),l.onmouseenter=o,l.onclick=o,l.onmouseleave=function(){this.removeAttribute("aria-current"),this.classList.remove("selected"),r._setActiveDescendant(null)}}return a}_createColorSamples(e){const t=this;let r=[];for(let a=0;a<e.length;a++){const o=e[a];let l=o,n=o;"object"==typeof o&&(l=o.label,n=o.value||l);const s=document.createElement("div");s.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),s.setAttribute("data-label",l),s.setAttribute("value",n),s.setAttribute("role","menuitem"),s.setAttribute("aria-label",l),s.classList.add("color-sample"),s.style.backgroundColor=l,"rgba(255, 255, 255, 255)"!==l&&"#FFFFFF"!==l&&"#FFFFFFFF"!==l||(s.style.borderColor="var(--smart-border)",s.style.borderStyle="solid",s.style.borderWidth="1px"),"rgba(255, 255, 255, 0)"===l||"#FFFFFF00"===l||"transparent"===l?s.setAttribute("transparent",""):s.removeAttribute("transparent"),s.classList[l||n?"remove":"add"]("no-color"),r.push(s)}if(r.length>0&&!t.$.menu.querySelector(".selected")){const a=Math.max(0,e.indexOf(t.value));r[a].classList.add("selected"),r[a].setAttribute("aria-current",!0),t._setActiveDescendant(r[0])}return r}ensureVisible(){this.$.menu.querySelector(".color-sample.selected")}_next(){const e=this,t=e.$.menu.querySelector(".color-sample.selected");if(!t){const t=e.$.menu.querySelector(".color-sample");return t.classList.add("selected"),t.setAttribute("aria-current",!0),void e._setActiveDescendant(t)}t.removeAttribute("aria-current"),t.classList.remove("selected");let r=t.nextElementSibling;if(!r){let a=t.parentElement.nextElementSibling;for(;a;){if(a.classList.contains("grid-samples-container")){r=a.children[0];break}a=a.nextElementSibling}r||(r=e.$.menu.querySelector(".color-sample"))}r.classList.add("selected"),r.setAttribute("aria-current",!0),e._setActiveDescendant(r),e.ensureVisible()}_prev(){const e=this,t=e.$.menu.querySelector(".color-sample.selected");if(!t){const t=e.$.menu.querySelector(".color-sample");return t.classList.add("selected"),t.setAttribute("aria-current",!0),void e._setActiveDescendant(t)}t.removeAttribute("aria-current"),t.classList.remove("selected");let r=t.previousElementSibling;if(!r){let a=t.parentElement.previousElementSibling;for(;a;){if(a.classList.contains("grid-samples-container")){r=a.children[a.children.length-1];break}a=a.previousElementSibling}r||(r=e.$.menu.querySelector(".grid-samples-container:last-of-type .color-sample:last-of-type"))}r.classList.add("selected"),r.setAttribute("aria-current",!0),e._setActiveDescendant(r),e.ensureVisible()}_move(e){const t=this;if(t.opened){switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 37:case 38:e.preventDefault(),t[t.rightToLeft?"_next":"_prev"]();break;case 39:case 40:e.preventDefault(),t[t.rightToLeft?"_prev":"_next"]()}e.stopPropagation()}}_inputSelectHandler(){const e=this;e.readonly&&(e.$.input.selectionStart=e.$.input.selectionEnd)}_inputChangeHandler(e){e.stopPropagation(),this._performSelect()}_keyDownHandler(e){const t=this;t._suppressKeyPressRepeat=![37,38,39,40,9,13,27,16,17,18].includes(e.keyCode),e.shiftKey||e.ctrlKey||(e.altKey?"ArrowUp"===e.key?t.close():"ArrowDown"===e.key&&t.open():t._move(e))}_keyUpHandler(e){const t=this;if(!(e.shiftKey||e.altKey||e.ctrlKey))switch(e.keyCode){case 40:case 39:case 38:case 37:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return void(13===e.keyCode&&t.open());t._performSelect(),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:if(t.readonly)return void(32!==e.keyCode||t.opened||t.open());t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault()),t.$.input.dataValue=t.$.input.value,t._isValidColor(t.value)||(t.$colorSampleContainer.addClass("no-color"),t.$.colorSample.setAttribute("aria-label","No color"),t.$.colorSample.style.backgroundColor="")}}propertyChangedHandler(e,t,r){const a=this;if("dropDownHeight"===e)a.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height",a.dropDownHeight+"px");else if("opened"===e)a.opened=t,r?a.open():a.close();else if("placeholder"===e){if(a.readonly){const e=a.getAttribute("aria-label");if(e&&e!==t)return;r?a.setAttribute("aria-label",r):a.removeAttribute("aria-label")}}else"readonly"===e?a._setAriaRelations():"theme"===e?a.$.scrollView.setAttribute(e,r):"rightToLeft"===e?r?a.$.scrollView.setAttribute("right-to-left",""):a.$.scrollView.removeAttribute("right-to-left"):"valueFormat"===e?(a.value=a._formatValue(a.value),a.$.input.dataValue=a.value):"displayMode"===e?a.open():"value"===e?(a.$.input.value=r,a._performSelect(t)):super.propertyChangedHandler(e,t,r)}_createElement(){const e=this,t=document.createElement("div"),r=document.createElement("div");r.classList.add("smart-color-input-drop-down-menu","smart-color-panel"),r.setAttribute("theme",e.theme),e.$.scrollView=r,e.rightToLeft?e.$.scrollView.setAttribute("right-to-left",""):e.$.scrollView.removeAttribute("right-to-left"),e.$.menu=t,e.$.menu.classList.add("default-samples-container","grid-mode-container","smart-container"),e.$.scrollView.onclick=function(t){t.stopPropagation(),t.preventDefault(),e._performSelect(),e.$.input.focus()},e.classList.add("smart-drop-down-box","smart-color-picker"),e.value?(e.$colorSampleContainer.removeClass("no-color"),e.$.colorSample.setAttribute("aria-label",e.value)):(e.$colorSampleContainer.addClass("no-color"),e.$.colorSample.setAttribute("aria-label","No color")),e._cssColorNamesHEX={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},e._performSelect(e.value)}_setAriaRelations(){const e=this,t=e.getAttribute("aria-label");e.readonly?(e.setAttribute("role","button"),!t&&e.placeholder&&e.setAttribute("aria-label",e.placeholder),e.$.input.setAttribute("aria-hidden",!0),e.$.input.removeAttribute("aria-activedescendant"),e.$.input.removeAttribute("aria-controls"),e.$.dropDownButton.setAttribute("aria-hidden",!0)):(e.setAttribute("role","combobox"),t&&t===e.placeholder&&e.removeAttribute("aria-label"),e.$.input.setAttribute("role","searchbox"),e.$.input.removeAttribute("aria-hidden",!0),e.$.dropDownButton.removeAttribute("aria-hidden")),e.setAttribute("aria-expanded",e.opened),e.setAttribute("aria-haspopup","listbox"),e.$.scrollView.setAttribute("role","listbox")}});

/***/ }),

/***/ 1139:
/***/ (() => {

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:"any"}}}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","listBox.scrollBottomReached":"_scrollBottomReachedHandler","listBox.scrollTopReached":"_scrollTopReachedHandler",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);const e=[];if(n.dataSource&&n.dataSource.length>0)for(let t=0;t<n.dataSource.length;t++){const i=n.dataSource[t];(i.value&&o.indexOf(i.value)>=0||i.label&&o.indexOf(i.label)>=0)&&e.push(i.value)}e.length>0&&(n.selectedValues=e),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"]()}),!0),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?"&#10006":",":"",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;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")}});

/***/ }),

/***/ 4232:
/***/ (() => {

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")}});

/***/ }),

/***/ 6057:
/***/ (() => {

(()=>{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),void 0===e.skipFirstRow&&(t.skipFirstRow=!1),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()};if("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}));else if("string"==typeof t.dataSource&&t.dataSource.indexOf(".xml")>=0)t.url=t.dataSource,t.dataSourceType="xml",new e(t,(e=>{t.dataSource=e}));else if("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()}));else if("string"==typeof t.dataSource&&t.dataSource.indexOf(".csv")>=0)t.url=t.dataSource,t.dataSourceType="csv",new e(t,(e=>{t.dataSource=e}));else if("string"==typeof t.dataSource&&t.dataSource.indexOf(".tsv")>=0)t.url=t.dataSource,t.dataSourceType="tsv",new e(t,(e=>{t.dataSource=e}));else if("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}));else if("string"==typeof t.dataSource&&(t.dataSource.indexOf("BEGIN:VCALENDAR")>=0||"ics"===t.dataSourceType))t._bindToICS(),a();else if("string"==typeof t.dataSource&&(t.dataSource.indexOf("<?xml")>=0||"xml"===t.dataSourceType))t._bindToXML(),a();else if("string"==typeof t.dataSource&&(t.dataSource.indexOf("  ")>=0||t.dataSource.indexOf(",")>=0||"tsv"===t.dataSourceType||"csv"===t.dataSourceType||"tab"===t.dataSourceType))t._bindToCSV(),a();else if("array"===t.dataSourceType)t._bindToArray(),a();else if("json"===t.dataSourceType){if(t.dataSource&&t.dataSource.url)return t.url=t.dataSource.url,t.dataSource.method&&(t.type=t.dataSource.method),t.dataSource.type&&(t.type=t.dataSource.type),t.dataSource.data&&(t.data=t.dataSource.data),void new e(t,(e=>{t.dataSource=e}));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={};let l=i[t].split(a);if(t>0){let e=[],a=0,n=!1,r=i[t];for(let t=0;t<r.length;t++)if('"'===r.charAt(t))n=!n;else if(","===r.charAt(t)&&!n){let n=r.substring(a,t);n=n.trim(),n=n.replaceAll('"',""),e.push(n),a=t+1}let o=r.substring(a);o=o.trim(),o=o.replaceAll('"',""),","===o?e.push('""'):e.push(o),l=e}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("/")&&-1===i.indexOf("-"))?(i.indexOf("-")>=0||i.indexOf("/")>=0||i.indexOf(":")>=0)&&"Invalid Date"!==new Date(i).toString()&&(e="date",i=new Date(i)):i.indexOf(".")>=0&&i.lastIndexOf(".")!==i.indexOf(".")?-1===i.indexOf(",")&&(e="date",i=new Date(i)):(e="number",i=parseFloat(i)),r.dataType||(r.dataType=e)}o[r.map||r.name||a.toString()]=i}0===t&&e.skipFirstRow||(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),t.data=r.data,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)=>{let a=t.value,n=t.valueTo;if(a&&a instanceof Date){a=`'${new Smart.Utilities.DateTime(a).toString("yyyy-MM-dd")}'`}if(t.valueTo&&t.valueTo instanceof Date){n=`'${new Smart.Utilities.DateTime(n).toString("yyyy-MM-dd")}'`}switch(t.condition){case"EQUAL":return e+" = "+a;case"NOT_EQUAL":return e+" != "+a;case"GREATER_THAN":return e+" > "+a;case"GREATER_THAN_OR_EQUAL":return e+" >= "+a;case"LESS_THAN":return e+" < "+a;case"LESS_THAN_OR_EQUAL":return e+" <= "+a;case"NULL":return e+" IS NULL";case"NOT_NULL":return e+" IS NOT NULL";case"RANGE":return"("+e+" >= "+a+" and "+e+" <= "+n+")"}},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]&&"or"!==o.logicalOperators[t]||(s=" OR ")}l.length&&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).replace(/</g,"&lt;").replace(/>/g,"&gt;")}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){if("$"===n||n===a.id)continue;const r=null===t.edit.row[n]?"":t.edit.row[n]+"";e.push(n+"='"+r.replace(/</g,"&lt;").replace(/>/g,"&gt;")+"'")}null===a.id?d.update=" SET "+e.join(", "):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),null!==t.edit.row[n]?e.push("'"+t.edit.row[n]+"'"):e.push("null"));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,edit:t.edit,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=JSON.parse(JSON.stringify(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=s.boundSource.canNotify;s.boundSource.canNotify=!1;const f=function(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()};let h=new Array;for(let t=0;t<e.length;t++)h[t]=f();t||(t="children"),a||(a="group"),r||(r="item"),o||(o="parent"),void 0===i&&(i="value");const p=new Array,g=new Array;let S=0;const y=function(t){let a=t;for(let n=0;n<e.length;n++){if(void 0===t[e[n]]){a=s._getDataItem(t,t.$.index);break}}if(n)for(let e in n){const t=n[e];t.name&&t.map&&(a[t.map]=a[t.name])}return a};let m=!1;for(let n=0;n<d.length;n++){let u=y(d[n]);u[c.leaf]=!1;let T=new Array,b=0;for(let t=0;t<e.length;t++){const a=e[t],n=u[a];null!=n?((""===n||void 0===n&&0===t)&&(m=!0),T[b++]={value:n,group:a,hash:h[t]}):(T[b++]={value:null,group:a,hash:h[t]},0===t&&(m=!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===g[v]||null===g[v]){if(null===x){x={$:{}},x[c.level]=0,x[c.leaf]=!1,x[o]=null,x[a]=n,x[r]=u,x.groupDataField=d,x[d]||(x[d]=x.data[d]),void 0!==u[c.expanded]?x[c.expanded]=u[c.expanded]:(x[c.expanded]=!1,s.expandHierarchy&&(x[c.expanded]=!0)),i&&(x[i]=u[i]),x[t]=new Array;let e=p.length+l;this.id&&"number"!=typeof u.$.id&&!isFinite(u.$.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),p[S++]=x}else{const e={$:{}};e[c.level]=x[c.level]+1,e[o]=x,e[a]=n,e[t]=new Array,e[r]=u,e.groupDataField=d,e[c.leaf]=!1,e[d]||(e[d]=e.data[d]),void 0!==u[c.expanded]?e[c.expanded]=u[c.expanded]:(e[c.expanded]=!1,s.expandHierarchy&&(e[c.expanded]=!0)),i&&(e[i]=u[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}g[v]=x}else x=g[v]}u&&(u[c.leaf]=!0),null!==x?(null===this.id?void 0===u.$.id&&(u.$.id=x.$.id+"_"+x[t].length):void 0===u.$.id&&-1===u.$.id.toString().indexOf(x.$.id)&&(u.$.id=x.$.id+"_"+u.$.id),u[o]=x,u[c.level]=x[c.level]+1,x[t][x[t].length]=u):void 0===u.$.id&&(u.$.id=f())}if(m){let e=null,t=!1;for(let a=0;a<p.length;a++){const n=p[a];if(!n[n.groupDataField]){e=n,e.$.id.toString().startsWith("Item")&&(t=!0),p.splice(a,1);break}}if(e&&(p.push(e),t))for(let e=0;e<p.length;e++){const t=p[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 s.boundSource.canNotify=u,p}_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),null===o&&(o=n[e]=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(void 0!==d&&"uncategorized"!==d||(d=""),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("status"===t)n=r[o.dataField][t],null==n&&(n=[]),n[d]||(n[d]=[]),n[d].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}else if("status"===t){let e=r[o.dataField][t];null==e&&(e=[]),e[d]||(e[d]=[]),e[d].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].status){const e=r[n.dataField].status;r[n.dataField].status=e}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(o&&"string"==typeof o&&o.indexOf("[")>=0){const e=JSON.parse(o);if(r.formatString&&Smart.Utilities.DateTime){const t=Smart.Utilities.DateTime.ParseDate(e[0],r.formatString),a=Smart.Utilities.DateTime.ParseDate(e[1],r.formatString);e[0]=t,e[1]=a}else{const t=a.$document.deserialize(""+e[0],r.dataType,!0),n=a.$document.deserialize(""+e[1],r.dataType,!0);e[0]=t,e[1]=n}o=e,n[r.name]=o;continue}if(r.formatString&&Smart.Utilities.DateTime){o=Smart.Utilities.DateTime.ParseDate(o,r.formatString)}else{const e=""+o;o=a.$document.deserialize(""+o,r.dataType,!0),o.getTime&&isNaN(o.getTime())&&(o=e,o=Smart.Utilities.DateTime.ParseDate(o))}}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,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;"):"blackList"===a.sanitizeHTML&&(o=window.Smart.Utilities.Core.sanitizeHTML(o),o.indexOf("<br")>=0&&(o=o.replaceAll("<br/>","\n\r"),o=o.replaceAll("<br>","\n\r")))),n[r.name]=o):n.$[r.name]=o}let o=t;if(a.id){if(o=i[a.id],void 0===o)if(void 0!==n[a.id]){if(o=n[a.id],""===o){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};o=e()+e()}}else{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++){let a=t[e];const r=-1===a.indexOf('"')?a.split(" "):a.split('"');let i=[];for(let e=0;e<r.length;e++){const t=r[e];if(""!==t&&" "!==t){if("true"===t.trim()){i.push(!0);continue}if("false"===t.trim()){i.push(!1);continue}if("NULL"===t.trim()){i.push("NULL"),i.push("");continue}if("NOT_NULL"===t.trim()){i.push("NOT_NULL"),i.push("");continue}if(t.indexOf(" GMT")>=0)i.push(t.trim());else if(t.indexOf("OR ")>=0||t.indexOf("AND ")>=0||t.indexOf("or ")>=0||t.indexOf("and ")>=0||t.indexOf("1 ")>=0||t.indexOf("0 ")>=0||t.indexOf("| ")>=0||t.indexOf("& ")>=0){const e=t.trim().split(" ");if(e.length>1){const t=e[0].trim(),a=e[1].trim();"1"===t?i.push("or"):"0"===t?i.push("and"):i.push(t),i.push(a)}else i.push(t.trim())}else 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&&"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){if(o.virtualDataSource)return;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]],e,a);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})();

/***/ }),

/***/ 2052:
/***/ (() => {

(()=>{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{let e=arguments[0],t=arguments[1]-1,a=arguments[2],s=arguments[3]||0,r=arguments[4]||0,n=arguments[5]||0,o=arguments[6]||0,d=arguments[7]||0,l=arguments[8]||0,f=arguments[9]||0,m=arguments[10]||0,c=arguments[11]||0,u=arguments[12]||0,y=arguments[13]||0;e>=2100&&(e=2100),t>=12?t=11:t<0&&(t=0),a>31?a=i.daysInMonth(e,1+t):a<0&&(a=0),s>23?s=23:s<0&&(s=0),r>59?r=59:r<0&&(r=0),n>59?n=59:n<0&&(n=0);const p=new Date(e,t,a,s,r,n,o);e<1970&&p.setFullYear(e),i.dateData=i.dateToMS(p.getFullYear(),p.getMonth()+1,p.getDate())+i.timeToMS(p.getHours(),p.getMinutes(),p.getSeconds(),p.getMilliseconds()),i._microsecond=d,i._nanosecond=l,i._picosecond=f,i._femtosecond=m,i._attosecond=c,i._zeptosecond=u,i._yoctosecond=y,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",custom7:"yyyy-MM-ddTHH:mm:ss.fffffff+HH:mm",custom8:"yyyy-MM-ddTHH:mm:ss.fffffff-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",iso_time7:"dd/MM/yyyy HH:mm",iso_time8:"dd.MM.yyyy HH:mm",iso_time9:"dd-MM-yyyy HH:mm",iso_time10:"MM.dd.yyyy HH:mm",iso_time11:"MM-dd-yyyy HH:mm",iso_time12:"dd/MM/yyyy",iso_time13:"MM.dd.yyyy h:mm tt",iso_time14:"MM-dd-yyyy h:mm tt",iso_time15:"MM/dd/yyyy h:mm tt"};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,y=0,p=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(y=n,12===y&&(y=0),s.outOfRange(y,0,11))return null;break;case"H":case"HH":if(y=n,s.outOfRange(y,0,23))return null;break;case"m":case"mm":if(p=n,s.outOfRange(p,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&&y<12&&(y+=12),D.setHours(y,p,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 y=c[0],p=y.length;let g;if(/i{1,24}/.test(y))o.push(a.getFirstNDigitsOfPrecision(y.length));else switch(y){case"ddd":case"dddd":{const e=3===p?t.days.namesAbbr:t.days.names;o.push(e[i.getDay()]);break}case"d":case"dd":o.push(a.padZeros(m(i,2),p));break;case"MMM":case"MMMM":g=m(i,1),o.push(t.months[3===p?"namesAbbr":"names"][g]);break;case"M":case"MM":o.push(a.padZeros(m(i,1)+1,p));break;case"y":case"yy":case"yyyy":g=a.getEraYear(i,t,a.getEra(i,r),n),p<4&&(g%=100),o.push(a.padZeros(g,p));break;case"h":case"hh":d=i.getHours()%12,0===d&&(d=12),o.push(a.padZeros(d,p));break;case"H":case"HH":o.push(a.padZeros(i.getHours(),p));break;case"m":case"mm":o.push(a.padZeros(i.getMinutes(),p));break;case"s":case"ss":o.push(a.padZeros(i.getSeconds(),p));break;case"t":case"tt":g=i.getHours()<12?t.AM?t.AM[0]:" ":t.PM?t.PM[0]:" ",o.push(1===p?g.charAt(0):g);break;case"f":case"ff":case"fff":o.push(a.padZeros(i.getMilliseconds(),3).substr(0,p));break;case"u":case"n":case"p":case"e":case"a":case"x":case"o":o.push(a[a._codeToUnit[y]]);break;case"uu":case"nn":case"pp":case"ee":case"aa":case"xx":case"oo":o.push(a.padZeros(a[a._codeToUnit[y]],3));break;case"z":case"zz":o.push((a.timeZoneOffsetHours>=0?"+":"-")+a.padZeros(Math.floor(Math.abs(a.timeZoneOffsetHours)),p));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 '"+y+"'."}}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))}})})();

/***/ }),

/***/ 7054:
/***/ (() => {

Smart("smart-date-time-picker",class extends Smart.BaseElement{static get properties(){return{animationSettings:{value:null,type:"object"},autoClose:{value:!1,type:"boolean"},autoCloseDelay:{value:0,type:"number"},autoSwitchToMinutes:{value:!1,type:"boolean"},calendarButton:{value:!1,type:"boolean"},calendarButtonPosition:{value:"right",allowedValues:["left","right"],type:"string"},calendarMode:{value:"default",allowedValues:["default","classic"],type:"string"},dayNameFormat:{value:"firstTwoLetters",allowedValues:["narrow","firstTwoLetters","long","short"],type:"string"},disableAutoNavigation:{value:!1,type:"boolean"},displayKind:{value:"unspecified",allowedValues:["UTC","local","unspecified"],type:"string"},displayModeView:{value:"table",allowedValues:["table","list"],type:"string"},displayMode:{allowedValues:["outlined","filled","underlined"],value:"outlined",type:"string"},dropDownAppendTo:{value:null,type:"any"},dropDownDisplayMode:{value:"default",allowedValues:["default","classic","calendar","timePicker","auto"],type:"string"},dropDownOverlay:{value:!1,type:"boolean"},dropDownPosition:{value:"auto",allowedValues:["auto","bottom","overlay-top","overlay-center","overlay-bottom","top","center-bottom","center-top"],type:"string"},editMode:{value:"default",allowedValues:["default","full","partial"],type:"string"},enableMouseWheelAction:{value:!1,type:"boolean"},firstDayOfWeek:{value:0,type:"number"},footerTemplate:{value:null,type:"any"},footer:{value:!1,type:"boolean"},formatString:{value:"dd-MMM-yy HH:mm:ss.fff",type:"string"},headerTemplate:{value:null,type:"any"},hideDayNames:{value:!1,type:"boolean"},hideOtherMonthDays:{value:!1,type:"boolean"},hideTooltipArrow:{value:!1,type:"boolean"},hint:{value:"",type:"string"},importantDates:{value:[],type:"array"},importantDatesTemplate:{value:null,type:"any"},interval:{value:new Smart.Utilities.TimeSpan(0,0,1),type:"any"},label:{value:"",type:"string"},max:{value:new Smart.Utilities.DateTime(3001,1,1),type:"any"},messages:{value:{en:{now:"Now",dateTabLabel:"DATE",timeTabLabel:"TIME"}},type:"object",extend:!0},min:{value:new Smart.Utilities.DateTime(1600,1,1),type:"any"},name:{value:"",type:"string"},nullable:{value:!1,type:"boolean"},opened:{value:!1,type:"boolean"},placeholder:{value:"Enter date",type:"string"},restrictedDates:{value:[],type:"array"},spinButtons:{value:!1,type:"boolean"},spinButtonsDelay:{value:75,type:"number"},spinButtonsInitialDelay:{value:0,type:"number"},spinButtonsPosition:{value:"right",allowedValues:["left","right"],type:"string"},tooltip:{value:!1,type:"boolean"},tooltipDelay:{value:100,type:"number"},tooltipPosition:{value:"top",allowedValues:["bottom","top","left","right","absolute"],type:"string"},tooltipTemplate:{value:null,type:"any"},validation:{value:"strict",allowedValues:["strict","interaction"],type:"string"},value:{defaultReflectToAttribute:!0,value:new Smart.Utilities.DateTime,type:"any"},weekNumbers:{value:!1,type:"boolean"},weeks:{value:6,type:"number"},yearCutoff:{value:1926,type:"number"}}}static get listeners(){return{"container.mouseout":"_mouseoutHandler","container.mouseover":"_mouseoverHandler","calendarButton.click":"_calendarButtonClickHandler","calendarDropDown.change":"_calendarDropDownChangeHandler","calendarDropDown.click":"_calendarDropDownClickHandler","downButton.click":"_spinButtonsClickHandler","input.blur":"_inputBlurHandler","input.change":"_inputChangeHandler","input.dragstart":"_inputDragstartHandler","input.focus":"_inputFocusHandler","input.keydown":"_inputKeydownHandler","input.down":"_inputDownHandler","input.paste":"_inputPasteHandler","input.select":"_inputSelectHandler","input.up":"_inputUpHandler","input.wheel":"_inputWheelHandler","dropDownContainer.keydown":"_dropDownKeydownHandler","dropDownContainer.transitionend":"_dropDownTransitionendHandler","dropDownHeader.click":"_dropDownHeaderClickHandler","upButton.click":"_spinButtonsClickHandler","document.up":"_documentUpHandler"}}static get requires(){return{"Smart.Utilities.DateTime":"smart.date.js","Smart.Utilities.Draw":"smart.draw.js","Smart.Utilities.BigNumber":"smart.math.js","Smart.Utilities.NumericProcessor":"smart.numeric.js","Smart.RepeatButton":"smart.button.js","Smart.Calendar":"smart.calendar.js","Smart.TimePicker":"smart.timepicker.js"}}static get styleUrls(){return["smart.datetimepicker.css"]}template(){return'<div id="container" role="presentation">\n                    <span id="label" class="smart-label">[[label]]</span>\n                    <div id="content" class="smart-content">\n                        <input id="input" class="smart-input smart-date-time-input" type="text" readonly="[[readonly]]" disabled="[[disabled]]" placeholder="[[placeholder]]" name="[[name]]" aria-label="[[placeholder]]" />\n                        <div id="spinButtonsContainer" class="smart-spin-buttons-container" role="presentation">\n                            <smart-repeat-button initial-delay="[[spinButtonsInitialDelay]]" animation="[[animation]]" delay="[[spinButtonsDelay]]" readonly="[[readonly]]"  unfocusable id="upButton" right-to-left="[[rightToLeft]]" class="smart-spin-button" aria-label="Increment">\n                                <div class="smart-arrow smart-arrow-up" aria-hidden="true"></div>\n                            </smart-repeat-button>\n                            <smart-repeat-button initial-delay="[[spinButtonsInitialDelay]]" animation="[[animation]]" delay="[[spinButtonsDelay]]" readonly="[[readonly]]" unfocusable id="downButton" right-to-left="[[rightToLeft]]" class="smart-spin-button" aria-label="Decrement">\n                                <div class="smart-arrow smart-arrow-down" aria-hidden="true"></div>\n                            </smart-repeat-button>\n                        </div>\n                        <div id="calendarButton" class="smart-drop-down-button smart-calendar-button" role="button" aria-haspopup="dialog" aria-label="Toggle popup"></div>\n                        <div id="dropDownContainer" class="smart-drop-down smart-date-time-drop-down smart-drop-down-container smart-visibility-hidden" role="dialog">\n                            <div id="dropDownHeader" class="smart-drop-down-header smart-hidden" role="heading" aria-level="1">\n                                <div id="selectDate" class="smart-selected" role="button"></div>\n                                <div id="selectTime" role="button"></div>\n                            </div>\n                            <div id="dropDownContent" class="smart-drop-down-content" role="presentation">\n                                <smart-calendar id="calendarDropDown" class="smart-hidden"\n                                              animation="[[animation]]"\n                                              animation-settings="[[animationSettings]]"\n                                              calendar-mode="[[calendarMode]]"\n                                              day-name-format="[[dayNameFormat]]"\n                                              disable-auto-navigation="[[disableAutoNavigation]]"\n                                              display-mode-view="[[displayModeView]]"\n                                              first-day-of-week="[[firstDayOfWeek]]"\n                                              header-template="[[headerTemplate]]"\n                                              hide-day-names="[[hideDayNames]]"\n                                              hide-other-month-days="[[hideOtherMonthDays]]"\n                                              hide-tooltip-arrow="[[hideTooltipArrow]]"\n                                              important-dates="[[importantDates]]"\n                                              important-dates-template="[[importantDatesTemplate]]"\n                                              locale="[[locale]]"\n                                              right-to-left="[[rightToLeft]]"\n                                              selection-mode="one"\n                                              spin-buttons-delay="[[spinButtonsDelay]]"\n                                              spin-buttons-initial-delay="[[spinButtonsInitialDelay]]"\n                                              theme="[[theme]]"\n                                              tooltip="[[tooltip]]"\n                                              tooltip-delay="[[tooltipDelay]]"\n                                              tooltip-position="[[tooltipPosition]]"\n                                              tooltip-template="[[tooltipTemplate]]"\n                                              unfocusable="[[unfocusable]]"\n                                              view-sections=\'["header", "footer"]\'\n                                              week-numbers="[[weekNumbers]]"\n                                              weeks="[[weeks]]"></smart-calendar>\n                            </div>\n                        </div>\n                    </div>\n                    <span id="hint" inner-h-t-m-l="[[hint]]" class="smart-hint smart-hidden"></span>\n                </div>'}attached(){const e=this;super.attached(),e.isCompleted&&(e._defaultFooterTemplateApplied&&e._addCalendarFooterListeners(),e.$.timePickerDropDown&&e._addTimePickerListener(),e._positionDetection&&e._positionDetection.dropDownAttached())}detached(){const e=this;if(super.detached(),e.close(),e._defaultFooterTemplateApplied){const t=e.$.calendarDropDown.$footer;t.unlisten("change"),t.unlisten("click"),t.unlisten("wheel")}e.$.timePickerDropDown&&e.$.timePickerDropDown.$.unlisten("change"),e._positionDetection&&e._positionDetection.dropDownDetached()}ready(){super.ready();const e=this;e._edgeMacFF=Smart.Utilities.Core.Browser.Edge||Smart.Utilities.Core.Browser.Firefox&&-1!==navigator.platform.toLowerCase().indexOf("mac"),e._iOS=!!navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform),e._edgeMacFF&&e.$dropDownContainer.addClass("not-in-view"),e._defaultFooterTemplate=document.createElement("template"),e._defaultFooterTemplate.innerHTML='<div class="smart-date-time-picker-footer">\n                <div class="smart-footer-component smart-footer-component-hour" role="presentation">\n                    <input type="text" class="smart-hour-element" aria-label="Hours" />\n                    <span role="presentation">\n                        <smart-repeat-button initial-delay="0" delay="75" aria-label="Increment hours">\n                            <span class="smart-arrow smart-arrow-up" aria-hidden="true"></span>\n                        </smart-repeat-button>\n                        <smart-repeat-button  initial-delay="0" delay="75" aria-label="Decrement hours">\n                            <span class="smart-arrow smart-arrow-down" aria-hidden="true"></span>\n                        </smart-repeat-button>\n                    </span>\n                </div>\n                <div class="smart-footer-component smart-footer-component-minute" role="presentation">\n                    <input class="smart-minute-element" aria-label="Minutes" />\n                    <span role="presentation">\n                        <smart-repeat-button initial-delay="0" delay="75" aria-label="Increment minutes">\n                            <span class="smart-arrow smart-arrow-up" aria-hidden="true"></span>\n                        </smart-repeat-button>\n                        <smart-repeat-button initial-delay="0" delay="75" aria-label="Decrement minutes">\n                            <span class="smart-arrow smart-arrow-down" aria-hidden="true"></span>\n                        </smart-repeat-button>\n                    </span>\n                </div>\n                <div class="smart-footer-component smart-footer-component-ampm" role="presentation">\n                    <input type="text" class="smart-am-pm-element" aria-label="AM/PM" />\n                </div>\n                <div class="smart-footer-component smart-footer-component-today" role="presentation">\n                    <div tabindex="-1" class="smart-today-element" role="button" aria-label="Now"></div>\n                </div>\n            </div>',e._codeToMethod={y:"addYears",yy:"addYears",yyyy:"addYears",yyyyy:"addYears",M:"addMonths",MM:"addMonths",MMM:"addMonths",MMMM:"addMonths",d:"addDays",dd:"addDays",ddd:"addDays",dddd:"addDays",H:"addHours",HH:"addHours",h:"addHours",hh:"addHours",m:"addMinutes",mm:"addMinutes",s:"addSeconds",ss:"addSeconds",f:"addDeciseconds",ff:"addCentiseconds",fff:"addMilliseconds",u:"addMicroseconds",uu:"addMicroseconds",n:"addNanoseconds",nn:"addNanoseconds",p:"addPicoseconds",pp:"addPicoseconds",e:"addFemtoseconds",ee:"addFemtoseconds",a:"addAttoseconds",aa:"addAttoseconds",x:"addZeptoseconds",xx:"addZeptoseconds",o:"addYoctoseconds",oo:"addYoctoseconds"},e._codeToIndex={y:0,yy:0,yyyy:0,yyyyy:0,M:1,MM:1,MMM:1,MMMM:1,d:2,dd:2,ddd:2,dddd:2,H:3,HH:3,h:3,hh:3,m:4,mm:4,s:5,ss:5,f:6,ff:6,fff:6,u:7,uu:7,n:8,nn:8,p:9,pp:9,e:10,ee:10,a:11,aa:11,x:12,xx:12,o:13,oo:13},e._getLocalizedNames(),e.checkLicense()}render(){const e=this;e.rightToLeft&&(e.calendarButtonPosition="right"===e.calendarButtonPosition?"left":"right"),e._positionDetection=new Smart.Utilities.PositionDetection(e,e.$.dropDownContainer,e.$.content,"close"),e._positionDetection.customPositionDropDown=e._positionExternalDropDown,e._positionDetection.getDropDownParent(!0),e._positionDetection.setDropDownPosition(),e.$.dropDownContainer.style.left=null,e._positionDetection.handleAutoPositioning(),e._setIds(),e._validateInitialPropertyValues(),e._setFocusable(),e.setAttribute("role","presentation"),e.$.input.setAttribute("aria-describedby",e.$.hint.id),e.$.input.setAttribute("aria-labelledby",e.$.label.id),e.$.calendarButton.setAttribute("aria-owns",e.$.dropDownContainer.id),e.$.dropDownContainer.setAttribute("animation",e.animation),e.$.dropDownContainer.setAttribute("drop-down-display-mode",e.dropDownDisplayMode),super.render(),e.isInitialized=!0}close(){this.opened&&this._close()}focus(){this.$.input.focus()}select(){this.$.input.select()}open(){this.opened||this._open()}_handleFooter(){const e=this;if(e.footer){e.$.dropDownContainer.setAttribute("footer","");const t=e.$.calendarDropDown;"default"===e._dropDownDisplayMode?t.viewSections=["title","header","footer"]:"classic"===e._dropDownDisplayMode?t.viewSections=["header","footer"]:"calendar"===e._dropDownDisplayMode&&(t.viewSections=["title","header","footer"])}else e.$.dropDownContainer.removeAttribute("footer")}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"animation":case"theme":n.$.timePickerDropDown&&(n.$.timePickerDropDown[e]=a),"animation"===e&&(n.$.dropDownContainer.setAttribute("animation",n.animation),n._defaultFooterTemplateApplied&&Array.from(n.$.calendarDropDown.$.footer.getElementsByTagName("smart-repeat-button")).forEach((function(e){e.animation=a})));break;case"calendarButton":n.$.dropDownContainer.style.transition="none",a||n.close();break;case"calendarButtonPosition":n.$.dropDownContainer.style.transition="none",n.close(),"left"===a?n.$.content.insertBefore(n.$.calendarButton,n.$.content.firstElementChild):null===n._dropDownParent?n.$.content.insertBefore(n.$.calendarButton,n.$.dropDownContainer):n.$.content.appendChild(n.$.calendarButton);break;case"disabled":a?(n.close(),n.$.upButton.disabled=!0,n.$.downButton.disabled=!0):n._disableSpinButtons(),n._setFocusable(),n._positionDetection.handleAutoPositioning();break;case"displayKind":{const e=n._outputTimeZone;switch(a){case"unspecified":n._outputTimeZone=n._inputTimeZone;break;case"UTC":n._outputTimeZone="UTC";break;case"local":n._outputTimeZone="Local"}if(n._outputTimeZone===e)return;null!==n._value&&(n.close(),n._toSync=!0,n._value=n._value.toTimeZone(n._outputTimeZone),n._applyFormatString()),n.min=n.min.toTimeZone(n._outputTimeZone),n.max=n.max.toTimeZone(n._outputTimeZone);for(let e=0;e<n.restrictedDates.length;e++){let t=n.restrictedDates[e];t=t.toTimeZone(n._outputTimeZone)}break}case"dropDownAppendTo":n._positionDetection.dropDownAppendToChangedHandler();break;case"dropDownDisplayMode":n._changeDropDownDisplayMode();break;case"dropDownOverlay":a||n._positionDetection.removeOverlay();break;case"dropDownPosition":n._positionDetection.dropDownPositionChangedHandler();break;case"footer":n._handleFooter();break;case"footerTemplate":if(null!==a){n._defaultFooterTemplateApplied=!1;const e=n.$.calendarDropDown.$footer;e.unlisten("change"),e.unlisten("click"),e.unlisten("wheel"),n.$.calendarDropDown.footerTemplate=a}else{n._setDefaultFooterTemplate();const e=n._value;n._hourElement.value=e.toString("hh"),n._minuteElement.value=e.toString("mm"),n._ampmElement.value=e.toString("tt")}n._handleFooter();break;case"formatString":""===a&&(n.formatString="dd-MMM-yy HH:mm:ss.fff"),n._getFormatStringRegExp(),n._applyFormatString(),"auto"===n.dropDownDisplayMode&&n._changeDropDownDisplayMode(),n._timePickerInitialized&&(n.$.timePickerDropDown.format=n._formatStringRegExp.groups.find((e=>-1!==e.indexOf("H")))?"24-hour":"12-hour");break;case"interval":n._validateInterval(t);break;case"locale":case"messages":if(n.$.selectDate.innerHTML=n.localize("dateTabLabel"),n.$.selectTime.innerHTML=n.localize("timeTabLabel"),n._defaultFooterTemplateApplied&&(n._todayElement.title=n.localize("now")),"messages"===e)return;n._getLocalizedNames(),n.min.calendar.days=n._localizedDays,n.min.calendar.months=n._localizedMonths,n.min.calendar.locale=n.locale,n.max.calendar.days=n._localizedDays,n.max.calendar.months=n._localizedMonths,n.max.calendar.locale=n.locale,null!==n.value&&(n._value.calendar.days=n._localizedDays,n._value.calendar.months=n._localizedMonths,n._value.calendar.locale=n.locale,n.value.calendar.days=n._localizedDays,n.value.calendar.months=n._localizedMonths,n.value.calendar.locale=n.locale),Smart.Utilities.DateTime.cache=[],n._applyFormatString();break;case"max":case"min":n._validateMinMax(e,t),"strict"===n.validation?n._validateValue():n._minMaxChanged=!0;break;case"nullable":!0===t&&null===n._value&&n._validateValue(n._now(),null);break;case"opened":a?n._open():n._close();break;case"readonly":case"unfocusable":a&&n.close(),"unfocusable"===e&&n._setFocusable();break;case"restrictedDates":n._validateRestrictedDates(),n._validateValue();break;case"spinButtonsPosition":"right"===a?n.$.content.insertBefore(n.$.spinButtonsContainer,n.$.input.nextElementSibling):n.$.content.insertBefore(n.$.spinButtonsContainer,n.$.input);break;case"validation":"strict"===a&&(delete n._minMaxChanged,n._validateValue());break;case"value":{let e;null!==a?(e=Smart.Utilities.DateTime.validateDate(a,n._now(),n.formatString),e=e.toTimeZone(n._outputTimeZone)):e=null,n._validateValue(e,n._value,void 0,!0);break}}}setDate(e){const t=this;let a;null!==e?(a=Smart.Utilities.DateTime.validateDate(e,t._now(),t.formatString),a=a.toTimeZone(t._outputTimeZone)):a=null,t._validateValue(a,t._value,void 0,!0)}getDate(){return this.value&&this.value.toDate?this.value.toDate():null}_addCalendarFooterListeners(){const e=this,t=e.$.calendarDropDown.$footer;t.listen("change",e._footerChangeHandler.bind(e)),t.listen("click",e._footerClickHandler.bind(e)),t.listen("wheel",e._footerWheelHandler.bind(e))}_updateTargetValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const a=e.dataset.property,n=e.value;a&&void 0!==t[a]&&(t[a]=n)}}}_addTimePickerListener(){const e=this;e.$.timePickerDropDown.$.listen("change",(function(t){const a=e.context,n=t.detail.value,i=Smart.Utilities.DateTime.getConstructorParameters(null!==e._value?e._value:e._now());e.context=e,i[3]=n.getHours(),i[4]=n.getMinutes(),e._timePickerInitiatedChange=!0,i.unshift(null),e._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,i))),e._timePickerInitiatedChange=!1,e.context=a}))}_applyFormatString(){const e=this;null!==e.value&&(e.$.input.value=e._value.toString(e.formatString))}_calendarButtonClickHandler(e){const t=this;t._highlightedTimePart=void 0,t.disabled||t.readonly||(t.hasRippleAnimation&&Smart.Utilities.Animation.Ripple.animate(t.$.calendarButton,e.pageX,e.pageY),t.opened?t._close():t._open())}_calendarDropDownChangeHandler(e){const t=this;if(e.stopPropagation(),t._disregardCalendarChangeEvent)t._disregardCalendarChangeEvent=!1;else if(this.$.calendarDropDown.selectedDates.length>0){const a=e.detail.value[0],n=null!==t._value?t._value:t._now(),i=Smart.Utilities.DateTime.getConstructorParameters(n);if(i[0]=a.getFullYear(),i[1]=a.getMonth()+1,i[2]=a.getDate(),t._calendarInitiatedChange=!0,i.unshift(null),t._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,i))),t._defaultFooterTemplateApplied){const e=t._value;""===t._hourElement.value&&(t._hourElement.value=e.toString("hh")),""===t._ampmElement.value&&(t._ampmElement.value=e.toString("tt")),""===t._minuteElement.value&&(t._minuteElement.value=e.toString("mm"))}t._calendarInitiatedChange=!1}else t._setNullValue()}_calendarDropDownClickHandler(e){const t=this;t.autoClose&&e.target.closest(".smart-calendar-cell")&&(clearTimeout(t._autoCloseTimeout),t._autoCloseTimeout=setTimeout((function(){t.close()}),t.autoCloseDelay))}_changeDropDownDisplayMode(){function e(e,a,n,i){t.$dropDownHeader[e]("smart-hidden"),t.$calendarDropDown[a]("smart-hidden"),t._timePickerInitialized&&t.$.timePickerDropDown.$[n]("smart-hidden"),i&&(t.opened?t.$.calendarDropDown._refreshTitle():t._toSync=!0)}const t=this,a=t._dropDownDisplayMode;t._detectDisplayMode(),t._dropDownDisplayMode!==a&&("default"===t._dropDownDisplayMode?(t.calendarMode="default",t.$.calendarDropDown.viewSections=["title","header"],t.$selectDate.addClass("smart-selected"),t.$selectTime.removeClass("smart-selected"),e("removeClass","removeClass","addClass",!0)):"classic"===t._dropDownDisplayMode?(t.calendarMode="classic",t.$.calendarDropDown.viewSections=["header","footer"],e("addClass","removeClass","addClass")):"calendar"===t._dropDownDisplayMode?(t.calendarMode="default",t.$.calendarDropDown.viewSections=["title","header"],e("addClass","removeClass","addClass",!0)):(t.calendarMode="default",e("addClass","addClass","removeClass"),t._timePickerInitialized||t._initializeTimePicker()),t.$.dropDownContainer.setAttribute("drop-down-display-mode",t.dropDownDisplayMode))}_cloneValue(){const e=this;return null!==e._value&&void 0!==e._value?e._value.clone():null}_close(){const e=this;if(e.$.fireEvent("closing").defaultPrevented)e.opened=!0;else{e.$.calendarDropDown.disabled=!0,e.$calendarButton.removeClass("smart-calendar-button-pressed"),e.$.calendarButton.removeAttribute("active"),e.$dropDownContainer.addClass("smart-visibility-hidden");const t=e.$.calendarDropDown.$.container.querySelector(".smart-calendar-cell[hover]");t&&t.removeAttribute("hover"),e.opened=!1,e._positionDetection.removeOverlay(!0),e.$.fireEvent("close"),e._edgeMacFF&&!e.hasAnimation&&(e.$.dropDownContainer.style.top=null,e.$.dropDownContainer.style.left=null,e.$dropDownContainer.addClass("not-in-view")),e.$.input.focus()}e.$.calendarButton.setAttribute("aria-expanded",e.opened)}_detectDisplayMode(){const e=this;"auto"!==e.dropDownDisplayMode?e._dropDownDisplayMode=e.dropDownDisplayMode:e._dropDownDisplayMode=Smart.Utilities.DateTime.detectDisplayMode(e.value||e.min,e.formatString,e._formatStringRegExp),"timePicker"===e._dropDownDisplayMode?(e.$calendarButton.addClass("time"),"Enter date"===e.placeholder&&(e.placeholder="Enter time")):(e.$calendarButton.removeClass("time"),"Enter time"===e.placeholder&&(e.placeholder="Enter date")),"default"===e._dropDownDisplayMode?e.$dropDownContent.removeClass("partial"):e.$dropDownContent.addClass("partial")}_disableSpinButtons(){const e=this;if(e.disabled)return;const t=null===e._value;e.$.upButton.disabled=t,e.$.downButton.disabled=t}_documentUpHandler(e){const t=this,a=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement,n=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;Smart.Utilities.Core.isMobile||a!==t.$.input||"partial"!==t.editMode||null===t._value||n===t.$.input&&t.$.input.selectionStart!==t.$.input.selectionEnd?n===t.$.calendarButton||t.$.dropDownContainer.contains(n)||t.$.dropDownContainer.contains(t._getRootShadowHost(n))||(t.close(),a===t.$.input||t.contains(n)||(t._highlightedTimePart=void 0)):(t._highlightedTimePartEdit=!1,t._validateValue(t.$.input.value,t._cloneValue(),!1),t._highlightTimePartBasedOnCursor()),t._mouseFocus=!1}_getRootShadowHost(e){const t=this;if(!t.shadowRoot&&!t.isInShadowDOM)return;let a,n=e.getRootNode().host;for(;n&&n!==t&&n!==document;)a=n,n=n.getRootNode().host;return a}_dropDownHeaderClickHandler(e){const t=this;if(e.target===t.$.selectDate){if(t.$selectDate.hasClass("smart-selected"))return;t.$selectDate.addClass("smart-selected"),t.$selectTime.removeClass("smart-selected"),t.$.timePickerDropDown.$.addClass("smart-hidden"),t.$calendarDropDown.removeClass("smart-hidden")}else{if(t.$selectTime.hasClass("smart-selected"))return;t.$selectDate.removeClass("smart-selected"),t.$selectTime.addClass("smart-selected"),t.$calendarDropDown.addClass("smart-hidden"),t._timePickerInitialized?t.$.timePickerDropDown.$.removeClass("smart-hidden"):t._initializeTimePicker()}}_dropDownKeydownHandler(e){const t=this,a=e.key,n=t.shadowRoot?t.shadowRoot.activeElement:document.activeElement;!t.$.dropDownHeader.contains(n)||"Enter"!==a&&" "!==a?"Escape"===a||e.altKey&&"ArrowUp"===a?(e.preventDefault(),t.close(),t.$.input.focus()):"Enter"!==a&&" "!==a||!n.classList.contains("smart-footer-component-today")?"Enter"===a&&(n===t.$.calendarDropDown.$.body&&t.$.calendarDropDown.querySelectorAll(".smart-calendar-cell[selected][focus]").length>0||t._timePickerInitialized&&n===t.$.timePickerDropDown.$.picker)&&(e.preventDefault(),t.close()):(e.preventDefault(),t._validateValue(t._now()),t.close()):(e.preventDefault(),t._dropDownHeaderClickHandler({target:n}))}_dropDownTransitionendHandler(){const e=this;if(e.hasAnimation)return e.opened&&e._toFocus?(e._toFocus.focus(),delete e._toFocus,void(e._timePickerInitialized&&!e.$.timePickerDropDown.classList.contains("smart-hidden")&&requestAnimationFrame((()=>e.$.timePickerDropDown._highlightLabel())))):e._edgeMacFF&&!e.opened?(e.$.dropDownContainer.style.top=null,e.$.dropDownContainer.style.left=null,void e.$dropDownContainer.addClass("not-in-view")):void 0}_footerChangeHandler(e){const t=this,a=t.context,n=e.target,i=null!==t._value?t._value:t._now();let o,l=n.value;if(t.context=t,e.stopPropagation(),n.classList.contains("smart-hour-element")){if(l=parseInt(l,10),isNaN(l)||l<0||l>12)return void(n.value=i.toString("hh"));l>0&&l<12&&"PM"===i.toString("tt")&&(l+=12),o="hh"}else{if(!n.classList.contains("smart-minute-element")){if(null===t._value)return void(n.value="");const e=i.toString("tt");return l=l.toLowerCase(),void("PM"===e&&("a"===l||"am"===l)||"AM"===e&&("p"===l||"pm"===l)?(t._incrementDecrement(void 0,"tt"),n.value=t._value.toString("tt")):n.value=e)}if(l=parseInt(l,10),isNaN(l)||l<0||l>59)return void(n.value=i.toString("mm"));o="mm"}const r=Smart.Utilities.DateTime.getConstructorParameters(i);r[t._codeToIndex[o]]=l,r.unshift(null),t._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,r))),n.value=t._value.toString(o),t.context=a}_footerClickHandler(e){const t=this,a=t.context,n=e.target;if(t.context=t,n.classList.contains("smart-today-element"))t._validateValue(t._now()),t.autoClose&&(clearTimeout(t._autoCloseTimeout),t._autoCloseTimeout=setTimeout((function(){t.close()}),t.autoCloseDelay));else{const e=n.closest("smart-repeat-button");if(null!==e){const a=e===e.parentElement.children[1],n=e.closest(".smart-footer-component").classList.contains("smart-footer-component-hour")?"hh":"mm";t._incrementDecrement(a,n)}}t.context=a}_footerWheelHandler(e){const t=this,a=t.shadowRoot?t.shadowRoot.activeElement:document.activeElement;if(t.enableMouseWheelAction&&e.target instanceof HTMLInputElement&&a===e.target){const a=t.context,n=e.target;t.context=t,n.classList.contains("smart-hour-element")?t._incrementDecrement(e.deltaY>0,"hh"):n.classList.contains("smart-minute-element")?t._incrementDecrement(e.deltaY>0,"mm"):t._incrementDecrement(void 0,"tt"),t.context=a,e.stopPropagation()}}_getAndHighlightTimePart(e,t,a){const n=this;n._programmaticSelection=!0,n.$.input.selectionStart!==e||n.$.input.selectionEnd!==t?n.$.input.setSelectionRange(e,t):setTimeout((function(){n.$.input.setSelectionRange(e,t)}),200),n._highlightedTimePart={code:n._formatStringRegExp.groups[a],index:a,from:e,to:t}}_getFormatStringRegExp(){const e=this;e._formatStringRegExp=e.min.getParseRegExp(e.min.calendar,e.formatString.replace(/y+/g,"yyyyy")),e._formatStringRegExp.regExp=new RegExp(e._formatStringRegExp.regExp)}_getLocalizedNames(){const e=this,t=Smart.Utilities.DateTime.getLocalizedNames(e.locale);e._localizedDays=t.days,e._localizedMonths=t.months,e.$.selectDate.innerHTML=e.localize("dateTabLabel"),e.$.selectTime.innerHTML=e.localize("timeTabLabel")}_handleManualTimePartEdit(e){const t=this,a=Smart.Utilities.DateTime.getConstructorParameters(t._value);if(e=e[t._highlightedTimePart.index+1],isNaN(e)){if(1===t._codeToIndex[t._highlightedTimePart.code]){let n=-1;if(e.length>1&&t._localizedMonths.names.some((function(t,a){if(-1!==t.toLowerCase().indexOf(e.toLowerCase()))return n=a,!0})),-1===n)return void t._applyFormatString();a[1]=n+1}}else{if("f"===t._highlightedTimePart.code)e=100*parseInt(e,10);else if("ff"===t._highlightedTimePart.code)e=10*parseInt(e,10);else if(-1!==t._highlightedTimePart.code.indexOf("y")&&e.length<3){const a=t.yearCutoff.toString(),n=parseInt(a.slice(2),10);let i=parseInt(a.slice(0,2),10);(e=parseInt(e,10))<n&&i++,e=e.toString(),e=i+""+"0".repeat(2-e.length)+e}else if(-1!==t._highlightedTimePart.code.indexOf("h")){const a=t._value.hour();e=parseInt(e,10),a>11&&e<=11&&(e+=12)}a[t._codeToIndex[t._highlightedTimePart.code]]=parseInt(e,10)}try{a.unshift(null),t._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,a)))}catch(e){t._applyFormatString()}}_highlightTimePartBasedOnCursor(e){const t=this,a=t.$.input.value,n=t._formatStringRegExp.regExp.exec(a);function i(){return void 0===e?t.$.input.selectionStart:e}if(null===n)return void(t._highlightedTimePart=void 0);t._iOS||void 0!==e||(e=t.$.input.selectionStart);let o,l=n.index;for(let e=1;e<n.length;e++){const r=n[e];if(o=a.indexOf(r,l),l=o+r.length,1===e&&i()<o){t._getAndHighlightTimePart(o,l,0);break}if(i()>=o&&i()<=l){t._getAndHighlightTimePart(o,l,e-1);break}const s=n[e+1];if(!s){t._programmaticSelection=!0,t.$.input.setSelectionRange(o,l),t._highlightedTimePart={code:t._formatStringRegExp.groups[e-1],index:e-1,from:o,to:l};break}{const n=a.indexOf(s,l);if(i()>l&&i()<n){i()-l<=n-i()?t._getAndHighlightTimePart(o,l,e-1):(t._formatStringRegExp.groups[e],t._programmaticSelection=!0,t.$.input.setSelectionRange(n,n+s.length));break}}}}_highlightTimePartBasedOnIndex(e){const t=this,a=t.$.input.value,n=t._formatStringRegExp.regExp.exec(a);if(null===n)return t._validateValue(void 0,t._cloneValue(),!1),void t._highlightTimePartBasedOnIndex(e);let i,o=n.index;const l=t.shadowRoot?t.shadowRoot.activeElement:document.activeElement;if(!(e<0||e>=n.length)){t.$.input!==l&&t.$.input.focus();for(let l=1;l<n.length;l++){const r=n[l];if(i=a.indexOf(r,o),o=i+r.length,e===l-1){t._getAndHighlightTimePart(i,o,e);break}}}}_incrementDecrement(e,t){const a=this,n=a._cloneValue();if(a._minMaxChanged&&(a._value=a._rangeValidation(a._value),delete a._minMaxChanged),void 0===t&&a._highlightedTimePart&&(t=a._highlightedTimePart.code),void 0!==t){if("z"===t||"zz"===t||"zzz"===t)return void a._highlightTimePartBasedOnIndex(a._highlightedTimePart.index);a._value="t"===t||"tt"===t?a._value.addHours(a._value.hour()<12?12:-12,!0):a._value[a._codeToMethod[t]](e?-1:1,!0),a._validateValue(void 0,n,!1),a._highlightedTimePart&&a._highlightTimePartBasedOnIndex(a._highlightedTimePart.index)}else a._value=a._value.add(e?a.interval.negate():a.interval,void 0,!0),a._validateValue(void 0,n,!1);0!==n.compare(a._value)&&a.isInitialized&&(a.$.fireEvent("change",{oldValue:n.toTimeZone(a._inputTimeZone),value:a.value}),a._updateTargetValue())}_initializeTimePicker(){const e=this,t=document.createElement("smart-time-picker");t.rightToLeft=e.rightToLeft,t.animation=e.animation,t.autoSwitchToMinutes=e.autoSwitchToMinutes,t.format=e._formatStringRegExp.groups.find((e=>-1!==e.indexOf("H")))?"24-hour":"12-hour",t.theme=e.theme,t.value=null!==e._value?e._value.toDate():e._now(),e.$.timePickerDropDown=t,t.$=Smart.Utilities.Extend(t),e.$.dropDownContent.appendChild(t),e._timePickerInitialized=!0,e._addTimePickerListener()}_inputBlurHandler(){const e=this;e.removeAttribute("focus"),e._fullEdit=!1,e._highlightedTimePartEdit=!1,e.$.fireEvent("blur")}_inputChangeHandler(e){const t=this;if(e&&e.stopPropagation(),""!==t.$.input.value){if(t._fullEdit||null===t._value)t._fullEdit=!1,t._validateValue(t.$.input.value),t._highlightTimePartBasedOnCursor();else if(t._highlightedTimePartEdit){t._highlightedTimePartEdit=!1;let e=t._formatStringRegExp.regExp.exec(t.$.input.value);null!==e?t._handleManualTimePartEdit(e):t._applyFormatString()}}else t._setNullValue()}_inputDragstartHandler(e){e.preventDefault()}_inputFocusHandler(){const e=this;if(e.setAttribute("focus",""),"full"!==e.editMode){const t=Smart.Utilities.Core.isMobile?10:0;setTimeout((function(){e._iOS?e._highlightTimePartBasedOnCursor():!0!==e._mouseFocus&&(void 0===e._highlightedTimePart?e._highlightTimePartBasedOnCursor(e._iOS?void 0:0):e._highlightTimePartBasedOnIndex(e._highlightedTimePart.index))}),t)}e.$.fireEvent("focus")}_inputKeydownHandler(e){const t=this,a=t.editMode,n=e.key;if("Tab"!==n){if(e.altKey&&"ArrowDown"===n)return e.preventDefault(),void t.open();if("Escape"===n||e.altKey&&"ArrowUp"===n)return e.preventDefault(),void t.close();if("full"!==a){if("partial"===a){if("Delete"===n)return void(null!==t._value&&(t._setNullValue(),e.preventDefault()));if(null===t._value&&(t._validateValue(t._now(),null,!1),t._highlightTimePartBasedOnIndex(0)),-1!==["/",".","-",","," "].indexOf(n))return t._inputChangeHandler(),t._navigateToNextTimePart(),void e.preventDefault();if("Backspace"===n)return t._resetTimePart(),t._highlightedTimePart.index>0?t._navigateToPreviousTimePart():t._highlightTimePartBasedOnIndex(0),void e.preventDefault()}else if(t._fullEdit||t._highlightedTimePartEdit||t.readonly||-1!==["Alt","Control","Shift"].indexOf(n)||e.altKey||e.ctrlKey)return void(-1!==["End","Home","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].indexOf(n)&&t._highlightedTimePartEdit&&t._inputChangeHandler());if(-1!==["End","Home","ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].indexOf(n)){if(e.preventDefault(),"partial"===a&&t._highlightedTimePartEdit&&t._inputChangeHandler(),null!==t._value)switch(n){case"End":t._highlightTimePartBasedOnIndex(t._formatStringRegExp.groups.length-1);break;case"Home":t._highlightTimePartBasedOnIndex(0);break;case"ArrowLeft":t._navigateToPreviousTimePart();break;case"ArrowUp":t._incrementDecrement();break;case"ArrowRight":t._navigateToNextTimePart();break;case"ArrowDown":t._incrementDecrement(!0)}}else if(t._highlightedTimePart){if("partial"!==a&&t._highlightedTimePart.to-t._highlightedTimePart.from!=t.$.input.selectionEnd-t.$.input.selectionStart)return void(t._fullEdit=!0);const i=t._highlightedTimePart.code;if("ddd"===i||"dddd"===i||"z"===i||"zz"===i||"zzz"===i||"t"===i||"tt"===i)return void e.preventDefault();if("partial"===a&&"MMM"!==i&&"MMMM"!==i&&!1===new RegExp(/^\d+$/).test(n))return void((n.length<2||"F"!==n.charAt(0))&&e.preventDefault());t._highlightedTimePartEdit=!0}}else t._fullEdit=!0}}_inputDownHandler(){const e=this;e._fullEdit||e._highlightedTimePartEdit||"full"===e.editMode||Smart.Utilities.Core.isMobile||setTimeout((function(){e._mouseFocus=!0,e._highlightTimePartBasedOnCursor()}),0)}_inputPasteHandler(e){"partial"===this.editMode?e.preventDefault():this._fullEdit=!0}_inputSelectHandler(){const e=this,t=e.shadowRoot?e.shadowRoot.activeElement:document.activeElement;"partial"===e.editMode&&t===e.$.input&&(!0===e._programmaticSelection?e._programmaticSelection=!1:e._highlightedTimePart?e._highlightTimePartBasedOnIndex(e._highlightedTimePart.index):e._highlightTimePartBasedOnIndex(0))}_inputUpHandler(){const e=this;Smart.Utilities.Core.isMobile&&(e._iOS?(e._mouseFocus=!0,setTimeout((function(){document.activeElement===e.$.input&&e._highlightTimePartBasedOnCursor()}),50)):setTimeout((function(){e._mouseFocus=!0,e._highlightTimePartBasedOnCursor()}),10))}_inputWheelHandler(e){const t=this;(t.shadowRoot?t.shadowRoot.activeElement:document.activeElement)!==t.$.input||!t.enableMouseWheelAction||t.disabled||t.readonly||(e.preventDefault(),t._incrementDecrement(e.deltaY>0))}_isRestricted(e){const t=this.restrictedDates;let a=!1;for(let n=0;n<t.length;n++)if(e.equalDateParts(t[n])){a=!0;break}return a}_mouseoutHandler(e){const t=this,a=e.target;t.disabled||a!==t.$.input&&a!==t.$.calendarButton||(a.removeAttribute("hover"),t.removeAttribute("hover"))}_mouseoverHandler(e){const t=this,a=e.target;t.disabled||a!==t.$.input&&a!==t.$.calendarButton||(a.setAttribute("hover",""),t.setAttribute("hover",""))}_navigateToNextTimePart(){this._highlightTimePartBasedOnIndex(this._highlightedTimePart.index+1)}_navigateToPreviousTimePart(){this._highlightTimePartBasedOnIndex(this._highlightedTimePart.index-1)}_now(){const e=this,t=new Smart.Utilities.DateTime("today","Local");return"Local"!==e._outputTimeZone?t.toTimeZone(e._outputTimeZone):t}_open(e){const t=this;if(t.disabled||t.readonly)return t.opened=!1,void t.$.calendarButton.setAttribute("aria-expanded",!1);if(t.$.fireEvent("opening").defaultPrevented)return t.opened=!1,void t.$.calendarButton.setAttribute("aria-expanded",!1);t._edgeMacFF&&t.$dropDownContainer.removeClass("not-in-view");const a=t.$.dropDownContainer;a.style.marginLeft=null,e||(a.style.transition=""),t.$.calendarDropDown.disabled=!1,t.$calendarButton.addClass("smart-calendar-button-pressed"),t.$.calendarButton.setAttribute("active",""),("default"!==t._dropDownDisplayMode&&"timePicker"!==t._dropDownDisplayMode||!t._timePickerInitialized||t._timePickerInitialized&&t.$.timePickerDropDown.$.hasClass("smart-hidden"))&&t.$calendarDropDown.removeClass("smart-hidden"),t.opened=!0,t.$.calendarButton.setAttribute("aria-expanded",!0),t._positionDetection.placeOverlay(),t._positionDetection.checkBrowserBounds("vertically"),t._positionDetection.positionDropDown(),t.$dropDownContainer.removeClass("smart-visibility-hidden");const n=1===window.devicePixelRatio?document.documentElement.clientWidth:window.innerWidth,i=a.getBoundingClientRect();if(i.left<0?a.style.marginLeft=-1*i.left+"px":i.right>n&&(a.style.marginLeft=n-i.right+"px"),t.$.fireEvent("open"),t._toSync){const e=t._value;if(null!==e)t._disregardCalendarChangeEvent=!0,t.$.calendarDropDown.selectedDates=[e.toDate()],t._defaultFooterTemplateApplied&&(t._hourElement.value=e.toString("hh"),t._minuteElement.value=e.toString("mm"),t._ampmElement.value=e.toString("tt")),t._timePickerInitialized&&(t.$.timePickerDropDown.value=e.toDate()),t._disregardCalendarChangeEvent=!1;else{const e=t.$.calendarDropDown.context;t.$.calendarDropDown.context=t.$.calendarDropDown,t.$.calendarDropDown._clearSelection(!0),t.$.calendarDropDown.context=e,t._defaultFooterTemplateApplied&&(t._hourElement.value="",t._minuteElement.value="",t._ampmElement.value="")}t._toSync=!1}let o;switch(t._dropDownDisplayMode){case"default":o=t.$selectDate.hasClass("smart-selected")?t.$.calendarDropDown:t.$.timePickerDropDown.$.picker;break;case"classic":case"calendar":o=t.$.calendarDropDown;break;case"timePicker":o=t.$.timePickerDropDown.$.picker}t.hasAnimation?(t._toFocus=o,function e(){t._toFocus&&(0===t.$.dropDownContainer.getBoundingClientRect().height?requestAnimationFrame(e):t._dropDownTransitionendHandler())}()):o.focus()}_positionExternalDropDown(e){const t=this.context,a=!t.calendarButton||"right"===t.calendarButtonPosition,n=t._dropDownListPosition,i=t.$.dropDownContainer;let o,l=a?e.right-i.offsetWidth:e.left;switch(n){case"bottom":o=e.bottom;break;case"overlay-top":o=e.bottom-i.offsetHeight;break;case"overlay-center":o=e.top+e.height/2-i.offsetHeight/2;break;case"overlay-bottom":o=e.top;break;case"top":o=e.top-i.offsetHeight;break;case"center-bottom":case"center-top":o="center-bottom"===n?e.bottom+5:e.top-5-i.offsetHeight,l=a?e.right-i.offsetWidth/2-t.$.calendarButton.offsetWidth/2:e.left-i.offsetWidth/2+t.$.calendarButton.offsetWidth/2}return{left:l,top:o}}_rangeValidation(e){const t=this;return-1===e.compare(t.min)?t.min.clone():1===e.compare(t.max)?t.max.clone():e}_resetTimePart(){const e=this,t=e._highlightedTimePart.code,a=e._codeToIndex[t],n=Smart.Utilities.DateTime.getConstructorParameters(e._value);let i;i=a>2?0:a>0?1:e.min.year(),n[a]=i,n.unshift(null),e._validateValue(new(Function.prototype.bind.apply(Smart.Utilities.DateTime,n)))}_setIds(){const e=this;e.$.label.id||(e.$.label.id=e.id+"Label"),e.$.input.id||(e.$.input.id=e.id+"Input"),e.$.calendarButton.id||(e.$.calendarButton.id=e.id+"CalendarButton"),e.$.dropDownContainer.id||(e.$.dropDownContainer.id=e.id+"DropDownContainer"),e.$.hint.id||(e.$.hint.id=e.id+"Hint")}_setDefaultFooterTemplate(e){const t=this;t.$.calendarDropDown.footerTemplate=t._defaultFooterTemplate,e&&t.$.calendarDropDown._handleLayoutTemplate(t.$.calendarDropDown.$.footer,t._defaultFooterTemplate),t._hourElement=t.$.calendarDropDown.getElementsByClassName("smart-hour-element")[0],t._minuteElement=t.$.calendarDropDown.getElementsByClassName("smart-minute-element")[0],t._ampmElement=t.$.calendarDropDown.getElementsByClassName("smart-am-pm-element")[0],t._todayElement=t.$.calendarDropDown.getElementsByClassName("smart-today-element")[0],t._todayElement.title=t.localize("now"),Array.from(t.$.calendarDropDown.$.footer.getElementsByTagName("smart-repeat-button")).forEach((function(e){e.animation=t.animation})),t._addCalendarFooterListeners(),t._defaultFooterTemplateApplied=!0}_setFocusable(){const e=this;if(e.disabled||e.unfocusable)return e.$.input.tabIndex=-1,e.$.selectDate.removeAttribute("tabindex"),e.$.selectTime.removeAttribute("tabindex"),void(e._defaultFooterTemplateApplied&&(e._hourElement.tabIndex=-1,e._ampmElement.tabIndex=-1,e._minuteElement.tabIndex=-1));const t=e.tabIndex>0?e.tabIndex:0;e.$.input.removeAttribute("tabindex"),e.$.selectDate.tabIndex=t,e.$.selectTime.tabIndex=t,e._defaultFooterTemplateApplied&&(e._hourElement.removeAttribute("tabindex"),e._ampmElement.removeAttribute("tabindex"),e._minuteElement.removeAttribute("tabindex"),e.$.calendarDropDown.getElementsByClassName("smart-footer-component-today")[0].tabIndex=t)}_setNullValue(e){const t=this;if(void 0===e&&(e=t._cloneValue()),t.nullable){if(t._value=null,t.value=null,t._highlightedTimePart=void 0,t.$.input.value="",null!==e){if(t.opened){if(!t._calendarInitiatedChange){const e=t.$.calendarDropDown.context;t.$.calendarDropDown.context=t.$.calendarDropDown,t.$.calendarDropDown._clearSelection(!0),t.$.calendarDropDown.context=e}t._defaultFooterTemplateApplied&&(t._hourElement.value="",t._ampmElement.value="",t._minuteElement.value=""),t._toSync=!1}else t._toSync=!0;t.isInitialized&&(t.$.fireEvent("change",{oldValue:e.toTimeZone(t._inputTimeZone),value:null}),t._updateTargetValue())}t._disableSpinButtons()}else t._validateValue(t._now(),e)}_spinButtonsClickHandler(e){const t=this;null===t._value||t.disabled||t.readonly||t._incrementDecrement(t.$.downButton.contains(e.target))}_validateInitialPropertyValues(){const e=this,t=e.$.calendarDropDown;"left"===e.calendarButtonPosition&&e.$.content.insertBefore(e.$.calendarButton,e.$.input),"left"===e.spinButtonsPosition&&e.$.content.insertBefore(e.$.spinButtonsContainer,e.$.input),e.disabled&&(e.$.upButton.disabled=!0,e.$.downButton.disabled=!0),e.opened&&(e.disabled||e.readonly?e.opened=!1:(e.$.dropDownContainer.style.transition="none",e._open(!0))),e.$.calendarButton.setAttribute("aria-expanded",e.opened),null===e.footerTemplate?e._setDefaultFooterTemplate(!0):(t.footerTemplate=e.footerTemplate,t._handleLayoutTemplate(t.$.footer,e.footerTemplate)),""===e.formatString&&(e.formatString="dd-MMM-yy HH:mm:ss.fff");const a=e.displayKind;let n;if("UTC"===a?e._outputTimeZone="UTC":"local"===a&&(e._outputTimeZone="Local"),null!==e.value?(n=Smart.Utilities.DateTime.validateDate(e.value,new Smart.Utilities.DateTime,e.formatString),e._inputTimeZone=n.timeZone,"unspecified"!==a&&e._inputTimeZone!==e._outputTimeZone?n=n.toTimeZone(e._outputTimeZone):"unspecified"===a&&(e._outputTimeZone=e._inputTimeZone)):(n=null,e._inputTimeZone="Local"),e._validateRestrictedDates(),e._validateMinMax("both"),e._validateValue(n,e._now(),!1,!0),e._validateInterval(new Smart.Utilities.TimeSpan(0,0,1)),e._getFormatStringRegExp(),e._defaultFooterTemplateApplied&&""===e._hourElement.value&&null!==e.value){const t=e.value;e._hourElement.value=t.toString("hh"),e._ampmElement.value=t.toString("tt"),e._minuteElement.value=t.toString("mm")}e._detectDisplayMode();const i=e._dropDownDisplayMode;"default"===i||"calendar"===i?(t.viewSections=["title","header"],t.$title.hasClass("smart-hidden")&&t.propertyChangedHandler("viewSections",["header","footer"],["title","header"]),"default"===i&&e.$dropDownHeader.removeClass("smart-hidden")):"timePicker"===i&&(e.$calendarDropDown.addClass("smart-hidden"),e._initializeTimePicker()),e.footer&&e._handleFooter()}_validateInterval(e){const t=this,a=t.interval;let n=a;if(a instanceof Smart.Utilities.TimeSpan)n=a;else if("string"==typeof a){const i=a.indexOf("TimeSpan("),o=a.indexOf(")");if(-1!==i&&-1!==o&&(n=a.slice(i+9,o),n=n.replace(/'/g,"").replace(/"/g,"").replace(/^\s+|\s+$|\s+(?=\s)/g,""),new RegExp(/(^(\d+)(,\s*\d+)*$)/g).test(n)&&(n=n.replace(/\s/g,""),n=n.split(","),n.map((function(e,t){n[t]=parseInt(e)})),n.unshift(null),n=new(Function.prototype.bind.apply(Smart.Utilities.TimeSpan,n)))),n instanceof Smart.Utilities.TimeSpan==0){if(""===n.trim())return void(t.interval=e);isNaN(n)||(n=1e4*parseInt(n,10));try{n=new Smart.Utilities.TimeSpan(n)}catch(a){return void(t.interval=e)}}}else{if("number"!=typeof a)return void(t.interval=e);n=new Smart.Utilities.TimeSpan(a)}0===n._ticks?t.interval=e:t.interval=n}_validateMinMax(e,t){const a=this;let n=!1;"max"!==e&&(a.min=Smart.Utilities.DateTime.validateDate(a.min,t||new Smart.Utilities.DateTime(1600,1,1),a.formatString),a.min=a.min.toTimeZone(a._outputTimeZone),n=!0),"min"!==e&&(a.max=Smart.Utilities.DateTime.validateDate(a.max,t||new Smart.Utilities.DateTime(3001,1,1),a.formatString),a.max=a.max.toTimeZone(a._outputTimeZone),a.max.calendar.days=a._localizedDays,a.max.calendar.months=a._localizedMonths,a.max.calendar.locale=a.locale,a.$.calendarDropDown.max=a.max.toDate()),a.min.compare(a.max)>0&&(a.min=a.max.clone(),n=!0),n&&(a.min.calendar.days=a._localizedDays,a.min.calendar.months=a._localizedMonths,a.min.calendar.locale=a.locale,a.$.calendarDropDown.min=a.min.toDate())}_validateRestrictedDates(){const e=this,t=[],a=[];for(let n=0;n<e.restrictedDates.length;n++){const i=e.restrictedDates[n];let o=Smart.Utilities.DateTime.validateDate(i,"invalid",e.formatString);"invalid"!==o&&(o=o.toTimeZone(e._outputTimeZone),t.push(o),a.push(o.toDate()))}e.restrictedDates=t,e.$.calendarDropDown.restrictedDates=a}_validateValue(e,t,a,n){const i=this;let o=void 0!==t?t:i._cloneValue();if(null===e||""===e)return void i._setNullValue(o);if(e&&"string"==typeof e)if(-1===e.indexOf("-")&&-1===e.indexOf("/")&&-1===e.indexOf(".")){if(i.formatString){let t="",a=0;for(let n=0;n<i.formatString.length;n++)"-"===i.formatString[n]||"/"===i.formatString[n]||"."===i.formatString[n]?t+=i.formatString[n]:e[a]?(t+=e[a],a++):t+=i.formatString[n];if(t.indexOf("y")>=0){let e=t.substring(t.indexOf("y")-2);const a=i.yearCutoff.toString(),n=parseInt(a.slice(2),10);let o=parseInt(a.slice(0,2),10);e=parseInt(e,10),e<n&&o++,e=e.toString(),"NaN"!==e?(e=o+""+"0".repeat(2-e.length)+e,t=t.substring(0,t.indexOf("y")-2)+e):t=null}e=t}}else{let t=e.indexOf("-")>=0?"-":"";if(""===t&&(t=e.indexOf("/")>=0?"/":""),""===t&&(t=e.indexOf(".")>=0?".":""),t&&i.formatString.indexOf("yyyy")>=0){const a=e.split(t);let n=a[a.length-1];if(n.length<4){const o=i.yearCutoff.toString(),l=parseInt(o.slice(2),10);let r=parseInt(o.slice(0,2),10);n=parseInt(n,10),n<l&&r++,n=n.toString(),n=r+""+"0".repeat(2-n.length)+n,a[a.length-1]=n,e=a.join(t)}}}if(void 0!==e&&(i._value=Smart.Utilities.DateTime.validateDate(e,o,i.formatString)),null===i._value)return void i._setNullValue(o);let l=i._value;for(;!0===i._isRestricted(l);)l.addDays(1,!1);const r=i._rangeValidation(l);n&&"strict"!==i.validation?!1===l.equals(r)&&(i._minMaxChanged=!0):(i._value=r,delete i._minMaxChanged),i.value=i._value.toTimeZone(i._inputTimeZone);const s=i._value;if(s.calendar.days=i._localizedDays,s.calendar.months=i._localizedMonths,s.calendar.locale=i.locale,i._applyFormatString(),i._disableSpinButtons(),o&&"string"==typeof o&&(o=new Smart.Utilities.DateTime(o)),(null===o||null===s)&&o!==s||null!==o&&null!==s&&o.compare&&0!==o.compare(s)){if(!1!==a&&i.isInitialized&&!n&&(i.$.fireEvent("change",{oldValue:null!==o?o.toTimeZone(i._inputTimeZone):null,value:i.value}),i._updateTargetValue()),i._calendarInitiatedChange)return;i.opened?(null!==o&&0!==i.$.calendarDropDown.selectedDates.length&&o.year()===s.year()&&o.month()===s.month()&&o.day()===s.day()&&i.$.calendarDropDown._isDateInView(s.toDate())||(i._disregardCalendarChangeEvent=!0,i.$.calendarDropDown.selectedDates=[s.toDate()]),i._defaultFooterTemplateApplied&&(null!==o&&o.hour()===s.hour()||(i._hourElement.value=s.toString("hh"),i._ampmElement.value=s.toString("tt")),null!==o&&o.minute()===s.minute()||(i._minuteElement.value=s.toString("mm"))),i._timePickerInitialized&&!i._timePickerInitiatedChange&&(i.$.timePickerDropDown.value=s.toDate()),i._toSync=!1):i._toSync=!0}}});

/***/ }),

/***/ 9613:
/***/ (() => {

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}});

/***/ }),

/***/ 7650:
/***/ (() => {

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","listBox.scrollBottomReached":"_scrollBottomReachedHandler","listBox.scrollTopReached":"_scrollTopReachedHandler",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                    <input id="hiddenInput" type="hidden" name="[[name]]">\n                </div>'}static get styleUrls(){return["smart.dropdownlist.css","smart.dropdown.css"]}dataBind(){this.$.listBox.dataBind()}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(),n.$.hiddenInput.value=n.selectedValues.toString();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}add(e){const t=this;t.$.listBox&&e&&(e&&Array.isArray(e)&&0===e.length||(t.$.listBox.add(e),t._applySelection(),t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize()))}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="&#10006",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){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])}return e.$.actionButton.innerHTML=n.length?`<span class="smart-token">${n.join(", ").trim()}</span>`:"",void(e.$.hiddenInput.value=e.selectedValues.toString())}e.$.actionButton.innerHTML="",e.$.actionButton.appendChild(e._createToken()),e.$.hiddenInput.value=e.selectedValues.toString()}}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.dropDownAppendTo&&e.name&&(e.$.listBox.name=""),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||!o.closest)&&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&&o.closest&&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("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(),(t.dropDownAppendTo||t.enableShadowDOM)&&t.$.fireEvent("change",e.detail)}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()}_scrollBottomReachedHandler(e){const t=this,o="onScrollBottomReached";t[o]?t[o](e):t[o.toLowerCase()]?t[o.toLowerCase()](e):t.dropDownAppendTo&&t.$.fireEvent(o)}_scrollTopReachedHandler(e){const t=this,o="onScrollTopReached";t[o]?t[o](e):t[o.toLowerCase()]?t[o.toLowerCase()](e):t.dropDownAppendTo&&t.$.fireEvent(o)}_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?Math.max(e._dropDownSize.minHeight,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":n&&(e.$.dropDownContainer.style.height=parseInt(e.$.dropDownContainer.style.height)+n+5+"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()}))}});

/***/ }),

/***/ 6321:
/***/ (() => {

!function(){if(void 0===typeof window)return;const e="21.0.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={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;","`":"&#x60;","=":"&#x3D;"};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,i=n,s=r)}));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 C;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()),C||(C=Date.now()),Math.abs(Date.now()-C)>375?l=Date.now():o=!0,C=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()-C,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,r){const o=this;r||(r={bubbles:!0,cancelable:!0,composed:null!==o.element.getRootNode().host}),r.detail=t||{};const i=new CustomEvent(e,r);if(i.originalStopPropagation=i.stopPropagation,i.stopPropagation=function(){return i.isPropagationStopped=!0,i.originalStopPropagation()},o.dispatchEvent(i),window[n].isVue){const t=y.Core.toDash(e);if(t!==e){const e=new CustomEvent(t,r);e.originalStopPropagation=i.stopPropagation,e.stopPropagation=function(){return e.isPropagationStopped=!0,e.originalStopPropagation()},o.dispatchEvent(e)}}return i}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("object"===t&&e.indexOf("{")>=0){let t=(e=e.replace(/{/gi,"").replace(/}/gi,"").replace("[","").replace("]","").replace(/'/gi,"").replace(/"/gi,"").trim()).trim().split(","),n={};for(let e=0;e<t.length;e++){const r=t[e].split(":")[0].trim(),o=t[e].split(":")[1].trim();n[r]=o}return n}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 C 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},unlockKey:{value:"",type:"string",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;if("Evaluation"===window[n].License&&-1===window.location.hostname.indexOf("htmlelements")&&"8414516F-15A2-4D84-A7AF-A9A72400DB02"!==window[n].License){if("8414516F-15A2-4D84-A7AF-A9A72400DB02"===e.unlockKey)return;if(document.body.hasAttribute("smart-license")&&"8414516F-15A2-4D84-A7AF-A9A72400DB02"===document.body.getAttribute("smart-license"))return void(window[n].License="8414516F-15A2-4D84-A7AF-A9A72400DB02");e.logWatermark(),e.logLicense(),window[n].License="8414516F-15A2-4D84-A7AF-A9A72400DB02"}}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(null!=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("keys"!==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]=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;if("keys"===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,r=e.getStaticMember("properties"),o=Object.getOwnPropertyNames(t);t.extendedProperties={},t.boundProperties={},t.templateListeners={},e.defineElementModules(),e.defineElementMethods(o,t),e.defineElementProperties(r),e.defineElementHierarchicalProperties(e.extendedProperties),t._initElement=function(){const e=this,r=t.extendedProperties,o=Object.keys(r),i=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<i.length;t+=1){let n=new(0,i[t]);n._initModule(e),e.modulesList.push(n)}const s=[];for(let t=0;t<o.length;t+=1){const n=o[t],i=r[n];let a=i.value;if(e._properties[n]){if(void 0!==e._properties[n].notify)continue;delete e._properties[n]}if(E&&"innerHTML"===n&&delete e[n],-1===window.navigator.userAgent.indexOf("PhantomJS")&&e.hasOwnProperty(n))if(i.isHierarchicalProperty&&e[n]){const t=e[n];s.push({name:n,value:t}),a=i.value,delete e[n]}else a=e[n],delete e[n];if("array"===i.type&&null!=a&&(a=a.slice(0)),"object"===i.type&&null!=a&&(a=Array.isArray(a)?a.slice(0):Object.assign({},a)),e._properties[n]={name:n,notify:i.notify,allowedValues:i.allowedValues,type:i.type,nullable:i.nullable,reflectToAttribute:i.reflectToAttribute,defaultReflectToAttribute:i.defaultReflectToAttribute,defaultReflectToAttributeConditions:i.defaultReflectToAttributeConditions,value:a,readOnly:i.readOnly,defaultValue:a,attributeName:i.attributeName,observer:i.observer,inherit:i.inherit,extend:i.extend,validator:i.validator},e.propertyByAttributeName[i.attributeName]=e._properties[n],!i.hasOwnProperty("type")){const t=e.localize("propertyUnknownType",{name:n});e.log(t)}if("any"===i.type||"propertyObject"===i.type)continue;const l=y.Types.getType(a);if(null!=a&&i.type!==l&&!i.validator){if("object"===i.type&&"array"===l)continue;if("number"===l&&["integer","int","float"].findIndex((e=>e===i.type))>=0)continue;const t=e.localize("propertyInvalidValueType",{name:n,actualType:l,type:i.type});e.log(t)}}if(e.defineElementHierarchicalProperties(e._properties,e),s.length&&"manual"!==window[n].RenderMode)for(let t=0;t<s.length;t++){const n=s[t];e[n.name]=n.value}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 _=[],S=[],x=[],E=!1;const A=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);A&&parseInt(A[2],10)<=50&&(E=!0);class D{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(!_[e]){if(e.startsWith(n.toLowerCase()))_[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]={}),_[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(_[e])return _[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()}}}}D.lazyRegister=!1,D.tagNames=[];class T{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"symbol"==typeof(r=n)||"object"==typeof r&&"[object Symbol]"===Object.prototype.toString.call(r)||t[n]||isNaN(parseInt(n))?t[n]:e.getItem(parseInt(n));var r},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 P={};window[n]&&(P=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 T(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)if("properties"===e){const t=n[e];for(let e in t)o[e]=t[e]}else 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(D.tagNames[e]=t,D.lazyRegister){D.toRegister||(D.toRegister=[]);const e=a.toCamelCase(r).replace(/[a-z]+/,"");return window[n][e]=t,void D.toRegister.push({tagName:r,element:t})}D.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 B=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",B)}};Object.assign(window[n],{Elements:D,Modules:[],BaseElement:class extends C{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]);_.push(n)}return _}}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]")),void 0===window[n].isVue&&(window[n].isVue=null!==document.querySelector(".vue-root")),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:T,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:P.Theme||"",EnableShadowDOM:P.ShadowDom||!1,BaseUrl:"./",StyleBaseUrl:"/styles/default/",Version:e,Templates:t,RenderMode:P.RenderMode||"auto",Render:function(){const e=()=>{window[n].RenderMode="",B()};"complete"===document.readyState?e():(window.removeEventListener("load",e),window.addEventListener("load",e))},Data:u,Mode:P.Mode||"production",License:P.License||"Evaluation"});let L=window[n].Theme;"manual"!==window[n].RenderMode&&document.addEventListener("readystatechange",B),Object.defineProperty(window[n],"Theme",{configurable:!1,enumerable:!0,get:()=>L,set(e){const t=L;L=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;if(e.stopPropagation(),e.preventDefault(),t.scrollHeight>0){t._wheelrafId=0;const n=()=>{t.scrollTop+=e.deltaY};cancelAnimationFrame(t._wheelrafId),t._wheelrafId=0,t._wheelrafId=requestAnimationFrame(n)}}}}_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(){if(""===this.hex)return"transparent";const e={"#DD5347":"#F8DCDA","#8E24AA":"#F9EEFB","#D50000":"#FFD5D5","#E67C73":"#F9DBD9","#F4511E":"#FDD6C8","#F6BF26":"#FDF2D7","#0B8043":"#DAFCEA","#33B679":"#DFF7EC","#3F51B5":"#E2E6F5","#039BE5":"#E8F8FF","#7986CB":"#DCDFF1","#8C47FF":"#EADDFF","#FF36C2":"#FFDFF5","#FFCFC9":"#C9403E","#FF9EB7":"#FF2058","#FFD66D":"#AA7B00","#FFEBB6":"#C18C00","#93DF89":"#29721F","#D1F7C4":"#619414","#9DC7FF":"#003377","#D0F0FD":"#098FCA","#7D2FFF":"#1BB4F5","#ECE1FD":"#7D30F1","#FA9DE2":"#860666","#FFDAF6":"#FF1AC6","#CBCBCB":"#6B6B6B","#EDEDED":"#909090","#CDAFFF":"#4600BB"};return e["#"+this.hex.toUpperCase()]?e["#"+this.hex.toUpperCase()]: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}}}();

/***/ }),

/***/ 6802:
/***/ (() => {

(()=>{var e="\r\n";function t(e,t,a){if(!t&&""!==t&&0!==t)return"";let o=t;return"boolean"==typeof t&&a&&(o=a(t)),` ${e}="${o}"`}var a=class{static createHeader(e={}){const t=["version"];e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone");return`<?xml ${t.map((t=>`${t}="${e[t]}"`)).join(" ")} ?>`}static createXml(a,o){let r="";a.properties&&(a.properties.prefixedAttributes&&a.properties.prefixedAttributes.forEach((e=>{Object.keys(e.map).forEach((a=>{r+=t(e.prefix+a,e.map[a],o)}))})),a.properties.rawMap&&Object.keys(a.properties.rawMap).forEach((e=>{r+=t(e,a.properties.rawMap[e],o)})));let n="<"+a.name+r;return a.children||null!=a.textNode?null!=a.textNode?n+">"+a.textNode+"</"+a.name+">"+e:(n+=">\r\n",a.children&&a.children.forEach((e=>{n+=this.createXml(e,o)})),n+"</"+a.name+">"+e):n+"/>"+e}};Smart.Utilities.Assign("DataExporter",class{constructor(e,t,a,o){const r=this;e||(e={}),r.style=e.style,r.header=e.header,r.exportHeader=void 0===e.exportHeader||e.exportHeader,r.hierarchical=e.hierarchical,r.expandChar=e.expandChar||"+",r.collapseChar=e.collapseChar||"-",r.pageOrientation=e.pageOrientation,r.allowNull=e.allowNull||!1,r.spreadsheets=e.spreadsheets||null,r._media=[],!r.hierarchical&&t&&t.length>0?r.groupBy=t:r.mergedCells=e.mergedCells,!r.groupBy&&a&&Object.keys(a).length>0&&(r.filterBy=a),o&&(r.conditionalFormatting=o),r.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 r=this;if(r.actualHierarchy=r.hierarchical,t=t.toLowerCase(),r.exportHeader&&(r.header?(0===(e=e.slice(0)).length&&(r.actualHierarchy=!1),r.processComplexHeader(r.header,e,t)):1===e.length&&(r.actualHierarchy=!1)),0===e.length)return void console.warn("No data to export.");if("xlsx"===t){r.xlsxStartIndex=r.complexHeader?r.complexHeader.length:+r.exportHeader;const e=r.headerContent?r.headerContent.length:0;r.xlsxStartIndex=r.xlsxStartIndex+e}r.actualHierarchy&&(e=r.processHierarchicalData(e,t)),r.getDatafields(e),a&&a.slice(a.length-t.length-1,a.length)!=="."+t&&(a+="."+t);let n=null;switch(t){case"csv":n=r.exportToCSVAndTSV(e,{delimiter:", ",MIME:"text/csv;charset=utf-8;",toRemove:2},a);break;case"html":n=r.exportToHTML(e,a);break;case"jpeg":case"png":r.exportToImage(e,a,t,o);break;case"json":n=r.exportToJSON(e,a);break;case"pdf":n=r.exportToPDF(e,a);break;case"tsv":n=r.exportToCSVAndTSV(e,{delimiter:"\t",MIME:"text/tab-separated-values",toRemove:1},a);break;case"xlsx":n=r.exportToXLSX(e,a,o);break;case"xml":n=r.exportToXML(e,a);break;case"md":n=r.exportToMD(e,a)}return o&&n&&o(n),delete r.complexHeader,n}exportToCSVAndTSV(e,t,a){const o=this,r=o.datafields;let n="";for(let a=0;a<e.length;a++){const l=e[a];let s="";for(let e=0;e<r.length;e++)o.actualHierarchy&&0===e?s+=('""'+t.delimiter).repeat(l._level-1)+'"'+l[r[e]]+'"'+t.delimiter+('""'+t.delimiter).repeat(o.maxLevel-l._level):s+='"'+l[r[e]]+'"'+t.delimiter;s=s.slice(0,s.length-t.toRemove)+"\n",n+=s}if(!a)return n;const l="\ufeff"+n;return this.downloadFile(l,t.MIME,a)}exportToHTML(e,t){const a=this,o=a.datafields,r=a.style;let n="",l=0,s="";if(e=a.processGroupingInformation(e),a.data=e,a.exportHeader&&(n=a.getHTMLHeader(o,e),l=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()}>${n}\n        <tbody>\n`;const c={},p={},m=[];a.getMergedCellsInfo(c,p);e:for(let n=l;n<e.length;n++){const s=e[n],d=n-l;let f=a.getAlternationIndex(d," rowN"),h="",g="",u="",x=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],r=a.groups[t][o];if(u+=o,-1===m.indexOf(u)){i+=`            <tr class="row">\n                <td class="column group" style="padding-left: ${25*x}px;" colspan="${a.datafields.length}">${r}</td>\n            </tr>`,m.push(u),n--;continue e}x++}let y=`            <tr class="row row${d}${f}${h}"${g}`;t||(y+=' style="page-break-inside: avoid;"'),y+=">\n";for(let e=0;e<o.length;e++){const t=e+","+d;let n=1,l=1;if(c[t])n=c[t].colspan,l=c[t].rowspan;else if(p[t])continue;const i=o[e];let m=s[i],f="";if(a.actualHierarchy&&0===e){let e="";s._expanded?e=a.collapseChar:!1===s._expanded&&(e=a.expandChar),f=`<div class="toggle-element" style="margin-left: ${25*(s._level-1)+5}px;" expanded>${e}</div>`}m=a.getFormattedValue(m,i),"string"==typeof m&&(m.indexOf("base64")>=0||m.indexOf(".png")>=0||m.indexOf(".jpeg")>=0)&&(m=`<img height="30" src="${m}"/>`);let h="";if(r&&r.columns&&r.columns[i]&&r.columns[i][d]){const e=r.columns[i][d];h+=`border-color: ${e.border}; background-color: ${e.background}; color: ${e.color};"`}0===e&&x>1&&(h+=`padding-left: ${25*(x-1)}px;"`),h&&(h=` style="${h}"`),y+=`                <td class="column column${i}"${h} colspan="${n}" rowspan="${l}">${f+m}</td>\n`}i+=y+"            </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 r=null;const n=this.exportToHTML(e,t,!0),l=document.createElement("iframe");return l.style.position="absolute",l.style.top=0,l.style.left=0,l.style.border="none",l.style.width="100%",l.style.height="100%",l.style.opacity=0,l.style.pointerEvents="none",document.body.appendChild(l),l.contentDocument.write(n),function e(){l.contentDocument.body&&l.contentDocument.body.firstElementChild?l.contentWindow.html2canvas(l.contentDocument.body.firstElementChild).then((e=>{const n=new Smart.Utilities.Draw(document.createElement("div"));r=e.toDataURL("image/png"),o?o(r):(document.body.appendChild(e),n.exportImage(void 0,e,a,t)),l.remove(),e.remove()})):requestAnimationFrame(e)}(),r}getMergedCellsInfo(e,t,a){const o=this;if(!o.mergedCells)return;const r=a&&0!==a[o.datafields.length-1];o.mergedCellsPDF=o.mergedCells.slice(0);for(let n=0;n<o.mergedCellsPDF.length;n++){const l=o.mergedCellsPDF[n];let s=l.colspan,i=l.rowspan;if(i<2&&s<2)continue;const c=l.cell[1];let p=l.cell[0];if(r&&s>1){const e=a[p],t=a[p+s-1],r=[];if(t>e){let n=e,l=p,m=0;e:for(let o=e;o<=t;o++){let e=l,t=0;for(;a[l]===n;)if(l++,m++,t++,m===s){r.push({start:e,span:t});break e}r.push({start:e,span:t}),n=a[l]}s=r[0].span;for(let e=1;e<r.length;e++)o.mergedCellsPDF.push({cell:[r[e].start,c],colspan:r[e].span,rowspan:i,originalCell:p})}}for(let a=p;a<p+s;a++)for(let o=c;o<c+i;o++){const r=a+","+o;a!==p||o!==c?t[r]=!0:e[r]={colspan:s,rowspan:i,originalCell:l.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,r=e.length;t<r;t+=1)for(let r=0,n=a.length;r<n;r+=1){const n=e[t][a[r]];"string"==typeof n&&(o+=n)}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,r=+a.exportHeader,n=[],l={},s={},i={},c=r?a.complexHeader?a.complexHeader.length:1:0,p={pageOrientation:a.pageOrientation||"portrait"};let m,d=[],f=[];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:d,datafields:o}],r&&(d=a.getPDFHeader(o,m,i)),a.getMergedCellsInfo(l,s,i);e:for(let t=r;t<e.length;t++){const c=e[t];let p="",d=0;if(a.groupBy)for(let e=0;e<a.groupBy.length;e++){const o=a.groupBy[e],r=c[o],l=a.groups[o][r];if(p+=r,-1===n.indexOf(p)){a.createGroupHeaderRow(m,{text:l,style:["row","cell","group"],marginLeft:7.5*d}),n.push(p),t--;continue e}d++}const f=h(),g=t-r;let u=a.getAlternationIndex(g,"");for(let e=0;e<o.length;e++){const t=o[e],r={style:["row","row"+g,"cell","cell"+t]},n=i[e]||0;if(void 0!==u&&r.style.splice(1,0,"rowN"+u),a.mergedCellsPDF){const t=e+","+g,a=l[t];if(a){if(r.colSpan=a.colspan,r.rowSpan=a.rowspan,void 0!==a.originalCell){r.text="",r.style[r.style.length-1]="cell"+o[a.originalCell],f[n].push(r);continue}}else if(s[t]){f[n].push({});continue}}const p=a.getFormattedValue(c[t],t);r.text=p.toString(),a.getUniqueStylePDF(r,t,g),a.setIndentation(r,{j:e,currentRecord:c,value:p,outlineLevel:d}),f[n].push(r)}for(let e=0;e<m.length;e++)m[e].body.push(f[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(d[e][a]);f.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 f[m.length-1].pageBreak,p.styles=g.styles}else{const e=m[0].body;for(let t=c-1;t>=0;t--)e.unshift(d[0][t]);f=[{table:{headerRows:c,body:e}}],p.styles={header:{bold:!0},group:{bold:!0}}}if(p.content=f,!t){const e=pdfMake.createPdf(p);return delete a.mergedCellsPDF,delete a.styleInfo,e}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,r=t.columns,n=t.rows,l={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 r in t)if(Object.prototype.hasOwnProperty.call(t,r))if(void 0===a[r])if("height"===r&&"header"===o)for(let a=0;a<e.headerRows;a++)l.heights[a]=parseInt(t[r],10)/e.headerRows/1.4;else e.storePDFStyle({prop:r,value:t[r],toUpdate:o});else for(let a in t[r]){if(!isNaN(a)||!Object.prototype.hasOwnProperty.call(t[r],a))continue;const n=t[r][a],s=e.datafields.indexOf(r);"width"===a&&"*"===l.widths[s]?l.widths[s]=n:e.storePDFStyle({prop:a,value:n,toUpdate:o+r})}}if(e.styleInfo=l,s(o,"header"),s(r,"cell"),n){for(let t in n){if(!Object.prototype.hasOwnProperty.call(n,t)||-1!==t.indexOf("alt"))continue;const a=n[t];if(isNaN(t))"height"===t?l.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?l.heights[parseFloat(t)+e.headerRows]=parseFloat(a[o])/1.4:e.storePDFStyle({prop:o,value:a[o],toUpdate:"row"+t}))}if(n.alternationCount)for(let e=0;e<n.alternationCount;e++){const t={};n[`alternationIndex${e}Color`]&&(t.color=n[`alternationIndex${e}Color`]),n[`alternationIndex${e}BackgroundColor`]&&(t.fillColor=n[`alternationIndex${e}BackgroundColor`]),l.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,r="portrait"===e.pageOrientation?655:1155,n=[];let l=0;for(let e=0;e<o.widths.length;e++){let s,i=o.widths[e];if("*"===i?s=r/6:"string"==typeof i&&-1!==i.indexOf("%")?(s=Math.min(r,Math.floor(parseFloat(i)/100*r)),s===r&&(i="*")):(i=parseFloat(i),i>=r?(s=r,i="*"):(s=i,i/=1.4)),void 0===n[l]){const o=[];n[l]={body:o,width:s,widths:[i],datafields:[a.datafields[e]]},t[e]=l;continue}const c=n[l];c.width+s>r?(l++,e--):(t[e]=l,c.width+=s,c.widths.push(i),c.datafields.push(a.datafields[e]))}return n}getPDFHeader(e,t,a){const o=this,r=[],n=o.headerRows,l=[],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<n;e++){const t=i[e],o=c[e];for(let r=0;r<t.length;r++){let n=a[r]||0;l[n]||(l[n]=[],s[n]=[]),l[n][e]||(l[n][e]=[],s[n][e]=[]),l[n][e].push(t[r]),s[n][e].push(o[r])}}function m(e,t,a,o){for(let r=0;r<n;r++){const l=e[r],s=t[r],i=[];for(let e=0;e<l.length;e++){const a=s[e];let c=1,p=1;if(s[e-1]&&s[e-1]===a||t[r-1]&&t[r-1][e]===a){i.push({});continue}let m=e+1;for(;s[m]&&s[m]===s[m-1];)c++,m++;for(m=r+1;t[m]&&t[m][e]===a;)p++,m++;const d=r===n-1||p+r===n?o.datafields[e]:null,f={text:l[e],colSpan:c,rowSpan:p};d?f.style=["header","header"+d]:(f.alignment="center",f.style="header"),i.push(f)}a.push(i)}}for(let e=0;e<t.length;e++)p=[],m(l[e],s[e],p,t[e]),r.push(p);return r}createGroupHeaderRow(e,t){for(let a=0;a<e.length;a++){const o=Object.assign({},t),r=e[a].datafields.length,n=[o];o.colSpan=r,n.length=r,n.fill({},1,r-1),e[a].body.push(n)}}getUniqueStylePDF(e,t,a){const o=this.style;if(!o||!o.columns||!o.columns[t])return;const r=o.columns[t][a];r&&(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(),r=parseFloat(t[3]).toString(16).toUpperCase();return"#"+"0".repeat(2-a.length)+a+"0".repeat(2-o.length)+o+"0".repeat(2-r.length)+r}(r.background),e.color=r.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))}addBodyImageToMap(e,t,a,o){const{row:r,column:n}=e.position||{},l=e;o&&(null===t||null===a||r&&n||(e.position||(e.position={}),e.position=Object.assign({},e.position,{row:t,column:o.indexOf(a)+1})),l.totalWidth=l.width,l.totalHeight=l.height),this.buildImageMap({imageToAdd:l,idx:1});let s=this.worksheetImageIds.get(1);s||(s=new Map,this.worksheetImageIds.set(1,s));const i=this.worksheetImages.get(1);i?i.push(l):this.worksheetImages.set(1,[l]),s.get(e.id)||s.set(e.id,{index:s.size,type:e.imageType})}buildImageMap(e){const{imageToAdd:t,idx:a}=e,o=this.images.get(t.id);if(o){const e=o.find((e=>e.sheetId===a));e?e.image.push(t):o.push({sheetId:a,image:[t]})}else this.images.set(t.id,[{sheetId:a,image:[t]}]),this.workbookImageIds.set(t.id,{type:t.imageType,index:this.workbookImageIds.size})}createXmlPart(e,t){const o=a.createHeader({encoding:"UTF-8",standalone:"yes"}),r=a.createXml(e);return t?r:`${o}${r}`}generateWorksheetImages(e,t,a){const o=this;this.images=new Map,this.worksheetImages=new Map,this.worksheetHeaderFooterImages=new Map,this.workbookImageIds=new Map,this.worksheetImageIds=new Map;let r=0,n=0,l=0;if(o.addImageToCell){for(let e=1+(o.headerContent?o.headerContent.length:0);e<a.length;e++){const t=a[e];for(let a=0;a<o.datafields.length;a++){const r=o.datafields[a];let n=t[r];if(n&&Array.isArray(n)){for(let a=0;a<n.length;a++){const s=o.addImageToCell(e+l++,r,n[a],n,t,a);s&&(t[r]="",this.addBodyImageToMap(s.image,1+e,r,o.datafields))}continue}const s=o.addImageToCell(e+l++,r,n,n,t,0);s&&(t[r]="",s.value&&s.value!==n&&(t[r]=s.value),this.addBodyImageToMap(s.image,1+e,r,o.datafields))}}if(o.headerContent)for(let e=0;e<o.headerContent.length;e++){const t=a[e];for(let a=0;a<o.datafields.length;a++){const r=o.datafields[a],n=t[r],l=o.addImageToCell(e+1,r,n,n,t,0);l&&(t[r]="",this.addBodyImageToMap(l.image,1+e,r,o.datafields))}}this.images.forEach((t=>{const a=t[0].image[0],{base64:o,imageType:r}=a,l="jpg"===r?"jpeg":r,s=(e,t)=>{e||(e="");const a=atob(e),o=new Array(a.length);for(let e=0;e<a.length;e++)o[e]=a.charCodeAt(e);const r=new Uint8Array(o);return new Blob([r],{type:t})};let i;i=o&&Array.isArray(o)?s(o[0].split(",")[1],"image/"+l):s(o.split(",")[1],"image/"+l),e.file(`xl/media/image${++n}.${l}`,i,!0)}))}let s=0;var i=e=>Math.ceil(9525*e),c=(e,t,a,o)=>({name:"xdr:pic",children:[f(e,t+1),p(e,a+1),m(e,o)]}),p=(e,t)=>{let a;if(e.transparency){const t=Math.min(Math.max(e.transparency,0),100);a=[{name:"a:alphaModFix",properties:{rawMap:{amt:1e5-Math.round(1e3*t)}}}]}if(e.recolor)switch(a||(a=[]),e.recolor.toLocaleLowerCase()){case"grayscale":a.push({name:"a:grayscl"});break;case"sepia":a.push(getDuoTone({color:"black"},{color:"D9C3A5",tint:50,saturation:180}));break;case"washout":a.push({name:"a:lum",properties:{rawMap:{bright:"70000",contrast:"-70000"}}})}return{name:"xdr:blipFill",children:[{name:"a:blip",properties:{rawMap:{cstate:"print","r:embed":`rId${t}`,"xmlns:r":"http://schemas.openxmlformats.org/officeDocument/2006/relationships"}},children:a},{name:"a:stretch",children:[{name:"a:fillRect"}]}]}},m=(e,t)=>{const a={name:"a:xfrm",children:[{name:"a:off",properties:{rawMap:{x:0,y:0}}},{name:"a:ext",properties:{rawMap:{cx:t.width,cy:t.height}}}]};if(e.rotation){const t=e.rotation;a.properties={rawMap:{rot:6e4*Math.min(Math.max(t,0),360)}}}return{name:"xdr:spPr",children:[a,{name:"a:prstGeom",properties:{rawMap:{prst:"rect"}},children:[{name:"a:avLst"}]}]}},d=e=>{const t=[{name:"a:ext",properties:{rawMap:{uri:"{FF2B5EF4-FFF2-40B4-BE49-F238E27FC236}"}},children:[{name:"a16:creationId",properties:{rawMap:{id:"{822E6D20-D7BC-2841-A643-D49A6EF008A2}","xmlns:a16":"http://schemas.microsoft.com/office/drawing/2014/main"}}}]}];switch(e.recolor&&e.recolor.toLowerCase()){case"grayscale":case"sepia":case"washout":t.push({name:"a:ext",properties:{rawMap:{uri:"{C183D7F6-B498-43B3-948B-1728B52AA6E4}"}},children:[{name:"adec:decorative",properties:{rawMap:{val:"0","xmlns:adec":"http://schemas.microsoft.com/office/drawing/2017/decorative"}}}]})}return{name:"a:extLst",children:t}},f=(e,t)=>({name:"xdr:nvPicPr",children:[{name:"xdr:cNvPr",properties:{rawMap:{id:t,name:e.id,descr:null!=e.altText?e.altText:void 0}},children:[d(e)]},{name:"xdr:cNvPicPr",properties:{rawMap:{preferRelativeResize:"0"}},children:[{name:"a:picLocks"}]}]}),h=(e,t)=>({name:`xdr:${e}`,children:[{name:"xdr:col",textNode:t.col.toString()},{name:"xdr:colOff",textNode:t.offsetX.toString()},{name:"xdr:row",textNode:t.row.toString()},{name:"xdr:rowOff",textNode:t.offsetY.toString()}]}),g={getTemplate(e){const{sheetIndex:t}=e,a=o.worksheetImages.get(t),r=o.worksheetImageIds.get(t);return{name:"xdr:wsDr",properties:{rawMap:{"xmlns:xdr":"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing","xmlns:a":"http://schemas.openxmlformats.org/drawingml/2006/main"}},children:a.map(((e,t)=>{const a=(e=>{e.fitCell=!!e.fitCell||!e.width||!e.height;const{position:t={},fitCell:a,width:o=0,height:r=0,totalHeight:n,totalWidth:l}=e,{offsetX:s=0,offsetY:c=0,row:p=1,rowSpan:m=1,column:d=1,colSpan:f=1}=t;return{from:{row:p-1,col:d-1,offsetX:i(s),offsetY:i(c)},to:{row:p-1+(a?1:m-1),col:d-1+(a?1:f-1),offsetX:i(o+s),offsetY:i(r+c)},height:i(n||r),width:i(l||o)}})(e);return{name:"xdr:twoCellAnchor",properties:{rawMap:{editAs:"absolute"}},children:[h("from",a.from),h("to",a.to),c(e,t,r.get(e.id).index,a),{name:"xdr:clientData"}]}}))}}};const u=e=>this.createXmlPart(g.getTemplate({sheetIndex:e}));var x={getTemplate(e){const{Id:t,Type:a,Target:o}=e;return{name:"Relationship",properties:{rawMap:{Id:t,Type:a,Target:o}}}}},y={getTemplate:e=>({name:"Relationships",properties:{rawMap:{xmlns:"http://schemas.openxmlformats.org/package/2006/relationships"}},children:e.map((e=>x.getTemplate(e)))})},b=y;const w=e=>{const t=this.worksheetImageIds.get(e)||[],a=[];for(const[e,o]of t)a.push({Id:`rId${o.index+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",Target:`../media/image${this.workbookImageIds.get(e).index+1}.${o.type}`});return this.createXmlPart(y.getTemplate(a))};var C=(t,a)=>{const o=`xl/drawings/drawing${a+1}.xml`,r=`xl/drawings/_rels/drawing${a+1}.xml.rels`;e.file(r,w(t)),e.file(o,u(t))};for(let e=1;e<a.length;e++){this.worksheetImages.has(e)&&(C(e,s),r=s,s++)}var v=this.exportAsTable?1:0;e.file("xl/worksheets/_rels/sheet1.xml.rels",(({drawingIndex:e,tableIndex:t}={})=>{if(void 0===e&&void 0===t)return"";const a=[];null!==e&&n>0&&a.push({Id:`rId${a.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing",Target:`../drawings/drawing${e+1}.xml`}),null!==t&&a.push({Id:`rId${a.length+1}`,Type:"http://schemas.openxmlformats.org/officeDocument/2006/relationships/table",Target:"../tables/table1.xml"});const o=b.getTemplate(a);return this.createXmlPart(o)})({tableIndex:v,drawingIndex:r}))}exportToXLSX(e,t,a){try{JSZip}catch(e){throw new Error("Missing reference to 'jszip.min.js'.")}const o=this;let r=o.style;if(e=o.processGroupingInformation(e,!0),o.data=e,o.getColumnsArray(),o.complexHeaderMergedCells=[],o.complexHeaderMergeInfo)for(let e in o.complexHeaderMergeInfo)if(Object.prototype.hasOwnProperty.call(o.complexHeaderMergeInfo,e)){const t=o.complexHeaderMergeInfo[e];if(t.from[0]===t.to[0]&&t.from[1]===t.to[1])continue;o.complexHeaderMergedCells.push({from:o.columnsArray[t.from[1]]+(t.from[0]+1),to:o.columnsArray[t.to[1]]+(t.to[0]+1)})}o.getConditionalFormatting(),r||(r=o.generateDefaultStyle(e));const n=new JSZip,l=n.folder("_rels"),s=n.folder("docProps"),i=n.folder("xl");if(o.headerContent){const t=o.headerContent,a=[];for(let e=0;e<t.length;e++){const r=t[e].cells;let n={};for(let e=0;e<o.datafields.length;e++){const t=o.datafields[e];r[t]?n[t]=r[t]:n[t]=null}a.push(n)}e=[...a,...e]}if(o.footerContent){const t=o.footerContent,a=[];for(let e=0;e<t.length;e++){const r=t[e].cells;let n={};for(let e=0;e<o.datafields.length;e++){const t=o.datafields[e];r[t]?n[t]=r[t]:n[t]=null}a.push(n)}e=[...e,...a]}this.generateWorksheetImages(n,i,e);const c=o.generateSharedStrings(e),p=c.collection,m=c.xml,d=o.generateStyles(r),f=o.groupBy?o.generateSheet1WithGrouping(e,p):o.generateSheet1(e,p,o.datafields,o.columnsArray),h=o.generateAuxiliaryFiles();let g=!1;const u=this.worksheetImages.get(1);u&&u.length&&(g=!0);const x=i.folder("_rels"),y=i.folder("theme"),b=i.folder("worksheets");if(g){i.folder("media"),i.folder("drawings"),i.folder("drawings/_rels")}if(l.file(".rels",h._relsRels),s.file("app.xml",h.docPropsAppXml),s.file("core.xml",h.docPropsCoreXml),x.file("workbook.xml.rels",h.xl_relsWorkbookXmlRels),y.file("theme1.xml",h.xlThemeTheme1Xml),b.file("sheet1.xml",f),i.file("sharedStrings.xml",m),i.file("styles.xml",d),i.file("workbook.xml",h.xlWorkbookXml),n.file("[Content_Types].xml",h.Content_TypesXml),this.spreadsheets){let e=2;for(let t=0;t<this.spreadsheets.length;t++){const a=this.spreadsheets[t],r=a.dataFields;let n=[...a.dataSource],l=[];for(let e=0;e<a.columns.length;e++){const t=a.columns[e];"string"==typeof t?l[t]=t:l[t.dataField]=t.label}n.splice(0,0,l);const s=o.generateSheet1(n,p,r,o.getColumnsArrayFromDataFields(r),e);b.file("sheet"+e+++".xml",s)}}if(this.exportAsTable){const t=Object.values(o.data[0]),a=o.groupBy&&o.groupBy.length?o.groupDimensionEnd:o.columnsArray[o.columnsArray.length-1]+(e.length-1);let r=`<table xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" xmlns:xr3="http://schemas.microsoft.com/office/spreadsheetml/2016/revision3" mc:Ignorable="xr xr3" id="1" name="Table1" displayName="Table1" ref="A${this.xlsxStartIndex}:${a}" totalsRowShown="0">\n<autoFilter ref="A${this.xlsxStartIndex}:${a}">`;for(let e=0;e<t.length;e++)r+=`<filterColumn colId="${e}" hiddenButton="0"/>\n`;r+="</autoFilter>";let n=`\n<tableColumns count="${t.length}">`;for(let e=0;e<t.length;e++){n+=`<tableColumn id="${e+1}" name="${t[e]}" dataCellStyle="Normal"/>\n`}n+="\n</tableColumns>",r+=n,r+='\n    <tableStyleInfo name="TableStyleLight1" showFirstColumn="0" showLastColumn="0" showRowStripes="1" showColumnStripes="0"/>\n</table>';i.folder("tables").file("table1.xml",r)}n.generateAsync({type:"blob",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}).then((function(e){return!t&&a&&a(e),o.downloadFile(e,"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",t)})),delete o.conditionalFormattingXLSX,delete o.complexHeaderMergeInfo,delete o.defaultRowHeight,delete o.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,r){if(!e||!Array.isArray(e)||0===e.length||!a||Array.isArray(a)&&0===a.length)return;"string"==typeof a&&(a=[a]);const n=[],l=[];void 0===o&&(o=[]);for(let r=0;r<a.length;r++)void 0===o[r]||"asc"===o[r]||"ascending"===o[r]?n[r]=1:n[r]=-1,l[r]=t(e[0][a[r]]);r?r(e,a,o,l):e.sort((function(e,t){for(let o=0;o<a.length;o++){const r=l[o](e[a[o]],t[a[o]]);if(0===r){if(a[o+1])continue;return void 0!==e._index?(e._index-t._index)*n[o]:0}return r*n[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 r="";for(let n=0;n<t.length;n++){const l=t[n];r+=o+"<row>\n";for(let t=0;t<a.length;t++){const n=a[t];if("rows"!==n)r+=o+`    <${n}>${l[n]}</${n}>\n`;else{if(!l.rows)continue;r+=`${o}    <rows>\n${e(l.rows,o+"        ")}${o}    </rows>\n`}}r+=o+"</row>\n"}return r}(e,"    ")+"</table>",t?this.downloadFile(o,"application/xml",t):o}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(),t=`<?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>`;let a='<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet1.xml"/>',o=1;if(this.spreadsheets)for(let e=0;e<this.spreadsheets.length;e++){const t=2+e;o++,a+=`<Relationship Id="rId${t}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/sheet${t}.xml"/>`}const r=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">${a}<Relationship Id="rId${++o}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Target="theme/theme1.xml"/><Relationship Id="rId${++o}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/><Relationship Id="rId${++o}" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/></Relationships>`;let n='<sheet name="Sheet1" sheetId="1" r:id="rId1"/>';if(this.spreadsheets)for(let e=0;e<this.spreadsheets.length;e++){const t=2+e;n+=`<sheet name="${this.spreadsheets[e].label}" sheetId="${t}" r:id="rId${t}"/>`}const l=`<?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>${n}</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>`,s=this.worksheetImages.get(1);let i="";s&&s.length&&(i='<Override PartName="/xl/drawings/drawing1.xml" ContentType="application/vnd.openxmlformats-officedocument.drawing+xml"/>');let c="";this.exportAsTable&&(c='<Override PartName="/xl/tables/table1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml"/>');let p='<Override PartName = "/xl/worksheets/sheet1.xml" ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" />';if(this.spreadsheets)for(let e=0;e<this.spreadsheets.length;e++)p+=`<Override PartName = "/xl/worksheets/sheet${e+2}.xml" ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" />`;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:t,xl_relsWorkbookXmlRels:r,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:l,Content_TypesXml:`<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="bin" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings"/><Default Extension="jpeg" ContentType="image/jpeg"/><Default Extension="png" ContentType="image/png"/><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"/>${p}<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"/>${c}${i}<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,r=t.complexHeader?e[t.complexHeader.length]:e[+t.exportHeader];if(!r)return a;for(let e=0;e<o.length;e++){r[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 r="",n=0,l=0;function s(e){n++,-1===o.indexOf(e)&&(l++,o.push(e),e=(e=(e=(e=(e=e.replace(/&(?!amp;)/g,"&amp;")).replace(/'/g,"&apos;")).replace(/"/g,"&quot;")).replace(/>/g,"&gt;")).replace(/</g,"&lt;"),r+=`<si><t>${e}</t></si>`)}const i=(e,a)=>{for(let o=0;o<e.length;o++){const r=e[o];for(let e=0;e<a.length;e++){let o=r[a[e]];null!==o||t.allowNull||(o=""),"string"==typeof o&&s(o)}}};if(i(e,a),t.spreadsheets)for(let e=0;e<t.spreadsheets.length;e++){const a=t.spreadsheets[e],o=a.dataFields;let r=[...a.dataSource],n=[];for(let e=0;e<a.columns.length;e++){const t=a.columns[e];"string"==typeof t?n[t]=t:n[t.dataField]=t.label}r.splice(0,0,n),i(r,o)}if(t.groupLabels)for(let e=0;e<t.groupLabels.length;e++)s(t.groupLabels[e]);return r=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="${n}" uniqueCount="${l}">${r}</sst>`,{collection:o,xml:r}}generateSheet1(e,t,a,o,r){const n=this,l=o.length,s=e.length,i=o[l-1]+s,c=n.getFilters(),p=[].concat(n.complexHeaderMergedCells);let m=0;const d=n.freezeHeader?`<sheetView rightToLeft="0" workbookViewId="0">\n         <pane state="frozen" topLeftCell="A${n.xlsxStartIndex+1}" ySplit="${n.xlsxStartIndex}"/>\n        </sheetView>`:"";let f=n.getCustomColumnWidths(o);if(r>1){let e="<cols>";for(let t=0;t<o.length;t++)e+='<col min="1" max="1" width="25" hidden="0" bestFit="0" customWidth="1"/>';e+="</cols>",f=e}let h=`<?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="${""!==c}" />\n    <dimension ref="A1:${i}" />\n    <sheetViews>\n        <sheetView ${r<=1?'tabSelected="1"':""} workbookViewId="0" />\n        ${d}\n    </sheetViews>\n    <sheetFormatPr defaultRowHeight="14.5" x14ac:dyDescent="0.35" />${f}\n    <sheetData>\n`;function g(e,t){return o[e]+t}for(let o=0;o<=e.length;o++){const r=e[o],s=o+1;let i="";if(n.actualHierarchy){const t=e[o-1];t&&t._collapsed&&(!r||t._level>r._level)&&(i=' collapsed="true"')}if(o===e.length){i&&(h+=`        <row r="${s}" outlineLevel="${Math.max(e[o-1]._level-2,0)}" hidden="false" collapsed="true" />\n`);break}let c=`        <row r="${s}"${n.getOutlineLevel(r)} hidden="${r._hidden||r._collapsed||!1}"${i} spans="1:${l}"${n.getCustomRowHeight(s-1)} customHeight="1" x14ac:dyDescent="0.45">\n`;for(let e=0;e<a.length;e++){const o=n.getXLSXCellStyle(g(e,s));c+=n.getActualCellData(r[a[e]],{r:g(e,s),s:o},t,s,a[e])}c+="        </row>\n",h+=c}if(n.headerContent)for(let e=0;e<n.headerContent.length;e++){const t=n.headerContent[e];t.style&&t.style.mergeAcross&&p.push({from:"A"+(e+1),to:o[l-1]+(e+1)})}if(n.footerContent)for(let t=0;t<n.footerContent.length;t++){const a=n.footerContent[t];a.style&&a.style.mergeAcross&&p.push({from:"A"+(e.length-t),to:o[l-1]+(e.length-t)})}return h+=`    </sheetData>${n.conditionalFormattingXLSX.conditions}${c}${n.getMergedCells(p)}\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    ${(e=>{let t="";const a=this.worksheetImages.get(e);return a&&a.length&&(t+=`<drawing r:id="rId${++m}"/>`),t})(1)}\n    ${(()=>{if(!n.exportAsTable)return"";return`<tableParts count="1">\n                <tablePart r:id="rId${++m}"/>\n            </tableParts>`})()}\n</worksheet>`,h}generateSheet1WithGrouping(e,t){const a=this,o=a.columnsArray.length,r=e.length,n=a.columnsArray[o-1]+r,l=a.datafields,s=[].concat(a.complexHeaderMergedCells);let i=0;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    <dimension ref="A1:${n}" />\n    <sheetViews>\n        <sheetView tabSelected="1" workbookViewId="0" />\n        ${a.freezeHeader?`<sheetView rightToLeft="0" workbookViewId="0">\n         <pane state="frozen" topLeftCell="A${a.xlsxStartIndex+1}" ySplit="${a.xlsxStartIndex}"/>\n        </sheetView>`:""}\n    </sheetViews>\n    <sheetFormatPr defaultRowHeight="14.5" x14ac:dyDescent="0.35" />${a.getCustomColumnWidths()}\n    <sheetData>\n`,p=0,m=[];function d(e,t){return a.columnsArray[e]+t}e:for(let r=0;r<e.length;r++){const n=e[r],i=r+1+p;let f=0,h="";if(!a.exportHeader||!a.complexHeader&&0!==r||a.complexHeader&&r>=a.complexHeader.length){let e="";for(let l=0;l<a.groupBy.length;l++){const d=a.groupBy[l],h=n[d],g=a.groups[d][h];if(e+=h,-1===m.indexOf(e)){let n=t.indexOf(g);c+=a.generateGroupRow({rowNumber:i,outlineLevel:f,numberOfColumns:o,sharedStringIndex:n,mergedCells:s}),m.push(e),r--,p++;continue e}f++}h=` outlineLevel="${f}"`}let g=`        <row r="${i}"${h} spans="1:${o}"${a.getCustomRowHeight(i-1)} customHeight="1" x14ac:dyDescent="0.45">\n`;for(let e=0;e<l.length;e++){const o=a.getXLSXCellStyle(d(e,r+1));g+=a.getActualCellData(n[l[e]],{r:d(e,i),s:o},t,i,l[e])}g+="        </row>\n",c+=g}return c+=`    </sheetData>${a.exportAsTable?"":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    ${(e=>{let t="";const a=this.worksheetImages.get(e);return a&&a.length&&(t+=`<drawing r:id="rId${++i}"/>`),t})(1)}\n    ${(()=>{if(!a.exportAsTable)return"";return`<tableParts count="1">\n                <tablePart r:id="rId${++i}"/>\n            </tableParts>`})()}\n</worksheet>`,a.groupDimensionEnd=a.columnsArray[o-1]+(r+p),a.groupRowsCount=r+p,c}isFormula(e){return null!==e&&(this.autoConvertFormulas&&e.toString().startsWith("="))}getActualCellData(e,t,a){const o=t.r,r=t.s||' s="0"';if(null!==e||this.allowNull||(e=""),e&&this.isFormula(e))return`            <c r="${o}" t="s"${r}>\n                <f>${e.slice(1)}</f>\n            </c>\n`;if("string"==typeof e)return`            <c r="${o}" t="s"${r}>\n                <v>${a.indexOf(e)}</v>\n            </c>\n`;if("boolean"==typeof e)return`            <c r="${o}" t="b"${r}>\n                <v>${+e}</v>\n            </c>\n`;if(e instanceof Date){return`            <c r="${o}"${r}>\n                <v>${2+Math.round(this.timeBetween1900And1970/864e5)+(e.getTime()-60*e.getTimezoneOffset()*1e3)/864e5}</v>\n            </c>\n`}return`            <c r="${o}"${r}>\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}getColumnsArrayFromDataFields(e){const t=e.length,a=[];function o(e){return e<26?"":String.fromCharCode(64+Math.floor(e/26))}for(let e=0;e<t;e++)a.push(o(e)+String.fromCharCode(65+(e<26?e:e%26)));return a}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 r="";const n=t.header||{};for(let t in n){if(!Object.prototype.hasOwnProperty.call(n,t))continue;const r=n[t];if(o[t]){a["header"+t]||(a["header"+t]="");for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const o=Smart.Utilities.Core.toDash(e)+": "+r[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(n[t],10)/e.complexHeader.length+"px; ":a.header+=Smart.Utilities.Core.toDash(t)+": "+n[t]+"; "}const l=t.columns||{};for(let e in l){if(!Object.prototype.hasOwnProperty.call(l,e))continue;const t=l[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)&&(r+=`        .${e} { ${a[e]}}\n`);return t.custom&&(r+=`${t.custom}\n`),r}getCustomColumnWidths(e){const t=this;if(e!==t.columnsArray)return"";if(!t.style||!t.columnWidth||0===t.columnWidth.length)return"";let a="\n    <cols>\n";for(let e=0;e<t.columnWidth.length;e++){let o=t.columnWidth[e];void 0!==o&&(o=Math.round(parseFloat(o))/7,a+=`        <col min="${e+1}" max="${e+1}" width="${o}" customWidth="1" />\n`)}return a+="    </cols>",a}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 r=e.datafields.indexOf(o);if(-1===r)continue;const n=t[o],l=n.filters;a+=`        <filterColumn colId="${r}">\n            <customFilters and="${!n.operator}">\n`;for(let t=0;t<l.length;t++)a+=e.getCustomFilter(l[t].value,l[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={},r=[];for(let n=a;n<e.length;n++){const l=e[n];for(let n=0;n<t.groupBy.length;n++){const s=t.groupBy[n],i=l[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,r.push(c[i]))}}t.groups=o,t.groupLabels=r}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 r=e[a];o+=`                <th class="header header${r}">${t[0][r]}</th>\n`}return o+="            </tr>\n        </thead>",o}for(let t=0;t<a.complexDataFieldsHeader.length;t++){const r=a.complexDataFieldsHeader[t];o+="            <tr>\n";for(let n=0;n<r.length;n++){const l=r[n];let s=1,i=1;if(r[n-1]&&r[n-1]===l||a.complexDataFieldsHeader[t-1]&&a.complexDataFieldsHeader[t-1][n]===l)continue;let c=n+1;for(;r[c]&&r[c]===r[c-1];)s++,c++;for(c=t+1;a.complexDataFieldsHeader[c]&&a.complexDataFieldsHeader[c][n]===l;)i++,c++;o+=`                <th class="header${t===a.complexHeader.length-1||i+t===a.complexHeader.length?" header"+e[n]:""}" colspan="${s}" rowspan="${i}">${a.complexHeader[t][n]}</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="",r="";for(let n=t.length-1;n>=0;n--){const l=t[n],s=e.columnsArray[e.datafields.indexOf(l.column)],i=s+(e.xlsxStartIndex+1),c=i+":"+s+e.data.length,p=l.background+l.color,m=e.getConditionalAttributes(l,i);let d=a.indexOf(p);if(-1===d){r+=`        <dxf>\n            <font>\n                <b val="0"/>\n                <i val="0"/>\n                <color rgb="${"White"===l.color?"FFFFFFFF":"FF000000"}"/>\n                <sz val="10"/>\n            </font>\n            <fill>\n                <patternFill>\n                    <bgColor rgb="${e.toARGB(l.background)}"/>\n                </patternFill>\n            </fill>\n        </dxf>\n`,d=a.length,a.push(p)}o+=`    <conditionalFormatting sqref="${c}">\n        <cfRule dxfId="${d}" text="${m.text}" rank="${m.rank}" percent="${m.percent}" bottom="${m.bottom}" equalAverage="${m.equalAverage}" aboveAverage="${m.aboveAverage}"${m.operator}${m.timePeriod} priority="${n+2}" type="${m.type}">\n${m.formula}        </cfRule>\n    </conditionalFormatting>\n`}r=`    <dxfs count="${a.length}">\n${r}    </dxfs>`,e.conditionalFormattingXLSX={conditions:o,styles:r}}getConditionalAttributes(e,t){let a=e.condition,o=e.comparator,r="",n=0,l=0,s=0,i=0,c="",p="",m="",d="";switch(a){case"equal":c="equal",m="cellIs",d=`            <formula>${o}</formula>\n`;break;case"lessThan":c="lessThan",m="cellIs",d=`            <formula>${o}</formula>\n`;break;case"greaterThan":c="greaterThan",m="cellIs",d=`            <formula>${o}</formula>\n`;break;case"notEqual":c="notEqual",m="cellIs",d=`            <formula>${o}</formula>\n`;break;case"between":c="between",m="cellIs",d=`            <formula>${e.min}</formula>\n            <formula>${e.max}</formula>\n`;break;case"duplicate":m="duplicateValues",d="            <formula>0</formula>\n";break;case"topNItems":n=o,m="top10";break;case"bottomNItems":n=o,s=1,m="top10";break;case"topNPercent":n=o,l=1,m="top10";break;case"bottomNPercent":n=o,l=1,s=1,m="top10";break;case"aboveAverage":i=1,m="aboveAverage",d="            <formula>0</formula>\n";break;case"belowAverage":m="aboveAverage",d="            <formula>0</formula>\n";break;case"contains":r=o,c="containsText",m="containsText",d=`            <formula>NOT(ISERROR(SEARCH("${o}",${t})))</formula>\n`;break;case"doesNotContain":r=o,c="notContains",m="notContainsText",d=`            <formula>ISERROR(SEARCH("${o}",${t}))</formula>\n`;break;case"dateOccur":p=` timePeriod="${o}"`,m="timePeriod"}return c&&(c=` operator="${c}" `),{text:r,rank:n,percent:l,bottom:s,equalAverage:0,aboveAverage:i,operator:c,timePeriod:p,type:m,formula:d}}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];if(o.rowspan<2&&o.colspan<2)continue;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),r=e.slice(17);a["rowN"+t]||(a["rowN"+t]=""),a["rowN"+t]+="Color"===r?"color : "+o+"; ":"BorderColor"===r?"border-color : "+o+"; ":"background-color : "+o+"; "}}let r=Object.keys(a);r.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<r.length;e++)o+=`        .${r[e]} { ${a[r[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){let t="$";if(e&&"string"==typeof e&&e.indexOf("c")>=0&&e.indexOf("x")>=0&&(t=e.substring(0,e.indexOf("x")),e=e.substring(1+e.indexOf("x"))),!/^([a-zA-Z]\d*)$/g.test(e))return e;let a=parseFloat(e.slice(1))||0,o=a>0?"."+"0".repeat(a):"";switch(e=e.slice(0,1)){case"C":case"c":return"$"!==t?"#,0"+o+" "+t:t+"#,0"+o;case"D":case"d":return a?"#,0"+o:"0";case"E":case"e":return"0"+o+e+"000";case"F":case"f":return"0"+o;case"N":case"n":return"#,0"+o;case"P":case"p":return"#,0"+o+" %";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,r=t.data[0],n=t.xlsxStartIndex;if(t.columnWidth=[],n&&a)for(let e=0;e<t.columnsArray.length;e++){const o=t.columnsArray[e],l=o+n,s=a[t.datafields[e]];for(let e in a)if(Object.prototype.hasOwnProperty.call(a,e)&&void 0===r[e])if(t.complexHeader)for(let r=0;r<t.complexHeader.length;r++)"height"!==e?t.storeCellStyle(o+(r+1),e,a[e]):t.rowHeight[r]=` ht="${parseFloat(a.height)/t.complexHeader.length/2}"`;else{if("height"===e){t.rowHeight[n-1]=` ht="${parseFloat(a.height)/2}"`;continue}t.storeCellStyle(l,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(l,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=n;e<t.data.length;e++)for(let a=0;a<t.columnsArray.length;a++){const n=t.columnsArray[a]+(e+1),l=t.datafields[a],s=o[l];for(let e in o)Object.prototype.hasOwnProperty.call(o,e)&&void 0===r[e]&&t.storeCellStyle(n,e,o[e]);if(s){for(let a in s)isNaN(a)&&Object.prototype.hasOwnProperty.call(s,a)&&t.storeCellStyle(n,a,s[a],t.data[e][l]);if(s[e]){const a=s[e];for(let o in a)isNaN(o)&&Object.prototype.hasOwnProperty.call(a,o)&&a[o]&&t.storeCellStyle(n,o,a[o],t.data[e][l])}}}if(t.headerContent&&t.headerContent.length)for(let e=0;e<t.headerContent.length;e++){const a=(e,a,o)=>{for(let r=0;r<t.columnsArray.length;r++){const n=t.columnsArray[r]+e;t.storeCellStyle(n,a,o)}},o=e+1;if(t.headerContent[e].style){const r=t.headerContent[e].style,n=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"),l=e=>isNaN(e)?"00":n[(e-e%16)/16]+n[e%16],s=e=>e.startsWith("#")?e.toUpperCase():(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))?"#"+l(e[1])+l(e[2])+l(e[3]).toUpperCase():null;for(let e in r){let n=r[e];"height"!==e?("color"!==e&&"backgroundColor"!==e||(n=s(n)),a(o,e,n)):t.rowHeight[o-1]=` ht="${parseFloat(n)}"`}}}if(t.footerContent&&t.footerContent.length)for(let e=0;e<t.footerContent.length;e++){const a=(e,a,o)=>{for(let r=0;r<t.columnsArray.length;r++){const n=t.columnsArray[r]+e;t.storeCellStyle(n,a,o)}};let o=t.headerContent&&t.headerContent.length?t.headerContent.length:0;const r=1+t.data.length+e+o;if(t.footerContent[e].style){const o=t.footerContent[e].style,n=new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"),l=e=>isNaN(e)?"00":n[(e-e%16)/16]+n[e%16],s=e=>e.startsWith("#")?e.toUpperCase():(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))?"#"+l(e[1])+l(e[2])+l(e[3]).toUpperCase():null;for(let e in o){let n=o[e];"height"!==e?("color"!==e&&"backgroundColor"!==e||(n=s(n)),a(r,e,n)):t.rowHeight[r-1]=` ht="${parseFloat(n)}"`}}}}processComplexHeader(e,t,a){const o=this,r={},n=-1!==["html","jpeg","pdf","png","xlsx"].indexOf(a)&&e.columngroups,l=[],s={},i={},c=[],p=[];let m=0;function d(t){for(let a=0;a<e.columngroups.length;a++){const o=e.columngroups[a];if(o.name===t)return o}}function f(e,t){const a=[];for(;e;){if(a.unshift(e[t]),!e.parentGroup)return a;e=d(e.parentGroup)}}if(n){for(let t=0;t<e.columngroups.length;t++){const a=e.columngroups[t],o=f(a,"label");s[a.name]=o,i[a.name]=f(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(r[a.dataField]=a.label,!n)continue;if(l[t]=a.dataField,c[m-1][t]=a.label,p[m-1][t]=a.dataField,!a.columnGroup)continue;const o=s[a.columnGroup],d=i[a.columnGroup];if(o)for(let e=0;e<o.length;e++)c[e][t]=o[e],p[e][t]=d[e]}if(c.length>1){const e=Object.keys(r).length;for(let o=0;o<m-1;o++){const r={};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]}r[l[t]]=c[o][t]}"xlsx"===a&&t.splice(o,0,r)}if(o.complexHeader=c,o.complexDataFieldsHeader=p,"xlsx"!==a)t.unshift(r);else{t.splice(m-1,0,r);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 r=a[e].to;if(t-r[0]>1||o-r[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(r)}processHierarchicalData(e,t){const a=this,o="xlsx"!==t?+a.exportHeader:a.xlsxStartIndex,r={},n=[];let l=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===r[o]?r[o]=[a]:r[o].push(a)}if(o)for(let a=0;a<o;a++)n.push(Object.assign({},e[a])),-1===["json","pdf","xml"].indexOf(t)&&(n[a]._level=1);return"json"!==t&&"xml"!==t?function e(t,a,o){const i=r[t];if(l=Math.max(l,a),void 0!==i)for(let t=0;t<i.length;t++){const l=i[t],c=l._keyDataField;l._collapsed=o,l._level=a,n.push(l),r[c]&&(s=!0,l._expanded=void 0===l._expanded||l._expanded,e(c,a+1,o||!l._expanded))}}(null,1,!1):function e(a,o,n){const i=r[a];if(l=Math.max(l,o),void 0!==i)for(let a=0;a<i.length;a++){const l=i[a],c=l._keyDataField;let p;if("json"===t){p={};for(let e in l)Object.prototype.hasOwnProperty.call(l,e)&&"_"!==e.charAt(0)&&(p[e]=l[e])}else p=Object.assign({},l);n.push(p),r[c]&&(s=!0,p.rows=[],e(c,o+1,p.rows))}}(null,1,n),s||(a.actualHierarchy=!1),a.maxLevel=l,n}processNestedData(e,t,a){const o=this,r=[];let n=0,l=!1;if(a)for(let o=0;o<a;o++)r.push(Object.assign({},e[o])),-1===["json","pdf","xml"].indexOf(t)&&(r[o]._level=1);return"json"!==t&&"xml"!==t?function e(t,a,o,s){n=Math.max(n,o);for(let n=t;n<a.length;n++){const t=Object.assign({},a[n]);t._collapsed=s,t._level=o,r.push(t),t.children&&t.children.length>0&&(l=!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){n=Math.max(n,s);for(let n=t;n<a.length;n++){const t=Object.assign({},a[n]);1===s?r[n]=t:o[n]=t,t.children&&t.children.length>0&&(l=!0,t.rows=[],e(0,t.children,t.rows,s+1)),delete t.children}}(a,e,void 0,1),l||(o.actualHierarchy=!1),o.maxLevel=n,r}processRowStyle(e){const t=this,a=e.rows;if(t.rowHeight=[],!a)return;const o=t.xlsxStartIndex;function r(e,a,r){for(let n=0;n<t.columnsArray.length;n++){const l=t.columnsArray[n]+(e+1+o);t.storeCellStyle(l,a,r)}}a.height&&(a.height||(a.height=15),t.defaultRowHeight=` ht="${parseFloat(a.height)/2}"`);for(let e=o;e<t.data.length;e++){const l=e-o;for(let e in a)Object.prototype.hasOwnProperty.call(a,e)&&-1===e.indexOf("alt")&&isNaN(e)&&"height"!==e&&r(l,e,a[e]);if(a.alternationCount&&((void 0===a.alternationStart||l>=a.alternationStart)&&(void 0===a.alternationEnd||l<=a.alternationEnd)||a.alternationStart===a.alternationEnd)){const e=(l-(a.alternationStart||0))%a.alternationCount;a[`alternationIndex${e}Color`]&&r(l,"color",a[`alternationIndex${e}Color`]),a[`alternationIndex${e}BorderColor`]&&r(l,"borderColor",a[`alternationIndex${e}BorderColor`]),a[`alternationIndex${e}BackgroundColor`]&&r(l,"backgroundColor",a[`alternationIndex${e}BackgroundColor`])}if(t.setRowHeight){const a=t.setRowHeight(l);if(a){t.rowHeight[e]=` ht="${parseFloat(a)}"`;continue}}if(a[l])for(let s in a[l])if(Object.prototype.hasOwnProperty.call(a[l],s)){if("height"===s){t.rowHeight[e]=` ht="${parseFloat(a[l].height)/2}"`;continue}if(t.data[e]&&t.data[e][s]){function n(e,a,r,n){const l=t.datafields?t.datafields.indexOf(n):-1;if(l>=0){const n=t.columnsArray[l]+(e+1+o);t.storeCellStyle(n,a,r)}}for(let e in a[l][s])n(l,e,a[l][s][e],s);continue}r(l,s,a[l][s])}}}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=Math.round(parseFloat(a)/(96/72));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(),r=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-r.length)+r}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={};let a=t.headerContent?t.headerContent.length:0;a+=t.footerContent?t.footerContent.length:0;let o=t.data.length+a;t.groupBy&&t.groupBy.length&&(o+=50);for(let e=0;e<o;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 r=t.getXLSXFormat(e.columns[o].format,t.data[1][o]),n=t.getXLSXFormat(e.columns[o].format,t.data[t.data.length-1][o]);if(n)e.columns[o].numFmt=n;else if(r)e.columns[o].numFmt=r;else if(e.columns[o].format&&(o.toLowerCase().indexOf("date")>=0||e.columns[o].format.indexOf("d/")>=0)){let t=e.columns[o].format;switch(t){case"d":t="m/d/yyyy";break;case"D":t="nnnnmmmm dd, yyyy";break;case"t":t="h:m AM/PM";break;case"T":t="h:mm:ss AM/PM";break;case"f":t="nnnnmmmm dd, yyyy h:m AM/PM";break;case"F":t="nnnnmmmm dd, yyyy h:mm:ss AM/PM";break;case"M":t="mmmm d";break;case"Y":t="yyyy mmmm";break;case"FP":case"PP":t="yyyy-mm-dd hh:mm:ss";break;case"FT":case"PT":t="hh:mm:ss"}t=t.replace(/f|u|n|p|e|a|x|o/gi,""),t=t.replace(/tt/gi,"AM/PM"),t=t.replace(/:{2,}|:\s|:$|\.$/g,""),t=t.trim(),e.columns[o].numFmt=t}}t.processRowStyle(e),t.processColumnStyle(e);const r={};for(let e=0;e<t.complexHeaderMergedCells.length;e++){const a=t.complexHeaderMergedCells[e];parseFloat(a.to[1])!==t.complexHeader.length?(t.styleMap[a.from].alignment.horizontal="center",t.styleMap[a.from].alignment.vertical="center"):r[a.to]=a.from}const n={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"]},s={xml:"",collection:[]},i={xml:'<xf fontId="0" fillId="0" borderId="1"/>',collection:["default"]};for(let e=0;e<o;e++)for(let a=0;a<t.columnsArray.length;a++){const o=t.columnsArray[a]+(e+1),c=t.styleMap[o];let p="",m="",d="",f=[],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":f[0]=a,p+=`<color rgb="${t.toARGB(a)}" />`;break;case"name":f[1]=a,p+=`<name val="${a}" />`;break;case"sz":f[2]=a,p+=`<sz val="${a}" />`;break;case"i":f[3]=a,p+="<i />";break;case"b":f[4]=a,p+="<b />";break;case"u":f[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,d+=`horizontal="${t}" `;break;case"vertical":g[1]=t,d+=`vertical="${t}" `}}if(f=f.toString(),h=h.toString(),""!==p){let e=n.collection.indexOf(f);-1===e&&(e=n.collection.length,n.xml+="<font>"+p+"</font>",n.collection.push(f)),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]=d),void 0!==c.numFmt&&(u[3]=t.getNumFmtIndex(c.numFmt,s));const x=u.toString();if(""!==x){let e=i.collection.indexOf(x);if(-1===e){let t="<xf ";e=i.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 ${d}/></xf>`:t+=' borderId="1"/>',i.xml+=t,i.collection.push(x)}t.cellStyleMapping[r[o]||o]=e}}return s.collection.length&&(s.xml=`<numFmts count="${s.collection.length}">${s.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">${s.xml}<fonts count="${n.collection.length}" x14ac:knownFonts="1">${n.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="${i.collection.length}">${i.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>`}})})();

/***/ }),

/***/ 6170:
/***/ (() => {

Smart.Utilities.Assign("FilterGroup",class t{constructor(){const t=this;t.stringConditions=["EMPTY","NOT_EMPTY","CONTAINS","CONTAINS_CASE_SENSITIVE","DOES_NOT_CONTAIN","DOES_NOT_CONTAIN_CASE_SENSITIVE","STARTS_WITH","STARTS_WITH_CASE_SENSITIVE","ENDS_WITH","ENDS_WITH_CASE_SENSITIVE","EQUAL","NOT_EQUAL","EQUAL_CASE_SENSITIVE","NOT_EQUAL_CASE_SENSITIVE","NULL","NOT_NULL"],t.numericConditions=["EQUAL","NOT_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","GREATER_THAN","GREATER_THAN_OR_EQUAL","NULL","NOT_NULL"],t.dateConditions=["EQUAL","NOT_EQUAL","LESS_THAN","LESS_THAN_OR_EQUAL","GREATER_THAN","GREATER_THAN_OR_EQUAL","NULL","NOT_NULL","TODAY","TOMORROW","YESTERDAY","LAST_WEEK","THIS_WEEK","NEXT_WEEK","LAST_MONTH","THIS_MONTH","NEXT_MONTH"],t.booleanConditions=["EQUAL","NOT_EQUAL","NULL","NOT_NULL"],t.filters=new Array,t.logicalOperators=new Array}toString(){const t=this;let e="";for(let r=0;r<t.filters.length;r++){if(r>0){let n=t.logicalOperators[r-1];0===n||"and"===n&&"0"===n?n="AND":(1===n||"or"===n&&"1"===n)&&(n="OR"),e+=" "+n+" "}let n=t.filters[r].toString();n.indexOf("[object")>=0&&"object"==typeof t.filters[r]&&(n=t.filters[r].condition+' "'+t.filters[r].value+'"'),e+=n}return e}evaluate(t){const e=this;let r=!0;for(let n=0;n<e.filters.length;n++){if(!e.filters[n].evaluate)continue;let i=e.filters[n].evaluate(t);r=0===n?i:1===e.logicalOperators[n]||"or"===e.logicalOperators[n]||"OR"===e.logicalOperators[n]?r||i:r&&i}return r}getFiltersCount(){return this.filters.length}setConditions(t,e){const r=this;switch(t){case"numeric":r.numericConditions=e;break;case"string":r.stringConditions=e;break;case"date":case"time":r.dateConditions=e;break;case"bool":case"boolean":r.booleanConditions=e}}getConditions(t){const e=this;let r=new Array;switch(t){case"numeric":r=e.numericConditions.slice(0);break;case"string":r=e.stringConditions.slice(0);break;case"date":case"time":r=e.dateConditions.slice(0);break;case"bool":case"boolean":r=e.booleanConditions.slice(0)}return r}generateFilterKey(){const t=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return t()+"-"+t()+"-"+t()}createFilter(t,e,r,n,i,s,a){if(null==t)return null;switch(t){case"int":case"float":case"int64":case"double":case"numeric":case"number":case"numericFilter":return new Smart.Utilities.NumericFilter(e,r.toUpperCase());case"string":case"stringFilter":return new Smart.Utilities.StringFilter(e,r.toUpperCase(),s);case"date":case"time":case"dateFilter":return new Smart.Utilities.DateFilter(e,r.toUpperCase(),i,s,a);case"bool":case"boolean":case"booleanFilter":return new Smart.Utilities.BooleanFilter(e,r.toUpperCase());case"custom":return new Smart.Utilities.CustomFilter(e,r.toUpperCase(),n)}throw new Error('smartGrid: There is no such filter type. The available filter types are: "numericFilter", "stringFilter", "dateFilter" and "booleanFilter"')}getFilters(){const e=this;let r=new Array;for(let n=0;n<e.filters.length;n++){const i=e.filters[n];if(i instanceof t){let t=i.getFilters();r.push({value:t,logicalOperator:e.logicalOperators[n],type:"FilterGroup"})}else{const t={value:i.value,condition:i.condition,logicalOperator:e.logicalOperators[n],type:i.type};i.data&&(t.id=i.data),r.push(t)}}return r}addFilter(t,e){const r=this;r.filters[r.filters.length]=e,e.key=r.generateFilterKey(),r.logicalOperators[r.logicalOperators.length]=t}removeFilter(t){const e=this;for(let r=0;r<e.filters.length;r++)if(e.filters[r].key===t.key){e.filters.splice(r,1),e.logicalOperators.splice(r,1);break}}getOperatorAt(t){return null==t||t<0||t>this.filters.length?null:this.logicalOperators[t]}setOperatorAt(t,e){return null==t||t<0||t>this.filters.length?null:void(this.logicalOperators[e]=e)}getFilterAt(t){return null==t||t<0||t>this.filters.length?null:this.filters[t]}setFilterAt(t,e){const r=this;return null==t||t<0||t>r.filters.length?null:(e.key=r.generateFilterKey(),void(r.filters[t]=e))}clear(){this.filters=new Array,this.logicalOperators=new Array}getUniqueValues(t,e){const r=t.data,n=[],i=[],s="dateFilter"===t.filterType&&"timePicker"===t.displayMode;let a,l=!1;for(let e=0;e<r.length;e++){let a,o=r[e][t.dataField];""!==o&&null!=o?(a=s?new Smart.Utilities.DateTime(o).toString(t.formatString):o.toString(),-1===n.indexOf(a)&&(n.push(a),i.push({label:a,value:o,customAttribute:"default-item"}))):l=!0}switch(t.filterType){case"numericFilter":case"booleanFilter":a=function(t,e){return t.value-e.value};break;case"stringFilter":a=function(t,e){return(new Intl.Collator).compare(t.value,e.value)};break;case"dateFilter":a=s?function(t,e){try{const r=t.value.getHours(),n=e.value.getHours();if(r!==n)return r-n;const i=t.value.getMinutes(),s=e.value.getMinutes();if(i!==s)return i-s;const a=t.value.getSeconds(),l=e.value.getSeconds();return a!==l?a-l:0}catch(t){return-1}}:function(t,e){try{return t.value.getTime()-e.value.getTime()}catch(t){return-1}}}return i.sort(a),"booleanFilter"===t.filterType&&i.map((function(t){const r=e.localize(t.label);t.label=""+r})),l&&i.push({label:e.localize("blanks"),value:"",customAttribute:"default-item"}),i}}),Smart.Utilities.Assign("StringFilter",class{constructor(t,e,r){const n=this;n.value=t,n.condition=e,n.locale=r||"en",n.type="stringFilter"}toString(){return this.condition+' "'+this.value+'"'}evaluate(t){const e=this,r=e.value,n=e.condition;if(null==t||""===t){if("NULL"===n)return!0;if("EQUAL"===n&&t===r)return!0;if("NOT_EQUAL"===n&&t!==r)return!0;if("CONTAINS"===n&&t===r)return!0;if("EMPTY"!==n)return!1;if(""===t)return!0}let i="";try{i=t.toString()}catch(t){return!0}const s=function(t,r){const i=e.locale;switch(null==r&&(r=""),n){case"EQUAL":return 0===t.localeCompare(r,i,{sensitivity:"accent"});case"EQUAL_CASE_SENSITIVE":return 0===t.localeCompare(r,i,{sensitivity:"variant"});case"NOT_EQUAL":return 0!==t.localeCompare(r,i,{sensitivity:"accent"});case"NOT_EQUAL_CASE_SENSITIVE":return 0!==t.localeCompare(r,i,{sensitivity:"variant"});case"CONTAINS":return"number"==typeof r?t===r:-1!==t.toLowerCase().indexOf(r.toLowerCase());case"CONTAINS_CASE_SENSITIVE":return-1!==t.indexOf(r);case"DOES_NOT_CONTAIN":return-1===t.toLowerCase().indexOf(r.toLowerCase());case"DOES_NOT_CONTAIN_CASE_SENSITIVE":return-1===t.indexOf(r);case"EMPTY":return""===t;case"NOT_EMPTY":return""!==t;case"NOT_NULL":return null!==t;case"STARTS_WITH":return 0===(t=t.substring(0,r.length)).localeCompare(r,i,{sensitivity:"accent"});case"ENDS_WITH":return 0===(t=t.substring(t.length-r.length,t.length)).localeCompare(r,i,{sensitivity:"accent"});case"ENDS_WITH_CASE_SENSITIVE":return 0===(t=t.substring(t.length-r.length,t.length)).localeCompare(r,i,{sensitivity:"variant"});case"STARTS_WITH_CASE_SENSITIVE":return 0===(t=t.substring(0,r.length)).localeCompare(r,i,{sensitivity:"variant"});default:return!1}},a=new Array;if(r&&r.indexOf&&(r.indexOf("|")>=0||r.indexOf(" AND ")>=0||r.indexOf(" OR ")>=0||r.indexOf(" and ")>=0||r.indexOf(" or ")>=0)){const t=s(i,r);if(t)return t;const e=r.indexOf(" and ")>=0?r.split(" and "):new Array,n=r.indexOf(" or ")>=0?r.split(" or "):new Array,l=r.indexOf("|")>=0?r.split("|"):new Array;let o=r.indexOf(" AND ")>=0?r.split(" AND "):new Array,u=r.indexOf(" OR ")>=0?r.split(" OR "):new Array;if(l.length>0)for(let t=0;t<l.length;t++)l[t]=l[t].trim;const c=r.indexOf(" ")>=0?r.split(" "):new Array;if(c.length>0)for(let t=0;t<c.length;t++)c[t]=c[t].trim;if(o=o.concat(c),o=o.concat(e),u=u.concat(l),u=u.concat(n),o.length>0)for(let t=0;t<o.length;t++)!o[t].indexOf(" OR ")>=0&&a.push(o[t]);if(u.length>0)for(let t=0;t<u.length;t++)!u[t].indexOf(" AND ")>=0&&a.push(u[t]);let g;for(let t=0;t<a.length;t++){const e=s(i,a[t]),r=t<o.length?"and":"or";g=void 0===g?e:"or"===r?g||e:g&&e}return g}return s(i,r)}}),Smart.Utilities.Assign("BooleanFilter",class{constructor(t,e){const r=this;r.value=t,r.condition=e,r.type="booleanFilter"}toString(){return this.condition+" "+this.value}evaluate(t){const e=this.value,r=t;switch(this.condition){case"EQUAL":return r===e;case"NOT_EQUAL":return r!==e;case"NULL":return null==t||""===t;case"NOT_NULL":return!(null==t||""===t);default:return!1}}}),Smart.Utilities.Assign("NumericFilter",class{constructor(t,e){const r=this;r.value=t,r.condition=e,r.type="numericFilter"}toString(){return this.condition+" "+this.value}evaluate(t){let e=this.value,r=this.condition;if(null==t||""===t){if("NOT_NULL"===r)return!1;if("NULL"===r)return!0;switch(r){case"EQUAL":return t===e;case"NOT_EQUAL":return t!==e}return!1}if("NULL"===r)return!1;if("NOT_NULL"===r)return!0;let n=t;try{n=parseFloat(n)}catch(e){if(null!==t&&""!==t.toString())return!1}const i=function(t,e){switch("number"==typeof t&&"number"!=typeof e&&(e=parseFloat(e)),r){case"EQUAL":return t===e;case"NOT_EQUAL":return t!==e;case"GREATER_THAN":return t>e;case"GREATER_THAN_OR_EQUAL":return t>=e;case"LESS_THAN":return t<e;case"LESS_THAN_OR_EQUAL":return t<=e;case"STARTS_WITH":return e=e.toString().toLowerCase(),t.toString().toLowerCase().substring(0,e.length)===e;case"ENDS_WITH":return t=t.toString().toLowerCase(),e=e.toString().toLowerCase(),t.substring(t.length-e.length,t.length)===e;case"ENDS_WITH_CASE_SENSITIVE":return t=t.toString(),e=e.toString(),t.substring(t.length-e.length,t.length)===e;case"STARTS_WITH_CASE_SENSITIVE":return e=e.toString(),t.toString().substring(0,e.length)===e;case"CONTAINS":return-1!==t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"CONTAINS_CASE_SENSITIVE":return-1!==t.toString().indexOf(e.toString());case"DOES_NOT_CONTAIN":return-1===t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"DOES_NOT_CONTAIN_CASE_SENSITIVE":return-1===t.toString().indexOf(e.toString());default:return!0}};let s=new Array;if(e&&e.indexOf&&(e.indexOf("|")>=0||e.indexOf(" AND ")>=0||e.indexOf(" OR ")>=0||e.indexOf(" and ")>=0||e.indexOf(" or ")>=0)){let t=i(n,e);if(t)return t;e=e.toString();const r=e.indexOf(" and ")>=0?e.split(" and "):new Array,a=e.indexOf(" or ")>=0?e.split(" or "):new Array,l=e.indexOf("|")>=0?e.split("|"):new Array;let o,u=e.indexOf(" AND ")>=0?e.split(" AND "):new Array,c=e.indexOf(" OR ")>=0?e.split(" OR "):new Array;if(u=u.concat(r),c=c.concat(a),l.length>0)for(let t=0;t<l.length;t++)l[t]=l[t].trim;if(c=c.concat(l),u.length>0)for(let t=0;t<u.length;t++)!u[t].indexOf(" OR ")>=0&&s.push(u[t]);if(c.length>0)for(let t=0;t<c.length;t++)!c[t].indexOf(" AND ")>=0&&s.push(c[t]);for(let e=0;e<s.length;e++){const r=s[e];if(r&&r.indexOf&&r.indexOf("..")>=0){const e=r.toString().split("..");2===e.length&&(t=n>=e[0]&&n<=e[1])}else t=i(n,r);const a=e<u.length?"and":"or";o=void 0===o?t:"or"===a?o||t:o&&t}return o}return e&&e.indexOf&&e.indexOf("..")>=0&&(s=e.toString().split(".."),2===s.length)?n>=s[0]&&n<=s[1]:i(n,e)}}),Smart.Utilities.Assign("DateFilter",class{constructor(t,e,r,n,i){const s=this,a=new Smart.Utilities.DateTime;if(s.value=t,s.type="dateFilter",void 0!==r){const e=a.parseDate(t,r);if(null!==e)s.filterdate=e;else{const e=a.tryparseDate(t);null!==e&&(s.filterdate=e)}}else{const e=new Date(t);"NaN"===e.toString()||"Invalid Date"===e.toString()?s.filterdate=a.tryparseDate(t):s.filterdate=e}if(!s.filterdate){const e=new Date(t);"NaN"===e.toString()||"Invalid Date"===e.toString()?s.filterdate=a.tryparseDate(t):s.filterdate=e}s.condition=e,s.formatString=r,s.timeOnly=i}toString(){return this.value&&this.value instanceof Date?this.condition+' "'+this.value.toISOString()+'"':this.condition+" "+this.value}evaluate(t){const e=this,r=e.condition,n=e.formatString;let i=e.value;if(e.timeOnly)return e.evaluateTimeOnly(t);if(null==t||""===t){if("NOT_NULL"===r)return!1;if("NULL"===r)return!0;switch(r){case"EQUAL":return t===i;case"NOT_EQUAL":return t!==i}return!1}if("NULL"===r)return!1;if("NOT_NULL"===r)return!0;let s,a=new Date;a.setFullYear(1900,0,1),a.setHours(12,0,0,0);try{const r=new Smart.Utilities.DateTime,l=new Date(t);if(a=t="NaN"===l.toString()||"Invalid Date"===l.toString()?r.tryparseDate(t):l,s=!1,void 0!==n&&(n.indexOf("t")>=0||n.indexOf("T")>=0||n.indexOf(":")>=0||n.indexOf("f")>=0)&&(s=!0,i&&-1===i.toString().indexOf(":"))){const t=r.tryparseDate(i.toString()+":00");null!==t&&(e.filterdate=t)}s||(a.setHours(0),a.setMinutes(0),a.setSeconds(0))}catch(e){if(null!==t&&""!==t.toString())return!1}if(null!==e.filterdate)i=e.filterdate;else if(i&&i.indexOf&&(-1!==i.indexOf(":")||!isNaN(parseInt(i)))){const t=new Date(a);t.setHours(12,0,0,0);const e=i.split(":");for(let r=0;r<e.length;r++)0===r&&t.setHours(e[r]),1===r&&t.setMinutes(e[r]),2===r&&t.setSeconds(e[r]);i=t}s&&i&&i.setFullYear&&a&&a.getFullYear&&-1===n.indexOf("d")&&-1===n.indexOf("M")&&-1===n.indexOf("y")&&i.setFullYear(a.getFullYear(),a.getMonth(),a.getDate());const l=function(t,e){switch(null===t&&(t=""),r){case"EQUAL":return t.toString()===e.toString();case"NOT_EQUAL":return t.toString()!==e.toString();case"GREATER_THAN":return t>e;case"GREATER_THAN_OR_EQUAL":return t>=e;case"LESS_THAN":return t<e;case"LESS_THAN_OR_EQUAL":return t<=e;case"STARTS_WITH":return e=e.toString().toLowerCase(),t.toString().toLowerCase().substring(0,e.length)===e;case"ENDS_WITH":return t=t.toString().toLowerCase(),e=e.toString().toLowerCase(),t.substring(t.length-e.length,t.length)===e;case"ENDS_WITH_CASE_SENSITIVE":return t=t.toString(),e=e.toString(),t.substring(t.length-e.length,t.length)===e;case"STARTS_WITH_CASE_SENSITIVE":return e=e.toString(),t.toString().substring(0,e.length)===e;case"CONTAINS":return-1!==t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"CONTAINS_CASE_SENSITIVE":return-1!==t.toString().indexOf(e.toString());case"DOES_NOT_CONTAIN":return-1===t.toString().toLowerCase().indexOf(e.toString().toLowerCase());case"DOES_NOT_CONTAIN_CASE_SENSITIVE":return-1===t.toString().indexOf(e.toString());case"TODAY":{const e=new Date;return e.setHours(0,0,0,0),t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}case"TOMORROW":{const e=new Date;return e.setHours(0,0,0,0),e.setDate(e.getDate()+1),t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}case"YESTERDAY":{const e=new Date;return e.setHours(0,0,0,0),e.setDate(e.getDate()-1),t.getFullYear()===e.getFullYear()&&t.getMonth()===e.getMonth()&&t.getDate()===e.getDate()}case"LAST_WEEK":{const e=(()=>{let t=new Date,e=t.getDay(),r=t.getDate(),n=new Date(t);n.setDate(r-e-7),n.setHours(0,0,0,0);let i=new Date(t);i.setDate(r+(6-e)-7),i.setHours(0,0,0,0);let s=[];for(let t=n;t<=i;t.setDate(t.getDate()+1))s.push(new Date(t));return s})();return t>=e[0]&&t<=e[e.length-1]}case"THIS_WEEK":{const e=(()=>{let t=new Date,e=t.getDay(),r=t.getDate(),n=new Date(t);n.setDate(r-e),n.setHours(0,0,0,0);let i=new Date(t);i.setDate(r+(6-e)),i.setHours(0,0,0,0);let s=[];for(let t=n;t<=i;t.setDate(t.getDate()+1))s.push(new Date(t));return s})();return t>=e[0]&&t<=e[e.length-1]}case"NEXT_WEEK":{const e=(()=>{let t=new Date,e=t.getDay(),r=t.getDate(),n=new Date(t);n.setDate(r-e+7),n.setHours(0,0,0,0);let i=new Date(t);i.setDate(r+(6-e)+7),i.setHours(0,0,0,0);let s=[];for(let t=n;t<=i;t.setDate(t.getDate()+1))s.push(new Date(t));return s})();return t>=e[0]&&t<=e[e.length-1]}case"LAST_MONTH":return!!(t=>{const e=new Date,r=new Date(e.getFullYear(),e.getMonth()-1,1),n=new Date(e.getFullYear(),e.getMonth(),1);return t>=r&&t<n})(t);case"THIS_MONTH":return!!(t=>{const e=new Date,r=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,1);return t>=r&&t<n})(t);case"NEXT_MONTH":return!!(t=>{const e=new Date,r=new Date(e.getFullYear(),e.getMonth()+1,1),n=new Date(e.getFullYear(),e.getMonth()+2,1);return t>=r&&t<n})(t);default:return!0}};let o=new Array;if(i&&i.indexOf&&(i.indexOf("|")>=0||i.indexOf(" AND ")>=0||i.indexOf(" OR ")>=0||i.indexOf(" and ")>=0||i.indexOf(" or ")>=0)){let t=l(a,i);if(t)return t;const e=i.indexOf(" and ")>=0?i.split(" and "):new Array,r=i.indexOf(" or ")>=0?i.split(" or "):new Array,n=i.indexOf("|")>=0?i.split("|"):new Array;let s,u=i.indexOf(" AND ")>=0?i.split(" AND "):new Array,c=i.indexOf(" OR ")>=0?i.split(" OR "):new Array;if(u=u.concat(e),c=c.concat(r),n.length>0)for(let t=0;t<n.length;t++)n[t]=n[t].trim;if(c=c.concat(n),u.length>0)for(let t=0;t<u.length;t++)!u[t].indexOf(" OR ")>=0&&o.push(u[t]);if(c.length>0)for(let t=0;t<c.length;t++)!c[t].indexOf(" AND ")>=0&&o.push(c[t]);for(let e=0;e<o.length;e++){const r=o[e];if(r&&r.indexOf&&r.indexOf("..")>=0){const e=r.toString().split("..");2===e.length&&(t=a>=e[0]&&a<=e[1])}else t=l(a,r);const n=e<u.length?"and":"or";s=void 0===s?t:"or"===n?s||t:s&&t}return s}return i&&i.indexOf&&i.indexOf("..")>=0&&(o=i.toString().split(".."),2===o.length)?a>=o[0]&&a<=o[1]:l(a,i)}evaluateTimeOnly(t){const e=this.value;return e?!!(t&&t instanceof Date)&&(t.getHours()===e.getHours()&&(t.getMinutes()===e.getMinutes()&&t.getSeconds()===e.getSeconds())):!t}}),Smart.Utilities.Assign("CustomFilter",class{constructor(t,e,r){const n=this;n.value=t,n.condition=e,n.customfilter=r}toString(){return this.condition+" "+this.value}evaluate(t){const e=this;return e.customfilter(e.value,t,e.condition)}}),Smart.FilterGroup=Smart.Utilities.FilterGroup,Smart.StringFilter=Smart.Utilities.StringFilter,Smart.NumericFilter=Smart.Utilities.NumericFilter,Smart.DateFilter=Smart.Utilities.DateFilter,Smart.CustomFilter=Smart.Utilities.CustomFilter;

/***/ }),

/***/ 3176:
/***/ (() => {

Smart("smart-grid-panel",class extends Smart.BaseElement{static get properties(){return{closeButtonPosition:{value:"left",allowedValues:["left","right"],type:"string"},dataSource:{value:[],type:"array",reflectToAttribute:!1},messages:{value:{en:{apply:"Ok",booleanFirst:"☐",booleanLast:"☑",cancel:"Cancel",dateFirst:"1",dateLast:"9",from:"from",numberFirst:"1",numberLast:"9",stringFirst:"A",stringLast:"Z",thenBy:"then by"}},type:"object",extend:!0}}}static get listeners(){return{change:"_changeHandler",click:"_clickHandler",keydown:"_keydownHandler","sortable.dragEnd":"_sortableDragEndHandler"}}static get requires(){return{"Smart.Input":"smart.input.js","Smart.Sortable":"smart.sortable.js"}}static get styleUrls(){return["smart.grid.anel.css"]}template(){return'<div id="container" role="presentation">\n                    <smart-sortable id="sortable" disable-mode="manual" animation="[[animation]]" disabled="[[readonly]]" right-to-left="[[rightToLeft]]"\n                            drag-mode="handle" handle-position="right" handle-visibility="visible" theme="[[theme]]">\n                    </smart-sortable>\n                    <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n                        <smart-input id="inputNotSorted" right-to-left="[[rightToLeft]]" animation="[[animation]]" readonly theme="[[theme]]"></smart-input>\n                        <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n                            <span class="smart-grid-panel-cancel-button" role="button"></span>\n                            <span class="smart-grid-panel-apply-button primary" role="button"></span>\n                        </div>\n                    </div>\n                </div>'}ready(){super.ready()}render(){const e=this;e.setAttribute("role","dialog"),"right"===e.closeButtonPosition&&(e.$.sortable.handlePosition="left"),e._localize(),e._createSources(),super.render()}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const l=this;switch(e){case"animation":case"theme":Array.from(l.$.sortable.getElementsByTagName("smart-input")).forEach((t=>t[e]=a));break;case"disabled":case"unfocusable":l._setFocusable();break;case"closeButtonPosition":"right"===l.closeButtonPosition?l.$.sortable.handlePosition="left":l.$.sortable.handlePosition="right";break;case"dataSource":l.$.sortable.$.container.innerHTML="",l._createSources();break;case"locale":case"messages":{const e=l.$.sortable._items;l._localize(),e.length&&(e[0].children[1].innerHTML=l.localize("firstBy"),e.forEach((function(e,t){0!==t&&(e.children[1].innerHTML=l.localize("thenBy"));const a=l._HTMLToSourceMap.get(e),n=l._ascDescTemplates[a.dataType]||l._ascDescTemplates.string;e.children[3].innerHTML=l.localize("from"),e.children[4].firstElementChild.innerHTML=n[0],e.children[4].children[1].innerHTML=n[1]})));break}case"maxLevel":if(null!=a)for(;l.$.sortable._items.length>0&&l.$.sortable._items.length>a;)l._interactionHandler(l.$.sortable._items[l.$.sortable._items.length-1].firstElementChild);l._disableItemAddition();break;case"rightToLeft":l.$.inputNotSorted.rightToLeft=a,l.$.inputNotSorted.dropDownButtonPosition=a?"left":"right",l.$.sortable._items.forEach((e=>{const t=e.querySelector("smart-input");t.rightToLeft=a,t.dropDownButtonPosition=a?"left":"right"}))}}_changeHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target;if(t.$.inputNotSorted.contains(a)){const e=t.$.inputNotSorted.value,a=t._labelToSourceMap.get(e);return t._createSortItem(a,t.$.sortable._items.length),t.$.sortable.updateItems(),t._visibleLabels.push(e),t._updateHiddenSource(),t._disableItemAddition(),void(t.$.inputNotSorted.value="")}const l=a.closest("smart-input");if(!l)return;const n=l.parentElement.parentElement,i=n.children[4].firstElementChild,o=n.children[4].children[1],r=l.value,s=t._HTMLToSourceMap.get(n).label,d=t._labelToSourceMap.get(r),c=t._ascDescTemplates[d.dataType]||t._ascDescTemplates.string;t._HTMLToSourceMap.set(n,d),t._visibleLabels.splice(t._visibleLabels.indexOf(s),1,r),t._updateHiddenSource(),i.innerHTML=c[0],o.innerHTML=c[1],d.sortDirection&&-1===d.sortDirection.indexOf("asc")?(o.classList.add("selected"),i.classList.remove("selected")):(i.classList.add("selected"),o.classList.remove("selected"))}_updateHiddenSource(){const e=this;e._hiddenSource=e.dataSource.map((e=>({label:e.label,value:e.dataField,icon:e.icon}))).filter((t=>-1===e._visibleLabels.indexOf(t.label)));const t=e.$.inputNotSorted.context;e.$.inputNotSorted.context=e.$.inputNotSorted,e.$.inputNotSorted.dataSource=e._hiddenSource,e.$.sortable._items.forEach((t=>{const a=t.getElementsByTagName("smart-input")[0],l=a.context;a.context=a,a.dataSource=e._hiddenSource,a.context=l})),e.$.inputNotSorted.context=t,e._disableItemAddition(),e.$.fireEvent("dataSourceChange")}_clickHandler(e){const t=this;t._interactionHandler(t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target,e)}_interactionHandler(e,t){const a=this;if(a.disabled||a.readonly)return!0;const l=e.closest(".smart-grid-panel-item");if(l){if(e===l.firstElementChild){const e=a._HTMLToSourceMap.get(l).label;a.$.sortable.$.container.removeChild(l),a.$.sortable.updateItems(),a._visibleLabels.splice(a._visibleLabels.indexOf(e),1),a._updateHiddenSource(),a._disableItemAddition(),a.$.sortable._items.length&&(a.$.sortable._items[0].children[1].innerHTML=a.localize("firstBy")),a.$.fireEvent("remove")}else if(l.children[4].contains(e)){const n=l.children[4].firstElementChild,i=l.children[4].children[1];"click"===t.type?e.classList.contains("selected")||(e===n?(i.classList.remove("selected"),n.classList.add("selected"),a._HTMLToSourceMap.get(l).sortDirection="ascending"):e===i&&(n.classList.remove("selected"),i.classList.add("selected"),a._HTMLToSourceMap.get(l).sortDirection="descending")):(n.classList.toggle("selected"),i.classList.toggle("selected"),a._HTMLToSourceMap.get(l).sortDirection=n.classList.contains("selected")?"ascending":"descending")}return!0}if(e===a.$.buttonsContainer.firstElementChild)return a.$.fireEvent("cancel"),!0;if(e===a.$.buttonsContainer.children[1]){const e=[],t={dataFields:[],dataTypes:[],orderBy:[]},l={value:e};return a.$.sortable._items.forEach((l=>{const n=a._HTMLToSourceMap.get(l);e.push({dataField:n.dataField,sortDirection:n.sortDirection}),t.dataFields.push(n.dataField),t.dataTypes.push(n.dataType),t.orderBy.push(n.sortDirection)})),a instanceof Smart.SortPanel&&a.$.maintainSortContainer&&(t.maintainSort=a.$.maintainSortContainer.firstElementChild.hasAttribute("active")),(a instanceof Smart.SortPanel||a instanceof Smart.GroupPanel)&&(l.sortByInfo=t),a.$.fireEvent("apply",l),!0}}_keydownHandler(e){const t=this,a=e.key;" "!==a&&"Enter"!==a||(e.preventDefault(),t._interactionHandler((t.shadowRoot||t.getRootNode()).activeElement,e))}_sortableDragEndHandler(e){const t=this,a=e.detail.oldIndex,l=e.detail.newIndex,n=Math.max(a,l),i=t.$.sortable._items;0===(a&&l)&&(i[0].children[1].innerHTML=t.localize("firstBy"),i[1].children[1].innerHTML=t.localize("thenBy"),n>1&&(i[n].children[1].innerHTML=t.localize("thenBy")))}_localize(){const e=this;e.$.inputNotSorted.placeholder=e.localize("pickAnother"),e.$.buttonsContainer.firstElementChild.innerHTML=e.localize("cancel"),e.$.buttonsContainer.children[1].innerHTML=e.localize("apply"),e._ascDescTemplates={boolean:[e.localize("booleanFirst")+" → "+e.localize("booleanLast"),e.localize("booleanLast")+" → "+e.localize("booleanFirst")],date:[e.localize("dateFirst")+" → "+e.localize("dateLast"),e.localize("dateLast")+" → "+e.localize("dateFirst")],number:[e.localize("numberFirst")+" → "+e.localize("numberLast"),e.localize("numberLast")+" → "+e.localize("numberFirst")],string:[e.localize("stringFirst")+" → "+e.localize("stringLast"),e.localize("stringLast")+" → "+e.localize("stringFirst")]}}_createSources(){const e=this,t=(e instanceof Smart.SortPanel?"sort":"group")+"Index",a=[],l=[];if(e._HTMLToSourceMap=new Map,e._labelToSourceMap=new Map,e.dataSource.forEach((l=>{e._labelToSourceMap.set(l.label,l),-1!==l[t]&&void 0!==l[t]&&a.push(l)})),a.sort(((e,a)=>e[t]-a[t])),void 0!==e.maxLevel&&null!==e.maxLevel)for(;a.length>0&&a.length>e.maxLevel;)a.pop();e.$.inputNotSorted.dropDownButtonPosition=e.rightToLeft?"left":"right",e.$.inputNotSorted.dataSource&&e.$.inputNotSorted.dataSource.length<10&&e.$.inputNotSorted.dataSource.length>0?e.$.inputNotSorted.dropDownHeight="auto":e.$.inputNotSorted.dropDownHeight=250,a.forEach((e=>l.push(e.label))),e._visibleLabels=l,e._updateHiddenSource(),a.forEach(((t,a)=>{e._createSortItem(t,a)})),e.$.sortable.updateItems(),e._disableItemAddition(),e._setFocusable()}_createSortItem(e,t){const a=this,l=a.disabled||a.unfocusable?-1:0,n=document.createElement("div"),i=a._ascDescTemplates[e.dataType]||a._ascDescTemplates.string;n.className="smart-grid-panel-item",n.innerHTML=`<div class="smart-grid-panel-item-close-button" tabindex="${l}" role="button" aria-label="Close"></div>\n<div class="smart-grid-panel-label-by smart-unselectable" role="presentation">${a.localize(t>0?"thenBy":"firstBy")}</div>\n<div class="smart-grid-panel-field-container" role="presentation"><smart-input class="smart-grid-panel-field-selection" value="${e.label}" animation="${a.animation}" readonly theme="${a.theme}" aria-label="Field name"></smart-input></div>\n<div class="smart-grid-panel-from smart-unselectable" role="presentation">${a.localize("from")}</div >\n<div class="smart-grid-panel-direction smart-unselectable" tabindex="${l}" role="presentation">\n    <div class="smart-grid-panel-asc" role="button" aria-label="Ascending">${i[0]}</div >\n    <div class="smart-grid-panel-desc" role="button" aria-label="Descending">${i[1]}</div>\n</div>\n`;const o=n.querySelector("smart-input");o.dataSource=a._hiddenSource,o.rightToLeft=a.rightToLeft,o.dropDownButtonPosition=a.rightToLeft?"left":"right",o.dataSource&&o.dataSource.length<10?o.dropDownHeight="auto":o.dropDownHeight=250,a.$.sortable.$.container.appendChild(n),o.tabIndex=l,e.sortDirection&&-1===e.sortDirection.indexOf("asc")?n.children[4].children[1].classList.add("selected"):(e.sortDirection="ascending",n.children[4].firstElementChild.classList.add("selected")),a._HTMLToSourceMap.set(n,e)}_disableItemAddition(){const e=this,t=e.maxLevel,a=0===e._hiddenSource.length||null!=t&&Math.max(0,t)===e.$.sortable._items.length;e.$.inputNotSorted.disabled=a,a&&e.$.inputNotSorted.removeAttribute("focus")}_setFocusable(){const e=this,t=e.disabled||e.unfocusable?-1:0,a=Array.from(e.getElementsByClassName("smart-grid-panel-item-close-button")),l=Array.from(e.getElementsByClassName("smart-grid-panel-direction")),n=Array.from(e.getElementsByTagName("input")),i=a.concat(l).concat(n);e.$.buttonsContainer.firstElementChild.tabIndex=t,e.$.buttonsContainer.children[1].tabIndex=t,i.forEach((e=>e.tabIndex=t))}}),Smart("smart-sort-panel",class extends Smart.GridPanel{static get properties(){return{messages:{value:{en:{firstBy:"Sort by",noSorting:"No sorting applied",pickAnother:"Pick another field to sort by",maintainSort:"Maintain Sort",applyOnce:"Apply once"}},type:"object",extend:!0}}}template(){return'<div id="container" role="presentation">\n                    <smart-sortable disable-mode="manual" right-to-left="[[rightToLeft]]" id="sortable" animation="[[animation]]" disabled="[[readonly]]" drag-mode="handle" handle-position="right" handle-visibility="visible" theme="[[theme]]"></smart-sortable>\n                    <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n                        <div>\n                        <smart-input right-to-left="[[rightToLeft]]" id="inputNotSorted" animation="[[animation]]" readonly theme="[[theme]]"></smart-input>\n                        <div id="maintainSortContainer" class="smart-hidden smart-grid-panel-buttons-container smart-grid-panel-maintain-sort smart-unselectable" role="presentation">\n                        <span class="smart-grid-panel-maintain-sort-button" role="button"></span>\n                         </div>\n                    \n                        </div>\n                        <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n                            <span class="smart-grid-panel-cancel-button" role="button"></span>\n                            <span class="smart-grid-panel-apply-button primary" role="button"></span>\n                        </div>\n                    </div>\n                </div>'}_changeApplyButtonText(e){const t=this,a=t.$.maintainSortContainer.firstElementChild,l=t.querySelector(".smart-grid-panel-apply-button");e?a.hasAttribute("active")?(a.removeAttribute("active"),l&&(l.innerHTML=t.localize("applyOnce"))):(a.setAttribute("active",""),l&&(l.innerHTML=t.localize("apply"))):a.hasAttribute("active")?l.innerHTML=t.localize("apply"):l.innerHTML=t.localize("applyOnce")}_interactionHandler(e,t){const a=this;super._interactionHandler(e,t)||e===a.$.maintainSortContainer.firstElementChild&&a._changeApplyButtonText(!0)}static get styleUrls(){return["smarttextbox.css"]}_localize(){super._localize();const e=this;e.$.sortable.$.container.setAttribute("no-sorting",e.localize("noSorting")),e.$.maintainSortContainer.firstElementChild.innerHTML=e.localize("maintainSort"),e._changeApplyButtonText()}}),Smart("smart-group-panel",class extends Smart.GridPanel{static get properties(){return{maxLevel:{value:8,type:"number?"},messages:{value:{en:{collapseAll:"Collapse all",expandAll:"Expand all",firstBy:"Group by",noGrouping:"No grouping",pickAnother:"Pick another field to group by"}},type:"object",extend:!0}}}template(){return'<div id="container" role="presentation">\n                    <smart-sortable disable-mode="manual" right-to-left="[[rightToLeft]]" id="sortable" animation="[[animation]]" disabled="[[readonly]]" drag-mode="handle" handle-position="right" handle-visibility="visible" theme="[[theme]]"></smart-sortable>\n                    <div id="expandCollapseContainer" class="smart-grid-panel-buttons-container smart-grid-panel-expand-collapse smart-unselectable" role="presentation">\n                        <span class="smart-group-panel-collapse-button" role="button"></span>\n                        <span class="smart-group-panel-expand-button" role="button"></span>\n                    </div>\n                    <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n                        <smart-input right-to-left="[[rightToLeft]]" id="inputNotSorted" animation="[[animation]]" readonly theme="[[theme]]"></smart-input>\n                        <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n                            <span class="smart-grid-panel-cancel-button" role="button"></span>\n                            <span class="smart-grid-panel-apply-button primary" role="button"></span>\n                        </div>\n                    </div>\n                </div>'}_interactionHandler(e,t){const a=this;super._interactionHandler(e,t)||(e===a.$.expandCollapseContainer.firstElementChild?a.$.fireEvent("collapseAll"):e===a.$.expandCollapseContainer.children[1]&&a.$.fireEvent("expandAll"))}_localize(){super._localize();const e=this;e.$.expandCollapseContainer.firstElementChild.innerHTML=e.localize("collapseAll"),e.$.expandCollapseContainer.children[1].innerHTML=e.localize("expandAll"),e.$.sortable.$.container.setAttribute("no-grouping",e.localize("noGrouping"))}_setFocusable(){super._setFocusable();const e=this,t=e.disabled||e.unfocusable?-1:0;e.$.expandCollapseContainer.firstElementChild.tabIndex=t,e.$.expandCollapseContainer.children[1].tabIndex=t}}),Smart("smart-multi-column-filter-panel",class extends Smart.BaseElement{static get properties(){return{closeButtonPosition:{value:"left",allowedValues:["left","right"],type:"string"},dataSource:{value:[],type:"array",reflectToAttribute:!1},editorCallback:{value:null,type:"function?",reflectToAttribute:!1},editorPlaceholder:{value:"Value",type:"string"},messages:{value:{en:{addFilter:"+ Add filter",and:"And",apply:"Ok",cancel:"Cancel",CONTAINS:"contains",CONTAINS_CASE_SENSITIVE:"contains (case sensitive)",DOES_NOT_CONTAIN:"does not contain",DOES_NOT_CONTAIN_CASE_SENSITIVE:"does not contain (case sensitive)",EMPTY:"empty",ENDS_WITH:"ends with",ENDS_WITH_CASE_SENSITIVE:"ends with (case sensitive)",EQUAL:"equal",EQUAL_CASE_SENSITIVE:"equal (case sensitive)",GREATER_THAN:"greater than",GREATER_THAN_OR_EQUAL:"greater than or equal",LESS_THAN:"less than",LESS_THAN_OR_EQUAL:"less than or equal",noFilters:"No filters applied",NOT_EMPTY:"not empty",NOT_EQUAL:"not equal",NOT_NULL:"not null",NULL:"null",or:"Or",STARTS_WITH:"starts with",STARTS_WITH_CASE_SENSITIVE:"starts with (case sensitive)",where:"Where",TOMORROW:"Tomorrow",TODAY:"Today",YESTERDAY:"Yesterday",NEXT_WEEK:"Next week",THIS_WEEK:"This week",LAST_WEEK:"Last week",NEXT_MONTH:"Next month",THIS_MONTH:"This month",LAST_MONTH:"Last month"}},type:"object",extend:!0},operator:{value:"and",allowedValues:["and","or"],type:"string"},value:{value:[],type:"array"}}}static get listeners(){return{change:"_changeHandler",click:"_interactionHandler",keydown:"_interactionHandler"}}static get requires(){return{"Smart.Button":"smart.button.js","Smart.CheckBox":"smart.checkbox.js","Smart.DateTimePicker":"smart.datetimepicker.js","Smart.FilterGroup":"smart.filter.js","Smart.Input":"smart.input.js","Smart.NumericTextBox":"smart.numerictextbox.js"}}static get styleUrls(){return["smart.grid.anel.css"]}template(){return'<div id="container" role="presentation">\n                    <div id="itemsContainer" class="smart-filter-panel-items-container smart-unselectable"></div>\n                    <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n                        <div id="addFilterButton" class="smart-filter-panel-add-filter-button smart-unselectable" role="button"></div>\n                        <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n                            <span class="smart-grid-panel-cancel-button" role="button"></span>\n                            <span class="smart-grid-panel-apply-button primary" role="button"></span>\n                        </div>\n                    </div>\n                </div>'}ready(){super.ready()}render(){const e=this;e.setAttribute("role","dialog"),e._setFocusable(),e._localize(),e._applyValue(),super.render()}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const l=this;switch(e){case"animation":case"theme":case"rightToLeft":Array.from(l.$.itemsContainer.querySelectorAll("smart-date-time-picker, smart-numeric-text-box, smart-check-box, smart-input")).forEach((t=>{t[e]=a,"smart-input"===t.tagName.toLowerCase()&&"rightToLeft"===e&&"none"!==t.dropDownButtonPosition&&(t.dropDownButtonPosition=a?"left":"right")}));break;case"disabled":case"unfocusable":l._setFocusable(!0);break;case"dataSource":case"value":l._applyValue();break;case"editorPlaceholder":Array.from(l.$.itemsContainer.getElementsByClassName("editor")).forEach((e=>e.placeholder=a));break;case"locale":case"messages":l._localize(!0);break;case"operator":l._setOperator()}}_setOperator(){const e=this,t=e.localize(e.operator);for(let a=2;a<e._items.length;a++)e._items[a].children[1].innerHTML=t}_changeHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target;if(a instanceof Smart.Input==0)return;const l=a.parentElement,n=l.children;if(a===n[1])t.operator=a.$.input.dataValue,t._setOperator();else if(a===n[2]){let a,i,o=t.dataSource.find((t=>t.dataField===e.detail.oldValue)).dataType,r=t.dataSource.find((t=>t.dataField===e.detail.oldValue)),s=t.dataSource.find((t=>t.dataField===e.detail.value)),d=s.dataType,c=[];if(s.options&&(d="enum",c=s.options.map((e=>{const t=e.color||"var(--smart-primary)";return e.prefix='<span style="background: '+t+'; width: 14px; height: 14px; display: inline-block; border-radius: 50%; margin-left:-4px; margin-right: 8px; top: 2px; position: relative;"></span>',""===e.label&&(e.label=" "),e}))),r&&r.options&&(o="enum"),"enum"!==d&&d===o)return void(t.editorCallback&&t.editorCallback(n[4],s));let u=n[3].value;switch(d){case"date":a=t._dateConditions,i=document.createElement("smart-date-time-picker"),i.calendarButton=!0,i.dropDownAppendTo="body",i.dropDownDisplayMode="auto",i.formatString="M/d/yy H:mm",u="";break;case"number":a=t._numberAndDateConditions,i=document.createElement("smart-numeric-text-box"),u="";break;case"boolean":a=t._booleanConditions,i=document.createElement("smart-check-box"),u="";break;case"enum":a=t._enumConditions,i=document.createElement("smart-input"),i.dataSource=c.length?c:s.options,i.readonly=!0,i.dropDownButtonPosition="right",u=a[0];break;default:a=t._stringConditions,u=t._stringConditions.find((e=>"CONTAINS"===e.value)),i=document.createElement("smart-input")}a.forEach((e=>{delete e.selected})),i.rightToLeft=t.rightToLeft,i.animation=t.animation,i.theme=t.theme,i.unfocusable=t.disabled||t.unfocusable,i.classList.add("underlined"),i.dataSource&&i.dataSource.length<10?i.dropDownHeight="auto":i.dropDownHeight=250,"boolean"!==d&&(i.placeholder=t.editorPlaceholder),t.editorCallback&&t.editorCallback(i,s),n[4]&&n[4].remove(),l.appendChild(i),""===u||a.find((e=>e.label===u))||(u.value?(n[3].value=u.label,n[3].selectedValue=u.value):(n[3].value="",n[3].selectedValue="")),n[3].dataSource=a,""===u&&(n[3].value=a[0].label,n[3].selectedValue=a[0].value),a.length>=10?n[3].dropDownHeight=250:n[3].dropDownHeight="auto",l.dataType=d}else if(a===n[3]){const e=n[4],t=a.$.input.dataValue;-1!==t.indexOf("NULL")||-1!==t.indexOf("EMPTY")||-1!==t.indexOf("THIS_WEEK")||-1!==t.indexOf("LAST_WEEK")||-1!==t.indexOf("NEXT_WEEK")||-1!==t.indexOf("THIS_MONTH")||-1!==t.indexOf("LAST_MONTH")||-1!==t.indexOf("NEXT_MONTH")||-1!==t.indexOf("THIS_YEAR")||-1!==t.indexOf("LAST_YEAR")||-1!==t.indexOf("NEXT_YEAR")||-1!==t.indexOf("TODAY")||-1!==t.indexOf("TOMORROW")||-1!==t.indexOf("YESTERDAY")?(e.value="",e.checked=!1,e.classList.add("smart-visibility-hidden")):e.classList.remove("smart-visibility-hidden"),a.condition=t}}_interactionHandler(e){const t=this;if(t.disabled||t.readonly)return;if("keydown"===e.type){if("Enter"!==e.key)return;e.preventDefault()}const a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target,l=a.closest(".smart-grid-panel-item");if(l){if(a===l.firstElementChild){const e=t._items.indexOf(l);let a;t._items.splice(e,1),l.remove(),t._items.length>0&&e<2&&(0===e&&(t._items[0].children[1].remove(),a=document.createElement("div"),a.innerHTML=t.localize("where"),t._items[0].insertBefore(a,t._items[0].children[1])),t._items.length>1&&(t._items[1].children[1].remove(),a=document.createElement("smart-input"),a.className="underlined",a.dataSource=[{value:"and",label:t.localize("and")},{value:"or",label:t.localize("or")}],a.dropDownButtonPosition=t.rightToLeft?"left":"right",a.readonly=!0,a.value=t.localize(t.operator),a.animation=t.animation,a.theme=t.theme,a.rightToLeft=t.rightToLeft,a.unfocusable=t.disabled||t.unfocusable,t._items[1].insertBefore(a,t._items[1].children[1])))}}else if(a===t.$.addFilterButton&&t.dataSource.length>0)t.$.itemsContainer.appendChild(t._createItem(t.dataSource[0],"","",t._items.length));else if(a!==t.$.buttonsContainer.firstElementChild){if(a===t.$.buttonsContainer.children[1]){let e=t._stringConditions.concat(t._dateConditions),a=t.operator,l=[],n={},i=[];t._customConditions&&(e=e.concat(t._customConditions)),t._items.forEach((i=>{const o=t.dataSource.find((e=>e.label===i.children[2].value)),r=[];let s=i.children[3].value;if(""===s)return;let d=o.dataType;if(s=e.find((e=>e.label===s)).value,r.push(o.dataField,s),-1===s.indexOf("NULL")&&-1===s.indexOf("EMPTY"))if("boolean"===d)r.push(i.children[4].checked);else if("date"===d)r.push(i.children[4].value.toDate());else if("enum"===d||o.options){let e=i.children[4].$.input.dataValue;if(void 0===e){const t=o.options.find((e=>e.label===i.children[4].value));if(!t)return;e=t.value}d="string",r.push(e)}else r.push(i.children[4].value);let c=n[r[0]];void 0===c&&(c=new Smart.Utilities.FilterGroup,n[r[0]]=c);const u=c.createFilter(d,r[2],r[1]);c.addFilter(a,u),l.push(r)}));for(let e in n)i.push([e,n[e]]);t.value=l,t.$.fireEvent("apply",{filters:i,operator:a,value:l})}}else t.$.fireEvent("cancel")}_applyValue(){const e=this,t=document.createDocumentFragment();let a=0;for(e._items=[];e.$.itemsContainer.firstElementChild;)e.$.itemsContainer.firstElementChild.remove();0!==e.dataSource.length&&(e.value.forEach((l=>{if(!Array.isArray(l))return;const n=l[0],i=e.dataSource.find((e=>e.dataField===n));if(!i)return;const o=e._createItem(i,l[1],l[2],a);t.appendChild(o),a++})),e.$.itemsContainer.appendChild(t))}_createItem(e,t,a,l){const n=this,i=n.disabled||n.unfocusable?-1:0,o=document.createElement("div"),r=document.createDocumentFragment(),s=document.createElement("div"),d=document.createElement("smart-input"),c=document.createElement("smart-input");let u,p;if(s.className="smart-grid-panel-item-close-button",s.tabIndex=i,s.setAttribute("role","button"),s.setAttribute("aria-label","button"),r.appendChild(s),0===l?(u=document.createElement("div"),u.innerHTML=n.localize("where"),u.setAttribute("role","presentation")):1===l?(u=document.createElement("smart-input"),u.className="underlined",u.dataSource=[{value:"and",label:n.localize("and")},{value:"or",label:n.localize("or")}],u.dropDownButtonPosition=n.rightToLeft?"left":"right",u.readonly=!0,u.value=n.localize(n.operator),u.animation=n.animation,u.theme=n.theme,u.rightToLeft=n.rightToLeft,u.unfocusable=n.disabled||n.unfocusable,u.setAttribute("aria-label","Operator")):(u=document.createElement("div"),u.innerHTML=n.localize(n.operator),u.setAttribute("role","presentation")),r.appendChild(u),d.className="underlined",d.dataSource=n.dataSource.map((e=>({value:e.dataField,label:e.label,icon:e.icon}))),d.dropDownButtonPosition=n.rightToLeft?"left":"right",d.readonly=!0,d.value=e.label,d.animation=n.animation,d.theme=n.theme,d.rightToLeft=n.rightToLeft,d.unfocusable=n.disabled||n.unfocusable,d.setAttribute("aria-label","Field"),d.dataSource&&d.dataSource.length<10?d.dropDownHeight="auto":d.dropDownHeight=250,r.appendChild(d),"boolean"===e.dataType)c.dataSource=JSON.parse(JSON.stringify(n._booleanConditions)),p=document.createElement("smart-check-box"),p.checked="boolean"==typeof a&&a;else if("date"===e.dataType)c.dataSource=n._dateConditions,p=document.createElement("smart-date-time-picker"),p.dropDownDisplayMode="auto",p.calendarButton=!0,p.dropDownAppendTo="body",p.formatString="M/d/yy H:mm",p.value=a;else if("number"===e.dataType)c.dataSource=JSON.parse(JSON.stringify(n._numberAndDateConditions)),p=document.createElement("smart-numeric-text-box"),p.value="number"==typeof a||"string"==typeof a?a:0;else if("enum"===e.dataType||e.options){c.dataSource=JSON.parse(JSON.stringify(n._enumConditions)),p=document.createElement("smart-input");let t=[];e.options&&(t=e.options.map((e=>{const t=e.color||"var(--smart-primary)";return e.prefix='<span style="background: '+t+'; width: 14px; height: 14px; display: inline-block; border-radius: 50%; margin-left:-4px; margin-right: 8px; top: 2px; position: relative;"></span>',""===e.label&&(e.label=" "),e}))),p.dataSource=t.length?t:e.options,p.readonly=!0,p.dropDownButtonPosition="right";const l=a?e.options.find((e=>e.value===a)):null;p.value=l&&a?l.label:""}else c.dataSource=JSON.parse(JSON.stringify(n._stringConditions)),p=document.createElement("smart-input"),p.value=null!=a?a.toString():"",t||(t="CONTAINS");return c.className="underlined",c.dropDownButtonPosition=n.rightToLeft?"left":"right",c.readonly=!0,c.animation=n.animation,c.theme=n.theme,c.rightToLeft=n.rightToLeft,c.unfocusable=n.disabled||n.unfocusable,c.setAttribute("aria-label","Condition"),c.classList.add("smart-filter-panel-list"),c.dataSource.forEach((e=>{delete e.selected})),c.dataSource.find((e=>e.value===t))?(c.value=n.localize(t),c.selectedValue=t,c.condition=t):(p.value="",p.checked=!1),(void 0===t||-1===t.indexOf("NULL")&&-1===t.indexOf("EMPTY"))&&-1===t.indexOf("THIS_WEEK")&&-1===t.indexOf("LAST_WEEK")&&-1===t.indexOf("NEXT_WEEK")&&-1===t.indexOf("THIS_MONTH")&&-1===t.indexOf("LAST_MONTH")&&-1===t.indexOf("NEXT_MONTH")&&-1===t.indexOf("THIS_YEAR")&&-1===t.indexOf("LAST_YEAR")&&-1===t.indexOf("NEXT_YEAR")&&-1===t.indexOf("TODAY")&&-1===t.indexOf("TOMORROW")&&-1===t.indexOf("YESTERDAY")||(p.value="",p.checked=!1,p.classList.add("smart-visibility-hidden")),c.dataSource&&c.dataSource.length<10?c.dropDownHeight="auto":c.dropDownHeight=250,p.animation=n.animation,p.classList.add("editor"),p.rightToLeft=n.rightToLeft,p.theme=n.theme,p.unfocusable=n.disabled||n.unfocusable,p.classList.add("underlined"),"boolean"!==e.dataType&&(p.placeholder=n.editorPlaceholder),n.editorCallback&&n.editorCallback(p,e),r.appendChild(c),r.appendChild(p),o.appendChild(r),o.className="smart-grid-panel-item",n._items.push(o),o.dataType=e.dataType,o}_localize(e){const t=this;t.$.addFilterButton.innerHTML=t.localize("addFilter"),t.$.buttonsContainer.firstElementChild.innerHTML=t.localize("cancel"),t.$.buttonsContainer.children[1].innerHTML=t.localize("apply"),t.$.itemsContainer.setAttribute("no-filters",t.localize("noFilters")),t._stringConditions=[{prefix:'<span class="smart-icon smart-icon-empty"></span>',value:"EMPTY",label:t.localize("EMPTY")},{prefix:'<span class="smart-icon smart-icon-not-empty"></span>',value:"NOT_EMPTY",label:t.localize("NOT_EMPTY")},{prefix:'<span class="smart-icon smart-icon-contains"></span>',value:"CONTAINS",label:t.localize("CONTAINS")},{prefix:'<span class="smart-icon smart-icon-does-not-contain"></span>',value:"DOES_NOT_CONTAIN",label:t.localize("DOES_NOT_CONTAIN")},{prefix:'<span class="smart-icon smart-icon-starts-with"></span>',value:"STARTS_WITH",label:t.localize("STARTS_WITH")},{prefix:'<span class="smart-icon smart-icon-ends-with"></span>',value:"ENDS_WITH",label:t.localize("ENDS_WITH")},{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],t._enumConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")}],t._dateConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-less-than"></span>',value:"LESS_THAN",label:t.localize("LESS_THAN")},{prefix:'<span class="smart-icon smart-icon-less-than-equal"></span>',value:"LESS_THAN_OR_EQUAL",label:t.localize("LESS_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-greater-than"></span>',value:"GREATER_THAN",label:t.localize("GREATER_THAN")},{prefix:'<span class="smart-icon smart-icon-greater-than-equal"></span>',value:"GREATER_THAN_OR_EQUAL",label:t.localize("GREATER_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"TOMORROW",label:t.localize("TOMORROW")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"TODAY",label:t.localize("TODAY")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"YESTERDAY",label:t.localize("YESTERDAY")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"NEXT_WEEK",label:t.localize("NEXT_WEEK")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"THIS_WEEK",label:t.localize("THIS_WEEK")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"LAST_WEEK",label:t.localize("LAST_WEEK")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"NEXT_MONTH",label:t.localize("NEXT_MONTH")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"THIS_MONTH",label:t.localize("THIS_MONTH")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"LAST_MONTH",label:t.localize("LAST_MONTH")}],t._numberAndDateConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-less-than"></span>',value:"LESS_THAN",label:t.localize("LESS_THAN")},{prefix:'<span class="smart-icon smart-icon-less-than-equal"></span>',value:"LESS_THAN_OR_EQUAL",label:t.localize("LESS_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-greater-than"></span>',value:"GREATER_THAN",label:t.localize("GREATER_THAN")},{prefix:'<span class="smart-icon smart-icon-greater-than-equal"></span>',value:"GREATER_THAN_OR_EQUAL",label:t.localize("GREATER_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],t._booleanConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],e&&t._items.forEach(((e,a)=>{const l=e.children[1],n=e.children[3];0===a?l.innerHTML=t.localize("where"):1===a?(l.dataSource=[{value:"and",label:t.localize("and")},{value:"or",label:t.localize("or")}],l.value=t.localize(t.operator)):l.innerHTML=t.localize(t.operator),"string"!==e.dataType||e.options?"enum"===e.dataType||e.options?n.dataSource=t._enumConditions:"boolean"===e.dataType?n.dataSource=t._booleanConditions:"date"===e.dataType?n.dataSource=t._dateConditions:n.dataSource=t._numberAndDateConditions:n.dataSource=t._stringConditions,n.value=n.condition?t.localize(n.condition):""}))}_setFocusable(e){const t=this,a=t.disabled||t.unfocusable?-1:0;if(t.$.addFilterButton.tabIndex=a,t.$.buttonsContainer.firstElementChild.tabIndex=a,t.$.buttonsContainer.children[1].tabIndex=a,e){const e=Array.from(t.$.itemsContainer.getElementsByClassName("smart-grid-panel-item-close-button")),l=Array.from(t.$.itemsContainer.querySelectorAll("smart-date-time-picker, smart-numeric-text-box, smart-check-box, smart-input"));e.forEach((e=>e.tabIndex=a)),l.forEach((e=>e.unfocusable=t.disabled||t.unfocusable))}}}),Smart("smart-column-panel",class extends Smart.BaseElement{static get properties(){return{dataSource:{value:[],type:"array",reflectToAttribute:!1},messages:{value:{en:{apply:"Ok",cancel:"Cancel",find:"Find a field",reset:"Reset",noResults:"No results"}},type:"object",extend:!0}}}static get listeners(){return{click:"_interactionHandler",keydown:"_interactionHandler","find.keyup":"_findKeyupHandler","sortable.dragEnd":"_sortableDragEndHandler"}}static get requires(){return{"Smart.Sortable":"smart.sortable.js"}}static get styleUrls(){return["smart.grid.anel.css"]}template(){return'<div id="container" role="presentation">\n                    <div class="smart-column-panel-find-container" role="search">\n                        <input id="find" readonly="[[readonly]]" role="searchbox" aria-label="Find a field"></input>\n                        <span id="clearButton" class="clear-button smart-hidden" role="button" aria-label="Clear"></span>\n                    </div>\n                    <smart-sortable id="sortable" disable-mode="manual" right-to-left="[[rightToLeft]]" animation="[[animation]]" disabled="[[readonly]]" drag-mode="handle" handle-position="right" handle-visibility="visible" theme="[[theme]]"></smart-sortable>\n                    <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n                        <span id="reset" class="smart-grid-panel-reset-button" role="button"></span>\n                        <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n                            <span class="smart-grid-panel-cancel-button" role="button"></span>\n                            <span class="smart-grid-panel-apply-button primary" role="button"></span>\n                        </div>\n                    </div>\n                </div>'}ready(){super.ready()}render(){const e=this;e.setAttribute("role","dialog"),e._positionChanged=!1,e._localize(),e._moves=[],e._createSortItems(),super.render()}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const l=this;switch(e){case"disabled":case"unfocusable":l._setFocusable();break;case"dataSource":{const e=l.$.sortable.$.container;for(;e.firstChild;)e.removeChild(e.firstChild);l._createSortItems(),l._positionChanged=!1,l.$.find.value="",l._findKeyupHandler(),l.$.clearButton.classList.add("smart-hidden");break}case"locale":case"messages":l._localize()}}_createSortItems(){const e=this,t=document.createDocumentFragment();e._HTMLToSourceMap=new Map,e.dataSource.forEach((a=>t.appendChild(e._createSortItem(a)))),e.$.sortable.$.container.appendChild(t),e.$.sortable.updateItems(),e._setFocusable()}_createSortItem(e){const t=document.createElement("div"),a=this.id+"Label"+e.dataField;return this._HTMLToSourceMap.set(t,e),t.className="smart-grid-panel-item",t.innerHTML=`<div class="toggle-visibility${!1!==e.visible?"":" hidden"}${e.disableToggle?" disable-toggle":""}" role="button" aria-controls="${a}" aria-label="Toggle visibility"></div>\n<span id="${a}" class="smart-column-panel-label smart-unselectable${e.icon?" icon "+e.icon:""}">${e.label}</span>`,1===e.level?t.classList.add("indent"):0===e.level&&t.classList.add("group"),e.disableDrag&&t.setAttribute("disable-drag",""),e.dataField&&t.setAttribute("data-field",e.dataField),e.parentDataField&&t.setAttribute("parent-data-field",e.parentDataField),!1!==e.allowHide&&!0!==e.disableToggle||(t.style.pointerEvents="none",t.setAttribute("disabled",""),t.style.opacity=.8),t}_interactionHandler(e){const t=this;if(t.disabled||t.readonly||"keydown"===e.type&&-1===[" ","Enter"].indexOf(e.key))return;const a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target;if(a.classList.contains("toggle-visibility")){a.classList.toggle("hidden");const e=a.closest(".smart-grid-panel-item");if(e.hasAttribute("data-field")){const l=e.getAttribute("data-field");if(e.hasAttribute("parent-data-field")||e.hasAttribute("disabled")){const a=e.getAttribute("parent-data-field"),l=t.$.sortable.querySelectorAll(".smart-grid-panel-item");let n=null;if(l.forEach((e=>{e.getAttribute("data-field")===a&&(n=e)})),n){let e=0,t=0;l.forEach((l=>{l.getAttribute("parent-data-field")===a&&(e++,l.firstElementChild.classList.contains("hidden")&&t++)})),t===e?n.firstElementChild.classList.add("hidden"):t<e&&n.firstElementChild.classList.remove("hidden")}}else t.$.sortable._items.forEach((e=>{if(e.hasAttribute("parent-data-field")&&!e.hasAttribute("disabled")){const t=e.getAttribute("parent-data-field"),n=e.firstElementChild;t===l&&(a.classList.contains("hidden")?n.classList.add("hidden"):n.classList.remove("hidden"))}}))}}else if(a.parentElement===t.$.buttonsContainer){if(a===t.$.buttonsContainer.firstElementChild)return t.$.fireEvent("cancel"),void(t._moves=[]);if(a===t.$.buttonsContainer.children[1]){const e=[];Array.from(t.$.sortable.$.container.children).forEach((a=>{const l=Object.assign({},t._HTMLToSourceMap.get(a));l.visible=!a.firstElementChild.classList.contains("hidden"),e.push(l)})),t.$.fireEvent("apply",{value:e,positionChanged:t._positionChanged,moves:t._moves}),t._positionChanged=!1,t._moves=[]}}else if(a===t.$.reset){const e=[];Array.from(t.$.sortable.$.container.children).forEach((a=>{const l=Object.assign({},t._HTMLToSourceMap.get(a));l.visible=!0,e.push(l)})),t.$.fireEvent("apply",{value:e,positionChanged:t._positionChanged,moves:t._moves}),t._positionChanged=!1,t._moves=[]}else a.classList.contains("clear-button")&&(t.$.find.value="",t._findKeyupHandler())}_findKeyupHandler(){const e=this;if(e.disabled||e.readonly)return;const t=e.$.find,a=t.value,l=[...e.$.sortable.$.container.children];if(void 0===e._disabledSortable&&(e._disabledSortable=e.$.sortable.disabled),""===a)return t.parentElement.classList.remove("no-results"),e.$.clearButton.classList.add("smart-hidden"),l.forEach((e=>e.classList.remove("smart-hidden"))),e.$.sortable.disabled=e._disabledSortable||e.readonly,void delete e._disabledSortable;let n=!0;e.$.clearButton.classList.remove("smart-hidden"),l.forEach((t=>{-1===e._HTMLToSourceMap.get(t).label.toLowerCase().indexOf(a.toLowerCase())?t.classList.add("smart-hidden"):(t.classList.remove("smart-hidden"),n=!1)})),e.$.sortable.disabled=n,n?t.parentElement.classList.add("no-results"):t.parentElement.classList.remove("no-results")}_sortableDragEndHandler(e){const t=e.detail;this._positionChanged=!0,this._moves.push({oldIndex:t.oldIndex,newIndex:t.newIndex})}_localize(){const e=this;e.$.find.placeholder=e.localize("find"),e.$.reset.innerHTML=e.localize("reset"),e.$.buttonsContainer.firstElementChild.innerHTML=e.localize("cancel"),e.$.buttonsContainer.children[1].innerHTML=e.localize("apply"),e.$.container.firstElementChild.setAttribute("no-results",e.localize("noResults"))}_setFocusable(){const e=this,t=e.disabled||e.unfocusable?-1:0,a=Array.from(e.$.sortable.getElementsByClassName("toggle-visibility"));e.$.find.tabIndex=t,e.$.clearButton.tabIndex=t,e.$.buttonsContainer.firstElementChild.tabIndex=t,e.$.buttonsContainer.children[1].tabIndex=t,a.forEach((e=>e.tabIndex=e.classList.contains("disable-toggle")?-1:t))}}),Smart("smart-formatting-panel",class extends Smart.BaseElement{static get properties(){return{columns:{value:[],type:"array",reflectToAttribute:!1},dataSource:{value:[],type:"any",reflectToAttribute:!1},items:{value:null,type:"array?",reflectToAttribute:!1},dropDownAppendTo:{value:null,type:"any",reflectToAttribute:!1},messages:{value:{en:{add:"Add condition",all:"All columns",apply:"Ok",between:"Between",cancel:"Cancel",close:"Close",column:"Column:",condition:"Condition:",equal:"Equal To",fontFamily:"Font family:",fontSize:"Font size:",format:"Format:",greaterThan:"Greater Than",highlight:"Highlight",lessThan:"Less Than",notEqual:"Not Equal To",remove:"Remove condition",secondValue:"Second value:",text:"Text",value:"Value:"}},type:"object",extend:!0}}}static get listeners(){return{click:"_interactionHandler",keydown:"_interactionHandler",change:"_changeHandler","popup.change":"_changeHandler","popup.click":"_interactionHandler","popup.keydown":"_interactionHandler","document.down":"_documentDownHandler"}}template(){return'<div id="container" role="presentation">\n                    <div id="itemsContainer" class="smart-formatting-panel-items-container" role="presentation"></div>\n                    <div id="addNewButton" class="smart-add-new-button" role="button" aria-label="Add new condition"></div>\n                    <div id="popup" class="smart-formatting-panel-popup smart-hidden smart-visibility-hidden" role="dialog">\n                        <div id="popupHeader" class="header" role="presentation">\n                            <div id="text" class="selected" role="button" aria-label="Text color"></div>\n                            <div id="highlight" role="button" aria-label="Highlight color"></div>\n                        </div>\n                        <div id="colorCode" class="color-code"></div>\n                        <input id="colorInput" type="color" />\n                        <div id="colorsContainer" class="colors-container"></div>\n                        <smart-button id="apply" class="ok primary" animation="[[animation]]" right-to-left="[[rightToLeft]]" theme="[[theme]]" unfocusable="[[unfocusable]]"></smart-button>\n                        <smart-button id="cancel" class="cancel" animation="[[animation]]" right-to-left="[[rightToLeft]]" theme="[[theme]]" unfocusable="[[unfocusable]]"></smart-button>\n                    </div>\n                </div>'}render(){const e=this,t=getComputedStyle(e);e.setAttribute("role","dialog"),e.$.popup.id=e.id+"Popup",e._basicColors=[[0,0,0],[68,68,68],[102,102,102],[153,153,153],[204,204,204],[238,238,238],[243,243,243],[255,255,255],[255,0,0],[255,153,0],[255,255,0],[0,255,0],[0,255,255],[0,0,255],[153,0,255],[255,0,255],[244,204,204],[252,229,205],[255,242,204],[217,234,211],[208,224,227],[207,226,243],[217,210,233],[234,209,220],[234,153,153],[249,203,156],[255,229,153],[182,215,168],[162,196,201],[159,197,232],[180,167,214],[213,166,189],[224,102,102],[246,178,107],[255,217,102],[147,196,125],[118,165,175],[111,168,220],[142,124,195],[194,123,160],[204,0,0],[230,145,56],[241,194,50],[106,168,79],[69,129,142],[61,133,198],[103,78,167],[166,77,121],[153,0,0],[180,95,6],[191,144,0],[56,118,29],[19,79,92],[11,83,148],[53,28,117],[116,27,71],[102,0,0],[120,63,4],[127,96,0],[39,78,19],[12,52,61],[7,55,99],[32,18,77],[76,17,48]],e._defaults={fontFamily:t.fontFamily,fontSize:t.fontSize,text:e._toHex(t.color),highlight:e._toHex(t.backgroundColor)},t.fontFamily.indexOf("-apple")>=0&&(e._defaults.fontFamily="Segoe UI"),e._localize(),e._setFocusable(),e._populatePopupWithColors(),e._processColumnsAndDataSource(),e._addDefaultItems(),super.render()}attached(){const e=this;super.attached(),e.isCompleted&&e._addDefaultItemsOnAttach&&e._addDefaultItems()}add(e,t){const a=this;if(e&&e.column&&"all"!==e.column&&!a.columns.find((t=>t.dataField===e.column)))return void a.items.splice(t,1);const l=document.createElement("div"),n=a._defaults,i=` animation="${a.animation}"${a.rightToLeft?" right-to-left":""} theme="${a.theme}"${a.unfocusable?" unfocusable":""}`,o=a.disabled||a.unfocusable?"":' tabindex="0"';e=Object.assign({column:"all",condition:"lessThan",firstValue:0,secondValue:1,fontFamily:n.fontFamily,fontSize:n.fontSize,text:n.text,highlight:n.highlight},e);const r=`\n<div class="value-label">${a.localize("value")}</div>\n<smart-input class="columns-input underlined" data-source='${JSON.stringify(a._columnsInputDataSource)}' placeholder="${a.localize("column")}" readonly value="${a._columnsInputDataSource.find((t=>t.value===e.column)).label}"${i}></smart-input>\n<smart-input class="condition-input underlined" data-source='${a._conditionsDataSource}' placeholder="${a.localize("condition")}" readonly value="${a.localize(e.condition)}"${i}></smart-input>\n<smart-input class="first-value underlined" type="number" placeholder="${a.localize("value")}" value="${e.firstValue}"${i}></smart-input>\n<div class="ampersand">&</div>\n<smart-input class="second-value underlined" type="number" placeholder="${a.localize("secondValue")}" value="${e.secondValue}"${i}></smart-input>\n<div class="close-button" title="${a.localize("close")}"${o} role="button" aria-label="Close"></div>\n<div class="format-label">${a.localize("format")}</div>\n<smart-input class="font-family-input underlined" drop-down-height="auto" placeholder="${a.localize("fontFamily")}" readonly${i}></smart-input>\n<smart-input class="font-size-input underlined" data-source='["8px", "9px", "10px", "11px", "12px", "13px", "14px", "15px", "16px"]' drop-down-height="auto" placeholder="${a.localize("fontSize")}" readonly value="${e.fontSize}"${i}></smart-input>\n<div class="popup-button smart-unselectable"${o} role="button" aria-haspopup="dialog" aria-label="Toggle pop-up">A</div>\n<div class="preview smart-unselectable">2.71828</div>`;l.classList.add("smart-formatting-panel-item"),l.classList.toggle("between","between"===e.condition),l.innerHTML=r,l.columnsInput=l.querySelector(".columns-input"),l.conditionInput=l.querySelector(".condition-input"),l.firstValue=l.querySelector(".first-value"),l.secondValue=l.querySelector(".second-value"),l.closeButton=l.querySelector(".close-button"),l.fontFamilyInput=l.querySelector(".font-family-input"),l.fontFamilyInput.dataSource=[n.fontFamily,"Arial","Verdana","Courier New","Georgia","Times New Roman"],l.fontFamilyInput.value=e.fontFamily,l.fontSizeInput=l.querySelector(".font-size-input"),l.popupButton=l.querySelector(".popup-button"),l.fontFamilyInput=l.querySelector(".font-family-input"),l.preview=l.querySelector(".preview"),l.popupButton.style.color=e.text,l.popupButton.style.backgroundColor=e.highlight,l.preview.style.fontFamily=e.fontFamily,l.preview.style.fontSize=e.fontSize,l.preview.style.color=e.text,l.preview.style.backgroundColor=e.highlight,l.data=e,a.$.itemsContainer.appendChild(l),l.columnsInput.$.input.value||(l.columnsInput.$.input.dataValue="all"),l.conditionInput.$.input.dataValue=e.condition,a._checkScrollBar()}apply(){const e=this,t=new Smart.Utilities.ConditionalFormatter(e.dataSource),a=Array.from(e.$.itemsContainer.children),l=[];let n;if(0===a.length)return;if(e.ownerElement&&"smart-pivot-table"===e.ownerElement.nodeName.toLowerCase()){const t=e.ownerElement._dynamicColumns;n=function(e){return"all"===e?t.map((e=>e.id)):t.filter((t=>t.dataFields[t.dataFields.length-1].dataField===e)).map((e=>e.id))}}else n=function(t){return"all"===t?e._columns.map((e=>e.value)):[t]};for(let e=0;e<a.length;e++){const i=a[e].data,o=n(i.column),r=i.condition;t.color=i.highlight,t.comparator=i.firstValue,t.min=i.firstValue,t.max=i.secondValue;const s=t.format(r,o);for(let e in s){const t=s[e];for(let e in t){const a=t[e];a.color=i.text,a.fontFamily=i.fontFamily,a.fontSize=i.fontSize}}l.push(s)}if(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 a=t[e];i[e]||(i[e]={});for(let t in a)i[e][t]=Object.assign({},i[e][t],a[t])}}return i}getItems(){return Array.from(this.$.itemsContainer.children).map((e=>e.data))}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const l=this;switch(e){case"animation":case"theme":case"rightToLeft":if(Array.from(l.$.itemsContainer.querySelectorAll(".smart-element")).forEach((t=>t[e]=a)),null!==l.dropDownAppendTo&&(l.$.apply[e]=a,l.$.cancel[e]=a),"theme"===e){const e=getComputedStyle(l);l._defaults.text=l._toHex(e.color),l._defaults.highlight=l._toHex(e.backgroundColor)}break;case"columns":case"items":"columns"===e&&(l._processColumnsAndDataSource(),l.items=null),l.$.itemsContainer.innerHTML="",l._addDefaultItems();break;case"disabled":case"unfocusable":{const t=l.disabled||l.unfocusable,n=Array.from(l.$.itemsContainer.querySelectorAll(".close-button, .popup-button"));"disabled"===e?l._closePopup():null!==l.dropDownAppendTo&&(l.$.apply.unfocusable=a,l.$.cancel.unfocusable=a),l._setFocusable(),Array.from(l.$.itemsContainer.querySelectorAll(".smart-element")).forEach((e=>e.unfocusable=t)),t?n.forEach((e=>e.removeAttribute("tabindex"))):n.forEach((e=>e.setAttribute("tabindex",0)));break}case"dataSource":Smart.DataAdapter&&a instanceof Smart.DataAdapter&&(l.dataSource=a.toArray());break;case"locale":case"messages":l.items=l.getItems(),l.$.itemsContainer.innerHTML="",l._localize(),l._columnsInputDataSource=JSON.parse(JSON.stringify(l._columns.concat([{label:l.localize("all"),value:"all"}]))),l._addDefaultItems()}}_populatePopupWithColors(){const e=this,t=e._basicColors,a=document.createDocumentFragment();for(let l=0;l<t.length;l++){const n=document.createElement("div"),i=t[l],o=`rgb(${i[0]}, ${i[1]}, ${i[2]})`,r=e._toHex(o);n.setAttribute("role","button"),n.setAttribute("aria-label","Select color "+r),n.index=l,n.value=r,n.style.backgroundColor=o,a.appendChild(n)}e.$.colorsContainer.appendChild(a)}_processColumnsAndDataSource(){const e=this,t=e.columns,a=e.dataSource,l=[];Smart.DataAdapter&&a instanceof Smart.DataAdapter&&(e.dataSource=a.toArray());for(let e=0;e<t.length;e++){const a=t[e];"number"===a.dataType&&l.push({label:a.label,value:a.dataField})}e._columns=l,e._columnsInputDataSource=JSON.parse(JSON.stringify(l.concat([{label:e.localize("all"),value:"all"}])))}_addDefaultItems(){const e=this,t=e.items,a=e.getRootNode();a===document||document.body.contains(a)?(t&&t.length>0?t.forEach(((t,a)=>e.add(t,a))):(e.add({condition:"greaterThan",firstValue:100}),e.add({condition:"lessThan",firstValue:0})),delete e._addDefaultItemsOnAttach):e._addDefaultItemsOnAttach=!0}_changeHandler(e){const t=this,a=t.isInShadowDOM?e.composedPath()[0]:e.target,l=a.closest(".smart-formatting-panel-item");if(l)if(a!==l.columnsInput){if(a===l.conditionInput)return l.data.condition=a.$.input.dataValue,void l.classList.toggle("between","between"===a.$.input.dataValue);if(l.firstValue.contains(a))l.data.firstValue=parseFloat(a.value);else{if(!l.secondValue.contains(a))return a===l.fontFamilyInput?(l.data.fontFamily=a.value,void(l.preview.style.fontFamily=a.value)):void(a===l.fontSizeInput&&(l.data.fontSize=a.value,l.preview.style.fontSize=a.value));l.data.secondValue=parseFloat(a.value)}}else l.data.column=a.$.input.dataValue;else t.$.popup.contains(a)&&t._updateUI(a.value.toUpperCase())}_checkScrollBar(){this.classList.toggle("scroll",this.$.itemsContainer.offsetHeight<this.$.itemsContainer.scrollHeight)}_interactionHandler(e){const t=this;if(!t.dropDownAppendTo&&e.currentTarget===t.$.popup)return;if("keydown"===e.type){if(-1===[" ","Enter"].indexOf(e.key))return void(t.disabled||t.readonly||t._keydownHandler(e));e.preventDefault()}const a=t.isInShadowDOM?e.composedPath()[0]:e.target;if(a===t.$.addNewButton)return void t.add();const l=a.closest(".smart-formatting-panel-item");if(l)return void(a===l.closeButton?(l.remove(),this._checkScrollBar()):a===l.popupButton&&(t._togglePopup(l),t._activePopupButton=a));const n=t.$.popup;if(n.contains(a)){if(a.parentElement===t.$.colorsContainer)return void t._updateUI(a.value);if(a.parentElement===t.$.popupHeader)a.classList.add("selected"),a===t.$.text?(n.selection="currentText",t.$.highlight.classList.remove("selected")):(n.selection="currentHighlight",t.$.text.classList.remove("selected")),t._updateUI(n[n.selection]);else if(a.classList.contains("smart-button")){if(t.$.apply.contains(a)||a&&a.ownerElement&&a.ownerElement.classList.contains("ok")){const e=n.item;e.data.text=n.currentText,e.data.highlight=n.currentHighlight,e.popupButton.style.color=n.currentText,e.popupButton.style.backgroundColor=n.currentHighlight,e.preview.style.color=n.currentText,e.preview.style.backgroundColor=n.currentHighlight}t._closePopup()}}}_keydownHandler(e){const t=this,a=e.key;if(-1===["ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Escape","Home","PageDown","PageUp"].indexOf(a))return;if(e.preventDefault(),"Escape"===a&&!t.$.popup.classList.contains("smart-hidden"))return void t._closePopup();if(t.getRootNode().activeElement!==t.$.colorsContainer)return;const l=Array.from(this.$.colorsContainer.children),n=this.$.colorsContainer.querySelector(".selected");let i,o="ArrowRight",r="ArrowLeft";if(t.rightToLeft&&(o="ArrowLeft",r="ArrowRight"),n){let e=n.index;switch(a){case r:e=Math.max(e-1,e-e%8);break;case o:e=Math.min(e+1,e+8-e%8-1);break;case"ArrowUp":e=Math.max(e-8,e%8);break;case"ArrowDown":e=Math.min(e+8,56+e%8);break;case"Home":e-=e%8;break;case"End":e=e+8-e%8-1;break;case"PageUp":e%=8;break;case"PageDown":e=56+e%8}i=l[e]}else i=l[0];t._updateUI(i.value,i)}_togglePopup(e){const t=this,a=t.$.popup;if(e===a.item)return void t._closePopup();if(a.setAttribute("animation",t.animation),a.setAttribute("theme",t.theme),t.rightToLeft&&a.setAttribute("right-to-left",""),a.classList.contains("smart-hidden")&&a.classList.remove("smart-hidden"),t.dropDownAppendTo)if("body"===t.dropDownAppendTo)document.body.appendChild(a);else{const e=document.querySelector(t.dropDownAppendTo);e&&e.appendChild(a)}const l=e.popupButton,n=l.getBoundingClientRect(),i=l.offsetLeft,o=l.offsetTop,r=a.offsetWidth,s=a.offsetHeight,d=t.$.itemsContainer.scrollTop,c=t._toHex(e.data.text),u=t._toHex(e.data.highlight);n.top>=s+5?a.style.top=o-(s+d+5)+"px":a.style.top=o+n.height-d+5+"px",a.style.left=i+n.width/2-r/2+"px",t.dropDownAppendTo&&(a.style.top=n.bottom+5+"px",a.style.left=n.left+n.width/2-r/2+"px"),t.$.text.classList.add("selected"),t.$.highlight.classList.remove("selected"),t.$.text.focus(),a.item=e,a.selection="currentText",a.currentText=c,a.currentHighlight=u,t._updateUI(c),a.controlledBy&&(a.controlledBy.removeAttribute("aria-controls"),a.controlledBy.removeAttribute("aria-expanded")),l.setAttribute("aria-controls",a.id),l.setAttribute("aria-expanded",!0),a.controlledBy=l,a.classList.remove("smart-visibility-hidden")}_closePopup(){const e=this,t=e.$.popup;"none"!==e.animation?(t.addEventListener("transitionend",(function e(){t.classList.add("smart-hidden"),t.removeEventListener("transitionend",e)})),t.classList.add("smart-visibility-hidden")):(t.classList.add("smart-visibility-hidden"),t.classList.add("smart-hidden")),delete t.item,e._activePopupButton&&e._activePopupButton.focus(),t.controlledBy&&(t.controlledBy.removeAttribute("aria-controls"),t.controlledBy.removeAttribute("aria-expanded"))}_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"}_updateUI(e,t){const a=this;a.$.colorInput.value=e,a.$.colorCode.innerHTML=e,a._selectColor(e,t)}_selectColor(e,t){const a=this.$.popup,l=Array.from(this.$.colorsContainer.children);l.forEach((e=>e.classList.remove("selected"))),(t=t||l.find((t=>t.value===e)))&&t.classList.add("selected"),a[a.selection]=e}_localize(){const e=this;e._conditionsDataSource=JSON.stringify([{label:e.localize("lessThan"),value:"lessThan"},{label:e.localize("greaterThan"),value:"greaterThan"},{label:e.localize("equal"),value:"equal"},{label:e.localize("notEqual"),value:"notEqual"},{label:e.localize("between"),value:"between"}]),e.$.text.innerHTML=e.localize("text"),e.$.highlight.innerHTML=e.localize("highlight"),e.$.apply.innerHTML=e.localize("apply"),e.$.cancel.innerHTML=e.localize("cancel"),e.$.addNewButton.title=e.localize("add")}_setFocusable(){const e=this,t=!e.disabled&&!e.unfocusable,a=[e.$.addNewButton,e.$.text,e.$.highlight,e.$.colorsContainer];t?(a.forEach((e=>e.setAttribute("tabindex",0))),e.$.colorInput.removeAttribute("tabindex")):(a.forEach((e=>e.removeAttribute("tabindex"))),e.$.colorInput.setAttribute("tabindex",-1))}_documentDownHandler(e){const t=this,a=t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target,l=t.$.popup;l.classList.contains("smart-hidden")||l.contains(a)||a.classList.contains("popup-button")||(delete t._activePopupButton,t._closePopup())}}),Smart("smart-data-view",class extends Smart.BaseElement{static get properties(){return{addNewButton:{value:!1,type:"boolean"},allowDrag:{value:!1,type:"boolean"},collapsible:{value:!1,type:"boolean"},columns:{value:[],type:"object",reflectToAttribute:!1},dataSource:{value:null,type:"object?",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"},editable:{value:!1,type:"boolean"},headerPosition:{value:"none",allowedValues:["none","top","bottom"],type:"string"},messages:{value:{en:{addFilter:"+ Add filter",and:"And",apply:"Ok",booleanFirst:"☐",booleanLast:"☑",cancel:"Cancel",CONTAINS:"contains",CONTAINS_CASE_SENSITIVE:"contains (case sensitive)",dateFirst:"1",dateLast:"9",DOES_NOT_CONTAIN:"does not contain",DOES_NOT_CONTAIN_CASE_SENSITIVE:"does not contain (case sensitive)",EMPTY:"empty",ENDS_WITH:"ends with",ENDS_WITH_CASE_SENSITIVE:"ends with (case sensitive)",EQUAL:"equal",EQUAL_CASE_SENSITIVE:"equal (case sensitive)",filter:"Filter",customize:"Customize 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",GREATER_THAN:"greater than",GREATER_THAN_OR_EQUAL:"greater than or equal",LESS_THAN:"less than",LESS_THAN_OR_EQUAL:"less than or equal",noFilters:"No filters applied",noResults:"No results",noSorting:"No sorting applied",NOT_EMPTY:"not empty",NOT_EQUAL:"not equal",NOT_NULL:"not null",NULL:"null",numberFirst:"1",numberLast:"9",ok:"OK",or:"Or",pickAnother:"Pick another field to sort by",sort:"Sort",group:"Group",fontFamily:"Font family:",fontSize:"Font size:",format:"Format:",formatColumn:"Format Column",formating:"Conditional Formating",sortedByMultiple:"Sorted by {{n}} fields",sortedByOne:"Sorted by 1 field",STARTS_WITH:"starts with",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",firstByGroup:"Group by",pickAnotherGroupBy:"Pick another field to group by",add:"Add condition",all:"All columns",between:"Between",close:"Close",column:"Column:",condition:"Condition:",equal:"Equal To",greaterThan:"Greater Than",highlight:"Highlight",lessThan:"Less Than",notEqual:"Not Equal To",remove:"Remove condition",secondValue:"Second value:",text:"Text",value:"Value:",reset:"Reset"}}}}}static get listeners(){return{"header.apply":"_applyHandler","header.cancel":"closePanel","headerDropDown.transitionend":"_headerDropDownTransitionendHandler","searchInput.keyup":"_searchInputKeyupHandler",resize:"_resizeHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler"}}render(){const e=this;e.$.headerDropDown.id||(e.$.headerDropDown.id=e.id+"HeaderDropDown"),e.setAttribute("role","group"),e._isMobile=Smart.Utilities.Core.isMobile,super.render()}addFilter(e,t="and"){const a=this;if(!Array.isArray(e)||e.length>0&&!Array.isArray(e[0]))return;let l;a.closePanel(),arguments[2]?l={filters:arguments[2],operator:t}:(l={filters:[],operator:t},e.forEach((e=>{e[1].filters.forEach((t=>{l.filters.push([e[0],t.condition,t.value])}))}))),JSON.stringify(l)!==JSON.stringify(a._appliedFiltering)&&(l.filterGroups=e,a._appliedFiltering=l,a._applyFilter(e,t),a.$.fireEvent("filter"),a._refreshFilterButton())}_refreshFilterButton(){const e=this,t=e._appliedFiltering.filters?e._appliedFiltering.filters.length:0;if(0===t)return e.$.filterButton.firstElementChild.innerHTML=e.localize("filter"),void e.$.filterButton.classList.remove("filtered");e.$.filterButton.firstElementChild.innerHTML=1===t?e.localize("filteredByOne"):e.localize("filteredByMultiple",{n:t}),e.$.filterButton.classList.add("filtered")}addSort(e,t){const a=this,l=a.dataSource,n=JSON.stringify(a._appliedSorting);let i;function o(e,n){if(a.columns.find((t=>t.dataField===e))){let a=Array.isArray(t)?t[n]:"string"==typeof t?t:"ascending";i.dataFields.push(e),i.dataTypes.push(l.dataFields.find((t=>t.name===e)).dataType),a=a&&-1!==a.indexOf("desc")?"descending":"ascending",i.orderBy.push(a)}}if(0!==arguments.length&&l&&0!==l.length){if(a.closePanel(),1===arguments.length&&"object"==typeof e)i=e;else if(i={dataFields:[],dataTypes:[],orderBy:[]},Array.isArray(e))e.forEach(o);else{if("string"!=typeof e)return;o(e,0)}a.closePanel(),a._appliedSorting=i,n!==JSON.stringify(a._appliedSorting)&&(a._applySort(),a.$.fireEvent("sort"),a._refreshSortButton())}}_refreshSortButton(){const e=this,t=e._appliedSorting.dataFields.length;return 0===t||e.grid&&!1===e.grid.sorting.maintainSort?(e.$.sortButton.firstElementChild.innerHTML=e.localize("sort"),void e.$.sortButton.classList.remove("sorted")):(e.$.sortButton.firstElementChild.innerHTML=1===t?e.localize("sortedByOne"):e.localize("sortedByMultiple",{n:t}),void e.$.sortButton.classList.add("sorted"))}closePanel(){const e=this.$.headerDropDown;e.classList.remove("open"),setTimeout((()=>{e.classList.add("smart-visibility-hidden")}),150),this._closeSearchPanel(),e.controlledBy&&(e.controlledBy.removeAttribute("aria-controls"),e.controlledBy.setAttribute("aria-expanded",!1),delete e.controlledBy)}_closeSearchPanel(){const e=this;e._searchInfo&&delete e._searchInfo}_closeDialog(){const e=this;e._editInfo&&e._editInfo.window.close()}openFormatPanel(){}openFilterPanel(e,t){const a=this,l=a.dataSource;if(!l||0===l.length&&!l.virtualDataSource||a.disabled||"none"===a.headerPosition)return;let n;a._editInfo&&a._editInfo.window.close(),a.$.headerDropDown.classList.add("filter-panel"),a.$.headerDropDown.classList.remove("customize-panel","colors-panel","sort-panel","search-panel","format-panel"),a.$.filter.classList.remove("smart-hidden"),a.$.customize.classList.add("smart-hidden"),a.$.sort.classList.add("smart-hidden"),a.$.colors&&a.$.colors.classList.add("smart-hidden"),a.$.format&&a.$.format.classList.add("smart-hidden"),a.$.group&&a.$.group.classList.add("smart-hidden"),a.$.search.classList.add("smart-hidden"),a._closeSearchPanel(),a._filterPartCreated?(n=a.$.filter.firstElementChild,n.set("dataSource",e),n.set("locale",a.locale),n.messages=a._innerElementMessages.multiColumnFilterPanel,n.operator=a._appliedFiltering.operator,n.editorPlaceholder=a.localize("filterValuePlaceholder"),n.set("operator",a._appliedFiltering.operator),n.set("value",a._appliedFiltering.filters),n._applyValue(),n.rightToLeft=a.rightToLeft):(n=document.createElement("smart-multi-column-filter-panel"),n.rightToLeft=a.rightToLeft,n.animation=a.animation,n.dataSource=e,n.locale=a.locale,n.messages=a._innerElementMessages.multiColumnFilterPanel,n.operator=a._appliedFiltering.operator,n.editorPlaceholder=a.localize("filterValuePlaceholder"),n.theme=a.theme,n.value=a._appliedFiltering.filters,n.editorCallback=t,a.$.filter.appendChild(n),a._filterPartCreated=!0),a._openHeaderDropDown(a.$.filterButton)}openColorsPanel(e,t,a){const l=this,n=l.dataSource;if(!n||0===n.length&&!n.virtualDataSource||l.disabled||"none"===l.headerPosition)return;let i;l._editInfo&&l._editInfo.window.close(),l.$.headerDropDown.classList.add("colors-panel"),l.$.headerDropDown.classList.remove("filter-panel","group-panel","customize-panel","sort-panel","search-panel","format-panel"),l.$.colors&&l.$.colors.classList.remove("smart-hidden"),l.$.customize.classList.add("smart-hidden"),l.$.filter.classList.add("smart-hidden"),l.$.sort.classList.add("smart-hidden"),l.$.filter&&l.$.filter.classList.add("smart-hidden"),l.$.group&&l.$.group.classList.add("smart-hidden"),l.$.search.classList.add("smart-hidden"),l._closeSearchPanel(),l._colorsPartCreated?(i=l.$.colors.firstElementChild,i.set("dataSource",e),i.set("locale",l.locale),i.messages=l._innerElementMessages.multiColumnFilterPanel,i.operator="or",i.editorPlaceholder=l.localize("filterValuePlaceholder"),i.set("operator","or"),l._appliedColors||(l._appliedColors=[]),i.set("value",l._appliedColors),i._applyValue(),i.rightToLeft=l.rightToLeft):(i=document.createElement("smart-colors-panel"),i.rightToLeft=l.rightToLeft,i.animation=l.animation,i.dataSource=e,i.locale=l.locale,i.messages=l._innerElementMessages.multiColumnFilterPanel,i.operator="or",i.editorPlaceholder=l.localize("filterValuePlaceholder"),i.theme=l.theme,i.editorCallback=t,i.ownerElement=a,l._appliedColors&&i.set("value",l._appliedColors),l.$.colors&&l.$.colors.appendChild(i),l._colorsPartCreated=!0),l._openHeaderDropDown(l.$.colorsButton)}openSortPanel(e){const t=this,a=t.dataSource;if(!a||0===a.length&&!a.virtualDataSource||t.disabled||"none"===t.headerPosition)return;let l;t._closeDialog(),t.$.headerDropDown.classList.add("sort-panel"),t.$.headerDropDown.classList.remove("customize-panel","filter-panel","format-panel","search-panel"),t.$.sort.classList.remove("smart-hidden"),t.$.customize.classList.add("smart-hidden"),t.$.filter.classList.add("smart-hidden"),t.$.colors&&t.$.colors.classList.add("smart-hidden"),t.$.format&&t.$.format.classList.add("smart-hidden"),t.$.group&&t.$.group.classList.add("smart-hidden"),t.$.search.classList.add("smart-hidden"),t._closeSearchPanel(),t._sortPartCreated?(l=t.$.sort.firstElementChild,l.rightToLeft=t.rightToLeft,l.dataSource=e,l.locale=t.locale,l.messages=t._innerElementMessages.sortPanel,l.set("dataSource",e),l.propertyChangedHandler("dataSource",void 0,e)):(l=document.createElement("smart-sort-panel"),l.rightToLeft=t.rightToLeft,l.animation=t.animation,l.dataSource=e,l.locale=t.locale,l.messages=t._innerElementMessages.sortPanel,l.theme=t.theme,t.$.sort.appendChild(l),t._sortPartCreated=!0),t._openHeaderDropDown(t.$.sortButton)}removeFilter(){this.addFilter([])}removeSort(){this.addSort({dataFields:[],dataTypes:[],orderBy:[]})}_clearFilterAndSortUI(){const e=this;e._appliedFiltering={filterGroups:[],filters:[],operator:"and"},e._appliedSorting={dataFields:[],dataTypes:[],orderBy:[]},e._appliedGrouping={dataFields:[]},e._appliedColors=[[],{type:"conditions",decorate:"border",singleSelect:""}],e.$.filterButton.classList.remove("filtered"),e.$.sortButton.classList.remove("sorted"),e.$.filterButton.firstElementChild.innerHTML=e.localize("filter"),e.$.sortButton.firstElementChild.innerHTML=e.localize("sort")}_getInnerElementMessages(){const e=this,t=e.locale,a={columnPanel:{},groupPanel:{},multiColumnFilterPanel:{},sortPanel:{},formattingPanel:{},dateTimePicker:{}};a.formattingPanel[t]={add:e.localize("add"),all:e.localize("all"),apply:e.localize("apply"),between:e.localize("between"),cancel:e.localize("cancel"),close:e.localize("close"),column:e.localize("column"),condition:e.localize("condition"),equal:e.localize("equal"),fontFamily:e.localize("fontFamily"),fontSize:e.localize("fontSize"),format:e.localize("format"),greaterThan:e.localize("greaterThan"),highlight:e.localize("highlight"),lessThan:e.localize("lessThan"),notEqual:e.localize("notEqual"),remove:e.localize("remove"),secondValue:e.localize("secondValue"),text:e.localize("text"),value:e.localize("value")},a.columnPanel[t]={apply:e.localize("apply"),cancel:e.localize("cancel"),reset:e.localize("reset"),find:e.localize("find"),noResults:e.localize("noResults")},a.groupPanel[t]={apply:e.localize("apply"),cancel:e.localize("cancel"),collapseAll:e.localize("collapseAll"),expandAll:e.localize("expandAll"),firstBy:e.localize("firstByGroup"),noGrouping:e.localize("noGrouping"),pickAnother:e.localize("pickAnotherGroupBy"),stringFirst:e.localize("stringFirst"),stringLast:e.localize("stringLast"),thenBy:e.localize("thenBy"),from:e.localize("from"),booleanFirst:e.localize("booleanFirst"),booleanLast:e.localize("booleanLast"),dateFirst:e.localize("dateFirst"),dateLast:e.localize("dateLast"),numberFirst:e.localize("numberFirst"),numberLast:e.localize("numberLast")},a.multiColumnFilterPanel[t]={addFilter:e.localize("addFilter"),noResults:e.localize("noResults"),add:"+ "+e.localize("add"),select:e.localize("dialogAddColumnTypeSelect"),condition:e.localize("conditions"),and:e.localize("and"),apply:e.localize("apply"),cancel:e.localize("cancel"),CONTAINS:e.localize("CONTAINS"),CONTAINS_CASE_SENSITIVE:e.localize("CONTAINS_CASE_SENSITIVE"),DOES_NOT_CONTAIN:e.localize("DOES_NOT_CONTAIN"),DOES_NOT_CONTAIN_CASE_SENSITIVE:e.localize("DOES_NOT_CONTAIN_CASE_SENSITIVE"),EMPTY:e.localize("EMPTY"),ENDS_WITH:e.localize("ENDS_WITH"),ENDS_WITH_CASE_SENSITIVE:e.localize("ENDS_WITH_CASE_SENSITIVE"),EQUAL:e.localize("EQUAL"),EQUAL_CASE_SENSITIVE:e.localize("EQUAL_CASE_SENSITIVE"),GREATER_THAN:e.localize("GREATER_THAN"),GREATER_THAN_OR_EQUAL:e.localize("GREATER_THAN_OR_EQUAL"),LESS_THAN:e.localize("LESS_THAN"),LESS_THAN_OR_EQUAL:e.localize("LESS_THAN_OR_EQUAL"),noFilters:e.localize("noFilters"),NOT_EMPTY:e.localize("NOT_EMPTY"),NOT_EQUAL:e.localize("NOT_EQUAL"),NOT_NULL:e.localize("NOT_NULL"),NULL:e.localize("NULL"),or:e.localize("or"),STARTS_WITH:e.localize("STARTS_WITH"),STARTS_WITH_CASE_SENSITIVE:e.localize("STARTS_WITH_CASE_SENSITIVE"),where:e.localize("where"),TOMORROW:e.localize("TOMORROW"),TODAY:e.localize("TODAY"),YESTERDAY:e.localize("YESTERDAY"),THIS_WEEK:e.localize("THIS_WEEK"),LAST_WEEK:e.localize("LAST_WEEK"),NEXT_WEEK:e.localize("NEXT_WEEK"),THIS_MONTH:e.localize("THIS_MONTH"),LAST_MONTH:e.localize("LAST_MONTH"),NEXT_MONTH:e.localize("NEXT_MONTH"),conditions:e.localize("conditions"),colorsSingleSelect:e.localize("colorsSingleSelect"),colorRows:e.localize("colorRows"),colorSelect:e.localize("colorSelect"),colorLeftBorderLabel:e.localize("colorLeftBorderLabel"),colorRowLabel:e.localize("colorRowLabel"),colorCellLabel:e.localize("colorCellLabel"),colorLeftBorder:e.localize("colorLeftBorder"),colorRow:e.localize("colorRow"),colorCell:e.localize("colorCell"),noOptions:e.localize("noOptions")},a.sortPanel[t]={apply:e.localize("apply"),applyOnce:e.localize("applyOnce"),booleanFirst:e.localize("booleanFirst"),booleanLast:e.localize("booleanLast"),cancel:e.localize("cancel"),dateFirst:e.localize("dateFirst"),dateLast:e.localize("dateLast"),firstBy:e.localize("firstBy"),from:e.localize("from"),numberFirst:e.localize("numberFirst"),numberLast:e.localize("numberLast"),noSorting:e.localize("noSorting"),pickAnother:e.localize("pickAnother"),maintainSort:e.localize("maintainSort"),stringFirst:e.localize("stringFirst"),stringLast:e.localize("stringLast"),thenBy:e.localize("thenBy")},a.dateTimePicker[t]={now:e.localize("now"),dateTabLabel:e.localize("dateTabLabel"),timeTabLabel:e.localize("timeTabLabel")},e._innerElementMessages=a}_handleHeaderPosition(e){const t=this,a=t.headerPosition,l=t.$.header;"none"!==a?(l.classList.remove("smart-hidden"),"top"===a&&l.nextElementSibling!==e?t.$.container.insertBefore(l,e):"bottom"===a&&l.previousElementSibling!==e&&t.$.container.insertBefore(l,t.$.loadingIndicatorContainer)):l.classList.add("smart-hidden")}_headerClickHandler(e){const t=this,a=t.$.headerDropDown;function l(e,l){a.classList.contains("smart-visibility-hidden")||e.classList.contains("smart-hidden")?t[l]():t.closePanel()}if(t.$.customizeButton.contains(e))l(t.$.customize,"openCustomizePanel");else if(t.$.filterButton.contains(e))l(t.$.filter,"openFilterPanel");else if(t.$.sortButton.contains(e))l(t.$.sort,"openSortPanel");else if(t.$.formatButton&&t.$.formatButton.contains(e))l(t.$.format,"openFormatPanel");else if(t.$.colorsButton&&t.$.colorsButton.contains(e))l(t.$.colors,"openColorsPanel");else if(e===t.$.searchButton)l(t.$.search,"_openSearchPanel");else if(t.$.groupButton&&t.$.groupButton.contains(e))l(t.$.group,"openGroupPanel");else if(t.$.viewStatesButton&&t.$.viewStatesButton.contains(e))l(t.$.view,"openViewPanel");else if(e===t.$.searchClose)t.$.searchInput.value="",t._search("",!1),t.closePanel();else if(e===t.$.searchPrev||e===t.$.searchNext){const a=t._searchInfo,l=a.foundIdsArray,n=e===t.$.searchNext,i=l.length;let o;if(void 0===a.highlighted)o=n?0:i-1;else{if(1===l.length)return;{const e=l.indexOf(a.highlighted);o=n?(e+1)%i:e-1>=0?e-1:i-1}}a.highlighted=l[o],t.grid?(t.grid.highlighted=a.highlighted,t.grid.ensureVisible(a.highlighted),t.grid._recycle(!1)):t.ensureVisible&&t.ensureVisible(a.highlighted),t.$.searchLabel.innerHTML=t.localize("found",{nth:o+1,n:l.length})}}_headerDropDownTransitionendHandler(e){const t=this,a=t.$.headerDropDown;t._openTimer=setTimeout((()=>{e&&("visibility"!==e.propertyName||a.classList.contains("smart-visibility-hidden"))||(a.classList.contains("search-panel")?t.$.searchInput.focus():!1===t.unfocusable&&(!t._isMobile&&a.classList.contains("customize-panel")?a.querySelector("smart-column-panel").$.find.focus():a.classList.contains("filter-panel")?a.querySelector("smart-multi-column-filter-panel").$.addFilterButton.focus():a.classList.contains("sort-panel")&&a.querySelector("smart-sort-panel").$.inputNotSorted.focus()))}),100)}_localizeHeader(){const e=this;e.$.customizeButton.firstElementChild.innerHTML=e.localize("customize"),e.$.groupButton&&(e.$.groupButton.firstElementChild.innerHTML=e.localize("group")),0===e._appliedFiltering.filters.length?e.$.filterButton.firstElementChild.innerHTML=e.localize("filter"):1===e._appliedFiltering.filters.length?e.$.filterButton.firstElementChild.innerHTML=e.localize("filteredByOne"):e.$.filterButton.firstElementChild.innerHTML=e.localize("filteredByMultiple",{n:e._appliedFiltering.filters.length}),0===e._appliedSorting.dataFields.length?e.$.sortButton.firstElementChild.innerHTML=e.localize("sort"):1===e._appliedSorting.dataFields.length?e.$.sortButton.firstElementChild.innerHTML=e.localize("sortedByOne"):e.$.sortButton.firstElementChild.innerHTML=e.localize("sortedByMultiple",{n:e._appliedSorting.dataFields.length}),e.$.formatButton&&(e.$.formatButton.firstElementChild.innerHTML=e.localize("formating")),e.$.searchInput.placeholder=e.localize("findInView")}_openHeaderDropDown(e){const t=this,a=t.$.headerDropDown;"top"===t.headerPosition?(a.style.bottom=null,a.style.top="100%"):(a.style.top=null,a.style.bottom="100%"),e!==t.$.searchButton||e===t.$.searchButton&&t.rightToLeft?a.style.left=e.offsetLeft-(t.rightToLeft?a.offsetWidth-e.offsetWidth:0)+"px":a.style.left=(t.rightToLeft?e.offsetLeft:e.offsetLeft+Math.max(25,e.offsetWidth)-a.offsetWidth)+"px",a.classList.remove("smart-visibility-hidden"),a.classList.add("open"),a.controlledBy&&(a.controlledBy.removeAttribute("aria-controls"),a.controlledBy.setAttribute("aria-expanded",!1)),a.controlledBy=e,e.setAttribute("aria-controls",a.id),e.setAttribute("aria-expanded",!0),t._headerDropDownTransitionendHandler()}_searchInputKeyupHandler(e){const t=this;function a(){t._searchInfo&&t.$.searchInput.value!==t._searchInfo.query&&t._search(t.$.searchInput.value)}return clearTimeout(t._searchInputTimeout),"Escape"===e.key?(t.$.searchInput.value="",a(),void t.closePanel()):"Enter"===e.key&&t._searchInfo.foundIdsArray&&t._searchInfo.foundIdsArray.length>1?(a(),void t._headerClickHandler(t.$.searchNext,t.$.cardContainer||t.$.body)):void(t._searchInputTimeout=setTimeout(a,500))}}),Smart("smart-colors-panel",class extends Smart.BaseElement{static get properties(){return{closeButtonPosition:{value:"left",allowedValues:["left","right"],type:"string"},dataSource:{value:[],type:"array",reflectToAttribute:!1},editorCallback:{value:null,type:"function?",reflectToAttribute:!1},editorPlaceholder:{value:"Value",type:"string"},messages:{value:{en:{addFilter:"+ Add decorator",and:"And",apply:"Ok",cancel:"Cancel",CONTAINS:"contains",CONTAINS_CASE_SENSITIVE:"contains (case sensitive)",DOES_NOT_CONTAIN:"does not contain",DOES_NOT_CONTAIN_CASE_SENSITIVE:"does not contain (case sensitive)",EMPTY:"empty",ENDS_WITH:"ends with",ENDS_WITH_CASE_SENSITIVE:"ends with (case sensitive)",EQUAL:"equal",EQUAL_CASE_SENSITIVE:"equal (case sensitive)",GREATER_THAN:"greater than",GREATER_THAN_OR_EQUAL:"greater than or equal",LESS_THAN:"less than",LESS_THAN_OR_EQUAL:"less than or equal",noFilters:"No filters applied",NOT_EMPTY:"not empty",NOT_EQUAL:"not equal",NOT_NULL:"not null",NULL:"null",or:"Or",STARTS_WITH:"starts with",STARTS_WITH_CASE_SENSITIVE:"starts with (case sensitive)",where:"Where",TOMORROW:"Tomorrow",TODAY:"Today",YESTERDAY:"Yesterday",NEXT_WEEK:"Next week",THIS_WEEK:"This week",LAST_WEEK:"Last week",NEXT_MONTH:"Next month",THIS_MONTH:"This month",LAST_MONTH:"Last month"}},type:"object",extend:!0},operator:{value:"and",allowedValues:["and","or"],type:"string"},value:{value:[],type:"array"}}}static get listeners(){return{change:"_changeHandler",click:"_interactionHandler",keydown:"_interactionHandler"}}static get requires(){return{"Smart.Button":"smart.button.js","Smart.CheckBox":"smart.checkbox.js","Smart.DateTimePicker":"smart.datetimepicker.js","Smart.FilterGroup":"smart.filter.js","Smart.Input":"smart.input.js","Smart.NumericTextBox":"smart.numerictextbox.js"}}static get styleUrls(){return["smart.grid.anel.css"]}template(){return'<div id="container" role="presentation">\n                    <div id="gridLayout">\n                        <div style="border-right: 1px solid var(--smart-border)" class="tabs" id="tabs">\n                        <div title="Color rows when they match the conditions" class="tab active" id="condition"></div>\n                        <div title="Color rows the same as a single select value" class="tab" id="select"></div>\n                        </div>\n                        <div style="margin-left: 10px;" id="applyTo"></div>\n                    </div>\n                    <div id="conditionsContainer">\n                        <span id="conditionLabel">Color rows when they match the conditions</span>\n                        <div id="singleSelectLabel" class="smart-hidden">Which single select field should the row be colored by?</div>\n                        <smart-input style="margin-top: 10px; margin-bottom: 10px; width: 250px; display: block;" selected-index="0" class="underlined smart-hidden" readonly id="singleSelect"></smart-input>\n                    </div>\n                    <div id="itemsContainer" style="padding-top: 0px;" class="smart-filter-panel-items-container smart-unselectable"></div>\n                    <div id="footer" class="smart-grid-panel-container-footer" role="presentation">\n                        <div id="addFilterButton" class="smart-filter-panel-add-filter-button smart-unselectable" role="button"></div>\n                        <div id="buttonsContainer" class="smart-grid-panel-buttons-container smart-unselectable" role="presentation">\n                            <span class="smart-grid-panel-cancel-button" role="button"></span>\n                            <span class="smart-grid-panel-apply-button primary" role="button"></span>\n                    </div>\n                </div>'}ready(){super.ready()}updateSingleSelect(){const e=this,t=e.ownerElement.columns.filter((e=>!!e.template&&!("tags"!==e.template&&"collaborator"!==e.template&&"dropdownlist"!==e.template&&"list"!==e.template||!e.editor.singleSelect))).map((e=>({label:e.label,value:e.dataField})));e.$.singleSelect.dataSource=t,e.$.singleSelect.selectedValue=t[0]?t[0].value:""}render(){const e=this;e.setAttribute("role","dialog"),e.$.gridLayout.style.display="grid",e.$.gridLayout.style.gridTemplateColumns="400px auto",e.$.gridLayout.style.gridColumnGap="1rem",e.$.gridLayout.style.overflow="hidden",e.$.applyToInput&&e.$.applyToInput.classList.remove("smart-hidden"),e.ownerElement&&"scheduler"===e.ownerElement.view&&(e.$.gridLayout.style.gridTemplateColumns="",e.$.tabs.style.borderRight="none",e.$.applyToInput&&e.$.applyToInput.classList.add("smart-hidden")),e.$.condition.onclick=()=>{e.$.select.classList.remove("active"),e.$.condition.classList.add("active"),e.$.singleSelectLabel.classList.add("smart-hidden"),e.$.singleSelect.classList.add("smart-hidden"),e.$.addFilterButton.classList.remove("smart-visibility-hidden"),e.$.itemsContainer.classList.remove("smart-hidden"),e.$.conditionLabel.classList.remove("smart-hidden"),e.$.singleSelect.classList.add("smart-hidden"),e.$.applyToInput.dataSource[2].visible=!0},e.$.select.onclick=()=>{e.$.select.classList.add("active"),e.$.condition.classList.remove("active"),e.$.singleSelectLabel.classList.remove("smart-hidden"),e.$.singleSelect.classList.remove("smart-hidden"),e.$.addFilterButton.classList.add("smart-visibility-hidden"),e.$.itemsContainer.classList.add("smart-hidden"),e.$.conditionLabel.classList.add("smart-hidden"),e.$.singleSelect.classList.remove("smart-hidden"),e.$.applyToInput.dataSource[2].visible=!1,2===e.$.applyToInput.selectedIndex&&(e.$.applyToInput.selectedIndex=0)};const t=document.createElement("smart-input");t.readonly=!0,t.dropDownButtonPosition="right",t.dropDownAppendTo="body",t.style.width="100%",e.$.singleSelect.dropDownButtonPosition="right",e.$.singleSelect.dropDownAppendTo="body",e.updateSingleSelect();const a="var(--smart-primary);";t.dataSource=[{label:"Left border",value:"border",menuLabel:'<div style="flex-direction: column; display: inline-flex"><div>Left border</div><div class="smart-quiet">Color the left border of a row</div>',prefix:'<span style="top: 8px; border-right: 3px solid '+a+'; padding: 2px; display: inline-block; margin-right: 16px; position: relative;">1</span>'},{label:"Row",value:"row",menuLabel:'<div style="flex-direction: column; display: inline-flex"><div>Row background</div><div class="smart-quiet">Color the background of a row</div>',prefix:'<span style="top: 8px; border: 1px solid var(--smart-primary); color: var(--smart-primary-color); background: '+a+'; padding: 2px; display: inline-block; margin-left:-4px; position: relative;">1</span><span style="border: 1px solid var(--smart-primary); color: var(--smart-primary-color); top: 8px;  background: '+a+'; padding: 2px; display: inline-block; margin-right: 8px; position: relative;">2</span>'},{label:"Cell",value:"cell",menuLabel:'<div style="flex-direction: column; display: inline-flex"><div>Cell background</div><div class="smart-quiet">Color the background of a cell</div>',prefix:'<span style="top: 8px; border: 1px solid var(--smart-primary); color: var(--smart-primary-color); background: '+a+'; padding: 2px; display: inline-block; margin-left:-4px; position: relative;">1</span><span style="border:1px solid '+a+'; padding: 2px; display: inline-block; top: 8px;  margin-right: 8px; position: relative;">2</span>'}],e.$.applyTo.appendChild(t),e.$.applyToInput=t,e._setFocusable(),e._localize(),e.$.applyToInput.selectedIndex=0,e._applyValue(),super.render()}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const l=this;switch(e){case"animation":case"theme":case"rightToLeft":Array.from(l.$.itemsContainer.querySelectorAll("smart-date-time-picker, smart-numeric-text-box, smart-check-box, smart-input")).forEach((t=>{t[e]=a,"smart-input"===t.tagName.toLowerCase()&&"rightToLeft"===e&&"none"!==t.dropDownButtonPosition&&(t.dropDownButtonPosition=a?"left":"right")}));break;case"disabled":case"unfocusable":l._setFocusable(!0);break;case"dataSource":case"value":l._applyValue();break;case"editorPlaceholder":Array.from(l.$.itemsContainer.getElementsByClassName("editor")).forEach((e=>e.placeholder=a));break;case"locale":case"messages":l._localize(!0);break;case"operator":l._setOperator()}}_setOperator(){const e=this,t=e.localize(e.operator);for(let a=2;a<e._items.length;a++)e._items[a].children[1].innerHTML=t}_changeHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target;if(a instanceof Smart.Input==0)return;if(a===t.$.singleSelect)return;const l=a.parentElement,n=l.children;if(a===n[1])t.operator=a.$.input.dataValue,t._setOperator();else if(a===n[2]){let a,i,o=t.dataSource.find((t=>t.dataField===e.detail.oldValue)).dataType,r=t.dataSource.find((t=>t.dataField===e.detail.oldValue)),s=t.dataSource.find((t=>t.dataField===e.detail.value)),d=s?s.dataType:"string",c=[];if(s&&s.options&&(d="enum",c=s.options.map((e=>{const t=e.color||"var(--smart-primary)";return e.prefix='<span style="background: '+t+'; width: 14px; height: 14px; display: inline-block; border-radius: 50%; margin-left:-4px; margin-right: 8px; top: 2px; position: relative;"></span>',""===e.label&&(e.label=" "),e}))),t.$.select.classList.contains("active"))return;if(r&&r.options&&(o="enum"),"enum"!==d&&d===o)return void(t.editorCallback&&t.editorCallback(n[4],s));let u=n[3]?n[3].value:"";switch(d){case"date":a=t._dateConditions,i=document.createElement("smart-date-time-picker"),i.calendarButton=!0,i.dropDownAppendTo="body",i.dropDownDisplayMode="auto",i.formatString="M/d/yy H:mm",u="";break;case"number":a=t._numberAndDateConditions,i=document.createElement("smart-numeric-text-box"),u="";break;case"boolean":a=t._booleanConditions,i=document.createElement("smart-check-box"),u="";break;case"enum":a=t._enumConditions,i=document.createElement("smart-input"),i.dataSource=c.length?c:s.options,i.readonly=!0,i.dropDownButtonPosition="right",u=a[0];break;default:a=t._stringConditions,u=t._stringConditions.find((e=>"CONTAINS"===e.value)),i=document.createElement("smart-input")}a.forEach((e=>{delete e.selected})),i.rightToLeft=t.rightToLeft,i.animation=t.animation,i.theme=t.theme,i.unfocusable=t.disabled||t.unfocusable,i.classList.add("underlined"),i.dataSource&&i.dataSource.length<10?i.dropDownHeight="auto":i.dropDownHeight=250,"boolean"!==d&&(i.placeholder=t.editorPlaceholder),t.editorCallback&&t.editorCallback(i,s),n[4]&&n[4].remove(),l.appendChild(i),""===u||a.find((e=>e.label===u))||(u.value?(n[3].value=u.label,n[3].selectedValue=u.value):(n[3].value="",n[3].selectedValue="")),n[3].dataSource=a,""===u&&(n[3].value=a[0].label,n[3].selectedValue=a[0].value),a.length>=10?n[3].dropDownHeight=250:n[3].dropDownHeight="auto",l.dataType=d}else if(a===n[3]){const e=n[4],t=a.$.input.dataValue;-1!==t.indexOf("NULL")||-1!==t.indexOf("EMPTY")||-1!==t.indexOf("THIS_WEEK")||-1!==t.indexOf("LAST_WEEK")||-1!==t.indexOf("NEXT_WEEK")||-1!==t.indexOf("THIS_MONTH")||-1!==t.indexOf("LAST_MONTH")||-1!==t.indexOf("NEXT_MONTH")||-1!==t.indexOf("THIS_YEAR")||-1!==t.indexOf("LAST_YEAR")||-1!==t.indexOf("NEXT_YEAR")||-1!==t.indexOf("TODAY")||-1!==t.indexOf("TOMORROW")||-1!==t.indexOf("YESTERDAY")?(e.value="",e.checked=!1,e.classList.add("smart-visibility-hidden")):e.classList.remove("smart-visibility-hidden"),a.condition=t}}_getColorInput(){const e=document.createElement("smart-color-input");return e.dataSource=["#D50000","#E67C73","#F4511E","#F6BF26","#0B8043","#33B679","#3F51B5","#039BE5","#7986CB","#8C47FF","#8E24AA","#FF36C2","#616161","#454545","#949494","#000000"],e.additionalColors=["#FF9EB7","#FFCFC9","#FFD66D","#FFEBB6","#93DF89","#D1F7C4","#9DC7FF","#D0F0FD","#CDAFFF","#ECE1FD","#FA9DE2","#FFDAF6","#CBCBCB","#EDEDED","#FFFFFF",""],e.valueDisplayMode="colorBox",e.classList.add("underlined","smart-grid-color-input"),e.style.width="auto",e.readonly=!0,e.onRender=()=>{const t=e.$.scrollView;e.querySelector(".smart-color-box").style.borderRadius="50%",t&&t.classList.add("smart-grid-color-input")},e}_interactionHandler(e){const t=this;if(t.disabled||t.readonly)return;if("keydown"===e.type){if("Enter"!==e.key)return;e.preventDefault()}const a=t.shadowRoot||t.isInShadowDOM?e.composedPath()[0]:e.target,l=a.closest(".smart-grid-panel-item");if(l){if(a===l.firstElementChild){const e=t._items.indexOf(l);let a;if(t._items.splice(e,1),l.remove(),t._items.length>0&&e<2){if(0===e){t._items[0].children[1].remove(),a=document.createElement("div"),a.innerHTML=t.localize("where");const e=t._getColorInput();t._items[0].insertBefore(e,t._items[0].children[1])}t._items.length>1&&(t._items[1].children[1].remove(),a=document.createElement("smart-input"),a.className="underlined",a.dataSource=[{value:"and",label:t.localize("and")},{value:"or",label:t.localize("or")}],a.dropDownButtonPosition=t.rightToLeft?"left":"right",a.readonly=!0,a.value=t.localize(t.operator),a.animation=t.animation,a.theme=t.theme,a.rightToLeft=t.rightToLeft,a.unfocusable=t.disabled||t.unfocusable,t._items[1].insertBefore(a,t._items[1].children[1]))}}}else if(a===t.$.addFilterButton&&t.dataSource.length>0)t.$.itemsContainer.appendChild(t._createItem(t.dataSource[0],"","",t._items.length));else if(a!==t.$.buttonsContainer.firstElementChild){if(a===t.$.buttonsContainer.children[1]){let e=t._stringConditions.concat(t._dateConditions),a=t.operator,l=[],n={},i=[];t._customConditions&&(e=e.concat(t._customConditions)),t._items.forEach((i=>{const o=t.dataSource.find((e=>e.label===i.children[2].value)),r=[];let s=i.children[3].value;if(""===s)return;let d=o.dataType;s=e.find((e=>e.label===s)).value;const c=i.querySelector("smart-color-input").value;if(r.push(o.dataField,s),-1===s.indexOf("NULL")&&-1===s.indexOf("EMPTY"))if("boolean"===d)r.push(i.children[4].checked);else if("date"===d)r.push(i.children[4].value.toDate());else if("enum"===d||o.options){let e=i.children[4].$.input.dataValue;if(void 0===e){const t=o.options.find((e=>e.label===i.children[4].value));if(!t)return;e=t.value}d="string",r.push(e)}else r.push(i.children[4].value);r.push(c);let u=n[r[0]];void 0===u&&(u=new Smart.Utilities.FilterGroup,n[r[0]]=u);const p=u.createFilter(d,r[2],r[1]);u.addFilter(a,p),l.push(r)}));for(let e in n)i.push([e,n[e]]);const o={};o.type=t.$.condition.classList.contains("active")?"conditions":"singleSelect",o.decorate=t.$.applyToInput.selectedValue,o.singleSelect=t.$.singleSelect.selectedValue,o.singleSelect||(o.singleSelect=t.$.singleSelect.dataSource&&t.$.singleSelect.dataSource.length?t.$.singleSelect.dataSource[0].value:""),null===o.decorate&&(o.decorate="border"),t.value=l,t.$.fireEvent("apply",{filters:i,decorator:o,value:l})}}else t.$.fireEvent("cancel")}_applyValue(){const e=this,t=document.createDocumentFragment();let a=0;for(e._items=[],e.$.itemsContainer.innerHTML="";e.$.itemsContainer.firstElementChild;)e.$.itemsContainer.firstElementChild.remove();if(0===e.dataSource.length)return;e.$.gridLayout.style.display="grid",e.$.gridLayout.style.gridTemplateColumns="400px auto",e.$.gridLayout.style.gridColumnGap="1rem",e.$.gridLayout.style.overflow="hidden",e.$.applyToInput.classList.remove("smart-hidden"),!e.ownerElement||"scheduler"!==e.ownerElement.view&&"kanban"!==e.ownerElement.view||(e.$.gridLayout.style.gridTemplateColumns="",e.$.applyToInput.classList.add("smart-hidden"));const l=e.value&&e.value[0]||[],n=e.value?e.value[1]:{};n&&"singleSelect"===n.type?e.$.select.click():e.$.condition.click(),l.forEach((l=>{if(!Array.isArray(l))return;const n=l[0],i=e.dataSource.find((e=>e.dataField===n));if(!i)return;let o;o="EMPTY"===l[1]||"NULL"===l[1]||"NOT_EMPTY"===l[1]||"NOT_NULL"===l[1]?e._createItem(i,l[1],void 0,a,l[2]):e._createItem(i,l[1],l[2],a,l[3]),t.appendChild(o),a++})),e.$.itemsContainer.appendChild(t),e.updateSingleSelect(),n&&(e.$.applyToInput.selectedValue=n.decorate,e.$.singleSelect.selectedValue=n.singleSelect)}_createItem(e,t,a,l,n=""){const i=this,o=i.disabled||i.unfocusable?-1:0,r=document.createElement("div"),s=document.createDocumentFragment(),d=document.createElement("div"),c=document.createElement("smart-input"),u=document.createElement("smart-input");let p,m;d.className="smart-grid-panel-item-close-button",d.tabIndex=o,d.setAttribute("role","button"),d.setAttribute("aria-label","button"),s.appendChild(d),p=document.createElement("div");const h=i._getColorInput();if(h.value=n,p.appendChild(h),p.setAttribute("role","presentation"),s.appendChild(p),c.className="underlined",c.dataSource=i.dataSource.map((e=>({value:e.dataField,label:e.label,icon:e.icon}))),c.dropDownButtonPosition=i.rightToLeft?"left":"right",c.readonly=!0,c.value=e.label,c.animation=i.animation,c.theme=i.theme,c.rightToLeft=i.rightToLeft,c.unfocusable=i.disabled||i.unfocusable,c.setAttribute("aria-label","Field"),c.dataSource&&c.dataSource.length<10?c.dropDownHeight="auto":c.dropDownHeight=250,s.appendChild(c),"boolean"===e.dataType)u.dataSource=JSON.parse(JSON.stringify(i._booleanConditions)),m=document.createElement("smart-check-box"),m.checked="boolean"==typeof a&&a;else if("date"===e.dataType)u.dataSource=i._dateConditions,m=document.createElement("smart-date-time-picker"),m.dropDownDisplayMode="auto",m.calendarButton=!0,m.dropDownAppendTo="body",m.formatString="M/d/yy H:mm",m.value=a;else if("number"===e.dataType)u.dataSource=JSON.parse(JSON.stringify(i._numberAndDateConditions)),m=document.createElement("smart-numeric-text-box"),m.value="number"==typeof a||"string"==typeof a?a:0;else if("enum"===e.dataType||e.options){u.dataSource=JSON.parse(JSON.stringify(i._enumConditions)),m=document.createElement("smart-input");let t=[];e.options&&(t=e.options.map((e=>{const t=e.color||"var(--smart-primary)";return e.prefix='<span style="background: '+t+'; width: 14px; height: 14px; display: inline-block; border-radius: 50%; margin-left:-4px; margin-right: 8px; top: 2px; position: relative;"></span>',""===e.label&&(e.label=" "),e}))),m.dataSource=t.length?t:e.options,m.readonly=!0,m.dropDownButtonPosition="right";const l=a?e.options.find((e=>e.value===a)):null;m.value=l&&a?l.label:""}else u.dataSource=JSON.parse(JSON.stringify(i._stringConditions)),m=document.createElement("smart-input"),m.value=null!=a?a.toString():"",t||(t="CONTAINS");return u.className="underlined",u.dropDownButtonPosition=i.rightToLeft?"left":"right",u.readonly=!0,u.animation=i.animation,u.theme=i.theme,u.rightToLeft=i.rightToLeft,u.unfocusable=i.disabled||i.unfocusable,u.setAttribute("aria-label","Condition"),u.classList.add("smart-filter-panel-list"),u.dataSource.forEach((e=>{delete e.selected})),u.dataSource.find((e=>e.value===t))?(u.value=i.localize(t),u.selectedValue=t,u.condition=t):(m.value="",m.checked=!1),(void 0===t||-1===t.indexOf("NULL")&&-1===t.indexOf("EMPTY"))&&-1===t.indexOf("THIS_WEEK")&&-1===t.indexOf("LAST_WEEK")&&-1===t.indexOf("NEXT_WEEK")&&-1===t.indexOf("THIS_MONTH")&&-1===t.indexOf("LAST_MONTH")&&-1===t.indexOf("NEXT_MONTH")&&-1===t.indexOf("THIS_YEAR")&&-1===t.indexOf("LAST_YEAR")&&-1===t.indexOf("NEXT_YEAR")&&-1===t.indexOf("TODAY")&&-1===t.indexOf("TOMORROW")&&-1===t.indexOf("YESTERDAY")||(m.value="",m.checked=!1,m.classList.add("smart-visibility-hidden")),u.dataSource&&u.dataSource.length<10?u.dropDownHeight="auto":u.dropDownHeight=250,m.animation=i.animation,m.classList.add("editor"),m.rightToLeft=i.rightToLeft,m.theme=i.theme,m.unfocusable=i.disabled||i.unfocusable,m.classList.add("underlined"),"boolean"!==e.dataType&&(m.placeholder=i.editorPlaceholder),i.editorCallback&&i.editorCallback(m,e),s.appendChild(u),s.appendChild(m),r.appendChild(s),r.className="smart-grid-panel-item",i._items.push(r),r.dataType=e.dataType,r}_localize(e){const t=this;t.$.addFilterButton.innerHTML=t.localize("add"),t.$.buttonsContainer.firstElementChild.innerHTML=t.localize("cancel"),t.$.buttonsContainer.children[1].innerHTML=t.localize("apply"),t.$.itemsContainer.setAttribute("no-filters",t.localize("noResults")),t.$.select.innerHTML='<span class="smart-icon smart-grid-icon smart-icon-sort-down show"></span>'+t.localize("select"),t.$.condition.innerHTML='<span class="smart-icon smart-grid-icon smart-icon-filter show"></span>'+t.localize("conditions"),t.$.condition.title=t.localize("colorRows"),t.$.select.title=t.localize("colorSelect"),t.$.conditionLabel.innerHTML=t.localize("colorRows"),t.$.singleSelectLabel.innerHTML=t.localize("colorsSingleSelect"),t.$.singleSelect.dropDownPlaceholder=t.localize("noOptions");const a="var(--smart-primary);";t.$.applyToInput.dataSource=[{label:t.localize("colorLeftBorderLabel"),value:"border",menuLabel:`<div style="flex-direction: column; display: inline-flex"><div>${t.localize("colorLeftBorderLabel")}</div><div class="smart-quiet">${t.localize("colorLeftBorder")}</div>`,prefix:'<span style="top: 8px; border-right: 3px solid '+a+'; padding: 2px; display: inline-block; margin-right: 16px; position: relative;">1</span>'},{label:t.localize("colorRowLabel"),value:"row",menuLabel:`<div style="flex-direction: column; display: inline-flex"><div>${t.localize("colorRowLabel")}</div><div class="smart-quiet">${t.localize("colorRow")}</div>`,prefix:'<span style="top: 8px; border: 1px solid var(--smart-primary); color: var(--smart-primary-color); background: '+a+'; padding: 2px; display: inline-block; margin-left:-4px; position: relative;">1</span><span style="border: 1px solid var(--smart-primary); color: var(--smart-primary-color); top: 8px;  background: '+a+'; padding: 2px; display: inline-block; margin-right: 8px; position: relative;">2</span>'},{label:t.localize("colorCellLabel"),value:"cell",menuLabel:`<div style="flex-direction: column; display: inline-flex"><div>${t.localize("colorCellLabel")}</div><div class="smart-quiet">${t.localize("colorCell")}</div>`,prefix:'<span style="top: 8px; border: 1px solid var(--smart-primary); color: var(--smart-primary-color); background: '+a+'; padding: 2px; display: inline-block; margin-left:-4px; position: relative;">1</span><span style="border:1px solid '+a+'; padding: 2px; display: inline-block; top: 8px;  margin-right: 8px; position: relative;">2</span>'}],t.$.applyToInput.selectedValue="border",t._stringConditions=[{prefix:'<span class="smart-icon smart-icon-empty"></span>',value:"EMPTY",label:t.localize("EMPTY")},{prefix:'<span class="smart-icon smart-icon-not-empty"></span>',value:"NOT_EMPTY",label:t.localize("NOT_EMPTY")},{prefix:'<span class="smart-icon smart-icon-contains"></span>',value:"CONTAINS",label:t.localize("CONTAINS")},{prefix:'<span class="smart-icon smart-icon-does-not-contain"></span>',value:"DOES_NOT_CONTAIN",label:t.localize("DOES_NOT_CONTAIN")},{prefix:'<span class="smart-icon smart-icon-starts-with"></span>',value:"STARTS_WITH",label:t.localize("STARTS_WITH")},{prefix:'<span class="smart-icon smart-icon-ends-with"></span>',value:"ENDS_WITH",label:t.localize("ENDS_WITH")},{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],t._enumConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")}],t._dateConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-less-than"></span>',value:"LESS_THAN",label:t.localize("LESS_THAN")},{prefix:'<span class="smart-icon smart-icon-less-than-equal"></span>',value:"LESS_THAN_OR_EQUAL",label:t.localize("LESS_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-greater-than"></span>',value:"GREATER_THAN",label:t.localize("GREATER_THAN")},{prefix:'<span class="smart-icon smart-icon-greater-than-equal"></span>',value:"GREATER_THAN_OR_EQUAL",label:t.localize("GREATER_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"TOMORROW",label:t.localize("TOMORROW")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"TODAY",label:t.localize("TODAY")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"YESTERDAY",label:t.localize("YESTERDAY")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"NEXT_WEEK",label:t.localize("NEXT_WEEK")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"THIS_WEEK",label:t.localize("THIS_WEEK")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"LAST_WEEK",label:t.localize("LAST_WEEK")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"NEXT_MONTH",label:t.localize("NEXT_MONTH")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"THIS_MONTH",label:t.localize("THIS_MONTH")},{prefix:'<span class="smart-icon smart-icon-calendar"></span>',value:"LAST_MONTH",label:t.localize("LAST_MONTH")}],t._numberAndDateConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-less-than"></span>',value:"LESS_THAN",label:t.localize("LESS_THAN")},{prefix:'<span class="smart-icon smart-icon-less-than-equal"></span>',value:"LESS_THAN_OR_EQUAL",label:t.localize("LESS_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-greater-than"></span>',value:"GREATER_THAN",label:t.localize("GREATER_THAN")},{prefix:'<span class="smart-icon smart-icon-greater-than-equal"></span>',value:"GREATER_THAN_OR_EQUAL",label:t.localize("GREATER_THAN_OR_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],t._booleanConditions=[{prefix:'<span class="smart-icon smart-icon-equal"></span>',value:"EQUAL",label:t.localize("EQUAL")},{prefix:'<span class="smart-icon smart-icon-not-equal"></span>',value:"NOT_EQUAL",label:t.localize("NOT_EQUAL")},{prefix:'<span class="smart-icon smart-icon-null"></span>',value:"NULL",label:t.localize("NULL")},{prefix:'<span class="smart-icon smart-icon-not-null"></span>',value:"NOT_NULL",label:t.localize("NOT_NULL")}],e&&t._items.forEach(((e,a)=>{const l=e.children[1],n=e.children[3];0===a?l.innerHTML="":1===a?(l.dataSource=[{value:"and",label:t.localize("and")},{value:"or",label:t.localize("or")}],l.value=t.localize(t.operator)):l.innerHTML=t.localize(t.operator),"string"!==e.dataType||e.options?"enum"===e.dataType||e.options?n.dataSource=t._enumConditions:"boolean"===e.dataType?n.dataSource=t._booleanConditions:"date"===e.dataType?n.dataSource=t._dateConditions:n.dataSource=t._numberAndDateConditions:n.dataSource=t._stringConditions,n.value=n.condition?t.localize(n.condition):""}))}_setFocusable(e){const t=this,a=t.disabled||t.unfocusable?-1:0;if(t.$.addFilterButton.tabIndex=a,t.$.buttonsContainer.firstElementChild.tabIndex=a,t.$.buttonsContainer.children[1].tabIndex=a,e){const e=Array.from(t.$.itemsContainer.getElementsByClassName("smart-grid-panel-item-close-button")),l=Array.from(t.$.itemsContainer.querySelectorAll("smart-date-time-picker, smart-numeric-text-box, smart-check-box, smart-input"));e.forEach((e=>e.tabIndex=a)),l.forEach((e=>e.unfocusable=t.disabled||t.unfocusable))}}});

/***/ }),

/***/ 8588:
/***/ (() => {

Smart("smart-input",class extends Smart.BaseElement{static get properties(){return{autoCompleteDelay:{value:100,type:"number"},dataSource:{type:"any",value:[],reflectToAttribute:!1},dropDownClassList:{value:[],type:"array",reflectToAttribute:!1},dropDownDataSource:{type:"any",reflectToAttribute:!1,value:[]},dropDownHeight:{type:"any",value:200},dropDownOpenMode:{allowedValues:["default","manual"],value:"default",type:"string"},dropDownAppendTo:{value:null,type:"any"},dropDownWidth:{type:"any",value:null},dropDownButtonPosition:{allowedValues:["none","left","right"],value:"none",type:"string"},dropDownOpenPosition:{allowedValues:["bottom","top","auto"],value:"bottom",type:"string"},dropDownPlaceholder:{type:"string",value:""},hint:{type:"string",value:""},inputPurpose:{type:"string",value:"off"},items:{type:"number",value:8},minLength:{type:"number",value:1},maxLength:{type:"number",value:99999999},name:{value:"",type:"string"},prefix:{value:"",type:"string",reflectToAttribute:!1},suffix:{value:"",type:"string",reflectToAttribute:!1},onAffixClick:{value:null,type:"any",reflectToAttribute:!1},opened:{value:!1,type:"boolean"},query:{type:"string",value:""},queryMode:{allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase"],type:"string",value:"containsIgnoreCase"},placeholder:{value:"",type:"string"},readonly:{type:"boolean",value:!1},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},selectedIndex:{type:"number",value:-1},selectedValue:{type:"any",value:""},selectedValues:{value:[],type:"array"},type:{type:"string"},value:{type:"string",value:""},innerHTML:{type:"string",reflectToAttribute:!1}}}static get styleUrls(){return["smart.textbox.css"]}template(){return'<div id="inputContainer" role="presentation"><div id="optionsContainer" inner-h-t-m-l=\'{{innerHTML}}\' class="smart-hidden"></div><span class="smart-input-prefix" id="prefix" inner-h-t-m-l=\'{{prefix}}\'></span><input maxlength=\'[[maxLength]]\'  class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' value=\'{{value::keyup}}\' disabled=\'[[disabled]]\' /><span class="smart-hidden smart-hint" id="span">[[hint]]</span><span id="suffix"  class="smart-input-suffix" inner-h-t-m-l=\'{{suffix}}\'></span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button" role="button" aria-label="Toggle popup"><div id="arrow" class="arrow" aria-hidden="true"></div></div></div>'}static get listeners(){return{"input.focus":"_focusHandler","input.blur":"_blurHandler","input.keydown":"_keyDownHandler","input.keyup":"_keyUpHandler","input.keypress":"_keyPressHandler","input.paste":"_pasteHandler","prefix.click":"_prefixClick","suffix.click":"_suffixClick","dropDownButton.down":"_dropDownButtonDownHandler","inputContainer.down":"_downHandler","document.up":"_documentUpHandler"}}_prefixClick(e){const t=this;if(t.onAffixClick)if("string"==typeof t.onAffixClick){const o=t.onAffixClick.replace("()","");window[o]&&window[o].apply(t,e)}else t.onAffixClick(e)}_suffixClick(e){const t=this;if("string"==typeof t.onAffixClick){const o=t.onAffixClick.replace("()","");window[o]&&window[o].apply(t,e)}else t.onAffixClick(e)}get selectedIndexes(){return this.isCompleted?[this.selectedIndex]:[]}set selectedIndexes(e){if(!this.isCompleted)return;const t=this;if(e&&void 0!==e[0]){if(this.selectedIndex=e[0],null===this.dataSource)return;const o=this.dataSource[this.selectedIndex];if(!o)return;const l=this.context;this.context=this,this.$.input.dataValue=this.selectedValue="string"==typeof o?o:o.value,this.setAttribute("data-value",this.$.input.dataValue);let a=t.dataSource;"string"==typeof a&&(a=t.$.deserialize(a,"array"));for(let e=0;e<a.length;e++){let o=a[e];"string"!=typeof o&&"number"!=typeof o&&(o.value===t.$.input.dataValue?o.selected=!0:o.selected=!1)}this.context=l}else{const e=this.context;this.context=this,this.$.input.dataValue=this.selectedValue="",this.setAttribute("data-value",this.$.input.dataValue),this.selectedIndex=-1;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),o&&Array.isArray(o))for(let e=0;e<o.length;e++){let l=o[e];"string"!=typeof l&&(l.value===t.$.input.dataValue?l.selected=!0:l.selected=!1)}this.context=e}}focus(){this.$.input.focus()}select(){const e=this;e.readonly?e.$.input.focus():e.$.input.select()}_documentUpHandler(e){const t=this,o=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;o!==t&&o!==t.$.dropDownButton&&o!==t.$.input&&o!==t.$.arrow?t.$.scrollView.contains(o.shadowParent||o)?t._isPointerDown&&(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),t.$.input.focus()):(t.opened&&(t._preventLookup=!0),"manual"===t.dropDownOpenMode||t._isPointerDown||t.close(),t._isPointerDown=!1):t._isPointerDown=!1}_focusHandler(){const e=this;e.setAttribute("focus",""),e.readonly||0!==e.minLength||0!==e.$.input.value.length||e._preventLookup?(e.$.fireEvent("focus"),delete e._preventLookup):e._lookup()}_blurHandler(){const e=this;e.opened||e.removeAttribute("focus"),e.opened||e.$.fireEvent("blur"),e._refreshSelectedIndex(),delete e._preventLookup}_pasteHandler(e){const t=this,o=t.$.input,l=o.value,a=o.selectionStart,r=o.selectionEnd;if(!e.clipboardData&&!window.clipboardData)return;if(t.disabled)return;const i=(e.clipboardData||window.clipboardData).getData("text");let n=l.slice(0,a)+i;n.length,n+=l.slice(r),t.setAttribute("data-value",n),t._refreshSelectedIndex()}_refreshSelectedIndex(){const e=this;let t=e.dataSource;if(t){let o=-1,l=null;if(e.dataSource instanceof Promise)return;if("function"==typeof e.dataSource)return;"string"==typeof t&&(t=e.$.deserialize(t,"array"));for(let a=0;a<t.length;a++){let r=t[a];if("number"!=typeof r&&"boolean"!=typeof r||(r=""+r),"string"==typeof r){if(r===e.value){o=a,l=e.value;break}}else r&&(delete r.selected,r.label===e.value&&(o=a,l=r.value,r.selected=!0))}e.set("selectedIndex",o,!1),e.set("selectedValue",l,!1),-1===e.selectedIndex&&(e.$.input.dataValue=null)}}selectItem(e){const t=this;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),o)for(let l=0;l<o.length;l++){const a=o[l];if(t.set("selectedIndex",-1),t.set("value",""),t.$.input.dataValue=null,"string"==typeof a){if(a===e)return t.set("selectedIndex",l,!1),t.set("value",t.$.input.dataValue=e),void t.setAttribute("data-value",t.$.input.dataValue)}else if(a.value===e)return t.set("selectedIndex",l,!1),t.set("value",a.label),t.$.input.dataValue=e,void t.setAttribute("data-value",t.$.input.dataValue)}else t.set("value",t.$.input.dataValue=e),t.setAttribute("data-value",t.$.input.dataValue),t.set("selectedIndex",-1,!1)}getItem(e){const t=this;if(t.dataSource)for(let o=0;o<t.dataSource.length;o++){const l=t.dataSource[o];if(l.value===e)return l}return null}getPrevItem(){const e=this,t=e.getSelectedItem();if(e.dataSource&&t)for(let o=0;o<e.dataSource.length;o++)if(e.dataSource[o].value===t.value)return e.dataSource[o-1];return null}getNextItem(){const e=this,t=e.getSelectedItem();if(e.dataSource&&t)for(let o=0;o<e.dataSource.length;o++)if(e.dataSource[o].value===t.value)return e.dataSource[o+1];return null}getSelectedItem(){const e=this;return e.dataSource&&0===e.dataSource.length?{label:e.value,value:e.$.input.dataValue?e.$.input.dataValue:e.value}:{label:e.value,value:void 0!==e.$.input.dataValue?e.$.input.dataValue:e.value}}_refreshMenu(){const e=this;e.$.menu.classList.remove("scroll"),e.$.scrollView.computedVerticalScrollBarVisibility&&e.$.menu.classList.add("scroll")}_fromHTMLEntities(e){const t=this,o=t._textArea?t._textArea:document.createElement("textarea");return o.innerHTML=e,t._textArea=o,o.value}_performSelect(){const e=this,t=e.$.menu.querySelector(".active");let o="",l="";t&&(o=t.getAttribute("data-label"),o=e._fromHTMLEntities(o),l=t.dataValue);let a=e.value,r=e.$.input.dataValue;e.set("value",o),e.$.input.dataValue=l,e.setAttribute("data-value",l),t&&e.set("selectedIndex",t.index),e.set("selectedValues",[e.$.input.dataValue]),e.set("selectedValue",e.$.input.dataValue);let i=e.dataSource;if("string"==typeof i&&(i=e.$.deserialize(i,"array")),i&&Array.isArray(i))for(let t=0;t<i.length;t++){let o=i[t];"string"!=typeof o&&"number"!=typeof o&&(o.value===e.$.input.dataValue?o.selected=!0:o.selected=!1)}e.close(),o===a&&l===r||(e.$.fireEvent("change",{value:l,label:o,oldValue:r,oldLabel:a}),e._updateTargetValue())}_open(){const e=this;if(e.opened)return;const t=window.scrollX,o=window.scrollY;let l=e.getBoundingClientRect(),a=0,r=0;if(e.timer&&clearTimeout(e.timer),e.getRootNode()&&e.getRootNode().host)e.getRootNode().host.shadowRoot.appendChild(e.$.scrollView);else if(e.dropDownAppendTo){if("body"===e.dropDownAppendTo||e.dropDownAppendTo===document.body)document.body.appendChild(e.$.scrollView);else if(e.dropDownAppendTo instanceof HTMLElement)e.dropDownAppendTo.appendChild(e.$.scrollView);else if("string"==typeof dropDownAppendTo){let t=document.getElementById(e.dropDownAppendTo);t instanceof HTMLElement?t.appendChild(e.$.scrollView):document.body.appendChild(e.$.scrollView)}}else document.body.appendChild(e.$.scrollView);if(e.setAttribute("aria-owns",e.$.scrollView.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.scrollView.id),e.$.scrollView.enableShadowDOM&&!e._importedStyle&&(e.$.scrollView.importStyle(e._getStyleUrl("smart.textbox.css")),e._importedStyle=!0),"static"!==getComputedStyle(document.body).position){const e=document.body.getBoundingClientRect();a=e.left,r=e.top}if(e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.style.left=-3+l.left+t-a+"px",e.$.scrollView.classList.remove("open"),e.$.scrollView.removeAttribute("top"),"bottom"===e.dropDownOpenPosition)e.$.scrollView.style.top=l.bottom+o-r+1+"px";else if("top"===e.dropDownOpenPosition)e.$.scrollView.style.top=l.top-e.$.scrollView.offsetHeight+o-r-2+"px",e.$.scrollView.setAttribute("top","");else if("auto"===e.dropDownOpenPosition){e.$.scrollView.style.top=l.bottom+o-r+1+"px";const t=l.top-e.$.scrollView.offsetHeight+o-r-2;window.innerHeight<parseInt(e.$.scrollView.style.top)+e.$.scrollView.offsetHeight-o?t>=0&&(e.$.scrollView.style.top=t+"px",e.$.scrollView.setAttribute("top","")):e.$.scrollView.style.top=l.bottom+o-r+1+"px"}if(e.dropDownAppendTo&&"body"!==e.dropDownAppendTo){e.$.scrollView.style.position="absolute",e.$.scrollView.style.width="auto",e.$.scrollView.style.height="auto";const t=e.$.scrollView.parentNode.getBoundingClientRect();e.$.scrollView.style.top=l.bottom-t.top+"px","top"===e.dropDownOpenPosition&&(e.$.scrollView.style.top=l.top-t.top-e.$.scrollView.offsetHeight+"px"),e.$.scrollView.style.left=-3+l.left-t.left+"px",e.dropDownHeight&&(e.$.scrollView.style.height=e.dropDownHeight),e.dropDownWidth&&(e.$.scrollView.style.width=e.dropDownWidth)}e.opening=!0,e._positionTimer&&clearInterval(e._positionTimer),e.dropDownAppendTo||(e._positionTimer=setInterval((()=>{const t=e.getBoundingClientRect();if(e.opening)e.opening=!1,l=t;else if(Math.abs(parseInt(t.top)-parseInt(l.top))>=10||Math.abs(parseInt(t.left)-parseInt(l.left))>=10){const o=window.scrollX,l=window.scrollY;return e.$.scrollView.style.left=-3+t.left+o-a+"px",void("bottom"===e.dropDownOpenPosition?e.$.scrollView.style.top=t.bottom+l-r+1+"px":"top"===e.dropDownOpenPosition?e.$.scrollView.style.top=t.top-e.$.scrollView.offsetHeight+l-r+1+"px":"auto"===e.dropDownOpenPosition&&(e.$.scrollView.removeAttribute("top"),e.$.scrollView.style.top=t.bottom+l-r+1+"px",window.innerHeight<parseInt(e.$.scrollView.style.top)+e.$.scrollView.offsetHeight-l?(e.$.scrollView.style.top=t.top-e.$.scrollView.offsetHeight+l-r+1+"px",e.$.scrollView.setAttribute("top","")):e.$.scrollView.style.top=t.bottom+l-r+1+"px"))}}),50)),e.$.scrollView.onpointerdown=function(t){e._isPointerDown=!0,t.stopPropagation(),t.preventDefault()},requestAnimationFrame((function(){const o=e.dropDownWidth;if(e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.$.scrollView.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open",""),o&&"string"==typeof o&&-1!==o.indexOf("%")){const t=parseFloat(o)/100;e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",e.offsetWidth*t+"px")}else if("auto"!==o&&o)e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",parseFloat(o)+"px");else if("auto"===o){if(e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.$.scrollViewerContainer.classList.contains("vscroll")){const t=e.$.scrollView.offsetWidth+parseFloat(getComputedStyle(e.$.scrollView).getPropertyValue("--smart-scroll-bar-size"));e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",t+"px")}}else{e.$.menu.style.width="auto";let t=e.$.menu.offsetWidth;const o=e.$.menu.querySelectorAll("li");for(let t=0;t<o.length;t++)e._maxDropDownWidth=Math.max((o[t].firstElementChild||o[t]).offsetWidth,e._maxDropDownWidth);e.$.scrollView.computedVerticalScrollBarVisibility&&(t+=e.$.scrollView.$&&e.$.scrollView.$.verticalScrollBar?e.$.scrollView.$.verticalScrollBar.offsetWidth:30),e.$.scrollView.style.setProperty("--smart-input-drop-down-menu-width",Math.max(t,e.offsetWidth-8)+"px"),e.$.menu.style.width=""}const r=parseInt(e.$.scrollView.style.left),i=e.$.scrollView.offsetWidth;r+i>document.body.offsetWidth&&(e.$.scrollView.style.left=-3+l.right+t-a-i+"px"),(e.shadowRoot||e.isInShadowDOM)&&e.$.scrollView._scrollView&&Smart.ScrollBar&&requestAnimationFrame((()=>{e.$.scrollView._scrollView&&e.$.scrollView._scrollView.vScrollBar.refresh()}))})),e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.set("opened",!0),e.setAttribute("aria-expanded",!0),e.$.fireEvent("open")}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.scrollView.parentNode&&!e.opened&&(e.$.scrollView.remove(),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e._positionTimer&&clearInterval(e._positionTimer),e.$.scrollView.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.set("opened",!1),e.setAttribute("aria-expanded",!1),e.$.input.focus(),e.$.fireEvent("close"),!0)}refresh(){const e=this;e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._getDataSourceFromOption(),e.close()}_lookup(e){const t=this;t.query=t.$.input.value;const o=t.context;if(t.context=t,t.selectedIndex=-1,t.selectedValue=null,t.context=o,t.$.input.readonly&&(t._incrementalSearchQuery||(t._incrementalSearchQuery=""),t._incrementalSearchQuery+=e.key,t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t.query=t._incrementalSearchQuery,t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),700)),t.query.length<t.minLength)return void t.close();const l=function(e){clearTimeout(t._autoCompleteTimeout),t._autoCompleteTimeout=setTimeout((()=>{const o=t.context;t.context=t,t._process(e),t.context=o}),t.autoCompleteDelay)};"function"==typeof t.dataSource?t.dataSource(t.query,l):l(t.dataSource)}_downHandler(e){const t=this;t.readonly&&t._dropDownButtonDownHandler(e)}_dropDownButtonDownHandler(e){const t=this;return"manual"!==t.dropDownOpenMode&&(t._toggle(),t.focus()),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),t._isPointerDown=!0,!1}_toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this;function t(t){e._process(t);const o=e.$.menu.querySelector(".active");if(o){const t=e.$.input.dataValue;for(let l=0;l<e.$.menu.children.length;l++){const a=e.$.menu.children[l],r=a.getAttribute("data-label"),i=a.dataValue;if(void 0!==t&&i===t||void 0===t&&r===e.$.input.value){o.classList.remove("active"),a.classList.add("active"),e._setActiveDescendant(a),e.$.input.dataValue=i,e.setAttribute("data-value",i);break}}}e.ensureVisible(),e.$.input.focus(),setTimeout((function(){e.$.input.focus()}),25)}e.dropDownDataSource&&(Array.isArray(e.dropDownDataSource)&&e.dropDownDataSource.length>0||"function"==typeof e.dropDownDataSource)?(e.query="","function"==typeof e.dropDownDataSource?e.dropDownDataSource(e.query,t):t(e.dropDownDataSource)):(e.query="","function"==typeof e.dataSource?e.dataSource(e.query,t):t(e.dataSource))}_process(e){const t=this;"string"==typeof e&&(e=t.$.deserialize(e,"array")),t.readonly,e=e.filter((function(e){return""===e||(t.matcher?t.matcher(e):t._matcher(e))})),e=t._sorter(e),t.sorted&&(e.sort(((e,t)=>void 0!==e.label?e.label.localeCompare(t.label):e.localeCompare(t))),"desc"===t.sortDirection&&e.reverse()),!e.length&&t.opened&&""===t.dropDownPlaceholder&&t.close(),0===e.length&&!0!==t.allowItemsAdd&&""===t.dropDownPlaceholder||(t.query.length>0?t.readonly?t._render(e):t._render(e.slice(0,t.items)):t._render(e),t._open(),t.$.scrollView.refresh&&t.$.scrollView.refresh(),t._refreshMenu(),t.ensureVisible())}_matcher(e){const t=this.query;switch(null===e&&(e="null"),e=""+(e=e.label||e),this.queryMode){case"startsWith":return e.startsWith(t);case"startsWithIgnoreCase":return e.toLowerCase().startsWith(t.toLowerCase());case"doesNotContain":return e.indexOf(t)<0;case"doesNotContainIgnoreCase":return e.toLowerCase().indexOf(t.toLowerCase())<0;case"contains":return e.indexOf(t)>-1;default:case"containsIgnoreCase":return~e.toLowerCase().indexOf(t.toLowerCase());case"equals":return 0===e.localeCompare(t);case"equalsIgnoreCase":return 0===e.toLowerCase().localeCompare(t.toLowerCase());case"endsWith":return e.endsWith(t);case"endsWithIgnoreCase":return e.toLowerCase().endsWith(t.toLowerCase())}}_sorter(e){const t=this;let o,l=[],a=[],r=[];if(e&&""===e[0])return e;for(;o=e.shift();){let e=o.label||o;e=""+e,e.toLowerCase().indexOf(t.query.toLowerCase())?~e.indexOf(t.query)?a.push(o):r.push(o):l.push(o)}return l.concat(a,r)}_highlighter(e){const t=this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&");return this.query?e.replace(new RegExp("("+t+")","ig"),(function(e,t){return"<strong>"+t+"</strong>"})):e}_render(e){const t=this;let o=0,l=-1,a=null;const r=e.map((function(e){let r=e,i=e;"object"==typeof e&&(r=e.label,i=void 0!==e.value?e.value:r),r=""+r,r=r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;");const n=document.createElement("li"),s=document.createElement("a");if(s.href="javascript:void(0)",n.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),n.setAttribute("data-label",r),n.index=o++,n.dataValue=i,"string"==typeof i?n.setAttribute("value",i):n.setAttribute("value",JSON.stringify(i)),n.setAttribute("role","option"),n.setAttribute("aria-label",r),void 0!==e.menuLabel?(r=e.menuLabel,s.innerHTML=r):s.innerHTML=t.highlighter?t.highlighter(r):t._highlighter(r),s.setAttribute("aria-hidden",!0),e.disabled&&n.classList.add("smart-disabled"),void 0!==e.visible&&!1===e.visible&&n.classList.add("smart-hidden"),e.icon&&(s.classList.add("icon"),s.classList.add(e.icon)),e.prefix){const t=document.createElement("span");t.innerHTML=e.prefix,s.classList.add("has-prefix"),s.innerHTML=t.innerHTML+s.innerHTML}if(e.suffix){const t=document.createElement("span");t.innerHTML=e.suffix,s.classList.add("has-suffix"),s.innerHTML=s.innerHTML+t.innerHTML}if(e.dataset)for(let t in e.dataset)n.setAttribute("data-"+t,e.dataset[t]);if(e.className){const t=e.className.split(" ");for(let e=0;e<t.length;e++)n.classList.add(t[e].trim())}return void 0!==t.selectedValue&&void 0!==e.value&&""!==t.selectedValue&&t.selectedValue===e.value&&(e.selected=!0,a=e,l=n.index,n.classList.add("active")),n.appendChild(s),n}));function i(){const e=t.$.menu.getElementsByClassName("active");e[0]&&e[0].classList.remove("active"),this.classList.add("active"),t._setActiveDescendant(this)}-1===l&&r.length>0&&(r[0].classList.add("active"),t._setActiveDescendant(r[0])),a&&(t.$.input.value=a.label,t.$.input.dataValue=a.value,t.setAttribute("data-value",t.$.input.dataValue)),t.$.menu.innerHTML="",0===r.length&&t.dropDownPlaceholder&&(t.$.menu.innerHTML='<div class="smart-flex smart-truncate smart-quiet" style="padding:10px; align-items: center;">'+t.dropDownPlaceholder+"</div>");for(let e=0;e<r.length;e++){const o=r[e];t.$.menu.appendChild(o),o.onmouseenter=i,o.onmouseleave=function(){this.classList.remove("active"),t._setActiveDescendant(null)},o.onclick=i}}ensureVisible(){const e=this,t=e.$.menu.querySelector(".active");t&&(t.offsetTop+t.offsetHeight>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight&&(e.$.scrollView.scrollTop=t.offsetTop+t.offsetHeight),(t.offsetTop<=e.$.scrollView.scrollTop||t.offsetTop>=e.$.scrollView.scrollTop+e.$.scrollView.offsetHeight)&&(e.$.scrollView.scrollTop=t.offsetTop),0===[...e.$.menu.children].indexOf(t)?e.$.scrollView.scrollTop=0:[...e.$.menu.children].indexOf(t)===e.$.menu.children.length-1&&(e.$.scrollView.scrollTop=e.$.scrollView.scrollHeight))}_next(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let o=t.nextElementSibling;o||(o=e.$.menu.firstElementChild),o.classList.add("active"),e._setActiveDescendant(o),e.ensureVisible()}_prev(){const e=this,t=e.$.menu.querySelector(".active");if(!t){const t=e.$.menu.firstElementChild;return t.classList.add("active"),void e._setActiveDescendant(t)}t.classList.remove("active");let o=t.previousElementSibling;o||(o=e.$.menu.lastElementChild),o.classList.add("active"),e._setActiveDescendant(o),e.ensureVisible()}_move(e){const t=this;if(t.readonly&&!t.opened){if("ArrowUp"===e.key){const o=t.getPrevItem();o&&t.selectItem(o.value),e.preventDefault()}if("ArrowDown"===e.key){const o=t.getNextItem();o&&t.selectItem(o.value),e.preventDefault()}}if(t.opened){switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),t._prev();break;case 40:e.preventDefault(),t._next()}e.stopPropagation()}}_keyDownHandler(e){const t=this;if(t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),t._oldValue=t.$.input.value,!(e.shiftKey||e.altKey||e.ctrlKey))return t.opened&&"Escape"===e.key?(t.close(),e.stopPropagation(),void e.preventDefault()):void t._move(e)}_keyPressHandler(e){this._suppressKeyPressRepeat||e.shiftKey||e.altKey||e.ctrlKey||this._move(e)}_keyUpHandler(e){const t=this;if(!(e.shiftKey||"F2"===e.key||"a"===e.key&&e.ctrlKey))switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return;if(!t.readonly&&!t.$.menu.querySelector(".active")){const o=t.$.input.value;return t._performSelect(),t.value=t.$.input.value=o,e.stopPropagation(),void e.preventDefault()}t._performSelect(),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookupTimer&&clearTimeout(t._lookupTimer),t._lookupTimer=setTimeout((()=>{if(t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault()),t.$.fireEvent("changing",{value:t.$.input.value,oldValue:t._oldValue}),t.dataSource&&t.dataSource.length&&"function"!=typeof t.dataSource)for(let e=0;e<t.dataSource.length;e++){const o=t.dataSource[e];if("string"==typeof o){if(o===t.$.input.value){t.$.input.dataValue=t.$.input.value,t.setAttribute("data-value",t.$.input.dataValue);break}}else if(void 0!==o.label&&o.label===t.$.input.value){t.$.input.dataValue=o.value,t.setAttribute("data-value",o.value);break}}else t.$.input.dataValue=t.$.input.value,t.setAttribute("data-value",t.$.input.dataValue);t._updateTargetValue()}),300)}}clearValue(){const e=this;e.$.input.value="",e.$.input.dataValue="",e.removeAttribute("data-value"),e.set("value",""),e.set("selectedIndex",-1),e.set("selectedValues",[e.$.input.dataValue]),e.set("selectedValue",e.$.input.dataValue)}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const l=this;if("innerHTML"===e&&(l._getDataSourceFromOption(),l._setSelection(!1)),"selectedValue"===e){let e=-1;if(l.dataSource&&Array.isArray(l.dataSource)&&l.dataSource.forEach(((t,l)=>{"string"==typeof t?t===o&&(e=l):t&&t.value===o&&(e=l)})),e>=0){const t=l.context;l.context=l,l.selectedIndex=e,l.context=t}l._setSelection()}if("selectedIndex"===e){let e=l.dataSource;if(l.selectedValue=null,e&&Array.isArray(e))for(let t=0;t<e.length;t++){let o=e[t];"string"!=typeof o&&"number"!=typeof o&&(o.selected=!1)}l._setSelection()}else if("dataSource"===e){if(l.dataSource&&Array.isArray(l.dataSource)){let e=-1;if(l.dataSource.forEach(((t,o)=>{t.selected&&(e=o)})),e>=0){const t=l.context;l.context=l,l.selectedIndex=e,l.context=t}}l._setSelection(!1)}else if("dropDownClassList"===e){const e=l.$.scrollView;for(let o=0,l=t.length;o<l;o+=1)e.classList.remove(t[o]);for(let t=0,l=o.length;t<l;t+=1)e.classList.add(o[t])}else if("dropDownHeight"===e)"auto"!==l.dropDownHeight?l.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height",l.dropDownHeight+"px"):l.$.scrollView.style.setProperty("--smart-input-drop-down-menu-height","auto");else if("opened"===e)l.opened=t,o?l.open():l.close();else if("placeholder"===e){if(l.readonly){const e=l.getAttribute("aria-label");if(e&&e!==t)return;o?l.setAttribute("aria-label",o):l.removeAttribute("aria-label")}}else if("selectedValues"===e)if(null===o)l.$.input.value="",l.$.input.dataValue=o,l.setAttribute("data-value",o),l._refreshSelectedIndex();else{const e=o.join(","),t=l.value;if(l.$.input.dataValue=e,e&&-1===e.indexOf(",")){let e=-1,t=o[0];if(l.dataSource&&Array.isArray(l.dataSource)&&l.dataSource.forEach(((l,a)=>{"string"==typeof l?l!==o&&l!==t||(e=a):l&&l.value===t&&(e=a)})),e>=0){const t=l.context;l.context=l,l.selectedIndex=e,l.context=t}}l._setSelection(),l.propertyChangedHandler("value",t,l.value)}else"value"===e?(l.displayMember!==l.valueMember&&"string"!=typeof o?(l.set("value",o[l.displayMember]),l.$.input.dataValue=o[l.valueMember],l.setAttribute("data-value",l.$.input.dataValue)):(l.$.input.value=l.$.input.dataValue=o,l.setAttribute("data-value",o)),l._refreshSelectedIndex()):"readonly"===e?(l._setAriaRelations(),l._setInputPurpose()):"theme"===e||"rightToLeft"===e?l.$.scrollView[e]=o:"inputPurpose"===e?l._setInputPurpose():"inverted"===e?o?l.$.scrollView.setAttribute("inverted",""):l.$.scrollView.removeAttribute("inverted"):"disabled"!==e&&"unfocusable"!==e||l._setFocusable()}_updateTargetValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const o=e.dataset.property,l=e.value;o&&void 0!==t[o]&&(t[o]=l)}}}detached(){super.detached(),this.close(),this.removeAttribute("focus")}_getDataSourceFromOption(){const e=this;if(e.innerHTML.indexOf("<option")>=0){e.$.optionsContainer.innerHTML=e.innerHTML.trim();const t=e.querySelectorAll("option");let o=[];for(let e=0;e<t.length;e++){const l=t[e],a=l.hasAttribute("selected")||l.hasAttribute("is-selected")&&"false"!==l.getAttribute("is-selected");let r=(""+l.textContent).trim();const i=(""+l.innerHTML).trim(),n=l.hasAttribute("value")?l.getAttribute("value"):r,s=l.hasAttribute("disabled"),u=l.hasAttribute("label")?l.getAttribute("label"):null;u&&(r=u),o.push({label:r,menuLabel:i,value:n,disabled:s,selected:a,className:l.className,dataset:l.dataset}),l.classList.add("smart-hidden")}e.dataSource=o}}render(){const e=this,t=e.dropDownClassList;if(e._getDataSourceFromOption(),e.selectedValues&&e.selectedValues.length){const t=e.selectedValues.join(",");e.value=t}e._createElement&&e._createElement();const o=e.$.scrollView;for(let e=0,l=t.length;e<l;e+=1)o.classList.add(t[e]);e.opened&&(e.opened=!1,e.open());const l=e.$.menu;l&&(l.setAttribute("role","presentation"),o.appendChild(l)),"auto"!==e.dropDownHeight?o.style.setProperty("--smart-input-drop-down-menu-height",e.dropDownHeight+"px"):o.style.setProperty("--smart-input-drop-down-menu-height","auto"),o.classList.add("smart-input-drop-down-menu");for(let t=0;t<e.classList.length;t++){const l=e.classList[t];"smart-element"!==l&&"smart-input"!==l&&o.classList.add(l+"-drop-down-menu")}o.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),o.ownerElement=e;let a=e.dataSource;if("string"==typeof a&&(a=e.$.deserialize(a,"array")),a&&a.length&&Array.isArray(a)){let t=-1;if(a.forEach(((e,o)=>{e.selected&&(t=o)})),t>=0){e.selectedIndex=t;const o=a[t];e.selectedValue="string"==typeof o?a[t]:a[t].value}}e._setAriaRelations(),e._setInputPurpose(),e._setSelection(),e.isInitialized=!0,e.hasAttribute("tabindex")&&(e.readonly||(e.$.input.setAttribute("tabindex",e.getAttribute("tabindex")),e.removeAttribute("tabindex"))),super.render()}_setSelection(e){const t=this;let o=t.dataSource;if("string"==typeof o&&(o=t.$.deserialize(o,"array")),t.selectedIndex>=0&&o&&o.length>0){let l=o[t.selectedIndex];if("number"!=typeof l&&"boolean"!=typeof l||(l=""+l),"string"==typeof l){let o=t.$.input.dataValue,a=t.value;t.set("value",l),t.$.input.dataValue=l,t.$.input.setAttribute("data-value",l),t.selectedValues=[t.$.input.dataValue],t.isInitialized&&!1!==e&&(t.$.fireEvent("change",{value:t.value,label:t.label,oldValue:o,oldLabel:a}),t._updateTargetValue())}else{let o=t.$.input.dataValue,a=t.value;l&&(void 0!==l.value?(t.set("value",void 0!==l.value?l.value+"":""),t.$.input.dataValue=l.value,t.$.input.setAttribute("data-value",l.value),t.selectedValues=[t.$.input.dataValue]):l.label&&(t.selectedValues=[l.value]),l.label&&t.set("value",l.label)),t.isInitialized&&!1!==e&&(t.$.fireEvent("change",{value:t.$.input.dataValue,label:l.value,oldValue:o,oldLabel:a}),t._updateTargetValue())}}}_createElement(){const e=this,t=document.createElement("ul"),o=document.createElement("smart-scroll-viewer");o.rightToLeft=e.rightToLeft,o.theme=e.theme,o.horizontalScrollBarVisibility="hidden",e.inverted?o.setAttribute("inverted",""):o.removeAttribute("inverted"),e.$.scrollView=o,e.$.menu=t,e._setFocusable();const l=e.$.input;e.$.menu.onpointerdown=function(t){const o=t.target.closest("li"),a=e.$.menu.querySelector(".active");a&&o&&(a.classList.remove("active"),o.classList.add("active")),t.stopPropagation(),t.preventDefault(),setTimeout((()=>{e._performSelect(),o&&o.parentNode&&e.$.fireEvent("itemClick",{index:[...o.parentNode.children].indexOf(o),item:o,label:o.getAttribute("aria-label"),value:o.dataValue}),l.focus()}),50)},e.$.menu.onpointerup=function(t){t.stopPropagation(),t.preventDefault(),e.$.scrollView.$.verticalScrollBar.thumbCapture&&(e.$.scrollView.$.verticalScrollBar.thumbCapture=!1)}}_setAriaRelations(){const e=this,t=e.getAttribute("aria-label");e.readonly?(e.setAttribute("role","button"),!t&&e.placeholder&&e.setAttribute("aria-label",e.placeholder),e.removeAttribute("aria-readonly"),e.$.input.removeAttribute("aria-activedescendant"),e.$.input.removeAttribute("aria-controls"),e.$.dropDownButton.setAttribute("aria-hidden",!0)):(e.setAttribute("role","combobox"),t&&t===e.placeholder&&e.removeAttribute("aria-label"),e.$.input.setAttribute("role","searchbox"),e.$.input.removeAttribute("aria-hidden",!0),e.$.dropDownButton.removeAttribute("aria-hidden")),e.setAttribute("aria-expanded",e.opened),e.setAttribute("aria-haspopup","listbox"),e.setAttribute("aria-owns",e.$.scrollView.id),e.$.scrollView.setAttribute("role","listbox")}_setActiveDescendant(e){const t=this;t.readonly||(e?t.setAttribute("aria-activedescendant",e.id):t.removeAttribute("aria-activedescendant"))}_setInputPurpose(){const e=this;e.readonly?e.$.input.removeAttribute("autocomplete"):e.$.input.setAttribute("autocomplete",e.inputPurpose)}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.$.input.setAttribute("tabindex",-1):e.$.input.removeAttribute("tabindex")}});

/***/ }),

/***/ 7498:
/***/ (() => {

Smart("smart-kanban",class extends Smart.DataView{static get properties(){return{addNewButton:{value:!1,type:"boolean"},addNewButtonDisplayMode:{value:"top",allowedValues:["top","bottom","both"],type:"string"},addNewColumn:{value:!1,type:"boolean"},autoColumnHeight:{value:!1,type:"boolean"},applyColumnColorToTasks:{value:!1,type:"boolean"},addNewColumnWidth:{value:null,type:"any"},allowColumnEdit:{value:!1,type:"boolean"},allowColumnHide:{value:!0,type:"boolean"},allowColumnRemove:{value:!1,type:"boolean"},allowColumnReorder:{value:!1,type:"boolean"},allowCustomTags:{value:!0,type:"boolean"},allowDrag:{value:!0,type:"boolean",defaultReflectToAttribute:!0},allowDrop:{value:!0,type:"boolean",defaultReflectToAttribute:!0},allowDropPlaceholder:{value:!1,type:"boolean",defaultReflectToAttribute:!0},autoLoadState:{value:!1,type:"boolean"},autoSaveState:{value:!1,type:"boolean"},cardHeight:{value:null,type:"number?"},currentUser:{value:null,type:"any"},columnColorEntireSurface:{value:!1,type:"boolean"},columnFooter:{value:!1,type:"boolean"},columnActions:{value:!1,type:"boolean"},columnColors:{value:!1,type:"boolean"},columnWidth:{value:null,type:"any"},columnSummary:{value:!1,type:"boolean"},columnEditMode:{value:"headerAndMenu",allowedValues:["header","menu","headerAndMenu"],type:"string"},columnHeaderTemplate:{value:null,type:"any"},disableDialog:{value:!1,type:"boolean"},disableAddNewDialog:{value:!1,type:"boolean"},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},editable:{value:!1,type:"boolean"},editMode:{value:"doubleClick",allowedValues:["singleClick","doubleClick"],type:"string"},dragOffset:{value:"auto",type:"any"},formatStringDate:{value:"d",type:"string"},formatStringTime:{value:"MMM d, HH:mm",type:"string"},hierarchy:{value:"columns",allowedValues:["columns","tabs"],type:"string"},messages:{value:{en:{actionsIcon:"Actions icon",actionsList:"Open actions list",unassignedTask:"Unassigned task",unassigned:"unassigned",assignedTask:"Assigned to {{userName}}",addNewStatus:"New status",addNewColumn:"Add new status",addNewTask:"Add new task",addSubtask:"Add subtask",assignedTo:"Assigned to",createdBy:"Created by",updatedBy:"Updated by",createdByDate:"Created",updatedByDate:"Updated",checklist:"Sub tasks",color:"Color",commentsIcon:"Comments icon",copy:"Copy",customize:"Customize tasks",customizeColumn:"Customize column",dueDate:"Due date",days:"days",edit:"Edit",editTask:"ID: {{taskId}} {{text}}",expand:"Expand column",collapse:"Collapse column",high:"High",low:"Low",critical:"Critical",newComment:"New comment",newSubtask:"New subtask",overdue:"Overdue",average:"Average",priority:"Priority",priorityIcon:"Priority icon",progress:"Progress",promptComment:"Are you sure you want to remove this comment?",promptTask:'Are you sure you want to remove the task "{{taskText}}"?',promptColumn:"Are you sure you want to remove this column?",remove:"Remove",removeSubtask:"Remove subtask",removeColumn:"Remove column",hideColumn:"Hide column",removeComment:"Remove comment",removeTask:"Remove task",showAllColumns:"Show all columns",send:"Send",startDate:"Start date",status:"Status",swimlane:"Swimlane",tags:"Tags",text:"Name",textPlaceholder:"Write a task name",description:"Description",taskProgress:"Task progress: {{value}}%",taskDescription:"Task description: {{value}}",taskCompleted:"Tasks completed: {{value}}/{{count}}",tasksSummary:"{{summary}} tasks",tasksSummaryOne:"1 task",userId:"User ID",userIcon:"User icon",guestUser:"Guest",detailsTab:"Details",commentsTab:"Comments",fieldsTab:"Fields",historyTab:"History",subtasksTab:"Subtasks",historyEvent:"Event",historyAuthor:"Author",historyDetails:"Details",range:'From "{{oldValue}}" to "{{newValue}}"',nullRange:'Changed to "{{newValue}}"',invalidRange:'"{{start}}" should be less than "{{end}}"',historyDate:"Date",ok:"ok",cancel:"Cancel",delete:"Delete",taskDeadlineChanged:"Deadline changed",tagsChanged:"Tags changed",taskMoved:"Task moved",taskUpdated:"Task updated",taskCreated:"Task created",taskUserChanged:"Assignee changed",taskUserRemoved:"Assignee removed",taskDescriptionChanged:"Description changed",taskSubtasksChanged:"Subtasks changed",taskProgressChanged:"Progress changed",taskPriorityChanged:"Priority changed",taskSubtasksCompleted:"Completed {{value}}",taskStatusChanged:"Status changed",taskTagsChanged:"Tags changed",taskNameChanged:"Name changed",taskColorChanged:"Color changed",empty:"No tasks",emptyTags:"No tags available",emptyImage:"No image to display",emptyAttachment:"No attachment to display"}}},onColumnHeaderRender:{value:null,type:"any",reflectToAttribute:!1},onColumnFooterRender:{value:null,type:"any",reflectToAttribute:!1},onTaskRender:{value:null,type:"any",reflectToAttribute:!1},onSortPrepare:{value:null,type:"any",reflectToAttribute:!1},onFilterPrepare:{value:null,type:"any",reflectToAttribute:!1},priority:{value:[],type:"array",reflectToAttribute:!1},priorityList:{value:!0,type:"boolean"},readonly:{value:!1,type:"boolean"},selectionMode:{value:"zeroOrOne",allowedValues:["zeroOrOne","zeroOrManyExtended"],type:"string"},storeHistory:{value:!0,type:"boolean"},storeHistoryItems:{value:20,type:"number"},swimlanes:{value:[],type:"array",reflectToAttribute:!1},swimlanesFrom:{value:0,type:"number"},swimlanesTo:{value:null,type:"number?"},tags:{value:[],type:"array"},taskActions:{value:!1,type:"boolean"},taskActionsRendered:{value:null,type:"any"},taskComments:{value:!1,type:"boolean"},taskDue:{value:!1,type:"boolean"},taskPosition:{value:"all",allowedValues:["all","leaf"],type:"string"},taskPriority:{value:!0,type:"boolean",defaultReflectToAttribute:!0},taskProgress:{value:!1,type:"boolean"},taskTags:{value:!0,type:"boolean",defaultReflectToAttribute:!0},taskSubTasks:{allowedValues:["none","onePerRow","onlyUnfinished"],value:"none",type:"string"},taskSubTasksInput:{value:!0,type:"boolean"},taskUserIcon:{value:!0,type:"boolean",defaultReflectToAttribute:!0},taskCustomFields:{value:[],type:"array",reflectToAttribute:!1},taskCustomFieldsHide:{value:!1,type:"boolean"},taskColor:{value:!0,type:"boolean"},taskColorEntireSurface:{value:!1,type:"boolean"},textTemplate:{value:null,type:"any"},userList:{value:!1,type:"boolean"},users:{value:[],type:"array",reflectToAttribute:!1},dialogCustomizationFunction:{value:null,type:"any"},dialogRendered:{value:null,type:"any"},dialogEditors:{value:["checklist","color","dueDate","priority","progress","startDate","status","swimlane","tags","text","description","userId"],type:"any"}}}static get listeners(){return{"body.focusin":"_bodyFocusinHandler",keyup:"_keyupHandler","container.click":"_containerClickHandler","container.down":"_containerDownHandler","container.keydown":"_containerKeydownHandler","container.touchmove":"_scrollViewerTouchmoveHandler","container.wheel":"_mouseWheelHandler"}}template(){const e=this._tabindex;return`<div id="container" role="presentation">\n                    <div id="header" class="smart-data-view-header" role="toolbar">\n                        <div id="customizeButton" class="smart-data-view-header-button smart-data-view-customize-button smart-unselectable"${e} role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Customize tasks"><div role="presentation"></div></div>\n                        <div id="filterButton" class="smart-data-view-header-button smart-data-view-filter-button smart-unselectable"${e} role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Filter"><div role="presentation"></div></div>\n                        <div id="sortButton" class="smart-data-view-header-button smart-data-view-sort-button smart-unselectable"${e} role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Sort"><div role="presentation"></div></div>\n                        <div id="searchButton" class="smart-data-view-header-button smart-data-view-search-button smart-unselectable"${e} role="button" aria-expanded="false" aria-haspopup="dialog" aria-label="Search"></div>\n                        <div id="headerDropDown" 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="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"${e} role="button" aria-label="Previous"></div>\n                                <div id="searchNext" class="smart-data-view-search-next"${e} role="button" aria-label="Next"></div>\n                                <div id="searchClose" class="smart-data-view-search-close"${e} role="button" aria-label="Close search box"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <smart-scroll-viewer auto-refresh vertical-scroll-bar-visibility="hidden" class="smart-kanban-scroll-viewer" id="scrollViewer">\n                        <div id="body" class="smart-kanban-body" role="presentation"></div>\n                    </smart-scroll-viewer>\n                </div>`}_mouseWheelNative(e,t){const a=this;void 0===a._scrollWheelContent&&(a._scrollWheelContent=document.createElement("div"),a._scrollWheelContent.style.width="100%",a._scrollWheelContent.style.height="100%",a._scrollWheelContent.style.position="absolute",a._scrollWheelContent.style.left="0px",a._scrollWheelContent.style.top="0px",a._scrollWheelContent.style.background="white",a._scrollWheelContent.style.zIndex=9999,a._scrollWheelContent.style.opacity=0,a._scrollWheelContent.style.overflow="auto",a._scrollWheelContent.style.visibility="hidden");let s=0;const l=()=>{if(t){const t=a._scrollWheelContent.scrollLeft;a._scrollView.hScrollBar.value=t,t===e&&a._scrollWheelContent.remove()}else{const t=a._scrollWheelContent.scrollTop;a._scrollView.vScrollBar.value=t,t===e&&a._scrollWheelContent.remove()}};a._scrollWheelContent.onscroll=()=>{cancelAnimationFrame(s),s=0,s=requestAnimationFrame(l)},a._scrollWheelContentView||(a._scrollWheelContentView=document.createElement("div"),a._scrollWheelContent.appendChild(a._scrollWheelContentView)),a._scrollWheelContentView.style.width=a.offsetWidth+a._scrollView.scrollWidth+"px",a._scrollWheelContentView.style.height=a.offsetHeight+a._scrollView.scrollHeight+"px",a.$.container.appendChild(a._scrollWheelContent),a._scrollWheelContent.scrollTop=a._scrollView.vScrollBar.value,a._scrollWheelContent.scrollLeft=a._scrollView.hScrollBar.value,!0===t?a._scrollWheelContent.scrollTo({top:a._scrollView.vScrollBar.value,left:e,behavior:"smooth"}):a._scrollWheelContent.scrollTo({top:e,left:a._scrollView.hScrollBar.value,behavior:"smooth"})}_mouseWheelHandler(e){const t=this,a=e.target;if(t.disabled||a.closest(".smart-scheduler-window-modal"))return;if(t._scrollView||(t._scrollView=new Smart.Utilities.Scroll(t.$.scrollViewer,t.$.scrollViewer.$.horizontalScrollBar,t.$.scrollViewer.$.verticalScrollBar)),t._scrollView.hScrollBar.$.hasClass("smart-hidden")&&t._scrollView.vScrollBar.$.hasClass("smart-hidden"))return;if(42===e.pointerId)return;let s=!1;if(e.wheelDeltaY?120!==Math.abs(e.wheelDeltaY)&&240!==Math.abs(e.wheelDeltaY)&&360!==Math.abs(e.wheelDeltaY)&&(s=!0):0===e.deltaMode&&(s=!0),t.disabled||t._scrollView.vScrollBar.$.hasClass("smart-hidden")||e.shiftKey||!e.deltaY){if(!t.disabled&&(!t._scrollView.hScrollBar.$.hasClass("smart-hidden")||e.shiftKey)){e.stopPropagation(),e.preventDefault();let a=160;const l=0===e.deltaX?e.wheelDelta:e.deltaX;l<0&&(a=-160),Math.abs(l)>=100&&!s&&!Smart.Utilities.Core.Browser.Firefox?t._mouseWheelNative(t._scrollView.scrollLeft+a,!0):t._scrollView.scrollLeft+=l}}else{const a=t.scrollTop;if(0===a&&e.deltaY<0||a===t.scrollHeight&&e.deltaY>0)return;e.stopPropagation(),e.preventDefault();let l=450;if(e.deltaY<=0&&(l=-450),Math.abs(e.deltaY)>=100&&!s&&!Smart.Utilities.Core.Browser.Firefox)t._mouseWheelNative(t._scrollView.scrollTop+l);else{t._wheelrafId=0;const a=()=>{t._scrollView.scrollTop+=e.deltaY};cancelAnimationFrame(t._wheelrafId),t._wheelrafId=0,t._wheelrafId=requestAnimationFrame(a)}}}_keyupHandler(e){const t=this;if("Escape"===e.key&&t._dragDetails){const e=t._dragDetails,a=Smart.Kanban.hoveredKanban,s=Smart.Kanban.hoveredItem;delete t._dragDetails,delete Smart.Kanban.kanbanTaskDragged,delete Smart.Kanban.hoveredKanban,delete Smart.Kanban.hoveredItem,e.ScrollViewer&&e.ScrollViewer._scrollView&&(e.ScrollViewer._scrollView.disableSwipeScroll=!1);let l=!1;if(document.querySelectorAll(".smart-kanban-task-placeholder").forEach((e=>{e.classList.remove("smart-kanban-task-placeholder"),e.style.marginTop=e.style.marginBottom="0px",l=!0})),l&&t._refreshButtonsAndSummaries(),!e.FeedbackShown)return;a&&clearInterval(a._dragInterval),t._preventSelection=!0;const r=t.isInShadowDOM?t.getRootNode().host:document.body;return r.classList.remove("smart-dragging"),r.style.overflow=t._originalBodyOverflow.overflow,r.style.eoverflowX=t._originalBodyOverflow.overflowX,r.style.overflowY=t._originalBodyOverflow.overflowY,delete t._originalBodyOverflow,e.Feedback.remove(),e.Items.forEach((e=>e.classList.remove("dragged"))),s.classList.remove("drop-target"),void(s.classList.contains("before")?s.classList.remove("before"):s.classList.contains("after")&&s.classList.remove("after"))}}render(){const e=this;Object.defineProperty(e,"dataSource",{get:function(){return e.context===e?e.properties.dataSource.value:e._getCurrentDataSource()},set(t){e.updateProperty(e,e._properties.dataSource,t)}}),e.isInitialized=!1,e._render(),super.render(),e.isInitialized=!0}_getPriority(){const e=this;if(!e.priority||e.priority&&0===e.priority.length)e.priority=[{menuIcon:'<span style="margin-left: 0px; margin-right: 5px;" class="priority"></span>',label:"",value:""},{menuIcon:'<span style="margin-left: 0px; margin-right: 5px;" class="priority low"></span>',label:e.localize("low"),value:"low"},{menuIcon:'<span style="margin-left: 0px; margin-right: 5px;" class="priority average"></span>',label:e.localize("average"),value:"average"},{menuIcon:'<span style="margin-left: 0px; margin-right: 5px;" class="priority high"></span>',label:e.localize("high"),value:"high"},{menuIcon:'<span style="margin-left: 0px; margin-right: 5px;" class="priority critical"></span>',label:e.localize("critical"),value:"critical"}];else if(e.priority){const t=e=>{switch(e.value){case"":return'<span style="margin-left: 0px; margin-right: 5px;" class="priority"></span>';case"low":case"Low":return'<span style="margin-left: 0px; margin-right: 5px;" class="priority low"></span>';case"average":case"Average":return'<span style="margin-left: 0px; margin-right: 5px;" class="priority average"></span>';case"high":case"High":return'<span style="margin-left: 0px; margin-right: 5px;" class="priority high"></span>';case"critical":case"Critical":return'<span style="margin-left: 0px; margin-right: 5px;" class="priority critical"></span>'}let t="margin-left: 1px; margin-right: 5px;";return t+="height: 0px;",t+="width: 0px;",t+="border-left-color: transparent;",t+="border-left-style: solid;",t+="border-left-width: 7px;",t+="border-right-color: transparent;",t+="border-right-style: solid;",t+="border-right-width: 7px;","low"!==e.value?(t+="border-bottom-color: "+e.color+";"||0,t+="border-bottom-style: solid;",t+="border-bottom-width: 12px;"):(t+="border-top-color: "+e.color+";"||0,t+="border-top-style: solid;",t+="border-top-width: 12px;"),t+="border-radius: 3px;",`<span class="${e.value} priority" style="${t}"></span>`};for(let a=0;a<e.priority.length;a++){const s=e.priority[a];s.menuIcon=t(s)}}for(let t=0;t<e.priority.length;t++){const a=e.priority[t];a.menuLabel=`<div priority="${a.value}" class="smart-kanban-task-text">${a.menuIcon}${a.label}</div>`}return e.priority}_getTags(){const e=this,t=[];if(e.tags){for(let a=0;a<e.tags.length;a++){const s=e.tags[a];if("[]"!==s)if(s&&"string"==typeof s)t.push({label:s.trim(),value:s.trim()});else{const e={};if(s.label){if("[]"===s.label)continue;e.label=s.label}s.value?e.value=s.value:e.value=s.label,s.color&&(e.color=s.color),t.push(e)}}e.tags=t}}_render(){const e=this,t=getComputedStyle(e);if(e.columnColorEntireSurface?e.classList.add("smart-kanban-column-color"):e.classList.remove("smart-kanban-column-color"),e.$.body.innerHTML="",e._autoScrollCoefficient=Smart.Utilities.Core.Browser.Firefox?4:Smart.Utilities.Core.Browser.Edge?8:2,e._kanbanTaskMinWidth=parseFloat(t.getPropertyValue("--smart-kanban-task-min-width")),e._dataViewPadding=parseFloat(t.getPropertyValue("--smart-data-view-padding")),e.uiTasksByDataField=[],e.tasksByDataField=[],e.taskById=[],e._allColumns=[],e._customTags=[],e._selectedTasks=[],e._dblclickObject={numberOfClicks:0},e._appliedFiltering={filterGroups:[],filters:[],operator:"and"},e._appliedSorting={dataFields:[],dataTypes:[],orderBy:[]},e._sortPanelDataSource=[{label:e.localize("text"),dataField:"text",dataType:"string",allowFilter:!0,allowSort:!0},{label:e.localize("userId"),dataField:"userId",dataType:"string",allowFilter:!0,allowSort:!0},{label:e.localize("tags"),dataField:"tags",dataType:"string",allowFilter:!0,allowSort:!0},{label:e.localize("priority"),dataField:"priority",dataType:"string",allowFilter:!0,allowSort:!0},{label:e.localize("progress"),dataField:"progress",dataType:"number",allowFilter:!0,allowSort:!0},{label:e.localize("startDate"),dataField:"startDate",dataType:"date",allowFilter:!0,allowSort:!0},{label:e.localize("dueDate"),dataField:"dueDate",dataType:"date",allowFilter:!0,allowSort:!0}],e.taskCustomFields){const t=e.dataSource&&e.dataSource.length>0?e.dataSource[0]:null;for(let a=0;a<e.taskCustomFields.length;a++){const s=e.taskCustomFields[a].label;if(t){const l=typeof t[e.taskCustomFields[a].dataField];"number"===l?e._sortPanelDataSource.push({dataField:e.taskCustomFields[a].dataField,allowFilter:!0,allowSort:!0,label:s,dataType:"number"}):"date"===l?e._sortPanelDataSource.push({dataField:e.taskCustomFields[a].dataField,allowFilter:!0,allowSort:!0,label:s,dataType:"date"}):e._sortPanelDataSource.push({dataField:e.taskCustomFields[a].dataField,allowFilter:!0,allowSort:!0,label:s,dataType:"string"})}else e._sortPanelDataSource.push({dataField:e.taskCustomFields[a].dataField,allowFilter:!0,allowSort:!0,label:s,dataType:"string"})}}const a={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"};for(let t in a)e.dataSourceMap[t]||(e.dataSourceMap[t]=a[t]);e._getPriority(),e._getTags(),e._validateDataSourceMap(),e._getInnerElementMessages(),e._localizeHeader(),e._handleHeaderPosition(e.$.scrollViewer),e._validateSwimlanes(),e._renderColumns(),e._handleSwimlanes();let s=!1;e.autoLoadState&&(s=e.loadState()),e._getCurrentUser(),s||e._processDataSource(),e._setPriorityList(),e._setUserList(),e._setActionsList(),e._setColumnActionsList(),e._setCommentsList(),e._autoSaveState(),e._createAddNewButton(),e.$.scrollViewer.refresh()}attached(){const e=this;super.attached(),e.isCompleted&&e._dialog&&(e._addDialogHandlers(),e.getShadowRootOrBody().appendChild(e._dialog))}detached(){const e=this;if(super.detached(),!e._dialog)return;const t=e._dialog;t.removeEventListener("open",e._dialogEventHandler),t.removeEventListener("closing",e._dialogEventHandler),t.removeEventListener("close",e._dialogEventHandler),t.removeEventListener("click",e._dialogClickHandler),t.remove()}addTask(e={},t){const a=this,s=a.columns;if("object"!=typeof e||0===s.length||!a._currentUser.allowAdd)return;const l=a.dataSourceMap;void 0===e[l.status]&&(e[l.status]=s[0].dataField),a._currentUser.info&&(void 0===e[l.createdUserId]?(e[l.createdUserId]=a._currentUser.info.id,e[l.createdDate]=new Date):e[l.createdDate]||(e[l.createdDate]=new Date));const r={value:e,id:e.id};a.$.fireEvent("taskBeforeAdd",r);let o=null;return a.dataSource&&a.dataSource.virtualDataSource?a._requestVirtualDataSource("add",e,(function(e){return e})):(a.dataSource||(a.dataSource=[]),t>=0?a.dataSource.splice(t,0,e):a.dataSource.push(e),o=a._createTask(e,!0,t),a._autoSaveState("dataSource")),a.$.fireEvent("taskAdd",r),a._refreshButtonsAndSummaries(),a.virtualization&&(a._refreshColumns(),a._refreshButtonsAndSummaries()),o}addSort(e,t){const a=this,s=a.dataSource;let l;function r(e,s){const r=a._sortPanelDataSource.find((t=>t.dataField===e));if(r){let a=Array.isArray(t)?t[s]:"string"==typeof t?t:"ascending";l.dataFields.push(e),l.dataTypes.push(r.dataType),a=a&&-1!==a.indexOf("desc")?"descending":"ascending",l.orderBy.push(a)}}if(0!==arguments.length&&s&&0!==s.length){if(a.closePanel(),1===arguments.length&&"object"==typeof e)l=e;else if(l={dataFields:[],dataTypes:[],orderBy:[]},Array.isArray(e))e.forEach(r);else{if("string"!=typeof e)return;r(e,0)}super.addSort(l)}}beginEdit(e){const t=this;t.disabled||(e=t._validateTaskArgument(e))&&(t.editable||t.readonly)&&t._openDialog(e,"edit")}cancelEdit(){const e=this._dialog;e&&e.opened&&e.classList.contains("edit")&&e.close()}hide(e){const t=this;void 0!==e&&"number"==typeof e&&(e=t.columns[e]),e&&!1!==e.visible&&(e.visible=!1,t.$.fireEvent("columnHide",{column:e}),t.refresh())}show(e){const t=this;void 0!==e&&"number"==typeof e&&(e=t.columns[e]),e&&!0!==e.visible&&(e.visible=!0,t.$.fireEvent("columnShow",{column:e}),t.refresh())}showAllColumns(){const e=this;for(let t=0;t<e.columns.length;t++)e.columns[t].visible=!0;e.refresh()}collapse(e){const t=this;if(!t.collapsible)return;if(!(e=t._validateColumnArgument(e))||e.collapsed||!e.collapsible)return;const a=t._columnToElement.get(e),s=a.siblingColumns;let l=0;e.collapsed=!0,a.classList.add("collapsed");const r=e.collapsed?t.localize("expand"):t.localize("collapse"),o=a.querySelector(".smart-kanban-column-header-toggle-button");if(o&&o.setAttribute("title",r),s.forEach((e=>e.collapsed&&l++)),l===s.length){const a=0!==s.indexOf(e)?0:1,l=s[a],r=t._columnToElement.get(l);l&&(l.collapsed=!1),r&&(r.classList.remove("collapsed"),t._updateColumnWidths(s,r.parentElement))}else t._updateColumnWidths(s,a.parentElement);t._allColumns.forEach((e=>t._refreshScrollViewer(e))),t._autoSaveState("collapsed"),t._handleSwimlanes(!0),t._createAddNewButton(),t._doNotFireEvents||t.$.fireEvent("columnCollapse",{column:e})}copyTask(e){const t=this;if(!t._currentUser.allowAdd)return;if(!(e=t._validateTaskArgument(e)))return;const a=JSON.parse(JSON.stringify(e.data));a.history=[],t.dataSource&&t.dataSource.virtualDataSource?t._requestVirtualDataSource("add",a,(function(e){return t.$.fireEvent("taskAdd",{value:a}),e})):(a[t.dataSourceMap.id]=Math.floor(9e4*Math.random()+1e4),t._createTask(a,!0),t._autoSaveState("dataSource"),t.$.fireEvent("taskAdd",{value:a})),t.dataSource||(t.dataSource=[]),t.dataSource.push(a),t._refreshButtonsAndSummaries()}endEdit(){const e=this._dialog;e&&e.opened&&e.classList.contains("edit")&&(e.ok=!0,e.close())}ensureVisible(e){const t=this;if(e&&"number"==typeof e){const a=t.getTask(e);if(!a)return;const s=a[t.dataSourceMap.status],l=t.querySelector('.smart-kanban-column[data-field="'+s+'"]');if(l){const r=l.querySelector("smart-scroll-viewer");if(r){if(void 0===a.top){if(!(e=t._validateTaskArgument(e))||e.filteredOut)return;const a=e.closest("smart-scroll-viewer");if(0===a.scrollHeight)return e;const s=a.scrollTop,l=e.offsetTop;return s<=l&&s+a.offsetHeight>=l+e.offsetHeight||(a.scrollTop=l),e}a.top<r.scrollTop||a.top>r.scrollTop+r.offsetHeight?r.scrollTop=a.top:t._refreshScrollHeight(r,s)}}return}if(!(e=t._validateTaskArgument(e))||e.filteredOut)return;const a=e.closest("smart-scroll-viewer");if(0===a.scrollHeight)return e;const s=a.scrollTop,l=e.offsetTop;return s<=l&&s+a.offsetHeight>=l+e.offsetHeight||(a.scrollTop=l),e}expand(e){const t=this;if(!(e=t._validateColumnArgument(e))||!e.collapsed)return;const a=t._columnToElement.get(e);e.collapsed=!1,a.classList.remove("collapsed");const s=e.collapsed?t.localize("expand"):t.localize("collapse"),l=a.querySelector(".smart-kanban-column-header-toggle-button");l&&l.setAttribute("title",s),t._updateColumnWidths(a.siblingColumns,a.parentElement),t._allColumns.forEach((e=>t._refreshScrollViewer(e))),t._autoSaveState("collapsed"),t._handleSwimlanes(!0),t._createAddNewButton(),t.$.fireEvent("columnExpand",{column:e})}expandAll(){const e=this;e._allColumns.forEach((t=>{t.collapsed=!1,e._columnToElement.get(t).classList.remove("collapsed")})),e._allColumns.forEach((t=>e._refreshScrollViewer(t))),e._columnContainers.forEach((t=>e._updateColumnWidths(t.children,t))),e._autoSaveState("collapsed"),e._handleSwimlanes(!0)}exportData(e,t,a){const s=this,l=getComputedStyle(s),r=l.borderRightColor,o=s.swimlanes,i=new Smart.Utilities.DataExporter,n=s._getCurrentDataSource(),d=s.dataSourceMap,c=[{id:"Task ID",text:"Text",status:"Status",swimlane:"Swimlane",asignee:"Asignee",priority:"Priority",progress:"Progress",startDate:"Start date",dueDate:"Due date",subTasks:"Completed sub-tasks",tags:"Tags"}],u={},m={},p={};if(s.taskCustomFields)for(let e=0;e<s.taskCustomFields.length;e++)c[0][s.taskCustomFields[e].dataField]=s.taskCustomFields[e].label;i.style={border:"1px solid "+r,borderCollapse:"collapse",backgroundColor:l.backgroundColor,color:l.color,fontFamily:"Helvetica",header:{border:"1px solid "+r,fontWeight:"bold"},columns:{border:"1px solid "+r,progress:{format:"p0"},startDate:{format:s.formatStringDate},dueDate:{format:s.formatStringDate}},rows:{}},0===o.length&&delete c[0].swimlane;for(let e=0;e<n.length;e++){const t=n[e];let a=t[d.status],l=t[d.swimlane],r=t[d.userId],h=t[d.progress];u[a]?a=u[a]:(a=s._allColumns.find((e=>e.dataField===a)).label,u[t[d.status]]=a),null===r?r="":p[r]?r=p[r]:(r=s.users.find((e=>e.id===r)).name,p[t[d.userId]]=r),null===h?h="":h/=100;let g=t[d.tags];g&&"string"!=typeof g&&(g=g.map((e=>"string"==typeof e?e:e.label)));const f={id:t[d.id],text:t[d.text],description:t[d.description]||"",status:a,asignee:r,priority:t[d.priority]||"",progress:h,startDate:t[d.startDate]||"",dueDate:t[d.dueDate]||"",subTasks:s._getCompletedSubTasks(t[d.checklist]),tags:g};if(s.taskCustomFields)for(let e=0;e<s.taskCustomFields.length;e++)f[s.taskCustomFields[e].dataField]=`"${t[s.taskCustomFields[e].dataField]}"`.replaceAll(","," ");o.length&&(l?m[l]?l=m[l]:(l=o.find((e=>e.dataField===l)).label,m[t[d.swimlane]]=l):l="",f.swimlane=l),c.push(f),t[d.color]&&(i.style.rows[e]={backgroundColor:t[d.color]})}return i.exportData(c,e,t,a)}getState(e){const t=this,a={},s={collapsed:a,dataSource:t._getCurrentDataSource(),filtering:t._appliedFiltering,selection:{selected:t._selectedTasks,selectionStart:t._selectionStart?t._selectionStart:null},sorting:t._appliedSorting,tabs:t._selectedTabs,visibility:{taskActions:t.taskActions,taskComments:t.taskComments,taskDue:t.taskDue,taskPriority:t.taskPriority,taskProgress:t.taskProgress,taskTags:t.taskTags,taskUserIcon:t.taskUserIcon}};let l=null,r=null;t._selectionInView&&(l=t._selectionInView.closest(".smart-kanban-column").column.dataField,r=t._selectionInView.getAttribute("swimlane")),s.selection.selectionInColumn=l,s.selection.swimlane=r;const o={};for(let e in t.tasksByDataField){o[e]=[];const a=t.tasksByDataField[e];for(let t=0;t<a.length;t++)o[e].push(a[t].id)}if(s.order=o,s.columnOrder=[],t._allColumns.forEach((e=>a[e.dataField]=e.collapsed)),t.columns.forEach((e=>s.columnOrder.push(e.dataField))),e){const t={};for(let a in e){const l=e[a];s[l]&&(t[l]=s[l])}return t}return s}loadState(e,t){const a=this;if(!e&&!(e=window.localStorage.getItem("smartKanban"+a.id)))return!1;let s=!0;"string"==typeof e&&(e=JSON.parse(e,((e,t)=>t&&-1!==["startDate","dueDate","time"].indexOf(e)?new Date(t):t))),e.dataSource||(t=!1),a._doNotFireEvents=!0,a._selectedTasks=[],delete a._selectionStart,delete a._selectionInView,a.expandAll(),!1!==t&&Array.from(a.$.container.querySelectorAll("smart-scroll-viewer.smart-kanban-column-content-tasks")).forEach((e=>{e&&e.clearContent&&e.isReady&&e.clearContent()}));let l=!1;a._allColumns.forEach((t=>{e.collapsed&&e.collapsed[t.dataField]&&(a.collapse(t),l=!0)}));for(let t in e.visibility)a[t]=e.visibility[t];if(!1!==t&&(a.dataSource=e.dataSource,a.uiTasksByDataField=[],a.tasksByDataField=[],a._processDataSource()),e.filtering&&a.addFilter(a._constructFilterGroups(e.filtering),e.filtering.operator),e.sorting&&a.addSort(e.sorting),!1!==t&&a._autoSaveState(e),e.selection&&(e.selection.selected.forEach((e=>{const t=a.$.container.querySelector(`.smart-kanban-task[data-id="${e}"]`);t&&(t.setAttribute("selected",""),a._selectedTasks.push(t.data.id))})),e.selection.selectionStart&&(a._selectionStart=a.$.container.querySelector(`.smart-kanban-task[data-id="${e.selection.selectionStart}"]`)),e.selection.selectionInColumn)){const t=a._columnToElement.get(a._allColumns.find((t=>t.dataField===e.selection.selectionInColumn)));e.selection.swimlane?a._selectionInView=t.querySelector(`smart-scroll-viewer[swimlane=${e.selection.swimlane}]`):a._selectionInView=t.querySelector("smart-scroll-viewer")}if(e.tabs){const t="tabs"===a.hierarchy;a._allColumns.forEach((s=>{if(void 0!==s.selected){const l=a._columnToElement.get(s),r=-1!==e.tabs.indexOf(s.dataField);s.selected=r,t&&(l.classList.toggle("smart-hidden",!r),l.tab.classList.toggle("selected",r),l.tab.setAttribute("aria-selected",r))}}))}const r=[],o={};if(e.columnOrder){a._allColumns.forEach((e=>{o[e.dataField]=e}));for(let t=0;t<e.columnOrder.length;t++){const a=e.columnOrder[t],s=o[a];s&&r.push(s)}r&&r.length===a.columns.length&&JSON.stringify(r.map((e=>e.value)))!==JSON.stringify(a.columns.map((e=>e.value)))&&(a.columns=r,a.refresh(),s=!1)}if(e.order){let t=!1,l=[];for(let s in e.order){const l=e.order[s];let r=a._getTasksByDataField(s);if(0!==r.length)for(let e=0;e<l.length;e++){const s=l[e],o=a.taskById[s];if(o){const s=r.indexOf(o);s!==e&&s>=0?(r.splice(e,0,r.splice(s,1)[0]),t=!0):-1===s&&a._getTasksByDataField(o[a.dataSourceMap.status]).indexOf(o)}}}if(t){const e=Object.keys(a.tasksByDataField);for(let t in e)l=l.concat(a.tasksByDataField[e[t]]);Array.from(a.$.container.querySelectorAll("smart-scroll-viewer.smart-kanban-column-content-tasks")).forEach((e=>e.clearContent())),a.dataSource=l,a.uiTasksByDataField=[],a.tasksByDataField=[],a._processDataSource(),s=!1}}return a._doNotFireEvents=!1,s}moveTask(e,t){const a=this;if(a.disabled||""!==t&&!t)return;const s=a.dataSourceMap;if(!(e=a._validateTaskArgument(e))||!a._updateTaskInProgress&&e.data[s.status]===t)return;const l=a._allColumns.find((e=>e.dataField===t));function r(){const r=e.closest("smart-scroll-viewer"),o=a._columnToElement.get(l),i=e.data,n=a.getTaskScrollViewer(o,i);if(a.virtualization){const l=i,o=e.column.dataField,d=a._getTasksByDataField(o),c=d.findIndex((e=>e.id===l.id));return c>=0&&(d.splice(c,1),a._getTasksByDataField(t).push(l)),i[s.status]=t,a._refreshScrollViewer(r,!0),a._refreshScrollViewer(n,!0),e.hasAttribute("selected")&&(e.removeAttribute("selected"),a._selectedTasks=a._selectedTasks.filter((t=>t!==e.data.id)),a._autoSaveState("selection")),e.removeAttribute("focus"),void((a.shadowRoot||a.getRootNode()).activeElement===r&&a._focusTask(a._getFirstItem(r.$.content)))}i[s.status]=t,n.appendChild(e),a._dialog&&a._dialog.ok||(a.textTemplate&&a._renderTask(e),a._autoSaveState("dataSource")),a._refreshScrollViewer(r,!0),a._refreshScrollViewer(n,!0),e.hasAttribute("selected")&&(e.removeAttribute("selected"),a._selectedTasks=a._selectedTasks.filter((t=>t!==e.data.id)),a._autoSaveState("selection")),e.removeAttribute("focus"),(a.shadowRoot||a.getRootNode()).activeElement===r&&a._focusTask(a._getFirstItem(r.$.content))}l&&(a.dataSource&&a.dataSource.virtualDataSource&&!a._ignoreVirtualDataSource?a._requestVirtualDataSource("update",Object.assign({},e.data,{status:t}),(function(e){return e&&r(),e})):r())}_getCustomizeColumnPanelDataSource(){const e=this;return e._customizeColumns=[{label:e.localize("actionsIcon"),dataField:"taskActions",allowHide:!0,disableDrag:!0,visible:e.taskActions},{label:e.localize("commentsIcon"),dataField:"taskComments",allowHide:!0,disableDrag:!0,visible:e.taskComments},{label:e.localize("dueDate"),dataField:"taskDue",allowHide:!0,disableDrag:!0,visible:e.taskDue},{label:e.localize("priorityIcon"),dataField:"taskPriority",allowHide:!0,disableDrag:!0,visible:e.taskPriority},{label:e.localize("progress"),dataField:"taskProgress",allowHide:!0,disableDrag:!0,visible:e.taskProgress},{label:e.localize("tags"),dataField:"taskTags",allowHide:!0,disableDrag:!0,visible:e.taskTags},{label:e.localize("userIcon"),dataField:"taskUserIcon",allowHide:!0,disableDrag:!0,visible:e.taskUserIcon}],e._customizeColumns}openCustomizePanel(){const e=this,t=e.dataSource;if(!t||0===t.length||e.disabled||"none"===e.headerPosition)return;const a=e.$.customize,s=[{label:e.localize("actionsIcon"),dataField:"taskActions",visible:e.taskActions},{label:e.localize("commentsIcon"),dataField:"taskComments",visible:e.taskComments},{label:e.localize("dueDate"),dataField:"taskDue",visible:e.taskDue},{label:e.localize("priorityIcon"),dataField:"taskPriority",visible:e.taskPriority},{label:e.localize("progress"),dataField:"taskProgress",visible:e.taskProgress},{label:e.localize("tags"),dataField:"taskTags",visible:e.taskTags},{label:e.localize("userIcon"),dataField:"taskUserIcon",visible:e.taskUserIcon}];let l;e._closeDialog(),e.$.headerDropDown.classList.add("customize-panel"),e.$.headerDropDown.classList.remove("filter-panel","sort-panel","search-panel"),a.classList.remove("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e.$.search.classList.add("smart-hidden"),e._closeSearchPanel(),e._customizePartCreated?(l=a.firstElementChild,l.set("dataSource",s),l.propertyChangedHandler("dataSource",void 0,s),l.rightToLeft=e.rightToLeft):(l=document.createElement("smart-column-panel"),l.animation=e.animation,l.dataSource=s,l.locale=e.locale,l.messages=e._innerElementMessages.columnPanel,l.rightToLeft=e.rightToLeft,l.theme=e.theme,e.$.customize.appendChild(l),l.classList.add("smart-kanban-column-panel"),e._customizePartCreated=!0),e._openHeaderDropDown(e.$.customizeButton)}_getFilterPanelDataSource(){const e=this,t=[{label:e.localize("text"),dataField:"text",dataType:"string",allowSort:!0,allowFilter:!0},{label:e.localize("userId"),dataField:"userId",dataType:"string",allowSort:!0,allowFilter:!0},{label:e.localize("tags"),dataField:"tags",dataType:"string",allowSort:!0,allowFilter:!0},{label:e.localize("priority"),dataField:"priority",dataType:"enum",allowSort:!0,allowFilter:!0,options:e._getPriority()},{label:e.localize("progress"),dataField:"progress",dataType:"number",allowSort:!0,allowFilter:!0},{label:e.localize("startDate"),dataField:"startDate",dataType:"date",allowSort:!0,allowFilter:!0},{label:e.localize("dueDate"),dataField:"dueDate",dataType:"date",allowSort:!0,allowFilter:!0}];if(e.taskCustomFields){const a=e.dataSource&&e.dataSource.length>0?e.dataSource[0]:null;for(let s=0;s<e.taskCustomFields.length;s++){const l=e.taskCustomFields[s].label;if(a){const r=typeof a[e.taskCustomFields[s].dataField];"number"===r?t.push({dataField:e.taskCustomFields[s].dataField,allowFilter:!0,allowSort:!0,label:l,dataType:"number"}):"date"===r?t.push({dataField:e.taskCustomFields[s].dataField,allowFilter:!0,allowSort:!0,label:l,dataType:"date"}):t.push({dataField:e.taskCustomFields[s].dataField,allowFilter:!0,allowSort:!0,label:l,dataType:"string"})}else t.push({dataField:e.taskCustomFields[s].dataField,allowFilter:!0,allowSort:!0,label:l,dataType:"string"})}}return e.onFilterPrepare&&e.onFilterPrepare(t),t}openFilterPanel(){const e=this,t=e._getFilterPanelDataSource();super.openFilterPanel(t,(function(t,a){"progress"===a.dataField?(t.min=0,t.max=100,t.showUnit=!0,t.unit="%"):"date"===a.dataType&&(t.formatString=e.formatStringDate)}))}_getSortPanelDataSource(){const e=this;return e.onSortPrepare&&e.onSortPrepare(this._sortPanelDataSource),this._sortPanelDataSource}openSortPanel(){const e=this,t=e._getSortPanelDataSource().map((t=>{const a=e._appliedSorting.dataFields.indexOf(t.dataField);return Object.assign({},t,{sortIndex:a,sortDirection:-1===a?"ascending":e._appliedSorting.orderBy[a]})}));super.openSortPanel(t)}removeTask(e,t){const a=this;function s(){const t=e.closest("smart-scroll-viewer"),s=e.data;if(a.virtualization||(e.remove(),a._refreshScrollViewer(t,!0)),a._autoSaveState("dataSource"),a.$.fireEvent("taskRemove",{value:s,id:e.data.id}),a.dataSource){const e=a.dataSource.findIndex?a.dataSource.findIndex((e=>e.id===s.id)):-1;if(e>-1){const t=s[a.dataSourceMap.status],l=a.tasksByDataField[t].findIndex((e=>e.id===s.id));l>=0&&a.tasksByDataField[t].splice(l,1),a.dataSource.splice(e,1)}}if(a._selectedTasks&&a._selectedTasks.indexOf(s.id)>=0){const e=a._selectedTasks.indexOf(s.id);a._selectedTasks.splice(e,1)}a._refreshSummaries(),a._refreshColumns()}a._currentUser.allowRemove&&(e=a._validateTaskArgument(e))&&(t?a._openDialog(e,"prompt"):a.dataSource&&a.dataSource.virtualDataSource?a._requestVirtualDataSource("remove",e.data,(function(e){return e&&s(),e})):s())}saveState(e){const t=this.getState(e);return window.localStorage.setItem("smartKanban"+this.id,JSON.stringify(t)),t}addHistory(e,t){const a=this;if(!e||!t)return;const s=a.dataSourceMap;a.storeHistory?(void 0!==e[s.history]&&null!==e[s.history]||(e[s.history]=[]),e[s.history].length===a.storeHistoryItems&&e[s.history].splice(0,1),Array.isArray(e[s.history])||(e[s.history]=[]),e[s.history].push(t)):e[s.history]=[]}clearHistory(e){e&&(e.history=[])}updateTask(e,t){const a=this;if(!a._currentUser.allowEdit||!t)return;if(!(e=a._validateTaskArgument(e)))return;const s=a.dataSourceMap,l=e.data;function r(){if(e.data=t,t[s.status]!==l[s.status]&&(a._updateTaskInProgress=!0,a.moveTask(e,t[s.status]),delete a._updateTaskInProgress),t[s.swimlane]!==l[s.swimlane]){const r=e.closest(".smart-kanban-column");a._hasSwimlane(r.index)?(r.querySelector(`smart-scroll-viewer[swimlane=${t[s.swimlane]}]`).appendChild(e),l[s.swimlane]&&a._refreshScrollViewer(r.querySelector(`smart-scroll-viewer[swimlane=${l[s.swimlane]}]`))):delete t[s.swimlane]}const r=()=>{if(!a._currentUser||a._currentUser&&!a._currentUser.info)return;const e=()=>({user:a._currentUser.info.id,date:t[s.updatedDate]});if(t[s.userId]!==l[s.userId]){const r=e();r.action="user";let o=!0;l[s.userId]||t[s.userId]||(o=!1),o&&(r.details={oldValue:l[s.userId],value:t[s.userId]},a.addHistory(t,r))}if(""+t[s.dueDate]!=""+l[s.dueDate]){const r=e();r.action="deadline",r.details={oldValue:l[s.dueDate]?l[s.dueDate].toLocaleDateString():"",value:t[s.dueDate]?t[s.dueDate].toLocaleDateString():""},a.addHistory(t,r)}if(""+t[s.startDate]!=""+l[s.startDate]){const r=e();r.action="deadline",r.details={oldValue:l[s.startDate]?l[s.startDate].toLocaleDateString():"",value:t[s.startDate]?t[s.startDate].toLocaleDateString():""},a.addHistory(t,r)}if(t[s.color]!==l[s.color]){const r=e();r.action="color",r.details={oldValue:l[s.color],value:t[s.color]},a.addHistory(t,r)}if(t[s.status]!==l[s.status]){const r=e();r.action="status",r.details={oldValue:l[s.status],value:t[s.status]},a.addHistory(t,r)}if(JSON.stringify(t[s.checklist])!==JSON.stringify(l[s.checklist])){const r=e();r.action="subtasks",r.details={oldValue:l[s.checklist],value:t[s.checklist]},a.addHistory(t,r)}if(parseFloat(t[s.progress])!==parseFloat(l[s.progress])){let r=!0;if(null===l[s.progress]&&0===parseFloat(t[s.progress])&&(r=!1),r){const r=e();r.action="progress";const o=l[s.progress]?l[s.progress]+"%":"0%",i=t[s.progress]?t[s.progress]+"%":"0%";o!==i&&(r.details={oldValue:o,value:i},a.addHistory(t,r))}}if(t[s.description]!==l[s.description]){const r=e();r.action="description",r.details={oldValue:l[s.description],value:t[s.description]},a.addHistory(t,r)}if(t[s.priority]!==l[s.priority]){const r=e();r.action="priority",r.details={oldValue:l[s.priority],value:t[s.priority]},a.addHistory(t,r)}if(t[s.tags]!==l[s.tags]){const r=e();r.action="tags",r.details={oldValue:l[s.tags],value:t[s.tags]},a.addHistory(t,r)}if(t[s.text]!==l[s.text]){const r=e();r.action="text",r.details={oldValue:l[s.text],value:t[s.text]},a.addHistory(t,r)}for(let s=0;s<a.taskCustomFields.length;s++){const r=a.taskCustomFields[s];let o=l[r.dataField],i=t[r.dataField];if(o!==i&&""+o!=""+i){const s=e();if(s.action=r.name?r.name:r.dataField,r.dataSource){const e=e=>{const t=r.dataSource.find((t=>t.value===e||t===e?t:void 0));return void 0!==t?t.label:""},t=t=>{if(null===t)return"";if(void 0===t||t.length){if(void 0!==t&&t.length&&"string"!=typeof t){let a=[];return t.forEach((t=>{a.push(e(t))})),a.toString()}if(t&&t.indexOf(",")>0){t=t.split(",");let a=[];return t.forEach((t=>{a.push(e(t))})),a.toString()}return t}return e(t)};i=t(i),o=t(o)}s.details={oldValue:o,value:i},a.addHistory(t,s)}}};a.textTemplate||t[s.text]!==l[s.text]||t[s.tags]!==l[s.tags]||t[s.priority]!==l[s.priority]||t[s.description]!==l[s.description]?(a._renderTask(e),r()):(r(),t[s.userId]!==l[s.userId]&&a._updateUserIcon(e),t[s.dueDate]!==l[s.dueDate]&&a._updateTaskDueDate(e),t[s.color]!==l[s.color]&&a._updateTaskColor(e),JSON.stringify(t[s.checklist])!==JSON.stringify(l[s.checklist])?(a._updateTaskChecked(e),a._updateTaskProgress(e)):parseFloat(t[s.progress])!==parseFloat(l[s.progress])&&a._updateTaskProgress(e),a._updateTaskSubtasks(e),a._updateTaskCustomFields(e));const o=a.getColumn(t.status);o&&(t.statusLabel=o.label);const i=a.getColumn(l.status);i&&(l.statusLabel=i.label);const n=JSON.parse(JSON.stringify(t)),d=JSON.parse(JSON.stringify(l));if(n.history=t.history,d.history=l.history,a.$.fireEvent("change",{task:e,id:n.id,value:n,oldValue:d}),a.virtualization){const t=e.data[s.status],l=a.tasksByDataField[t].findIndex((t=>t.id===e.data.id));if(l>=0){a.tasksByDataField[t][l]=e.data;const s=a._getTasksByDataField(t),r=s.findIndex((t=>t.id===e.data.id));r>=0&&(s[r]=e.data)}}if(a._refreshScrollViewer(e.closest("smart-scroll-viewer")),a.dataSource&&a.dataSource.findIndex){const t=a.dataSource.findIndex((t=>e.data.id===t.id));t>=0&&(a.dataSource[t]=e.data)}a._refreshSummaries(),a._updateTaskComments(e),a._autoSaveState("dataSource"),a.$.fireEvent("taskUpdate",{id:n.id,value:n,oldValue:d})}(t=Object.assign({},l,t))[s.checklist]&&0===t[s.checklist].length&&(t[s.checklist]=null),JSON.stringify(t)!==JSON.stringify(l)&&(a.dataSource&&a.dataSource.virtualDataSource?a._requestVirtualDataSource("update",t,(function(e){return e&&(a._ignoreVirtualDataSource=!0,r(),delete a._ignoreVirtualDataSource),e})):r())}_refreshSelection(){const e=this;if("zeroOrOne"===e.selectionMode){const t=e._selectionStart;e._selectedTasks.forEach((a=>{if(a!==t){const t=e.getTask(a);t&&(t.selected=!1);const s=e.querySelector('[data-id="'+a+'"]');s&&s.removeAttribute("selected")}})),e._selectedTasks=[t]}e._selectedTasks.forEach((t=>{const a=e.querySelector('[data-id="'+t+'"]');a&&a.setAttribute("selected","")})),e._refreshColumns()}propertyChangedHandler(e,t,a){const s=this,l=s._dialog;function r(){if(s.cancelEdit(),l&&l.close(),s._closeList(s._commentsList,"_commentSelectionFor"),s._getCurrentUser(),s.taskSubTasks){const e=s.querySelectorAll(".smart-kanban-task-input");s._currentUser&&!s._currentUser.allowEdit||s.disabled||!s.taskSubTasksInput?e.forEach((e=>{e.classList.add("smart-hidden")})):e.forEach((e=>{e.classList.remove("smart-hidden")}))}}switch(super.propertyChangedHandler(e,t,a),e){case"columnColorEntireSurface":a?s.classList.add("smart-kanban-column-color"):s.classList.remove("smart-kanban-column-color");break;case"columnFooter":case"addNewButton":case"addNewButtonDisplayMode":s._reset(),s._createAddNewButton();break;case"taskTags":s._reset();break;case"taskCustomFields":s._resetFields=!0,s._reset();break;case"autoColumnHeight":case"applyColumnColorToTasks":case"columnWidth":case"addNewColumn":s._reset();break;case"allowDrag":s._getCurrentUser();break;case"animation":case"theme":{let t=Array.from(s.$.container.querySelectorAll("smart-column-panel, smart-multi-column-filter-panel, smart-sort-panel"));l&&(t.push(l),t=t.concat(Array.from(l.$.footer.children)),l.editPanelPopulated&&(t=t.concat(Array.from(l.$.container.querySelectorAll(".smart-element.editor"))))),t.forEach((t=>t[e]=a)),Array.from(s.$.container.getElementsByClassName("smart-kanban-task")).forEach((e=>s._updateTaskColor(e)));break}case"autoSaveState":s._autoSaveState();break;case"collapsible":a||s.expandAll();break;case"columnSummary":s._refreshSummaries();break;case"columns":s._render(),l&&l.editPanelPopulated&&(l.editors.status.dataSource=s._allColumns.map((e=>({color:e.color,label:e.label,value:e.dataField}))));break;case"currentUser":r();break;case"dataSource":case"dataSourceMap":if("dataSourceMap"===e&&s._validateDataSourceMap(),s._customTags=[],s._selectedTasks=[],s.cancelEdit(),s.closePanel(),s._closeList(s._actionsList,"_actionSelectionFor"),s._closeList(s._columnActionsList,"_columnActionSelectionFor"),s._closeList(s._commentsList,"_commentSelectionFor"),s._closeList(s._userList,"_userSelectionFor"),s._closeList(s._priorityList,"_prioritySelectionFor"),0===s.columns.length)return s._renderColumns(),s._handleSwimlanes(),void s._processDataSource();Array.from(s.$.container.querySelectorAll("smart-scroll-viewer.smart-kanban-column-content-tasks")).forEach((e=>{e.clearContent(),e.refresh(),s._refreshScrollViewer(e,!0)})),s._processDataSource(),s.dataSource||s._refresh(),s.columnSummary&&s._refreshSummaries();break;case"disabled":s.cancelEdit(),s.closePanel(),s._closeList(s._actionsList,"_actionSelectionFor"),s._closeList(s._columnActionsList,"_columnActionSelectionFor"),s._closeList(s._commentsList,"_commentSelectionFor"),s._closeList(s._userList,"_userSelectionFor"),s._closeList(s._priorityList,"_prioritySelectionFor"),s._setFocusable();break;case"formatStringDate":Array.from(s.$.container.getElementsByClassName("smart-kanban-task")).forEach((e=>s._updateTaskDueDate(e))),l&&(l.editors.startDate.formatString=a,l.editors.dueDate.formatString=a);break;case"formatStringTime":s._closeList(s._commentsList,"_commentSelectionFor");break;case"editable":s.cancelEdit(),s._actionsList.classList.contains("edit-comment")||s._closeList(s._actionsList,"_actionSelectionFor"),s._getCurrentUser();break;case"headerPosition":s._handleHeaderPosition(s.$.body),s._allColumns.forEach((e=>s._refreshScrollViewer(e)));break;case"hierarchy":0===s.swimlanes.length&&s.columns.length!==s._allColumns.length&&s._reset();break;case"locale":case"messages":s.closePanel(),s._localizeHeader(),s._getInnerElementMessages(),s._closeList(s._actionsList,"_actionSelectionFor"),s._closeList(s._columnActionsList,"_columnActionSelectionFor"),s._closeList(s._commentsList,"_commentSelectionFor"),s._setActionsList(),s._setColumnActionsList(),s._setCommentsList(),l&&(s.cancelEdit(),l.close(),l.$.footer.firstElementChild.innerHTML=s.localize("ok"),l.$.footer.children[1].innerHTML=s.localize("cancel"),l.$.footer.children[2].innerHTML=s.localize("delete"),l.editPanelPopulated&&(l.editors.priority.dataSource=s._getPriority(),l.$.container.querySelector(".new-subtask").placeholder=s.localize("newSubtask"),l.$.container.querySelector("smart-button.add").title=s.localize("addSubtask"),Array.from(l.$.container.getElementsByClassName("editor-label")).forEach((e=>{let t=e.id.slice(s.id.length+5);t=t.slice(0,1).toLowerCase()+t.slice(1),e.innerHTML=s.localize(t)})))),s._customizePartCreated&&(s.$.customize.firstElementChild.messages=s._innerElementMessages.columnPanel,s.$.customize.firstElementChild.locale=s.locale),s._filterPartCreated&&(s.$.filter.firstElementChild.messages=s._innerElementMessages.multiColumnFilterPanel,s.$.filter.firstElementChild.locale=s.locale,s.$.filter.firstElementChild.editorPlaceholder=s.localize("filterValuePlaceholder")),s._sortPartCreated&&(s.$.sort.firstElementChild.messages=s._innerElementMessages.sortPanel,s.$.sort.firstElementChild.locale=s.locale);break;case"rightToLeft":s._reset(!0);break;case"selectionMode":"zeroOrOne"===a&&s._selectedTasks.length>1&&s._refreshSelection();break;case"swimlanes":if(s._validateSwimlanes(),JSON.stringify(s.swimlanes)===JSON.stringify(t))return;s._reset(),l&&l.editPanelPopulated&&(l.editors.swimlane.dataSource=s.swimlanes.map((e=>({label:e.label,value:e.dataField}))));break;case"swimlanesFrom":case"swimlanesTo":{const e=s.swimlanesFrom,t=s.swimlanesTo;e<0&&(s.swimlanesFrom=0),null!==t&&e>t&&(s.swimlanesFrom=t),s.swimlanes.length>0&&s._reset();break}case"taskCustomFieldsHide":case"taskProgress":case"taskSubTasksInput":case"taskSubTasks":case"taskUserIcon":case"taskComments":case"taskDue":case"taskPriority":case"tags":case"taskColor":case"taskColorEntireSurface":case"textTemplate":Array.from(s.$.container.getElementsByClassName("smart-kanban-task")).forEach((e=>s._renderTask(e))),s._allColumns.forEach((e=>s._refreshScrollViewer(e)));break;case"unfocusable":s._setFocusable();break;case"priority":s._closeList(s._priorityList,"_prioritySelectionFor"),s._setPriorityList();break;case"users":s._closeList(s._userList,"_userSelectionFor"),s._setUserList(),Array.from(s.$.container.getElementsByClassName("smart-kanban-task")).forEach((e=>s._updateUserIcon(e))),l&&l.editPanelPopulated&&(l.editors.userId.dataSource=s.users.map((e=>({label:e.name,value:e.id})))),r()}}_reset(e){const t=this,a=t.getState();t._allColumns=[],t._customTags=[],t._selectedTasks=[],t._dialog&&(t.cancelEdit(),e&&(t._dialog.remove(),delete t._dialog)),t.closePanel(),t._closeList(t._actionsList,"_actionSelectionFor"),t._closeList(t._columnActionsList,"_columnActionSelectionFor"),t._closeList(t._commentsList,"_commentSelectionFor"),t._closeList(t._userList,"_userSelectionFor"),t.$.body.innerHTML="",Array.from(t.$.container.getElementsByClassName("swimlane")).forEach((e=>e.remove())),t._renderColumns(),t._handleSwimlanes(),t._createAddNewButton(),t.loadState(a),t.$.scrollViewer.refresh()}_refresh(){const e=this;e._allColumns=[],e._customTags=[],e._selectedTasks=[],e.closePanel(),e._closeList(e._actionsList,"_actionSelectionFor"),e._closeList(e._columnActionsList,"_columnActionSelectionFor"),e._closeList(e._commentsList,"_commentSelectionFor"),e._closeList(e._userList,"_userSelectionFor"),e.$.body.innerHTML="",Array.from(e.$.container.getElementsByClassName("swimlane")).forEach((e=>e.remove())),e._renderColumns(),e._handleSwimlanes(),e._createAddNewButton(),e.$.scrollViewer.refresh()}_closeAllLists(){const e=this;e.cancelEdit(),e.closePanel(),e._closeList(e._actionsList,"_actionSelectionFor"),e._closeList(e._columnActionsList,"_columnActionSelectionFor"),e._closeList(e._commentsList,"_commentSelectionFor"),e._closeList(e._userList,"_userSelectionFor"),e._closeList(e._priorityList,"_prioritySelectionFor")}_inlineTaskAdd(e,t){const a=this;if(a._inlineEditDetails&&a._inlineEditDetails.popup.parentNode){const e=a._addToBottom;a._inlineEditDetails.addTask(),a._addToBottom=e}const s=document.createElement("div"),l={},r=a.dataSourceMap;l[r.status]=e.dataField,a._currentUser.info&&(void 0===l[r.createdUserId]?(l[r.createdUserId]=a._currentUser.info.id,l[r.createdDate]=new Date):l[r.createdDate]||(l[r.createdDate]=new Date));const o=document.createElement("div");o.style.position="relative",o.classList.add("smart-kanban-task"),s.appendChild(o);const i=t.parentElement.querySelector(".smart-kanban-column-content-tasks");if(a._addToBottom)i.appendChild(s);else{const e=i.querySelector(".smart-kanban-task");e?e.parentElement.insertBefore(s,e):i.appendChild(s)}a._refreshButtonsAndSummaries();const n=document.createElement("textarea");n.placeholder=a.localize("textPlaceholder"),n.style.position="absolute",n.style.backgroundColor="transparent",n.style.borderLeftWidth=n.style.borderTopWidth=n.style.borderRightWidth=n.style.borderBottomWidth="0px",n.style.outline="0px",n.style.left="0px",n.style.bottom="0px",n.style.width="100%",n.style.height="100%",n.style.resize="none",o.style.height="70px",o.style.marginBottom="10px";const d=()=>{a._addToBottom?i.scrollTop=i.scrollHeight:i.scrollTop=0};o.appendChild(n),d();const c=()=>{const e=a._inlineEditDetails.input,t=a._inlineEditDetails.popup;e.onchange=e.onblur=null,t.remove(),l[a.dataSourceMap.text]=e.value,a.addTask(l,a._addToBottom?-1:0)&&d(),delete a._addToBottom};n.onchange=n.onblur=e=>{c(),e.preventDefault()},n.onkeydown=e=>{"Enter"===e.key?(c(),e.preventDefault()):"Escape"===e.key&&(n.onchange=n.onblur=null,s.remove(),a._refreshButtonsAndSummaries(),d(),e.preventDefault())," "===e.key&&e.stopPropagation()},a._inlineEditDetails={popup:s,input:n,addTask:c},setTimeout((()=>{n.focus()}),50)}_containerClickHandler(e){const t=this,a=t.isInShadowDOM||t.shadowRoot?e.composedPath()[0]:e.target;if(t.$.header.contains(a))return void t._headerClickHandler(a,t.$.body);const s=a.closest(".smart-kanban-column-header");if(s){const l=s.parentElement.column;if(a instanceof HTMLInputElement)return;if(t.columnActions&&a.classList.contains("smart-kanban-column-actions")){if(!t._columnActionsList.parentElement||t._columnActionsList.classList.contains("smart-visibility-hidden")){if(t._columnActionsListDate&&new Date-t._columnActionsListDate<300)return;t._openColumnActionsList(a,l)}return}if(a.closest(".smart-kanban-column-header-add")&&l)return void(t.disableAddNewDialog?t._inlineTaskAdd(l,s,e):t._openDialog(l,"add","column"));if(t.collapsible&&l&&l.collapsible&&a.closest(".smart-kanban-column-header-toggle-button"))return void t[l.collapsed?"expand":"collapse"](l)}const l=a.closest(".smart-kanban-tab");if(l){if(l.classList.contains("selected"))return;const e=l.parentElement.querySelector(".selected");return e.classList.remove("selected"),e.setAttribute("aria-selected",!1),e.columnElement.classList.add("smart-hidden"),e.columnElement.column.selected=!1,l.classList.add("selected"),l.setAttribute("aria-selected",!0),l.columnElement.classList.remove("smart-hidden"),l.columnElement.column.selected=!0,t._selectedTabs=t._allColumns.filter((e=>e.selected)).map((e=>e.dataField)),t._autoSaveState("tabs"),void t._allColumns.forEach((e=>t._refreshScrollViewer(e)))}if(t.addNewColumn){const e=a.closest(".smart-kanban-add-new-column"),s=a.closest(".smart-color-input"),l=a.closest(".smart-kanban-column-header");if(!s&&e&&!e.querySelector(".pending")&&l)return void t._addNewColumnDynamically()}const r=a.closest(".smart-kanban-list .item");if(r){const e=r.getAttribute("data-id"),a=t._userSelectionFor,s=t._prioritySelectionFor;if(a){const s=t.dataSourceMap,l=a.data[s.userId],r=JSON.parse(JSON.stringify(a.data));if(parseInt(a.data[s.userId])===parseInt(e)?a.data[s.userId]=null:a.data[s.userId]=e,t._updateUserIcon(a),t._closeList(t._userList,"_userSelectionFor"),a.data[s.userId]!==l){t.dataSource&&t.dataSource.virtualDataSource&&t._requestVirtualDataSource("update",a.data,(function(e){return e||(a.data[s.userId]=l,t._updateUserIcon(a)),e}));const e=a.data;if(t._currentUser.info){a.data[s.updatedUserId]=t._currentUser.info.id,a.data[s.updatedDate]=new Date;const l={user:t._currentUser.info.id,label:e[s.text],date:e[s.updatedDate]};e[s.userId]!==r[s.userId]&&(l.action="user",l.details={oldValue:r[s.userId],value:e[s.userId]},t.addHistory(e,l))}const o=JSON.parse(JSON.stringify(e));t.$.fireEvent("change",{task:a,id:o.id,value:o,oldValue:r}),t.$.fireEvent("taskUpdate",{id:o.id,value:o,oldValue:r}),t._autoSaveState("dataSource")}return}if(s){const e=t.dataSourceMap,a=s.data[e.priority],l=JSON.parse(JSON.stringify(s.data));if(s.data[e.priority]=r.getAttribute("priority"),t._closeList(t._priorityList,"_prioritySelectionFor"),s.data[e.priority]!==a){t._currentUser.info&&(s.data[e.updatedUserId]=t._currentUser.info.id,s.data[e.updatedDate]=new Date);const a=s.data,r=JSON.parse(JSON.stringify(a));if(t._currentUser.info){s.data[e.updatedUserId]=t._currentUser.info.id,s.data[e.updatedDate]=new Date;const r={user:t._currentUser.info.id,date:a[e.updatedDate]};a[e.priority]!==l[e.priority]&&(r.action="priority",r.details={oldValue:l[e.priority],value:a[e.priority]},t.addHistory(a,r))}t.$.fireEvent("change",{task:s,id:r.id,value:r,oldValue:l}),t.$.fireEvent("taskUpdate",{id:r.id,value:r,oldValue:l}),t._updateTaskPriority(s),t._autoSaveState("dataSource")}}const l=t._actionSelectionFor,o=t._columnActionSelectionFor;if(l){switch(parseFloat(e)){case 0:r.hasAttribute("edit")&&(t._actionsList.classList.contains("edit-comment")?(t._commentsList.textarea.value=l.comment.text,t._commentsList.textarea.focus(),t._commentsList.editing=l,l.parentElement.scrollTop=l.offsetTop):t.beginEdit(l));break;case 1:r.hasAttribute("copy")&&t.copyTask(l);break;case 2:r.hasAttribute("remove")&&(t._actionsList.classList.contains("edit-comment")?t._openDialog(l,"prompt","comment"):t.removeTask(l,!0))}return void t._closeList(t._actionsList,"_actionSelectionFor")}if(o){switch(parseFloat(e)){case 0:t._handleColumnEditing(o.dataField);break;case 1:{const e=t._columnToElement.get(o).querySelector(".smart-kanban-column-header-add");e?e.click():t._openDialog(o,"add","column");break}case 2:t.collapse(o);break;case 3:t._openDialog(o,"prompt","column");break;case 4:t.hide(o);break;case 5:t.showAllColumns()}return void t._closeList(t._columnActionsList,"columnActionSelectionFor")}}if(a.closest(".smart-kanban-list.comments")){const e=a.closest(".send");if(e){if(e.disabled)return;const a=JSON.parse(JSON.stringify(t._commentSelectionFor.data)),s=t._createComment();t._commentsList.textarea.value="",e.disabled=!0;const l=JSON.parse(JSON.stringify(t._commentSelectionFor.data));t.$.fireEvent("change",{task:t._commentSelectionFor,id:l.id,value:l,oldValue:a}),t.$.fireEvent("taskUpdate",{id:l.id,value:l,oldValue:a}),t.$.fireEvent("commentAdd",{id:l.id,value:s})}else if(a.classList.contains("remove-button")&&a.classList.contains("enabled")){const e=a.closest(".smart-comment");t._actionSelectionFor&&(t._actionSelectionFor===e||t._actionSelectionFor.classList.contains("smart-kanban-task")||t._actionsList.parentElement&&!t._actionsList.classList.contains("smart-visibility-hidden"))||t._openActionsList(a,void 0,e)}return}const o=a.closest(".smart-kanban-task");if(o)if(a.classList.contains("smart-kanban-task-user"))!t.userList||!t._currentUser.allowEdit||t._userSelectionFor&&(t._userSelectionFor===o||t._userList.parentElement&&!t._userList.classList.contains("smart-visibility-hidden"))||t._openUserList(a,o);else if(a.classList.contains("priority")&&t.priorityList)!t._priorityList||!t._currentUser.allowEdit||t._prioritySelectionFor&&(t._prioritySelectionFor===o||t._priorityList.parentElement&&!t._priorityList.classList.contains("smart-visibility-hidden"))||t._openPriorityList(a,o);else if(t.taskActions&&a.classList.contains("smart-kanban-task-actions"))t._actionSelectionFor&&(t._actionSelectionFor===o||t._actionSelectionFor.classList.contains("comment")||t._actionsList.parentElement&&!t._actionsList.classList.contains("smart-visibility-hidden"))||t._openActionsList(a,o);else if(t.taskComments&&a.classList.contains("smart-kanban-task-comments"))t.users.length>0&&(!t._commentSelectionFor||t._commentSelectionFor!==o&&(!t._commentsList.parentElement||t._commentsList.classList.contains("smart-visibility-hidden")))&&t._openCommentsList(a,o);else if((!t.taskSubTasksInput||!a.classList.contains("smart-kanban-task-input"))&&(!t.taskSubTasksInput||!a.classList.contains("smart-kanban-task-subtasks")||"singleClick"!==t.editMode)&&(!o||o.data)&&(t.$.fireEvent("taskClick",{id:o.data.id,value:o.data,element:o}),t._preventSelection||t._selectTask(e,o),"singleClick"!==t.editMode||t._dragDetails||"INPUT"===a.nodeName||"TEXTAREA"===a.nodeName||a.classList.contains("smart-kanban-task-subtasks-container")||"IMG"===a.nodeName||t.beginEdit(o),e.type))if(clearTimeout(t._dblclickObject.timeout),t._dblclickObject.numberOfClicks++,2===t._dblclickObject.numberOfClicks){if(t._dblclickObject.numberOfClicks=0,o.hasAttribute("selected")||t._selectTask(e,o),t.$.fireEvent("taskDoubleClick",{id:o.data.id,value:o.data,element:o}).defaultPrevented)return;"doubleClick"===t.editMode&&t.beginEdit(o)}else t._dblclickObject.timeout=setTimeout((function(){t._dblclickObject.numberOfClicks=0}),300)}_selectTask(e,t){const a=this,s=a.selectionMode,l=()=>{a._selectedTasks.forEach((e=>{if(e!==t.data.id){const t=a.querySelector('[data-id="'+e+'"]');t&&t.removeAttribute("selected")}}))};function r(){l(),t.hasAttribute("selected")||(t.setAttribute("selected",""),a._selectedTasks=[t.data.id]),a._selectionStart=t.data.id,a._selectionInView=t.closest("smart-scroll-viewer"),a._autoSaveState("selection"),a._focusTask(t)}if("zeroOrOne"===s)l(),t.hasAttribute("selected")?(a._focusTask(t),t.removeAttribute("selected"),a._selectedTasks=[],delete a._selectionInView):(t.setAttribute("selected",""),a._selectedTasks=[t.data.id],a._selectionStart=t.data.id,a._selectionInView=t.closest("smart-scroll-viewer"),a._focusTask(t)),a.virtualization&&a._refreshColumns();else{if(!e.ctrlKey&&!e.shiftKey&&!e.metaKey||0===a._selectedTasks.length||t.closest("smart-scroll-viewer")!==a._selectionInView)return void r();if(e.ctrlKey||e.metaKey)t.hasAttribute("selected")?(t.removeAttribute("selected"),a._selectedTasks=a._selectedTasks.filter((e=>e!==t.data.id))):(t.setAttribute("selected",""),a._selectedTasks.push(t.data.id),a._selectionStart=t.data.id);else if(e.shiftKey){if(t&&t.id===a._selectionStart)return a._selectedTasks.length>1&&r(),void(a.virtualization&&a._refreshColumns());const e=t[a.dataSourceMap.status],s=a._getTasksByDataField(e),l=a.getTask(a._selectionStart);let o=s.indexOf(l),i=s.indexOf(t.id);const n=o;o=Math.min(o,i),i=Math.max(n,i),a._selectedTasks=[],s.forEach(((e,t)=>{const s=a.querySelector('[data-id="'+e.id+'"]');t>=o&&t<=i&&!e.filteredOut?(s&&s.setAttribute("selected",""),a._selectedTasks.push(e.id)):s&&s.removeAttribute("selected")}))}a._focusTask(t)}a.virtualization&&a._refreshColumns(),a._autoSaveState("selection")}_processDataSource(){const e=this;let t=e.dataSource;if(0!==e.columns.length&&null!=t){if(t instanceof Smart.DataAdapter){if(t.virtualDataSource)return void e._requestVirtualDataSource("dataBind");t=t.dataSource}t.length>500&&(e.virtualization=!0),t.forEach((t=>{e._createTask(t)})),e.virtualization&&(e._measureCardHeight(),e._refreshColumns()),e.whenRendered((()=>e._allColumns.forEach((t=>e._refreshScrollViewer(t)))))}}_requestVirtualDataSource(e,t,a){const s=this,l=s.dataSourceMap,r=[],o=[],i={},n=s._appliedFiltering;let d=null;if(n&&n.filterGroups.length>0&&(n.filterGroups.forEach((e=>o[e[0]]=e[1])),o.length=n.filterGroups.length,d=n.operator),s._appliedSorting&&s._appliedSorting.dataFields.length>0&&(s._appliedSorting.dataFields.forEach(((e,t)=>{let a=s._appliedSorting.orderBy[t].replace("ending","");r[e]={sortOrder:a,sortIndex:t}})),r.length=s._appliedSorting.dataFields.length),void 0!==t){const e=Object.assign({},t);e[l.checklist]=JSON.stringify(e[l.checklist]),e[l.history]=JSON.stringify(e[l.history],(function(e,t){return"date"===e?new Date(t).toISOString().slice(0,19).replace("T"," "):t})),e[l.comments]=JSON.stringify(e[l.comments],(function(e,t){return"time"===e?new Date(t).toISOString().slice(0,19).replace("T"," "):t})),e[l.updatedDate]&&(e[l.updatedDate]=e[l.updatedDate].toISOString().slice(0,10)),e[l.createdDate]&&(e[l.createdDate]=e[l.createdDate].toISOString().slice(0,10)),e[l.dueDate]&&(e[l.dueDate]=e[l.dueDate].toISOString().slice(0,10)),e[l.startDate]&&(e[l.startDate]=e[l.startDate].toISOString().slice(0,10)),i.row=e}s.dataSource.onVirtualDataSourceRequested((function(t){let l=!0;-1!==["add","update","remove"].indexOf(e)&&a&&(l=a(t.result),"add"!==e)||l&&(Array.from(s.$.container.querySelectorAll("smart-scroll-viewer.smart-kanban-column-content-tasks")).forEach((e=>e.clearContent())),s.dataSource.dataSource.forEach((e=>{s._createTask(e)})),s._allColumns.forEach((e=>s._refreshScrollViewer(e))),s._autoSaveState("dataSource"))}),{first:0,last:0,sorting:r,filtering:o,filterOperator:d,grouping:[],edit:i,action:e})}_setUserList(){const e=this,t=document.createElement("div");t.id=e.id+"UserList",t.className="smart-kanban-list users smart-visibility-hidden",t.setAttribute("role","listbox"),e.disabled||e.unfocusable||(t.tabIndex=0),e.users.forEach((e=>{const a=document.createElement("div"),s=e?e.image:null,l=s?`background-image: url('${s}');`:"";a.className="item",a.innerHTML=`<div class="icon" style="${l}"></div><div class="name">${e.name}</div>`,a.setAttribute("data-id",e.id),a.setAttribute("role","option"),t.appendChild(a)})),e._userList=t}_setPriorityList(){const e=this,t=document.createElement("div");t.id=e.id+"PriorityList",t.className="smart-kanban-list priority smart-visibility-hidden",t.setAttribute("role","listbox"),e.disabled||e.unfocusable||(t.tabIndex=0),e._getPriority().forEach((e=>{const a=document.createElement("div");a.className="item",e.menuLabel?a.innerHTML=e.menuLabel:a.innerHTML=`<div priority="${e.value}" class="smart-kanban-task-text">${e.menuIcon}${e.label}</div>`,a.setAttribute("priority",e.value),a.setAttribute("role","option"),t.appendChild(a)})),e._priorityList=t;const a=e._dialog;a&&a.editPanelPopulated&&(a.editors.priority.dataSource=e._getPriority())}_openList(e,t,a){const s=this,l=e.getBoundingClientRect();let r,o,i=l.left,n=l.top+e.offsetHeight;a=s.rightToLeft?!a:a,1===window.devicePixelRatio?(r=document.documentElement.clientWidth,o=document.documentElement.clientHeight):(r=window.innerWidth,o=window.innerHeight),t.classList.add("dialog"),document.body.appendChild(t),a&&(i=l.right-t.offsetWidth),i+t.offsetWidth>r&&(i=r-t.offsetWidth),n+t.offsetHeight>o&&(n=o-t.offsetHeight),t.style.left=Math.max(0,i)+"px",t.style.top=n+"px",t.classList.remove("smart-visibility-hidden"),e.setAttribute("aria-expanded",!0),e.setAttribute("aria-controls",t.id),s.unfocusable||requestAnimationFrame((function e(){0===t.getBoundingClientRect().height?requestAnimationFrame(e):t.focus()})),t.openedFrom=e,t.onclick=e=>{s._containerClickHandler(e)}}_openUserList(e,t){const a=this;if(0===a.users.length)return;const s=t.data[a.dataSourceMap.userId],l=a._userList,r=l.querySelector(".selected");if(r&&(r.classList.remove("selected"),r.removeAttribute("aria-selected")),a._openList(e,l),null!==s){const e=Array.from(l.children).find((e=>e.getAttribute("data-id")===s.toString()));e&&(e.classList.add("selected"),e.setAttribute("aria-selected",!0),l.scrollTop=e.offsetTop)}a._userSelectionFor=t}_openPriorityList(e,t){const a=this,s=t.data[a.dataSourceMap.priority],l=a._priorityList,r=l.querySelector(".selected");if(r&&(r.classList.remove("selected"),r.removeAttribute("aria-selected")),a._openList(e,l),null!=s){const e=Array.from(l.children).find((e=>e.getAttribute("priority")===s.toString()));e&&(e.classList.add("selected"),e.setAttribute("aria-selected",!0),l.scrollTop=e.offsetTop)}a._prioritySelectionFor=t}_closeList(e,t){const a=this;if(!e||!e.parentElement)return;const s=a.$.container.querySelector(`[aria-expanded="true"][aria-controls="${e.id}"]`);e.classList.add("smart-visibility-hidden"),requestAnimationFrame((function s(){e.classList.contains("smart-visibility-hidden")&&(e.getBoundingClientRect().height>0?requestAnimationFrame(s):(e.remove(),delete e.openedFrom,delete a[t]))})),s&&(s.removeAttribute("aria-expanded"),s.removeAttribute("aria-controls"))}_setActionsList(){const e=this,t=document.createElement("div");if(t.id=e.id+"ActionsList",t.className="smart-kanban-list actions smart-visibility-hidden",t.setAttribute("role","menu"),e.disabled||e.unfocusable||(t.tabIndex=0),t.innerHTML=`<div class="item" edit data-id="0" role="menuitem"><div class="name">${e.localize("edit")}</div></div>\n<div class="item" copy data-id="1" role="menuitem"><div class="name">${e.localize("copy")}</div></div>\n<div class="item" remove data-id="2" role="menuitem"><div class="name">${e.localize("remove")}</div></div>`,e.taskActionsRendered){e.taskActionsRendered(t);const a=Array.from(t.children);for(let e=0;e<a.length;e++){const t=a[e];t.classList.add("item"),t.setAttribute("data-id",e),t.setAttribute("role","menuitem"),t.firstElementChild&&t.firstElementChild.classList.add("name")}}e._actionsList=t}_setColumnActionsList(){const e=this,t=document.createElement("div");t.id=e.id+"ColumnActionsList",t.className="smart-kanban-list actions smart-visibility-hidden",t.setAttribute("role","menu"),e.disabled||e.unfocusable||(t.tabIndex=0),t.innerHTML=`<div class="item" data-id="0" role="menuitem"><div class="name">${e.localize("edit")}</div></div>\n            <div class="item" data-id="1" role="menuitem"><div class="name">${e.localize("addNewTask")}</div></div>\n            <div class="item" data-id="2" role="menuitem"><div class="name">${e.localize("collapse")}</div></div>\n            <div class="item" data-id="3" role="menuitem"><div class="name">${e.localize("removeColumn")}</div></div>\n            <div class="item" data-id="4" role="menuitem"><div class="name">${e.localize("hideColumn")}</div></div>\n            <div class="item" data-id="5" role="menuitem"><div class="name">${e.localize("showAllColumns")}</div></div>`,e._columnActionsList=t}_openActionsList(e,t,a){const s=this,l=s._currentUser,r=s._actionsList;s._openList(e,r,a),r.classList.toggle("edit-comment",!!a),s._actionSelectionFor=t||a,r.children[0]&&r.children[0].hasAttribute("edit")&&(t&&!l.allowEdit?r.children[0].classList.add("smart-hidden"):r.children[0].classList.remove("smart-hidden")),r.children[1]&&r.children[1].hasAttribute("add")&&(t&&!l.allowAdd?r.children[1].classList.add("smart-hidden"):r.children[1].classList.remove("smart-hidden")),r.children[2]&&r.children[0].hasAttribute("remove")&&(t&&!l.allowRemove?r.children[2].classList.add("smart-hidden"):r.children[2].classList.remove("smart-hidden")),Array.from(r.children).forEach((e=>e.classList.remove("selected")))}_openColumnActionsList(e,t){const a=this,s=a._columnActionsList,l=s.children;a.allowColumnEdit&&t.editable&&"header"!==a.columnEditMode?l[0].classList.remove("smart-hidden"):l[0].classList.add("smart-hidden"),a.addNewButton&&t.addNewButton?l[1].classList.remove("smart-hidden"):l[1].classList.add("smart-hidden"),a.allowColumnRemove&&t.allowRemove&&a._allColumns.length>1?l[3].classList.remove("smart-hidden"):l[3].classList.add("smart-hidden"),a.collapsible&&t.collapsible?l[2].classList.remove("smart-hidden"):l[2].classList.add("smart-hidden"),a.allowColumnHide&&t.allowHide&&a._allColumns.length>1?(l[4].classList.remove("smart-hidden"),l[5].classList.remove("smart-hidden")):(l[4].classList.add("smart-hidden"),l[5].classList.add("smart-hidden")),a._openList(e,s),a._columnActionSelectionFor=t,Array.from(s.children).forEach((e=>e.classList.remove("selected")))}_setCommentsList(){const e=this,t=document.createElement("div");t.id=e.id+"CommentsList",t.className="smart-kanban-list comments smart-visibility-hidden",t.setAttribute("role","dialog"),e.disabled||e.unfocusable||(t.tabIndex=0),t.innerHTML=`<div class="smart-kanban-comments" role="list"></div>\n<div class="smart-kanban-new-comment" role="presentation">\n    <textarea placeholder="${e.localize("newComment")}"></textarea>\n    <smart-button class="send primary" disabled${e._rtlAttr}>${e.localize("send")}</smart-button>\n</div>`;const a=t.querySelector("textarea"),s=t.querySelector("smart-button");s.tabIndex=0,a.onfocus=()=>{t.classList.add("expanded"),s.disabled=""===a.value},a.onblur=e=>{s.contains(e.relatedTarget)||t.classList.remove("expanded")},a.onkeyup=()=>{s.disabled=""===a.value},a.oncut=()=>{s.disabled=""===a.value},a.onpaste=()=>{s.disabled=""===a.value},t.textarea=a,t.button=s,e._commentsList=t}_openCommentsList(e,t){const a=this,s=a._commentsList;s.classList.remove("expanded"),s.firstElementChild.innerHTML="",s.textarea.value="",s.textarea.disabled=!a._currentUser.allowComment,a.unfocusable?s.textarea.tabIndex=-1:s.textarea.removeAttribute("tabindex"),delete s.editing,t.data[a.dataSourceMap.comments].forEach((e=>a._createComment(e))),a._openList(e,s),a._commentSelectionFor=t}_getCommentsList(e){const t=this,a=t._commentsList;return a.classList.remove("expanded"),a.firstElementChild.innerHTML="",a.textarea.value="",a.textarea.disabled=!t._currentUser.allowComment,t.unfocusable?a.textarea.tabIndex=-1:a.textarea.removeAttribute("tabindex"),delete a.editing,e.data[t.dataSourceMap.comments].forEach((e=>t._createComment(e))),t._commentSelectionFor=e,a.classList.remove("smart-visibility-hidden"),a}_createComment(e){const t=this,a=document.createElement("div");let s,l;function r(){const r=t._commentsList.firstElementChild,o=l?l.image:null,i=l?l.name||l.id:t.localize("guestUser"),n=l?l.name:t.localize("guestUser");a.classList="smart-comment",a.setAttribute("role","listitem");const d=o?`background-image: url('${o}');`:"";a.innerHTML=`<div class="comment-indent" role="presentation">\n    <div class="user-icon" style="${d}" role="img" aria-label="Icon of user ${i}"></div>\n</div>\n<div class="comment-main" role="presentation">\n    <div class="comment-header" role="presentation">\n        <div class="user-name" aria-label="User name">${n}</div>\n        <div class="time" aria-label="Comment time">${e.time?new Smart.Utilities.DateTime(e.time).toString(t.formatStringTime):""}</div>\n        <div class="remove-button${t._currentUser&&t._currentUser.info&&l.id===t._currentUser.info.id&&t._currentUser.allowComment?" enabled":""}"${t._tabindex} role="button" aria-haspopup="menu" aria-label="Comment settings"></div>\n    </div>\n    <div class="comment-body" aria-label="Comment text">${e.text||""}</div >\n</div>`,a.comment=e,o||a.querySelector(".user-icon").classList.add("empty"),r.appendChild(a),s&&(r.scrollTop=r.scrollHeight-r.offsetHeight)}if(e)l=t.users.find((t=>t.id===e.userId));else{const a=t.dataSourceMap,o=t.dataSource&&t.dataSource.virtualDataSource,i=t._commentsList.textarea.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/\\/g,""),n=t._commentsList.editing,d=t._commentSelectionFor.data,c=JSON.parse(JSON.stringify(d));if(n){if(o){const e=Object.assign({},d);e[a.comments]=e[a.comments].slice(0),e[a.comments][e[a.comments].indexOf(n.comment)]=Object.assign({},n.comment,{text:i}),t._requestVirtualDataSource("update",e,(function(a){return a&&(t._commentSelectionFor.data=e,n.querySelector(".comment-body").innerHTML=i),delete t._commentsList.editing,a}))}else n.querySelector(".comment-body").innerHTML=i,n.comment.text=i,delete t._commentsList.editing;return t.$.fireEvent("commentUpdate",{id:d.id,value:n.comment}),t.$.fireEvent("taskUpdate",{id:d.id,value:d,oldValue:c}),void t.$.fireEvent("change",{task:t._commentSelectionFor,id:d.id,value:d,oldValue:c})}if(s=!0,e={text:i,id:function(){const e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()}(),userId:t._currentUser&&t._currentUser.info?t._currentUser.info.id:-1,time:new Date},l=t._currentUser?t._currentUser.info:null,o){const s=Object.assign({},d);s[a.comments]=s[a.comments].slice(0),s[a.comments].push(e),t._requestVirtualDataSource("update",s,(function(e){return e&&(t._commentSelectionFor.data=s,t._commentSelectionFor.querySelector(".smart-kanban-task-comments").setAttribute("num",s[a.comments].length||""),r()),e}))}else d[a.comments].push(e),t._commentSelectionFor.querySelector(".smart-kanban-task-comments").setAttribute("num",d[a.comments].length||"")}return e.time instanceof Date==0&&(e.time=new Date(e.time),e.time.setTime(e.time.getTime()-1*e.time.getTimezoneOffset()*60*1e3)),r(),e}_getTaskIndexByPosition(e,t){const a=(e,t)=>{const a=e.top,s=e.top+e.height,l=a<=t&&s>t;return 0!==e.height&&l};return(t=>{let s=0,l=t.length-1;if(e<=0)return 0;const r=t[t.length-1];if(-1!==r.top&&r.top<=e)return t.length-1;for(;;){const r=Math.floor((s+l)/2),o=t[r];if(a(o,e))return r;o.top<e?s=r+1:o.top>e?l=r-1:s=r+1}})(t)}_refreshColumns(){const e=this;e.virtualization&&e._allColumns.forEach((t=>{e._refreshColumn(t.dataField)}))}_refreshColumn(e){const t=this.getColumn(e),a=this._columnToElement.get(t);if(!a)return;const s=a.querySelector("smart-scroll-viewer");this._refreshScrollHeight(s,e)}_getTasksByDataField(e){const t=this;let a=t.tasksByDataField[e];return a?a._filtered?a._filtered:a._sorted?a._sorted:a:(t.tasksByDataField[e]=[],t.tasksByDataField[e])}_refreshEmptyColumnState(e,t){const a=this;e&&(e.querySelector(".smart-kanban-task")||e.querySelector(".smart-kanban-task")&&!t?(e.removeAttribute("empty",a.localize("empty")),e.classList.remove("empty")):(e.setAttribute("empty",a.localize("empty")),e.classList.add("empty")))}_refreshScrollHeight(e,t){const a=this;if(a._refreshEmptyColumnState(e,t),!a.virtualization)return;const s=a._getTasksByDataField(t);if(!s)return;const l=a._autoCardHeight?a._autoCardHeight:a.cardHeight;e.scrollHeight=e.virtualScrollHeight=s.length*l-e.offsetHeight;for(let e=0;e<s.length;e++){const t=s[e];t.top=e*l,t.height=l}const r=e.querySelector(".smart-scroll-viewer-content-container"),o=e=>{const l=a._getTaskIndexByPosition(e,s),o=a.uiTasksByDataField[t].length;for(let e=0;e<o;e++){const o=s[l+e],i=a.uiTasksByDataField[t][e];i&&(a._dragDetails&&(i.classList.remove("dragged"),o&&a._dragDetails.ItemsData.forEach((e=>{e.id===o.id&&i.classList.add("dragged")}))),o?i.classList.remove("smart-hidden"):i.classList.add("smart-hidden"),0===e&&(r.style.marginTop=o?o.top+"px":"0px"),o)&&(i.hasAttribute("selected")&&i.removeAttribute("selected"),i.hasAttribute("focus")&&i.removeAttribute("focus"),JSON.stringify(o)!==JSON.stringify(i.data)&&(i.data=o,a._renderTask(i)),a._selectedTasks&&a._selectedTasks.indexOf(o.id)>=0&&i.setAttribute("selected",""),a._focusedTask===o.id&&i.setAttribute("focus",""))}};e.onVerticalChange=e=>{const t=e.detail.value;o(t)},a.uiTasksByDataField[t]||(a.uiTasksByDataField[t]=[]);const i=Math.round(e.offsetHeight/l)+2,n=a.uiTasksByDataField[t].length;if(0===n||n<i){const r=Math.round(e.offsetHeight/l)+2;for(let e=0;e<r;e++){const l=s[e];if(!l)continue;const r=a._createVirtualTask(l);a.uiTasksByDataField[t].push(r)}e.refresh(),e.scrollHeight=e.virtualScrollHeight=s.length*l-e.offsetHeight,o(e.scrollTop)}else o(e.scrollTop)}_createVirtualTask(e,t){const a=this,s=a.dataSourceMap,l=a._allColumns.find((t=>t.dataField===e[s.status]));if(!l)return;const r=document.createElement("div"),o=a._columnToElement.get(l),i=a.getTaskScrollViewer(o,e);return void 0===e[s.id]&&(e[s.id]=Math.floor(9e4*Math.random()+1e4)),r.className="smart-kanban-task smart-unselectable",r.setAttribute("role","listitem"),r.setAttribute("data-id",e[s.id]),a._currentUser.info&&(void 0===e[s.createdUserId]?(e[s.createdUserId]=a._currentUser.info.id,e[s.createdDate]=new Date):e[s.createdDate]||(e[s.createdDate]=new Date),e[s.history]=[],a.addHistory(e,{action:"created",user:a._currentUser.info.id,details:{value:e[s.text]},date:e[s.createdDate]})),r.data=e,r.column=l,a._renderTask(r),e.class&&"string"==typeof e.class&&r.classList.add(e.class),i.appendChild(r),a._updateTaskColor(r),t&&(l.collapsed?i.toRefresh=!0:i.refresh()),r}_measureCardHeight(){const e=this,t=Object.keys(e.tasksByDataField);if(0===t.length||0===e.columns.length)return null;if(null===e.cardHeight&&!e._autoCardHeight){const a=e.tasksByDataField[t[0]],s=e._createVirtualTask(a[0]);e._renderTask(s),a.class&&"string"==typeof a.class&&s.classList.add(a.class);const l=e.columns[0],r=e._columnToElement.get(l),o=e.getTaskScrollViewer(r,a);o.appendChild(s);const i=o.querySelector(".smart-scroll-viewer-content-container"),n=getComputedStyle(i).rowGap;e._autoCardHeight=s.offsetHeight+parseInt(n),s.remove()}}_createTask(e,t,a){const s=this,l=s.dataSourceMap,r=s._allColumns.find((t=>t.dataField===e[l.status]));if(!r)return;const o=document.createElement("div"),i=s._columnToElement.get(r),n=s.getTaskScrollViewer(i,e);if(void 0===e[l.id]&&(e[l.id]=Math.floor(9e4*Math.random()+1e4)),o.className="smart-kanban-task smart-unselectable",o.setAttribute("role","listitem"),o.setAttribute("data-id",e[l.id]),s._currentUser&&s._currentUser.info&&(void 0===e[l.createdUserId]?(e[l.createdUserId]=s._currentUser.info.id,e[l.createdDate]=new Date):e[l.createdDate]||(e[l.createdDate]=new Date),e[l.history]||(e[l.history]=[],s.addHistory(e,{action:"created",user:s._currentUser.info.id,details:{value:e[l.text]},date:e[l.createdDate]}))),o.data=e,o.column=r,s.tasksByDataField[r.dataField]||(s.tasksByDataField[r.dataField]=[]),a>=0?s.tasksByDataField[r.dataField].splice(a,0,e):s.tasksByDataField[r.dataField].push(e),s.taskById[e.id]=e,!s.virtualization){if(s._renderTask(o),e.class&&"string"==typeof e.class&&o.classList.add(e.class),a>=0){const e=n.querySelector(".smart-kanban-task");e?e.parentElement.insertBefore(o,e):n.appendChild(o)}else n.appendChild(o);return s._updateTaskColor(o),t&&(r.collapsed?n.toRefresh=!0:n.refresh()),o}}getTaskScrollViewer(e,t){const a=this,s=a.dataSourceMap;let l;return a._hasSwimlane(e.index)?void 0!==t[s.swimlane]&&a.swimlanes.find((e=>e.dataField===t[s.swimlane]))?l=e.querySelector(`smart-scroll-viewer[swimlane="${t[s.swimlane]}"]`):(l=e.querySelector("smart-scroll-viewer"),t[s.swimlane]=l.getAttribute("swimlane")):(l=e.querySelector("smart-scroll-viewer"),delete t[s.swimlane]),l}_renderTask(e){const t=this;t._applyTaskTemplate(e),t._updateUserIcon(e),t._updateTaskChecked(e),t._updateTaskProgress(e),t._updateTaskDueDate(e),e.parentElement&&t._updateTaskColor(e),t._updateTaskPriority(e),e.column&&t.columnSummary&&t._updateColumnSummary(e.column),t.onTaskRender&&t.onTaskRender(e,e.data)}_refreshSummaries(){const e=this,t=e.querySelectorAll(".smart-kanban-column");for(let a=0;a<t.length;a++){const s=t[a].column;e._updateColumnSummary(s)}}_updateColumnSummary(e){const t=this,a=t._columnToElement.get(e);if(!a||!t.columnSummary)return;const s=t._getColumnSummary(e),l=a.querySelector(".summary");if(l&&(l.innerHTML=s),t.columnFooter){const l=a.querySelector(".smart-kanban-column-footer");if(s.length){let e=parseInt(s.replace("(","").replace(")","").trim());l.innerHTML=1===e?t.localize("tasksSummaryOne"):t.localize("tasksSummary",{summary:e})}else l.innerHTML="";t.onColumnFooterRender&&t.onColumnFooterRender(l,e,e.dataField)}a.removeAttribute("wip-min-error"),a.removeAttribute("wip-max-error"),void 0!==e.min&&(a.setAttribute("min",e.min),s.length?parseInt(s.replace("(","").replace(")","").trim())<e.min&&a.setAttribute("wip-min-error",""):0<e.min&&a.setAttribute("wip-min-error","")),void 0!==e.max&&(a.setAttribute("max",e.max),s.length)&&parseInt(s.replace("(","").replace(")","").trim())>e.max&&a.setAttribute("wip-max-error","")}_createAttachment(e){const t=e.target.classList.contains("attachments")?e.target:e.target.closest(".attachments"),a=t.getAttribute("data-field"),s=t.closest("smart-kanban"),l=s._fieldAttachmentValue[a],r=l&&"string"==typeof l?JSON.parse(l):l,o=e.target.closest(".item");if(!o)return;const i=o.getAttribute("value"),n=l.findIndex((e=>e.value===i));if(r[n]){const e=document.createElement("a");if(r[n].value.indexOf(window.location.host)>=0)fetch(r[n].value).then((e=>e.blob())).then((t=>{const a=URL.createObjectURL(t);e.download=r[n].label,e.href=a,e.click()}));else{if(r[n].value.indexOf("base64")>=0){const t=s._getFileFromBase64(r[n].value);e.href=URL.createObjectURL(t)}else e.href=r[n].value;e.target="_blank",e.click()}}e.stopPropagation(),e.preventDefault()}_createImageModal(e,t){const a=this,s=document.createElement("smart-window");s.animation=a.animation,s.headerButtons=["close"],s.rightToLeft=a.rightToLeft,s.resizeMode="none",s.theme=a.theme,s.style.height="auto",s.style.width="auto",s.style.maxWidth="1000px",s.style.maxHeight="1000px",document.body.appendChild(s),s.onclose=()=>{document.body.removeChild(s)},s.innerHTML="",s.label=e.title;const l=e.cloneNode(!0);e.hasAttribute("value")&&(l.src=e.getAttribute("value")),l.removeAttribute("onpointerdown"),l.removeAttribute("width"),l.removeAttribute("height"),l.style.maxWidth="800px",l.style.maxHeight="800px",s.appendChild(l),s.open(),t.stopPropagation(),t.preventDefault()}_applyTagsContent(e,t,a){const s=this;let l=s.tags;const r=s.dataSourceMap;l||(l=[]);let o="";if(e&&e.indexOf&&e.indexOf("{")>=0&&(e=JSON.parse(e)),e&&"string"==typeof e){if("[]"===e)return t[r.tags]="",o;e=e.split(",");for(let t=0;t<e.length;t++)e[t]=e[t].trim();l&&l.length>0?(e=e.filter((e=>{if(-1!==l.indexOf(e))return!0})),t[r.tags]=e.join(", ")):s.allowCustomTags?e.forEach((e=>{-1===s._customTags.indexOf(e)&&"[objectObject]"!==e&&s._customTags.push(e)})):e=[],o=e.map((e=>`<span class="smart-kanban-task-tag" role="listitem">${e}</span>`)).join("")}else e&&"object"==typeof e?(Array.isArray(e)||(e=[e],t[r.tags]=e),l.length>0?(s.allowCustomTags?e.forEach((e=>{if(-1===s._customTags.indexOf(e)&&"[objectObject]"!==e){let t=!0;if(s.tags)for(let a in s.tags){const l=s.tags[a];(e===l||JSON.stringify(e)===JSON.stringify(l))&&(t=!1)}t&&s._customTags.push(e)}})):e=e.filter((e=>{if(-1!==l.indexOf(e))return!0;if(e.value){let t=!1;if(l.find((a=>{a===e.value&&(t=!0),a.value===e.value&&(t=!0)})),t)return!0}})),t[r.tags]=e):s.allowCustomTags?e.forEach((e=>{-1===s._customTags.indexOf(e)&&"[objectObject]"!==e&&s._customTags.push(e)})):(e=[],t[r.tags]=[]),o=e.map((e=>{if(e.color){const t=e.color||"rgba(var(--smart-primary-rgb), 0.15)",a=document.createElement("div");document.body.appendChild(a),a.style.backgroundColor=t;const s=getComputedStyle(a).backgroundColor;return a.remove(),`<span style="color: ${new Smart.Color(s).getInvertedColor()}; background: ${t} " class="smart-kanban-task-tag" role="listitem">${e.label}</span>`}return`<span class="smart-kanban-task-tag" role="listitem">${"string"==typeof e?e:e.label}</span>`})).join("")):t[r.tags]="";return o}_applyTaskTemplate(e){const t=this,a=t.dataSourceMap,s=(t.tags,e.data),l=t._tabindex;let r=s[a.text],o=s[a.description],i=s[a.tags],n="",d=r;void 0===r&&(r="",s[a.text]="",d=r),void 0===o&&(o="",s[a.description]=""),r=t._applyTextTemplate(r,s,e),n=t._applyTagsContent(i,s,e),"string"==typeof s[a.priority]&&(s[a.priority]=s[a.priority].toLowerCase());const c=t._getPriority();let u=c.findIndex((e=>e.value===s[a.priority]));const m=c.length>0&&u>=0?c[u]:null;s[a.comments]&&Array.isArray(s[a.comments])||(s[a.comments]=[]);const p=t.localize(s[a.priority])+" "+t.localize("priority");let h=d?`${d}: ${p}`:`${p}`;t.taskPriority||(h=d);let g=`<div class="smart-kanban-task-cover"></div><div title="${h}" class="smart-kanban-task-content" role="presentation">\n    <div class="smart-kanban-task-text">${r}`;g+=m?`${m.menuIcon}`:'<span style="margin-left: 0px; margin-right: 5px;" class="priority"></span>';let f=s[a.description].replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;");g+=`</div>\n    <div class="smart-kanban-task-user"${l} role="button" aria-haspopup="listbox"></div>\n</div>\n<div class="smart-kanban-task-info" role="presentation">\n    <div class="smart-kanban-task-progress-container">\n        <div class="smart-kanban-task-progress" role="progressbar" aria-label="Task progress" aria-valuemin="0" aria-valuemax="100"></div>\n        <div class="smart-kanban-task-checked" aria-label="Completed sub-tasks"></div>\n    </div>\n    <div class="smart-kanban-task-due" aria-label="Task due date"></div>\n</div>\n<div class="smart-kanban-task-fields"></div>\n<div class="smart-hidden smart-kanban-task-subtasks">\n    <div class="smart-kanban-task-subtasks-container"></div>\n    <div><input class="smart-kanban-task-input smart-input" placeholder="${t.localize("newSubtask")}"/></div>\n</div>\n<div class="smart-hidden smart-kanban-task-custom-fields"></div>\n<div class="smart-kanban-task-footer" role="toolbar" aria-label="Task footer">\n    <div class="smart-kanban-task-tags" role="list" aria-label="Tags list">${n}</div>\n    <div class="smart-kanban-task-edit smart-hidden"${l} title="${t.localize("edit")}" role="button" aria-label="Edit"></div>\n    <div title="${t.localize("actionsList")}" class="smart-kanban-task-actions"${l} role="button" aria-haspopup="menu" aria-label="Open actions list"></div>\n    <div class="smart-kanban-task-comments"${l} num="${s[a.comments].length||""}" role="button" aria-haspopup="dialog" aria-label="Open comments list"></div>\n    <div class="smart-kanban-task-description smart-hidden"${l} title="${t.localize("taskDescription",{value:f})}" num="${s[a.description]?s[a.description].length:""}" role="button" aria-label="Show description"></div>\n</div>`,e.innerHTML=g,e.setAttribute("aria-label",s[a.text]);const b=e.querySelector(".smart-kanban-task-description");s[a.description]?b.classList.remove("smart-hidden"):b.classList.add("smart-hidden");const v=e.querySelector(".smart-kanban-task-edit");t.editable?v.classList.remove("smart-hidden"):v.classList.add("smart-hidden"),v.onpointerdown=a=>{t.beginEdit(e),a.preventDefault(),a.stopPropagation()},e.onmousemove=()=>{Smart.Kanban.kanbanTaskDragged&&t.allowDropPlaceholder&&setTimeout((()=>{const a=e.classList.contains("before"),s=e.classList.contains("after");(a||s)&&(Smart.Kanban.dropOverTask&&Smart.Kanban.dropOverTask!==e&&delete Smart.Kanban.isBefore,Smart.Kanban.isBefore!==a&&(Smart.Kanban.isBefore=a,Smart.Kanban.dropOverTask=e,(a=>{e.classList.add("smart-kanban-task-placeholder"),t._dropAreaTimer&&clearTimeout(t._dropAreaTimer),t._dropAreaTimer=setTimeout((()=>{setTimeout((()=>{document.querySelectorAll(".smart-kanban-task-placeholder").forEach((e=>{e.style.marginTop=e.style.marginBottom="0px"}));const s=e.closest(".smart-kanban-column");if(s&&s.hasAttribute("orientation")&&"horizontal"!==s.getAttribute("orientation")){const s=t._dragDetails?t._dragDetails.Item:null;e!==s&&(a?e.previousElementSibling!==s&&(e.style.marginTop="100px"):e.nextElementSibling!==s&&(e.style.marginBottom="100px"))}t._refreshButtonsAndSummaries()}),20)}),20)})(a)))}))},t._updateTaskCustomFields(e),t._updateTaskSubtasks(e)}_updateTaskCustomFields(e){const t=this,a=e.data;if(t.taskCustomFieldsHide){const t=e.querySelector(".smart-kanban-task-custom-fields");t&&t.classList.remove("smart-hidden")}else if(t.taskCustomFields.length>0&&!t.taskCustomFieldsHide){const s=e.querySelector(".smart-kanban-task-custom-fields");s.classList.remove("smart-hidden");for(let l=0;l<t.taskCustomFields.length;l++){const r=t.taskCustomFields[l];let o=a[r.dataField],i="";if(!t.dataSourceMap[r.dataField]&&"password"!==r.editor)if(null!=o&&!1!==r.visible){if(void 0===r.visible&&(r.visible=!0),void 0===r.allowHide&&(r.allowHide=!0),"string"==typeof o&&(!r.dataSource||r.dataSource&&0===r.dataSource.length)&&o.length>50){if(o.indexOf("base64")>=0&&"image"===r.editor){o=JSON.parse(o),window.Smart._createSmartImageModal=t._createImageModal;let a="";for(let e=0;e<o.length;e++){const t=o[e];a+=`<img style="margin-left: 5px;" onpointerdown="Smart._createSmartImageModal(this, event)" src="${t.value}" title="${t.label}"/>`}if(o=a,r.cover){const t=e.querySelector(".smart-kanban-task-cover");t.classList.add("smart-kanban-task-cover-content"),t.innerHTML=o}}else if(r.image&&o.indexOf("http")>=0){if(window.Smart._createSmartImageModal=t._createImageModal,o.indexOf(",")>=0){let e="";o=o.split(",");for(let t=0;t<o.length;t++)e+=`<img style="margin-left: 5px;" onpointerdown="Smart._createSmartImageModal(this, event)" src="${o[t]}"/>`;o=e}else o=`<img style="margin-left: 5px;" onpointerdown="Smart._createSmartImageModal(this, event)" src="${o}"/>`;if(r.cover){const t=e.querySelector(".smart-kanban-task-cover");t.classList.add("smart-kanban-task-cover-content"),t.innerHTML=o}}else if(r.image&&o.indexOf("http")>=0||r.editor&&"image"===r.editor&&o.indexOf("[{")>=0)if(window.Smart._createSmartImageModal=t._createImageModal,o.indexOf("[{")>=0){o=JSON.parse(o);let t="";for(let e=0;e<o.length;e++){const a=o[e];a.label||(a.label=""),t+=`<img title="${a.label}" style="margin-left: 5px;" value="${a.value}" onpointerdown="Smart._createSmartImageModal(this, event)" src="${a.small||a.value}"/>`}if(o=t,r.cover){const t=e.querySelector(".smart-kanban-task-cover");t.classList.add("smart-kanban-task-cover-content"),t.innerHTML=o}}else i=o,o=o.substring(0,50)+"...";else if(r.image){if(o=`<img style="margin-left: 5px;" onpointerdown="Smart._createSmartImageModal(this, event)" src="${o}"/>`,r.cover){const t=e.querySelector(".smart-kanban-task-cover");t.classList.add("smart-kanban-task-cover-content"),t.innerHTML=o}}else if("attachment"===r.editor)if(o.length>50){if("string"==typeof o&&(o.indexOf("[{")>=0||o.indexOf("}]")>=0)){let e="";if(o)try{e=JSON.parse(o)}catch(e){console.log(e)}o=e}const e=document.createElement("div");Array.isArray(o)&&(o.forEach((t=>{const a=document.createElement("div");a.title=t.label,a.classList.add("item"),a.innerHTML="<div></div>",a.firstElementChild.classList.add("smart-grid-icon","show","attachment"),t.label.indexOf("png")>=0||t.label.indexOf("jpg")>=0||t.label.indexOf("jpeg")>=0||t.label.indexOf("gif")>=0?a.firstElementChild.classList.add("smart-icon-image"):t.label.indexOf(".pdf")>=0?a.firstElementChild.classList.add("smart-icon-pdf"):t.label.indexOf(".tsv")>=0||t.label.indexOf(".txt")>=0||t.label.indexOf(".csv")>=0?a.firstElementChild.classList.add("smart-icon-text"):t.label.indexOf(".xls")>=0||t.label.indexOf(".xlsx")>=0?a.firstElementChild.classList.add("smart-icon-excel"):t.label.indexOf(".ppt")>=0?a.firstElementChild.classList.add("smart-icon-powerpoint"):t.label.indexOf(".zip")>=0||t.label.indexOf(".rar")>=0||t.label.indexOf(".7z")>=0?a.firstElementChild.classList.add("smart-icon-archive"):t.label.indexOf(".doc")>=0||t.label.indexOf(".docx")>=0?a.firstElementChild.classList.add("smart-icon-word"):a.firstElementChild.classList.add("smart-icon-file"),a.setAttribute("value",t.value),e.appendChild(a)})),t._fieldAttachmentValue||(t._fieldAttachmentValue=[]),t._fieldAttachmentValue[r.dataField]=o),window.Smart._createSmartAttachment=t._createAttachment,o='<div data-field="'+r.dataField+'" onpointerdown="Smart._createSmartAttachment(event)" class="attachments">'+e.innerHTML+"</div>"}else input=document.createElement("div"),o||(o=t.localize("emptyAttachment"));else if("dateInput"===r.editor)o=new Smart.Utilities.DateTime(o).toString(this.formatStringDate);else if("dateRangeInput"===r.editor)o&&o.length&&(o[0]=new Smart.Utilities.DateTime(o[0]).toString(this.formatStringDate),o[1]=new Smart.Utilities.DateTime(o[1]).toString(this.formatStringDate),o=o[0]+"-"+o[1]);else if(r.dataSource)if(o&&o.indexOf(",")>0&&(o=o.split(",")),void 0!==o&&Array.isArray(o)){let e=[];for(let t=0;t<o.length;t++){const a=r.dataSource.find((e=>{if(e.value===o[t])return e}));a&&e.push(a.label)}o=e.toString()}else{const e=r.dataSource.find((e=>{if(e.value===o)return e}));e&&e.label&&(o=e.label)}const a=e.querySelector("[data-field="+r.dataField+"]");if(a)a.innerHTML=`<div class="smart-kanban-task-field-label">${r.label}</div><div title="${i}" class="smart-kanban-task-field-value">${o}</div>`,a.classList.remove("smart-hidden");else{const e=document.createElement("div");e.classList.add("smart-kanban-task-field"),e.setAttribute("data-field",r.dataField),e.innerHTML=`<div class="smart-kanban-task-field-label">${r.label}</div><div title="${i}" class="smart-kanban-task-field-value">${o}</div>`,s.appendChild(e)}}}else{const t=e.querySelector("[data-field="+r.dataField+"]");t&&t.classList.add("smart-hidden")}}}}_updateTaskSubtasks(e){const t=this;if("none"===t.taskSubTasks)return void e.querySelector(".smart-kanban-task-subtasks").classList.add("smart-hidden");const a=e.data,s=t.dataSourceMap,l=[],r=[];(a[s.checklist]||[]).forEach(((e,t)=>{e.completed&&l.push(t),r.push({label:e.text,selected:!0===e.completed})}));const o=e.querySelector(".smart-kanban-task-subtasks"),i=e.querySelector(".smart-kanban-task-subtasks-container");i.innerHTML="",o.classList.remove("smart-hidden");const n=e.querySelector(".smart-kanban-task-input");t._currentUser&&!t._currentUser.allowEdit||t.disabled||!t.taskSubTasksInput?n.classList.add("smart-hidden"):n.classList.remove("smart-hidden"),n.onfocus=function(e){e.preventDefault(),e.stopPropagation()},n.onkeydown=e=>{"Escape"===e.key&&(n.value="",n.blur())," "===e.key&&e.stopPropagation()},n.onchange=function(l){a[s.checklist]||(a[s.checklist]=[]);const r=JSON.parse(JSON.stringify(a));a[s.checklist].push({text:n.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/\\/g,""),completed:!1}),n.value="",t._updateTaskSubtasks(e);const o=JSON.parse(JSON.stringify(a));t.$.fireEvent("change",{task:e,id:o.id,value:o,oldValue:r}),t.$.fireEvent("taskUpdate",{id:o.id,value:o,oldValue:r}),t._refreshColumnHeights(),l.preventDefault(),l.stopPropagation(),n.closest(".smart-scroll-viewer-container").scrollTop=0},r.length&&r.forEach(((l,o)=>{const n=document.createElement("div"),d=l.label;n.innerHTML=`<div data-index="${o}" class="smart-kanban-sub-task"><span title="${d}" class="label">${d}</span><span class="edit-subtask" aria-label="Edit subtask" title="${t.localize("edit")}"></span><span class="remove-subtask" aria-label="Remove subtask" title="${t.localize("removeSubtask")}"></span></div>`,l.selected&&n.firstChild.classList.add("selected"),"onlyUnfinished"===t.taskSubTasks&&l.selected&&n.classList.add("smart-hidden");let c=!0;(t._currentUser&&!t._currentUser.allowEdit||t.disabled)&&(c=!1),c?(n.querySelector(".edit-subtask").style.opacity=1,n.querySelector(".remove-subtask").style.opacity=1):(n.querySelector(".remove-subtask").style.opacity=0,n.querySelector(".edit-subtask").style.opacity=0),n.onpointerup=n.onclick=e=>{t._dragDetails||(e.preventDefault(),e.stopPropagation())},n.onpointerdown=l=>{let o=!0;if((t._currentUser&&!t._currentUser.allowEdit||t.disabled)&&(o=!1),!o)return;t._subTaskInput&&t._subTaskInput.parentNode&&(t._subTaskInput.remove(),delete t._subTaskInput);const i=JSON.parse(JSON.stringify(a)),d=parseInt(n.firstChild.getAttribute("data-index")),c=r[d];if(l.target.classList.contains("remove-subtask"))r.splice(d,1),n.classList.add("smart-hidden"),a[s.checklist].splice(d,1);else if(l.target.classList.contains("edit-subtask")){t._subTaskClickTimer&&clearTimeout(t._subTaskClickTimer);const l=document.createElement("input"),r=n.firstElementChild,o=n.querySelector(".label");l.classList.add("smart-input"),l.style.position="absolute";const i=t.offset(r),d=t.offset(t);l.style.height=r.offsetHeight+"px",l.style.background="var(--smart-background)",l.style.width=n.offsetWidth-20+"px",l.value=o.textContent,t.appendChild(l),t.style.position="relative",l.select(),l.style.top=i.top-d.top+"px",l.style.left=i.left-d.left+20+"px",t._subTaskInput=l,l.onchange=()=>{const r=JSON.parse(JSON.stringify(a)),i=parseInt(n.firstChild.getAttribute("data-index"));a[s.checklist][i].text=l.value,o.innerHTML=l.value;const d=JSON.parse(JSON.stringify(a));t.$.fireEvent("change",{task:e,id:d.id,value:d,oldValue:r}),t.$.fireEvent("taskUpdate",{id:d.id,value:d,oldValue:r}),l.remove()}}else n.firstChild.classList.toggle("selected"),c.selected=!c.selected,a[s.checklist][d].completed=c.selected,"onlyUnfinished"===t.taskSubTasks&&c.selected&&n.classList.add("smart-hidden");t._updateTaskChecked(e);const u=JSON.parse(JSON.stringify(a));t.$.fireEvent("change",{task:e,id:u.id,value:u,oldValue:i}),t.$.fireEvent("taskUpdate",{id:u.id,value:u,oldValue:i}),l.preventDefault(),l.stopPropagation()},i.appendChild(n)}))}_applyTextTemplate(e,t,a){const s=this;let l=this.textTemplate;if(!l)return e;let r="";if("function"==typeof l){const s={data:t,task:a,text:e,template:null};if(l(s),e=s.text,null===s.template)return e;l=s.template}if(l.startsWith("#")){const a=document.querySelector(l);if(a&&a instanceof HTMLTemplateElement){const l=a.content.cloneNode(!0),o=document.createElement("div");return o.appendChild(l),e=(e=(e=e.toString()).replace(/'/gi,"\\'")).replace(/"/gi,'\\"'),r=o.innerHTML.replace(/{{text}}/gi,e).replace(/{{id}}/gi,t[s.dataSourceMap.id]),r.indexOf("{{text=")>=0&&(e?(r=r.substring(0,r.indexOf("{{text="))+e+r.substring(r.indexOf("}")),r=r.replace(/}/gi,""),r=r.replace(/{/gi,"")):(r=r.replace(/{{text=/gi,""),r=r.replace(/}}/gi,""))),r}}return r=l.replace(/{{text}}/gi,e).replace(/{{id}}/gi,t[s.dataSourceMap.id]),r}_updateUserIcon(e){const t=this,a=this.dataSourceMap,s=e.data,l=e.getElementsByClassName("smart-kanban-task-user")[0];if(void 0!==s[a.userId]&&null!==s[a.userId]){const e=this.users.find((e=>e.id.toString()===s[a.userId].toString()));if(e)return s[a.userId]!==e.id&&(s[a.userId]=e.id),l.classList.remove("empty"),l.style.backgroundImage='url("'+e.image+'")',l.setAttribute("title",t.localize("assignedTask",{userName:e.name||e.id})),void l.setAttribute("aria-label","Icon of user "+(e.name||e.id))}s[a.userId]=null,l.classList.add("empty"),l.style.backgroundImage=null,l.setAttribute("aria-label","Empty user icon"),l.setAttribute("title",t.localize("unassignedTask"))}_updateTaskComments(e){const t=this.dataSourceMap,a=e.data;e.querySelector(".smart-kanban-task-comments").setAttribute("num",a[t.comments].length||"")}_updateTaskProgress(e){const t=this.dataSourceMap,a=e.data,s=e.querySelector(".smart-kanban-task-progress");let l=a[t.progress];if(void 0===l){a[t.progress]=null,s.setAttribute("aria-valuenow",0);const e=this.localize("taskProgress",{value:0});return void s.parentElement.setAttribute("title",e)}if(l=parseFloat(l),isNaN(l)){a[t.progress]=null,s.setAttribute("aria-valuenow",0);const e=this.localize("taskProgress",{value:0});return void s.parentElement.setAttribute("title",e)}l=Math.max(0,Math.min(parseFloat(l),100)),a[t.progress]=l,s.style.width=l+"%",s.classList.toggle("bottom",null!==a[t.checklist]),s.setAttribute("aria-valuenow",l);const r=this.localize("taskProgress",{value:l});s.parentElement.setAttribute("title",r)}_updateTaskChecked(e){const t=this.dataSourceMap,a=e.data,s=a[t.checklist],l=e.querySelector(".smart-kanban-task-checked");if(s&&Array.isArray(s)&&s.length>0?l.innerHTML=this._getCompletedSubTasks(s):(a[t.checklist]=null,l.innerHTML=""),l.innerHTML.length>0){let e=0;s.forEach((t=>t.completed&&e++));const t=e,a=s.length,r=this.localize("taskCompleted",{value:t,count:a});l.setAttribute("title",r)}else l.removeAttribute("title")}_getCompletedSubTasks(e){if(null===e)return"";let t=0;return e.forEach((e=>e.completed&&t++)),t+"/"+e.length}_updateTaskDueDate(e){const t=this.dataSourceMap;let a=e.data,s=a[t.dueDate],l=e.querySelector(".smart-kanban-task-due");if(s&&"string"==typeof s&&(s=new Date(s),s.setTime(s.getTime()-1*s.getTimezoneOffset()*60*1e3),a[t.dueDate]=s),s)if(l.innerHTML=new Smart.Utilities.DateTime(s).toString(this.formatStringDate),l.classList.toggle("overdue",s.getTime()<(new Date).getTime()&&100!==a[t.progress]),l.classList.contains("overdue")){const e=Math.abs(new Date-s),t=Math.ceil(e/864e5);l.setAttribute("title",this.localize("overdue")+" "+t+" "+this.localize("days"))}else l.removeAttribute("title");else a[t.dueDate]=null,l.innerHTML="",l.classList.remove("overdue"),l.removeAttribute("title");a[t.startDate]?"string"==typeof a[t.startDate]&&(a[t.startDate]=new Date(a[t.startDate]),a[t.startDate].setTime(a[t.startDate].getTime()-1*a[t.startDate].getTimezoneOffset()*60*1e3)):a[t.startDate]=null}_updateTaskColor(e){const t=this,a=t.dataSourceMap,s=e.data,l=e.querySelector(".smart-kanban-task-progress-container"),r=e.querySelector(".smart-kanban-task-progress"),o=t.rightToLeft?"borderRightColor":"borderLeftColor";function i(e){let t=parseFloat(e).toString(16);return t="0".repeat(2-t.length)+t,t.toUpperCase()}if(e.style.borderLeftColor=null,e.style.borderRightColor=null,e.style.borderLeftWidth="",e.style.borderRightWidth="",s[a.color]){e.style[o]=s[a.color];const d=getComputedStyle(e)[o],c="dark"===t.theme?.4:.1;t.taskColor?e.style[o]=s[a.color]:(e.style[o]="var(--smart-border)",e.style[t.rightToLeft?"borderRightWidth":"borderLeftWidth"]="1px"),s[a.color]=(n=(n=d).match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))?"#"+i(n[1])+i(n[2])+i(n[3]):null,l&&(l.style.backgroundColor=`rgba(${d.slice(4,d.length-1)}, ${c})`,r.style.backgroundColor=d),t.taskColorEntireSurface&&(e.style.backgroundColor=`rgba(${d.slice(4,d.length-1)}, ${c})`)}else{if(s[a.color]=null,l&&(l.style.backgroundColor=null,r.style.backgroundColor=null),t.taskColorEntireSurface){const a=getComputedStyle(e)[o],s="dark"===t.theme?.4:.1;e.style.backgroundColor=`rgba(${a.slice(4,a.length-1)}, ${s})`}t.taskColor||(e.style[o]="var(--smart-border)",e.style[t.rightToLeft?"borderRightWidth":"borderLeftWidth"]="1px")}var n}_updateTaskPriority(e){const t=this,a=t.dataSourceMap,s=e.data,l=e.querySelector(".priority");l.className="priority";let r="";s[a.priority]&&(l.className+=" "+s[a.priority],r=t.localize(s[a.priority])+" "+t.localize("priority"));const o=s[a.text],i=e.querySelector(".smart-kanban-task-content");t.taskPriority?l.classList.remove("smart-hidden"):l.classList.add("smart-hidden"),i&&(o&&t.taskPriority&&r?i.setAttribute("title",`${o}: ${r}`):i.removeAttribute("title"))}_validateSwimlanes(){const e=this,t=e.swimlanesFrom,a=e.swimlanesTo,s=[];t<0&&(e.swimlanesFrom=0),null!==a&&t>a&&(e.swimlanesFrom=a),e.swimlanes.forEach((e=>{"string"==typeof e&&(e={dataField:e,label:e}),(e.dataField||e.label)&&(e.label||(e.label=e.dataField),e.dataField||(e.dataField=e.label),s.push(e))})),e.swimlanes=s}_handleSwimlanes(e){const t=this,a=t.swimlanes;if(0===a.length||0===t.columns.length)return;const s=t.columns,l=parseFloat(getComputedStyle(t).getPropertyValue("--smart-kanban-header-size")),r=t.$.container,o=t.$.container.getBoundingClientRect(),i=t.$.container.querySelectorAll(".smart-kanban-column.has-swimlane");let n=i[0],d=i[i.length-1];if(t.rightToLeft){let e=n;n=d,d=e}const c=n.getBoundingClientRect(),u=i.length>1?d.getBoundingClientRect():c,m=Array.from(n.getElementsByTagName("smart-scroll-viewer"));let p,h,g,f,b=!1,v=!0,y=t.swimlanesTo;null===y&&(y=s.length-1),e&&(p=r.getElementsByClassName("swimlane")),n.column.collapsed&&(n.classList.remove("collapsed"),b=!0);for(let e=t.swimlanesFrom;e<=y;e++)v=v&&s[e].collapsed;v||(h=u.right-c.left+"px",g=c.left-o.left+"px",f=m.map((e=>e.getBoundingClientRect().top-o.top-l-t._dataViewPadding+"px"))),a.forEach(((t,a)=>{let s;e?s=p[a]:(s=document.createElement("div"),s.innerHTML=`<div class="swimlane-label">${t.label}</div>`,s.className="swimlane",s.setAttribute("role","heading"),s.setAttribute("aria-level",2),t.color&&(s.style.backgroundColor=t.color)),s.classList.toggle("smart-visibility-hidden",v),v||(s.style.width=h,s.style.left=g,s.style.top=f[a]),e||r.appendChild(s)})),b&&n.classList.add("collapsed")}_renderColumns(){const e=this,t=e.collapsible,a=[],s=e.$.body,l=document.createDocumentFragment();let r=e.columns;const o=e.context;if(e.context=e,e._columnToElement=new Map,e._columnContainers=[],0===r.length){const t=e.dataSource;t&&0!==t.length&&(r=[],t.forEach((t=>{const a=t[e.dataSourceMap.status];a&&-1===r.indexOf(a)&&r.push(a)})))}!function e(a,s,l){const r=[];let o=0;if(a.forEach((a=>{"string"==typeof a&&(a={dataField:a,label:a}),void 0!==a.dataField&&(void 0===a.label&&(a.label=a.dataField),void 0===a.dataField&&(a.dataField=a.label),"horizontal"!==a.orientation&&(a.orientation="vertical"),!1!==a.collapsible&&(a.collapsible=!0),a.collapsed&&t&&a.collapsible?o++:a.collapsed=!1,!1!==a.addNewButton&&(a.addNewButton=!0),!1!==a.allowRemove&&(a.allowRemove=!0),!1!==a.allowHide&&(a.allowHide=!0),!1!==a.editable&&(a.editable=!0),!1!==a.reorder&&(a.reorder=!0),0===l?delete a.selected:!0===a.selected?r.push(a):a.selected=!1,a.columns&&(a.validColumns=[],e(a.columns,a.validColumns,l+1),a.columns=a.validColumns,delete a.validColumns),s.push(a))})),o&&o===s.length&&(s[0].collapsed=!1),r.length>1)for(let e=r.length-2;e>=0;e--)r[e].selected=!1;else l>0&&0===r.length&&s.length>0&&(s[0].selected=!0)}(r,a,0),0===e.swimlanes.length?"columns"===e.hierarchy?e._createColumnElements(a,l,s,1):e._createColumnElementsTabs(a,l,s):e._createColumnElementsSwimlanes(a,l,s),s.appendChild(l),e._selectedTabs=e._allColumns.filter((e=>e.selected)).map((e=>e.dataField)),e._autoSaveState("tabs"),e.context=o}_createAddNewButton(){const e=this,t=e.querySelectorAll(".smart-kanban-add-new-button");t.length&&t.forEach((e=>{e.remove()})),e.addNewButton&&"top"!==e.addNewButtonDisplayMode&&(e.addNewButtons=[],e.querySelectorAll(".smart-kanban-column").forEach((t=>{const a=t.querySelector(".smart-scroll-viewer");if(a){const s=(()=>{const t=document.createElement("div");return t.setAttribute("add-new-button",""),t.classList.add("smart-kanban-add-new-button"),t.title=e.localize("addNewTask"),t.onpointerdown=()=>{if(t.column){const a=t.column.querySelector(".smart-kanban-column-header-add");a&&(e._addToBottom=!0,a.click())}},t})(),l=t.column;if(!l||l&&l.collapsed||l&&!l.addNewButton)return;t.appendChild(s);const r=()=>{const l=a.getBoundingClientRect(),r=t.querySelectorAll(".smart-kanban-task"),o=e.offset(e);if(0===r.length){const a=t.querySelector(".smart-kanban-column-header"),l=e.offset(a).top-o.top,r=e.autoColumnHeight?60:0;s.style.top=l+r+a.offsetHeight+"px"}else{const i=r[r.length-1],n=e.offset(i);let d=parseInt(i.style.marginBottom);const c=e.offsetHeight-2*s.offsetHeight;isNaN(d)&&(d=0);const u=n.top-o.top+i.offsetHeight+d;if(a.computedVerticalScrollBarVisibility){const t=e.getBoundingClientRect();s.style.top=Math.min(l.top-t.top+a.offsetHeight,c)+"px"}else{const a=t.querySelector(".smart-kanban-column-footer");if(a){const t=e.offset(a).top-o.top-s.offsetHeight/2;s.style.top=Math.min(t,c)+"px"}else s.style.top=Math.min(u,c)+"px"}}const i=t.offsetWidth-a.offsetWidth;s.style.left=l.left+a.offsetWidth/2-i-s.offsetWidth/2-o.left+e.$.scrollViewer.scrollLeft+"px"};s.refresh=r,s.column=t,t.addNewButton=s,s.refresh(),e.addNewButtons.push(s),requestAnimationFrame((()=>{s.classList.add("show")}))}})),e._refreshSummaries())}_refreshColumnHeights(e=!0,t,a=0){const s=this;s.autoColumnHeight&&(s.virtualization?s.querySelectorAll(".smart-kanban-column").forEach((e=>{if(e.querySelector(".smart-scroll-viewer")){const t=e.column,a=s._getTasksByDataField(t.dataField),l=e.querySelector(".smart-kanban-column-header"),r=e.querySelector(".smart-kanban-column-footer"),o=r?r.offsetHeight:0;if(0===a.length)e.style.height=100+o+l.offsetHeight+"px";else{const t=s.offsetHeight,r=a[a.length-1],i=l.offsetHeight+o+r.top+r.height;isNaN(i)||(e.style.height=t<i?"":i-o+"px")}}})):s.querySelectorAll(".smart-kanban-column").forEach((l=>{const r=l.querySelector(".smart-scroll-viewer");if(r){const o=l.column;if(t&&o.dataField!==t)return;if(!o||o&&o.collapsed)return void(l.style.height="");const i=l.querySelectorAll(".smart-kanban-task"),n=l.querySelector(".smart-kanban-column-header"),d=l.querySelector(".smart-kanban-column-footer"),c=d?d.offsetHeight:0;if(0===i.length)l.style.height=100+c+n.offsetHeight+"px";else{const e=i[i.length-1];if(r.style.top="0px",!s._rowGap){const t=parseInt(getComputedStyle(e.parentElement).gridRowGap);s._rowGap=t,isNaN(s._rowGap)&&(s._rowGap=0)}let t=0;for(let e=0;e<i.length;e++)if(t+=i[e].offsetHeight+s._rowGap,i[e].classList.contains("smart-kanban-task-placeholder")){const a=parseInt(i[e].style.marginTop),s=parseInt(i[e].style.marginBottom);isNaN(a)||(t+=a),isNaN(s)||(t+=s)}const o=s.offsetHeight,d=n.offsetHeight+c+t+s._rowGap+s._rowGap+a;l.style.height=o<d?"":d+"px"}e&&r.refresh(),s._refreshEmptyColumnState(r)}})))}_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)}}_getColorInput(){const e=document.createElement("smart-color-input");return e.dataSource=["#D50000","#E67C73","#F4511E","#F6BF26","#0B8043","#33B679","#3F51B5","#039BE5","#7986CB","#8C47FF","#8E24AA","#FF36C2","#616161","#454545","#949494","#000000"],e.additionalColors=["#FF9EB7","#FFCFC9","#FFD66D","#FFEBB6","#93DF89","#D1F7C4","#9DC7FF","#D0F0FD","#CDAFFF","#ECE1FD","#FA9DE2","#FFDAF6","#CBCBCB","#EDEDED","#FFFFFF",""],e.valueDisplayMode="colorBox",e.classList.add("smart-kanban-color-input"),e.style.width="auto",e.style.height="auto",e.readonly=!0,e.onRender=()=>{const t=e.$.scrollView;t&&t.classList.add("smart-kanban-color-input")},e}_createColumnElements(e,t,a,s){const l=this,r=l.id,o=[],i=[];let n=0;const d=e=>"number"==typeof e?e+"px":"string"==typeof e?e:void 0;if(e.forEach(((a,c)=>{const u=document.createElement("div");let m=`${l._getColumnHeader(a,c<e.length-1,s)}\n                <div class="smart-kanban-column-contentAAA" role="presentation">\n                    <smart-scroll-viewer class="smart-kanban-column-content-tasks"${l._rtlAttr}${l._tabindex} role="list"></smart-scroll-viewer>BBB\n                </div>`,p=0;if(l.columnFooter&&(m+='<div class="smart-kanban-column-footer"></div>'),a.columns?(m=m.replace("AAA",""),m=m.replace("BBB",'<div class="smart-kanban-column-content-columns" role="presentation"></div>')):(m=m.replace("AAA"," no-sub-columns"),m=m.replace("BBB","")),u.className="smart-kanban-column",u.setAttribute("data-field",a.dataField),u.setAttribute("role","group"),u.setAttribute("aria-labelledby",`${r}ColumnHeaderLabel${a.dataField}`),u.setAttribute("orientation",a.orientation),a.color&&l.applyColumnColorToTasks&&u.style.setProperty("--smart-primary",a.color),a.collapsible&&u.setAttribute("collapsible",""),a.addNewButton&&u.setAttribute("add-new-button",""),u.innerHTML=m,u.siblingColumns=e,t.appendChild(u),u.column=a,u.index=c,u.onmouseleave=()=>{let e=!1;u.querySelectorAll(".smart-kanban-task-placeholder").forEach((t=>{t.style.marginTop=t.style.marginBottom="0px",e=!0})),e&&l._refreshButtonsAndSummaries()},l.onColumnHeaderRender&&l.onColumnHeaderRender(u.querySelector(".smart-kanban-column-header"),a,a.dataField),l._columnToElement.set(a,u),a.columns){const e=u.querySelector(".smart-kanban-column-content-columns");p=l._createColumnElements(a.columns,e,e,s+1),n+=p}else n+=1;let h=(p||1)+"fr";l.columnWidth?h=d(l.columnWidth):a.width&&(h=d(a.width)),!1!==a.visible?(a.collapsed?(u.classList.add("collapsed"),o.push("auto")):o.push(h),i.push(h)):u.classList.add("smart-hidden"),l._allColumns.push(a)})),1===s&&l.addNewColumn)if(l._appendAddNewColumn(t),l.columnWidth){let e="1fr";const t=l.addNewColumnWidth?l.addNewColumnWidth:l.columnWidth;e=d(t),o.push(e)}else o.push("var(--smart-kanban-add-new-column-width)");return a.style.gridTemplateColumns=o.join(" "),a.fractions=i,l._columnContainers.push(a),n}_createColumnElementsTabs(e,t,a,s){const l=this,r=l.id,o=[],i=[];if(e.forEach(((a,n)=>{const d=document.createElement("div");let c=`<div class="smart-kanban-column-contentAAA" role="presentation">\n                    <smart-scroll-viewer class="smart-kanban-column-content-tasks"${l._rtlAttr}${l._tabindex} role="list"></smart-scroll-viewer>BBB\n                </div>`;if(a.columns?(c=c.replace("AAA",""),c=c.replace("BBB",'<div class="smart-kanban-column-content-columns has-tabs" role="presentation"></div>')):(c=c.replace("AAA"," no-sub-columns"),c=c.replace("BBB","")),d.className="smart-kanban-column",d.setAttribute("orientation",a.orientation),a.collapsible&&d.setAttribute("collapsible",""),a.addNewButton&&d.setAttribute("add-new-button",""),s){const e=document.createElement("div"),t=`${r}Tab${a.dataField}`,o=`${r}Column${a.dataField}`;e.id=t,e.className="smart-kanban-tab smart-unselectable",l.disabled||l.unfocusable||(e.tabIndex=0),e.setAttribute("role","tab"),e.setAttribute("aria-controls",o),e.innerHTML=`<div class="smart-kanban-tab-label">${a.label}</div>`,e.columnElement=d,d.id=o,d.setAttribute("role","tabpanel"),d.setAttribute("aria-labelledby",t),d.tab=e,s.appendChild(e),a.selected?e.classList.add("selected"):d.classList.add("smart-hidden"),e.setAttribute("aria-selected",a.selected)}else c=l._getColumnHeader(a,n<e.length-1)+c,d.setAttribute("role","group"),d.setAttribute("aria-labelledby",`${r}ColumnHeaderLabel${a.dataField}`);if(d.innerHTML=c,d.siblingColumns=e,t.appendChild(d),d.column=a,d.index=n,l._columnToElement.set(a,d),a.columns){const e=d.querySelector(".smart-kanban-column-content-columns"),t=document.createElement("div");t.className="smart-kanban-tab-strip",t.setAttribute("role","tablist"),e.appendChild(t),l._createColumnElementsTabs(a.columns,e,e,t)}s||(a.collapsed?(d.classList.add("collapsed"),o.push("auto")):o.push("1fr"),i.push("1fr")),l._allColumns.push(a)})),!s){if(l.addNewColumn)if(l._appendAddNewColumn(t),l.columnWidth){let e="1fr";const t=e=>"number"==typeof e?e+"px":"string"==typeof e?e:void 0;e=t(l.addNewColumnWidth?l.addNewColumnWidth:l.columnWidth),o.push(e)}else o.push("var(--smart-kanban-add-new-column-width)");a.style.gridTemplateColumns=o.join(" "),a.fractions=i,l._columnContainers.push(a)}}_createColumnElementsSwimlanes(e,t,a){const s=this,l=s.id,r=s.swimlanes,o=[],i=[];if(e&&(e=e.filter((e=>{if(!1!==e.visible)return!0}))),e.forEach(((a,n)=>{const d=document.createElement("div");let c=`${s._getColumnHeader(a,n<e.length-1)}\n                <div class="smart-kanban-column-content no-sub-columns" role="presentation"></div>`;d.className="smart-kanban-column",d.setAttribute("role","group"),d.setAttribute("aria-labelledby",`${l}ColumnHeaderLabel${a.dataField}`),d.setAttribute("orientation",a.orientation),a.collapsible&&d.setAttribute("collapsible",""),a.addNewButton&&d.setAttribute("add-new-button",""),d.innerHTML=c,d.siblingColumns=e;const u=d.children[1];let m="";if(s._hasSwimlane(n)){let e=[];for(let t=0;t<r.length;t++)m+=`<smart-scroll-viewer class="smart-kanban-column-content-tasks" swimlane="${r[t].dataField}"${s._rtlAttr}${s._tabindex} role="list"></smart-scroll-viewer>`,e.push("1fr");d.classList.add("has-swimlane"),u.classList.add("has-swimlane"),u.style.gridTemplateRows=e.join(" ")}else m=`<smart-scroll-viewer class="smart-kanban-column-content-tasks"${s._rtlAttr}${s._tabindex} role="list"></smart-scroll-viewer>`;u.innerHTML=m,t.appendChild(d),d.column=a,d.index=n,s._columnToElement.set(a,d),a.collapsed?(d.classList.add("collapsed"),o.push("auto")):o.push("1fr"),i.push("1fr"),s._allColumns.push(a)})),s.addNewColumn)if(s._appendAddNewColumn(t),s.columnWidth){let e="1fr";const t=e=>"number"==typeof e?e+"px":"string"==typeof e?e:void 0;e=t(s.addNewColumnWidth?s.addNewColumnWidth:s.columnWidth),o.push(e)}else o.push("var(--smart-kanban-add-new-column-width)");a.style.gridTemplateColumns=o.join(" "),a.fractions=i,s._columnContainers.push(a)}_getColumnSummary(e){const t=this.getColumnDataItems(e.dataField);return this.columnSummary&&t.length?" ("+t.length+")":""}_getColumnHeaderTemplate(e,t){const a=e.headerTemplate||this.columnHeaderTemplate;if(a){const s=document.createElement("div");let l;if("string"==typeof a&&a.startsWith("#")?l=document.querySelector(a):"string"==typeof a&&(l=a),"function"==typeof a){const s=a(e,t);return s||t}if(l instanceof HTMLTemplateElement){s.appendChild(l.content.cloneNode(!0));const t=/{{\w+}}/g;let a=s.innerHTML;const r=t.exec(a);for(let t=0;t<r.length;t++){const t=e[r[0].replace("{{","").replace("}}","")];a=a.replace(r[0],t)}return a}return l instanceof HTMLElement?s.appendChild(l):s.innerHTML=l,s.innerHTML}return null}_getColumnHeader(e,t,a=1){const s=this,l=s._tabindex,r=e.collapsed?s.localize("expand"):s.localize("collapse"),o=s.localize("addNewTask"),i=s.allowColumnEdit||s.allowColumnRemove||s.allowColumnHide?"settings":"",n=s.localize("customizeColumn");let d=e.label;""===d&&(d="&nbsp;");const c=s._getColumnSummary(e);let u=`<span class="smart-kanban-title">${d}</span><span class='summary'>${c}</span>`,m="smart-kanban-column-header-label";if(void 0!==e.color&&s.columnColors){if(e.color){const t=new Smart.Color(e.color).getInvertedColor();u=`<div class="heading" style="background: ${e.color}; color: ${t};"><span class="smart-kanban-title">${d}</span><span class='summary'>${c}</span></div>`}else u=`<div class="heading"><span class="smart-kanban-title">${d}</span><span class='summary'>${c}</span></div>`;m+=" pill"}const p=null!==s.columnHeaderTemplate||e.headerTemplate?s._getColumnHeaderTemplate(e,u):u,h="bottom"===s.addNewButtonDisplayMode?"":"add-new-button";return`<div status="${e.dataField}" ${i} ${h} class="smart-kanban-column-header smart-unselectable"${l} role="heading" aria-level=${a}>\n                    <div title="${o}" class="smart-kanban-column-header-add ${h}"${l} role="button" aria-label="Add new task"></div>\n                    <div id="${s.id}ColumnHeaderLabel${e.dataField}" class="${m}">${p}</div>\n                    <div title="${r}" class="smart-kanban-column-header-toggle-button smart-arrow smart-arrow-${t?"left":"right"}" role="button" aria-hidden="true"></div>\n                    <div title="${n}" class="smart-kanban-column-actions smart-kanban-column-header-settings-button" role="button" aria-haspopup="menu" aria-label="Open actions list" aria-hidden="true"></div>\n                </div>`}_hasSwimlane(e){const t=this;if(0===t.swimlanes.length)return!1;const a=t.swimlanesFrom;let s=t.swimlanesTo;return null===s&&(s=t.columns.length-1),e>=a&&e<=s}_updateColumnWidths(e,t){const a=this;if(!e&&!t)return void a._columnContainers.forEach((e=>a._updateColumnWidths(e.children[0].siblingColumns,e)));const s=t.fractions,l=[];let r=0,o=0;for(let t=0;t<e.length;t++){const i=e[t];!1!==i.visible&&(l.push(e[t].collapsed?"auto":s[r++]),!i.collapsed&&a.columnWidth&&(o+=i.width?i.width:a.columnWidth))}if(t===a.$.body&&a.addNewColumn)if(a.columnWidth){let e="1fr";const t=e=>"number"==typeof e?e+"px":"string"==typeof e?e:void 0;e=t(a.addNewColumnWidth?a.addNewColumnWidth:a.columnWidth),l.push(e)}else l.push("var(--smart-kanban-add-new-column-width)");o<a.offsetWidth&&a.columnWidth&&l.push("1fr"),t.style.gridTemplateColumns=l.join(" "),a.columnWidth&&a.$.scrollViewer.refresh()}_validateColumnArgument(e){if(!isNaN(e))return this.columns[e];const t=this._allColumns;return"string"==typeof e?t.find((t=>t.dataField===e)):"object"==typeof e?t.find((t=>t===e)):null}_resizeHandler(){this.$.scrollViewer&&(this.$.scrollViewer.scrollLeft=0),this.refresh("resize")}refresh(e){const t=this;"resize"===e?(clearTimeout(t._resizeTimeout),t._resizeTimeout=setTimeout((function(){t._allColumns.forEach((e=>t._refreshScrollViewer(e)))}),50),t._handleSwimlanes(!0)):(t.closePanel(),t._closeList(t._actionsList,"_actionSelectionFor"),t._closeList(t._columnActionsList,"_columnActionSelectionFor"),t._closeList(t._commentsList,"_commentSelectionFor"),t._closeList(t._userList,"_userSelectionFor"),t._closeList(t._priorityList,"_prioritySelectionFor"),t._resetFields=!0,t._render()),t.$.scrollViewer.refresh()}_refreshScrollViewer(e,t){const a=this,s=e instanceof HTMLElement?e:this._columnToElement.get(e);function l(l,r){if(!t&&l&&l.$.scrollViewerContentContainer&&""===l.$.scrollViewerContentContainer.innerHTML.trim())return a.virtualization&&a._refreshScrollHeight(l,e.dataField),void a._refreshEmptyColumnState(l);if(e.collapsed?l.toRefresh=!0:(delete l.toRefresh,requestAnimationFrame((()=>{if(l.isReady&&l.refresh(),void 0===e.dataField){const t=e.closest(".smart-kanban-column");if(t){const e=t.getAttribute("data-field");a._refreshScrollHeight(l,e)}}else a._refreshScrollHeight(l,e.dataField);0===r&&"horizontal"===e.orientation&&(a.columnWidth||(l.$.content.offsetWidth<=2*a._kanbanTaskMinWidth+a._dataViewPadding?s.setAttribute("orientation","vertical"):"vertical"===s.getAttribute("orientation")&&s.setAttribute("orientation","horizontal")))}))),a._refreshButtonsAndSummaries(),void 0===e.dataField){const t=e.closest(".smart-kanban-column");if(t){const e=t.getAttribute("data-field");a._refreshScrollHeight(l,e)}}else a._refreshScrollHeight(l,e.dataField)}e instanceof Smart.ScrollViewer?l(e):this.swimlanes.length>0?Array.from(s.querySelectorAll("smart-scroll-viewer")).forEach(((e,t)=>l(e,t))):l(s.querySelector("smart-scroll-viewer"),0)}_containerDownHandler(e){const t=this,a=t.isInShadowDOM||t.shadowRoot?e.originalEvent.composedPath()[0]:e.originalEvent.target,s=a.closest(".smart-kanban-task");if(delete t._preventSelection,t.allowColumnReorder){const l=a.closest(".smart-kanban-column-header")&&!a.classList.contains("smart-kanban-column-header-add")&&!a.classList.contains("smart-kanban-column-header-toggle-button");if(!s&&l&&!t._columnEditing){const s=a.closest(".smart-kanban-column");if(s){const a=e.originalEvent.composedPath();let l=0;for(let e=0;e<a.length;e++)a[e].classList&&a[e].classList.contains("smart-kanban-column")&&l++;s.column.reorder&&l<=1&&(t._columnDragDetails={x:e.pageX,y:e.pageY,event:e,kanbanColumn:s})}}}const l=a.closest(".smart-kanban-column"),r=a.closest(".smart-kanban-column-header")&&!a.classList.contains("smart-kanban-column-header-add")&&!a.classList.contains("smart-kanban-column-header-toggle-button"),o=l?l.column:null;if(o){if(r&&t.$.fireEvent("columnClick",{column:o}),new Date-t._clickTime<=300)return!s&&r&&!t._columnEditing&&t.allowColumnEdit&&(t._columnDragDetails=null,!1===o.collapsed&&o.editable&&"menu"!==t.columnEditMode&&t._handleColumnEditing(o.dataField)),void(r&&(o.collapsed?t.expand(o):(!t.allowColumnEdit||t.allowColumnEdit&&"menu"===t.columnEditMode)&&t.collapse(o),t.$.fireEvent("columnDoubleClick",{column:o})));t._clickTime=new Date}if(s&&3!==e.which){if(!s.data)return;if(t.taskSubTasksInput&&a.classList.contains("smart-kanban-task-input"))return;t.virtualization?(t.focusTask(s.data.id),t._refreshColumns()):t._focusTask(s),t._startDragging(s,e)}}_containerKeydownHandler(e){const t=this;if(t._dragDetails)return;const a=e.key,s=t.isInShadowDOM||t.shadowRoot?e.composedPath()[0]:e.target;function l(a=s){delete t._preventSelection,t._documentUpHandler({originalEvent:{target:a}}),t._containerClickHandler({target:a,ctrlKey:e.ctrlKey||e.metaKey,shiftKey:e.shiftKey}),e.preventDefault()}if(s.closest(".smart-kanban-column, .smart-kanban-add-new-column"))return s.classList.contains("smart-kanban-column-content-tasks")?void t._selectViaKeyboard(s.$.content,e,l):void("Enter"!==a&&" "!==a||s instanceof HTMLInputElement!=0||l());if(t.$.headerDropDown.contains(s))"Escape"===a&&(t.closePanel(),t.$[/\s?([a-z]+)-panel/g.exec(t.$.headerDropDown.className)[1]+"Button"].focus());else if(!(s.classList.contains("smart-data-view-header-button")||s.closest(".smart-data-view-search-box")||s.classList.contains("remove-button"))||"Enter"!==a&&" "!==a||l(),s.classList.contains("smart-kanban-list")){const r=s;switch(a){case"ArrowDown":t._selectListItem(t._getNextItem(r));break;case"ArrowUp":t._selectListItem(t._getPrevItem(r));break;case"Home":t._selectListItem(t._getFirstItem(r));break;case"End":t._selectListItem(t._getLastItem(r));break;case"Escape":r.openedFrom.focus(),t._closeList(r,r===t._actionsList?"_actionSelectionFor":r===t._commentsList?"_commentSelectionFor":"_userSelectionFor"),r===t._columnActionsList&&t._closeList(t._columnActionsList,"_columnActionSelectionFor");break;case"Enter":case" ":{const e=t._getSelectedItem(r);e&&l(e);break}default:return}e.preventDefault()}}getTaskIndex(e){const t=this,a=t.getTask(e);if(!a)return-1;const s=a[t.dataSourceMap.status];return t._getTasksByDataField(s).findIndex((t=>{if(t.id===e)return!0}))}_getNextPrevColumn(e,t){const a=this;let s=null;return a._allColumns.forEach(((l,r)=>{if(l.dataField===e)if(t){if(r<a._allColumns.length-1)return s=a._allColumns[r+1],!0}else if(r>0)return s=a._allColumns[r-1],!0})),s}focusTask(e){const t=this;t._focusedTask=e,t.ensureVisible(e),t._refreshColumns()}_selectViaKeyboard(e,t,a){const s=this;let l=t.key;s.rightToLeft&&("ArrowRight"===l?l="ArrowLeft":"ArrowLeft"===l&&(l="ArrowRight"));const r=s._focusedTask,o=s.getTask(r);if(!o)return;const i=o[s.dataSourceMap.status],n=s._getTasksByDataField(i),d=s.getTaskIndex(r);switch(l){case"ArrowRight":{const e=s._getNextPrevColumn(i,!0);if(e)if(s.virtualization){const t=s._getTasksByDataField(e.dataField);t.length>0&&s.focusTask(t[0].id)}else{const t=s._columnToElement.get(e),a=t.querySelector(".smart-kanban-task");s._focusTask(a),t.focus()}break}case"ArrowLeft":{const e=s._getNextPrevColumn(i,!1);if(e)if(s.virtualization){const t=s._getTasksByDataField(e.dataField);t.length>0&&s.focusTask(t[0].id)}else{const t=s._columnToElement.get(e).querySelector(".smart-kanban-task");s._focusTask(t)}break}case"ArrowDown":if(s.virtualization)d<n.length-1&&s.focusTask(n[d+1].id);else{const e=s.getColumn(i),t=s._columnToElement.get(e);s._focusTask(s._getNextItem(t,!0))}break;case"ArrowUp":if(s.virtualization)d>0&&s.focusTask(n[d-1].id);else{const e=s.getColumn(i),t=s._columnToElement.get(e);s._focusTask(s._getPrevItem(t,!0))}break;case"Home":s.virtualization?s.focusTask(n[0].id):s._focusTask(s._getFirstItem(e));break;case"End":s.virtualization?s.focusTask(n[n.length-1].id):s._focusTask(s._getLastItem(e));break;case"Enter":case" ":case"F2":case"Delete":{const e=s.querySelector("[focus]");e&&("F2"===l||"Enter"===l?s.beginEdit(e):"Delete"===l?s.removeTask(e,!0):a(e));break}default:return}t.preventDefault()}_getFirstItem(e){const t=e.children;for(let e=0;e<t.length;e++){const a=t[e];if(!a.hasAttribute("disabled")&&"none"!==getComputedStyle(a).display)return a}}_getLastItem(e){const t=e.children;for(let e=t.length-1;e>=0;e--){const a=t[e];if(!a.hasAttribute("disabled")&&"none"!==getComputedStyle(a).display)return a}}_getPrevItem(e,t){const a=this._getSelectedItem(e,t);let s=a?a.previousElementSibling:this._getLastItem(e);for(;s;){if(!s.hasAttribute("disabled")&&"none"!==getComputedStyle(s).display)return s;s=s.previousElementSibling}}_getNextItem(e,t){const a=this._getSelectedItem(e,t);let s=a?a.nextElementSibling:this._getFirstItem(e);for(;s;){if(!s.hasAttribute("disabled")&&"none"!==getComputedStyle(s).display)return s;s=s.nextElementSibling}}_getSelectedItem(e,t){return e?t?e.querySelector("[focus]"):e.querySelector(".selected"):null}_selectListItem(e){if(!e)return;const t=e.parentElement,a=t.querySelector(".selected");a&&(a.classList.remove("selected"),a.removeAttribute("aria-selected")),e.classList.add("selected"),e.setAttribute("aria-selected",!0),t.scrollTop=e.offsetTop}_focusTask(e){if(!e)return;const t=this;t._isMobile||(Array.from(t.querySelectorAll("[focus]")).forEach((e=>e.removeAttribute("focus"))),e.setAttribute("focus",""),this._focusedTask=e.data.id,t.virtualization?t.ensureVisible(t._focusedTask):this.ensureVisible(e))}_setFocusable(){const e=this,t=e.$.container,a=e.disabled||e.unfocusable;let s=[e.$.customizeButton,e.$.filterButton,e.$.sortButton,e.$.searchButton,e.$.searchPrev,e.$.searchNext,e.$.searchClose,e._actionsList,e._userList];if(s=s.concat(Array.from(t.querySelectorAll(".smart-kanban-column-header, .smart-kanban-column-header-add, .smart-kanban-tab, .smart-kanban-column-content-tasks, .smart-kanban-task-user, .smart-kanban-task-actions, .smart-kanban-task-comments, .smart-kanban-add-new-column"))),s.forEach((e=>{a?e.removeAttribute("tabindex"):(null===e.getAttribute("tabindex")||e.getAttribute("tabindex")<0)&&e.setAttribute("tabindex",0)})),e._dialog&&e._dialog.editPanelPopulated){const t=Array.from(e._dialog.$.container.querySelectorAll(".text-editor, .new-subtask"));a?t.forEach((e=>e.tabIndex=-1)):t.forEach((e=>e.removeAttribute("tabindex"))),Array.from(e._dialog.$.container.querySelectorAll(".smart-element.editor, smart-button.add, smart-button.ok, smart-button.cancel")).forEach((e=>e.unfocusable=a)),e._dialog.unfocusable=a}}_startDragging(e,t){const a=this;if(!a._currentUser.allowDrag)return;if(a._isMobile)return;const s=e.closest("smart-scroll-viewer"),l=e.getBoundingClientRect();let r=e.hasAttribute("selected")?Array.from(e.parentElement.querySelectorAll("[selected]")):[e],o=r.map((e=>e.data));a._dragDetails={StartPosition:{left:t.pageX,top:t.pageY},Items:r,ItemsData:o,ItemData:e.data,Item:e,FeedbackShown:!1,OriginalEvent:t,Column:e.classList.contains("smart-kanban-column")?e:null,PointerOffset:[l.x-t.clientX,l.y-t.clientY],ScrollViewer:s,StartTime:new Date,Dragging:!0},Smart.Kanban.kanbanTaskDragged=!0,s&&s._scrollView&&(s._scrollView.disableSwipeScroll=!0),a.allowDrop&&(Smart.Kanban.hoveredKanban=a,Smart.Kanban.hoveredItem=e)}_documentMoveHandler(e){const t=this,a=t._dragDetails;function s(){delete t._dragDetails,delete Smart.Kanban.kanbanTaskDragged,delete Smart.Kanban.hoveredKanban,delete Smart.Kanban.hoveredItem,a.ScrollViewer._scrollView.disableSwipeScroll=!1}if(t.allowColumnReorder&&t._columnDragDetails&&(Math.abs(e.pageX-t._columnDragDetails.x)>=3||Math.abs(e.pageY-t._columnDragDetails.y)>=3)&&(t._startDragging(t._columnDragDetails.kanbanColumn,t._columnDragDetails.event),t._columnDragDetails=null),!a)return;if(!a.FeedbackShown){const l=(new Date).getTime()-a.StartTime.getTime()>500,r=Math.abs(a.StartPosition.left-e.pageX)>5||Math.abs(a.StartPosition.top-e.pageY)>5;if(!r||!(!t._isMobile||t._isMobile&&l))return void(t._isMobile&&r&&!l&&s());if(t.$.fireEvent("dragStart",{item:a.Item,items:a.Items,data:a,container:t,previousContainer:t,originalEvent:a.OriginalEvent}).defaultPrevented)return void s();t.closePanel(),t._hideBodyOverflow(),a.Feedback=t._addDragFeedback(),a.FeedbackShown=!0,a.Items.forEach((e=>e.classList.add("dragged")))}const l=a=>{a.scrollWidth&&(t._autoScrollDragInterval&&clearInterval(t._autoScrollDragInterval),t._autoScrollDragInterval=setInterval((function(){const t=a.getBoundingClientRect();e.clientX<=t.left+20?a.scrollLeft-=15:e.clientX>=t.left+t.width-20&&(a.scrollLeft+=15)}),25))};Smart.Kanban.hoveredKanban?l(Smart.Kanban.hoveredKanban.$.scrollViewer):l(t.$.scrollViewer);let r,o=t.dragOffset;if(o="auto"!==o&&Array.isArray(o)?o:a.PointerOffset,t.$.fireEvent("dragging",{item:a.Item,items:a.Items,data:a,originalEvent:e}),a.Feedback.style.left=e.pageX+(o[0]||0)+"px",a.Feedback.style.top=e.pageY+(o[1]||0)+"px",Smart.Kanban.hoveredKanban&&(clearInterval(Smart.Kanban.hoveredKanban._dragInterval),delete Smart.Kanban.hoveredKanban),Smart.Kanban.hoveredItem&&(Smart.Kanban.hoveredItem.classList.remove("drop-target"),Smart.Kanban.hoveredItem.classList.remove("before","after"),delete Smart.Kanban.hoveredItem),r=t._isMobile?(t.shadowRoot||t.getRootNode()).elementFromPoint(e.clientX,e.clientY):t.isInShadowDOM||t.shadowRoot?e.originalEvent.composedPath()[0]:e.originalEvent.target,!r)return;const i=(t.shadowRoot?r.getRootNode().host:r).closest("smart-kanban");if(!i||!i.allowDrop)return;const n=r.closest(".smart-kanban-column-content-tasks");if(Smart.Kanban.hoveredKanban=i,a.Column)return void t._handleColumnDragging(e);if(!n)return;const d=n.parentElement.parentElement.getAttribute("orientation"),c=Array.from(n.$.content.children);let u=0;if(c.forEach((e=>e.filteredOut&&u++)),0===c.length||c.length===u)return Smart.Kanban.hoveredItem=n.$.scrollViewerContainer,void Smart.Kanban.hoveredItem.classList.add("drop-target");n.scrollHeight>0&&(i._dragInterval=setInterval((function(){const a=n.getBoundingClientRect();a.left<=e.clientX&&a.left+a.width>=e.clientX?e.clientY>=a.top&&e.clientY<=a.top+20?n.scrollTop-=t._autoScrollCoefficient:e.clientY>=a.top+a.height-20&&e.clientY<=a.top+a.height?n.scrollTop+=t._autoScrollCoefficient:clearInterval(i._dragInterval):clearInterval(i._dragInterval)}),2));let m=r.closest(".smart-kanban-task");if(m&&-1===a.Items.indexOf(m)){const t=m.getBoundingClientRect();"vertical"===d&&e.clientY-t.top<=t.height/2||"horizontal"===d&&e.clientX-t.left<=t.width/2?m.classList.add("before"):m.classList.add("after")}else{if(m&&1===c.length)return;m=m&&1===a.Items.length?t[`_${d}ClosestTaskToHover`]([m.previousElementSibling,m.nextElementSibling],e,!0):t[`_${d}ClosestTaskToHover`](c,e,m||r===n.$.content)}m&&(m.classList.add("drop-target"),Smart.Kanban.hoveredItem=m)}_handleColumnDragging(e){const t=this.querySelectorAll(".smart-kanban-column");let a;for(let s=0;s<t.length;s++){const l=t[s],r=l.getBoundingClientRect();e.clientX>=r.left&&e.clientX<=r.right&&e.clientY>=r.top&&e.clientY<=r.bottom&&(a=l)}if(a){const s=a.getBoundingClientRect();e.clientX-s.left<=s.width&&(a.classList.add("before"),a.classList.add("drop-target")),e.clientX-s.left>=s.width/2&&a===t[t.length-1]&&(a.classList.remove("before"),a.classList.add("after"),a.classList.add("drop-target")),Smart.Kanban.hoveredItem=a}}_hideBodyOverflow(){const e=this,t=(document.scrollingElement||document.documentElement).scrollHeight>document.documentElement.clientHeight,a=(document.scrollingElement||document.documentElement).scrollWidth>document.documentElement.clientWidth,s=e.isInShadowDOM?e.getRootNode().host:document.body;e._originalBodyOverflow={overflowX:s.style.overflowX,overflowY:s.style.overflowY,overflow:s.style.overflow},s.classList.add("smart-dragging"),s.style.overflow=s.style.overflowX=s.style.overflowY="",t&&!a?s.style.overflowX="hidden":a&&!t?s.style.overflowY="hidden":a||t||(s.style.overflow="hidden")}_verticalClosestTaskToHover(e,t,a){const s=this._dragDetails.Items,l=t.clientY;let r,o,i=1/0,n=0,d=e.length-1,c=1;for(a||(n=d,d=0,c=-1);n!==d+c;){const t=e[n];if(n+=c,!t||t.filteredOut||-1!==s.indexOf(t))continue;if(!a){r=t,o="after";break}const d=t.getBoundingClientRect(),u=d.top+d.height/2,m=Math.abs(l-u);if(!(m<i))break;i=m,r=t,o=l<=u?"before":"after"}return r&&r.classList.add(o),r}_horizontalClosestTaskToHover(e,t){const a=this._dragDetails.Items,s=t.clientY,l=t.clientX;let r,o,i;return e.forEach((e=>{if(!e||e.filteredOut||-1!==a.indexOf(e))return;const t=e.getBoundingClientRect(),n=Math.abs(s-t.top),d=Math.abs(s-t.bottom),c=Math.min(n,d),u=Math.abs(l-t.left),m=Math.abs(l-t.right),p=Math.min(u,m),h=Math.sqrt(Math.pow(p,2)+Math.pow(c,2));(void 0===o||h<o)&&(r=e,o=h,i=u<m?"before":"after")})),r&&r.classList.add(i),r}_scrollViewerTouchmoveHandler(e){const t=this;t._dragDetails&&(t.isInShadowDOM||t.shadowRoot?e.composedPath()[0]:e.target).closest("smart-scroll-viewer")&&e.cancelable&&(e.preventDefault(),e.stopPropagation())}_documentUpHandler(e){const t=this,a=t._dragDetails;if(t._columnDragDetails=null,t.$.container.hasAttribute("modal"))return;const s=t.isInShadowDOM||t.shadowRoot?e.originalEvent.composedPath()[0]:e.originalEvent.target,l=t.$.header;if(t._userSelectionFor&&!t._userList.contains(s)&&t._closeList(t._userList,"_userSelectionFor"),t._prioritySelectionFor&&!t._priorityList.contains(s)&&t._closeList(t._priorityList,"_prioritySelectionFor"),t._actionSelectionFor&&!t._actionsList.contains(s)&&t._closeList(t._actionsList,"_actionSelectionFor"),t._columnActionSelectionFor&&!t._columnActionsList.contains(s)&&(t._columnActionsList.classList.contains("smart-visibility-hidden")||(t._closeList(t._columnActionsList,"_columnActionSelectionFor"),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),t._columnActionsListDate=new Date)),t._commentSelectionFor){const e=t._commentsList;(t.shadowRoot||t.getRootNode()).activeElement!==e.textarea&&(t._actionSelectionFor||e.contains(s)?!e.classList.contains("expanded")||s===e.textarea||e.button.contains(s)||s.classList.contains("remove-button")||e.classList.remove("expanded"):t._closeList(e,"_commentSelectionFor"))}if(!("none"===t.headerPosition||t.$.headerDropDown.classList.contains("smart-visibility-hidden")||t.$.headerDropDown.classList.contains("search-panel")||s!==l&&l.contains(s))){const e=s.closest("smart-scroll-viewer"),a=s.closest(".smart-drop-down");e&&l.contains(e.ownerElement)||a&&(!a.ownerElement||l.contains(a.ownerElement))||t.closePanel()}if(!a)return;const r=Smart.Kanban.hoveredKanban,o=Smart.Kanban.hoveredItem;t._dragDetails&&e.originalEvent.preventDefault(),delete t._dragDetails,delete Smart.Kanban.kanbanTaskDragged,delete Smart.Kanban.hoveredKanban,delete Smart.Kanban.hoveredItem,delete Smart.Kanban.dropOverTask,delete Smart.Kanban.isBefore;let i=!1;if(document.querySelectorAll(".smart-kanban-task-placeholder").forEach((e=>{e.classList.remove("smart-kanban-task-placeholder"),e.style.marginTop=e.style.marginBottom="0px",i=!0})),i&&t._refreshButtonsAndSummaries(),a.ScrollViewer&&a.ScrollViewer._scrollView&&(a.ScrollViewer._scrollView.disableSwipeScroll=!1),!a.FeedbackShown)return;const n=r||(t.shadowRoot||t.getRootNode()).elementFromPoint(e.clientX,e.clientY);t._preventSelection=!0;const d=t.isInShadowDOM?t.getRootNode().host:document.body;d.classList.remove("smart-dragging"),d.style.overflow=t._originalBodyOverflow.overflow,d.style.eoverflowX=t._originalBodyOverflow.overflowX,d.style.overflowY=t._originalBodyOverflow.overflowY,delete t._originalBodyOverflow,a.Feedback.remove(),r&&clearInterval(r._dragInterval);const c=a.Item,u=a.Items;if(u.forEach((e=>e.classList.remove("dragged"))),!n)return;if(!o)return void t.$.fireEvent("dragEnd",{item:c,items:u,target:n,data:a,previousContainer:t,container:n,originalEvent:e});if(!r||!r.allowDrop||r.disabled)return;let m=!1;if(o.classList.remove("drop-target"),o.classList.contains("before")?o.classList.remove("before"):o.classList.contains("after")&&(o.classList.remove("after"),m=!0),a.DropDetails={item:o,after:m},t.$.fireEvent("dragEnd",{item:c,items:u,target:o,data:a,previousContainer:t,container:r,originalEvent:e}).defaultPrevented)return;function p(e,s){t._requestVirtualDataSource("update",Object.assign({},e.data,{status:s}),(function(s){return s&&t._moveDraggedItems(Object.assign({},a,{Item:e,Items:[e]})),s}))}const h=o.closest(".smart-kanban-column"),g=h.column.dataField;if(a.Column){const e=()=>Array.from(h.parentElement.querySelectorAll(".smart-kanban-column")).filter((e=>e.parentElement===h.parentElement)),s=e().indexOf(a.Column);a.DropDetails.after?h.parentElement.appendChild(a.Column):h.parentElement.insertBefore(a.Column,h);const l=e().indexOf(a.Column),r=[],o=e();for(let e=0;e<o.length;e++)o[e].column&&!o[e].classList.contains("smart-kanban-add-new-column")&&r.push(o[e].column);return t.columns=r,t.$.fireEvent("columnReorder",{column:a.Column.column,oldIndex:s,index:l}),t._reset(),void t._createAddNewButton()}if(c&&c.data&&g!==c.data[t.dataSourceMap.status]){const e=Object.assign({},c.data);e[t.dataSourceMap.status]=g;const a=t.getColumn(g);a&&(e.statusLabel=a.label);const s=t.getColumn(c.data[t.dataSourceMap.status]);s&&(c.data.statusLabel=s.label);const l=JSON.parse(JSON.stringify(e)),r=JSON.parse(JSON.stringify(c.data));if(t.$.fireEvent("change",{task:c,id:l.id,value:l,oldValue:r}),t._currentUser.info){const e=t.dataSourceMap;c.data[e.updatedUserId]=t._currentUser.info.id,c.data[e.updatedDate]=new Date,t.addHistory(c.data,{action:"moved",user:t._currentUser.info.id,details:{id:c.data[e.id],oldValue:r[e.status],value:l[e.status]},label:c.data[e.text],date:c.data[e.updatedDate]}),l.history=c.data.history}t.$.fireEvent("taskUpdate",{id:l.id,value:l,oldValue:r})}if(t.dataSource&&t.dataSource.virtualDataSource&&g!==c.data[t.dataSourceMap.status])if(m)for(let e=u.length-1;e>=0;e--)p(u[e],g);else for(const e of u)p(e,g);else if(t._moveDraggedItems(a),c&&c.data){const e=Object.assign({},c.data),a=JSON.parse(JSON.stringify(e));t.$.fireEvent("taskReorder",{id:a.id,value:a})}}_refreshButtonsAndSummaries(){const e=this;e._refreshColumnHeights(),e.addNewButtons&&(e.addNewButtons.forEach((e=>{e.refresh()})),e._refreshSummaries())}_addDragFeedback(){const e=this,t=e._dragDetails.Item,a=e._dragDetails.Items.length,s=document.createElement("div"),l=t.offsetWidth+"px",r=t.offsetHeight+"px";let o=t.cloneNode(!0);if(o.style.width=l,o.style.height=r,t.classList.contains("smart-kanban-column")){o=document.createElement("smart-kanban");const a=Object.assign({},t.column);a.collapsed=!1;const r=[a];o.columns=r,o.dataSource=e.dataSource,o.users=e.users,o.taskActions=e.taskActions,o.taskDue=e.taskDue,o.taskProgress=e.taskProgress,o.style.height="100%",o.style.width=l,o.style.minWidth="250px",s.setAttribute("column-drag","")}if(s.className="smart-kanban-feedback",s.setAttribute("parent-kanban-id",e.id),e.theme&&s.setAttribute("theme",e.theme),["rightToLeft","taskActions","taskComments","taskDue","taskPriority","taskProgress","taskTags","taskUserIcon"].forEach((t=>{e[t]&&s.setAttribute(Smart.Utilities.Core.toDash(t),"")})),s.appendChild(o),a>1){const e=document.createElement("div");e.style.width=l,e.style.height=r,e.className="smart-kanban-feedback-additional",s.insertBefore(e,o),o.setAttribute("num",a),a>2&&e.classList.add("multiple")}return e.getShadowRootOrBody().appendChild(s),s}_moveDraggedItems(e){const t=this,a=t.dataSourceMap;let s,l=e.DropDetails,r=l.item,o=r.closest(".smart-kanban-column"),i=e.Item.closest("smart-scroll-viewer"),n=o.column;if(r.classList.contains("smart-kanban-task")?(s=r.parentElement,l.after&&(r=r.nextElementSibling,r&&r.classList.contains("smart-hidden")&&(r=null)),e.Items.forEach(((l,o)=>{if(t.virtualization){const s=e.ItemsData[o],i=s[a.status],d=t._getTasksByDataField(i),c=d.findIndex((e=>e.id===s.id));if(r){if(r.data!==l.data){d.splice(c,1);const e=t._getTasksByDataField(n.dataField),a=e.indexOf(r.data);e.splice(a,0,s)}}else c>=0&&(d.splice(c,1),t._getTasksByDataField(n.dataField).push(s))}else{s.insertBefore(l,r);const i=e.ItemsData[o],d=i[a.status],c=t._getTasksByDataField(d),u=c.findIndex((e=>e.id===i.id));if(r){if(r.data!==l.data){c.splice(u,1);const e=t._getTasksByDataField(n.dataField),a=e.indexOf(r.data);e.splice(a,0,i)}}else u>=0&&(c.splice(u,1),t._getTasksByDataField(n.dataField).push(i))}l.data[a.status]=n.dataField,l.data.statusLabel=n.label,l.column=n}))):(s=r.firstElementChild,e.Items.forEach((e=>{if(t.virtualization){const s=e.data[a.status],l=t._getTasksByDataField(s),r=l.findIndex((t=>t.id===e.data.id));l.splice(r,1),t._getTasksByDataField(n.dataField).push(e.data)}else{s.appendChild(e);const l=e.data[a.status],r=t._getTasksByDataField(l),o=r.findIndex((t=>t.id===e.data.id));r.splice(o,1),t._getTasksByDataField(n.dataField).push(e.data)}e.data[a.status]=n.dataField,e.data.statusLabel=n.label,e.column=n}))),s=s.closest("smart-scroll-viewer"),t.swimlanes.length>0){const t=s.getAttribute("swimlane");t?e.Items.forEach((e=>e.data[a.swimlane]=t)):e.Items.forEach((e=>delete e.data[a.swimlane]))}t.virtualization?(t._refreshColumns(),t.focusTask(e.ItemData.id)):t._focusTask(e.Item),i!==s?(s.focus(),t.textTemplate&&e.Items.forEach((e=>t._renderTask(e))),e.Item.hasAttribute("selected")&&(e.Items.forEach((e=>e.removeAttribute("selected"))),t._selectedTasks=[],t._autoSaveState("selection")),t._refreshScrollViewer(i,!0),t._refreshScrollViewer(s,!0)):t.virtualization&&t._refreshScrollViewer(i,!0),t._refreshSummaries(),t._autoSaveState("dataSource")}_getCurrentDataSource(){const e=Array.from(this.$.container.getElementsByClassName("smart-kanban-task")),t=[],a=this;if(a.virtualization){const e=Object.keys(a.tasksByDataField);let t=[];for(let s=0;s<e.length;s++){const l=e[s];let r=a._getTasksByDataField(l);t=[...t,...r]}return t}for(let a=0;a<e.length;a++)t.push(e[a].data);return t}_validateTaskArgument(e){const t=this;return e instanceof HTMLElement&&t.$.container.contains(e)&&e.classList.contains("smart-kanban-task")?e:null===e||"number"!=typeof e&&"string"!=typeof e?null!==e&&"object"==typeof e&&void 0!==e.id?t.$.container.querySelector(`.smart-kanban-task[data-id="${e.id}"]`):void 0:t.$.container.querySelector(`.smart-kanban-task[data-id="${e}"]`)}_openDialog(e,t,a="task"){const s=this,l={purpose:t};if(l[a]=e,window.smartBlazor&&(l[a]=e.data),s.$.fireEvent("opening",l).defaultPrevented)return;if(s.disableDialog)return;s._dialog||s._createDialog();const r=s._dialog,o="prompt"===t;r.refreshFieldsDirty=!0,r.openedFrom=(s.shadowRoot||s.getRootNode()).activeElement,r.classList.toggle("prompt",o),r.classList.toggle("edit",!o),r.style.top="",r.style.left="",r.style.width="",r.style.height="auto","edit"!==t||!s.readonly&&s._currentUser.allowEdit?r.removeAttribute("readonly"):r.setAttribute("readonly",""),s.offsetWidth<600&&(r.style.top="0px",r.style.left="0px",r.style.width="100%",r.style.height="100%");const i=e=>{s.applyColumnColorToTasks&&(e&&e.color?(r.style.setProperty("--smart-primary",e.color),r.style.setProperty("--smart-ui-state-active",e.color)):(r.style.setProperty("--smart-primary",""),r.style.setProperty("--smart-ui-state-active","")))};if(e&&e.column?i(e.column):"add"===t&&i(e),r.taskOrComment=e,"edit"===t?s._currentUser&&s._currentUser.allowRemove&&r.querySelector(".delete").classList.remove("smart-hidden"):r.querySelector(".delete").classList.add("smart-hidden"),r.editPanelPopulated&&(r.selectTab(0),r.editors.historyTab&&r.editors.historyTab.classList.add("smart-hidden")),o){let t="task"===a?s.localize("promptTask",{taskText:e.data[s.dataSourceMap.text]}):s.localize("promptComment"),l="task"===a?s.localize("removeTask",{taskText:e.data[s.dataSourceMap.text]}):s.localize("removeComment");"column"===a&&(t=s.localize("promptColumn"),l=s.localize("removeColumn")),r.label=l,r.setAttribute("aria-label",t),r.$.container.querySelector(".prompt").innerHTML=t}else{let a=!0;if(r.removeAttribute("aria-label"),r.headerPosition="top",r.editPanelPopulated||(s._initEditPanel(),a=!1),"edit"===t)s._beginEdit(e);else if("add"===t){r.label=s.localize("addNewTask"),delete r.taskOrComment,a&&s._clearEditors();const t=s.tags.length>0?[...s.tags,...s._customTags]:s._customTags;r.editors.tags.dataSource=t,s._showHideDialogEditors(),r.refreshTabs(!1),r.selectTab(0),r.editors.status.selectedValues=[e.dataField],0===s.swimlanes.length?(r.editors.swimlane.classList.add("smart-hidden"),r.editors.swimlaneLabel.classList.add("smart-hidden"),r.editors.swimlane.parentElement.classList.add("single-column")):(r.editors.swimlane.classList.remove("smart-hidden"),r.editors.swimlaneLabel.classList.remove("smart-hidden"),r.editors.swimlane.parentElement.classList.remove("single-column")),r.editors.created.parentElement.classList.add("smart-hidden"),r.editors.updated.parentElement.classList.add("smart-hidden")}}s.$.container.setAttribute("modal","");const n=s.offset(s);s.offsetWidth>600&&(r.offsetHeight>s.offsetHeight?r.style.top=s.getBoundingClientRect().top+"px":r.style.top=n.top+s.offsetHeight/2-r.offsetHeight/2+"px",r.offsetWidth>s.offsetWidth?r.style.left=s.getBoundingClientRect().left+"px":r.style.left=n.left+s.offsetWidth/2-r.offsetWidth/2+"px"),s.dialogCustomizationFunction&&s.dialogCustomizationFunction(r,e,r.editors,r.labels,t,a),r.open()}_createDialog(){const e=this,t=document.createElement("smart-window"),a=document.createElement("template"),s=` animation="${e.animation}"${e._rtlAttr} theme="${e.theme}"${e.unfocusable?" unfocusable":""}`;a.innerHTML=`<smart-button class="ok primary"${s}><span class="smart-icon"></span>${e.localize("ok")}</smart-button>\n<smart-button class="cancel"${s}><span class="smart-icon"></span>${e.localize("cancel")}</smart-button><smart-button class="smart-hidden delete secondary"${s}><span class="smart-icon"></span>${e.localize("delete")}</smart-button>`,t.animation=e.animation,t.footerTemplate=a,t.headerButtons=["close"],t.rightToLeft=e.rightToLeft,t.resizeMode="both",t.liveResize=!0,t.theme=e.theme,t.className="smart-kanban-window",t.innerHTML='<div class="prompt"></div>\n<div class="edit"></div>',t.ownerElement=e,e._dialog=t,e._addDialogHandlers(),e.getShadowRootOrBody().appendChild(t)}_addDialogHandlers(){const e=this,t=e._dialog;t.addEventListener("open",e._dialogEventHandler),t.addEventListener("closing",e._dialogEventHandler),t.addEventListener("close",e._dialogEventHandler),t.addEventListener("click",e._dialogClickHandler),t.addEventListener("keydown",(e=>{if("Enter"===e.key){const e=t.querySelector(".ok"),a=t.querySelector('.smart-kanban-tab[view="details"]');a&&a.classList.contains("selected")&&(e.disabled||e.click())}}))}_dialogEventHandler(e){const t=this,a=t.ownerElement,s=e.type,l=a.context;(t.isInShadowDOM||t.shadowRoot?e.composedPath()[0]:e.target)===t&&(a.context=a,"open"===s?(a.$.fireEvent("open"),t.classList.contains("edit")&&(a.hasAnimation?t.addEventListener("transitionend",(function(){setTimeout((()=>{!a.readonly&&a._currentUser.allowEdit&&t.editors.text.focus()}),100)}),{once:!0}):requestAnimationFrame((()=>t.editors.text.focus())))):"closing"===s?a.$.fireEvent("closing").defaultPrevented&&(e.preventDefault(),delete t.ok):"close"===s&&(a.$.fireEvent("close"),a._dialogCloseHandler(e)),a.context=l)}_dialogClickHandler(e){const t=this,a=t.isInShadowDOM||t.shadowRoot?e.composedPath()[0]:e.target;if(a.closest(".ok"))t.ok=!0,t.close();else if(a.closest(".cancel"))t.close();else if(a.closest(".delete"))t.ownerElement.removeTask(t.taskOrComment),t.close();else if(a.closest(".add")){const e=t.editors.newSubtask,a=e.value;if(""===a)return;const s=t.editors.checklist;s.insert(s.items.length,{label:a}),e.value="",t.$.content.scrollTop=t.$.content.scrollHeight-t.$.content.offsetHeight,t.refreshTabs()}else if(a.classList.contains("remove-subtask"))t.editors.checklist.removeChild(a.closest("smart-list-item")),t.refreshTabs();else if(a.classList.contains("remove-button")){const e=t.ownerElement,s=t.ownerElement.dataSourceMap,l=t.taskOrComment.data[s.comments],r=a.closest(".smart-comment").comment,o=JSON.parse(JSON.stringify(t.taskOrComment.data));t.taskOrComment.comment=r,t.taskOrComment.data[s.comments]=l.filter((e=>e!==t.taskOrComment.comment)),t.refreshComments();const i=JSON.parse(JSON.stringify(t.taskOrComment.data));e.$.fireEvent("change",{task:t.taskOrComment,id:i.id,value:i,oldValue:o}),e.$.fireEvent("taskUpdate",{id:i.id,value:i,oldValue:o}),e.$.fireEvent("commentRemove",{id:i.id,value:t.taskOrComment.comment})}}_dialogCloseHandler(){const e=this,t=e.dataSourceMap,a=e._dialog;function s(s){const l=JSON.parse(JSON.stringify(s.data));a.taskOrComment.remove(),s.querySelector(".smart-kanban-task-comments").setAttribute("num",s.data[t.comments].length||""),e._commentsList.editing&&(e._commentsList.textarea.value="",delete e._commentsList.editing);const r=JSON.parse(JSON.stringify(s.data));e.$.fireEvent("change",{task:s,id:r.id,value:r,oldValue:l}),e.$.fireEvent("taskUpdate",{id:r.id,value:r,oldValue:l}),e.$.fireEvent("commentRemove",{id:r.id,value:a.taskOrComment.comment})}if(e.$.container.removeAttribute("modal"),a.ok){if(a.classList.contains("prompt")){const l=e._commentSelectionFor;if(l){const r=l.data;if(e.dataSource&&e.dataSource.virtualDataSource){const o=Object.assign({},r);o[t.comments]=o[t.comments].filter((e=>e!==a.taskOrComment.comment)),e._requestVirtualDataSource("update",o,(function(e){return e&&(l.data=o,s(l)),e}))}else r[t.comments]=r[t.comments].filter((e=>e!==a.taskOrComment.comment)),s(l)}else e._columnActionSelectionFor&&a.taskOrComment.dataField?e.removeColumn(a.taskOrComment.dataField):e.removeTask(a.taskOrComment)}else e._endEdit();delete a.ok}a.openedFrom&&requestAnimationFrame((()=>{e.getRootNode().contains(a.openedFrom)&&a.openedFrom.focus&&a.openedFrom.focus(),delete a.openedFrom})),delete a.taskOrComment}_closeDialog(){const e=this;e._dialog&&e._dialog.close()}_getHistoryItemLabel(e){const t=this;let a;switch(e.action){case"created":a=t.localize("taskCreated");break;case"tags":a=t.localize("taskTagsChanged");break;case"description":a=t.localize("taskDescriptionChanged");break;case"progress":a=t.localize("taskProgressChanged");break;case"text":a=t.localize("taskNameChanged");break;case"color":a=t.localize("taskColorChanged");break;case"priority":a=t.localize("taskPriorityChanged");break;case"deadline":a=t.localize("taskDeadlineChanged");break;case"subtasks":a=t.localize("taskSubtasksChanged");break;case"user":a=e.details.value?t.localize("taskUserChanged"):t.localize("taskUserRemoved");break;case"moved":a=t.localize("taskMoved");break;case"status":a=t.localize("taskStatusChanged");break;default:a=t.localize("taskUpdated")}return a}_initEditPanel(){const e=this,t=e.id,a=e._dialog,s=a.$.container.querySelector(".edit"),l=[""].concat(e.users.map((e=>({label:e.name,value:e.id,color:e.color,image:e.image})))),r=e._allColumns.map((e=>({color:e.color,label:e.label,value:e.dataField}))),o=e._getPriority(),i=e.swimlanes.map((e=>({label:e.label,value:e.dataField}))),n=document.createElement("template"),d=` animation="${e.animation}"${e._rtlAttr} theme="${e.theme}"${e.unfocusable?" unfocusable":""}`;n.innerHTML=`<div class="smart-kanban-sub-task"><span class="label">{{label}}</span><span class="remove-subtask" aria-label="Remove subtask" title="${e.localize("removeSubtask")}"></span></div>`,n.id=e.id+"ChecklistTemplate",a.$.container.appendChild(n),s.innerHTML=`\n        <div tabindex="0" class="smart-kanban-tab-strip">\n            <div tabindex="0" view="details" class="selected smart-kanban-tab"><div class="smart-kanban-tab-label">${e.localize("detailsTab")}</div></div>\n            <div tabindex="0" view="subtasks" class="smart-kanban-tab"><div class="smart-kanban-tab-label">${e.localize("subtasksTab")}</div></div>\n            <div tabindex="0" view="comments" class="smart-kanban-tab"><div class="smart-kanban-tab-label">${e.localize("commentsTab")}</div></div>\n            <div tabindex="0" view="history" class="smart-kanban-tab smart-hidden"><div class="smart-kanban-tab-label">${e.localize("historyTab")}</div></div>\n            <div tabindex="0" view="fields" class="smart-kanban-tab smart-hidden"><div class="smart-kanban-tab-label">${e.localize("fieldsTab")}</div></div>\n        </div>\n        <div class="smart-kanban-tab-content details">\n            <div class="layout">\n                <div class="column">\n                    <div id="${t}LabelText" class="editor-label">${e.localize("text")}</div>\n                    <smart-input class="editor text-editor" aria-labelledby="${t}LabelText"></smart-input>\n                    <div id="${t}LabelDescription" class="editor-label">${e.localize("description")}</div>\n                    <textarea class="editor description-editor" aria-labelledby="${t}LabelDescription"></textarea> \n                    <div id="${t}LabelStatus" class="editor-label">${e.localize("status")}</div>\n                    <smart-multi-combo-input single-select pills color-items class="editor status-editor" drop-down-open-position="auto" data-source='${JSON.stringify(r)}' drop-down-button-position="right" readonly${d} aria-labelledby="${t}LabelStatus"></smart-multi-combo-input>\n                    <div id="${t}LabelSwimlane" class="editor-label swimlane-label">${e.localize("swimlane")}</div>\n                    <smart-input class="editor swimlane-editor" drop-down-open-position="auto" data-source='${JSON.stringify(i)}'${0===i.length?" disabled":""} drop-down-button-position="right" readonly${d} aria-labelledby="${t}LabelSwimlane"></smart-input>\n                </div>\n                <div class="column">\n                    <div class="editor-container">\n                        <div id="${t}LabelAssignedTo" class="editor-label">${e.localize("assignedTo")}</div>\n                        <div id="${t}LabelProgress" class="editor-label">${e.localize("progress")}</div>\n                        <smart-multi-combo-input readonly pills class="editor asignee-editor" single-select data-source='${JSON.stringify(l)}'${0===l.length?" disabled":""} drop-down-button-position="right"${d} aria-labelledby="${t}LabelAssignedTo"></smart-multi-combo-input>\n                        <smart-numeric-text-box class="editor progress-editor" input-format="floatingPoint" min="0" max="100" show-unit unit="%"${d} aria-labelledby="${t}LabelProgress"></smart-numeric-text-box>\n                    </div>\n                    <div class="editor-container">\n                        <div id="${t}LabelStartDate" class="editor-label">${e.localize("startDate")}</div>\n                        <div id="${t}LabelDueDate" class="editor-label">${e.localize("dueDate")}</div>\n                        <smart-date-time-picker auto-close auto-open class="editor start-date-editor" calendar-button drop-down-append-to="body" drop-down-display-mode="calendar" format-string="${e.formatStringDate}" nullable${d} value="null" aria-labelledby="${t}LabelStartDate"></smart-date-time-picker>\n                        <smart-date-time-picker auto-close auto-open class="editor due-date-editor" calendar-button drop-down-append-to="body" drop-down-display-mode="calendar" format-string="${e.formatStringDate}" nullable${d} value="null" aria-labelledby="${t}LabelDueDate"></smart-date-time-picker>\n                    </div>\n                    <div class="editor-error-container smart-hidden" style="color: var(--smart-error);">\n                      <label id="${t}LabelRange">${e.localize("invalidRange",{start:e.localize("startDate"),end:e.localize("dueDate")})}</label>\n                      <br/>  <br/>\n                    </div>\n                    <div class="editor-container">\n                        <div id="${t}LabelPriority" class="editor-label">${e.localize("priority")}</div>\n                        <div id="${t}LabelColor" class="editor-label">${e.localize("color")}</div>\n                        <div style="display: flex;"><span class="priority-editor-icon"></span><smart-input class="editor priority-editor" data-source='${JSON.stringify(o)}' drop-down-height="auto" drop-down-open-position="auto" drop-down-button-position="right" readonly${d} aria-labelledby="${t}LabelPriority"></smart-input></div>\n                        <smart-color-input value-display-mode="colorBox" class="editor color-editor" drop-down-open-position="auto" drop-down-button-position="right"${d} aria-labelledby="${t}LabelColor"></smart-color-input>\n                    </div>\n                    <div id="${t}LabelTags" class="editor-label">${e.localize("tags")}</div>\n                    <div aria-labelledby="${t}LabelTags">\n                        <smart-multi-combo-input color-items readonly pills class="editor tags-editor" drop-down-button-position="right" drop-down-open-position="auto" ${d} aria-labelledby="${t}LabelTags"></smart-multi-combo-input>\n                        <div class="smart-hidden editor empty-tags-label" id="${t}LabelEmptyTags" aria-labelledby="${t}LabelTags">${e.localize("emptyTags")}</div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div class="smart-kanban-tab-content smart-hidden subtasks">\n            <div id="${t}LabelChecklist" class="editor-label">${e.localize("checklist")}</div>\n            <div class="new-container">\n                <input type="text" class="new-subtask" placeholder="${e.localize("newSubtask")}" />\n                <smart-button class="add primary" title="${e.localize("addSubtask")}" aria-label="Add subtask"${d}>+</smart-button>\n            </div>\n            <smart-list-box class="editor checklist-editor" item-template="${n.id}" selection-mode="checkBox"${d} aria-labelledby="${t}LabelChecklist"></smart-list-box>\n            <br/>\n        </div>\n        <div class="smart-kanban-tab-content comments">\n        </div>\n        <div class="smart-kanban-tab-content smart-hidden history">\n            <div class="editor-container">\n                <div id="${t}LabelCreatedBy" class="editor-label">${e.localize("createdBy")}</div>\n                <div id="${t}LabelCreatedByDate" class="editor-label">${e.localize("createdByDate")}</div>\n                <div class="editor created" aria-labelledby="${t}LabelCreatedBy"></div>\n                <div class="editor created-date" aria-labelledby="${t}LabelCreatedByDate"></div>\n            </div>\n            <div class="editor-container">\n                <div id="${t}LabelUpdatedBy" class="editor-label">${e.localize("updatedBy")}</div>\n                <div id="${t}LabelUpdatedBy" class="editor-label">${e.localize("updatedByDate")}</div>\n                <div class="editor updated" aria-labelledby="${t}LabelUpdatedBy"></div>\n                <div class="editor updated-date" aria-labelledby="${t}LabelUpdatedByDate"></div>\n            </div>\n            <div class="history-table smart-hidden editor-container">\n            </div>\n        </div>\n        <div class="smart-kanban-tab-content fields">\n        </div>        \n<div class="template-container">\n</div>\n`,a.layout=s.querySelector(".layout"),a.editors={text:s.querySelector(".text-editor"),description:s.querySelector(".description-editor"),tags:s.querySelector(".tags-editor"),emptyTags:s.querySelector(".empty-tags-label"),userId:s.querySelector(".asignee-editor"),status:s.querySelector(".status-editor"),swimlane:s.querySelector(".swimlane-editor"),swimlaneLabel:s.querySelector(".swimlane-label"),startDate:s.querySelector(".start-date-editor"),dueDate:s.querySelector(".due-date-editor"),progress:s.querySelector(".progress-editor"),priority:s.querySelector(".priority-editor"),priorityIcon:s.querySelector(".priority-editor-icon"),color:s.querySelector(".color-editor"),newSubtask:s.querySelector(".new-subtask"),checklist:s.querySelector(".checklist-editor"),template:s.querySelector(".template-container"),created:s.querySelector(".created"),createdDate:s.querySelector(".created-date"),updated:s.querySelector(".updated"),updatedDate:s.querySelector(".updated-date"),tabs:s.querySelector(".smart-kanban-tab-strip"),detailsTab:s.querySelector('[view="details"]'),commentsTab:s.querySelector('[view="comments"]'),subtasksTab:s.querySelector('[view="subtasks"]'),historyTab:s.querySelector('[view="history"]'),fieldsTab:s.querySelector('[view="fields"]')},a.labels={};for(let e in a.editors){const t=a.editors[e].getAttribute("aria-labelledby"),l=s.querySelector("#"+t);l&&(a.labels[e]=l)}a.tabs={all:a.editors.tabs,detail:a.editors.detailsTab,comments:a.editors.commentsTab,history:a.editors.historyTab,subtasks:a.editors.subtasksTab,fields:a.editors.fieldsTab};const c=()=>{a.editors.status.classList.contains("smart-hidden")&&a.editors.text.classList.contains("smart-hidden")&&a.editors.description.classList.contains("smart-hidden")?(a.editors.description.closest(".column").classList.add("smart-hidden"),a.editors.description.closest(".layout").classList.add("single-column")):e.dialogEditors&&3===e.dialogEditors.length&&e.dialogEditors.indexOf("text")>=0&&e.dialogEditors.indexOf("description")>=0&&e.dialogEditors.indexOf("status")>=0?a.editors.description.closest(".layout").classList.add("single-column"):(a.editors.description.closest(".column").classList.remove("smart-hidden"),a.editors.description.closest(".column").classList.remove("single-column"),a.editors.description.closest(".layout").classList.remove("single-column"))};a.showEditor=e=>{const t=e=>{if(e){const t=[...e.children];let a=0;for(let e=0;e<t.length;e++)t[e].classList.contains("smart-hidden")||a++;a===t.length&&e.classList.remove("single-column")}};a.editors[e]&&(a.editors[e].classList.remove("smart-hidden"),t(a.editors[e].closest(".editor-container"))),a.labels[e]&&(a.labels[e].classList.remove("smart-hidden"),t(a.labels[e].closest(".editor-container"))),"checklist"===e&&a.tabs.subtasks.classList.remove("smart-hidden"),c()},a.hideEditor=e=>{if(a.editors[e]){a.editors[e].classList.add("smart-hidden");const t=a.editors[e].closest(".editor-container");t&&t.classList.add("single-column")}a.labels[e]&&a.labels[e].classList.add("smart-hidden"),"checklist"===e&&a.tabs.subtasks.classList.add("smart-hidden"),c()};const u=a.editors.tabs.querySelectorAll(".smart-kanban-tab");a.selectTab=e=>{if(u[e]&&!u[e].classList.contains("smart-hidden")&&u[e].click(),0===e){const e=[...a.tabs.all.children];for(let t=0;t<e.length;t++)if(e[t]&&!e[t].classList.contains("smart-hidden")){e[t].click();break}}},a.refreshTabs=t=>{const s=a.taskOrComment?a.taskOrComment.data[e.dataSourceMap.comments]:0,l=s&&s.length?'<span class="summary"> ('+s.length+")</span>":"";let r=a.taskOrComment?a.taskOrComment.data[e.dataSourceMap.checklist]:0,o=r&&r.length?'<span class="summary"> ('+r.length+")</span>":"";t||(r=a.editors.checklist.items.length,r&&(o=r?'<span class="summary"> ('+r+")</span>":"")),a.editors.commentsTab.innerHTML=`${e.localize("commentsTab")}${l}`,a.editors.subtasksTab.innerHTML=`${e.localize("subtasksTab")}${o}`,e._currentUser.allowComment&&a.taskOrComment?a.editors.commentsTab.classList.remove("smart-hidden"):a.editors.commentsTab.classList.add("smart-hidden"),e.readonly&&!r?a.editors.subtasksTab.classList.add("smart-hidden"):a.editors.checklist.classList.contains("smart-hidden")||a.editors.subtasksTab.classList.remove("smart-hidden"),e.taskCustomFields.length>0?a.editors.fieldsTab.classList.remove("smart-hidden"):a.editors.fieldsTab.classList.add("smart-hidden"),a.taskOrComment&&(a.taskOrComment.data[e.dataSourceMap.updatedDate]||a.taskOrComment.data[e.dataSourceMap.createdDate])?a.editors.historyTab.classList.remove("smart-hidden"):a.editors.historyTab.classList.add("smart-hidden");const i=["checklist","color","dueDate","priority","progress","startDate","status","swimlane","tags","text","description","userId"];let n=0;for(let e=0;e<i.length;e++){const t=i[e];a.editors[t].classList.contains("smart-hidden")&&n++}n===i.length?a.tabs.detail.classList.add("smart-hidden"):a.tabs.detail.classList.remove("smart-hidden")},a.refreshFields=()=>{const t=a.querySelector(".fields"),s=a.taskOrComment?a.taskOrComment.data:{},l=e.taskCustomFields.length,r=a.querySelectorAll(["[container-for]"]).length;if(e._resetFields&&(delete e._resetFields,a.refreshFieldsDirty=!0,t.innerHTML=""),!0===a.refreshFieldsDirty)if(a.refreshFieldsDirty=!1,t.firstElementChild&&l<=r)for(let t=0;t<e.taskCustomFields.length;t++){const l=e.taskCustomFields[t];let r=s[l.dataField];const o=a.querySelector("[container-for="+l.dataField+"]");if(!o)continue;e.dataSourceMap[l.dataField]?o.classList.add("smart-hidden"):o.classList.remove("smart-hidden"),null==r&&(r="");const i=o.lastElementChild.firstElementChild;i.removeAttribute("dirty"),r&&r instanceof Date?"dateInput"===l.editor?i.value=r:r&&"dateRangeInput"===l.editor?Array.isArray(r)&&(i.value=r):i.value=""+r:i.value=""+r,"image"===l.editor?r||(i.innerHTML=e.localize("emptyImage")):"attachments"!==l.editor&&"attachment"!==l.editor||r||(i.innerHTML=e.localize("emptyAttachment"))}else{const a=document.createDocumentFragment(),l=(t,a,s)=>{null==a&&(a="");const l=document.createElement("div"),r=document.createElement("div"),o=document.createElement("div");void 0===s.visible&&(s.visible=!0),void 0===s.allowHide&&(s.allowHide=!0),s.allowHide?r.innerHTML=t+'<span class="icon"></span>':r.innerHTML=t,r.classList.add("editor-label"),s.allowHide&&(!1===s.visible&&r.lastElementChild.classList.add("hide"),r.lastElementChild.onpointerdown=()=>{s.visible=!s.visible,r.lastElementChild.classList.toggle("hide")}),o.classList.add("editor");let i=document.createElement("input");if(i.classList.add("smart-input"),void 0!==s.minLength&&(i.minLength=s.minLength),void 0!==s.maxLength&&(i.maxLength=s.maxLength),"textarea"===s.editor)i=document.createElement("smart-text-area"),void 0!==s.minLength&&(i.minLength=s.minLength),void 0!==s.maxLength&&(i.maxLength=s.maxLength);else if("password"===s.editor)i.type="password";else if("phone"===s.editor||"tel"===s.editor)Smart.PhoneInput?i=document.createElement("smart-phone-input"):i.type="tel";else if("url"===s.editor)i.type="url";else if("email"===s.editor)i.type="email";else if("date"===s.dataType||"dateInput"===s.editor)"dateRangeInput"===s.editor?(i=document.createElement("smart-date-range-input"),i.selectedDates=a):i=document.createElement("smart-date-input"),i.autoClose=!0,""===a&&(a=new Date),void 0!==s.minDate&&(i.min=s.minDate),void 0!==s.maxDate&&(i.max=s.maxDate);else if("boolean"===s.dataType)i=document.createElement("smart-check-box"),""===a&&(a=!1);else if("number"===s.dataType||"numberInput"===s.editor)i=document.createElement("smart-number-input"),a||(a=0),void 0!==s.min&&(i.min=s.min),void 0!==s.max&&(i.max=s.max);else if("string"===s.dataType&&s.options)i=document.createElement("smart-input"),i.readonly=!0,i.dropDownButtonPosition="right",i.dataSource=s.options;else if("string"===s.dataType&&"multiComboInput"===s.editor)i=document.createElement("smart-multi-combo-input"),i.readonly=!0,i.dropDownButtonPosition="right",i.dataSource=s.dataSource,i.pills=!0,i.selectedValues=[""+a],s.singleSelect&&(i.singleSelect=!0),s.colorItems&&(i.colorItems=!0);else if("string"!==s.dataType||"image"!==s.editor&&"images"!==s.editor){if("string"===s.dataType&&("attachment"===s.editor||"attachments"===s.editor))if(a.length>50){if("string"==typeof a&&(a.indexOf("[{")>=0||a.indexOf("}]")>=0)){let e="";if(a)try{e=JSON.parse(a)}catch(e){console.log(e)}a=e}const t=document.createElement("div");if(Array.isArray(a)){a.forEach((e=>{const a=document.createElement("div");a.title=e.label,a.classList.add("item"),a.innerHTML="<div></div>",a.firstElementChild.classList.add("smart-grid-icon","show","attachment"),e.label.indexOf("png")>=0||e.label.indexOf("jpg")>=0||e.label.indexOf("jpeg")>=0||e.label.indexOf("gif")>=0?a.firstElementChild.classList.add("smart-icon-image"):e.label.indexOf(".pdf")>=0?a.firstElementChild.classList.add("smart-icon-pdf"):e.label.indexOf(".tsv")>=0||e.label.indexOf(".txt")>=0||e.label.indexOf(".csv")>=0?a.firstElementChild.classList.add("smart-icon-text"):e.label.indexOf(".xls")>=0||e.label.indexOf(".xlsx")>=0?a.firstElementChild.classList.add("smart-icon-excel"):e.label.indexOf(".ppt")>=0?a.firstElementChild.classList.add("smart-icon-powerpoint"):e.label.indexOf(".zip")>=0||e.label.indexOf(".rar")>=0||e.label.indexOf(".7z")>=0?a.firstElementChild.classList.add("smart-icon-archive"):e.label.indexOf(".doc")>=0||e.label.indexOf(".docx")>=0?a.firstElementChild.classList.add("smart-icon-word"):a.firstElementChild.classList.add("smart-icon-file"),t.appendChild(a)}));const s=t;t._value=a,t.onpointerdown=a=>{if(a.target.classList.contains("attachment")){const l=t._value&&"string"==typeof t._value?JSON.parse(t._value):t._value,r=[...s.children[0].children].indexOf(a.target);if(l[r]){const t=document.createElement("a");if(l[r].value.indexOf(window.location.host)>=0)fetch(l[r].value).then((e=>e.blob())).then((e=>{const a=URL.createObjectURL(e);t.download=l[r].label,t.href=a,t.click()}));else{if(l[r].value.indexOf("base64")>=0){const a=e._getFileFromBase64(l[r].value);t.href=URL.createObjectURL(a)}else t.href=l[r].value;t.target="_blank",t.click()}}a.stopPropagation(),a.preventDefault()}}}i=t}else i=document.createElement("div"),a||(i.innerHTML=e.localize("emptyAttachment"))}else if(a.length>50)if(a.indexOf("base64")>=0){a=JSON.parse(a),window.Smart._createSmartImageModal=e._createImageModal;let t="";for(let e=0;e<a.length;e++){const s=a[e];t+=`<img style="margin-left: 5px;" onpointerdown="Smart._createSmartImageModal(this, event)" width="20" height="20" src="${s.value}" title="${s.label}"/>`}i=document.createElement("div"),i.innerHTML=t}else a=a.substring(0,50)+"...";else i=document.createElement("div"),a||(i.innerHTML=e.localize("emptyImage"));return i.setAttribute("data-field",s.dataField),i.classList.add("smart-kanban-task-field-editor"),s&&"dateRangeInput"===s.editor?i.value=a:i.value=""+a,i.onchange=()=>{i.setAttribute("dirty","")},o.appendChild(i),l.appendChild(r),l.appendChild(o),l.setAttribute("container-for",s.dataField),l},r=document.createElement("div");r.classList.add("editor-container"),a.appendChild(r);for(let t=0;t<e.taskCustomFields.length;t++){const a=e.taskCustomFields[t],o=l(a.label,s[a.dataField],a);r.appendChild(o),e.dataSourceMap[a.dataField]&&o.classList.add("smart-hidden")}t.innerHTML="",t.appendChild(a)}},a.refreshHistory=()=>{const t=a.querySelector(".history-table");if(!e.storeHistory)return void t.classList.add("smart-hidden");t.classList.remove("smart-hidden");const s=a.taskOrComment.data.history;let l=`<table><tr>\n            <th>${e.localize("historyEvent")}</th>\n            <th>${e.localize("historyAuthor")}</th>\n            <th>${e.localize("historyDetails")}</th>\n            <th>${e.localize("historyDate")}</th>\n            </tr>\n            `;for(let t=s.length-1;t>=0;t--){const a=s[t];if(l+=`<tr>\n                <td>${e._getHistoryItemLabel(a)}</td>`,void 0!==a.user){const t=(t=>{const a=t?t.image:null;return{image:a?`background-image: url('${a}');`:"",label:t?t.name||t.id:e.localize("guestUser")}})(e.users.find((e=>e.id===a.user)));l+=`<td><div class="smart-kanban-task-user-history"><div class="icon smart-kanban-task-user" style="${t.image}"></div><div class="name">${t.label}</div></div></td>`}else l+="<td></td>";if("created"!==a.action){let t=a.details.oldValue,s=a.details.value;if("user"===a.action){const a=e.users.find((e=>e.id===t)),l=e.users.find((e=>e.id===s));t=a?a.name:e.localize("unassigned"),s=l?l.name:e.localize("unassigned")}if(t&&t instanceof Date&&(t=t.toLocaleString()),s&&s instanceof Date&&(s=s.toLocaleString()),"subtasks"===a.action){const t=a.details.value.filter((e=>e.completed));l+=`<td><span class="smart-truncate">${e.localize("taskSubtasksCompleted",{value:t.length+"/"+a.details.value.length})}</span></td>`}else l+=t?`<td><span class="smart-truncate">${e.localize("range",{oldValue:t,newValue:s})}</span></td>`:`<td><span class="smart-truncate">${e.localize("nullRange",{oldValue:t,newValue:s})}</span></td>`}else l+=`<td>${a.details.value}</td>`;l+=`\n                <td>${a.date.toLocaleString()}</td>\n                </tr>`}l+="</table>",t.innerHTML=l,a.refreshTabs()},a.refreshComments=()=>{if(!a.taskOrComment)return;const t=a.querySelector(".comments");t.classList.remove("smart-hidden");const s=e._getCommentsList(a.taskOrComment);s.classList.remove("dialog");const l=s.querySelector(".send");l&&(l.onclick=t=>{if(l.disabled)return;const s=JSON.parse(JSON.stringify(e._commentSelectionFor.data)),r=e._createComment();e._commentsList.textarea.value="",l.disabled=!0,a.refreshTabs();const o=JSON.parse(JSON.stringify(e._commentSelectionFor.data));e.$.fireEvent("change",{task:e._commentSelectionFor,id:o.id,value:o,oldValue:s}),e.$.fireEvent("taskUpdate",{id:o.id,value:o,oldValue:s}),e.$.fireEvent("commentAdd",{id:o.id,value:r}),t.stopPropagation(),t.preventDefault()}),t.innerHTML="",t.appendChild(s),a.refreshTabs()},u.forEach((e=>{e.onfocus=()=>{e.setAttribute("focus","")},e.onblur=()=>{e.removeAttribute("focus")},e.onkeydown=t=>{"Enter"===t.key&&(e.click(),t.stopPropagation())},e.onclick=e=>{const t=e.target.closest(".smart-kanban-tab"),s=t.getAttribute("view");switch(u.forEach((e=>{e.classList.remove("selected")})),t.focus(),t.classList.add("selected"),a.querySelectorAll(".smart-kanban-tab-content").forEach((e=>{e.classList.add("smart-hidden")})),s){case"details":a.querySelector(".details").classList.remove("smart-hidden");break;case"subtasks":a.querySelector(".subtasks").classList.remove("smart-hidden");break;case"comments":a.refreshComments();break;case"history":a.querySelector(".history").classList.remove("smart-hidden"),a.refreshHistory();break;case"fields":a.querySelector(".fields").classList.remove("smart-hidden"),a.refreshFields()}}})),(()=>{const e=a.editors.color;e.dataSource=["#D50000","#E67C73","#F4511E","#F6BF26","#33B679","#0B8043","#039BE5","#3F51B5","#7986CB","#8E24AA","#616161","#FFFFFF","#000000",""],e.valueDisplayMode="colorBox",e.classList.add("smart-kanban-color-input"),e.style.width="auto",e.style.height="auto",e.readonly=!0,e.dropDownWidth=50;const t=e.$.scrollView;t&&t.classList.add("smart-kanban-color-input"),e.onRender=()=>{const t=e.$.scrollView;t&&t.classList.add("smart-kanban-color-input")}})(),a.editors.newSubtask.onchange=()=>{a.editors.newSubtask.nextElementSibling.click()},a.editors.priority.onchange=()=>{e._setPriorityEditorIcon(!0)},e._setPriorityEditorIcon(),a.editPanelPopulated=!0,e.dialogRendered&&e.dialogRendered(a,a.editors,a.labels,a.tabs,a.layout,a.taskOrComment)}_setPriorityEditorIcon(e){const t=this,a=t._dialog;let s=a.editors.priority.selectedValues[0];null==s&&(s=""),e||a.taskOrComment&&a.taskOrComment.data&&void 0!==a.taskOrComment.data.priority&&(s=a.taskOrComment.data.priority);const l=e=>{switch(e.value){case"":return'<span style="margin-left: 0px; margin-right: 5px;" class="priority"></span>';case"low":return'<span style="margin-left: 0px; margin-right: 5px;" class="priority low"></span>';case"average":return'<span style="margin-left: 0px; margin-right: 5px;" class="priority average"></span>';case"high":return'<span style="margin-left: 0px; margin-right: 5px;" class="priority high"></span>';case"critical":return'<span style="margin-left: 0px; margin-right: 5px;" class="priority critical"></span>'}let t="margin-left: 1px; margin-right: 5px;";return t+="height: 0px;",t+="width: 0px;",t+="border-left-color: transparent;",t+="border-left-style: solid;",t+="border-left-width: 7px;",t+="border-right-color: transparent;",t+="border-right-style: solid;",t+="border-right-width: 7px;","low"!==e.value?(t+="border-bottom-color: "+e.color+";"||0,t+="border-bottom-style: solid;",t+="border-bottom-width: 12px;"):(t+="border-top-color: "+e.color+";"||0,t+="border-top-style: solid;",t+="border-top-width: 12px;"),t+="border-radius: 3px;",`<span class="${e.value} priority" style="${t}"></span>`};for(let e=0;e<t.priority.length;e++){const r=t.priority[e];if(s?a.editors.priorityIcon.classList.remove("smart-hidden"):a.editors.priorityIcon.classList.add("smart-hidden"),r.value===s){a.editors.priorityIcon.innerHTML='<div class="smart-kanban-task-text">'+l(r)+"</div>";break}}}_showHideDialogEditors(){const e=this,t=e._dialog,a=["checklist","color","dueDate","priority","progress","startDate","status","swimlane","tags","text","description","userId"];for(let s=0;s<a.length;s++){const l=a[s];e.dialogEditors.indexOf(l)>=0?t.showEditor(l):t.hideEditor(l)}const s=e._allColumns.map((e=>({color:e.color,label:e.label,value:e.dataField})));s.length<=1&&t.hideEditor("status"),t.editors.status.dataSource=s,0===t.editors.tags.dataSource.length?(t.editors.tags.classList.add("smart-hidden"),t.editors.emptyTags.classList.remove("smart-hidden")):(t.editors.tags.classList.remove("smart-hidden"),t.editors.emptyTags.classList.add("smart-hidden")),0===e.users.length&&t.hideEditor("userId")}_unescapeValue(e){if(null==e)return e;const t=[{regex:"&",entity:"&amp;"},{regex:">",entity:"&gt;"},{regex:"<",entity:"&lt;"},{regex:'"',entity:"&quot;"},{regex:"'",entity:"&#39;"},{regex:"=",entity:"&#x3D;"},{regex:"/",entity:"&#x2F;"},{regex:"`",entity:"&#x60;"}];let a;for(let s in t)a=new RegExp(t[s].entity,"g"),e=e.replace(a,t[s].regex);return e}_escapeValue(e){return e=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")}_beginEdit(e){const t=this;t.tags||(t.tags=[]);const a=t.dataSourceMap,s=e.data,l=t._dialog,r=l.editors,o=t.tags.length>0?[...t.tags,...t._customTags]:t._customTags,i=t._allColumns.find((e=>e.dataField===s[a.status]));if(l.label=t.localize("editTask",{taskId:s[a.id],text:s[a.text]}),r.text.value=t._unescapeValue(s[a.text]),r.description.value=t._unescapeValue(s[a.description]),r.tags.dataSource=o,t._showHideDialogEditors(),t.allowCustomTags,s[a.tags]){const e=e=>{let a=[];e.indexOf(",")>=0?a=e.split(","):Array.isArray(e)?a=a.concat(e):a.push(e);const s=[];for(let e=0;e<a.length;e++)"string"==typeof a[e]?(a[e]=t._unescapeValue(a[e].trim()),s.push(a[e])):(a[e].label=t._unescapeValue(a[e].label),s.push(a[e].value));return s};if(!t.allowCustomTags){const l=t.tags.length>0?t.tags:e(s[a.tags]);r.tags.dataSource=l}r.tags.selectedValues=e(s[a.tags])}else r.tags.selectedValues=[];0===r.tags.dataSource.length?(r.tags.classList.add("smart-hidden"),r.emptyTags.classList.remove("smart-hidden")):(r.tags.classList.remove("smart-hidden"),r.emptyTags.classList.add("smart-hidden")),l.editors.created.parentElement.classList.add("smart-hidden"),l.editors.updated.parentElement.classList.add("smart-hidden");const n=void 0!==s[a.createdUserId]?t.users.find((e=>e.id===s[a.createdUserId])):"",d=s[a.createdDate],c=void 0!==s[a.updatedUserId]?t.users.find((e=>e.id===s[a.updatedUserId])):"",u=s[a.updatedDate],m=e=>{const a=e?e.image:null;return{image:a?`background-image: url('${a}');`:"",label:e?e.name||e.id:t.localize("guestUser")}};if(n){const e=m(n);l.editors.created.parentElement.classList.remove("smart-hidden"),l.editors.created.innerHTML=`<div class="icon smart-kanban-task-user" style="${e.image}"></div><div class="name">${e.label}</div>`,d&&(l.editors.createdDate.innerHTML=d.toLocaleString())}if(c){const e=m(c);l.editors.updated.parentElement.classList.remove("smart-hidden"),l.editors.updated.innerHTML=`<div class="icon smart-kanban-task-user" style="${e.image}"></div><div class="name">${e.label}</div>`,u&&(l.editors.updatedDate.innerHTML=u.toLocaleString())}const p=null!==s[a.userId]?t.users.find((e=>e.id===s[a.userId])):"";p?r.userId.selectedItems=[{label:p.name,value:p.id,image:p.image?p.image:null}]:r.userId.value="",delete r.userId.$.input.dataValue,r.status.selectedValues=[i.dataField],t.readonly||!t._currentUser.allowEdit?(r.status.readonly=!1,r.priority.readonly=!1):(r.status.readonly=!0,r.priority.readonly=!0),delete r.status.$.input.dataValue,t._hasSwimlane(t.columns.indexOf(i))?r.swimlane.value=t.swimlanes.find((e=>e.dataField===s[a.swimlane])).label:r.swimlane.value="",delete r.swimlane.$.input.dataValue,r.startDate.value=s[a.startDate]||null,r.dueDate.value=s[a.dueDate]||null,r.progress.value=parseFloat(s[a.progress])||0;const h=t.localize(s[a.priority]);r.priority.value=null!=h?h:"",delete r.priority.$.input.dataValue,""===r.priority.value&&(r.priority.selectedValues=[]),r.color.value=s[a.color]||"";const g=[],f=[];(s[a.checklist]||[]).forEach(((e,t)=>{e.completed&&g.push(t),f.push({label:e.text,selected:!0===e.completed})})),0===t.swimlanes.length?(l.editors.swimlane.classList.add("smart-hidden"),l.editors.swimlaneLabel.classList.add("smart-hidden"),l.editors.swimlane.parentElement.classList.add("single-column")):(l.editors.swimlane.classList.remove("smart-hidden"),l.editors.swimlaneLabel.classList.remove("smart-hidden"),l.editors.swimlane.parentElement.classList.remove("single-column")),r.dueDate.onchange=r.startDate.onchange=()=>{r.startDate.value>=r.dueDate.value&&r.dueDate.value?(l.$.footer.firstElementChild.disabled=!0,l.querySelector(".editor-error-container").classList.remove("smart-hidden")):(l.$.footer.firstElementChild.disabled=!1,l.querySelector(".editor-error-container").classList.add("smart-hidden"))},r.startDate.value&&r.startDate.value>=r.dueDate.value&&r.dueDate.value&&(l.$.footer.firstElementChild.disabled=!0,l.querySelector(".editor-error-container").classList.remove("smart-hidden")),r.newSubtask.value="",r.checklist.dataSource=f,r.checklist.selectedIndexes=g,t._setPriorityEditorIcon(),l.refreshTabs(!0),l.selectTab(0)}_endEdit(){const e=this,t=e.dataSourceMap,a=e._dialog,s=a.editors,l=a.taskOrComment,r=l?l.data:void 0,o=Object.assign({},r);let i=s.startDate.value,n=s.dueDate.value;o[t.text]=e._escapeValue(s.text.value),o[t.description]=e._escapeValue(s.description.value);const d=[];for(let t=0;t<s.tags.dataSource.length;t++){const a=s.tags.dataSource[t];"string"==typeof a?s.tags.selectedValues.indexOf(a)>=0&&d.push(e._escapeValue(a)):s.tags.selectedValues.indexOf(a.value)>=0&&(a.label=e._escapeValue(a.label),d.push(a))}if(o[t.tags]=d,o[t.progress]=parseFloat(s.progress.value),o[t.color]=s.color.value,e._currentUser.info&&(o[t.updatedUserId]=e._currentUser.info.id,o[t.updatedDate]=new Date),o[t.color]||""===o[t.color]||delete o[t.color],void 0!==s.userId.$.input.dataValue&&(o[t.userId]=parseFloat(s.userId.$.input.dataValue)),void 0!==s.status.$.input.dataValue&&(o[t.status]=s.status.$.input.dataValue),s.swimlane.$.input.dataValue&&(o[t.swimlane]=s.swimlane.$.input.dataValue),i&&(i=i.toDate()),n&&(n=n.toDate()),o[t.startDate]=i,o[t.dueDate]=n,void 0!==s.priority.$.input.dataValue&&(o[t.priority]=s.priority.$.input.dataValue),o[t.checklist]=s.checklist.items.map((e=>({text:e.label.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/\\/g,""),completed:e.selected}))),e.taskCustomFields&&e.taskCustomFields.length>0)for(let t=0;t<e.taskCustomFields.length;t++){const s=e.taskCustomFields[t],l=a.querySelector("[data-field="+s.dataField+"]");if(l){let t=l.value;l.dataSource&&l.dataSource.length>0&&l.selectedValues.length>0&&(t=l.selectedValues.toString()),"smart-number-input"===l.nodeName.toLowerCase()&&(t=l.getValue()),"smart-date-input"===l.nodeName.toLowerCase()&&(t=l.getValue()),"smart-date-range-input"===l.nodeName.toLowerCase()&&(t=l.getValue()),(l.hasAttribute("dirty")||e.dialogCustomizationFunction)&&(o[s.dataField]=t)}}l?e.updateTask(l,o):e.addTask(o),s.tags.close()}_clearEditors(){const e=this,t=e._dialog.editors,a=e.tags.length>0?e.tags:e._customTags;t.text.value="",t.description.value="",t.tags.dataSource=a,t.tags.selectedValues=[],t.status.selectedValues=[],delete t.status.$.input.dataValue,t.swimlane.value="",delete t.swimlane.$.input.dataValue,t.userId.value="",delete t.userId.$.input.dataValue,t.progress.value=0,t.startDate.value=null,t.dueDate.value=null,t.priority.value="",t.priority.$.input.dataValue="",t.priority.selectedValues=[],t.color.value="",t.newSubtask.value="",t.created.innerHTML="",t.updated.innerHTML="",t.createdDate.innerHTML="",t.updatedDate.innerHTML="",t.checklist.dataSource=[],t.checklist.selectedIndexes=[]}_getCurrentUser(){const e=this,t=e.users;let a=e.currentUser,s=!0,l=!0,r=e.allowDrag,o=e.editable,i=!0;t&&null!==a&&(a=t.find((e=>e.id===a)),a&&(s=!1!==a.allowAdd,l=!1!==a.allowComment,r=r&&!1!==a.allowDrag,o=o&&!1!==a.allowEdit,i=!1!==a.allowRemove)),e._currentUser={allowAdd:s,allowComment:l,allowDrag:r,allowEdit:o,allowRemove:i,info:a}}_autoSaveState(e){const t=this;if(t.autoSaveState)if("object"!=typeof e)if(e&&t._autoSavedState){switch(e){case"collapsed":t._allColumns.forEach((e=>t._autoSavedState.collapsed[e.dataField]=e.collapsed));break;case"dataSource":t._autoSavedState.dataSource=t._getCurrentDataSource();break;case"filtering":t._autoSavedState.filtering=t._appliedFiltering;break;case"selection":{const e=t.dataSourceMap;let a=null,s=null;t._selectionInView&&(a=t._selectionInView.closest(".smart-kanban-column").column.dataField,s=t._selectionInView.getAttribute("swimlane")),t._autoSavedState.selection={selected:t._selectedTasks,selectionStart:t._selectionStart?t._selectionStart.data[e.id]:null,selectionInColumn:a,swimlane:s};break}case"sorting":t._autoSaveState.sorting=t._appliedSorting;break;case"tabs":t._autoSaveState.tabs=t._selectedTabs;break;case"visibility":t._autoSavedState.visibility={taskActions:t.taskActions,taskComments:t.taskComments,taskDue:t.taskDue,taskPriority:t.taskPriority,taskProgress:t.taskProgress,taskTags:t.taskTags,taskUserIcon:t.taskUserIcon}}window.localStorage.setItem("smartKanban"+t.id,JSON.stringify(t._autoSavedState))}else t._autoSavedState=t.saveState();else t._autoSavedState=e}_getCurrentDataFields(e){const t=this,a=[{name:"text",dataType:"string"},{name:"tags",dataType:"string"},{name:"priority",dataType:"string"},{name:"progress",dataType:"number"},{name:"startDate",dataType:"date"},{name:"dueDate",dataType:"date"},{name:"userId",dataType:"string"}],s=e&&e.length>0?e[0]:null;for(let e=0;e<t.taskCustomFields.length;e++)if(s){const l=typeof s[t.taskCustomFields[e].dataField];"number"===l?a.push({name:t.taskCustomFields[e].dataField,dataType:"number"}):"date"===l?a.push({name:t.taskCustomFields[e].dataField,dataType:"date"}):a.push({name:t.taskCustomFields[e].dataField,dataType:"string"})}else a.push({name:t.taskCustomFields[e].dataField,dataType:"string"});return a}_applyFilter(e,t){const a=this;if(a.dataSource&&a.dataSource.virtualDataSource)return a._requestVirtualDataSource("filter"),void a._autoSaveState("filtering");const s=a._getCurrentDataSource(),l=a._getCurrentDataFields(s),r=new Smart.DataAdapter({dataSource:s,dataFields:l,id:"id"});try{r._filter(e,t)}catch(e){return}if(a.virtualization){if(e&&e.length>0){const e=Object.keys(a.tasksByDataField);for(let t=0;t<e.length;t++){const s=e[t];delete a.tasksByDataField[s]._filtered;let l=a._getTasksByDataField(s),o=[];for(let e=0;e<l.length;e++){const t=l[e],a=r.dataItemById[t.id];a&&a.$.filtered&&o.push(t)}a.tasksByDataField[s]._filtered=o}}else{const e=Object.keys(a.tasksByDataField);for(let t=0;t<e.length;t++){const s=e[t];delete a.tasksByDataField[s]._filtered}}a._refreshColumns()}else{const e=Array.from(a.$.container.getElementsByClassName("smart-kanban-task"));for(let t=0;t<r.length;t++){const a=e[t],s=!r[t].$.filtered;a.classList.toggle("smart-hidden",s),a.filteredOut=s}a._allColumns.forEach((e=>a._refreshScrollViewer(e)))}a._autoSaveState("filtering")}_applyHandler(e,t){const a=this,s=a.isInShadowDOM||a.shadowRoot?e.composedPath()[0]:e.target,l=e.detail;a.$.customize.contains(s)||"customize"===t?(l.value.forEach((e=>a[e.dataField]=e.visible)),a._allColumns.forEach((e=>a._refreshScrollViewer(e))),a.virtualization&&(delete a._autoCardHeight,a._measureCardHeight(),a._refreshColumns()),a._autoSaveState("visibility")):a.$.filter.contains(s)||"filter"===t?a.addFilter(l.filters,l.operator,l.value):(a.$.sort.contains(s)||"sort"===t)&&a.addSort(l.sortByInfo),a.closePanel()}_applySort(){const e=this,t=e._appliedSorting;if(e._autoSaveState("sorting"),e.dataSource&&e.dataSource.virtualDataSource)e._requestVirtualDataSource("sort");else if(0!==t.dataFields.length)e._allColumns.forEach((a=>{const s=e._columnToElement.get(a).querySelector(".smart-scroll-viewer-content-container"),l=Array.from(s.children),r=[];if(l.length<2)return;let o;if(e.virtualization?e.tasksByDataField[a.dataField].forEach(((t,a)=>{const s=e.dataSourceMap,l=Object.assign({taskIndex:a},t);"low"===l[s.priority]&&(l[s.priority]="z"),r.push(l)})):l.forEach(((t,a)=>{const s=e.dataSourceMap,l=Object.assign({taskIndex:a},t.data);"low"===l[s.priority]&&(l[s.priority]="z"),r.push(l)})),e.taskCustomFields.length){const t=e._getCurrentDataFields(r);t.push({name:"taskIndex",dataType:"number"}),o=new Smart.DataAdapter({dataSource:r,observable:!1,dataFields:t,id:"id"})}else o=new Smart.DataAdapter({dataSource:r,observable:!1,dataFields:["taskIndex: number","text: string","tags: string","priority: string","progress: number","startDate: date","dueDate: date","userId: string"],id:"id"});if(o.sortBy(t.dataFields,t.dataTypes,t.orderBy),e.virtualization){if(e.tasksByDataField[a.dataField]._sorted=Smart.DataAdapter.Sort(e.tasksByDataField[a.dataField],t.dataFields,t.orderBy),e.tasksByDataField[a.dataField]._filtered){e.tasksByDataField[a.dataField]._originalFilteredData=JSON.parse(JSON.stringify(e.tasksByDataField[a.dataField]._filtered));const s=Smart.DataAdapter.Sort([...e.tasksByDataField[a.dataField]._filtered],t.dataFields,t.orderBy);e.tasksByDataField[a.dataField]._filtered=s||[]}e._refreshColumn(a.dataField)}else for(let e=0;e<o.length;e++)s.appendChild(l[o[e].taskIndex])}));else if(e.virtualization){const t=Object.keys(e.tasksByDataField);for(let a=0;a<t.length;a++){const s=t[a];delete e.tasksByDataField[s]._sorted,e.tasksByDataField[s]._filtered&&e.tasksByDataField[s]._originalFilteredData&&(e.tasksByDataField[s]._filtered=e.tasksByDataField[s]._originalFilteredData,delete e.tasksByDataField[s]._originalFilteredData),e._refreshColumn(s)}}}_closeSearchPanel(){const e=this;e._searchInfo&&(Array.from(e.$.container.querySelectorAll(".smart-kanban-task.smart-data-view-found, .smart-kanban-task.smart-data-view-highlighted")).forEach((e=>e.classList.remove("smart-data-view-found","smart-data-view-highlighted"))),delete e._searchInfo)}_constructFilterGroups(e){const t={text:"string",tags:"string",priority:"string",progress:"number",startDate:"date",dueDate:"date"},a={},s=[];e.filters.forEach((s=>{const l=s[0],r=t[l];let o=s[2],i=a[l];void 0===i&&(i=new Smart.Utilities.FilterGroup,a[l]=i),"date"===r&&"string"==typeof o&&(o=new Date(o));const n=i.createFilter(r,o,s[1]);i.addFilter(e.operator,n)}));for(let e in a)s.push([e,a[e]]);return s}_openSearchPanel(){const e=this;e.$.headerDropDown.classList.add("search-panel"),e.$.headerDropDown.classList.remove("customize-panel","filter-panel","sort-panel"),e.$.search.classList.remove("smart-hidden"),e.$.customize.classList.add("smart-hidden"),e.$.filter.classList.add("smart-hidden"),e.$.sort.classList.add("smart-hidden"),e._openHeaderDropDown(e.$.searchButton),e._searchInfo={source:e._getCurrentDataSource(),stringDataFields:["text","tags"]},""!==e.$.searchInput.value&&e._search(e.$.searchInput.value,!1)}_search(e,t=!0){const a=this;if(a._searchInfo.query=e,Array.from(a.$.container.querySelectorAll(".smart-kanban-task.smart-data-view-found, .smart-kanban-task.smart-data-view-highlighted")).forEach((e=>e.classList.remove("smart-data-view-found","smart-data-view-highlighted"))),""===e)return a.$.search.classList.remove("matches","no-matches"),delete a._searchInfo.foundIdsArray,delete a._searchInfo.foundIdsObject,void delete a._searchInfo.highlighted;const s=new Smart.DataAdapter({dataSource:a._searchInfo.source,dataFields:["text: string","tags: string"],id:"id"}),l=[],r=[],o={};a._searchInfo.stringDataFields.forEach((t=>{const a=new Smart.Utilities.FilterGroup,s=a.createFilter("string",e,"CONTAINS");a.addFilter("or",s),l.push([t,a])})),s._filter(l,"or");for(let e=0;e<s.length;e++){const t=s[e];!1!==t.$.filtered&&(r.push(t.$.id),o[t.$.id]=!0)}if(a._searchInfo.foundIdsArray=r,a._searchInfo.foundIdsObject=o,Array.from(a.$.container.getElementsByClassName("smart-kanban-task")).forEach((e=>{const s=e.data[a.dataSourceMap.id];if(o[s]){if(e.filteredOut)return r.splice(r.indexOf(s),1),void delete o[s];t&&r[0]===s&&e.classList.add("smart-data-view-highlighted"),e.classList.add("smart-data-view-found")}})),r.length>0){if(t){let e=r[0];a._searchInfo.highlighted=e,a.ensureVisible(e)}return a.$.search.classList.remove("no-matches"),a.$.search.classList.add("matches"),void(a.$.searchLabel.innerHTML=a.localize("found",{nth:t?1:0,n:r.length}))}a.$.search.classList.remove("matches"),a.$.search.classList.add("no-matches"),a.$.searchLabel.innerHTML=a.localize("found",{nth:0,n:0})}_bodyFocusinHandler(e){const t=this;let a=t.isInShadowDOM||t.shadowRoot?e.composedPath()[0]:e.target;if(a.classList.contains("smart-kanban-column-content-tasks")&&(a=a.$.content,!t._getSelectedItem(a,!0))){if(t.virtualization){const e=t._focusedTask;return void t.focusTask(e)}if(void 0!==t._focusedTask)return void t.focusTask(t._focusedTask);t._focusTask(t._getFirstItem(a))}}get _rtlAttr(){return this.rightToLeft?" right-to-left":""}get _tabindex(){return this.disabled||this.unfocusable?"":' tabindex="0"'}_appendAddNewColumn(e){const t=document.createElement("div");t.classList.add("smart-kanban-column","smart-kanban-add-new-column","smart-unselectable"),t.innerHTML=`<div class="smart-kanban-column-header smart-unselectable" > <div title="${this.localize("addNewColumn")}" class="smart-kanban-add-new-column-label smart-kanban-column-header-label"><span>+ ${this.localize("addNewStatus")}</span></div></div >\n                <div class="smart-kanban-column-content no-sub-columns"><smart-scroll-viewer></smart-scroll-viewer></div>\n            `,this.disabled||this.unfocusable||t.setAttribute("tabindex",0),t.column={dataField:"newStatus",label:"New Status"},e.appendChild(t)}selectTask(e){const t=this;t._selectedTasks.push(e),t._selectionStart=e,t._focusedTask=e;const a=t.querySelector(".smart-kanban-task[focus]");a&&a.removeAttribute("focus");const s=t.querySelector('.smart-kanban-task[data-id="'+e+'"]');s&&s.setAttribute("focus",""),t._refreshSelection(),t.ensureVisible(e)}unselectTask(e){const t=this,a=t._selectedTasks.indexOf(e);a>=0&&t._selectedTasks.splice(a,1),t._refreshSelection()}clearSelection(){const e=this;e._selectionStart=null,e._selectedTasks=[],e._refreshSelection()}getSelectedTasks(){return this._selectedTasks||(this._selectedTasks=[]),this._selectedTasks}getTask(e){return this.dataSource?this.dataSource.find((t=>{if(t.id===e)return t})):null}getColumn(e){const t=this;let a=null;for(let s=0;s<t.columns.length;s++)if(t.columns[s].dataField===e){a=t.columns[s];break}return a}getColumnDataItems(e){const t=this;let a=[];if(!t.getColumn(e)||!t.dataSource)return[];for(let s=0;s<t.dataSource.length;s++){const l=t.dataSource[s];l[t.dataSourceMap.status]===e&&a.push(l)}return a}_getFileFromBase64(e,t){let a=e.split(","),s=a[0].match(/:(.*?);/)[1],l=atob(a[1]),r=l.length,o=new Uint8Array(r);for(;r--;)o[r]=l.charCodeAt(r);return new File([o],t,{type:s})}updateColumn(e,t){const a=this;let s=null;for(let t=0;t<a.columns.length;t++)if(a.columns[t].dataField===e){s=a.columns[t];break}if(s){const e=s.label;void 0!==t.label&&(s.label=t.label),void 0!==t.collapsed&&(s.collapsed=t.collapsed),void 0!==t.collapsible&&(s.collapsible=t.collapsible),void 0!==t.orientation&&(s.orientation=t.orientation),void 0!==t.width&&(s.width=t.width),a._reset(),a.$.fireEvent("columnUpdate",{columnData:t,oldValue:e,value:s.label})}}addColumn(e){const t=this;e?(t.columns.push(e),t._reset(),t._createAddNewButton(),t.$.fireEvent("columnAdd",{columnData:e})):t._addNewColumnDynamically()}removeColumn(e){const t=this;let a=null,s=-1;for(let l=0;l<t.columns.length;l++)if(t.columns[l].dataField===e){a=t.columns[l],s=l;break}if(a&&t.columns.splice(s,1),t.dataSource)for(let a=0;a<t.dataSource.length;a++){const s=t.dataSource[a];if(s[t.dataSourceMap.status]===e){const e=JSON.parse(JSON.stringify(s));s[t.dataSourceMap.status]=t.columns[0].value;const a=JSON.parse(JSON.stringify(s));t.$.fireEvent("change",{task:s,id:a.id,value:a,oldValue:e}),t.$.fireEvent("taskUpdate",{id:a.id,value:a,oldValue:e})}}t._reset(),t._createAddNewButton(),t.$.fireEvent("columnRemove",{column:a})}_addNewColumnDynamically(){const e=this,t=e._dialog,a=Math.floor(9e4*Math.random()+1e4),s={label:e.localize("addNewStatus")+" "+a,dataField:"newStatus"+a,addNewButton:!0,collapsed:!1,collapsible:!0,orientation:"vertical"},l=e.$.body.querySelector(".smart-kanban-add-new-column").querySelector(".smart-kanban-add-new-column-label"),r=document.createElement("input");if(l.classList.add("pending"),l.appendChild(r),r.classList.add("smart-kanban-column-header-input"),e.columnColors){l.classList.add("colors");const t=e._getColorInput();l.appendChild(t)}function o(a){let o=r.value,i=l.querySelector("smart-color-input");i&&i.opened?e._columnAddTimer&&clearTimeout(e._columnAddTimer):(!1===/^\s*$/.test(o)?(o=o.trim(),s.label=o,s.dataField="dataField"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)):""===o&&(o="",s.label="",s.dataField="dataField"+Math.floor(65536*(1+Math.random())).toString(16).substring(1)),l.classList.contains("pending")&&(e._columnAddTimer&&clearTimeout(e._columnAddTimer),e._columnAddTimer=setTimeout((()=>{if(l.classList.remove("pending"),r.parentNode&&r.parentNode.removeChild(r),i){s.color=i.value;const e=l.querySelector(".heading");if(e){const t=new Smart.Color(s.color).getInvertedColor();e.style.backgroundColor=s.color,e.style.color=t}i.remove()}e.columns.push(s),e._reset(),e._createAddNewButton(),t&&t.editPanelPopulated&&(t.editors.status.dataSource=e._allColumns.map((e=>({color:e.color,label:e.label,value:e.dataField})))),e.$.fireEvent("columnAdd",{newColumn:s}),delete e._columnAddTimer}),50),a.stopPropagation()))}r.focus(),r.onkeydown=e=>{"Escape"===e.key?(l.classList.remove("pending"),r&&r.parentElement&&(r.nextElementSibling&&"Smart-COLOR-INPUT"===r.nextElementSibling.nodeName&&r.nextElementSibling.remove(),r.parentElement.removeChild(r),e.stopPropagation(),e.preventDefault())):"Enter"===e.key&&o(e)},r.addEventListener("blur",o),r.addEventListener("change",o)}_handleColumnEditing(e){const t=this,a=t.columns.find((t=>t.dataField===e));if(t._columnEditing)return;const s=Array.from(t.$.body.getElementsByClassName("smart-kanban-column")).find((t=>t.column.dataField===e)).querySelector(".smart-kanban-column-header-label"),l=document.createElement("input");s.classList.add("pending"),s.appendChild(l);const r=a.label,o=a.color;if(l.value=a.label,l.classList.add("smart-kanban-column-header-input"),t.columnColors){s.classList.add("colors");const e=t._getColorInput();e.value=a.color||"transparent",s.appendChild(e)}function i(e){let i=l.value,n=s.querySelector("smart-color-input");if(!n||!n.opened){if(!1===/^\s*$/.test(i)?(i=i.trim(),a.label=i,s.querySelector(".smart-kanban-title").innerHTML=i.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;").replace(/\\/g,"")):""===i&&(a.label="",s.querySelector(".smart-kanban-title").innerHTML="&nbsp;"),n){a.color=n.value;const e=s.querySelector(".heading");if(e){const s=new Smart.Color(a.color).getInvertedColor();t.columnColors?""===a.color?(e.style.backgroundColor="",e.style.color=""):(e.style.backgroundColor=a.color,e.style.color=s):(e.style.backgroundColor="",e.style.color="")}t.applyColumnColorToTasks&&s.closest(".smart-kanban-column").style.setProperty("--smart-primary",a.color),n.remove()}s.classList.remove("pending");try{l.parentNode&&l.parentNode.removeChild(l)}catch(e){t._error=e}t._columnEditTimer&&clearTimeout(t._columnEditTimer),t._columnEditing=!1,t._columnEditTimer=setTimeout((()=>{r===a.label&&o===a.color||t.$.fireEvent("columnUpdate",{column:a,oldValue:r,value:a.label}),delete t._columnEditTimer}),50),e.stopPropagation()}}t._columnEditing=!0,setTimeout((()=>{l.focus()}),50),l.onkeydown=e=>{if("Escape"===e.key){s.classList.remove("pending"),l.value=r;try{l.parentNode&&l.parentNode.removeChild(l)}catch(e){t._error=e}t._columnEditing=!1}else"Enter"===e.key&&i(e)},l.addEventListener("blur",i),l.addEventListener("change",i)}_validateDataSourceMap(){this.dataSourceMap=Object.assign({},{checklist:"checklist",color:"color",comments:"comments",dueDate:"dueDate",id:"id",priority:"priority",progress:"progress",startDate:"startDate",status:"status",swimlane:"swimlane",tags:"tags",text:"text",userId:"userId"},this.dataSourceMap)}});

/***/ }),

/***/ 5707:
/***/ (() => {

Smart("smart-list-item",class extends Smart.ContentElement{static get properties(){return{alternationIndex:{value:-1,type:"int"},color:{value:"",type:"string"},displayMode:{allowedValues:["plain","checkBox","radioButton"],value:"plain",type:"string"},grouped:{value:!1,type:"boolean"},selected:{value:!1,type:"boolean"},value:{value:"",type:"any"},valueName:{value:"",type:"any"},label:{value:"",type:"string"},sanitizeHTML:{value:!1,type:"boolean"},details:{value:"",type:"string"},group:{value:"",type:"string"},hidden:{value:!1,type:"boolean"},readonly:{value:!1,type:"boolean"}}}get hasStyleObserver(){return!1}get enableShadowDOM(){return!1}get _focused(){const e=this;return void 0===e.__focused&&(e.__focused=!1),e.__focused}set _focused(e){const t=this;t.__focused=e,e?(t.setAttribute("focus",""),t.ownerListBox&&t.ownerListBox.ownerElement&&Smart.ComboBox&&t.ownerListBox.ownerElement instanceof Smart.ComboBox&&t.ownerListBox.ownerElement.$.input.setAttribute("aria-activedescendant",t.id)):t.removeAttribute("focus")}template(){return'<div id="container">\n                   <span id=\'itemInput\' class=\'smart-input smart-hidden\'></span>\n                    <span class="smart-overlay" id="overlay"></span>\n                    <div id="itemContainer" class="smart-list-item-label-element smart-content smart-list-item-container"><span class="smart-content-label" inner-h-t-m-l=\'[[innerHTML]]\' role="presentation"><content></content></span><span inner-h-t-m-l=\'[[details]]\' id="details" class="smart-content-details"></span></div>\n                </div>'}appendChild(e){const t=this;if(!t.isCompleted||e.classList&&e.classList.contains("smart-ripple")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}window.smartBlazor?t.$.itemContainer.appendChild(e):(t.$.itemContainer.innerHTML="",e instanceof HTMLElement&&t.$.itemContainer.appendChild(e))}insertBefore(e,t){const i=this;if(!i.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(i,e.concat(Array.prototype.slice.call(arguments)))}t.parentNode.insertBefore(e,t)}removeChild(e){const t=this;if(!t.isCompleted||e.classList.contains("smart-ripple")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof HTMLElement&&t.$.itemContainer.removeChild(e)}attached(){const e=this;super.attached(),e.ownerListBox=e.getListBox(),e.ownerListBox&&(e.ownerListBox.onClick&&(e.onpointerdown=t=>{e.ownerListBox.onClick(t)}),e.ownerListBox.onDoubleClick&&(e.ondblclick=t=>{e.ownerListBox.onDoubleClick(t)}))}static get listeners(){return{mouseenter:"_itemOnMouseEnter",mouseleave:"_itemOnMouseLeave"}}ready(){super.ready();const e=this;if(e.setAttribute("role","option"),""!==e.label){let t=e.label;t&&"string"==typeof t&&e.sanitizeHTML&&(t=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#39;").replace(/"/g,"&quot;")),e.innerHTML=t}else""!==e.innerHTML&&(e.label=e.innerHTML);e._setDisplayMode(e.displayMode),e._setItemColor(),e.$.container.noRipple=!0;const t=e.closest("smart-list-box");if(t&&t.isRendered){if(cancelAnimationFrame(Smart.ListBox.processTimer),t._inLazyInit||t._isUpdating)return;Smart.ListBox.processTimer=requestAnimationFrame((()=>{t._lazyInitItems()}))}}propertyChangedHandler(e,t,i){const r=this;if(super.propertyChangedHandler(e,t,i),"hidden"===e)i?r.$.addClass("smart-hidden"):r.$.removeClass("smart-hidden");else if("color"===e)r._setItemColor();else if("displayMode"===e)r._setDisplayMode(i);else if("label"===e||"value"===e){const t=r.context;r.context=document,"label"===e&&(r.innerHTML=i);const o=r.getListBox();o&&(o._applyTemplate(r),o.onItemUpdated(r)),r.context=t}else if("details"===e){const e=r.context;r.context=document,r.$.details.innerHTML=i;const t=r.getListBox();t&&t.onItemUpdated(r),r.context=e}else if("innerHTML"===e){const e=r.getListBox();e&&e.onItemUpdated(r)}else if("selected"===e)if(i)r.setAttribute("aria-selected",!0);else{const e=r.getListBox();r.readonly||r.disabled||!e||-1===["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox"].indexOf(e.selectionMode)?r.removeAttribute("aria-selected"):r.setAttribute("aria-selected",!1)}}getListBox(){const e=this;if(!Smart.ListBox)return e.getRootNode().host;let t=e.parentNode;for(;t instanceof Smart.ListBox==0&&null!==t;)t=t.parentNode;return!t&&Smart.EnableShadowDOM?e.getRootNode().host:t}_itemOnMouseEnter(){const e=this;!e.disabled&&e.ownerListBox&&(Smart.ListBox.DragDrop.Dragging&&e.ownerListBox.allowDrop&&(Smart.ListBox.DragDrop.DropDetails={item:e,position:"bottom"}),e.ownerListBox.$.verticalScrollBar.thumbCapture||e.ownerListBox.$.horizontalScrollBar.thumbCapture||e.setAttribute("hover",""))}_itemOnMouseMove(e){const t=this;if(t.ownerListBox&&Smart.ListBox.DragDrop.Dragging&&t.ownerListBox.allowDrop&&!Smart.Utilities.Core.isMobile){const i=[].slice.call(t.ownerListBox.getElementsByClassName("smart-list-item-bottom-line-feedback"));for(let e=0;e<i.length;e++)i[e].$.removeClass("smart-list-item-line-feedback"),i[e].$.removeClass("smart-list-item-bottom-line-feedback");if(Smart.ListBox.DragDrop.DropDetails={item:t,position:"top"},!t.ownerListBox._areCSSVarsSupported){if(t.ownerListBox._indexOf(t)===t.ownerListBox._items.length-1||t.parentNode.lastElementChild===t){const i=t.getBoundingClientRect();e.pageY-window.pageYOffset>i.top+i.height/2-1&&(Smart.ListBox.DragDrop.DropDetails={item:t,position:"bottom"})}return}if(t.$.removeClass("smart-list-item-line-feedback"),t.$.removeClass("smart-list-item-bottom-line-feedback"),t.ownerListBox.sorted&&t.ownerListBox.autoSort)return;const r=t.ownerListBox._items.filter((e=>!e.hidden));if(r.indexOf(t)===r.length-1||t.parentNode.lastElementChild===t){const i=t.getBoundingClientRect();e.pageY-window.pageYOffset>i.top+i.height/2-1?(t.$.addClass("smart-list-item-bottom-line-feedback"),Smart.ListBox.DragDrop.DropDetails={item:t,position:"bottom"}):arguments[1]||t.$.addClass("smart-list-item-line-feedback")}else arguments[1]||t.$.addClass("smart-list-item-line-feedback")}}_itemOnMouseLeave(){const e=this;e.ownerListBox&&(Smart.ListBox.DragDrop.Dragging&&(e.$.removeClass("smart-list-item-line-feedback"),e.$.removeClass("smart-list-item-bottom-line-feedback")),e.removeAttribute("hover"))}_setDisplayMode(e){const t=this,i=t.getListBox();if(i){const r="checkBox"===i.selectionMode||"radioButton"===i.selectionMode?i.selectionMode:"plain";t.displayMode=e=r}"plain"!==e?t.$itemInput.removeClass("smart-hidden"):t.$itemInput.addClass("smart-hidden")}_setItemColor(){const e=this,t=e.querySelector(".smart-content-label"),i=/(^#[0-9A-F]{3}$)|(^#[0-9A-F]{6}$)|(^#[0-9A-F]{8}$)/i.test(e.color)?e.color:"";t.style.backgroundColor=i,t.style.color=e._getContrastColor(i)}_getContrastColor(e){if(!e)return"";let t=(i=e.slice(1,3),r=e.slice(3,5),o=e.slice(5,7),[parseInt(i,16),parseInt(r,16),parseInt(o,16)]);var i,r,o;return parseFloat(((.299*t[0]+.61*t[1]+.114*t[2])/255).toFixed(2))>.65?"#000000":"#FFFFFF"}}),Smart("smart-list-items-group",class extends Smart.ContentElement{static get properties(){return{label:{value:"",type:"string"}}}get enableShadowDOM(){return!1}template(){return'<div id="container" role="presentation">\n                 <span id="itemsLabel" class="smart-list-items-group-label">[[label]]</span>\n                 <div id="listItemsGroupContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="smart-list-items-group-container" role="presentation">\n                    <content></content>\n                 </div>\n               </div>'}appendChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof HTMLElement&&t.$.listItemsGroupContainer.appendChild(e)}removeChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e instanceof HTMLElement&&t.$.listItemsGroupContainer.removeChild(e)}getListBox(){let e=this.parentNode;for(;e instanceof Smart.ListBox==0&&null!==e;)e=e.parentNode;return e}attached(){const e=this;super.attached(),e.ownerListBox||(e.ownerListBox=e.getListBox()),e.setAttribute("role","group"),e.$.itemsLabel.id||(e.$.itemsLabel.id=e.id+"Label"),e.setAttribute("aria-labelledby",e.$.itemsLabel.id)}}),Smart("smart-list-box",class extends Smart.ScrollViewer{static get properties(){return{allowDrag:{value:!1,type:"boolean"},allowDrop:{value:!1,type:"boolean"},alternationStart:{value:0,type:"int"},alternationEnd:{value:0,type:"int"},alternationCount:{value:0,type:"int"},autoSort:{value:!0,type:"boolean"},dataSource:{value:null,type:"any?",reflectToAttribute:!1},dragFeedbackFormatFunction:{value:null,type:"function?"},dragOffset:{value:[10,10],type:"array"},displayLoadingIndicator:{value:!1,type:"boolean"},displayMember:{value:"",type:"string"},shadowDomMode:{allowedValues:["light","shadow"],value:"shadow",type:"string"},dropAction:{value:"move",type:"string",allowedValues:["copy","move","none"]},editable:{value:!1,type:"boolean"},filterable:{value:!1,type:"boolean"},filterCallback:{value:null,type:"function?"},filterMode:{value:"containsIgnoreCase",allowedValues:["contains","containsIgnoreCase","doesNotContain","doesNotContainIgnoreCase","equals","equalsIgnoreCase","startsWith","startsWithIgnoreCase","endsWith","endsWithIgnoreCase","custom"],type:"string"},filterInputPlaceholder:{value:"",type:"string"},grouped:{value:!1,type:"boolean"},groupMember:{value:"",type:"string"},itemTemplate:{value:null,type:"any"},itemHeight:{value:null,type:"number?"},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"},loadingIndicatorPlaceholder:{value:"Loading...",type:"string"},loadingIndicatorPosition:{value:"center",allowedValues:["bottom","center","top"],type:"string"},messages:{extend:!0,value:{en:{overridingProperties:'{{elementType}}: Overriding properties {{property1}} and {{property2}} applied. The "{{property1}}" property is used by default.',invalidIndex:'{{elementType}}: "{{method}}" method accepts an index of type number or an Array of numbers.',indexOutOfBound:'{{elementType}}: Out of bound index/indexes in "{{method}}" method.',invalidItem:'{{elementType}}: "{{method}}" method accepts an object or an array of objects as it\'s second parameter.',invalidSettings:'{{elementType}}: "{{method}}" method accepts a string or an object as it\'s second parameter.'}},type:"object"},name:{value:"",type:"string"},placeholder:{value:"No Items",type:"string"},selectedIndexes:{value:[],type:"array"},selectedValues:{value:[],type:"array"},selectionMode:{value:"oneOrManyExtended",allowedValues:["none","oneOrManyExtended","zeroOrMany","oneOrMany","zeroOrOne","zeroAndOne","one","checkBox","radioButton"],type:"string"},selectionChangeAction:{value:"release",allowedValues:["press","release"],type:"string"},sorted:{value:!1,type:"boolean"},sortDirection:{value:"asc",type:"string"},topVisibleIndex:{value:-1,type:"int"},type:{value:"list",type:"string",defaultReflectToAttribute:!0,readonly:!0},valueMember:{value:"",type:"string"},virtualized:{value:!1,type:"boolean"},onClick:{value:null,type:"any",reflectToAttribute:!1},onDoubleClick:{value:null,type:"any",reflectToAttribute:!1}}}static get requires(){return{"Smart.ScrollBar":"smart.scrollbar.js"}}static get styleUrls(){return["smart.listbox.css","smart.dropdown.css","smart.scrollbar.css"]}static get listeners(){return{focus:"_focusHandler",blur:"_blurHandler","container.wheel":"_mouseWheelHandler","editInput.change":"_editInputEventHandler","editInput.blur":"_editInputEventHandler","editInput.keydown":"_editInputEventHandler","horizontalScrollBar.change":"_horizontalScrollbarHandler","itemsInnerContainer.down":"_downHandler","itemsInnerContainer.dblclick":"_dblclickEventHandler","itemsInnerContainer.move":"_itemsContainerMoveHandler","itemsContainer.mouseleave":"_mouseLeaveHandler","itemsInnerContainer.touchmove":"_touchmoveHandler","itemsInnerContainer.touchstart":"_touchstartHandler","document.move":"_moveHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler",resize:"_resizeHandler",selectstart:"_selectStartHandler",styleChanged:"_styleChangedHandler",swipeleft:"_swipeLeftHandler",swiperight:"_swipeRightHandler",touchmove:"_overriddenHandler",touchstart:"_overriddenHandler","verticalScrollBar.change":"_verticalScrollbarHandler"}}template(){return'<div id="container" class="smart-container" role="presentation">\n                    <div class="smart-list-box-filter-input-container smart-hidden" id="filterInputContainer" role="presentation"><input id="filterInput" disabled="[[disabled]]" placeholder=\'[[filterInputPlaceholder]]\' role="searchbox" aria-label="[[filterInputPlaceholder]]"></div>\n                    <div id="itemsContainer" class="smart-list-items-container" role="presentation">\n                        <div id="placeholder" class="smart-placeholder" role="presentation" aria-hidden="true">[[placeholder]]</div>\n                        <div id="itemsInnerContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="smart-list-items-inner-container" role="presentation">\n                            <content></content>\n                        </div>\n                        <input type="text" id="editInput" class= "smart-hidden"/>\n                    </div>\n                    <smart-scroll-bar wait theme="[[theme]]" right-to-left="[[rightToLeft]]" id="verticalScrollBar" disabled="[[disabled]]" orientation="vertical"></smart-scroll-bar>\n                    <smart-scroll-bar wait theme="[[theme]]" right-to-left="[[rightToLeft]]" id="horizontalScrollBar" disabled="[[disabled]]"></smart-scroll-bar>\n                    <div id="loadingIndicatorContainer" class="smart-loader-container" 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                    <input id="hiddenInput" type="hidden" name="[[name]]">\n                </div>'}get value(){const e=this;return e.isRendered&&e._selectedItems.length>0?e._selectedItems.map((e=>({label:e.label,value:e.value}))):null}set value(e){const t=this;if(Array.isArray(e)){const i=t.context;t.context=t,t._isUpdating++,t.selectedValues=[],t.clearSelection();for(let i=0;i<e.length;i++){const r=e[i],o=t.getItem(r);o&&("oneOrManyExtended"===t.selectionMode?t._select(o):t.select(o))}return t.context=i,void t._isUpdating--}const i=t.getItem(e);i&&t.select(i)}get _selectedItems(){const e=this,t=[];if(e.isRendered)for(let i=0;i<e._items.length;i++){const r=e._items[i];r.selected&&t.push(r)}return t}_mouseLeaveHandler(){const e=[].slice.call(this.getElementsByClassName("smart-list-item-bottom-line-feedback"));for(let t=0;t<e.length;t++)e[t].$.removeClass("smart-list-item-line-feedback"),e[t].$.removeClass("smart-list-item-bottom-line-feedback")}_downHandler(e){const t=this;if(t.disabled||t.displayLoadingIndicator||t.readonly)return;let i=e.originalEvent.target,r=null;if(!(i instanceof Smart.ListItem)||i.disabled||i.hidden||i instanceof Smart.ListItemsGroup)for(;i.parentElement;){if(i instanceof Smart.ListItem&&!i.disabled&&!i.hidden&&!(i instanceof Smart.ListItemsGroup)){r=i.dataItem;break}i=i.parentElement}else r=i.dataItem;Smart.ListBox.DragDrop.StartTime=new Date,Smart.ListBox.DragDrop.StartPosition={left:e.pageX,top:e.pageY},r&&(e.stopPropagation(),t.hasRippleAnimation&&(r.readonly||r.disabled||Smart.Utilities.Animation.Ripple.animate(i.$.overlay,e.pageX,e.pageY)),Smart.Utilities.Core.isMobile||"press"!==t.selectionChangeAction||(t._focus(r),t.select(r)),!Smart.ListBox.DragDrop.Feedback&&t.allowDrag&&(Smart.ListBox.DragDrop.DraggedFrom=t,Smart.ListBox.DragDrop.Feedback=document.createElement("span"),t.rightToLeft?Smart.ListBox.DragDrop.Feedback.setAttribute("right-to-left",!0):Smart.ListBox.DragDrop.Feedback.removeAttribute("right-to-left"),t.dragFeedbackFormatFunction?Smart.ListBox.DragDrop.Feedback.innerHTML=t.dragFeedbackFormatFunction(r):Smart.ListBox.DragDrop.Feedback.appendChild(r.offsetHeight?r.cloneNode(!0):t._createItem(r)),Smart.ListBox.DragDrop.Item=r,Smart.Utilities.Extend(Smart.ListBox.DragDrop.Feedback).addClass("smart-popup smart-list-item smart-list-item-feedback")))}_dblclickEventHandler(e){const t=this;if(!t.editable)return;const i=e.target.closest("smart-list-item");i instanceof Smart.ListItem&&!i.disabled&&!i.readonly?(t.$.editInput.dir=t.rightToLeft?"rtl":"ltr",t.$.editInput.style.width=t.$.itemsInnerContainer.offsetWidth+"px",t.$.editInput.owner=i,t.$.editInput.value=i.label,t.$.editInput.style.height=i.offsetHeight+"px",t.$.editInput.style.top=i.offsetTop+t.$.itemsInnerContainer.offsetTop+"px",t.$.editInput.setAttribute("aria-label","Edit item "+i.label),t.$editInput.hasClass("smart-hidden")&&t.$editInput.removeClass("smart-hidden"),t.$.editInput.focus({preventScroll:!0})):t.$editInput.addClass("smart-hidden")}_editInputEventHandler(e){const t=this;if("blur"===e.type||"keydown"===e.type&&"Escape"===e.key)return t.$editInput.hasClass("smart-hidden")||t.$editInput.addClass("smart-hidden"),void t.focus();if("keydown"===e.type||t.$editInput.hasClass("smart-hidden"))return;const i=e.target;if(e.stopPropagation(),i.owner.label!==i.value&&(i.owner.label=i.value,t.itemTemplate&&t._applyTemplate(i.owner),t.dataSource)){const e=i.owner.dataIndex,r=t.dataSource[e];r&&(t.displayMember?r[t.displayMember]=i.value:r.label=i.value)}t.$editInput.addClass("smart-hidden"),t.$.fireEvent("itemLabelChange",{selected:i.owner.selected,disabled:i.owner.disabled,index:t._indexOf(i.owner),label:i.owner.label,value:i.owner.value})}_pointerUpHandler(e){const t=this;let i=e.originalEvent,r=i.target;(t.shadowRoot||t.isInShadowDOM)&&(r=i.originalEvent?i.originalEvent.composedPath()[0]:i.composedPath()[0]);const o=e=>{const i=e.ownerListBox;i.disabled||i!==t||i.displayLoadingIndicator||"none"===i.selectionMode||e.grouped||e.readonly||(i._focus(e),i.select(e),Smart.ListBox.DragDrop.StartPosition=null,t.$.fireEvent("itemClick",{selected:r.selected,disabled:r.disabled,index:t._indexOf(r),label:r.label,value:r.value}))};if(!(i.target instanceof Smart.ListItem)||i.target.disabled||i.target instanceof Smart.ListItemsGroup){for(;r&&r.parentElement;){if(r instanceof Smart.ListItem&&!r.disabled&&!(r instanceof Smart.ListItemsGroup))return void o(r.dataItem);r=r.parentElement}if(this.shadowRoot&&"shadow"===this.shadowDomMode){const e=i.composedPath();for(let t=0;t<e.length;t++){const i=e[t];i instanceof Smart.ListItem&&!i.disabled&&o(i.dataItem)}}}else o(r.dataItem)}_upHandler(e){const t=this;if(super._upHandler(),!t.disabled&&!t.readonly&&Smart.ListBox.DragDrop.StartPosition){if(Smart.Utilities.Core.isMobile&&!Smart.ListBox.DragDrop.Dragging){const i=Math.abs(e.pageX-Smart.ListBox.DragDrop.StartPosition.left),r=Math.abs(e.pageY-Smart.ListBox.DragDrop.StartPosition.top);let o=i>=0&&i<=3&&r>=0&&r<=3;if(Smart.Utilities.Core.isMobile&&new Date-Smart.ListBox.DragDrop.StartTime>=300&&(o=!1,Smart.ListBox.DragDrop.StartTime=null),o){const i=e.originalEvent.target.closest("smart-list-box");i?i._pointerUpHandler(e):t._pointerUpHandler(e),Smart.ListBox.DragDrop.StartPosition=null}else{let t=e.originalEvent.target;if(!(e.target instanceof Smart.ListItem)||t.readonly||e.target.disabled||e.target instanceof Smart.ListItemsGroup)for(;t.parentElement;){if(t instanceof Smart.ListItem&&!t.readonly&&!t.disabled&&!(t instanceof Smart.ListItemsGroup)){e.stopPropagation();break}t=t.parentElement}else e.stopPropagation()}}else if(!Smart.Utilities.Core.isMobile&&!Smart.ListBox.DragDrop.Dragging&&"release"===t.selectionChangeAction){const i=(t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target).closest("smart-list-box");i&&(i.upTimer&&clearTimeout(i.upTimer),t.isInShadowDOM?i?i._pointerUpHandler(e):t._pointerUpHandler(e):i.upTimer=setTimeout((()=>{i?i._pointerUpHandler(e):t._pointerUpHandler(e)})))}if(Smart.ListBox.DragDrop.Feedback){let i;if(Smart.ListBox.DragDrop.Feedback.parentNode&&Smart.ListBox.DragDrop.Feedback.parentNode.removeChild(Smart.ListBox.DragDrop.Feedback),Smart.ListBox.DragDrop.Feedback=null,Smart.Utilities.Core.isMobile&&Smart.ListBox.DragDrop.Dragging)for(let t=0;t<Smart.ListBox.DragDrop.ListBoxes.length;t++){const r=Smart.ListBox.DragDrop.ListBoxes[t],o=r.getBoundingClientRect();if(r.allowDrop&&!r.closest(".smart-visibility-hidden")&&o.left<=e.clientX&&e.clientX<=o.left+o.width&&o.top<=e.clientY&&e.clientY<=o.top+o.height){i=r;const t=r._items.filter((e=>!e.hidden));for(let i=0;i<t.length;i++){const s=t[i],l=s.getBoundingClientRect();if((t.indexOf(s)===t.length-1||s.parentNode.lastElementChild===s)&&e.clientY>=o.top+s.offsetTop-r.scrollTop+l.height/2&&e.clientY<=o.top-r.scrollTop+s.offsetTop+l.height){Smart.ListBox.DragDrop.DropDetails={item:s,position:"bottom"};break}if(e.clientY>=o.top+s.offsetTop-r.scrollTop&&e.clientY<=o.top+s.offsetTop+l.height-r.scrollTop){Smart.ListBox.DragDrop.DropDetails={item:s,position:"top"};break}}}}if(Smart.ListBox.DragDrop.Dragging){if(Smart.ListBox.DragDrop.DropDetails){let r=Smart.ListBox.DragDrop.DropDetails.item,o=Smart.ListBox.DragDrop.Item;const s=o.ownerListBox;let l=e.originalEvent.target;if(t.isInShadowDOM&&(l=e.originalEvent?e.originalEvent.composedPath()[0]:e.composedPath()[0]),i=!i&&l.closest?l.closest("smart-list-box"):i,document.body.classList.remove("smart-dragging"),r.$.removeClass("smart-list-item-line-feedback"),r.$.removeClass("smart-list-item-bottom-line-feedback"),i&&r.ownerListBox!==i&&i.items.length>0&&(r=i.items[i.items.length-1]),Smart.ListBox.DragDrop.Item===r||i!==r.ownerListBox&&!Smart.Utilities.Core.isMobile)i&&0===i._items.length&&"none"!==i.dropAction&&("move"===i.dropAction?Smart.ListBox.DragDrop.Item.ownerListBox.removeChild(Smart.ListBox.DragDrop.Item):"copy"===i.dropAction&&(o=o.cloneNode(!0)),i.appendChild(o));else if("none"!==o.ownerListBox.dropAction){r.ownerListBox!==o.ownerListBox&&"move"===o.ownerListBox.dropAction&&Smart.ListBox.DragDrop.Item.ownerListBox.removeChild(Smart.ListBox.DragDrop.Item),"copy"===o.ownerListBox.dropAction&&(o=o.cloneNode(!0)),Smart.ListBox.DragDrop.Item.group=r.group;const e=r.ownerListBox;"checkBox"!==e.selectionMode&&"radioButton"!==e.selectionMode&&e.clearSelection(),"top"===Smart.ListBox.DragDrop.DropDetails.position?e.insertBefore(o,r):r.parentNode.lastElementChild===r?e.appendChild(o):e.appendChild(o,r),e.ensureVisible(o),"checkBox"===e.selectionMode||"radioButton"===e.selectionMode?(e._focus(o),e._refreshSelection()):(e.clearSelection(),e.select(o))}o.selected&&i!==s&&s._refreshSelection();const n=Smart.ListBox.DragDrop.Item,a=n.ownerListBox;n.displayMode="checkBox"===a.selectionMode||"radioButton"===a.selectionMode?a.selectionMode:"plain",a.$.fireEvent("dragEnd",{item:n,target:r,data:Smart.ListBox.DragDrop,previousContainer:s,container:i,originalEvent:e}),a._focus(n)}else{const t=Smart.ListBox.DragDrop.Item,i=t.ownerListBox;t.displayMode="checkBox"===i.selectionMode||"radioButton"===i.selectionMode?i.selectionMode:"plain",document.body.classList.remove("smart-dragging"),i.$.fireEvent("dragEnd",{item:t,target:null,data:Smart.ListBox.DragDrop,previousContainer:i,container:i,originalEvent:e}),i._focus(t)}e.preventDefault()}delete Smart.ListBox.DragDrop.DraggedFrom,Smart.ListBox.DragDrop.Dragging=!1,Smart.ListBox.DragDrop.Item=null,Smart.ListBox.DragDrop.DropDetails=null}for(let e=0;e<Smart.ListBox.DragDrop.ListBoxes.length;e++){const t=Smart.ListBox.DragDrop.ListBoxes[e];t._dragInterval&&clearInterval(t._dragInterval)}}}_itemsContainerMoveHandler(e){const t=this;if(Smart.ListBox.DragDrop.Dragging)return t._applyItemFeedback(e),t._moveHandler(e),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),!1}_touchmoveHandler(e){if(Smart.ListBox.DragDrop.Dragging&&e.cancelable)return e.preventDefault(),void e.stopPropagation();super._touchmoveHandler(e)}_applyItemFeedback(e){const t=this,i=e.originalEvent.target,r=i.closest?i.closest("smart-list-item"):i;Smart.Utilities.Core.isMobile?Smart.ListBox.DragDrop.DropDetails={item:Smart.ListBox.DragDrop.Item,position:"bottom"}:0!==t.items.length&&(r?r._itemOnMouseMove(e):t.items[t.items.length-1]._itemOnMouseMove(e,!0))}_moveHandler(e){const t=this;if(!Smart.ListBox.DragDrop.Feedback||Smart.ListBox.DragDrop.DraggedFrom!==t)return;const i=t.dragOffset;if(Smart.ListBox.DragDrop.Dragging){Smart.ListBox.DragDrop.Feedback.style.left=i[0]+e.pageX+"px",Smart.ListBox.DragDrop.Feedback.style.top=i[1]+e.pageY+"px",t.$.fireEvent("dragging",{item:Smart.ListBox.DragDrop.Item,data:Smart.ListBox.DragDrop,originalEvent:e.originalEvent});for(let t=0;t<Smart.ListBox.DragDrop.ListBoxes.length;t++){const i=Smart.ListBox.DragDrop.ListBoxes[t];i._dragInterval&&clearInterval(i._dragInterval),i._dragInterval=setInterval((function(){const t=i.getBoundingClientRect();t.left<=e.clientX&&t.left+t.width>=e.clientX&&(e.clientY>=t.top&&e.clientY<=t.top+20?i.scrollTop-=2:e.clientY>=t.top+t.height-20&&e.clientY<=t.top+t.height&&(i.scrollTop+=2))}),1)}return e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),!1}{const r=Math.abs(e.pageX-Smart.ListBox.DragDrop.StartPosition.left),o=Math.abs(e.pageY-Smart.ListBox.DragDrop.StartPosition.top),s=new Date-Smart.ListBox.DragDrop.StartTime;let l=r>=5&&r<=15||o>=5&&o<=15;if(Smart.Utilities.Core.isMobile&&(s<300||s>1e3)&&(l=!1),l){Smart.ListBox.DragDrop.Dragging=!0,Smart.ListBox.DragDrop.Feedback.style.left=i[0]+e.pageX+"px",Smart.ListBox.DragDrop.Feedback.style.top=i[1]+e.pageY+"px",t.getShadowRootOrBody().appendChild(Smart.ListBox.DragDrop.Feedback),e.preventDefault(),e.stopPropagation(),e.originalEvent.preventDefault(),e.originalEvent.stopPropagation();const r=Smart.ListBox.DragDrop.Item,o=r.ownerListBox;o.$.fireEvent("dragStart",{item:r,data:Smart.ListBox.DragDrop,container:o,previousContainer:o,originalEvent:e.originalEvent}),document.body.classList.add("smart-dragging")}}}_focusHandler(){this._focused=!0,this.setAttribute("focus","")}_blurHandler(){this._focused=!1,this.removeAttribute("focus")}appendChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.isVirtualized?(t._items.indexOf(e)>-1&&t._items.splice(t._items.indexOf(e),1),t._items.push(e)):(e.dataItem=e,t.shadowRoot&&"light"===t.shadowDomMode?t.appendChild(e):t.$.itemsInnerContainer.appendChild(e),t._items.indexOf(e)>-1&&t._items.splice(t._items.indexOf(e),1),t._items.push(e)),t._isUpdating||(t._refreshItems(),t._refreshSelection())}insertBefore(e,t){const i=this;if(!i.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(i,e.concat(Array.prototype.slice.call(arguments)))}i.isVirtualized?(i._items.indexOf(e)>-1&&i._items.splice(i._items.indexOf(e),1),i._items.splice(i._indexOf(t),0,e)):(e.dataItem=e,t.parentNode.insertBefore(e,t),i._items.indexOf(e)>-1&&i._items.splice(i._items.indexOf(e),1),i._items.splice(i._indexOf(t),0,e)),i._refreshItems(),i._refreshSelection()}removeChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}if(t.isVirtualized)t._items.splice(t._indexOf(e),1);else if(e.parentNode){const i=t.selectedIndexes.slice(0),r=t.selectedValues.slice(0),o=i.indexOf(e.dataIndex);e.parentNode.removeChild(e),o>-1&&(i.splice(o,1),r.splice(o,1),t.selectedIndexes=i,t.selectedValues=r)}t._refreshItems()}propertyChangedHandler(e,t,i){if("dataSource"===e&&(!i||i&&Array.isArray(i)&&0===i.length))return void this.clearItems();super.propertyChangedHandler(e,t,i);const r=this;switch(e){case"innerHTML":r.clearSelection(),r._dataBind(),r.innerHTML=r.content=Smart.Utilities.Core.html(r.$.content);break;case"dataSource":case"valueMember":case"groupMember":case"displayMember":r.clearSelection(),r._dataBind(),r._applyDefaultSelection();break;case"disabled":case"unfocusable":r._setFocusable();break;case"displayLoadingIndicator":r._setLoadingIndicatorVisibility();break;case"filterable":r._refreshFilter(),r._refreshLayout();break;case"grouped":if(i?r._group():r._ungroup(),"radioButton"===r.selectionMode){if(r.selectedValues.length>0){const e=r.selectedValues;r.clearSelection(),r.select(e[0])}}else r._refreshSelection();r._refreshLayout();break;case"itemTemplate":{if(null===i||""===i)return r._items.map((e=>e.innerHTML=e.label)),delete r._bindingDetails,void r._refreshLayout();const e=r.querySelectorAll("smart-list-item"),t=function(){r._handleItemTemplate(i)&&(r._items.map((e=>r._applyTemplate(e))),r._refreshLayout()),r.ownerElement&&r.ownerElement._setDropDownSize&&r.ownerElement._setDropDownSize(),r.$.fireEvent("bindingComplete")};0===e.length?t():r._ensureItemsReady(e,t);break}case"selectedIndexes":case"selectedValues":{let o=r.selectedIndexes.slice(0),s=r.selectedValues.slice(0);if(!r._items||0===r._items.length)return r.selectedIndexes=[],r.selectedValues=[],void(r.$.hiddenInput.value=r.selectedValues.toString());if(r._propertyChanging=!0,"selectedIndexes"===e){o=t.slice(0),r.clearSelection();for(let e=0;e<i.length;e++){const t=i[e],o=r._items[t];o&&("oneOrManyExtended"===r.selectionMode||"oneOrMany"===r.selectionMode?(r.selectedIndexes.length>0&&0===e&&r.clearSelection(),r._select(o)):r.select(o))}}else{s=t.slice(0),r.selectedValues=[],r.clearSelection();for(let e=0;e<i.length;e++){const t=i[e],o=r.getItem(t);o&&("oneOrManyExtended"===r.selectionMode?r._select(o):r.select(o))}}if(r.selectedIndexes.length>0&&r._focus(r._items[r.selectedIndexes[0]]),r._propertyChanging=!1,JSON.stringify(s)!==JSON.stringify(r.selectedValues.slice(0))){let e=[],t=[];for(let e=0;e<o.length;e++)r.selectedIndexes.indexOf(o[e])<0&&t.push(r._items[o[e]]);for(let t=0;t<r.selectedIndexes.length;t++)o.indexOf(r.selectedIndexes[t])<0&&e.push(r._items[r.selectedIndexes[t]]);let i={addedItems:e,removedItems:t};if(r.selectedIndexes.length>0){const e=r._items[r.selectedIndexes[r.selectedIndexes.length-1]];void 0!==e&&(i.selected=e.selected,i.disabled=e.disabled,i.index=r._indexOf(e),i.label=e.label,i.value=e.value)}else i.selected=!1,i.disabled=!1,i.index=-1,i.label="",i.value="";r.$.fireEvent("change",i),r._updateTargetValue()}break}case"selectionMode":{const e="checkBox"===r.selectionMode||"radioButton"===r.selectionMode?r.selectionMode:"plain",o=r.selectedIndexes.slice(0),s=r.selectedValues.slice(0);r._propertyChanging=!0;const l=r.selectedValues;r.setAttribute("aria-multiselectable",-1!==["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox","radioButton"].indexOf(i)),r.selectedValues=[],r.clearSelection();for(let e=0;e<l.length;e++){const t=l[e],i=r.getItem(t);i&&("oneOrManyExtended"===r.selectionMode?r._select(i):r.select(i))}if(r._items.forEach((t=>t.displayMode=e)),r._recycle(),r._propertyChanging=!1,JSON.stringify(s)!==JSON.stringify(r.selectedValues.slice(0))){let e=[],t=[];for(let e=0;e<o.length;e++)r.selectedIndexes.indexOf(o[e])<0&&t.push(r._items[o[e]]);for(let t=0;t<r.selectedIndexes.length;t++)o.indexOf(r.selectedIndexes[t])<0&&e.push(r._items[r.selectedIndexes[t]]);let i={addedItems:e,removedItems:t};if(o.length>0){const e=r._items[o[o.length-1]];e&&(i.selected=e.selected,i.disabled=e.disabled,i.index=r._indexOf(e),i.label=e.label,i.value=e.value)}r.$.fireEvent("change",i),r._updateTargetValue()}r._applyAriaSelected(),"checkBox"!==i&&"radioButton"!==i&&"checkBox"!==t&&"radioButton"!==t||r._refreshLayout();break}case"topVisibleIndex":r._setTopVisibleIndex(i);break;case"autoSort":r._canSort=i;break;case"alternationStart":case"alternationEnd":case"alternationCount":r._refreshItems(),r._refreshLayout();break;case"sortDirection":case"sorted":{r._canSort=!0,i?r._sort():r._unsort();const e=r.selectedValues;r.selectedValues=[],r._refreshSelection();for(let t=0;t<e.length;t++){const i=e[t],o=r.getItem(i);o&&("oneOrManyExtended"===r.selectionMode?r._select(o):r.select(o))}r._refreshLayout(),r._canSort=r.autoSort;break}}}_refreshSelection(){const e=this;if(!e._items||0===e._items.length)return;const t=e.selectedValues;e.selectedIndexes=[],e.selectedValues=[];for(let i=0;i<e._items.length;i++){const r=e._items[i];r.selected=!1,t.indexOf(r.value)>-1&&e.select(r)}e._recycle()}clearSelection(){const e=this;if(!e._items||0===e._items.length)return;let t=[];for(let i=0;i<e._items.length;i++)e._items[i].selected&&t.push(e._items[i]);e._items.map((e=>e.selected=!1)),e.selectedValues.slice(0);const i=e.selectedIndexes.slice(0);if(e.selectedIndexes=[],e.selectedValues=[],e.$.hiddenInput.value=e.selectedValues.toString(),e._recycle(),e.context!==e){let r={addedItems:[],removedItems:t};if(i.length>0){const t=e._items[i[i.length-1]];t&&(r.selected=t.selected,r.disabled=t.disabled,r.index=e._indexOf(t),r.label=t.label,r.value=t.value)}e.$.fireEvent("change",r),e._updateTargetValue()}}ensureVisible(e){const t=this;if(e)return!("string"==typeof e&&!(e=t.getItem(e))||(t.isVirtualized||t.$.itemsContainer.scrollTop===t.scrollTop||(t.scrollTop=t.$.itemsContainer.scrollTop),e.top+e.height>=t.scrollTop+t.offsetHeight&&(t.scrollTop=t.scrollTop+e.height,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)),(e.top<=t.scrollTop||e.top>=t.scrollTop+t.$.itemsContainer.offsetHeight)&&(t.scrollTop=e.top,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)),0===t._indexOf(e)||1===t._indexOf(e)&&t._items.length>1&&t._items[0].grouped?(t.scrollTop=0,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)):t._indexOf(e)===t._items.length-1&&(t.scrollTop=t.scrollHeight,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop)),0))}get items(){const e=this;if(!window.__karma__&&!window.karma&&e instanceof Element&&e.isRendered&&e.hasAttribute&&e.hasAttribute("smart-blazor")){let t=[];for(let i=0;i<e._items.length;i++){const r=e._items[i];t.push({label:r.label,value:r.value})}return t}return e._filteredItems?e._filteredItems:e._items}getItems(){const e=this,t=e._filteredItems?e._filteredItems:e._items;let i=[];if(t&&t.length>0)for(let e=0;e<t.length;e++){const r=t[e];i.push({label:r.label,value:r.value})}return i}ready(){super.ready();const e=this;if(e.shadowRoot&&"light"===e.shadowDomMode){const t=document.createDocumentFragment();[].slice.call(e.$.itemsInnerContainer.children).map((e=>t.appendChild(e))),e.appendChild(t),e.$.itemsInnerContainer.appendChild(document.createElement("slot"))}e._areCSSVarsSupported=Smart.Utilities.Core.CSSVariablesSupport(),e.isUpdating=0,e._scrollView&&(e._scrollView=new Smart.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar),e._scrollView.hScrollBar.$.addClass("smart-hidden"),e._scrollView.vScrollBar.$.addClass("smart-hidden"));const t=e._scrollView.vScrollBar,i=e._scrollView.hScrollBar;t.hasStyleObserver=!1,i.hasStyleObserver=!1,t.hasResizeObserver=!1,i.hasResizeObserver=!1,t.wait=!1,i.wait=!1,e._setFocusable()}render(){const e=this;e.setAttribute("role","listbox"),e.setAttribute("aria-orientation","vertical"),e.$.verticalScrollBar.setAttribute("aria-controls",e.id),e.$.horizontalScrollBar.setAttribute("aria-controls",e.id),e._keysPressed={},e._incrementalSearchQuery="",e._incrementalSearchItems=[],e._canSort=!0,e._previousEntry="",e._setLoadingIndicatorVisibility(),e._refreshFilter(),e._initializeInnerHTML(),e._dataBind(),e._applyDefaultSelection(),e.enableShadowDOM&&HTMLElement.prototype.appendChild.apply(e,[e.$.hiddenInput]),e.setAttribute("aria-multiselectable",-1!==["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox","radioButton"].indexOf(e.selectionMode)),super.render()}_lazyInitItems(){const e=this;if(e._inLazyInit)return cancelAnimationFrame(Smart.ListBox.processTimer),void delete Smart.ListBox.processTimer;e._inLazyInit=!0,e.dataSource||(e.clearSelection(),e._dataBind(),e._applyDefaultSelection()),cancelAnimationFrame(Smart.ListBox.processTimer),delete Smart.ListBox.processTimer,e._inLazyInit=!1}_applyDefaultSelection(){const e=this;!e._focusedItem&&e._items&&e._items.length>0&&0===e.selectedIndexes.length&&("one"!==e.selectionMode&&"oneOrMany"!==e.selectionMode&&"oneOrManyExtended"!==e.selectionMode||e.select(e._items[0]))}attached(){const e=this;super.attached(),Smart.ListBox.DragDrop||(Smart.ListBox.DragDrop={ListBoxes:[]}),Smart.ListBox.DragDrop.ListBoxes.push(e),e._scrollView||(e._scrollView=new Smart.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.selectedIndexes.length>0&&e._items&&e.ensureVisible(e._items[e.selectedIndexes[0]])}detached(){const e=this;if(super.detached(),e._scrollView&&(e._scrollView.unlisten(),delete e._scrollView),Smart.ListBox.DragDrop&&Smart.ListBox.DragDrop.ListBoxes){const t=Smart.ListBox.DragDrop.ListBoxes.indexOf(e);Smart.ListBox.DragDrop.ListBoxes.splice(t,1)}}_createItem(e,t,i){const r=this,o="checkBox"===r.selectionMode||"radioButton"===r.selectionMode?r.selectionMode:"plain",s=i?{}:document.createElement("smart-list-item");s.ownerListBox=r,"number"==typeof e&&(e=""+e);const l=function(t,i){return void 0!==e[t]?""+e[t]:e[i]};let n="string"==typeof e?e:l(r.displayMember,"label"),a="string"==typeof e?e:l(r.valueMember,"value"),d=l(r.groupMember,"group");return void 0===n&&(n=void 0!==t?""+t:""),s.label=s.innerHTML=""+n,void 0===a&&(a=void 0!==t?""+t:n),e.color&&(s.color=e.color),s.value=""+a,s.displayMode=o,s.selected=!!e.selected&&e.selected,s.disabled=!!e.disabled&&e.disabled,s.dataItem=s,void 0!==t&&(s.dataIndex=t),r._alternateItem(s),e.title&&(s.title=e.title),d&&(s.group=""+d),s}_alternateItem(e){const t=this,i=t.alternationStart,r=t.alternationEnd>0?t.alternationEnd:1/0;t.alternationCount<=0||(void 0===t._alternationIndexCounter&&(t._alternationIndexCounter=0),e.dataIndex>=i&&e.dataIndex<=r&&(e.alternationIndex=t._alternationIndexCounter++,t._alternationIndexCounter===t.alternationCount&&(t._alternationIndexCounter=0)))}_beginUpdate(){this.isUpdating++}_isUpdating(){return this.isUpdating>0}_endUpdate(){this.isUpdating--}get _scrollHeight(){const e=this;if(0===e._items.length||e._items.filter((e=>!e.hidden)).length<1)return 0;let t=0;if(e.isVirtualized){if(e.__scrollHeight)return e.__scrollHeight;if(0===e._items.length)return 0;e.isUpdating++;const i=e._createItem(e._items[0]);e.$.itemsInnerContainer.appendChild(i);for(let r=0;r<e._items.length;r++){const o=e._items[r];o.hidden?(o.height=0,o.top=t):(e.itemHeight?(e.itemHeight<32&&(e.itemHeight=32),o.height=e.itemHeight):(i.$&&i.$.itemContainer?i.$.itemContainer.firstElementChild.innerHTML=o.label:i.label=o.label,o.height=i.offsetHeight),o.top=t,t+=o.height)}e.$.itemsInnerContainer.removeChild(i),e.__scrollHeight=t-e.$.itemsInnerContainer.offsetHeight,e.filterable,t=e.__scrollHeight,e.isUpdating--}else{for(let i=0;i<e._items.length;i++){const r=e._items[i];r.hidden?(r.height=0,r.top=t):(e.itemHeight?"auto"!==e.itemHeight&&(r.height=e.itemHeight,r.style.height=r.height+"px"):r.height=r.offsetHeight,r.top=r.offsetTop,t+=r.height)}t=e.$.itemsInnerContainer.scrollHeight-e.$.itemsInnerContainer.offsetHeight,e.filterable&&t>0&&(t+=e.$.filterInput.offsetHeight),e.__scrollHeight=t}return t}_initializeRecyclingItems(){const e=this;if(!e.dataSource||e.dataSource&&0===e.dataSource.length||!e.isVirtualized)return;let t=0,i=e.offsetHeight||400;e.$.itemsInnerContainer.innerHTML="",e._recyclingItems=[];const r=function(r){for(let o=0;o<r.length;o++){const s=r[o],l=e._createItem(s);if(e.itemHeight&&"auto"!==e.itemHeight&&(l.style.height=e.itemHeight+"px"),e.$.itemsInnerContainer.appendChild(l),t+=l.offsetHeight,l.dataItem=e._items[o],e._recyclingItems.push(l),t>1.5*i)break}};if("function"==typeof e.dataSource){let e=[];for(let t=0;t<100;t++)e.push("");r(e)}else{r(e.dataSource);let o=0;for(;t<1.5*i&&++o<5;)r(e.dataSource)}}dataBind(){const e=this;e.clearSelection(),e._dataBind(),e._applyDefaultSelection()}_dataBind(){const e=this;if(e._scrollView||(e._scrollView=new Smart.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),"function"==typeof e.dataSource){e._items=[],delete e._filteredItems;const t=e.dataSource("",(t=>{e.clearItems(),e.insert(0,t)}));t&&Array.isArray(t)&&(e.clearItems(),e.insert(0,t))}if("string"==typeof e.dataSource&&(e.dataSource=JSON.parse(e.dataSource)),null!==e.dataSource&&Array.isArray(e.dataSource)){e.isUpdating++;const t=t=>{e._items=[],e._groups=[],delete e._filteredItems;const i=e.dataSource;for(let r=0;r<i.length;r++){const o=i[r],s=e._createItem(o,r,!t);e._items[r]=s,t&&t.appendChild(s)}};if(e.isVirtualized)t(),e._initializeRecyclingItems();else{const i=document.createDocumentFragment();e.$.itemsInnerContainer.innerHTML="",t(i),e.$.itemsInnerContainer.appendChild(i)}e.isUpdating--}const t=e.shadowRoot?e.shadowRoot.querySelectorAll("smart-list-item"):e.querySelectorAll("smart-list-item"),i=function(){e.isUpdating++,e.dataSource||(e._initializeHtmlListItems(),e._initializeHtmlListGroups()),e.grouped&&e._group(),e.sorted&&e._sort(),e._refreshLayout(),e._initializeSelection(),e.isInitialized=!0,e._canSort=e.autoSort,e.isUpdating--,e.itemTemplate&&e._handleItemTemplate(e.itemTemplate)&&(e._items.map((t=>e._applyTemplate(t))),e._refreshLayout()),e.__onCompleted&&(e._onCompleted=e.__onCompleted,e.__onCompleted=null,e._onCompleted()),e.topVisibleIndex>-1&&e._setTopVisibleIndex(e.topVisibleIndex),e.$.fireEvent("bindingComplete"),e._updateTopVisibleIndex(),0===e._items.length&&e.clearItems(),e._applyAriaSelected()};0===t.length?i():(e._onCompleted&&(e.__onCompleted=e._onCompleted,e._onCompleted=null),e._ensureItemsReady(t,i))}_ensureItemsReady(e,t){const i=this,r=function(){const i=function(t){for(let i=0;i<e.length;i++)e[i].context="node"===t?e[i]:document};i("node"),t(),i()};if(0===e.length)r();else{i._nodesReadyListeners=0;for(let t=0;t<e.length;t++){const o=e[t],s=function(){i._nodesReadyListeners--,0===i._nodesReadyListeners&&(r(),delete i._nodesReadyListeners)}.bind(i);o.isCompleted||(i._nodesReadyListeners++,o._onCompleted=s)}0===i._nodesReadyListeners&&r()}}_initializeInnerHTML(){const e=this;e.$.itemsInnerContainer.innerHTML.indexOf("<option")>=0?e.$.itemsInnerContainer.innerHTML=e.$.itemsInnerContainer.innerHTML.replace(/<optgroup/gi,"<smart-list-items-group").replace(/<\/optgroup/gi,"</smart-list-items-group").replace(/<option/gi,"<smart-list-item").replace(/<\/option/gi,"</smart-list-item"):e.$.itemsInnerContainer.innerHTML.indexOf("<ul")>=0&&(e.$.itemsInnerContainer.innerHTML=e.$.itemsInnerContainer.innerHTML.replace(/<ul/gi,"<smart-list-items-group").replace(/<\/ul/gi,"</smart-list-items-group").replace(/<li/gi,"<smart-list-item").replace(/<\/li/gi,"</smart-list-item"))}_initializeHtmlListItems(){const e=this,t=e.shadowRoot&&"shadow"===e.shadowDomMode?e.shadowRoot.querySelectorAll("smart-list-item"):e.querySelectorAll("smart-list-item"),i="checkBox"===e.selectionMode||"radioButton"===e.selectionMode?e.selectionMode:"plain",r=function(e,t,i){return void 0!==e[t]?""+e[t]:e[i]};e._items=[];let o=0;for(let s=0;s<t.length;s++){const l=t[s];l.dataIndex=s,l.label=l.innerHTML,l.dataItem=l,l.top||(l.top=o),l.height||(l.height=l.offsetHeight),o+=l.height,l.value||(l.value=""+s);const n=r(l,e.displayMember,"label"),a=r(l,e.valueMember,"value"),d=r(l,e.groupMember,"group");l.label!==n&&(l.label=n),l.value!==a&&(l.value=a),l.group!==d&&(l.group=d);const c=l.context;l.context=document,l.displayMode=i,l.context=c,e._alternateItem(l),l.selected&&(e.selectedIndexes.push(s),e.selectedValues.push(l.value)),e._items.push(l)}e.itemTemplate&&e._handleItemTemplate(e.itemTemplate)&&e._items.map((t=>e._applyTemplate(t)))}_group(){const e=this;e.isUpdating++;let t=[],i=[];e._canSort&&e._unsort();for(let i=0;i<e._items.length;i++){const r=e._items[i];let o=r.group?r.group.trim():r.innerHTML.charAt(0)||r.label.charAt(0);o+=" ",t[o]?t[o].items.push(r):t[t.length++]=t[o]={items:[r],label:o}}if(e.isVirtualized){e._groups=[];for(let e=0;e<t.length;e++){const r=t[e];r.dataIndex=e,r.grouped=!0,r.hidden=!1,r.displayMode="plain",i.push(r);for(let o=0;o<t[e].items.length;o++){const e=r.items[o];e.group=r,i.push(e)}}e._groups=t,e._items=i}else{for(;e.$.itemsInnerContainer.firstChild;)e.$.itemsInnerContainer.removeChild(e.$.itemsInnerContainer.firstChild);const r=document.createDocumentFragment();e._groups=[];for(let o=0;o<t.length;o++){const s=t[o],l=document.createElement("smart-list-items-group");l.label=s.label,l.dataIndex=o;for(let e=0;e<t[o].items.length;e++){const t=s.items[e];i.push(t),t.group=s.label,l.appendChild(t)}e._groups.push(l),r.appendChild(l)}e._items=i,/Trident|Edge/.test(navigator.userAgent)?setTimeout((function(){e.$.itemsInnerContainer.appendChild(r)}),50):e.$.itemsInnerContainer.appendChild(r)}e.sorted&&e._sort(),e.isUpdating--}_ungroup(){const e=this;e.isUpdating++,e._groups=[],e._canSort&&e._unsort();let t=[];if(e.isVirtualized)for(let i=0;i<e._items.length;i++){const r=e._items[i];r.grouped||t.push(r)}else{const i=document.createDocumentFragment();for(let r=0;r<e._items.length;r++){const o=e._items[r];i.appendChild(o),t.push(o)}t.length>0&&(e.$.itemsInnerContainer.innerHTML="",e.$.itemsInnerContainer.appendChild(i))}e._items=t,e.sorted&&e._sort(),e.isUpdating--}_initializeHtmlListGroups(){const e=this,t=e.$.itemsInnerContainer.querySelectorAll("smart-list-items-group");e._groups=[];for(let i=0;i<t.length;i++){const r=t[i];r.dataIndex=i,e._groups.push(r)}}_initializeSelection(){const e=this,t=e.selectedIndexes.slice(0),i=e.selectedValues.slice(0);e.clearSelection(),"oneOrManyExtended"===e.selectionMode&&(e._keysPressed.Control=!0);for(let r=0;r<e._items.length;r++){const o=e._items[r];(t.indexOf(r)>=0||i.indexOf(o.value||o.label)>=0)&&(e._focusedItem&&(e._focusedItem._focused=!1),e._focusedItem=null,e.select(o))}"oneOrManyExtended"===e.selectionMode&&(e._keysPressed.Control=!1)}onItemUpdated(){const e=this;e.isInitialized&&!e._isUpdating()&&(e.isUpdating++,e._refreshLayout(),e.isUpdating--)}_refreshItems(){const e=this;if(e.isInitialized&&!e._isUpdating()){if(e.isUpdating++,e.grouped?e._ungroup():e.sorted&&e._canSort&&e._unsort(),!e.isVirtualized){e._items=[];const t=e.shadowRoot?e.shadowRoot.querySelectorAll("smart-list-item"):e.querySelectorAll("smart-list-item");for(let i=0;i<t.length;i++)t[i].dataIndex=i,e._alternateItem(t[i]),e._items.push(t[i])}e.grouped?e._group():e.sorted&&e._sort(),e._refreshLayout(),e.isUpdating--}}_applyIncrementalSearch(e){const t=this;null===t.incrementalSearchDelay||isNaN(t.incrementalSearchDelay)||["Shift","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Control","Home","End","PageUp","PageDown"].indexOf(e)>-1||(0!==t._incrementalSearchQuery.indexOf(e)&&(t._incrementalSearchQuery+=e),t._incrementalSearchTimer&&clearTimeout(t._incrementalSearchTimer),t._incrementalSearch(),t._incrementalSearchTimer=setTimeout((function(){t._incrementalSearchQuery=""}),t.incrementalSearchDelay))}select(e){const t=this;if(("string"!=typeof e||(e=t.getItem(e)))&&("number"!=typeof e||(e=t.getItem(e)))&&!(e.grouped||e.readonly||!t._items.length||e instanceof HTMLElement&&!t.contains(e)&&!t.virtualized)){if("none"===t.selectionMode)return t.selectedIndexes=[],void(t.selectedValues=[]);switch(!t._focusedItem!==e&&"none"!==t.selectionMode&&(t._focusedItem&&(t._focusedItem._focused=!1),t._focusedItem=e,e._focused=!0),t.selectionMode){case"one":case"zeroAndOne":return(1!==t.selectedIndexes.length||t.selectedIndexes[0]!==t._indexOf(e))&&(t._previouslySelectedIndexes=t.selectedIndexes,t.selectedIndexes.length>=1&&t.clearSelection(),t._select(e),delete t._previouslySelectedIndexes,!0);case"zeroOrOne":return 1===t.selectedIndexes.length&&t.selectedIndexes[0]===t._indexOf(e)?(t.unselect(e),!0):(t._previouslySelectedIndexes=t.selectedIndexes,t.selectedIndexes.length>=1&&t.clearSelection(),t._select(e),delete t._previouslySelectedIndexes,!0);case"radioButton":if(t._previouslySelectedIndexes=t.selectedIndexes,t.$.itemsInnerContainer.querySelectorAll("smart-list-items-group").length>0){const i=e.parentNode;if(!e.selected){for(let e in i.children){const r=i.children[e];r.selected&&t.unselect(r)}t._select(e)}return delete t._previouslySelectedIndexes,!0}if(t.isVirtualized&&t._groups.length>0){const i=e.group;if(!e.selected){for(let e in i.items){const r=i.items[e];r.selected&&t.unselect(r)}t._select(e)}return delete t._previouslySelectedIndexes,!0}return e.selected||(t.selectedIndexes.length>=1&&t.clearSelection(),t._select(e)),delete t._previouslySelectedIndexes,!0;case"oneOrMany":return e.selected?t.selectedIndexes.length>1&&t.unselect(e):t._select(e),!0;case"zeroOrMany":case"checkBox":return e.selected?t.unselect(e):t._select(e),!0;case"oneOrManyExtended":{const i=t.selectedValues;if(t._keysPressed.Control)return t.selectedIndexes.length>1&&e.selected?(t.unselect(e),t._focus(t._items[t.selectedIndexes[0]])):t._select(e),!0;if(t._keysPressed.Shift){const r=t._items[t.selectedIndexes[0]];let o;t.clearSelection();const s=i.indexOf(r.value)>=0||r.selected;if(t._select(r,s),t._indexOf(r)>t._indexOf(e))for(o=t._indexOf(r)-1;o>=t._indexOf(e);){const e=t._items[o],r=i.indexOf(e.value)>=0||e.selected;t._select(e,r),o--}else for(o=t._indexOf(r)+1;o<=t._indexOf(e);){const e=t._items[o],r=i.indexOf(e.value)>=0||e.selected;t._select(e,r),o++}const l=[];for(let e=0;e<i.length;e++)l.push(t.getItem(i[e]));if(l.length>0&&!t._propertyChanging){let r=[];for(let e=0;e<t.selectedValues.length;e++){const o=t.selectedValues[e];i.indexOf(o)<0&&r.push(t.getItem(o))}t.$.fireEvent("change",{addedItems:r,removedItems:l,selected:e.selected,disabled:e.disabled,index:t._indexOf(e),label:e.label,value:e.value}),t._updateTargetValue()}return!0}for(let r=0;r<i.length;r++){const o=i[r],s=t.getItem(o);e!==s&&t.unselect(s)}return t.clearSelection(),t._select(e,i.indexOf(e.value)>=0),!0}}return!1}}_applyTemplate(e,t){const i=this;if(null===i.itemTemplate)return;if("function"==typeof i.itemTemplate)return void i.itemTemplate(e,{label:e.label,value:e.value,index:i._items.indexOf(e)});if(!i._bindingDetails||0===i._bindingDetails.length)return;const r=i._bindingDetails.length;let o,s,l=document.importNode(i._template.content,!0);for(let t=0;t<r;t++){o=l.childNodes[i._bindingDetails[t].childNodeIndex],s=i._bindingDetails[t].bindingString.length;for(let r=0;r<s;r++){const s=i._bindingDetails[t].bindingString[r],l=s.indexOf("label")>=0?e.label:e.value;o.innerHTML=o.innerHTML.replace(s,l)}}e.innerHTML="";for(let t=0;t<l.childNodes.length;t++)l.childNodes[t].outerHTML&&(e.innerHTML+=l.childNodes[t].outerHTML);!1!==t&&(i._scrollHeightTimer&&(clearInterval(i._scrollHeightTimer),i._scrollHeightCounter=0),i._scrollHeightTimer=setInterval((function(){i._lastScrollHeight===i.$.itemsInnerContainer.scrollHeight&&10!==i._scrollHeightCounter||(i._refreshLayout(),clearInterval(i._scrollHeightTimer)),i._lastScrollHeight=i.$.itemsInnerContainer.scrollHeight,i._scrollHeightCounter++}),50))}_filterItems(e,t,i){const r=this,o=r.$.filterInput.value;let s,l;const n=function(){if(0===l.length)return r._filteredItems=[],void(t&&t());s=r._queryItems(o,r.filterMode);for(let e=0;e<l.length;e++)l[e].hidden=!0,l[e].$&&l[e].$.addClass("smart-hidden");for(let e=0;e<s.length;e++){const t=s[e];t.hidden=!1,l[e].$&&t.$.removeClass("smart-hidden")}if(r.grouped&&r.isVirtualized)for(let e=0;e<r._groups.length;e++){const t=r._groups[e],i=t.items;let o=!0;for(let e=0;e<i.length;e++)i[e].hidden||(o=!1);o&&(t.hidden=!0)}if(r.grouped&&!r.isVirtualized)for(let e=0;e<r._groups.length;e++){const t=r._groups[e],i=[].concat(...t.querySelectorAll("smart-list-item"));let o=!0;for(let e=0;e<i.length;e++)i[e].$.hasClass("smart-hidden")||(o=!1);o?t.$.addClass("smart-hidden"):t.$.removeClass("smart-hidden")}if(r._filteredItems=s,r._refreshLayout(),t&&t(),e)return;const i=r._propertyChanging;r._propertyChanging=!0,r._refreshSelection(),r._propertyChanging=i};if("function"==typeof r.dataSource)if(o||i){const e=function(e){(o||i)&&r.isAttached&&(r._updateListBoxAfterQuery=function(){s=l=r._items,n()},r.clearItems(),r.insert(0,e))},t=r.dataSource(o,e);if(t){if(!o&&!i)return;r._updateListBoxAfterQuery=function(){s=l=r._items,n()},r.clearItems(),r.insert(0,t)}}else r.clearItems(),s=l=r._items,n(),r.$.fireEvent("bindingComplete");else{if(l=r._items,0===l.length)return;n()}}_getNextItem(e){const t=this._items,i=this._items.length;let r=Math.max(e+1,0);for(;r<i;){const e=t[r];if(!(e.disabled||e.hidden||e.grouped||e.readonly))return e;r++}return t[e]}_getPreviousItem(e){const t=this._items;let i=Math.max(e-1,0);for(;i>-1;){const e=t[i];if(!(e.disabled||e.hidden||e.grouped||e.readonly))return e;i--}return t[e]}get _scrollWidth(){const e=this,t=e._items;return e.__scrollWidth||(e.__scrollWidth=(()=>{const e=this,i=e.virtualized,r=e.itemMeasureMode;let o=0,s="";function l(t){const i=e._createItem({label:t});i.style.position="absolute",e.$.itemsContainer.appendChild(i),i.label=t,i.style.width="auto",i.isCompleted&&(i.$.itemContainer.style.width="auto");const r=getComputedStyle(i),o=parseInt(r.paddingLeft)+parseInt(r.paddingRight),s=i.$.itemContainer||i,l=s.offsetWidth+s.offsetLeft+o;return i.parentNode.removeChild(i),l}for(let e=0;e<t.length;e++){const n=t[e];if(!n.hidden)if("auto"===r){const e=i?n.label:n.textContent.trim();e.length>s.length&&(s=e)}else o=Math.max(o,l(n.label))}return"auto"===r?l(s):o})()),e.__scrollWidth}update(e,t){const i=this,r=i._items[e];if(r){if("string"==typeof t)r.label=t,void 0===r.value&&(r.value=t);else for(let e in t)"selected"===e&&r[e]!==t[e]?i.select(r):r[e]=t[e],"group"===e&&i._refreshItems();(i.sorted||i.grouped||i.isVirtualized)&&(i._refreshItems(),i._refreshSelection())}else i.error(i.localize("indexOutOfBound",{elementType:i.nodeName.toLowerCase(),method:"update"}))}insert(e,t){const i=this;let r=[];if((!e||e<0)&&(e=0),Array.isArray(t)){i.isUpdating++;const o=0===i._items.length;for(let s=0;s<t.length;s++){const l=t[s],n=i._createItem(l);r.push(n),e>=i._items.length||0===i._items.length||o?i.appendChild(n):i.insertBefore(n,i._items[e])}i.isUpdating--}else{const o=i._createItem(t);r.push(o),e>=i._items.length||0===i._items.length?i.appendChild(o):i.insertBefore(o,i._items[e])}if(r.length>0?(r.map((e=>i._applyTemplate(e))),i._ensureItemsReady(r,(function(){i._refreshItems(),0!==i._items.length&&(i._updateListBoxAfterQuery&&(i._updateListBoxAfterQuery(),delete i._updateListBoxAfterQuery),i._refreshSelection(),i.$.fireEvent("bindingComplete"))}))):i._updateListBoxAfterQuery&&(i._updateListBoxAfterQuery(),delete i._updateListBoxAfterQuery),i.virtualized&&i.filterable){const e=i.context;i.context=i,i.filterable&&(i.$.filterInput.value="",i._filterItems()),i.scrollTop=i.$.itemsContainer.scrollTop=0,i.scrollLeft=i.$.itemsContainer.scrollLeft=i._getScrollLeft(0),i.context=e}}add(e){const t=this;let i=[];if(e&&(!e||0!==e.length)){if(Array.isArray(e)){t.isUpdating++;for(let r=0;r<e.length;r++){const o=e[r],s=t._createItem(o);i.push(s),t.appendChild(s)}t.isUpdating--}else{const r=t._createItem(e);i.push(r),t.appendChild(r)}if(i.length>0?(i.map((e=>t._applyTemplate(e))),t._ensureItemsReady(i,(function(){t._refreshItems(),0!==t._items.length&&(t._updateListBoxAfterQuery&&(t._updateListBoxAfterQuery(),delete t._updateListBoxAfterQuery),t._refreshSelection(),t.$.fireEvent("bindingComplete"))}))):t._updateListBoxAfterQuery&&(t._updateListBoxAfterQuery(),delete t._updateListBoxAfterQuery),t.virtualized&&t.filterable){const e=t.context;t.context=t,t.filterable&&(t.$.filterInput.value="",t._filterItems()),t.scrollTop=t.$.itemsContainer.scrollTop=0,t.scrollLeft=t.$.itemsContainer.scrollLeft=t._getScrollLeft(0),t.context=e}else t.virtualized&&t._refreshLayout()}}removeItem(e){const t=this,i=t.getItem(e);if(i){if(i.selected&&t.unselect(i),t.isVirtualized){let e=t._items.indexOf(i);-1===e&&(e=t._items.indexOf(i)),t._items.splice(e,1)}else{i.parentNode.removeChild(i);let e=t._items.indexOf(i);-1===e&&(e=t._items.indexOf(i)),t._items.splice(e,1)}t._refreshItems(),t._refreshSelection(),0===t.selectedIndexes.length&&t._items.length>0&&("oneOrMany"!==t.selectionMode&&"one"!==t.selectionMode&&"oneOrManyExtended"!==t.selectionMode||t.select(t._items[0]))}}removeAt(e){const t=this,i=t._items[e];i?(i.selected&&t.unselect(i),t.isVirtualized||i.parentNode.removeChild(i),t._items.splice(e,1),t._refreshItems(),t._refreshSelection(),0===t.selectedIndexes.length&&t._items.length>0&&("oneOrMany"!==t.selectionMode&&"one"!==t.selectionMode&&"oneOrManyExtended"!==t.selectionMode||t.select(t._items[0]))):t.error(t.localize("indexOutOfBound",{elementType:t.nodeName.toLowerCase(),method:"remove"}))}_queryItems(e,t){const i=this,r=[],o=function(r,o){if(r.grouped)return r;switch(t){case"startsWith":if(0===r.label.indexOf(o))return r;break;case"startsWithIgnoreCase":if(0===r.label.toLowerCase().indexOf(o.toLowerCase()))return r;break;case"doesNotContain":if(r.label.indexOf(o)<0)return r;break;case"doesNotContainIgnoreCase":if(r.label.toLowerCase().indexOf(o.toLowerCase())<0)return r;break;case"contains":if(r.label.indexOf(o)>-1)return r;break;case"containsIgnoreCase":if(r.label.toLowerCase().indexOf(o.toLowerCase())>-1)return r;break;case"equals":if(0===r.label.localeCompare(o))return r;break;case"equalsIgnoreCase":if(0===r.label.toLowerCase().localeCompare(o.toLowerCase()))return r;break;case"endsWith":if(r.label.endsWith(o))return r;break;case"endsWithIgnoreCase":if(r.label.toLowerCase().endsWith(o.toLowerCase()))return r;break;case"custom":if(i.filterCallback(r,e))return r}return null};if(0===e.length)return i._items;for(let t=0;t<i._items.length;t++){const s=o(i._items[t],e);s&&r.push(s)}return r}_select(e,t){const i=this,r=i.selectedIndexes.indexOf(i._indexOf(e)),o=i.selectedIndexes.slice(0),s=i.selectedValues.slice(0);if(e.selected=!0,-1!==r)return i._recycle(),!1;if(o.push(i._indexOf(e)),s.push(e.value||e.label),i.selectedIndexes=o,i.selectedValues=s,i._recycle(),i.$.hiddenInput.value=s.toString(),!i.isCompleted||t||!i.isInitialized||i._propertyChanging)return;let l=[];if(i._previouslySelectedIndexes){for(let e=0;e<i._previouslySelectedIndexes.length;e++)i.selectedIndexes.indexOf(i._previouslySelectedIndexes[e])<0&&l.push(i._items[i._previouslySelectedIndexes[e]]);delete i._previouslySelectedIndexes}return i.$.fireEvent("change",{addedItems:[e],removedItems:l,selected:e.selected,disabled:e.disabled,index:i._indexOf(e),label:e.label,value:e.value}),i._updateTargetValue(),!0}_updateTargetValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const i=e.dataset.property,r=e.value;i&&void 0!==t[i]&&(t[i]=r)}}}_setTopVisibleIndex(e){const t=this;if("number"==typeof e&&(t.topVisibleIndex=Math.max(0,e),e=t._items[t.topVisibleIndex]),!e)return!1;e.top!==t.scrollTop&&(t.scrollTop=e.top,t.isVirtualized||(t.$.itemsContainer.scrollTop=t.scrollTop),t.scrollHeight===t.scrollTop&&t._updateTopVisibleIndex())}_updateTopVisibleIndex(){const e=this,t=e.scrollTop+e._scrollView.verticalScrollBar.offsetHeight-e.offsetHeight;let i;if(e.scrollTop<e.scrollHeight/2){for(let r=0;r<e._items.length;r++)if(e._items[r].top>=t){i=e._items[r];break}}else for(let r=e._items.length-1;r>=0&&!(e._items[r].top<t);r--)i=e._items[r];if(i){const t=e.context;e.context=e,e.topVisibleIndex=i.dataIndex,e.context=t}}unselect(e){const t=this;if(!e)return;if("string"==typeof e&&!(e=t.getItem(e)))return;if("none"===t.selectionMode)return void t.clearSelection();const i=t.selectedIndexes.indexOf(t._indexOf(e)),r=t.selectedIndexes.slice(0),o=t.selectedValues.slice(0);return e.selected=!1,i>=0&&(r.splice(i,1),o.splice(i,1),t.selectedIndexes=r,t.selectedValues=o,t.$.hiddenInput.value=o.toString(),t.isCompleted&&!t._propertyChanging?(t.$.fireEvent("change",{addedItems:[],removedItems:[e],selected:e.selected,disabled:e.disabled,index:t._indexOf(e),label:e.label,value:e.value}),t._updateTargetValue(),t._recycle(),!0):void 0)}_handleItemTemplate(e){if(null===e||!e)return;if("function"==typeof e)return e;const t=this;if(!("content"in document.createElement("template")))return t.error(t.localize("htmlTemplateNotSuported",{elementType:t.nodeName.toLowerCase()})),void(t.itemTemplate=null);if(null===(e=document.getElementById(e))||!("content"in e))return t.error(t.localize("invalidTemplate",{elementType:t.nodeName.toLowerCase(),property:"itemTemplate"})),void(t.itemTemplate=null);const i=e.content,r=i.childNodes.length,o=/{{\w+}}/g;let s,l;t._bindingDetails=[],t._template=e;for(let e=0;e<r;e++){for(l=[];s=o.exec(i.childNodes[e].innerHTML);)l.push(s[0]);l.length>0&&t._bindingDetails.push({childNodeIndex:e,bindingString:l})}return!0}_handleKeyStrokes(e){const t=this,i="radioButton"===t.selectionMode||"checkBox"===t.selectionMode||"zeroOrMany"===t.selectionMode||"oneOrMany"===t.selectionMode||"zeroOrOne"===t.selectionMode;let r=t._items;if(t.filterable&&t.$.filterInput.value.length>0&&(r=t._filteredItems),!t.disabled&&!t.readonly&&r.length){switch(e){case"ArrowLeft":case"ArrowUp":t._handleArrowKeys(!0);break;case"ArrowRight":case"ArrowDown":t._handleArrowKeys(!1);break;case" ":{if(t.selectedIndexes.length<1&&!t._focusedItem)return;const e=t._focusedItem?t._focusedItem:t._items[t.selectedIndexes[t.selectedIndexes.length-1]],i=e=>{e.selected&&"radioButton"!==t.selectionMode?t.unselect(e):t.select(e)};if("oneOrMany"===t.selectionMode)return void(e.selected&&t.selectedIndexes.length>1?i(e):e.selected||i(e));i(e);break}case"Home":if(0===r.length)return;i||(t._keysPressed.Shift||t.clearSelection(),t.select(r[0])),t._focus(r[0]),t.scrollTop=0;break;case"End":if(0===r.length)return;i||(t._keysPressed.Shift||t.clearSelection(),t.select(r[r.length-1])),t._focus(r[r.length-1]),t.scrollTop=t.scrollHeight;break;case"PageUp":t._pageUpKeyHandler(r);break;case"PageDown":t._pageDownKeyHandler(r)}t._recycle()}}_horizontalScrollbarHandler(e){const t=this;e&&e.stopPropagation&&e.stopPropagation(),t.isVirtualized?t._recycle():t.$.itemsContainer.scrollLeft=t._getScrollLeft(e.detail.value)}_getScrollLeft(e,t){const i=this;if(!i.rightToLeft)return e;if(Smart.Utilities.Core.Browser.Chrome){if(!t){const e=2*(parseInt(getComputedStyle(i.$.itemsInnerContainer).getPropertyValue("--smart-list-item-horizontal-offset"))||0);t=i._scrollWidth-i.$.itemsContainer.offsetWidth-e}e=t-e}else e*=-1;return e}_unsort(){const e=this;e.isUpdating++;const t=function(e,t){let i=e.dataIndex,r=t.dataIndex;return i<r?-1:i>r?1:0};if(e.isVirtualized)if(e._groups.length>0){e._groups.sort(t);let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.items);s.sort(t),i.push(o),i=i.concat(s)}e._items=i}else e._items.sort(t);else{if(e._groups.length>0){e._groups.sort(t);let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.querySelectorAll("smart-list-item"));s.sort(t),i=i.concat(s)}e._items=i}else e._items.sort(t);e._applySortOrder()}e.isUpdating--}_applySortOrder(){const e=function(e){for(let t=0;t<e.length;t++){const i=e[t],r=i.parentNode;r&&r.appendChild(i)}};e(this._items),e(this._groups)}_sort(){const e=this;if(!e._canSort)return;e.isUpdating++;const t=function(t,i){let r=t.label,o=i.label;if("asc"===e.sortDirection){if(r<o)return-1;if(r>o)return 1}else{if(r<o)return 1;if(r>o)return-1}return 0};if(e._groups.sort(t),e.isVirtualized)if(e._groups.length>0){let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.items);i.push(o),s.sort(t),i=i.concat(s)}e._items=i}else e._items.sort(t);else{if(e._groups.length>0){let i=[];for(let r=0;r<e._groups.length;r++){const o=e._groups[r],s=[].concat(...o.querySelectorAll("smart-list-item"));s.sort(t),i=i.concat(s)}e._items=i}else e._items.sort(t);e._applySortOrder()}e.isUpdating--}getItem(e){const t=this;for(let i=0;i<t._items.length;i++)if(t._items[i].value===e)return t._items[i];return null}_focus(e){const t=this;!e||"none"===t.selectionMode||t.disabled||t.readonly||(t._focusedItem&&(t._focusedItem._focused=!1),t._focusedItem=e,t._focusedItem._focused=!0)}_keyDownHandler(e){const t=this,i=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement;let r=e.key;if(e.metaKey&&(r="Control"),!t.disabled&&!t.readonly&&(!t.filterable||t.$.filterInput!==i)&&t._focused&&0!==t._items.length&&!t.disabled&&!t.displayLoadingIndicator){if(t.editable){if("F2"===r)return void t._dblclickEventHandler({target:t._focusedItem});if(t.$.editInput===i)return}if("none"!==t.selectionMode){switch(e.stopPropagation(),r){case"Down":case"Right":case"Left":case"Up":r="Arrow"+r}if(t.filterable)switch(r){case"ArrowLeft":case"ArrowRight":return;case"ArrowUp":case"ArrowDown":e.preventDefault()}if(t._applyIncrementalSearch(r),!(["Shift","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Control"," ","Home","End","PageUp","PageDown"].indexOf(r)<0))if(e.preventDefault(),!t._focusedItem&&t._items.length>0)"one"===t.selectionMode||"oneOrMany"===t.selectionMode||"oneOrManyExtended"===t.selectionMode?t.select(t._items[0]):t._focus(t._items[0]);else switch(t.selectionMode){case"one":case"zeroAndOne":if("Shift"===r||"Control"===r||" "===r)return;t._handleKeyStrokes(r);break;case"oneOrMany":case"zeroOrOne":case"zeroOrMany":case"radioButton":case"checkBox":if("Shift"===r||"Control"===r)return;t._handleKeyStrokes(r);break;case"oneOrManyExtended":if(" "===r)return;t._keysPressed[r]="keydown"===e.type,t._handleKeyStrokes(r)}}}}_keyUpHandler(e){const t=this,i=(t.shadowRoot||t.getRootNode()).activeElement||document.activeElement;if(!t.editable||t.$.editInput!==i){if(t.filterable&&t.$.filterInput===i)return t._filterTimer&&clearTimeout(t._filterTimer),void(t._filterTimer=setTimeout((function(){const e=t.context;t.context=t,t._filterItems(void 0,void 0,!0),t.scrollTop=t.$.itemsContainer.scrollTop=0,t.scrollLeft=t.$.itemsContainer.scrollLeft=t._getScrollLeft(0),t.context=e}),300));if(t._focused){if(t._focusedItem&&t._focusedItem.hidden&&t._filteredItems.length>0){let e=t._filteredItems[0];e.grouped&&t._filteredItems.length>1&&(e=t._filteredItems[1]),t._focus(e),t._recycle()}e.stopPropagation(),e.preventDefault(),t.disabled||("Escape"===e.key&&Smart.ListBox.DragDrop.Dragging&&t._cancelDrag(),["Shift","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Control"," ","PageUp","PageDown"].indexOf(e.key)<0||(t._keysPressed[e.key]=!1))}}}_cancelDrag(){if(!Smart.ListBox.DragDrop.Dragging)return;Smart.ListBox.DragDrop.Feedback.parentNode&&Smart.ListBox.DragDrop.Feedback.parentNode.removeChild(Smart.ListBox.DragDrop.Feedback);const e=Smart.ListBox.DragDrop.Item,t=e.ownerListBox;if(t.$.fireEvent("dragCancel",{item:e,data:Smart.ListBox.DragDrop,container:t,previousContainer:t}),Smart.ListBox.DragDrop.Feedback=null,Smart.ListBox.DragDrop.DropDetails){let e=Smart.ListBox.DragDrop.DropDetails.item;e&&(e.$.removeClass("smart-list-item-line-feedback"),e.$.removeClass("smart-list-item-bottom-line-feedback"))}document.body.classList.remove("smart-dragging"),delete Smart.ListBox.DragDrop.DraggedFrom,Smart.ListBox.DragDrop.Dragging=!1,Smart.ListBox.DragDrop.Item=null,Smart.ListBox.DragDrop.DropDetails=null}_mouseWheelNative(e,t){const i=this;void 0===i._scrollWheelContent&&(i._scrollWheelContent=document.createElement("div"),i._scrollWheelContent.style.width="100%",i._scrollWheelContent.style.height="100%",i._scrollWheelContent.style.position="absolute",i._scrollWheelContent.style.left="0px",i._scrollWheelContent.style.top="0px",i._scrollWheelContent.style.background="white",i._scrollWheelContent.style.zIndex=9999,i._scrollWheelContent.style.opacity=0,i._scrollWheelContent.style.overflow="auto",i._scrollWheelContent.style.visibility="hidden");let r=0;const o=()=>{if(t){const t=i._scrollWheelContent.scrollLeft;i._scrollView.hScrollBar.value=t,t===e&&i._scrollWheelContent.remove()}else{const t=i._scrollWheelContent.scrollTop;i._scrollView.vScrollBar.value=t,t===e&&i._scrollWheelContent.remove()}};i._scrollWheelContent.onscroll=()=>{cancelAnimationFrame(r),r=0,r=requestAnimationFrame(o)},i._scrollWheelContentView||(i._scrollWheelContentView=document.createElement("div"),i._scrollWheelContent.appendChild(i._scrollWheelContentView)),i._scrollWheelContentView.style.width=i.offsetWidth+i._scrollView.scrollWidth+"px",i._scrollWheelContentView.style.height=i.offsetHeight+i._scrollView.scrollHeight+"px",i.$.container.appendChild(i._scrollWheelContent),i._scrollWheelContent.scrollTop=i._scrollView.vScrollBar.value,i._scrollWheelContent.scrollLeft=i._scrollView.hScrollBar.value,!0===t?i._scrollWheelContent.scrollTo({top:i._scrollView.vScrollBar.value,left:e,behavior:"smooth"}):i._scrollWheelContent.scrollTo({top:e,left:i._scrollView.hScrollBar.value,behavior:"smooth"})}_mouseWheelHandler(e){const t=this;if(t._scrollView.hScrollBar.$.hasClass("smart-hidden")&&t._scrollView.vScrollBar.$.hasClass("smart-hidden"))return;if(42===e.pointerId)return;if(t._isUpdating())return;let i=!1;if(e.wheelDeltaY?120!==Math.abs(e.wheelDeltaY)&&240!==Math.abs(e.wheelDeltaY)&&360!==Math.abs(e.wheelDeltaY)&&(i=!0):0===e.deltaMode&&(i=!0),t.disabled||t._scrollView.vScrollBar.$.hasClass("smart-hidden")||e.shiftKey||!e.deltaY){if(!t.disabled&&(!t._scrollView.hScrollBar.$.hasClass("smart-hidden")||e.shiftKey)){e.stopPropagation(),e.preventDefault();let r=160;const o=0===e.deltaX?e.wheelDelta:e.deltaX;o<0&&(r=-160),Math.abs(o)>=100&&!i&&!Smart.Utilities.Core.Browser.Firefox?t._mouseWheelNative(t._scrollView.scrollLeft+r,!0):t._scrollView.scrollLeft+=o}}else{const r=t.scrollTop;if(0===r&&e.deltaY<0||r===t.scrollHeight&&e.deltaY>0)return;e.stopPropagation(),e.preventDefault();const o=t.itemHeight?t.itemHeight:30;let s=7*o;if(e.deltaY<=0&&(s=-7*o),Math.abs(e.deltaY)>=100&&!i&&!Smart.Utilities.Core.Browser.Firefox)t._mouseWheelNative(t._scrollView.scrollTop+s);else{t._wheelrafId=0;const i=()=>{t._scrollView.scrollTop+=e.deltaY};cancelAnimationFrame(t._wheelrafId),t._wheelrafId=0,t._wheelrafId=requestAnimationFrame(i)}}}_pageDownKeyHandler(e){const t=this;if(0===e.length)return;let i,r=t._items[t.selectedIndexes[t.selectedIndexes.length-1]];if("checkBox"!==t.selectionMode&&"radioButton"!==t.selectionMode&&"zeroOrMany"!==t.selectionMode&&"oneOrMany"!==t.selectionMode&&"zeroOrOne"!==t.selectionMode||t._focusedItem&&(r=t._focusedItem),!r)return;const o=t._indexOf(r);let s=r.top+t.$.itemsContainer.offsetHeight-r.height;for(let t=o;t<e.length;t++)if(e[t].top>=s){i=e[t];break}i||(i=e[e.length-1]),"checkBox"===t.selectionMode||"radioButton"===t.selectionMode||"zeroOrMany"===t.selectionMode||"oneOrMany"===t.selectionMode||"zeroOrOne"===t.selectionMode?t._focus(i):i.selected||(t._keysPressed.Shift||t.clearSelection(),t.select(i),t._focus(i)),(i.height+i.top>t.$.itemsContainer.scrollTop+t.$.itemsContainer.offsetHeight||i.top<t.$.itemsContainer.scrollTop)&&(t.scrollTop=i.top-t.$.itemsContainer.offsetHeight+i.height)}_pageUpKeyHandler(e){const t=this;if(0===e.length)return;let i=t._items[t.selectedIndexes[t.selectedIndexes.length-1]];if("checkBox"!==t.selectionMode&&"radioButton"!==t.selectionMode&&"zeroOrMany"!==t.selectionMode&&"oneOrMany"!==t.selectionMode&&"zeroOrOne"!==t.selectionMode||t._focusedItem&&(i=t._focusedItem),!i)return;const r=i.top-t.$.itemsContainer.offsetHeight;let o;for(let s=t._indexOf(i);s>0;s--)if(e[s].top<=r){o=e[s];break}o||(o=e[0]),"checkBox"===t.selectionMode||"radioButton"===t.selectionMode||"zeroOrMany"===t.selectionMode||"oneOrMany"===t.selectionMode||"zeroOrOne"===t.selectionMode?t._focus(o):o.selected||(t._keysPressed.Shift||t.clearSelection(),t.select(o),t._focus(o)),t.scrollTop=o.top,0===t._indexOf(o)&&(t.scrollTop=0)}clearItems(){const e=this;e.clearSelection(),e.$.itemsInnerContainer.innerHTML="",e._items=[],delete e._focusedItem,e.$placeholder.removeClass("smart-hidden"),e.refresh()}_resizeHandler(e){this.refresh(e)}refresh(e){const t=this;if(!e&&!t._isUpdatingScrollBars&&t.isInitialized)return t._isUpdatingScrollBars=!0,t._initializeRecyclingItems(),t._refreshLayout(),void(t._isUpdatingScrollBars=!1);e&&e.target===t&&!t._isUpdatingScrollBars&&(t._isUpdatingScrollBars=!0,t._initializeRecyclingItems(),t._refreshLayout(),t._isUpdatingScrollBars=!1)}_indexOf(e){const t=this;if(!e)return-1;let i=t._items.indexOf(e);return-1===i&&(i=t._items.indexOf(t.getItem(e.value))),i}_incrementalSearch(){const e=this,t="radioButton"!==e.selectionMode&&"checkBox"!==e.selectionMode&&"zeroOrMany"!==e.selectionMode&&"oneOrMany"!==e.selectionMode&&"zeroOrOne"!==e.selectionMode;let i,r=0;switch(e.incrementalSearchMode){case"containsIgnoreCase":case"equalsIgnoreCase":case"startsWithIgnoreCase":case"endsWithIgnoreCase":i=e._incrementalSearchQuery.toLowerCase();break;default:i=e._incrementalSearchQuery}const o=function(i){i.grouped||i.readonly||(t?(e.selectedIndexes.length>0&&e.clearSelection(),e._focus(i),e.select(i)):e._focus(i),(i.height+i.top>e.$.itemsContainer.scrollTop+e.$.itemsContainer.offsetHeight||i.top<e.scrollTop)&&(e.scrollTop=i.top),0===e._indexOf(i)&&(e.scrollTop=0),e._indexOf(i)===e._items.length-1&&(e.scrollTop=e.scrollHeight))};0!==e._previousEntry.localeCompare(i)&&(e._incrementalSearchItems=e._queryItems(e._incrementalSearchQuery,e.incrementalSearchMode),delete e._itemPosition),e._previousEntry=i;const s=e._incrementalSearchItems.length;if(0!==s)if(1!==s)for(void 0!==e._itemPosition?e._itemPosition<s-1?r=e._itemPosition:(r=0,t?(e._incrementalSearchItems[e._itemPosition].selected=!1,e.selectedIndexes=[],e.selectedValues=[]):e._incrementalSearchItems[e._itemPosition]._focused=!1):t&&e.clearSelection();r<s;r++)if(e._incrementalSearchItems[r].selected&&t)e._incrementalSearchItems[r].selected=!1,e.selectedIndexes=[],e.selectedValues=[];else{if(t||!e._incrementalSearchItems[r]._focused)return o(e._incrementalSearchItems[r]),void(e._itemPosition=r);e._incrementalSearchItems[r]._focused=!1}else o(e._incrementalSearchItems[0])}_selectStartHandler(e){const t=this,i=(t.shadowRoot||t.getRootNode()).activeElement;t.$.filterInput!==i&&t.$.editInput!==i&&e.preventDefault()}_handleArrowKeys(e){const t=this,i="radioButton"!==t.selectionMode&&"checkBox"!==t.selectionMode&&"zeroOrMany"!==t.selectionMode&&"oneOrMany"!==t.selectionMode&&"zeroOrOne"!==t.selectionMode;if(t.disabled||t.readonly)return;let r;if(t._focusedItem&&!t._keysPressed.Shift)r=t._indexOf(t._focusedItem),t._focusedItem._focused=!1;else{if(0===t.selectedIndexes.length)return;r=t.selectedIndexes[t.selectedIndexes.length-1]}const o=e?t._getPreviousItem(r):t._getNextItem(r);t._focus(o),i&&(t._keysPressed.Shift?t.select(o):t._items[r]!==o&&(t.clearSelection(),t.select(o))),t.ensureVisible(o)}_refreshFilter(){const e=this;if(e.filterable)return e.$.filterInput.disabled=!(!e.disabled&&!e.displayLoadingIndicator),e.$filterInputContainer.removeClass("smart-hidden"),void e.$itemsContainer.addClass("filter");e.$.filterInput.disabled=!0,e.$filterInputContainer.addClass("smart-hidden"),e.$itemsContainer.removeClass("filter")}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.removeAttribute("tabindex"):e.tabIndex=e.tabIndex>0?e.tabIndex:0}_setLoadingIndicatorVisibility(){const e=this;e.displayLoadingIndicator?e.$loadingIndicatorContainer.hasClass("smart-visibility-hidden")?e.$loadingIndicatorContainer.removeClass("smart-visibility-hidden"):e.$loadingIndicatorContainer.removeClass("smart-hidden"):e._areCSSVarsSupported?e.$loadingIndicatorContainer.addClass("smart-hidden"):e.$loadingIndicatorContainer.addClass("smart-visibility-hidden")}_refreshLayout(){const e=this,t=e._filteredItems||e._items;if(e.__scrollHeight=null,e.__scrollWidth=null,e._height=null,e._scrollView||(e._scrollView=new Smart.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.$itemsContainer.removeClass("hscroll"),e.$itemsContainer.removeClass("vscroll"),!t||null===t||0===t.length)return e.scrollWidth=0,e.scrollHeight=0,e.$filterInputContainer.removeClass("vscroll"),e.$placeholder.removeClass("smart-hidden"),e.isVirtualized&&e._recycle(),void(e.$.itemsInnerContainer.style.width="");e.$placeholder.addClass("smart-hidden");const i=2*(parseInt(getComputedStyle(e.$.itemsContainer).getPropertyValue("--smart-list-item-horizontal-offset"))||0);let r=e._scrollWidth-e.$.itemsContainer.offsetWidth-i,o=e._scrollHeight;if(e._refreshHorizontalScrollBarVisibility(r),e._refreshVerticalScrollBarVisibility(o),e.$.itemsInnerContainer.style.width="","hidden"===e.horizontalScrollBarVisibility?e.$.itemsInnerContainer.style.width=e.$.itemsContainer.offsetWidth-i:e.$.itemsInnerContainer.style.width=Math.max(e.$.itemsContainer.offsetWidth-i,-i+e.__scrollWidth)+"px",e.computedVerticalScrollBarVisibility)return r=e._scrollWidth-e.$.itemsContainer.offsetWidth-i,e._refreshHorizontalScrollBarVisibility(r),"hidden"!==e.horizontalScrollBarVisibility&&(e.$.itemsInnerContainer.style.width="",e.$.itemsInnerContainer.style.width=Math.max(e.$.itemsContainer.offsetWidth-i,-i+e.__scrollWidth)+"px"),e.computedHorizontalScrollBarVisibility&&(("visible"!==e.horizontalScrollBarVisibility||0!==e.scrollWidth||"visible"===e.horizontalScrollBarVisibility)&&(e.__scrollHeight+=e._scrollView.hScrollBar.offsetHeight),e.scrollHeight=e.__scrollHeight,e._scrollView.hScrollBar.$.hasClass("bottom-corner")&&e._scrollView.hScrollBar.refresh()),void(e.isVirtualized&&e._recycle());r=e._scrollWidth-e.$.itemsContainer.offsetWidth-i,e._refreshHorizontalScrollBarVisibility(r),e.computedHorizontalScrollBarVisibility&&(e.scrollHeight=e._scrollHeight,e._refreshVerticalScrollBarVisibility(e.scrollHeight),e.computedVerticalScrollBarVisibility&&(r=e._scrollWidth-e.$.itemsContainer.offsetWidth-e._scrollView.vScrollBar.offsetWidth,e._refreshHorizontalScrollBarVisibility(r)),e._scrollView.vScrollBar.$.hasClass("bottom-corner")&&e._scrollView.vScrollBar.refresh(),e._scrollView.hScrollBar.$.hasClass("bottom-corner")&&e._scrollView.hScrollBar.refresh()),e.isVirtualized&&e._recycle();const s=/Trident|Edge/.test(navigator.userAgent);!e.isRefreshing&&s&&setTimeout((function(){e.isRefreshing=!0,e._refreshLayout(),e.isRefreshing=!1}),50)}_styleChangedHandler(){this._refreshLayout()}_swipeLeftHandler(){}_swipeRightHandler(){}_refreshHorizontalScrollBarVisibility(e){const t=this;t.scrollWidth=e,t.$.horizontalScrollBar.refresh(),t.computedHorizontalScrollBarVisibility?(t.scrollLeft=t._getScrollLeft(t.$.itemsContainer.scrollLeft,e),t.$itemsContainer.addClass("hscroll")):t.$itemsContainer.removeClass("hscroll")}_refreshVerticalScrollBarVisibility(e){const t=this;t.scrollHeight=e,t.$.verticalScrollBar.refresh(),t.computedVerticalScrollBarVisibility?(t.$itemsContainer.addClass("vscroll"),t.$filterInputContainer.addClass("vscroll")):(t.$itemsContainer.removeClass("vscroll"),t.$filterInputContainer.removeClass("vscroll"))}_validateTemplate(e,t){if(null===t||!t)return;const i=this;return"content"in document.createElement("template")?null!==(t=document.getElementById(t))&&"content"in t?t:(i.error(i.localize("invalidTemplate",{elementType:i.nodeName.toLowerCase(),property:e})),void(i[e]=null)):(i.error(i.localize("htmlTemplateNotSuported",{elementType:i.nodeName.toLowerCase()})),void(i[e]=null))}_getItemIndexByPosition(e){const t=this;return(i=>{let r=0,o=i.length-1;if(e<=0)return 0;if(i[i.length-1].top<=e)return i.length-1;for(;;){const s=Math.floor((r+o)/2),l=i[s];if(t._isItemInPosition(l,e))return s;l.top<e?r=s+1:l.top>e&&(o=s-1)}})(t.$.filterInput.value.length>0?t._filteredItems:t._items)}_isItemInPosition(e,t){const i=e.top,r=e.top+e.height;return i<=t&&r>t}get isVirtualized(){const e=this;return e.virtualized&&e.dataSource&&e.dataSource.length>0}_recycle(){const e=this;if(!e._recyclingItems)return;let t=e._height;e._height||(t=e._height=e.$.itemsContainer.offsetHeight);let i=0;const r=e.scrollTop,o=e._getItemIndexByPosition(r),s=e.filterable&&e.$.filterInput.value.length>0?e._filteredItems:e._items,l=s[o];let n=l?l.top:0;if(e.$.itemsInnerContainer.style.left=-e.scrollLeft+"px",e.$.itemsInnerContainer.style.top=-r+n+"px",e.isUpdating++,o>=0){const l=s.length;for(let a=o;a<l;a++){const o=s[a];if(0!==o.height){if(!(n+o.height>=r&&n<=r+t))break;{const t=e._recyclingItems[i++];if(!t)break;t.setAttribute("aria-setsize",l),t.setAttribute("aria-posinset",a),t.context=document,t.dataItem=o,t.label=o.label,t.value=o.value,t.selected=o.selected,t._focused=o._focused,t.hidden=o.hidden,t.grouped=o.grouped,t.readonly=o.readonly,t.style.height=o.height+"px",e._alternateItem(t),o.title?t.title=o.title:t.title="",o.grouped?t.displayMode="plain":t.displayMode=o.displayMode,e.scrollWidth>0&&(t.style.width=e.$.itemsInnerContainer.offsetWidth+e.scrollWidth+"px"),e.itemTemplate&&e._handleItemTemplate(e.itemTemplate)&&e._applyTemplate(t,!1)}n+=o.height}}}if(i<e._recyclingItems.length)for(let t=i;t<e._recyclingItems.length;t++){const t=e._recyclingItems[i++],r=t.context;t.context=document,t.hidden=!0,t.context=r}e.isUpdating--}_verticalScrollbarHandler(e){const t=this,i=e.detail.value;e&&e.stopPropagation&&e.stopPropagation(),t.isVirtualized?t._recycle():t.$.itemsContainer.scrollTop=i,t._updateTopVisibleIndex(),e.context.max!==e.context.value?e.context.min===e.context.value&&t.$.fireEvent("scrollTopReached"):t.$.fireEvent("scrollBottomReached")}_applyAriaSelected(){const e=this,t=e.isVirtualized?e._recyclingItems:e._items,i=e.selectionMode;for(let e=0;e<t.length;e++){const r=t[e];r.selected?r.setAttribute("aria-selected",!0):r.readonly||r.disabled||-1===["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox"].indexOf(i)?r.removeAttribute("aria-selected"):r.setAttribute("aria-selected",!1)}}});

/***/ }),

/***/ 8687:
/***/ (() => {

(()=>{let t;try{BigInt,t=!0}catch(i){t=!1}Smart.Utilities.Assign("BigNumber",class{constructor(t,i,e){var r,n=this;if(Smart.Utilities.BigNumber.bigIntSupport){if(t instanceof Smart.Utilities.BigNumber){if(!Array.isArray(t._d))return new Smart.Utilities.BigNumber(t._d);t=(t._s?"-":"")+(t._d.slice(0,t._f).join("")||"0")+(t._f!=t._d.length?"."+t._d.slice(t._f).join(""):"")}try{null===t?n._d=BigInt(0):"string"==typeof t&&-1!==t.toLowerCase().indexOf("e")?n._d=BigInt(parseFloat(t)):n._d=BigInt(t)}catch(i){try{const i=t.toString().split(".");let e=BigInt(i[0]),r=parseInt(i[1].charAt(0));if(e>=0&&r>=5)e+=BigInt(1);else if(e<0)if(r>5)e-=BigInt(1);else if(5===r){let t=1,r=i[1].charAt(t),n=!1;for(;""!==r;)if(t++,r=i[1].charAt(t),"0"!==r){n=!0;break}n&&(e-=BigInt(1))}n._d=e}catch(t){n._d=BigInt(0)}}return n._f=n._d.toString().replace("-","").length,void(n._s=n._d<0)}if(t instanceof Smart.Utilities.BigNumber){if("bigint"==typeof t._d)return new Smart.Utilities.BigNumber(t._d.toString());for(r in{precision:0,roundType:0,_s:0,_f:0})n[r]=t[r];return n._d=t._d.slice(),void(t._s&&1===t._d.length&&0===t._d[0]&&(n._s=!1))}if(void 0!==t&&("-0"===t&&(t="0"),new RegExp(/e/i).test(t))){var s=t.toString().toLowerCase(),a=s.indexOf("e"),l=new Smart.Utilities.BigNumber(s.slice(0,a)),_=s.slice(a+2),u=s.slice(a+1,a+2),o=new Smart.Utilities.BigNumber(10).pow(u+_);t=l.multiply(o).toString()}for(n.precision=isNaN(i=Math.abs(i))?Smart.Utilities.BigNumber.defaultPrecision:i,n.roundType=isNaN(e=Math.abs(e))?Smart.Utilities.BigNumber.defaultRoundType:e,n._s="-"==(t+="").charAt(0),n._f=((t=t.replace(/[^\d.]/g,"").split(".",2))[0]=t[0].replace(/^0+/,"")||"0").length,r=(t=n._d=(t.join("")||"0").split("")).length;r;t[--r]=+t[r]);n.round()}static get defaultPrecision(){return 40}static get defaultRoundType(){return 4}static get bigIntSupport(){return t&&!0!==Smart.Utilities.BigNumber.ignoreBigIntNativeSupport}add(t){if(Smart.Utilities.BigNumber.bigIntSupport)return new Smart.Utilities.BigNumber(this._d+new Smart.Utilities.BigNumber(t)._d);let i=this.normalizeOperand(this);if(t=i.normalizeOperand(t),i.isZero()&&i._s&&(i._s=!1),0===t||t.constructor===Smart.Utilities.BigNumber&&1===t._d.length&&0===t._d[0])return new Smart.Utilities.BigNumber(i);if(i._s!=(t=new Smart.Utilities.BigNumber(t))._s)return t._s^=1,i.subtract(t);var e,r,n=new Smart.Utilities.BigNumber(i),s=n._d,a=t._d,l=n._f,_=t._f;for(t=Math.max(l,_),l!=_&&((_=l-_)>0?n._zeroes(a,_,1):n._zeroes(s,-_,1)),e=(l=s.length)==(_=a.length)?s.length:((_=l-_)>0?n._zeroes(a,_):n._zeroes(s,-_)).length,r=0;e;r=(s[--e]=s[e]+a[e]+r)/10>>>0,s[e]%=10);return r&&++t&&s.unshift(r),n._f=t,n.round()}subtract(t){if(Smart.Utilities.BigNumber.bigIntSupport)return new Smart.Utilities.BigNumber(this._d-new Smart.Utilities.BigNumber(t)._d);let i=this.normalizeOperand(this);if(t=i.normalizeOperand(t),i.isZero()&&i._s&&(i._s=!1),0===t||t.constructor===Smart.Utilities.BigNumber&&1===t._d.length&&0===t._d[0])return new Smart.Utilities.BigNumber(i);if(i._s!=(t=new Smart.Utilities.BigNumber(t))._s)return t._s^=1,i.add(t);var e,r,n=new Smart.Utilities.BigNumber(i),s=n.abs().compare(t.abs())+1,a=s?n:t,l=s?t:n,_=a._f,u=l._f,o=_;for(a=a._d,l=l._d,_!=u&&((u=_-u)>0?n._zeroes(l,u,1):n._zeroes(a,-u,1)),e=(_=a.length)==(u=l.length)?a.length:((u=_-u)>0?n._zeroes(l,u):n._zeroes(a,-u)).length;e;){if(a[--e]<l[e]){for(r=e;r&&!a[--r];a[r]=9);--a[r],a[e]+=10}l[e]=a[e]-l[e]}return s||(n._s^=1),n._f=o,n._d=l,n.round()}multiply(t){if(Smart.Utilities.BigNumber.bigIntSupport)return new Smart.Utilities.BigNumber(this._d*new Smart.Utilities.BigNumber(t)._d);let i=this.normalizeOperand(this);t=i.normalizeOperand(t);var e,r,n,s=new Smart.Utilities.BigNumber(i),a=s._d.length>=(t=new Smart.Utilities.BigNumber(t))._d.length,l=(a?s:t)._d,_=(a?t:s)._d,u=l.length,o=_.length,g=new Smart.Utilities.BigNumber;for(e=o;e;a&&n.unshift(a),g.set(g.add(new Smart.Utilities.BigNumber(n.join("")))))for(n=new Array(o- --e).join("0").split(""),a=0,r=u;r;a+=l[--r]*_[e],n.unshift(a%10),a=a/10>>>0);return s._s=s._s!=t._s,s._f=((a=u+o-s._f-t._f)>=(r=(s._d=g._d).length)?i._zeroes(s._d,a-r+1,1).length:r)-a,s.round()}divide(t){if(Smart.Utilities.BigNumber.bigIntSupport)return new Smart.Utilities.BigNumber(this._d/new Smart.Utilities.BigNumber(t)._d);let i=this.normalizeOperand(this);if(t=i.normalizeOperand(t),"0"==(t=new Smart.Utilities.BigNumber(t)))throw new Error("Division by 0");if("0"==i)return new Smart.Utilities.BigNumber;var e,r,n,s=new Smart.Utilities.BigNumber(i),a=s._d,l=t._d,_=a.length-s._f,u=l.length-t._f,o=new Smart.Utilities.BigNumber,g=0,m=1,d=0,h=0;for(o._s=s._s!=t._s,o.precision=Math.max(s.precision,t.precision),o._f=+o._d.pop(),_!=u&&s._zeroes(_>u?l:a,Math.abs(_-u)),t._f=l.length,(l=t)._s=!1,l=l.round(),t=new Smart.Utilities.BigNumber;"0"==a[0];a.shift());t:do{for(n=d=0,"0"==t&&(t._d=[],t._f=0);g<a.length&&-1==t.compare(l);++g){if(n=g+1==a.length,(!m&&++d>1||(h=n&&"0"==t&&"0"==a[g]))&&(o._f==o._d.length&&++o._f,o._d.push(0)),"0"==a[g]&&"0"==t||(t._d.push(a[g]),++t._f),h)break t;if(n&&-1==t.compare(l)&&(o._f==o._d.length&&++o._f,1)||(n=0))for(;o._d.push(0),t._d.push(0),++t._f,-1==t.compare(l););}if(m=0,-1==t.compare(l)&&!(n=0))for(;n?o._d.push(0):n=1,t._d.push(0),++t._f,-1==t.compare(l););var f;for(r=new Smart.Utilities.BigNumber,e=0;t.compare(f=r.add(l))+1&&++e;r.set(f));t.set(t.subtract(r)),!n&&o._f==o._d.length&&++o._f,o._d.push(e)}while((g<a.length||"0"!=t)&&o._d.length-o._f<=o.precision);return o.round()}mod(t){if(Smart.Utilities.BigNumber.bigIntSupport)return new Smart.Utilities.BigNumber(this._d%new Smart.Utilities.BigNumber(t)._d);let i=this.normalizeOperand(this);t=i.normalizeOperand(t);var e=i.subtract(i.divide(t).intPart().multiply(t));return e.isZero()&&e._s&&(e._s=!e._s),e}pow(t){if(Smart.Utilities.BigNumber.bigIntSupport){let i=BigInt(1);for(let e=BigInt(0);e<new Smart.Utilities.BigNumber(t)._d;e+=BigInt(1))i*=this._d;return new Smart.Utilities.BigNumber(i)}let i=this.normalizeOperand(this);t=i.normalizeOperand(t);var e,r=new Smart.Utilities.BigNumber(i);if(0==(t=new Smart.Utilities.BigNumber(t).intPart()))return r.set(1);for(e=Math.abs(t);--e;r.set(r.multiply(i)));return t<0?r.set(new Smart.Utilities.BigNumber(1).divide(r)):r}set(t){return t=new Smart.Utilities.BigNumber(t),this._d=t._d,this._f=t._f,this._s=t._s,this}compare(t){if(Smart.Utilities.BigNumber.bigIntSupport){const i=new Smart.Utilities.BigNumber(t)._d;return this._d===i?0:this._d>i?1:-1}let i=this.normalizeOperand(this);t=i.normalizeOperand(t);var e,r,n,s=i,a=i._f,l=new Smart.Utilities.BigNumber(t),_=l._f,u=[-1,1];if(s.isZero()&&l.isZero())return 0;if(s._s!=l._s)return s._s?-1:1;if(a!=_)return u[a>_^s._s];for(a=(n=s._d).length,_=(l=l._d).length,e=-1,r=Math.min(a,_);++e<r;)if(n[e]!=l[e])return u[n[e]>l[e]^s._s];return a!=_?u[a>_^s._s]:0}negate(){if(Smart.Utilities.BigNumber.bigIntSupport)return new Smart.Utilities.BigNumber(this._d*BigInt(-1));let t=this.normalizeOperand(this);var i=new Smart.Utilities.BigNumber(t);return i._s^=1,i}abs(){if(Smart.Utilities.BigNumber.bigIntSupport)return new Smart.Utilities.BigNumber(this._d<0?this._d*BigInt(-1):this._d);let t=this.normalizeOperand(this);var i=new Smart.Utilities.BigNumber(t);return i._s=0,i}intPart(){if(Smart.Utilities.BigNumber.bigIntSupport)return new Smart.Utilities.BigNumber(this._d);let t=this.normalizeOperand(this);return new Smart.Utilities.BigNumber((t._s?"-":"")+(t._d.slice(0,t._f).join("")||"0"))}valueOf(t,i){return this.normalizeOperand(this).toString(t,i)}toString(t,i,e){function r(t){var i,e,r=new Smart.Utilities.BigNumber(2),s=[];e=void 0===t?n:t;do{i=e.mod(r),s.push(i.toString()),e=e.subtract(i).divide(r).intPart()}while(1===e.compare(new Smart.Utilities.BigNumber(0)));return s.reverse().join("")}let n,s,a;if(Smart.Utilities.BigNumber.bigIntSupport?(n=this,s=Array.isArray(n._d)?(n._s?"-":"")+(n._d.slice(0,n._f).join("")||"0")+(n._f!=n._d.length?"."+n._d.slice(n._f).join(""):""):this._d.toString()):(n=this.normalizeOperand(this),s=(n._s?"-":"")+(n._d.slice(0,n._f).join("")||"0")+(n._f!=n._d.length?"."+n._d.slice(n._f).join(""):"")),void 0===t||10===t)return s;if(n.compare(0)>-1)switch(t){case 2:a=r(),e&&(a=a.padStart(i,"0"));break;case 8:a=function(t){for(var i="";t.length%3!=0;)t="0"+t;for(var e=t.length/3;e>=1;e--){var r=t[3*e-3]+""+t[3*e-2]+t[3*e-1];i=parseInt(r,2).toString(8)+""+i}return i}(r());break;case 16:a=function(t){for(var i="";t.length%4!=0;)t="0"+t;for(var e=t.length/4;e>=1;e--){var r=t[4*e-4]+""+t[4*e-3]+t[4*e-2]+t[4*e-1];i=parseInt(r,2).toString(16)+""+i}return i}(r()).toUpperCase(),e&&(a=a.padStart(i/4,"0"))}else a=function(t,i,e){var r="";for(String.prototype.repeat&&(t="0".repeat(e-t.length)+t);t.length<e;)t="0"+t;for(var n=!0,s="",a=(r=(r=(r=(r=t.replace(/0/g,"a")).replace(/1/g,"b")).replace(/a/g,"1")).replace(/b/g,"0")).length-1;a>=0;a--){var l;"0"===r.charAt(a)?!0===n?(l="1",n=!1):l="0":l=!0===n?"0":"1",s=l+""+s}switch(i){case 2:return s;case 8:var _,u;switch(e){case 8:_=3,u="0";break;case 16:_=6,u="00";break;case 32:_=11,u="0";break;case 64:_=22,u="00"}s=u+s;for(var o="",g=_;g>=1;g--){var m=s[3*g-3]+""+s[3*g-2]+s[3*g-1];o=parseInt(m,2).toString(8)+""+o}return o;case 16:var d;switch(e){case 8:d=2;break;case 16:d=4;break;case 32:d=8;break;case 64:d=16}for(var h="",f=d;f>=1;f--){var p=s[4*f-4]+""+s[4*f-3]+s[4*f-2]+s[4*f-1];h=parseInt(p,2).toString(16)+""+h}return h.toUpperCase()}}(r(n.negate()),t,i);return a}_zeroes(t,i,e){var r=["push","unshift"][e||0];for(++i;--i;t[r](0));return t}round(){if("_rounding"in this)return this;var t,i,e,r,n=Smart.Utilities.BigNumber,s=this.roundType,a=this._d;for(this._rounding=!0;this._f>1&&!a[0];--this._f,a.shift());for(t=this._f,e=a[i=this.precision+t];a.length>t&&!a[a.length-1];a.pop());return r=(this._s?"-":"")+(i-t?"0."+this._zeroes([],i-t-1).join(""):"")+1,a.length>i&&(e&&s!=n.DOWN&&(s==n.UP||(s==n.CEIL?!this._s:s==n.FLOOR?this._s:s==n.HALF_UP?e>=5:s==n.HALF_DOWN?e>5:s==n.HALF_EVEN&&(e>=5&&1&a[i-1])))&&this.add(r),a.splice(i,a.length-i)),delete this._rounding,this}isZero(){return 1===this._d.length&&0===this._d[0]}normalizeOperand(t){return t instanceof Smart.Utilities.BigNumber&&"bigint"==typeof t._d?new Smart.Utilities.BigNumber(t._d.toString()):t}})})();

/***/ }),

/***/ 9633:
/***/ (() => {

Smart("smart-multi-combo-input",class extends Smart.CheckInput{static get properties(){return{allowItemsAdd:{value:!1,type:"boolean"},allowItemsRemove:{value:!1,type:"boolean"},autoAddNewTags:{value:!0,type:"boolean"},colorItems:{value:!0,type:"boolean"},inputTagsMode:{allowedValues:["one","many"],value:"many",type:"string"},hideInputTagsCloseButton:{value:!1,type:"boolean"},messages:{value:{en:{newItem:"Find...",tagLabelOne:"{{value}} item selected",tagLabel:"{{value}} items selected",selectAll:"Select All",unselectAll:"Unselect All"}},type:"object",extend:!0},pills:{value:!1,type:"boolean"},dots:{value:!1,type:"boolean"},singleSelect:{value:!1,type:"boolean"},selectAll:{value:!1,type:"boolean"}}}template(){return'<div id="inputContainer" role="presentation"><div id="optionsContainer" inner-h-t-m-l=\'{{innerHTML}}\' class="smart-hidden"></div><div class="smart-action-button" role="presentation" id="actionButton"> <input class="smart-input" id=\'input\' readonly=\'[[readonly]]\' placeholder=\'[[placeholder]]\' type=\'[[type]]\' name=\'[[name]]\' disabled=\'[[disabled]]\' aria-label="[[placeholder]]" /></div><span class="smart-hidden smart-hint" id="span">[[hint]]</span><div id="dropDownButton" tabindex=-1 class="smart-drop-down-button" role="button" aria-label="Toggle popup"><div id="arrow" class="arrow" aria-hidden="true"></div></div></div>'}_downHandler(e){const t=this,o=e.originalEvent.target;t.readonly&&o&&o.classList&&!o.classList.contains("smart-drop-down-list-unselect-button")?t._dropDownButtonDownHandler(e):t._tokenCloseButtonClick!==o.closest(".smart-drop-down-list-unselect-button")&&(t._tokenCloseButtonClick=o.closest(".smart-drop-down-list-unselect-button"),t.readonly&&!t._tokenCloseButtonClick&&t._dropDownButtonDownHandler(e))}focus(){const e=this;e.readonly?HTMLElement.prototype.focus.apply(e,[]):e.$.input.focus()}_setFocusable(){const e=this;if(e.readonly){if(e.disabled||e.unfocusable)return void e.removeAttribute("tabindex");e.tabIndex=e.tabIndex>0?e.tabIndex:0,e.$.listen("keydown",e._keyDownHandler),e.$.listen("keyup",e._keyUpHandler)}}_documentUpHandler(e){const t=this,o=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if(o!==t&&o!==t.$.dropDownButton&&o!==t.$.input&&o!==t.$.arrow){if(t._tokenCloseButtonClick&&t._tokenCloseButtonClick===o.closest(".smart-drop-down-list-unselect-button")){const e=o.closest(".smart-token"),[l,n]=[e.getAttribute("data-label"),e.getAttribute("value")];let s,a,i=t._selectedItems.findIndex((e=>l===e.label&&n===e.value)),[r,d]=[t.value,t.$.input.dataValue];return-1===i&&l===n&&(i=t._selectedItems.findIndex((e=>l===e))),i>-1&&t._selectedItems.splice(i,1),t.set("value",a=t._selectedItems.map((e=>e.label)).join(t.separator)),t.$.input.dataValue=s=t._selectedItems.map((e=>e.value)).join(t.separator),t._updateValue(),t.$.actionButton.contains(e)&&t.$.actionButton.removeChild(e),t.close(),void(a===r&&s===d||(t.$.fireEvent("change",{value:s,label:a,oldValue:d,oldLabel:r}),t._updateTargetValue()))}if(!t.contains(o))if(t.$.dropDownContainer.contains(o.shadowParent||o)){if(t._isPointerDown){if(t._isPointerDown=!1,t.opened&&(t._preventLookup=!0),o.hasAttribute("add-new"))return;t.focus()}}else t.opened&&(t._preventLookup=!0),t._isPointerDown||t.close(),t._isPointerDown=!1}else t._isPointerDown=!1}get selectedItems(){return this._selectedItems?this._selectedItems:[]}set selectedItems(e){this._selectedItems=e,this._updateValue()}_performSelect(e,t){const o=this;if(!e)return void o.close();const l=e.target?e.target.closest("li"):e;if(!l)return;o._selectedItems||(o._selectedItems=[]),l.classList.toggle("selected"),o.singleSelect&&(o._selectedItems=[],l.classList.add("selected"));const n=l.classList.contains("selected"),s={label:l.getAttribute("data-label"),value:l.getAttribute("value"),color:l.getAttribute("color"),image:l.getAttribute("image")},a=o.$.menu.children;for(let e=0;e<a.length;e++)o.singleSelect&&a[e]!==l&&a[e].classList.remove("selected"),a[e].classList.remove("active"),a[e].setAttribute("aria-selected",!1);if(n){if(o.dataSource&&o.dataSource[0]&&"string"==typeof o.dataSource[0])o._selectedItems.push(s);else{const e=o.dataSource.findIndex((e=>e.label===s.label&&""+e.value===s.value));o.dataSource&&e>=0?o._selectedItems.push(o.dataSource[e]):o._selectedItems.push(s)}if(e.noActiveState||(o._setActiveDescendant(l),l.classList.add("active")),o.dataSource)if(o.dataSource[0]&&"string"==typeof o.dataSource[0]){const e=o.dataSource.findIndex((e=>e===s.label));o.set("selectedIndex",e)}else{const e=o.dataSource.findIndex((e=>e.label===s.label&&""+e.value===s.value));o.set("selectedIndex",e)}}else{if(o.dataSource&&o.dataSource[0]&&"string"==typeof o.dataSource[0]){const e=o.dataSource.findIndex((e=>e===s.label));if(e>-1){const e=o._selectedItems.findIndex((e=>e===s.label));o._selectedItems.splice(e,1),o.set("selectedIndex",-1)}else o.set("selectedIndex",e)}else{const e=o.dataSource.findIndex((e=>e.label===s.label&&""+e.value===s.value));if(o.dataSource)if(e>-1){const e=o._selectedItems.findIndex((e=>e.label===s.label&&""+e.value===s.value));o._selectedItems.splice(e,1),o.set("selectedIndex",-1)}else o.set("selectedIndex",e)}l.classList.remove("active")}l.setAttribute("aria-selected",n),o._updateValue(t),o.singleSelect&&o.close()}_updateValue(e){const t=this;if(!t.isInitialized)return;let o=t._selectedItems,l=t.value,n=t.$.input.dataValue,[s,a]=[[],[]];o||(o=[]);for(let e=0;e<o.length;e++){const t=o[e];t?"string"==typeof t?(s.push(t),a.push(t)):(s.push(t.label),a.push(t.value)):(s.push(""),a.push(""))}t._createTags();let i=[];for(let e=0;e<o.length;e++){const t=o[e];"string"==typeof t?i.push(t):void 0!==t.value&&i.push(t.value)}if(t.set("selectedValues",i),s=s.join(t.separator),t.set("value",s),t.$.input.dataValue=a=a.join(t.separator),t.$.input.value="",t.setAttribute("value",t.value),e||s===l&&a===n||(t.$.fireEvent("change",{value:a,label:s,oldValue:n,oldLabel:l}),t._updateTargetValue()),t.selectAll&&t._setSelectAllItemState(),!t.opened)return;const r=t.getBoundingClientRect(),d=window.scrollX,c=window.scrollY;t.$.dropDownContainer.style.left=-3+r.left+d+"px",t.$.dropDownContainer.style.top=r.bottom+c+1+"px",t._reposition()}_setSelection(){const e=this;super._setSelection(),e.singleSelect&&(e._selectedItems.length>0&&(e._selectedItems=[e._selectedItems[e._selectedItems.length-1]]),e.selectedValues.length>0&&(e.selectedValues=[e.selectedValues[e.selectedValues.length-1]])),this._createTags()}_createTags(){const e=this,t=e._selectedItems||[];let o,l=document.createDocumentFragment();const n=document.createElement("div");n.classList.add("smart-flex-wrap"),n.classList.add("smart-tokens-container"),l.appendChild(n);const s=e.$.actionButton.querySelector(".smart-tokens-container");if(s&&s.remove(),0===t.length&&"one"===e.inputTagsMode&&e.readonly){const l="one"===e.inputTagsMode?t.length>1?e.localize("tagLabel",{value:t.length,count:e.dataSource.length}):e.localize("tagLabelOne",{value:t.length,count:e.dataSource.length}):"";o=document.createElement("span"),o.classList.add("smart-token");const s=e.dots?" dots":"";o.innerHTML="<span class='smart-drop-down-list-selection-label "+s+'\' role="presentation">'+l+"</span>",n.appendChild(o)}for(let l=0;l<t.length;l++){const s=t[l];if("one"===e.inputTagsMode&&!o||"many"===e.inputTagsMode){let l="one"===e.inputTagsMode?t.length>1?e.localize("tagLabel",{value:t.length,count:e.dataSource.length}):e.localize("tagLabelOne",{value:t.length,count:e.dataSource.length}):"string"==typeof s?s:s.label;"many"===e.inputTagsMode&&void 0===l&&(l=""),o=document.createElement("span"),o.classList.add("smart-token");let a=null,i="";s.image&&"many"===e.inputTagsMode&&(a=document.createElement("span"),a.style.backgroundImage=`url('${s.image}')`,a.className="smart-drop-down-list-selection-image",i=a.outerHTML);const r=e.dots?" dots":"";if(o.innerHTML=i+"<span class='smart-drop-down-list-selection-label"+r+'\' role="presentation">'+l+"</span>",e.singleSelect||"one"===e.inputTagsMode||e.hideInputTagsCloseButton||(o.innerHTML+='<span class=\'smart-drop-down-list-unselect-button\' role="button" aria-label="Unselect"></span>'),"many"===e.inputTagsMode){s.label?(o.setAttribute("data-label",s.label),o.setAttribute("value",s.value)):"string"==typeof s&&s.length>0?(o.setAttribute("data-label",s),o.setAttribute("value",s)):(o.setAttribute("data-label",""),o.setAttribute("value","")),o.setAttribute("separator",e.separator);const t=s.color;if(t&&e.colorItems){o.setAttribute("color",t),o.style.setProperty("--smart-primary",t);const e=new Smart.Color(t).getInvertedColor();o.style.setProperty("--smart-primary-color",e)}}if(""===l&&e.singleSelect)continue;n.appendChild(o)}}e.$.actionButton.insertBefore(l,e.$.input);const a=e.getBoundingClientRect(),i=window.scrollX,r=window.scrollY;e.$.scrollView.style.left=-3+a.left+i+"px",e.$.scrollView.style.top=a.bottom+r+1+"px"}_render(e){const t=this,o=(e,o)=>{let l=e,n=e,s=e,a=null;"object"==typeof e&&(l=e.label,n=void 0!==e.value?e.value:l,a=void 0!==e.color?e.color:"",s=void 0!==e.id?e.id:o);const i=document.createElement("li"),r=document.createElement("a");if(r.href="javascript:void(0)",i.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),i.setAttribute("data-label",l),i.setAttribute("value",n),i.setAttribute("role","option"),i.setAttribute("aria-selected",!1),i.setAttribute("aria-label",l),void 0!==s&&(i.id=s),a&&t.colorItems){i.setAttribute("color",a),i.style.setProperty("--smart-primary",a);const e=new Smart.Color(a).getInvertedColor();i.style.setProperty("--smart-primary-color",e)}if(r.innerHTML=t.highlighter?t.highlighter(l):t._highlighter(l),l||r.classList.add("smart-visibility-hidden"),r.setAttribute("aria-hidden",!0),e.icon&&(r.classList.add("icon"),r.classList.add(e.icon)),e.image){const t=document.createElement("span");t.style.backgroundImage=`url('${e.image}')`,t.className="smart-drop-down-list-selection-image",i.setAttribute("image",e.image),r.innerHTML=t.outerHTML+r.innerHTML}if(i.appendChild(r),t.allowItemsRemove){const o=document.createElement("span");o.classList.add("close-button"),e.image||(r.innerHTML="<span data-content>"+r.innerHTML+"</span>"),r.appendChild(o),o.onpointerdown=o=>{o.preventDefault(),o.stopPropagation();const s=t.dataSource.findIndex((t=>t.value===e.value));if(s>=0){if(t.dataSource.splice(s,1),i.remove(),t.$.scrollView.refresh&&t.$.scrollView.refresh(),"one"===t.inputTagsMode){const e=t._selectedItems.findIndex((e=>e.label===l&&e.value===n));e>=0&&t._selectedItems.splice(e,1),t._createTags()}t.$.fireEvent("remove",{index:s,label:e.label,value:e.value})}}}return(t.singleSelect&&""===e||t.singleSelect&&e&&""===e.label)&&(i.innerHTML=""),i},l=e.map((function(e,t){return o(e,t)}));delete t._customItem,t.$.menu.innerHTML="",0===l.length&&t.dropDownPlaceholder&&(t.$.menu.innerHTML='<div class="smart-flex smart-truncate smart-quiet" style="padding:10px; align-items: center;">'+t.dropDownPlaceholder+"</div>"),t._selectedItems||(t._selectedItems=[]);let n=t._selectedItems.map((e=>"string"==typeof e?e:e.value));n.length||(n=(t.$.input.dataValue||t.$.input.value).split(t.separator).map((e=>e.trim())));let s=Array.from(t.$.actionButton.getElementsByClassName("smart-token")).map((e=>e.textContent.trim()));if(t.allowItemsAdd){const e=document.createElement("div"),n=document.createElement("smart-button"),s=document.createElement("input");e.classList.add("add-new-item"),n.setAttribute("add-new",""),s.setAttribute("add-new",""),s.placeholder=t.localize("newItem"),s.classList.add("smart-input"),n.classList.add("smart-hidden");const a=()=>{const e=["#D50000","#F4511E","#F6BF26","#0B8043","#33B679","#3F51B5","#039BE5","#7986CB","#8C47FF","#8E24AA","#FF36C2","#949494","#FF9EB7","#FFCFC9","#FFD66D","#FFEBB6","#93DF89","#D1F7C4","#9DC7FF","#D0F0FD","#CDAFFF","#ECE1FD","#FA9DE2","#FFDAF6","#CBCBCB","#EDEDED","#000000"];return{label:s.value,value:s.value.trim().replace(/ /gi,""),color:e[Math.floor(Math.random()*e.length)]}},i=e=>{e.preventDefault(),e.stopPropagation(),t.dataSource||(t.dataSource=[]);const o=t.$.menu.querySelector(".active");if(!o&&t._customItem&&t._customItem.item||o&&!o.offsetHeight&&t._customItem&&t._customItem.item||o&&o.classList.contains("smart-custom-item")){const e=t._customItem.item;t.dataSource.push(e),t.$.scrollView.refresh&&t.$.scrollView.refresh(),t._selectedItems=[],t._selectedItems.push(e),t._updateValue(!0),t.$.fireEvent("add",{label:e.label,value:e.value,index:t.dataSource.length-1}),s.value="",t.close()}else o&&o.offsetHeight&&t._keyUpHandler(e)},r=()=>{const e=s.value.toLowerCase();t._visibleItems=[];let n=null,r=0;for(let o=0;o<l.length;o++){const s=l[o];s.getAttribute("data-label").trim().toLowerCase().indexOf(e)>=0?(s.classList.remove("smart-hidden"),t._visibleItems.push(s.getAttribute("data-value")),n=s):(s.classList.add("smart-hidden"),r++),s.classList.remove("focused"),s.classList.remove("active")}if(e.length&&r===l.length){if(t._customItem){let o=e;if(14*o.length*.52>t.$.menu.offsetWidth-40){let e=parseInt((t.$.menu.offsetWidth-40)/7.28);o.length>e&&(o=o.substring(0,e)+"...")}t._customItem.classList.remove("smart-hidden"),t._customItem.classList.add("smart-custom-item"),t._customItem.firstElementChild.textContent=o,t._customItem.item.label=t._customItem.item.value=e}else{const e=a(),l=o(e,t.dataSource.length-1);t.$.menu.appendChild(l),l.classList.add("smart-custom-item"),t._customItem=l,l.item=e,l.onpointerdown=e=>{i(e)}}n&&(n.classList.add("focused"),n.classList.add("active")),t.$.scrollView.refresh&&t.$.scrollView.refresh()}t.$.scrollView.refresh&&t.$.scrollView.refresh()};s.oninput=()=>{r()},n.onclick=()=>{if(!s.value)return;t.dataSource||(t.dataSource=[]);const e=a();t.dataSource.push(e);const l=o(e,t.dataSource.length-1);t.$.menu.appendChild(l),t.$.scrollView.refresh&&t.$.scrollView.refresh(),s.value="","one"===t.inputTagsMode&&t._createTags(),t.$.fireEvent("add",{label:e.label,value:e.value,index:t.dataSource.length-1})},s.onkeydown=e=>{"Enter"===e.key&&i(e),"Escape"===e.key&&t.close(),"ArrowUp"!==e.key&&"ArrowDown"!==e.key||(t._keyDownHandler(e),e.preventDefault(),e.stopPropagation())},e.appendChild(s),e.appendChild(n),t.$.menu.appendChild(e),t.$.menu.setAttribute("allow-add-new","")}for(let e=0;e<l.length;e++){const o=l[e],a=o.getAttribute("value"),i=o.getAttribute("data-label").trim(),r=n.findIndex((e=>""+e==""+a));r>-1&&("one"===t.inputTagsMode||s[r]&&"string"==typeof s[r]&&s[r].trim()===i)&&(o.classList.add("selected"),o.setAttribute("aria-selected",!0),t._setActiveDescendant(o),t._selectedItems.findIndex((e=>"string"==typeof e?e===i:e.label===i&&e.value===a))<0&&t._selectedItems.findIndex((e=>"string"==typeof e?e===a:""+e.value==""+a))<0&&t._selectedItems.push({label:o.getAttribute("data-label"),value:o.getAttribute("value")})),t._setSelectAllItemState(),t.$.menu.appendChild(o)}}_next(){const e=this;let t=e._selectedItems?e._selectedItems[e._selectedItems.length-1]:void 0;t&&(t=e.$.menu.querySelector(`.active[data-label="${t.label}"][value="${t.value}"]`));const o=t||e.$.menu.querySelector(".active");if(!o){let t=e.$.menu.firstElementChild;for(;t&&(!t.offsetHeight||t.classList.contains("add-new-item"));)t=t.nextElementSibling;return t.classList.add("active","focused"),void e._setActiveDescendant(t)}const l=e.$.menu.children;for(let e=0;e<l.length;e++)l[e].classList.remove("active","focused");e._setActiveDescendant();let n=o.nextElementSibling;for(;n&&(!n.offsetHeight||n.classList.contains("add-new-item"));)n=n.nextElementSibling;if(!n)for(n=e.$.menu.firstElementChild;n&&(!n.offsetHeight||n.classList.contains("add-new-item"));)n=n.nextElementSibling;n.classList.add("active","focused"),e._setActiveDescendant(n),e.ensureVisible()}_prev(){const e=this;let t=e._selectedItems?e._selectedItems[e._selectedItems.length-1]:void 0;t&&(t=e.$.menu.querySelector(`.active[data-label="${t.label}"][value="${t.value}"]`));const o=t||e.$.menu.querySelector(".active");if(!o){let t=e.$.menu.firstElementChild;for(;t&&(!t.offsetHeight||t.classList.contains("add-new-item"));)t=t.nextElementSibling;return t.classList.add("active","focused"),void e._setActiveDescendant(t)}const l=e.$.menu.children;for(let e=0;e<l.length;e++)l[e].classList.remove("active","focused");e._setActiveDescendant();let n=o.previousElementSibling;for(;n&&(!n.offsetHeight||n.classList.contains("add-new-item"));)n=n.previousElementSibling;n||(n=e.$.menu.lastElementChild),n.classList.add("active","focused"),e._setActiveDescendant(n),e.ensureVisible()}_keyDownHandler(e){const t=this;if(t._suppressKeyPressRepeat=![40,38,9,13,27,16,17,18].includes(e.keyCode),e.shiftKey||e.altKey||e.ctrlKey)delete t._inputValue;else{if(t.opened&&"Escape"===e.key)return t.close(),e.stopPropagation(),void e.preventDefault();t._move(e),t._inputValue=t.$.input.value}}_keyUpHandler(e){const t=this;let o=t.$.input.value;if(t._selectedItems&&(o=t._selectedItems.map((e=>"string"==typeof e?e:e.label)),t.$.input.value&&o.push(t.$.input.value),o=o.join(t.separator)),t.set("value",o),!e.shiftKey&&"F2"!==e.key)if(","!==e.key){switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 8:{if(t.readonly)break;if(t.opened&&t.close(),t._inputValue&&t._inputValue.length)break;if(!t._selectedItems){t.readonly||(t.$.input.dataValue=t.$.input.value);break}const e=t._selectedItems[t._selectedItems.length-1];if(!e)break;(t.$.menu.querySelector(`li[data-label="${e.label}"][value="${e.value}"]`)||0===t.$.menu.offsetHeight)&&(t._selectedItems.pop(),t._updateValue());break}case 9:case 13:if(!t.opened)return void(t.autoAddNewTags&&13===e.keyCode&&"many"===t.inputTagsMode&&t._autoCreateTags());t._performSelect(t.$.menu.querySelector(".active")),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault())}delete t._inputValue}else t._autoCreateTags()}_blurHandler(){super._blurHandler(),this._autoCreateTags()}_autoCreateTags(){const e=this;if(!e.autoAddNewTags||"many"===!e.inputTagsMode)return;e.dataSource||(e.dataSource=[]);const t=e.$.input.value.trim();if(!e.dataSource.find((e=>"string"==typeof e?e===t:e.label===t))){e._tempItems||(e._tempItems=[]);let o=t.trim();if(t.indexOf(",")>=0){o=t.split(",");for(let t=0;t<o.length;t++){const l=o[t].trim();""!==l&&(e._tempItems.push(l),e._createTagsFromValue(l))}}else""!==o&&(e._tempItems.push(o),e._createTagsFromValue(o));e.query="",e._updateValue(!0)}}propertyChangedHandler(e,t,o){const l=this;if("disabled"===e&&l._setFocusable(),"value"===e){l.displayMember!==l.valueMember&&"string"!=typeof o?(l.value=o[l.displayMember],l.$.input.dataValue=o[l.valueMember]):l.$.input.dataValue="";const e=l.$.menu.children;for(let t=0;t<e.length;t++)e[t].classList.remove("selected"),e[t].setAttribute("aria-selected",!1);l._setActiveDescendant(l.$.menu.querySelector("active")),l._createTagsFromValue(o)}else if("separator"===e){const e=l.$.actionButton.children;for(let t=0;t<e.length;t++){const l=e[t];l.classList.contains("smart-token")&&l.setAttribute("separator",o)}}else if("inputTagsMode"===e)l._createTags();else if("theme"===e||"rightToLeft"===e)l.$.scrollView[e]=o,o?l.$.dropDownContainer.setAttribute(Smart.Utilities.Core.toDash(e),""):l.$.dropDownContainer.removeAttribute(Smart.Utilities.Core.toDash(e));else if("inverted"===e)o?l.$.dropDownContainer.setAttribute("inverted",""):l.$.dropDownContainer.removeAttribute("inverted");else if("selectAll"===e)l._handleSelectAllItem();else if("selectedIndex"===e){if(super.propertyChangedHandler(e,t,o),l._selectedItems=[],l.dataSource){const e=l.dataSource[o];e&&l._selectedItems.push(e),l._updateValue(!0)}}else if("selectedValues"===e){if(super.propertyChangedHandler(e,t,o),l.dataSource){l._selectedItems=[];const e=l.dataSource.filter((e=>{if("string"==typeof e){if(l.selectedValues.indexOf(e)>=0)return!0}else if(l.selectedValues.indexOf(e.value)>=0)return!0}));l._selectedItems=e,l._updateValue(!0)}}else super.propertyChangedHandler(e,t,o)}_createElement(){const e=this,t=document.createElement("ul"),o=document.createElement("smart-scroll-viewer"),l=document.createElement("div");if(o.rightToLeft=e.rightToLeft,o.theme=e.theme,o.horizontalScrollBarVisibility="hidden",o.classList.add("smart-multi-combo-input-scroll-viewer"),e.rightToLeft&&l.setAttribute("right-to-left",""),e.dataSource&&"string"==typeof e.dataSource&&(e.dataSource=e.$.deserialize(e.dataSource,"array")),l.setAttribute("theme",e.theme),l.classList.add("smart-multi-combo-input-drop-down-menu","smart-input-drop-down-menu","smart-check-input-drop-down-menu"),e.pills&&l.setAttribute("pills",""),e.dots&&l.setAttribute("dots",""),e.singleSelect&&l.setAttribute("single-select",""),e.inverted?l.setAttribute("inverted",""):l.removeAttribute("inverted"),e.classList.add("smart-input"),l.appendChild(o),t.setAttribute("aria-multiselectable",!0),e.$.scrollView=o,e.$.menu=t,e.$.dropDownContainer=l,e.$.menu.onpointerdown=function(t){const o=t.target.closest("li");t.target&&t.target.hasAttribute("add-new")||(t.stopPropagation(),t.preventDefault(),e._performSelect(t),o&&e.$.fireEvent("itemClick",{index:[...o.parentNode.children].indexOf(o),item:o,label:o.getAttribute("aria-label"),value:o.dataValue}),e.focus())},e.classList.add("smart-input"),e.$.input.value="",e.selectedValues&&e.selectedValues.length>0){const t=e.dataSource.filter((t=>{if("string"==typeof t){if(e.selectedValues.indexOf(t)>=0)return!0}else if(e.selectedValues.indexOf(t.value)>=0)return!0}));e.selectedItems=t}else{const t=e.value;t&&e._createTagsFromValue(t)}e.readonly?e.$.input.classList.add("smart-hidden"):e.$.input.classList.remove("smart-hidden"),e._handleSelectAllItem(),e._setFocusable()}_createTagsFromValue(e=""){const t=this;if(e){const e=t.value.split(",");for(t.$.input.value="",t._selectedItems=[];"SPAN"===t.$.actionButton.firstElementChild.nodeName;)t.$.actionButton.removeChild(t.$.actionButton.firstElementChild);for(let o=0,l=e.length;o<l;o+=1){const l=e[o].trim();if(l)if(t.dataSource){const e=t.dataSource.find((e=>{if("string"==typeof e){if(e===l)return e}else if(""+e.value===l)return e}));e&&e.label?e.color?t._selectedItems.push({color:e.color,label:e.label,value:e.value}):t._selectedItems.push({label:e.label,value:e.value}):t._selectedItems.push({label:l,value:l})}else t._selectedItems.push({label:l,value:l})}t._createTags()}else t.$.input.value="",t._selectedItems=[],t._createTags()}_handleSelectAllItem(){const e=this;if(e.selectAll){if(!e.$.selectAll){const t=document.createElement("ul"),o=document.createElement("li"),l=document.createElement("a");l.href="#",l.innerHTML=e.localize("selectAll"),l.setAttribute("aria-hidden",!0),o.id=e.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),o.setAttribute("role","option"),o.setAttribute("value",e.localize("selectAll")),o.setAttribute("aria-label",e.localize("selectAll")),o.classList.add("smart-select-all"),o.appendChild(l),o.onclick=function(t){t.stopPropagation(),t.preventDefault(),Array.from(e.$.menu.children).find((e=>!e.classList.contains("selected")))?e._selectAll():e._clearSelection(),e._setSelectAllItemState(),o.classList.contains("selected")&&o.classList.add("active"),e.focus()},t.appendChild(o),e.$.selectAll=t}e._setSelectAllItemState(),e.$.dropDownContainer.insertBefore(e.$.selectAll,e.$.scrollView)}else e.$.selectAll&&e.$.selectAll.remove()}_setSelectAllItemState(){const e=this;if(!e.$.selectAll)return;const t=e.$.selectAll.firstElementChild,o=t.firstElementChild,l=!Array.from(e.$.menu.children).find((e=>!e.classList.contains("selected")));t.removeAttribute("indeterminate"),t.classList.remove("selected","active"),o.innerHTML=e.localize("selectAll"),e._selectedItems&&e._selectedItems.length>0&&(l?(t.classList.add("selected"),o.innerHTML=e.localize("unselectAll")):t.setAttribute("indeterminate",""))}_selectAll(){const e=this,t=e._selectedItems.length,o=e.$.input.dataValue,l=e.value;e._clearSelection(!0);const n=e.$.menu.children;for(let t=0;t<n.length;t++)n[t].classList.contains("selected")||e._performSelect({target:n[t],noActiveState:!0},!0);t!==e._selectedItems.length&&(e.$.fireEvent("change",{value:e.$.input.dataValue,label:e.value,oldValue:o,oldLabel:l}),e._updateTargetValue())}_clearSelection(e){const t=this;if(!t._selectedItems.length)return;const o=t.$.input.dataValue,l=t.value;for(t.$.input.dataValue="",t.value=t.$.input.value,t._selectedItems=[];"SPAN"===t.$.actionButton.firstElementChild.nodeName;)t.$.actionButton.removeChild(t.$.actionButton.firstElementChild);const n=t.$.menu.children;for(let e=0;e<n.length;e++)n[e].classList.remove("selected"),n[e].classList.remove("active"),n[e].setAttribute("aria-selected",!1);t._setActiveDescendant(t.$.menu.querySelector("active")),e||(t.$.fireEvent("change",{value:"",label:"",oldValue:o,oldLabel:l}),t._updateTargetValue());const s=t.getBoundingClientRect(),a=window.scrollX,i=window.scrollY;t.$.dropDownContainer.style.left=-3+s.left+a+"px",t.$.dropDownContainer.style.top=s.bottom+i+1+"px",t._reposition()}_reposition(){const e=this,t=e.getBoundingClientRect();e.getBoundingClientRect();let o=0,l=0;if("static"!==getComputedStyle(document.body).position){const e=document.body.getBoundingClientRect();o=e.left,l=e.top}if(!e.opening){const n=window.scrollX,s=window.scrollY;e.$.dropDownContainer.style.left=-3+t.left+n-o+"px","bottom"===e.dropDownOpenPosition?e.$.dropDownContainer.style.top=t.bottom+s-l+1+"px":"top"===e.dropDownOpenPosition?e.$.dropDownContainer.style.top=t.top-e.$.dropDownContainer.offsetHeight+s-l+1+"px":"auto"===e.dropDownOpenPosition&&(e.$.dropDownContainer.removeAttribute("top"),e.$.dropDownContainer.style.top=t.bottom+s-l+1+"px",window.innerHeight<parseInt(e.$.dropDownContainer.style.top)+e.$.dropDownContainer.offsetHeight-s?(e.$.dropDownContainer.style.top=t.top-e.$.dropDownContainer.offsetHeight+s-l+1+"px",e.$.dropDownContainer.setAttribute("top","")):e.$.dropDownContainer.style.top=t.bottom+s-l+1+"px")}}_open(){const e=this;let t=e.getBoundingClientRect(),o=window.scrollX,l=window.scrollY,n=0,s=0;if(!this.opened&&e.parentNode&&!e._preventOpen){if(e.timer&&clearTimeout(e.timer),e.$.scrollView.classList.remove("smart-input-drop-down-menu"),e.$.dropDownContainer.id=e.id+"_"+e.tagName.toLowerCase()+"_menu_"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),document.body.appendChild(e.$.dropDownContainer),e.setAttribute("aria-owns",e.$.dropDownContainer.id),e.readonly||e.$.input.setAttribute("aria-controls",e.$.dropDownContainer.id),e.$.scrollView.enableShadowDOM&&!e._importedStyle&&(e.$.scrollView.importStyle(e._getStyleUrl("smart.textbox.css")),e._importedStyle=!0),"static"!==getComputedStyle(document.body).position){const e=document.body.getBoundingClientRect();n=e.left,s=e.top}if(e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.dropDownContainer.style.left=-3+t.left+o-n+"px",e.$.dropDownContainer.style.top=t.bottom+l-s+1+"px",e.$.dropDownContainer.classList.remove("open"),"bottom"===e.dropDownOpenPosition)e.$.dropDownContainer.style.top=t.bottom+l-s+1+"px";else if("top"===e.dropDownOpenPosition)e.$.dropDownContainer.style.top=t.top-e.$.dropDownContainer.offsetHeight+l-s-2+"px",e.$.dropDownContainer.setAttribute("top","");else if("auto"===e.dropDownOpenPosition)if(e.$.dropDownContainer.removeAttribute("top"),window.innerHeight<parseInt(e.$.dropDownContainer.style.top)+e.$.dropDownContainer.offsetHeight-l+16){const o=t.top-e.$.dropDownContainer.offsetHeight+l-s-2;o>=0&&(e.$.dropDownContainer.style.top=o+"px",e.$.dropDownContainer.setAttribute("top",""))}else e.$.dropDownContainer.style.top=t.bottom+l-s+1+"px";e._positionTimer&&clearInterval(e._positionTimer),e.dropDownAppendTo||(e._positionTimer=setInterval((()=>{const o=e.getBoundingClientRect();if(e.opening)e.opening=!1,t=o;else if(Math.abs(parseInt(o.top)-parseInt(t.top))>=10||Math.abs(parseInt(o.left)-parseInt(t.left))>=10){const t=window.scrollX,l=window.scrollY;return e.$.dropDownContainer.style.left=-3+o.left+t-n+"px",void("bottom"===e.dropDownOpenPosition?e.$.dropDownContainer.style.top=o.bottom+l-s+1+"px":"top"===e.dropDownOpenPosition?e.$.dropDownContainer.style.top=o.top-e.$.dropDownContainer.offsetHeight+l-s+1+"px":"auto"===e.dropDownOpenPosition&&(e.$.dropDownContainer.removeAttribute("top"),e.$.dropDownContainer.style.top=o.bottom+l-s+1+"px",window.innerHeight<parseInt(e.$.dropDownContainer.style.top)+e.$.dropDownContainer.offsetHeight-l?(e.$.dropDownContainer.style.top=o.top-e.$.dropDownContainer.offsetHeight+l-s+1+"px",e.$.dropDownContainer.setAttribute("top","")):e.$.dropDownContainer.style.top=o.bottom+l-s+1+"px"))}}),50)),e.$.dropDownContainer.onpointerdown=function(){e._isPointerDown=!0},requestAnimationFrame((function(){const t=e.dropDownWidth;if(e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.$.dropDownContainer.setAttribute("open",""),e.setAttribute("open",""),e.$.dropDownButton.setAttribute("open",""),e.$.input.setAttribute("open",""),t&&"string"==typeof t&&-1!==t.indexOf("%")){const o=parseFloat(t)/100;e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",e.offsetWidth*o+"px")}else if("auto"!==t&&t)e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",parseFloat(t)+"px");else if("auto"===t){if(e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",""),e.$.scrollView.$.scrollViewerContainer.classList.contains("vscroll")){const t=e.$.scrollView.offsetWidth+parseFloat(getComputedStyle(e.$.scrollView).getPropertyValue("--smart-scroll-bar-size"));e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",t+"px")}}else{e.$.menu.style.width="auto";let t=e.$.menu.offsetWidth;const o=e.$.menu.querySelectorAll("li");for(let t=0;t<o.length;t++)e._maxDropDownWidth=Math.max((o[t].firstElementChild||o[t]).offsetWidth,e._maxDropDownWidth);e.$.scrollView.computedVerticalScrollBarVisibility&&(t+=e.$.scrollView.$&&e.$.scrollView.$.verticalScrollBar?e.$.scrollView.$.verticalScrollBar.offsetWidth:30),e.$.dropDownContainer.style.setProperty("--smart-input-drop-down-menu-width",Math.max(t,e.offsetWidth-8)+"px"),e.$.menu.style.width=""}(e.shadowRoot||e.isInShadowDOM)&&e.$.scrollView._scrollView&&Smart.ScrollBar&&requestAnimationFrame((()=>e.$.scrollView._scrollView.vScrollBar.refresh()))})),e.$.scrollView.refresh&&e.$.scrollView.refresh(),e._refreshMenu(),e.allowItemsAdd&&setTimeout((()=>{e.$.scrollView.querySelector("input").focus()}),100),this.opened=!0,e.setAttribute("aria-expanded",!0)}}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e._positionTimer&&clearInterval(e._positionTimer),e.timer=setTimeout((function(){e.$.dropDownContainer.parentNode&&!e.opened&&(document.body.removeChild(e.$.dropDownContainer),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e.$.dropDownContainer.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.opened=!1,e.setAttribute("aria-expanded",!1),e.focus(),e.$.fireEvent("close"),!0)}});

/***/ }),

/***/ 9264:
/***/ (() => {

Smart("smart-multi-input",class extends Smart.Input{static get properties(){return{dropDownButtonPosition:{allowedValues:["none","left","right"],defaultReflectToAttribute:!0,value:"right",type:"string"},separator:{value:", ",type:"string"},selectedValues:{value:[],type:"array"}}}_performSelect(e){const t=this;if(!e)return void t.close();const a=e.target?e.target.closest("li"):e;if(!a)return;t._selectedItems||(t._selectedItems=[]),a.classList.toggle("active");const l=a.classList.contains("active"),s={label:a.getAttribute("data-label"),value:a.getAttribute("value")};if(l)t._selectedItems.push(s),a.setAttribute("aria-selected",!0),t._setActiveDescendant(a);else{const e=t._selectedItems.findIndex((e=>e.label===s.label&&e.value===s.value));e>-1&&t._selectedItems.splice(e,1),a.setAttribute("aria-selected",!1)}a.setAttribute("aria-selected",l);const i=t._selectedItems,r=t.value,n=t.$.input.dataValue;let[o,u]=[[],[]];for(let e=0;e<i.length;e++){const t=i[e];o.push(t.label),u.push(t.value)}t.set("selectedValues",i.map((e=>e.value))),o=o.join(t.separator),t.set("value",o),t.$.input.dataValue=u=u.join(t.separator),o===r&&u===n||(t.$.fireEvent("change",{value:u,label:o,oldValue:n,oldLabel:r}),t._updateTargetValue())}close(){const e=this;return!!e.opened&&(e.timer&&clearTimeout(e.timer),e.timer=setTimeout((function(){e.$.scrollView.parentNode&&!e.opened&&(e.$.scrollView.remove(),e.removeAttribute("aria-owns"),e.readonly||e.$.input.removeAttribute("aria-controls"))}),1e3),e.$.scrollView.removeAttribute("open"),e.$.dropDownButton.removeAttribute("open"),e.$.input.removeAttribute("open"),e.removeAttribute("open"),e.opened=!1,e.setAttribute("aria-expanded",!1),e.$.input.focus(),!0)}open(){const e=this;let t;if(e.dropDownDataSource?(e.query="",t="function"==typeof e.dataSource?e.dataSource(e.query):e.dataSource):t="function"==typeof e.dropDownDataSource?e.dropDownDataSource(e.query):e.dropDownDataSource,e._tempItems){t=JSON.parse(JSON.stringify(t));for(let a=0;a<e._tempItems.length;a++){const l=e._tempItems[a];-1===t.indexOf(l)&&t.push(l)}}e._process(t),e.ensureVisible(),e.$.input.focus(),setTimeout((function(){e.$.input.focus()}),25)}_render(e){const t=this,a=e.map((function(e){let a=e,l=e;"object"==typeof e&&(a=e.label,l=void 0!==e.value?e.value:a);const s=document.createElement("li"),i=document.createElement("a");return i.href="#",s.id=t.id+"Item"+Math.floor(65536*(1+Math.random())).toString(16).substring(1),s.setAttribute("data-label",a),s.setAttribute("value",l),s.setAttribute("role","option"),s.setAttribute("aria-selected",!1),s.setAttribute("aria-label",a),void 0!==e.menuLabel&&(a=e.menuLabel),i.innerHTML=t.highlighter?t.highlighter(a):t._highlighter(a),i.setAttribute("aria-hidden",!0),e.icon&&(i.classList.add("icon"),i.classList.add(e.icon)),s.appendChild(i),s}));t.$.menu.innerHTML="";let l=[],s=[],i=t._selectedItems;i||(i=t._selectedItems=[]);const r=i.length;i.length&&i.forEach((e=>{s.push(e.label),l.push(e.value)})),l=l.concat((t.$.input.dataValue||t.$.input.value).split(",").map((e=>e.trim()))),s=s.concat(t.$.input.value.split(",").map((e=>e.trim())));for(let e=0;e<a.length;e++){const n=a[e],o=n.getAttribute("value"),u=n.getAttribute("data-label"),c=r?l.indexOf(o):s.indexOf(u);c>-1&&s[c]===u&&(n.classList.add("active"),n.setAttribute("aria-selected",!0),t._setActiveDescendant(n),i.findIndex((e=>e.label===u&&e.value===o))<0&&i.push({label:n.getAttribute("data-label"),value:n.getAttribute("value")})),t.$.menu.appendChild(n)}t.set("selectedValues",i.map((e=>e.value)))}_next(){const e=this;let t=e._selectedItems?e._selectedItems[e._selectedItems.length-1]:void 0;t&&(t=e.$.menu.querySelector(`.active[data-label="${t.label}"][value="${t.value}"]`));const a=t||e.$.menu.querySelector(".active");if(!a){const t=e.$.menu.firstElementChild;return void e._performSelect(t)}e._selectedItems&&(e._selectedItems=[]);const l=e.$.menu.children;for(let e=0;e<l.length;e++)l[e].classList.remove("active"),l[e].setAttribute("aria-selected",!1);e._setActiveDescendant();let s=a.nextElementSibling;s||(s=e.$.menu.firstElementChild),e._performSelect(s),e.ensureVisible()}_prev(){const e=this;let t=e._selectedItems?e._selectedItems[e._selectedItems.length-1]:void 0;t&&(t=e.$.menu.querySelector(`.active[data-label="${t.label}"][value="${t.value}"]`));const a=t||e.$.menu.querySelector(".active");if(!a){const t=e.$.menu.firstElementChild;return void e._performSelect(t)}e._selectedItems&&(e._selectedItems=[]);const l=e.$.menu.children;for(let e=0;e<l.length;e++)l[e].classList.remove("active"),l[e].setAttribute("aria-selected",!1);e._setActiveDescendant();let s=a.previousElementSibling;s||(s=e.$.menu.lastElementChild),e._performSelect(s),e.ensureVisible()}_keyUpHandler(e){const t=this;if(!e.shiftKey)switch(e.keyCode){case 40:case 38:case 16:case 17:case 18:40===e.keyCode&&e.altKey&&t.open(),38===e.keyCode&&e.altKey&&t.close();break;case 9:case 13:if(!t.opened)return;t._performSelect(),e.stopPropagation(),e.preventDefault();break;case 27:if(!t.opened)return;t.close(),e.stopPropagation(),e.preventDefault();break;default:t._lookup(e),!t.opened||e.ctrlKey||e.shiftKey||(e.stopPropagation(),e.preventDefault()),t.readonly||(t.$.input.dataValue=t.$.input.value)}}propertyChangedHandler(e,t,a){const l=this;if("value"===e){l.displayMember!==l.valueMember&&"string"!=typeof a?(l.value=a[l.displayMember],l.$.input.dataValue=a[l.valueMember]):l.$.input.dataValue=l.$.input.value=a,l._selectedItems=[],l.set("selectedValues",[]);const e=l.$.menu.children;for(let t=0;t<e.length;t++)e[t].classList.remove("active"),e[t].setAttribute("aria-selected",!1);l._setActiveDescendant()}else"separator"===e?(l.set("value",l.value.replace(new RegExp(t,"g"),a)),l.$.input.dataValue&&(l.$.input.dataValue=l.$.input.dataValue.replace(new RegExp(t,"g"),a))):super.propertyChangedHandler(e,t,a)}_createElement(){const e=this,t=document.createElement("ul"),a=document.createElement("smart-scroll-viewer");a.rightToLeft=e.rightToLeft,a.theme=e.theme,a.horizontalScrollBarVisibility="hidden",a.classList.add("smart-multi-input-drop-down-menu"),e.inverted?a.setAttribute("inverted",""):a.removeAttribute("inverted"),e.classList.add("smart-input"),t.setAttribute("aria-multiselectable",!0),e.$.scrollView=a,e.$.menu=t,e.$.menu.onclick=function(t){const a=t.target.closest("li");t.stopPropagation(),t.preventDefault(),e._performSelect(t),a&&e.$.fireEvent("itemClick",{index:[...a.parentNode.children].indexOf(a),item:a,label:a.getAttribute("aria-label"),value:a.dataValue}),e.$.input.focus()}}_setSelection(){const e=this;let t=e.dataSource;"string"==typeof t&&(t=e.$.deserialize(t,"array"));const a=e.selectedValues;if(t){e._selectedItems=[],a.length>0?t.forEach((e=>{void 0!==e.selected&&delete e.selected})):t.forEach((e=>{if("number"!=typeof e&&"boolean"!=typeof e||(e=""+e),e.selected){const t=void 0!==e.value?e.value:e;a.push(t)}}));let l=[];for(let s=0;s<a.length;s++){const i=a[s];t.find((t=>{if("string"==typeof t||"number"==typeof t)t===i&&(e._selectedItems.push(t),l.push(t));else{let a=t.value;"number"==typeof i&&(a=parseFloat(a)),a===i&&(e._selectedItems.push(t),l.push(t.label))}}))}l=l.join(e.separator),e.set("value",l),e.$.input.dataValue=a.join(e.separator)}}_setActiveDescendant(e){const t=this;t.readonly||(e?t.setAttribute("aria-activedescendant",e.id):t.removeAttribute("aria-activedescendant"))}});

/***/ }),

/***/ 2754:
/***/ (() => {

Smart.Utilities.Assign("NumericProcessor",class{constructor(t,e){switch(t[e]){case"integer":return new Smart.Utilities.IntegerNumericProcessor(t,e);case"floatingPoint":return new Smart.Utilities.DecimalNumericProcessor(t,e);case"complex":return new Smart.Utilities.ComplexNumericProcessor(t,e)}}}),Smart.Utilities.Assign("BaseNumericProcessor",class{constructor(t,e){const i=this;i.context=t,i._longestLabelSize=0,i.numericFormatProperty=e,i.regexScientificNotation=new RegExp(/^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)(Y|Z|E|P|T|G|M|k|m|u|n|p|f|a|z|y){1}$/),i.regexNoLeadingZero=new RegExp(/^(-)?[.]\d+$/),i.regexLeadingZero=new RegExp(/^[+\-]?(0+)[1-9]+|^[+\-]?(0{2,})[.]|^(0{2,})$/),i.prefixesToPowers={Y:24,Z:21,E:18,P:15,T:12,G:9,M:6,k:3,m:-3,u:-6,n:-9,p:-12,f:-15,a:-18,z:-21,y:-24},window.NIComplex?i.complexConstructor=window.NIComplex:i.complexConstructor=Smart.Utilities.Complex}prepareForValidation(t,e,i){const r=this.context,a=t||void 0!==e;if(i=(i=i.toString()).replace(/\s/g,""),i=r._discardDecimalSeparator(i),this.regexLeadingZero.test(i)){const t=this.regexLeadingZero.exec(i);i=t[1]?i.replace(t[1],""):t[2]?i.replace(t[2],"0"):i.replace(t[3],"0")}this.regexNoLeadingZero.test(i)?i="-"===i.charAt(0)?"-0"+i.slice(1):"0"+i:("integer"===r[this.numericFormatProperty]&&(10===r._radixNumber||a)||"floatingPoint"===r[this.numericFormatProperty])&&this.regexScientificNotation.test(i)&&(i=this.scientificToDecimal(i));let n,l=!1;if("complex"===r[this.numericFormatProperty]&&!1===r._regexSpecial.nonNumericValue.test(i))try{if(r._regexSpecial.exaValue.test(i)){const t=i.indexOf("E"),e=parseFloat(i.slice(0,t))*Math.pow(10,18),r=parseFloat(i.slice(t+1,-1));n=new this.complexConstructor(e,r)}else n=new this.complexConstructor(i);l=!0}catch(t){l=!1}if(!1!==l||!(!a&&!1===r._regex[r._radixNumber].test(i)||a&&!1===r._regex[10].test(i)))return{value:i,enteredComplexNumber:n};r._handleNonNumericValue(t,e,i)}isENotation(t){return new RegExp(/e/i).test(t.toString())}scientificToDecimal(t){const e=this.regexScientificNotation.exec(t),i=e[1],r=e[2];return parseFloat(i)*Math.pow(10,this.prefixesToPowers[r])}_createMeasureLabel(){const t=this.context,e=document.createElement("div");return e.className="smart-label",e.style.position="absolute",e.style.visibility="hidden","far"!==t.scalePosition?t._measureLabelScale=t.$.scaleNear:t._measureLabelScale=t.$.scaleFar,t._measureLabelScale.appendChild(e),e}_addMajorTickAndLabel(t,e,i,r,a){const n=this.context,l=n._settings.leftOrTop,o=this.valueToPx(r);let s="",c="";if(parseInt(o)>parseInt(n._measurements.trackLength))return{tick:s,label:c};if(n.logarithmicScale&&(t=n._formatLabel(Math.pow(10,r))),"smart-tank"===n.nodeName.toLowerCase()||n._intervalHasChanged){let e=n._tickIntervalHandler.labelsSize;if(a){n._labelDummy.innerHTML=t;let a=this.valueToPx(r),l=this.valueToPx(n._drawMax),o=this.valueToPx(n._drawMin),s=n._labelDummy[n._settings.size],c="vertical"===n.orientation?n._labelDummy.offsetWidth:n._labelDummy.offsetHeight,m=(s+e.minLabelSize)/2,u=(s+e.maxLabelSize)/2;i=n._normalLayout?a+u<l&&a-m>o:a-u>l&&a+m<o,c>this._longestLabelSize&&(this._longestLabelSize=c)}else this._longestLabelSize=Math.max(e.minLabelOtherSize,e.maxLabelOtherSize,this._longestLabelSize)}return n._tickValues.push(r),s='<div style="'+l+": "+o+'px;" class="smart-tick"></div>',!1!==i&&(void 0===e&&(n._labelDummy.innerHTML=t,e=n._labelDummy[n._settings.size]),c+='<div class="smart-label'+(a?" smart-label-middle":"")+'" style="'+l+": "+(o-e/2)+'px;">'+t+"</div>"),{tick:s,label:c}}getWordLength(t){switch(this.context._unsigned="u"===t.charAt(0),t){case"int8":case"uint8":return 8;case"int16":case"uint16":return 16;case"int32":case"uint32":return 32;case"int64":case"uint64":return 64}}getAngleByValue(t,e,i){const r=this.context;!1!==e&&r.logarithmicScale&&(t=Math.log10(t));const a=(t-r._drawMin)*r._angleRangeCoefficient;let n;return n=void 0===r.inverted||!r.inverted&&!r.rightToLeft||r.rightToLeft&&r.inverted?r.endAngle-a:r.startAngle+a,i?n:n*Math.PI/180+Math.PI/2}getValueByAngle(t,e){const i=this.context;let r,a,n;for(void 0===i.inverted||!i.inverted&&!i.rightToLeft||i.rightToLeft&&i.inverted?(r=i.endAngle,a=t):(r=t,a=i._normalizedStartAngle);r<a;)r+=360;if(n=(r-a)/i._angleDifference*i._range+parseFloat(i._drawMin),i.logarithmicScale){if(i.customInterval)return parseFloat(Math.pow(10,this.getCoercedValue(n,!0)).toFixed(12));n=Math.pow(10,n)}return e&&!i.coerce?Math.round(n):(n=this.createDescriptor(n,void 0,!0,!0),this.getCoercedValue(n,!1))}updateGaugeValue(t){const e=this.context,i=e.value;e.value=t,e._drawValue=e.logarithmicScale?Math.log10(t).toString():t,e._number=this.createDescriptor(e.value),e.$.digitalDisplay.value=t,e.$.fireEvent("change",{value:t,oldValue:i}),e._setAriaValue("valuenow"),delete e._valueBeforeCoercion}validateColorRange(t){const e=this.context;return Math.min(Math.max(t,e.min),e.max)}getActualValue(t){return this.context.logarithmicScale?Math.pow(10,t):t}drawGaugeLogarithmicScaleMinorTicks(t,e,i){const r=this.context;let a;e instanceof Smart.Utilities.BigNumber&&(e=parseFloat(e.toString()));for(let e in t)if(a=e,e>=0&&e%1==0)break;for(let t=parseFloat(a);t<r._drawMax;t+=e)for(let a=2;a<=9;a++){const n=a*Math.pow(10,t+e-1);n<r.max&&i(n)}for(let t=parseFloat(a);t>r._drawMin;t-=e)for(let e=2;e<=9;e++){const a=e*Math.pow(10,t-1);a>r.min&&i(a)}}_getAngleDifference(t,e){const i=Math.abs(e-t)%360;return i>180?360-i:i}addCustomTicks(){const t=this,e=t.context,i=!e.logarithmicScale;let r="",a="";function n(n){const l=e.customTicks[n],o=i?t.createDescriptor(l):Math.log10(l),s=n>0&&n<e.customTicks.length-1,c=t._addMajorTickAndLabel(e._formatLabel(l),void 0,!0,o,s);r+=c.tick,a+=c.label}if(t._longestLabelSize=0,e._tickValues=[],e._labelDummy=t._createMeasureLabel(),e._normalLayout)for(let t=0;t<e.customTicks.length;t++)n(t);else for(let t=e.customTicks.length-1;t>=0;t--)n(t);"smart-tank"===e.nodeName.toLowerCase()&&e._updateScaleWidth(t._longestLabelSize),e._appendTicksAndLabelsToScales(r,a)}addGaugeCustomTicks(){const t=this,e=t.context,i=e._distance,r=e._measurements.radius-i.majorTickDistance;let a,n;function l(i){const r=e.customTicks[i],l=t.createDescriptor(r),o=t.getAngleByValue(l,!0),s=i>0&&i<e.customTicks.length-1;a(o),n(o,r,s)}a="none"!==e.ticksVisibility&&!1!==e._plotTicks?function(t){e._drawTick(t,r,"major")}:function(){},n="none"!==e.labelsVisibility&&!1!==e._plotLabels?function(t,r,a){e._drawLabel(t,r,i.labelDistance,a)}:function(){};for(let t=e.customTicks.length-1;t>=0;t--)l(t)}}),Smart.Utilities.Assign("IntegerNumericProcessor",class extends Smart.Utilities.BaseNumericProcessor{constructor(t,e){super(t,e);const i=this;i.context=t,i.defaultMins={int8:"-128",uint8:"0",int16:"-32768",uint16:"0",int32:"-2147483648",uint32:"0",int64:"-9223372036854775808",uint64:"0"},i.defaultMaxs={int8:"127",uint8:"255",int16:"32767",uint16:"65535",int32:"2147483647",uint32:"4294967295",int64:"9223372036854775807",uint64:"18446744073709551615"}}createDescriptor(t,e,i,r,a){const n=this.context;let l;if(t.constructor!==Smart.Utilities.BigNumber){let i=!a&&n._radixNumber?n._radixNumber:10;10===i&&e&&t.constructor!==Smart.Utilities.BigNumber&&this.isENotation(t)&&(t=Smart.Utilities.BigNumber.bigIntSupport?new Smart.Utilities.BigNumber(Math.round(t)):new Smart.Utilities.NumberRenderer(t).largeExponentialToDecimal()),l=n._toBigNumberDecimal?n._toBigNumberDecimal(t.toString(i,n._wordLengthNumber),i):new Smart.Utilities.BigNumber(t)}else l=new Smart.Utilities.BigNumber(t);return i&&(n._unsigned&&-1===l.compare(0)&&(l=l.set(0)),r&&(l=this.validate(l,n._minObject,n._maxObject)),l=this.round(l)),l}round(t){const e=this.context;if(t instanceof window.Smart.Utilities.BigNumber&&"bigint"==typeof t._d)return t;if(t instanceof window.Smart.Utilities.BigNumber==0||!e._wordLengthNumber||e._wordLengthNumber<64)return new Smart.Utilities.BigNumber(Math.round(t.toString()));const i=t.mod(1);return 1===i._d.length&&0===i._d[0]||((t=t.intPart())._s?(i._d[1]>5||5===i._d[1]&&i._d[2])&&(t=t.add(-1)):i._d[1]>4&&(t=t.add(1))),t}validate(t,e,i){let r;return r=-1===t.compare(e)?e:1===t.compare(i)?i:t,r}validateMinMax(t,e){const i=this.context;let r=this.defaultMins[i.wordLength],a=new Smart.Utilities.BigNumber(r),n=this.defaultMaxs[i.wordLength],l=new Smart.Utilities.BigNumber(n),o="date"!==i.mode;if(void 0===i._numberRenderer&&(i._numberRenderer=new Smart.Utilities.NumberRenderer),t&&o){null!==i.min&&(i.min=i.min.toString().replace(/\s/g,""),this.regexScientificNotation.test(i.min)&&(i.min=this.scientificToDecimal(i.min)));let t=this.round(new Smart.Utilities.BigNumber(i.min));null===i.min||i._minIsNull&&i._initialized||!(t.compare(a)>=0)?(i._minIsNull=!0,i.min=r,i._minObject=a):i._minObject=t}if(e&&o){null!==i.max&&(i.max=i.max.toString().replace(/\s/g,""),this.regexScientificNotation.test(i.max)&&(i.max=this.scientificToDecimal(i.max)));let t=this.round(new Smart.Utilities.BigNumber(i.max));null===i.max||i._maxIsNull&&i._initialized||!(t.compare(l)<=0)?(i._maxIsNull=!0,i.max=n,i._maxObject=l):i._maxObject=t}o||(i._minObject=new Smart.Utilities.BigNumber(i.min),i._maxObject=new Smart.Utilities.BigNumber(i.max)),this.compare(i._minObject,i._maxObject)||(i._minObject=a,i._maxObject=l,i._drawMin=i.logarithmicScale?0:r,i._drawMax=i.logarithmicScale?10:n,i.min=r,i.max=n),o||(i._minDate=Smart.Utilities.DateTime.fromFullTimeStamp(i.min),i._maxDate=Smart.Utilities.DateTime.fromFullTimeStamp(i.max))}valueToPx(t){const e=Smart.Utilities.BigNumber.ignoreBigIntNativeSupport;Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=!0;const i=this.context,r=new Smart.Utilities.BigNumber(i._measurements.trackLength).divide(new Smart.Utilities.BigNumber(i._range));let a;if(i._normalLayout){const e=i._drawMin instanceof Smart.Utilities.BigNumber?i._drawMin:new Smart.Utilities.BigNumber(i._drawMin);t=new Smart.Utilities.BigNumber(t),a=parseFloat(r.multiply(t.subtract(e)).toString())}else{const e=i._drawMax instanceof Smart.Utilities.BigNumber?i._drawMax:new Smart.Utilities.BigNumber(i._drawMax);a=parseFloat(this.round(e.subtract(t).multiply(r)).toString())}return Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=e,a}pxToValue(t){const e=this.context,i=Smart.Utilities.BigNumber.ignoreBigIntNativeSupport;let r;if(Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=!0,r=e._normalLayout?e._valuePerPx.multiply(t-e._trackStart):e._valuePerPx.multiply(e._trackEnd-t),r=this.round(r).toString(),Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=i,e.logarithmicScale){let t=parseFloat(r)+parseFloat(e._drawMin);return new Smart.Utilities.BigNumber(Math.round(Math.pow(10,t)))}return this.createDescriptor(e._minObject.add(r),!1,!0,!0)}compare(t,e,i){if((null===t||null===e)&&t!==e)return!0;t.constructor!==Smart.Utilities.BigNumber&&(t=new Smart.Utilities.BigNumber(t));const r=t.compare(e);return!0!==i?0!==r:r}incrementDecrement(t,e,i){const r=this.context;let a;if(t.constructor!==Smart.Utilities.BigNumber&&(t=new Smart.Utilities.BigNumber(t)),"add"===e){if(a=t.add(i),void 0!==r._drawMax)return a.compare(r._drawMax)>0?new Smart.Utilities.BigNumber(r._drawMax):a}else if(a=t.subtract(i),void 0!==r._drawMin)return a.compare(r._drawMin)<0?new Smart.Utilities.BigNumber(r._drawMin):a;return a}render(t,e){const i=this.context;if(!i.scientificNotation&&!0===e)return new Smart.Utilities.NumberRenderer(new Smart.Utilities.BigNumber(t)).bigNumberToExponent(i.significantDigits);let r=t;return i.scientificNotation&&!0===e?r=new Smart.Utilities.NumberRenderer(r).toScientific(i.significantDigits,i.precisionDigits):"string"!=typeof t&&(r=t.toString(i._radixNumber,i._wordLengthNumber,i.leadingZeros)),r}addTicksAndLabels(){const t=Smart.Utilities.BigNumber.ignoreBigIntNativeSupport;Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=!0;const e=this.context,i=e._measurements.trackLength,r=e._normalLayout,a=e._majorTicksInterval,n=this.round(new Smart.Utilities.BigNumber(e._range).divide(a)),l=i/n,o=new Smart.Utilities.BigNumber(e._drawMin),s=new Smart.Utilities.BigNumber(e._drawMax);let c,m,u,g,d,p,h,b,f,_="",S="";e._tickValues=[],this._longestLabelSize=0,r?(c=o,m=a.add(c.subtract(c.mod(a))),u=m.subtract(c),d=e._formatLabel(o),p=e._tickIntervalHandler.labelsSize.minLabelSize,g=s,h=e._formatLabel(s),b=e._tickIntervalHandler.labelsSize.maxLabelSize):(c=s,m=c.subtract(c.mod(a)),u=c.subtract(m),d=e._formatLabel(s),p=e._tickIntervalHandler.labelsSize.maxLabelSize,g=o,h=e._formatLabel(o),b=e._tickIntervalHandler.labelsSize.minLabelSize),e._labelDummy=this._createMeasureLabel(),f=this._addMajorTickAndLabel(d,p,!0,c),_+=f.tick,S+=f.label;const x=u.divide(a).multiply(l);if(0!==m.compare(e.max)&&x.compare(i)<0){const t=e._formatLabel(m.toString()),i=x.compare(p)>0;f=this._addMajorTickAndLabel(t,void 0,i,m,!0),_+=f.tick,S+=f.label}f=this.addMiddleMajorTicks(n,l,x,u,r,a),_+=f.tick,S+=f.label,f=this._addMajorTickAndLabel(h,b,!0,g),_+=f.tick,S+=f.label,"date"!==e.mode&&(_+=this.addMinorTicks(r)),e._measureLabelScale.removeChild(e._labelDummy),delete e._labelDummy,delete e._measureLabelScale,"smart-tank"===e.nodeName.toLowerCase()&&e._updateScaleWidth(this._longestLabelSize),e._appendTicksAndLabelsToScales(_,S),Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=t}addMiddleMajorTicks(t,e,i,r,a,n){const l=this.context;let o,s="",c="";for(let m=1;m<t;m++){let u,g=i.add(m*e);if(a?u=n.multiply(m).add(r.add(new Smart.Utilities.BigNumber(l._drawMin))):(u=new Smart.Utilities.BigNumber(l._drawMax).subtract(r).subtract(n.multiply(m)),m===t-1&&0===u.compare(0)&&(l._numberRenderer.numericValue=l._tickIntervalHandler.nearestPowerOfTen,o=l._numberRenderer.bigNumberToExponent(1))),0!==u.compare(l._drawMax)){let i=l._formatLabel(u.toString()),r=!0;l._labelDummy.innerHTML=o||i;let a=l._labelDummy[l._settings.size];g.add(a).compare(t*e)>=0&&(r=!1);const n=this._addMajorTickAndLabel(i,void 0,r,u,!0);s+=n.tick,c+=n.label}}return{tick:s,label:c}}addMinorTicks(t){function e(t){-1===r.indexOf(t)&&t%n==0&&(m+='<div style="'+l+": "+i._numericProcessor.valueToPx(t)+'px;" class="smart-tick smart-tick-minor"></div>')}const i=this.context,r=i._tickValues,a=i._tickIntervalHandler.nearestPowerOfTen,n=i._minorTicksInterval,l=i._settings.leftOrTop;let o,s,c,m="";if(t?(o=r[0],s=r[1],c=r[r.length-1]):(o=r[r.length-1],s=r[r.length-2],c=r[0]),i.logarithmicScale)!function(){let t=i._measurements.trackLength/r.length,e=.1;t<20?e=1:t>=20&&t<40?e=s-o>1?1:.5:t>=40&&t<80&&(e=.2);let a=Math.floor(i._drawMax),n=i._drawMax-a,c=i._drawMax-i._drawMin>r.length;for(let t=i._drawMax;t>0;t-=1){let r=n>0?Math.pow(10,t-n+1):Math.pow(10,t),a=r*e;for(let t=r;t>0;t-=a)if(t<i.max&&t>i.min){let e=new Smart.Utilities.BigNumber(Math.log10(t));(e%1==0&&c||!c)&&(m+='<div style="'+l+": "+i._numericProcessor.valueToPx(e)+'px;" class="smart-tick smart-tick-minor"></div>')}}}();else{for(let t=s;o.compare(t)<0;t=t.subtract(a))e(t);for(let t=s.add(a);c.compare(t)>0;t=t.add(a))e(t)}return m}validateCustomTicks(){const t=this.context,e="date"!==t.mode;let i=[];for(let r=0;r<t.customTicks.length;r++){let a=t.customTicks[r];e?a=this.createDescriptor(a,!1,!0):void 0===a._d&&(a=Smart.Utilities.DateTime.validateDate(a).getTimeStamp()),a.compare(t._minObject)>=0&&a.compare(t._maxObject)<=0&&i.push(a)}if(i.sort((function(t,e){return t.compare(e)})),e){for(let t=0;t<i.length;t++)i[t]=i[t].toString();i=i.filter((function(t,e,i){return!e||t!==i[e-1]}))}t.customTicks=i.slice(0)}addGaugeTicksAndLabels(){const t=Smart.Utilities.BigNumber.ignoreBigIntNativeSupport;Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=!0;const e=this.context,i=this,r=Math.max(e._tickIntervalHandler.labelsSize.minLabelSize,e._tickIntervalHandler.labelsSize.maxLabelSize),a=e._majorTicksInterval,n=e._minorTicksInterval,l={},o=e._distance,s=e._measurements.radius,c=s-o.majorTickDistance,m=s-o.minorTickDistance,u=new Smart.Utilities.BigNumber(e._drawMin),g=new Smart.Utilities.BigNumber(e._drawMax);let d,p,h,b,f,_;"none"!==e.ticksVisibility&&!1!==e._plotTicks?(d=function(t){e._drawTick(t,c,"major")},p=function(t){e._drawTick(i.getAngleByValue(t,!0),m,"minor")}):(d=function(){},p=function(){}),h="none"!==e.labelsVisibility&&!1!==e._plotLabels?function(t,i,r){e._drawLabel(t,i,o.labelDistance,r)}:function(){},void 0===e.inverted||!e.inverted&&!e.rightToLeft||e.rightToLeft&&e.inverted?(f=e.endAngle,_=e.startAngle):(f=e.startAngle,_=e.endAngle),b=i.getAngleByValue(u,!1),d(b),l[e._drawMin.toString()]=!0,h(b,e.min,!1);let S,x,v=u.subtract(u.mod(a));-1!==u.compare(0)&&(v=v.add(a));for(let t=new Smart.Utilities.BigNumber(v);-1!==t.compare(u);t=t.subtract(n))S=t;for(b=i.getAngleByValue(v,!1),d(b),l[v.toString()]=!0,2*Math.PI*e._measurements.innerRadius*(this._getAngleDifference(f,i.getAngleByValue(v,!1,!0))/360)>r&&h(b,this.getActualValue(v),-1===v.compare(g)),x=v.add(a);-1===x.compare(g.subtract(a));x=x.add(a))b=i.getAngleByValue(x,!1),d(b),l[x.toString()]=!0,h(b,this.getActualValue(x),!0);if(void 0===l[x.toString()]&&1!==x.compare(g)&&(b=i.getAngleByValue(x,!1),d(b),l[x.toString()]=!0,2*Math.PI*e._measurements.innerRadius*(this._getAngleDifference(_,i.getAngleByValue(x,!1,!0))/360)>=r&&h(b,this.getActualValue(x),!0),e._normalizedStartAngle!==e.endAngle&&(b=i.getAngleByValue(g,!1),d(b),2*Math.PI*e._measurements.innerRadius*(this._getAngleDifference(_,f)/360)>=r&&h(b,e.max,!1))),"date"!==e.mode){if(e.logarithmicScale)this.drawGaugeLogarithmicScaleMinorTicks(l,a,p);else for(let t=S;-1===t.compare(g);t=t.add(n))l[t.toString()]||p(t);Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=t}else Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=t}updateToolTipAndValue(t,e,i){const r=this.context,a=r.logarithmicScale;r._updateTooltipValue(t.toString()),a&&(t=parseFloat(Math.pow(10,parseFloat(t)).toFixed(11)));const n=(t=t instanceof Smart.Utilities.BigNumber?t:new Smart.Utilities.BigNumber(t)).toString();r._number=t,r._drawValue=a?Math.log10(n):t,0!==t.compare(e)&&i&&("numeric"===r.mode?(r.value=n,t=n):(e=r._valueDate,r._valueDate=Smart.Utilities.DateTime.fromFullTimeStamp(n),r.value=t,t=r._valueDate),r._programmaticValueIsSet||r.$.fireEvent("change",{value:t,oldValue:e}),r.$.hiddenInput&&(r.$.hiddenInput.value=t),r._setAriaValue("valuenow"))}validateInterval(t){const e=this.context,i=e._maxObject.subtract(e._minObject);e._validInterval=new Smart.Utilities.BigNumber(t),e._validInterval=this.round(e._validInterval),e._validInterval.compare(0)<=0&&(e._validInterval=new Smart.Utilities.BigNumber(1)),1===e._validInterval.compare(i)&&(e._validInterval=i),e.interval=e._validInterval.toString()}getCoercedValue(t,e,i){const r=this.context;if(!r.coerce)return t;const a=!r.logarithmicScale;let n,l;if(t=t instanceof Smart.Utilities.BigNumber?t:new Smart.Utilities.BigNumber(t),r.customInterval){const e=r.customTicks;if(0===e.length)return t;let l,o;if(a||i){n=r._minObject,l=n.subtract(t).abs(),o=n;for(let i=0;i<e.length;i++){const r=this.createDescriptor(e[i]),a=r.subtract(t).abs();-1===a.compare(l)&&(l=a,o=r)}}else{n=r._drawMin,l=Math.abs(n-parseFloat(t.toString())),o=n;for(let i=0;i<e.length;i++){const r=Math.log10(e[i]),a=Math.abs(r-t);a<l&&(l=a,o=r)}o=new Smart.Utilities.BigNumber(o)}return o}let o=r._validInterval;if("date"===r.mode){if("addYears"===r._dateIncrementMethod)return this.coerceYear(t);if("addMonths"===r._dateIncrementMethod)return this.coerceMonth(t);o=new Smart.Utilities.BigNumber(r._dateIntervalNumber).multiply(o)}!1!==e?(n=new Smart.Utilities.BigNumber(r._drawMin),l=new Smart.Utilities.BigNumber(r._drawMax)):(n=new Smart.Utilities.BigNumber(r.min),l=new Smart.Utilities.BigNumber(r.max));let s=t.subtract(n),c=s.mod(o);if(0===c.compare(0))return t;let m=s.subtract(c),u=m.add(o);if(s.subtract(m).abs().compare(s.subtract(u).abs())<0)return m.add(n);{const t=u.add(n);return t.compare(l)<=0?t:m.add(n)}}coerceMonth(t){const e=this.context,i=parseFloat(e._validInterval),r=Smart.Utilities.DateTime.fromFullTimeStamp(t),a=r.year(),n=r.month(),l=r.day(),o=e._minDate.year(),s=e._minDate.month(),c=12*(e._maxDate.year()-o-1)+12-s+e._maxDate.month();let m=12*(a-1-o)+(12-s)+n;1===i&&(-1!==[1,3,5,7,8,10,12].indexOf(n)?(l>16||16===l&&r.hour()>11)&&m++:2===n?r.isLeapYear(a)?(l>15||15===l&&r.hour()>11)&&m++:l>14&&m++:l>15&&m++),m=this.getCoercedTimePart(0,c,m,i);let u=e._minDate.addMonths(m,!0);return 1===u.compare(e._maxDate)&&(u=e._minDate.addMonths(m-i,!0)),e._drawValue=new Smart.Utilities.BigNumber(u.getTimeStamp()),e._drawValue}coerceYear(t){const e=this.context,i=parseFloat(e._validInterval),r=Smart.Utilities.DateTime.fromFullTimeStamp(t),a=e._maxDate.year(),n=Smart.Utilities.DateTime.getConstructorParameters(e._minDate);let l=r.year();r.month()>6&&l++;let o=this.getCoercedTimePart(e._minDate.year(),a,l,i);o>a&&(o-=i),n[0]=o,n.unshift(null);const s=new(Function.prototype.bind.apply(Smart.Utilities.DateTime,n));return e._drawValue=new Smart.Utilities.BigNumber(s.getTimeStamp()),e._drawValue}getCoercedTimePart(t,e,i,r){let a=i-t,n=a%r;if(0===n)return i;let l=parseFloat((a-n).toFixed(12)),o=l+r;if(e-t<=r)return i>=t+(e-t)/2?e:t;if(Math.abs(a-l)<Math.abs(a-o))return l+t;{const i=o+t;return i>e?l+t:i}}updateValue(t){const e=this.context;t=t instanceof Smart.Utilities.BigNumber?t:new Smart.Utilities.BigNumber(t);const i=this.validate(t,e._minObject,e._maxObject);let r,a,n=e.value;e._number=i,e._drawValue=e.logarithmicScale?Math.log10(i):i,"numeric"===e.mode?(r=t.toString(),e.value=r,a=this.compare(t,n)):(n=Smart.Utilities.DateTime.fromFullTimeStamp(n),e._valueDate=Smart.Utilities.DateTime.fromFullTimeStamp(t),e.value=t,r=t=e._valueDate,a=0!==t.compare(n)),e._programmaticValueIsSet||!a&&!e._scaleTypeChangedFlag||e.$.fireEvent("change",{value:r,oldValue:n}),e.$.hiddenInput&&(e.$.hiddenInput.value=t),e._setAriaValue("valuenow"),e._moveThumbBasedOnValue(e._drawValue)}getValuePerPx(t,e){const i=Smart.Utilities.BigNumber.ignoreBigIntNativeSupport;Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=!0;const r=new Smart.Utilities.BigNumber(t).divide(e);return Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=i,r}restrictValue(t){t[1].constructor===Smart.Utilities.BigNumber?-1===t[1].compare(t[0])&&t[1].set(t[0]):t[1]<t[0]&&(t[1]=t[0])}getAngleByValue(t,e,i){const r=this.context,a=Smart.Utilities.BigNumber.ignoreBigIntNativeSupport;if(Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=!0,r._wordLengthNumber<64)return Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=a,super.getAngleByValue(parseFloat(t.toString()),e,i);t instanceof Smart.Utilities.BigNumber==0&&(t=new Smart.Utilities.BigNumber(t)),!1!==e&&r.logarithmicScale&&(t=new Smart.Utilities.BigNumber(Math.log10(t.toString())));const n=t.subtract(r._drawMin).multiply(r._angleRangeCoefficient);let l;return l=void 0===r.inverted||!r.inverted&&!r.rightToLeft||r.rightToLeft&&r.inverted?n.multiply(-1).add(r.endAngle):n.add(r.startAngle),l=parseFloat(l.toString()),Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=a,i?l:l*Math.PI/180+Math.PI/2}getValueByAngle(t){const e=this.context;if(e._wordLengthNumber<64)return super.getValueByAngle(t,!0);const i=Smart.Utilities.BigNumber.ignoreBigIntNativeSupport;let r,a,n,l;for(Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=!0,void 0===e.inverted||!e.inverted&&!e.rightToLeft||e.rightToLeft&&e.inverted?(r=e.endAngle,a=t):(r=t,a=e._normalizedStartAngle);r<a;)r+=360;return n=new Smart.Utilities.BigNumber((r-a)/e._angleDifference).multiply(e._range).add(e._drawMin),e.logarithmicScale&&(n=new Smart.Utilities.BigNumber(Math.pow(10,n.toString()))),l=e.coerce?this.getCoercedValue(n,!1):this.round(n),Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=i,new Smart.Utilities.BigNumber(l)}updateGaugeValue(t){if(t instanceof Smart.Utilities.BigNumber==0)return super.updateGaugeValue(t);const e=this.context,i=e._getEventValue();"numeric"===e.mode?(e.value=t.toString(),e.$.digitalDisplay.value=e.value):(e._valueDate=Smart.Utilities.DateTime.fromFullTimeStamp(t),e.value=t),e._drawValue=e.logarithmicScale?Math.log10(e.value).toString():e.value,e._number=t,e.$.fireEvent("change",{value:e._getEventValue(),oldValue:i}),e._setAriaValue("valuenow")}validateColorRange(t){const e=this.context;if(e._wordLengthNumber<64)return super.validateColorRange(t);t="numeric"===e.mode?new Smart.Utilities.BigNumber(t):(t=Smart.Utilities.DateTime.validateDate(t)).getTimeStamp();const i=new Smart.Utilities.BigNumber(e.min),r=new Smart.Utilities.BigNumber(e.max);return-1===t.compare(i)&&(t=i),1===t.compare(r)&&(t=r),t}lockRotation(t,e){const i=this.context;if(e instanceof Smart.Utilities.BigNumber==0&&(e=new Smart.Utilities.BigNumber(e)),t&&-1===e.compare(i._number)){if(i._lockCW=!0,-1===e.compare(i._maxObject))return new Smart.Utilities.BigNumber(i._maxObject)}else if(!t&&1===e.compare(i._number)&&(i._lockCCW=!0,1===e.compare(i._minObject)))return new Smart.Utilities.BigNumber(i._minObject)}getAngleRangeCoefficient(){const t=this.context,e=Smart.Utilities.BigNumber.ignoreBigIntNativeSupport;Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=!0,t._angleRangeCoefficient=new Smart.Utilities.BigNumber(t._angleDifference).divide(t._range),Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=e}}),Smart.Utilities.Assign("DecimalNumericProcessor",class extends Smart.Utilities.BaseNumericProcessor{constructor(t,e){super(t,e),this.context=t}getPreciseModulo(t,e,i){const r=t>=0?1:-1;if(t=Math.abs(t),e=Math.abs(e),void 0===i){const i=t.toExponential(),a=e.toExponential(),n=parseInt(i.slice(i.indexOf("e")+1),10),l=parseInt(a.slice(a.indexOf("e")+1),10),o=n<0?Math.abs(n):0,s=l<0?Math.abs(l):0,c=Math.max(o,s);if(this.roundCoefficient=c,t<e)return r*t;if(t===e)return 0;if((t<-1||t>1)&&(e<-1||e>1||1===e)){if(t%1==0&&e%1==0)return r*(t%e);{const i=Smart.Utilities.BigNumber.ignoreBigIntNativeSupport;Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=!0;const a=r*parseFloat(new Smart.Utilities.BigNumber(t).mod(e).toString());return Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=i,a}}const m=Math.pow(10,c);return r*(t*m%(e*m)/m)}return r*(Math.round(t*i)%Math.round(e*i))}createDescriptor(t,e,i,r){let a=parseFloat(t);return r&&(a=this.validate(a,this.context._minObject,this.context._maxObject)),a}round(t){return Math.round(t)}validate(t,e,i){let r;return r=t<e?e:t>i?i:t,r}validateMinMax(t,e){const i=this.context,r=void 0!==i._regexSpecial&&i._regexSpecial.inf.test(i.min),a=void 0!==i._regexSpecial&&i._regexSpecial.inf.test(i.max);t&&(null===i.min||r?(i.min=-1/0,i._minObject=-1/0):(i.min=i.min.toString().replace(/\s/g,""),this.regexScientificNotation.test(i.min)&&(i.min=this.scientificToDecimal(i.min)),i._minObject=i._discardDecimalSeparator(i.min))),e&&(null===i.max||a?(i.max=1/0,i._maxObject=1/0):(i.max=i.max.toString().replace(/\s/g,""),this.regexScientificNotation.test(i.max)&&(i.max=this.scientificToDecimal(i.max)),i._maxObject=i._discardDecimalSeparator(i.max))),this.compare(i._minObject,i._maxObject)||(i._maxObject=parseFloat(i._maxObject)+1,i.max=i._maxObject)}valueToPx(t){const e=this.context,i=e._measurements.trackLength/e._range;let r;return r=e._normalLayout?i*(t-e._drawMin):i*(e._drawMax-t),Math.round(r)}pxToValue(t){const e=this.context;let i;if(i=e._normalLayout?(t-e._trackStart)*e._valuePerPx:(e._trackEnd-t)*e._valuePerPx,e.logarithmicScale){const t=i+parseFloat(e._drawMin);return Math.pow(10,t)}return this.validate(i+e._minObject,e._minObject,e._maxObject)}compare(t,e,i){return t=parseFloat(t),e=parseFloat(e),!0!==i?t!==e:t<e?-1:t>e?1:0}incrementDecrement(t,e,i){const r=this.context;let a;if("add"===e){if(a=parseFloat(t)+parseFloat(i),void 0!==r._drawMax)return a>parseFloat(r._drawMax)?r._drawMax:a}else if(a=parseFloat(t)-parseFloat(i),void 0!==r._drawMin)return a<parseFloat(r._drawMin)?r._drawMin:a;return a}render(t){const e=this.context;if(void 0!==e._regexSpecial&&e._regexSpecial.nonNumericValue.test(t))return t;{const i=new Smart.Utilities.NumberRenderer(t);return e.scientificNotation?i.toScientific(e.significantDigits,e.precisionDigits):i.toDigits(e.significantDigits,e.precisionDigits)}}addTicksAndLabels(){const t=this.context,e=t._measurements.trackLength,i=t._normalLayout,r=t._majorTicksInterval,a=Math.round(t._range/parseFloat(r.toString())),n=e/a,l=parseFloat(t._drawMin),o=parseFloat(t._drawMax);let s,c,m,u,g,d,p,h,b,f="",_="";t._tickValues=[],this._longestLabelSize=0,i?(s=l,c=t.logarithmicScale&&l<0&&-1!==l?parseFloat(s-this.getPreciseModulo(s,r)):parseFloat(s-this.getPreciseModulo(s,r)+parseFloat(r)),m=c-s,g=t._formatLabel(l),d=t._tickIntervalHandler.labelsSize.minLabelSize,u=o,p=t._formatLabel(o),h=t._tickIntervalHandler.labelsSize.maxLabelSize):(s=o,c=parseFloat(s-this.getPreciseModulo(s,r)),m=s-c,g=t._formatLabel(o),d=t._tickIntervalHandler.labelsSize.maxLabelSize,u=l,p=t._formatLabel(l),h=t._tickIntervalHandler.labelsSize.minLabelSize),t._labelDummy=this._createMeasureLabel(),b=this._addMajorTickAndLabel(g,d,!0,s),f+=b.tick,_+=b.label;const S=m/r*n;if(c.toString()!==t._drawMax.toString()&&S<e){const e=t._formatLabel(c.toString()),i=d<S;b=this._addMajorTickAndLabel(e,void 0,i,c,!0),f+=b.tick,_+=b.label}b=this.addMiddleMajorTicks(a,n,S,m,i,r),f+=b.tick,_+=b.label,b=this._addMajorTickAndLabel(p,h,!0,u),f+=b.tick,_+=b.label,f+=this.addMinorTicks(i),t._measureLabelScale.removeChild(t._labelDummy),delete t._labelDummy,delete t._measureLabelScale,"smart-tank"===t.nodeName.toLowerCase()&&t._updateScaleWidth(this._longestLabelSize),t._appendTicksAndLabelsToScales(f,_)}addMiddleMajorTicks(t,e,i,r,a,n){const l=this.context;let o="",s="";for(let c=1;c<t;c++){let m,u=c*e+i;if(m=a?parseFloat(l._drawMin)+n*c+r:parseFloat(l._drawMax)-n*c-r,m.toString()!==l._drawMax.toString()){let i=l._formatLabel(m.toString()),r=!0;l._labelDummy.innerHTML=i,u+l._labelDummy[l._settings.size]>=t*e&&(r=!1);const a=this._addMajorTickAndLabel(i,void 0,r,m,!0);o+=a.tick,s+=a.label}}return{tick:o,label:s}}addMinorTicks(t){function e(t){return parseFloat(t.toFixed(o))}function i(t){-1===a.indexOf(t)&&0===r._numericProcessor.getPreciseModulo(t,l,s)&&(d+='<div style="'+c+": "+r._numericProcessor.valueToPx(t)+'px;" class="smart-tick smart-tick-minor"></div>')}const r=this.context,a=r._tickValues,n=r._tickIntervalHandler.nearestPowerOfTen,l=r._minorTicksInterval,o=Math.log10(n)<0?Math.round(Math.abs(Math.log10(n))):0,s=Math.pow(10,o),c=r._settings.leftOrTop;let m,u,g,d="";if(t?(m=a[0],u=a[1],g=a[a.length-1]):(m=a[a.length-1],u=a[a.length-2],g=a[0]),r.logarithmicScale)!function(){let t=r._measurements.trackLength/a.length,e=.1;t<20?e=1:t>=20&&t<40?e=u-m>1?1:.5:t>=40&&t<80&&(e=.2);let i=Math.floor(r._drawMax),n=r._drawMax-i,l=r._drawMax-r._drawMin>a.length;for(let t=r._drawMax;t>r._drawMin-1;t-=1){let i=n>0?Math.pow(10,t-n+1):Math.pow(10,t),a=i*e;for(let t=i;t>0;t-=a)if(t<r.max&&t>r.min){let e=new Smart.Utilities.BigNumber(Math.log10(t));(e%1==0&&l||!l)&&(d+='<div style="'+c+": "+r._numericProcessor.valueToPx(e)+'px;" class="smart-tick smart-tick-minor"></div>')}}}();else{for(let t=u;t>m;t=e(t-n))i(t);for(let t=e(u+n);t<g;t=e(t+n))i(t)}return d}validateCustomTicks(){const t=this.context;let e=[];for(let i=0;i<t.customTicks.length;i++){const r=t.customTicks[i],a=this.createDescriptor(r);a>=t._minObject&&a<=t._maxObject&&e.push(a.toString())}e.sort((function(t,e){return t-e})),e=e.filter((function(t,e,i){return!e||t!==i[e-1]})),t.customTicks=e.slice(0)}addGaugeTicksAndLabels(){const t=this.context,e=this,i=Math.max(t._tickIntervalHandler.labelsSize.minLabelSize,t._tickIntervalHandler.labelsSize.maxLabelSize),r=t._majorTicksInterval,a=t._minorTicksInterval,n={},l=t._distance,o=t._measurements.radius,s=o-l.majorTickDistance,c=o-l.minorTickDistance;let m,u,g,d,p,h;"none"!==t.ticksVisibility&&!1!==t._plotTicks?(m=function(e){t._drawTick(e,s,"major")},u=function(i){t._drawTick(e.getAngleByValue(i,!0),c,"minor")}):(m=function(){},u=function(){}),g="none"!==t.labelsVisibility&&!1!==t._plotLabels?function(e,i,r){t._drawLabel(e,i,l.labelDistance,r)}:function(){},void 0===t.inverted||!t.inverted&&!t.rightToLeft||t.rightToLeft&&t.inverted?(p=t.endAngle,h=t.startAngle):(p=t.startAngle,h=t.endAngle),d=e.getAngleByValue(t._drawMin,!1),m(d),n[t._drawMin]=!0,g(d,t.min,!1);let b,f,_=t._drawMin-e.getPreciseModulo(t._drawMin,r);t._drawMin>=0&&(_+=r);for(let e=_;e>=t._drawMin;e-=a)b=e;for(d=e.getAngleByValue(_,!1),m(d),n[_]=!0,2*Math.PI*t._measurements.innerRadius*(this._getAngleDifference(p,e.getAngleByValue(_,!1,!0))/360)>i&&g(d,this.getActualValue(_),_<t._drawMax),f=_+r;f<t._drawMax-r;f+=r)d=e.getAngleByValue(f,!1),m(d),n[f]=!0,g(d,this.getActualValue(f),!0);if(void 0===n[f]&&f<=t._drawMax&&(d=e.getAngleByValue(f,!1),m(d),n[f]=!0,2*Math.PI*t._measurements.innerRadius*(this._getAngleDifference(h,e.getAngleByValue(f,!1,!0))/360)>=i&&g(d,this.getActualValue(f),!0),t._normalizedStartAngle!==t.endAngle&&(d=e.getAngleByValue(t._drawMax,!1),m(d),n[t._drawMax]=!0,2*Math.PI*t._measurements.innerRadius*(this._getAngleDifference(h,p)/360)>=i&&g(d,t.max,!1))),t.logarithmicScale)this.drawGaugeLogarithmicScaleMinorTicks(n,r,u);else for(let e=b;e<t._drawMax;e+=a)n[e]||u(e)}updateToolTipAndValue(t,e,i){const r=this.context,a=r.logarithmicScale;r._updateTooltipValue(t),a&&(t=parseFloat(Math.pow(10,parseFloat(t)).toFixed(11)));const n=t.toString();r._number=t,r._drawValue=a?Math.log10(n):t,n!==e&&i&&(r.value=r._discardDecimalSeparator(n),r._programmaticValueIsSet||r.$.fireEvent("change",{value:r.value,oldValue:e}),r.$.hiddenInput&&(r.$.hiddenInput.value=r.value),r._setAriaValue("valuenow"))}validateInterval(t){const e=this.context,i=e._maxObject-e._minObject;t<=0&&(t=1),e._validInterval=Math.min(parseFloat(t),i),e.interval=e._validInterval}getCoercedValue(t,e,i){const r=this.context;if(!r.coerce)return t;let a,n,l=!r.logarithmicScale;if(r.customInterval){const n=r.customTicks;if(0===n.length)return t;l=l||i,a=!1!==e?parseFloat(r._drawMin):r._minObject;let o=Math.abs(a-t),s=a;for(let e=0;e<n.length;e++){const i=this.createDescriptor(n[e]),r=l?i:Math.log10(i),a=Math.abs(r-t);a<o&&(o=a,s=r)}return s}!1!==e?(a=parseFloat(r._drawMin),n=parseFloat(r._drawMax)):(a=parseFloat(r.min),n=parseFloat(r.max));let o=t-a,s=this.getPreciseModulo(o,parseFloat(r.interval)),c=this.roundCoefficient;if(0===s)return t;0===this.roundCoefficient&&(c=12);let m=parseFloat((o-s).toFixed(c)),u=m+parseFloat(r.interval);if(r.max-r.min<=parseFloat(r.interval)&&l){let e=a,i=n;return t>=e+(i-e)/2?i:e}if(Math.abs(o-m)<Math.abs(o-u))return m+a;{const t=u+a;return t>n?m+a:t}}updateValue(t){const e=this.context,i=this.validate(t,e._minObject,e._maxObject),r=e.value;t.toString()!==r.toString()||e._scaleTypeChangedFlag?(e.value=t.toString(),e._number=i,e._programmaticValueIsSet||e.$.fireEvent("change",{value:e.value,oldValue:r})):e.value="string"==typeof t?t:t.toString(),e._drawValue=e.logarithmicScale?Math.log10(i).toString():i.toString(),e._moveThumbBasedOnValue(e._drawValue),e.$.hiddenInput&&(e.$.hiddenInput.value=e.value),e._setAriaValue("valuenow")}getValuePerPx(t,e){return parseFloat(t)/e}restrictValue(t){t[1]<t[0]&&(t[1]=t[0])}lockRotation(t,e){const i=this.context;if(t&&e<i._number){if(i._lockCW=!0,e<i._maxObject)return i._maxObject}else if(!t&&e>i._number&&(i._lockCCW=!0,e>i._minObject))return i._minObject}getAngleRangeCoefficient(){const t=this.context;t._angleRangeCoefficient=t._angleDifference/t._range}}),Smart.Utilities.Assign("ComplexNumericProcessor",class extends Smart.Utilities.BaseNumericProcessor{constructor(t,e){super(t,e),this.context=t}createDescriptor(t,e,i,r,a,n){let l;return l=n||(t.constructor===this.complexConstructor?new this.complexConstructor(t.realPart,t.imaginaryPart):new this.complexConstructor(t)),r&&(l=this.validate(l,this.context._minObject,this.context._maxObject)),l}validate(t,e,i){let r=t;return e!==-1/0?-1===this.compareComplexNumbers(t,e)&&(r=new this.complexConstructor(e.realPart,e.imaginaryPart)):i!==1/0&&1===this.compareComplexNumbers(t,i)&&(r=new this.complexConstructor(i.realPart,i.imaginaryPart)),r}compare(t,e,i){return!0!==i?0!==this.compareComplexNumbers(t,e):this.compareComplexNumbers(t,e)}validateMinMax(t,e){const i=this.context;t&&(null===i.min||i._regexSpecial.inf.test(i.min)?(i.min=-1/0,i._minObject=-1/0):i._minObject=new this.complexConstructor(i.min)),e&&(null===i.max||i._regexSpecial.inf.test(i.max)?(i.max=1/0,i._maxObject=1/0):i._maxObject=new this.complexConstructor(i.max))}incrementDecrement(t,e){let i=new this.complexConstructor(t.realPart,t.imaginaryPart),r=this.context._spinButtonsStepObject;return"add"===e?(i.realPart+=r.realPart,i.imaginaryPart+=r.imaginaryPart):(i.realPart-=r.realPart,i.imaginaryPart-=r.imaginaryPart),i}render(t){let e=t;if(!1===this.context._regexSpecial.nonNumericValue.test(t)){let t,i=e.realPart,r=e.imaginaryPart,a=this.context.significantDigits,n=this.context.precisionDigits;r>=0?t="+":(t="-",r=Math.abs(r));const l=new Smart.Utilities.NumberRenderer(i),o=new Smart.Utilities.NumberRenderer(r);this.context.scientificNotation?(i=l.toScientific(a,n),r=o.toScientific(a,n)):(i=l.toDigits(a,n),r=o.toDigits(a,n)),e=`${i} ${t} ${r}i`}return e}compareComplexNumbers(t,e){if(t instanceof this.complexConstructor==0||e instanceof this.complexConstructor==0)return-1;const i=t.realPart,r=e.realPart;if(i<r)return-1;if(i>r)return 1;{const i=t.imaginaryPart,r=e.imaginaryPart;return i<r?-1:i>r?1:0}}}),Smart.Utilities.Assign("NumberRenderer",class{constructor(t){const e=this;e.numericValue=t,e.powersToPrefixes={24:"Y",21:"Z",18:"E",15:"P",12:"T",9:"G",6:"M",3:"k",0:"","-3":"m","-6":"u","-9":"n","-12":"p","-15":"f","-18":"a","-21":"z","-24":"y"},e.localizationObject={currencysymbol:"$",currencysymbolposition:"before",decimalseparator:".",thousandsseparator:",",defaultPrecision:2}}isENotation(t){return new RegExp(/e/i).test(t)}largeExponentialToDecimal(t){let e;void 0===t&&(t=this.numericValue,e=!0);let i=t.toString().toLowerCase(),r=i.indexOf("e"),a=new Smart.Utilities.BigNumber(i.slice(0,r)),n=i.slice(r+1,r+2);"+"!==n&&"-"!==n&&(i=i.slice(0,r)+"e+"+i.slice(r+1),n="+");let l=i.slice(r+2),o=new Smart.Utilities.BigNumber(10).pow(n+(e?Math.min(20,l):l));return a.multiply(o).toString()}bigNumberToExponent(t,e){let i=this.numericValue;i.constructor!==Smart.Utilities.BigNumber&&(i=new Smart.Utilities.BigNumber(i));const r=i._f;let a=i.toString();if(r<=10)return e?parseFloat(a).toExponential(null!==t?t-1:void 0):new Smart.Utilities.NumberRenderer(parseFloat(a)).toDigits(t);if(t>=r&&!e)return a;{let n;!1===i._s?n="":(n="-",a=a.slice(1)),parseFloat(a.slice(t,t+1))>=5&&(a=new Smart.Utilities.BigNumber(a.slice(0,t)).add(1).toString());let l=a.slice(1,t);if(e)t--,l.length>0&&t>l.length?l+="0".repeat(t-l.length):0===l.length&&(l="0".repeat(t));else for(;l.length>0&&"0"===l.charAt(l.length-1);)l=l.slice(0,l.length-1);const o=l.length>0?".":"",s=r-1;return n+a.slice(0,1)+o+l+"E+"+s}}toScientific(){const t=this;let e;if(e=t.numericValue._d?t.bigNumberToExponent(null!==arguments[0]?arguments[0]:arguments[1]+1,!0).toLowerCase():t.numericValue<=-1||t.numericValue>=1?Number(t.toDigits(arguments[0],arguments[1])).toExponential():Number(t.numericValue).toExponential(),isNaN(e))return e;const i=e.indexOf("e");let r=parseInt(e.slice(i+1),10),a=parseFloat(e.slice(0,i)),n=new Smart.Utilities.NumberRenderer(a);if(r<0){let e=n.toDigits(arguments[0],arguments[1]);if(e=parseFloat(e).toExponential(),"0"===e.charAt(e.length-1)){let e=0;for(;r%3!=0;)r--,e++;if(e){const t=Smart.Utilities.BigNumber.ignoreBigIntNativeSupport;Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=!0,a=parseFloat(new Smart.Utilities.BigNumber(a).multiply(Math.pow(10,e)).toString()),Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=t}n.numericValue=a,a=n.toDigits(arguments[0],arguments[1]),n.numericValue=a/1e3;const i=n.toDigits(arguments[0],arguments[1]);return i>=1&&(a=i,r+=3),a+t.powersToPrefixes[r.toString()]}}let l=0;if(l=Math.abs(r)>24?r-r/Math.abs(r)*24:r%3,l>0)for(let t=0;t<l;t++)a*=10;else if(l<0){const t=Smart.Utilities.BigNumber.ignoreBigIntNativeSupport;Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=!0,a=parseFloat(new Smart.Utilities.BigNumber(a).multiply(Math.pow(10,l)).toString()),Smart.Utilities.BigNumber.ignoreBigIntNativeSupport=t}if(r>0){const t=a>=0?0:1,r=e.slice(t,i).length-l-2;r>=0&&(a=a.toFixed(r))}let o=Number(a).toExponential();o=parseFloat(o.charAt(o.length-1)),n.numericValue=a,a=n.toDigits(arguments[0],arguments[1]);let s=Number(a).toExponential(),c=0;s=parseFloat(s.charAt(s.length-1)),s!==o&&s%3==0&&(a=parseFloat(a)/Math.pow(10,s),n.numericValue=a,a=n.toDigits(arguments[0],arguments[1]),c=s);const m=r-l+c;return a+t.powersToPrefixes[m.toString()]}bigNumberToScientific(){const t=this,e=t.numericValue._f-1,i=parseInt(e,10)%3,r=parseInt(e,10)-i;let a,n,l=t.numericValue.toString();if("-"===l.charAt(0)?(a="-",l=l.slice(1)):a="",null!==arguments[0])for(n=l.slice(0,arguments[0]),parseFloat(l.slice(arguments[0],arguments[0]+1))>=5&&(n=new Smart.Utilities.BigNumber(n).add(1).toString());n.length>1+i&&"0"===n.charAt(n.length-1);)n=n.slice(0,n.length-1);else null!==arguments[1]&&(n=l.slice(0,arguments[1]+1),parseFloat(l.slice(arguments[1]+1,arguments[1]+2))>=5&&(n=new Smart.Utilities.BigNumber(n).add(1).toString()),arguments[1]+i>n.length-1&&(n+="0".repeat(arguments[1]+i-n.length+1)));return n.length>1+i&&(n=n.slice(0,1+i)+"."+n.slice(1+i)),a+n+t.powersToPrefixes[r.toString()]}toDigits(t,e){const i=this;let r;return r=null!==t?i.applySignificantDigits(t):null!==e?i.applyPrecisionDigits(e):i.applySignificantDigits(8),r}applySignificantDigits(t){const e=this;function i(t){for(;"0"===t.charAt(t.length-1);)t=t.slice(0,-1);return"."===t.charAt(t.length-1)&&(t=t.slice(0,-1)),t}t=Math.max(1,Math.min(t,21));let r=parseFloat(e.numericValue).toPrecision(t).toUpperCase();if(-1!==r.indexOf("."))if(e.isENotation(r)){const t=r.indexOf("."),e=r.indexOf("E");let a=r.slice(t,e);a=i(a),r=r.slice(0,t)+a+r.slice(e)}else r=i(r);return r}applyPrecisionDigits(t){const e=this;t=Math.max(0,Math.min(t,20));let i=parseFloat(e.numericValue).toFixed(t);return e.isENotation(i)&&(i=e.largeExponentialToDecimal(i)+"."+"0".repeat(t)),i}getLogarithm(t){const e=this.numericValue;let i;if(void 0===t&&(t=10),10===t)try{i=Math.log10(e)}catch(t){i=Math.log(e)/Math.log(10)}else i=Math.log(e)/Math.log(t);return i}applySeparators(t,e){const i=this,r=(t=t.toString()).indexOf(".");if(-1!==r){const a=t.slice(0,r),n=t.slice(r+1);return i.applyThousandsSeparator(a,e)+i.localizationObject.decimalseparator+n}return i.applyThousandsSeparator(t,e)}applyThousandsSeparator(t,e){if(e)return t;let i="";"-"===(t=t.toString()).charAt(0)&&(i="-",t=t.slice(1));let r=t.split("").reverse();for(let t=2;t<r.length-1;t+=3)r[t]=this.localizationObject.thousandsseparator+r[t];return r.reverse(),r=r.join(""),i+r}formatNumber(t,e,i){const r=this;if(void 0===arguments[3]&&delete r._ignoreMinus,delete r._wordLengthNumber,!/^([a-zA-Z]\d*)$/g.test(e))try{return r.applyCustomFormat(t,e)}catch(e){return t.toString()}const a=e.slice(0,1);let n=e.slice(1);if(""!==n&&(isNaN(parseFloat(n))||parseFloat(n)<0||parseFloat(n)>99?n="":parseFloat(n)%1!=0&&(n=Math.round(n))),t._d)r.inputFormat="integer";else{if(t.imaginaryPart)return r.formatComplexNumber(t,e,a,n);r.inputFormat="floatingPoint"}let l,o=new Smart.Utilities.NumericProcessor(r,"inputFormat"),s=o.createDescriptor(t);switch(r._wordLengthNumber=o.getWordLength(i||"int32"),"integer"===r.inputFormat&&(s=o.round(s)),r.numericValue=s,a){case"C":case"c":return""===n&&(n=r.localizationObject.defaultPrecision),n=parseFloat(n),l="floatingPoint"===r.inputFormat?r.applyPrecisionDigits(n):s.toString()+(n>0?"."+"0".repeat(n):""),l=r.applySeparators(l),"before"===r.localizationObject.currencysymbolposition?"-"===l.charAt(0)?"-"+r.localizationObject.currencysymbol+l.slice(1):r.localizationObject.currencysymbol+l:l+" "+r.localizationObject.currencysymbol;case"D":case"d":{if(l=s,"floatingPoint"===r.inputFormat&&(l=Math.round(s)),l=l.toString(),""===n)return l;let t="";"-"===l.charAt(0)&&(t="-",l=l.slice(1));const e=n-l.length;return e>0&&(l="0".repeat(e)+l),t+l}case"E":case"e":case"U":case"u":{""===n&&(n=6),l="floatingPoint"===r.inputFormat?s.toExponential(n):r.bigNumberToExponent(parseFloat(n)+1,!0).toLowerCase();const t=l.indexOf("e"),e=l.slice(t+2).length;return e<3&&(l=l.slice(0,t+2)+"0".repeat(3-e)+l.slice(t+2)),"u"===a.toLowerCase()?r.exponentialToSuperscript(r.applySeparators(l,!0)):("E"===a&&(l=l.toUpperCase()),r.applySeparators(l,!0))}case"F":case"f":case"N":case"n":return""===n&&(n=r.localizationObject.defaultPrecision),n=parseFloat(n),l="floatingPoint"===r.inputFormat?r.applyPrecisionDigits(n):s.toString()+(n>0?"."+"0".repeat(n):""),r.applySeparators(l,"f"===a.toLowerCase());case"G":case"g":{if(""===n||"0"===n)if("floatingPoint"===r.inputFormat)n=15;else switch(i){case"int8":case"uint8":n=3;break;case"int16":case"uint16":n=5;break;case"int64":n=19;break;case"uint64":n=20;break;default:n=10}n=parseFloat(n);let e=r.formatNumber(t,"E"+n,i),l=e.indexOf("E");const o=parseInt(e.slice(l+1),10);if(o>-5&&o<n)return"floatingPoint"===r.inputFormat?r.applySeparators(r.applySignificantDigits(n),!0):s.toString();if(o>-100&&o<100&&(e=e.slice(0,l+2)+e.slice(l+3)),-1!==e.indexOf(r.localizationObject.decimalseparator)){for(;"0"===e.charAt(l-1);)e=e.slice(0,l-1)+e.slice(l),l=e.indexOf("E");e.charAt(l-1)===r.localizationObject.decimalseparator&&(e=e.slice(0,l-1)+e.slice(l))}return"g"===a&&(e=e.toLowerCase()),e}case"P":case"p":return""===n&&(n=r.localizationObject.defaultPrecision),n=parseFloat(n),"floatingPoint"===r.inputFormat?(r.numericValue=100*s,l=r.applyPrecisionDigits(n)):l=s.multiply(100).toString()+(n>0?"."+"0".repeat(n):""),r.applySeparators(l)+" %";case"B":case"b":case"O":case"o":case"X":case"x":{let e;switch("integer"!==r.inputFormat&&(r.inputFormat="integer",o=new Smart.Utilities.NumericProcessor(r,"inputFormat"),s=o.round(o.createDescriptor(t))),a){case"B":case"b":e=2;break;case"O":case"o":e=8;break;default:e=16}if(l=s.toString(e,r._wordLengthNumber),""!==n){const t=parseFloat(n)-l.length;t>0&&(l="0".repeat(t)+l)}return"x"===a&&(l=l.toLowerCase()),l}case"S":case"s":return""===n&&(n=r.localizationObject.defaultPrecision),n=parseFloat(n),r.toScientific(null,n).replace(".",r.localizationObject.decimalseparator);default:return t.toString()}}formatComplexNumber(t,e,i){const r=this;switch(i){case"E":case"e":case"U":case"u":case"F":case"f":case"G":case"g":case"N":case"n":case"S":case"s":return t.imaginaryPart>=0?r.formatNumber(t.realPart,e)+" + "+r.formatNumber(t.imaginaryPart,e)+"i":r.formatNumber(t.realPart,e)+" - "+r.formatNumber(Math.abs(t.imaginaryPart),e)+"i";default:return t.toString()}}toString(t,e,i){return e?this.formatNumber(t,e,i):t.toString()}applyCustomFormat(t,e){const i=this,r=(e=(e=e.replace(/_.|\[\w*\]|\*/g,"")).replace(/\?/g,"#")).split(";");if("string"==typeof t&&isNaN(t))return r[r.length-1].replace(/"/g,"").replace(/@/g,t.toString());if(t._d)i.inputFormat="integer";else{if(t.imaginaryPart)return t.toString();t=parseFloat(t),i.inputFormat="floatingPoint"}let a=new Smart.Utilities.NumericProcessor(i,"inputFormat"),n=a.createDescriptor(t);"integer"===i.inputFormat&&(n=a.round(n)),i.numericProcessor=a;const l=i.getRelevantFormatSection(r,n);if(void 0===l)return t.toString();if(-1!==l.indexOf("@"))return r[r.length-1].replace(/"/g,"").replace(/@/g,t.toString());const o=-1!==l.replace(/".*"/g,"").indexOf("%"),s=i.getTextParts(l);if(-1!==s.main.toLowerCase().indexOf("e"))return i.applyCustomExponentialFormat(n,s,a);if(-1!==s.main.indexOf("/"))return i.applyCustomFractionalFormat(n,s,a);if(o&&("integer"===i.inputFormat?n=n.multiply(100):n*=100),""===s.main){if(!o)return s.suffix;let t=n.toString();return i._ignoreMinus&&"-"===t.charAt(0)&&(t=t.slice(1)),t+s.suffix}let c=s.main.replace(/[^0#,. \/]/g,""),m=c.indexOf(".");for(-1!==m&&(c=c.substring(0,m+1)+c.substring(m+1).replace(/\./g,""),"."===c.charAt(c.length-1)&&(c=c.slice(0,c.length-1)),0===m&&(c="#"+c));","===c.charAt(c.length-1);)c=c.slice(0,c.length-1),"floatingPoint"===i.inputFormat?n/=1e3:n=n.multiply(.001);"integer"===i.inputFormat&&(n=a.round(n));const u=-1!==c.indexOf(",");c=c.replace(/,/g,"");const g=c.split("."),d=g[0];let p=g[1],h="";if(1===g.length)return"floatingPoint"===i.inputFormat&&(n=a.round(n)),h=n.toString(),i.setTextParts(i.formatWholeNumber(h,d,u),s);h=n.toString();let b=h.split("."),f=i.formatWholeNumber(b[0],d,u),_=b[1]||"";if(p.length<=_.length&&(h=parseFloat(n.toFixed(p.length)).toString(),b=h.split("."),f=i.formatWholeNumber(b[0],d,u),_=b[1]||"",_))return i.setTextParts(f+i.localizationObject.decimalseparator+_.slice(0,p.length),s);p=p.slice(_.length-p.length);let S=p.lastIndexOf("0");return-1===S?""===_?i.setTextParts(f,s):i.setTextParts(f+i.localizationObject.decimalseparator+_,s):i.setTextParts(f+i.localizationObject.decimalseparator+_+"0".repeat(S+1),s)}getRelevantFormatSection(t,e){const i=this,r=i.numericProcessor.compare(e,0,!0);if(1===r)return t[0];let a,n;return t.length>=3?(i._ignoreMinus=!0,a=1,n=2):2===t.length?(i._ignoreMinus=!0,n=0,a=1):1===t.length&&(n=0,a=0),0===r?t[n]:-1===r?t[a]:void 0}getTextParts(t){const e=t.replace(/"[^"]*"/g,""),i=t.match(/"[^"]*"/g),r=e.search(/0|#|\./g),a=Math.max(e.lastIndexOf("0"),e.lastIndexOf("#"),e.lastIndexOf("."),e.lastIndexOf(",")),n=e.slice(r,a+1);if(""===n)return{prefix:"",main:"",suffix:t.replace(/"/g,"")};let l=t.indexOf(n),o=l+n.length;if(i)for(let e=0;e<i.length;e++){const r=t.indexOf(i[e]);l>=r&&o<=r+i[e].length&&(l=t.indexOf(n,r+i[e].length),o=l+n.length)}return{prefix:t.slice(0,l).replace(/"/g,""),main:n,suffix:t.slice(o).replace(/"/g,"")}}applyCustomExponentialFormat(t,e,i){const r=this;let a,n=e.main;const l=-1!==n.indexOf(",");n=n.replace(/[^0#.eE+-]/g,"");const o=n.toLowerCase().indexOf("e");n=n.substring(0,o+1)+n.substring(o+1).replace(/[eE\.]/g,"");const s=n.charAt(o),c=n.indexOf(".");-1!==c&&(n=n.substring(0,c+1)+n.substring(c+1).replace(/\./g,"")),"."===n.charAt(n.length-1)&&(n=n.slice(0,n.length-1));const m=n.split(s);let u=m[0];const g=u.split("."),d=g[0],p=g[1],h=m[1];let b=t.toString().split(".")[0].replace(/-/,""),f=0;if("0"===b&&i.compare(t,0)){let e=d.length-1;for(;0===parseInt(t);)f++,t*=10;b=t.toString().split(".")[0].replace(/-/,""),f+=e,t*=Math.pow(10,e)}if(l&&(u=u.slice(0,1)+","+u.slice(1)),b.length<=d.length)a=r.formatNumber(t,u,void 0,!0)+s+r.formatExponent(0-f,h);else{const e=b.length-d.length;let n="floatingPoint"===r.inputFormat?t/Math.pow(10,e):t.divide(Math.pow(10,e));p||(a=r.applyThousandsSeparator(i.round(n).toString(),!l)+s+r.formatExponent(e-f,h));let o=n.toString().split(".")[1]||"";o.length===p.length?a=r.applySeparators(n,!l)+s+r.formatExponent(e-f,h):o.length<p.length?a=r.formatNumber(n,u,void 0,!0)+s+r.formatExponent(e-f,h):(n="floatingPoint"===r.inputFormat?n.toFixed(p.length):n=i.round(t.divide(Math.pow(10,e-p.length))).divide(Math.pow(10,p.length)),a=r.formatNumber(parseFloat(n),u,void 0,!0)+s+r.formatExponent(e-f,h))}return r.setTextParts(a,e)}formatExponent(t,e){let i;return-1!==["+","-"].indexOf(e.charAt(0))&&(i=e.charAt(0),(t>0&&"-"===i||t<0&&"+"===i)&&(i=void 0)),t<0&&(t=Math.abs(t),i="-"),e=e.replace(/[+-]/g,""),(i||"")+(t=this.formatNumber(t,e,void 0,!0))}formatWholeNumber(t,e,i){const r=this;let a="";if("-"===t.charAt(0)&&(r._ignoreMinus||(a="-"),t=t.slice(1)),"0"===t){if(e==="#".repeat(e.length))return a;t=""}if(e.length<=t.length)return a+r.applyThousandsSeparator(t,!i);for(let i=(e=e.slice(0,e.length-t.length)).length-1;i>=0;i--)"0"===e.charAt(i)&&(t="0"+t);return a+r.applyThousandsSeparator(t,!i)}setTextParts(t,e){return e.prefix+t+e.suffix}applyCustomFractionalFormat(t,e,i){const r=this,a=/^([0#,]+[ ]+)?([0#,]+\/[0#,]+)$/;let n,l=e.main.trim();if(!a.test(l))return t.toString();const o=a.exec(l);if(o[2]=o[2].replace(/,/g,""),"integer"===r.inputFormat){const i=o[2].split("/");return void 0===o[1]?n=r.formatNumber(t,i[0],void 0,!0)+"/"+r.formatNumber(1,i[1],void 0,!0):(n=r.formatNumber(t,o[1].trim(),void 0,!0),-1!==o[2].indexOf("0")&&(n+=" "+r.formatNumber(0,i[0],void 0,!0)+"/"+r.formatNumber(1,i[1],void 0,!0))),r.setTextParts(n,e)}if(void 0===o[1])n=(t<0?"-":"")+r.formatAsFraction(Math.abs(t),o[2]);else{const e=o[1].trim(),a=o[2];n=r.formatNumber(parseInt(t,10),e,void 0,!0)+" "+r.formatAsFraction(i.getPreciseModulo(Math.abs(t),1),a)}return r.setTextParts(n.trim(),e)}formatAsFraction(t,e){const i=this,r=e.split("/");if(0===t)return-1===e.indexOf("0")?"":i.formatNumber(0,r[0],void 0,!0)+"/"+i.formatNumber(1,r[1],void 0,!0);if(t%1==0)return i.formatNumber(t,r[0],void 0,!0)+"/"+i.formatNumber(1,r[1],void 0,!0);const a=[];i.approximateFractions(t,a);const n=r[1].length>=2?2:1;let l=[],o=[];a.forEach((function(e,i){const r=e.denominator.toString().length,a=Math.abs(t-e.numerator/e.denominator);if(void 0===l[r])return o[r]=i,void(l[r]=a);a<l[r]&&(o[r]=i,l[r]=a)}));let s=o[n]?a[o[n]]:a[o[1]];return i.formatNumber(s.numerator,r[0],void 0,!0)+"/"+i.formatNumber(s.denominator,r[1],void 0,!0)}approximateFractions(t,e){const i=[0,1],r=[1,0],a=this.getMaxNumerator(t);let n,l=t,o=NaN;for(let s=2;s<1e3;s++){const c=Math.floor(l);if(i[s]=c*i[s-1]+i[s-2],Math.abs(i[s])>a)return;if(r[s]=c*r[s-1]+r[s-2],n=i[s]/r[s],n===o)return;if(e.push({numerator:i[s],denominator:r[s]}),n===t)return;o=n,l=1/(l-c)}}getMaxNumerator(t){let e=null,i=t.toString().indexOf("E");-1===i&&(i=t.toString().indexOf("e")),e=-1===i?t.toString():t.toString().substring(0,i);let r=null;const a=e.toString().indexOf(".");-1===a?r=e:0===a?r=e.substring(1,e.length):a<e.length&&(r=e.substring(0,a)+e.substring(a+1,e.length));let n=r;const l=n.toString().length,o=t;let s=o.toString().length;0===o&&(s=0);const c=l-s;for(let t=c;t>0&&n%2==0;t--)n/=2;for(let t=c;t>0&&n%5==0;t--)n/=5;return n}exponentialToSuperscript(t){const e=t.indexOf("e"),i=t.slice(e+1).replace(/0{1,2}/,"");let r=t.slice(0,e+1);return r=r.replace("e","×10"),r+=this.toSuperscript(i),r=r.replace("+",""),r}toSuperscript(t,e){const i="-0123456789",r="⁻⁰¹²³⁴⁵⁶⁷⁸⁹";let a="";for(let n=0;n<t.length;n++)if(!0===e){const e=r.indexOf(t.charAt(n));a+=-1!==e?i[e]:t[n]}else{const e=i.indexOf(t.charAt(n));a+=-1!==e?r[e]:t[n]}return a}});

/***/ }),

/***/ 7997:
/***/ (() => {

Smart("smart-numeric-text-box",class extends Smart.BaseElement{static get properties(){return{decimalSeparator:{value:".",type:"string"},dropDownAppendTo:{value:null,type:"any"},enableMouseWheelAction:{value:!1,type:"boolean"},inputFormat:{value:"integer",allowedValues:["integer","floatingPoint","complex"],type:"string"},hint:{value:"",type:"string"},label:{value:"",type:"string"},leadingZeros:{value:!1,type:"boolean"},max:{value:null,type:"any"},messages:{value:{en:{binary:"BIN",octal:"OCT",decimal:"DEC",hexadecimal:"HEX",integerOnly:"smartNumericTextBox: The property {{property}} can only be set when inputFormat is integer.",noInteger:"smartNumericTextBox: the property {{property}} cannot be set when inputFormat is integer.",significantPrecisionDigits:"smartNumericTextBox: the properties significantDigits and precisionDigits cannot be set at the same time."}},type:"object",extend:!0},min:{value:null,type:"any"},name:{value:"",type:"string"},nullable:{value:!1,type:"boolean"},opened:{value:!1,type:"boolean"},outputFormatString:{value:null,type:"string?"},placeholder:{value:"",type:"string"},dropDownEnabled:{value:!1,type:"boolean"},precisionDigits:{value:null,type:"number?"},radix:{value:10,allowedValues:["2","8","10","16",2,8,10,16,"binary","octal","decimal","hexadecimal"],type:"any"},radixDisplay:{value:!1,type:"boolean"},radixDisplayPosition:{value:"left",allowedValues:["left","right"],type:"string"},scientificNotation:{value:!1,type:"boolean"},showDropDownValues:{value:!1,type:"boolean"},showUnit:{value:!1,type:"boolean"},significantDigits:{value:null,type:"number?"},spinButtons:{value:!1,type:"boolean"},spinButtonsDelay:{value:75,type:"number"},spinButtonsInitialDelay:{value:0,type:"number"},spinButtonsPosition:{value:"right",allowedValues:["left","right"],type:"string"},spinButtonsStep:{value:"1",type:"any"},type:{value:"numeric",type:"string",defaultReflectToAttribute:!0,readonly:!0},unit:{value:"kg",type:"string"},validation:{value:"strict",allowedValues:["strict","interaction"],type:"string"},value:{value:"0",type:"any?"},wordLength:{value:"int32",allowedValues:["int8","uint8","int16","uint16","int32","uint32","int64","uint64"],type:"string"}}}static get listeners(){return{mouseenter:"_mouseenterMouseleaveHandler",mouseleave:"_mouseenterMouseleaveHandler",resize:"_resizeHandler","downButton.click":"_downButtonClickHandler","downButton.mouseenter":"_mouseenterMouseleaveHandler","downButton.mouseleave":"_mouseenterMouseleaveHandler","dropDown.click":"_dropDownItemClickHandler","dropDown.mouseout":"_mouseenterMouseleaveHandler","dropDown.mouseover":"_mouseenterMouseleaveHandler","input.blur":"_inputBlurHandler","input.change":"_inputChangeHandler","input.focus":"_inputFocusHandler","input.keydown":"_inputKeydownHandler","input.keyup":"_inputKeyupHandler","input.paste":"_inputPasteHandler","input.wheel":"_inputWheelHandler","radixDisplayButton.click":"_radixDisplayButtonClickHandler","radixDisplayButton.mouseenter":"_mouseenterMouseleaveHandler","radixDisplayButton.mouseleave":"_mouseenterMouseleaveHandler","upButton.click":"_upButtonClickHandler","upButton.mouseenter":"_mouseenterMouseleaveHandler","upButton.mouseleave":"_mouseenterMouseleaveHandler","document.down":"_documentMousedownHandler","document.up":"_documentMouseupHandler"}}static get requires(){return window.NIComplex?{"Smart.Button":"smart.button.js","Smart.Utilities.BigNumber":"smart.math.js","Smart.Utilities.NumericProcessor":"smart.numeric.js"}:{"Smart.Button":"smart.button.js","Smart.Utilities.Complex":"smart.complex.js","Smart.Utilities.BigNumber":"smart.math.js","Smart.Utilities.NumericProcessor":"smart.numeric.js"}}static get styleUrls(){return["smart.button.css","smart.numerictextbox.css"]}template(){return'<div id="container" class="smart-container" role="presentation">\n                <span id="label" inner-h-t-m-l="[[label]]" class="smart-label"></span>\n                <div id="radixDisplayButton" class="smart-unselectable smart-input-addon smart-drop-down-button smart-numeric-text-box-component smart-numeric-text-box-radix-display" role="button" aria-haspopup="listbox"></div>\n                <input id="input" type="text" spellcheck="false" class="smart-input smart-numeric-text-box-component" placeholder="[[placeholder]]" readonly="[[readonly]]" disabled="[[disabled]]" name="[[name]]" aria-label="[[placeholder]]" />\n                <div id="unitDisplay" class="smart-unselectable smart-input-addon smart-drop-down-button smart-numeric-text-box-component smart-numeric-text-box-unit-display" role="presentation"></div>\n                <div id="spinButtonsContainer" class="smart-input-addon smart-numeric-text-box-component smart-spin-buttons-container" role="presentation">\n                    <smart-repeat-button initial-delay="[[spinButtonsInitialDelay]]" delay="[[spinButtonsDelay]]" animation="[[animation]]" unfocusable id="upButton" class="smart-spin-button" aria-label="Increment" right-to-left="[[rightToLeft]]">\n                        <div class="smart-arrow smart-arrow-up" role="presentation" aria-hidden="true"></div>\n                    </smart-repeat-button>\n                    <smart-repeat-button initial-delay="[[spinButtonsInitialDelay]]" delay="[[spinButtonsDelay]]" animation="[[animation]]" unfocusable id="downButton" class="smart-spin-button" aria-label="Decrement" right-to-left="[[rightToLeft]]">\n                        <div class="smart-arrow smart-arrow-down" role="presentation" aria-hidden="true"></div>\n                    </smart-repeat-button>\n                </div>\n                <ul id="dropDown" class="smart-visibility-hidden smart-drop-down smart-numeric-text-box-drop-down" role="listbox">\n                    <li id="dropDownItem2" class="smart-list-item" data-value="2" role="option"></li>\n                    <li id="dropDownItem8" class="smart-list-item" data-value="8" role="option"></li>\n                    <li id="dropDownItem10" class="smart-list-item" data-value="10" role="option"></li>\n                    <li id="dropDownItem16" class="smart-list-item" data-value="16" role="option"></li>\n                </ul>\n                <span id="hint" class="smart-hint smart-hidden" inner-h-t-m-l="[[hint]]"></span>\n            </div>'}attached(){const e=this;super.attached(),e.isCompleted&&(e._positionDetection.dropDownAttached(),e._positionDetection.checkBrowserBounds())}detached(){const e=this;super.detached(),e.opened&&e._closeRadix(!0),e._positionDetection&&e._positionDetection.dropDownDetached()}ready(){super.ready()}render(){const e=this;e._numericProcessor=new Smart.Utilities.NumericProcessor(e,"inputFormat"),e._numberRenderer=new Smart.Utilities.NumberRenderer,e._numberRenderer.localizationObject.decimalseparator=e.decimalSeparator,e._positionDetection=new Smart.Utilities.PositionDetection(e,e.$.dropDown,e.$.container,"_closeRadix"),e._positionDetection.getDropDownParent(!0),e._dropDownListPosition="bottom",e.rightToLeft&&(e.spinButtonsPosition="right"===e.spinButtonsPosition?"left":"right"),e._setIds(),e.setAttribute("aria-describedby",e.$.unitDisplay.id+" "+e.$.hint.id),e.getAttribute("aria-labelledby")||e.setAttribute("aria-labelledby",e.$.label.id),e.$.radixDisplayButton.setAttribute("aria-owns",e.$.dropDown.id),e.rightToLeft&&null!==e.dropDownAppendTo&&e.$.dropDown.setAttribute("right-to-left",""),e._radixPrefixes={10:"d",2:"b",8:"o",16:"x"},e._regex={2:new RegExp(/^[0-1]+$/),8:new RegExp(/^[0-7]+$/),10:new RegExp(/^[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?$/),16:new RegExp(/^[0-9a-f]+$/i)},e._regexSpecial={nan:new RegExp(/^(nan)$/i),inf:new RegExp(/^((-?inf(inity)?)|([+\-]?∞))$/i),nonNumericValue:new RegExp(/^$|(^((nan)|((-?inf(inity)?)|([+\-]?∞))|(null))$)/i),exaValue:new RegExp(/^[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[E])([+\-]\d*)?i$/)},e._initialDropDownOptionsSet=!1,"left"===e.spinButtonsPosition&&e.$.container.insertBefore(e.$.spinButtonsContainer,e.$.label.nextElementSibling),"right"===e.radixDisplayPosition&&e.$.container.insertBefore(e.$.radixDisplayButton,e.$.unitDisplay.nextElementSibling),e._setInitialComponentDisplay(),e._initialAdjustments(),e._refreshShape(),e._initialized=!0,super.render()}_setIds(){const e=this;e.$.label.id||(e.$.label.id=e.id+"Label"),e.$.radixDisplayButton.id||(e.$.radixDisplayButton.id=e.id+"RadixDisplayButton"),e.$.unitDisplay.id||(e.$.unitDisplay.id=e.id+"UnitDisplay"),e.$.dropDown.id||(e.$.dropDown.id=e.id+"DropDown"),e.$.hint.id||(e.$.hint.id=e.id+"Hint")}_refreshShape(){const e=this.$.container.querySelectorAll(".smart-numeric-text-box-component:not(.smart-hidden)");Array.from(this.$.container.getElementsByClassName("smart-numeric-text-box-component")).forEach((e=>e.classList.remove("smart-numeric-text-box-component-border-left","smart-numeric-text-box-component-border-right"))),e.length>0&&(e[0].classList.add("smart-numeric-text-box-component-border-left"),e[e.length-1].classList.add("smart-numeric-text-box-component-border-right"))}val(e,t){const n=this,i=null!==e&&"object"==typeof e&&0===Object.keys(e).length;if(void 0===e||!1!==i)return n.value;{const i=n.value;if((""===e||null===e)&&null===i)return null;if(null===e)return n._triggerChangeEvent="strict"===n.validation,n._validate(!1,null),n._triggerChangeEvent=!1,void(n._programmaticValueIsSet=!0);if((e=e.toString()).toUpperCase()===i.toString().toUpperCase())return e;void 0===t?(n._triggerChangeEvent="strict"===n.validation,n._validate(!1,e),n._triggerChangeEvent=!1):n._setValue(e),n._programmaticValueIsSet=!0}}focus(){this.$.input.focus()}select(){this.$.input.select()}_updateSpinButtonsStepObject(){const e=this;e._spinButtonsStepObject=e._numericProcessor.createDescriptor(e.spinButtonsStep,!0)}_setInitialComponentDisplay(){const e=this;!1===e.spinButtons&&e.$spinButtonsContainer.addClass("smart-hidden"),!1===e.radixDisplay&&e.$radixDisplayButton.addClass("smart-hidden"),!1===e.showUnit&&e.$unitDisplay.addClass("smart-hidden")}_initialAdjustments(){const e=this;e._radixNumber=e._getRadix(e.radix),e._wordLengthNumber=e._numericProcessor.getWordLength(e.wordLength),e._validatePropertyCompatibility(),e._numericProcessor.validateMinMax(!0,!0),e._updateSpinButtonsStepObject(),e._validate(!0),e._programmaticValueIsSet=!0,e._cachedInputValue=e.$.input.value,void 0===e._editableValue&&(e._editableValue=e._cachedInputValue),e.$.radixDisplayButton.innerHTML=e._radixPrefixes[e._radixNumber],e.$.unitDisplay.innerHTML=e.unit,e.disabled&&(e.$.upButton.disabled=!0,e.$.downButton.disabled=!0),e.opened&&(e.dropDownEnabled&&!e.disabled&&null!==e.value?e._openRadix():e.opened=!1),e.$.radixDisplayButton.setAttribute("aria-expanded",e.opened),e._setFocusable()}_validatePropertyCompatibility(){const e=this;"integer"!==e.inputFormat?(10!==e._radixNumber&&e.error(e.localize("integerOnly",{property:"radix"})),e.radixDisplay&&e.error(e.localize("integerOnly",{property:"radixDisplay"})),e.dropDownEnabled&&e.error(e.localize("integerOnly",{property:"dropDownEnabled"})),"int32"!==e.wordLength&&e.error(e.localize("integerOnly",{property:"wordLength"}))):null!==e.precisionDigits&&e.error(e.localize("noInteger",{property:"precisionDigits"})),null===e.significantDigits&&null===e.precisionDigits?e.significantDigits=8:null!==e.significantDigits&&null!==e.precisionDigits&&e.error(e.localize("significantPrecisionDigits"))}_validate(e,t){const n=this;let i;if(e)i=n.value,void 0===i&&(i=n.nullable?null:"0");else if(void 0===t||null===t&&!n.nullable){if(i=n.$.input.value,i===n.value&&!0!==n._programmaticValueIsSet)return void(n.$.input.value=n._cachedInputValue)}else i=t;if(n.nullable&&(null===i||""===i))return n.value=null,n._number=null,n.$.input.value="",n._cachedInputValue="",n._editableValue="",void n._disableComponents();const a=n._numericProcessor.prepareForValidation(e,t,i);if(void 0===a)return void n._disableComponents();const r=n._numericProcessor.createDescriptor(a.value,!0,!0,!e&&void 0===t||"strict"===n.validation,e||void 0!==t,a.enteredComplexNumber);if(e){n._number=r;let e=n._renderValue(r);n.value=r.toString(),n.$.input.value=e}else n._updateValue(r);n._programmaticValueIsSet=!1,n._disableComponents()}_handleNonNumericValue(e,t,n){const i=this;if("integer"!==i.inputFormat){if(i._regexSpecial.nan.test(n))return void i._handleNaN(e);if(i._regexSpecial.inf.test(n))return void i._handleInfinity(e,t,n)}if(e){let e=i._numericProcessor.createDescriptor(0);i._number=i._validateRange(e);const t=i._renderValue(i._number);i.value=i._number.toString(),i.$.input.value=t}else if(void 0===t)i.$.input.value=i._cachedInputValue;else{const e=i._number.toString();i.value!==e&&(i.value=e)}}_handleNaN(e){const t=this;if(t.$.input.value="NaN",e)t.value=NaN,t._number=NaN;else{const e=t.value;null!==e&&"NaN"===e.toString()||(t.value=NaN,t._number=NaN,t._cachedInputValue="NaN",t._editableValue="NaN",t._triggerChangeEvent&&(t.$.fireEvent("change",{value:NaN,oldValue:e,radix:t._radixNumber}),t._updateTargetValue()))}}_handleInfinity(e,t,n){const i=this;let a,r;if("-"===n.charAt(0)?(a="∞"===n.charAt(1)?"-∞":"-Inf",r=-1/0):(a=-1!==n.indexOf("∞")?"∞":"Inf",r=1/0),r===-1/0&&i.min===-1/0||r===1/0&&i.max===1/0||void 0!==t)if(e)i.value=r,i._number=r,i.$.input.value=a;else{const e=i.value;n!==a&&(i.$.input.value=a),e!==r&&(i.value=r,i._number=r,i._cachedInputValue=a,i._editableValue=a,i._triggerChangeEvent&&(i.$.fireEvent("change",{value:r,oldValue:e,radix:i._radixNumber}),i._updateTargetValue()))}else r===-1/0?i._validate(!1,i.min):i._validate(!1,i.max)}_updateTargetValue(e){const t=this;if(t.dataset.target){const n=document.querySelector(t.dataset.target);if(n){const i=t.dataset.property,a=t.value;i&&void 0!==n[i]&&(n[i]=void 0!==e?e:a)}}}_validateRange(e){const t=this;return e=t._numericProcessor.validate(e,t._minObject,t._maxObject)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const i=this,a=i.$.input;function r(){!0===i._initialDropDownOptionsSet&&i._setDropDownOptions(!0),2!==i._radixNumber&&16!==i._radixNumber||(i._cachedInputValue=i._number.toString(i._radixNumber,i._wordLengthNumber,i.leadingZeros),i._editableValue=i._cachedInputValue,i.$.input.value=i._cachedInputValue)}if(n!=t)switch(e){case"disabled":i._setFocusable(),!0===n?(i.$.upButton.disabled=!0,i.$.downButton.disabled=!0):i._disableComponents();break;case"dropDownAppendTo":i._positionDetection.dropDownAppendToChangedHandler(),i.$.dropDown.removeAttribute("right-to-left"),i.rightToLeft&&null!==n&&i.$.dropDown.setAttribute("right-to-left","");break;case"unfocusable":i._setFocusable();break;case"enableMouseWheelAction":case"placeholder":case"readonly":case"spinButtonsDelay":case"spinButtonsInitialDelay":break;case"value":{if(""===n&&null===t)return;if(null===n||""===n||null===t)return i.value=t,i._triggerChangeEvent="strict"===i.validation,i._validate(!1,n),i._triggerChangeEvent=!1,void(i._programmaticValueIsSet=!0);const e=n.toString(),a=t.toString();a!==e&&(a.toUpperCase()===e.toUpperCase()&&(i.value=t),i._triggerChangeEvent="strict"===i.validation,i._validate(!1,e),i._triggerChangeEvent=!1,i._programmaticValueIsSet=!0);break}case"radix":"integer"===i.inputFormat?i._changeRadix(n):i.error(i.localize("integerOnly",{property:"radix"}));break;case"rightToLeft":null!==i.dropDownAppendTo&&(n?i.$.dropDown.setAttribute("right-to-left",""):i.$.dropDown.removeAttribute("right-to-left")),i.spinButtonsPosition=i.rightToLeft?"left":"right","left"===i.spinButtonsPosition?i.$.container.insertBefore(i.$.spinButtonsContainer,i.$.label.nextElementSibling):i.$.container.insertBefore(i.$.spinButtonsContainer,i.$.dropDown),i._refreshShape();break;case"leadingZeros":"integer"===i.inputFormat&&null!==i._number&&r();break;case"min":case"max":if(null!==n&&(i[`_${e}IsNull`]=!1),i._numericProcessor.validateMinMax("min"===e,"max"===e),"strict"===i.validation)i._triggerChangeEvent=!0,i._validate(!1,i.value),i._triggerChangeEvent=!1;else if(!1===i._regexSpecial.nonNumericValue.test(i.value)){const e=i._numericProcessor.createDescriptor(i._number),t=i._validateRange(e);!0===i._numericProcessor.compare(i.value,t)&&(i._programmaticValueIsSet=!0)}break;case"opened":n?i.dropDownEnabled&&!i.disabled&&null!==i.value?i._openRadix():(i.opened=!1,i.$.radixDisplayButton.setAttribute("aria-expanded",!1)):i._closeRadix(!1,!0);break;case"outputFormatString":n?(i._cachedInputValue=i._numberRenderer.formatNumber(i._number,n),i.$.input.value=i._cachedInputValue):(i._cachedInputValue=i._editableValue,i.$.input.value=i._editableValue);break;case"dropDownEnabled":n?("integer"!==i.inputFormat&&i.error(i.localize("integerOnly",{property:"dropDownEnabled"})),!0===i._initialDropDownOptionsSet&&i._setDropDownOptions(!0)):i.opened&&i._closeRadix(!0);break;case"spinButtons":n?i.$spinButtonsContainer.removeClass("smart-hidden"):i.$spinButtonsContainer.addClass("smart-hidden"),i._refreshShape();break;case"spinButtonsStep":i._updateSpinButtonsStepObject();break;case"significantDigits":case"precisionDigits":if("precisionDigits"===e&&"integer"===i.inputFormat&&i.error(i.localize("noInteger",{property:e})),"significantDigits"===e&&null!==i.precisionDigits?i.precisionDigits=null:"precisionDigits"===e&&null!==i.significantDigits&&(i.significantDigits=null),!1===i._regexSpecial.nonNumericValue.test(i.value)){const e=i._renderValue(i._number);a.value=e}break;case"decimalSeparator":{i._numberRenderer.localizationObject.decimalseparator=i.decimalSeparator;const e=i._discardDecimalSeparator(a.value,t),n=i._applyDecimalSeparator(e),r=i._applyDecimalSeparator(i._discardDecimalSeparator(i._editableValue,t));a.value=n,i._editableValue=r;break}case"spinButtonsPosition":"left"===n?i.$.container.insertBefore(i.$.spinButtonsContainer,i.$.label.nextElementSibling):i.$.container.insertBefore(i.$.spinButtonsContainer,i.$.dropDown),i._refreshShape();break;case"wordLength":if(i._wordLengthNumber=i._numericProcessor.getWordLength(n),"integer"===i.inputFormat&&(i._numericProcessor.validateMinMax(!0,!0),null!==i._number)){let e=i._validateRange(new Smart.Utilities.BigNumber(i._number));i._updateValue(e),i.leadingZeros&&r()}break;case"radixDisplay":n?("integer"!==i.inputFormat&&i.error(i.localize("integerOnly",{property:"radixDisplay"})),i.$radixDisplayButton.removeClass("smart-hidden")):i.$radixDisplayButton.addClass("smart-hidden"),i._refreshShape();break;case"radixDisplayPosition":"left"===n?i.$.container.insertBefore(i.$.radixDisplayButton,i.$.input):i.$.container.insertBefore(i.$.radixDisplayButton,i.$.unitDisplay.nextElementSibling),i._refreshShape();break;case"inputFormat":i._changeInputFormat(t,n);break;case"showUnit":n?i.$unitDisplay.removeClass("smart-hidden"):i.$unitDisplay.addClass("smart-hidden"),i._refreshShape();break;case"unit":i.$.unitDisplay.innerHTML=n;break;case"scientificNotation":if(!1===i._regexSpecial.nonNumericValue.test(i.value)){const e=i._renderValue(i._number);a.value=e}break;case"locale":case"messages":case"showDropDownValues":i.opened?i._setDropDownOptions():i._initialDropDownOptionsSet=!1;break;case"nullable":!0===t&&null===i.value&&i._validate(!1,"0");break;case"validation":"strict"===n&&(i._triggerChangeEvent=!0,i._validate(!1,i.value),i._triggerChangeEvent=!1)}else"string"!=typeof n&&"string"==typeof t&&(i[e]=t);i._cachedInputValue=a.value}_changeInputFormat(e,t){const n=this;n._numericProcessor=new Smart.Utilities.NumericProcessor(n,"inputFormat"),"complex"!==e?("integer"===t&&"floatingPoint"===e&&n._changeFromFloatingPointToIntegerInputFormat(),"floatingPoint"===t&&"integer"===e&&n._changeFromIntegerToFloatingPointInputFormat(),"complex"===t&&n._changeToComplexInputFormat(e),n._updateSpinButtonsStepObject(),null!==n.value&&(n._inputFormatChangedFlag=!0,n._validate(void 0,n._number.toString()),n._inputFormatChangedFlag=!1)):n._changeFromComplexInputFormat(t)}_changeFromComplexInputFormat(e){const t=this;if(t.spinButtonsStep=t._spinButtonsStepObject.realPart,t._updateSpinButtonsStepObject(),"integer"===e?(t.min===-1/0?t.min=null:t.min=t._minObject.realPart,t.max===1/0?t.max=null:t.max=t._maxObject.realPart):(t.min!==-1/0&&(t.min=t._minObject.realPart),t.max!==1/0&&(t.max=t._maxObject.realPart)),t._numericProcessor.validateMinMax(!0,!0),null!==t.value){const e=t._number;t._inputFormatChangedFlag=!0,t._validate(void 0,(void 0!==e.realPart?e.realPart:e).toString()),t._inputFormatChangedFlag=!1}}_changeFromFloatingPointToIntegerInputFormat(){const e=this;e.min===-1/0&&(e.min=null),e.max===1/0&&(e.max=null),e._numericProcessor.validateMinMax(!0,!0)}_changeFromIntegerToFloatingPointInputFormat(){const e=this;e.radixDisplay&&(e.radixDisplay=!1,e.$radixDisplayButton.addClass("smart-hidden")),10!==e._radixNumber&&(e.radix=10,e._radixNumber=10),e._minIsNull?(e.min=-1/0,e._minObject=-1/0):e._minObject=parseFloat(e._minObject.toString()),e._maxIsNull?(e.max=1/0,e._maxObject=1/0):e._maxObject=parseFloat(e._maxObject.toString()),e.dropDownEnabled&&(e.dropDownEnabled=!1)}_changeToComplexInputFormat(e){const t=this;"integer"===e&&(t.radixDisplay&&(t.radixDisplay=!1,t.$radixDisplayButton.addClass("smart-hidden")),t._minIsNull&&(t.min=null),t._maxIsNull&&(t.max=null),t.dropDownEnabled&&(t.dropDownEnabled=!1)),t._numericProcessor.validateMinMax(t.min!==-1/0,t.max!==1/0)}_updateValue(e){const t=this,n=t.$.input.value,i=e.toString(t._radixNumber,t._wordLengthNumber,t.leadingZeros),a=t._renderValue(e),r=t.value,o=t._regexSpecial.nonNumericValue.test(i);if(n===i&&n===t._cachedInputValue||(t.$.input.value=a,t._cachedInputValue=a),t._inputFormatChangedFlag||o&&a!==r||!1===o&&t._numericProcessor.compare(e,t._number)){t._number=t._numericProcessor.createDescriptor(e);const n=t._number.toString();t.value=n,t._setDropDownOptions(!0),t._triggerChangeEvent&&(t.$.fireEvent("change",{value:n,oldValue:r,radix:t._radixNumber}),t._updateTargetValue())}else t.value=t._number.toString()}_setValue(e){const t=this;t.value=e,t.$.input.value=e,t._number=t._numericProcessor.createDescriptor(e,!0),t._setDropDownOptions(!0)}_changeRadix(e){const t=this,n=t._getRadix(e),i=t.radix;if(n===t._radixNumber)return;t.radix=e,t._radixNumber=n;const a=t.$.input,r=a.value;let o,l;null!==t.value?(o=t._number.toString(n,t._wordLengthNumber,t.leadingZeros),l=t._renderValue(o)):l="",a.value=l,t._cachedInputValue=l,t.$.radixDisplayButton.innerHTML=t._radixPrefixes[n],t.$.fireEvent("radixChange",{radix:e,oldRadix:i,displayedValue:l,oldDisplayedValue:r})}_openRadix(){const e=this;if(e.$.fireEvent("opening").defaultPrevented)return void(e.opened=!1);!1===e._initialDropDownOptionsSet&&(e._setDropDownOptions(),e._initialDropDownOptionsSet=!0),null!==e._dropDownParent&&(e.$.dropDown.style.width=e.offsetWidth+"px"),e.$radixDisplayButton.addClass("smart-numeric-text-box-pressed-component"),e.$dropDown.removeClass("smart-visibility-hidden"),e.$.dropDown.style.marginTop=null,e.opened=!0,e._positionDetection.positionDropDown();const t=(1===window.devicePixelRatio?document.documentElement.clientHeight:window.innerHeight)-e.$.dropDown.getBoundingClientRect().top-e.$.dropDown.offsetHeight-parseFloat(getComputedStyle(e.$.dropDown).marginBottom);t<0&&(e.$.dropDown.style.marginTop=t+"px"),e.$.fireEvent("open",{dropDown:e.$.dropDown}),e.$.radixDisplayButton.setAttribute("aria-expanded",!0)}_closeRadix(e,t){const n=this;(n.opened||t)&&(!n.$.fireEvent("closing").defaultPrevented||e?(n.$radixDisplayButton.removeClass("smart-numeric-text-box-pressed-component"),n.$dropDown.addClass("smart-visibility-hidden"),n.opened=!1,n.$.fireEvent("close",{dropDown:n.$.dropDown}),n.$.radixDisplayButton.setAttribute("aria-expanded",!1)):n.opened=!0)}_isLeftButtonPressed(e){const t=0===e.buttons||1===e.which;return 1===e.detail.buttons||t}_isIncrementOrDecrementAllowed(){const e=this;return!e.disabled&&!e.readonly&&!1===e._regexSpecial.nonNumericValue.test(e.$.input.value)}_upButtonClickHandler(e){const t=this;t._isLeftButtonPressed(e)&&t._isIncrementOrDecrementAllowed()&&(t._up||t.$upButton.addClass("smart-numeric-text-box-pressed-component"),t._incrementOrDecrement("add"))}_downButtonClickHandler(e){const t=this;t._isLeftButtonPressed(e)&&t._isIncrementOrDecrementAllowed()&&(t._up||t.$downButton.addClass("smart-numeric-text-box-pressed-component"),t._incrementOrDecrement("subtract"))}_documentMousedownHandler(e){const t=this;if(t._up=!1,!t.opened)return;let n=e.originalEvent.target;(t.shadowRoot||t.isInShadowDOM)&&(n=e.originalEvent.composedPath()[0]),(t.shadowRoot||t).contains(n)||t.$.dropDown.contains(n)||t._closeRadix()}_documentMouseupHandler(){const e=this;e._up=!0,e.$upButton.removeClass("smart-numeric-text-box-pressed-component"),e.$downButton.removeClass("smart-numeric-text-box-pressed-component")}_radixDisplayButtonClickHandler(){const e=this;e.dropDownEnabled&&!e.disabled&&null!==e.value&&(e.opened?e._closeRadix():e._openRadix())}_dropDownItemClickHandler(e){if(e.target.$.hasClass("smart-list-item")){const t=this;let n=e.target.getAttribute("data-value");t._changeRadix(parseInt(n,10)),t._closeRadix()}}_mouseenterMouseleaveHandler(e){const t=this;e.target===t.$.dropDown||t.disabled||t.readonly||("mouseenter"===e.type?e.target.setAttribute("hover",""):e.target.removeAttribute("hover"))}_inputKeydownHandler(e){const t=this,n=e.charCode?e.charCode:e.which;40===n&&t._isIncrementOrDecrementAllowed()?t._incrementOrDecrement("subtract"):38===n&&t._isIncrementOrDecrementAllowed()&&t._incrementOrDecrement("add"),t._keydownInfo={value:t.$.input.value,specialKey:e.altKey||e.ctrlKey||e.shiftKey}}_inputKeyupHandler(e){const t=this;if(13===e.keyCode)t._suppressBlurEvent=!0,t.$.input.value!==t._cachedInputValue&&(t._triggerChangeEvent=!0,t._validate(),t._triggerChangeEvent=!1,t.$.input.blur());else if(27===e.keyCode)t.$.input.value=t._editableValue;else{const n=t.$.input.value;""!==n&&t._regex[t._radixNumber].test(n)?(t.$.upButton.disabled=!1,t.$.downButton.disabled=!1):""===n&&(t.$.upButton.disabled=!0,t.$.downButton.disabled=!0),!t._keydownInfo||t._keydownInfo.value===n||t._keydownInfo.specialKey||e.altKey||e.ctrlKey||e.shiftKey||"Control"===e.key||(t.$.fireEvent("changing",{currentValue:n,validValue:t.value,radix:t._radixNumber}),t._updateTargetValue(n))}e.preventDefault()}_inputBlurHandler(){const e=this;!0===e._suppressBlurEvent?(e._suppressBlurEvent=!1,e._formattedValue&&(e._cachedInputValue=e._formattedValue,e.$.input.value=e._formattedValue,delete e._formattedValue)):e.$.input.value!==e._editableValue?(e._triggerChangeEvent=!0,e._validate(),e._triggerChangeEvent=!1):e.$.input.value=e._cachedInputValue,e.radixDisplay&&e.$.radixDisplayButton.removeAttribute("focus"),e.opened&&e._closeRadix(),e.spinButtons&&e.$.spinButtonsContainer.removeAttribute("focus"),e.showUnit&&e.$.unitDisplay.removeAttribute("focus"),e.removeAttribute("focus"),e.$.fireEvent("blur")}_inputFocusHandler(){const e=this;e.spinButtons&&e.$.spinButtonsContainer.setAttribute("focus",""),e.radixDisplay&&e.$.radixDisplayButton.setAttribute("focus",""),e.showUnit&&e.$.unitDisplay.setAttribute("focus",""),e.opened&&e._closeRadix(),e.setAttribute("focus",""),e.outputFormatString&&(e.$.input.value=e._editableValue),e.$.fireEvent("focus")}_inputChangeHandler(e){e.stopPropagation(),e.preventDefault()}_inputPasteHandler(){const e=this;requestAnimationFrame((()=>e.$.fireEvent("changing",{currentValue:e.$.input.value,validValue:e.value,radix:e._radixNumber})))}_inputWheelHandler(e){const t=this,n=t.shadowRoot&&t.shadowRoot.activeElement||document.activeElement;t.$.input===n&&t.enableMouseWheelAction&&t._isIncrementOrDecrementAllowed()&&(e.stopPropagation(),e.preventDefault(),e.wheelDelta>0?t._incrementOrDecrement("add"):t._incrementOrDecrement("subtract"))}_getRadix(e){switch(e.toString()){case"10":case"decimal":return 10;case"2":case"binary":return 2;case"8":case"octal":return 8;case"16":case"hexadecimal":return 16}}_setDropDownOptions(e){const t=this;if(!1===t.dropDownEnabled||null===t._number)return;if(!t.showDropDownValues){if(e)return;return t.$.dropDownItem2.innerHTML=t.localize("binary"),t.$.dropDownItem8.innerHTML=t.localize("octal"),t.$.dropDownItem10.innerHTML=t.localize("decimal"),void(t.$.dropDownItem16.innerHTML=t.localize("hexadecimal"))}const n=t._wordLengthNumber,i=t.leadingZeros;t.$.dropDownItem2.innerHTML=`${t._number.toString(2,n,i)} (${t.localize("binary")})`,t.$.dropDownItem8.innerHTML=`${t._number.toString(8,n)} (${t.localize("octal")})`,t.$.dropDownItem10.innerHTML=`${t._renderValue(t._number.toString(10,n),!0)} (${t.localize("decimal")})`,t.$.dropDownItem16.innerHTML=`${t._number.toString(16,n,i)} (${t.localize("hexadecimal")})`}_incrementOrDecrement(e){const t=this,n=t.shadowRoot&&t.shadowRoot.activeElement||document.activeElement;let i=t._cachedInputValue;if(t.$.input===n&&(i=t._editableValue,t._suppressBlurEvent=!0),(t.$.input.value!==i||t._programmaticValueIsSet&&"interaction"===t.validation)&&(t._triggerChangeEvent=!0,t._validate(),t._triggerChangeEvent=!1,!1===t._isIncrementOrDecrementAllowed()))return;const a=t._numericProcessor.incrementDecrement(t._number,e,t._spinButtonsStepObject),r=t._validateRange(a);t._triggerChangeEvent=!0,t._updateValue(r),t._triggerChangeEvent=!1}_toBigNumberDecimal(e,t){const n=this;let i;return 10===t?i=new Smart.Utilities.BigNumber(e):n._unsigned||!1===n._isNegative(e,t)?n._wordLengthNumber<64?(i=parseInt(e,t),i=new Smart.Utilities.BigNumber(i)):i=n._getBigNumberFrom64BitBinOctHex(e,t):(i=n._getNegativeDecimal(e,t),i=new Smart.Utilities.BigNumber(i)),i}_isNegative(e,t){const n=this,i=e.length,a=e.charAt(0).toLowerCase();if(2===t)return i===n._wordLengthNumber&&"1"===a;if(8!==t)return i===n._wordLengthNumber/4&&-1!==["8","9","a","b","c","d","e","f"].indexOf(a);switch(n._wordLengthNumber){case 8:return 3===i&&("2"===a||"3"===a);case 16:return 5===i&&"1"===a;case 32:return 11===i&&("2"===a||"3"===a);case 64:return 22===i&&"1"===a}}_getBigNumberFrom64BitBinOctHex(e,t){let n=new Smart.Utilities.BigNumber(0);for(let i=e.length-1;i>=0;i--){let a=new Smart.Utilities.BigNumber(parseInt(e.charAt(i),t));n=n.add(a.multiply(new Smart.Utilities.BigNumber(t).pow(e.length-1-i)))}return n}_getNegativeDecimal(e,t){const n=this;let i=e;if(8===t){let t=[];for(let n=0;n<e.length;n++){let i=parseInt(e.charAt(n),8).toString(2);for(;3!==i.length;)i=`0${i}`;t.push(i)}for(i=t.join("");"0"===i.charAt(0);)i=i.slice(1)}else if(16===t){let t=[];for(let n=0;n<e.length;n++){let i=parseInt(e.charAt(n),16).toString(2);for(;4!==i.length;)i=`0${i}`;t.push(i)}i=t.join("")}let a=i.replace(/0/g,"a");return a=a.replace(/1/g,"b"),a=a.replace(/a/g,"1"),a=a.replace(/b/g,"0"),this._wordLengthNumber<64?a=-1*(parseInt(a,2)+1):(a=n._getBigNumberFrom64BitBinOctHex(a,t),a=a.add(1).negate()),a}_discardDecimalSeparator(e,t){if(void 0===t&&(t=this.decimalSeparator),"."!==t&&e!==1/0&&e!==-1/0){let n=new RegExp(t,"g");return e.replace(n,".")}return e}_applyDecimalSeparator(e){const t=this;return"string"!=typeof e&&(e=e.toString()),"."!==t.decimalSeparator&&(e=e.replace(/\./g,t.decimalSeparator)),e}_renderValue(e,t){const n=this,i=e,a=10===n._radixNumber||!0===t;if(e=n._numericProcessor.render(e,a),"."!==n.decimalSeparator&&a&&(e=n._applyDecimalSeparator(e)),!0!==t&&(n._editableValue=e,n.outputFormatString&&10===n._radixNumber)){const e=(n.shadowRoot||n.getRootNode()).activeElement||document.activeElement,t=n._numberRenderer.formatNumber(i,n.outputFormatString);if(e!==n.$.input)return t;n._formattedValue=t}return e}_setFocusable(){const e=this;e.disabled||e.unfocusable?e.$.input.tabIndex=-1:e.$.input.removeAttribute("tabindex")}_disableComponents(){const e=this;if(e.disabled)return;const t=e.value;null===t||"NaN"===t.toString()||Math.abs(t)===1/0?(e.$.upButton.disabled=!0,e.$.downButton.disabled=!0):(e.$.upButton.disabled=!1,e.$.downButton.disabled=!1)}_resizeHandler(){this.refresh()}refresh(){const e=this;e.opened&&e._closeRadix(!0)}});

/***/ }),

/***/ 9135:
/***/ (() => {

Smart("smart-scroll-bar",class extends Smart.BaseElement{static get properties(){return{clickRepeatDelay:{type:"integer",value:50},largeStep:{type:"integer",value:100},min:{type:"integer",value:0},max:{type:"integer",value:1e3},mechanicalAction:{value:"switchWhileDragging",allowedValues:["switchUntilReleased","switchWhenReleased","switchWhileDragging"],type:"string"},orientation:{type:"string",value:"horizontal",allowedValues:["horizontal","vertical"]},step:{type:"integer",value:10},showButtons:{type:"boolean",value:!0,defaultReflectToAttribute:!0},value:{type:"integer",value:0}}}static get styleUrls(){return["smart.scrollbar.css"]}template(){return'<div id="container" class="smart-container" role="presentation">\n                    <div id="nearButton" class="smart-scroll-button smart-arrow-left" role="presentation" aria-hidden="true"></div>\n                    <div  id="track" class="smart-track" role="presentation">\n                        <div id="thumb" class="smart-thumb" role="presentation"></div>\n                    </div>\n                    <div id="farButton" class="smart-scroll-button smart-arrow-right" role="presentation" aria-hidden="true"></div>\n            </div>'}static get listeners(){return{"nearButton.click":"_nearButtonClickHandler","nearButton.down":"_startRepeat","nearButton.up":"_stopRepeat","nearButton.pointerenter":"_updateInBoundsFlag","nearButton.pointerleave":"_updateInBoundsFlag","farButton.click":"_farButtonClickHandler","farButton.down":"_startRepeat","farButton.up":"_stopRepeat","farButton.pointerenter":"_updateInBoundsFlag","farButton.pointerleave":"_updateInBoundsFlag","track.down":"_trackDownHandler","track.click":"_trackClickHandler","track.move":"_trackMoveHandler","thumb.down":"_dragStartHandler","document.move":"_dragHandler","document.up":"_dragEndHandler",up:"_dragEndHandler","document.selectstart":"_selectStartHandler",resize:"_resizeHandler"}}_updateInBoundsFlag(t){const e=this,a=t.target;a._isPointerInBounds=!0,-1!==t.type.indexOf("leave")&&(a._isPointerInBounds=!1),1!==("buttons"in t?t.buttons:t.which)&&e._stopRepeat(t)}_startRepeat(t){const e=this;if(e.disabled)return;const a=t.target;a._initialTimer||(a._initialTimer=setTimeout((function(){a._repeatTimer=setInterval((()=>{if(a._isPointerInBounds){const e="buttons"in t?t.buttons:t.which;a.$.fireEvent("click",{buttons:e,clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY,screenX:t.screenX,screenY:t.screenY})}}),e.clickRepeatDelay)}),3*e.clickRepeatDelay))}_stopRepeat(t){if(this.disabled)return;const e=t.target;e._repeatTimer&&(clearInterval(e._repeatTimer),e._repeatTimer=null),e._initialTimer&&(clearTimeout(e._initialTimer),e._initialTimer=null)}_calculateThumbSize(t){const e=this,a=e.max-e.min,r="horizontal"===e.orientation?e.$.track.offsetWidth>10:e.$.track.offsetHeight>10;let n=0;return a>=1&&r?(n=t/(a+t)*t,e.$.thumb.className.indexOf("smart-hidden")>=0&&e.$thumb.removeClass("smart-hidden")):e.$thumb.addClass("smart-hidden"),Math.max(10,Math.min(n,t))}_dragStartHandler(t){const e=this;e.disabled||(e.thumbCapture=!0,e.dragStartX=t.clientX,e.dragStartY=t.clientY,e.dragStartValue=e.value,t.stopPropagation(),t.preventDefault())}_dragHandler(t){const e=this;if(!0!==e.thumbCapture)return;e._isThumbDragged=!0;const a=(e.max-e.min)/(e.scrollBarSize-e.thumbSize),r="horizontal"===e.orientation?(t.clientX-e.dragStartX)*a:(t.clientY-e.dragStartY)*a;let n=r;e.rightToLeft&&"horizontal"===e.orientation&&(n=-r),e._updateValue(e.dragStartValue+n),t.stopPropagation(),t.preventDefault(),t.originalEvent&&(t.originalEvent.stopPropagation(),t.originalEvent.preventDefault())}_dragEndHandler(t){const e=this;e._trackDownTimer&&(clearInterval(e._trackDownTimer),e._trackDownTimer=null),e.thumbCapture&&(e.thumbCapture=!1,e._isThumbDragged=!1,"switchWhenReleased"===e.mechanicalAction?e._updateValue(e.dragStartValue,e.value):"switchUntilReleased"===this.mechanicalAction&&e._updateValue(e.dragStartValue),t.preventDefault(),t.stopPropagation(),t.originalEvent.preventDefault(),t.originalEvent.stopPropagation())}_farButtonClickHandler(){const t=this;if(t.disabled)return;const e=t.value;t._updateValue(t.value+("horizontal"===t.orientation&&t.rightToLeft?-1:1)*t.step),"switchUntilReleased"===t.mechanicalAction&&t._updateValue(e)}_nearButtonClickHandler(){const t=this;if(t.disabled)return;const e=t.value;t._updateValue(t.value-("horizontal"===t.orientation&&t.rightToLeft?-1:1)*t.step),"switchUntilReleased"===t.mechanicalAction&&t._updateValue(e)}propertyChangedHandler(t,e,a){super.propertyChangedHandler(t,e,a);const r=this;switch(t){case"min":case"max":case"orientation":case"showButtons":r._layout(),"min"===t?r.setAttribute("aria-valuemin",a):"max"===t?r.setAttribute("aria-valuemax",a):"orientation"===t&&r.setAttribute("aria-orientation",a);break;case"value":r._updateValue(e,a);break;default:r._layout()}}render(){const t=this;t.setAttribute("role","scrollbar"),t.setAttribute("aria-orientation",t.orientation),t.setAttribute("aria-valuemin",t.min),t.setAttribute("aria-valuemax",t.max),t.setAttribute("aria-valuenow",t.value),t._layout(),super.render()}_resizeHandler(){this._layout()}refresh(){this._layout()}beginUpdate(){this._isUpdating=!0}endUpdate(){this._isUpdating=!1,this.refreshValue()}refreshValue(){const t=this;t._layout(),t._updateValue(t.value)}_layout(){const t=this;t._isUpdating||(t.scrollBarSize="horizontal"===t.orientation?t.$.track.offsetWidth:t.$.track.offsetHeight,t.thumbSize=t._calculateThumbSize(t.scrollBarSize),"horizontal"===t.orientation&&t.$.thumb.style.width!==t.thumbSize+"px"?t.$.thumb.style.width=t.thumbSize+"px":"vertical"===t.orientation&&t.$.thumb.style.height!==t.thumbSize+"px"&&(t.$.thumb.style.height=t.thumbSize+"px"),"horizontal"===t.orientation?(t.$.nearButton.classList.contains("smart-arrow-up")&&t.$.nearButton.classList.remove("smart-arrow-up"),t.$.farButton.classList.contains("smart-arrow-down")&&t.$.farButton.classList.remove("smart-arrow-down"),t.$.nearButton.classList.contains("smart-arrow-left")||t.$.nearButton.classList.add("smart-arrow-left"),t.$.farButton.classList.contains("smart-arrow-right")||t.$.farButton.classList.add("smart-arrow-right")):(t.$.nearButton.classList.contains("smart-arrow-left")&&t.$.nearButton.classList.remove("smart-arrow-left"),t.$.farButton.classList.contains("smart-arrow-right")&&t.$.farButton.classList.remove("smart-arrow-right"),t.$.nearButton.classList.contains("smart-arrow-up")||t.$.nearButton.classList.add("smart-arrow-up"),t.$.farButton.classList.contains("smart-arrow-down")||t.$.farButton.classList.add("smart-arrow-down")),t._updateThumbPosition(),(t.value>t.max||t.value<t.min)&&t._updateValue(t.value,t.value>t.max?t.max:t.min))}_selectStartHandler(t){this.thumbCapture&&t.preventDefault()}_trackDownHandler(t){const e=this;t.target===e.$.track&&(e._trackDownTimer&&clearInterval(e._trackDownTimer),e.thumbCapture||(e._trackDownTimer=setInterval((function(){e._trackClickHandler(t)}),e.clickRepeatDelay),t.stopPropagation(),t.preventDefault()))}_trackClickHandler(t){const e=this;if(e.disabled)return;if(e._isThumbDragged)return clearInterval(e._trackDownTimer),void(e._trackDownTimer=null);const a=e.$.thumb.getBoundingClientRect(),r=t.pageX-window.pageXOffset,n=t.pageY-window.pageYOffset,i=(e.rightToLeft?-1:1)*e.value;"horizontal"===e.orientation?r>(e._isThumbDragged?e.dragStartX:a.right)?e._updateValue(e.value+(e.rightToLeft?-1:1)*e.largeStep):r<(e._isThumbDragged?e.dragStartX:a.left)&&e._updateValue(e.value-(e.rightToLeft?-1:1)*e.largeStep):n>(e._isThumbDragged?e.dragStartY:a.bottom)?e._updateValue(e.value+e.largeStep):n<(e._isThumbDragged?e.dragStartY:a.top)&&e._updateValue(e.value-e.largeStep),"switchUntilReleased"===e.mechanicalAction&&e._updateValue(i)}_trackMoveHandler(t){"touchmove"===t.originalEvent.type&&t.originalEvent.preventDefault()}_updateValue(t,e){const a=this;if(!a._isUpdating&&(1===arguments.length&&(e=t,t=a.value),(void 0===e||isNaN(e))&&(e=a.min),e>a.max&&(e=a.max),e<a.min&&(e=a.min),a.value=e,t!==e)){if(a.setAttribute("aria-valuenow",e),a._updateThumbPosition(),a.thumbCapture&&"switchWhenReleased"===a.mechanicalAction)return;if(a.onChange)return void a.onChange({value:a.value,oldValue:t,min:a.min,max:a.max,context:a});a.$.fireEvent("change",{value:a.value,oldValue:t,min:a.min,max:a.max})}}_updateThumbPosition(){const t=this,e="horizontal"===t.orientation?t.$.track.offsetWidth:t.$.track.offsetHeight,a=t._calculateThumbSize(e),r=e-a;let n=(e-a)/(t.max-t.min)*(t.value-t.min);t.rightToLeft&&"horizontal"===t.orientation&&(n=(e-a)/(t.max-t.min)*(t.max-t.value-t.min)),n=Math.min(r,Math.max(0,n)),"vertical"===t.orientation&&t.$.thumb.style.top!==n+"px"?t.$.thumb.style.top=n+"px":"horizontal"===t.orientation&&t.$.thumb.style.left!==n+"px"&&(t.$.thumb.style.left=n+"px")}});

/***/ }),

/***/ 6297:
/***/ (() => {

Smart("smart-sortable",class extends Smart.ContentElement{static get properties(){return{disableMode:{value:"auto",allowedValues:["auto","manual"],type:"string"},dragMode:{value:"item",allowedValues:["item","handle"],type:"string"},handlePosition:{value:"right",allowedValues:["none","right","left","top","bottom"],type:"string"},handleVisibility:{value:"hover",allowedValues:["none","hover","visible"],type:"string"},items:{value:null,type:"string?"},mode:{value:"vertical",allowedValues:["horizontal","vertical"],type:"string"}}}static get listeners(){return{contextmenu:"_preventDefault","container.down":"_containerDownHandler","container.move":"_containerMoveHandler","container.transitionend":"_containerTransitionendHandler","document.dragstart":"_preventDefault","document.move":"_documentMoveHandler","document.selectstart":"_preventDefault","document.up":"_documentUpHandler"}}static get styleUrls(){return["smart.sortable.css"]}template(){return'<div id="container" class="smart-sortable-container" role="presentation" inner-h-t-m-l=\'[[innerHTML]]\'><content></content></div>'}move(e,t){const o=this,i=o._items;if(isNaN(e)||isNaN(t)||e===t||e<0||e>=i.length||t<0||t>=i.length)return;const n=i[e],s=i[t];e>t?o._itemsParent.insertBefore(n,s):o._itemsParent.insertBefore(n,s.nextElementSibling),o._getItems(!1)}updateItems(){const e=this;e._items&&(e._items.forEach((e=>e.classList.remove("smart-sortable-item"))),e._getItems())}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const i=this;switch(e){case"disabled":i._originallyDisabled=o,i._items.length<2&&"auto"===i.disableMode&&(i.disabled=!0);break;case"items":i._itemsParent.classList.remove("smart-sortable-items-parent"),i.updateItems();break;case"mode":i._setSettingsObject()}}ready(){super.ready();const e=this;e.setAttribute("role","group"),e._originallyDisabled=e.disabled,e._getItems(),e._setSettingsObject()}_getItems(e){const t=this;if(null===t.items?t._items=Array.from(t.$.container.children):t._items=Array.from((t.shadowRoot||t).querySelectorAll(".smart-sortable-container "+t.items)),t._items=t._items.filter((e=>!e.hasAttribute("disable-drag"))),!1!==e&&(t._items.forEach((e=>e.classList.add("smart-sortable-item"))),t._items.length)){if(t._itemsParent=t._items[0].parentElement,t._itemsParent.classList.add("smart-sortable-items-parent"),t.parents)for(let e=0;e<t.parents.length;e++)if(t.parents[e]instanceof HTMLElement&&t.parents[e].classList.contains("smart-sort-panel"))return void("auto"===t.disableMode&&(t.disabled=t._originallyDisabled));"auto"===t.disableMode&&(t._items.length<2?t.disabled=!0:t.disabled=t._originallyDisabled)}}_setSettingsObject(){const e=this;"vertical"===e.mode?e._settings={coordinateName:"y",dimension:"height",offsetDimension:"offsetHeight",startOffset:"top",endOffset:"bottom"}:e._settings={coordinateName:"x",dimension:"width",offsetDimension:"offsetWidth",startOffset:"left",endOffset:"right"}}_preventDefault(e){this._draggedItem&&e.preventDefault()}_containerDownHandler(e){const t=this;if(t.disabled||t._draggedItem)return;const o=(t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target).closest(".smart-sortable-item");if(!o)return;if(o.hasAttribute("disable-drag"))return;const i=e.pageX-window.scrollX,n=e.pageY-window.scrollY,s=o.getBoundingClientRect(),r=getComputedStyle(o),a=parseFloat(r.marginLeft),l=parseFloat(r.marginTop);if("handle"!==t.dragMode||!(e.originalEvent.target!==document.elementFromPoint(e.clientX,e.clientY)||i>=s.left&&i<=s.right&&n>=s.top&&n<=s.bottom)){if("handle"===t.dragMode){const t=e.originalEvent.composedPath();for(let e=1;e<t.length;e++)if(t[e].classList&&t[e].classList.contains("smart-sortable-item"))return}window.getSelection().removeAllRanges(),t._draggedItem=o,t._positionPlaceholder(),t._getPositionedAncestorCoords(),o.style.width=o.offsetWidth+"px",o.style.height=o.offsetHeight+"px",o.style.left=s.left-a+(-t._positionedAncestorCoords.x||window.scrollX)+"px",o.style.top=s.top-l+(-t._positionedAncestorCoords.y||window.scrollY)+"px",o.classList.add("dragged"),t._clickOffset={x:e.pageX-s.left+a,y:e.pageY-s.top+l},t._prevCoords={x:i,y:n},t._getItemCoordinates()}}_positionPlaceholder(){const e=this,t=e._draggedItem,o=getComputedStyle(t),i=document.createElement("div");i.className="smart-sortable-item placeholder smart-visibility-hidden",i.style.width=t.offsetWidth+"px",i.style.height=t.offsetHeight+"px",i.style.minHeight=t.offsetHeight+"px",i.style.marginBottom=o.marginBottom,i.style.marginLeft=o.marginLeft,i.style.marginRight=o.marginRight,i.style.marginTop=o.marginTop,e._itemsParent.insertBefore(i,t.nextElementSibling),e._placeholder=i}_getPositionedAncestorCoords(){const e=this,t=e.offsetParent;if(e._positionedAncestorCoords={x:0,y:0},t!==document.body){const o=t.getBoundingClientRect();e._positionedAncestorCoords={x:o.left,y:o.top}}}_getItemCoordinates(){const e=[];this._items.forEach((function(t){const o=t.getBoundingClientRect();e.push({left:o.left,top:o.top,right:o.right,bottom:o.bottom,width:o.width,height:o.height})})),this._coordinates=e}_containerMoveHandler(e){this._draggedItem&&"touchmove"===e.originalEvent.type&&e.originalEvent.preventDefault()}_containerTransitionendHandler(e){const t=this;t._draggedItem&&e.target.classList.contains("smart-sortable-item")&&(e.target.classList.contains("returning")?t._resolveDragging():t._getItemCoordinates())}_documentMoveHandler(e){const t=this,o=t._draggedItem;if(!o)return;const i=t._settings,n={x:e.pageX-window.scrollX,y:e.pageY-window.scrollY},s=n[i.coordinateName];let r;if(t._prevCoords.x===n.x&&t._prevCoords.y===n.y)return;t.hasAttribute("dragged")||t.setAttribute("dragged",""),r=t._prevCoords[i.coordinateName]>s?"up":"down",t._prevCoords=n,o.style.top=e.pageY-t._clickOffset.y+(-t._positionedAncestorCoords.y||window.scrollY)+"px",o.style.left=e.pageX-t._clickOffset.x+(-t._positionedAncestorCoords.x||window.scrollX)+"px";const a=t._items.indexOf(o);let l;for(let e=0;e<t._coordinates.length;e++){const o=t._coordinates[e];if(a!==e){if("down"===r&&s>=o[i.startOffset]+o[i.dimension]/2&&s<=o[i.endOffset]){l=t._items[e];break}if("up"===r&&s>=o[i.startOffset]&&s<=o[i.startOffset]+o[i.dimension]/2){l=t._items[e];break}}}if(l){if(l!==t._prevOverItem){if(t._prevOverItem=l,l[r])return;const e=t._items.indexOf(l);if(t._overItem=l,l.up||l.down)l.style.transform=null,delete l.up,delete l.down;else{if("horizontal"===t.mode&&("up"===r&&(!t.rightToLeft&&e>a||t.rightToLeft&&e<a)||"down"===r&&(!t.rightToLeft&&e<a||t.rightToLeft&&e>a)))return;if("vertical"===t.mode&&("up"===r&&e>a||"down"===r&&e<a))return;const o=getComputedStyle(l);l.style.transform=`translate${i.coordinateName.toUpperCase()}(${("up"===r?1:-1)*(l[i.offsetDimension]+parseFloat(o["margin-"+i.startOffset])+parseFloat(o["margin-"+i.endOffset]))}px)`,l[r]=!0}}}else delete t._prevOverItem}_documentUpHandler(){const e=this,t=e._draggedItem;if(!t)return;let o=e._overItem;if(o){const i=e._items.indexOf(t),n=e._items.indexOf(o);i<n&&o[e.rightToLeft&&"horizontal"===e.mode?"up":"down"]||i>n&&!o.down&&!o.up?(e._insertBefore=o.nextElementSibling,o=e._insertBefore,o&&o.nextElementSibling===t&&(o=e._placeholder)):(i>n&&o[e.rightToLeft&&"horizontal"===e.mode?"down":"up"]||i<n&&!o.down&&!o.up)&&(e._insertBefore=o,i>n&&o[e.rightToLeft&&"horizontal"===e.mode?"down":"up"]||(o=o.previousElementSibling||o))}else o=e._placeholder;e._resolveDragging()}_resolveDragging(){const e=this,t=e._draggedItem,o=e._items.indexOf(t);let i=!1;t.classList.remove("dragged","returning"),e._removeInlineStyle(),void 0!==e._insertBefore&&e._items.indexOf(e._insertBefore)!==o&&e._insertBefore!==e._placeholder[e.rightToLeft&&"horizontal"===e.mode?"previousElementSibling":"nextElementSibling"]&&(e._itemsParent.insertBefore(t,e._insertBefore),delete e._insertBefore,i=!0),e._itemsParent.removeChild(e._placeholder),delete e._clickOffset,delete e._draggedItem,delete e._overItem,delete e._placeholder,delete e._prevCoords,e.removeAttribute("dragged"),i&&(e._getItems(!1),e.$.fireEvent("dragEnd",{oldIndex:o,newIndex:e._items.indexOf(t)}))}_removeInlineStyle(){const e=this;e._items.forEach((function(e){e.style=null,e.style.transition="none",delete e.up,delete e.down})),setTimeout((function(){e._items.forEach((e=>e.style.transition=null))}),50)}});

/***/ }),

/***/ 1419:
/***/ (() => {

Smart("smart-time-picker",class extends Smart.BaseElement{static get properties(){return{autoSwitchToMinutes:{value:!1,type:"boolean"},footer:{value:!1,type:"boolean"},footerTemplate:{value:null,type:"any?"},format:{value:"12-hour",allowedValues:["12-hour","24-hour"],type:"string"},minuteInterval:{value:1,type:"number"},name:{value:"",type:"string"},selection:{value:"hour",allowedValues:["hour","minute"],type:"string"},value:{value:new Date,type:"any",reflectToAttribute:!1},view:{value:"portrait",allowedValues:["landscape","portrait"],type:"string"}}}static get listeners(){return{keydown:"_keydownHandler",resize:"_resizeHandler","header.click":"_headerClickHandler","picker.down":"_pickerDownHandler","picker.move":"_pickerMoveHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler"}}static get requires(){return{"Smart.Utilities.NumericProcessor":"smart.numeric.js","Smart.Utilities.BigNumber":"smart.math.js","Smart.Utilities.Draw":"smart.draw.js"}}static get styleUrls(){return["smart.timepicker.css"]}template(){return'<div id="container" role="presentation">\n                <div id="header" class="smart-header smart-unselectable" role="heading" aria-level="1">\n                    <div id="hourMinuteContainer" class="smart-hour-minute-container">\n                        <div id="hourContainer" class="smart-hour-container" role="button"></div>\n                        <div role="presentation">:</div>\n                        <div id="minuteContainer" class="smart-minute-container" role="button"></div>\n                    </div>\n                    <div id="ampmContainer" class="smart-am-pm-container" role="presentation">\n                        <div id="amContainer" class="smart-am-container" role="button">AM</div>\n                        <div id="pmContainer" class="smart-pm-container" role="button">PM</div>\n                    </div>\n                </div>\n                <div id="main" class="smart-main-container">\n                    <div id="svgContainer" class="smart-svg-container">\n                        <div id="picker" class="smart-svg-picker" role="slider"></div>\n                    </div>\n                    <div id="footer" class="smart-footer"></div>\n                </div>\n                <input id="hiddenInput" type="hidden" name="[[name]]">\n            </div>'}ready(){super.ready()}render(){this._createElement(),super.render()}setHours(e){const t=this;(e=24===e?0:Math.max(0,Math.min(e,23)))<12?t._selectAmPm("am"):t._selectAmPm("pm"),"12-hour"===t.format&&(0===e?e=12:e>12&&(e-=12)),t._updateHours(e,arguments[1]),"hour"===t.selection&&(t._inInnerCircle="24-hour"===t.format&&(0===e||e>12),t._drawArrow(!0,e,arguments[2]),t.hasAnimation||(t._inInnerCircle=!1))}setMinutes(e){const t=this;e=60===e?0:Math.max(0,Math.min(e,59)),t._updateMinutes(e),"minute"===t.selection&&t._drawArrow(!0,e,arguments[1])}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const n=this;switch(e){case"disabled":case"unfocusable":n._setFocusable();break;case"footer":case"view":n._resizeHandler();break;case"footerTemplate":n._validateFooterTemplate();break;case"format":{let e=n.value.getHours();"12-hour"===a?(n.$ampmContainer.removeClass("smart-hidden"),n.value.getHours()<12?n._selectAmPm("am"):n._selectAmPm("pm"),0===e?e=12:e>12&&(e-=12)):n.$ampmContainer.addClass("smart-hidden"),n.$.hourContainer.innerHTML=e,"hour"===n.selection&&(n.$.picker.setAttribute("aria-valuenow",e),n._draw.clear(),n._renderSVG());break}case"minuteInterval":{const e=Math.max(1,Math.min(a,60));e!==a&&(n.minuteInterval=e),"minute"===n.selection&&(n.interval=e);break}case"selection":"hour"===a?n._changeToHourSelection():n._changeToMinuteSelection();break;case"value":{n._oldValue=t,n._validateValue();const e=n.value.getHours()===t.getHours(),a=n.value.getMinutes()===t.getMinutes();e&&a||(a?n.setHours(n.value.getHours()):(e||n.setHours(n.value.getHours(),!0),n.setMinutes(n.value.getMinutes()))),delete n._oldValue;break}}}_applyInitialSettings(){const e=this,t=e.value;let a,n;a=t.getHours(),n=t.getMinutes(),"12-hour"===e.format?a<12?(e._ampm="am",e.$amContainer.addClass("smart-selected"),0===a&&(a=12)):(e._ampm="pm",e.$pmContainer.addClass("smart-selected"),a>12&&(a-=12)):e.$ampmContainer.addClass("smart-hidden"),n=n.toString(),1===n.length&&(n="0"+n),e.$.hourContainer.innerHTML=a,e.$.minuteContainer.innerHTML=n,"hour"===e.selection?(e.$hourContainer.addClass("smart-selected"),e.$.picker.setAttribute("aria-valuenow",a)):(e.$minuteContainer.addClass("smart-selected"),e.$.picker.setAttribute("aria-valuenow",n))}_changeSelection(e,t){const a=this,n=e.pageX,r=e.pageY,i=a._getCenterCoordinates(),s=Math.sqrt(Math.pow(i.x-n,2)+Math.pow(i.y-r,2));if(a._measurements.center=i,"down"===e.type){if(s>a._measurements.radius)return void e.stopPropagation();a._dragging=!0}"24-hour"===a.format&&"hour"===a.selection&&s<a._measurements.radius-50?a._inInnerCircle=!0:a._inInnerCircle=!1;let o=-1*Math.atan2(r-i.y,n-i.x)*180/Math.PI;o<0&&(o+=360),a._angle=o;let l=a._numericProcessor.getValueByAngle(a._angle);"hour"===a.selection?("24-hour"===a.format&&a._inInnerCircle?0!==l&&12!==l?l+=12:l=0:0===l&&(l=12),a._updateHours(l)):(60===l&&(l=0),a._updateMinutes(l)),void 0!==a._oldTimePart&&(cancelAnimationFrame(a._animationFrameId),delete a._animationFrameId,a._drawArrow(!0,l,t))}_changeToHourSelection(){const e=this,t=e._centralCircle.parentElement||e._centralCircle.parentNode;let a=e.value.getHours();cancelAnimationFrame(e._animationFrameId),delete e._animationFrameId,e.interval=1,e.$hourContainer.addClass("smart-selected"),e.$minuteContainer.removeClass("smart-selected"),t.removeChild(e._centralCircle),t.removeChild(e._arrow),t.removeChild(e._head),e._getMeasurements(),e._numericProcessor.getAngleRangeCoefficient(),e._draw.clear(),t.appendChild(e._centralCircle),t.appendChild(e._arrow),t.appendChild(e._head),e._renderHours(),"24-hour"===e.format&&(0===a||a>12)?e._inInnerCircle=!0:"12-hour"===e.format&&(a%=12,0===a&&(a=12)),e._drawArrow(!0,void 0,!0),e._inInnerCircle=!1,e.$.picker.firstElementChild.setAttribute("aria-hidden",!0),e.$.picker.setAttribute("aria-valuenow",a)}_changeToMinuteSelection(){const e=this,t=e._centralCircle.parentElement||e._centralCircle.parentNode;e._inInnerCircle=!1,cancelAnimationFrame(e._animationFrameId),delete e._animationFrameId,e.interval=e.minuteInterval,e.$hourContainer.removeClass("smart-selected"),e.$minuteContainer.addClass("smart-selected"),t.removeChild(e._centralCircle),t.removeChild(e._arrow),t.removeChild(e._head),e._getMeasurements(),e._numericProcessor.getAngleRangeCoefficient(),e._draw.clear(),t.appendChild(e._centralCircle),t.appendChild(e._arrow),t.appendChild(e._head),e._renderMinutes(),e._drawArrow(!0,void 0,!0),e.$.picker.firstElementChild.setAttribute("aria-hidden",!0),e.$.picker.setAttribute("aria-valuenow",e.value.getMinutes())}_computeArrowBodyPoints(e,t,a,n){const r=Math.sin(t),i=Math.cos(t),s=e-a*i+n*r,o=e+a*r+n*i,l=e+a*i+n*r,d=e-a*r+n*i,u="M "+(e+a*i)+","+(e-a*r)+" L "+(e-a*i)+","+(e+a*r)+" L "+s+","+o+" "+l+","+d;return this._headCenter={x:(s+l)/2,y:(o+d)/2},u}_createElement(){const e=this;if(e.setAttribute("role","dialog"),e.value){const t=new Date;let a=e.value;a.calendar&&(a=a.toDate()),a.getFullYear()===t.getFullYear()&&a.getMonth()===t.getMonth()&&a.getHours()===t.getHours()&&a.getMinutes()===t.getMinutes()&&(e.value=new Date)}e.coerce=!0,e.min=0,e._drawMin="0",e.startAngle=-270,e.endAngle=90,e._angleDifference=e.endAngle-e.startAngle,e.ticksVisibility="none",e._tickIntervalHandler={},e._tickIntervalHandler.labelsSize={},e._distance={majorTickDistance:0,minorTickDistance:0,labelDistance:10},e._measurements={},e._validateInitialPropertyValues(),e._applyInitialSettings(),e._numericProcessor=new Smart.Utilities.DecimalNumericProcessor(e),e._draw=new Smart.Utilities.Draw(e.$.picker),e._isVisible()?(e._setPickerSize(),e._getMeasurements(),e._numericProcessor.getAngleRangeCoefficient(),e._renderSVG(),e._setFocusable(),e.$.hiddenInput.value=e.value,e.enableShadowDOM&&e.appendChild(e.$.hiddenInput)):e._renderingSuspended=!0}_documentMoveHandler(e){const t=this;t._dragging&&t._changeSelection(e,!0)}_documentUpHandler(){const e=this;e._dragging?(e._inInnerCircle=!1,e._dragging=!1,e.autoSwitchToMinutes&&"hour"===e.selection&&(e.hasAnimation?function t(){e._animationFrameId?requestAnimationFrame(t):(e.$picker.addClass("animate"),setTimeout((function(){e.selection="minute",e._changeToMinuteSelection()}),250),setTimeout((function(){e.$picker.removeClass("animate")}),550))}():(e.selection="minute",e._changeToMinuteSelection()))):e.hasAttribute("focus")&&(e.$.fireEvent("blur"),e.removeAttribute("focus"))}_drawArrow(e,t,a){const n=this,r="hour"===n.selection,i="12-hour"===n.format;let s,o,l=n._oldTimePart;if(delete n._oldTimePart,void 0===t&&(r?(t=n.value.getHours(),i&&t>12&&(t-=12)):t=n.value.getMinutes()),void 0===l||a||!n.hasAnimation)return void n._drawArrowSVG(e,t);if(r&&!i)return void n._animate24HourView(l,t);r?(s=.2,o=12,t%=o,l%=o):(s=1,o=60);let d=t-l,u=l-t;d<0&&(d+=o),u<0&&(u+=o),u<d&&(s*=-1),function a(){l+=s,l=parseFloat((l%o).toFixed(1)),l<0&&(l+=o),n._drawArrowSVG(e,l),e=!0,l!==t%o?n._animationFrameId=requestAnimationFrame(a):delete n._animationFrameId}()}_animate24HourView(e,t){const a=this;let n=.2;a._inInnerCircle=!1;const r=0===e||e>12,i=0===t||t>12;if(r!==i){if(e=r?Math.abs(e-12):(e+12)%24,a._inInnerCircle=i,a._drawArrowSVG(!0,e),e===t)return}else a._inInnerCircle=i;let s=e,o=t;a._inInnerCircle&&(0===o&&s<18?o=12:0===s&&o<18&&(s=12));let l=o-s,d=s-o;l<0&&(l+=12),d<0&&(d+=12),d<l&&(n*=-1),function r(i){a._inInnerCircle=i,i?((e=parseFloat((e+n).toFixed(1)))<0?e+=24:e<1&&(e+=12),12!==e&&24!==e||(e=0)):(12!==(e+=n)&&(e=parseFloat((e%12).toFixed(1))),e<=0&&(e+=12)),a._drawArrowSVG(!0,e),e!==t?a._animationFrameId=requestAnimationFrame((function(){r(i)})):(delete a._animationFrameId,a._inInnerCircle=!1)}(a._inInnerCircle)}_drawArrowSVG(e,t){const a=this,n=a._measurements,r=a._numericProcessor.getAngleByValue(t);let i;i=a._inInnerCircle?a._computeArrowBodyPoints(n.radius,r,1,n.innerRadius-a._largestLabelSize/2-45):a._computeArrowBodyPoints(n.radius,r,1,n.innerRadius-a._largestLabelSize/2),e?(a._arrow.setAttribute("d",i),a._head.setAttribute("cx",a._headCenter.x),a._head.setAttribute("cy",a._headCenter.y),a._head.setAttribute("r",a._largestLabelSize),a._headRect=a._head.getBoundingClientRect(),t%1==0&&a._highlightLabel(t)):(a._arrow=a._draw.path(i,{class:"smart-needle"}),a._head=a._draw.circle(a._headCenter.x,a._headCenter.y,a._largestLabelSize,{class:"smart-needle-central-circle"}),a._headRect=a._head.getBoundingClientRect())}_drawLabel(e,t,a){const n=this,r=n._measurements,i=r.radius,s={class:"smart-label smart-unselectable","font-size":r.fontSize,"font-family":r.fontFamily,"font-weight":r.fontWeight,"font-style":r.fontStyle};"hour"===n.selection?n._plotInnerCircle?t>0?t+=12:t="00":0===t&&(t=12):1===t.toString().length&&(t="0"+t);const o=n._draw.measureText(t,0,s),l=i-a-n._largestLabelSize/2,d=i+l*Math.sin(e),u=i+l*Math.cos(e);n._draw.text(t,Math.round(d)-o.width/2,Math.round(u)-o.height/2,o.width,o.height,0,s).setAttribute("value",parseFloat(t))}_getCenterCoordinates(){const e=this.$.picker.getBoundingClientRect(),t=this._measurements.radius,a=document.body.scrollLeft||document.documentElement.scrollLeft,n=document.body.scrollTop||document.documentElement.scrollTop;return{x:e.left+a+t,y:e.top+n+t}}_getMeasurements(){const e=this,t=e._measurements,a=document.createElement("div");let n,r,i,s,o,l;a.className="smart-label",a.style.position="absolute",a.style.visibility="hidden",e.$.svgContainer.appendChild(a),"hour"===e.selection?(n="1",r="23",e.max=12,e._drawMax="12",e._range=12):(n="00",r="55",e.max=60,e._drawMax="60",e._range=60),a.innerHTML=n,i=a.offsetWidth,o=a.offsetHeight,a.innerHTML=r,s=a.offsetWidth,l=a.offsetHeight,e._largestLabelSize=Math.max(i,o,s,l),e._tickIntervalHandler.labelsSize.minLabelSize=o,e._tickIntervalHandler.labelsSize.maxLabelSize=l;const d=window.getComputedStyle(a);t.fontSize=d.fontSize,t.fontFamily=d.fontFamily,t.fontWeight=d.fontWeight,t.fontStyle=d.fontStyle,e.$.svgContainer.removeChild(a)}_headerClickHandler(e){const t=this;if(!t.disabled&&!t.readonly)switch(e.target){case t.$.hourContainer:"hour"!==t.selection&&(t.selection="hour",t._changeToHourSelection());break;case t.$.minuteContainer:"minute"!==t.selection&&(t.selection="minute",t._changeToMinuteSelection());break;case t.$.amContainer:if(!t.$amContainer.hasClass("smart-selected")){t._selectAmPm("am");const e=new Date(t.value.getTime());t.value.setHours(t.value.getHours()-12),t.$.hiddenInput.value=t.value,t.$.fireEvent("change",{value:t.value,oldValue:e})}break;case t.$.pmContainer:if(!t.$pmContainer.hasClass("smart-selected")){t._selectAmPm("pm");const e=new Date(t.value.getTime());t.value.setHours(t.value.getHours()+12),t.$.hiddenInput.value=t.value,t.$.fireEvent("change",{value:t.value,oldValue:e})}}}_highlightLabel(e){const t=this;if(t._highlightedLabel){if(parseFloat(t._highlightedLabel.getAttribute("value"))===e)return;t._highlightedLabel.classList.remove("smart-selected"),t._highlightedLabel=void 0}let a;"hour"===t.selection?(void 0===e&&(e=t.value.getHours()),"12-hour"===t.format&&(0===e?e=12:e>12&&(e-=12)),a=e):(void 0===e&&(e=t.value.getMinutes()),a=5*Math.round(e/5),60===a&&(a=0));const n=t.$.picker.querySelector('.smart-label[value="'+a+'"]');n&&(a===e||t._overlapsLabel(n))&&(t._highlightedLabel=n,n.classList.add("smart-selected"))}_isVisible(){const e=this;return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}_keydownHandler(e){const t=this;if(t._dragging)return;const a=(t.shadowRoot||t.getRootNode()).activeElement,n=e.key;if(!t.$.header.contains(a)||"Enter"!==n&&" "!==n){if(a===t.$.picker&&!e.altKey){let a;if("ArrowRight"===n||"ArrowUp"===n?a=1:"ArrowLeft"!==n&&"ArrowDown"!==n||(a=-1),a)if(e.preventDefault(),"hour"===t.selection){let e=t.value.getHours();0===e&&-1===a?e=23:23===e&&1===a?e=0:e+=a,"12-hour"===t.format&&(e>=12&&t.$amContainer.hasClass("smart-selected")?e-=12:e<12&&t.$pmContainer.hasClass("smart-selected")&&(e+=12)),t.setHours(e,void 0,!0)}else{let e=t.value.getMinutes();a*=t.minuteInterval,e+a>=60?e=0:e<-1*a?e=60%a==0?60+a:60-60%a:e+=a,t.setMinutes(e,!0)}}}else e.preventDefault(),t._headerClickHandler({target:a})}_overlapsLabel(e){const t=this,a=e.getBoundingClientRect();let n=t._headRect;return 0===n.height&&(n=t._headRect=t._head.getBoundingClientRect()),!(a.right-10<n.left||a.left+10>n.right||a.bottom-10<n.top||a.top+10>n.bottom)}_parseDateString(e,t){const a=e.indexOf("Date("),n=e.indexOf(")");let r=e;if(-1!==a&&-1!==n){if(r=e.slice(a+5,n),r=r.replace(/'/g,"").replace(/"/g,"").replace(/^\s+|\s+$|\s+(?=\s)/g,""),""===r.trim())return new Date;if(new RegExp(/(^(\d+)(\s*,\s*\d+)+$)/g).test(r))return r=r.replace(/\s/g,""),r=r.split(","),r.map((function(e,t){r[t]=parseInt(e)})),r.unshift(null),r=new(Function.prototype.bind.apply(Date,r)),r}if(""===r.trim())return t;if(!isNaN(r))return new Date(parseInt(r,10));try{r=new Date(r)}catch(e){r=t}return isNaN(r.getTime())?t:r}_pickerDownHandler(e){const t=this;t.disabled||t.readonly||!Smart.Utilities.Core.isMobile&&1!==e.which||(t._changeSelection(e),t.$.fireEvent("focus"),t.setAttribute("focus",""))}_pickerMoveHandler(e){"touchmove"===e.originalEvent.type&&e.originalEvent.preventDefault()}_renderHours(){const e=this;e._highlightedLabel=void 0,e._majorTicksInterval=1,e._numericProcessor.addGaugeTicksAndLabels(),"24-hour"===e.format?(e._plotInnerCircle=!0,e._distance.labelDistance=55,e._numericProcessor.addGaugeTicksAndLabels(),e._plotInnerCircle=!1,e._distance.labelDistance=10,e.$.picker.setAttribute("aria-valuemin",0),e.$.picker.setAttribute("aria-valuemax",23)):(e.$.picker.setAttribute("aria-valuemin",1),e.$.picker.setAttribute("aria-valuemax",12))}_renderMinutes(){const e=this;e._highlightedLabel=void 0,e._majorTicksInterval=5,e._numericProcessor.addGaugeTicksAndLabels(),e.$.picker.setAttribute("aria-valuemin",0),e.$.picker.setAttribute("aria-valuemax",59)}_renderSVG(){const e=this;if(e._isVisible()&&!e._renderingSuspended){if(e._centralCircle=e._draw.circle(e._measurements.radius,e._measurements.radius,4,{class:"smart-needle-central-circle"}),"hour"===e.selection&&"24-hour"===e.format&&(0===e.value.getHours()||e.value.getHours()>12)&&(e._inInnerCircle=!0),e._drawArrow(!1),e._inInnerCircle=!1,"hour"===e.selection){e.interval=1,e._renderHours();let t=e.value.getHours();"12-hour"===e.format&&t>12&&(t-=12),e._highlightLabel(t)}else e.interval=e.minuteInterval,e._renderMinutes(),e._highlightLabel(e.value.getMinutes());e.$.picker.firstElementChild.setAttribute("aria-hidden",!0)}else e._renderingSuspended=!0}refresh(){const e=this;let t=!1;e.isRendered&&(e._isVisible()?(e._renderingSuspended=!1,t=!0,e._getMeasurements(),e._numericProcessor.getAngleRangeCoefficient(),e._setPickerSize(),e._sizeChanged||t?(e._draw.clear(),e._renderSVG(),e._sizeChanged=!1):(e._headRect=e._head.getBoundingClientRect(),e._highlightLabel())):e._renderingSuspended=!0)}_resizeHandler(){this.refresh()}_selectAmPm(e){const t=this;"am"===e?(t._ampm="am",t.$pmContainer.removeClass("smart-selected"),t.$amContainer.addClass("smart-selected")):(t._ampm="pm",t.$amContainer.removeClass("smart-selected"),t.$pmContainer.addClass("smart-selected"))}_setFocusable(){const e=this;if(e.disabled||e.unfocusable)return e.$.hourContainer.removeAttribute("tabindex"),e.$.minuteContainer.removeAttribute("tabindex"),e.$.amContainer.removeAttribute("tabindex"),e.$.pmContainer.removeAttribute("tabindex"),void e.$.picker.removeAttribute("tabindex");const t=e.tabIndex>0?e.tabIndex:0;e.$.hourContainer.tabIndex=t,e.$.minuteContainer.tabIndex=t,e.$.amContainer.tabIndex=t,e.$.pmContainer.tabIndex=t,e.$.picker.tabIndex=t}_setPickerSize(){const e=this,t=e.$.svgContainer.offsetWidth,a=e.$.svgContainer.offsetHeight;let n=.9*Math.min(t,a);void 0!==e._pickerSize&&e._pickerSize!==n?e._sizeChanged=!0:e._sizeChanged=!1,e._pickerSize=n,e._measurements.radius=n/2,e._measurements.innerRadius=e._measurements.radius-10,n+="px",e.$.picker.style.width=n,e.$.picker.style.height=n}_updateHours(e,t){const a=this;let n=e;"12-hour"===a.format?"am"===a._ampm?12===n&&(n=0):n<12&&(n+=12):n=e;const r=void 0!==a._oldValue?a._oldValue:new Date(a.value.getTime()),i=r.getHours();n!==i?(a._oldTimePart=i,void 0===a._oldValue&&a.value.setHours(n),a.$.hourContainer.innerHTML=e,!0!==t&&(a.$.hiddenInput.value=a.value,a.$.fireEvent("change",{value:a.value,oldValue:r})),"hour"===a.selection&&a.$.picker.setAttribute("aria-valuenow",e)):delete a._oldTimePart}_updateMinutes(e){const t=this,a=void 0!==t._oldValue?t._oldValue:new Date(t.value.getTime()),n=a.getMinutes();e!==n?(t._oldTimePart=n,void 0===t._oldValue&&t.value.setMinutes(e),"minute"===t.selection&&t.$.picker.setAttribute("aria-valuenow",e),1===(e=e.toString()).length&&(e="0"+e),t.$.minuteContainer.innerHTML=e,t.$.hiddenInput.value=t.value,t.$.fireEvent("change",{value:t.value,oldValue:a})):delete t._oldTimePart}_validateFooterTemplate(){const e=this,t=e.footerTemplate;if(null===t)return void(e.$.footer.innerHTML="");let a;if(t instanceof HTMLTemplateElement?a=t:"string"==typeof t&&(a=document.getElementById(t),a instanceof HTMLTemplateElement||(a=void 0)),void 0===a)return e.footerTemplate=null,void(e.$.footer.innerHTML="");const n=document.importNode(a.content,!0);if(e.enableShadowDOM)return e.$.footer.innerHTML="<slot></slot>",void e.appendChild(n);e.$.footer.appendChild(n)}_validateInitialPropertyValues(){const e=this;e._validateFooterTemplate(),e.minuteInterval=Math.max(1,Math.min(e.minuteInterval,60)),e._validateValue()}_validateValue(){const e=this,t=e.value,a=void 0!==e._oldValue?this._oldValue:new Date;if(!(t instanceof Date))if("string"==typeof t){if(/^\d{1,2}:\d{1,2}$/.test(t)){const n=t.split(":");return void(e.value=new Date(a.getFullYear(),a.getMonth(),a.getDate(),parseFloat(n[0]),parseFloat(n[1])))}e.value=e._parseDateString(t,a)}else e.value=a}});

/***/ }),

/***/ 6693:
/***/ (() => {

Smart("smart-tooltip",class extends Smart.ContentElement{static get properties(){return{arrow:{value:!1,type:"boolean"},arrowDirection:{allowedValues:["bottom","top","left","right"],value:"bottom",type:"string"},align:{allowedValues:["left","center","right"],value:"center",type:"string"},delay:{value:0,type:"number"},messages:{extend:!0,value:{en:{invalidSelector:'{{elementType}}: "{{property}}" must be a String, an HTMLElement or null.',htmlTemplateNotSuported:"{{elementType}}: 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.',invalidNode:'{{elementType}}: Invalid parameter "{{node}}" when calling {{method}}.'}},type:"object"},iframeRect:{value:null,type:"object?"},offset:{value:[],type:"array"},openMode:{allowedValues:["click","focus","hover","manual"],value:"hover",type:"string"},position:{allowedValues:["bottom","top","left","right","absolute","auto"],value:"top",type:"string"},selector:{value:null,type:"any?"},tooltipTemplate:{value:null,type:"any"},value:{value:"",type:"string",reflectToAttribute:!1},visible:{value:!1,type:"boolean"}}}static get styleUrls(){return["smart.tooltip.css"]}template(){return'<div id="container" role="presentation">\n                    <div id="content" class="smart-tooltip-content" inner-h-t-m-l="[[innerHTML]]" role="presentation">\n                        <content></content>\n                    </div>\n                </div>'}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const o=this;let l;switch(e){case"align":o._applyPosition(n);break;case"openMode":o.close(),o._handleEventListeners(t),o._handleResize();break;case"selector":o._oldOwnerElement=o._ownerElement,o._handleSelector(n,t),o._handleEventListeners();break;case"tooltipTemplate":o._handleTemplate(t);break;case"value":o.tooltipTemplate?o._handleTemplate():o.$.content.innerHTML=o.value;break;case"visible":l=n?"open":"close",o.$.fireEvent(l,{owner:o._ownerElement},o.isInShadowDOM?{composed:!0,bubbles:!0,cancelable:!0}:void 0);break;case"position":return void o._applyPosition(t)}o._applyPosition()}ready(){super.ready()}render(){const e=this;super.render(),e.getAttribute("role")||e.setAttribute("role","tooltip"),e._isParentPositionStatic="static"===window.getComputedStyle(e.parentElement||document.querySelector("body")).position,e._handleSelector(e.selector),e.visible&&e._applyPosition(),e._handleEventListeners(),e._handleResize(),e.value=e.$.content.innerHTML=e.value?e.value:e.innerHTML,e._handleTemplate()}appendChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e?(t.$.content.appendChild(e),t._applyPosition()):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"appendChild",node:"node"}))}close(){const e=this;if(e._isOpening&&clearTimeout(e._isOpening),!e.visible)return;const t=e.isInShadowDOM?{composed:!0,bubbles:!0,cancelable:!0}:void 0;e.$.fireEvent("closing",{owner:e._ownerElement},t).defaultPrevented||(e.$.fireEvent("close",{owner:e._ownerElement},t),e.visible=!1)}clear(){const e=this.$.content;if(e)for(;e.childNodes.length;)e.removeChild(e.firstChild)}insertBefore(e,t){const n=this;if(!n.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(n,e.concat(Array.prototype.slice.call(arguments)))}e&&t?(n.$.content.insertBefore(e,t),n._applyPosition()):n.error(n.localize("invalidNode",{elementType:n.nodeName.toLowerCase(),method:"insertBefore",node:"newNode/referenceNode"}))}open(){const e=this;e.disabled||e.readonly||e.visible||(clearTimeout(e._isOpening),e._isOpening=setTimeout((function(){const t=e.isInShadowDOM?{composed:!0,bubbles:!0,cancelable:!0}:void 0;if(e.$.fireEvent("opening",{owner:e._ownerElement},t).defaultPrevented)return void clearTimeout(e._isOpening);e._applyPosition(),e.$.fireEvent("open",{owner:e._ownerElement},t);const n=e.context;e.context=e,e.visible=!0,e.context=n}),e.delay))}removeChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e?(t.$.content.removeChild(e),t._applyPosition()):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"removeChild",node:"node"}))}reposition(){const e=this;e.isRendered&&e._applyPosition()}toggle(){const e=this;e.visible?e.close():e.open()}_getDomElementPosition(e){let t=[],n=e.parentElement;for(;n&&"BODY"!==n.nodeName;)t.push(n),n=!this.enableShadowDOM||n.parentElement?n.parentElement:n.getRootNode().host;return t}_getElementAndOwnerRelation(e){const t=this._getDomElementPosition(e||this),n=t.length;let o=null;for(let e=0;e<n;e++)if("static"!==window.getComputedStyle(t[e]).getPropertyValue("position")){o=t[e];break}return o}_applyPosition(e){const t=this;if(!t._ownerElement)return;if(!t.parentElement)return;t._isParentPositionStatic="static"===window.getComputedStyle(t.parentElement).position;const n=t._ownerElement.getBoundingClientRect(),o=t.parentElement?t.parentElement.getBoundingClientRect():{top:0,left:0};let l,i;t.parentElement&&"BODY"===t.parentElement.nodeName.toUpperCase()?(l=n.top+window.scrollY,i=n.left+window.scrollX):(l=n.top-o.top,i=n.left-o.left);const r=t.position,s=t.iframeRect;let a,p={top:n.top,left:n.left,right:n.right,width:n.width,height:n.height,nonStaticParent:t._getElementAndOwnerRelation()};switch(s&&(p.top+=s.top,p.left+=s.left,p.right+=s.right),r){case"auto":case"bottom":case"top":case"left":case"right":{t.style.left="";const e=t["_position"+r.charAt(0).toUpperCase()+r.slice(1)](i,l,p);l=e.top,i=e.left,a=e.translate;break}case"absolute":e?(t.style.top=t.style.left="",l=i=0):(l=parseFloat(t.style.top),i=parseFloat(t.style.left))}const d=t.getAttribute("arrow-direction");a?t.$.container.style.setProperty("--smart-tooltip-arrow-translate",a+"px"):t.$.container.style.removeProperty("--smart-tooltip-arrow-translate"),void 0===l||isNaN(l)||(l+=("auto"===r&&"top"===d?-1:1)*parseInt(t.offset[1])||0,t.style.top=l+"px"),void 0===i||isNaN(i)||(i+=("auto"===r&&"left"===d?-1:1)*parseInt(t.offset[0])||0,t.style.left=i+"px")}_positionAuto(e,t,n){const o=this;let l,i,r=o.parentElement;for(;r;){if("hidden"===getComputedStyle(r).getPropertyValue("overflow")){l=r;break}r=r.parentElement}if(l)i=l.getBoundingClientRect();else{const e=document.scrollingElement;let t,n;document.scrollingElement?(t=e.offsetWidth,n=e.offsetHeight):(t=window.innerWidth,n=window.innerHeight),l=document.body,i={width:t,height:n,left:0,top:0,right:t,bottom:n}}const s=parseFloat(window.getComputedStyle(o).getPropertyValue("--smart-tooltip-arrow-width"))||0;let a=o._positionTop(e,t,n),p=n.nonStaticParent,d=o.offsetWidth/2-s,c=0,f=0,m=a.left,h=i.right-(m+f+o.offsetWidth),u=Math.min(0,h);if(m<=0&&h>0&&(m=Math.min(e,m+h)),u<=0&&(u=Math.sign(u)*(Math.abs(u)+i.right-(e+n.width))),p){const e=p.getBoundingClientRect();c=e.top,f=e.left}return a.top+c>=i.top?(m<=0&&(m=e),t=a.top,{left:e=Math.max(i.left-f,m+u),top:t,translate:Math.max(-d,Math.min(d,a.left-e))}):(a=o._positionBottom(e,t,n),a.top+o.offsetHeight+c<=i.bottom?(m=a.left,m<=0&&(m=e),t=a.top,{left:e=Math.max(i.left-f,m+u),top:t,translate:Math.max(-d,Math.min(d,a.left-e))}):(a=o._positionLeft(e,t,n),t=a.top,d=o.offsetHeight/2-s,t=Math.max(i.top-c,a.top+Math.min(0,i.bottom-(a.top+c+o.offsetHeight))),a.left+f>=i.left?e=a.left:(a=o._positionRight(e,t,n),e=a.left+o.offsetWidth+f<=i.right?a.left:i.right-o.offsetWidth),{left:e,top:t,translate:Math.max(-d,Math.min(d,a.top-t))}))}_getRelativeParentOffset(e){const t=this,n=t._ownerElement;let o=t._getElementAndOwnerRelation(n),l=0,i=0;if(!e)return{left:i,top:l};for(;e&&o&&e!==o;)l+=o.offsetTop,i+=o.offsetLeft,o=t._getElementAndOwnerRelation(o);return{left:i,top:l}}_positionTop(e,t,n){const o=this,l=o._getRelativeParentOffset(n.nonStaticParent);if(o.set("arrowDirection","bottom"),null===n.nonStaticParent)return t=n.top+window.scrollY-o.offsetHeight,{left:(e=o._getAlignmentOffset(n.left,o.offsetWidth,n.width)+window.scrollX)+l.left,top:t+l.top};if(o._isParentPositionStatic){if(t=o._ownerElement.offsetTop-o.offsetHeight,e=o._getAlignmentOffset(o._ownerElement.offsetLeft,o.offsetWidth,n.width),o._ownerElement instanceof SVGElement){const n=o._ownerElement.getBoundingClientRect(),l=o._ownerElement.parentNode.getBoundingClientRect();t=n.top-l.top-o.offsetHeight/2,e=o._getAlignmentOffset(n.left,o.offsetWidth,l.left)}return{left:e+l.left,top:t+l.top}}if(o._ownerElement instanceof SVGElement&&o._ownerElement.parentElement){const n=o._ownerElement.getBoundingClientRect(),i=o._ownerElement.parentNode.getBoundingClientRect();return t=n.top-i.top-o.offsetHeight,{left:(e=o._getAlignmentOffset(n.left-i.left,o.offsetWidth,n.width))+l.left,top:t+l.top}}return t-=o.offsetHeight,{left:(e=o._getAlignmentOffset(e,o.offsetWidth,n.width))+l.left,top:t+l.top}}_positionBottom(e,t,n){const o=this,l=o._getRelativeParentOffset(n.nonStaticParent);return o.set("arrowDirection","top"),null===n.nonStaticParent?(t=n.top+window.scrollY+n.height,{left:(e=o._getAlignmentOffset(n.left,o.offsetWidth,n.width)+window.scrollX)+l.left,top:t+l.top}):o._isParentPositionStatic?(t=o._ownerElement.offsetTop+n.height,{left:(e=o._getAlignmentOffset(o._ownerElement.offsetLeft,o.offsetWidth,n.width))+l.left,top:t+l.top}):(t+=n.height,{left:(e=o._getAlignmentOffset(e,o.offsetWidth,n.width))+l.left,top:t+l.top})}_getAlignmentOffset(e,t,n){switch(this.align){case"left":return e;case"right":return e-t+n;default:return e-t/2+n/2}}_positionLeft(e,t,n){const o=this,l=o._getRelativeParentOffset(n.nonStaticParent);return o.set("arrowDirection","right"),null===n.nonStaticParent?(t=n.top+window.scrollY+n.height/2-o.$.content.offsetHeight/2,{left:(e=n.left+window.scrollX-o.offsetWidth)+l.left,top:t+l.top}):o._isParentPositionStatic?(t=o._ownerElement.offsetTop+n.height/2-o.$.content.offsetHeight/2,{left:(e=o._ownerElement.offsetLeft-o.offsetWidth)+l.left,top:t+l.top}):(t=t+n.height/2-o.$.content.offsetHeight/2,{left:(e-=o.offsetWidth)+l.left,top:t+l.top})}_positionRight(e,t,n){const o=this,l=o._getRelativeParentOffset(n.nonStaticParent);return o.set("arrowDirection","left"),null===n.nonStaticParent?(t=n.top+window.scrollY+n.height/2-o.$.content.offsetHeight/2,{left:(e=n.left+window.scrollX+n.width)+l.left,top:t+l.top}):o._isParentPositionStatic?(t=o._ownerElement.offsetTop+n.height/2-o.$.content.offsetHeight/2,{left:(e=o._ownerElement.offsetLeft+n.width)+l.left,top:t+l.top}):(t=t+n.height/2-o.$.content.offsetHeight/2,{left:(e+=n.width)+l.left,top:t+l.top})}_eventsHandler(e){const t=this;t.disabled||t.readonly||("click"!==e.type?"mouseenter"===e.type||"focus"===e.type?this.open():this.close():t.visible?this.close():this.open())}_handleEventListeners(e){const t=this;if(t._oldOwnerElement&&"manual"!==t.openMode){let e=t._oldOwnerElement.getAttribute("aria-describedby");e&&"tooltip"===t.getAttribute("role")&&(e===t.id?t._oldOwnerElement.removeAttribute("aria-describedby"):(e=e.replace(" "+t.id,""),e=e.replace(t.id+" ",""),t._oldOwnerElement.setAttribute("aria-describedby",e))),t._oldOwnerElement.$.unlisten("mouseenter.tooltip"),t._oldOwnerElement.$.unlisten("mouseleave.tooltip"),t._oldOwnerElement.$.unlisten("focus.tooltip"),t._oldOwnerElement.$.unlisten("blur.tooltip"),t._oldOwnerElement.$.unlisten("click.tooltip"),t._oldOwnerElement=null}if(t._ownerElement){if(e)switch(e){case"hover":t._ownerElement.$.unlisten("mouseenter.tooltip"),t._ownerElement.$.unlisten("mouseleave.tooltip");break;case"focus":t._ownerElement.$.unlisten("focus.tooltip"),t._ownerElement.$.unlisten("blur.tooltip");break;case"click":t._ownerElement.$.unlisten("click.tooltip")}if("manual"!==t.openMode)switch(t._ownerElement instanceof Smart.BaseElement||(t._ownerElement.$=Smart.Utilities.Extend(t._ownerElement)),t.openMode){case"hover":t._ownerElement.$.listen("mouseenter.tooltip",t._eventsHandler.bind(t)),t._ownerElement.$.listen("mouseleave.tooltip",t._eventsHandler.bind(t));break;case"focus":t._ownerElement.$.listen("focus.tooltip",t._eventsHandler.bind(t)),t._ownerElement.$.listen("blur.tooltip",t._eventsHandler.bind(t));break;case"click":t._ownerElement.$.listen("click.tooltip",t._eventsHandler.bind(t))}}}_handleResize(){const e=this;function t(){e._applyPosition()}"click"===e.openMode?window.addEventListener("resize",t):window.removeEventListener("resize",t)}_handleSelector(e,t){const n=this;if(t&&t.removeAttribute&&t.removeAttribute("aria-describedby"),"string"==typeof e)n._ownerElement=e.length>0?document.getElementById(e):void 0;else if(e&&e.nodeType===Node.ELEMENT_NODE)n._ownerElement=e;else{if(null===e)return void(n._ownerElement=void 0);n.error(n.localize("invalidSelector",{elementType:n.nodeName.toLowerCase(),property:"selector"}))}if(!n._ownerElement||"tooltip"!==n.getAttribute("role"))return;if(!n.value)return;const o=n._ownerElement?n._ownerElement.getAttribute("aria-describedby"):null;o?o.indexOf(n.id)<0&&n._ownerElement.setAttribute("aria-describedby",o+" "+n.id):n._ownerElement.setAttribute("aria-describedby",n.id)}_handleTemplate(e){const t=this;let n=t.tooltipTemplate;if(e&&(t.$.content.innerHTML=t.value?t.value:""),null===n||!n)return;if("function"==typeof t.tooltipTemplate)return void t.tooltipTemplate(t.$.content,{value:t.value});if(!("content"in document.createElement("template")))return void t.error(t.localize("htmlTemplateNotSuported",{elementType:t.nodeName.toLowerCase()}));if(n=document.getElementById(n),null===n||!("content"in n))return void t.error(t.localize("invalidTemplate",{elementType:t.nodeName.toLowerCase(),property:"template"}));const o=n.content,l=o.childNodes.length,i=/{{\w+}}/g;let r,s=[];for(let e=0;e<l;e++)for(r=i.exec(o.childNodes[e].innerHTML);r;)s.push({childNodeIndex:e,bindingString:r[0]}),r=i.exec(o.childNodes[e].innerHTML);const a=s.length;let p,d,c=document.importNode(n.content,!0);for(let e=0;e<a;e++){p=c.childNodes[s[e].childNodeIndex],d=s.length;for(let n=0;n<d;n++)p.innerHTML=p.innerHTML.replace(s[e].bindingString,t.value)}t.$.content.innerHTML="";for(let e=0;e<c.childNodes.length;e++)c.childNodes[e].outerHTML&&(t.$.content.innerHTML+=c.childNodes[e].outerHTML)}}),function(){const e=()=>{const e=document.querySelectorAll('[data-toggle="tooltip"');if(e.length>0)for(let t=0;t<e.length;t++){if(!e[t].hasAttribute("data-title"))continue;const n=document.createElement("smart-tooltip");n.selector=e[t],n.innerHTML=e[t].getAttribute("data-title"),document.body.appendChild(n),e[t].hasAttribute("data-placement")&&(n.position=e[t].getAttribute("data-placement"))}};"complete"===document.readyState?e():(window.removeEventListener("load",e),window.addEventListener("load",e))}();

/***/ }),

/***/ 8466:
/***/ (() => {

Smart("smart-window",class extends Smart.ContentElement{static get properties(){return{collapsed:{value:!1,type:"boolean"},closeOnMaskClick:{value:!1,type:"boolean"},disableEscape:{value:!1,type:"boolean"},disableFocus:{value:!1,type:"boolean"},disableSnap:{value:!1,type:"boolean"},footerPosition:{value:"bottom",allowedValues:["bottom","none"],type:"string"},footerTemplate:{value:null,type:"any"},headerButtons:{value:["close","maximize","minimize"],type:"array"},headerPosition:{value:"top",allowedValues:["top","bottom","left","right","none"],type:"string"},headerTemplate:{value:null,type:"any"},disableKeyboard:{value:!1,type:"boolean"},label:{value:"",type:"string"},liveResize:{value:!1,type:"boolean"},maximized:{value:!1,type:"boolean"},modal:{value:!1,type:"boolean"},minimized:{value:!1,type:"boolean"},opened:{value:!1,type:"boolean"},pinned:{value:!1,type:"boolean"},resizeIndicator:{value:!1,type:"boolean"},resizeMode:{allowedValues:["none","horizontal","vertical","both","top","bottom","left","right"],value:"none",type:"string"},windowParent:{value:null,type:"any"}}}static get listeners(){return{"document.dragstart":"_dragStartHandler","document.focusin":"_documentFocusInEventHandler","document.move":"_documentMoveHandler","document.up":"_documentUpHandler","document.wheel":"_mouseWheelHandler","document.selectstart":"_documentSelectStartHandler",down:"_downHandler",focus:"_focusHandler",blur:"_focusHandler",move:"_moveHandler",keydown:"_keyDownHandler",keyup:"_keyUpHandler"}}get hasStyleObserver(){return!1}static get styleUrls(){return["smart.button.css","smart.window.css"]}template(){return'<div role="presentation">\n                    <div class="smart-content-container" id="container">\n                        <div id="headerSection" class="smart-header-section" role="heading" aria-level="1">\n                            <div id="header" class="smart-header" role="presentation">[[label]]</div>\n                            <div id="buttonsContainer" class="smart-buttons-container" role="presentation">\n                                <button id="pinButton" class="smart-button smart-element smart-pin-button" aria-label="Pin"></button>\n                                <button id="collapseButton" class="smart-button smart-element smart-collapse-button" aria-label="Collapse"></button>\n                                <button id="minimizeButton" class="smart-button smart-element smart-minimize-button"aria-label="Minimize"></button>\n                                <button id="maximizeButton" class="smart-button smart-element smart-maximize-button" aria-label="Maximize"></button>\n                                <button id="closeButton" class="smart-button smart-element smart-close-button" aria-label="Close"></button>\n                            </div>\n                        </div>\n                        <div class="smart-content" inner-h-t-m-l="[[innerHTML]]"><content></content></div>\n                        <div id="footer" class="smart-footer"></div>\n                    </div>\n                </div>'}propertyChangedHandler(e,t,a){const i=this;switch(e){case"collapsed":a?i.collapse(!0):i.expand(!0);break;case"disabled":case"unfocusable":i._setFocusable();break;case"headerTemplate":case"footerTemplate":i._applyLayoutTemplate(i.$[e.split(/[T]/)[0]],a);break;case"headerButtons":i._setHeaderButtons();break;case"headerPosition":{const e=i.minimized;i._preventEventFiring=!0,i.restore(),delete i._preventEventFiring,e&&i.minimize();break}case"label":i.$.header.innerHTML=i.label;break;case"maximized":a?i.maximize(!0):i.restore(e);break;case"modal":i._setModal(),i.setAttribute("aria-modal",a);break;case"minimized":a?i.minimize(!0):i.restore(e);break;case"opened":a?i.open(!0):i.close(!0);break;case"resizeMode":i.$.container.classList.remove("smart-window-resizing-bottom-right","smart-window-resizing-top-right","smart-window-resizing-top-left","smart-window-resizing-bottom-left","smart-window-resizing-top","smart-window-resizing-bottom","smart-window-resizing-left","smart-window-resizing-right");break;case"windowParent":i._setElementParent(a);break;default:super.propertyChangedHandler(e,t,a)}}ready(){super.ready(),this._windowParent={initialParent:this.parentElement}}render(){const e=this,t=e.animation;e.$.header.id||(e.$.header.id=e.id+"Header"),e.$.content.id||(e.$.content.id=e.id+"Content"),e.opened||(e.animation="none"),e._windowParent={initialParent:e.parentElement},e.$.addClass("smart-window"),e._createElement(),e._setElementParent(e.windowParent),e._setHeaderButtons(),e.headerTemplate&&e._applyLayoutTemplate(e.$.header,e.headerTemplate),e.footerTemplate&&e._applyLayoutTemplate(e.$.footer,e.footerTemplate),e.opened?e.open():e.close(),e.maximized&&e.maximize(!0),e.minimized&&e.minimize(!0),e.collapsed&&e.collapse(!0),e.pinned?e.pin():e.unpin(),e._setFocusable(),e.animation=t,e.setAttribute("aria-modal",e.modal),e.setAttribute("aria-labelledby",e.$.header.id),e._setupDismissTargets(),super.render()}refresh(){const e=this;e.headerTemplate&&e._applyLayoutTemplate(e.$.header,e.headerTemplate),e.footerTemplate&&e._applyLayoutTemplate(e.$.footer,e.footerTemplate),e.opened?e.open():e.close(),e.maximized&&e.maximize(!0),e.minimized&&e.minimize(!0),e.collapsed&&e.collapse(!0),e.pinned?e.pin():e.unpin()}static get requires(){return{"Smart.Button":"smart.button.js"}}_setFocusable(){const e=this;if(e.disabled||e.unfocusable)e.removeAttribute("tabindex");else{let t=e.tabIndex>0?e.tabIndex:0;e.setAttribute("tabindex",t)}}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.$.content.appendChild(e):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"appendChild",node:"node"}))}updateLabel(e){this.label=e}updateContent(e){this.content=e}move(e,t){const a=this,i=e=>"number"==typeof e?e+"px":"string"==typeof e?e:void 0;void 0!==e&&(a.style.left=i(e)),void 0!==t&&(a.style.top=i(t))}collapse(e){const t=this;!e&&t.collapsed||(t.collapsed=!0,t.$.fireEvent("collapse"),"left"===t.headerPosition||"right"===t.headerPosition?t.style.width="":t.style.height="")}close(e){const t=this;if(e||!t.$.hasClass("smart-visibility-hidden")){if(t.isCompleted){if(t.$.fireEvent("closing").defaultPrevented)return;t.$.addClass("smart-visibility-hidden"),t.opened=!1,t.isRendered&&t.$.fireEvent("close")}else t.$.addClass("smart-visibility-hidden"),t.opened=!1;t._setModal(),t.removeAttribute("ontop")}}attached(){super.attached();const e=this;e.isRendered,e._windowParent.parent&&e._windowParent.parent!==e.getShadowRootOrBody()&&e._windowParent.parent.querySelectorAll("smart-window, smart-dialog-window, smart-progress-window, smart-wait-window, smart-alert-window, smart-prompt-window, smart-multiline-prompt-window")&&"static"===window.getComputedStyle(e._windowParent.parent).getPropertyValue("position")&&(e._windowParent.parent.style.position="relative"),e.opened&&e._modal&&e.parentElement.insertBefore(e._modal,e)}bringToFront(){const e=this;if(!e.parentElement)return;const t=e.parentElement.closest(".smart-window");if(t)return void t.bringToFront();const a=document.body.getElementsByClassName("smart-window");let i=[];for(let e=0;e<a.length;e++){const t=a[e];t.removeAttribute("ontop"),t.opened&&i.push(t)}1===i.length&&i[0]===e||e.setAttribute("ontop","")}clear(){const e=this;e.isCompleted&&"Smart-WINDOW"===e.nodeName&&(e.innerHTML=e.$.content.innerHTML="")}detached(){super.detached();const e=this;e._windowParent.parent&&!e._windowParent.parent.querySelectorAll("smart-window, smart-dialog-window, smart-progress-window, smart-wait-window, smart-alert-window, smart-prompt-window, smart-multiline-prompt-window")&&(e._windowParent.parent.style.position=""),e._modal&&e._modal.parentElement&&e._modal.parentElement.removeChild(e._modal),e._resizeDummy&&e._resizeDummy.parentElement&&e._handleWindowResizeDummy(),e._refreshMinimizedWindowsPosition()}expand(e){const t=this;(e||t.collapsed)&&(t.collapsed=!1,t.$.fireEvent("expand"),t.maximized?"left"===t.headerPosition||"right"===t.headerPosition?t.style.width=Math.max(t._windowParent.scrollElement.scrollWidth,t._windowParent.element.clientWidth)-t._windowParent.borderWidth+"px":t.style.height=Math.max(t._windowParent.scrollElement.scrollHeight,t._windowParent.element.clientHeight)-t._windowParent.borderWidth+"px":"left"===t.headerPosition||"right"===t.headerPosition?t.style.width=t.className.indexOf("smart-window-snapped-")<0&&t._dragDetails?t._dragDetails.width+"px":"":t.style.height=t.className.indexOf("smart-window-snapped-")<0&&t._dragDetails?t._dragDetails.height+"px":"")}maximize(e){const t=this;if(!e&&t.maximized)return;t.minimized&&t._restoreFromMinimization(e),t._setDragDetails("minimize"),"none"!==t.resizeMode&&t.$.container.classList.remove("smart-window-resizing-bottom-right","smart-window-resizing-top-right","smart-window-resizing-top-left","smart-window-resizing-bottom-left","smart-window-resizing-top","smart-window-resizing-bottom","smart-window-resizing-left","smart-window-resizing-right"),t._snapDummy&&t.$.hasClass("smart-window-snapped-"+t._snapDummy._position)&&t.classList.remove("smart-window-snapped-"+t._snapDummy._position),t.maximized=!0,t.$.fireEvent("maximize"),t.style.left=t.style.top=0,t.style.maxWidth=t.style.maxHeight="none";const a=t._windowParent.scrollElement.scrollHeight,i=t._windowParent.scrollElement.scrollWidth,n=t._windowParent.element.clientHeight,o=t._windowParent.element.clientWidth,s=Math.max(a,n),r=Math.max(i,o);"top"===t.headerPosition||"bottom"===t.headerPosition?(t.style.width=i>o?r-t._windowParent.borderWidth+"px":"100%",t.collapsed||(t.style.height=a>n?s-t._windowParent.borderWidth+"px":"100%")):(t.collapsed||(t.style.width=i>o?r-t._windowParent.borderWidth+"px":"100%"),t.style.height=a>n?s-t._windowParent.borderWidth+"px":"100%"),"100%"!==t.style.height&&t.addEventListener("transitionend",(function e(){if(!t.maximized||!t.hasAnimation)return;const a=t._windowParent.scrollElement.scrollHeight,i=t._windowParent.element.clientHeight,n=Math.max(a,i);("top"===t.headerPosition||"bottom"===t.headerPosition)&&t.collapsed||(t.style.height=a>i?n-t._windowParent.borderWidth+"px":"100%"),t.removeEventListener("transitionend",e)}))}minimize(e){const t=this;if(!e&&t.minimized)return;t.maximized&&(t._preventEventFiring=!0,t.restore(),delete t._preventEventFiring),t._setDragDetails(),t.minimized=!0,t.$.fireEvent("minimize"),t._snapDummy&&t.$.hasClass("smart-window-snapped-"+t._snapDummy._position)&&(t.$.removeClass("smart-window-snapped-"+t._snapDummy._position),t.style.right=t.style.top=t.style.left="");const a=t._getAllMinimizedWindows(t._windowParent.element);if(a.length>0){const e=a[a.length-1];t.style.left=(e.offsetLeft+e.offsetWidth+t._dragDetails.minWidth+10>t._windowParent.element.clientWidth?e.offsetLeft:e.offsetLeft+e.offsetWidth+5)+"px",t.style.top=e.offsetTop+"px"}else t.style.left="5px",t.style.top=t._windowParent.element.clientHeight+t._windowParent.scrollElement.scrollTop-t.$.headerSection.offsetHeight-5+"px";t.style.width="",t.style.height=t.$.headerSection.offsetHeight+"px"}_createElement(){this.setAttribute("role","dialog")}removeChild(e){const t=this;if(!t.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e?t.$.content.removeChild(e):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"removeChild",node:"node"}))}restore(e){const t=this;if("maximized"===e||t.maximized?(t.maximized=!1,t.style.width=t.style.height=t.style.top=t.style.left=""):("minimized"===e||t.minimized)&&t._restoreFromMinimization(e),t._preventEventFiring||t.$.fireEvent("restore"),t.style.maxWidth=t.style.maxHeight="",t._dragDetails){if(t.style.left=Math.max(0,Math.min(t._dragDetails.windowX,t._windowParent.element.clientWidth-t._dragDetails.width))+"px",t.style.top=Math.max(0,Math.min(t._dragDetails.windowY,t._windowParent.scrollElement.scrollHeight-t._dragDetails.height))+"px",t.collapsed)return void("top"===t.headerPosition||"bottom"===t.headerPosition?t.style.width=t._dragDetails.width+"px":t.style.height=t._dragDetails.height+"px");t._dragDetails.resized&&(t.style.width=t._dragDetails.width+"px",t.style.height=t._dragDetails.height+"px")}}toggle(){const e=this;e.opened?e.close():e.open()}openModal(){this.modal=!0,this.open()}open(e){const t=this;if(e||t.$.hasClass("smart-visibility-hidden")){if(t.isCompleted){if(t.$.fireEvent("opening").defaultPrevented)return;t.$.removeClass("smart-visibility-hidden"),t.opened=!0,t.$.fireEvent("open")}else t.$.removeClass("smart-visibility-hidden"),t.opened=!0;t.bringToFront(),t._setModal(),t._handleActiveState(),t.hasAnimation?t.addEventListener("transitionend",a):a()}function a(e){if(!t.hasAnimation||e&&e.target===t){if(t.removeEventListener("transitionend",a),t._onOpenCallback)return void t._onOpenCallback();if(t.disableFocus)return;t.focus()}}}_setupDismissTargets(){const e=this;if(e.querySelector('[data-dismiss="modal"]')){const t=e.querySelectorAll('[data-dismiss="modal"]'),a=()=>{e.close()};for(let e=0;e<t.length;e++)t[e].removeEventListener("click",a,null),t[e].addEventListener("click",a)}}pin(){this.pinned=!0}unpin(){this.pinned=!1}_applyLayoutTemplate(e,t){const a=this;if(!t)return e.innerHTML="",void(e===a.$.header&&a.label&&(e.innerHTML=a.label));if("content"in document.createElement("template")){if(t instanceof HTMLTemplateElement||(t=document.getElementById(t)),t&&!("content"in t))return e.innerHTML="",void e.appendChild(t);null!==t&&"content"in t?(e.innerHTML="",e.appendChild(document.importNode(t.content,!0))):a.error(a.localize("invalidTemplate",{elementType:a.nodeName.toLowerCase(),property:e===a.$.footer?"footerTemplate":"headerTemplate"}))}else a.error(a.localize("htmlTemplateNotSuported",{elementType:a.nodeName.toLowerCase()}))}_cancelDragging(e){const t=this;if(t._dragDetails&&t._dragDetails.started&&"drag"===t._dragDetails.type){if(!e){const a=t.getBoundingClientRect();e={pageX:a.left,pageY:a.top}}t.$.fireEvent("dragEnd",{left:e.pageX,top:e.pageY}),t.removeAttribute("dragged"),t._dragDetails.started=!1,delete t._mouseManipulation}}_documentFocusInEventHandler(e){const t=this;if(t._changingFocus){if(!t.contains(e.target)&&!t.contains(e.composedPath()[0])){if(t.disableFocus)return;t.focus()}delete t._changingFocus}}_downHandler(e){const t=this;let a=Smart.Utilities.Core.isMobile?document.elementFromPoint(e.pageX-window.pageXOffset,e.pageY-window.pageYOffset):e.originalEvent.target;if((t.shadowRoot||t.isInShadowDOM)&&(a=e.originalEvent.composedPath()[0]),e.stopPropagation(),t.disabled||!Smart.Utilities.Core.isMobile&&1!==e.which)return;if(t._tabsWindow&&(t._tabsWindow._isAutoHideWindowClicked=!0),t.hasAttribute("ontop")||t.bringToFront(),a.closest&&a.closest(".smart-buttons-container")===t.$.buttonsContainer){if(t._buttonPressed=a.closest(".smart-button"),t._buttonPressed)return}else if(a.getRootNode()&&a.getRootNode().host&&(t._buttonPressed=a.getRootNode().host,t._buttonPressed.closest(".smart-buttons-container")===t.$.buttonsContainer))return;t._isWindowContentClicked=a.closest(".smart-content");let i=t.closest("smart-docking-layout");if(t.isInShadowDOM&&!i){let e=t.getRootNode().host;for(;e&&(i=e.closest("smart-docking-layout"),!i)&&e.getRootNode();)e=e.getRootNode().host}if(!(t instanceof Smart.TabsWindow&&i&&i.disabled)){if(t._handleActiveState(),!(t instanceof Smart.TabsWindow&&i))return a.closest(".smart-header-section")===t.$.headerSection&&(void 0===t._dblClickDetails&&(t._dblClickDetails={clicks:0}),clearTimeout(t._dblClickDetails.timeOut),t._dblClickDetails.clicks++,t._dblClickDetails.timeOut=setTimeout((function(){t._dblClickDetails&&(t._dblClickDetails.clicks=0)}),300),2===t._dblClickDetails.clicks)?(t._headerDblCickHandler(e),void(t._dblClickDetails.clicks=0)):void(t.maximized||(Smart.Utilities.Core.isMobile&&t._moveHandler(e),!t.pinned&&!t.minimized&&t.$.container.className.indexOf("smart-window-resizing")<0&&(a=a.closest(".smart-header-section"),a&&a===t.$.headerSection&&(t._mouseManipulation=!0,t._setDragDetails("drag",e))),"none"!==t.resizeMode&&t.$.container.className.indexOf("smart-window-resizing")>-1&&(t._mouseManipulation=!0,t._setDragDetails("resize",e))));t.$.hasClass("smart-docking-layout-auto-hide-window")&&(Smart.Utilities.Core.isMobile&&t._moveHandler(e),"none"!==t.resizeMode&&t.$.container.className.indexOf("smart-window-resizing")>-1&&(t._mouseManipulation=!0,t._setDragDetails("resize",e)))}}_documentMoveHandler(e){const t=this;!t._dragDetails||!t._dragDetails.started||t.minimized||!t._mouseManipulation||Math.abs(e.pageX-t._dragDetails.x)<=5&&Math.abs(e.pageY-t._dragDetails.y)<=5||(t.hasAttribute("dragged")||t.hasAttribute("resized")||t.$.fireEvent(t._dragDetails.type+"Start",{left:e.pageX,top:e.pageY,width:t.offsetWidth,height:t.offsetHeight}),e.stopPropagation(),"drag"!==t._dragDetails.type||t.pinned?(t._dragDetails.resized=!0,t._resize(t._dragDetails.side,e),t._dragDetails.x=Math.max(t._windowParent.offsetLeft+t._dragDetails.left,Math.min(t._windowParent.offsetLeft+t._dragDetails.left+(t._dragDetails.side.toLowerCase().indexOf("left")>-1?0:t._dragDetails.newWidth),e.pageX)),t._dragDetails.y=Math.max(t._windowParent.offsetTop+t._dragDetails.top,Math.min(t._windowParent.offsetTop+t._dragDetails.top+(t._dragDetails.side.toLowerCase().indexOf("top")>-1?0:t._dragDetails.newHeight),e.pageY))):(t.setAttribute("dragged",""),t._snapDummy&&t.$.hasClass("smart-window-snapped-"+t._snapDummy._position)&&(t.$.removeClass("smart-window-snapped-"+t._snapDummy._position),t.style.right=t.style.top=t.style.left="",t.collapsed||(t.style.height=t._dragDetails.height+"px",t.style.width=t._dragDetails.width+"px")),t._drag(e,"both"),t._dragDetails.x=Math.max(t._windowParent.offsetLeft+t._dragDetails.offsetX-t._windowParent.scrollElement.scrollLeft,Math.min(t._windowParent.offsetLeft+t._windowParent.element.offsetWidth-(t._windowParent.element.offsetWidth-t.offsetLeft)+t._dragDetails.offsetX,e.pageX)),t._dragDetails.y=Math.max(t._windowParent.offsetTop+t._dragDetails.offsetY-t._windowParent.scrollElement.scrollTop,Math.min(t._windowParent.offsetTop+t._windowParent.element.offsetHeight-(t._windowParent.element.offsetHeight-t.offsetTop)+t._dragDetails.offsetY,e.pageY)),e.pageX>=t._windowParent.offsetLeft+t._windowParent.scrollElement.scrollWidth-1?t._handleSnapping("right"):e.pageY<=t._windowParent.offsetTop?t._handleSnapping("top"):e.pageX<=t._windowParent.offsetLeft?t._handleSnapping("left"):t._handleSnapping()))}_documentUpHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if(t.disabled)return t.removeAttribute("active"),delete t._buttonPressed,void delete t._isWindowContentClicked;if(t._dragDetails&&t._dragDetails.started&&(t.hasAttribute("resized")&&(t.$.fireEvent(t._dragDetails.type+"End",{left:e.pageX,top:e.pageY,width:t._dragDetails.newWidth,height:t._dragDetails.newHeight}),t.removeAttribute("resized"),t._handleWindowResizeDummy(),t.$.container.classList.remove("smart-window-resizing-bottom-right","smart-window-resizing-top-right","smart-window-resizing-top-left","smart-window-resizing-bottom-left","smart-window-resizing-top","smart-window-resizing-bottom","smart-window-resizing-left","smart-window-resizing-right")),setTimeout((function(){t.$.removeClass("no-transition")}),20),t.hasAttribute("dragged")&&(t.$.fireEvent(t._dragDetails.type+"End",{left:e.pageX,top:e.pageY}),t.removeAttribute("dragged")),t._dragDetails.started=!1,delete t._mouseManipulation),t._snapDummy&&!t._snapDummy.classList.contains("smart-visibility-hidden")){switch(t._snapDummy._position){case"left":case"top":t.style.left=t.style.top="0",t.style.right="auto";break;case"right":t.style.left="auto",t.style.top=t.style.right="0"}t.style.width="top"===t._snapDummy._position?"100%":"50%",t.style.height="100%",t.$.addClass("smart-window-snapped-"+t._snapDummy._position),t._handleSnapping()}t._modal&&a===t._modal&&!t._isWindowContentClicked&&(t.closeOnMaskClick?t.close():t.focus()),t._isWindowButton(a)&&t.focus(),delete t._isWindowContentClicked,delete t._buttonPressed;const i=t.shadowRoot&&t._windowParent.element&&t._windowParent.element.getRootNode()?t._windowParent.element.getRootNode().activeElement:document.activeElement;if(!t.hasAttribute("active")||i===t)return;if(!a.closest)return;let n=a.closest(".smart-window");for(;n&&n!==t;)n=n.parentElement,n&&(n=n.closest(".smart-window"));t.opened&&n!==t&&t.removeAttribute("active")}_documentSelectStartHandler(e){this._dragDetails&&this._dragDetails.started&&e.preventDefault()}_drag(e,t){const a=this;if(!e||a.pinned||a.maximized)return;let i,n;a._dragDetails&&a._dragDetails.started||a._setDragDetails("drag",e),a.$.addClass("no-transition"),"object"==typeof e?(i=e.pageX-a._dragDetails.x,n=e.pageY-a._dragDetails.y):i=n=e;const o=Math.max(a._windowParent.element.clientHeight,a._windowParent.scrollElement.scrollHeight),s=Math.max(a._windowParent.element.clientWidth,a._windowParent.scrollElement.scrollWidth);switch(t){case"horizontal":a._dragDetails.windowX=Math.max(0,Math.min(a._dragDetails.windowX+i,s-a.offsetWidth)),a.style.left=a._dragDetails.windowX+"px";break;case"vertical":a._dragDetails.windowY=Math.max(0,Math.min(a._dragDetails.windowY+n,o-a.offsetHeight)),a.style.top=a._dragDetails.windowY+"px";break;case"both":a._dragDetails.windowX=Math.max(0,Math.min(a._dragDetails.windowX+i,s-a.offsetWidth)),a._dragDetails.windowY=Math.max(0,Math.min(a._dragDetails.windowY+n,o-a.offsetHeight)),a.style.left=a._dragDetails.windowX+"px",a.style.top=a._dragDetails.windowY+"px"}a._dragDetails.top=a.offsetTop,a._dragDetails.left=a.offsetLeft}_dragStartHandler(e){this._dragDetails&&this._dragDetails.started&&e.preventDefault()}_focusHandler(e){const t=this;"focus"===e.type?(t.setAttribute("focus",""),t.bringToFront()):t._buttonPressed||(t.removeAttribute("focus"),t._dragDetails&&t._dragDetails.started&&t._handleWindowResizeDummy())}_getAllMinimizedWindows(e){const t=this;let a=[];e||(e=t._windowParent.element);const i=e.querySelectorAll("smart-window");for(let e=0;e<i.length;e++)i[e]!==t&&i[e].hasAttribute("minimized")&&a.push(i[e]);return a.sort((function(e,t){let a=e.getBoundingClientRect(),i=t.getBoundingClientRect();return a.right-i.right})),a}_handleSnapping(e){const t=this;e?t.disableSnap||t.collapsed||(t._snapDummy||(t._snapDummy=document.createElement("div"),t._snapDummy.addEventListener("transitionend",(function(){t._snapDummy.classList.contains("smart-visibility-hidden")&&t._snapDummy.parentElement&&t._snapDummy.parentElement.removeChild(t._snapDummy)}))),t._snapDummy.className="smart-window-snap-"+e+"-feedback",t._snapDummy._position=e,t._snapDummy.parentElement||t._windowParent.element.appendChild(t._snapDummy)):t._snapDummy&&t._snapDummy.parentElement&&t._snapDummy.classList.add("smart-visibility-hidden")}_headerDblCickHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;a!==t.$.headerSection&&a!==t.$.header||t.$.maximizeButton&&0===t.$.maximizeButton.offsetHeight||(t.maximized?t.restore():t.maximize())}_isWindowButton(e){const t=this;for(;e&&(e.closest&&e.closest(".smart-buttons-container"))!==t.$.buttonsContainer;)e=e.getRootNode().host;if(!e)return;const a=/smart-(\w+[-]*\w*)-button/gi;if((e=e.closest(".smart-button"))&&e===t._buttonPressed)switch(e){case t.$.closeButton:return t.close(),!0;case t.$.collapseButton:return t.collapsed?t.expand():t.collapse(),!0;case t.$.maximizeButton:return t.maximized?t.restore():t.maximize(),!0;case t.$.minimizeButton:return t.minimized?t.restore():t.minimize(),!0;case t.$.pinButton:return t.pinned?t.unpin():t.pin(),!0;default:if(!a.test(e.className))return;return t.$.fireEvent(Smart.Utilities.Core.toCamelCase(e.className.match(a).toString().replace("smart-","").replace("-button","")),{button:e}),!0}}_keyDownHandler(e){const t=this;if(delete t._changingFocus,t.disabled||(t.hasAttribute("dragged")||t.hasAttribute("resized"))&&t._mouseManipulation)return;const a="ArrowDown"===e.key||"ArrowRight"===e.key?10:-10,i=t.enableShadowDOM&&t._windowParent.element.getRootNode()?t._windowParent.element.getRootNode().activeElement:document.activeElement;if(!t.disableKeyboard)switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":{if(t.minimized||i!==t)return;let n=e.key.indexOf("Right")>-1||e.key.indexOf("Left")>-1;e.preventDefault();const o=(t.isInShadowDOM?t.getRootNode().host:t).closest("smart-docking-layout");if(!n&&e.altKey&&!(t instanceof Smart.TabsWindow&&o))return void("ArrowUp"===e.key?t.maximize():t.restore());if(t.maximized)return;if(t.$.addClass("no-transition"),e.ctrlKey&&"none"!==t.resizeMode&&!t.collapsed)return n=-1===["horizontal","vertical","both"].indexOf(t.resizeMode)?t.resizeMode:n?"right":"bottom",t.hasAttribute("dragged")&&t._cancelDragging(e),t.hasAttribute("resized")||t.$.fireEvent("resizeStart",{position:{x:e.pageX,y:e.pageY}}),void t._resize(n,a);t.pinned||(t.hasAttribute("dragged")||(t.setAttribute("dragged",""),t.$.fireEvent("dragStart",{left:e.pageX,top:e.pageY})),t._drag(a,n?"horizontal":"vertical")),t.$.removeClass("no-transition");break}case"Escape":t.disableEscape||t.headerButtons.indexOf("close")>-1&&t.close();break;case"p":e.altKey&&t.headerButtons.indexOf("pin")>-1&&(t.pinned?t.unpin():t.pin());break;case"c":e.altKey&&t.headerButtons.indexOf("collapse")>-1&&(t.collapsed?t.expand():t.collapse());break;case"m":e.altKey&&t.headerButtons.indexOf("minimize")>-1&&(t.minimized?t.restore():t.minimize());break;case"Tab":t.opened&&t.modal&&(t._changingFocus=!0);break;case"Enter":case" ":{let a;if(t.shadowRoot||t.isInShadowDOM?(a=e.composedPath()[0],t._buttonPressed=a.getRootNode().host):(a=e.target.closest&&e.target.closest(".smart-button"),t._buttonPressed=a),!a)return;t._isWindowButton(a),delete t._buttonPressed;break}}}_keyUpHandler(e){const t=this;if(e.key&&!t.disableKeyboard){if("Control"===e.key&&t._dragDetails&&t.hasAttribute("resized")&&!t._mouseManipulation){if(!t._dragDetails.started)return;"drag"!==t._dragDetails.type&&(t.removeAttribute("resized"),t.$.fireEvent("resizeEnd",{left:e.pageX,top:e.pageY,width:t._dragDetails.newWidth,height:t._dragDetails.newHeight}),t._handleWindowResizeDummy()),t._dragDetails.started=!1}e.key.indexOf("Arrow")>-1&&t.hasAttribute("dragged")&&!t._mouseManipulation&&t._cancelDragging(e)}}_mouseWheelHandler(e){const t=this;!t.disabled&&t._dragDetails&&t._dragDetails.started&&(e.deltaY<0&&t._windowParent.scrollElement.scrollTop+e.deltaY<=0?t.style.top=Math.max(0,t._dragDetails.windowY)+"px":e.deltaY>0&&(t._dragDetails.windowY+t.offsetHeight+e.deltaY>=t._windowParent.scrollElement.scrollHeight||t._windowParent.scrollElement.scrollTop+t._windowParent.element.clientHeight===t._windowParent.scrollElement.scrollHeight)||("drag"===t._dragDetails.type?(t._dragDetails.windowY+=e.deltaY,t.style.top=t._dragDetails.windowY+"px"):(t._dragDetails.height+=e.deltaY,t.style.height=t._dragDetails.height+"px")))}_moveHandler(e){const t=this;if(!(t.disabled||t.collapsed||t.maximized||t.minimized||(Smart.Utilities.Core.isMobile&&navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)&&t.hasAttribute("dragged")&&e.originalEvent.preventDefault(),t._mouseManipulation||(t.$.container.className.indexOf("smart-window-resizing")>-1&&t.$.container.classList.remove("smart-window-resizing-bottom-right","smart-window-resizing-top-right","smart-window-resizing-top-left","smart-window-resizing-bottom-left","smart-window-resizing-top","smart-window-resizing-bottom","smart-window-resizing-left","smart-window-resizing-right"),"none"===t.resizeMode)))){const a=t.getBoundingClientRect(),i=e.clientY<a.top+10,n=e.clientY>a.bottom-10,o=e.clientX>a.right-10,s=e.clientX<a.left+10;switch(t.resizeMode){case"none":break;case"both":if(t.resizeIndicator)return void(n&&o&&t.$.container.classList.add("smart-window-resizing-bottom-right"));if(s||o)return i?void t.$.container.classList.add("smart-window-resizing-top-"+(s?"left":"right")):n?void t.$.container.classList.add("smart-window-resizing-bottom-"+(s?"left":"right")):void t.$.container.classList.add("smart-window-resizing-"+(s?"left":"right"));if(i||n){if(o)return void t.$.container.classList.add("smart-window-resizing-"+(i?"top-right":"bottom-right"));if(s)return void t.$.container.classList.add("smart-window-resizing-"+(i?"top-left":"bottom-left"));t.$.container.classList.add("smart-window-resizing-"+(i?"top":"bottom"))}break;case"horizontal":if(t.resizeIndicator)return void(n&&o&&t.$.container.classList.add("smart-window-resizing-right"));if(s)return void t.$.container.classList.add("smart-window-resizing-left");o&&t.$.container.classList.add("smart-window-resizing-right");break;case"vertical":if(t.resizeIndicator)return void(n&&o&&t.$.container.classList.add("smart-window-resizing-bottom"));if(i)return void t.$.container.classList.add("smart-window-resizing-top");n&&t.$.container.classList.add("smart-window-resizing-bottom");break;case"top":if(i){if(t.resizeIndicator&&!s)return;t.$.container.classList.add("smart-window-resizing-top")}break;case"bottom":if(n){if(t.resizeIndicator&&!o)return;t.$.container.classList.add("smart-window-resizing-bottom")}break;case"left":if(s){if(t.resizeIndicator&&!i)return;t.$.container.classList.add("smart-window-resizing-left")}break;case"right":if(o){if(t.resizeIndicator&&!n)return;t.$.container.classList.add("smart-window-resizing-right")}}}}_handleActiveState(){const e=this,t=document.querySelectorAll(".smart-window");for(let a=0;a<t.length;a++)t[a].contains(e)||e.contains(t[a])||(t[a].removeAttribute("active"),t[a].removeAttribute("focus"));e.setAttribute("active","")}_handleWindowResizeDummy(){const e=this;if(e._resizeDummy||(e._resizeDummy=document.createElement("div"),e._resizeDummy.classList.add("smart-window-resize-feedback")),!e.hasAttribute("resized"))return e._resizeDummy&&e._resizeDummy.remove(),void(!e.liveResize&&"resize"===e._dragDetails.type&&e._dragDetails.started&&(e.style.top=e._dragDetails.top+"px",e.style.left=e._dragDetails.left+"px",e.style.width=e._dragDetails.newWidth+"px",e.style.height=e._dragDetails.newHeight+"px"));e._resizeDummy.parentElement||e._resizeDummy.getRootNode().host||(e._resizeDummy.style.width=e.offsetWidth+"px",e._resizeDummy.style.height=e.offsetHeight+"px",e._resizeDummy.style.top=e.offsetTop+"px",e._resizeDummy.style.left=e.offsetLeft+"px",e._windowParent.element.appendChild(e._resizeDummy))}_resize(e,t){const a=this;let i;if((!a._dragDetails||a._dragDetails&&"drag"===a._dragDetails.type)&&a._setDragDetails("resize"),!a._dragDetails)return;a._dragDetails.started=!0,a.hasAttribute("resized")||(a.setAttribute("resized",""),a.hasAnimation&&a.$.addClass("no-transition")),a.liveResize||a._handleWindowResizeDummy();const n=a._snapDummy&&a.$.hasClass("smart-window-snapped-"+a._snapDummy._position)?"snapWindowWidth":"width";switch(e){case"left":i="object"==typeof t?t.pageX-a._dragDetails.x:t,i=i>0?Math.min(i,a._dragDetails[n]-a._dragDetails.minWidth):-1*Math.min(a._dragDetails.maxWidth?a._dragDetails.maxWidth-a._dragDetails[n]:a._dragDetails.left,Math.abs(i)),a._dragDetails[n]=Math.min(a._dragDetails[n]+a._dragDetails.left-a._windowParent.scrollElement.scrollLeft,a._dragDetails[n]-i),a._dragDetails.windowX=Math.max(a._windowParent.scrollElement.scrollLeft,a._dragDetails.windowX+i),"object"!=typeof t&&(a._dragDetails[n]=Math.max(a._dragDetails[n],a._dragDetails.minWidth)),a._dragDetails[n]>=a._dragDetails.minWidth&&(a._dragDetails.left=a._dragDetails.windowX,a._dragDetails.newWidth=a._dragDetails[n]);break;case"right":{const e=a._windowParent.element.clientWidth!==a._windowParent.element.offsetWidth?a._windowParent.borderWidth:0,n=a._snapDummy&&a.$.hasClass("smart-window-snapped-"+a._snapDummy._position)?"snapWindowWidth":"width";i="object"==typeof t?t.pageX-a._dragDetails.x:t,i>0&&a._dragDetails.maxWidth&&(i=Math.min(a._dragDetails.maxWidth-a._dragDetails[n],i)),a._dragDetails[n]=Math.min(a._windowParent.element.clientWidth+a._windowParent.scrollElement.scrollLeft-a._dragDetails.left-e,Math.max(0,a._dragDetails[n]+i)),"object"!=typeof t&&(a._dragDetails[n]=Math.max(a._dragDetails[n],a._dragDetails.minWidth)),a._dragDetails.left=a.offsetLeft,a._dragDetails.newWidth=Math.max(a._dragDetails.minWidth,a._dragDetails[n]);break}case"top":a._snapDummy&&a.$.hasClass("smart-window-snapped-"+a._snapDummy._position)&&(a._dragDetails.height=a._dragDetails.snapWindowHeight),i="object"==typeof t?t.pageY-a._dragDetails.y:t,i=i>0?Math.min(i,a._dragDetails.height-a._dragDetails.minHeight):-1*Math.min(a._dragDetails.maxHeight?a._dragDetails.maxHeight-a._dragDetails.height:a._dragDetails.top,Math.abs(i)),a._dragDetails.snapWindowHeight=a._dragDetails.height=Math.min(a._dragDetails.height+a._dragDetails.top-a._windowParent.scrollElement.scrollTop,a._dragDetails.height-i),a._dragDetails.windowY=Math.max(a._windowParent.scrollElement.scrollTop,a._dragDetails.windowY+i),"object"!=typeof t&&(a._dragDetails.snapWindowHeight=a._dragDetails.height=Math.max(a._dragDetails.height,a._dragDetails.minHeight)),a._dragDetails.height>=a._dragDetails.minHeight&&(a._dragDetails.top=a._dragDetails.windowY,a._dragDetails.newHeight=a._dragDetails.height),a._dragDetails.newWidth=Math.max(a._dragDetails[n],a._dragDetails.newWidth);break;case"bottom":a._snapDummy&&a.$.hasClass("smart-window-snapped-"+a._snapDummy._position)&&(a._dragDetails.height=a._dragDetails.snapWindowHeight),i="object"==typeof t?t.pageY-a._dragDetails.y:t,i>0&&a._dragDetails.maxHeight&&(i=Math.min(a._dragDetails.maxHeight-a._dragDetails.height,i)),a._dragDetails.snapWindowHeight=a._dragDetails.height=Math.min(a._windowParent.element.clientHeight+a._windowParent.scrollElement.scrollTop-a._dragDetails.top-a._windowParent.borderWidth,Math.max(0,a._dragDetails.height+i)),"object"!=typeof t&&(a._dragDetails.snapWindowHeight=a._dragDetails.height=Math.max(a._dragDetails.height,a._dragDetails.minHeight)),a._dragDetails.newHeight=Math.max(a._dragDetails.minHeight,a._dragDetails.height),a._dragDetails.newWidth=Math.max(a._dragDetails[n],a._dragDetails.newWidth);break;case"bottomLeftCorner":a._resize("bottom",t),a._resize("left",t);break;case"bottomRightCorner":a._resize("bottom",t),a._resize("right",t);break;case"topLeftCorner":a._resize("top",t),a._resize("left",t);break;case"topRightCorner":a._resize("top",t),a._resize("right",t)}const o=a.liveResize?a:a._resizeDummy;a._dragDetails.newHeight=Math.max(a._dragDetails.snapWindowHeight,a._dragDetails.newHeight),o.style.top=a._dragDetails.top+"px",o.style.left=a._dragDetails.left+"px",o.style.width=a._dragDetails.newWidth+"px",o.style.height=a._dragDetails.newHeight+"px"}_restoreFromMinimization(){const e=this;e.minimized=!1,e.style.width=e.style.height=e.style.top=e.style.left="",e._refreshMinimizedWindowsPosition()}_refreshMinimizedWindowsPosition(){const e=this,t=e._getAllMinimizedWindows();if(0===t.length)return;let a;t[0].style.left="5px";for(let i=1;i<t.length;i++)parseFloat(t[i-1].style.left)+t[i-1].offsetWidth+t[i].offsetWidth+10<e._windowParent.element.clientWidth?(t[i].style.left=parseFloat(t[i-1].style.left)+t[i-1].offsetWidth+5+"px",t[i].style.top=t[i-1].offsetTop+"px",a=t[i]):(t[i].style.left=parseFloat(a.style.left)+"px",t[i].style.top=a.offsetTop+"px")}_setHeaderButtons(){const e=this,t=e.headerButtons,a=e.$.buttonsContainer.children,i=function(t){const a=e.$.buttonsContainer.getElementsByClassName("smart-"+(t+"").split(/(?=[A-Z])/).join("-").toLowerCase()+"-button")[0];return a&&a.classList.remove("smart-hidden"),a};for(let e=0;e<a.length;e++)a[e].classList.add("smart-hidden");if(t.length>0)for(let a=0;a<t.length;a++){let n=i(t[a]);if(!n){const e=(t[a]+"").split(/(?=[A-Z])/);n=document.createElement("button"),n.setAttribute("aria-label",e.map((e=>e.slice(0,1).toUpperCase()+e.slice(1))).join(" ")),n.classList.add("smart-"+e.join("-").toLowerCase()+"-button","smart-button","smart-element")}e.$.buttonsContainer.insertBefore(n,e.$.buttonsContainer.firstElementChild)}}_setDragDetails(e,t){const a=this;if(a._dragDetails||(a._dragDetails={}),void 0===a._dragDetails.minWidth||void 0===a._dragDetails.minHeight||void 0===a._dragDetails.maxWidth||void 0===a._dragDetails.maxHeight){const e=getComputedStyle(a);a._dragDetails.minWidth=parseFloat(e.getPropertyValue("min-width"))||0,a._dragDetails.minHeight=parseFloat(e.getPropertyValue("min-height"))||0,a._dragDetails.maxWidth=parseFloat(e.getPropertyValue("max-width"))||0,a._dragDetails.maxHeight=parseFloat(e.getPropertyValue("max-height"))||0}a._dragDetails.windowX=a.offsetLeft,a._dragDetails.windowY=a.offsetTop;const i=a.getBoundingClientRect();if(a._snapDummy&&a.$.hasClass("smart-window-snapped-"+a._snapDummy._position))"right"===a.headerPosition&&a.collapsed&&(a._dragDetails.offsetX=i.left+a.offsetWidth-t.clientX);else{const n=a.parentElement===document.body?document.documentElement.getBoundingClientRect():a.parentElement?a.parentElement.getBoundingClientRect():document.documentElement.getBoundingClientRect(),o=window.scrollX||window.pageXOffset,s=window.scrollY||window.pageYOffset;a._windowParent.offsetLeft=n.left+o,a._windowParent.offsetTop=n.top+s,t&&"object"==typeof t&&(a._dragDetails.offsetX=t.clientX-i.left,a._dragDetails.offsetY=t.clientY-i.top),a.collapsed||(a.hasAnimation&&"minimize"===e?(a._dragDetails.width=a._dragDetails.width?a._dragDetails.width:a.offsetWidth,a._dragDetails.height=a._dragDetails.height?a._dragDetails.height:a.offsetHeight):(a._dragDetails.width=a.offsetWidth,a._dragDetails.height=a.offsetHeight),(a.style.width||a.style.height)&&(a._dragDetails.resized=!0))}if("minimize"!==e&&e&&(a._dragDetails.type=e,a._dragDetails.started=!0,a._dragDetails.snapWindowWidth=a.offsetWidth,a._dragDetails.snapWindowHeight=a.offsetHeight,t&&"object"==typeof t?(a._dragDetails.x=t.pageX,a._dragDetails.y=t.pageY):(a._dragDetails.x=a.offsetLeft,a._dragDetails.y=a.offsetTop),"resize"===e)){if("none"===a.resizeMode)return void delete a._dragDetails;a._dragDetails.top=a.offsetTop,a._dragDetails.left=a.offsetLeft,a._dragDetails.newWidth=a._dragDetails.width,a._dragDetails.newHeight=a._dragDetails.height,a.$container.hasClass("smart-window-resizing-right")?a._dragDetails.side="right":a.$container.hasClass("smart-window-resizing-left")?a._dragDetails.side="left":a.$container.hasClass("smart-window-resizing-top")?a._dragDetails.side="top":a.$container.hasClass("smart-window-resizing-bottom")?a._dragDetails.side="bottom":a.$container.hasClass("smart-window-resizing-top-left")?a._dragDetails.side="topLeftCorner":a.$container.hasClass("smart-window-resizing-bottom-left")?a._dragDetails.side="bottomLeftCorner":a.$container.hasClass("smart-window-resizing-top-right")?a._dragDetails.side="topRightCorner":a.$container.hasClass("smart-window-resizing-bottom-right")&&(a._dragDetails.side="bottomRightCorner")}}_setElementParent(e){const t=this;if(t._windowParent.element=void 0,t._windowParent.parent&&!t._windowParent.parent.querySelectorAll("smart-window, smart-dialog-window, smart-progress-window, smart-wait-window, smart-alert-window, smart-prompt-window, smart-multiline-prompt-window")&&(t._windowParent.parent.style.position=""),e instanceof HTMLElement)t._windowParent.element=e;else if("string"==typeof e)if("body"===e){const e=t.getRootNode();t._windowParent.element=e&&e.host?t.getShadowRootOrBody():document.body}else t._windowParent.element=document.getElementById(e);if(t._windowParent.element||(t._windowParent.initialParent?t._windowParent.element=t._windowParent.initialParent.parentElement?t._windowParent.initialParent:t.getShadowRootOrBody():t._windowParent.element=t.getShadowRootOrBody()),t.parentElement!==t._windowParent.element&&t._windowParent.element.appendChild(t),t._windowParent.element===document.body)t._windowParent.element=document.documentElement,t._windowParent.scrollElement=document.scrollingElement,t._windowParent.parent=document.body,t._windowParent.borderWidth=0;else{if(t.parentElement instanceof Smart.Window&&!t.parentElement.isCompleted)return void t.parentElement.whenRendered((function(){t.parentElement.appendChild(t),t._setElementParent(t.windowParent)}));if(t._windowParent.element instanceof Smart.Window&&(t._windowParent.element=t._windowParent.element.$.content),t.parentElement){const e=getComputedStyle(t.parentElement),a=e.getPropertyValue("position");t._windowParent.borderWidth=2*parseInt(e.getPropertyValue("border-width")||0),t._windowParent.parent=t.parentElement,t._windowParent.scrollElement=t._windowParent.element,"static"===a&&(t.parentElement.style.position="relative")}else t._windowParent.scrollElement=t._windowParent.element}t._setModal(),t.style.left&&t.offsetLeft>t._windowParent.scrollElement.scrollWidth&&(t.style.left=t._windowParent.scrollElement.scrollWidth-t.offsetWidth+"px"),t.style.top&&t.offsetTop>t._windowParent.scrollElement.scrollHeight&&(t.style.top=t._windowParent.scrollElement.scrollHeight-t.offsetHeight+"px")}_setModal(){const e=this;if(e._windowParent&&(delete e._changingFocus,e._windowParent.element))if(e.modal)if(e._modal||(e._modal=document.createElement("div"),e._modal.classList.add("smart-modal")),e._windowParent.parent!==document.body?e._modal.setAttribute("nested-modal",""):e._modal.removeAttribute("nested-modal"),e._modal._window=e,e.opened&&!e._modal.parentElement){const t=parseInt(getComputedStyle(e).getPropertyValue("z-index"));isNaN(t)||(e._modal.style.zIndex=t-1),e.parentElement.insertBefore(e._modal,e)}else e._modal.parentElement&&e._modal.parentElement.removeChild(e._modal);else e._modal&&e._modal.parentElement&&(e._modal.parentElement.removeChild(e._modal),delete e._modal)}}),Smart("smart-dialog-window",class extends Smart.Window{static get properties(){return{cancelLabel:{value:"Cancel",type:"string"},confirmLabel:{value:"Ok",type:"string"},disableSnap:{value:!0,readOnly:!0,type:"boolean"},headerButtons:{value:["close"],type:"array"},modal:{value:!0,readOnly:!0,type:"boolean",defaultReflectToAttribute:!0}}}static get listeners(){return{"footer.click":"_footerClickHandler"}}template(){return'<div role="presentation">\n                    <div class="smart-content-container" id="container">\n                        <div id="headerSection" class="smart-header-section" role="heading" aria-level="1">\n                            <div id="header" class="smart-header">[[label]]</div>\n                            <div id="buttonsContainer" class="smart-buttons-container">\n                                <button id="pinButton" class="smart-pin-button" aria-label="Pin"></button>\n                                <button id="collapseButton" class="smart-button smart-element smart-collapse-button" aria-label="Collapse"></button>\n                                <button id="minimizeButton" class="smart-button smart-element smart-minimize-button" aria-label="Minimize"></button>\n                                <button id="maximizeButton" class="smart-button smart-element smart-maximize-button" aria-label="Maximize"></button>\n                                <button id="closeButton" class="smart-button smart-element smart-close-button" aria-label="Close"></button>\n                            </div>\n                        </div>\n                        <div class="smart-content">\n                            <content></content>\n                        </div>\n                        <div id="footer" class="smart-footer">\n                            <button id="confirmButton" class="smart-button smart-element smart-confirm-button">[[confirmLabel]]</button>\n                            <button id="cancelButton" class="smart-button smart-element smart-cancel-button">[[cancelLabel]]</button>\n                        </div>\n                    </div>\n                </div>'}_createElement(){const e=this;e.setAttribute("role","alertdialog"),e.setAttribute("aria-describedby",e.$.content.id)}_footerClickHandler(e){const t=this,a=e.target;a.closest(".smart-confirm-button")?t.$.fireEvent("confirm"):a.closest(".smart-cancel-button")&&t.$.fireEvent("cancel")}_keyDownHandler(e){const t=this;if(delete t._changingFocus,t.disabled||(t.hasAttribute("dragged")||t.hasAttribute("resized"))&&t._mouseManipulation)return;if(t.disableKeyboard)return;e.stopPropagation();const a="ArrowDown"===e.key||"ArrowRight"===e.key?10:-10,i=t.enableShadowDOM&&t._windowParent.element.getRootNode()?t._windowParent.element.getRootNode().activeElement:document.activeElement;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":{if(t.minimized||i!==t)return;const n=e.key.indexOf("Right")>-1||e.key.indexOf("Left")>-1;if(e.preventDefault(),!n&&e.altKey)return void("ArrowUp"===e.key?t.maximize():t.restore());if(t.$.addClass("no-transition"),t.maximized)return;if(e.ctrlKey&&"none"!==t.resizeMode)return t.hasAttribute("dragged")&&t._cancelDragging(e),t.hasAttribute("resized")||t.$.fireEvent("resizeStart",{position:{x:e.pageX,y:e.pageY}}),void t._resize(n?"right":"bottom",a);t.pinned||(t.hasAttribute("dragged")||(t.setAttribute("dragged",""),t.$.fireEvent("dragStart",{left:e.pageX,top:e.pageY})),t._drag(a,n?"horizontal":"vertical")),t.$.removeClass("no-transition");break}case"Escape":t.disableEscape||t.headerButtons.indexOf("close")>-1&&t.close();break;case"Tab":t.opened&&t.modal&&(t._changingFocus=!0);break;case"Enter":case" ":{let a;if(t.shadowRoot||t.isInShadowDOM?(a=e.composedPath()[0],t._buttonPressed=a.getRootNode().host):(a=e.target.closest&&e.target.closest(".smart-button"),t._buttonPressed=a),!a)return;t._isWindowButton(a),delete t._buttonPressed;break}}}}),Smart("smart-alert-window",class extends Smart.DialogWindow{static get properties(){return{headerButtons:{value:[],type:"array"}}}_createElement(){const e=this;e.setAttribute("role","alertdialog"),e.setAttribute("aria-describedby",e.$.content.id)}}),Smart("smart-prompt-window",class extends Smart.DialogWindow{static get properties(){return{autoComplete:{allowedValues:["none","manual","auto","inline"],type:"string",value:"manual"},confirmLabel:{value:"Ok",type:"string"},cancelLabel:{value:"Cancel",type:"string"},disableSnap:{value:!0,readOnly:!0,type:"boolean"},displayMode:{value:"default",allowedValues:["default","escaped"],type:"string"},headerButtons:{value:["close"],type:"array"},form:{value:"",type:"string"},hint:{value:null,type:"any?"},maxLength:{value:null,type:"number?"},minLength:{value:2,type:"number"},messages:{extend:!0,value:{en:{missingReference:"{{elementType}}: Missing reference to {{files}}."}},type:"object"},modal:{value:!0,readOnly:!0,type:"boolean",defaultReflectToAttribute:!0},name:{value:"",type:"string"},placeholder:{value:"",type:"string"},promptLabel:{value:"",type:"string?"},required:{value:!1,type:"boolean"},requiredMessage:{value:"",type:"string"},selectAllOnFocus:{value:!1,type:"boolean"},value:{value:"",type:"string"}}}template(){return'<div role="presentation">\n                    <div class="smart-content-container" id="container">\n                        <div id="headerSection" class="smart-header-section" role="heading" aria-level="1">\n                            <div id="header" class="smart-header">[[label]]</div>\n                            <div id="buttonsContainer" class="smart-buttons-container">\n                                <button id="closeButton" class="smart-button smart-element smart-close-button" aria-label="Close"></button>\n                            </div>\n                        </div>\n                        <div class="smart-content">\n                            <content></content>\n                            <smart-text-box id="textBox"\n                                animation="[[animation]]"\n                                auto-complete="[[autoComplete]]"\n                                max-length="[[maxLength]]"\n                                value="{{value}}"\n                                form="[[form]]"\n                                label="[[promptLabel]]"\n                                hint="[[hint]]"\n                                display-mode="[[displayMode]]"\n                                max-length="[[maxLength]]"\n                                placeholder="[[placeholder]]"\n                                required="[[required]]"\n                                required-message="[[requiredMessage]]"\n                                select-all-on-focus="[[selectAllOnFocus]]"\n                                theme="[[theme]]"\n                                right-to-left="[[rightToLeft]]">\n                            </smart-text-box>\n                        </div>\n                        <div id="footer" class="smart-footer">\n                            <button id="confirmButton" class="smart-button smart-element smart-confirm-button flat">[[confirmLabel]]</button>\n                            <button id="cancelButton" class="smart-button smart-element smart-cancel-button flat">[[cancelLabel]]</button>\n                        </div>\n                    </div>\n                </div>'}static get listeners(){return{"footer.click":"_footerClickHandler"}}static get requires(){return{"Smart.TextBox":"smart.textbox.js"}}_footerClickHandler(e){const t=this,a=e.target;a.closest(".smart-confirm-button")?t.$.fireEvent("confirm",{value:t.$.textBox.value}):a.closest(".smart-cancel-button")&&t.$.fireEvent("cancel",{value:t.$.textBox.value})}_keyDownHandler(e){const t=this;function a(){t._dragDetails&&(t._dragDetails.started=!1),t.$.removeClass("no-transition")}if(delete t._changingFocus,t.disabled||t._dragDetails&&t._dragDetails.started)return;if(t.disableKeyboard)return;e.stopPropagation();const i="ArrowDown"===e.key||"ArrowRight"===e.key?10:-10,n=t.enableShadowDOM&&t._windowParent.element.getRootNode()?t._windowParent.element.getRootNode().activeElement:document.activeElement;switch(t.$.removeClass("no-transition"),e.key){case"ArrowUp":case"ArrowDown":if(n!==t)return;if(e.preventDefault(),e.altKey)return"ArrowUp"===e.key?t.maximize():t.restore(),void a();if(t.$.addClass("no-transition"),e.ctrlKey)return t._resize("bottom",i),void a();t._drag(i,"vertical");break;case"ArrowLeft":case"ArrowRight":if(n!==t)return;if(e.preventDefault(),t.$.addClass("no-transition"),e.ctrlKey)return t._resize("right",i),void a();t._drag(i,"horizontal"),t.$.removeClass("no-transition");break;case"Escape":t.disableEscape||t.headerButtons.indexOf("close")>-1&&t.close();break;case"Tab":t.opened&&t.modal&&(t._changingFocus=!0);break;case"Enter":case" ":{let a;if(t.shadowRoot||t.isInShadowDOM?(a=e.composedPath()[0],t._buttonPressed=a.getRootNode().host):(a=e.target.closest&&e.target.closest(".smart-button"),t._buttonPressed=a),!a)return;t._isWindowButton(a),delete t._buttonPressed;break}}a()}}),Smart("smart-multiline-prompt-window",class extends Smart.PromptWindow{static get properties(){return{autoCapitalize:{value:"none",allowedValues:["none","words","characters"],type:"string"},autoExpand:{value:!1,type:"boolean"},headerButtons:{value:["close"],type:"array"},horizontalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},modal:{value:!0,readOnly:!0,type:"boolean",defaultReflectToAttribute:!0},selectionDirection:{value:"none",allowedValues:["forward","backward","none"],type:"string"},selectionEnd:{value:0,reflectToAttribute:!1,type:"number"},selectionStart:{value:0,reflectToAttribute:!1,type:"number"},spellCheck:{value:!1,type:"boolean"},verticalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},wrap:{value:"soft",allowedValues:["hard","soft","off"],type:"string"}}}template(){return'<div role="presentation">\n                    <div class="smart-content-container" id="container">\n                        <div id="headerSection" class="smart-header-section" role="heading" aria-level="1">\n                            <div id="header" class="smart-header">[[label]]</div>\n                            <div id="buttonsContainer" class="smart-buttons-container">\n                                <button id="closeButton" class="smart-button smart-element smart-close-button" aria-label="Close"></button>\n                            </div>\n                        </div>\n                        <div class="smart-content">\n                            <content></content>\n                           <smart-multiline-text-box id="textBox"\n                                animation="[[animation]]"\n                                horizontal-scroll-bar-visibility= "[[horizontalScrollBarVisibility]]"\n                                vertical-scroll-bar-visibility= "[[verticalScrollBarVisibility]]"\n                                auto-capitalize="[[autoCapitalize]]"\n                                auto-expand = "[[autoExpand]]"\n                                selection-direction= "[[selectionDirection]]"\n                                selection-end= "[[selectionEnd]]"\n                                selection-start="[[selectionStart]]"\n                                spell-check= "[[spellCheck]]"\n                                wrap="[[wrap]]"\n                                max-length="[[maxLength]]"\n                                value="{{value}}"\n                                form="[[form]]"\n                                label="[[promptLabel]]"\n                                hint="[[hint]]"\n                                display-mode="[[displayMode]]"\n                                max-length="[[maxLength]]"\n                                placeholder="[[placeholder]]"\n                                required="[[required]]"\n                                required-message="[[requiredMessage]]"\n                                select-all-on-focus="[[selectAllOnFocus]]"\n                                theme="[[theme]]"\n                                right-to-left="[[rightToLeft]]">\n                           </smart-multiline-text-box>\n                        </div>\n                        <div id="footer" class="smart-footer">\n                            <button id="confirmButton" class="smart-button smart-element smart-confirm-button flat">[[confirmLabel]]</button>\n                            <button id="cancelButton" class="smart-button smart-element smart-cancel-button flat">[[cancelLabel]]</button>\n                        </div>\n                    </div>\n                </div>'}static get listeners(){return{"footer.click":"_footerClickHandler"}}static get requires(){return{"Smart.MultilineTextBox":"smart.multilinetextbox.js"}}_footerClickHandler(e){const t=this,a=e.target;a.closest(".smart-confirm-button")?t.$.fireEvent("confirm",{value:t.$.textBox.value}):a.closest(".smart-cancel-button")&&t.$.fireEvent("cancel",{value:t.$.textBox.value})}}),Smart("smart-progress-window",class extends Smart.Window{static get properties(){return{completeLabel:{value:"Continue",type:"string"},disableSnap:{value:!0,readOnly:!0,type:"boolean"},headerButtons:{value:["close"],type:"array"},indeterminate:{value:!1,type:"boolean"},inverted:{value:!1,type:"boolean"},formatFunction:{value:null,type:"function"},max:{value:100,type:"number"},modal:{value:!0,readOnly:!0,type:"boolean",defaultReflectToAttribute:!0},min:{value:0,type:"number"},showProgressValue:{value:!1,type:"boolean"},value:{value:0,type:"number?"}}}template(){return'<div role="presentation">\n                    <div class="smart-content-container" id="container">\n                        <div id="headerSection" class="smart-header-section" role="heading" aria-level="1">\n                            <div id="header" class="smart-header">[[label]]</div>\n                            <div id="buttonsContainer" class="smart-buttons-container">\n                                <button id="closeButton" class="smart-button smart-element smart-close-button" aria-label="Close"></button>\n                            </div>\n                        </div>\n                        <div class="smart-content" inner-h-t-m-l="[[innerHTML]]">\n                            <content></content>\n                        </div>\n                        <div id="footer" class="smart-footer">\n                            <smart-progress-bar id="progressBar"\n                                animation="[[animation]]"\n                                min="[[min]]"\n                                max="[[max]]"\n                                indeterminate="[[inditerminate]]"\n                                inverted="[[inverted]]"\n                                format-function="[[formatFunction]]"\n                                show-progress-value="[[showProgressValue]]"\n                                theme="[[theme]]"\n                                right-to-left="[[rightToLeft]]"\n                                value="{{value}}">\n                            </smart-progress-bar>\n                            <button id="completeButton" class="smart-button smart-element smart-complete-button smart-visibility-hidden">[[completeLabel]]</button>\n                        </div>\n                    </div>\n                </div>'}static get requires(){return{"Smart.ProgressBar":"smart.progressbar.js"}}propertyChangedHandler(e,t,a){const i=this;switch(e){case"value":i._handleCompletion();break;default:super.propertyChangedHandler(e,t,a)}}_createElement(){this.setAttribute("role","dialog"),this._handleCompletion()}_handleCompletion(){const e=this;e.$.completeButton&&(e.value>=e.max?(e.$completeButton.removeClass("smart-visibility-hidden"),e.$progressBar.addClass("smart-visibility-hidden")):(e.$completeButton.addClass("smart-visibility-hidden"),e.$progressBar.removeClass("smart-visibility-hidden")))}_keyDownHandler(e){const t=this;function a(){t._dragDetails&&(t._dragDetails.started=!1),t.$.removeClass("no-transition")}if(delete t._changingFocus,t.disabled||t._dragDetails&&t._dragDetails.started)return;if(t.disableKeyboard)return;e.stopPropagation();const i="ArrowDown"===e.key||"ArrowRight"===e.key?10:-10,n=t.enableShadowDOM&&t._windowParent.element.getRootNode()?t._windowParent.element.getRootNode().activeElement:document.activeElement;switch(t.$.removeClass("no-transition"),e.key){case"ArrowUp":case"ArrowDown":if(n!==t)return;if(e.preventDefault(),e.altKey)return"ArrowUp"===e.key?t.maximize():t.restore(),void a();if(t.$.addClass("no-transition"),e.ctrlKey)return t._resize("bottom",i),void a();t._drag(i,"vertical"),t.$.removeClass("no-transition");break;case"ArrowLeft":case"ArrowRight":if(n!==t)return;if(e.preventDefault(),t.$.addClass("no-transition"),e.ctrlKey)return t._resize("right",i),void a();t._drag(i,"horizontal"),t.$.removeClass("no-transition");break;case"Escape":t.disableEscape||t.headerButtons.indexOf("close")>-1&&t.close();break;case"Tab":t.opened&&t.modal&&(t._changingFocus=!0);break;case"Enter":case" ":{let a;if(t.shadowRoot||t.isInShadowDOM?(a=e.composedPath()[0],t._buttonPressed=a.getRootNode().host):(a=e.target.closest&&e.target.closest(".smart-button"),t._buttonPressed=a),!a)return;t._isWindowButton(a),delete t._buttonPressed;break}}a()}}),Smart("smart-tabs-window",class extends Smart.Window{static get properties(){return{disableSnap:{value:!0,readOnly:!0,type:"boolean"},dropPosition:{value:["all"],type:"array"},addNewTab:{value:!1,type:"boolean"},allowToggle:{value:!1,type:"boolean"},autoHide:{value:!1,type:"boolean"},autoHideWindow:{value:null,type:"any"},dataSource:{value:null,type:"array?",reflectToAttribute:!1},tabCloseButtonMode:{value:"default",allowedValues:["default","selected"],type:"string"},tabCloseButtons:{value:!1,type:"boolean"},draggable:{value:!0,type:"boolean",reflectToAttribute:!1},messages:{value:{en:{ambiguousIndexes:"smart-tabs: Initially set smart-tab-item indexes are ambiguous and are ignored in favour of the HTML structure.",detailsObjectRequired:'smart-tabs: The method "insert" requires a details Object to be passed as a second argument.',invalidIndex:'smart-tabs: "{{method}}" method accepts an index of type number.',referenceNodeNotChild:"smart-tabs: Passed {{argument}} is not part of this smart-tabs element.",tabItemRequired:'smart-tabs: The method "{{method}}" requires a "smart-tab-item" element to be passed as an argument.'}},type:"object",extend:!0},tabOverflow:{value:"auto",allowedValues:["auto","hidden","scroll"],type:"string"},tabReorder:{value:!1,type:"boolean"},tabResize:{value:!1,type:"boolean"},tabScrollButtonsPosition:{value:"both",allowedValues:["near","far","both"],type:"string"},selectedIndex:{value:null,type:"number?"},selectionMode:{value:"click",allowedValues:["click","dblclick","mouseenter","none"],type:"string"},collapsed:{value:!1,type:"boolean"},collapsible:{value:!1,type:"boolean"},locked:{value:!1,type:"boolean"},max:{value:"",type:"any"},min:{value:"",type:"any"},size:{value:"",type:"any"},tabLayout:{value:"scroll",allowedValues:["scroll","dropdown","wrap","shrink"],type:"string",defaultReflectToAttribute:!0},tabPosition:{value:"top",allowedValues:["top","bottom","left","right","hidden"],type:"string"},tabTextOrientation:{value:"horizontal",allowedValues:["horizontal","vertical"],type:"string"},layout:{value:null,type:"any"}}}static get listeners(){return{"tabsElement.blur":"_tabsFocusHandler","tabsElement.change":"_tabsChangeHandler","tabsElement.focus":"_tabsFocusHandler","autoHideWindow.close":"_autoHideWindowCloseHandler","autoHideWindow.open":"_autoHideWindowOpenHandler"}}template(){return'<div role="presentation">\n                    <div class="smart-content-container" id="container">\n                        <div id="headerSection" class="smart-header-section" role="heading" aria-level="1">\n                            <div id="header" class="smart-header">[[label]]</div>\n                            <div id="buttonsContainer" class="smart-buttons-container">\n                                <button id="minimizeButton" class="smart-button smart-element smart-minimize-button" aria-label="Minimize"></button>\n                                <button id="maximizeButton" class="smart-button smart-element smart-maximize-button" aria-label="Maximize"></button>\n                                <button id="closeButton" class="smart-button smart-element smart-close-button" aria-label="Close"></button>\n                            </div>\n                        </div>\n                        <div id="contentSection" class="smart-content">\n                           <smart-tabs id="tabsElement"\n                                animation="[[animation]]"\n                                add-new-tab="[[addNewTab]]"\n                                allow-toggle="[[allowToggle]]"\n                                close-button-mode="[[tabCloseButtonMode]]"\n                                close-buttons="[[tabCloseButtons]]"\n                                disabled="[[disabled]]"\n                                overflow="[[tabOverflow]]"\n                                reorder="[[tabReorder]]"\n                                resize="[[tabResize]]"\n                                scroll-buttons-position="[[tabScrollButtonsPosition]]"\n                                selected-index="{{selectedIndex}}"\n                                selection-mode="[[selectionMode]]"\n                                tab-layout="[[tabLayout]]"\n                                tab-position="[[tabPosition]]"\n                                tab-text-orientation="[[tabTextOrientation]]"\n                                theme="[[theme]]"\n                                right-to-left="[[rightToLeft]]">\n                                <content></content>\n                            </smart-tabs>\n                        </div>\n                        <div id="footer" class="smart-footer smart-hidden"></div>\n                    </div>\n                </div>'}static get requires(){return{"Smart.Tabs":"smart.tabs.js"}}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?(e instanceof Smart.TabItem||t.error(t.localize("tabItemRequired",{method:"removeChild"})),t.$.tabsElement.appendChild(e)):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"appendChild",node:"node"}))}insert(e,t){this.$.tabsElement.insert(e,t);const a=this.$.tabsElement._tabs[e];a&&(a.draggable=void 0===t.draggable||t.draggable,a.floatable=void 0===t.floatable||t.floatable)}insertBefore(e,t){this.$.tabsElement.insertBefore(e,t)}removeAt(e){this.$.tabsElement.removeAt(e)}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.TabItem||t.error(t.localize("tabItemRequired",{method:"removeChild"})),(t.shadowRoot||t).contains(e)||t.error(t.localize("referenceNodeNotChild",{argument:"node"})),t.$.tabsElement.removeChild(e)):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"removeChild",node:"node"}))}refreshTabHeader(){const e=this;e.$.tabsElement&&e.$.tabsElement.isCompleted&&e.$.tabsElement.refreshTabHeader()}refreshTabs(){const e=this;e.$.tabsElement&&e.$.tabsElement.isCompleted&&e.$.tabsElement._applyTabOverflow()}select(e){this.$.tabsElement.select(e)}update(e,t,a){this.$.tabsElement.update(e,t,a)}get items(){return this.isCompleted&&this.$.tabsElement?this.$.tabsElement._tabs:null}get itemLabels(){return this.$?this.$.tabsElement._tabLabelContainers:null}get siblings(){const e=this;let t=[];if(!e.isCompleted)return t;const a=e.closest("smart-splitter");if(!a||!a.closest("smart-docking-layout"))return t;const i=a._items;if(!i||!i.length)return t;for(let n=0;n<i.length;n++){const o=i[n];o!==e.closest("smart-splitter-item")&&o.querySelector("smart-tabs-window").closest("smart-splitter")===a&&t.push(o.querySelector("smart-tabs-window"))}return t}propertyChangedHandler(e,t,a){const i=this;switch("collapsed"!==e&&super.propertyChangedHandler(e,t,a),e){case"theme":""!==t&&(i.$.closeButton.classList.remove(t),i.$.collapseButton.classList.remove(t),i.$.maximizeButton.classList.remove(t),i.$.pinButton.classList.remove(t)),i._applyTheme(a);break;case"autoHideWindow":i._handleAutoHideWindow();break;case"autoHide":a||(null!==i.$.tabsElement.selectedIndex&&(i.$.tabsElement._tabs[i.$.tabsElement.selectedIndex]._autoHideWindowSize=void 0),i._autoHideWindow&&i._autoHideWindow.close());break;case"dataSource":i.$.tabsElement.dataSource=a;break;case"layout":i._handleLayoutProperty();break;case"collapsible":case"collapsed":case"locked":case"max":case"min":case"size":{const n=i.getRootNode(),o=(n&&n.host?n.host:i).closest("smart-docking-layout"),s=i.closest("smart-splitter-item");if(!o)return void("collapsed"===e&&super.propertyChangedHandler(e,t,a));s&&(s[e]=a);break}}}_applyTheme(e){if(""!==e){const t=this.$.buttonsContainer.children;for(let a=0;a<t.length;a++)t[a].classList.add(e)}}_autoHideWindowCloseHandler(){const e=this;e.allowToggle&&null!==e.$.tabsElement.selectedIndex&&e.$.tabsElement.select(e.$.tabsElement.selectedIndex),e._autoHideWindow&&e._moveContent(e._autoHideWindow.items[0],e._autoHideWindow._tab)}_autoHideWindowOpenHandler(){const e=this;e.$.tabsElement.selectedIndex&&e._handleAutoHide(e.$.tabsElement.selectedIndex)}_createElement(){const e=this;e.setAttribute("role","dialog"),e.$.tabsElement.$.tabHeaderControls&&!e.$.tabsElement.$.tabHeaderControls.innerHTML&&e.$.tabsElement.$tabHeaderControls.addClass("smart-hidden"),e.$.tabsElement.dataSource=e.dataSource,e._applyTheme(e.theme),e._handleAutoHideWindow(),e.autoHide&&e._handleAutoHide(e.$.tabsElement.selectedIndex),e.allowToggle||e.selectedIndex||null===e.$.tabsElement.selectedIndex||(e.selectedIndex=e.$.tabsElement.selectedIndex,e.$.tabsElement.setAttribute("selected-index",e.selectedIndex)),e._handleLayoutProperty();const t=(e.isInShadowDOM?e.getRootNode().host:e||e).closest("smart-docking-layout"),a=e.closest("smart-splitter-item");t&&a&&(a.collapsible=e.collapsible,a.collapsed=e.collapsed,a.min=e.min,a.max=e.max,a.size=e.size,a.locked=e.locked)}attached(){super.attached();const e=this;e.classList.add("smart-window"),e.shadowRoot&&e.$.root.classList.add("smart-window")}_handleLayoutProperty(){const e=this;let t=e.closest("smart-docking-layout");if(Smart.DockingLayout){if(!e.ownerLayout&&e.getRootNode()){let a=e.getRootNode().host;for(;a;){if(!a.closest)return;if(a.closest("smart-docking-layout")){t=a.closest("smart-docking-layout");break}a=a.getRootNode()?a.getRootNode().host:void 0}}t?e.layout=t:e.layout instanceof Smart.DockingLayout||"string"==typeof e.layout&&(e.layout=document.getElementById(e.layout))}}_headerDblCickHandler(e){const t=this,a=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;e.ctrlKey||a!==t.$.headerSection&&a!==t.$.header||t.$.maximizeButton&&0===t.$.maximizeButton.offsetHeight||(t.maximized?t.restore():t.maximize())}_documentUpHandler(e){const t=this;let a=e.originalEvent.target.closest?e.originalEvent.target.closest(".smart-window"):e.originalEvent.target,i=a===t||a===t._autoHideWindow||t._isAutoHideWindowClicked,n=t.closest("smart-docking-layout");(t.shadowRoot||t.isInShadowDOM)&&(a=e.originalEvent.composedPath()[0],i=a.getRootNode()===t.shadowRoot||a.closest(".smart-window")===t||a.closest(".smart-window")===t._autoHideWindow||t._isAutoHideWindowClicked),n=((t.isInShadowDOM?t.getRootNode().host:t)||t).closest("smart-docking-layout"),n&&n.disabled?delete t._isWindowContentClicked:(super._documentUpHandler(e),delete t._isAutoHideWindowClicked,t.autoHide&&t._autoHideWindow&&(i&&t._autoHideWindow.opened||(t.selectedIndex=null,t._autoHideWindow.parentElement&&t._autoHideWindow.parentElement.closest(".smart-window")===t&&t._autoHideWindow.close())))}_handleAutoHide(e){const t=this;if(!t.autoHide||null===e)return;if(t._autoHideWindow||t._handleAutoHideWindow(!0),!t._autoHideWindow)return;t._autoHideWindow._tabsWindow&&t._autoHideWindow._tabsWindow!==t&&(t._autoHideWindow._tabsWindow.selectedIndex=null);const a=t.$.tabsElement._tabs[e];t._autoHideWindow._tab!==a&&t._moveContent(t._autoHideWindow.items[0],t._autoHideWindow._tab),t._autoHideWindow.label=a.label,t._autoHideWindow.draggable=a.draggable,t._autoHideWindow.floatable=a.floatable,t._autoHideWindow._tab=a,t._autoHideWindow.headerButtons=t.headerButtons,t._moveContent(t._autoHideWindow._tab,t._autoHideWindow.items[0]),t._autoHideWindow.bringToFront(),t._setAutoHideWindowSize(e),t._autoHideWindow.open(),t._autoHideWindow._tabsWindow=t,t._autoHideWindow.controlledBy&&t._autoHideWindow.controlledBy.removeAttribute("aria-controls"),t._autoHideWindow.controlledBy=t.$.tabsElement._tabLabelContainers[e],t._autoHideWindow.controlledBy.setAttribute("aria-controls",t._autoHideWindow.id)}_moveHandler(e){const t=this,a=t.closest("smart-docking-layout");a&&a.items.indexOf(t)>-1||(Smart.Utilities.Core.isMobile&&navigator.platform&&/iPad|iPhone|iPod/.test(navigator.platform)&&t.layout instanceof Smart.DockingLayout&&t.layout.hasAttribute("dragged")&&e.originalEvent.preventDefault(),super._moveHandler(e))}_setAutoHideWindowSize(e){const t=this;if(!t._autoHideWindow)return;t._autoHideWindow.$.addClass("no-transition"),t._autoHideWindow.style.maxWidth=t._autoHideWindow.style.maxHeight="";const a=t.$.tabsElement._tabs[e],i=(t._autoHideWindow.isInShadowDOM?t._autoHideWindow.getRootNode().host:t._autoHideWindow).closest("smart-docking-layout")||t._autoHideWindow.parentElement;let n,o;if(a){if("top"===t.tabPosition||"bottom"===t.tabPosition){t._autoHideWindow.resizeMode="top"===t.tabPosition?"bottom":"top",t._autoHideWindow.style.width=t.$.tabsElement.offsetWidth+"px",n=i.getBoundingClientRect(),o=t.$.tabsElement.getBoundingClientRect();let e=a._autoHideWindowSize&&parseFloat(a._autoHideWindowSize)||"";Smart.DockingLayout&&i instanceof Smart.DockingLayout&&(e&&(e=Math.min(i.$.itemsContainer.offsetHeight,e)+"px"),t._autoHideWindow.style.maxHeight=i.$.itemsContainer.offsetHeight+"px"),t._autoHideWindow.style.height=e,t._autoHideWindow.style.left=o.left-n.left+"px",t._autoHideWindow&&("top"===t.tabPosition?t._autoHideWindow.style.top=o.top+-n.top+o.height+"px":t._autoHideWindow.style.top=o.top-n.top-t._autoHideWindow.offsetHeight+"px")}else{t._autoHideWindow.resizeMode="left"===t.tabPosition?"right":"left",t._autoHideWindow.style.height=t.$.tabsElement.offsetHeight+"px";let e=a._autoHideWindowSize&&parseFloat(a._autoHideWindowSize)||"";i instanceof Smart.DockingLayout&&(e&&(e=Math.min(i.$.itemsContainer.offsetWidth,e)+"px"),t._autoHideWindow.style.maxWidth=i.$.itemsContainer.offsetWidth+"px"),t._autoHideWindow.style.width=e,n=i.getBoundingClientRect(),o=t.$.tabsElement.getBoundingClientRect(),t._autoHideWindow.style.top=o.top-n.top+"px","left"===t.tabPosition?t._autoHideWindow.style.left=o.left-n.left+t.$.tabsElement.offsetWidth+"px":t._autoHideWindow.style.left=o.left-n.left-t._autoHideWindow.offsetWidth+"px"}t._autoHideWindow._dragDetails&&(t._autoHideWindow._dragDetails.maxWidth=void 0),t._autoHideWindow._setDragDetails("resize"),t._autoHideWindow._dragDetails.started=!1,t._autoHideWindow.$.removeClass("no-transition")}}_handleAutoHideWindow(e){const t=this;if(t.autoHideWindow){if(t._autoHideWindow&&t._autoHideWindow.parentElement.removeChild(t._autoHideWindow),"string"==typeof t.autoHideWindow)return void(t._autoHideWindow=document.getElementById(t.autoHideWindow));if(t.autoHideWindow instanceof Smart.Window)return void(t._autoHideWindow=t.autoHideWindow)}if(!e||t._autoHideWindow||2===t.$.contentSection.children.length&&t.$.contentSection.children[1]instanceof Smart.Window)return;const a=document.createElement("smart-window");a.$=Smart.Utilities.Extend(a),a.disableSnap=a.pinned=!0,a.headerButtons=["close"],t.$.contentSection.appendChild(a),t._autoHideWindow=a}_moveContent(e,t){if(!e||!t)return;const a=[].slice.call(e.$.content.childNodes);for(let e=0;e<a.length;e++)t.appendChild(a[e])}_tabsChangeHandler(e){const t=this;if(e.target===t.$.tabsElement&&t.autoHide){if(t._autoHideWindow||t._handleAutoHideWindow(!0),null!==e.detail.oldIndex&&t._autoHideWindow.opened&&(t.$.tabsElement._tabs[e.detail.oldIndex]._autoHideWindowSize=t._autoHideWindow.style["right"===t.$.tabsElement.tabPosition||"left"===t.$.tabsElement.tabPosition?"width":"height"]),!t.autoHide||null===e.detail.index||void 0===e.detail.index)return t._autoHideWindow.setAttribute("active",""),void t._autoHideWindow.close();t._handleAutoHide(e.detail.index)}}_tabsFocusHandler(e){const t=this;"focus"===e.type?(t.bringToFront(),t.setAttribute("focus","")):t.removeAttribute("focus")}}),Smart("smart-wait-window",class extends Smart.ProgressWindow{static get properties(){return{headerButtons:{value:[],type:"array"},disableSnap:{value:!0,readOnly:!0,type:"boolean"},modal:{value:!0,readOnly:!0,type:"boolean",defaultReflectToAttribute:!0},pinned:{value:!0,type:"boolean",readOnly:!0}}}template(){return'<div role="presentation">\n                    <div class="smart-content-container" id="container">\n                        <div id="headerSection" class="smart-header-section" role="heading" aria-level="1">\n                            <div id="header" class="smart-header">[[label]]</div>\n                            <div id="buttonsContainer" class="smart-buttons-container">\n                                <button id="closeButton" class="smart-button smart-element smart-close-button" aria-label="Close"></button>\n                            </div>\n                        </div>\n                        <div class="smart-content">\n                            <content></content>\n                            <smart-progress-bar id="progressBar" animation="[[animation]]" indeterminate theme="[[theme]]" right-to-left="[[rightToLeft]]"></smart-progress-bar>\n                        </div>\n                        <div id="footer" class="smart-footer"></div>\n                    </div>\n                </div>'}_keyDownHandler(e){const t=this;function a(){t._dragDetails&&(t._dragDetails.started=!1),t.$.removeClass("no-transition")}if(delete t._changingFocus,t.disabled||t._dragDetails&&t._dragDetails.started)return;const i=t.shadowRoot||t._windowParent.element.getRootNode()?t._windowParent.element.getRootNode().activeElement:document.activeElement;e.stopPropagation();const n="ArrowDown"===e.key||"ArrowRight"===e.key?10:-10;switch(t.$.removeClass("no-transition"),e.key){case"ArrowUp":case"ArrowDown":if(i!==t)return;if(e.preventDefault(),e.altKey)return"ArrowUp"===e.key?t.maximize():t.restore(),void a();if(t.$.addClass("no-transition"),e.ctrlKey)return t._resize("bottom",n),void a();t._drag(n,"vertical");break;case"ArrowLeft":case"ArrowRight":if(i!==t)return;if(e.preventDefault(),t.$.addClass("no-transition"),e.ctrlKey)return t._resize("right",n),void a();t._drag(n,"horizontal");break;case"Tab":t.opened&&t.modal&&(t._changingFocus=!0);break;case"Enter":case" ":{let a;if(t.shadowRoot||t.isInShadowDOM?(a=e.composedPath()[0],t._buttonPressed=a.getRootNode().host):(a=e.target.closest&&e.target.closest(".smart-button"),t._buttonPressed=a),!a)return;t._isWindowButton(a),delete t._buttonPressed;break}}a()}});

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	(() => {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = (module) => {
/******/ 			var getter = module && module.__esModule ?
/******/ 				() => (module['default']) :
/******/ 				() => (module);
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	(() => {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = (exports, definition) => {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	})();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	(() => {
/******/ 		__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ 	})();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// This entry need to be wrapped in an IIFE because it need to be in strict mode.
(() => {
"use strict";
/* unused harmony export smartKanban */
/* harmony import */ var _smart_element_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6321);
/* harmony import */ var _smart_element_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_smart_element_js__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _smart_button_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2612);
/* harmony import */ var _smart_button_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_smart_button_js__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _smart_calendar_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(5810);
/* harmony import */ var _smart_calendar_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_smart_calendar_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _smart_complex_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4232);
/* harmony import */ var _smart_complex_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_smart_complex_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _smart_data_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6057);
/* harmony import */ var _smart_data_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_smart_data_js__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _smart_date_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2052);
/* harmony import */ var _smart_date_js__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_smart_date_js__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _smart_datetimepicker_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7054);
/* harmony import */ var _smart_datetimepicker_js__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_smart_datetimepicker_js__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _smart_draw_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9613);
/* harmony import */ var _smart_draw_js__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_smart_draw_js__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _smart_dropdownlist_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7650);
/* harmony import */ var _smart_dropdownlist_js__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_smart_dropdownlist_js__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _smart_combobox_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1139);
/* harmony import */ var _smart_combobox_js__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_smart_combobox_js__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _smart_export_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(6802);
/* harmony import */ var _smart_export_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_smart_export_js__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _smart_filter_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(6170);
/* harmony import */ var _smart_filter_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_smart_filter_js__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _smart_input_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(8588);
/* harmony import */ var _smart_input_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_smart_input_js__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var _smart_colorinput_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(4896);
/* harmony import */ var _smart_colorinput_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_smart_colorinput_js__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var _smart_multiinput_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(9264);
/* harmony import */ var _smart_multiinput_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_smart_multiinput_js__WEBPACK_IMPORTED_MODULE_14__);
/* harmony import */ var _smart_checkinput_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(2864);
/* harmony import */ var _smart_checkinput_js__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(_smart_checkinput_js__WEBPACK_IMPORTED_MODULE_15__);
/* harmony import */ var _smart_multicomboinput_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(9633);
/* harmony import */ var _smart_multicomboinput_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_smart_multicomboinput_js__WEBPACK_IMPORTED_MODULE_16__);
/* harmony import */ var _smart_listbox_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(5707);
/* harmony import */ var _smart_listbox_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_smart_listbox_js__WEBPACK_IMPORTED_MODULE_17__);
/* harmony import */ var _smart_math_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(8687);
/* harmony import */ var _smart_math_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_smart_math_js__WEBPACK_IMPORTED_MODULE_18__);
/* harmony import */ var _smart_numeric_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(2754);
/* harmony import */ var _smart_numeric_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_smart_numeric_js__WEBPACK_IMPORTED_MODULE_19__);
/* harmony import */ var _smart_numerictextbox_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(7997);
/* harmony import */ var _smart_numerictextbox_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_smart_numerictextbox_js__WEBPACK_IMPORTED_MODULE_20__);
/* harmony import */ var _smart_scrollbar_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(9135);
/* harmony import */ var _smart_scrollbar_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_smart_scrollbar_js__WEBPACK_IMPORTED_MODULE_21__);
/* harmony import */ var _smart_sortable_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(6297);
/* harmony import */ var _smart_sortable_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_smart_sortable_js__WEBPACK_IMPORTED_MODULE_22__);
/* harmony import */ var _smart_timepicker_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(1419);
/* harmony import */ var _smart_timepicker_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_smart_timepicker_js__WEBPACK_IMPORTED_MODULE_23__);
/* harmony import */ var _smart_tooltip_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(6693);
/* harmony import */ var _smart_tooltip_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_smart_tooltip_js__WEBPACK_IMPORTED_MODULE_24__);
/* harmony import */ var _smart_window_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(8466);
/* harmony import */ var _smart_window_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_smart_window_js__WEBPACK_IMPORTED_MODULE_25__);
/* harmony import */ var _smart_gridpanel_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(3176);
/* harmony import */ var _smart_gridpanel_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(_smart_gridpanel_js__WEBPACK_IMPORTED_MODULE_26__);
/* harmony import */ var _smart_kanban_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(7498);
/* harmony import */ var _smart_kanban_js__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(_smart_kanban_js__WEBPACK_IMPORTED_MODULE_27__);

/* Smart UI v22.0.10 (2025-02-10) 
Copyright (c) 2011-2025 jQWidgets. 
License: https://htmlelements.com/license/ */ //






























class smartKanban extends Smart.Component {
    get name() {
        return 'smartKanban';
    }
}

})();

/******/ })()
;
})();