var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,b,c){a instanceof String&&(a=String(a));for(var d=a.length,e=0;e<d;e++){var f=a[e];if(b.call(c,f,e,a))return{i:e,v:f}}return{i:-1,v:void 0}};$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 k=e[f];if(!(k in d))return;d=d[k]}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("Array.prototype.find",function(a){return a?a:function(b,c){return $jscomp.findInternal(this,b,c).v}},"es6","es3");
zul.mesh.HeaderWidget=zk.$extends(zul.LabelImageWidget,{_sumWidth:!0,$define:{align:function(a){this.adjustDOMAlign_("align",a)},valign:function(a){this.adjustDOMAlign_("valign",a)},height:function(){this.updateMesh_()}},getWidth:function(){return this.isVisible()?this._width:0},setWidth:function(a){this._width=a;this.updateMesh_()},doFocus_:function(a){this.$supers("doFocus_",arguments);var b,c;(b=this.getMeshWidget())&&b.efrozen&&zk.Widget.$(b.efrozen.firstChild)&&(c=this.$n())&&b._moveToHidingFocusCell(c.cellIndex)},
updateMesh_:function(a,b){if(this.desktop){var c=this.getMeshWidget();if(c){var d=null;"visible"==a&&b&&"-1"==this._width&&(d=c._calcMinWds());c._minWd=null;c.rerender();if(d){a=this.parent.firstChild;for(b=0;a;a=a.nextSibling,b++)if(a==this){this._width=jq.px0(d.wds[b]);break}zUtl.fireSized(c,-1)}}}},adjustDOMAlign_:function(a,b){var c=this.$n();c&&("align"==a?c.style.textAlign=b:"valign"==a&&(c.style.verticalAlign=b))},setFlexSize_:function(a,b){if(!this._cssflex||null==this.parent.getFlexContainer_()||
b){if(void 0!==a.width&&"auto"!=a.width&&""!=a.width||0==a.width){var c="min"==this._hflex&&this.firstChild&&this.isRealVisible()?zk(this.$n("cave")).revisedWidth(a.width):a.width;this._hflexWidth=c;return{width:c}}this.$supers("setFlexSize_",arguments)}},getContentEdgeHeight_:function(){return zk(this).sumStyles("tb",jq.margins)},getContentEdgeWidth_:function(){return zk(this).sumStyles("lr",jq.margins)},domStyle_:function(a){var b="";this._hflexWidth&&(b="width: "+this._hflexWidth+"px;",a?a.width=
!0:a={width:!0});this._align&&(b+="text-align:"+this._align+";");this._valign&&(b+="vertical-align:"+this._valign+";");return b+this.$super("domStyle_",a)},getMeshWidget:function(){return this.parent?this.parent.parent:null},isSortable_:function(){return!1},setVisible:function(a){if(this.isVisible()!=a){this.$supers("setVisible",arguments);this.updateMesh_("visible",a);var b=this.getMeshWidget();b&&b.desktop&&!this._hflexWidth&&this.getWidth()&&this.parent.fire("onColSize",{index:zk(this.$n()).cellIndex(),
column:this,width:this.isVisible()?this._width:"-1"},null,0)}},getTextNode:function(){return jq(this.$n()).find(">div:first")[0]},bind_:function(){this.$supers(zul.mesh.HeaderWidget,"bind_",arguments);this.parent.isSizable()&&this._initsz();var a=this.getMeshWidget(),b=zul.mesh.MeshWidget.WIDTH0;if(a){var c=jq(this.$n()),d=jq(this.$n("hdfaker")),e=this.getWidth();a._cssflex&&a.isChildrenFlex&&a.isChildrenFlex()?this.isVisible()?c.css("display",""):c.css("display","none"):this.isVisible()?(d.css("visibility",
""),!this._hflexWidth&&e&&d.css("width",e)):(d.css("display",""),d.css("visibility","collapse"),d.css("width",b),a._cssflex&&0<this._nhflex?c.css("display","none"):c.css("display",""))}this.fixFaker_()},unbind_:function(){this._dragsz&&(this._dragsz.destroy(),this._dragsz=null);this.$supers(zul.mesh.HeaderWidget,"unbind_",arguments)},_initsz:function(){if(this.$n()&&!this._dragsz){var a=this.$class;this._dragsz=new zk.Draggable(this,null,{revert:!0,constraint:"horizontal",ghosting:a._ghostsizing,
endghosting:a._endghostsizing,snap:a._snapsizing,ignoredrag:a._ignoresizing,zIndex:99999,endeffect:a._aftersizing})}},fixFaker_:function(){if(!this.parent.$instanceof(zul.mesh.Auxhead))for(var a=this.$n(),b=zk(a).cellIndex(),c=this.getMeshWidget(),d,e=this.$class._faker,f=e.length;f--;)(d=c["e"+e[f]])&&!this.$n(e[f])&&(d[d.childNodes.length>b?"insertBefore":"appendChild"](this._createFaker(a,e[f]),d.childNodes[b]),this._subnodes[e[f]]=null)},_createFaker:function(a,b){var c=zul.mesh.MeshWidget._getWidth;
c=c(this,this._hflexWidth?this._hflexWidth+"px":this.getWidth());var d=document.createElement("col"),e=this.getMeshWidget().frozen;(c=c?"width: "+c+";":"")||!e||e._smooth||(c=this._calcFakerWidth(b));d.id=a.id+"-"+b;d.style.cssText=c;return d},_calcFakerWidth:function(a){for(var b=this.parent.firstChild,c=0,d=1;b;){if(!b.getWidth()&&!b.getHflex()&&b!=this){var e=b.$n(a).style.width;if(""==e)break;c=e==zul.mesh.MeshWidget.WIDTH0?c+parseFloat(b._origWd):c+parseFloat(e);d++}b=b.nextSibling}if(0==c)return"";
b=jq.px0(c/d);this._syncFakerWidth(b,a);return"width: "+b},_syncFakerWidth:function(a,b){for(var c=this.parent.firstChild;c;){if(!c.getWidth()&&!c.getHflex()&&c!=this){var d=c.$n(b);d.style.width==zul.mesh.MeshWidget.WIDTH0?"hdfaker"==b&&(c._origWd=a):d.style.width=a}c=c.nextSibling}},doClick_:function(a){var b=a.domTarget,c=zk.Widget.$(b),d=this.$n();d=this._dragsz?zk(d).revisedOffset():!1;var e=c.$n("btn"),f=!1;11>zk.ie&&e&&!zk(e).isRealVisible()&&(f=!0);zk.dragging||c!=this&&!c.$instanceof(zul.wgt.Label)||
!this.isSortable_()||jq.nodeName(b,"input")||this._dragsz&&this._insizer(a.pageX-d[0])||f?(jq.nodeName(b,"input")&&a.stop({propagation:!0}),this.$supers("doClick_",arguments)):(this.fire("onSort","ascending"!=this.getSortDirection()),a.stop())},doDoubleClick_:function(a){if(this._dragsz){var b=this.$n();b=zk(b);var c=b.revisedOffset();this._insizer(a.pageX-c[0])?(c=this.getMeshWidget(),b=b.cellIndex(),c.clearCachedSize_(),c._calcMinWds(),this.$class._aftersizing({control:this,_zszofs:c._minWd.wds[b]},
a)):this.$supers("doDoubleClick_",arguments)}else this.$supers("doDoubleClick_",arguments)},doMouseMove_:function(a){if(!zk.dragging&&this.parent.isSizable()){var b=this.$n(),c=zk(b).revisedOffset();this._insizer(a.pageX-c[0])?jq(b).addClass(this.$s("sizing")):jq(b).removeClass(this.$s("sizing"))}},doMouseOut_:function(a){if(this.parent.isSizable()){var b=this.$n();jq(b).removeClass(this.$s("sizing"))}this.$supers("doMouseOut_",arguments)},ignoreDrag_:function(a){if(this.parent.isSizable()){var b=
this.$n();b=zk(b).revisedOffset();return this._insizer(a[0]-b[0])}return!1},ignoreChildNodeOffset_:function(a){return!0},listenOnFitSize_:zk.$void,unlistenOnFitSize_:zk.$void,beforeMinFlex_:function(a){if("w"==a&&(a=this.getMeshWidget())&&(a._calcMinWds(),a._minWd)){var b=this.$n();b=zk(b);var c=b.cellIndex();return b.revisedWidth(a._minWd.wds[c])}return null},clearCachedSize_:function(){this.$supers("clearCachedSize_",arguments);var a;(a=this.getMeshWidget())&&a._clearCachedSize()},getParentSize_:function(){var a=
this.getMeshWidget(),b=a.$n();return(b=b?zk(b):null)?(a.ebody&&11>zk.ie&&a.ebodytbl&&!a.ebodytbl.width&&(a.ebodytbl.width="100%"),{height:b.contentHeight(),width:b.contentWidth()}):{}},isWatchable_:function(a,b,c){var d;return this._visible&&(d=this.parent)&&d._visible&&(d=d.parent)&&d.isWatchable_(a,b,c)},_insizer:function(a){return a>=this.$n().offsetWidth-8},deferRedrawHTML_:function(a){a.push("<th",this.domAttrs_({domClass:1}),' class="z-renderdefer"></th>')},afterClearFlex_:function(){this.parent.afterClearFlex_()},
getContentWidth_:function(){var a=zk(this.$n("cave")),b=this.nChildren||this._iconSclass?a.textSize()[0]:a.textWidth();return Math.ceil(b+a.padBorderWidth()+zk(this.$n()).padBorderWidth())}},{_faker:["hdfaker","bdfaker","ftfaker"],_ghostsizing:function(a,b,c){var d=a.control;a=d.getMeshWidget().eheadtbl;c=zk(a).revisedOffset();d=d.$n();b[1]=c[1];b[0]+=zk(d).offsetWidth();jq(document.body).append('<div id="zk_hdghost" style="position:absolute;top:'+b[1]+"px;left:"+b[0]+"px;width:3px;height:"+zk(a.parentNode.parentNode).offsetHeight()+
'px;background:darkgray"></div>');return jq("#zk_hdghost")[0]},_endghostsizing:function(a,b){a._zszofs=zk(a.node).revisedOffset()[0]-zk(b).revisedOffset()[0]},_snapsizing:function(a,b){var c=a.control.$n();c=zk(c);var d=c.viewportOffset(),e=c.scrollOffset();a=d[0]+e[0]+a._zmin;b[0]+=c.offsetWidth();b[0]<a&&(b[0]=a);return b},_ignoresizing:function(a,b,c){c=a.control;var d=c.$n();d=zk(d);var e=d.revisedOffset();return c._insizer(b[0]-e[0])?(a._zmin=10+d.padBorderWidth(),!1):!0},_aftersizing:function(a,
b){var c=a.control,d=c.getMeshWidget();a=jq.px(a._zszofs);var e=d.ehdfaker,f=d.ebdfaker,k=d.eftfaker,n=zk(c.$n()).cellIndex();e=e.childNodes;f=f.childNodes;k=k?k.childNodes:null;for(var l=[],g=d.head.firstChild,h=0;g;g=g.nextSibling,h++){var m=e[h].style.width,p=g._origWd,q=m&&0>m.indexOf("%");p?(q&&1<zk.parseFloat(m)&&(p=m),g._width=l[h]=p):(l[h]=q?m:jq.px0(g.$n().offsetWidth),g.isVisible()?g._width=l[h]:g._width||g._hflex||(g._width="-1"));q||(e[h].style.width=f[h].style.width=l[h],k&&(k[h].style.width=
l[h]));m=zk.parseInt(l[h]);d._cssflex&&d.isChildrenFlex()?zFlex.clearCSSFlex(this,"h",!0):g._hflexWidth&&(g.setHflex_(null),g._hflexWidth=void 0);d._minWd&&(d._minWd.wds[h]=m)}c.origWd||(c._width=l[n]=a);e[n].style.width=f[n].style.width=a;k&&(k[n].style.width=a);d.eheadtbl.width="";d.ebodytbl.width="";d.efoottbl&&(d.efoottbl.width="");delete d._span;delete d._sizedByContent;for(g=d.head.firstChild;g;g=g.nextSibling)g.setHflex_(null);c.parent.fire("onColSize",zk.copy({index:n,column:c,width:a,widths:l},
b.data),null,0);d.$n()._lastsz=null;zk.webkit||(d.eheadtbl.width="100%",d.ebodytbl.width="100%",d.efoottbl&&(d.efoottbl.width="100%"));zUtl.fireSized(d,-1)},redraw:function(a){var b=this.uuid,c=this.domContent_();a.push("<th",this.domAttrs_({width:!0}),' role="columnheader"><div id="',b,'-cave" class="',this.$s("content"),'"',this.domTextStyleAttr_(),'><div class="',this.$s("sorticon"),'"><i id="',b,'-sort-icon" aria-hidden="true"></i></div>',this.firstChild||""!=c?c:"&nbsp;");this.parent._menupopup&&
"none"!=this.parent._menupopup&&a.push('<a id="',b,'-btn" href="javascript:;" class="',this.$s("button"),'" tabindex="-1" aria-hidden="true"><i class="z-icon-caret-down"></i></a>');for(b=this.firstChild;b;b=b.nextSibling)b.redraw(a);a.push("</div></th>")}});
