var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.checkStringArgs=function(a,b,c){if(null==a)throw new TypeError("The 'this' value for String.prototype."+c+" must not be null or undefined");if(b instanceof RegExp)throw new TypeError("First argument to String.prototype."+c+" must not be a regular expression");return a+""};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.ISOLATE_POLYFILLS=!1;
$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE="function"===typeof Symbol&&"symbol"===typeof Symbol("x");$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;$jscomp.polyfills={};
$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b){var c=$jscomp.propertyToPolyfillSymbol[b];if(null==c)return a[b];c=a[c];return void 0!==c?c:a[b]};$jscomp.polyfill=function(a,b,c,d){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,d):$jscomp.polyfillUnisolated(a,b,c,d))};
$jscomp.polyfillUnisolated=function(a,b,c,d){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))return;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})};
$jscomp.polyfillIsolated=function(a,b,c,d){var e=a.split(".");a=1===e.length;d=e[0];d=!a&&d in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var f=0;f<e.length-1;f++){var g=e[f];if(!(g in d))return;d=d[g]}e=e[e.length-1];c=$jscomp.IS_SYMBOL_NATIVE&&"es6"===c?d[e]:null;b=b(c);null!=b&&(a?$jscomp.defineProperty($jscomp.polyfills,e,{configurable:!0,writable:!0,value:b}):b!==c&&(void 0===$jscomp.propertyToPolyfillSymbol[e]&&(c=1E9*Math.random()>>>0,$jscomp.propertyToPolyfillSymbol[e]=$jscomp.IS_SYMBOL_NATIVE?
$jscomp.global.Symbol(e):$jscomp.POLYFILL_PREFIX+c+"$"+e),$jscomp.defineProperty(d,$jscomp.propertyToPolyfillSymbol[e],{configurable:!0,writable:!0,value:b})))};$jscomp.polyfill("String.prototype.startsWith",function(a){return a?a:function(b,c){var d=$jscomp.checkStringArgs(this,b,"startsWith");b+="";var e=d.length,f=b.length;c=Math.max(0,Math.min(c|0,d.length));for(var g=0;g<f&&c<e;)if(d[c++]!=b[g++])return!1;return g>=f}},"es6","es3");
zul.inp.Combobox=zk.$extends(zul.inp.ComboWidget,{_autocomplete:!0,_instantSelect:!0,_iconSclass:"z-icon-caret-down",$define:{autocomplete:null,emptySearchMessage:null,instantSelect:null},onResponse:function(){var a=arguments;if(this.isOpen()&&jq(this.getPopupNode_()).is(":animated")){var b=this;setTimeout(function(){b.desktop&&b.onResponse.apply(b,a)},50)}else this.$supers("onResponse",arguments),this._shallRedoCss&&(zk(this.getPopupNode_()).redoCSS(-1),this._shallRedoCss=null),a[1]&&a[1].rtags&&
a[1].rtags.onChanging&&this.isOpen()&&(this._checkPopupPosition(),this._fixEmptySearchMessage()),this.isOpen()&&this._shallSyncPopupPosition&&(zk(this.getPopupNode_()).position(this.getInputNode(),"before_start"),this._shallSyncPopupPosition=!1)},setSelectedItemUuid_:function(a){if(this.desktop){if(!this._sel||a!=this._sel.uuid){var b=this._sel,c;this._sel=this._lastsel=null;(a=zk.$(a))&&(c=a);this._hiliteOpt(b,this._sel=c);this._lastsel=c}}else this._initSelUuid=a},setRepos:function(a){if(!this._repos&&
a&&(this.$supers("setRepos",arguments),this.desktop)){this._typeahead(this._bDel);this._bDel=null;var b=this.getPopupNode_();b&&(b.style.width="auto",zk.webkit&&(this._shallRedoCss=!0))}},setValue:function(a){this.$supers("setValue",arguments);this._reIndex();this.valueEnter_=null;this._lastsel=this._sel},_reIndex:function(){var a=this.getValue();if(!this._sel||a!=this._sel.getLabel()){if(this._sel){var b=this._sel.$n();b&&jq(b).removeClass(this._sel.$s("selected"))}this._sel=this._lastsel=null;for(b=
this.firstChild;b;b=b.nextSibling)if(a==b.getLabel()){this._sel=b;break}}},validateStrict:function(a){var b=this._cst;return this._findItem(a,!0)?null:(b?b._errmsg.STRICT?b._errmsg.STRICT:"":"")||msgzul.VALUE_NOT_MATCHED},_findItem:function(a,b){return this._findItem0(a,b)},_findItem0:function(a,b,c,d){var e=this.firstChild;if(e&&a){a=a.toLowerCase();var f=this._sel;f&&f.parent==this||(f=e);for(d=d?f.nextSibling?f.nextSibling:e:f;;){if((!b||!d.isDisabled())&&d.isVisible()&&(c?d.getLabel().toLowerCase().startsWith(a):
a==d.getLabel().toLowerCase()))return d;(d=d.nextSibling)||(d=e);if(d==f)break}}},_hilite:function(a){this._hilite2(this._findItem(this.valueEnter_=this.getInputNode().value,this._isStrict()||a&&a.strict),a)},_hilite2:function(a,b){b=b||{};var c=this._sel;this._sel=a;this._hiliteOpt(c,a);if(b.sendOnSelect&&this._lastsel!=a){if(a){c=this.getInputNode();var d=a.getLabel(),e=null;11>zk.ie&&(e=zk(c).getSelectionRange());this.valueEnter_=c.value=d;e&&c.setSelectionRange(e[0],e[1]);b.noSelectRange||(zk.gecko?
c.select():zk(c).setSelectionRange(0,d.length))}b.sendOnChange&&this.$supers("updateChange_",[]);this.fire("onSelect",{items:a?[a]:[],reference:a,prevSeld:this._lastsel});this._lastsel=a}else b.sendOnChange&&this.$supers("updateChange_",[])},_hiliteOpt:function(a,b){if(a&&a.parent==this){var c=a.$n();c&&jq(c).removeClass(a.$s("selected"))}b&&!b.isDisabled()&&jq(b.$n()).addClass(b.$s("selected"))},_isStrict:function(){var a=this.getConstraint();return a&&a._flags&&a._flags.STRICT},open:function(a){this.$supers("open",
arguments);this._hilite()},dnPressed_:function(a){this._updnSel(a)},upPressed_:function(a){this._updnSel(a,!0)},_updnSel:function(a,b){var c=this.getInputNode(),d=c.value;if(d||this._sel){d=d.toLowerCase();var e=this._sel;e&&e.parent==this||(e=this._next(null,!b));if(!e){a.stop();return}for(var f=e;;){if(!f.isDisabled()&&f.isVisible()){var g=f.getLabel().toLowerCase();if(d==g){var h=f;break}else if(!k&&g.startsWith(d)){var k=f;break}}g=this._next(f,b);if(f==g)break;if((f=g)==e)break}h||(h=k);h?(c=
zk(c).getSelectionRange(),0==c[0]&&c[1]==d.length&&(h=this._next(h,b))):h=this._next(null,!b)}else h=this._next(null,!0);h&&zk(h).scrollIntoView(this.$n("pp"));this._select(h,!this._instantSelect&&this._open?{}:{sendOnSelect:!0,sendOnChange:!0});a.stop()},_next:function(){function a(b,c,d){c=c?"previousSibling":"nextSibling";for(b=d?b:b[c];b;b=b[c])if(!b.isDisabled()&&b.isVisible())return b;return null}return function(b,c){b&&(b=a(b,c));return b?b:a(c?this.firstChild:this.lastChild,!c,!0)}}(),_select:function(a,
b){var c=this.getInputNode(),d=c.value=a?a.getLabel():"";this.valueSel_=d;this._hilite2(a,b);d&&(zk.gecko?c.select():zk(c).setSelectionRange(0,d.length))},otherPressed_:function(a){var b=a.keyCode;this._bDel=8==b||46==b;if(this._readonly)switch(b){case 35:case 36:this._hilite2(),this.getInputNode().value="";case 37:case 39:this._updnSel(a,37==b||35==b);break;case 8:a.stop();break;default:96<=b&&105>=b&&(b-=48),a=String.fromCharCode(b),(a=this._findItem0(a,!0,!0,!!this._sel))&&this._select(a,{sendOnSelect:!0})}},
escPressed_:function(){if(!this._instantSelect&&this._open&&this._lastsel!=this._sel){this._hilite2(this._lastsel);var a=this._lastsel?this._lastsel.getLabel():"";this.valueSel_=this.valueEnter_=this.getInputNode().value=a}this.$supers("escPressed_",arguments)},doKeyUp_:function(a){if(!this._disabled){if(!this._readonly&&!this._autoCompleteSuppressed){var b=a.keyCode;this._typeahead(8==b||46==b)}this.$supers("doKeyUp_",arguments)}},_typeahead:function(a){if(zk.currentFocus==this){var b=this.getInputNode(),
c=b.value,d=zk(b).getSelectionRange(),e=this.firstChild;this.valueEnter_=c;if(!c||!e||d[0]!=c.length||d[0]!=d[1])return this._hilite({strict:!0});if((d=this._findItem(c,!0))||a||!this._autocomplete)return d&&d.getLabel().toLowerCase().startsWith(c.toLowerCase())&&this._autocomplete&&(b.value=d.getLabel()),this._hilite2(d);c=c.toLowerCase();(d=this._sel)&&d.parent==this||(d=e);for(a=d;;){if(!a.isDisabled()&&a.isVisible()&&a.getLabel().toLowerCase().startsWith(c)){b.value=a.getLabel();zk(b).setSelectionRange(c.length,
b.value.length);this._hilite2(a);break}(a=a.nextSibling)||(a=e);if(a==d){this._hilite2();break}}}},updateChange_:function(){if(this._value!=this.getInputNode().value)return this._hilite({sendOnSelect:!0,sendOnChange:!0,noSelectRange:!0}),!0;this.valueEnter_=null},bind_:function(){this.$supers(zul.inp.Combobox,"bind_",arguments);this.isListen("onOpen")&&this.listen({onChanging:zk.$void},-1E3);this._initSelUuid&&(this.setSelectedItemUuid_(this._initSelUuid),this._initSelUuid=null);var a=this.getInputNode();
this.domListen_(a,"onCompositionstart","_doCompositionstart").domListen_(a,"onCompositionend","_doCompositionend")},unbind_:function(){this._hilite2();this._sel=this._lastsel=null;var a=this.getInputNode();this.domUnlisten_(a,"onCompositionend","_doCompositionend").domUnlisten_(a,"onCompositionstart","_doCompositionstart");this.isListen("onOpen")&&this.unlisten({onChanging:zk.$void});this.$supers(zul.inp.Combobox,"unbind_",arguments)},_doCompositionstart:function(){this._autoCompleteSuppressed=!0},
_doCompositionend:function(){this._autoCompleteSuppressed=!1;this._disabled||this._readonly||this._typeahead(!1)},redrawpp_:function(a){var b=this.uuid,c=this._emptySearchMessage;a.push('<div id="',b,'-pp" class="',this.$s("popup")," ",this.getSclass(),'" style="display:none" tabindex="0">');c&&a.push('<div id="',b,'-emptySearchMessage" class="',this.$s("emptySearchMessage")," ",this.$s("emptySearchMessage-hidden"),'">',c,"</div>");a.push('<ul id="',b,'-cave" class="',this.$s("content"),'" >');for(b=
this.firstChild;b;b=b.nextSibling)b.redraw(a);a.push("</ul></div>")},afterAnima_:function(a){a&&this._lastsel&&zk(this._lastsel).scrollIntoView(this.$n("pp"));this.$supers("afterAnima_",arguments)},_fixsz:function(){var a=this.getPopupNode_();a.style.width="auto";this.$supers("_fixsz",arguments);zk(a).hasVScroll()&&!this.getPopupWidth()&&(a.style.width=jq.px(a.offsetWidth+jq.scrollbarWidth()))},_fixEmptySearchMessage:function(){this._emptySearchMessage&&jq(this.$n("emptySearchMessage")).toggleClass(this.$s("emptySearchMessage-hidden"),
0<this.nChildren)}});
