1 |
- !function(H,p,e){"use strict";var f="ht",G=H[f],E=G.Default,s=E.isTouchable,C=G.Color,$="px",h="0",A="innerHTML",N="className",F="position",b="absolute",v="width",O="height",U="left",W="top",Y="right",P="bottom",m="max-width",g="max-height",i=null,r="none",J="",d=H.parseInt,S=H.setTimeout,q=E.getInternal(),c=E.animate,a=C.titleIconBackground,Q=function(){return document},x=function(q){return Q().createElement(q)},w=function(){return x("div")},I=function(){return x("canvas")},K=function(I,w,h){I.style.setProperty(w,h,i)},V=function(J,K){return J.style.getPropertyValue(K)},y=function($,s){$.appendChild(s)},u=function(s,J){s.removeChild(J)},o=function(o){var H=o.scrollWidth,m=o.scrollHeight;return o===Q().body&&(H=Math.max(H,Q().documentElement.scrollWidth),m=Math.max(m,Q().documentElement.scrollHeight)),{width:H,height:m}},L=function(c){var z=c.touches[0];return z?z:c.changedTouches[0]};q.addMethod(E,{panelExpandIcon:{width:16,height:16,comps:[{type:"triangle",rect:[4,4,10,8],background:a,rotation:3.14}]},panelCollapseIcon:{width:16,height:16,comps:[{type:"triangle",rect:[4,4,10,8],background:a}]},panelLockIcon:{width:100,height:100,comps:[{type:"roundRect",rect:[10,50,80,40],borderWidth:10,borderColor:a},{type:"shape",points:[37,45,37,20,37,13,43,13,63,13,69,13,70,19,70,44],segments:[1,2,3,2,3,2],borderWidth:10,borderColor:a}]},panelUnLockIcon:{width:100,height:100,comps:[{type:"roundRect",rect:[10,50,80,40],borderWidth:10,borderColor:a},{type:"shape",points:[37,45,37,20,37,13,43,13,63,13,69,13,70,19,70,26],segments:[1,2,3,2,3,2],borderWidth:10,borderColor:a}]},panelMinimizeIcon:{width:100,height:100,comps:[{type:"shape",points:[10,35,35,35,35,10],segments:[1,2,2],borderWidth:8,borderColor:a},{type:"shape",points:[90,35,65,35,65,10],segments:[1,2,2],borderWidth:8,borderColor:a},{type:"shape",points:[10,65,35,65,35,90],segments:[1,2,2],borderWidth:8,borderColor:a},{type:"shape",points:[65,90,65,65,90,65],segments:[1,2,2],borderWidth:8,borderColor:a}]},panelRestoreIcon:{width:300,height:300,comps:[{type:"rect",rect:[10,24,268,56],background:a},{type:"rect",rect:[10,118,268,56],background:a},{type:"rect",rect:[10,213,268,56],background:a}]},panelTitleLabelColor:E.labelSelectColor,panelTitleLabelFont:E.labelFont,panelContentLabelFont:E.labelFont,panelTitleBackground:C.titleBackground,panelSeparatorWidth:1,panelSeparatorColor:e},!0);var k=G.widget.Panel=function(O){var L=this,x=L._view=q.createView(null,L);L.$1i=0,L.$18i=new G.Notifier,L.$2i="leftTop",K(x,W,h),K(x,U,h),K(x,F,b),K(x,"overflow","hidden"),L._interactor=new D(L),L.setConfig(O),L.addEventListener(function(j){var K=L.getPanelConfig(j.id),n=K.content;("beginRestore"===j.kind||"betweenResize"===j.kind||"endToggle"===j.kind)&&(n&&n.invalidate&&n.invalidate(),K.items&&K.items.forEach(function(C){C&&C.content&&C.content.invalidate&&C.content.invalidate()}))})};E.def(k,p,{ms_v:1,_dragContainment:"parent",setConfig:function(l){function H(y){y.expanded=!y.expanded,d.togglePanel(y.id,!0,!0)}if(l){var d=this;d._view[A]=J,d._config=l,d.$35i=[],l.expanded==i&&(l.expanded=l.expand!=i?l.expand:!0);var W=d._view,T=d.$24i(l,W,!0),p=T[2],f=l.width;d.$35i.push(T[1]),l.items&&l.items.forEach(function(h){h.expanded==i&&(h.expanded=h.expand!=i?h.expand:!0);var Q=d.$24i(h,p.children[0]);d.$35i.push(Q[1])});var S=w();K(S,v,10+$),K(S,O,10+$),K(S,F,b),K(S,P,h),K(S,Y,h),S[N]="resize-area",y(W,S),d.$10i(),l.flowLayout&&K(W,F,"relative"),K(W,"opacity",h),y(Q().body,W),f==i&&(f=W.offsetWidth),K(W,v,f+$),K(W,m,f+$),l.items&&l.items.forEach(function(R){H(R)}),l.buttons&&l.buttons.indexOf("toggle")<0||H(l),l.minimized==i&&l.minimize!=i&&(l.minimized=l.minimize),l.minimized&&l.minimizable!==!1&&d.minimize(!0),u(Q().body,W),K(W,"opacity",J),d.iv()}},getPanelConfig:function(Z){var u=this,E=u._config,k=E.items;if(E.id===Z)return E;if(k)for(var C=0;C<k.length;C++){var O=k[C];if(O.id===Z)return O}},getPanelView:function(A){for(var e=this,z=e.$35i,o=0;o<z.length;o++){var H=z[o],E=H.parentNode;if(E.$15i===A)return E}},setDragContainment:function(u){this._dragContainment=u},getDragContainment:function(){return this._dragContainment},$20i:function(){var f=this._config,R=f.restoreIconSize||24;return R},$5i:function(j){var M=j.titleIconSize||16;return s&&(M*=1.2),M},$4i:function(Z){var v=Z.titleHeight||E.widgetTitleHeight;return v},setTitle:function(S,v){if(v==i&&(v=this._config.id),v!=i){var e=this.getPanelConfig(v),f=this.getPanelView(v);e.title=S,f.querySelector(".panel-title span").innerHTML=S}},setInnerPanel:function(Y){var M,S,d=this,C=Y.id,j=d.$35i,F=!1;if(Y.expanded==i&&(Y.expanded=!0),C!=i){var W=d.getPanelConfig(C);if(W){F=!0;var t,X=d.getPanelView(C),N=X.parentNode,q=X.children[0];if(X!==d._view){d.$11i();for(t in W)delete W.key;for(t in Y)W[t]=Y[t];M=d.$24i(Y,N,!1,X),S=M[1],N.removeChild(X);for(var n=0;n<j.length;n++)if(j[n]===q){j.splice(n,1,S);break}d.$12i(),W.expanded=!W.expanded,d.togglePanel(W.id,!0,!0),d.iv()}}}if(!F){d.$11i(),M=d.$24i(Y,d._view.children[1]),S=M[1],j.push(S),d._config.items||(d._config.items=[]);var b=d._config.items;if(b.push(Y),d.$12i(),b.length>1){var g=b[b.length-2],y=d.getPanelView(g.id).children[0];K(y,"border-bottom",d.$55i(g))}Y.expanded=!Y.expanded,d.togglePanel(Y.id,!0,!0),d.iv()}},removeInnerPanel:function(j){var p,q=this,U=-1,T=q._config.items;if(T)for(p=0;p<T.length;p++){var c=T[p];if(c.id===j){U=p;break}}if(q.$11i(),U>=0){var i=q.$35i,M=q.getPanelView(j),F=M.children[0];for(p=0;p<i.length;p++)if(i[p]===F){i.splice(p,1);break}T.splice(U,1),M.parentNode.removeChild(M)}if(q.$12i(),T.length>0){var P=T[T.length-1],u=q.getPanelView(P.id).children[0];K(u,"border-bottom",q.$55i(P))}},$6i:function(e){K(e,"cursor","pointer"),K(e,"display","inline-block"),K(e,"margin-right",(s?8:4)+$),K(e,"vertical-align",W)},$24i:function(m,k,p,F){var G=this,a=G._config.flowLayout,S=p?k:w(),V=G.$50i(m),u=G.$3i(m,p);S[N]="ht-widget-panel"+(p?" outer-panel":" inner-panel"),m.borderWidth==i&&(m.borderWidth=p?2:0);var z=m.borderWidth;if(z="0 "+z+$+" "+z+$+" "+z+$+" ",K(S,"padding",z),y(S,u),y(S,V),p||(F?k.insertBefore(S,F):y(k,S)),!a&&p&&m.minimizable!==!1){var M=I(),H=G.$20i(),s=m.restoreToolTip;q.setCanvas(M,H,H),M[N]="control-button button-minimize button-minimize-restore",G.$6i(M),K(M,"display","none"),y(k,M),M.title=s||""}var b=m.titleBackground||E.panelTitleBackground;if(K(S,"background-color",b),m.id==i){for(var O=G.$1i++;G.getPanelConfig(O);)O=G.$1i++;m.id=O}return S.$15i=m.id,m.width&&(S.style.width=m.width+$),[S,u,V]},$9i:function(u){var c=I();c[N]="control-button button-toggle button-toggle-expand",c.title=u.toggleToolTip||"";var h=this.$4i(u),s=this.$5i(u);return this.$6i(c),q.setCanvas(c,s,h),c},$8i:function(m){var j=I(),c="control-button button-independent-switch";j[N]=m.independent===!0?c+" button-independent-switch-on":c+" button-independent-switch-off",j.title=m.independentSwitchToolTip||"";var l=this.$4i(m),h=this.$5i(m);return this.$6i(j),q.setCanvas(j,h,l),j},$7i:function(i){var X=I();X[N]="control-button button-minimize button-minimize-minimize",X.title=i.minimizeToolTip||"";var V=this.$4i(i),B=this.$5i(i);return this.$6i(X),q.setCanvas(X,B,V),X},$55i:function(G){var e=this._config,V=e.items,x=G.separatorWidth||E.panelSeparatorWidth,O=G.titleBackground||E.panelTitleBackground,H=G.expanded!==!1?O:G.separatorColor||E.panelSeparatorColor||E.brighter(O);return(e===G||V&&V.indexOf(G)===V.length-1)&&(x=0),x+$+" solid "+H},$3i:function(X,l){var J=this,H=J._config.flowLayout,e=w(),L=w(),m=J.$4i(X),f=X.titleBackground,j=X.titleColor,u=X.titleIcon,O=X.buttons;if(e[N]="panel-title",K(e,F,"relative"),K(e,"background",f||E.panelTitleBackground),K(e,"color",j||E.panelTitleLabelColor),K(e,W,h),K(e,"box-sizing","border-box"),K(e,"-moz-box-sizing","border-box"),K(e,"padding","0 5px 0 0"),K(e,v,"100%"),K(e,"cursor","default"),K(e,"white-space","nowrap"),K(e,"font",E.panelTitleLabelFont),u){var B=I();B[N]="control-button panel-title-icon";var R=J.$4i(X),r=J.$5i(X);J.$6i(B),q.setCanvas(B,r,R),y(e,B)}var k=x("span");K(k,"display","inline-block"),K(k,"margin-left","5px"),k[A]="<span>"+X.title+"</span>",y(e,k),K(e,"line-height",m+$),L[N]="panel-title-controls",K(L,F,b),K(L,U,h),K(L,Y,5+$),K(L,W,h),K(L,P,h),K(L,"text-align",Y);var c=function(){var W=J.$9i(X);y(L,W)},s=function(){if(!H&&l&&X.minimizable!==!1){var V=J.$7i(X);y(L,V)}},D=function(){if(!l){var e=J.$8i(X);y(L,e)}},M=function(o){var Z=I();Z[N]="control-button custombutton-"+o.name,Z.title=o.toolTip||"",Z._action=o.action;var $=J.$4i(X),A=J.$5i(X);J.$6i(Z),q.setCanvas(Z,A,$),y(L,Z)};if(O)for(var T=0;T<O.length;T++){var C=O[T];"string"==typeof C?"minimize"===C?s():"independentSwitch"===C?D():"toggle"===C&&c():"object"==typeof C&&M(C)}else s(),c();return y(e,L),e},$50i:function(Y){var R=w(),C=Y.contentHeight,I=w();if(K(I,F,"relative"),R[N]="panel-body",K(R,"overflow","hidden"),K(R,"background","white"),K(R,"font",E.panelContentLabelFont),y(R,I),Y.content){var r;Y.content.getView?(y(I,Y.content.getView()),r=I.children[0]):Y.content instanceof Element?(y(I,Y.content),r=I.children[0]):I[A]=Y.content,r&&(K(r,v,"100%"),K(r,O,"100%")),C&&K(I,O,C+$)}return R},$10i:function(){var i=this,j=i._config,s=i._view,L=s.querySelector(".resize-area").style;L.display=j.flowLayout||j.minimized===!0||j.expanded===!1?r:"block"},$11i:function(){var t=this._view,G=t.children[1];this.$13i>=0?this.$13i++:this.$13i=1,K(G,g,J),K(t,m,J)},$12i:function(){var z=--this.$13i;if(0===z){var x=this._view,S=x.children[1];K(S,g,S.scrollHeight+$),K(x,m,x.offsetWidth+$)}},$14i:function(){var b=this._view,V=b.children[0],m=V.children[1].children,H=this._config,M=0;b.$26i=b.offsetWidth,M+=V.children[0].offsetWidth,H.titleIcon&&(M+=V.children[1].offsetWidth,m=V.children[2].children);for(var R=0;R<m.length;R++){var E=m[R];M+=E.offsetWidth+5}b.$51i=M+15},togglePanel:function(E,Y,y){function r(Q){var s=Q.target,L=s.parentNode,D=w.getPanelConfig(L.$15i);delete L.$19i,s!==x&&w.$12i(),w.$18i.fire({kind:"endToggle",target:w,id:D.id})}for(var w=this,o=w._view,x=o.children[1],U=i,n=w.$35i,S=n.length,R=w._config.exclusive,u=w.$2i,l=[],I=w._config.narrowWhenCollapse,B=0;S>B;B++){var X=n[B],Z=X.parentNode,a=Z.$15i,d=w.getPanelConfig(a);a===E&&(U=Z),!Y&&R&&d.expanded&&Z!==o&&a!==E&&d.independent!==!0&&l.push(Z)}if(U&&!U.$19i){U.$19i=!0;var t=U.children[1],e=U.querySelector(".button-toggle"),j=w.getPanelConfig(U.$15i);if(!e)return;U===o||j.expanded||j.independent===!0||l.forEach(function(m){w.togglePanel(m.$15i,!0)}),U!==o&&w.$11i();var q=200;if(y&&(q=0),w.$18i.fire({kind:"beginToggle",target:w,id:U.$15i}),j.expanded){var O=function(){e[N]="control-button button-toggle",e[N]+=u.indexOf("Bottom")>=0?" button-toggle-expand":" button-toggle-collapse",K(t,v,t.clientWidth+$),j.expanded=!1,K(U.children[0],"border-bottom",w.$55i(j)),c(t).duration(q).set("opacity",h).set(g,h).end(r),I&&U===o&&c(U).duration(q).set(m,U.$51i+$).end(),U[N]+=" panel-collapse",c(U).duration(q).set("padding-bottom",h).end(),w.$28i(j,!0),w.$10i()};I&&U===o&&w.$14i(),O()}else e[N]="control-button button-toggle",e[N]+=u.indexOf("Bottom")>=0?" button-toggle-collapse":" button-toggle-expand",K(t,v,J),j.expanded=!0,K(U.children[0],"border-bottom",w.$55i(j)),c(t).duration(q).set("opacity","1").set(g,t.scrollHeight+$).end(r),I&&U===o&&c(U).duration(q).set(m,(U.$26i||U.offsetWidth)+$).end(),U[N]=U[N].replace(" panel-collapse",J),c(U).duration(q).set("padding-bottom",j.borderWidth+$).end(),w.$28i(j,!0),w.$10i()}},$16i:function(){var Z=this._view,A=Z.$22i,q=Z.$23i,e=this.$2i;return A==i&&(e.indexOf(U)>=0?A=Z.$22i=0:e.indexOf(Y)>=0&&(A=Z.$22i=100)),q==i&&(e.indexOf("Top")>=0?q=Z.$23i=0:e.indexOf("Bottom")>=0&&(q=Z.$23i=100)),[A,q]},$25i:function(){var b=this,j=b._view,G=j.$21i,w=b.$20i(),g=b.$16i(),v=g[0],a=g[1],B=b.$2i;j.children[0].style.display=r,j.children[1].style.display=r,j.children[2].style.display=J,K(j,"padding",h),K(j,m,w+$),"leftTop"===B?(K(j,U,d(V(j,U))+(G.width-w)*v/100+$),K(j,W,d(V(j,W))+(G.height-w)*a/100+$)):"leftBottom"===B?(K(j,U,d(V(j,U))+(G.width-w)*v/100+$),K(j,P,d(V(j,P))+(G.height-w)*(1-a/100)+$)):"rightTop"===B?(K(j,Y,d(V(j,Y))+(G.width-w)*(1-v/100)+$),K(j,W,d(V(j,W))+(G.height-w)*a/100+$)):"rightBottom"===B&&(K(j,Y,d(V(j,Y))+(G.width-w)*(1-v/100)+$),K(j,P,d(V(j,P))+(G.height-w)*(1-a/100)+$)),j[N]+=" panel-minimized",b.$18i.fire({kind:"endMinimize",target:b,id:j.$15i})},$17i:function(){var u=this,e=u._config,B=u._view;K(B,"-webkit-transform",J),K(B,"-ms-transform",J),K(B,"transform",J),e.minimized?u.$25i():(u.$18i.fire({kind:"endRestore",target:u,id:e.id}),B[N]=B[N].replace(" panel-minimized",J)),delete B.$19i},minimize:function(i){var W=this,m=W._view;if(!m.$19i&&m.children[0].style.display!==r){var F=W._config,f=m.getBoundingClientRect(),B=W.$20i(),G=f.width,R=f.height,l=B/G,A=B/R,S=W.$16i(),k=S[0],p=S[1];m.$52i=l,m.$53i=A,m.$21i=f,W.$18i.fire({kind:"beginMinimize",target:W,id:m.$15i});var h=200;i&&(h=0),F.minimized=!0,m.$19i=!0,F.expanded&&(m.$26i=m.offsetWidth);var N=k+"% "+p+"%";K(m,"-webkit-transform-origin",N),K(m,"-ms-transform-origin",N),K(m,"transform-origin",N),c(m).duration(h).scale(l,A).end(function(){W.$17i()}),W.$10i()}},restore:function(){var x,s,f,Q,F,z,B,G,t,b,T,i,A=this,v=A._view,I=v.parentNode,M=A._config;if(!v.$19i&&M.minimized){var y=v.$21i,l=v.$52i,h=v.$53i,N=M.borderWidth+$,R=N,_=N,O=0,w=A.$20i(),E=o(I),H=A.$2i;"leftTop"===H?(x=d(V(v,U)),f=d(V(v,W)),F=x,B=f,t=x+y.width-E.width,b=f+y.height-E.height,t>0&&(t>=x?x=0:x-=t),b>0&&(b>=f?f=0:f-=b),T=100*((F-x)/(y.width-w)),i=100*((B-f)/(y.height-w)),K(v,U,x+$),K(v,W,f+$)):"leftBottom"===H?(x=d(V(v,U)),Q=d(V(v,P)),F=x,G=Q,t=x+y.width-E.width,b=Q+y.height-E.height,t>0&&(t>=x?x=0:x-=t),b>0&&(b>=Q?Q=0:Q-=b),T=100*((F-x)/(y.width-w)),i=100*(1-(G-Q)/(y.height-w)),K(v,U,x+$),K(v,P,Q+$)):"rightTop"===H?(s=d(V(v,Y)),f=d(V(v,W)),z=s,B=f,t=s+y.width-E.width,b=f+y.height-E.height,t>0&&(t>=s?s=0:s-=t),b>0&&(b>=f?f=0:f-=b),T=100*(1-(z-s)/(y.width-w)),i=100*((B-f)/(y.height-w)),K(v,Y,s+$),K(v,W,f+$)):"rightBottom"===H&&(s=d(V(v,Y)),Q=d(V(v,P)),z=s,G=Q,t=s+y.width-E.width,b=Q+y.height-E.height,t>0&&(t>=s?s=0:s-=t),b>0&&(b>=Q?Q=0:Q-=b),T=100*(1-(z-s)/(y.width-w)),i=100*(1-(G-Q)/(y.height-w)),K(v,Y,s+$),K(v,P,Q+$)),v.children[0].style.display="block",v.children[1].style.display="block",v.children[2].style.display=r,K(v,"padding",O+" "+R+" "+_+" "+N),K(v,"-webkit-transform","scale("+l+", "+h+")"),K(v,"-ms-transform","scale("+l+", "+h+")"),K(v,"transform","scale("+l+", "+h+")"),v.$22i=T,v.$23i=i,K(v,"-webkit-transform-origin",T+"% "+i+"%"),K(v,"-ms-transform-origin",T+"% "+i+"%"),K(v,"transform-origin",T+"% "+i+"%"),M.narrowWhenCollapse&&!M.expanded?K(v,m,v.$51i+$):K(v,m,v.$26i+$),A.$18i.fire({kind:"beginRestore",target:A,id:v.$15i}),v.$19i=!0,M.minimized=!1,S(function(){c(v).scale(1,1).end(function(){A.$17i()})},30),A.$10i()}},addEventListener:function(E,C,N){this.$18i.add(E,C,N)},removeEventListener:function(u,T){this.$18i.remove(u,T)},setPosition:function(F,B){var c=this._view,R=this.$2i;"leftTop"===R?(K(c,U,F+$),K(c,W,B+$),K(c,Y,J),K(c,P,J)):"leftBottom"===R?(K(c,U,F+$),K(c,P,B+$),K(c,Y,J),K(c,W,J)):"rightTop"===R?(K(c,Y,F+$),K(c,W,B+$),K(c,U,J),K(c,P,J)):"rightBottom"===R&&(K(c,Y,F+$),K(c,P,B+$),K(c,U,J),K(c,W,J)),delete c.$22i,delete c.$23i},getPosition:function(){var r=this._view,I=this.$2i;return"leftTop"===I?{x:d(V(r,U)),y:d(V(r,W))}:"leftBottom"===I?{x:d(V(r,U)),y:d(V(r,P))}:"rightTop"===I?{x:d(V(r,Y)),y:d(V(r,W))}:"rightBottom"===I?{x:d(V(r,Y)),y:d(V(r,P))}:void 0},setPositionRelativeTo:function($){var r=this,L=r._view.querySelectorAll(".button-toggle"),T="control-button button-toggle",Z=r.getPosition();r.$2i=$,r.setPosition(Z.x,Z.y);for(var v=0;v<L.length;v++){var B=L[v],g=r.getPanelConfig(B.parentNode.parentNode.parentNode.$15i);B[N]=g.expanded?$.indexOf("Bottom")>=0?T+" button-toggle-collapse":T+" button-toggle-expand":$.indexOf("Bottom")>=0?T+" button-toggle-expand":T+" button-toggle-collapse"}r.iv()},getPositionRelativeTo:function(){return this.$2i},invalidate:function(M){var w=this;w._68I||(w._68I=1,E.callLater(w.validate,w,i,M),w.onInvalidated&&w.onInvalidated(),w.fireViewEvent("invalidate"));var T=this._config,o=T.content;o&&o.invalidate&&o.invalidate(),T.items&&T.items.forEach(function(v){v&&v.content&&v.content.invalidate&&v.content.invalidate()})},$27i:function($,n,Y,j){var S=q.initContext($);q.translateAndScale(S,0,0,1),S.clearRect(0,0,Y,Y);var U=(Y-j)/2;E.drawStretchImage(S,E.getImage(n),"fill",0,U,j,j),S.restore()},$28i:function(W){var p,$,o,r=this,e=W.id,x=r.getPanelView(e),F=x.querySelector(".button-toggle"),z=r.$2i.indexOf("Bottom")>=0;if($=z?E.panelCollapseIcon:E.panelExpandIcon,o=z?E.panelExpandIcon:E.panelCollapseIcon,F){p=W.expanded?E.getImage(o):E.getImage($);var m=r.$4i(W),Y=r.$5i(W);r.$27i(F,p,m,Y)}},$29i:function(M){var O,j=this,F=M.id,z=j.getPanelView(F),o=z.querySelector(".button-independent-switch"),G=E.panelUnLockIcon,J=E.panelLockIcon;if(o){O=M.independent!==!0?E.getImage(J):E.getImage(G);var s=j.$4i(M),$=j.$5i(M);j.$27i(o,O,s,$)}},$30i:function(C){var O=this,x=C.id,i=O.getPanelView(x),n=i.querySelector(".button-minimize-minimize"),r=E.panelMinimizeIcon;if(n){var l=O.$4i(C),z=O.$5i(C);O.$27i(n,E.getImage(r),l,z)}},$31i:function(R){var Y=this,F=R.id,u=Y.getPanelView(F),X=u.querySelector(".button-minimize-restore"),P=R.titleIcon||E.panelRestoreIcon;if(X){var A=Y.$20i();Y.$27i(X,E.getImage(P),A,A)}},$32i:function(s){var b=this,x=s.id,z=b.getPanelView(x);if(s.buttons){var d=s.buttons;d.forEach(function(o){var e=o.name,q=o.icon;if(e&&q){var j=z.querySelector(".custombutton-"+e);if(j){var A=b.$4i(s),f=b.$5i(s)-1;b.$27i(j,E.getImage(q),A,f)}}})}},$33i:function(T){var K=this,d=T.id,s=K.getPanelView(d),y=s.querySelector(".panel-title-icon"),w=T.titleIcon;if(y&&w){var M=K.$4i(T),i=K.$5i(T);K.$27i(y,E.getImage(w),M,i)}},validateImpl:function(){var I=this,u=I._config;I.$28i(u),I.$30i(u),I.$31i(u),I.$32i(u),I.$33i(u),u.items&&u.items.forEach(function(B){I.$28i(B),I.$29i(B),I.$32i(B)})}});var D=function(P){var R=this,i=P.getView();R.$34i=P,R.addListeners(),i.addEventListener("dblclick",R.$42i.bind(R))};E.def(D,p,{ms_listener:1,getView:function(){return this.$34i.getView()},clear:function(){delete this.$37i,delete this.$38i,delete this.$36i,delete this.$39i},$42i:function(V){for(var J=this.$34i,u=V.target,x=J.$35i,k=x.length,h=0;k>h;h++){var p=x[h];p.contains(u)&&(V.preventDefault(),J.togglePanel(p.parentNode.$15i))}},handle_touchstart:function(_){var u=this,q=u.$34i,w=q._config,M=w.flowLayout,f=_;if(E.preventDefault(_),E.isLeftButton(_)){var W=_.target,e=q.getView().children[0],j=q.getView().querySelector(".button-minimize-restore");s&&(f=L(_));var r=u.$40i={x:f.pageX,y:f.pageY};u.$41i={x:r.x,y:r.y},(!M&&e.contains(W)||j&&j.contains(W))&&(u.$38i=!0,E.startDragging(u,_)),!M&&u.handle_mousemove(_)&&(u.$37i=!0,E.startDragging(u,_),q.$11i())}},handle_mousedown:function(k){this.handle_touchstart(k)},handle_touchend:function(b){var W=this,j=W.$34i,p=b.target,e=j.$35i,r=e.length,s=0,J=j.getView(),S=J.querySelector(".button-minimize"),z=J.querySelector(".button-minimize-restore");if(!W.$39i&&!W.$36i){if(S&&S.contains(p)||z&&z.contains(p))b.preventDefault(),j._config.minimized?j.restore():j.minimize();else for(;r>s;s++){var l=e[s],K=l.parentNode,H=K.$15i,O=j.getPanelConfig(H),g=l.querySelector(".button-toggle"),Q=l.querySelector(".button-independent-switch");if(g===p)b.preventDefault(),j.togglePanel(H);else if(Q===p){b.preventDefault();var V="button-independent-switch-off",u="button-independent-switch-on";O.independent=O.independent==i?!0:!O.independent,Q[N]=O.independent?Q[N].replace(V,u):Q[N].replace(u,V),j.$29i(O)}else p[N]&&p[N].indexOf("control-button custombutton-")>=0&&l.contains(p)&&p._action.call(j,O,j.getPanelView(H),b)}delete W.$40i,delete W.$41i}},handle_mouseup:function(_){this.handle_touchend(_)},handleWindowTouchEnd:function(){var D=this,S=D.$34i;D.$37i&&D.$36i?(S.$18i.fire({kind:"endResize",target:S,id:S.getView().$15i}),S.$12i()):D.$38i&&D.$39i&&S.$18i.fire({kind:"endMove",target:S,id:S.getView().$15i}),this.clear()},handleWindowMouseUp:function(E){this.handleWindowTouchEnd(E)},handle_mousemove:function(F){var A=this,x=A.getView(),c=x.querySelector(".resize-area"),U=c.getBoundingClientRect(),M={x:U.left,y:U.top,width:U.width,height:U.height};F=s?L(F):F;var a=F.clientX,e=F.clientY,O=A.$34i._config;return O.expanded&&O.minimized!==!0&&E.containsPoint(M,{x:a,y:e})?(x.style.cursor="nwse-resize",!0):(x.style.cursor=J,void 0)},handleWindowTouchMove:function(u){u.preventDefault();var X=u;s&&(X=L(u));var Z=this,F=Z.$40i,i=Z.$41i;if(!(i.x==F.x&&i.y==F.y&&E.getDistance(i,{x:X.pageX,y:X.pageY})<=1)){var y=Z.$34i,H=Z.getView(),r=H.parentNode,j=y._config,w=j.resizeMode||"wh",a=X.pageX-F.x,x=X.pageY-F.y,T=y.$2i;if(Z.$37i){var M=H.children[1].children[0],J=H.clientWidth,k=M.clientHeight,c=J+a,D=k+x;c=Math.max(c,100),D=Math.max(D,100),"w"===w?(K(H,v,c+$),j.width=c,F.x+=c-J,T.indexOf(Y)>=0&&K(H,Y,d(V(H,Y))-(c-J)+$)):"h"===w?(K(M,O,D+$),j.contentHeight=D,F.y+=D-k,T.indexOf("Bottom")>=0&&K(H,P,d(V(H,P))-(D-k)+$)):"wh"===w&&(K(H,v,c+$),K(M,O,D+$),j.width=c,j.contentHeight=D,F.x+=c-J,F.y+=D-k,T.indexOf("right")>=0&&K(H,Y,d(V(H,Y))-(c-J)+$),T.indexOf("Bottom")>=0&&K(H,P,d(V(H,P))-(D-k)+$)),Z.$36i?y.$18i.fire({kind:"betweenResize",target:y,id:y.getView().$15i}):(Z.$36i=!0,y.$18i.fire({kind:"beginResize",target:y,id:y.getView().$15i}))}else if(Z.$38i){var R,z,g,f,N,S,m,t,e,l,A=H.getBoundingClientRect(),G=A.width,Q=A.height,I=o(r),h=I.width,C=I.height,p=y._dragContainment;"leftTop"===T?(R=d(V(H,U))||0,g=d(V(H,W))||0,N=R+a,m=g+x,"parent"===p&&(N+G>h&&(N=h-G),m+Q>C&&(m=C-Q),0>N&&(N=0),0>m&&(m=0)),e=N-R,l=m-g,y.setPosition(N,m),F.x+=e,F.y+=l):"rightBottom"===T?(z=d(V(H,Y))||0,f=d(V(H,P))||0,S=z-a,t=f-x,"parent"===p&&(0>S&&(S=0),0>t&&(t=0),S+G>h&&(S=h-G),t+Q>C&&(t=C-Q)),e=S-z,l=t-f,y.setPosition(S,t),F.x-=e,F.y-=l):"rightTop"===T?(z=d(V(H,Y))||0,g=d(V(H,W))||0,S=z-a,m=g+x,"parent"===p&&(0>S&&(S=0),0>m&&(m=0),S+G>h&&(S=h-G),m+Q>C&&(m=C-Q)),e=S-z,l=m-g,y.setPosition(S,m),F.x-=e,F.y+=l):"leftBottom"===T&&(R=d(V(H,U))||0,f=d(V(H,P))||0,N=R+a,t=f-x,"parent"===p&&(0>N&&(N=0),0>t&&(t=0),N+G>h&&(N=h-G),t+Q>C&&(t=C-Q)),e=N-R,l=t-f,y.setPosition(N,t),F.x+=e,F.y-=l),Z.$39i?y.$18i.fire({kind:"betweenMove",target:y,id:y.getView().$15i}):(Z.$39i=!0,y.$18i.fire({kind:"beginMove",target:y,id:y.getView().$15i}))}}},handleWindowMouseMove:function(I){this.handleWindowTouchMove(I)}});var X=G.widget.PanelGroup=function(B){var b=this,l=b._view=q.createView(null,b);l.style.border="1px dashed black",l.style.position="absolute",l.style.background="rgba(120, 120, 120, 0.4)",b.$48i=new G.List,b._tolerance=100,b._config=B||{hGap:0,vGap:0},b.bindHandlePanelMove=b.handlePanelMove.bind(b),b.bindHandlePanelEvent=b.handlePanelEvent.bind(b),b.invalidate()};E.def(X,p,{invalidate:function(){var k=this;k._68I||(k._68I=1,S(function(){k.validate()},50))},validate:function(){if(this._68I){delete this._68I;var m=this.$48i.get(0);if(m){var n=m.getView().parentNode;n&&(this.layoutPanels(n,"leftTop"),this.layoutPanels(n,"rightTop"),this.layoutPanels(n,"leftBottom"),this.layoutPanels(n,"rightBottom"))}}},setLeftTopPanels:function(){var S=this,k=S.$43i,f=S.$48i;k==i&&(k=S.$43i=new G.List);for(var Q=0;Q<arguments.length;Q++){var C=arguments[Q];if("string"==typeof C)k.$49i=C;else{if(C._config.flowLayout)continue;C.setPositionRelativeTo("leftTop"),k.contains(C)||k.add(C),f.contains(C)||S.add(C)}}},setRightTopPanels:function(){var M=this,c=M.$44i,F=M.$48i;c==i&&(c=M.$44i=new G.List);for(var H=0;H<arguments.length;H++){var U=arguments[H];if("string"==typeof U)c.$49i=U;else{if(U._config.flowLayout)continue;U.setPositionRelativeTo("rightTop"),c.contains(U)||c.add(U),F.contains(U)||M.add(U)}}},setLeftBottomPanels:function(){var v=this,n=v.$45i,A=v.$48i;n==i&&(n=v.$45i=new G.List);for(var m=0;m<arguments.length;m++){var d=arguments[m];if("string"==typeof d)n.$49i=d;else{if(d._config.flowLayout)continue;d.setPositionRelativeTo("leftBottom"),n.contains(d)||n.add(d),A.contains(d)||v.add(d)}}},setRightBottomPanels:function(){var m=this,H=m.$46i,e=m.$48i;H==i&&(H=m.$46i=new G.List);for(var M=0;M<arguments.length;M++){var c=arguments[M];if("string"==typeof c)H.$49i=c;else{if(c._config.flowLayout)continue;c.setPositionRelativeTo("rightBottom"),H.contains(c)||H.add(c),e.contains(c)||m.add(c)}}},add:function($){if(!$._config.flowLayout){var O=this,f=O.$48i;f.contains($)||($.addEventListener(O.bindHandlePanelMove),$.addEventListener(O.bindHandlePanelEvent),f.add($))}},remove:function(z){var s=this,l=s.$48i;l.contains(z)&&(z.removeEventListener(s.bindHandlePanelMove),z.removeEventListener(s.bindHandlePanelEvent),l.remove(z),s.$43i.contains(z)&&s.$43i.remove(z),s.$44i.contains(z)&&s.$44i.remove(z),s.$45i.contains(z)&&s.$45i.remove(z),s.$46i.contains(z)&&s.$46i.remove(z))},layoutPanels:function(K,l,G){var a=this,W=a._config,o=W.hGap||0,Y=W.vGap||0;if(K){var Z=a.$43i;if("leftBottom"===l?Z=a.$45i:"rightTop"===l?Z=a.$44i:"rightBottom"===l&&(Z=a.$46i),!Z)return;var f=Z.$49i,d=o,E=Y;if(K.contains(a._view)&&K.removeChild(a._view),Z&&Z.size()>0)for(var q=0;q<Z.size();q++){var c=Z.get(q),x=c.getView();K=K||x.parentNode,G!==q?c.setPosition(d,E):("leftTop"===l?(a._view.style.right="",a._view.style.bottom="",a._view.style.left=d+$,a._view.style.top=E+$):"leftBottom"===l?(a._view.style.right="",a._view.style.top="",a._view.style.left=d+$,a._view.style.bottom=E+$):"rightTop"===l?(a._view.style.left="",a._view.style.bottom="",a._view.style.right=d+$,a._view.style.top=E+$):"rightBottom"===l&&(a._view.style.left="",a._view.style.top="",a._view.style.right=d+$,a._view.style.bottom=E+$),a._view.style.width=x.offsetWidth+$,a._view.style.height=x.offsetHeight+$,K.insertBefore(a._view,x)),"h"===f?d+=x.offsetWidth+o:"v"===f&&(E+=x.offsetHeight+Y)}}},handlePanelEvent:function(c){if("beginToggle"===c.kind||"endToggle"===c.kind||"beginRestore"===c.kind||"endMinimize"===c.kind||"endResize"===c.kind){var E=this,u=c.target,G=u.getView(),j=G.parentNode,g=E.$43i,M=E.$44i,t=E.$45i,_=E.$46i,k=E._config,p=i,y=i,R=u.$47i;if(R==i&&(R=u.$47i=0),"beginToggle"===c.kind?R=u.$47i=R+1:"endToggle"===c.kind&&(R=u.$47i=R-1),g&&g.contains(u)?(p="leftTop",y=g):t&&t.contains(u)?(p="leftBottom",y=t):M&&M.contains(u)?(p="rightTop",y=M):_&&_.contains(u)&&(p="rightBottom",y=_),"beginToggle"===c.kind&&p&&1===R){var O=w(),K=O.style,o=y.$49i,J="each";K.fontSize="0",K.position="absolute",K.width="100%","leftTop"===p?(K.left=0,K.top=0):"leftBottom"===p?(K.left=0,K.bottom=0,"v"===o&&(J="reverseEach")):"rightTop"===p?(K.right=0,K.top=0,K.textAlign="right","h"===o&&(J="reverseEach")):"rightBottom"===p&&(K.right=0,K.bottom=0,K.textAlign="right",J="reverseEach"),y[J](function(H){var S=H.getView(),I=S.style,Z=w();I.position="static",Z.style.textAlign="left",Z.style.position="relative",Z.style.display="inline-block","leftTop"===p?(Z.style.marginLeft=k.hGap+$,Z.style.marginTop=k.vGap+$):"leftBottom"===p?(Z.style.marginLeft=k.hGap+$,Z.style.marginBottom=k.vGap+$):"rightTop"===p?(Z.style.marginRight=k.hGap+$,Z.style.marginTop=k.vGap+$):"rightBottom"===p&&(Z.style.marginRight=k.hGap+$,Z.style.marginBottom=k.vGap+$),Z.appendChild(S),O.appendChild(Z),"h"===o?Z.style.verticalAlign="leftTop"===p||"rightTop"===p?"top":"bottom":O.appendChild(x("br"))}),E.$54i=O,j.appendChild(O)}else"endToggle"===c.kind&&p&&0===R?S(function(){j=j.parentNode.parentNode,j.removeChild(E.$54i),delete E.$54i,y.each(function(b){var G=b.getView(),x=G.style;x.position="absolute",j.appendChild(G)}),E.layoutPanels(j,p)},30):("beginRestore"===c.kind||"endMinimize"===c.kind||"endResize"===c.kind)&&p&&E.layoutPanels(j,p)}},handlePanelMove:function(m){if(!(m.kind.indexOf("Move")<0)){var S=this,$=S._config,X=$.hGap||0,V=$.vGap||0,e=m.target,f=e._view,P=f.getBoundingClientRect(),r=P.width,O=P.height,T=r/2,v=O/2,R=f.parentNode,q=S.$43i,Z=S.$44i,a=S.$45i,k=S.$46i,F=R.getBoundingClientRect(),N=S._tolerance;if("endMove"===m.kind){var B=S._corner;B&&(e.setPositionRelativeTo(B),S.layoutPanels(R,B)),delete S._corner}if("betweenMove"===m.kind){var Y=F.left,z=F.top,I=F.width,x=F.height,n=P.left+r/2,j=P.top+O/2;q==i&&(q=S.$43i=new G.List),a==i&&(a=S.$45i=new G.List),Z==i&&(Z=S.$44i=new G.List),k==i&&(k=S.$46i=new G.List),delete S._corner,q.contains(e)?(q.remove(e),S.layoutPanels(R,"leftTop")):a.contains(e)?(a.remove(e),S.layoutPanels(R,"leftBottom")):Z.contains(e)?(Z.remove(e),S.layoutPanels(R,"rightTop")):k.contains(e)&&(k.remove(e),S.layoutPanels(R,"rightBottom"));var y=function(C,L){var D=Y+X,p=z+V;if(0===L.size()){var $=D+T,y=p+v;"leftBottom"===C?y=z+x-V-v:"rightTop"===C?$=Y+I-X-T:"rightBottom"===C&&($=Y+I-X-T,y=z+x-V-v);var A=n-$,M=j-y,c=Math.sqrt(A*A+M*M);if(N>c)return S._corner=C,L.add(e),S.layoutPanels(R,C,0),!0}else if(1===L.size()){var f=L.get(0),O=f.getView().getBoundingClientRect(),s=O.left+T,J=O.top+v,w=O.left+O.width+X+T,F=p+v,W=D+T,r=O.top+O.height+V+v;"leftBottom"===C?(J=O.top+O.height-v,F=z+x-V-v,r=O.top-V-v):"rightTop"===C?(s=O.left+O.width-T,w=O.left-X-T,W=Y+I-X-T):"rightBottom"===C&&(s=O.left+O.width-T,J=O.top+O.height-v,w=O.left-X-T,F=z+x-V-v,W=Y+I-X-T,r=O.top-V-v);var G=n-s,o=j-J,g=n-w,Z=j-F,K=n-W,Q=j-r,B=d(Math.sqrt(G*G+o*o)),q=d(Math.sqrt(g*g+Z*Z)),H=d(Math.sqrt(K*K+Q*Q)),U=[B,q,H];U.sort(function(v,r){return v-r});var m=U[0];if(N>m){if(S._corner=C,m===B)return L.add(e,0),S.layoutPanels(R,C,0),!0;if(m===q)return L.add(e),L.$49i="h",S.layoutPanels(R,C,1),!0;if(m===H)return L.add(e),L.$49i="v",S.layoutPanels(R,C,1),!0}}else if(L.size()>1){for(var P=i,u={},h=[],k=L.$49i,l=0;l<L.size();l++){var t=L.get(l),a=t.getView(),_=a.getBoundingClientRect(),b=_.left+T,E=_.top+v;"leftBottom"===C?E=_.top+_.height-v:"rightTop"===C?b=_.left+_.width-T:"rightBottom"===C&&(b=_.left+_.width-T,E=_.top+_.height-v),l===L.size()-1&&(P=_);var A=n-b,M=j-E,c=d(Math.sqrt(A*A+M*M));u[c]=l,h.push(c)}"leftTop"===C&&"h"===k?($=P.left+P.width+X+T,y=p+v):"leftTop"===C&&"v"===k?($=D+T,y=P.top+P.height+V+v):"leftBottom"===C&&"h"===k?($=P.left+P.width+X+T,y=z+x-V-v):"leftBottom"===C&&"v"===k?($=D+T,y=P.top-V-v):"rightTop"===C&&"h"===k?($=P.left-X-T,y=p+v):"rightTop"===C&&"v"===k?($=Y+I-X-T,y=P.top+P.height+V+v):"rightBottom"===C&&"h"===k?($=P.left-X-T,y=z+x-V-v):"rightBottom"===C&&"v"===k&&($=Y+I-X-T,y=P.top-V-v),A=n-$,M=j-y,c=d(Math.sqrt(A*A+M*M)),u[c]=l,h.push(c),h.sort(function(C,x){return C-x});var m=h[0];if(N>m)return S._corner=C,L.add(e,u[m]),S.layoutPanels(R,C,u[m]),!0}};y("leftTop",q)||y("leftBottom",a)||y("rightTop",Z)||y("rightBottom",k)}}}})}("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:this,Object);
|