var __awaiter=this&&this.__awaiter||function(t,n,e,i){function r(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,u){function c(t){try{f(i.next(t))}catch(t){u(t)}}function o(t){try{f(i["throw"](t))}catch(t){u(t)}}function f(t){t.done?e(t.value):r(t.value).then(c,o)}f((i=i.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},i,r,u,c=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return c.next=o(0),c["throw"]=o(1),c["return"]=o(2),typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function o(t){return function(n){return f([t,n])}}function f(o){if(i)throw new TypeError("Generator is already executing.");while(c&&(c=0,o[0]&&(e=0)),e)try{if(i=1,r&&(u=o[0]&2?r["return"]:o[0]?r["throw"]||((u=r["return"])&&u.call(r),0):r.next)&&!(u=u.call(r,o[1])).done)return u;if(r=0,u)o=[o[0]&2,u.value];switch(o[0]){case 0:case 1:u=o;break;case 4:e.label++;return{value:o[1],done:false};case 5:e.label++;r=o[1];o=[0];continue;case 7:o=e.ops.pop();e.trys.pop();continue;default:if(!(u=e.trys,u=u.length>0&&u[u.length-1])&&(o[0]===6||o[0]===2)){e=0;continue}if(o[0]===3&&(!u||o[1]>u[0]&&o[1]<u[3])){e.label=o[1];break}if(o[0]===6&&e.label<u[1]){e.label=u[1];u=o;break}if(u&&e.label<u[2]){e.label=u[2];e.ops.push(o);break}if(u[2])e.ops.pop();e.trys.pop();continue}o=n.call(t,e)}catch(t){o=[6,t];r=0}finally{i=u=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};System.register([],(function(t){"use strict";return{execute:function(){var n=t("n",(function(t,n){var e=Object.assign(Object.assign({},t),{disabled:false,invalid:false,selected:false,focused:false,hidden:false,multiline:false});if(n){e.disabled=n.disabled===undefined?e.disabled:n.disabled;e.invalid=n.invalid===undefined?e.invalid:n.invalid;e.selected=n.selected===undefined?e.selected:n.selected;e.focused=n.focused===undefined?e.focused:n.focused;e.hidden=n.hidden===undefined?e.hidden:n.hidden;e.multiline=n.multiline===undefined?e.multiline:n.multiline}return e}));var e=function(t){return n({value:t.value,label:t.label},t)};var i=function(){function t(){}t.prototype.connectedCallback=function(t){this.component=t;this.optionChanged()};t.prototype.componentWillRender=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:if(!this.component.listEl)return[3,2];t=this.component;return[4,this.component.listEl.getValues()];case 1:t.nativeOptions=n.sent();n.label=2;case 2:return[2]}}))}))};t.prototype.hasPropOptions=function(){return this.component.options&&this.component.options.length>0};t.prototype.optionChanged=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:this.component.rawOptions=this.component.options.map(e);return[4,this.component.valueUtil.updateInputContent()];case 1:t.sent();return[2]}}))}))};t.prototype.listenToOptionChange=function(t){return __awaiter(this,void 0,void 0,(function(){var t,n;return __generator(this,(function(e){switch(e.label){case 0:return[4,(t=this.component.listEl)===null||t===void 0?void 0:t.getSelectedValues()];case 1:n=e.sent()||[];this.component.valueUtil.updateRawValueBySelection(n);if(!this.component.multiple){this.component.popupUtil.collapseList();if(this.component.hasFocus){this.component.balBlur.emit(new FocusEvent("blur",{relatedTarget:this.component.el}));this.component.hasFocus=false}}return[2]}}))}))};return t}();t("D",i)}}}));