var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.findInternal=function(a,c,b){a instanceof String&&(a=String(a));for(var e=a.length,d=0;d<e;d++){var m=a[d];if(c.call(b,m,d,a))return{i:d,v:m}}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,e){if(c){b=$jscomp.global;a=a.split(".");for(e=0;e<a.length-1;e++){var d=a[e];d in b||(b[d]={});b=b[d]}a=a[a.length-1];e=b[a];c=c(e);c!=e&&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 e=this.$n("scrollX"),d=jq.scrollbarWidth();this.$n().style.height=this.$n("cave").style.height=this.$n("right").style.height=e.style.height=e.firstChild.style.height=jq.px0(zk.ie?d+1:d);a._currentLeft=0;this.domListen_(e,"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"),e=a.$n("head");a._nativebar?(this.domUnlisten_(this.$n("scrollX"),"onScroll"),a.unlisten({onScroll:this.proxy(this._onScroll)}),zWatch.unlisten({onSize:this}),e&&this.domUnlisten_(e,"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),m=b.head;m=c.length-jq(m).find(m.$n("bar")).length;var f=a._columns,r=0;if(c&&!(0>=m)){for(var g=b.head.firstChild;g;g=g.nextSibling)g.isVisible()||--m;for(g=0;g<f;g++)r+=c[g].offsetWidth;b._deleteFakeRow(b.eheadrows);a.$n("cave").style.width=jq.px0(r);c=a.$n("scrollX");g=b.$n("body").offsetWidth;b.$n("frozen").style.width=jq.px0(g);g-=r;c.style.width=jq.px0(g);
c.firstChild.style.width=jq.px0(g+50*(m-f-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,e=this,d=function(){var a=zk.currentFocus;a&&(b=c.getFocusCell(a.$n()))&&
0<=(index=b.cellIndex-e._columns)&&(e.setStart(index),c.ebody.scrollLeft=0,c.ehead&&(c.ehead.scrollLeft=0))};c&&(11>zk.ie?setTimeout(d,0):d());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,e=0,d=this.parent,m=a;var f=this._columns;var r=zul.mesh.MeshWidget.WIDTH0;a=zk(d.ebody).hasVScroll()?jq.scrollbarWidth():0;if(d.head){var g=d.head.nChildren,t=d.head.$n().cells,k=d.ehdfaker.firstChild,q=d.foot?d.efootrows:null;q=q?q.rows[0].cells:null;var h;for(b=0;k&&b<g;k=k.nextSibling,b++)if(-1==k.style.width.indexOf("px")){var n=k.style.width=
jq.px0(t[b].offsetWidth),p=zk.Widget.$(k);if(!p.$instanceof(zul.mesh.HeadWidget)){if(h=p.$n("bdfaker"))h.style.width=n;if(h=p.$n("ftfaker"))h.style.width=n}}k=[];for(b=f;b<g;b++){f=t[b];var v=(n=zk.Widget.$(f))&&n.isVisible();p=!1;if(n.isVisible()){if(0>=m--){var u=v?zk.ie?Math.max(jq(f).width(),0):f.offsetWidth:0;if(c||1>u){var l=n._origWd||jq.px(u);1<u&&(h=jq("#"+f.id+"-hdfaker")[0])&&h.style.width&&(l=h.style.width);n._origWd=null;p=!0}}else if(c||0!=(zk.ie?Math.max(jq(f).width(),0):f.offsetWidth))h=
jq("#"+f.id+"-hdfaker")[0],h.style.width&&1<zk.parseInt(h.style.width)&&(n._origWd=h.style.width),l=r,p=!0;(c||p)&&k.push({node:f,index:b,width:l})}}for(jq(d).css({position:"absolute",left:-9999});c=k.shift();){f=c.node;l=c.width;b=c.index;if(h=jq("#"+f.id+"-hdfaker")[0])h.style.width=l;(h=jq("#"+f.id+"-bdfaker")[0])&&v&&(h.style.width=l);if(h=jq("#"+f.id+"-ftfaker")[0])h.style.width=l;t[b].style.width=l;q&&q.length>b&&(q[b].style.width=l)}k=d.ehdfaker.firstChild;for(b=0;k&&b<g;k=k.nextSibling,b++)"none"!=
k.style.display&&(e+=zk.parseInt(k.style.width));e+=a;jq(d).css({position:"",left:""})}if(l=d.eheadtbl)l.style.width=jq.px(e);if(l=d.ebodytbl)l.style.width=jq.px(e-a);if(a=d.efoottbl)a.style.width=jq.px(e);d._restoreFocus();zk.ie9_&&(f=d.$n(),f.className+=" ",f.className.trim())}})})();
