var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,c,b){a instanceof String&&(a=String(a));for(var f=a.length,e=0;e<f;e++){var l=a[e];if(c.call(b,l,e,a))return{i:e,v:l}}return{i:-1,v:void 0}};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(a,c,b){a!=Array.prototype&&a!=Object.prototype&&(a[c]=b.value)};
$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global&&null!=global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.polyfill=function(a,c,b,f){if(c){b=$jscomp.global;a=a.split(".");for(f=0;f<a.length-1;f++){var e=a[f];e in b||(b[e]={});b=b[e]}a=a[a.length-1];f=b[a];c=c(f);c!=f&&null!=c&&$jscomp.defineProperty(b,a,{configurable:!0,writable:!0,value:c})}};
$jscomp.polyfill("Array.prototype.find",function(a){return a?a:function(a,b){return $jscomp.findInternal(this,a,b).v}},"es6","es3");
(function(){zul.mesh.Frozen=zk.$extends(zul.Widget,{_start:0,_scrollScale:0,$define:{columns:[function(a){return 0>a?0:a},function(a){this._columns?this.desktop&&(this.onSize(),this.syncScroll()):this.rerender()}],start:function(){this.syncScroll()}},syncScroll:function(){var a=this.parent;a&&a._nativebar&&(a=this.$n("scrollX"))&&(a.scrollLeft=50*this._start)},syncScrollByParentBody:function(){var a=this.parent,c,b;a&&a._nativebar&&(c=a.ebody)&&0<(b=c.scrollLeft)&&(a=this.$n("scrollX"))&&(a.scrollLeft=
Math.ceil(b/(c.scrollWidth-c.clientWidth)*(a.scrollWidth-a.clientWidth)))},bind_:function(){this.$supers(zul.mesh.Frozen,"bind_",arguments);var a=this.parent,c=a.$n("body"),b=a.$n("foot");if(a._nativebar){zWatch.listen({onSize:this});var f=this.$n("scrollX"),e=jq.scrollbarWidth();this.$n().style.height=this.$n("cave").style.height=f.style.height=f.firstChild.style.height=jq.px0(zk.ie?e+1:e);a._currentLeft=0;this.domListen_(f,"onScroll");(a=a.$n("head"))&&this.domListen_(a,"onScroll","_doHeadScroll")}else this._shallSyncScale=
!0;zWatch.listen({onResponse:this});c&&jq(c).addClass("z-word-nowrap");b&&jq(b).addClass("z-word-nowrap")},unbind_:function(){var a=this.parent,c=a.$n("body"),b=a.$n("foot"),f=a.$n("head");a._nativebar?(this.domUnlisten_(this.$n("scrollX"),"onScroll"),a.unlisten({onScroll:this.proxy(this._onScroll)}),zWatch.unlisten({onSize:this}),f&&this.domUnlisten_(f,"onScroll","_doHeadScroll")):this._shallSyncScale=!1;zWatch.unlisten({onResponse:this});c&&jq(c).removeClass("z-word-nowrap");b&&jq(b).removeClass("z-word-nowrap");
this.$supers(zul.mesh.Frozen,"unbind_",arguments)},onResponse:function(){if(this.parent._nativebar)this._syncFrozenNow();else if(this._shallSyncScale){var a=this.parent.ehdfaker;a&&(this._scrollScale=a.childNodes.length-this._columns-1);this._shallSyncScale=!1}},onSize:function(){if(this._columns){var a=this;a._syncFrozen();var c=this.parent,b=c.head;c._nativebar&&b&&(c=(c=b.$n())?c.cells?c.cells[0]:null:null)&&(b=c.style,b.height||(b.height=c.offsetHeight+"px"));setTimeout(function(){var b=a.parent;
if(b.eheadtbl&&b._nativebar){var c=b._getFirstRowCells(b.eheadrows),l=b.head;cellsSize=l=c.length-jq(l).find(l.$n("bar")).length;columns=a._columns;leftWidth=0;if(c&&!(0>=cellsSize)){for(var d=b.head.firstChild;d;d=d.nextSibling)d.isVisible()||--l;for(d=0;d<columns;d++)leftWidth+=c[d].offsetWidth;b._deleteFakeRow(b.eheadrows);a.$n("cave").style.width=jq.px0(leftWidth);c=a.$n("scrollX");d=b.$n("body").offsetWidth;b.$n("frozen").style.width=jq.px0(d);d-=leftWidth;c.style.width=jq.px0(d);c.firstChild.style.width=
jq.px0(d+50*(l-columns-1));a.syncScroll()}}a._syncFrozenNow()})}},_syncFrozen:function(){this._shallSync=!0},_syncFrozenNow:function(){var a=this._start;this._shallSync&&a&&this._doScrollNow(a,!0);this._shallSync=!1},beforeParentChanged_:function(a){this.desktop&&this._lastScale&&this._doScroll(0);this.$supers("beforeParentChanged_",arguments)},_onScroll:function(a){if(a.data&&zk.currentFocus){var c=this.parent,b,f=this,e=function(){var a=zk.currentFocus;a&&(b=c.getFocusCell(a.$n()))&&0<=(index=b.cellIndex-
f._columns)&&(f.setStart(index),c.ebody.scrollLeft=0,c.ehead&&(c.ehead.scrollLeft=0))};c&&(11>zk.ie?setTimeout(e,0):e());a.stop()}},_doHeadScroll:function(a){var c=a.domTarget,b=Math.ceil(c.scrollLeft/50);c.scrollLeft&&this._lastScale!=b&&(a.data=c.scrollLeft,this._onScroll(a))},_doScroll:function(a){var c=this.parent._nativebar?Math.ceil(this.$n("scrollX").scrollLeft/50):Math.ceil(a);if(this._lastScale!=c){var b=this;this._delayedScroll&&clearTimeout(this._delayedScroll);this._delayedScroll=setTimeout(function(){b._lastScale=
c;b._doScrollNow(c);b.smartUpdate("start",c);b._start=c;b.delayedScroll=null},0)}},_doScrollNow:function(a,c){var b,f=0,e=this.parent,l=a;var d=this._columns;var u=zul.mesh.MeshWidget.WIDTH0;if(e.head){a=e.head.nChildren;var q=e.head.$n().cells,h=e.ehdfaker.firstChild,p=e.foot?e.efootrows:null;p=p?p.rows[0].cells:null;var g;for(b=0;h&&b<a;h=h.nextSibling,b++)if(-1==h.style.width.indexOf("px")){var m=h.style.width=jq.px0(q[b].offsetWidth),n=zk.Widget.$(h);if(!n.$instanceof(zul.mesh.HeadWidget)){if(g=
n.$n("bdfaker"))g.style.width=m;if(g=n.$n("ftfaker"))g.style.width=m}}h=[];for(b=d;b<a;b++){d=q[b];var t=(m=zk.Widget.$(d))&&m.isVisible();n=!1;if(m.isVisible()){if(0>=l--){var r=t?zk.ie?Math.max(jq(d).width(),0):d.offsetWidth:0;if(c||1>r){var k=m._origWd||jq.px(r);1<r&&(g=jq("#"+d.id+"-hdfaker")[0])&&g.style.width&&(k=g.style.width);m._origWd=null;n=!0}}else if(c||0!=(zk.ie?Math.max(jq(d).width(),0):d.offsetWidth))g=jq("#"+d.id+"-hdfaker")[0],g.style.width&&1<zk.parseInt(g.style.width)&&(m._origWd=
g.style.width),k=u,n=!0;(c||n)&&h.push({node:d,index:b,width:k})}}for(jq(e).css({position:"absolute",left:-9999});c=h.shift();){d=c.node;k=c.width;b=c.index;if(g=jq("#"+d.id+"-hdfaker")[0])g.style.width=k;(g=jq("#"+d.id+"-bdfaker")[0])&&t&&(g.style.width=k);if(g=jq("#"+d.id+"-ftfaker")[0])g.style.width=k;q[b].style.width=k;p&&p.length>b&&(p[b].style.width=k)}h=e.ehdfaker.firstChild;for(b=0;h&&b<a;h=h.nextSibling,b++)"none"!=h.style.display&&(f+=zk.parseInt(h.style.width));jq(e).css({position:"",left:""})}if(k=
e.eheadtbl)k.style.width=jq.px(f);if(k=e.ebodytbl)k.style.width=jq.px(f);if(k=e.efoottbl)k.style.width=jq.px(f);this.onSize();e._restoreFocus();zk.ie8_?zk(e).redoCSS():zk.ie9_&&(d=e.$n(),d.className+=" ",d.className.trim())}})})();
