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.endsWith",function(a){return a?a:function(b,c){var d=$jscomp.checkStringArgs(this,b,"endsWith");b+="";void 0===c&&(c=d.length);c=Math.max(0,Math.min(c|0,d.length));for(var e=b.length;0<e&&0<c;)if(d[--c]!=b[--e])return!1;return 0>=e}},"es6","es3");
var Tree=zul.sel.Tree=zk.$extends(zul.sel.SelectWidget,{_scrollbar:null,_barPos:null,unbind_:function(){this.destroyBar_();this.$supers(Tree,"unbind_",arguments)},onSize:function(){this.$supers(Tree,"onSize",arguments);var a=this,b=this.frozen;this._shallSyncFrozen&&b&&this._nativebar&&(b.onSize(),this._shallSyncFrozen=!1);setTimeout(function(){a.desktop&&!a._nativebar&&(a._scrollbar||(a._scrollbar=zul.mesh.Scrollbar.init(a)),a.refreshBar_())},200)},refreshBar_:function(a){var b=this._scrollbar;if(b){if(this._currentLeft||
this._currentTop)var c={l:this._currentLeft,t:this._currentTop};this.inPagingMold()&&c&&(a=!0);b.syncSize(a||this._shallShowScrollbar);delete this._shallShowScrollbar;c&&b.scrollTo(c.l,c.t);a=this.frozen;var d;a&&0!=(d=a._start)&&(a._doScrollNow(d),b.setBarPosition(d))}},destroyBar_:function(){var a=this._scrollbar;a&&(a.destroy(),this._scrollbar=null)},clear:function(){if(this._treechildren&&this._treechildren.nChildren)for(var a=this._treechildren.firstChild;a;a=a.nextSibling)a.detach()},insertBefore:function(a,
b,c){if(this.$super("insertBefore",a,b,!this.z_rod))return this._fixOnAdd(a,c,c),!0},appendChild:function(a,b){if(this.$super("appendChild",a,!this.z_rod))return this.insertingBefore_||this._fixOnAdd(a,b,b),!0},_fixOnAdd:function(a,b,c){a.$instanceof(zul.sel.Treecols)?this.treecols=a:a.$instanceof(zul.sel.Treechildren)?(this.treechildren=a,this._fixSelectedSet()):a.$instanceof(zul.mesh.Paging)?this.paging=a:a.$instanceof(zul.sel.Treefoot)?this.treefoot=a:a.$instanceof(zul.mesh.Frozen)&&(this.frozen=
a);b||this.rerender();c||this._syncSize()},onChildRemoved_:function(a){this.$supers("onChildRemoved_",arguments);a==this.treecols?this.treecols=null:a==this.treefoot?this.treefoot=null:a==this.treechildren?(this.treechildren=null,this._selItems=[],this._sel=null):a==this.paging?this.paging=null:a==this.frozen&&(this.frozen=null,this.destroyBar_());this.childReplacing_||this._syncSize()},onChildAdded_:function(a){this.$supers("onChildAdded_",arguments);this.childReplacing_&&this._fixOnAdd(a,!0)},_onTreeitemAdded:function(a){this._fixNewChild(a);
this._onTreechildrenAdded(a.treechildren)},_onTreeitemRemoved:function(a){var b,c;a.isSelected()&&(this._selItems.$remove(a),(b=this._sel==a)&&!this._multiple&&(this._sel=null));this._onTreechildrenRemoved(a.treechildren);b&&this._fixSelected();(c=a.previousSibling||a.getParentItem())?this._shallSyncFocus=c:this._shallSyncFocus=!0},_onTreechildrenAdded:function(a){if(a&&a.parent!=this){var b=0;a=a.getItems();for(var c=a.length;b<c;++b)a[b]&&this._fixNewChild(a[b])}},_onTreechildrenRemoved:function(a){if(null!=
a&&a.parent!=this){for(var b,c=0,d=a.getItems(),e=d.length;c<e;++c)if(a=d[c],a.isSelected()&&(this._selItems.$remove(a),this._sel==a)){if(!this._multiple){this._sel=null;return}b=!0}b&&this._fixSelected()}},_fixNewChild:function(a){a.isSelected()&&(this._sel&&!this._multiple?(a._selected=!1,a.rerender()):(this._sel||(this._sel=a),this._selItems.push(a)))},_fixSelectedSet:function(){this._sel=null;this._selItems=[];for(var a=0,b=this.getItems(),c=b.length;a<c;++a)if(b[a].isSelected()){if(null==this._sel)this._sel=
b[a];else if(!this._multiple){b[a]._selected=!1;continue}this._selItems.push(b[a])}},_fixSelected:function(){switch(this._selItems.length){case 1:var a=this._selItems[0];case 0:break;default:for(var b=0,c=this.getItems(),d=c.length;b<d;++b)if(c[b].isSelected()){a=c[b];break}}return a!=this._sel?(this._sel=a,!0):!1},_sizeOnOpen:function(){this._shallShowScrollbar=!0;var a=this.treecols,b;if(!a||this.isSizedByContent()||"min"==this._hflex)this.syncSize();else for(a=a.firstChild;a;a=a.nextSibling)if(a._hflex||
!(b=a._width)||"auto"==b){this.syncSize();return}this.doResizeScroll_()},getHeadWidgetClass:function(){return zul.sel.Treecols},itemIterator:_zkf=function(a){return new zul.sel.TreeItemIter(this,a)},getBodyWidgetIterator:_zkf,_updHeaderCM:function(){var a;this._headercm&&this._multiple&&(a=this.treecols)&&(a=a.firstChild)&&(a._checked=this._isAllSelected());this.$supers(Tree,"_updHeaderCM",arguments)},getItems:function(a){return this.treechildren?this.treechildren.getItems(null,a):[]},getItemCount:function(a){return null!=
this.treechildren?this.treechildren.getItemCount(a):0},_doLeft:function(a){a.isOpen()&&a.setOpen(!1)},_doRight:function(a){a.isOpen()||a.setOpen(!0)},shallIgnoreSelect_:function(a){var b=a.domTarget;if(b)return b=b.id,b.endsWith("open")||b.endsWith("icon")||"onRightClick"==a.name&&!this.rightSelect},clearSelection:function(){this.$supers("clearSelection",arguments);this._sel=null},_addItemToSelection:function(){this.$supers("_addItemToSelection",arguments);this._sel=this._selItems[0]},_removeItemFromSelection:function(){this.$supers("_removeItemFromSelection",
arguments);this._sel=this._selItems[0]},checkOnHighlightDisabled_:function(){if(this._selectOnHighlightDisabled){var a=window.getSelection||document.selection;if(a)return 0<a().toString().length}}});
zul.sel.TreeItemIter=zk.$extends(zk.Object,{$init:function(a,b){this.tree=a;this.opts=b},_init:function(){this._isInit||(this._isInit=!0,this.items=this.tree.getItems(this.opts),this.length=this.items.length,this.cur=0)},hasNext:function(){this._init();return this.cur<this.length},next:function(){this._init();return this.items[this.cur++]}});
