-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsmart.dropdownlist.js
137 lines (108 loc) · 249 KB
/
smart.dropdownlist.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* Smart UI v15.0.0 (2023-Jan)
Copyright (c) 2011-2023 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;const r="smart-window".toLowerCase();if(n&&n.nodeName.toLowerCase()===r&&"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((()=>{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)}});
/***/ }),
/***/ 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",mouseenter:"_mouseEnterHandler",mouseleave:"_mouseLeaveHandler",resize:"_resizeHandler","resizeBar.move":"_resizeBarMoveHandler",styleChanged:"_styleChangedHandler",wheel:"_mouseWheelHandler"}}template(){return'<div id="container" role="presentation">\n <span class="smart-label" id="label">[[label]]</span>\n <div id="content" class="smart-content" role="presentation">\n <div class="smart-buttons-container" id="buttonsContainer" role="presentation">\n <span id="actionButton" class ="smart-action-button" role="presentation">[[placeholder]]</span>\n <span id="dropDownButton" class="smart-drop-down-button">\n <span class ="smart-drop-down-button-icon" id="arrow" aria-hidden="true"></span>\n </span>\n </div>\n <div id="dropDownContainer" class="smart-drop-down smart-drop-down-container smart-visibility-hidden" role="presentation">\n <smart-list-box id="listBox" unfocusable\n animation="[[animation]]"\n data-source="[[dataSource]]"\n disabled="[[disabled]]"\n display-loading-indicator="[[displayLoadingIndicator]]"\n display-member="[[displayMember]]"\n filterable="[[filterable]]"\n filter-callback="[[filterCallback]]"\n filter-mode="[[filterMode]]"\n filter-input-placeholder="[[filterInputPlaceholder]]"\n grouped="[[grouped]]"\n group-member="[[groupMember]]"\n item-height="[[itemHeight]]"\n item-measure-mode="[[itemMeasureMode]]"\n item-template="[[itemTemplate]]"\n incremental-search-delay="[[incrementalSearchDelay]]"\n incremental-search-mode="[[incrementalSearchMode]]"\n loading-indicator-placeholder="[[loadingIndicatorPlaceholder]]"\n loading-indicator-position="[[loadingIndicatorPosition]]"\n name="[[name]]"\n placeholder="[[dropDownPlaceholder]]"\n right-to-left="[[rightToLeft]]"\n readonly="[[readonly]]"\n selected-indexes="{{selectedIndexes}}"\n selection-mode="[[selectionMode]]"\n selected-values="{{selectedValues}}"\n sorted="[[sorted]]"\n sort-direction="[[sortDirection]]"\n theme="[[theme]]"\n value-member="[[valueMember]]"\n horizontal-scroll-bar-visibility="[[horizontalScrollBarVisibility]]"\n vertical-scroll-bar-visibility="[[verticalScrollBarVisibility]]"\n virtualized="[[virtualized]]">\n <content></content>\n </smart-list-box>\n <div id="resizeBar" class="smart-drop-down-resize-bar" aria-label="Resize">\n <div></div>\n </div>\n </div>\n </div>\n <span class="smart-hint smart-hidden" id="hint">[[hint]]</span>\n </div>'}static get styleUrls(){return["smart.dropdownlist.css","smart.dropdown.css"]}propertyChangedHandler(e,t,o){super.propertyChangedHandler(e,t,o);const n=this;switch(e){case"animation":n.$.dropDownContainer.setAttribute("animation",n.animation);break;case"disabled":n._setFocusable(),n.close(),n._positionDetection.handleAutoPositioning();break;case"dataSource":case"displayMember":case"inputMember":n.$.actionButton&&(n.$.actionButton.innerHTML=n.placeholder),n._setDropDownSize(),n._positionDetection.checkBrowserBounds("vertically"),n._positionDetection.positionDropDown(),n._positionDetection.checkBrowserBounds("horizontally");break;case"dropDownAppendTo":n._positionDetection.dropDownAppendToChangedHandler();break;case"dropDownOpenMode":n._setFocusable(),n.$dropDownContainer.addClass("smart-visibility-hidden"),n.$.dropDownContainer.setAttribute("drop-down-open-mode",o),n.$.dropDownButton.removeAttribute("selected"),n.removeAttribute("drop-down-button-focus"),n.removeAttribute("action-button-focus"),n.opened=!1,n._ariaButton&&n._ariaButton.setAttribute("aria-expanded",!1),n._setAriaRelations();break;case"dropDownOverlay":o||n._positionDetection.removeOverlay();break;case"dropDownPosition":n._positionDetection.dropDownPositionChangedHandler();break;case"dropDownMinWidth":case"dropDownWidth":case"dropDownMaxWidth":case"dropDownHeight":case"dropDownMinHeight":case"dropDownMaxHeight":n._setDropDownSize();break;case"filterable":n.$.listBox.filterable=o,n._dropDownSize&&"auto"===n._dropDownSize.height&&n._setDropDownSize();break;case"label":if(!n._ariaButton)return;o?n._ariaButton.setAttribute("aria-labelledby",n.$.label.id):"DropDownList"===n.elementName&&n._ariaButton.setAttribute("aria-labelledby",n.$.actionButton.id);break;case"opened":if(n.disabled||n.readonly)return;o?n.open():n.close();break;case"placeholder":n._applySelection();break;case"readonly":n.close();break;case"resizeIndicator":o?n.$.dropDownContainer.setAttribute("resize-indicator",""):n.$.dropDownContainer.removeAttribute("resize-indicator");break;case"resizeMode":n.$.dropDownContainer.setAttribute("resize-mode",n.resizeMode);break;case"selectedValues":case"selectedIndexes":0===o.length?n.$.actionButton.innerHTML=n.placeholder:n._applySelection();break;case"selectionMode":n.$.listBox&&(n.$.listBox[e]=o,"checkBox"!==o&&"radioButton"!==o&&"checkBox"!==t&&"radioButton"!==t||n._setDropDownSize());break;case"selectionDisplayMode":n._applySelection();break;case"tokenTemplate":n._tokenTemplate=n._validateTemplate(n.tokenTemplate),n._applySelection();break;case"unfocusable":n._setFocusable()}}_updateTargetValue(){const e=this;if(e.dataset.target){const t=document.querySelector(e.dataset.target);if(t){const o=e.dataset.property,n=e.value;o&&void 0!==t[o]&&(t[o]=n)}}}appendChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e?(t.$.listBox.appendChild(e),t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize()):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"appendChild",node:"node"}))}attached(){const e=this;super.attached(),e.isCompleted&&e.$.dropDownContainer&&(e._positionDetection.dropDownAttached("_setDropDownSize"),e._positionDetection.checkBrowserBounds(),e.selectedIndexes&&e._applySelection())}detached(){const e=this;super.detached(),e.$.dropDownContainer&&(e.close(),e._positionDetection&&e._positionDetection.dropDownDetached())}clearItems(){const e=this;e.$.listBox&&(e.$.listBox.clearItems(),e.$.actionButton.innerHTML=e.placeholder)}clearSelection(){const e=this;e.$.listBox&&(e.$.listBox.clearSelection(),e.$.actionButton.innerHTML=e.placeholder)}close(){const e=this;e.$dropDownContainer.hasClass("smart-visibility-hidden")||e.$.fireEvent("closing").defaultPrevented||(e.$dropDownContainer.addClass("smart-visibility-hidden"),e.$.fireEvent("close"),e.$.dropDownButton&&e.$.dropDownButton.removeAttribute("selected"),e.opened=!1,e._ariaButton&&e._ariaButton.setAttribute("aria-expanded",!1),e._preventDropDownClose=!1,e._positionDetection.removeOverlay(!0),e.$.listBox.removeAttribute("focus"),e._edgeMacFF&&!e.hasAnimation&&e.$.dropDownContainer&&(e.$.dropDownContainer.style.top=e.$.dropDownContainer.style.left="",e.$dropDownContainer.addClass("not-in-view")))}cloneNode(){const e=this;if(!e.$.listBox)return;let t=HTMLElement.prototype.cloneNode.apply(e,Array.prototype.slice.call(arguments,0,1));return t.dataSource=e.dataSource,t}ensureVisible(e){this.$.listBox&&this.$.listBox.ensureVisible(e)}getItem(e){if(this.$.listBox)return this.$.listBox.getItem(e)}get items(){const e=this;return e.$&&e.$.listBox?e.$.listBox.items:[]}get _focusedItem(){const e=this;return e.$&&e.$.listBox?e.$.listBox._focusedItem:null}insert(e,t){const o=this;o.$.listBox&&(o.$.listBox.insert(e,t),o._applySelection(),o._dropDownSize&&"auto"===o._dropDownSize.height&&o._setDropDownSize())}insertBefore(e,t){const o=this;if(!o.isCompleted){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.insertBefore.apply(o,e.concat(Array.prototype.slice.call(arguments)))}e&&t?o.$.listBox&&(o.$.listBox.insertBefore(e,t),o._dropDownSize&&"auto"===o._dropDownSize.height&&o._setDropDownSize()):o.error(o.localize("invalidNode",{elementType:o.nodeName.toLowerCase(),method:"insertBefore",node:"newNode/referenceNode"}))}toggle(){const e=this;e.opened?e.close():e.open()}open(){const e=this,t=function(){for(let t=0;t<e.items.length;t++)if(!e.items[t].disabled)return e.items[t]};if(!e.disabled&&e.offsetHeight&&e.$dropDownContainer.hasClass("smart-visibility-hidden")){if(e.$dropDownContainer.hasClass("not-in-view")&&e.$dropDownContainer.removeClass("not-in-view"),e.$.dropDownContainer.style.transition=null,e.dropDownAppendTo){const t=e.getBoundingClientRect();if(e.$.container.contains(e.$.dropDownContainer)){let t=0;const o=setInterval((function(){const n=e.getBoundingClientRect();t++,n.top===e._positionTop&&t<10||(e.open(),clearInterval(o),e._positionTop=n.top)}),100);return}t.top!==e._positionTop&&(e._positionTop=t.top)}e.$.fireEvent("opening").defaultPrevented||(e._shadowDOMStylesDelay&&(e._setDropDownSize(),delete e._shadowDOMStylesDelay),e.opened=!0,e._ariaButton&&e._ariaButton.setAttribute("aria-expanded",!0),e.$.listBox.setAttribute("focus",""),e._positionDetection.placeOverlay(),e._positionDetection.checkBrowserBounds("vertically"),e._positionDetection.positionDropDown(),e._positionDetection.checkBrowserBounds("horizontally"),e.$dropDownContainer.removeClass("smart-visibility-hidden"),e.$.fireEvent("open"),e.$.dropDownButton&&("dropDownButton"===e.dropDownOpenMode?e.$.dropDownButton.setAttribute("selected",""):e.$.dropDownButton.removeAttribute("selected")),(e.$.listBox&&!e._focusedItem||e._focusedItem&&!e._focusedItem._focused)&&(e.selectedIndexes.length>0?e._focus(e.items[e.selectedIndexes[0]]):e._focus(t)),e.$.input&&!Smart.Utilities.Core.isMobile&&e.$.input.focus())}}ready(){super.ready()}render(){const e=this;e.rightToLeft&&(e.dropDownButtonPosition="right"===e.dropDownButtonPosition?"left":"right"),e.classList.add("smart-drop-down-box"),e.$.dropDownContainer&&(e._positionDetection=new Smart.Utilities.PositionDetection(e,e.$.dropDownContainer,e.$.container,"close"),e._positionDetection.getDropDownParent(!0),e._positionDetection.setDropDownPosition(),e._calculateDropDownSize(),e.$.dropDownContainer.setAttribute("resize-mode",e.resizeMode),e.$.dropDownContainer.setAttribute("drop-down-open-mode",e.dropDownOpenMode),e.resizeIndicator&&e.$.dropDownContainer.setAttribute("resize-indicator",""),e._positionDetection.handleAutoPositioning()),e.opened&&e.open(),e._positionTop=e.getBoundingClientRect().top,e._edgeMacFF=Smart.Utilities.Core.Browser.Edge||Smart.Utilities.Core.Browser.Firefox&&-1!==navigator.platform.toLowerCase().indexOf("mac"),e._edgeMacFF&&e.hasAnimation&&e.$.dropDownContainer&&e.$dropDownContainer.addClass("not-in-view"),e.$.label&&!e.$.label.id&&(e.$.label.id=e.id+"Label"),e.$.actionButton&&!e.$.actionButton.id&&(e.$.actionButton.id=e.id+"ActionButton"),e.$.hint&&!e.$.hint.id&&(e.$.hint.id=e.id+"Hint"),e._createElement(),super.render()}removeAt(e){const t=this;t.$.listBox&&(t.$.listBox.removeAt(e),t._applySelection(),t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize())}removeChild(e){const t=this;if(!t.isCompleted||e instanceof HTMLElement&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}e&&e instanceof Smart.ListItem?(t.$.listBox.removeChild(e),t._dropDownSize&&"auto"===t._dropDownSize.height&&t._setDropDownSize()):t.error(t.localize("invalidNode",{elementType:t.nodeName.toLowerCase(),method:"removeChild",node:"node"}))}get value(){const e=this;return e.isRendered&&e.$.listBox?e.$.listBox.value:null}set value(e){const t=this;return t.isRendered&&t.$.listBox?void(t.$.listBox.value=e):null}select(e){this.$.listBox&&this.$.listBox.select(e)}_setFocusable(){const e=this;if(e.disabled||e.unfocusable)return e.removeAttribute("tabindex"),e.$.actionButton.removeAttribute("tabindex"),void e.$.dropDownButton.removeAttribute("tabindex");let t=e.tabIndex>0?e.tabIndex:0;e.tabIndex=t,"dropDownButton"===e.dropDownOpenMode?(e.removeAttribute("tabindex"),e.$.actionButton.setAttribute("tabindex",t),e.$.dropDownButton.setAttribute("tabindex",t)):(e.$.actionButton.removeAttribute("tabindex"),e.$.dropDownButton.removeAttribute("tabindex"))}static get requires(){return{"Smart.ListBox":"smart.listbox.js"}}unselect(e){this.$.listBox&&this.$.listBox.unselect(e)}update(e,t){const o=this;o.$.listBox&&(o.$.listBox.update(e,t),o._applySelection())}_resizeBarMoveHandler(e){"touchmove"===e.originalEvent.type&&e.originalEvent.preventDefault()}_createToken(){const e=this;let t,o=!1;const n=document.createDocumentFragment(),i=e.selectedIndexes[e.selectedIndexes.length-1];"plain"!==e.selectionDisplayMode||"one"!==e.selectionMode&&"zeroAndOne"!==e.selectionMode&&"zeroOrOne"!==e.selectionMode&&"radioButton"!==e.selectionMode?"tokens"===e.selectionDisplayMode?1===e.selectedIndexes.length&&["oneOrManyExtended","oneOrMany","zeroAndOne","one","radioButton"].indexOf(e.selectionMode)>-1?t="":(t="✖",o=!0):t=1===e.selectedIndexes.length?"":",":t="";const r=e.selectedIndexes,a=e.$.listBox._items;for(let s=0;s<r.length;s++){const l=r[s];a[l]&&n.appendChild(e._applyTokenTemplate(a[l][e.inputMember],"tokens"!==e.selectionDisplayMode&&l===i?"":t,o))}return n}_applySelection(){const e=this;if("placeholder"!==e.selectionDisplayMode&&0!==e.selectedIndexes.length){if(e.$.listBox._items&&0!==e.$.listBox._items.length)if("plain"!==e.selectionDisplayMode)e.$.actionButton.innerHTML="",e.$.actionButton.appendChild(e._createToken());else{const t=e.$.listBox.selectedIndexes,o=e.$.listBox._items;let n=[];for(let i=0;i<t.length;i++){const r=t[i];o[r]&&n.push(o[r][e.inputMember])}e.$.actionButton.innerHTML=n.length?`<span class="smart-token">${n.join(", ").trim()}</span>`:""}}else e.$.actionButton.innerHTML=e.placeholder}_applyTokenTemplate(e,t,o){const n=this,i=document.createElement("span"),r=function(){return"<span class='smart-drop-down-list-selection-label' role=\"presentation\">"+e+`</span><span class='smart-drop-down-list-unselect-button' role="button"${o?' aria-label="Unselect"':""}>${t}</span>`};if(i.classList.add("smart-token"),n._tokenTemplate){let e=document.importNode(n._tokenTemplate.content,!0);const t=e.childNodes.length,o=/{{\w+}}/g;let a;for(let n=0;n<t;n++)a=o.exec(e.childNodes[n].innerHTML),a&&(e.childNodes[n].innerHTML=e.childNodes[n].innerHTML.replace(a[0],r())),e.childNodes[n].outerHTML&&(i.innerHTML+=e.childNodes[n].outerHTML)}else"function"==typeof n.tokenTemplate?n.tokenTemplate(i,{label:e,iconSeparator:t}):i.innerHTML=r();return i}_bindingCompleteHandler(){const e=this;e.$.listBox&&requestAnimationFrame((()=>{e._setDropDownSize(),e._positionDetection.checkBrowserBounds()}))}_buttonsDownHandler(e){const t=this;if(!t.disabled){if(t.hasRippleAnimation)if(t.$.buttonsContainer&&"dropDownButton"!==t.dropDownOpenMode){const o=t.$.buttonsContainer;o.firstElementChild.noRipple=!0,Smart.Utilities.Animation.Ripple.animate(o,e.pageX,e.pageY),o.firstElementChild.noRipple=!1}else Smart.Utilities.Animation.Ripple.animate(e.target,e.pageX,e.pageY);t._preventsSelectStart=!0,t.tagName.toLowerCase().indexOf("smart-drop-down-")>-1&&"dropDownButton"===t.dropDownOpenMode&&e.target===t.$.actionButton&&t.$.actionButton.setAttribute("active",""),t.opened&&(t._preventDropDownClose=!0)}}_buttonsMouseEventsHandler(e){const t=this;t.disabled||("mouseenter"===e.type?(t.setAttribute("hover",""),e.target.setAttribute("hover",""),"dropDownButton"===t.dropDownOpenMode&&e.target===t.$.dropDownButton&&t.setAttribute("drop-down-button-hover","")):(t.removeAttribute("hover"),t.removeAttribute("drop-down-button-hover"),e.target.removeAttribute("hover")))}_calculateDropDownSize(){const e=this;e._dropDownSize={};const t=window.getComputedStyle(e.$.dropDownContainer),o=parseFloat(t.getPropertyValue("border-top-width").trim()),n=parseFloat(t.getPropertyValue("border-bottom-width").trim()),i=parseFloat(t.getPropertyValue("margin-top").trim()),r=parseFloat(t.getPropertyValue("margin-bottom").trim()),a=parseFloat(t.getPropertyValue("padding-top").trim()),s=parseFloat(t.getPropertyValue("padding-bottom").trim());Smart.Utilities.Core.CSSVariablesSupport()&&(e._dropDownSize.width=t.getPropertyValue("--smart-drop-down-list-drop-down-width").trim(),e._dropDownSize.height=t.getPropertyValue("--smart-drop-down-list-drop-down-height").trim()),(!e._dropDownSize.width||e._dropDownSize.width.indexOf("initial")>-1)&&(e._dropDownSize.width=e.offsetWidth),e._dropDownSize.height||(e._dropDownSize.height="auto"),e._dropDownSize.minHeight=parseFloat(t.getPropertyValue("min-height").trim()),e._dropDownSize.maxHeight=parseFloat(t.getPropertyValue("max-height").trim()),e._dropDownSize.borderWidth=(isNaN(o)?0:o)+(isNaN(n)?0:n),e._dropDownSize.paddingWidth=(isNaN(a)?0:a)+(isNaN(s)?0:s),e._dropDownSize.marginWidth=(isNaN(i)?0:i)+(isNaN(r)?0:r)}_createElement(){const e=this;e._tokenTemplate=e._validateTemplate(e.tokenTemplate),e._applySelection(),e._setDropDownSize(),e._setFocusable(),e.$.arrow.noRipple=!0,e._shadowDOMStylesDelay=e.shadowRoot,e._setAriaRelations(!0)}_documentDownHandler(e){const t=this;if(t.disabled||t.readonly)return;let o=e.originalEvent.target;if(o===t._overlay&&(t._overlayDown=!0),t.shadowRoot){o=e.originalEvent.composedPath()[0];let n=o.getRootNode().host;for(;n;)n.closest(".smart-drop-down-container")===t.$.dropDownContainer&&(t._isDropDownClicked=!0),n=n.getRootNode().host}else t.isInShadowDOM&&(o=e.originalEvent.composedPath()[0]),t._isDropDownClicked=o.closest(".smart-drop-down-container")===t.$.dropDownContainer;if(t._buttonClicked=o.closest(".smart-action-button")||o.closest(".smart-drop-down-button"),t.$.listBox){let n=o.closest("smart-list-item");t.$.listBox.contains(n)||(n=void 0),t.hasRippleAnimation&&n&&Smart.Utilities.Animation.Ripple.animate(n,e.pageX,e.pageY),(n||o===t.$.listBox.$.filterInput||o.closest(".smart-token"))&&(t._preventDropDownClose=!0)}if(t._isDropDownClicked&&(t._preventDropDownClose=!0),o!==t.$.resizeBar||"none"===t.resizeMode)return;t._resizeDetails||(t._resizeDetails={});const n=t.$.dropDownContainer.getBoundingClientRect();t._resizeDetails.started=!0,t._resizeDetails.x=e.pageX,t._resizeDetails.y=e.pageY,t._resizeDetails.width=t.$.dropDownContainer.offsetWidth,t._resizeDetails.height=t.$.dropDownContainer.offsetHeight,t._resizeDetails.offsetXL=e.clientX-n.left,t._resizeDetails.offsetXR=n.left+t.$.dropDownContainer.offsetWidth-e.clientX,t._resizeDetails.offsetY=n.top+t.$.dropDownContainer.offsetHeight-e.clientY,t._resizeDetails.offsetYtop=e.clientY-n.top,t._preventDropDownClose=!0}_documentMoveHandler(e){const t=this,o=t.shadowRoot||t.isInShadowDOM?e.originalEvent.composedPath()[0]:e.originalEvent.target;if("auto"===t.dropDownOpenMode&&null!==t.dropDownAppendTo&&(t.contains(o)||t.$.dropDownContainer.contains(o)?t._isElementHovered=!0:(t._isElementHovered=!1,t._autoClose())),!t._resizeDetails||t._resizeDetails&&!t._resizeDetails.started)return;t.setAttribute("resizing",""),t._resizeDetails.resizeEventFired||(t.$.fireEvent("resizeStart",{position:{left:e.pageX,top:e.pageY}}),t._resizeDetails.resizeEventFired=!0);const n=document.documentElement,i=t.$.dropDownContainer.getBoundingClientRect(),r=t.getBoundingClientRect(),a=t.$.dropDownContainer.hasAttribute("top")?"top":"bottom";let s;function l(){if(s=e.pageY-t._resizeDetails.y,"bottom"===a)t._resizeDetails.height=Math.min(n.clientHeight-i.top-6,Math.max(0,t._resizeDetails.height+s)),t._resizeDetails.y=Math.max(i.top+n.scrollTop-t._resizeDetails.offsetY,Math.min(n.clientHeight+n.scrollTop-1.5*t._resizeDetails.offsetY,e.pageY));else{if(t._resizeDetails.height=Math.min(t._dropDownSize.maxHeight,Math.max(0,Math.min(r.top,t._resizeDetails.height-s))),s=Math.max(0,i.top+(i.height-Math.max(t._dropDownSize.minHeight,t._resizeDetails.height))),t.dropDownAppendTo){const e=Math.abs(parseFloat(getComputedStyle(t.$.dropDownContainer).getPropertyValue("margin-bottom")))||0;t.$.dropDownContainer.style.top=t.dropDownAppendTo?e+s+"px":""}const o=r.top+n.scrollTop+t._resizeDetails.offsetYtop;t._resizeDetails.y=Math.max(t._resizeDetails.offsetYtop,Math.min(o,Math.max(o-t._dropDownSize.maxHeight,e.pageY)))}t.$.dropDownContainer.style.height=t._resizeDetails.height+"px"}function d(){s=e.pageX-t._resizeDetails.x,t._resizeDetails.width=Math.min(n.clientWidth-i.left-6,Math.max(0,t._resizeDetails.width+s)),t.$.dropDownContainer.style.width=t._resizeDetails.width+"px",t._resizeDetails.x=Math.max(i.left+n.scrollLeft-t._resizeDetails.offsetXR,Math.min(n.clientWidth+n.scrollLeft-1.5*t._resizeDetails.offsetXR,e.pageX))}switch(t.resizeMode){case"vertical":l();break;case"horizontal":d();break;case"both":d(),l()}}_documentUpHandler(e){const t=this;if(t.$.actionButton.removeAttribute("active"),t._resizeDetails&&t._resizeDetails.started)return t._resizeDetails.started=t._resizeDetails.resizeEventFired=!1,t.removeAttribute("resizing"),t._preventDropDownClose=!1,t.focus(),void t.$.fireEvent("resizeEnd",{position:{left:e.pageX,top:e.pageY}});if(t.disabled||t._isDropDownClicked||t.readonly)return void delete t._isDropDownClicked;if(t._overlayDown)return t.close(),void delete t._overlayDown;let o=e.originalEvent.target,n=o.closest?o.closest("smart-drop-down-list"):void 0;if((t.enableShadowDOM||t.isInShadowDOM)&&(o=e.originalEvent.composedPath()[0],n=o.getRootNode().host),t._preventsSelectStart=!1,void 0===o||o===t.$.resizeBar)return;if("tokens"===t.selectionDisplayMode&&o.classList.contains("smart-drop-down-list-selection-label")&&n===t){"none"!==t.dropDownOpenMode&&t.open();let e=t.$.listBox._items.filter((e=>e[t.inputMember].toString()===o.textContent))[0];return t.$.listBox._scrollView.scrollTop=e.offsetTop,void t._focus(e)}if("tokens"===t.selectionDisplayMode&&o.classList.contains("smart-drop-down-list-unselect-button")&&n===t){if(1===t.selectedIndexes.length&&["zeroOrMany","zeroOrOne","checkBox"].indexOf(t.selectionMode)<0)return;return void t.unselect(t.$.listBox._items.filter((e=>e[t.inputMember].toString()===o.previousElementSibling.textContent))[0])}const i=o.closest(".smart-action-button");let r;if(t._buttonClicked&&("dropDownButton"===t.dropDownOpenMode&&i&&t._buttonClicked===t.$.actionButton?t.$.fireEvent("actionButtonClick"):o.closest(".smart-drop-down-button")!==t._buttonClicked&&i!==t._buttonClicked||(r=!0,t.$.fireEvent("dropDownButtonClick"))),t._buttonClicked=void 0,i===t.$.actionButton||o.closest(".smart-drop-down-button")===t.$.dropDownButton)return"dropDownButton"===t.dropDownOpenMode&&i===t.$.actionButton?void t.close():void(t.$dropDownContainer.hasClass("smart-visibility-hidden")&&"none"!==t.dropDownOpenMode&&r&&"pointercancel"!==e.originalEvent.type?t.open():t.close());o=t._getUpEventTarget(o),void 0!==o&&("dropDownContainer"!==o&&"item"!==o||"item"===o&&"checkBox"!==t.selectionMode&&t.selectionMode.indexOf("Many")<0)&&t.close()}_dragStartHandler(e){this._resizeDetails&&this._resizeDetails.started&&e.preventDefault()}_dropDownTransitionendHandler(){const e=this;e._edgeMacFF&&!e.opened&&e.hasAnimation&&(e.$.dropDownContainer.style.top=e.$.dropDownContainer.style.left="",e.$dropDownContainer.addClass("not-in-view"))}_focus(e){this.$.listBox._focus(e)}_blurEventHandler(){const e=this;e.$.dropDownButton&&(e.removeAttribute("focus"),e.$.dropDownButton.removeAttribute("focus")),e.$.actionButton&&(e.removeAttribute("focus"),e.$.actionButton.removeAttribute("focus")),e.nodeName&&"smart-drop-down-list"===e.nodeName.toLowerCase()&&!e._preventDropDownClose&&e.close()}_focusEventHandler(){const e=this;e.$.dropDownButton&&(e.setAttribute("focus",""),e.$.dropDownButton.setAttribute("focus","")),e.$.actionButton&&(e.setAttribute("focus",""),e.$.actionButton.setAttribute("focus","")),e.removeAttribute("drop-down-button-focus"),e.removeAttribute("action-button-focus")}_buttonsFocusHandler(e){const t=this;e.target===t.$.dropDownButton?"focus"===e.type?t.setAttribute("drop-down-button-focus",""):(t.removeAttribute("drop-down-button-focus"),t.nodeName&&"smart-drop-down-list"===t.nodeName.toLowerCase()&&!t._preventDropDownClose&&t.close()):"focus"===e.type?t.setAttribute("action-button-focus",""):t.removeAttribute("action-button-focus")}_getUpEventTarget(e){const t=this;let o=e;for(o=void 0===o.parentElement?o.getRootNode().host:o.parentElement;o;){if(o===t.$.dropDownContainer){o="dropDownContainer";break}o=void 0===o.parentElement?o.getRootNode().host:o.parentElement}return o}_keyDownHandler(e){const t=this,o=t.enableShadowDOM&&t.shadowRoot.activeElement||document.activeElement,n=t.enableShadowDOM?e.composedPath()[0]:e.target;if(!(t.$.listBox&&n===t.$.listBox.$.filterInput||o!==t&&o!==t.$.dropDownButton&&o!==t.$.actionButton)||"Tab"===e.key)switch(e.key){case"Tab":if(t.filterable&&t.opened){const o=function(){for(let e=0;e<t.items.length;e++)if(!t.items[e].disabled)return t.items[e]};t.$.listBox.$.filterInput&&!Smart.Utilities.Core.isMobile&&document.activeElement!==t.$.listBox.$.filterInput?(t.$.listBox.$.filterInput.focus(),t._preventDropDownClose=!0):t.$.listBox&&(t.focus(),t.selectedIndexes.length>0?t._focus(t.items[t.selectedIndexes[0]]):t._focus(o),t._preventDropDownClose=!0),e.preventDefault()}break;case"Enter":case" ":e.preventDefault(),n!==t.$.actionButton&&(t._keyPressed=!0,t.opened?(t._focusedItem&&t.select(t._focusedItem),("Enter"===e.key&&["none"].indexOf(t.selectionMode)<0||" "===e.key&&["none","zeroAndOne","one","radioButton"].indexOf(t.selectionMode)>-1)&&t.close()):t.opened||t.readonly||"none"===t.dropDownOpenMode||t.open()),"dropDownButton"===t.dropDownOpenMode&&n.setAttribute("active","");break;case"End":case"Home":case"PageUp":case"PageDown":case"ArrowUp":case"ArrowDown":if(t.readonly)return;if(e.altKey)return t._keyPressed=!1,void(t.$dropDownContainer.hasClass("smart-visibility-hidden")?t.open():t.close());e.preventDefault(),t.$.listBox._handleKeyStrokes(e.key);break;case"Escape":e.preventDefault(),t.close();break;default:if(t.readonly)return;"oneOrManyExtended"===t.selectionMode&&(t.$.listBox._keysPressed[e.key]=!0),t.$.listBox._applyIncrementalSearch(e.key)}}_keyUpHandler(e){const t=this,o=t.enableShadowDOM?e.composedPath()[0]:e.target;t.$.listBox&&o===t.$.listBox.$.filterInput||("Enter"!==e.key&&" "!==e.key||(o.removeAttribute("active"),t.$dropDownContainer.hasClass("smart-visibility-hidden")||(t._keyPressed=!1)),t.$.listBox&&"oneOrManyExtended"===t.selectionMode&&(t.$.listBox._keysPressed[e.key]=!1))}_listBoxChangeHandler(e){const t=this;if(e.target===t.$.listBox){if((t.dropDownAppendTo||t.enableShadowDOM)&&t.$.fireEvent("change",e.detail),"list"===t.autoComplete&&e.detail){const o=t.$.listBox._items[e.detail.index];t._lastSelectedItem=o&&o.selected?o:void 0}t._applySelection(t.selectionMode,e.detail),t._updateTargetValue()}else e.stopPropagation()}_listBoxItemClickHandler(e){const t=this;(t.dropDownAppendTo||t.enableShadowDOM)&&t.$.fireEvent(e.type,e.detail),"checkBox"!==t.selectionMode&&t.selectionMode.indexOf("Many")<0&&t.close(),Smart.Utilities.Core.isMobile||t.focus(),delete t._isDropDownClicked}_listBoxKeyDownHandler(e){const t=this;if("Enter"===e.key)return t.close(),"dropDownButton"===t.dropDownOpenMode?t.$.dropDownButton.focus():t.focus(),void e.stopPropagation();"Escape"!==e.key||t.close()}_mouseEnterHandler(){const e=this;e._isElementHovered=!0,e.tagName.toLowerCase().indexOf("smart-drop-down-")>-1&&"auto"===e.dropDownOpenMode&&!e.disabled&&!e.readonly&&e.open()}_mouseLeaveHandler(){const e=this;e.removeAttribute("hover"),e._isElementHovered=!1,"auto"!==e.dropDownOpenMode||e.disabled||e.readonly||e._autoClose()}_mouseWheelHandler(e){const t=this;t.disabled||t.readonly||t.items&&0===t.items.length||t.$dropDownContainer&&!t.$dropDownContainer.hasClass("smart-visibility-hidden")||t.$.listBox&&(e.preventDefault(),t.$.listBox._handleKeyStrokes(e.deltaY>0?"ArrowDown":"ArrowUp"))}_autoClose(){const e=this;e._autoCloseTimeout=setTimeout(function(){e._isElementHovered||e.close(),clearTimeout(e._autoCloseTimeout)}.bind(e),e.autoCloseDelay)}_propertyValidator(e,t){return"number"!=typeof t&&"string"!=typeof t?e:t}_resizeHandler(){this.refresh()}refresh(){const e=this;"none"===e.resizeMode&&(e._calculateDropDownSize(),e._setDropDownSize())}_selectStartHandler(e){this._preventsSelectStart&&e.preventDefault()}_setAriaRelations(e){const t=this;let o,n;"dropDownButton"!==t.dropDownOpenMode?(o=t.$.dropDownButton,o.setAttribute("aria-hidden",!0),n=t,t.$.actionButton.removeAttribute("role")):(o=t,n=t.$.dropDownButton,n.removeAttribute("aria-hidden"),t.$.actionButton.setAttribute("role","button")),t._ariaButton=n,n.setAttribute("role","button"),n.setAttribute("aria-haspopup","listbox"),n.setAttribute("aria-owns",t.$.listBox.id),n.setAttribute("aria-describedby",t.$.hint.id),t.label?n.setAttribute("aria-labelledby",t.$.label.id):"DropDownList"===t.elementName&&n.setAttribute("aria-labelledby",t.$.actionButton.id),o.setAttribute("role","presentation"),o.removeAttribute("aria-owns"),e?n.setAttribute("aria-expanded",t.opened):(o.removeAttribute("aria-describedby"),o.removeAttribute("aria-expanded"),o.removeAttribute("aria-haspopup"),o.removeAttribute("aria-labelledby"))}_setDropDownSize(){const e=this,t=e.$.listBox;let o;if(e._dropDownSize||e._calculateDropDownSize(),["dropDownMinWidth","dropDownMaxWidth"].forEach((t=>{e.$.dropDownContainer.style[t.replace("dropDown","").replace(/^./,"m")]="initial"===e[t]?e.offsetWidth+"px":e[t]?parseFloat(e[t])+(e[t].toString().endsWith("%")?"%":"px"):null})),["dropDownMinHeight","dropDownMaxHeight"].forEach((t=>{e.$.dropDownContainer.style[t.replace("dropDown","").replace(/^./,"m")]=e[t]?parseFloat(e[t])+(e[t].toString().endsWith("%")?"%":"px"):null})),e.dropDownWidth?"auto"!==e.dropDownWidth?e.$.dropDownContainer.style.width=("initial"===e.dropDownWidth?e.offsetWidth:parseFloat(e.dropDownWidth))+"px":e.$.dropDownContainer.style.width="auto":e.$.dropDownContainer.style.width="auto"===e._dropDownSize.width?"auto":(parseFloat(e._dropDownSize.width)||0)+"px",e.dropDownHeight&&"auto"!==e.dropDownHeight)e.$.dropDownContainer.style.height=parseFloat(e.dropDownHeight)+((e.dropDownHeight+"").indexOf("%")>-1?"%":"px");else if(!e.$.listBox||"auto"!==e._dropDownSize.height&&"auto"!==e.dropDownHeight)e.$.dropDownContainer.style.height=e._dropDownSize.height;else{e.$.dropDownContainer.style.height="";let n=0;if(t.$.itemsContainer&&(n=2*parseInt(window.getComputedStyle(t.$.itemsContainer).getPropertyValue("--smart-list-item-vertical-offset"))),isNaN(n)&&(n=6),o=n,t.items&&t.items.length>0?t.items.map((e=>o+=e.height||e.offsetHeight)):o=t.$.placeholder?t.$.placeholder.offsetHeight:200,e.filterable){const e=t.$.filterInputContainer;o+=e.offsetHeight+e.offsetTop}o=o+e._dropDownSize.paddingWidth+e._dropDownSize.borderWidth,e.$.dropDownContainer.style.height=o+"px"}if(t){if(void 0===o||!t.$)return void t._refreshLayout();const n=t.$.horizontalScrollBar?t.$.horizontalScrollBar.offsetHeight:0,i=Math.max(0,e._dropDownSize.minHeight-(o-n));i&&(e.$.dropDownContainer.style.height=o+i+"px"),!e.opened&&e.virtualized&&t.refresh()}}_styleChangedHandler(e){const t=this;if(t.dropDownAppendTo){const o=e.detail.styleProperties,n=["font-size","font-family","font-style","font-weight"];for(let e=0;e<n.length;e++)o[n[e]]&&(t.$.dropDownContainer.style[n[e]]=o[n[e]].value)}"auto"===t._dropDownSize.height&&t._setDropDownSize()}_validateTemplate(e){const t=this;if(e&&"function"!=typeof e)if("content"in document.createElement("template")){if(e instanceof HTMLTemplateElement||(e=document.getElementById(e)),null!==e&&"content"in e)return e;t.error(t.localize("invalidTemplate",{elementType:t.nodeName.toLowerCase(),property:"tokenTemplate"}))}else t.error(t.localize("htmlTemplateNotSuported",{elementType:t.nodeName.toLowerCase()}))}});
/***/ }),
/***/ 6321:
/***/ (() => {
!function(){const e="16.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={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(e).replace(/[&<>"'`=\/]/g,(e=>t[e]))}static sanitizeHTML(e){if(e&&(e.indexOf("onclick")>=0||e.indexOf("onload")>=0||e.indexOf("onerror")>=0))return this.escapeHTML(e);const t=new RegExp("<s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)[^>]*>(.*?)<s*/s*(applet|audio|base|bgsound|embed|form|iframe|isindex|keygen|layout|link|meta|object|script|svg|style|template|video)>","ig");return String(e).replace(t,(e=>this.escapeHTML(e)))}static createGUID(){function e(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()}static getScriptLocation(){return"./"!==window[n].BaseUrl?window[n].BaseUrl:function(){if(document.currentScript){let e=document.currentScript.src,t=e.lastIndexOf("/");return e=e.substring(0,t),e}const e=new Error;let t="(",n=")";if(Smart.Utilities.Core.Browser.Safari&&(t="@",n="\n"),e.fileName)return e.fileName.replace("/smart.element.js","");let r=e.stack.split(t);return r=r[1],r=r.split(n)[0],r=r.split(":"),r.splice(-2,2),r=r.join(":"),r.replace("/smart.element.js","")}()}static CSSVariablesSupport(){return window.CSS&&window.CSS.supports&&window.CSS.supports("(--fake-var: 0)")}static assign(e,t){const n=e=>e&&"object"==typeof e&&!Array.isArray(e)&&null!==e;let r=Object.assign({},e);return n(e)&&n(t)&&Object.keys(t).forEach((o=>{n(t[o])?o in e?r[o]=this.assign(e[o],t[o]):Object.assign(r,{[o]:t[o]}):Object.assign(r,{[o]:t[o]})})),r}static html(e,t){const n=this;let r="",o=e.childNodes;if(!t){for(let e,t=0,i=o.length;t<i&&(e=o[t]);t++){const t=["strong"];if(e instanceof HTMLElement||e.tagName&&t.indexOf(e.tagName.toLowerCase())>=0){const t=e.tagName.toLowerCase(),o=e.attributes;let i="<"+t;for(let e,t=0;e=o[t];t++)i+=" "+e.name+'="'+e.value.replace(/[&\u00A0"]/g,y.Core.escapeHTML)+'"';i+=">",["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"][t]&&(r+=i),r=r+i+n.html(e)+"</"+t+">"}else{if(8===e.nodeType)continue;r+=e.textContent.replace(/[&\u00A0<>]/g,y.Core.escapeHTML)}}return r}{const n=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi;e.innerHTML=t.replace(n,"<$1></$2>")}}}let l=[];class d{static watch(e){switch(e.nodeName.toLowerCase()){case"smart-grid":case"smart-kanban":case"smart-table":case"smart-pivot-table":case"smart-scheduler":case"smart-tabs":case"smart-card-view":case"smart-list-box":case"smart-combo-box":case"smart-drop-down-list":case"smart-calendar":case"smart-gauge":case"smart-numeric-text-box":case"smart-menu":case"smart-tree":l.push(e);break;default:return}d.start()}static start(){d.isStarted||(d.isStarted=!0,d.interval&&clearInterval(d.interval),0===l.length||document.hidden?d.isStarted=!1:d.interval=setInterval((function(){d.observe()}),100))}static stop(){d.isStarted=!1,d.interval&&clearInterval(d.interval)}static observeElement(e){const t=e;if("test"===window.Smart.Mode||document.hidden)return void(d.interval&&clearInterval(d.interval));let n=e._computedStyle||"resize"!==t.hasStyleObserver?document.defaultView.getComputedStyle(t,null):{},r=!0,o="resize"!==t.hasStyleObserver?["paddingLeft","paddingRight","paddingTop","paddingBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth","display","visibility","font-size","font-family","font-style","font-weight","max-height","min-height","max-width","min-width","overflow","overflow-x","overflow-y"]:[];if(e.styleProperties&&(o=o.concat(e.styleProperties)),e.observableStyleProperties&&(o=e.observableStyleProperties),!t._styleInfo){t._styleInfo=[];for(let e=0;e<o.length;e++){const r=o[e],i=r.startsWith("--")?n.getPropertyValue(r):n[r];t._styleInfo[r]=i}return}if(e.isHidden||"none"!==n.display&&(0!==e.offsetWidth&&0!==e.offsetHeight||(e.isHidden=!0)),e.isHidden){if(e.visibilityChangedHandler(),e.isHidden)return;r=!1}let i=[];for(let e=0;e<o.length;e++){const r=o[e],s=r.startsWith("--")?n.getPropertyValue(r):n[r];t._styleInfo[r]!==s&&(i[r]={oldValue:t._styleInfo[r],value:s},i.length++),t._styleInfo[r]=s}i.length>0&&(t.$.fireEvent("styleChanged",{styleProperties:i},{bubbles:!1,cancelable:!0}),i.display&&r&&t.$.fireEvent("resize",t,{bubbles:!1,cancelable:!0}))}static observe(){for(let e=0;e<l.length;e++){const t=l[e];this.observeElement(t)}}static unwatch(e){d.stop();const t=l.indexOf(e);-1!==t&&l.splice(t,1),d.start()}}let c=[];const u=[],p=["resize","down","up","move","tap","taphold","swipeleft","swiperight","swipetop","swipebottom"];class h{constructor(e){const t=this;t.target=e,t.$target=new f(e),t.$document=e.$document?e.$document:new f(document),t.id=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase();let n={handlers:{},boundEventTypes:[],listen:t.listen.bind(t),unlisten:t.unlisten.bind(t)};return t.tapHoldDelay=750,t.swipeMin=10,t.swipeMax=5e3,t.swipeDelay=1e3,t.tapHoldDelay=750,t.inputEventProperties=["clientX","clientY","pageX","pageY","screenX","screenY"],p.forEach((e=>{n[e]=t=>{n.handlers[e]=t},t[e]=e=>{if(!n.handlers[e.type]){if(("mousemove"===e.type||"pointermove"===e.type||"touchmove"===e.type)&&n.handlers.move){const r=t.createEvent(e,"move");n.handlers.move(r)}return!0}return n.handlers[e.type](e)}})),t.listen(),t.handlers=n.handlers,n}listen(e){const t=this;if("resize"===e&&t.target!==document&&t.target!==window&&!1!==t.target.hasResizeObserver)if(Smart.Utilities.Core.Browser.Firefox){if(!t.target.resizeObserver){let e,n,r,o=!1,i=t.target.offsetWidth,s=t.target.offsetHeight;const a=new ResizeObserver((()=>{if(!o)return void(o=!0);const a=new CustomEvent("resize",{bubbles:!1,cancelable:!0});n=t.target.offsetWidth,r=t.target.offsetHeight,e=n!==i||r!==s,t.target.requiresLayout&&(e=!0),e&&(t.resize(a),t.target.requiresLayout=!1)}));a.observe(t.target),t.target.resizeObserver=a}}else if(!t.target.resizeTrigger){const e=document.createElement("div");e.className="smart-resize-trigger-container",e.innerHTML='<div class="smart-resize-trigger-container"><div class="smart-resize-trigger"></div></div><div class="smart-resize-trigger-container"><div class="smart-resize-trigger-shrink"></div></div>',e.setAttribute("aria-hidden",!0),window[n].EnableShadowDOM&&t.target.shadowRoot?t.target.shadowRoot.appendChild(e):t.target.appendChild(e),t.target.resizeTrigger=e;const r=e.childNodes[0],o=r.childNodes[0],i=e.childNodes[1],s=function(){o.style.width="100000px",o.style.height="100000px",r.scrollLeft=1e5,r.scrollTop=1e5,i.scrollLeft=1e5,i.scrollTop=1e5};let a,l,d,c,u=t.target.offsetWidth,p=t.target.offsetHeight;if(0===u||0===p){const e=function(){s(),t.target.removeEventListener("resize",e)};t.target.addEventListener("resize",e),s()}else s();t.target.resizeHandler=function(){l||(l=requestAnimationFrame((function(){if(l=0,d=t.target.offsetWidth,c=t.target.offsetHeight,a=d!==u||c!==p,t.target.requiresLayout&&(a=!0),!a)return;u=d,p=c;const e=new CustomEvent("resize",{bubbles:!1,cancelable:!0});t.resize(e),t.target.requiresLayout=!1}))),s()},r.addEventListener("scroll",t.target.resizeHandler),i.addEventListener("scroll",t.target.resizeHandler)}t.isListening||(t.isListening=!0,t.isPressed=!1,t.isReleased=!1,t.isInBounds=!1,window.PointerEvent?(t.$target.listen("pointerdown.inputEvents"+t.id,t.pointerDown.bind(t)),t.$target.listen("pointerup.inputEvents"+t.id,t.pointerUp.bind(t)),t.$target.listen("pointermove.inputEvents"+t.id,t.pointerMove.bind(t)),t.$target.listen("pointercancel.inputEvents"+t.id,t.pointerCancel.bind(t))):("ontouchstart"in window&&(t.$target.listen("touchmove.inputEvents"+t.id,t.touchMove.bind(t)),t.$target.listen("touchstart.inputEvents"+t.id,t.touchStart.bind(t)),t.$target.listen("touchend.inputEvents"+t.id,t.touchEnd.bind(t)),t.$target.listen("touchcancel.inputEvents"+t.id,t.touchCancel.bind(t))),t.$target.listen("mousedown.inputEvents"+t.id,t.mouseDown.bind(t)),t.$target.listen("mouseup.inputEvents"+t.id,t.mouseUp.bind(t)),t.$target.listen("mousemove.inputEvents"+t.id,t.mouseMove.bind(t)),t.$target.listen("mouseleave.inputEvents"+t.id,t.mouseLeave.bind(t))),t.target._handleDocumentUp||(t.target._handleDocumentUp=t.handleDocumentUp.bind(t),t.target._handleDocumentUpId=t.id,t.$document.listen("mouseup.inputEvents"+t.target._handleDocumentUpId,t.target._handleDocumentUp)))}unlisten(e){const t=this;if(t.isListening=!1,window.PointerEvent?(t.$target.unlisten("pointerdown.inputEvents"+t.id),t.$target.unlisten("pointerup.inputEvents"+t.id),t.$target.unlisten("pointermove.inputEvents"+t.id),t.$target.unlisten("pointercancel.inputEvents"+t.id)):("ontouchstart"in window&&(t.$target.unlisten("touchstart.inputEvents"+t.id),t.$target.unlisten("touchmove.inputEvents"+t.id),t.$target.unlisten("touchend.inputEvents"+t.id),t.$target.unlisten("touchcancel.inputEvents"+t.id)),t.$target.unlisten("mousedown.inputEvents"+t.id),t.$target.unlisten("mouseup.inputEvents"+t.id),t.$target.unlisten("mousemove.inputEvents"+t.id),t.$target.unlisten("mouseleave.inputEvents"+t.id)),t.target._handleDocumentUp&&(t.$document.unlisten("mouseup.inputEvents"+t.target._handleDocumentUpId,t.target._handleDocumentUp),delete t.target._handleDocumentUp,delete t.target._handleDocumentUpId),"resize"===e)if(Smart.Utilities.Core.Browser.Firefox)t.target.resizeObserver&&(t.target.resizeObserver.unobserve(t.target),delete t.target.resizeObserver);else if(t.target.resizeTrigger){const e=t.target.resizeTrigger,n=e.childNodes[0],r=e.childNodes[1];n.removeEventListener("scroll",t.target.resizeHandler),r.removeEventListener("scroll",t.target.resizeHandler),t.target.resizeHandler=null,e.parentNode.removeChild(e),delete t.target.resizeTrigger}}handleDocumentUp(e){const t=this;t.isPressed=!1,t.isReleased=!1,t.resetSwipe(e)}createEvent(e,t){const n=this,r=e.touches,o=e.changedTouches,i=r&&r.length?r[0]:o&&o.length?o[0]:void 0,s=new CustomEvent(t,{bubbles:!0,cancelable:!0,composed:void 0!==n.$target.element.getRootNode().host});if(s.originalEvent=e,i){for(let e=0;e<n.inputEventProperties.length;e++){const t=n.inputEventProperties[e];s[t]=i[t]}return s}for(let t in e)t in s||(s[t]=e[t]);return s}fireTap(e){const t=this;if(clearTimeout(this.tapHoldTimeout),!this.tapHoldFired&&this.isInBounds){const n=t.createEvent(e,"tap");t.tap(n)}}initTap(e){const t=this;t.isInBounds=!0,t.tapHoldFired=!1,t.tapHoldTimeout=setTimeout((function(){if(t.isInBounds){t.tapHoldFired=!0;const n=t.createEvent(e,"taphold");t.taphold(n)}}),t.tapHoldDelay)}pointerDown(e){return this.handleDown(e)}mouseDown(e){const t=this;if(!(t.isPressed||t.touchStartTime&&new Date-t.touchStartTime<500))return t.handleDown(e)}touchStart(e){const t=this;return t.touchStartTime=new Date,t.isTouchMoved=!0,t.handleDown(e)}mouseUp(e){const t=this;if(!(t.isReleased||t.touchEndTime&&new Date-t.touchEndTime<500))return t.handleUp(e)}handleDown(e){const t=this;t.isReleased=!1,t.isPressed=!0;const n=t.createEvent(e,"down");return(t.handlers.tap||t.handlers.taphold)&&t.initTap(n),(t.handlers.swipeleft||t.handlers.swiperight||t.handlers.swipetop||t.handlers.swipebottom)&&t.initSwipe(n),t.down(n)}handleUp(e){const t=this;t.isReleased=!0,t.isPressed=!1;const n=t.createEvent(e,"up"),r=t.up(n);return(t.handlers.tap||t.handlers.taphold)&&t.fireTap(n),t.resetSwipe(n),r}handleMove(e){const t=this;let n=t.move(e);return t.isPressed&&(t._maxSwipeVerticalDistance=Math.max(t._maxSwipeVerticalDistance,Math.abs(t._startY-e.pageY)),t._maxSwipeHorizontalDistance=Math.max(t._maxSwipeHorizontalDistance,Math.abs(t._startX-e.pageX)),n=t.handleSwipeEvents(e)),n}touchEnd(e){return this.touchEndTime=new Date,this.handleUp(e)}pointerUp(e){return this.handleUp(e)}pointerCancel(e){this.pointerUp(e)}touchCancel(e){this.touchEnd(e)}mouseLeave(){this.isInBounds=!1}mouseMove(e){if(!this.isTouchMoved)return this.handleMove(e)}pointerMove(e){return this.handleMove(e)}touchMove(e){const t=this,n=e.touches,r=e.changedTouches,o=n&&n.length?n[0]:r&&r.length?r[0]:void 0;for(let n=0;n<t.inputEventProperties.length;n++){const r=t.inputEventProperties[n];void 0===e[r]&&(e[r]=o[r])}return t.isTouchMoved=!0,t.handleMove(e)}handleSwipeEvents(e){const t=this;let n=!0;return(t.handlers.swipetop||t.handlers.swipebottom)&&(n=this.handleVerticalSwipeEvents(e)),!1===n||(t.handlers.swipeleft||t.handlers.swiperight)&&(n=this.handleHorizontalSwipeEvents(e)),n}handleVerticalSwipeEvents(e){let t,n;return t=e.pageY,n=t-this._startY,this.swiped(e,n,"vertical")}handleHorizontalSwipeEvents(e){let t,n;return t=e.pageX,n=t-this._startX,this.swiped(e,n,"horizontal")}swiped(e,t,n){const r=this;if(n=n||0,Math.abs(t)>=r.swipeMin&&!r._swipeEvent&&!r._swipeLocked){let o=t<0?"swipeleft":"swiperight";if("horizontal"===n?r._swipeEvent=r.createEvent(e,o):(o=t<0?"swipetop":"swipebottom",r._swipeEvent=r.createEvent(e,t<0?"swipetop":"swipebottom")),r[o]&&(r[o](this._swipeEvent),Math.abs(t)<=this.swipeMax))return e.stopImmediatePropagation(),!1}return!0}resetSwipe(){this._swipeEvent=null,clearTimeout(this._swipeTimeout)}initSwipe(e){const t=this;t._maxSwipeVerticalDistance=0,t._maxSwipeHorizontalDistance=0,t._startX=e.pageX,t._startY=e.pageY,t._swipeLocked=!1,t._swipeEvent=null,t._swipeTimeout=setTimeout((function(){t._swipeLocked=!0}),t.swipeDelay)}}class m{get scrollWidth(){const e=this;return e.horizontalScrollBar?e.horizontalScrollBar.max:-1}set scrollWidth(e){const t=this;e<0&&(e=0),t.horizontalScrollBar&&(t.horizontalScrollBar.max=e)}get scrollHeight(){const e=this;return e.verticalScrollBar?e.verticalScrollBar.max:-1}set scrollHeight(e){const t=this;e<0&&(e=0),t.verticalScrollBar&&(t.verticalScrollBar.max=e)}get scrollLeft(){const e=this;return e.horizontalScrollBar?e.horizontalScrollBar.value:-1}set scrollLeft(e){const t=this;e<0&&(e=0),t.horizontalScrollBar&&(t.horizontalScrollBar.value=e)}get scrollTop(){const e=this;return e.verticalScrollBar?e.verticalScrollBar.value:-1}set scrollTop(e){const t=this;e<0&&(e=0),t.verticalScrollBar&&(t.verticalScrollBar.value=e)}get vScrollBar(){return this.verticalScrollBar}get hScrollBar(){return this.horizontalScrollBar}constructor(e,t,n){const r=this;r.container=e,r.horizontalScrollBar=t,r.verticalScrollBar=n,r.disableSwipeScroll=!1,r.listen()}listen(){const e=this,t=a.isMobile,n=e.horizontalScrollBar,r=e.verticalScrollBar;let o,i,s,l,d,c,u,p;e.inputEvents=new h(e.container);const m=function(e){return{amplitude:0,delta:0,initialValue:0,min:0,max:e.max,previousValue:0,pointerPosition:0,targetValue:0,scrollBar:e,value:0,velocity:0}},f=m(n),g=m(r),w=function(){const t=e.container.touchVelocityCoefficient||50;c=Date.now(),u=c-l,l=c;const n=function(e){e.delta=e.value-e.previousValue,e.previousValue=e.value;let n=t*e.delta/(1+u);e.velocity=.8*n+.2*e.velocity};n(g),n(f)},b=function(e){return p.value=e>p.max?p.max:e<p.min?p.min:e,p.scrollBar.value=p.value,e>p.max?"max":e<p.min?"min":"value"};function v(){let t,n;p.amplitude&&(e.container.$.fireEvent("kineticScroll"),t=Date.now()-l,n=-p.amplitude*Math.exp(-t/500),n>5||n<-5?(b(p.targetValue+n),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(v)):b(p.targetValue))}let _;e.inputEvents.down((function(n){if(!t)return;const r=n.originalEvent.target,i=r&&r.closest?r.closest("smart-scroll-bar"):void 0;if(i===e.horizontalScrollBar||i===e.verticalScrollBar)return;s=!0,o=!1;const a=function(e,t){e.amplitude=0,e.pointerPosition=t,e.previousValue=e.value,e.value=e.scrollBar.value,e.initialValue=e.value,e.max=e.scrollBar.max};a(g,n.clientY),a(f,n.clientX),l=Date.now(),clearInterval(d),d=setInterval(w,500)})),e.inputEvents.up((function(){if(!s)return!0;if(clearInterval(d),e.disableSwipeScroll)return void(s=!1);const t=function(e){p=e,e.amplitude=.8*e.velocity,e.targetValue=Math.round(e.value+e.amplitude),l=Date.now(),cancelAnimationFrame(i),i=requestAnimationFrame(v),e.velocity=0};g.velocity>10||g.velocity<-10?t(g):(f.velocity>10||f.velocity<-10)&&t(f),s=!1})),e.inputEvents.move((function(t){if(!s)return!0;if(e.disableSwipeScroll)return;if(o&&(t.originalEvent.preventDefault(),t.originalEvent.stopPropagation()),f.visible=e.scrollWidth>0,g.visible=e.scrollHeight>0,!s||!f.visible&&!g.visible)return;const n=e.container.touchScrollRatio,r=e.container;let i,a;n&&("number"==typeof n?(i=-n,a=-n):"function"==typeof n&&(i=n(g.max,r.offsetHeight),a=n(f.max,r.offsetWidth))),g.ratio=i||-g.max/r.offsetHeight,g.delta=(t.clientY-g.pointerPosition)*g.ratio,f.ratio=a||-f.max/r.offsetWidth,f.delta=(t.clientX-f.pointerPosition)*f.ratio;let l="value";const d=function(t,n,r){return t.delta>5||t.delta<-5?(p=t,l=t.initialValue+t.delta>p.max?"max":t.initialValue+t.delta<p.min?"min":"value","min"===l&&0===t.initialValue||"max"===l&&t.initialValue===t.max||!t.visible||(e.container.$.fireEvent("kineticScroll"),b(t.initialValue+t.delta),w(),r.originalEvent.preventDefault(),r.originalEvent.stopPropagation(),o=!0,!1)):null};let c=d(g,t.clientY,t);if(null!==c)return c;{let e=d(f,t.clientX,t);if(null!==e)return e}})),e.scrollTo=function(t,n){const r=!1===n?f:g;let o=!1;l||(l=Date.now()),_||(_=Date.now()),Math.abs(Date.now()-_)>375?l=Date.now():o=!0,_=Date.now(),r.value=r.scrollBar.value,r.delta=t-r.value,r.max=r.scrollBar.max,t<=r.min&&(t=r.min),t>=r.max&&(t=r.max),r.targetValue=t;const s=t;let a=r.value;r.velocity=100*r.delta/(1+r.max),r.from=a;const d=function(e){return r.value=e>r.max?r.max:e<r.min?r.min:e,r.scrollBar.value=r.value,e>r.max?"max":e<r.min?"min":"value"},c=function(){let n,u=Date.now()-_,p=Math.min(1e3,Date.now()-l),h=r.velocity*Math.exp(p/175);if(o)(h<0&&r.value<=t||h>0&&r.value>=t)&&(h=0),(r.value+h<=r.min||r.value+h>=r.max)&&(h=0),h>.5||h<-.5?(d(r.value+h),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(c)):d(r.targetValue);else{if(u>=175)return cancelAnimationFrame(i),e.container.$.fireEvent("kineticScroll"),void(i=0);n=y.Animation.Easings.easeInSine(u,a,s-a,175),d(n),cancelAnimationFrame(i),i=0,i=requestAnimationFrame(c)}};cancelAnimationFrame(i),i=requestAnimationFrame(c)},e.inputEvents.listen()}unlisten(){const e=this;e.inputEvents&&e.inputEvents.unlisten(),delete e.inputEvents}}class f{constructor(e){this.events={},this.handlers={},this.element=e}hasClass(e){const t=this,n=e.split(" ");for(let e=0;e<n.length;e++)if(!t.element.classList.contains(n[e]))return!1;return!0}addClass(e){const t=this;if(t.hasClass(e))return;const n=e.split(" ");for(let e=0;e<n.length;e++)t.element.classList.add(n[e]);t.isNativeElement||d.observeElement(t.element)}removeClass(e){const t=this;if(0===arguments.length)return void t.element.removeAttribute("class");const n=e.split(" ");for(let e=0;e<n.length;e++)t.element.classList.remove(n[e]);""===t.element.className&&t.element.removeAttribute("class"),t.isNativeElement||d.observeElement(t.element)}get isCustomElement(){const e=this;return!!e.element.tagName.startsWith(n)||e.element instanceof window[n].BaseElement==1||"DIV"!==e.element.tagName&&"SPAN"!==e.element.tagName&&"BUTTON"!==e.element.tagName&&"INPUT"!==e.element.tagName&&"UL"!==e.element.tagName&&"LI"!==e.element.tagName&&document.createElement(e.element.nodeName)instanceof window[n].BaseElement==1}get isNativeElement(){return!this.isCustomElement}dispatch(e){const t=this,n=t.events[e.type];let r=!1;if(n.length>1)for(let e=0;e<n.length;e++){const t=n[e];if(t.namespace&&t.namespace.indexOf("_")>=0){r=!0;break}}r&&n.sort((function(e,t){let n=e.namespace,r=t.namespace;return n=-1===n.indexOf("_")?0:parseInt(n.substring(n.indexOf("_")+1)),r=-1===r.indexOf("_")?0:parseInt(r.substring(r.indexOf("_")+1)),n<r?-1:n>r?1:0}));for(let r=0;r<n.length;r++){const o=n[r];if(e.namespace=o.namespace,e.context=o.context,e.defaultPrevented)break;const i=o.handler.apply(t.element,[e]);if(void 0!==i&&(e.result=i,!1===i)){e.preventDefault(),e.stopPropagation();break}}return e.result}fireEvent(e,t,n){const r=this;n||(n={bubbles:!0,cancelable:!0,composed:null!==r.element.getRootNode().host}),n.detail=t||{};const o=new CustomEvent(e,n);return o.originalStopPropagation=o.stopPropagation,o.stopPropagation=function(){return o.isPropagationStopped=!0,o.originalStopPropagation()},r.dispatchEvent(o),o}get isPassiveSupported(){const e=this;if(void 0!==e.supportsPassive)return e.supportsPassive;e.supportsPassive=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e.supportsPassive=!0}});window.addEventListener("testPassive",null,t),window.removeEventListener("testPassive",null,t)}catch(e){}return e.supportsPassive}dispatchEvent(e){const t=this,n=e.type,r=t.element.context,o=n.substring(0,1).toUpperCase()+n.substring(1);t.element.context=document,t.element["on"+o]?t.element["on"+o](e):t.element["on"+n.toLowerCase()]?t.element["on"+n.toLowerCase()](e):t.element.dispatchEvent(e),t.element.context=r}listen(e,t){const n=this,r=e.split("."),o=r.slice(1).join("."),i=r[0];n.events[i]||(n.events[i]=[]);const s={type:i,handler:t,context:n.element,namespace:o};p.indexOf(i)>=0&&(n.inputEvents||(n.inputEvents=new h(n.element)),n.inputEvents[i]((function(e){n.dispatchEvent(e)})),n.inputEvents.boundEventTypes.push(i),n.inputEvents.listen(i)),0===n.events[i].length&&(n.handlers[i]=n.dispatch.bind(n),"wheel"===i?n.element.addEventListener("wheel",n.handlers[i],!!n.isPassiveSupported&&{passive:!1}):"touchmove"===i||"touchstart"===i||"touchend"===i?n.element.addEventListener(i,n.handlers[i],!!n.isPassiveSupported&&{passive:!1}):n.element.addEventListener(i,n.handlers[i],!1)),n.events[i].push(s)}unlisten(e){const t=this,n=e.split("."),r=n.slice(1).join("."),o=n[0];let i=t.events[o];if(t.inputEvents&&t.inputEvents.boundEventTypes.indexOf(o)>=0&&(t.inputEvents.boundEventTypes.splice(t.inputEvents.boundEventTypes.indexOf(o),1),0===t.inputEvents.boundEventTypes.length&&t.inputEvents.unlisten(o)),i){for(let e=0;e<i.length;e++){if(""!==r){let e=i.findIndex((e=>e.namespace===r));i.splice(e,1);break}i=[]}0===i.length&&(t.element.removeEventListener(o,t.handlers[o]),t.events[o]=[],delete t.handlers[o])}}getAttributeValue(e,t){const n=this,r=n.element.getAttribute(e);if(n.isNativeElement)return n.deserialize(r,t);const o=n.element.propertyByAttributeName[e];return void 0===o.deserialize?n.deserialize(r,t,o.nullable):n.element[o.deserialize](r)}setAttributeValue(e,t,n){const r=this;let o,i=!1;if(r.isNativeElement){if(o=r.serialize(t,n),"boolean"===n&&["checked","selected","async","autofocus","autoplay","controls","defer","disabled","hidden","ismap","loop","multiple","open","readonly","required","scoped"].indexOf(e)>=0)return void(t?r.element.setAttribute(e,""):r.element.removeAttribute(e))}else{const s=r.element.propertyByAttributeName[e];i=!s||s.nullable,o=s&&s.serialize?r.element[s.serialize](t):r.serialize(t,n,i)}"array"!==n&&"object"!==n||"[]"!==o&&"{}"!==o?void 0===o?(r.element.removeAttribute(e),r.element.shadowRoot&&r.element.$.root&&r.element.$.root.removeAttribute(e)):(r.element.setAttribute(e,o),r.element.shadowRoot&&r.element.$.root&&r.element.$.root.setAttribute(e,o)):r.element.removeAttribute(e)}serialize(e,t,n){if(void 0===t&&(t=y.Types.getType(e)),void 0!==e&&(n||null!==e)){if(n&&null===e)return"null";if("string"===t)return e;if("boolean"===t||"bool"===t){if(!0===e||"true"===e||1===e||"1"===e)return"";if(!1===e||"false"===e||0===e||"0"===e)return}return"array"===t?JSON.stringify(e):["string","number","int","integer","float","date","any","function"].indexOf(t)>=0?e.toString():"object"===t?JSON.stringify(e):void 0}}deserialize(e,t,n){const r="null"===e;if(void 0!==e&&(!r||n)){if(r&&n)return null;if("boolean"===t||"bool"===t)return null!==e;if("number"===t||"float"===t)return"NaN"===e?NaN:"Infinity"===e?1/0:"-Infinity"===e?-1/0:parseFloat(e);if("int"===t||"integer"===t)return"NaN"===e?NaN:"Infinity"===e?1/0:"-Infinity"===e?-1/0:parseInt(e);if("string"===t)return e;if("any"===t)return e;if("date"===t)return new Date(e);if("function"===t){if("function"==typeof window[e])return window[e]}else if("array"===t||"object"===t)try{const t=JSON.parse(e);if(t)return t}catch(n){if(window[e]&&"object"==typeof window[e])return window[e];if("array"===t&&e.indexOf("[")>=0){if(e.indexOf("{")>=0){let t=e.replace(/{/gi,"").replace("[","").replace("]","").replace(/'/gi,"").replace(/"/gi,"").trim();t=t.split("},");for(let e=0;e<t.length;e++){let n={},r=t[e].trim().split(",");for(let e=0;e<r.length;e++){const t=r[e].split(":")[0].trim(),o=r[e].split(":")[1].trim();n[t]=o}t[e]=n}return t}return e.replace("[","").replace("]","").replace(/'/gi,"").replace(/"/gi,"").trim().split(",")}}}}}class g{static get Ripple(){return i}static get Easings(){return s}}class y{static get Types(){return o}static get Core(){return a}static get Animation(){return g}static get Scroll(){return m}static get InputEvents(){return h}static Extend(e){return new f(e)}static Assign(e,t){if(e.indexOf(".")>=0){const n=e.split(".");return y[n[0]]||(y[n[0]]={}),void(y[n[0]][n[1]]=t)}y[e]=t}}const w=y.Extend(document);let b=null;document.addEventListener("click",(()=>{d.start(),b&&clearTimeout(b),b=setTimeout((()=>{d.stop()}),1e4)})),document.addEventListener("mouseenter",(()=>{d.start()})),document.addEventListener("mouseleave",(()=>{d.stop()}));class v{}v.cache={};class _ extends HTMLElement{static get properties(){return{animation:{value:"advanced",type:"string",allowedValues:["none","simple","advanced"]},unfocusable:{value:!1,type:"boolean"},disabled:{value:!1,type:"boolean"},dataContext:{value:null,reflectToAttribute:!1,type:"any"},debugMode:{value:!0,type:"boolean",reflectToAttribute:!1},locale:{value:"en",type:"string",reflectToAttribute:!1},localizeFormatFunction:{value:null,type:"any",reflectToAttribute:!1},messages:{value:{en:{propertyUnknownName:"Invalid property name: '{{name}}'!",propertyUnknownType:"'{{name}}' property is with undefined 'type' member!",propertyInvalidValue:"Invalid '{{name}}' property value! Actual value: '{{actualValue}}', Expected value: '{{value}}'!",propertyInvalidValueType:"Invalid '{{name}}' property value type! Actual type: '{{actualType}}', Expected type: '{{type}}'!",methodInvalidValueType:"Invalid '{{name}}' method argument value type! Actual type: '{{actualType}}', Expected type: '{{type}}' for argument with index: '{{argumentIndex}}'!",methodInvalidArgumentsCount:"Invalid '{{name}}' method arguments count! Actual arguments count: '{{actualArgumentsCount}}', Expected at least: '{{argumentsCount}}' argument(s)!",methodInvalidReturnType:"Invalid '{{name}}' method return type! Actual type: '{{actualType}}', Expected type: '{{type}}'!",elementNotInDOM:"Element does not exist in DOM! Please, add the element to the DOM, before invoking a method.",moduleUndefined:"Module is undefined.",missingReference:"{{elementType}}: Missing reference to '{{files}}'.",htmlTemplateNotSuported:"{{elementType}}: Web Browser doesn't support HTMLTemplate elements.",invalidTemplate:"{{elementType}}: '{{property}}' property accepts a string that must match the id of an HTMLTemplate element from the DOM."}},reflectToAttribute:!1,inherit:!0,type:"object"},props:{value:null,reflectToAttribute:!1,isHierarchicalProperty:!0,type:"any"},readonly:{value:!1,type:"boolean"},renderMode:{value:"auto",type:"string",reflectToAttribute:!1,allowedValues:["auto","manual"]},rightToLeft:{value:!1,type:"boolean"},rethrowError:{value:!0,type:"boolean",reflectToAttribute:!1},theme:{value:window[n].Theme,type:"string"},visibility:{value:"visible",allowedValues:["visible","collapsed","hidden"],type:"string"},wait:{value:!1,type:"boolean"}}}getBindings(e,t){const n=this;let r=0,o={},i=(e=>{if(e instanceof HTMLElement)return n.parseAttributes(e);{let t=n.parseProperty(e.data?e.data.trim():null,"textContent",e);if(t)return n&&e.parentNode===n.$.content&&(t.value=""!==n.$.html?n.$.html:void 0,n.innerHTML=""),{textContent:t}}})(e);i&&(o.data=i),t||(o.mapping=[],t=o),e.getAttribute&&(o.nodeId=e.getAttribute("smart-id"),t&&i&&(t.mapping[o.nodeId]=i)),o.node=e,e.firstChild&&(o.children={});for(let i=e.firstChild;i;i=i.nextSibling)o.children[r++]=n.getBindings(i,t);return o}_addRemovePropertyBinding(e,t,n,r,o){if(!e||!t||!n)return;const i=this,s=i.bindings,a=n.getAttribute("smart-id"),l=e.indexOf("{{")>=0;let d=!1;(e=e.replace("{{","").replace("}}","").replace("[[","").replace("]]","")).indexOf("!")>=0&&(e=e.replace("!",""),d=!0);const c=i._properties[e],u={name:e,reflectToAttribute:c.reflectToAttribute,twoWay:l,type:c.type,not:d};if(o&&!r){const n={},r={name:e,targetPropertyName:t,reflectToAttribute:c.reflectToAttribute,twoWay:l,type:c.type,not:d};n[e]=r,s.mapping[a]=n}const p=function(e){for(let o in e){const s=e[o];if(s.nodeId===a){s.data||(s.data={}),r?(s.data[t]=null,delete s.data[t]):s.data[t]=u;break}if(s.children)p(s.children);else if(s.node&&s.node.children&&s.node===n.parentElement){const e=s.node;if(!e.firstChild)continue;s.children={};let t=0;for(let n=e.firstChild;n;n=n.nextSibling)s.children[t++]=i.getBindings(n);p(s.children)}}};p(s.children),r?delete i.boundProperties[e]:i.boundProperties[e]=!0,i.updateBoundNodes(e)}addPropertyBinding(e,t,n,r){this._addRemovePropertyBinding(e,t,n,!1,r)}removePropertyBinding(e,t,n,r){this._addRemovePropertyBinding(e,t,n,!0,r)}parseAttributes(e){const t=this;let n;for(let r=0;r<e.attributes.length;r++){const o=e.attributes[r],i=o.name,s=o.value;v.cache["toCamelCase"+i]||(v.cache["toCamelCase"+i]=y.Core.toCamelCase(i));const a=v.cache["toCamelCase"+i];if(i.indexOf("(")>=0){let r=i.substring(1,i.length-1);if(t&&!t.dataContext){t.templateListeners[e.getAttribute("smart-id")+"."+r]=s,e.removeAttribute(i);continue}{n||(n={});const e=s.substring(0,s.indexOf("("));n[a]={isEvent:!0,name:r,value:e};continue}}let l=t.parseProperty(s,i,e);l&&(n||(n={}),n[a]=l)}return n}parseProperty(e,t){if(!e||!e.length)return;const n=this;let r,o=e.length,i=0,s=0,a=0,l=!0;for(;s<o;){i=e.indexOf("{{",s);let t=e.indexOf("[[",s),n="}}";if(t>=0&&(i<0||t<i)&&(i=t,l=!1,n="]]"),a=i<0?-1:e.indexOf(n,i+2),a<0)return;r=r||{};let o=e.slice(i+2,a).trim();r.name=o,s=a+2}const d=r.name,c=n?n._properties[d]:null;return r.twoWay=l,r.ready=!1,n&&(d.indexOf("::")>=0?n.boundProperties[d.substring(0,d.indexOf("::"))]=!0:n.boundProperties[d]=!0),c?(r.type=c.type,r.reflectToAttribute=c.reflectToAttribute):(["checked","selected","async","autofocus","autoplay","controls","defer","disabled","hidden","ismap","loop","multiple","open","readonly","required","scoped"].indexOf(t)>=0?r.type="boolean":r.type="string",r.reflectToAttribute=!0),r}updateTextNodes(){const e=this;e.updateTextNode(e.shadowRoot||e,e.bindings,e)}updateTextNode(e,t,n){const r=this;if(!t)return;let o=0;for(let i=e.firstChild;i&&t.children;i=i.nextSibling)r.updateTextNode(i,t.children[o++],n);if(t&&t.data)for(let e in t.data){const r=t.data[e],o=r.name;"textContent"===e&&r.twoWay&&!r.updating&&void 0!==r.value&&(n[o]=r.value)}}updateBoundProperty(e,t){if(t.updating)return;const n=this;t.updating=!0,n[e]=t.value,t.updating=!1}updateBoundNodes(e){const t=this;if(t.updateBoundNode(t.shadowRoot||t,t.bindings,t,e),t.detachedChildren.length>0)for(let n=0;n<t.detachedChildren.length;n++){const r=t.detachedChildren[n],o=r.getAttribute("smart-id"),i=function(e){if(e.nodeId===o)return e;for(let t in e.children){const n=e.children[t];if((n.getAttribute?n.getAttribute("smart-id"):"")===o)return e;if(n.children){const e=i(n);if(e)return e}}return null},s=i(t.bindings);if(s)t.updateBoundNode(r,s,t,e,!0);else if(r.getAttribute&&t.bindings.mapping){const n=t,r=t.bindings;if(r)for(let o in r.mapping){const i=n.querySelector('[smart-id="'+o+'"]');if(i){const s=r.mapping[o];t.updateBoundData(i,s,n,e)}}}}}updateBoundMappedNodes(){const e=this,t=e.bindings,n=e;if(t.mapping)for(let r in t.mapping){let o=n.querySelector('[smart-id="'+r+'"]');if(n.shadowRoot&&(o=n.querySelector('[id="'+r+'"]'),o||(o=n.shadowRoot.querySelector('[id="'+r+'"]')||n.shadowRoot.querySelector('[smart-id="'+r+'"]'))),o){const i=t.mapping[r];e.updateBoundData(o,i,n)}else if(n.getAttribute("aria-controls")){let i=document.getElementById(n.getAttribute("aria-controls"));if(!i&&n.shadowRoot&&(i=n.shadowRoot.getElementById(n.getAttribute("aria-controls"))),o=i.querySelector('[smart-id="'+r+'"]'),o){const i=t.mapping[r];e.updateBoundData(o,i,n)}}}}updateBoundNode(e,t,n,r,o){const i=this;if(!t)return;let s=0;if(o){if(o&&!t.data)for(let a=e.firstChild;a&&t.children;a=a.nextSibling)if(a.getAttribute){const e=a.getAttribute("smart-id"),o=function(){for(let n in t.children)if(t.children[n].nodeId===e)return t.children[n]}();i.updateBoundNode(a,o,n,r),s++}else i.updateBoundNode(a,t.children[s++],n,r,o)}else for(let o=e.firstChild;o&&t.children;o=o.nextSibling)if(o.getAttribute){const e=o.getAttribute("smart-id"),a=function(){for(let n in t.children)if(t.children[n].nodeId===e)return t.children[n]}();i.updateBoundNode(o,a,n,r),s++}else i.updateBoundNode(o,t.children[s++],n,r);if(!t||!t.data)return;const a=t.data;i.updateBoundData(e,a,n,r)}updateBoundData(e,t,n,r){const o=this;for(let i in t){const s=t[i];let a=s.name;if(!s.updating&&(a.indexOf("::")>=0&&(a=a.substring(0,a.indexOf("::"))),void 0===r||r===a)){if(a.indexOf("(")>=0){let e=a.substring(a.indexOf("("));const t=a.substring(0,a.indexOf("("));if(e=e.substring(1,e.length-1),e=e.replace(/ /gi,""),e=e.split(","),e.length>0&&""!==e[0]){let r=[];for(let t=0;t<e.length;t++)r.push(n[e[t]]);s.value=n[t].apply(n,r)}else s.value=n[t]();s.type=typeof s.value}else s.value=n[a];if("innerHTML"===a){if(e[i].toString().trim()!==n[a].toString().trim()){if(window.smartBlazor&&e[i].indexOf("\x3c!--")>=0){(s.ready||n._properties[a].defaultValue!==s.value)&&(e[i]=s.value.toString());continue}(s.ready||n._properties[a].defaultValue!==s.value)&&(e[i]=s.value.toString().trim())}}else s.not?(e[i]=!s.value,s.targetPropertyName&&(e[s.targetPropertyName]=!s.value)):(e[i]=s.value,s.targetPropertyName&&(e[s.targetPropertyName]=s.value));if(e.$&&e.$.isNativeElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i],n=e.$.getAttributeValue(t,s.type);!s.reflectToAttribute||n===s.value&&s.ready||e.$.setAttributeValue(t,s.value,s.type),s.reflectToAttribute||e.$.setAttributeValue(t,null,s.type)}if(!s.ready){if(e.$&&e.$.isCustomElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i];e._properties||(e._beforeCreatedProperties=e._properties=e.propertyByAttributeName=[]),e._properties[i]||(e._properties[i]={attributeName:t},e._beforeCreatedProperties&&(e._beforeCreatedProperties[i]=e._properties[i]),e.propertyByAttributeName[t]=e._properties[i]);const n=e._properties[i];n.isUpdating=!0,s.reflectToAttribute&&(s.not?e.$.setAttributeValue(n.attributeName,!s.value,s.type):e.$.setAttributeValue(n.attributeName,s.value,s.type)),s.reflectToAttribute||e.$.setAttributeValue(n.attributeName,null,s.type),n.isUpdating=!1}if(s.twoWay){const t=function(t){if(s.value=t,e.$&&e.$.isNativeElement){v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const t=v.cache["toDash"+i],n=e.$.getAttributeValue(t,s.type);s.reflectToAttribute&&n!==s.value&&e.$.setAttributeValue(t,s.value,s.type),s.reflectToAttribute||e.$.setAttributeValue(t,null,s.type)}};if(s.name.indexOf("::")>=0){const n=s.name.indexOf("::"),r=s.name.substring(n+2);o["$"+e.getAttribute("smart-id")].listen(r,(function(){t(e[i]);const n=s.name.substring(0,s.name.indexOf("::"));o.updateBoundProperty(n,s)}))}if(e.$&&e.$.isCustomElement){e._properties[i]&&(e._properties[i].notify=!0),v.cache["toDash"+i]||(v.cache["toDash"+i]=y.Core.toDash(i));const n=v.cache["toDash"+i];o["$"+e.getAttribute("smart-id")].listen(n+"-changed",(function(e){let n=e.detail;t(n.value);const r=o.context;e.context!==document&&(o.context=o),o.updateBoundProperty(s.name,s),o.context=r}))}}}s.ready=!0}}}static clearCache(){this.cache={}}addMessages(e,t){Object.assign(this.messages[e],t)}localize(e,t){const n=this;if(!n.messages||!n.messages[n.locale])return;let r=n.messages[n.locale][e];if(""===r)return"";if(!r){const r=n.messages.en;if(r){let n=r[e];if(n){for(let e in t){let r=t[e];n=n.replace(new RegExp("{{"+e+"}}","g"),r)}return n}return e}}const o=r;for(let e in t){let n=t[e];r=r.replace(new RegExp("{{"+e+"}}","g"),n)}if(n.localizeFormatFunction){const i=n.localizeFormatFunction(o,r,t,e);if(void 0!==i)return i}return r}static get requires(){return{}}static get listeners(){return{"theme-changed":function(e){this.theme=e.detail.newValue}}}static get methods(){return{}}get classNamesMap(){return{animation:"smart-animate",rippleAnimation:"smart-ripple"}}get hasAnimation(){return"none"!==this.animation}get hasRippleAnimation(){return"none"!==this.animation&&"advanced"===this.animation}static get modules(){return window[n].Modules}get properties(){const e=this;return e._properties||(e._properties=[]),e._properties}get parents(){const e=this;let t=[],r=e.parentNode;for(;r&&9!==r.nodeType;)r instanceof HTMLElement==1&&t.push(r),r=r.parentNode;const o=e.getRootNode();if(o.host){const e=e=>{let t=[e],n=e.parentNode;for(;n&&9!==n.nodeType;)n instanceof HTMLElement==1&&t.push(n),n=n.parentNode;return t};t=t.concat(e(o.host))}return window[n].EnableShadowDOM&&e.isInShadowDOM&&e.shadowParent&&(t=t.concat(e.shadowParent.parents)),t}log(e){this._logger("log",e)}warn(e){this._logger("warn",e)}error(e){this._logger("error",e)}_logger(e,t){if(this.debugMode){const n=t instanceof Error?t.message:t.toString();console[e](n)}if(this.rethrowError&&"error"===e)throw t}get focused(){return this.contains(document.activeElement)}template(){return"<div></div>"}registered(){const e=this;e.onRegistered&&e.onRegistered()}created(){const e=this;e.isReady=!1,e._initElement(e),e._setModuleState("created"),e.onCreated&&e.onCreated()}completed(){const e=this;e.isCompleted=!0,e._onCompleted&&e._onCompleted(),e.onCompleted&&e.onCompleted()}whenReady(e){const t=this;t.isCompleted?e():(t.whenReadyCallbacks||(t.whenReadyCallbacks=[]),t.whenReadyCallbacks.push(e))}whenRendered(e){const t=this;t.isRendered?e():(t.whenRenderedCallbacks||(t.whenRenderedCallbacks=[]),t.whenRenderedCallbacks.push(e))}addThemeClass(){const e=this;""!==e.theme&&e.classList.add("smart-"+e.theme)}addDefaultClass(){const e=this;e.classList.add(n.toLowerCase()+"-element"),e.classList.add(e.nodeName.toLowerCase())}_renderShadowRoot(){const e=this;if(e.shadowRoot){e.$.root.classList.add(e.nodeName.toLowerCase());for(let t=0;t<e.attributes.length;t++){const n=e.attributes[t];"class"===n.name||"id"===n.name||"style"===n.name||"tabindex"===n.name||n.name.indexOf("aria")>=0||e.$.root.setAttribute(n.name,n.value)}for(let t=0;t<e.classList.length;t++){const n=e.classList[t];"smart-element-init"!==n&&"smart-element"!==n&&"smart-hidden"!==n&&"smart-visibility-hidden"!==n&&e.$.root.classList.add(n)}}}render(){const e=this;if(!e.isRendered&&(e.isRendered=!0,e.isRendering=!1,e.context=document,e._renderShadowRoot(),e.whenRenderedCallbacks)){for(let t=0;t<e.whenRenderedCallbacks.length;t++)e.whenRenderedCallbacks[t]();e.whenRenderedCallbacks=[]}e.onRender&&e.onRender(),e.disabled&&e.setAttribute("aria-disabled",!0),e.readonly&&-1!==["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox"].indexOf(e.getAttribute("role"))&&e.setAttribute("aria-readonly",!0)}ready(){const e=this;if(e._setId(),e.addThemeClass(),e.addDefaultClass(),"collapsed"===e.visibility?e.classList.add("smart-hidden"):"hidden"===e.visibility&&e.classList.add("smart-visibility-hidden"),e.dataContext&&e.applyDataContext(),e.onReady&&e.onReady(),e.shadowRoot&&Smart(e._selector)){if(Smart(e._selector).styleUrls){const t=Smart(e._selector).styleUrls;for(let n=0;n<t.length;n++)e.importStyle(t[n])}if(Smart(e._selector).styles){const t=document.createElement("style");t.innerHTML=Smart(e._selector).styles,e.shadowRoot.insertBefore(t,e.shadowRoot.firstChild)}}Smart(e._selector)&&Smart(e._selector).ready&&Smart(e._selector).ready()}_setId(){const e=this;if(!e.id){const t=e.elementName;e.id=t.slice(0,1).toLowerCase()+t.slice(1)+Math.floor(65536*(1+Math.random())).toString(16).substring(1)}}checkLicense(){const e=this;"Evaluation"===window[n].License&&-1===window.location.hostname.indexOf("htmlelements")&&(e.logWatermark(),e.logLicense(),window[n].License="")}logWatermark(){const e=document.createElement("a");e.href="https://www.htmlelements.com/",e.innerHTML="https://www.htmlelements.com/",e.style.position="absolute",e.style.right="5px",e.style.bottom="5px",e.style.color="#fff",e.style.padding="20px",e.style.borderRadius="5px",e.style.background="#0C3D78",e.style.cursor="pointer",e.style.zIndex="999999",e.style.display="block",e.style.fontSize="24px",e.style.textDecoration="none",e.style.fontWeight="bold",e.style.opacity=0,e.style.transition="opacity .35s ease-in-out",e.id="watermark",document.getElementById("watermark")||setTimeout((()=>{document.getElementById("watermark")||(document.body.appendChild(e),setTimeout((()=>{e.style.opacity=1})),setTimeout((()=>{e.style.opacity=0,setTimeout((()=>{e.parentNode.removeChild(e)}),350)}),6e3))}),1e3)}logLicense(){console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("*jQWidgets License Key Not Found."),console.log("*This is an EVALUATION only Version, it is NOT Licensed for software projects intended for PRODUCTION."),console.log("*if you want to hide this message, please send an email to: sales@jqwidgets.com for a license."),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************"),console.log("****************************************************************************************************************")}get _selector(){const e=this;return e.id?"#"+e.id:e.classList.length>0?"."+e.classList[0]:""}applyDataContext(e){const t=this;let n="string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext;if(e&&(n=e,t.dataContext=e),n){if(!n._uid){n._uid=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase(),n._properties=[];for(let e in n){const r=n[e];"function"!=typeof r&&"_properties"!==e&&"_uid"!==e&&(n._properties[e]=r,Object.defineProperty(n,e,{configurable:!1,enumerable:!0,get:()=>n._properties[e],set(r){const o=n._properties[e];n._properties[e]=r;let i=[];i[e]={oldValue:o,value:r},i.length++,t.updatingDataContext=!0,w.fireEvent("dataContextPropertyChanged",{dataContext:n,properties:i},{bubbles:!1,cancelable:!0}),t.updatingDataContext=!1}}))}}if(t.dataContextProperties=t.parseAttributes(t),t.dataContextPropertiesMap={},t.dataContextListeners={},t.dataContextProperties){t.updatingDataContext=!0;for(let e in t.dataContextProperties){const r=t.dataContextProperties[e],o=r.name;if(r.propertyName=e,t.dataContextPropertiesMap[o]=e,v.cache["toDash"+e]||(v.cache["toDash"+e]=y.Core.toDash(o)),r.isEvent){const e=r.value;t.dataContextListeners[o]&&t.removeEventListener(o,t.dataContextListeners[o]),t.dataContextListeners[o]=function(t){n[e](t)},t.addEventListener(o,t.dataContextListeners[o])}if(o.indexOf(".")>=0){const r=o.split(".");let i=n[r[0]];for(let e=1;e<r.length;e++)i=i[r[e]];void 0!==i&&(t[e]=i)}else t[e]=n[o]}t.dataContextPropertyChangedHandler=function(e){const n=e.detail.properties;if(e.detail.dataContext===("string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext))for(let e in n){const r=t.dataContextPropertiesMap[e],o=t.context;r&&(t.context=document,t[r]=n[e].value,t.context=o)}},w.listen("dataContextPropertyChanged",t.dataContextPropertyChangedHandler),t.updatingDataContext=!1}else t.dataContextProperties=null}else{t.dataContextProperties=null;const e=function(){("string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext)&&(t.applyDataContext(),window.removeEventListener("load",e))};window.addEventListener("load",e)}}updateDataContextProperty(e){const t=this,n="string"==typeof t.dataContext?window[t.dataContext]||document[t.dataContext]:t.dataContext,r=t.dataContextProperties[e];if(!t.updatingDataContext&&r.twoWay){const o=r.name;if(o.indexOf(".")>=0){const r=o.split(".");let i=n[r[0]];for(let e=1;e<r.length;e++)i=i[r[e]];void 0!==i&&(i=t[e],c[n._uid]&&(c[n._uid][e]=i))}else n[o]=t[e],c[n._uid]&&(c[n._uid][e]=n[o])}}static get version(){return window[n].Version}initProperties(){const e=this;if(Smart(e._selector)&&Smart(e._selector).properties&&(e._initProperties=Smart(e._selector).properties),e.hasAttribute("props")&&!e.props?e._initProperties=window[e.getAttribute("props")]:e.props&&(e._initProperties=e.props),e._initProperties){const t=Object.keys(e._initProperties);for(let n=0;n<t.length;n++){const r=t[n],o=e._initProperties[r];if(void 0!==o){if(o.constructor===Smart.ObservableArray||o instanceof Smart.ObservableArray){e[r]=o.toArray();continue}if(o.constructor===Smart.DataAdapter||"smartDataAdapter"===o.constructor.name||"object"==typeof o&&Smart.DataAdapter&&o instanceof Smart.DataAdapter||o instanceof Smart.Observable||o.constructor===Smart.Observable||"object"!=typeof o||y.Types.isArray(o)||o instanceof Date){if(void 0===e[r]&&-1===["onReady","onAttached","onDetached","onCreated","onCompleted"].indexOf(r)){const t=e.localize("propertyUnknownName",{name:r});e.log(t)}e[r]=o;continue}}if("messages"!==r)if("dataSourceMap"!==r&&"rowCSSRules"!==r){if(o&&"object"==typeof o){const t=function(n,r){const o=Object.keys(n);for(let i=0;i<o.length;i++){const s=o[i],a=n[s],l=e._properties[r+"_"+s];if(l&&null===l.value){if(void 0===e[r+"_"+s]){const t=e.localize("propertyUnknownName",{name:r+"_"+s});e.log(t)}e[r+"_"+s]=a}else if("object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date)t(a,r+"_"+s);else{if(void 0===e[r+"_"+s]){const t=e.localize("propertyUnknownName",{name:r+"_"+s});e.log(t)}e[r+"_"+s]=a}}};t(o,r)}}else e[r]=o;else e[r]=Object.assign(e[r],o)}}}setProperties(e){const t=this,n=Object.keys(e);for(let r=0;r<n.length;r++){const o=n[r],i=e[o];if(i.constructor===Smart.ObservableArray||i instanceof Smart.ObservableArray)t[o]=i.toArray();else if(i.constructor===Smart.DataAdapter||"smartDataAdapter"===i.constructor.name||"object"==typeof i&&Smart.DataAdapter&&i instanceof Smart.DataAdapter||i instanceof Smart.Observable||i.constructor===Smart.Observable||"object"!=typeof i||y.Types.isArray(i)||i instanceof Date){if(void 0===t[o]&&-1===["onReady","onAttached","onDetached","onCreated","onCompleted"].indexOf(o))continue;const e=t._properties[o];"int"===e.type||"number"===e.type&&"string"==typeof subPropertyValue?"int"===e.type?t[o]=parseInt(i):t[o]=parseFloat(i):t[o]=i}else if("messages"!==o&&"dataSourceMap"!==o){if("object"==typeof i){const e=function(n,r){const o=Object.keys(n);for(let i=0;i<o.length;i++){const s=o[i],a=n[s],l=t._properties[r+"_"+s];if(l&&null===l.value){if(void 0===t[r+"_"+s])continue;const e=t._properties[r+"_"+s];"int"===e.type||"number"===e.type&&"string"==typeof a?"int"===e.type?t[r+"_"+s]=parseInt(a):t[r+"_"+s]=parseFloat(a):t[r+"_"+s]=a}else if("object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date)e(a,r+"_"+s);else{if(void 0===t[r+"_"+s])continue;const e=t._properties[r+"_"+s];"int"===e.type||"number"===e.type&&"string"==typeof a?"int"===e.type?t[r+"_"+s]=parseInt(a):t[r+"_"+s]=parseFloat(a):t[r+"_"+s]=a}}};e(i,o)}}else t[o]=i}}setup(){const e=this;if(e.context=this,e.isReady&&!e.isCompleted)return;if(e.isReady)return e._setModuleState("attached"),e.isAttached=!0,e.attached(),e._handleListeners("listen"),void(e.context=document);e.ownerElement&&e.ownerElement.detachedChildren.indexOf(e)>=0&&e.ownerElement.detachedChildren.splice(e.ownerElement.detachedChildren.indexOf(e),1),e.isReady=!0,e.methods=e.getStaticMember("methods"),e.initProperties(),a.isMobile&&e.classList.add("smart-mobile");for(let t=0;t<e.attributes.length;t+=1){const n=e.propertyByAttributeName[e.attributes[t].name];if(!n)continue;let r=e.$.getAttributeValue(n.attributeName,n.type);const o=r?r.toString():"";if(!(o.indexOf("{{")>=0||o.indexOf("[[")>=0||"object"!==n.type&&"array"!==n.type&&(e.attributes[t].value.indexOf("{{")>=0||e.attributes[t].value.indexOf("[[")>=0)||void 0===r||n.value===r)){const o=y.Types.getType(r),i=e.attributes[t].value;if(("any"===n.type||"object"===n.type)&&""+e[n.name]===r)continue;if("array"===n.type&&e[n.name]&&JSON.stringify(e[n.name])===r)continue;if("number"===o&&isNaN(r)&&"NaN"!==i&&"Infinity"!==i&&"-Infinity"!==i){const t=e.localize("propertyInvalidValueType",{name:n.name,actualType:"string",type:n.type});e.log(t)}n.isUpdatingFromAttribute=!0,e[n.name]=r,n.isUpdatingFromAttribute=!1}}for(let t in e._properties){const n=e._properties[t];if("innerHTML"===t&&n.value===n.defaultValue&&(n.value=n.defaultValue=y.Core.html(e)),"boolean"!==n.type&&"bool"!==n.type||"false"===e.getAttribute(n.attributeName)&&(n.isUpdating=!0,e.setAttribute(n.attributeName,""),n.isUpdating=!1),n.defaultReflectToAttribute&&n.reflectToAttribute){if(n.defaultReflectToAttribute&&n.defaultReflectToAttributeConditions){let t=!0;for(let r=0;r<n.defaultReflectToAttributeConditions.length;r++){const o=n.defaultReflectToAttributeConditions[r];let i,s;for(let e in o)i=e,s=o[e];e._properties[i]&&e._properties[i].value!==s&&(t=!1)}if(!t)continue}n.isUpdating=!0,e.$.setAttributeValue(n.attributeName,n.value,n.type),n.isUpdating=!1}}const t=[];if(e.children.length>0)for(let n=0;n<e.children.length;n++){const r=e.children[n];y.Extend(r).isCustomElement&&t.push(r)}e.applyTemplate(),e.complete=function(){if(!e.templateBindingsReady){const t=e=>{e.templateBindingsReady||(e.templateBindingsReady=!0,e.updateTextNodes(),e.updateBoundNodes())};if(e.ownerElement){let n=e.ownerElement,r=[];for(;n;)r.push(n),n=n.ownerElement;for(let e=r.length-1;e>=0;e--)t(r[e]);t(e)}else t(e)}const t=()=>{if(e._setModuleState("ready"),e.ready(),"auto"!==e.renderMode||e.isRendered||e.render(),e.isAttached=!0,e._setModuleState("attached"),e.attached(),e._handleListeners("listen"),e.isHidden||0!==e.offsetWidth&&0!==e.offsetHeight||(e.isHidden=!0),e.completed(),e.isRendered&&(e.context=document),e.whenReadyCallbacks){for(let t=0;t<e.whenReadyCallbacks.length;t++)e.whenReadyCallbacks[t]();e.whenReadyCallbacks=[]}};if(e.wait)e.classList.add("smart-visibility-hidden");else if(e.classList.contains("smart-async"))requestAnimationFrame((()=>{t()}));else{const n=e.shadowParent;e.shadowParent=null;const r=e.parents;if(e.shadowParent=n,0===r.length)return;const o=()=>{let t=e.ownerElement,n=[];for(;t;)n.push(t),t=t.ownerElement;for(let e=n.length-1;e>=0;e--)n[e].updateBoundMappedNodes()};e.ownerElement&&"HTML"!==r[r.length-1].nodeName?e.getRootNode().host?t():e.ownerElement&&"HTML"===e.ownerElement.parents[e.ownerElement.parents.length-1].nodeName?(o(),t()):e.checkIsInDomInterval=setInterval((()=>{const n=e.parents;"HTML"===n[n.length-1].nodeName&&(clearInterval(e.checkIsInDomInterval),o(),t())}),100):t()}};let r=[].slice.call(e.querySelectorAll("[smart-id]")).concat(t);if(window[n].EnableShadowDOM&&!0!==e.isInShadowDOM&&(r=[].slice.call(e.shadowRoot.querySelectorAll("[smart-id]")).concat(t)),0===r.length)e.complete();else{e._completeListeners=0;for(let t=0;t<r.length;t++){const n=r[t];if(y.Extend(n).isCustomElement){const t=function(){e._completeListeners--,0===e._completeListeners&&(e.complete(),delete e._completeListeners)}.bind(e);n.isCompleted||n.isUtilityElement||!0===n.wait||(e._completeListeners++,n._onCompleted||(n.completeHandlers=[],n._onCompleted=function(){for(let e=0;e<n.completeHandlers.length;e++)n.completeHandlers[e]()}),n.completeHandlers.push(t))}}0===e._completeListeners&&e.complete()}}visibilityChangedHandler(){const e=this;e.isReady&&requestAnimationFrame((()=>{0===e.offsetWidth||0===e.offsetHeight?e.isHidden=!0:(e.isHidden=!1,e.$.fireEvent("resize",e,{bubbles:!1,cancelable:!0}))}))}attributeChangedCallback(e,t,n){const r=this,o=r.propertyByAttributeName[e];if("class"!==e&&"style"!==e||r.visibilityChangedHandler(),o||r.attributeChanged(e,t,n),r.onAttributeChanged&&r.onAttributeChanged(e,t,n),!o||o&&o.isUpdating)return;let i=r.$.getAttributeValue(o.attributeName,o.type);void 0!==n&&r[o.name]!==i&&(o.isUpdatingFromAttribute=!0,r[o.name]=void 0!==i?i:r._properties[o.name].defaultValue,o.isUpdatingFromAttribute=!1)}attributeChanged(e,t,n){}set hasStyleObserver(e){const t=this;void 0===t._hasStyleObserver&&(t._hasStyleObserver=e),e?d.watch(t):d.unwatch(t)}get hasStyleObserver(){const e=this;return void 0===e._hasStyleObserver||e._hasStyleObserver}attached(){const e=this;e.hasStyleObserver&&d.watch(e),e.onAttached&&e.onAttached(),Smart(e._selector)&&Smart(e._selector).attached&&Smart(e._selector).attached()}detached(){const e=this;e.hasStyleObserver&&d.unwatch(e),e._setModuleState("detached"),e.isAttached=!1,e.ownerElement&&-1===e.ownerElement.detachedChildren.indexOf(e)&&e.ownerElement.detachedChildren.push(e),e._handleListeners("unlisten"),e.onDetached&&e.onDetached(),Smart(e._selector)&&Smart(e._selector).detached&&Smart(e._selector).detached(),u&&u[e._selector]&&delete u[e._selector]}propertyChangedHandler(e,t,n){const r=this;t!==n&&("theme"===e&&(""!==t&&r.classList.remove("smart-"+t),""!==n&&r.classList.add("smart-"+n)),"visibility"===e?("collapsed"===t?r.classList.remove("smart-hidden"):"hidden"===t&&r.classList.remove("smart-visibility-hidden"),"collapsed"===n?r.classList.add("smart-hidden"):"hidden"===n&&r.classList.add("smart-visibility-hidden")):("disabled"===e||"readonly"===e)&&r._ariaPropertyChangedHandler(e,n),r.propertyChanged&&r.propertyChanged(e,t,n))}_ariaPropertyChangedHandler(e,t){const n=this;"readonly"===e&&-1===["checkbox","combobox","grid","gridcell","listbox","radiogroup","slider","spinbutton","textbox"].indexOf(n.getAttribute("role"))||(t?n.setAttribute("aria-"+e,!0):n.removeAttribute("aria-"+e))}_handleListeners(e){const t=this,n=t.tagName.toLowerCase(),r=r=>{for(let o in r){const i=o.split(".");let s=i[0],a=t.$;if(i[1])if(s=i[1],a=t["$"+i[0]],"document"===i[0]){let e=t.smartId;""===e&&(e=y.Core.toCamelCase(n)),s=s+"."+e}else t.smartId&&(s=s+"."+t.smartId+"_"+t.parents.length);else t.smartId&&(s=s+"."+t.smartId);const l=r[o],d=function(e){const n=t.context;t.context=t,t[l]&&t[l].apply(t,[e]),t.context=n};a&&a[e](s,d)}};r(t.getStaticMember("listeners")),r(t.templateListeners),Smart(t._selector)&&Smart(t._selector).properties&&r(Smart(t._selector).listeners)}parseTemplate(){const e=this,n=e.template(),o=document.createDocumentFragment();if(t[e.nodeName]&&!r)return t[e.nodeName].cloneNode(!0);if(""===n)return null;let i=document.createElement("div");o.appendChild(i),i.innerHTML=n;let s=i.childNodes;i.parentNode.removeChild(i);for(let e=0;e<s.length;e++)o.appendChild(s[e]);return t[e.nodeName]=o,r?o:o.cloneNode(!0)}applyTemplate(){const e=this,t=e.parseTemplate();if(!t)return;if(!t.hasChildNodes)return;const n=t.childNodes[0],r=(t,n)=>{e["$"+t]=n.$=y.Extend(n),e.$[t]=n,n.ownerElement=e};let o=n;if(n.getElementsByTagName("content").length>0){let e=n.getElementsByTagName("content")[0];o=e.parentNode,o.removeChild(e)}else{const e=t.querySelectorAll("[inner-h-t-m-l]");e&&e.length>0&&(o=e[0])}e.$.template="template"===n.nodeName.toLowerCase()?n:n.querySelector("template");let i=t.querySelectorAll("[id]");0===i.length&&(i=t.querySelectorAll("*")),r("root",n),r("content",o),e.$.html=e.innerHTML.toString().trim();for(let t=0;t<i.length;t+=1){let n=i[t];""===n.id&&(n.id="child"+t),r(n.id,n),n.setAttribute("smart-id",n.id),e.shadowRoot?n.shadowParent=e:n.removeAttribute("id")}for(!1!==e.hasTemplateBindings?e.bindings=e.getBindings(t):e.bindings=[],e.$root.addClass("smart-container");e.childNodes.length;)o.appendChild(e.firstChild);if(e.appendTemplate(t),e.$.template){const t=document.createElement("div");t.classList.add("smart-template-container"),e.$.templateContainer=t,e.$.template.parentNode.insertBefore(t,e.$.template),e.refreshTemplate()}}refreshTemplate(){const e=this;if(!e.$.templateContainer)return;e.templateDetached(e.$.templateContainer);const t=e.$.template.content.cloneNode(!0);e.templateBindings=e.getBindings(t),e.templateProperties=[];let n=document.createDocumentFragment();const r=function(t,n,o){for(let i in t){const s=t[i],a=s.node.cloneNode();n.appendChild(a);let l=[],d=!1;if(s.data)for(let t in s.data){const r=s.data[t],i=r.name;if(e.templateProperties[i]=!0,a.removeAttribute(y.Core.toDash(t)),"*items"===t)l=e[i],d=!0;else if(i.indexOf("item.")>=0&&void 0!==o)r.value=o[i.substring("item.".length)],a[t]=r.value;else if(i.indexOf("item")>=0&&void 0!==o)r.value=o,a[t]=r.value;else if("*if"===t)if(i.indexOf("(")>=0){let t,r=i.substring(i.indexOf("("));const o=i.substring(0,i.indexOf("("));if(r=r.substring(1,r.length-1),r=r.replace(/ /gi,""),r=r.split(","),r.length>0&&""!==r[0]){let n=[];for(let t=0;t<r.length;t++)n.push(e[r[t]]);t=e[o].apply(e,n)}else t=e[o]();!1===t&&n.removeChild(a)}else e[i]||n.removeChild(a);else e.updateBoundNode(a,s,e,i)}if(l.length>0||d){for(let e=0;e<l.length;e++)s.children&&r(s.children,a,l[e]);if("number"==typeof l)for(let e=0;e<l;e++)s.children&&r(s.children,a,e)}else s.children&&r(s.children,a,o)}};r(e.templateBindings.children,n),e.$.templateContainer.innerHTML="",e.$.templateContainer.appendChild(n),e.templateAttached(e.$.templateContainer)}templateAttached(){}templateDetached(){}appendTemplate(e){this.appendChild(e)}defineElementModules(){const e=this,t=e.constructor.prototype;if("BaseElement"===t.elementName){t.modules=e.constructor.modules;const n=t.modules;for(let t=0;t<n.length;t+=1)e.addModule(n[t])}else{const n=t.modules;if(!n)return;for(let t=0;t<n.length;t+=1){const r=n[t],o=r.prototype;e.defineElementMethods(o.methodNames,o),e.defineElementProperties(r.properties)}}}watch(e,t){const n=this;n._watch=null!==e&&null!==t?{properties:e,propertyChangedCallback:t}:null}unwatch(){this._watch=null}set(e,t,n){const r=this,o=r.context;r.context=!0===n?document:r,r[e]=t,r.context=o}get(e){return this[e]}_setModuleState(e,t){const n=this,r="is"+e.substring(0,1).toUpperCase()+e.substring(1),o="on"+e.substring(0,1).toUpperCase()+e.substring(1);for(let i=0;i<n.modulesList.length;i++){const s=n.modulesList[i];s[r]=!0,s[e]&&s[e](t),s[o]&&s[o](t)}}addModule(e,t){const n=this;if(!e)return;const r=n.modules.slice(0),o=e.prototype,i=Object.getPrototypeOf(e);if(i.name&&i.name!==e.name&&n.addModule(i),!e.moduleName&&e.name&&(e.moduleName=e.name),-1===r.findIndex((t=>e.moduleName===t.moduleName))&&r.push(e),n.defineModule(e),n.defineElementMethods(o.methodNames,o),n.defineElementProperties(e.properties),n.constructor.prototype.modules=r,t)for(let t in Smart.Elements.tagNames){const r=Smart.Elements.tagNames[t];let o=Object.getPrototypeOf(r),i=[];for(;o!==HTMLElement;)i.push(o.prototype),o=Object.getPrototypeOf(o);i.indexOf(n)>=0&&r!==n&&r.prototype.addModule(e)}}defineModule(e){if(e.isDefined)return;e.prototype._initModule=function(e){this.ownerElement=e};const t=e.properties||{},n=Object.keys(t),r=Object.getOwnPropertyNames(e.prototype);e.prototype.methodNames=r;for(let r=0;r<n.length;r+=1){const o=n[r],i=t[o];Object.defineProperty(e.prototype,o,{configurable:!1,enumerable:!0,get(){return this.ownerElement?this.ownerElement[o]:i.value},set(e){this.ownerElement[o]=e}})}e.isDefined=!0}getStaticMember(e,t){const r=window[n][this.elementName],o=r[e];t||(t="");let i="array"===t?[]:"string"===t?"":{},s=Object.getPrototypeOf(r),a=[];for(;s[e];)a.push(s[e]),s=Object.getPrototypeOf(s);for(let e=a.length-1;e>=0;e--)if("array"===t)for(let t=0;t<a[e].length;t++)-1===i.indexOf(a[e][t])&&i.push(a[e][t]);else"string"===t?-1===i.indexOf(a[e])&&(i+=a[e]):i=y.Core.assign(i,a[e]);if("array"===t){for(let e=0;e<o.length;e++)-1===i.indexOf(o[e])&&i.push(o[e]);return i}return"string"===t?(-1===i.indexOf(o)&&(i+=o),i):y.Core.assign(i,o)}defineElementHierarchicalProperties(e,t){const n=this,r=[];!function(e){const n=Object.keys(e);for(let o=0;o<n.length;o++){const i=n[o];if("messages"===i)continue;const s=e[i],a=Object.keys(s),l=a.indexOf("value")>=0&&a.indexOf("type")>=0&&"object"==typeof s.value;if("propertyObject"===s.type||l){const e=function(n,o){if(!n.value)return;const i=Object.keys(n.value);for(let s=0;s<i.length;s++){const a=i[s],l=n.value[a],d=o+"_"+a;if("object"!=typeof l||null===l)break;const c=Object.keys(l);if(!(c.indexOf("value")>=0&&c.indexOf("type")>=0))break;if("array"!==n.type&&(n.isHierarchicalProperty=!0),l.parentPropertyName=o,t){const e=t._properties[d];if(n.value.hasOwnProperty(a)){if(e.isDefined)continue;delete n.value[a]}e.isDefined=!0,Object.defineProperty(n.value,a,{configurable:!1,enumerable:!0,get:()=>t._properties[d].value,set(e){t.updateProperty(t,t._properties[d],e)}})}r[d]||(r[d]=l,r.length++),("propertyObject"===l.type||"object"==typeof l.value&&"array"!==l.type)&&e(t?t._properties[d]:l,d)}};e(s,i)}}}(e),r.length>0&&!t&&n.defineElementProperties(r)}defineElement(){const e=this,t=e.constructor.prototype,n=e.getStaticMember("properties"),r=Object.getOwnPropertyNames(t);t.extendedProperties={},t.boundProperties={},t.templateListeners={},e.defineElementModules(),e.defineElementMethods(r,t),e.defineElementProperties(n),e.defineElementHierarchicalProperties(e.extendedProperties),t._initElement=function(){const e=this,n=t.extendedProperties,r=Object.keys(n),o=e.modules;e.$=y.Extend(e),e.$document=w,e.smartId=(Date.now().toString(36)+Math.random().toString(36).substr(2,5)).toUpperCase(),e.isCreated||(e.modulesList=[],e._properties=[],e._beforeCreatedProperties&&(e._properties=e._beforeCreatedProperties,delete e._beforeCreatedProperties),e.detachedChildren=[],e.propertyByAttributeName=[]);for(let t=0;t<o.length;t+=1){let n=new(0,o[t]);n._initModule(e),e.modulesList.push(n)}for(let t=0;t<r.length;t+=1){const o=r[t],i=n[o];let s=i.value;if(e._properties[o]){if(void 0!==e._properties[o].notify)continue;delete e._properties[o]}if(E&&"innerHTML"===o&&delete e[o],-1===window.navigator.userAgent.indexOf("PhantomJS")&&e.hasOwnProperty(o)&&(s=e[o],delete e[o]),"array"===i.type&&null!=s&&(s=s.slice(0)),"object"===i.type&&null!=s&&(s=Array.isArray(s)?s.slice(0):Object.assign({},s)),e._properties[o]={name:o,notify:i.notify,allowedValues:i.allowedValues,type:i.type,nullable:i.nullable,reflectToAttribute:i.reflectToAttribute,defaultReflectToAttribute:i.defaultReflectToAttribute,defaultReflectToAttributeConditions:i.defaultReflectToAttributeConditions,value:s,readOnly:i.readOnly,defaultValue:s,attributeName:i.attributeName,observer:i.observer,inherit:i.inherit,extend:i.extend,validator:i.validator},e.propertyByAttributeName[i.attributeName]=e._properties[o],!i.hasOwnProperty("type")){const t=e.localize("propertyUnknownType",{name:o});e.log(t)}if("any"===i.type||"propertyObject"===i.type)continue;const a=y.Types.getType(s);if(null!=s&&i.type!==a&&!i.validator){if("object"===i.type&&"array"===a)continue;if("number"===a&&["integer","int","float"].findIndex((e=>e===i.type))>=0)continue;const t=e.localize("propertyInvalidValueType",{name:o,actualType:a,type:i.type});e.log(t)}}e.defineElementHierarchicalProperties(e._properties,e),e.isCreated=!0},t.registered()}defineElementMethods(e,t){const n=this.constructor.prototype,r=function(e,t){const n=Array.prototype.slice.call(arguments,2),r=function(){if(!this.isReady&&"localize"!==t&&"localize"!==t&&"cloneNode"!==t&&"importStyle"!==t&&"log"!==t&&"parseAttributes"!==t){const e=this.localize("elementNotInDOM");this.log(e)}let r=this;for(let e=0;e<this.modulesList.length;e++){let n=this.modulesList[e];if(t in n){r=n;break}}const o=this.context,i=n.concat(Array.prototype.slice.call(arguments));let s=null;const a=function(e,t){return e===t||"number"===e&&("int"===t||"integer"===t||"float"===t)||"bool"===e&&"boolean"===t||"boolean"===e&&"bool"===t||"object"===e&&"any"===t||void 0};if(this.methods){const e=this.methods[t];if(e){const n=e.split(":");s=n[n.length-1].trim();const r=[],o=e.substring(1+e.indexOf("("),e.lastIndexOf(")")).split(",");let l="";for(let e=0;e<o.length;e++){const t=o[e];l+=t,t.indexOf(":")>=0?(r.push(l),l=""):l+=","}let d=r.length;for(let e=0;e<r.length;e++){const n=r[e].trim().split(":"),o=n[0].split("=")[0].trim().indexOf("?")>=0,s=n[1].indexOf("?")>=0,l=n[1].replace(/\?/gi,"").trim(),c=l.split("|");let u=n[0].split("=")[1];const p=y.Types.getType(i[e]);if(void 0===i[e]&&u){switch(u=u.trim(),l[0]){case"date":{let e=u.substring(u.indexOf("(")+1,u.lastIndexOf(")"));e=e.length>0?e.split(",").map((e=>parseInt(e))):[],u=0===e.length?new Date:new Date(e[0],e[1],e[2]);break}case"bool":case"boolean":u="true"===u||"1"===u;break;case"int":case"integer":u=parseInt(u);break;case"float":case"number":u=parseFloat(u);break;case"any":case"object":u=u.indexOf("{")>=0?JSON.parse(u):u}i.push(u)}else o&&d--;if(l!==p&&p){let n=!0;for(let e=0;e<c.length;e++)if(a(p,c[e])){n=!1;break}if(n&&(null!==i[e]||!s)){const n=this.localize("methodInvalidValueType",{name:t,actualType:p,type:l,argumentIndex:e});this.log(n)}}if(i.length<d){const e=this.localize("methodInvalidArgumentsCount",{name:t,actualArgumentsCount:i.length,argumentsCount:d});this.log(e)}}}}this.context=this;const l=e.apply(r,i);if(s){const e=void 0===y.Types.getType(l)?"void":y.Types.getType(l);if(!a(e,s)){const n=this.localize("methodInvalidReturnType",{name:t,actualType:e,type:s});this.log(n)}}return this.context=o,l};return r},o=["constructor","ready","created","render","attached","detached","appendChild","insertBefore","removeChild","connect","disconnectedCallback","connectedCallback","attributeChangedCallback","propertyChangedHandler","enableShadowDOM","isInShadowDOM","addPropertyBindings"];for(let i in e){let s=e[i];s&&s.startsWith&&s.startsWith("_")||void 0!==o.find((e=>e===s))||n.extendedProperties[s]||y.Types.isFunction(t[s])&&(n[s]=r(t[s],s))}}defineElementProperties(e){if(!e)return;const t=this,n=t.constructor.prototype,r=Object.keys(e),o=t.getStaticMember("properties");Object.assign(n.extendedProperties,e),t.updateProperty=function(e,t,n){const r=e;if(!t||t.readOnly)return;if(t.allowedValues){let e=!1;for(let r=0;r<t.allowedValues.length;r++)if(t.allowedValues[r]===n){e=!0;break}if(!e){const e=JSON.stringify(t.allowedValues).replace(/\[|\]/gi,"").replace(",",", ").replace(/"/gi,"'"),o="'"+n+"'",i=r.localize("propertyInvalidValue",{name:t.name,actualValue:o,value:e});return void r.log(i)}}const o=t.name,i=r._properties[o].value;if(t.validator&&r[t.validator]){const e=r.context;r.context=r;const o=r[t.validator](i,n);void 0!==o&&(n=o),r.context=e}if(i!==n){if(r.propertyChanging){const e=r.propertyChanging(o,i,n);if(!1===e||null===e)return}if(!t.hasOwnProperty("type")){const e=r.localize("propertyUnknownType",{name:o});r.log(e)}if("array"!==t.type||JSON.stringify(i)!==JSON.stringify(n)){if(null!=n&&"any"!==t.type&&"propertyObject"!==t.type&&t.type!==y.Types.getType(n)&&!t.validator||null===n&&!t.nullable){let e=!0;if("object"===t.type&&"array"===y.Types.getType(n)&&(e=!1),"number"===y.Types.getType(n)&&["integer","int","float"].findIndex((e=>e===t.type))>=0&&(e=!1),e){const e=r.localize("propertyInvalidValueType",{name:o,actualType:y.Types.getType(n),type:t.type});return void r.error(e)}}if(t.isUpdating=!0,t.isHierarchicalProperty){const e=function(t,n){if(!t)return;const o=Object.keys(t);for(let i=0;i<o.length;i++){const s=o[i],a=t[s];"object"==typeof a&&!y.Types.isArray(a)&&a&&a.constructor!==Date?e(a,n+"_"+s):r[n+"_"+s]=a}};e(n,o)}else r._properties[o].value=n;if(!t.isUpdatingFromAttribute&&t.reflectToAttribute&&r.$.setAttributeValue(t.attributeName,n,t.type),r.isReady&&(!r.ownerElement||r.ownerElement&&r.ownerElement.isReady)){if("wait"===o&&(n||!i||r.isCompleted||(r.classList.remove("smart-visibility-hidden"),r.ownerElement&&r.ownerElement.updateBoundMappedNodes(),r.updateBoundMappedNodes(),r.complete())),"renderMode"===o)return;if(r.context!==r&&!r.wait){const e=r.context;r.context=r,r.propertyChangedHandler(o,i,n),r.context=e,t.observer&&r[t.observer]&&(r.context=r,r[t.observer](i,n),r.context=document),r._watch&&r._watch.properties.indexOf(o)>=0&&r._watch.propertyChangedCallback(o,i,n)}const e=t.notify||r.boundProperties[o];e&&(r.$.fireEvent(t.attributeName+"-changed",{context:r.context,oldValue:i,value:r[o]}),r.boundProperties[o]&&r.updateBoundNodes(o)),e&&r.templateProperties&&r.templateProperties[o]&&r.refreshTemplate(),r.dataContextProperties&&("dataContext"===o?r.applyDataContext():r.dataContextProperties[o]&&r.updateDataContextProperty(o))}t.isUpdating=!1}}};for(let t=0;t<r.length;t+=1){const i=r[t],s=e[i],a=y.Core.toDash(i),l=s.type||"any",d=l.indexOf("?")>=0||"any"===l;d&&"any"!==l&&(s.type=l.substring(0,l.length-1)),s.nullable=d,s.attributeName=a.toLowerCase(),s.name=i,s.reflectToAttribute=void 0===s.reflectToAttribute||s.reflectToAttribute,s.inherit&&o[i]&&(s.value=o[i].value),s.extend&&o[i]&&y.Core.assign(s.value,o[i].value),n.hasOwnProperty(i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get(){if(this._properties[i])return this._properties[i].value},set(e){const t=this;t.updateProperty(t,t._properties[i],e)}})}}}let C=[],S=[],x=[],E=!1;const A=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);A&&parseInt(A[2],10)<=50&&(E=!0);class T{static register(e,t){const r=t.prototype;let o=a.toCamelCase(e).replace(/[a-z]+/,""),i=t.version||window[n].Version;if(window.customElements.get(e)&&window.customElements.get(e).version===i)return;let s=e;for(i=i.split(".");window.customElements.get(e);)e=s+"-"+i.join("."),i[2]=parseInt(i[2])+1;if(!C[e]){if(e.startsWith(n.toLowerCase()))C[e]=window[n][o]=window[n.toLowerCase()+o]=t;else{let r=e.split("-")[0];r=r.substring(0,1).toUpperCase()+r.substring(1),window[n][r]||(window[n][r]={}),C[e]=window[n][r][o]=window[r.toLowerCase()+o]=t,window[n][o]&&(o=a.toCamelCase(e)),window[n][o]=t}r.elementName=o,r.defineElement(),S[e]&&S[e](r),window.customElements.define(e,t)}}static registerElements(){const e=this;if(e.toRegister){e.isRegistering=!0;for(let t=0;t<e.toRegister.length;t++){const n=e.toRegister[t];e.register(n.tagName,n.element)}e.isRegistering=!1}}static get(e){if(C[e])return C[e]}static whenRegistered(e,t){if(!e)throw new Error("Syntax Error: Invalid tag name");const n=S[e],r=this.get(e),o=r?r.modules.length:3;try{n||r?!n&&r?(t(r.prototype),S[e]=void 0):n&&!r?S[e]=function(e){n(e),t(e)}:n&&r&&(r.proto&&(n(r.proto),t(r.proto)),S[e]=void 0):S[e]=function(e){try{t(e)}catch(e){const t=e instanceof Error?e.message:e.toString();console.log(t)}}}catch(e){const t=e instanceof Error?e.message:e.toString();console.log(t)}if(r&&o!==r.prototype.modules.length){const t=document.querySelectorAll(e);for(let e=0;e<t.length;e++){const n=t[e];n.isCreated&&n._initElement()}}}}T.lazyRegister=!1,T.tagNames=[];class P{constructor(){const e=this;e.name="observableArray",e.observables=arguments.length<3?null:arguments[2];const t=new Proxy(e,{deleteProperty:function(e,t){return delete e[t],!0},apply:function(e,t,n){return e.apply(t,n)},get:function(t,n){return t[n]||isNaN(parseInt(n))?t[n]:e.getItem(parseInt(n))},set:function(t,n,r){return t[n]||isNaN(parseInt(n))?(t[n]=r,!0):(e.setItem(parseInt(n),r),!0)}});if(e._addArgs={eventName:"change",object:t,action:"add",index:null,removed:new Array,addedCount:1},e._removeArgs={eventName:"change",object:t,action:"remove",index:null,removed:null,addedCount:0},arguments.length>=1&&Array.isArray(arguments[0])){e._array=[];const t=arguments[0];for(let n=0,r=t.length;n<r;n++){const r=e._getItem(e._array.length,t[n]);e._array.push(r)}}else e._array=Array.apply(null,arguments);return 2===arguments.length&&(e.notifyFn=arguments[1]),t}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;t.canNotify&&t.notifyFn&&t.notifyFn(e)}notify(e){e&&(this.notifyFn=e)}toArray(){return this._array}_getItem(e,t){const n=this;return"string"==typeof t||"number"==typeof t||void 0===t?t:new Proxy(t,{deleteProperty:function(e,t){return delete e[t],!0},set:function(t,r,o){const i=t[r];return t[r]=o,!n._canNotify||!1===t.canNotify||(n.observables&&!n.observables[r]||n._notify({eventName:"change",object:n,target:t,action:"update",index:e,path:e+"."+r,oldValue:i,newValue:o,propertyName:r}),!0)}})}getItem(e){return this._array[e]}setItem(e,t){const n=this,r=n._array[e];n._array[e]=n._getItem(e,t),n._notify({eventName:"change",object:n._array,action:"update",index:e,removed:[r],addedCount:1})}get length(){return this._array.length}set length(e){const t=this;o.isNumber(e)&&t._array&&t._array.length!==e&&t.splice(e,t._array.length-e)}toString(){return this._array.toString()}toLocaleString(){return this._array.toLocaleString()}concat(){const e=this;e._addArgs.index=e._array.length;const t=e._array.concat.apply(e._array,arguments);return new Smart.ObservableArray(t)}join(e){return this._array.join(e)}pop(){const e=this;e._removeArgs.index=e._array.length-1,delete e[e._array.length-1];const t=e._array.pop();return e._removeArgs.removed=[t],e._notify(e._removeArgs),e._notifyLengthChange(),t}push(){const e=this;if(e._addArgs.index=e._array.length,1===arguments.length&&Array.isArray(arguments[0])){const t=arguments[0];for(let n=0,r=t.length;n<r;n++){const r=e._getItem(e._array.length,t[n]);e._array.push(r)}}else{const t=e._getItem(e._addArgs.index,arguments[0]);e._array.push.apply(e._array,[t])}return e._addArgs.addedCount=e._array.length-e._addArgs.index,e._notify(e._addArgs),e._notifyLengthChange(),e._array.length}_notifyLengthChange(){const e=this;if(!e.canNotify)return;const t=e._createPropertyChangeData("length",e._array.length);e._notify(t)}_createPropertyChangeData(e,t,n){return{eventName:"change",object:this,action:e,value:t,oldValue:n}}reverse(){return this._array.reverse()}shift(){const e=this,t=e._array.shift();return e._removeArgs.index=0,e._removeArgs.removed=[t],e._notify(e._removeArgs),e._notifyLengthChange(),t}slice(e,t){return this._array.slice(e,t)}sort(e){return this._array.sort(e)}splice(e,t,n){const r=this,o=r._array.length;let i;if(n&&n.length)for(let o=0;o<n.length;o++)i=r._array.splice(e+o,t,n[o]);else i=r._array.splice.apply(r._array,arguments);if(n){let t=r.canNotify;if(r.canNotify=!1,n.length)for(let t=0;t<n.length;t++)r.setItem(e+t,n[t]);else r.setItem(e,n);r.canNotify=t,r._notify({eventName:"change",object:this,action:"add",index:e,added:i,addedCount:r._array.length>o?r._array.length-o:0})}else r._notify({eventName:"change",object:this,action:"remove",index:e,removed:i,addedCount:r._array.length>o?r._array.length-o:0});return r._array.length!==o&&r._notifyLengthChange(),i}unshift(){const e=this,t=e._array.length,n=e._array.unshift.apply(e._array,arguments);return e._addArgs.index=0,e._addArgs.addedCount=n-t,e._notify(this._addArgs),e._notifyLengthChange(),n}indexOf(e,t){const n=this;for(let r=t||0,o=n._array.length;r<o;r++)if(n._array[r]===e)return r;return-1}lastIndexOf(e,t){const n=this;for(let r=t||n._array.length-1;r>=0;r--)if(n._array[r]===e)return r;return-1}find(e,t){return this._array.find(e,t)}findIndex(e,t){return this._array.findIndex(e,t)}every(e,t){return this._array.every(e,t)}some(e,t){return this._array.some(e,t)}forEach(e,t){this._array.forEach(e,t)}map(e,t){return this._array.map(e,t)}filter(e,t){return this._array.filter(e,t)}reduce(e,t){return void 0!==t?this._array.reduce(e,t):this._array.reduce(e)}reduceRight(e,t){return void 0!==t?this._array.reduceRight(e,t):this._array.reduceRight(e)}move(e,t){this.splice(t,0,this.splice(e,1)[0])}}let D={};window[n]&&(D=window[n]),window[n]=function(e,t){let r=e;if(e){if(e.indexOf("#")>=0||e.indexOf(".")>=0)return u[e]?u[e]:t?(u[e]=new t,function(e,t){const n=t.properties;t._properties=[];const r=function(n,o){const i=Object.keys(n);for(let s=0;s<i.length;s++){const a=i[s],l=n[a];t._properties[o+a]=l,Array.isArray(l)?t._properties[o+a]=new P(l,(function(t){const n=a+"."+t.path,r=t.newValue,o=document.querySelector(e);if(o){const e=n.split(".");let t=o;for(let n=0;n<e.length;n++)t=t[e[n]];t=r}})):(Object.defineProperty(n,a,{configurable:!1,enumerable:!0,get:()=>t._properties[o+a],set(e){t._properties[o+a]=e}}),l&&"DataAdapter"===l.constructor.name||l&&"object"==typeof l&&Smart.DataAdapter&&l instanceof Smart.DataAdapter||"object"==typeof l&&l&&Object.keys(l).length>0&&r(l,o+a+"."))}};r(n,""),Object.defineProperty(t,"properties",{configurable:!1,enumerable:!0,get:()=>n});const o=document.querySelector(e);if(o&&o.isReady)for(let e in n)o[e]=n[e];else if(o){o.props={};for(let e in n)o.props[e]=n[e]}}(e,u[e]),u[e]):void 0;if(t){if(T.tagNames[e]=t,T.lazyRegister){T.toRegister||(T.toRegister=[]);const e=a.toCamelCase(r).replace(/[a-z]+/,"");return window[n][e]=t,void T.toRegister.push({tagName:r,element:t})}T.register(r,t)}}},window.addEventListener("load",(function(){const e=window[n].Elements.tagNames;let t=[];for(let r in e){const o=e[r];let i=document.querySelectorAll("["+r+"]");for(let e=0;e<i.length;e++){const t=i[e];t instanceof HTMLDivElement&&(t.__proto__=o.prototype,t.created(),t.connectedCallback()),t.classList.add("smart-element-ready")}let s=o.name;"Item"===s&&(s="ListItem"),i=document.querySelectorAll('[is="'+n.toLocaleLowerCase()+s+'"]');for(let e=0;e<i.length;e++)t.push(i[e])}if(t.length>0){const e=e=>{let t=[],n=e.parentNode;for(;n&&9!==n.nodeType;)n instanceof HTMLElement==1&&t.push(n),n=n.parentNode;return t};t.sort((function(t,n){let r=e(t).length,o=e(n).length;return r<o?1:r>o?-1:0}));for(let e=0;e<t.length;e++){const n=t[e],r=n.getAttribute("is");let o;o="smartItem"===r?new window.smartListItem(n):new window[r](n),o.removeAttribute("is")}}}));const L=function(){if("complete"===document.readyState&&"manual"!==window[n].RenderMode){x.sort((function(e,t){let n=e.element.parents.length,r=t.element.parents.length;return n<r?-1:n>r?1:0}));for(let e=0;e<x.length;e++)window[n].RenderMode="",x[e].element.isLoading=!1,x[e].callback(),window[n].RenderMode="";x=[],document.removeEventListener("readystatechange",L)}};Object.assign(window[n],{Elements:T,Modules:[],BaseElement:class extends _{static get observedAttributes(){let e=this,t=["external-style"];for(let n in e.prototype.extendedProperties){const r=e.prototype.extendedProperties[n];t.push(r.attributeName)}return t}static get styleUrls(){return[]}static get styles(){return""}get styleUrl(){return this._styleUrl}set styleUrl(e){this._styleUrl=e}get isInShadowDOM(){const e=this,t=e.getRootNode();return!e.hasAttribute("smart-blazor")&&t!==document&&t!==e}getShadowRootOrBody(){const e=this;return e.isInShadowDOM&&e.getRootNode().host?e.getRootNode().host.shadowRoot:document.body}get enableShadowDOM(){return window[n].EnableShadowDOM}importStyle(e,t){this._importStyle(e,t)}_importStyle(e,t){const n=this;if(!n.shadowRoot||!e)return;const r=e=>{const r=n.shadowRoot.children;for(let n=0;n<r.length;n++){const o=r[n];if(o instanceof HTMLLinkElement&&o.href===e)return t&&t(),null}const o=document.createElement("link");return o.rel="stylesheet",o.type="text/css",o.href=e,o.onload=t,o},o=(()=>{const e=n.shadowRoot.children;let t=null;for(let n=0;n<e.length;n++){const r=e[n];r instanceof HTMLLinkElement&&(t=r)}return t})(),i=(e,t)=>{t.parentNode.insertBefore(e,t.nextSibling)};if(Array.isArray(e)){const t=document.createDocumentFragment();for(let n=0;n<e.length;n++){const o=r(e[n]);o&&t.appendChild(o)}o?i(t,o):n.shadowRoot.insertBefore(t,n.shadowRoot.firstChild)}else{const t=r(e);if(!t)return;o?i(t,o):n.shadowRoot.insertBefore(t,n.shadowRoot.firstChild)}}attributeChanged(e,t,n){"style-url"===e&&(this.styleUrl=n)}attributeChangedCallback(e,t,n){this.isReady&&super.attributeChangedCallback(e,t,n)}constructor(e,t){super();const n=this;if(e){t&&(n._initProperties=t);const r=e=>{if("string"==typeof e?document.querySelector(e):e){const r="string"==typeof e?document.querySelector(e):e;if(r instanceof HTMLDivElement){const o=document.createElement(n.tagName);for(let e of r.attributes)o.setAttribute(e.name,r.getAttribute(e.name));for(;r.childNodes.length;)o.appendChild(r.firstChild);return"string"==typeof e&&(o.id=e.substring(1)),o._initProperties=t,r.parentNode&&r.parentNode.replaceChild(o,r),o}if(t){const e=r.context;if(r._initProperties=t,r.isReady){r.context=r;const n={},o={};for(let e in t)n[e]=r[e],o[e]=t[e];Object.getOwnPropertyNames(t).length>0&&(r.initProperties(),r.propertyChangedHandler(t,n,o)),r.context=e}}return r}};if("string"==typeof e){const t=document.querySelectorAll(e),n=[];if(t.length>1){for(let e=0;e<t.length;e++){const o=r(t[e]);n.push(o)}return n}}else if(e&&e.length>0){const t=e;if(t.length>1){for(let e=0;e<t.length;e++){const n=r(t[e]);C.push(n)}return C}}return r(e)}n._styleUrl="",n.isUtilityElement||n.created()}_getRootShadowParent(){let e=this.shadowParent;for(;e;){if(!e.shadowParent)return e;e=e.shadowParent}return e||this.shadowParent}_getStyleUrl(e){let t=y.Core.getScriptLocation()+window[n].StyleBaseUrl+e;return this.shadowParent&&(t=t.replace("scoped/","")),t}_getStyleUrls(){const e=this;e.nodeName.startsWith(n);const t=e.getStaticMember("styleUrls","array"),r=[];for(let n=0;n<t.length;n++){const o=t[n],i=e._getStyleUrl(o);r.push(i)}return r}_setupShadowRoot(){const e=this;e.classList.add("smart-element-init");const t=t=>{t.$.root&&(t.$.root.classList.add(n.toLowerCase()+"-element"),t.$.root.classList.add(e.nodeName.toLowerCase())),t.setup(),t.classList.remove("smart-element-init")};if(document.adoptedStyleSheets)if(window[n].AdoptedStyleSheets)window[n].AdoptedStyleSheetsLoaded?(e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets,t(e)):(e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets,window[n].AdoptedStyleSheetsLoadedQueue||(window[n].AdoptedStyleSheetsLoadedQueue=[]),window[n].AdoptedStyleSheetsLoadedQueue.push(e));else{const r=new CSSStyleSheet;let o=y.Core.getScriptLocation()+"/styles/smart.default.css";r.replace('@import url("'+o+'")').then((()=>{if(t(e),window[n].AdoptedStyleSheetsLoaded=!0,window[n].AdoptedStyleSheetsLoadedQueue){const e=window[n].AdoptedStyleSheetsLoadedQueue;for(let n=0;n<e.length;n++){const r=e[n];t(r)}delete window[n].AdoptedStyleSheetsLoadedQueue}})).catch((e=>{console.error("Failed to load:",e)})),window[n].AdoptedStyleSheets=[r],document.adoptedStyleSheets=[r],e.shadowRoot.adoptedStyleSheets=window[n].AdoptedStyleSheets}}connect(){const e=this;window[n].EnableShadowDOM&&!e.shadowRoot&&!0!==e.isInShadowDOM&&(e.attachShadow({mode:"open"}),e.shadowRoot&&e.$.root&&(e.shadowRoot.appendChild(e.$.root),e.$.root.classList.add(e.nodeName.toLowerCase()))),e.shadowRoot||e.shadowParent?e.shadowRoot?e._setupShadowRoot():(e.shadowParent&&window[n].EnableShadowDOM,e.setup()):e.setup()}connectedCallback(){const e=this;if(e.isLoading||e.isUtilityElement)return;e.classList.add("smart-element-init");const t=function(){e.classList.remove("smart-element-init")};if("complete"===document.readyState&&(void 0===window[n].isAngular&&(window[n].isAngular=null!==document.body.querySelector("[ng-version]")),window[n].isAngular))for(let t=0;t<e.parents.length&&!e.parents[t].nodeName.toLowerCase().startsWith(n.toLowerCase()+"-");t++)if(e.parents[t].hasAttribute("ng-version")&&!e.classList.contains("smart-angular")){window[n].RenderMode="manual";break}if("complete"===document.readyState&&"manual"!==window[n].RenderMode){const n=e.parents;n.length&&"HTML"===n[n.length-1].nodeName||e.getRootNode().host?(e.checkIsInDomTimer&&clearInterval(e.checkIsInDomTimer),t(),e.connect()):(e.checkIsInDomTimer&&clearInterval(e.checkIsInDomTimer),n.length>0&&(e.checkIsInDomTimer=setInterval((()=>{const n=e.parents;0===n.length&&clearInterval(e.checkIsInDomTimer),n.length>0&&"HTML"===n[n.length-1].nodeName&&(clearInterval(e.checkIsInDomTimer),t(),e.connect())}),100)))}else e.isLoading=!0,x.push({element:this,callback:function(){this.isReady||(t(),this.connect())}.bind(e)})}disconnectedCallback(){const e=this;e.isAttached?(e.shadowParent=null,e.detached()):e._resetShadowParent()}adoptedCallback(){this.setup()}appendTemplate(e){const t=this;t.shadowRoot?t.shadowRoot.appendChild(e):t.appendChild(e)}_resetShadowParent(){const e=this;if(!window[n].EnableShadowDOM||null===e.shadowParent)return;const t=[];let r=e.parentNode;for(;r&&9!==r.nodeType;){if(r instanceof HTMLElement==1)t.push(r);else if(11===r.nodeType&&r.host){r=r.host;continue}r=r.parentNode}for(let n=0;n<t.length;n++)if(t[n]===e.shadowParent)return;t.length>0&&"HTML"===t[t.length-1].nodeName&&(e.shadowParent=null)}},Utilities:y,Import:function(e,t){let n=0;const r=function(e,t){return new Promise((n=>{const r=document.createElement("script");r.src=e,r.onload=n;for(let e=0;e<document.head.children.length;e++){const r=document.head.children[e];if(r.src&&r.src.toString().indexOf(t)>=0)return void n()}document.head.appendChild(r)}))};return new Promise((o=>{const i=y.Core.getScriptLocation(),s=function(t){if(!e[t])return;const a=i+"/"+e[t];r(a,e[t]).then((function(){n++,n===e.length&&o(),s(t+1)}))};if(t)for(let t=0;t<e.length;t++){const s=i+"/"+e[t];r(s,e[t]).then((function(){n++,n===e.length&&o()}))}else s(0)}))},ObservableArray:P,Observable:class{constructor(e,t){const n=this;var r;return this.name="observable",e&&Object.assign(n,e),r=e,Object.getOwnPropertyNames(Object.getPrototypeOf(r)).forEach((e=>"constructor"===e||!!e.startsWith("_")||void(n[e]=r[e]))),new Proxy(n,{deleteProperty:function(e,t){return delete e[t],!0},get:function(e,t){return e[t]},set:function(e,r,o){const i=e[r];return i===o||(e[r]=o,!("notifyFn"!==r&&!r.startsWith("_")&&"canNotify"!==r&&(!t||-1!==t.indexOf(r))&&n.canNotify&&(n._notify({target:e,propertyName:r,oldValue:i,newValue:o}),0)))}})}get canNotify(){const e=this;return void 0===e._canNotify&&(e._canNotify=!0),e._canNotify}set canNotify(e){this._canNotify=e}_notify(e){const t=this;if(t.canNotify&&t.notifyFn)for(let n=0;n<t.notifyFn.length;n++)t.notifyFn[n](e)}notify(e){const t=this;e&&(t.notifyFn||(t.notifyFn=[]),t.notifyFn.push(e))}},Component:class{constructor(e,t){const n=this.name;let r=null;return e?r=new window[n](e,t):(r=new window[n],r._initProperties=t),this._element=r,r}get name(){return"Component"}get element(){return this._element}},Theme:D.Theme||"",EnableShadowDOM:D.ShadowDom||!1,BaseUrl:"./",StyleBaseUrl:"/styles/default/",Version:e,Templates:t,RenderMode:D.RenderMode||"auto",Render:function(){const e=()=>{window[n].RenderMode="",L()};"complete"===document.readyState?e():(window.removeEventListener("load",e),window.addEventListener("load",e))},Data:u,Mode:D.Mode||"production",License:D.License||"Evaluation"});let O=window[n].Theme;"manual"!==window[n].RenderMode&&document.addEventListener("readystatechange",L),Object.defineProperty(window[n],"Theme",{configurable:!1,enumerable:!0,get:()=>O,set(e){const t=O;O=e,w.fireEvent("theme-changed",{oldValue:t,newValue:e},{bubbles:!0,cancelable:!0})}}),window[n]("smart-base-element",window[n].BaseElement),window[n]("smart-content-element",class extends window[n].BaseElement{static get properties(){return{content:{type:"any",reflectToAttribute:!1},innerHTML:{type:"string",reflectToAttribute:!1}}}template(){return"<div inner-h-t-m-l='[[innerHTML]]'></div>"}ready(){super.ready(),this.applyContent()}refresh(){}clearContent(){const e=this;for(;e.$.content.firstChild;)e.$.content.removeChild(e.$.content.firstChild)}applyContent(){const e=this;if(void 0===e.content)return void(e.content=e.$.content);if(""===e.content||null===e.content)return void e.clearContent();if(e.content instanceof HTMLElement)return e.clearContent(),void e.$.content.appendChild(e.content);const t=document.createDocumentFragment();let n=document.createElement("div");t.appendChild(n),e.content instanceof HTMLElement?n.appendChild(e.content):n.innerHTML=e.content;let r=Array.from(n.childNodes);n.parentNode.removeChild(n);for(let e=0;e<r.length;e++)t.appendChild(r[e]);e.clearContent(),e.$.content.appendChild(t)}propertyChangedHandler(e,t,n){super.propertyChangedHandler(e,t,n);const r=this;t!==n&&("innerHTML"===e&&(r.content=n,r.applyContent(),r.innerHTML=r.content=y.Core.html(r.$.content)),"content"===e&&r.applyContent())}}),window[n]("smart-scroll-viewer",class extends window[n].ContentElement{static get properties(){return{autoRefresh:{type:"boolean",value:!1},horizontalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]},touchScrollRatio:{type:"any",value:null},touchVelocityCoefficient:{type:"number",value:50},verticalScrollBarVisibility:{type:"string",value:"auto",allowedValues:["auto","disabled","hidden","visible"]}}}static get listeners(){return{touchmove:"_touchmoveHandler",touchstart:"_touchstartHandler",wheel:"_mouseWheelHandler","document.up":"_upHandler"}}static get styleUrls(){return["smart.scrollviewer.css"]}template(){return'<div id="container" class="smart-container" role="presentation">\n <div id="scrollViewerContainer" class="smart-scroll-viewer-container" role="presentation">\n <div id="scrollViewerContentContainer" inner-h-t-m-l=\'[[innerHTML]]\' class="smart-scroll-viewer-content-container" role="presentation">\n <content></content>\n </div>\n </div>\n <smart-scroll-bar id="verticalScrollBar" theme="[[theme]]" animation="[[animation]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]" orientation="vertical"></smart-scroll-bar>\n <smart-scroll-bar id="horizontalScrollBar" theme="[[theme]]" disabled="[[disabled]]" right-to-left="[[rightToLeft]]"></smart-scroll-bar>\n </div>'}appendChild(e){const t=this;if(e){if(!t.isCompleted||e.classList&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.appendChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.$.scrollViewerContentContainer.appendChild(e)}}removeChild(e){const t=this;if(e){if(!t.isCompleted||e.classList&&e.classList.contains("smart-resize-trigger-container")){const e=Array.prototype.slice.call(arguments,2);return HTMLElement.prototype.removeChild.apply(t,e.concat(Array.prototype.slice.call(arguments)))}t.$.scrollViewerContentContainer.removeChild(e)}}removeAll(){const e=this;e.isCompleted&&(e.$.scrollViewerContentContainer.innerHTML="")}_horizontalScrollbarHandler(e){const t=this;t.$.scrollViewerContentContainer.style.left=(t.rightToLeft?1:-1)*t.scrollLeft+"px",e.stopPropagation&&e.stopPropagation(),t.onHorizontalChange&&t.onHorizontalChange(e)}_verticalScrollbarHandler(e){const t=this;t.$.scrollViewerContentContainer.style.top=-t.scrollTop+"px",e.stopPropagation&&e.stopPropagation(),t.onVerticalChange&&t.onVerticalChange(e)}_touchmoveHandler(e){const t=this;if(t._touchmoveInside&&e.cancelable)return e.preventDefault(),void e.stopPropagation();const n=t.scrollHeight>0,r=t.scrollWidth>0,o=t._touchCoords;if(!n&&!r||!o)return;const i=e.touches[0];let s,a,l,d;t._touchCoords=[i.pageX,i.pageY],n?(s=t.scrollTop,a=t.scrollHeight,l=i.pageY,d=o[1]):(s=t.scrollLeft,a=t.scrollWidth,l=i.pageX,d=o[0]);const c=parseFloat(l.toFixed(5)),u=parseFloat(d.toFixed(5));0===s&&c>=u||s===a&&c<=u||(l!==d&&(t._touchmoveInside=!0),e.cancelable&&(e.preventDefault(),e.stopPropagation()))}_touchstartHandler(e){const t=e.touches[0];this._touchCoords=[t.pageX,t.pageY]}_mouseWheelHandler(e){const t=this;if(!t.disabled&&(t.computedHorizontalScrollBarVisibility||t.computedVerticalScrollBarVisibility)){if(e.shiftKey&&t.computedHorizontalScrollBarVisibility){const n=t.scrollLeft;if(0===n&&e.deltaX<0||n===t.scrollHeight&&e.deltaX>0)return;return e.stopPropagation(),e.preventDefault(),void(t.scrollWidth>0&&t.scrollTo(void 0,t.scrollLeft+t._getScrollCoefficient(e,t.offsetWidth)))}if(t.computedVerticalScrollBarVisibility){const n=t.scrollTop;if(0===n&&e.deltaY<0||n===t.scrollHeight&&e.deltaY>0)return;e.stopPropagation(),e.preventDefault(),t.scrollHeight>0&&t.scrollTo(t.scrollTop+t._getScrollCoefficient(e,t.offsetHeight))}}}_overriddenHandler(){}_upHandler(){delete this._touchCoords,delete this._touchmoveInside}_getScrollCoefficient(e,t){const n=e.deltaMode,r=Math.abs(e.deltaY);let o;return 0===n?o=r<100/3?r:t:1===n?o=r<1?r*(100/3):t:2===n&&(o=t),e.deltaY<0?-o:o}applyContent(){super.applyContent(),this.refresh()}get computedHorizontalScrollBarVisibility(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?!e._scrollView.hScrollBar.$.hasClass("smart-hidden"):null}get computedVerticalScrollBarVisibility(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?!e._scrollView.vScrollBar.$.hasClass("smart-hidden"):null}scrollTo(e,t){const n=this;n._scrollView&&(void 0!==e&&n._scrollView.scrollTo(e),void 0!==t&&n._scrollView.scrollTo(t,!1))}refreshScrollBarsVisibility(){const e=this;e._scrollView&&(e._scrollView.hScrollBar.disabled=e.disabled,e._scrollView.vScrollBar.disabled=e.disabled,"disabled"===e.horizontalScrollBarVisibility&&(e._scrollView.hScrollBar.disabled=!0),"disabled"===e.verticalScrollBarVisibility&&(e._scrollView.vScrollBar.disabled=!0),e.scrollWidth>0?e._scrollView.hScrollBar.$.removeClass("smart-hidden"):"visible"!==e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.addClass("smart-hidden"),e.scrollHeight>0?e._scrollView.vScrollBar.$.removeClass("smart-hidden"):"visible"!==e.verticalScrollBarVisibility&&e._scrollView.vScrollBar.$.addClass("smart-hidden"),"hidden"===e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.addClass("smart-hidden"),"hidden"===e.verticalScrollBarVisibility&&e._scrollView.vScrollBar.$.addClass("smart-hidden"),"visible"===e.horizontalScrollBarVisibility&&e._scrollView.hScrollBar.$.removeClass("smart-hidden"),"visible"===e.verticalScrollBarVisibility&&(e._scrollView.vScrollBar.$.removeClass("smart-hidden"),e.disabled||(e._scrollView.vScrollBar.disabled=e.scrollHeight<=0)),e.computedHorizontalScrollBarVisibility&&e.computedVerticalScrollBarVisibility?(e._scrollView.hScrollBar.$.addClass("bottom-corner"),e._scrollView.vScrollBar.$.addClass("bottom-corner")):(e._scrollView.hScrollBar.$.removeClass("bottom-corner"),e._scrollView.vScrollBar.$.removeClass("bottom-corner")))}ready(){super.ready();const e=this;e.$.verticalScrollBar.onChange=t=>{t.detail=t,e._verticalScrollbarHandler(t)},e.$.horizontalScrollBar.onChange=t=>{t.detail=t,e._horizontalScrollbarHandler(t)},e.$.verticalScrollBar.setAttribute("aria-controls",e.id),e.$.horizontalScrollBar.setAttribute("aria-controls",e.id),e._customScrollView||(e._scrollView=new Smart.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar)),e.refresh()}refresh(){const e=this;function t(){const t=e.$.scrollViewerContainer.classList.contains("vscroll");e.$.scrollViewerContainer.classList.remove("vscroll");const n=e.$.scrollViewerContentContainer.offsetWidth-e.$.scrollViewerContainer.offsetWidth;return n>0&&"hidden"!==e.horizontalScrollBarVisibility||"visible"===e.horizontalScrollBarVisibility?e.$.scrollViewerContainer.classList.add("hscroll"):e.$.scrollViewerContainer.classList.remove("hscroll"),t&&e.$.scrollViewerContainer.classList.add("vscroll"),n}function n(){let t;const n=e.$.scrollViewerContainer.classList.contains("hscroll");if(e.$.scrollViewerContainer.classList.remove("hscroll"),Smart.Utilities.Core.Browser.Safari){const n=e.$.scrollViewerContentContainer.getBoundingClientRect().height,r=e.$.scrollViewerContainer.getBoundingClientRect().height;t=n&&r?parseInt(n)-parseInt(r):e.$.scrollViewerContentContainer.offsetHeight-e.$.scrollViewerContainer.offsetHeight}else t=e.$.scrollViewerContentContainer.offsetHeight-e.$.scrollViewerContainer.offsetHeight;return e.virtualScrollHeight&&(t=e.virtualScrollHeight),t>0&&"hidden"!==e.verticalScrollBarVisibility||"visible"===e.verticalScrollBarVisibility?e.$.scrollViewerContainer.classList.add("vscroll"):e.$.scrollViewerContainer.classList.remove("vscroll"),n&&e.$.scrollViewerContainer.classList.add("hscroll"),t}if(!e.$.scrollViewerContentContainer)return;"hidden"===e.verticalScrollBarVisibility&&e.$.scrollViewerContentContainer.setAttribute("disable-vertical",""),"hidden"===e.horizontalScrollBarVisibility&&e.$.scrollViewerContentContainer.setAttribute("disable-horizontal","");let r=e.scrollWidth,o=e.scrollHeight;e.scrollWidth=t(),e.scrollHeight=n(),e.scrollHeight&&o===e.scrollHeight||(e.scrollWidth=t()),e.scrollWidth&&r===e.scrollWidth||(e.scrollHeight=n()),e.computedVerticalScrollBarVisibility&&(e.scrollHeight+=e._scrollView.hScrollBar.offsetHeight),e.computedHorizontalScrollBarVisibility&&(e.scrollWidth+=e._scrollView.vScrollBar.offsetWidth),0===e.scrollHeight&&e.scrollWidth>0&&e.$.container.offsetHeight-e.$.content.offsetHeight<5&&(e.$.container.style.paddingBottom=e._scrollView.hScrollBar.offsetHeight+"px"),e.autoRefresh&&(e.$.scrollViewerContainer.scrollLeft=0,e.$.scrollViewerContainer.scrollTop=0)}attached(){const e=this;super.attached(),e._scrollView||e._customScrollView||(e._scrollView=new Smart.Utilities.Scroll(e,e.$.horizontalScrollBar,e.$.verticalScrollBar))}detached(){const e=this;super.detached(),e._scrollView&&(e._scrollView.unlisten(),delete e._scrollView)}get scrollWidth(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?1===e._scrollView.hScrollBar.max&&"visible"===e.horizontalScrollBarVisibility?0:e._scrollView.hScrollBar.max:-1}set scrollWidth(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.hScrollBar&&(0===e&&"visible"===t.horizontalScrollBarVisibility?t._scrollView.hScrollBar.max=0:t._scrollView.hScrollBar.max=e,t.refreshScrollBarsVisibility())}get scrollHeight(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?1===e._scrollView.vScrollBar.max&&"visible"===e.verticalScrollBarVisibility?0:e._scrollView.vScrollBar.max:0}set scrollHeight(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.vScrollBar&&(0===e&&"visible"===t.verticalScrollBarVisibility?t._scrollView.vScrollBar.max=1:t._scrollView.vScrollBar.max=e,t.refreshScrollBarsVisibility())}get scrollLeft(){const e=this;return e._scrollView&&e._scrollView.hScrollBar?e._scrollView.hScrollBar.value:0}set scrollLeft(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.hScrollBar&&(t._scrollView.hScrollBar.value=e)}get scrollTop(){const e=this;return e._scrollView&&e._scrollView.vScrollBar?e._scrollView.vScrollBar.value:0}set scrollTop(e){const t=this;e<0&&(e=0),t._scrollView&&t._scrollView.vScrollBar&&(t._scrollView.vScrollBar.value=e)}propertyChangedHandler(e,t,n){const r=this;super.propertyChangedHandler(e,t,n),"animation"!==e&&"theme"!==e&&r.refresh()}}),window[n].Utilities.Assign("PositionDetection",class{constructor(e,t,n,r){const o=this;if(t){const n="dropDown"+Math.floor(65536*(1+Math.random())).toString(16).substring(1);t.id=n,e.setAttribute("aria-owns",n)}o.context=e,o.dropDown=t,o.defaultParent=n,o.closeMethod=r}handleAutoPositioning(){const e=this,t=e.context;if("auto"!==t.dropDownPosition||t.disabled||t.isHidden)return;const n=window.requestAnimationFrame;let r,o=Date.now();return r=n((function i(){t.isHidden||document.hidden||(r=n(i),"auto"===t.dropDownPosition&&!t.disabled&&(t.isInShadowDOM?document.body.contains(t.shadowParent):document.body.contains(t))||cancelAnimationFrame(r),t.isHidden&&cancelAnimationFrame(r),Date.now()-o>=200&&(e.scrollHandler(),o=Date.now()))}))}checkBrowserBounds(e){const t=this.context;if("auto"===t.dropDownPosition&&!t.disabled)switch(e){case"vertically":this.checkBrowserBoundsVertically();break;case"horizontally":this.checkBrowserBoundsHorizontally();break;default:this.checkBrowserBoundsVertically(),this.checkBrowserBoundsHorizontally()}}checkBrowserBoundsHorizontally(){const e=this.context,t=this.dropDown;let n,r=0;a.isMobile||window.innerWidth===document.documentElement.clientWidth||(r=window.innerWidth-document.documentElement.clientWidth),null!==e._dropDownParent?n=!0:t.style.left="";const o=window.innerWidth-r;let i=e.getBoundingClientRect().left;if(i<0&&(t.style.left=(n?0:Math.abs(i))+"px",i=parseFloat(t.style.left)),i+t.offsetWidth>o){let e=i-Math.abs(o-i-t.offsetWidth);n&&(e+=window.pageXOffset),t.style.left=(n?e:e-i)+"px",window.innerWidth===document.documentElement.clientWidth&&(t.style.left=parseFloat(t.style.left)+r+"px"),n&&window.innerHeight===document.documentElement.clientHeight&&this.positionDropDown(!0)}}checkBrowserBoundsVertically(e){const t=this.context,n=this.dropDown,r=t._dropDownListPosition;e||(e=t.getBoundingClientRect()),0!==e.height&&(document.documentElement.clientHeight-Math.abs(e.top+e.height+n.offsetHeight)>=0?t._dropDownListPosition="bottom":e.top-n.offsetHeight>=0?t._dropDownListPosition="top":t._dropDownListPosition="overlay-center",this.updatePositionAttribute(r,t._dropDownListPosition))}scrollHandler(){const e=this.context;if(!e.parentElement)return;const t=e.getBoundingClientRect();if(t.top===e._positionTop)return;const n=e._dropDownListPosition;this.checkBrowserBoundsVertically(t),e._dropDownListPosition!==n&&this.positionDropDown(),e._positionTop=t.top}getDropDownParent(e){const t=this.context,n=this.dropDown;let r=t.dropDownAppendTo;t._positionedParent=null,null===r?t._dropDownParent=null:"body"===r||r===document.body?t.getRootNode().host?t._dropDownParent=t.getRootNode().host.shadowRoot:t._dropDownParent=document.body:r instanceof HTMLElement?t._dropDownParent=r:"string"==typeof r?(r=document.getElementById(r),r instanceof HTMLElement?t._dropDownParent=r:(t.dropDownAppendTo=null,t._dropDownParent=null)):(t.dropDownAppendTo=null,t._dropDownParent=null);let o=t._dropDownParent;if(null!==o){for(;o&&o instanceof HTMLElement&&"static"===window.getComputedStyle(o).position&&o!==t.getShadowRootOrBody();)o=o.parentElement;o===document.body?t._positionedParent=null:t._positionedParent=o,n&&(n.setAttribute("animation",t.animation),""!==t.theme&&n.$.addClass(t.theme),e&&(t._dropDownParent.appendChild(n),n.$.addClass("smart-drop-down-repositioned")),-1===t.detachedChildren.indexOf(n)&&t.detachedChildren.push(n))}}dropDownAppendToChangedHandler(){const e=this.context,t=this.dropDown,n=e._dropDownParent;this.getDropDownParent(),e._dropDownParent!==n&&(e[this.closeMethod](),["left","top","font-size","font-family","font-style","font-weight"].forEach((e=>t.style[e]=null)),null===e._dropDownParent?(this.defaultParent.appendChild(t),t.$.removeClass("smart-drop-down-repositioned")):(e._dropDownParent.appendChild(t),t.$.addClass("smart-drop-down-repositioned")))}dropDownPositionChangedHandler(){const e=this;e.dropDown.style.transition="none",e.context[e.closeMethod](),e.setDropDownPosition(),e.handleAutoPositioning()}dropDownAttached(e){const t=this.context;null!==t._dropDownParent&&(t._dropDownParent.appendChild(this.dropDown),this.handleAutoPositioning(),e&&t[e]())}dropDownDetached(){const e=this.context;null!==e._dropDownParent&&document.body.contains(this.dropDown)&&document.body.contains(e._dropDownParent)&&e._dropDownParent.removeChild(this.dropDown)}setDropDownPosition(){const e=this.context,t=e.dropDownPosition,n=e._dropDownListPosition;"auto"===t?this.checkBrowserBounds():e._dropDownListPosition=t,this.updatePositionAttribute(n,e._dropDownListPosition)}updatePositionAttribute(e,t){const n=this.context,r=this.dropDown;n.$.dropDownButton&&!n.$.dropDownButton.hasAttribute(t)&&(n.$.dropDownButton.removeAttribute(e),n.$.dropDownButton.setAttribute(t,"")),r.hasAttribute(t)||(r.style.transition="none",r.removeAttribute(e),r.setAttribute(t,""),requestAnimationFrame((function(){r.style.transition=null})))}positionDropDown(e){const t=this.context,n=this.dropDown;if(!t.opened||null===t._dropDownParent)return;const r=t.getBoundingClientRect();let o,i;if(this.customPositionDropDown){const e=this.customPositionDropDown(r);o=e.left,i=e.top}else switch(o=r.left,i=r.top,t._dropDownListPosition){case"bottom":i+=t.$.container.offsetHeight-1;break;case"center-bottom":i+=t.$.container.offsetHeight-1,o+=t.offsetWidth-n.offsetWidth/2;break;case"center-top":i-=n.offsetHeight-1,o+=t.offsetWidth-n.offsetWidth/2;break;case"top":i-=n.offsetHeight-1;break;case"overlay-bottom":break;case"overlay-center":i-=n.offsetHeight/2-t.offsetHeight/2;break;case"overlay-top":i-=n.offsetHeight-t.offsetHeight}const s=this.getDropDownOffset();n.style.top=i+s.y+"px",e||(n.style.left=o+s.x+"px")}getDropDownOffset(){const e=this.context._positionedParent;let t,n;if(e&&"#document-fragment"!==e.nodeName){const r=e.getBoundingClientRect();t=-r.left,n=-r.top}else t=window.pageXOffset,n=window.pageYOffset;return{x:t,y:n}}placeOverlay(){const e=this.context;if(!e.dropDownOverlay||e._overlay)return;const t=document.createElement("div");t.classList.add("smart-drop-down-overlay"),t.style.width=document.documentElement.scrollWidth+"px",t.style.height=document.documentElement.scrollHeight+"px",document.body.appendChild(t),e._overlay=t}removeOverlay(e){const t=this,n=t.context;n._overlay&&(n.hasAnimation&&e?requestAnimationFrame((function e(){t.dropDown.getBoundingClientRect().height>0?requestAnimationFrame(e):(document.body.removeChild(n._overlay),delete n._overlay)})):(document.body.removeChild(n._overlay),delete n._overlay))}}),window.Smart.Color=class{constructor(e){if(window.Smart._colors||(window.Smart._colors=[]),window.Smart._colors[e]){const t=window.Smart._colors[e];return this.hex=t.hex,this.r=t.r,this.g=t.g,void(this.b=t.b)}this.r=this.g=this.b=0,this.hex="";const t=this.getStandardizedColor(e);t&&(this.setHex(t.substring(1)),window.Smart._colors[e]={hex:this.hex,r:this.r,g:this.g,b:this.b})}getStandardizedColor(e){const t=document.createElement("canvas").getContext("2d");return t.fillStyle=e,t.fillStyle}getInvertedColor(){return""===this.hex?"transparent":255-(.299*this.r+.587*this.g+.114*this.b)<105?"Black":"White"}hexToRgb(e){let t="00",n="00",r="00";return 6===(e=this.validateHex(e)).length?(t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6)):(e.length>4&&(t=e.substring(4,e.length),e=e.substring(0,4)),e.length>2&&(n=e.substring(2,e.length),e=e.substring(0,2)),e.length>0&&(r=e.substring(0,e.length))),{r:this.hexToInt(t),g:this.hexToInt(n),b:this.hexToInt(r)}}validateHex(e){return(e=(e=new String(e).toUpperCase()).replace(/[^A-F0-9]/g,"0")).length>6&&(e=e.substring(0,6)),e}webSafeDec(e){return e=Math.round(e/51),e*=51}hexToWebSafe(e){let t,n,r;return 3===e.length?(t=e.substring(0,1),n=e.substring(1,1),r=e.substring(2,1)):(t=e.substring(0,2),n=e.substring(2,4),r=e.substring(4,6)),this.intToHex(this.webSafeDec(this.hexToInt(t)))+this.intToHex(this.webSafeDec(this.hexToInt(n)))+this.intToHex(this.webSafeDec(this.hexToInt(r)))}rgbToWebSafe(e){return{r:this.webSafeDec(e.r),g:this.webSafeDec(e.g),b:this.webSafeDec(e.b)}}rgbToHex(e){return this.intToHex(e.r)+this.intToHex(e.g)+this.intToHex(e.b)}intToHex(e){let t=parseInt(e).toString(16);return 1===t.length&&(t="0"+t),t.toUpperCase()}hexToInt(e){return parseInt(e,16)}setRgb(e,t,n){let r=function(e){return e<0||e>255||isNaN(parseInt(e))?0:e};this.r=r(e),this.g=r(t),this.b=r(n),this.hex=this.rgbToHex(this)}setHex(e){this.hex=e;let t=this.hexToRgb(this.hex);this.r=t.r,this.g=t.g,this.b=t.b}}}();
/***/ }),
/***/ 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:"string"},label:{value:"",type:"string"},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-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(){super.attached(),this.ownerListBox=this.getListBox()}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&&(t=t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")),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"}}}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.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.upTimer&&clearTimeout(i.upTimer),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],n=s.getBoundingClientRect();if((t.indexOf(s)===t.length-1||s.parentNode.lastElementChild===s)&&e.clientY>=o.top+s.offsetTop-r.scrollTop+n.height/2&&e.clientY<=o.top-r.scrollTop+s.offsetTop+n.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+n.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 n=e.originalEvent.target;if(t.isInShadowDOM&&(n=e.originalEvent?e.originalEvent.composedPath()[0]:e.composedPath()[0]),i=!i&&n.closest?n.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 l=Smart.ListBox.DragDrop.Item,a=l.ownerListBox;l.displayMode="checkBox"===a.selectionMode||"radioButton"===a.selectionMode?a.selectionMode:"plain",a.$.fireEvent("dragEnd",{item:l,target:r,data:Smart.ListBox.DragDrop,previousContainer:s,container:i,originalEvent:e}),a._focus(l)}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 n=r>=5&&r<=15||o>=5&&o<=15;if(Smart.Utilities.Core.isMobile&&(s<300||s>1e3)&&(n=!1),n){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._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 n=r.selectedValues;r.setAttribute("aria-multiselectable",-1!==["oneOrManyExtended","zeroOrMany","oneOrMany","checkBox","radioButton"].indexOf(i)),r.selectedValues=[],r.clearSelection();for(let e=0;e<n.length;e++){const t=n[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 n=function(t,i){return void 0!==e[t]?""+e[t]:e[i]};let l="string"==typeof e?e:n(r.displayMember,"label"),a="string"==typeof e?e:n(r.valueMember,"value"),d=n(r.groupMember,"group");return void 0===l&&(l=void 0!==t?""+t:""),s.label=s.innerHTML=""+l,void 0===a&&(a=void 0!==t?""+t:l),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.dataSource[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&&(e.__scrollHeight+=e.$.filterInput.offsetHeight),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(){for(let r=0;r<e.dataSource.length;r++){const o=e.dataSource[r],s=e._createItem(o);if(e.itemHeight&&"auto"!==e.itemHeight&&(s.style.height=e.itemHeight+"px"),e.$.itemsInnerContainer.appendChild(s),t+=s.offsetHeight,s.dataItem=e._items[r],e._recyclingItems.push(s),t>1.5*i)break}};r();let o=0;for(;t<1.5*i&&++o<5;)r()}_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),"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 n=t[s];n.dataIndex=s,n.label=n.innerHTML,n.dataItem=n,n.top||(n.top=o),n.height||(n.height=n.offsetHeight),o+=n.height,n.value||(n.value=""+s);const l=r(n,e.displayMember,"label"),a=r(n,e.valueMember,"value"),d=r(n,e.groupMember,"group");n.label!==l&&(n.label=l),n.value!==a&&(n.value=a),n.group!==d&&(n.group=d);const c=n.context;n.context=document,n.displayMode=i,n.context=c,e._alternateItem(n),n.selected&&(e.selectedIndexes.push(s),e.selectedValues.push(n.value)),e._items.push(n)}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],n=document.createElement("smart-list-items-group");n.label=s.label,n.dataIndex=o;for(let e=0;e<t[o].items.length;e++){const t=s.items[e];i.push(t),t.group=s.label,n.appendChild(t)}e._groups.push(n),r.appendChild(n)}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))){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 n=[];for(let e=0;e<i.length;e++)n.push(t.getItem(i[e]));if(n.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:n,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,n=document.importNode(i._template.content,!0);for(let t=0;t<r;t++){o=n.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],n=s.indexOf("label")>=0?e.label:e.value;o.innerHTML=o.innerHTML.replace(s,n)}}e.innerHTML="";for(let t=0;t<n.childNodes.length;t++)n.childNodes[t].outerHTML&&(e.innerHTML+=n.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,n;const l=function(){if(0===n.length)return r._filteredItems=[],void(t&&t());s=r._queryItems(o,r.filterMode);for(let e=0;e<n.length;e++)n[e].hidden=!0,n[e].$&&n[e].$.addClass("smart-hidden");for(let e=0;e<s.length;e++){const t=s[e];t.hidden=!1,n[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=n=r._items,l()},r.clearItems(),r.insert(0,e))},t=r.dataSource(o,e);if(t){if(!o&&!i)return;r._updateListBoxAfterQuery=function(){s=n=r._items,l()},r.clearItems(),r.insert(0,t)}}else r.clearItems(),s=n=r._items,l(),r.$.fireEvent("bindingComplete");else{if(n=r._items,0===n.length)return;l()}}_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 n(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,n=s.offsetWidth+s.offsetLeft+o;return i.parentNode.removeChild(i),n}for(let e=0;e<t.length;e++){const l=t[e];if(!l.hidden)if("auto"===r){const e=i?l.label:l.textContent.trim();e.length>s.length&&(s=e)}else o=Math.max(o,n(l.label))}return"auto"===r?n(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++;for(let o=0;o<t.length;o++){const s=t[o],n=i._createItem(s);r.push(n),e>=i._items.length||0===i._items.length?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])}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)}removeAt(e){const t=this,i=t._items[e];i?(i.selected&&t.unselect(i),t.isVirtualized?t._items.splice(e,1):i.parentNode.removeChild(i),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 n=[];if(i._previouslySelectedIndexes){for(let e=0;e<i._previouslySelectedIndexes.length;e++)i.selectedIndexes.indexOf(i._previouslySelectedIndexes[e])<0&&n.push(i._items[i._previouslySelectedIndexes[e]]);delete i._previouslySelectedIndexes}return i.$.fireEvent("change",{addedItems:[e],removedItems:n,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,n;t._bindingDetails=[],t._template=e;for(let e=0;e<r;e++){for(n=[];s=o.exec(i.childNodes[e].innerHTML);)n.push(s[0]);n.length>0&&t._bindingDetails.push({childNodeIndex:e,bindingString:n})}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(),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}_mouseWheelHandler(e){const t=this;if((t.computedHorizontalScrollBarVisibility||t.computedVerticalScrollBarVisibility)&&!t.disabled&&t.computedVerticalScrollBarVisibility){const i=t.scrollTop;if(0===i&&e.deltaY<0||i===t.scrollHeight&&e.deltaY>0)return;e.stopPropagation(),e.preventDefault(),t.scrollTo(i+t._getScrollCoefficient(e,t.offsetHeight))}}_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.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.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),n=i[s];if(t._isItemInPosition(n,e))return s;n.top<e?r=s+1:n.top>e&&(o=s-1)}})(t.filterable&&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,n=s[o];let l=n?n.top:0;if(e.$.itemsInnerContainer.style.left=-e.scrollLeft+"px",e.$.itemsInnerContainer.style.top=-r+l+"px",e.isUpdating++,o>=0){const n=s.length;for(let a=o;a<n;a++){const o=s[a];if(0!==o.height){if(!(l+o.height>=r&&l<=r+t))break;{const t=e._recyclingItems[i++];if(!t)break;t.setAttribute("aria-setsize",n),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)}l+=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)}}});
/***/ }),
/***/ 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")}});
/***/ })
/******/ });
/************************************************************************/
/******/ // 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 smartDropDownList */
/* 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_scrollbar_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9135);
/* harmony import */ var _smart_scrollbar_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_smart_scrollbar_js__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _smart_listbox_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(5707);
/* harmony import */ var _smart_listbox_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_smart_listbox_js__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _smart_dropdownlist_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(7650);
/* harmony import */ var _smart_dropdownlist_js__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_smart_dropdownlist_js__WEBPACK_IMPORTED_MODULE_4__);
/* Smart UI v15.2.0 (2023-04-20)
Copyright (c) 2011-2023 jQWidgets.
License: https://htmlelements.com/license/ */ //
class smartDropDownList extends Smart.Component {
get name() {
return 'smartDropDownList';
}
}
})();
/******/ })()
;