@momentum-ui/web-components 2.15.0 → 2.15.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[30],{55:function(t,e,o){"use strict";o.r(e),o.d(e,"ComboBox",(function(){return i}));o(56),o(14);var i,s=o(1),r=o(7),l=o(5),n=o(16),d=o(6),a=o(0),c=o(2),h=o(4),p=o(3),u=o(13),b=o(8),m=o(30),g=o(65),x=a.css`:host{--combobox-input-clear-bg:var(--combobox-group-button-bg-color, $lm-combobox-group-button-bg-color-light)}:host .group{background:var(--combobox-bg-color,#fff)}:host(:focus){box-shadow:none!important;outline:0!important}:host(:active) .md-new-combobox .group{outline:2px solid var(--input-default-outline-color);outline-offset:.125rem;box-shadow:none;border:1px solid var(--combobox-border-color,#b2b2b2)!important}:host(:active) .md-new-combobox .md-combobox-right-arrow{border-left:1px solid var(--combobox-border-color,#b2b2b2)}:host([focus-visible]) .group{border-color:var(--combobox-focus-border-color);box-shadow:none}:host([focus-visible]) .md-new-combobox .group{outline:2px solid var(--combobox-focus-border-color);outline-offset:.125rem;box-shadow:none;border-color:var(--combobox-focus-new-border-color)}:host([focus-visible]) .md-new-combobox .md-combobox-right-arrow{border-color:var(--combobox-focus-new-border-color)}:host([disabled]) .group,:host([disabled]) .group:active,:host([disabled]) .group:hover{background:var(--combobox-disabled-bg-color,#ededed);pointer-events:none}:host([disabled]) .group md-icon,:host([disabled]) .group:active md-icon,:host([disabled]) .group:hover md-icon{opacity:.3}:host([disabled]) .md-new-combobox .group,:host([disabled]) .md-new-combobox .group:active,:host([disabled]) .md-new-combobox .group:hover{outline:0;box-shadow:none;border-color:var(--combobox-disabled-bg-color)!important;background-color:rgba(0,0,0,0)}:host([disabled]) .md-new-combobox .group md-icon,:host([disabled]) .md-new-combobox .group:active md-icon,:host([disabled]) .md-new-combobox .group:hover md-icon{color:var(--md-primary-text-color);fill:var(--md-primary-text-color)}:host([disabled]) .md-new-combobox .group .md-combobox-right-arrow,:host([disabled]) .md-new-combobox .group:active .md-combobox-right-arrow,:host([disabled]) .md-new-combobox .group:hover .md-combobox-right-arrow{border-color:var(--combobox-disabled-bg-color)}:host([disabled]) .md-new-combobox .md-combobox__multiwrap input{color:var(--combobox-disabled-bg-color)}:host([disabled]) .md-new-combobox .md-combobox__multiwrap input::-webkit-input-placeholder,:host([disabled]) .md-new-combobox .md-combobox__multiwrap input::placeholder{opacity:1;color:var(--combobox-disabled-bg-color)}:host([expanded]) .md-combobox-button.arrow-down{transform:rotate(180deg)}:host([invalid]) .group,:host([invalid]) .group:active,:host([invalid]) .group:hover{background:var(--combobox-invalid-bg-color,#ffe8e3);border-color:var(--combobox-invalid-border-color,#f7644a)}:host([invalid]) .md-combobox-error{padding:.1875rem 0 0 .75rem}.md-combobox-list{position:relative;height:2rem}.md-combobox .group{align-items:start;background:var(--combobox-bg-color,#fff);border:1px solid var(--combobox-border-color,#b2b2b2);border-radius:var(--combobox-group-radius,.25rem);display:flex;padding:0 .75rem;padding-right:.5rem;height:2.125rem}.md-combobox .group md-icon{color:var(--md-secondary-text-color,#545454);cursor:pointer;fill:var(--md-secondary-text-color,#545454);height:1.75rem}.md-combobox .group md-icon:focus{box-shadow:none;outline:0;box-shadow:0 0 0 .125rem var(--md-focus-border-color,#00a0d1)}.md-combobox .group .search-icon{height:100%}.md-combobox .group:hover{background:var(--combobox-hover-bg-color,#dedede)}.md-combobox .group:active{background:var(--combobox-pressed-bg-color,#ccc)}.md-combobox .group.multiselect:hover{background:var(--combobox-bg-color,#fff)}.md-combobox .group.multiselect:active{background:var(--combobox-bg-color,#fff)}.md-combobox .md-combobox-button[disabled] md-icon{color:var(--md-disabled-text-color,#b2b2b2)}.md-combobox--pill .group{border-radius:18px}.md-new-combobox .group{display:flex;align-items:center;border-radius:8px;background:rgba(0,0,0,0);height:2rem;max-width:100%;flex-grow:1}.md-new-combobox .group:not(.md-combobox-dropdown-arrow){padding-right:0}.md-new-combobox .group:not(.md-combobox-dropdown-arrow) .md-combobox-button{margin-left:0}.md-new-combobox .group span{margin-right:-.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:100%}.md-new-combobox .group.compact{height:1.75rem}.md-new-combobox .group.compact .md-combobox-button{width:20px;height:20px;justify-content:center;align-items:center}.md-new-combobox .group.compact .md-combobox__multiwrap{display:flex;align-items:center;width:50%;max-height:1.75rem}.md-new-combobox .group.compact .md-combobox__multiwrap input{height:1.75rem;min-width:0;flex-grow:1;flex-shrink:1;width:auto}.md-new-combobox .group .md-combobox-button.clear{margin-right:.25rem}.md-new-combobox .group md-icon{color:var(--md-primary-text-color);cursor:pointer;fill:var(--md-primary-text-color)}.md-new-combobox .group md-icon:focus{box-shadow:none;outline:0;box-shadow:0 0 0 .125rem var(--md-focus-border-color,#00a0d1)}.md-new-combobox .group:active{border:1px solid var(--combobox-border-color,#b2b2b2)}.md-new-combobox .md-combobox__multiwrap input{color:var(--md-primary-text-color)}.md-new-combobox .md-combobox__multiwrap .md-combobox-selected-item{border-radius:4px;background:var(--combobox-selected-new-bg-color,#dedede);border-color:var(--combobox-selected-new-border-color,#dedede)}.md-new-combobox .md-combobox__multiwrap .md-combobox-selected-item md-icon{font-size:16px}.md-new-combobox.md-error .group,.md-new-combobox.md-error .group:active{border-color:var(--input-error-border-color)!important}.md-new-combobox.md-error .group .md-combobox-right-arrow,.md-new-combobox.md-error .group:active .md-combobox-right-arrow{border-color:var(--input-error-border-color)}.md-new-combobox.md-warning .group,.md-new-combobox.md-warning .group:active{border-color:var(--input-warning-border-color)!important}.md-new-combobox.md-warning .group .md-combobox-right-arrow,.md-new-combobox.md-warning .group:active .md-combobox-right-arrow{border-color:var(--input-warning-border-color)!important}.md-new-combobox.md-success .group,.md-new-combobox.md-success .group:active{border-color:var(--input-success-border-color)!important}.md-new-combobox.md-success .group .md-combobox-right-arrow,.md-new-combobox.md-success .group:active .md-combobox-right-arrow{border-color:var(--input-success-border-color)!important}.md-new-combobox.md-combobox-readonly .group,.md-new-combobox.md-combobox-readonly .group:active,.md-new-combobox.md-combobox-readonly .group:hover{border-color:var(--combobox-disabled-bg-color)!important}.md-new-combobox.md-combobox-readonly .group .md-combobox-right-arrow,.md-new-combobox.md-combobox-readonly .group:active .md-combobox-right-arrow,.md-new-combobox.md-combobox-readonly .group:hover .md-combobox-right-arrow{border-color:var(--combobox-disabled-bg-color)!important}.help-text,.md-combobox__messages{padding-top:.25rem}.md-combobox-button{transition:all .15s linear;align-self:center;align-items:center;justify-content:center;background:rgba(0,0,0,0);border:0;cursor:pointer;margin:0;margin-left:calc(.25rem*2);outline:0;position:relative;vertical-align:bottom;height:inherit;display:inline-flex;border-radius:50%;width:1.25rem;height:1.25rem}.md-combobox-button .md-input__icon-clear{align-items:center;display:flex}.md-combobox-button md-icon{color:var(--combobox-dropdown-item-icon-color,#121212)}.md-combobox-button.clear{display:inline-flex;align-items:center;justify-content:center}.md-combobox-right-arrow{height:100%;display:flex;justify-content:center;align-items:center;width:2rem;border-left:1px solid var(--combobox-border-color,#b2b2b2)}.md-combobox-right-arrow .md-combobox-right-arrow{margin-left:0}.md-combobox-right-arrow .md-combobox-button.arrow-down:focus,.md-combobox-right-arrow .md-combobox-button.clear:focus{outline:0}.md-combobox-button.arrow-down:focus,.md-combobox-button.clear:focus{outline:2px solid var(--button-focus-ring-color,#007aa3)}div#md-combobox-listbox{background-color:var(--combobox-dropdown-bg-color,#fff);border:1px solid var(--combobox-border-color,#b2b2b2);border-radius:.5rem;box-shadow:0 4px 8px rgba(0,0,0,.16),0 0 1px rgba(0,0,0,.16);box-sizing:border-box;font-family:var(--brand-font-regular, "CiscoSansTT Regular", "Helvetica Neue", Helvetica, Arial, sans-serif);font-size:14px;left:0;list-style:none;margin:0;overflow:auto;overflow-x:hidden;position:absolute;top:calc(100% + .25rem);width:100%;padding:var(--wc-menu-padding,0)}div#md-combobox-listbox .no-result{padding:.3125rem .75rem .375rem}.virtual-scroll{overflow:auto;position:relative}.md-combobox-multi-input{width:initial}.highlight-text{font-weight:700}.selected-label-text{white-space:pre-wrap}.group-label{justify-content:space-between;font-weight:400;font-size:14px;line-height:19px;color:var(--combobox-group-label-color);padding:.3125rem .75rem .375rem;border-bottom:1px solid var(--combobox-group-label-border-color);display:flex;width:100%;background-color:var(--combobox-group-label-bg-color);border-radius:var(--wc-menu-item-rounded-border-radius)}.group-label:hover{background:unset;color:var(--combobox-group-label-color)}.group-label[focused]{background:var(--combobox-dropdown-item-focus-bg-color,#00a0d1);color:var(--combobox-dropdown-item-select-font-color,#121212)}.md-combobox-option{align-items:center;color:var(--md-primary-text-color,#f7f7f7);display:flex;margin:0;outline:0;padding:.3125rem .75rem .375rem;width:100%;border:solid 2px transparent;border-radius:var(--wc-menu-item-rounded-border-radius)}.md-combobox-option .select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:default;display:block;letter-spacing:normal;width:calc(100% - 1.25rem)}.md-combobox-option .select-label span{margin-right:-.25rem;white-space:nowrap}.md-combobox-option .select-option{background:var(--combobox-dropdown-item-select-bg-color,#fff);border:1px solid var(--combobox-select-border-color,#545454);border-radius:calc(.5rem/2);box-sizing:border-box;cursor:pointer;display:inline-block;height:1.25rem;margin-right:.75rem;min-width:1.25rem;position:relative}.md-combobox-option .select-option md-icon{height:1.125rem;left:.125rem;position:absolute;top:auto;vertical-align:top;visibility:hidden}.md-combobox-option:hover{background:var(--combobox-dropdown-item-hover-bg-color,#91ebff);color:var(--combobox-dropdown-item-select-font-color,#121212)}.md-combobox-option.md-combobox-multiselect{border-bottom:1px solid var(--md-primary-seperator-color,#545454);border-bottom-left-radius:0;border-bottom-right-radius:0}.md-combobox-option[aria-checked=true] .select-option{background:var(--combobox-dropdown-item-checked-bg-color,#00a0d1);border:1px solid var(--combobox-dropdown-item-checked-bg-color,#00a0d1)}.md-combobox-option[aria-checked=true] .select-option md-icon{color:var(--combobox-dropdown-item-checked-icon-color,#fff);visibility:visible}.md-combobox-option[focused]{border:2px solid var(--md-default-focus-outline-color)}.md-combobox-option[selected=true]{background:var(--combobox-dropdown-item-selected-bg-color,#00a0d1);color:var(--combobox-dropdown-item-select-font-color,#121212)}.md-combobox-option[selected=true] .select-option{border:1px solid #fff}.md-combobox__multiwrap{align-items:center;display:inline-flex;flex:1 1 auto;margin-left:0;max-height:calc(1.25rem*4.5);max-width:100%}.md-combobox__multiwrap .selected-count{color:var(--md-primary-text-color,#f7f7f7)}.md-combobox__multiwrap .md-combobox-selected-item{align-items:center;background:var(--combobox-selected-bg-color,#dedede);border:1px solid var(--combobox-selected-border-color,#ccc);border-radius:.875rem;box-sizing:border-box;cursor:pointer;display:flex;font-size:12px;margin-right:.25rem;max-height:1.5rem;padding:0 .75rem}.md-combobox__multiwrap .md-combobox-selected-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;max-width:calc(1.25rem*4)}.md-combobox__multiwrap .md-combobox-selected-item .remove-item{height:1.5rem}.md-combobox__multiwrap .md-combobox-selected-item:hover{background:var(--combobox-selected-hover,#b2b2b2)}.md-combobox__multiwrap .md-combobox-selected-item[selected]{background:var(--combobox-selected-hover,#b2b2b2)}.md-combobox__multiwrap input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:rgba(0,0,0,0);border:0;color:var(--md-secondary-text-color,#545454);display:inline-block;flex:1 1 auto;height:2rem;outline:0}.md-combobox__multiwrap ::input-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:100%}.md-combobox__multiwrap .remove-item{padding-left:calc(.25rem*3)}.md-combobox-has-leading-icon .md-combobox__multiwrap{margin-left:calc(.25rem*1.5)}input::-webkit-input-placeholder,input::placeholder{opacity:1;color:var(--combobox-placeholder-color,#545454)}@media(forced-colors:active){:host([focus-visible]) .group{border:none;outline:2px solid Highlight;box-shadow:none}.md-combobox-option .select-option{background:Canvas;color:CanvasText;border:1px solid CanvasText}.md-combobox-option[aria-checked=true] .select-option{background:Canvas;color:CanvasText;border:1px solid CanvasText}.md-combobox-option[aria-checked=true] .select-option md-icon{color:CanvasText;visibility:visible}.md-combobox-option[focused]{forced-color-adjust:none;color:Canvas;background-color:Highlight}}`,f=function(t,e,o,i){var s,r=arguments.length,l=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,o,i);else for(var n=t.length-1;n>=0;n--)(s=t[n])&&(l=(r<3?s(l):r>3?s(e,o,l):s(e,o))||l);return r>3&&l&&Object.defineProperty(e,o,l),l},v=function(t,e,o,i){return new(o||(o=Promise))((function(s,r){function l(t){try{d(i.next(t))}catch(t){r(t)}}function n(t){try{d(i.throw(t))}catch(t){r(t)}}function d(t){var e;t.done?s(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(l,n)}d((i=i.apply(t,e||[])).next())}))};!function(t){class e{determineMessageType(t){return t.reduce((t,e)=>"error"===e?t:e.type,"")}filterMessagesByType(t,e){return t.reduce((t,o)=>o.type===e?t.concat(o.message):t,[])}}t.MessageController=e;let o=class extends(Object(r.a)(a.LitElement)){constructor(){super(...arguments),this._focusedIndex=-1,this._focusedGroupIndex=-1,this.label="Options",this.options=[],this.customOptions=[],this.placeholder="",this.isMulti=!1,this.useVirtualScroll=!1,this.disabled=!1,this.ordered=!1,this.expanded=!1,this.groupExpandedList=[],this.searchItem=!1,this.compact=!1,this.noClearIcon=!1,this.selectWhenInFocus=!1,this.selectedOptions=[],this.visibleOptions=8,this.optionId="",this.optionValue="",this.isCustomContent=!1,this.searchable=!1,this.shape="none",this.value=[],this.inputValue="",this.allowCustomValue=!1,this.autofocus=!1,this.resultsTextLocalization="No Results",this.optionsTextLocalization="No Options",this.trimSpace=!1,this.invalid=!1,this.invalidText="",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForComboBox="",this.clearAriaLabel="Clear",this.arrowAriaLabel="Expand",this.clearIconHeight="auto",this.allTextLocalization="All",this.selectAllTextLocalization="Select All",this.selectedTextLocalization="Selected",this.allowSelectAll=!1,this.showCustomError=!1,this.showLoader=!1,this.showSelectedCount=!1,this.popupChevronAriaHidden="true",this.newMomentum=!1,this.showFilterIcon=!1,this.isDropdownArrow=!1,this.comboboxId="",this.helpText="",this.messageArr=[],this.htmlId="",this.readOnly=!1,this.messageController=new e,this.isOptGroup=!1,this.isSelectAllChecked=!1,this.multiSelectedIndex=-1,this.multiSelected=[],this.customContent=[],this.notifySelectedChange=Object(n.b)(t=>{this.dispatchEvent(new CustomEvent("change-selected",{composed:!0,bubbles:!0,detail:t}))},0),this.handleGroupFilter=t=>{const e=t.filter(t=>{if("string"!=typeof t&&"true"===t.isLabel)return t.groupName});return this.searchItem=!0,this.groupExpandedList=e.map(t=>{if("string"!=typeof t)return t.groupName}),t.filter(e=>{if("string"!=typeof e&&"true"===e.isLabel){return!!t.find(t=>{if("string"!=typeof e&&"string"!=typeof t)return e.groupName===t.groupName&&"false"===t.isLabel})}return!0})},this.notifyInputValueChanged=Object(n.b)(t=>{this.dispatchEvent(new CustomEvent("combobox-input",{composed:!0,bubbles:!0,detail:{value:t}})),this.notifySearchResultCount(),this.focusedGroupIndex=0,requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})},250),this.handleOutsideClick=t=>{let e=!1;const o=t.composedPath();o.length&&(e=!!o.find(t=>t===this),e||(this.setVisualListbox(!1),this.unselectedAllMultiTag()))}}get focusedIndex(){return this._focusedIndex}set focusedIndex(t){this.updateFocusedIndex(t)}updateFocusedIndex(t){var e;const o=this._focusedIndex;if(this.checkForVirtualScroll()){let o;o=this.allowSelectAll?0===t?"selectAll":this.getOptionId(this.filteredOptions[t-1]):this.getOptionId(this.filteredOptions[t]);const i=this.lists?null===(e=[...this.lists])||void 0===e?void 0:e.find(t=>0!==t.offsetHeight&&t.id===o):"";this.lists&&[...this.lists].forEach(t=>{t.toggleAttribute("focused",!1)}),i&&(null==i||i.toggleAttribute("focused",!0))}else if(this.lists){const e=this.lists[o];e&&e.toggleAttribute("focused",!1);const i=this.lists[t];i&&i.toggleAttribute("focused",!0)}this._focusedIndex=t,this.requestUpdate("focusedIndex",o)}get focusedGroupIndex(){return this._focusedGroupIndex}set focusedGroupIndex(t){const e=this._focusedGroupIndex;if(this.labels&&0!==this.labels.length){const o=this.labels[e];o&&o.toggleAttribute("focused",!1);const i=this.labels[t];i&&(i.toggleAttribute("focused",!0),i.focus())}this._focusedGroupIndex=t,this.requestUpdate("focusedGroupIndex",e)}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}notifySearchResultCount(){if(this.searchResultAriaLabel){const t=/{{.*?}}/g;this.ariaLabelForComboBox=this.searchResultAriaLabel.replace(t,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForComboBox=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForComboBox=`ComboBox Element, ${this.filteredOptions.length} results found.`}firstUpdated(t){this.ariaLabelForComboBox=this.ariaLabel?this.ariaLabel:"ComboBox Element",super.firstUpdated(t),this.isCustomContent&&(this.optionId="id",this.optionValue="value",this.setOptionCustomContent()),this.setInitialValue()}updated(t){super.updated(t),t.has("expanded")&&(this.expanded?(this.resizeListbox(),this.checkSelectedOptions()):this.unCheckAllOptions()),t.has("focusedIndex")&&this.focusedIndex>=0&&(this.checkForVirtualScroll()||this.scrollToOption()),t.has("value")&&0===this.selectedOptions.length&&this.setInitialValue(),t.has("customOptions")&&this.isCustomContent&&(this.setOptionCustomContent(),this.resizeListbox()),t.has("showCustomError")&&this.resizeListbox(),t.has("showLoader")&&this.resizeListbox(),t.has("searchItem")&&this.resizeListbox()}handleFocusIn(t){this.disabled&&!this.readOnly||(this.noClearIcon&&(requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}),this.selectWhenInFocus&&this.input.select()),super.handleFocusIn&&super.handleFocusIn(t)),this.dispatchEvent(new CustomEvent("combobox-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(t){super.handleFocusOut&&super.handleFocusOut(t),this.dispatchEvent(new CustomEvent("combobox-focus-out",{composed:!0,bubbles:!0}))}findFilteredOption(t){return this.isOptionObject(t)?this.filteredOptions.findIndex(e=>this.getOptionId(e)===this.getOptionId(t)&&this.getOptionValue(e)===this.getOptionValue(t)):this.filteredOptions.indexOf(t)}setInitialValue(){var t;if(this.value.length)if(this.isMulti)this.value.forEach(t=>{-1!==this.findFilteredOption(t)&&this.setSelectedOption(t)});else{const e=this.value[0],o=this.findFilteredOption(e);-1!==o&&(this.setSelectedOption(e),this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)),this.focusedIndex=o,this.focusedGroupIndex=-1)}}isOptionObject(t){return"object"==typeof t&&null!==t}setOptionCustomContent(){if(this.isOptGroup){const t=[...this.querySelectorAll("optgroup")],e=[];for(const o of t){const t=o.getAttribute("label"),i=[...o.querySelectorAll("[slot]")];e.push({isLabel:"true",[this.optionValue]:t,groupName:t});for(const o of i){const i=o.getAttribute("aria-label"),s=o.getAttribute("display-value"),r=o.getAttribute("slot");i&&s&&e.push({[this.optionId]:i,[this.optionValue]:s,isLabel:"false",groupName:t,slot:r})}}this.options=e}else this.customContent=[...this.querySelectorAll("[slot]")],this.customContent&&this.customContent.length?this.options=this.customContent.map(t=>{const e=t.getAttribute("aria-label"),o=t.getAttribute("display-value");if(e&&o)return{[this.optionId]:e,[this.optionValue]:o}}):this.options=[]}getOptionValue(t){return this.isOptionObject(t)?t[this.optionValue]:t}getOptionGroupName(t){return null==t?void 0:t.groupName}getOptionId(t){return this.isOptionObject(t)?t[this.optionId]:t}getFocusedItem(t){if(t>=0)return this.filteredOptions[t]}setupEvents(){document.addEventListener("click",this.handleOutsideClick),this.addEventListener("remove-all-selected",this.removeAllSelected),this.addEventListener("selected-changed",this.selectedChange)}teardownEvents(){document.removeEventListener("click",this.handleOutsideClick),this.removeEventListener("remove-all-selected",this.removeAllSelected),this.removeEventListener("selected-changed",this.selectedChange)}setVisualListbox(t){this.expanded=t}setGroupList(t){this.groupExpandedList.includes(t)?(this.groupExpandedList.splice(this.groupExpandedList.indexOf(t),1),this.groupExpandedList=[...this.groupExpandedList]):this.searchItem?this.groupExpandedList.push(t):this.groupExpandedList=[t]}findSelectedOption(t){return this.optionId&&t?this.selectedOptions.findIndex(e=>e&&e[this.optionId]===t[this.optionId]):this.selectedOptions.indexOf(t)}findOptionIndex(t){const e=t.composedPath();if(this.checkForVirtualScroll()){let t="";return[...this.lists].forEach(o=>{e.includes(o)&&(t=o.id)}),this.filteredOptions.findIndex(e=>this.getOptionId(e)===t)}return[...this.lists].findIndex(t=>e.includes(t))}checkSelectedOptions(){if(this.checkForVirtualScroll()){const t=this.selectedOptions.map(t=>this.getOptionId(t)),e=[...this.lists].filter(t=>"selectAll"!==t.id);null==e||e.forEach(e=>{t.includes(e.id)?(this.isMulti&&(null==e||e.setAttribute("aria-checked","true")),null==e||e.setAttribute("aria-selected","true")):this.isMulti&&(null==e||e.setAttribute("aria-checked","false"))})}}unCheckAllOptions(){var t;this.checkForVirtualScroll()&&this.isMulti&&(null===(t=[...this.lists])||void 0===t||t.forEach(t=>{"selectAll"!==(null==t?void 0:t.id)&&(null==t||t.setAttribute("aria-checked","false"))}))}setSelectedOption(t){this.isMulti||(this.selectedOptions=[]);const e=this.findSelectedOption(t);if(-1!==e){const t=this.selectedOptions[e];this.selectedOptions.splice(e,1),this.notifySelectedChange({value:t,selected:this.selectedOptions})}else this.selectedOptions.push(t),this.notifySelectedChange({value:t,selected:this.selectedOptions});this.checkSelectedOptions(),this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()),this.requestUpdate()}filterOptions(t){if(t&&t.length){const e=this.options.filter(e=>this.isOptGroup&&"string"!=typeof e&&"true"===e.isLabel?e:(this.isCustomContent?this.getOptionId(e):this.getOptionValue(e)).toLowerCase().includes(t.toLowerCase()));return this.isOptGroup?this.handleGroupFilter(e):e}return this.searchItem=!1,this.options}getListBoxVerticalPadding(){if(this.listBox){const t=window.getComputedStyle(this.listBox,null),e=parseInt(t.getPropertyValue("padding-top"))+parseInt(t.getPropertyValue("padding-bottom"));if(!isNaN(e))return e+2}return 10}resizeListbox(){this.updateOnNextFrame(()=>{var t;let e=0,o=0,i=0;const s=this.getListBoxVerticalPadding();if(this.lists){const t=this.checkForVirtualScroll()?[...this.lists].filter(t=>0!==t.offsetHeight):[...this.lists];e=t.slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0),i=this.checkForVirtualScroll()&&this.allowSelectAll?t.slice(1,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0):t.slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)}if(this.labels&&(o=[...this.labels].slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)),this.listBox&&(this.listBox.style.maxHeight=e+o+s+"px"),this.virtualizer&&(this.virtualizer.style.height=i+s+"px"),this.showCustomError||this.showLoader){const e=null===(t=this.listBox)||void 0===t?void 0:t.querySelector("[slot]");this.listBox&&e&&(this.listBox.style.height=e.clientHeight+s+"px",this.listBox.style.maxHeight=e.clientHeight+s+"px")}})}setInputValue(t=""){this.input.value=t}updateOnNextFrame(t){requestAnimationFrame(t)}unCheckedAllOptions(){this.isMulti&&(this.lists.forEach((t,e)=>this.unCheckedOption(e)),this.isSelectAllChecked=!1)}unCheckedOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","false"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}checkAllOptions(){this.isMulti&&this.lists.forEach((t,e)=>this.checkOption(e))}checkOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","true"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}isSelectAllSelected(){return this.selectedOptions.length===this.options.length}setFocusOnHost(t){this.setFocus&&this.setFocus(t)}isOptionFocused(t){return this.focusedIndex===t}getAriaState(t){return this.isOptionFocused(t)}scrollToOption(){var t,e;let o=0;const{top:i,bottom:s}=this.listBox.getBoundingClientRect(),r=this.lists[this.focusedIndex],l=null===(t=this.lists[this.focusedIndex+1]||r)||void 0===t?void 0:t.getBoundingClientRect(),n=null===(e=this.lists[this.focusedIndex-1]||r)||void 0===e?void 0:e.getBoundingClientRect();(null==l?void 0:l.bottom)>s?o=l.bottom-s+2:(null==n?void 0:n.top)<i&&(o=n.top-i-2),this.updateOnNextFrame(()=>{this.listBox.scrollTop+=o})}getCustomContentName(t){const e=this.options.indexOf(t);if(this.isOptGroup){const t=this.options[e];if(t&&"string"!=typeof t)return t.slot}else if(-1!==e)return this.customContent[e].slot}setInputSelectionRange(t,e){this.input.setSelectionRange(t,e)}isOptionChecked(t){return-1!==this.findSelectedOption(t)?"true":"false"}getInputSelection(){return this.input.selectionStart}canMultiSelect(){return 0===this.getInputSelection()&&0!==this.selectedOptions.length&&this.isMulti}removeMultiTag(){this.selected&&this.multiSelected.forEach(t=>{const e=this.selected[t];e&&e.hasAttribute("selected")&&this.removeSelected(this.selectedOptions[t])})}unselectedAllMultiTag(){this.selected&&this.selected.forEach(t=>t.removeAttribute("selected")),this.multiSelectedIndex=-1}findLastMultiSelected(){return this.selected[this.multiSelectedIndex]}toggleMultiSelectedTag(t,e){t&&t.toggleAttribute("selected",e)}selectMultiTag(t){if(this.canMultiSelect()){if(!t){this.multiSelected=[];const t=this.findLastMultiSelected();this.toggleMultiSelectedTag(t,!1)}this.multiSelectedIndex<=0?this.multiSelectedIndex=this.selectedOptions.length-1:this.multiSelectedIndex--,this.multiSelected.push(this.multiSelectedIndex);const e=this.findLastMultiSelected();this.toggleMultiSelectedTag(e,!0)}}handleListClick(t){return v(this,void 0,void 0,(function*(){this.dispatchEvent(new CustomEvent("selected-changed",{detail:{event:t}})),yield this.updateComplete,this.isMulti?this.setVisualListbox(!0):this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}))}handleSelectAll(){return v(this,void 0,void 0,(function*(){this.isSelectAllChecked=!this.isSelectAllChecked,this.isSelectAllChecked?(this.selectedOptions=[...this.options],this.checkAllOptions()):(this.selectedOptions=[],this.unCheckedAllOptions()),yield this.updateComplete,this.setVisualListbox(!0),this.notifySelectedChange({selected:this.selectedOptions})}))}handleInputKeyUp(t){switch(t.code){case s.b.Escape:break;case s.b.Backspace:this.setFocusOnHost(!0),this.setVisualListbox(!0),this.resizeListbox(),this.removeMultiTag();break;case s.b.ArrowLeft:this.isMulti&&(t.shiftKey?this.selectMultiTag(!0):this.selectMultiTag(!1));break;default:this.isMulti&&this.unselectedAllMultiTag()}}handleInput(t){const e=t.target.value;this.inputValue=e.trim(),this.notifyInputValueChanged(e.trim())}removeAllSelected(){var t;this.focusedIndex=-1,this.focusedGroupIndex=-1,this.selectedOptions=[],this.inputValue="",this.setInputValue(),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,""),this.setVisualListbox(!1),this.unCheckedAllOptions(),this.setSelectedAttribute(void 0),this.updateOnNextFrame(()=>{this.input.focus()}),this.notifySelectedChange({selected:this.selectedOptions})}removeSelected(t){const e=this.findSelectedOption(t),o=this.filteredOptions.indexOf(t);-1!==o&&this.unCheckedOption(o),-1!==e&&(this.selectedOptions.splice(e,1),this.requestUpdate()),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}selectedChange(t){var e;const{event:o}=t.detail;let i=this.findOptionIndex(o);if(-1!==i){this.focusedIndex=this.allowSelectAll&&this.checkForVirtualScroll()?i+1:i,this.isMulti&&this.allowSelectAll&&!this.checkForVirtualScroll()&&(i-=1);const t=this.getFocusedItem(i);this.setSelectedAttribute(t),t&&(this.setSelectedOption(t),this.isMulti?this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()):(this.setInputValue(this.getOptionValue(t)),null===(e=this.input)||void 0===e||e.setAttribute(s.a.AriaActivedescendant,this.getOptionId(t))))}}setSelectedAttribute(t){var e;let o="";t&&(o=this.getOptionId(t)),null===(e=this.lists)||void 0===e||e.forEach((t,e)=>{(null==t?void 0:t.id)===o?null==t||t.setAttribute("selected","true"):null==t||t.setAttribute("selected","false")})}shouldChangeButton(){const t=this.input&&this.input.value.length>0&&!this.noClearIcon||this.isMulti&&this.selectedOptions.length&&!this.noClearIcon;return t&&document.dispatchEvent(new CustomEvent("on-widget-update")),t}setCustomValue(){this.optionId||this.optionValue||(this.options=[...this.options,this.inputValue],this.setSelectedOption(this.inputValue),this.isMulti||this.updateOnNextFrame(()=>{var t;this.focusedIndex=this.filteredOptions.length-1;const e=this.getFocusedItem(this.focusedIndex);e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)))}),this.dispatchEvent(new CustomEvent("custom-value-add",{composed:!0,bubbles:!0,detail:{value:this.inputValue}}))),this.inputValue=""}handleGroupFocus(){this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.filteredGroupOptions.length>0&&-1===this.focusedGroupIndex&&(this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===this.groupExpandedList[0])),this.updateOnNextFrame(()=>{-1===this.focusedGroupIndex||!this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length-1||this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length?this.focusedGroupIndex=0:this.focusedGroupIndex++}),this.focusedIndex=-1}handleInputKeyDown(t){var e,o;switch(t.code){case s.b.Backspace:this.focusedIndex=-1;break;case s.b.Tab:case s.b.Enter:if(this.setFocusOnHost(!0),this.expanded&&this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);if(this.allowCustomValue&&this.input&&this.input.value.length){if(-1===this.findFilteredOption(this.inputValue))return void this.setCustomValue()}e&&(this.setSelectedAttribute(e),this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()}),this.setVisualListbox(!1),t.code===s.b.Tab&&this.isMulti)return;break;case s.b.ArrowDown:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case s.b.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)),this.focusedGroupIndex=-1)});break;case s.b.ArrowLeft:case s.b.ArrowRight:t.stopPropagation();break;case s.b.Escape:this.setFocusOnHost(!0),this.expanded?(t.stopPropagation(),this.setVisualListbox(!1)):(this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(s.a.AriaActivedescendant,""),this.focusedIndex=-1,this.focusedGroupIndex=-1,this.removeAllSelected(),this.setSelectedAttribute(void 0));break;case s.b.Home:this.setInputSelectionRange(0,0);break;case s.b.End:{const{length:t}=this.inputValue;this.setInputSelectionRange(t,t)}break;case s.b.Space:if(this.isMulti&&this.expanded){t.preventDefault();const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.setSelectedAttribute(e),this.showSelectedCount||(this.setInputValue(),null===(o=this.input)||void 0===o||o.setAttribute(s.a.AriaActivedescendant,""))),0===this.focusedIndex&&this.allowSelectAll&&this.handleSelectAll()}this.expanded=!0}}handleGroupLabelKeyDown(t,e){switch(t.code){case s.b.Tab:this.handleGroupFocus();break;case s.b.Enter:case s.b.Space:-1!==this.focusedGroupIndex?this.toggleGroupListBox(t,e.value):(this.setFocusOnHost(!0),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()}));break;case s.b.ArrowDown:if(0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case s.b.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)))});break;case s.b.Escape:this.focusedGroupIndex=-1,this.setVisualListbox(!1),this.setFocusOnHost(!0),this.input.focus();break;default:this.setVisualListbox(!0)}}toggleVisualListBox(t){var e,o;if(!this.readOnly){if(t.target.classList.contains("md-combobox-listbox"))t.target.focus();else if("md-icon"===t.target.localName){const i=null===(o=null===(e=t.target.parentElement)||void 0===e?void 0:e.parentElement)||void 0===o?void 0:o.parentElement;if(i){const t=i.querySelector(".md-combobox-listbox");Object(g.setTimeout)(()=>{t.focus()},10)}}this.expanded?this.setVisualListbox(!1):(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.setVisualListbox(!0)),this.input.focus(),this.setGroupList(""),this.focusedGroupIndex=-1}}toggleGroupListBox(t,e){t.stopPropagation(),this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===e),this.setGroupList(e),this.resizeListbox()}handleRemoveAll(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}connectedCallback(){super.connectedCallback(),this.setupEvents();this.querySelector("optgroup")&&(this.isOptGroup=!0)}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}static get styles(){return[d.a,x]}get listItemOptionMap(){return{"md-combobox-multiselect":this.isMulti,compact:this.compact}}get filteredOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t&&this.groupExpandedList.includes(this.getOptionGroupName(t))?"false"===t.isLabel:void 0))}get filteredGroupOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t?"true"===t.isLabel:void 0))}get comboBoxTemplateClassMap(){return{["md-combobox--"+this.shape]:!!this.shape,"md-combobox-searchable":this.searchable,"md-combobox-has-leading-icon":this.searchable||this.showFilterIcon,"md-new-combobox":this.newMomentum,["md-"+this.messageType]:!!this.messageType,"md-combobox-readonly":this.readOnly,"md-combobox-compact":this.compact,"md-combobox-dropdown-arrow":this.isDropdownArrow}}searchIconTemplate(){return this.leadingIconTemplate("search-bold","search-icon")}filterIconTemplate(){return this.leadingIconTemplate("filter-bold","filter-icon")}leadingIconTemplate(t,e){return a.html`
1
+ (window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[30],{55:function(t,e,o){"use strict";o.r(e),o.d(e,"ComboBox",(function(){return i}));o(56),o(14);var i,s=o(1),r=o(7),l=o(5),n=o(16),d=o(6),a=o(0),c=o(2),h=o(4),p=o(3),u=o(13),b=o(8),m=o(30),g=o(65),x=a.css`:host{--combobox-input-clear-bg:var(--combobox-group-button-bg-color, $lm-combobox-group-button-bg-color-light)}:host .group{background:var(--combobox-bg-color,#fff)}:host(:focus){box-shadow:none!important;outline:0!important}:host(:active) .md-new-combobox .group{outline:2px solid var(--input-default-outline-color);outline-offset:.125rem;box-shadow:none;border:1px solid var(--combobox-border-color,#b2b2b2)!important}:host(:active) .md-new-combobox .md-combobox-right-arrow{border-left:1px solid var(--combobox-border-color,#b2b2b2)}:host([focus-visible]) .group{border-color:var(--combobox-focus-border-color);box-shadow:none}:host([focus-visible]) .md-new-combobox .group{outline:2px solid var(--combobox-focus-border-color);outline-offset:.125rem;box-shadow:none;border-color:var(--combobox-focus-new-border-color);background-color:var(--combobox-focus-bg-color)}:host([focus-visible]) .md-new-combobox .md-combobox-right-arrow{border-color:var(--combobox-focus-new-border-color)}:host([disabled]) .group,:host([disabled]) .group:active,:host([disabled]) .group:hover{background:var(--combobox-disabled-bg-color,#ededed);pointer-events:none}:host([disabled]) .group md-icon,:host([disabled]) .group:active md-icon,:host([disabled]) .group:hover md-icon{opacity:.3}:host([disabled]) .md-new-combobox .group,:host([disabled]) .md-new-combobox .group:active,:host([disabled]) .md-new-combobox .group:hover{outline:0;box-shadow:none;border-color:var(--combobox-disabled-bg-color)!important;background-color:rgba(0,0,0,0)}:host([disabled]) .md-new-combobox .group md-icon,:host([disabled]) .md-new-combobox .group:active md-icon,:host([disabled]) .md-new-combobox .group:hover md-icon{color:var(--md-primary-text-color);fill:var(--md-primary-text-color)}:host([disabled]) .md-new-combobox .group .md-combobox-right-arrow,:host([disabled]) .md-new-combobox .group:active .md-combobox-right-arrow,:host([disabled]) .md-new-combobox .group:hover .md-combobox-right-arrow{border-color:var(--combobox-disabled-bg-color)}:host([disabled]) .md-new-combobox .md-combobox__multiwrap input{color:var(--combobox-disabled-bg-color)}:host([disabled]) .md-new-combobox .md-combobox__multiwrap input::-webkit-input-placeholder,:host([disabled]) .md-new-combobox .md-combobox__multiwrap input::placeholder{opacity:1;color:var(--combobox-disabled-bg-color)}:host([expanded]) .md-combobox-button.arrow-down{transform:rotate(180deg)}:host([invalid]) .group,:host([invalid]) .group:active,:host([invalid]) .group:hover{background:var(--combobox-invalid-bg-color,#ffe8e3);border-color:var(--combobox-invalid-border-color,#f7644a)}:host([invalid]) .md-combobox-error{padding:.1875rem 0 0 .75rem}.md-combobox-list{position:relative;height:2rem}.md-combobox .group{align-items:start;background:var(--combobox-bg-color,#fff);border:1px solid var(--combobox-border-color,#b2b2b2);border-radius:var(--combobox-group-radius,.25rem);display:flex;padding:0 .75rem;padding-right:.5rem;height:2.125rem}.md-combobox .group md-icon{color:var(--md-secondary-text-color,#545454);cursor:pointer;fill:var(--md-secondary-text-color,#545454);height:1.75rem}.md-combobox .group md-icon:focus{box-shadow:none;outline:0;box-shadow:0 0 0 .125rem var(--md-focus-border-color,#00a0d1)}.md-combobox .group .search-icon{height:100%}.md-combobox .group:hover{background:var(--combobox-hover-bg-color,#dedede)}.md-combobox .group:active{background:var(--combobox-pressed-bg-color,#ccc)}.md-combobox .group.multiselect:hover{background:var(--combobox-bg-color,#fff)}.md-combobox .group.multiselect:active{background:var(--combobox-bg-color,#fff)}.md-combobox .md-combobox-button[disabled] md-icon{color:var(--md-disabled-text-color,#b2b2b2)}.md-combobox--pill .group{border-radius:18px}.md-new-combobox .group{display:flex;align-items:center;border-radius:8px;background:rgba(0,0,0,0);height:2rem;max-width:100%;flex-grow:1}.md-new-combobox .group.md-combobox-dropdown-arrow{padding-right:.5rem}.md-new-combobox .group:not(.md-combobox-dropdown-arrow){padding-right:0}.md-new-combobox .group:not(.md-combobox-dropdown-arrow) .md-combobox-button{margin-left:0}.md-new-combobox .group:not(.md-combobox-dropdown-arrow) .md-combobox-button.clear{margin-right:.25rem}.md-new-combobox .group span{margin-right:-.25rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:100%}.md-new-combobox .group.compact{height:1.75rem}.md-new-combobox .group.compact .md-combobox-button{width:20px;height:20px;justify-content:center;align-items:center}.md-new-combobox .group.compact .md-combobox__multiwrap{display:flex;align-items:center;width:50%;max-height:1.75rem}.md-new-combobox .group.compact .md-combobox__multiwrap input{height:1.75rem;min-width:0;flex-grow:1;flex-shrink:1;width:auto}.md-new-combobox .group md-icon{color:var(--md-primary-text-color);cursor:pointer;fill:var(--md-primary-text-color)}.md-new-combobox .group md-icon:focus{box-shadow:none;outline:0;box-shadow:0 0 0 .125rem var(--md-focus-border-color,#00a0d1)}.md-new-combobox .group:active{border:1px solid var(--combobox-border-color,#b2b2b2)}.md-new-combobox .md-combobox__multiwrap input{color:var(--md-primary-text-color)}.md-new-combobox .md-combobox__multiwrap .md-combobox-selected-item{border-radius:4px;background:var(--combobox-selected-new-bg-color,#dedede);border-color:var(--combobox-selected-new-border-color,#dedede)}.md-new-combobox .md-combobox__multiwrap .md-combobox-selected-item md-icon{font-size:16px}.md-new-combobox.md-error .group,.md-new-combobox.md-error .group:active{border-color:var(--input-error-border-color)!important}.md-new-combobox.md-error .group .md-combobox-right-arrow,.md-new-combobox.md-error .group:active .md-combobox-right-arrow{border-color:var(--input-error-border-color)}.md-new-combobox.md-warning .group,.md-new-combobox.md-warning .group:active{border-color:var(--input-warning-border-color)!important}.md-new-combobox.md-warning .group .md-combobox-right-arrow,.md-new-combobox.md-warning .group:active .md-combobox-right-arrow{border-color:var(--input-warning-border-color)!important}.md-new-combobox.md-success .group,.md-new-combobox.md-success .group:active{border-color:var(--input-success-border-color)!important}.md-new-combobox.md-success .group .md-combobox-right-arrow,.md-new-combobox.md-success .group:active .md-combobox-right-arrow{border-color:var(--input-success-border-color)!important}.md-new-combobox.md-combobox-readonly .group,.md-new-combobox.md-combobox-readonly .group:active,.md-new-combobox.md-combobox-readonly .group:hover{border-color:var(--combobox-disabled-bg-color)!important}.md-new-combobox.md-combobox-readonly .group .md-combobox-right-arrow,.md-new-combobox.md-combobox-readonly .group:active .md-combobox-right-arrow,.md-new-combobox.md-combobox-readonly .group:hover .md-combobox-right-arrow{border-color:var(--combobox-disabled-bg-color)!important}.help-text,.md-combobox__messages{padding-top:.25rem}.md-combobox-button{transition:all .15s linear;align-self:center;align-items:center;justify-content:center;background:rgba(0,0,0,0);border:0;cursor:pointer;margin:0;margin-left:calc(.25rem*2);outline:0;position:relative;vertical-align:bottom;height:inherit;display:inline-flex;border-radius:50%;width:1.25rem;height:1.25rem}.md-combobox-button .md-input__icon-clear{align-items:center;display:flex}.md-combobox-button md-icon{color:var(--combobox-dropdown-item-icon-color,#121212)}.md-combobox-button.clear{display:inline-flex;align-items:center;justify-content:center}.md-combobox-right-arrow{height:100%;display:flex;justify-content:center;align-items:center;width:2rem;border-left:1px solid var(--combobox-border-color,#b2b2b2)}.md-combobox-right-arrow .md-combobox-right-arrow{margin-left:0}.md-combobox-right-arrow .md-combobox-button.arrow-down:focus,.md-combobox-right-arrow .md-combobox-button.clear:focus{outline:0}.md-combobox-button.arrow-down:focus,.md-combobox-button.clear:focus{outline:2px solid var(--button-focus-ring-color,#007aa3)}div#md-combobox-listbox{background-color:var(--combobox-dropdown-bg-color,#fff);border:1px solid var(--combobox-border-color,#b2b2b2);border-radius:.5rem;box-shadow:0 4px 8px rgba(0,0,0,.16),0 0 1px rgba(0,0,0,.16);box-sizing:border-box;font-family:var(--brand-font-regular, "CiscoSansTT Regular", "Helvetica Neue", Helvetica, Arial, sans-serif);font-size:14px;left:0;list-style:none;margin:0;overflow:auto;overflow-x:hidden;position:absolute;top:calc(100% + .25rem);width:100%;padding:var(--wc-menu-padding,0)}div#md-combobox-listbox .no-result{padding:.3125rem .75rem .375rem}.virtual-scroll{overflow:auto;position:relative}.md-combobox-multi-input{width:initial}.highlight-text{font-weight:700}.selected-label-text{white-space:pre-wrap}.group-label{justify-content:space-between;font-weight:400;font-size:14px;line-height:19px;color:var(--combobox-group-label-color);padding:.3125rem .75rem .375rem;border-bottom:1px solid var(--combobox-group-label-border-color);display:flex;width:100%;background-color:var(--combobox-group-label-bg-color);border-radius:var(--wc-menu-item-rounded-border-radius)}.group-label:hover{background:unset;color:var(--combobox-group-label-color)}.group-label[focused]{background:var(--combobox-dropdown-item-focus-bg-color,#00a0d1);color:var(--combobox-dropdown-item-select-font-color,#121212)}.md-combobox-option{align-items:center;color:var(--md-primary-text-color,#f7f7f7);display:flex;margin:0;outline:0;padding:.3125rem .75rem .375rem;width:100%;border:solid 2px transparent;border-radius:var(--wc-menu-item-rounded-border-radius)}.md-combobox-option .select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:default;display:block;letter-spacing:normal;width:calc(100% - 1.25rem)}.md-combobox-option .select-label span{margin-right:-.25rem;white-space:nowrap}.md-combobox-option .select-option{background:var(--combobox-dropdown-item-select-bg-color,#fff);border:1px solid var(--combobox-select-border-color,#545454);border-radius:calc(.5rem/2);box-sizing:border-box;cursor:pointer;display:inline-block;height:1.25rem;margin-right:.75rem;min-width:1.25rem;position:relative}.md-combobox-option .select-option md-icon{height:1.125rem;left:.125rem;position:absolute;top:auto;vertical-align:top;visibility:hidden}.md-combobox-option:hover{background:var(--combobox-dropdown-item-hover-bg-color,#91ebff);color:var(--combobox-dropdown-item-select-font-color,#121212)}.md-combobox-option.md-combobox-multiselect{border-bottom:1px solid var(--md-primary-seperator-color,#545454);border-bottom-left-radius:0;border-bottom-right-radius:0}.md-combobox-option[aria-checked=true] .select-option{background:var(--combobox-dropdown-item-checked-bg-color,#00a0d1);border:1px solid var(--combobox-dropdown-item-checked-bg-color,#00a0d1)}.md-combobox-option[aria-checked=true] .select-option md-icon{color:var(--combobox-dropdown-item-checked-icon-color,#fff);visibility:visible}.md-combobox-option[focused]{border:2px solid var(--md-default-focus-outline-color)}.md-combobox-option[selected=true]{background:var(--combobox-dropdown-item-selected-bg-color,#00a0d1);color:var(--combobox-dropdown-item-select-font-color,#121212)}.md-combobox-option[selected=true] .select-option{border:1px solid #fff}.md-combobox__multiwrap{align-items:center;display:inline-flex;flex:1 1 auto;margin-left:0;max-height:calc(1.25rem*4.5);max-width:100%}.md-combobox__multiwrap .selected-count{color:var(--md-primary-text-color,#f7f7f7)}.md-combobox__multiwrap .md-combobox-selected-item{align-items:center;background:var(--combobox-selected-bg-color,#dedede);border:1px solid var(--combobox-selected-border-color,#ccc);border-radius:.875rem;box-sizing:border-box;cursor:pointer;display:flex;font-size:12px;margin-right:.25rem;max-height:1.5rem;padding:0 .75rem}.md-combobox__multiwrap .md-combobox-selected-item span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;max-width:calc(1.25rem*4)}.md-combobox__multiwrap .md-combobox-selected-item .remove-item{height:1.5rem}.md-combobox__multiwrap .md-combobox-selected-item:hover{background:var(--combobox-selected-hover,#b2b2b2)}.md-combobox__multiwrap .md-combobox-selected-item[selected]{background:var(--combobox-selected-hover,#b2b2b2)}.md-combobox__multiwrap input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:rgba(0,0,0,0);border:0;color:var(--md-secondary-text-color,#545454);display:inline-block;flex:1 1 auto;height:2rem;outline:0}.md-combobox__multiwrap ::input-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:100%}.md-combobox__multiwrap .remove-item{padding-left:calc(.25rem*3)}.md-combobox-has-leading-icon .md-combobox__multiwrap{margin-left:calc(.25rem*1.5)}input::-webkit-input-placeholder,input::placeholder{opacity:1;color:var(--combobox-placeholder-color,#545454)}@media(forced-colors:active){:host([focus-visible]) .group{border:none;outline:2px solid Highlight;box-shadow:none}.md-combobox-option .select-option{background:Canvas;color:CanvasText;border:1px solid CanvasText}.md-combobox-option[aria-checked=true] .select-option{background:Canvas;color:CanvasText;border:1px solid CanvasText}.md-combobox-option[aria-checked=true] .select-option md-icon{color:CanvasText;visibility:visible}.md-combobox-option[focused]{forced-color-adjust:none;color:Canvas;background-color:Highlight}}`,f=function(t,e,o,i){var s,r=arguments.length,l=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(t,e,o,i);else for(var n=t.length-1;n>=0;n--)(s=t[n])&&(l=(r<3?s(l):r>3?s(e,o,l):s(e,o))||l);return r>3&&l&&Object.defineProperty(e,o,l),l},v=function(t,e,o,i){return new(o||(o=Promise))((function(s,r){function l(t){try{d(i.next(t))}catch(t){r(t)}}function n(t){try{d(i.throw(t))}catch(t){r(t)}}function d(t){var e;t.done?s(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(l,n)}d((i=i.apply(t,e||[])).next())}))};!function(t){class e{determineMessageType(t){return t.reduce((t,e)=>"error"===e?t:e.type,"")}filterMessagesByType(t,e){return t.reduce((t,o)=>o.type===e?t.concat(o.message):t,[])}}t.MessageController=e;let o=class extends(Object(r.a)(a.LitElement)){constructor(){super(...arguments),this._focusedIndex=-1,this._focusedGroupIndex=-1,this.label="Options",this.options=[],this.customOptions=[],this.placeholder="",this.isMulti=!1,this.useVirtualScroll=!1,this.disabled=!1,this.ordered=!1,this.expanded=!1,this.groupExpandedList=[],this.searchItem=!1,this.compact=!1,this.noClearIcon=!1,this.selectWhenInFocus=!1,this.selectedOptions=[],this.visibleOptions=8,this.optionId="",this.optionValue="",this.isCustomContent=!1,this.searchable=!1,this.shape="none",this.value=[],this.inputValue="",this.allowCustomValue=!1,this.autofocus=!1,this.resultsTextLocalization="No Results",this.optionsTextLocalization="No Options",this.trimSpace=!1,this.invalid=!1,this.invalidText="",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForComboBox="",this.clearAriaLabel="Clear",this.arrowAriaLabel="Expand",this.clearIconHeight="auto",this.allTextLocalization="All",this.selectAllTextLocalization="Select All",this.selectedTextLocalization="Selected",this.allowSelectAll=!1,this.showCustomError=!1,this.showLoader=!1,this.showSelectedCount=!1,this.popupChevronAriaHidden="true",this.newMomentum=!1,this.showFilterIcon=!1,this.isDropdownArrow=!1,this.comboboxId="",this.helpText="",this.messageArr=[],this.htmlId="",this.readOnly=!1,this.messageController=new e,this.isOptGroup=!1,this.isSelectAllChecked=!1,this.multiSelectedIndex=-1,this.multiSelected=[],this.customContent=[],this.notifySelectedChange=Object(n.b)(t=>{this.dispatchEvent(new CustomEvent("change-selected",{composed:!0,bubbles:!0,detail:t}))},0),this.handleGroupFilter=t=>{const e=t.filter(t=>{if("string"!=typeof t&&"true"===t.isLabel)return t.groupName});return this.searchItem=!0,this.groupExpandedList=e.map(t=>{if("string"!=typeof t)return t.groupName}),t.filter(e=>{if("string"!=typeof e&&"true"===e.isLabel){return!!t.find(t=>{if("string"!=typeof e&&"string"!=typeof t)return e.groupName===t.groupName&&"false"===t.isLabel})}return!0})},this.notifyInputValueChanged=Object(n.b)(t=>{this.dispatchEvent(new CustomEvent("combobox-input",{composed:!0,bubbles:!0,detail:{value:t}})),this.notifySearchResultCount(),this.focusedGroupIndex=0,requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})},250),this.handleOutsideClick=t=>{let e=!1;const o=t.composedPath();o.length&&(e=!!o.find(t=>t===this),e||(this.setVisualListbox(!1),this.unselectedAllMultiTag()))}}get focusedIndex(){return this._focusedIndex}set focusedIndex(t){this.updateFocusedIndex(t)}updateFocusedIndex(t){var e;const o=this._focusedIndex;if(this.checkForVirtualScroll()){let o;o=this.allowSelectAll?0===t?"selectAll":this.getOptionId(this.filteredOptions[t-1]):this.getOptionId(this.filteredOptions[t]);const i=this.lists?null===(e=[...this.lists])||void 0===e?void 0:e.find(t=>0!==t.offsetHeight&&t.id===o):"";this.lists&&[...this.lists].forEach(t=>{t.toggleAttribute("focused",!1)}),i&&(null==i||i.toggleAttribute("focused",!0))}else if(this.lists){const e=this.lists[o];e&&e.toggleAttribute("focused",!1);const i=this.lists[t];i&&i.toggleAttribute("focused",!0)}this._focusedIndex=t,this.requestUpdate("focusedIndex",o)}get focusedGroupIndex(){return this._focusedGroupIndex}set focusedGroupIndex(t){const e=this._focusedGroupIndex;if(this.labels&&0!==this.labels.length){const o=this.labels[e];o&&o.toggleAttribute("focused",!1);const i=this.labels[t];i&&(i.toggleAttribute("focused",!0),i.focus())}this._focusedGroupIndex=t,this.requestUpdate("focusedGroupIndex",e)}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}notifySearchResultCount(){if(this.searchResultAriaLabel){const t=/{{.*?}}/g;this.ariaLabelForComboBox=this.searchResultAriaLabel.replace(t,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForComboBox=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForComboBox=`ComboBox Element, ${this.filteredOptions.length} results found.`}firstUpdated(t){this.ariaLabelForComboBox=this.ariaLabel?this.ariaLabel:"ComboBox Element",super.firstUpdated(t),this.isCustomContent&&(this.optionId="id",this.optionValue="value",this.setOptionCustomContent()),this.setInitialValue()}updated(t){super.updated(t),t.has("expanded")&&(this.expanded?(this.resizeListbox(),this.checkSelectedOptions()):this.unCheckAllOptions()),t.has("focusedIndex")&&this.focusedIndex>=0&&(this.checkForVirtualScroll()||this.scrollToOption()),t.has("value")&&0===this.selectedOptions.length&&this.setInitialValue(),t.has("customOptions")&&this.isCustomContent&&(this.setOptionCustomContent(),this.resizeListbox()),t.has("showCustomError")&&this.resizeListbox(),t.has("showLoader")&&this.resizeListbox(),t.has("searchItem")&&this.resizeListbox()}handleFocusIn(t){this.disabled&&!this.readOnly||(this.noClearIcon&&(requestAnimationFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}),this.selectWhenInFocus&&this.input.select()),super.handleFocusIn&&super.handleFocusIn(t)),this.dispatchEvent(new CustomEvent("combobox-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(t){super.handleFocusOut&&super.handleFocusOut(t),this.dispatchEvent(new CustomEvent("combobox-focus-out",{composed:!0,bubbles:!0}))}findFilteredOption(t){return this.isOptionObject(t)?this.filteredOptions.findIndex(e=>this.getOptionId(e)===this.getOptionId(t)&&this.getOptionValue(e)===this.getOptionValue(t)):this.filteredOptions.indexOf(t)}setInitialValue(){var t;if(this.value.length)if(this.isMulti)this.value.forEach(t=>{-1!==this.findFilteredOption(t)&&this.setSelectedOption(t)});else{const e=this.value[0],o=this.findFilteredOption(e);-1!==o&&(this.setSelectedOption(e),this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)),this.focusedIndex=o,this.focusedGroupIndex=-1)}}isOptionObject(t){return"object"==typeof t&&null!==t}setOptionCustomContent(){if(this.isOptGroup){const t=[...this.querySelectorAll("optgroup")],e=[];for(const o of t){const t=o.getAttribute("label"),i=[...o.querySelectorAll("[slot]")];e.push({isLabel:"true",[this.optionValue]:t,groupName:t});for(const o of i){const i=o.getAttribute("aria-label"),s=o.getAttribute("display-value"),r=o.getAttribute("slot");i&&s&&e.push({[this.optionId]:i,[this.optionValue]:s,isLabel:"false",groupName:t,slot:r})}}this.options=e}else this.customContent=[...this.querySelectorAll("[slot]")],this.customContent&&this.customContent.length?this.options=this.customContent.map(t=>{const e=t.getAttribute("aria-label"),o=t.getAttribute("display-value");if(e&&o)return{[this.optionId]:e,[this.optionValue]:o}}):this.options=[]}getOptionValue(t){return this.isOptionObject(t)?t[this.optionValue]:t}getOptionGroupName(t){return null==t?void 0:t.groupName}getOptionId(t){return this.isOptionObject(t)?t[this.optionId]:t}getFocusedItem(t){if(t>=0)return this.filteredOptions[t]}setupEvents(){document.addEventListener("click",this.handleOutsideClick),this.addEventListener("remove-all-selected",this.removeAllSelected),this.addEventListener("selected-changed",this.selectedChange)}teardownEvents(){document.removeEventListener("click",this.handleOutsideClick),this.removeEventListener("remove-all-selected",this.removeAllSelected),this.removeEventListener("selected-changed",this.selectedChange)}setVisualListbox(t){this.expanded=t}setGroupList(t){this.groupExpandedList.includes(t)?(this.groupExpandedList.splice(this.groupExpandedList.indexOf(t),1),this.groupExpandedList=[...this.groupExpandedList]):this.searchItem?this.groupExpandedList.push(t):this.groupExpandedList=[t]}findSelectedOption(t){return this.optionId&&t?this.selectedOptions.findIndex(e=>e&&e[this.optionId]===t[this.optionId]):this.selectedOptions.indexOf(t)}findOptionIndex(t){const e=t.composedPath();if(this.checkForVirtualScroll()){let t="";return[...this.lists].forEach(o=>{e.includes(o)&&(t=o.id)}),this.filteredOptions.findIndex(e=>this.getOptionId(e)===t)}return[...this.lists].findIndex(t=>e.includes(t))}checkSelectedOptions(){if(this.checkForVirtualScroll()){const t=this.selectedOptions.map(t=>this.getOptionId(t)),e=[...this.lists].filter(t=>"selectAll"!==t.id);null==e||e.forEach(e=>{t.includes(e.id)?(this.isMulti&&(null==e||e.setAttribute("aria-checked","true")),null==e||e.setAttribute("aria-selected","true")):this.isMulti&&(null==e||e.setAttribute("aria-checked","false"))})}}unCheckAllOptions(){var t;this.checkForVirtualScroll()&&this.isMulti&&(null===(t=[...this.lists])||void 0===t||t.forEach(t=>{"selectAll"!==(null==t?void 0:t.id)&&(null==t||t.setAttribute("aria-checked","false"))}))}setSelectedOption(t){this.isMulti||(this.selectedOptions=[]);const e=this.findSelectedOption(t);if(-1!==e){const t=this.selectedOptions[e];this.selectedOptions.splice(e,1),this.notifySelectedChange({value:t,selected:this.selectedOptions})}else this.selectedOptions.push(t),this.notifySelectedChange({value:t,selected:this.selectedOptions});this.checkSelectedOptions(),this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()),this.requestUpdate()}filterOptions(t){if(t&&t.length){const e=this.options.filter(e=>this.isOptGroup&&"string"!=typeof e&&"true"===e.isLabel?e:(this.isCustomContent?this.getOptionId(e):this.getOptionValue(e)).toLowerCase().includes(t.toLowerCase()));return this.isOptGroup?this.handleGroupFilter(e):e}return this.searchItem=!1,this.options}getListBoxVerticalPadding(){if(this.listBox){const t=window.getComputedStyle(this.listBox,null),e=parseInt(t.getPropertyValue("padding-top"))+parseInt(t.getPropertyValue("padding-bottom"));if(!isNaN(e))return e+2}return 10}resizeListbox(){this.updateOnNextFrame(()=>{var t;let e=0,o=0,i=0;const s=this.getListBoxVerticalPadding();if(this.lists){const t=this.checkForVirtualScroll()?[...this.lists].filter(t=>0!==t.offsetHeight):[...this.lists];e=t.slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0),i=this.checkForVirtualScroll()&&this.allowSelectAll?t.slice(1,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0):t.slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)}if(this.labels&&(o=[...this.labels].slice(0,this.visibleOptions).reduce((t,e)=>t+e.offsetHeight,0)),this.listBox&&(this.listBox.style.maxHeight=e+o+s+"px"),this.virtualizer&&(this.virtualizer.style.height=i+s+"px"),this.showCustomError||this.showLoader){const e=null===(t=this.listBox)||void 0===t?void 0:t.querySelector("[slot]");this.listBox&&e&&(this.listBox.style.height=e.clientHeight+s+"px",this.listBox.style.maxHeight=e.clientHeight+s+"px")}})}setInputValue(t=""){this.input.value=t}updateOnNextFrame(t){requestAnimationFrame(t)}unCheckedAllOptions(){this.isMulti&&(this.lists.forEach((t,e)=>this.unCheckedOption(e)),this.isSelectAllChecked=!1)}unCheckedOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","false"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}checkAllOptions(){this.isMulti&&this.lists.forEach((t,e)=>this.checkOption(e))}checkOption(t){this.isMulti&&(this.lists[t].setAttribute("aria-checked","true"),this.notifySelectedChange({value:this.filteredOptions[t],selected:this.selectedOptions}))}isSelectAllSelected(){return this.selectedOptions.length===this.options.length}setFocusOnHost(t){this.setFocus&&this.setFocus(t)}isOptionFocused(t){return this.focusedIndex===t}getAriaState(t){return this.isOptionFocused(t)}scrollToOption(){var t,e;let o=0;const{top:i,bottom:s}=this.listBox.getBoundingClientRect(),r=this.lists[this.focusedIndex],l=null===(t=this.lists[this.focusedIndex+1]||r)||void 0===t?void 0:t.getBoundingClientRect(),n=null===(e=this.lists[this.focusedIndex-1]||r)||void 0===e?void 0:e.getBoundingClientRect();(null==l?void 0:l.bottom)>s?o=l.bottom-s+2:(null==n?void 0:n.top)<i&&(o=n.top-i-2),this.updateOnNextFrame(()=>{this.listBox.scrollTop+=o})}getCustomContentName(t){const e=this.options.indexOf(t);if(this.isOptGroup){const t=this.options[e];if(t&&"string"!=typeof t)return t.slot}else if(-1!==e)return this.customContent[e].slot}setInputSelectionRange(t,e){this.input.setSelectionRange(t,e)}isOptionChecked(t){return-1!==this.findSelectedOption(t)?"true":"false"}getInputSelection(){return this.input.selectionStart}canMultiSelect(){return 0===this.getInputSelection()&&0!==this.selectedOptions.length&&this.isMulti}removeMultiTag(){this.selected&&this.multiSelected.forEach(t=>{const e=this.selected[t];e&&e.hasAttribute("selected")&&this.removeSelected(this.selectedOptions[t])})}unselectedAllMultiTag(){this.selected&&this.selected.forEach(t=>t.removeAttribute("selected")),this.multiSelectedIndex=-1}findLastMultiSelected(){return this.selected[this.multiSelectedIndex]}toggleMultiSelectedTag(t,e){t&&t.toggleAttribute("selected",e)}selectMultiTag(t){if(this.canMultiSelect()){if(!t){this.multiSelected=[];const t=this.findLastMultiSelected();this.toggleMultiSelectedTag(t,!1)}this.multiSelectedIndex<=0?this.multiSelectedIndex=this.selectedOptions.length-1:this.multiSelectedIndex--,this.multiSelected.push(this.multiSelectedIndex);const e=this.findLastMultiSelected();this.toggleMultiSelectedTag(e,!0)}}handleListClick(t){return v(this,void 0,void 0,(function*(){this.dispatchEvent(new CustomEvent("selected-changed",{detail:{event:t}})),yield this.updateComplete,this.isMulti?this.setVisualListbox(!0):this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}))}handleSelectAll(){return v(this,void 0,void 0,(function*(){this.isSelectAllChecked=!this.isSelectAllChecked,this.isSelectAllChecked?(this.selectedOptions=[...this.options],this.checkAllOptions()):(this.selectedOptions=[],this.unCheckedAllOptions()),yield this.updateComplete,this.setVisualListbox(!0),this.notifySelectedChange({selected:this.selectedOptions})}))}handleInputKeyUp(t){switch(t.code){case s.b.Escape:break;case s.b.Backspace:this.setFocusOnHost(!0),this.setVisualListbox(!0),this.resizeListbox(),this.removeMultiTag();break;case s.b.ArrowLeft:this.isMulti&&(t.shiftKey?this.selectMultiTag(!0):this.selectMultiTag(!1));break;default:this.isMulti&&this.unselectedAllMultiTag()}}handleInput(t){const e=t.target.value;this.inputValue=e.trim(),this.notifyInputValueChanged(e.trim())}removeAllSelected(){var t;this.focusedIndex=-1,this.focusedGroupIndex=-1,this.selectedOptions=[],this.inputValue="",this.setInputValue(),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,""),this.setVisualListbox(!1),this.unCheckedAllOptions(),this.setSelectedAttribute(void 0),this.updateOnNextFrame(()=>{this.input.focus()}),this.notifySelectedChange({selected:this.selectedOptions})}removeSelected(t){const e=this.findSelectedOption(t),o=this.filteredOptions.indexOf(t);-1!==o&&this.unCheckedOption(o),-1!==e&&(this.selectedOptions.splice(e,1),this.requestUpdate()),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1})}selectedChange(t){var e;const{event:o}=t.detail;let i=this.findOptionIndex(o);if(-1!==i){this.focusedIndex=this.allowSelectAll&&this.checkForVirtualScroll()?i+1:i,this.isMulti&&this.allowSelectAll&&!this.checkForVirtualScroll()&&(i-=1);const t=this.getFocusedItem(i);this.setSelectedAttribute(t),t&&(this.setSelectedOption(t),this.isMulti?this.isMulti&&this.allowSelectAll&&(this.isSelectAllChecked=this.isSelectAllSelected()):(this.setInputValue(this.getOptionValue(t)),null===(e=this.input)||void 0===e||e.setAttribute(s.a.AriaActivedescendant,this.getOptionId(t))))}}setSelectedAttribute(t){var e;let o="";t&&(o=this.getOptionId(t)),null===(e=this.lists)||void 0===e||e.forEach((t,e)=>{(null==t?void 0:t.id)===o?null==t||t.setAttribute("selected","true"):null==t||t.setAttribute("selected","false")})}shouldChangeButton(){const t=this.input&&this.input.value.length>0&&!this.noClearIcon||this.isMulti&&this.selectedOptions.length&&!this.noClearIcon;return t&&document.dispatchEvent(new CustomEvent("on-widget-update")),t}setCustomValue(){this.optionId||this.optionValue||(this.options=[...this.options,this.inputValue],this.setSelectedOption(this.inputValue),this.isMulti||this.updateOnNextFrame(()=>{var t;this.focusedIndex=this.filteredOptions.length-1;const e=this.getFocusedItem(this.focusedIndex);e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)))}),this.dispatchEvent(new CustomEvent("custom-value-add",{composed:!0,bubbles:!0,detail:{value:this.inputValue}}))),this.inputValue=""}handleGroupFocus(){this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.filteredGroupOptions.length>0&&-1===this.focusedGroupIndex&&(this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===this.groupExpandedList[0])),this.updateOnNextFrame(()=>{-1===this.focusedGroupIndex||!this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length-1||this.allowSelectAll&&this.focusedGroupIndex>=this.filteredGroupOptions.length?this.focusedGroupIndex=0:this.focusedGroupIndex++}),this.focusedIndex=-1}handleInputKeyDown(t){var e,o;switch(t.code){case s.b.Backspace:this.focusedIndex=-1;break;case s.b.Tab:case s.b.Enter:if(this.setFocusOnHost(!0),this.expanded&&this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);if(this.allowCustomValue&&this.input&&this.input.value.length){if(-1===this.findFilteredOption(this.inputValue))return void this.setCustomValue()}e&&(this.setSelectedAttribute(e),this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()}),this.setVisualListbox(!1),t.code===s.b.Tab&&this.isMulti)return;break;case s.b.ArrowDown:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case s.b.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return void this.handleGroupFocus();this.setFocusOnHost(!1),this.expanded||this.setVisualListbox(!0),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)),this.focusedGroupIndex=-1)});break;case s.b.ArrowLeft:case s.b.ArrowRight:t.stopPropagation();break;case s.b.Escape:this.setFocusOnHost(!0),this.expanded?(t.stopPropagation(),this.setVisualListbox(!1)):(this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(s.a.AriaActivedescendant,""),this.focusedIndex=-1,this.focusedGroupIndex=-1,this.removeAllSelected(),this.setSelectedAttribute(void 0));break;case s.b.Home:this.setInputSelectionRange(0,0);break;case s.b.End:{const{length:t}=this.inputValue;this.setInputSelectionRange(t,t)}break;case s.b.Space:if(this.isMulti&&this.expanded){t.preventDefault();const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.setSelectedAttribute(e),this.showSelectedCount||(this.setInputValue(),null===(o=this.input)||void 0===o||o.setAttribute(s.a.AriaActivedescendant,""))),0===this.focusedIndex&&this.allowSelectAll&&this.handleSelectAll()}this.expanded=!0}}handleGroupLabelKeyDown(t,e){switch(t.code){case s.b.Tab:this.handleGroupFocus();break;case s.b.Enter:case s.b.Space:-1!==this.focusedGroupIndex?this.toggleGroupListBox(t,e.value):(this.setFocusOnHost(!0),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{var t;const e=this.getFocusedItem(this.allowSelectAll?this.focusedIndex-1:this.focusedIndex);e&&(this.setSelectedOption(e),this.showSelectedCount||(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)),this.updateOnNextFrame(()=>{this.input.focus(),this.focusedGroupIndex=-1}))),this.isMulti&&this.allowSelectAll&&0===this.focusedIndex&&this.handleSelectAll()}));break;case s.b.ArrowDown:if(0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;-1===this.focusedIndex||!this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length-1||this.allowSelectAll&&this.focusedIndex>=this.filteredOptions.length?this.focusedIndex=0:this.focusedIndex++;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],!this.showSelectedCount&&e&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e))),this.focusedGroupIndex=-1});break;case s.b.ArrowUp:if(this.isOptGroup&&0===this.filteredOptions.length)return;this.setFocusOnHost(!1),this.updateOnNextFrame(()=>{var t;this.focusedIndex<=0?this.focusedIndex=this.allowSelectAll?this.filteredOptions.length:this.filteredOptions.length-1:this.focusedIndex--;const e=this.getFocusedItem(this.focusedIndex);this.groupExpandedList=[this.getOptionGroupName(e)],e&&!this.showSelectedCount&&(this.setInputValue(this.getOptionValue(e)),null===(t=this.input)||void 0===t||t.setAttribute(s.a.AriaActivedescendant,this.getOptionId(e)))});break;case s.b.Escape:this.focusedGroupIndex=-1,this.setVisualListbox(!1),this.setFocusOnHost(!0),this.input.focus();break;default:this.setVisualListbox(!0)}}toggleVisualListBox(t){var e,o;if(!this.readOnly){if(t.target.classList.contains("md-combobox-listbox"))t.target.focus();else if("md-icon"===t.target.localName){const i=null===(o=null===(e=t.target.parentElement)||void 0===e?void 0:e.parentElement)||void 0===o?void 0:o.parentElement;if(i){const t=i.querySelector(".md-combobox-listbox");Object(g.setTimeout)(()=>{t.focus()},10)}}this.expanded?this.setVisualListbox(!1):(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.setVisualListbox(!0)),this.input.focus(),this.setGroupList(""),this.focusedGroupIndex=-1}}toggleGroupListBox(t,e){t.stopPropagation(),this.focusedGroupIndex=this.filteredGroupOptions.findIndex(t=>"string"!=typeof t&&t.groupName===e),this.setGroupList(e),this.resizeListbox()}handleRemoveAll(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}connectedCallback(){super.connectedCallback(),this.setupEvents();this.querySelector("optgroup")&&(this.isOptGroup=!0)}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}static get styles(){return[d.a,x]}get listItemOptionMap(){return{"md-combobox-multiselect":this.isMulti,compact:this.compact,"md-combobox-dropdown-arrow":this.isDropdownArrow}}get filteredOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t&&this.groupExpandedList.includes(this.getOptionGroupName(t))?"false"===t.isLabel:void 0))}get filteredGroupOptions(){return this.filterOptions(this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue).filter(t=>!this.isOptGroup||("string"!=typeof t?"true"===t.isLabel:void 0))}get comboBoxTemplateClassMap(){return{["md-combobox--"+this.shape]:!!this.shape,"md-combobox-searchable":this.searchable,"md-combobox-has-leading-icon":this.searchable||this.showFilterIcon,"md-new-combobox":this.newMomentum,["md-"+this.messageType]:!!this.messageType,"md-combobox-readonly":this.readOnly,"md-combobox-compact":this.compact,"md-combobox-dropdown-arrow":this.isDropdownArrow}}searchIconTemplate(){return this.leadingIconTemplate("search-bold","search-icon")}filterIconTemplate(){return this.leadingIconTemplate("filter-bold","filter-icon")}leadingIconTemplate(t,e){return a.html`
2
2
  <md-icon
3
3
  name=${t}
4
4
  class=${e}
@@ -1,4 +1,4 @@
1
- (window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[70],{122:function(e,o,t){"use strict";t.r(o),t.d(o,"Dropdown",(function(){return g}));t(14);var r=t(1),i=t(7),d=t(16),s=t(6),n=t(0),a=t(2),l=t(12),p=t(3),c=t(13),h=t(8),u=n.css`:host(:focus){box-shadow:none!important;outline:0!important}:host .md-dropdown{display:flex;flex-direction:column;position:relative}:host .md-dropdown-select{display:none}:host .md-dropdown-label{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:center;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color));border-radius:var(--dropdown-group-radius,.25rem);min-height:2rem;padding:0 .75rem}:host .md-dropdown-label--text{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--md-secondary-text-color);line-height:2rem;outline:0;width:6.25rem;flex:1 0 auto}:host .md-dropdown-label--icon{transition:all .15s linear;align-self:center;background:rgba(0,0,0,0);border:0;cursor:pointer;margin:0;margin-left:calc(.25rem*2);outline:0;padding:0;padding-top:calc(.25rem/2);position:relative;vertical-align:bottom;height:inherit;display:flex}:host .md-dropdown-label--icon md-icon{color:var(--md-primary-text-color,#f7f7f7)}:host .md-dropdown-label:hover{background-color:var(--dropdown-bg-color-hover,#dedede)}:host .md-dropdown-label:active{background-color:var(--dropdown-bg-color-active,#ccc)}:host .md-dropdown-list{list-style:none;margin:0;padding:0;display:none;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-list-border-color);border-radius:.5rem;box-shadow:0 4px 8px rgba(0,0,0,.16),0 0 1px rgba(0,0,0,.16);left:0;overflow:auto;overflow-x:hidden;position:absolute;top:calc(100% + .25rem);width:100%;z-index:99;padding:calc(var(--dropdown-list-padding)/16*1rem);font-size:var(--body-primary-font-size,inherit)}:host .md-dropdown-option{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;color:var(--md-primary-text-color,#f7f7f7);padding:.4375rem .75rem .5rem;border-radius:calc(var(--dropdown-list-item-border-radius)/16*1rem);height:calc(var(--dropdown-list-item-height)/16*1rem)}:host .md-dropdown-option .select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:default;width:calc(100% - 1rem);display:block}:host .md-dropdown-option:hover{background-color:var(--dropdown-list-item-bg-color-hover,#91ebff)}:host .md-dropdown-option[focused]{background-color:var(--dropdown-list-item-bg-color-hover,#91ebff);box-shadow:none;outline:0;box-shadow:0 0 0 .09375rem var(--dropdown-list-item-border-focus)}:host .md-dropdown-option[selected]{background-color:var(--dropdown-list-item-bg-color-focus,#00a0d1);box-shadow:none;outline:0;box-shadow:0 0 0 .09375rem var(--dropdown-list-item-border-focus)}:host .md-dropdown__expanded .md-dropdown-list{display:block}:host .md-dropdown__expanded .md-dropdown-label--icon{transform:rotate(180deg)}:host .md-dropdown__expanded .md-dropdown-button.arrow-down{transform:rotate(180deg)}:host .md-dropdown--pill .group,:host .md-dropdown--pill .md-dropdown-label{border-radius:18px}:host .md-dropdown .group{align-items:start;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color));border-radius:var(--dropdown-group-radius,.25rem);display:flex;min-height:2rem;padding:0 .75rem;height:2.125rem}:host .md-dropdown .group md-icon{color:var(--md-primary-text-color,#545454);cursor:pointer;fill:var(--md-secondary-text-color,#545454);height:100%}:host .md-dropdown .group md-icon:focus{box-shadow:none;outline:0;box-shadow:0 0 0 .125rem var(--md-focus-border-color,#545454)}:host .md-dropdown .group:hover{background-color:var(--dropdown-bg-color-hover,#dedede)}:host .md-dropdown .group:active{background-color:var(--dropdown-bg-color-active,#ccc)}:host .md-dropdown .group input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:rgba(0,0,0,0);border:0;color:var(--md-primary-text-color);display:inline-block;flex:1 1 auto;height:2rem;outline:0}:host .md-dropdown .group input::placeholder{color:var(--md-secondary-text-color)}:host .md-dropdown .group ::input-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:100%}:host .md-dropdown .group .md-dropdown-left-icon{margin-right:.25rem}:host .md-dropdown .md-dropdown-button[disabled] md-icon{color:var(--md-disabled-text-color,#b2b2b2)}:host .md-dropdown .md-dropdown-input[readonly]{pointer-events:none}:host .md-dropdown.md-error .group,:host .md-dropdown.md-error .group:active{border-color:var(--input-error-border-color)!important}:host .md-dropdown.md-warning .group,:host .md-dropdown.md-warning .group:active{border-color:var(--input-warning-border-color)!important}:host .md-dropdown.md-success .group,:host .md-dropdown.md-success .group:active{border-color:var(--input-success-border-color)!important}:host .help-text,:host .md-dropbox__messages{padding-top:.375rem}:host .group[readonly]{border-color:var(--dropdown-border-color-disabled)!important}:host .group[readonly] md-icon{color:var(--dropdown-bg-color-disabled)!important}:host .md-dropdown-button{transition:all .15s linear;align-self:center;background:rgba(0,0,0,0);border:0;cursor:pointer;margin:0;margin-left:calc(.25rem*2);outline:0;padding:0;position:relative;width:1.25rem;height:1.25rem;display:flex;align-items:center;justify-content:center}:host .md-dropdown-button md-icon{color:var(--combobox-dropdown-item-icon-color)}:host .md-combobox-button.clear{height:auto;padding:.115rem}:host .md-combobox-button.arrow-down:focus,:host .md-combobox-button.clear:focus{outline:2px solid var(--button-focus-ring-color,#007aa3)}:host .md-new-dropdown-label{background-color:var(--dropdown-bg-color-default);border-radius:8px}:host .md-new-dropdown-label--text{color:var(--md-primary-text-color)}:host .md-new-dropdown-label:hover{background-color:var(--dropdown-bg-color-hover,#dedede)}:host .md-new-dropdown-label:active{background-color:var(--dropdown-bg-color-active,#ccc)}:host .md-new-dropdown .group{height:2rem;border-radius:.5rem;background-color:rgba(0,0,0,0);padding-right:.5rem}:host(:active) .md-new-dropdown .group,:host(:active) .md-new-dropdown-label{outline:2px solid var(--input-default-outline-color);outline-offset:.125rem;box-shadow:none;border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color))!important}:host([focus-visible]) .md-dropdown-label{border-color:var(--dropdown-border-color-focus,#005e7d);box-shadow:none;outline:0}:host([focus-visible]) .group{border-color:var(--dropdown-border-color-focus,#005e7d)}:host([focus-visible]) .md-new-dropdown .group,:host([focus-visible]) .md-new-dropdown-label{outline:2px solid var(--dropdown-border-color-focus)!important;outline-offset:.125rem!important;box-shadow:none;border-color:var(--combobox-focus-new-border-color)}:host([disabled]) .md-dropdown-label{background-color:var(--md-tertiary-bg-color)}:host([disabled]) .md-dropdown-label:active,:host([disabled]) .md-dropdown-label:hover{background-color:var(--md-tertiary-bg-color);pointer-events:none}:host([disabled]) .md-dropdown-label:active>md-icon,:host([disabled]) .md-dropdown-label:hover>md-icon{opacity:.3}:host([disabled]) .md-dropdown-label:focus-visible{border-color:var(--dropdown-border-color-focus,#005e7d);outline:0}:host([disabled]) .group{background-color:var(--md-tertiary-bg-color)}:host([disabled]) .group md-icon{opacity:.3}:host([disabled]) .group:active,:host([disabled]) .group:hover{background-color:var(--md-tertiary-bg-color);pointer-events:none}:host([disabled]) .group:focus-visible{border-color:var(--dropdown-border-color-focus,#005e7d);outline:0}:host([disabled]) md-help-text{color:var(--md-disabled-text-color,#b2b2b2)}:host([disabled]) .md-new-dropdown-label{background-color:rgba(0,0,0,0);border-color:var(--dropdown-border-color-disabled,#b2b2b2);outline:0!important;box-shadow:none}:host([disabled]) .md-new-dropdown-label--text{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown-label .md-dropdown-label--icon md-icon{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown-label:active,:host([disabled]) .md-new-dropdown-label:hover{background-color:rgba(0,0,0,0);pointer-events:none;outline:0!important;box-shadow:none;border-color:var(--dropdown-border-color-disabled,#b2b2b2)}:host([disabled]) .md-new-dropdown-label:focus-visible{border-color:var(--dropdown-border-color-disabled);outline:0!important;box-shadow:none}:host([disabled]) .md-new-dropdown .group{background:rgba(0,0,0,0);border-color:var(--dropdown-border-color-disabled);pointer-events:none;outline:0!important}:host([disabled]) .md-new-dropdown .group input{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown .group input::placeholder{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown .group:active,:host([disabled]) .md-new-dropdown .group:hover{border-color:var(--dropdown-border-color-disabled)}:host([disabled]) .md-new-dropdown .group:focus-visible{border-color:var(--dropdown-border-color-disabled)}@media(forced-colors:active){:host([focus-visible]) .md-dropdown .md-dropdown-label{border:2px solid Highlight}:host([focus-visible]) .md-dropdown .md-dropdown-label--text{forced-color-adjust:none;background-color:Canvas;color:CanvasText}:host([focus-visible]) .md-dropdown-list{border:1px solid CanvasText}:host .md-dropdown-option[focused]{forced-color-adjust:none;background-color:Highlight;color:HighlightText}:host .group input{color:HighlightText}:host .group ::input-placeholder{color:GrayText}:host([disabled]) .md-dropdown .md-dropdown-label{border:1px solid GrayText!important}:host([disabled]) .group,:host([disabled]) .group:active{border:1px solid GrayText!important;outline:0!important}:host([disabled]) .group input,:host([disabled]) .group:active input{color:GrayText}:host([disabled]) .group ::input-placeholder,:host([disabled]) .group:active ::input-placeholder{color:HighlightText!important}}`,b=function(e,o,t,r){var i,d=arguments.length,s=d<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,o,t,r);else for(var n=e.length-1;n>=0;n--)(i=e[n])&&(s=(d<3?i(s):d>3?i(o,t,s):i(o,t))||s);return d>3&&s&&Object.defineProperty(o,t,s),s},m=function(e,o,t,r){return new(t||(t=Promise))((function(i,d){function s(e){try{a(r.next(e))}catch(e){d(e)}}function n(e){try{a(r.throw(e))}catch(e){d(e)}}function a(e){var o;e.done?i(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(s,n)}a((r=r.apply(e,o||[])).next())}))};var g;!function(e){class o{determineMessageType(e){return e.reduce((e,o)=>"error"===o?e:o.type,"")}filterMessagesByType(e,o){return e.reduce((e,t)=>t.type===o?e.concat(t.message):e,[])}}e.MessageController=o;let t=class extends(Object(i.a)(n.LitElement)){constructor(){super(...arguments),this.title="Select...",this.options=[],this.optionId="",this.optionValue="",this.defaultOption="",this.disabled=!1,this.customTabIndex=0,this.allowUnselected=!1,this.visibleOptions=8,this.newMomentum=!1,this.compact=!1,this.searchable=!1,this.searchItem=!1,this.inputValue="",this.placeholder="Select...",this.readOnly=!1,this.autofocus=!1,this.leftIcon="",this.trimSpace=!1,this.resultsTextLocalization="No Results",this.helpText="",this.messageArr=[],this.htmlId="",this.clearAriaLabel="Clear",this.clearIconHeight="auto",this.arrowAriaLabel="Expand",this.popupChevronAriaHidden="true",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForDropdown="",this.renderOptions=[],this.selectedKey="",this.expanded=!1,this.focusedIndex=-1,this.messageController=new o,this.lastMaxHeight="",this.onOutsideClick=e=>{let o=!1;const t=e.composedPath();t.length&&(o=!!t.find(e=>e===this),o||this.expanded&&this.collapse())},this.onKeyDown=e=>{switch(e.code){case r.b.Tab:this.expanded&&(e.stopPropagation(),this.collapse());break;case r.b.Space:case r.b.Enter:this.expanded?(this.select(),this.collapse()):this.expand();break;case r.b.ArrowDown:this.expanded?this.focusNext():this.expand();break;case r.b.ArrowUp:this.expanded?this.focusPrev():this.expand();break;case r.b.Home:this.expanded?this.focusFirst():this.expand();break;case r.b.End:this.expanded?this.focusLast():this.expand();break;case r.b.Escape||r.b.Backspace:this.expanded&&(e.stopPropagation(),this.collapse())}},this.notifyInputValueChanged=Object(d.b)(e=>{this.dispatchEvent(new CustomEvent("dropdown-input",{composed:!0,bubbles:!0,detail:{value:e}})),this.notifySearchResultCount(),requestAnimationFrame(()=>{this.input.focus()})},250)}connectedCallback(){super.connectedCallback(),this.setupEvents()}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}firstUpdated(e){super.firstUpdated(e),e.forEach((e,o)=>{if("defaultOption"===o&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}}),this.searchable&&this.setInitialValue()}updated(e){super.updated(e),e.forEach((e,o)=>{if("options"===o&&this.updateRenderOptions(),"selectedKey"===o){const e=this.renderOptions.findIndex(e=>e.key===this.selectedKey);-1!==e&&(this.focusToIndex(e),this.searchable&&this.setInitialValue())}if("expanded"===o&&this.updateListDOM(),"focusedIndex"===o&&this.updateListDOM(),"defaultOption"===o&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}})}notifySearchResultCount(){if(this.searchResultAriaLabel){const e=/{{.*?}}/g;this.ariaLabelForDropdown=this.searchResultAriaLabel.replace(e,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForDropdown=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForDropdown=`Dropdown Element, ${this.filteredOptions.length} results found.`}setInitialValue(){var e;if(this.options.length){const o=this.renderOptions.find(e=>e.key===this.selectedKey),t=null==o?void 0:o.option;t&&(this.setInputValue(this.getOptionValue(t)),null===(e=this.input)||void 0===e||e.setAttribute(r.a.AriaActivedescendant,this.getOptionId(t)),this.notifyInputValueChanged(this.getOptionValue(t)),this.requestUpdate())}}getOptionValue(e){return this.isOptionObject(e)&&!this.optionValue?Object.values(e)[0]:this.isOptionObject(e)?e[this.optionValue]:e}getOptionId(e){return this.isOptionObject(e)?e[this.optionId]:e}isOptionObject(e){return"object"==typeof e&&null!==e}updateRenderOptions(){const e=[];this.focusReset();const o=this.options.reduce((o,t)=>{const{key:r,value:i}=this.getOptionKeyValuePair(t);return-1!==e.indexOf(r)?console.error(`Dropdown already have option key: "${r}". Ignoring `):r?(e.push(r),o.push({key:r,value:i,option:t})):console.error(`Dropdown key is not defined: "${r}". (value: "${i}"). Ignoring `),o},[]);this.allowUnselected&&o.unshift({key:"",value:this.title}),this.renderOptions=o}updateListDOM(){return m(this,void 0,void 0,(function*(){this.expanded&&(yield this.resizeDropdownList(),yield this.scrollToIndex(this.focusedIndex))}))}resizeDropdownList(){return m(this,void 0,void 0,(function*(){yield new Promise(e=>requestAnimationFrame(()=>{if(this.optionsListItems)if(this.optionsListItems.length>this.visibleOptions){const e=[...this.optionsListItems].slice(0,this.visibleOptions).reduce((e,o)=>e+o.offsetHeight,0)+"px";this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}else{const e="auto";this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}e()}))}))}handleFocusIn(e){this.disabled&&this.readOnly||super.handleFocusIn&&super.handleFocusIn(e),this.dispatchEvent(new CustomEvent("dropdown-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(e){super.handleFocusOut&&super.handleFocusOut(e),this.dispatchEvent(new CustomEvent("dropdown-focus-out",{composed:!0,bubbles:!0}))}static get styles(){return[s.a,u]}get filteredOptions(){const e=this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue;if(!e.trim())return this.renderOptions;const o=this.renderOptions.filter(o=>o.value.toLowerCase().includes(e.toLowerCase()));return 0===o.length?[{key:"no-result",value:"No Result",disabled:!0}]:o}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}setVisualListbox(e){this.expanded=e}updateOnNextFrame(e){requestAnimationFrame(e)}setInputValue(e=""){this.input.value=e}shouldChangeButton(){const e=this.input&&this.input.value.length>0;return e&&document.dispatchEvent(new CustomEvent("on-widget-update")),e}toggleVisualListBox(e){var o,t;if(!this.readOnly){if(e.target.classList.contains("md-dropdown-input"))e.target.focus();else if("md-icon"===e.target.localName){const r=null===(t=null===(o=e.target.parentElement)||void 0===o?void 0:o.parentElement)||void 0===t?void 0:t.parentElement;if(r){const e=r.querySelector(".md-dropdown-input");setTimeout(()=>{e.focus()},10)}}this.expanded?this.setVisualListbox(!1):(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.setVisualListbox(!0)),this.input.focus()}}handleRemoveAll(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}removeAllSelected(){var e;this.focusReset(),this.selectedKey="",this.inputValue="",this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(r.a.AriaActivedescendant,""),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus()}),this.dispatchEvent(new CustomEvent("dropdown-selection-removed",{composed:!0,bubbles:!0,detail:{}}))}setupEvents(){document.addEventListener("click",this.onOutsideClick),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("remove-all-selected",this.removeAllSelected)}teardownEvents(){document.removeEventListener("click",this.onOutsideClick),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("remove-all-selected",this.removeAllSelected)}expand(){this.expanded=!0;const e=-1!==this.focusedIndex?"combo-"+this.focusedIndex:"";document.dispatchEvent(new CustomEvent("on-widget-update")),this.label.setAttribute("aria-activedescendant",e),this.optionsList&&this.optionsList.focus(),-1===this.focusedIndex&&this.focusNext()}collapse(){this.expanded=!1,this.searchable||this.label.setAttribute("aria-activedescendant","")}toggle(){this.expanded?this.collapse():this.expand()}select(){if(-1!==this.focusedIndex){const e=this.renderOptions[this.focusedIndex],o=e.key;o!==this.selectedKey&&(this.selectedKey=o,this.dispatchEvent(new CustomEvent("dropdown-selected",{composed:!0,bubbles:!0,detail:{option:e.option?e.option:e.key}})))}}onLabelClick(){this.label.focus(),this.toggle()}focusFirst(){this.renderOptions.length&&(this.focusedIndex=0)}focusLast(){this.renderOptions.length&&(this.focusedIndex=this.renderOptions.length-1)}focusNext(){this.renderOptions.length&&(-1!==this.focusedIndex&&this.focusedIndex<this.renderOptions.length-1?this.focusedIndex++:this.focusFirst())}focusPrev(){this.renderOptions.length&&(this.focusedIndex>0?this.focusedIndex--:this.focusLast())}focusToIndex(e){this.renderOptions.length&&e>=0&&e<=this.renderOptions.length-1&&(this.focusedIndex=e)}focusToIndexWithOption(e){const o=this.renderOptions.findIndex(o=>o.key===e.key);this.renderOptions.length&&o>=0&&o<=this.renderOptions.length-1&&(this.focusedIndex=o)}focusReset(){this.focusedIndex=-1}scrollToIndex(e){return m(this,void 0,void 0,(function*(){yield new Promise(o=>{requestAnimationFrame(()=>{if(this.optionsListItems&&this.optionsListItems.length>this.visibleOptions&&e>=0&&this.optionsListItems.length>e){let o=0;const{top:t,bottom:r}=this.optionsList.getBoundingClientRect(),i=this.optionsListItems[e],d=this.optionsListItems[e+1]||i,s=this.optionsListItems[e-1]||i,n=d.getBoundingClientRect(),a=s.getBoundingClientRect();n.bottom>r?o=n.bottom-r+2:a.top<t&&(o=a.top-t-2),this.optionsList.scrollTop+=o}o()})})}))}getOptionKeyValuePair(e){if("string"==typeof e)return{key:e.trim(),value:e};if(e&&"object"==typeof e){const o=Object.keys(e),t=Object.values(e);if(o.length){if(1===o.length||!this.optionId)return{key:o[0],value:t[0]};if(this.optionId)return{key:e[this.optionId],value:e[this.optionValue||this.optionId]}}}return{key:"undefined",value:"undefined"}}get labelTitle(){if(this.selectedKey){const e=this.renderOptions.find(e=>e.key===this.selectedKey);if(e)return e.value}return this.title}get dropDownClassMap(){return{"md-dropdown__expanded":this.expanded,["md-"+this.messageType]:!!this.messageType,"md-new-dropdown":this.newMomentum}}handleInput(e){const o=e.target.value;this.inputValue=o.trim(),this.notifyInputValueChanged(o.trim())}helpTextTemplate(){return this.helpText?a.html`
1
+ (window["momentum-web-components-[id]"]=window["momentum-web-components-[id]"]||[]).push([[70],{122:function(e,o,t){"use strict";t.r(o),t.d(o,"Dropdown",(function(){return g}));t(14);var r=t(1),i=t(7),d=t(16),s=t(6),n=t(0),a=t(2),l=t(12),p=t(3),c=t(13),h=t(8),u=n.css`:host(:focus){box-shadow:none!important;outline:0!important}:host .md-dropdown{display:flex;flex-direction:column;position:relative}:host .md-dropdown-select{display:none}:host .md-dropdown-label{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:center;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color));border-radius:var(--dropdown-group-radius,.25rem);min-height:2rem;padding:0 .75rem}:host .md-dropdown-label--text{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--md-secondary-text-color);line-height:2rem;outline:0;width:6.25rem;flex:1 0 auto}:host .md-dropdown-label--icon{transition:all .15s linear;align-self:center;background:rgba(0,0,0,0);border:0;cursor:pointer;margin:0;margin-left:calc(.25rem*2);outline:0;padding:0;padding-top:calc(.25rem/2);position:relative;vertical-align:bottom;height:inherit;display:flex}:host .md-dropdown-label--icon md-icon{color:var(--md-primary-text-color,#f7f7f7)}:host .md-dropdown-label:hover{background-color:var(--dropdown-bg-color-hover,#dedede)}:host .md-dropdown-label:active{background-color:var(--dropdown-bg-color-active,#ccc)}:host .md-dropdown-list{list-style:none;margin:0;padding:0;display:none;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-list-border-color);border-radius:.5rem;box-shadow:0 4px 8px rgba(0,0,0,.16),0 0 1px rgba(0,0,0,.16);left:0;overflow:auto;overflow-x:hidden;position:absolute;top:calc(100% + .25rem);width:100%;z-index:99;padding:calc(var(--dropdown-list-padding)/16*1rem);font-size:var(--body-primary-font-size,inherit)}:host .md-dropdown-option{align-content:center;align-items:center;display:flex;flex-flow:row nowrap;justify-content:flex-start;color:var(--md-primary-text-color,#f7f7f7);padding:.4375rem .75rem .5rem;border-radius:calc(var(--dropdown-list-item-border-radius)/16*1rem);height:calc(var(--dropdown-list-item-height)/16*1rem)}:host .md-dropdown-option .select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:default;width:calc(100% - 1rem);display:block}:host .md-dropdown-option:hover{background-color:var(--dropdown-list-item-bg-color-hover,#91ebff)}:host .md-dropdown-option[focused]{background-color:var(--dropdown-list-item-bg-color-hover,#91ebff);box-shadow:none;outline:0;box-shadow:0 0 0 .09375rem var(--dropdown-list-item-border-focus)}:host .md-dropdown-option[selected]{background-color:var(--dropdown-list-item-bg-color-focus,#00a0d1);box-shadow:none;outline:0;box-shadow:0 0 0 .09375rem var(--dropdown-list-item-border-focus)}:host .md-dropdown__expanded .md-dropdown-list{display:block}:host .md-dropdown__expanded .md-dropdown-label--icon{transform:rotate(180deg)}:host .md-dropdown__expanded .md-dropdown-button.arrow-down{transform:rotate(180deg)}:host .md-dropdown--pill .group,:host .md-dropdown--pill .md-dropdown-label{border-radius:18px}:host .md-dropdown .group{align-items:start;background-color:var(--md-primary-bg-color);border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color));border-radius:var(--dropdown-group-radius,.25rem);display:flex;min-height:2rem;padding:0 .75rem;height:2.125rem}:host .md-dropdown .group md-icon{color:var(--md-primary-text-color,#545454);cursor:pointer;fill:var(--md-secondary-text-color,#545454);height:100%}:host .md-dropdown .group md-icon:focus{box-shadow:none;outline:0;box-shadow:0 0 0 .125rem var(--md-focus-border-color,#545454)}:host .md-dropdown .group:hover{background-color:var(--dropdown-bg-color-hover)}:host .md-dropdown .group:active{background-color:var(--dropdown-bg-color-active)}:host .md-dropdown .group input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;background:rgba(0,0,0,0);border:0;color:var(--md-primary-text-color);display:inline-block;flex:1 1 auto;height:2rem;outline:0}:host .md-dropdown .group input::placeholder{color:var(--md-secondary-text-color)}:host .md-dropdown .group ::input-placeholder{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block;width:100%}:host .md-dropdown .group .md-dropdown-left-icon{margin-right:.25rem}:host .md-dropdown .md-dropdown-button[disabled] md-icon{color:var(--md-disabled-text-color,#b2b2b2)}:host .md-dropdown .md-dropdown-input[readonly]{pointer-events:none}:host .md-dropdown.md-error .group,:host .md-dropdown.md-error .group:active{border-color:var(--input-error-border-color)!important}:host .md-dropdown.md-warning .group,:host .md-dropdown.md-warning .group:active{border-color:var(--input-warning-border-color)!important}:host .md-dropdown.md-success .group,:host .md-dropdown.md-success .group:active{border-color:var(--input-success-border-color)!important}:host .help-text,:host .md-dropbox__messages{padding-top:.375rem}:host .group[readonly]{border-color:var(--dropdown-border-color-disabled)!important}:host .group[readonly] md-icon{color:var(--dropdown-bg-color-disabled)!important}:host .md-dropdown-button{transition:all .15s linear;align-self:center;background:rgba(0,0,0,0);border:0;cursor:pointer;margin:0;margin-left:calc(.25rem*2);outline:0;padding:0;position:relative;width:1.25rem;height:1.25rem;display:flex;align-items:center;justify-content:center}:host .md-dropdown-button md-icon{color:var(--combobox-dropdown-item-icon-color)}:host .md-combobox-button.clear{height:auto;padding:.115rem}:host .md-combobox-button.arrow-down:focus,:host .md-combobox-button.clear:focus{outline:2px solid var(--button-focus-ring-color,#007aa3)}:host .md-new-dropdown-label{background-color:var(--dropdown-bg-color-default);border-radius:8px}:host .md-new-dropdown-label--text{color:var(--md-primary-text-color)}:host .md-new-dropdown-label:hover{background-color:var(--dropdown-bg-color-hover)}:host .md-new-dropdown-label:active{background-color:var(--dropdown-bg-color-active)}:host .md-new-dropdown-label:focus{background-color:var(--dropdown-bg-color-focus)}:host .md-new-dropdown .group{height:2rem;border-radius:.5rem;background-color:rgba(0,0,0,0);padding-right:.5rem}:host(:active) .md-new-dropdown .group,:host(:active) .md-new-dropdown-label{outline:2px solid var(--input-default-outline-color);outline-offset:.125rem;box-shadow:none;border:1px solid var(--dropdown-border-color,var(--md-secondary-seperator-color))!important}:host([focus-visible]) .md-dropdown-label{border-color:var(--dropdown-border-color-focus);box-shadow:none;outline:0}:host([focus-visible]) .group{border-color:var(--dropdown-border-color-focus);background-color:var(--dropdown-bg-color-focus)}:host([focus-visible]) .md-new-dropdown .group,:host([focus-visible]) .md-new-dropdown-label{outline:2px solid var(--dropdown-border-color-focus)!important;outline-offset:.125rem!important;box-shadow:none;border-color:var(--combobox-focus-new-border-color)}:host([disabled]) .md-dropdown-label{background-color:var(--md-tertiary-bg-color)}:host([disabled]) .md-dropdown-label:active,:host([disabled]) .md-dropdown-label:hover{background-color:var(--md-tertiary-bg-color);pointer-events:none}:host([disabled]) .md-dropdown-label:active>md-icon,:host([disabled]) .md-dropdown-label:hover>md-icon{opacity:.3}:host([disabled]) .md-dropdown-label:focus-visible{border-color:var(--dropdown-border-color-focus,#005e7d);outline:0}:host([disabled]) .group{background-color:var(--md-tertiary-bg-color)}:host([disabled]) .group md-icon{opacity:.3}:host([disabled]) .group:active,:host([disabled]) .group:hover{background-color:var(--md-tertiary-bg-color);pointer-events:none}:host([disabled]) .group:focus-visible{border-color:var(--dropdown-border-color-focus,#005e7d);outline:0}:host([disabled]) md-help-text{color:var(--md-disabled-text-color,#b2b2b2)}:host([disabled]) .md-new-dropdown-label{background-color:rgba(0,0,0,0);border-color:var(--dropdown-border-color-disabled,#b2b2b2);outline:0!important;box-shadow:none}:host([disabled]) .md-new-dropdown-label--text{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown-label .md-dropdown-label--icon md-icon{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown-label:active,:host([disabled]) .md-new-dropdown-label:hover{background-color:rgba(0,0,0,0);pointer-events:none;outline:0!important;box-shadow:none;border-color:var(--dropdown-border-color-disabled,#b2b2b2)}:host([disabled]) .md-new-dropdown-label:focus-visible{border-color:var(--dropdown-border-color-disabled);outline:0!important;box-shadow:none}:host([disabled]) .md-new-dropdown .group{background:rgba(0,0,0,0);border-color:var(--dropdown-border-color-disabled);pointer-events:none;outline:0!important}:host([disabled]) .md-new-dropdown .group input{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown .group input::placeholder{color:var(--md-disabled-text-color)}:host([disabled]) .md-new-dropdown .group:active,:host([disabled]) .md-new-dropdown .group:hover{border-color:var(--dropdown-border-color-disabled)}:host([disabled]) .md-new-dropdown .group:focus-visible{border-color:var(--dropdown-border-color-disabled)}@media(forced-colors:active){:host([focus-visible]) .md-dropdown .md-dropdown-label{border:2px solid Highlight}:host([focus-visible]) .md-dropdown .md-dropdown-label--text{forced-color-adjust:none;background-color:Canvas;color:CanvasText}:host([focus-visible]) .md-dropdown-list{border:1px solid CanvasText}:host .md-dropdown-option[focused]{forced-color-adjust:none;background-color:Highlight;color:HighlightText}:host .group input{color:HighlightText}:host .group ::input-placeholder{color:GrayText}:host([disabled]) .md-dropdown .md-dropdown-label{border:1px solid GrayText!important}:host([disabled]) .group,:host([disabled]) .group:active{border:1px solid GrayText!important;outline:0!important}:host([disabled]) .group input,:host([disabled]) .group:active input{color:GrayText}:host([disabled]) .group ::input-placeholder,:host([disabled]) .group:active ::input-placeholder{color:HighlightText!important}}`,b=function(e,o,t,r){var i,d=arguments.length,s=d<3?o:null===r?r=Object.getOwnPropertyDescriptor(o,t):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,o,t,r);else for(var n=e.length-1;n>=0;n--)(i=e[n])&&(s=(d<3?i(s):d>3?i(o,t,s):i(o,t))||s);return d>3&&s&&Object.defineProperty(o,t,s),s},m=function(e,o,t,r){return new(t||(t=Promise))((function(i,d){function s(e){try{a(r.next(e))}catch(e){d(e)}}function n(e){try{a(r.throw(e))}catch(e){d(e)}}function a(e){var o;e.done?i(e.value):(o=e.value,o instanceof t?o:new t((function(e){e(o)}))).then(s,n)}a((r=r.apply(e,o||[])).next())}))};var g;!function(e){class o{determineMessageType(e){return e.reduce((e,o)=>"error"===o?e:o.type,"")}filterMessagesByType(e,o){return e.reduce((e,t)=>t.type===o?e.concat(t.message):e,[])}}e.MessageController=o;let t=class extends(Object(i.a)(n.LitElement)){constructor(){super(...arguments),this.title="Select...",this.options=[],this.optionId="",this.optionValue="",this.defaultOption="",this.disabled=!1,this.customTabIndex=0,this.allowUnselected=!1,this.visibleOptions=8,this.newMomentum=!1,this.compact=!1,this.searchable=!1,this.searchItem=!1,this.inputValue="",this.placeholder="Select...",this.readOnly=!1,this.autofocus=!1,this.leftIcon="",this.trimSpace=!1,this.resultsTextLocalization="No Results",this.helpText="",this.messageArr=[],this.htmlId="",this.clearAriaLabel="Clear",this.clearIconHeight="auto",this.arrowAriaLabel="Expand",this.popupChevronAriaHidden="true",this.ariaLabel="",this.searchResultAriaLabel="",this.ariaLabelForDropdown="",this.renderOptions=[],this.selectedKey="",this.expanded=!1,this.focusedIndex=-1,this.messageController=new o,this.lastMaxHeight="",this.onOutsideClick=e=>{let o=!1;const t=e.composedPath();t.length&&(o=!!t.find(e=>e===this),o||this.expanded&&this.collapse())},this.onKeyDown=e=>{switch(e.code){case r.b.Tab:this.expanded&&(e.stopPropagation(),this.collapse());break;case r.b.Space:case r.b.Enter:this.expanded?(this.select(),this.collapse()):this.expand();break;case r.b.ArrowDown:this.expanded?this.focusNext():this.expand();break;case r.b.ArrowUp:this.expanded?this.focusPrev():this.expand();break;case r.b.Home:this.expanded?this.focusFirst():this.expand();break;case r.b.End:this.expanded?this.focusLast():this.expand();break;case r.b.Escape||r.b.Backspace:this.expanded&&(e.stopPropagation(),this.collapse())}},this.notifyInputValueChanged=Object(d.b)(e=>{this.dispatchEvent(new CustomEvent("dropdown-input",{composed:!0,bubbles:!0,detail:{value:e}})),this.notifySearchResultCount(),requestAnimationFrame(()=>{this.input.focus()})},250)}connectedCallback(){super.connectedCallback(),this.setupEvents()}disconnectedCallback(){super.disconnectedCallback(),this.teardownEvents()}firstUpdated(e){super.firstUpdated(e),e.forEach((e,o)=>{if("defaultOption"===o&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}}),this.searchable&&this.setInitialValue()}updated(e){super.updated(e),e.forEach((e,o)=>{if("options"===o&&this.updateRenderOptions(),"selectedKey"===o){const e=this.renderOptions.findIndex(e=>e.key===this.selectedKey);-1!==e&&(this.focusToIndex(e),this.searchable&&this.setInitialValue())}if("expanded"===o&&this.updateListDOM(),"focusedIndex"===o&&this.updateListDOM(),"defaultOption"===o&&this.defaultOption){const{key:e}=this.getOptionKeyValuePair(this.defaultOption);this.selectedKey=e}})}notifySearchResultCount(){if(this.searchResultAriaLabel){const e=/{{.*?}}/g;this.ariaLabelForDropdown=this.searchResultAriaLabel.replace(e,this.filteredOptions.length.toString())}else this.ariaLabel?this.ariaLabelForDropdown=`${this.ariaLabel}, ${this.filteredOptions.length} results found.`:this.ariaLabelForDropdown=`Dropdown Element, ${this.filteredOptions.length} results found.`}setInitialValue(){var e;if(this.options.length){const o=this.renderOptions.find(e=>e.key===this.selectedKey),t=null==o?void 0:o.option;t&&(this.setInputValue(this.getOptionValue(t)),null===(e=this.input)||void 0===e||e.setAttribute(r.a.AriaActivedescendant,this.getOptionId(t)),this.notifyInputValueChanged(this.getOptionValue(t)),this.requestUpdate())}}getOptionValue(e){return this.isOptionObject(e)&&!this.optionValue?Object.values(e)[0]:this.isOptionObject(e)?e[this.optionValue]:e}getOptionId(e){return this.isOptionObject(e)?e[this.optionId]:e}isOptionObject(e){return"object"==typeof e&&null!==e}updateRenderOptions(){const e=[];this.focusReset();const o=this.options.reduce((o,t)=>{const{key:r,value:i}=this.getOptionKeyValuePair(t);return-1!==e.indexOf(r)?console.error(`Dropdown already have option key: "${r}". Ignoring `):r?(e.push(r),o.push({key:r,value:i,option:t})):console.error(`Dropdown key is not defined: "${r}". (value: "${i}"). Ignoring `),o},[]);this.allowUnselected&&o.unshift({key:"",value:this.title}),this.renderOptions=o}updateListDOM(){return m(this,void 0,void 0,(function*(){this.expanded&&(yield this.resizeDropdownList(),yield this.scrollToIndex(this.focusedIndex))}))}resizeDropdownList(){return m(this,void 0,void 0,(function*(){yield new Promise(e=>requestAnimationFrame(()=>{if(this.optionsListItems)if(this.optionsListItems.length>this.visibleOptions){const e=[...this.optionsListItems].slice(0,this.visibleOptions).reduce((e,o)=>e+o.offsetHeight,0)+"px";this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}else{const e="auto";this.lastMaxHeight!==e&&(this.optionsList.style.maxHeight=e,this.lastMaxHeight=e)}e()}))}))}handleFocusIn(e){this.disabled&&this.readOnly||super.handleFocusIn&&super.handleFocusIn(e),this.dispatchEvent(new CustomEvent("dropdown-focus-in",{composed:!0,bubbles:!0}))}handleFocusOut(e){super.handleFocusOut&&super.handleFocusOut(e),this.dispatchEvent(new CustomEvent("dropdown-focus-out",{composed:!0,bubbles:!0}))}static get styles(){return[s.a,u]}get filteredOptions(){const e=this.trimSpace?this.inputValue.replace(/\s+/g,""):this.inputValue;if(!e.trim())return this.renderOptions;const o=this.renderOptions.filter(o=>o.value.toLowerCase().includes(e.toLowerCase()));return 0===o.length?[{key:"no-result",value:"No Result",disabled:!0}]:o}get messageType(){return this.messageArr.length>0?this.messageController.determineMessageType(this.messageArr):null}get messages(){return this.messageType?this.messageController.filterMessagesByType(this.messageArr,this.messageType):null}setVisualListbox(e){this.expanded=e}updateOnNextFrame(e){requestAnimationFrame(e)}setInputValue(e=""){this.input.value=e}shouldChangeButton(){const e=this.input&&this.input.value.length>0;return e&&document.dispatchEvent(new CustomEvent("on-widget-update")),e}toggleVisualListBox(e){var o,t;if(!this.readOnly){if(e.target.classList.contains("md-dropdown-input"))e.target.focus();else if("md-icon"===e.target.localName){const r=null===(t=null===(o=e.target.parentElement)||void 0===o?void 0:o.parentElement)||void 0===t?void 0:t.parentElement;if(r){const e=r.querySelector(".md-dropdown-input");setTimeout(()=>{e.focus()},10)}}this.expanded?this.setVisualListbox(!1):(this.dispatchEvent(new CustomEvent("combobox-on-expand",{composed:!0,bubbles:!0})),this.notifySearchResultCount(),this.setVisualListbox(!0)),this.input.focus()}}handleRemoveAll(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-all-selected"))}removeAllSelected(){var e;this.focusReset(),this.selectedKey="",this.inputValue="",this.setInputValue(),null===(e=this.input)||void 0===e||e.setAttribute(r.a.AriaActivedescendant,""),this.setVisualListbox(!1),this.updateOnNextFrame(()=>{this.input.focus()}),this.dispatchEvent(new CustomEvent("dropdown-selection-removed",{composed:!0,bubbles:!0,detail:{}}))}setupEvents(){document.addEventListener("click",this.onOutsideClick),this.addEventListener("keydown",this.onKeyDown),this.addEventListener("remove-all-selected",this.removeAllSelected)}teardownEvents(){document.removeEventListener("click",this.onOutsideClick),this.removeEventListener("keydown",this.onKeyDown),this.removeEventListener("remove-all-selected",this.removeAllSelected)}expand(){this.expanded=!0;const e=-1!==this.focusedIndex?"combo-"+this.focusedIndex:"";document.dispatchEvent(new CustomEvent("on-widget-update")),this.label.setAttribute("aria-activedescendant",e),this.optionsList&&this.optionsList.focus(),-1===this.focusedIndex&&this.focusNext()}collapse(){this.expanded=!1,this.searchable||this.label.setAttribute("aria-activedescendant","")}toggle(){this.expanded?this.collapse():this.expand()}select(){if(-1!==this.focusedIndex){const e=this.renderOptions[this.focusedIndex],o=e.key;o!==this.selectedKey&&(this.selectedKey=o,this.dispatchEvent(new CustomEvent("dropdown-selected",{composed:!0,bubbles:!0,detail:{option:e.option?e.option:e.key}})))}}onLabelClick(){this.label.focus(),this.toggle()}focusFirst(){this.renderOptions.length&&(this.focusedIndex=0)}focusLast(){this.renderOptions.length&&(this.focusedIndex=this.renderOptions.length-1)}focusNext(){this.renderOptions.length&&(-1!==this.focusedIndex&&this.focusedIndex<this.renderOptions.length-1?this.focusedIndex++:this.focusFirst())}focusPrev(){this.renderOptions.length&&(this.focusedIndex>0?this.focusedIndex--:this.focusLast())}focusToIndex(e){this.renderOptions.length&&e>=0&&e<=this.renderOptions.length-1&&(this.focusedIndex=e)}focusToIndexWithOption(e){const o=this.renderOptions.findIndex(o=>o.key===e.key);this.renderOptions.length&&o>=0&&o<=this.renderOptions.length-1&&(this.focusedIndex=o)}focusReset(){this.focusedIndex=-1}scrollToIndex(e){return m(this,void 0,void 0,(function*(){yield new Promise(o=>{requestAnimationFrame(()=>{if(this.optionsListItems&&this.optionsListItems.length>this.visibleOptions&&e>=0&&this.optionsListItems.length>e){let o=0;const{top:t,bottom:r}=this.optionsList.getBoundingClientRect(),i=this.optionsListItems[e],d=this.optionsListItems[e+1]||i,s=this.optionsListItems[e-1]||i,n=d.getBoundingClientRect(),a=s.getBoundingClientRect();n.bottom>r?o=n.bottom-r+2:a.top<t&&(o=a.top-t-2),this.optionsList.scrollTop+=o}o()})})}))}getOptionKeyValuePair(e){if("string"==typeof e)return{key:e.trim(),value:e};if(e&&"object"==typeof e){const o=Object.keys(e),t=Object.values(e);if(o.length){if(1===o.length||!this.optionId)return{key:o[0],value:t[0]};if(this.optionId)return{key:e[this.optionId],value:e[this.optionValue||this.optionId]}}}return{key:"undefined",value:"undefined"}}get labelTitle(){if(this.selectedKey){const e=this.renderOptions.find(e=>e.key===this.selectedKey);if(e)return e.value}return this.title}get dropDownClassMap(){return{"md-dropdown__expanded":this.expanded,["md-"+this.messageType]:!!this.messageType,"md-new-dropdown":this.newMomentum}}handleInput(e){const o=e.target.value;this.inputValue=o.trim(),this.notifyInputValueChanged(o.trim())}helpTextTemplate(){return this.helpText?a.html`
2
2
  <md-help-text
3
3
  class="help-text ${Object(l.classMap)({disabled:this.disabled,newMomentum:this.newMomentum})}"
4
4
  .message=${this.helpText}