@wcardinal/wcardinal-ui 0.147.0 → 0.148.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,10 @@
1
1
  /*
2
- Winter Cardinal UI v0.147.0
2
+ Winter Cardinal UI v0.148.0
3
3
  Copyright (C) 2019 Toshiba Corporation
4
4
  SPDX-License-Identifier: Apache-2.0
5
5
 
6
6
  Material Design icons by Google
7
7
  Apache license version 2.0.
8
8
  */
9
- !function(t){"use strict";var n={},i={},r={CIRCLE:0,RECTANGLE:1,RECTANGLE_ROUNDED:2,TRIANGLE:3,TRIANGLE_ROUNDED:4,LINE:5,IMAGE:6,IMAGE_SDF:7,GROUP:8,BAR:9,LABEL:10,NULL:11,GROUP_SHADOWED:12,LINE_OF_CIRCLES:13,LINE_OF_RECTANGLES:14,LINE_OF_RECTANGLE_ROUNDEDS:15,LINE_OF_TRIANGLES:16,LINE_OF_TRIANGLE_ROUNDEDS:17,EMBEDDED:18,EMBEDDED_LAYER:19,BUTTON:20,RECTANGLE_PIVOTED:21,CONNECTOR_LINE:22,EXTENSION:1e3},e={},u=function(){function t(t,n,i,r,e,u){this.buffer=t,this.i=u,this.u=n,this.h=i,this.o=r,this.l=e}return t.prototype.init=function(t){t.uploaded=this;for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].init(n);return this.update(t),this},t.prototype.update=function(t){for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].update(n,t)},t.prototype.isCompatible=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)if(!n[i].isCompatible(t))return!1;return!0},t.prototype.getBuffer=function(){return this.buffer},t.prototype.getVertexOffset=function(){return this.u},t.prototype.getVertexCount=function(){return this.o},t.prototype.getIndexOffset=function(){return this.h},t.prototype.getIndexCount=function(){return this.l},t.prototype.buildUnit=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)n[i].buildUnit(t)},t}(),s={NONE:0,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING:14,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896},h=function(t,n,i,r){return i&s.DOTTED_MASK?i&s.DOTTED?r.set(n,n):i&s.DOTTED_DENSELY?r.set(n,.5*n):r.set(n,2*n):i&s.DASHED_MASK?i&s.DASHED?r.set(2*n,n):i&s.DASHED_DENSELY?r.set(2*n,.5*n):r.set(2*n,2*n):r.set(2*t,0),r},o=function(t){var n=t&s.NON_EXPANDING_WIDTH?1:0,i=t&s.NON_SHRINKING_WIDTH?2:0;return t&(s.DOTTED_MASK||s.DASHED_MASK)?n|i|(t&s.NON_SCALING_DOT_AND_DASH?4:0):n|i},a=new t.Point,c=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5,t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5},f=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+2,t[++r]=n+1,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3},l=function(t,n,i,r,e,u,s,c,f){var l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty,w=e[0],p=e[1],O=l*w+b*p+g,D=v*w+d*p+m,E=e[2],M=e[3],S=l*E+b*M+g,T=v*E+d*M+m,j=S-O,N=T-D,I=Math.sqrt(j*j+N*N),C=I;if(0<=u&&1e-5<I){var A=u/I;S=O+(j*=A),T=D+(N*=A),C=u}var R=O-j,y=D-N,k=S+j,L=T+N,x=o(c),B=h(C,s,c,a),_=B.x,P=B.y,F=(r<<1)-1,U=(r<<2)-1,G=6*r-1;t[++F]=O,t[++F]=D,t[++F]=O,t[++F]=D,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=y,n[++G]=S,n[++G]=T,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=y,n[++G]=S,n[++G]=T,i[++U]=0,i[++U]=_,i[++U]=P,i[++U]=C,i[++U]=0,i[++U]=_,i[++U]=P,i[++U]=C,t[++F]=S,t[++F]=T,t[++F]=S,t[++F]=T,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=k,n[++G]=L,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=k,n[++G]=L,i[++U]=C,i[++U]=_,i[++U]=P,i[++U]=C,i[++U]=C,i[++U]=_,i[++U]=P,i[++U]=C},v=function(t,n,i){var r=(n<<1)-1;t[++r]=i.x0,t[++r]=i.y0,t[++r]=i.x3,t[++r]=i.y3,t[++r]=i.x1,t[++r]=i.y1,t[++r]=i.x2,t[++r]=i.y2},b=function(){function t(){this.target="",this.position=0}return t.prototype.init=function(t){this.target=t,this.position=0},t.prototype.hasNext=function(){return this.position<this.target.length},t.prototype.findNextBreak=function(t,n){for(var i=t.length,r=n;r<i;++r){var e=t.charCodeAt(r);if(!this.isLowSurrogate(e)&&!this.isVariationSelector(e))return r}return i},t.prototype.isHighSurrogate=function(t){return 55296<=t&&t<=56319},t.prototype.isLowSurrogate=function(t){return 56320<=t&&t<=57343},t.prototype.isVariationSelector=function(t){return 65024<=t&&t<=65039},t.prototype.next=function(){var t=this.target,n=this.position,i=this.findNextBreak(t,n+1),r=t.substring(n,i);return this.position=i,r},t.prototype.advance=function(t){var n=this.target,i=this.position,r=this.findNextBreak(n,i+1);return n.substring(i,r)!==t&&(this.position=r,!0)},t.prototype.close=function(){var t=this.target.length;return this.position<t&&(this.position=t,!0)},t.from=function(n){null==t.v&&(t.v=new t);var i=t.v;return i.init(n),i},t.v=null,t}(),d={NORMAL:0,BOLD:1},g={NORMAL:0,ITALIC:1},m={LEFT:0,CENTER:1,RIGHT:2,OUTSIDE_LEFT:3,OUTSIDE_RIGHT:4},w={TOP:0,MIDDLE:1,BOTTOM:2,OUTSIDE_TOP:3,OUTSIDE_BOTTOM:4},p={LEFT_TO_RIGHT:0,TOP_TO_BOTTOM:1,BOTTOM_TO_TOP:2},O=function(t,n,i,r){var e=i-t,u=r-n;return Math.sqrt(e*e+u*u)},D=1e-5,E=new t.Point,M=function(t){return 12*Math.ceil(t.text.value.length/12)},S=function(t,n,i){for(var r=3*n-1,e=3*(n+i)-1;r<e;)t[++r]=0,t[++r]=0,t[++r]=2},T=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s,t[++e]=s+1,t[++e]=s+3,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=4},j=function(t,n,i,r,e,u,h){var a=6*n-1,c=6*(n+i)-1,f=o(s.NONE);if(null!=r)for(var l=r.font.size/e,v=h===d.NORMAL?0:.05;a<c;)t[++a]=u,t[++a]=f,t[++a]=l,t[++a]=1,t[++a]=0,t[++a]=v;else for(;a<c;)t[++a]=0,t[++a]=f,t[++a]=0,t[++a]=1,t[++a]=0,t[++a]=0},N=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g,p,O,D,E){switch(t){case m.LEFT:switch(n){case w.TOP:E.x=o+g*(i+e)+O*(r+u),E.y=a+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i+e)+O*(r-.5*h),E.y=.5*(a+d)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i+e)+O*(r-u-h),E.y=d+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i+e)+O*(r-u-h),E.y=a+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i+e)+O*(r+u),E.y=d+p*(i+e)+D*(r+u)}break;case m.CENTER:switch(n){case w.TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r+u),E.y=.5*(a+f)+p*(i-.5*s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+l)+g*(i-.5*s)+O*(r-.5*h),E.y=.5*(a+v)+p*(i-.5*s)+D*(r-.5*h);break;case w.BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(d+v)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(a+f)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r+u),E.y=.5*(d+v)+p*(i-.5*s)+D*(r+u)}break;case m.RIGHT:switch(n){case w.TOP:E.x=c+g*(i-e-s)+O*(r+u),E.y=f+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(f+v)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i-e-s)+O*(r-u-h),E.y=v+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i-e-s)+O*(r-u-h),E.y=f+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i-e-s)+O*(r+u),E.y=v+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_LEFT:switch(n){case w.TOP:E.x=o+g*(i-e-s)+O*(r+u),E.y=a+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(a+d)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i-e-s)+O*(r-u-h),E.y=d+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i-e-s)+O*(r-u-h),E.y=a+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i-e-s)+O*(r+u),E.y=d+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_RIGHT:switch(n){case w.TOP:E.x=c+g*(i+e)+O*(r+u),E.y=f+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i+e)+O*(r-.5*h),E.y=.5*(f+v)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i+e)+O*(r-u-h),E.y=v+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i+e)+O*(r-u-h),E.y=f+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i+e)+O*(r+u),E.y=v+p*(i+e)+D*(r+u)}}},I=function(t,n,i,r,e){var u=t*t+n*n;if(D<u){var s=Math.sqrt(u),h=1/s;return e.set(t*h,n*h),s}return e.set(i,r),0},C=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,d,D,M,S,T,j,C,y,k,L,B){var _=.5*s,P=.5*h,F=E;F.set(e-_,u-P),B.apply(F,F);var U=F.x,G=F.y;F.set(e+_,u-P),B.apply(F,F);var z=F.x,H=F.y;F.set(e+_,u+P),B.apply(F,F);var V=F.x,W=F.y,X=U+(V-z),K=G+(W-H),Y=O(U,G,z,H);I(B.a,B.b,1,0,F);var J=F.x,Z=F.y,q=O(U,G,X,K);I(B.c,B.d,0,1,F);for(var $=F.x,Q=F.y,tt=0,nt=0,it=0,rt=Math.max(0,a+S),et=0,ut=o.characters,st=b.from(c),ht=0;st.hasNext();)"\n"!==(Gt=st.next())?(0<ht&&(et+=Math.max(0,ht+M)),(Ht=ut[Gt])?(ht=Ht.advance,it=Ht.height):ht=0):(et+=ht,ht=0,tt=Math.max(tt,et),et=0,nt+=rt);var ot=a/o.font.size;et+=ht,tt=Math.max(tt,et)*ot,et=0,it*=ot,nt+=a;var at=0,ct=0,ft=NaN;switch(T){case p.LEFT_TO_RIGHT:if(N(l,v,d,D,j,C,tt,nt,U,G,z,H,V,W,X,K,J,Z,$,Q,F),at=F.x,ct=F.y,y)switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:ft=Y-2*j}}break;case p.TOP_TO_BOTTOM:if(F.set($,Q),$=-J,Q=-Z,J=F.x,Z=F.y,N(function(t){switch(t){case w.TOP:return m.LEFT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.RIGHT;case w.OUTSIDE_TOP:return m.OUTSIDE_LEFT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_RIGHT}}(v),function(t){switch(t){case m.LEFT:return w.BOTTOM;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.TOP;case m.OUTSIDE_LEFT:return w.OUTSIDE_BOTTOM;case m.OUTSIDE_RIGHT:return w.OUTSIDE_TOP}}(l),D,d,C,j,tt,nt,z,H,V,W,X,K,U,G,J,Z,$,Q,F),at=F.x,ct=F.y,y)switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:ft=q-2*C}}break;case p.BOTTOM_TO_TOP:if(F.set($,Q),$=J,Q=Z,J=-F.x,Z=-F.y,N(function(t){switch(t){case w.TOP:return m.RIGHT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.LEFT;case w.OUTSIDE_TOP:return m.OUTSIDE_RIGHT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_LEFT}}(v),function(t){switch(t){case m.LEFT:return w.TOP;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.BOTTOM;case m.OUTSIDE_LEFT:return w.OUTSIDE_TOP;case m.OUTSIDE_RIGHT:return w.OUTSIDE_BOTTOM}}(l),D,d,C,j,tt,nt,X,K,U,G,z,H,V,W,J,Z,$,Q,F),at=F.x,ct=F.y,y)switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:ft=q-2*C}}}if(ft<tt){var lt=.5*(tt-ft);k[0]=at+J*lt,k[1]=ct+Z*lt,k[2]=J,k[3]=Z,k[4]=$,k[5]=Q,k[6]=ft,k[7]=nt}else k[0]=at,k[1]=ct,k[2]=J,k[3]=Z,k[4]=$,k[5]=Q,k[6]=tt,k[7]=nt;var vt=L.x0,bt=L.x1,dt=L.x3,gt=L.y0,mt=L.y1,wt=L.y3,pt=bt-vt,Ot=mt-gt,Dt=dt-vt,Et=wt-gt,Mt=rt*$,St=rt*Q,Tt=ot*J,jt=ot*Z,Nt=.5*(it-a),It=Nt*$,Ct=Nt*Q,At=f===g.NORMAL?0:.25*a,Rt=at-It+At*Tt,yt=ct-Ct+At*jt,kt=at+It+a*$,Lt=ct+Ct+a*Q,xt=Rt,Bt=yt,_t=kt,Pt=Lt;et=0,ht=0,st.position=0;for(var Ft=0,Ut=2*i;st.hasNext();Ut+=8){var Gt;if("\n"!==(Gt=st.next())){var zt=et;0<ht&&(et+=Math.max(0,ht+M));var Ht,Vt=et*Tt,Wt=et*jt;if(xt=Rt+Vt,Bt=yt+Wt,_t=kt+Vt,Pt=Lt+Wt,Ft+=1,Ht=ut[Gt]){var Xt=Ht.advance;if(ft<(et+Xt)*ot){var Kt=ut["..."];if(Kt){if(1<Ft&&ft<(et+Kt.advance)*ot){Ut-=8,Ft-=1;var Yt=(et=zt)*Tt,Jt=et*jt;xt=Rt+Yt,Bt=yt+Jt,_t=kt+Yt,Pt=Lt+Jt}for(ht=Kt.advance,R(t,n,Ut,Kt,o,Tt,jt,xt,Bt,_t,Pt,pt,Ot,Dt,Et,vt,gt),Ut+=8;;Ut+=8){if(!st.hasNext()||!st.advance("\n")){Ut-=8;break}A(t,n,Ut,xt,Bt,_t,Pt,vt,gt,dt,wt),Ft+=1}}else ht=Xt,A(t,n,Ut,xt,Bt,_t,Pt,vt,gt,dt,wt)}else ht=Xt,R(t,n,Ut,Ht,o,Tt,jt,xt,Bt,_t,Pt,pt,Ot,Dt,Et,vt,gt)}else ht=0,A(t,n,Ut,xt,Bt,_t,Pt,vt,gt,dt,wt)}else et+=ht,ht=0,A(t,n,Ut,xt=Rt+=Mt,Bt=yt+=St,_t=kt+=Mt,Pt=Lt+=St,vt,gt,dt,wt),x(t,J,Z,Ft,Ut,tt-et*ot,T,l,v),et=0,Ft=0}x(t,J,Z,Ft,Ut,tt-(et+=ht)*ot,T,l,v);for(var Zt=2*(i+r);Ut<Zt;Ut+=2)t[Ut+0]=at,t[Ut+1]=ct,n[Ut+0]=vt,n[Ut+1]=gt},A=function(t,n,i,r,e,u,s,h,o,a,c){t[i+0]=r,t[i+1]=e,t[i+2]=r,t[i+3]=e,t[i+4]=u,t[i+5]=s,t[i+6]=u,t[i+7]=s,n[i+0]=h,n[i+1]=o,n[i+2]=h,n[i+3]=o,n[i+4]=a,n[i+5]=c,n[i+6]=a,n[i+7]=c},R=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=r.x-r.origin.x,w=r.width,p=m*u,O=m*s,D=(m+w)*u,E=(m+w)*s;t[i+0]=h+p,t[i+1]=o+O,t[i+2]=h+D,t[i+3]=o+E,t[i+4]=a+D,t[i+5]=c+E,t[i+6]=a+p,t[i+7]=c+O;var M=r.x/e.width,S=r.y/e.height,T=(r.x+r.width)/e.width,j=(r.y+r.height)/e.height,N=f*M,I=l*M,C=f*T,A=l*T,R=v*S,y=b*S,k=v*j,L=b*j;n[i+0]=d+N+R,n[i+1]=g+I+y,n[i+2]=d+C+R,n[i+3]=g+A+y,n[i+4]=d+C+k,n[i+5]=g+A+L,n[i+6]=d+N+k,n[i+7]=g+I+L},y=function(t,n,i,r,e){for(var u=n-8*i-1,s=0;s<i;++s)t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e},k=function(t,n,i,r,e,u){y(t,n,i,(r*=.5)*e,r*u)},L=function(t,n,i,r,e,u){y(t,n,i,r*e,r*u)},x=function(t,n,i,r,e,u,s,h,o){if(D<u)switch(s){case p.LEFT_TO_RIGHT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:break;case m.CENTER:k(t,e,r,u,n,i);break;case m.OUTSIDE_LEFT:case m.RIGHT:L(t,e,r,u,n,i)}break;case p.TOP_TO_BOTTOM:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:break;case w.MIDDLE:k(t,e,r,u,n,i);break;case w.OUTSIDE_TOP:case w.BOTTOM:L(t,e,r,u,n,i)}break;case p.BOTTOM_TO_TOP:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:L(t,e,r,u,n,i);break;case w.MIDDLE:k(t,e,r,u,n,i)}}},B=function(t,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};function _(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}B(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var P,F,U={NONE:0,CLOSED:1,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896,CURVE:1024,FORMATTER_MASK:1024},G=function(t,n,i,r,e){for(var u=(t>>16&255)/255*n,s=(t>>8&255)/255*n,h=(t>>0&255)/255*n,o=n,a=(i<<2)-1,c=(i+r<<2)-1;a<c;)e[++a]=u,e[++a]=s,e[++a]=h,e[++a]=o},z=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=-1,this.strokeAlign=NaN,this.strokeWidth=NaN,this.strokeSide=NaN,this.strokeStyle=NaN,this.colorFill=NaN,this.alphaFill=-1,this.colorStroke=NaN,this.alphaStroke=-1,this.texture=null,this.textureTransformId=NaN}return n.prototype.isCompatible=function(t){return!0},n.prototype.updateColorFill=function(t,n){var i=n.fill,r=n.visible&&i.enable,e=i.color,u=r?i.alpha:0;e===this.colorFill&&u===this.alphaFill||(this.colorFill=e,this.alphaFill=u,t.updateColorFills(),G(e,u,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.stroke,r=n.visible&&i.enable&&0<i.width,e=i.color,u=r?i.alpha:0;e===this.colorStroke&&u===this.alphaStroke||(this.colorStroke=e,this.alphaStroke=u,t.updateColorStrokes(),G(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),H=function(t){return t.updateTransform(),t.transform.getLocalId()},V=function(n){return n.texture||t.Texture.WHITE},W=function(t){var n=t;return null==n._uvs&&t.updateUvs(),n._updateID},X=function(t){return t._uvs},K=function(){function t(){}return t.setDefaultThemeClass=function(t){this.DEFAULT_THEME_CLASS=t},t.getDefaultThemeClass=function(){return this.DEFAULT_THEME_CLASS},t.getInstance=function(){if(null==this.INSTANCE){var t=this.getDefaultThemeClass();if(null==t)throw new Error("No default theme class found");this.INSTANCE=new t}return this.INSTANCE},t.setInstance=function(t){var n=this.INSTANCE;return this.INSTANCE=t,n},t.DEFAULT_THEME_CLASS=null,t.INSTANCE=null,t}(),Y=function(){function t(){}return Object.defineProperty(t,"THEME",{get:function(){var t=this.g;if(null!=t)return t;var n=K.getInstance().get("EShape");return this.g=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_COLOR",{get:function(){return this.THEME.getFillColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_ALPHA",{get:function(){return this.THEME.getFillAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_COLOR",{get:function(){return this.THEME.getStrokeColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALPHA",{get:function(){return this.THEME.getStrokeAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_WIDTH",{get:function(){return this.THEME.getStrokeWidth()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALIGN",{get:function(){return this.THEME.getStrokeAlign()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_SIDE",{get:function(){return this.THEME.getStrokeSide()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_STYLE",{get:function(){return this.THEME.getStrokeStyle()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_VALUE",{get:function(){return this.THEME.getTextValue()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_COLOR",{get:function(){return this.THEME.getTextColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_ALPHA",{get:function(){return this.THEME.getTextAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_FAMILY",{get:function(){return this.THEME.getTextFamily()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_SIZE",{get:function(){return this.THEME.getTextSize()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"CURSOR",{get:function(){return this.THEME.getCursor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"RADIUS",{get:function(){return this.THEME.getRadius()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_X",{get:function(){return this.THEME.getSizeX()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_Y",{get:function(){return this.THEME.getSizeY()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HIGHLIGHT_COLOR",{get:function(){return this.THEME.getHighlightColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"CURVE_SEGMENT_COUNT",{get:function(){return this.THEME.getCurveSegmentCount()},enumerable:!1,configurable:!0}),t}(),J={NONE:0,CIRCLE:1,TRIANGLE:2,RECTANGLE:3},Z=function(){function t(t,n,i,r){this.O=t,this.S=n,this.T=i,this.j=r}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha)},t.prototype.set=function(t,n,i){var r=!1;void 0!==t&&this.S!==t&&(this.S=t,r=!0),void 0!==n&&this.T!==n&&(this.T=n,r=!0),void 0!==i&&this.j!==i&&(this.j=i,r=!0),r&&this.O.updateUploaded()},t.prototype.clone=function(){return new t(this.O,this.S,this.T,this.j)},t.prototype.toObject=function(){return{enable:this.S,color:this.T,alpha:this.j}},t.prototype.serialize=function(t){var n="["+(this.S?1:0)+","+this.T+","+this.j+"]";return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getFill(t);if(null!=r)this.set(!!r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setFill(t,e),this.set(!!e[0],e[1],e[2])}}},t}(),q=function(){function n(){}return n.prototype.lock=function(){return this},n.prototype.unlock=function(){return this},Object.defineProperty(n.prototype,"type",{get:function(){return J.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var n=this.I;return null==n&&(n=new t.Point,this.I=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transform",{get:function(){var n=this.C;return null==n&&(n=new t.Matrix,this.C=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){var t=this.A;return null==t&&(t=new Z(this,!0,Y.FILL_COLOR,1),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.updateUploaded=function(){},n.prototype.copy=function(t){return this},n.prototype.set=function(t,n,i){return this},n.prototype.serialize=function(t){return-1},n.prototype.deserialize=function(t,n){},n}(),$=function(){function t(){this.R=new q}return t.prototype.lock=function(){return this},t.prototype.unlock=function(){return this},Object.defineProperty(t.prototype,"head",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.R},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t.getInstance=function(){var n=this.INSTANCE;return null==n&&(n=new t,this.INSTANCE=n),n},t}(),Q={TOP:0,LEFT:1,RIGHT:2,BOTTOM:3},tt=function(){function n(t){this.O=t,this.k=0,this.L=[0,0,0,0],this.B=[],this._=U.NONE,this.I=-1,this.P=Q.TOP,this.F=NaN,this.U=NaN,this.G=NaN,this.V=NaN}return n.prototype.getComputedSize=function(t,n,i,r){if(0<=t)return t;switch(n){case Q.TOP:case Q.BOTTOM:return Math.abs(r);case Q.RIGHT:case Q.LEFT:return Math.abs(i)}return 0},n.prototype.update=function(){var t=this.O.size,n=t.x,i=t.y,r=this.P,e=this.I;if(this.F!==e||this.U!==n||this.G!==i||this.V!==r){this.k+=1,this.F=e,this.U=n,this.G=i,this.V=r;var u=.5*n,s=.5*i,h=this.getComputedSize(e,r,n,i),o=this.L;switch(r){case Q.TOP:o[0]=0,o[1]=-s,o[2]=0,o[3]=-s+h;break;case Q.RIGHT:o[0]=u,o[1]=0,o[2]=u-h,o[3]=0;break;case Q.BOTTOM:o[0]=0,o[1]=s,o[2]=0,o[3]=s-h;break;case Q.LEFT:o[0]=-u,o[1]=0,o[2]=-u+h,o[3]=0}}},Object.defineProperty(n.prototype,"length",{get:function(){return 2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.update(),this.k},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.update(),this.L},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.B},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.I},set:function(t){this.moveTo(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"position",{get:function(){return this.P},set:function(t){this.moveTo(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this._},set:function(t){this.moveTo(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.R;return null==t&&(t=$.getInstance(),this.R=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return t instanceof n?this.moveTo(t.position,t.size,t.style):this.moveTo(void 0,void 0,t.style)},n.prototype.set=function(t,n,i){var r,e;if(null!=t){var u=t[0];if(0===u){var s=t[1];r=s<=0?Q.TOP:Q.BOTTOM,e=Math.abs(t[3]-s)}else r=u<=0?Q.LEFT:Q.RIGHT,e=Math.abs(t[2]-u)}return this.moveTo(r,e,i)},n.prototype.moveTo=function(t,n,i){var r=!1;return null!=i&&this._!==i&&(this._=i,r=!0),null!=t&&this.P!==t&&(this.P=t,r=!0),null!=n&&this.I!==n&&(this.I=n,r=!0),r&&this.O.updateUploaded(),this},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("["+this.P+","+this.I+","+this._+"]")},n.prototype.deserialize=function(t,n){if(0<=t&&t<n.resources.length){var i=n.resources[t],r=JSON.parse(i);this.moveTo(r[0],r[1],r[2])}},n.prototype.calcHitPointAbs=function(t,n,i,r,e,u,s,h){if(2<=this.length){var o=this.L;if(s(t,n,o[0],o[1],o[2],o[3],0,e,h))return!0}return!1},n}(),nt={NONE:0,LINE:1,MARKER_TAIL:2,MARKER_HEAD:3,TEXT:4,CHILDREN:5},it={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},rt=function(){function t(){}return t.add=function(n){t.INSTANCES.push(n)},t.first=function(){var n=t.INSTANCES;if(0<n.length)return n[0];throw new Error("No application found.")},t.last=function(){var n=t.INSTANCES;if(0<n.length)return n[n.length-1];throw new Error("No application found.")},t.get=function(n){var i=t.INSTANCES;return 0<=n&&n<i.length?i[n]:null},t.indexOf=function(n){return t.INSTANCES.indexOf(n)},t.size=function(){return t.INSTANCES.length},t.getStage=function(t){for(var n=t;n.parent;)n=n.parent;return"application"in n&&"layer"in n?n:null},t.find=function(t){var n=this.getStage(t);return n?n.layer.application:null},t.getLayerBase=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerBase():null},t.getLayerOverlay=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerOverlay():null},t.getLayer=function(t){var n=this.getStage(t);return n?n.layer:null},t.getResolution=function(t){var n,i=this.getLayer(t);return i?i.renderer.resolution:null!==(n=window.devicePixelRatio)&&void 0!==n?n:1},t.update=function(n){if(n){var i=this.getStage(n);i&&i.layer.update()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].update()},t.render=function(n){if(n){var i=this.getStage(n);i&&i.layer.render()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].render()},t.INSTANCES=[],t}(),et=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if(n[i]===t)return i;for(i=0,r=n.length;i<r;++i)if(n[i].isEquals(t))return i;return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.serialize=function(t){for(var n=[],i=this.values,r=0,e=i.length;r<e;++r)n.push(i[r].serialize(t));return n},t}(),ut=function(){function t(t){this.O=t,this.W=new Set}return t.prototype.add=function(t){var n=this.W;return!n.has(t)&&(n.add(t),!0)},t.prototype.contains=function(t){return this.W.has(t)},t.prototype.size=function(){return this.W.size},t.prototype.remove=function(t){return this.W.delete(t)},t.prototype.clear=function(){return 0<this.W.size&&(this.W.clear(),!0)},t.prototype.copy=function(t){var n=this.W;return n.clear(),t.each((function(t){n.add(t)})),this},t.prototype.each=function(t){return this.W.forEach(t),this},t.prototype.fit=function(t){this.W.forEach(this.toOnFitBound(t))},t.prototype.toOnFitBound=function(t){var n;return t?(null==(n=this.K)&&(n=this.newOnFitBound(!0),this.K=n),n):(null==(n=this.J)&&(n=this.newOnFitBound(!1),this.J=n),n)},t.prototype.newOnFitBound=function(t){var n=this;return function(i){n.onFit(i,t)}},t.prototype.onFit=function(t,n){t.fit(n)},t.prototype.attach=function(){var t=this.O;return this.W.forEach((function(n){n.set(t)})),this},t.prototype.detach=function(){return this.W.forEach((function(t){t.set(null)})),this},t}(),st={NONE:0,TRANSFORM:1,SIZE:2,STYLE:4,ACTION:8,POINTS:16,STATE:32,IMAGE:64,DATA:128,TAG:128,CONNECTOR:256,ALL:511},ht={HOVERED:"HOVERED",ACTIVE:"ACTIVE",FOCUSED:"FOCUSED",UNFOCUSABLE:"UNFOCUSABLE",FOCUS_ROOT:"FOCUS_ROOT",FOCUS_REVERSE:"FOCUS_REVERSE",READ_ONLY:"READ_ONLY",DISABLED:"DISABLED",GESTURING:"GESTURING",PRESSED:"PRESSED",INVALID:"INVALID",SUCCEEDED:"SUCCEEDED",FAILED:"FAILED",WARNED:"WARNED",CHANGED:"CHANGED",ALTERNATED:"ALTERNATED",NEW_WINDOW:"NEW_WINDOW"},ot=function(t){return"function"==typeof t},at=function(t){return"string"==typeof t||"[object String]"===Object.prototype.toString.call(t)},ct=function(){function t(){this.Z=new Set,this.O=null}return t.prototype.is=function(t){return this.Z.has(t)},t.prototype.in=function(t){return this.is(t)||this.under(t)},t.prototype.on=function(t){var n,i;return null!==(i=null===(n=this.O)||void 0===n?void 0:n.is(t))&&void 0!==i&&i},t.prototype.under=function(t){var n,i;return null!==(i=null===(n=this.O)||void 0===n?void 0:n.in(t))&&void 0!==i&&i},t.prototype.lock=function(t){return this},t.prototype.unlock=function(){return this},t.prototype.begin=function(){return this},t.prototype.end=function(){return this},t.prototype.checkAdded=function(t){return!this.Z.has(t)},t.prototype.add=function(t){return this.checkAdded(t)&&(this.begin(),this.Z.add(t),this.end()),this},t.prototype.checkAddeds=function(t){for(var n=this.Z,i=0,r=t.length;i<r;++i)if(!n.has(t[i]))return!0;return!1},t.prototype.addAll=function(t){var n=at(t)?arguments:t;if(this.checkAddeds(n)){this.begin();for(var i=this.Z,r=0,e=n.length;r<e;++r)i.add(n[r]);this.end()}return this},t.prototype.checkRemoved=function(t){return this.Z.has(t)},t.prototype.remove=function(t){return this.checkRemoved(t)&&(this.begin(),this.Z.delete(t),this.end()),this},t.prototype.checkRemoveds=function(t){for(var n=this.Z,i=0,r=t.length;i<r;++i)if(n.has(t[i]))return!0;return!1},t.prototype.removeAll=function(t){var n=this,i=this.Z;if(ot(t)){var r=!1;i.forEach((function(e){t(e)&&(r||(r=!0,n.begin()),i.delete(e))})),r&&this.end()}else{var e=at(t)?arguments:t;if(this.checkRemoveds(e)){this.begin();for(var u=0,s=e.length;u<s;++u)i.delete(e[u]);this.end()}}return this},t.prototype.clear=function(){var t=this.Z;return 0<t.size&&(this.begin(),t.clear(),this.end()),this},t.prototype.set=function(t,n){if(!0===n)null!=t&&this.add(t);else if(!1===n)null!=t&&this.remove(t);else{var i=t,r=n;null!=i?null!=r?(this.checkAdded(i)||this.checkRemoved(r))&&(this.begin(),this.Z.add(i).delete(r),this.end()):this.add(i):null!=r&&this.remove(r)}return this},t.prototype.setAll=function(t,n){if(!0===n)null!=t&&this.addAll(t);else if(!1===n)null!=t&&this.removeAll(t);else{var i=t,r=n;if(null!=i)if(null!=r){if(this.checkAddeds(i)||this.checkRemoveds(r)){this.begin();for(var e=this.Z,u=0,s=i.length;u<s;++u)e.add(i[u]);for(u=0,s=r.length;u<s;++u)e.delete(r[u]);this.end()}}else this.addAll(i);else null!=r&&this.removeAll(r)}return this},t.prototype.each=function(t){return this.Z.forEach((function(n){t(n)})),this},t.prototype.size=function(){return this.Z.size},t.prototype.copy=function(n){if(n instanceof t){this.begin();var i=this.Z;i.clear(),n.local.forEach((function(t){i.add(t)})),this.O=n.parent,this.end()}return this},Object.defineProperty(t.prototype,"local",{get:function(){return this.Z},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.O},set:function(t){this.O!==t&&(this.begin(),this.O=t,this.end())},enumerable:!1,configurable:!0}),t.prototype.onParentChange=function(t,n){this.O=n,this.begin(),this.O=t,this.end()},Object.defineProperty(t.prototype,"isHovered",{get:function(){return this.is(ht.HOVERED)},set:function(t){this.set(ht.HOVERED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inHovered",{get:function(){return this.in(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHovered",{get:function(){return this.on(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underHovered",{get:function(){return this.under(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this.is(ht.ACTIVE)},set:function(t){this.set(ht.ACTIVE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inActive",{get:function(){return this.in(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onActive",{get:function(){return this.on(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underActive",{get:function(){return this.under(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPressed",{get:function(){return this.is(ht.PRESSED)},set:function(t){this.set(ht.PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inPressed",{get:function(){return this.in(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onPressed",{get:function(){return this.on(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underPressed",{get:function(){return this.under(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReadOnly",{get:function(){return this.is(ht.READ_ONLY)},set:function(t){this.set(ht.READ_ONLY,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inReadOnly",{get:function(){return this.in(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onReadOnly",{get:function(){return this.on(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underReadOnly",{get:function(){return this.under(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return!this.is(ht.DISABLED)},set:function(t){this.set(ht.DISABLED,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inEnabled",{get:function(){return!this.in(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onEnabled",{get:function(){return!this.on(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underEnabled",{get:function(){return!this.under(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.is(ht.DISABLED)},set:function(t){this.set(ht.DISABLED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisabled",{get:function(){return this.in(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDisabled",{get:function(){return this.on(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underDisabled",{get:function(){return this.under(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActionable",{get:function(){return!this.in(ht.DISABLED)&&!this.in(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGesturing",{get:function(){return this.is(ht.GESTURING)},set:function(t){this.set(ht.GESTURING,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inGesturing",{get:function(){return this.in(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onGesturing",{get:function(){return this.on(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underGesturing",{get:function(){return this.under(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocused",{get:function(){return this.is(ht.FOCUSED)},set:function(t){this.set(ht.FOCUSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocused",{get:function(){return this.in(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocused",{get:function(){return this.on(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocused",{get:function(){return this.under(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusRoot",{get:function(){return this.is(ht.FOCUS_ROOT)},set:function(t){this.set(ht.FOCUS_ROOT,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusRoot",{get:function(){return this.in(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusRoot",{get:function(){return this.on(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusRoot",{get:function(){return this.under(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusReverse",{get:function(){return this.is(ht.FOCUS_REVERSE)},set:function(t){this.set(ht.FOCUS_REVERSE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusReverse",{get:function(){return this.in(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusReverse",{get:function(){return this.on(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusReverse",{get:function(){return this.under(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusable",{get:function(){return!this.is(ht.UNFOCUSABLE)},set:function(t){this.set(ht.UNFOCUSABLE,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusable",{get:function(){return!this.in(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusable",{get:function(){return!this.on(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusable",{get:function(){return!this.under(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUnfocusable",{get:function(){return this.is(ht.UNFOCUSABLE)},set:function(t){this.set(ht.UNFOCUSABLE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inUnfocusable",{get:function(){return this.in(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUnfocusable",{get:function(){return this.on(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underUnfocusable",{get:function(){return this.under(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isInvalid",{get:function(){return this.is(ht.INVALID)},set:function(t){this.set(ht.INVALID,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inInvalid",{get:function(){return this.in(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onInvalid",{get:function(){return this.on(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underInvalid",{get:function(){return this.on(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSucceeded",{get:function(){return this.is(ht.SUCCEEDED)},set:function(t){this.set(ht.SUCCEEDED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inSucceeded",{get:function(){return this.in(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSucceeded",{get:function(){return this.on(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underSucceeded",{get:function(){return this.under(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFailed",{get:function(){return this.is(ht.FAILED)},set:function(t){this.set(ht.FAILED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFailed",{get:function(){return this.in(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFailed",{get:function(){return this.on(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFailed",{get:function(){return this.under(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isWarned",{get:function(){return this.is(ht.WARNED)},set:function(t){this.set(ht.WARNED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inWarned",{get:function(){return this.in(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onWarned",{get:function(){return this.on(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underWarned",{get:function(){return this.on(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.is(ht.CHANGED)},set:function(t){this.set(ht.CHANGED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inChanged",{get:function(){return this.in(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onChanged",{get:function(){return this.on(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underChanged",{get:function(){return this.on(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlternated",{get:function(){return this.is(ht.ALTERNATED)},set:function(t){this.set(ht.ALTERNATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inAlternated",{get:function(){return this.in(ht.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAlternated",{get:function(){return this.on(ht.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underAlternated",{get:function(){return this.on(ht.ALTERNATED)},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){var t=[];return this.Z.forEach((function(n){t.push(n)})),{local:t}},t.prototype.toString=function(){return JSON.stringify(this.toObject())},t}(),ft=function(t){function n(n){var i=t.call(this)||this;return i.q=n,i.$=0,i.tt=!1,i.nt=!0,i}return _(n,t),n.prototype.lock=function(t){return this.$+=1,!1===t&&(this.nt=!1),this},n.prototype.unlock=function(){return this.$-=1,this.end()},Object.defineProperty(n.prototype,"saved",{get:function(){var t=this.it;return null==t&&(t=new ct,this.it=t),t},enumerable:!1,configurable:!0}),n.prototype.begin=function(){return this.nt&&!this.tt&&(this.tt=!0,this.saved.copy(this)),this},n.prototype.end=function(){return this.$<=0&&(this.nt=!0,this.tt&&(this.tt=!1,this.onChange(this,this.saved))),this},n.prototype.onChange=function(t,n){this.q(t,n)},n}(ct),lt={CLICKED:"CLICKED",DOWN:"DOWN",UP:"UP",ACTIVATED:"ACTIVATED",DEACTIVATED:"DEACTIVATED"},vt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onChange=function(n,i){n.isActive?i.isActive||this.Z.add(lt.ACTIVATED).delete(lt.DEACTIVATED):i.isActive&&this.Z.add(lt.DEACTIVATED).delete(lt.ACTIVATED),t.prototype.onChange.call(this,n,i)},Object.defineProperty(n.prototype,"isClicked",{get:function(){return this.is(lt.CLICKED)},set:function(t){this.set(lt.CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inClicked",{get:function(){return this.in(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onClicked",{get:function(){return this.on(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underClicked",{get:function(){return this.under(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDown",{get:function(){return this.is(lt.DOWN)},set:function(t){this.set(lt.DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDown",{get:function(){return this.in(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDown",{get:function(){return this.on(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDown",{get:function(){return this.under(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUp",{get:function(){return this.is(lt.UP)},set:function(t){this.set(lt.UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUp",{get:function(){return this.in(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUp",{get:function(){return this.on(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUp",{get:function(){return this.under(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isActivated",{get:function(){return this.is(lt.ACTIVATED)},set:function(t){this.set(lt.ACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inActivated",{get:function(){return this.in(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onActivated",{get:function(){return this.on(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underActivated",{get:function(){return this.under(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDeactivated",{get:function(){return this.is(lt.DEACTIVATED)},set:function(t){this.set(lt.DEACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDeactivated",{get:function(){return this.in(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDeactivated",{get:function(){return this.on(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDeactivated",{get:function(){return this.under(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),n}(ft),bt=function(n){function i(i){var r=n.call(this)||this;return r.internalTransform=new t.Matrix,r.O=i,r}return _(i,n),i.prototype.onChange=function(){n.prototype.onChange.call(this),this.O.onTransformChange()},i.prototype.updateSkew=function(){n.prototype.updateSkew.call(this),this.O.onTransformChange()},i.prototype.getLocalIdCurrent=function(){return this._currentLocalID},i.prototype.getLocalId=function(){return this._localID},i.prototype.getParentId=function(){return this._parentID},i.prototype.getWorldId=function(){return this._worldID},i.prototype.updateTransform=function(t){var r=this._currentLocalID,e=this._worldID;n.prototype.updateTransform.call(this,t);var u=this._currentLocalID,s=this._worldID;if(r!==u){var h=this.localTransform,o=this.internalTransform;h.copyTo(o),t instanceof i&&o.prepend(t.internalTransform)}else e!==s&&(h=this.localTransform,o=this.internalTransform,t instanceof i&&(h.copyTo(o).prepend(t.internalTransform),this._currentLocalID+=1,this._localID=this._currentLocalID))},i}(t.Transform),dt=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0,this.strokeWidth=0,this.strokeScale=1,this.strokeAlign=0}return t.prototype.set=function(t,n,i,r,e,u,s){return this.x=t,this.y=n,this.width=i,this.height=r,this.strokeWidth=e,this.strokeScale=u,this.strokeAlign=s,this},t}(),gt=function(t){return"data:image/svg+xml;base64,"+btoa(t)},mt=function(t,n,i){var r=t.length;if(n<r)return t;for(var e="",u=0,s=n-r;u<s;++u)e+=i;return e+t},wt=function(){function t(){}return t.toCode=function(t){return mt(t.toString(16).toUpperCase(),6,"0")},t.fromCode=function(t){var n=t.trim().toLowerCase();if(6===n.length){var i=Number("0x"+n);if(i==i)return i}return null},t.fromRgb=function(t,n,i){return 255*t<<16|255*n<<8|255*i|0},t.blend=function(t,n,i){var r=t>>16&255,e=t>>8&255,u=255&(0|t),s=n>>16&255,h=n>>8&255,o=255&(0|n),a=Math.max(0,Math.min(1,i)),c=1-a;return Math.max(0,Math.min(255,r*c+s*a))<<16|Math.max(0,Math.min(255,e*c+h*a))<<8|0|Math.max(0,Math.min(255,u*c+o*a))},t.brighten=function(t,n){return 0<=n?this.blend(t,16777215,n):this.blend(t,0,-n)},t.darken=function(t,n){return 0<=n?this.blend(t,0,n):this.blend(t,16777215,-n)},t.toGrayscale=function(t){var n=this.toLuma(t);return n<<16|n<<8|n},t.toLuma=function(t){return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(255&(0|t))&255},t}(),pt=function(){function t(){}return t.serializeGradient=function(t){for(var n=t.points,i="["+t.direction,r=0,e=n.length,u=1;r<e;r+=1,u+=3){var s=n[r];i+=","+s.color+","+s.alpha+","+s.position}return i+"]"},t.parseGradient=function(t){try{return JSON.parse(t)}catch(t){return null}},t.deserializeGradient=function(t){var n=this.parseGradient(t);if(!(null==n||n.length<7)){for(var i=n[0],r=[],e=1,u=n.length;e<u;e+=3)r.push({color:n[e+0],alpha:n[e+1],position:n[e+2]});return{points:r,direction:i}}},t.toGradientId=function(t,n){return null!=t?(null==t.serialized&&(t.serialized=this.serializeGradient(t)),n.addResource(t.serialized)):-1},t.toGradientImageUrl=function(t){for(var n=t.direction,i=t.points,r="",e=0,u=i.length;e<u;++e){var s=i[e],h=wt.toCode(s.color),o=s.alpha;r+='<stop offset="'+100*s.position+'%" stop-color="#'+h+'" stop-opacity="'+o+'" />'}var a=n*Math.PI/180,c=.5*Math.cos(a),f=-.5*Math.sin(a);return gt('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><defs><linearGradient id="o2glkm3aeu2oio" x1="'+(.5-c)+'" x2="'+(.5+c)+'" y1="'+(.5-f)+'" y2="'+(.5+f)+'">'+r+'</linearGradient></defs><rect x="0" y="0" width="32" height="32" stroke="none" fill="url(#o2glkm3aeu2oio)" /></svg>')},t}(),Ot=function(t,n,i,r){return-i<=t&&t<=+i&&-r<=n&&n<=+r},Dt=function(n){function i(t){var i=n.call(this)||this;return i.id="",i.uuid=0,i.type=t,i.transform=i.newTransform(),i.rt=0,i.et=!1,i.action=new et,i.ut=!0,i.st=0,i.ht=!1,i.ot=!1,i.at=NaN,i.ct=NaN,i.ft=NaN,i.interactive=!1,i.parent=null,i.children=[],i.selected=!1,i.index=0,i.reference=0,i}return _(i,n),i.prototype.newTransform=function(){return new bt(this)},i.prototype.onSizeChange=function(){var t;this.at=NaN,this.ct=NaN,this.ft=NaN,this.lt(),this.updateUploaded(),null===(t=this.vt)||void 0===t||t.fit(!0)},i.prototype.onTransformChange=function(){this.lt(),this.onParentTransformChange()},i.prototype.onParentTransformChange=function(){var t;this.updateUploaded(),null===(t=this.vt)||void 0===t||t.fit(!0);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onParentTransformChange()},i.prototype.lt=function(){if(0===this.rt){var t=this.parent;null!=t&&t.onChildTransformChange()}else this.et=!0},i.prototype.disallowOnTransformChange=function(){this.rt+=1,1===this.rt&&(this.et=!1)},i.prototype.allowOnTransformChange=function(t){this.rt-=1,0===this.rt&&this.et&&(this.et=!1,t&&this.onTransformChange())},i.prototype.onChildTransformChange=function(){},i.prototype.disallowUploadedUpdate=function(){this.st+=1,1===this.st&&(this.ht=!1,this.ot=!1)},i.prototype.allowUploadedUpdate=function(){this.st-=1,0===this.st&&(this.ot?(this.ot=!1,this.ht=!1,this.updateUploadedRecursively()):this.ht&&(this.ht=!1,this.updateUploaded()))},i.prototype.updateUploadedRecursively=function(){if(0===this.st){this.updateUploaded();for(var t=this.children,n=0,i=t.length;n<i;++n)t[n].updateUploadedRecursively()}else this.ot=!0},i.prototype.updateUploaded=function(){if(0===this.st){var t=this.uploaded;null!=t&&t.update(this)}else this.ht=!0},Object.defineProperty(i.prototype,"image",{get:function(){return this.bt},set:function(t){this.bt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){for(var t=this;t.parent instanceof i;)t=t.parent;return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"connector",{get:function(){var t=this.vt;return null==t&&(t=new ut(this),this.vt=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"visible",{get:function(){if(this.ut){var t=this.parent;return!(t instanceof i)||t.visible}return!1},set:function(t){this.ut!==t&&(this.ut=t,this.updateUploadedRecursively())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"worldVisible",{get:function(){if(this.ut){var t=this.parent;return!t||t.worldVisible}return!1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){var t;null===(t=this.parent)||void 0===t||t.toDirty()},i.prototype.attach=function(t,n){this.detach(),this.parent=t;var i=t.children;return null!=n&&0<=n&&n<i.length?i.splice(n,0,this):i.push(this),this.uploaded=void 0,t.onChildTransformChange(),t.toDirty(),this.onAttach(),this},i.prototype.onAttach=function(){var t=this.vt;t&&(t.attach(),t.fit(!0));for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onAttach()},i.prototype.detach=function(){var t=this.parent;if(t){this.parent=null,this.uploaded=void 0;var n=t.children,i=n.indexOf(this);0<=i&&(n.splice(i,1),t.onChildTransformChange(),t.toDirty(),this.onDetach())}return this},i.prototype.onDetach=function(){var t=this.vt;t&&t.detach();for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onDetach()},i.prototype.updateTransform=function(){var n=this.parent;n?(n.parent&&n.updateTransform(),this.transform.updateTransform(n.transform)):this.transform.updateTransform(t.Transform.IDENTITY)},i.prototype.serializeChildren=function(t){for(var n=this.children,i=[],r=0,e=n.length;r<e;++r){var u=n[r];i.push(u.serialize(t))}return i},i.prototype.serializeImage=function(t){var n=this.bt;return null!=n?t.addResource(n.src):-1},i.prototype.serializeGradient=function(t){return pt.toGradientId(this.gradient,t)},i.prototype.serializeState=function(t){var n=this.state;return(this.interactive?1:0)|(n.isFocusable?0:2)|(n.isActive?4:0)},i.prototype.serialize=function(t){var n=this.transform,i=n.position,r=n.pivot,e=this.size,u=this.shortcut,s=null!=u?t.addResource(u):-1,h=this.title,o=null!=h?t.addResource(h):-1;return[this.type,t.addResource(this.id),i.x,i.y,e.x,e.y,n.rotation,n.skew.x,this.fill.serialize(t),this.stroke.serialize(t),t.addResource(this.cursor.trim()),this.text.serialize(t),this.data.serialize(t),this.radius,this.corner,-1,-1,this.action.serialize(t),this.serializeImage(t),this.serializeGradient(t),this.serializeChildren(t),r.x,r.y,this.serializeState(t),s,o,this.uuid]},i.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},i.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},i.prototype.getShapeScale=function(){var t=this.root.parent;return null!=t&&null!=t.getShapeScale?t.getShapeScale():1},i.prototype.getStrokeWidthScale=function(t){return t&s.NON_EXPANDING_WIDTH?t&s.NON_SHRINKING_WIDTH?this.getShapeScale():Math.min(1,this.getShapeScale()):t&s.NON_SHRINKING_WIDTH?Math.max(1,this.getShapeScale()):1},i.prototype.getHitTestSize=function(t){var n=this.size;return t.width=.5*n.x,t.height=.5*n.y,t},i.prototype.toHitTestData=function(t,n){var r,e=this.getHitTestSize(null!==(r=i.WORK_HIT_TEST_DATA)&&void 0!==r?r:i.WORK_HIT_TEST_DATA=new dt),u=e.width,s=e.height,h=this.transform.pivot,o=t-h.x,a=n-h.y,c=this.stroke,f=c.enable?c.width:0,l=this.getStrokeWidthScale(c.style),v=c.align,b=f*l*v;return e.set(0<=u?+o:-o,0<=s?+a:-a,Math.abs(u)+b,Math.abs(s)+b,f,l,v)},i.prototype.contains=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbs(i.x,i.y,i.width,i.height,i.strokeWidth,i.strokeScale,i.strokeAlign)?this:this.containsText(t,n)||this.containsChildren(t,n)},i.prototype.containsText=function(t,n){var i=this.text;if(null!=i.atlas){var r=i.world;if(null!=r){var e=this.transform.internalTransform,u=e.a*t+e.c*n+e.tx-r[0],s=e.b*t+e.d*n+e.ty-r[1],h=r[2]*u+r[3]*s,o=r[4]*u+r[5]*s;if(0<=h&&h<=r[6]&&0<=o&&o<=r[7])return this}}return null},i.prototype.containsChildren=function(t,n){for(var i=this.children,r=i.length-1;0<=r;--r){var e=i[r];e.updateTransform();var u=e.transform.localTransform,s=u.a,h=u.b,o=u.c,a=u.d,c=u.tx,f=u.ty,l=1/(s*a-o*h),v=(a*t-o*n+f*o-c*a)*l,b=(s*n-h*t-f*s+c*h)*l,d=e.contains(v,b);if(null!=d)return d}return null},i.prototype.containsBBox=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbsBBox(i.x,i.y,i.width,i.height)},i.prototype.containsAbs=function(t,n,i,r,e,u,s){return this.containsAbsBBox(t,n,i,r)},i.prototype.containsAbsBBox=function(t,n,i,r){return Ot(t,n,i,r)},i.prototype.select=function(t){return!1},i.prototype.toGlobal=function(t,n,i){return!0!==i&&this.updateTransform(),n.copyFrom(t),this.transform.worldTransform.apply(n,n),n},i.prototype.toLocal=function(n,i,r,e){return!0!==e&&this.updateTransform(),void 0===r&&(r=new t.Point),r.copyFrom(n),this.transform.worldTransform.applyInverse(r,r),r},i.prototype.getBounds=function(n,i,r){!0!==i&&this.updateTransform();var e=this._bounds||new t.Rectangle;this._bounds=e;var u=this.transform.getWorldId();return u!==this.at&&(this.at=u,this.wt(this.transform.worldTransform,n,e)),r.copyFrom(e),r},i.prototype.getBoundsInternal=function(n,i,r){!0!==i&&this.updateTransform();var e=this.Ot||new t.Rectangle;this.Ot=e;var u=this.transform.getLocalIdCurrent();return u!==this.ct&&(this.ct=u,this.wt(this.transform.internalTransform,n,e)),r.copyFrom(e),r},i.prototype.getBoundsLocal=function(n,i,r){!0!==i&&this.updateTransform();var e=this.Dt||new t.Rectangle;this.Dt=e;var u=this.transform.getLocalIdCurrent();return u!==this.ft&&(this.ft=u,this.wt(this.transform.localTransform,n,e)),r.copyFrom(e),r},i.prototype.getBoundsSize=function(){return this.size},i.prototype.wt=function(t,n,i){var r=this.transform.pivot,e=r.x,u=r.y,s=this.getBoundsSize(),h=.5*s.x,o=.5*s.y,a=t.a,c=t.b,f=t.c,l=t.d,v=-h+e,b=-o+u,d=a*v+f*b,g=c*v+l*b,m=a*(v=+h+e)+f*(b=-o+u),w=c*v+l*b,p=a*(v=-h+e)+f*(b=+o+u),O=c*v+l*b,D=a*(v=+h+e)+f*(b=+o+u),E=c*v+l*b,M=Math.min(d,m,p,D),S=Math.min(g,w,O,E),T=Math.max(d,m,p,D),j=Math.max(g,w,O,E);return i.x=M+t.tx,i.y=S+t.ty,i.width=T-M,i.height=j-S,i},i.prototype.destroy=function(){for(var t=this.children,n=t.length-1;0<=n;--n)t[n].destroy();t.length=0},i.prototype.onStateChange=function(t,n){var r;null===(r=this.runtime)||void 0===r||r.onStateChange(this,t,n);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}},Object.defineProperty(i.prototype,"state",{get:function(){var t=this,n=this.Et;return null==n&&(n=new vt((function(n,i){t.onStateChange(n,i)})),this.Et=n),n},enumerable:!1,configurable:!0}),i.prototype.focus=function(){return this.setFocused(!0),this},i.prototype.blur=function(){return this.setFocused(!1),this},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=rt.getLayer(this);n&&n.getFocusController().set(this,t)}},i.prototype.onKeyDown=function(t){var n=this.runtime;return!!n&&n.onKeyDown(this,t)},i.prototype.onKeyUp=function(t){var n=this.runtime;return!!n&&n.onKeyUp(this,t)},i.prototype.update=function(t){var n=this.runtime;n&&n.update(this,t)},i.prototype.onRender=function(t,n){var i=this.runtime;i&&i.onRender(this,t,n)},i.prototype.updateRecursively=function(t){this.update(t);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].update(t)},i.prototype.copy=function(t,n){if(void 0===n&&(n=st.ALL),this.id=t.id,this.uuid=t.uuid,n&st.TRANSFORM){var r=this.transform,e=t.transform;r.position.copyFrom(e.position),r.rotation=e.rotation,r.skew.copyFrom(e.skew),r.pivot.copyFrom(e.pivot),r.scale.copyFrom(e.scale)}if(n&st.SIZE&&this.size.copyFrom(t.size),n&st.STYLE&&(this.fill.copy(t.fill),this.stroke.copy(t.stroke),this.text.copy(t.text),this.radius=t.radius,this.corner=t.corner),n&st.DATA&&this.data.copy(t.data),n&st.IMAGE&&(this.image=t.image),n&st.ACTION&&(this.action.clearAndAddAll(t.action.values),this.interactive=t.interactive,this.cursor=t.cursor,this.shortcut=t.shortcut),n&st.POINTS){var u=t.points;if(null!=u){var s=this.points;null!=s&&s.copy(u)}}if(n&st.STATE&&this.state.lock(!1).copy(t.state).unlock(),n&st.CONNECTOR)if(t instanceof i){var h=t.vt;h?this.connector.copy(h):(o=this.vt)&&o.clear()}else{var o;(o=this.vt)&&o.clear()}return this},i}(t.utils.EventEmitter),Et=function(){function t(t,n,i,r,e,u,s,h){this.O=t,this.S=n,this.T=i,this.j=r,this.Mt=e,this.St=u,this.Tt=s,this._=h}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.Mt},set:function(t){this.Mt!==t&&(this.Mt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return this.Tt},set:function(t){this.Tt!==t&&(this.Tt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this._},set:function(t){this._!==t&&(this._=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width,t.align,t.side,t.style)},t.prototype.set=function(t,n,i,r,e,u,s){var h=!1;void 0!==t&&this.S!==t&&(this.S=t,h=!0),void 0!==n&&this.T!==n&&(this.T=n,h=!0),void 0!==i&&this.j!==i&&(this.j=i,h=!0),void 0!==r&&this.Mt!==r&&(this.Mt=r,h=!0),void 0!==e&&this.St!==e&&(this.St=e,h=!0),void 0!==u&&this.Tt!==u&&(this.Tt=u,h=!0),void 0!==s&&this._!==s&&(this._=s,h=!0),h&&this.O.updateUploaded()},t.prototype.clone=function(){return new t(this.O,this.S,this.T,this.j,this.Mt,this.St,this.Tt,this._)},t.prototype.toObject=function(){return{enable:this.S,color:this.T,alpha:this.j,width:this.Mt,align:this.St,side:this.Tt,style:this._}},t.prototype.serialize=function(t){var n="["+(this.S?1:0)+","+this.T+","+this.j+","+this.Mt+","+this.St+","+this.Tt+","+this._+"]";return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getStroke(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3],r[4],r[5],r[6]);else{var e=JSON.parse(i[t]);n.setStroke(t,e),this.set(!!e[0],e[1],e[2],e[3],e[4],e[5],e[6])}}},t}(),Mt={ASCENDING:0,DESCENDING:1},St={NONE:0,FROM:1,TO:2,FROM_TO:3},Tt=function(){function t(){this.jt=St.NONE,this.Nt=0,this.It=1}return Object.defineProperty(t.prototype,"type",{get:function(){return this.jt},set:function(t){if(this.jt!==t){this.jt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.Nt},set:function(t){if(this.Nt!==t){this.Nt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.It},set:function(t){if(this.It!==t){this.It=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;if(void 0!==t&&void 0!==n)if(null!==t&&null!==n){var r=this.jt|St.FROM|St.TO;this.jt===r&&this.Nt===t&&this.It===n||(this.jt=r,this.Nt=t,this.It=n,i=!0)}else null!==t?(r=(this.jt|St.FROM)&~St.TO,this.jt===r&&this.Nt===t||(this.jt=r,this.Nt=t,i=!0)):null!==n?(r=(this.jt|St.TO)&~St.FROM,this.jt===r&&this.Nt===t||(this.jt=r,this.It=n,i=!0)):(r=this.jt&~(St.TO|St.FROM),this.jt!==r&&(this.jt=r,i=!0));else void 0!==t?null!==t?(r=this.jt|St.FROM,this.jt===r&&this.Nt===t||(this.jt=r,this.Nt=t,i=!0)):(r=this.jt&~St.FROM,this.jt!==r&&(this.jt=r,i=!0)):void 0!==n&&(null!==n?(r=this.jt|St.TO,this.jt===r&&this.It===n||(this.jt=r,this.It=n,i=!0)):(r=this.jt&~St.TO,this.jt!==r&&(this.jt=r,i=!0)));if(i){var e=this.parent;null!=e&&(e.isChanged=!0)}return i},t.prototype.normalize=function(t){var n=this.jt,i=this.Nt,r=this.It;switch(n){case St.FROM_TO:return(t-i)/(r-i);case St.FROM:return t-i;case St.TO:return r-t;case St.NONE:default:return t}},t.prototype.isEquals=function(t){return this.jt===t.type&&this.Nt===t.from&&this.It===t.to},t.prototype.copy=function(t){return this.Ct(t.type,t.from,t.to)},t.prototype.Ct=function(t,n,i){var r=!1;if(this.jt!==t&&(this.jt=t,r=!0),this.Nt!==n&&(this.Nt=n,r=!0),this.It!==i&&(this.It=i,r=!0),r){var e=this.parent;null!=e&&(e.isChanged=!0)}return this},t.prototype.toObject=function(){return{type:this.type,from:this.from,to:this.to}},t.prototype.serialize=function(t){var n="["+this.jt+","+this.Nt+","+this.It+"]";return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getRange(t);if(null!=r)this.Ct(r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setRange(t,e),this.Ct(e[0],e[1],e[2])}}},t}(),jt=function(t,n){return t-n},Nt=function(){function t(){this.id="",this.initial="",this.format="",this.range=new Tt,this.At=0,this.Rt=0,this.yt=0,this.kt=Mt.ASCENDING}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.range.parent=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.At},set:function(t){var n=this.formatter;null!=n&&(t=n(t));var i=this.yt;if(i<=0){if(this.At!==t){this.At=t;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.L;null==e&&(e=[],this.L=e),this.At=t;var u=this.kt;u===Mt.ASCENDING?e.push(t):e.unshift(t);var s=e.length-i;if(0<s)if(u===Mt.ASCENDING)for(var h=0;h<s;++h)e.shift();else e.length=i;var o=this.parent;null!=o&&(o.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){return this.range.normalize(this.At)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.L;return null==t&&(t=[],this.L=t),t},set:function(t){if(0<t.length){var n=this.yt;if(n<=0){var i=t[t.length-1];if(null!=(u=this.formatter)&&(i=u(i)),this.At!==i){this.At=i;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.L;null==e&&(e=[],this.L=e);var u,s=this.kt;if(null!=(u=this.formatter))if(this.At=u(t[t.length-1]),s===Mt.ASCENDING)for(var h=0,o=t.length;h<o;++h)e.push(u(t[h]));else for(h=0,o=t.length;h<o;++h)e.unshift(u(t[h]));else if(this.At=t[t.length-1],s===Mt.ASCENDING)for(h=0,o=t.length;h<o;++h)e.push(t[h]);else for(h=0,o=t.length;h<o;++h)e.unshift(t[h]);var a=e.length-n;if(0<a)if(s===Mt.ASCENDING)for(h=0;h<a;++h)e.shift();else e.length=n;var c=this.parent;null!=c&&(c.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.Rt},set:function(t){var n=this.yt;if(n<=0){if(this.Rt!==t){this.Rt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.Lt;null==r&&(r=[],this.Lt=r),this.Rt=t;var e=this.kt;e===Mt.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===Mt.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"times",{get:function(){var t=this.Lt;return null==t&&(t=[],this.Lt=t),t},set:function(t){if(0<t.length){var n=this.yt;if(n<=0){var i=t[t.length-1];if(this.Rt!==i){this.Rt=i;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.Lt;null==e&&(e=[],this.Lt=e),this.Rt=t[t.length-1];var u=this.kt;if(u===Mt.ASCENDING)for(var s=0,h=t.length;s<h;++s)e.push(t[s]);else for(s=0,h=t.length;s<h;++s)e.unshift(t[s]);var o=e.length-n;if(0<o)if(u===Mt.ASCENDING)for(s=0;s<o;++s)e.shift();else e.length=n;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){return this.yt},set:function(t){if(this.yt<t)this.yt=t;else if(t<this.yt){this.yt=t;var n=!1,i=this.kt,r=this.L;if(null!=r&&0<(u=r.length-t)){if(i===Mt.ASCENDING)for(var e=0;e<u;++e)r.shift();else r.length=t;n=!0}var u,s=this.Lt;if(null!=s&&0<(u=s.length-t)){if(i===Mt.ASCENDING)for(e=0;e<u;++e)s.shift();else s.length=t;n=!0}if(n){var h=this.parent;null!=h&&(h.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.kt},set:function(t){this.kt=t},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){var n=!1,i=this.L;null!=i&&0<=t&&t<i.length&&(i.splice(t,1),n=!0);var r=this.Lt;if(null!=r&&0<=t&&t<r.length&&(r.splice(t,1),n=!0),n){var e=this.parent;null!=e&&(e.isChanged=!0)}},t.prototype.removeAll=function(t){var n=!1,i=this.L,r=this.Lt,e=t.slice(0).sort(jt);if(null!=i)if(null!=r)for(var u=e.length-1;0<=u;--u)0<=(s=e[u])&&(s<i.length&&(i.splice(s,1),n=!0),s<r.length&&(r.splice(s,1),n=!0));else for(u=e.length-1;0<=u;--u)0<=(s=e[u])&&s<i.length&&(i.splice(s,1),n=!0);else if(null!=r)for(u=e.length-1;0<=u;--u){var s;0<=(s=e[u])&&s<r.length&&(r.splice(s,1),n=!0)}if(n){var h=this.parent;null!=h&&(h.isChanged=!0)}},t.prototype.clear=function(){var t=!1,n=this.L;null!=n&&(n.length=0,t=!0);var i=this.Lt;if(null!=i&&(i.length=0,t=!0),t){var r=this.parent;null!=r&&(r.isChanged=!0)}},t.prototype.copy=function(t){return this.id=t.id,this.initial=t.initial,this.format=t.format,this.formatter=t.formatter,this.range.copy(t.range),this.At=t.value,this.Rt=t.time,this.yt=t.capacity,this},t.prototype.isEquals=function(t){return this.id===t.id&&this.initial===t.initial&&this.formatter===t.formatter&&this.range.isEquals(t.range)},t.prototype.serialize=function(t){var n=t.addData(this.id),i=t.addResource(this.initial),r=t.addResource(this.format.trim()),e=this.range.serialize(t);return t.addResource("["+n+","+i+","+r+","+e+","+this.yt+","+this.kt+"]")},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getDataValue(t);null==r&&(r=JSON.parse(i[t]),n.setDataValue(t,r)),this.id=n.data[r[0]]||"",this.initial=i[r[1]]||"",this.format=i[r[2]]||"",this.range.deserialize(r[3],n),this.yt=r[4],this.kt=r[5]}return this},t}(),It=function(){function t(){this.L=[],this.xt=!0}return Object.defineProperty(t.prototype,"values",{get:function(){return this.L},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.xt},set:function(t){this.xt=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.L;return 0<t.length?t[0].id:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"initial",{get:function(){var t=this.L;return 0<t.length?t[0].initial:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){var t=this.L;return 0<t.length?t[0].format:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.L;return 0<t.length?t[0].range:null!=P?P:P=new Tt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this.L;return 0<t.length?t[0].value:0},set:function(t){var n=this.L;0<n.length&&(n[0].value=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){var t=this.L;return 0<t.length?t[0].nvalue:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){var t=this.L;return 0<t.length?t[0].time:0},set:function(t){var n=this.L;0<n.length&&(n[0].time=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){var t=this.L;return 0<t.length?t[0].capacity:0},set:function(t){var n=this.L;0<n.length&&(n[0].capacity=t)},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.L;t.parent=this,void 0===n?i.push(t):i.splice(n,0,t)},t.prototype.set=function(t,n){var i=this.L;if(0<=t&&t<i.length){var r=i[t];return n.parent=this,i[t]=n,r.parent=void 0,r}return null},t.prototype.remove=function(t){var n=this.L;0<=t&&t<n.length&&(n.splice(t,1)[0].parent=void 0)},t.prototype.indexOf=function(t){for(var n=this.L,i=n.length,r=0;r<i;++r)if(n[r]===t)return r;for(r=0;r<i;++r)if(n[r].isEquals(t))return r;for(r=0;r<i;++r)if(n[r].id===t.id)return r;return-1},t.prototype.get=function(t){var n=this.L;return 0<=t&&t<n.length?n[t]:null},t.prototype.size=function(){return this.L.length},t.prototype.swap=function(t,n){var i=this.L,r=i[n];i[n]=i[t],i[t]=r},t.prototype.copy=function(t){var n=this.L;n.length=0;for(var i=0,r=t.size();i<r;++i){var e=t.get(i);if(null!=e){var u=(new Nt).copy(e);u.parent=this,n.push(u)}}return this},t.prototype.serialize=function(t){var n=this.L;if(n.length<=0)return t.addResource("[]");for(var i="["+n[0].serialize(t),r=1,e=n.length;r<e;++r)i+=","+n[r].serialize(t);return i+="]",t.addResource(i)},t.prototype.deserialize=function(t,n){if(0<=t&&t<n.resources.length){var i=n.getData(t);null==i&&(i=JSON.parse(n.resources[t]),n.setData(t,i));var r=this.L;r.length=0;for(var e=i.length,u=0;u<e;++u){var s=i[u],h=new Nt;h.parent=this,h.deserialize(s,n),r.push(h)}}},t}(),Ct=function(){function t(t,n,i){this.O=t,this.Bt=n,this.Pt=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Bt},set:function(t){this.Bt!==t&&(this.Bt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.Pt},set:function(t){this.Pt!==t&&(this.Pt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Bt!==t&&(this.Bt=t,i=!0),null!=n&&this.Pt!==n&&(this.Pt=n,i=!0),i&&this.O.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Bt,vertical:this.Pt}},t.prototype.serialize=function(t){return t.addResource("["+this.Bt+","+this.Pt+"]")},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getAlign(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setAlign(t,e),this.set(e[0],e[1])}}},t}(),At=function(){function t(t,n,i){this.O=t,this.Bt=n,this.Pt=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Bt},set:function(t){this.Bt!==t&&(this.Bt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.Pt},set:function(t){this.Pt!==t&&(this.Pt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Bt!==t&&(this.Bt=t,i=!0),null!=n&&this.Pt!==n&&(this.Pt=n,i=!0),i&&this.O.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Bt,vertical:this.Pt}},t.prototype.serialize=function(t){return t.addResource("["+this.Bt+","+this.Pt+"]")},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getMargin(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setMargin(t,e),this.set(e[0],e[1])}}},t}(),Rt=function(){function t(t,n,i,r,e){this.O=t,this.S=n,this.T=i,this.j=r,this.Mt=e}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.Mt},set:function(t){this.Mt!==t&&(this.Mt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width)},t.prototype.set=function(t,n,i,r){var e=!1;void 0!==t&&this.S!==t&&(this.S=t,e=!0),void 0!==n&&this.T!==n&&(this.T=n,e=!0),void 0!==i&&this.j!==i&&(this.j=i,e=!0),void 0!==r&&this.Mt!==r&&(this.Mt=r,e=!0),e&&this.O.updateUploaded()},t.prototype.clone=function(){return new t(this.O,this.S,this.T,this.j,this.Mt)},t.prototype.toObject=function(){return{enable:this.S,color:this.T,alpha:this.j,width:this.Mt}},t.prototype.serialize=function(t){var n="["+(this.S?1:0)+","+this.T+","+this.j+","+this.Mt+"]";return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getTextOutline(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3]);else{var e=JSON.parse(i[t]);n.setTextOutline(t,e),this.set(!!e[0],e[1],e[2],e[3])}}},t}(),yt=function(){function t(t,n,i,r,e,u){this.O=t,this.S=!0,this.At=n,this.T=i,this.j=r,this.Ft=e,this.I=u,this.Ut=d.NORMAL,this.align=new Ct(t,m.CENTER,w.MIDDLE),this.offset=new At(t,0,0),this._=g.NORMAL,this.spacing=new At(t,0,0),this.outline=new Rt(t,!1,16777215,1,.5),this.Gt=p.LEFT_TO_RIGHT,this.padding=new At(t,10,10),this.zt=!1}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.At},set:function(t){if(this.At!==t){this.At=t;var n=this.O,i=n.uploaded;if(null==i||!i.isCompatible(n))return this.atlas=void 0,void n.toDirty();var r=this.atlas,e=r&&r.characters;if(null==e)return this.atlas=void 0,void n.toDirty();for(var u=0,s=t.length;u<s;++u)if(!(t[u]in e))return this.atlas=void 0,void n.toDirty();n.updateUploaded()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){return this.Ft},set:function(t){this.Ft!==t&&(this.Ft=t,this.O.toDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.I},set:function(t){this.I!==t&&(this.I=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return this.Ut},set:function(t){this.Ut!==t&&(this.Ut=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this._},set:function(t){this._!==t&&(this._=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this.Gt},set:function(t){this.Gt!==t&&(this.Gt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){return this.zt},set:function(t){this.zt!==t&&(this.zt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return t&&(this.set(t.value,t.color,t.alpha,t.family,t.size,t.weight,t.style,t.direction,t.clipping),this.align.copy(t.align),this.offset.copy(t.offset),this.outline.copy(t.outline),this.spacing.copy(t.spacing),this.padding.copy(t.padding)),this},t.prototype.set=function(t,n,i,r,e,u,s,h,o){var a=!1,c=!1;return null!=t&&this.At!==t&&(this.At=t,a=!0),null!=n&&this.T!==n&&(this.T=n,c=!0),null!=i&&this.j!==i&&(this.j=i,c=!0),null!=r&&this.Ft!==r&&(this.Ft=r,a=!0),null!=e&&this.I!==e&&(this.I=e,c=!0),null!=u&&this.Ut!==u&&(this.Ut=u,c=!0),null!=s&&this._!==s&&(this._=s,c=!0),null!=h&&this.Gt!==h&&(this.Gt=h,c=!0),null!=o&&this.zt!==o&&(this.zt=o,c=!0),a?this.O.toDirty():c&&this.O.updateUploaded(),this},t.prototype.toObject=function(){return{value:this.At,color:this.T,alpha:this.j,family:this.Ft,size:this.I,weight:this.Ut,align:this.align.toObject(),offset:this.offset.toObject(),style:this._,outline:this.outline.toObject(),direction:this.Gt,spacing:this.spacing.toObject(),padding:this.padding.toObject(),clipping:this.zt}},t.prototype.serialize=function(t){var n=t.addResource(this.At),i=t.addResource(this.Ft),r=this.align.serialize(t),e=this.offset.serialize(t),u=this.outline.serialize(t),s=this.spacing.serialize(t),h=this.padding.serialize(t),o="["+n+","+this.T+","+this.j+","+i+","+this.I+","+this.Ut+","+r+","+e+","+this._+","+u+","+s+","+this.Gt+","+h+","+(this.zt?1:0)+"]";return t.addResource(o)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getText(t);null==r&&(r=JSON.parse(i[t]),n.setText(t,r)),this.set(i[r[0]]||"",r[1],r[2],i[r[3]]||"auto",r[4],r[5],r[8],r[11],!!r[13]),this.align.deserialize(r[6],n),this.offset.deserialize(r[7],n),this.outline.deserialize(r[9],n),this.spacing.deserialize(r[10],n),this.padding.deserialize(r[12],n)}},t}(),kt=function(n){function i(t){var i=n.call(this,t)||this;i.size=i.newSize(),i.fill=i.newFill(),i.stroke=i.newStroke(),i.Ht=Y.RADIUS,i.Vt=it.ALL;var r=new It;return i.data=r,i.tag=r,i.text=i.newText(),i.cursor=Y.CURSOR,i}return _(i,n),i.prototype.newSize=function(){var n=this;return new t.ObservablePoint((function(){n.onSizeChange()}),void 0,Y.SIZE_X,Y.SIZE_Y)},i.prototype.newFill=function(){return new Z(this,!0,Y.FILL_COLOR,Y.FILL_ALPHA)},i.prototype.newStroke=function(){return new Et(this,!0,Y.STROKE_COLOR,Y.STROKE_ALPHA,Y.STROKE_WIDTH,Y.STROKE_ALIGN,Y.STROKE_SIDE,Y.STROKE_STYLE)},i.prototype.newText=function(){return new yt(this,Y.TEXT_VALUE,Y.TEXT_COLOR,Y.TEXT_ALPHA,Y.TEXT_FAMILY,Y.TEXT_SIZE)},Object.defineProperty(i.prototype,"corner",{get:function(){return this.Vt},set:function(t){this.Vt!==t&&(this.Vt=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"radius",{get:function(){return this.Ht},set:function(t){this.Ht!==t&&(this.Ht=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"image",{get:function(){return this.bt},set:function(t){if(this.bt!==t){null!=t?(this.bt=t,this.imageSrc=t.src):(this.bt=void 0,this.imageSrc=void 0);var n=this.parent;null!=n&&n.toDirty()}},enumerable:!1,configurable:!0}),i}(Dt),Lt=function(t,n,i,r,e,u,s){if(t.fill.enable){if((c=n*n)*(o=e*e)+(f=i*i)*(h=r*r)<=h*o)return!0}else if(0<u){var h,o,a=u*s,c=n*n,f=i*i,l=Math.max(0,r-a),v=Math.max(0,e-a),b=l*l,d=v*v;if(b*d<=c*d+f*b&&c*(o=e*e)+f*(h=r*r)<=h*o)return!0}return!1},xt={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_OR_LEFT:9,TOP_OR_RIGHT:3,BOTTOM_OR_LEFT:12,BOTTOM_OR_RIGHT:6,ALL:15},Bt=function(t,n,i,r,e,u,s){if(Ot(n,i,r,e)){if(t.fill.enable)return!0;var h=t.stroke.side;if(0<u&&h!==xt.NONE){var o=u*s,a=Math.max(0,r-o),c=Math.max(0,e-o);if(!Ot(n,i,a,c))return!(h!==xt.ALL&&!(n<=-a?i<=-c?h&xt.TOP_OR_LEFT:+c<=i?h&xt.BOTTOM_OR_LEFT:h&xt.LEFT:+a<=n?i<=-c?h&xt.TOP_OR_RIGHT:+c<=i?h&xt.BOTTOM_OR_RIGHT:h&xt.RIGHT:i<=-c?h&xt.TOP:+c<=i&&h&xt.BOTTOM))}}return!1},_t=function(t,n,i,r,e){return+i*t+r-n<=0&&-i*t+r-n<=0&&n<=e},Pt=function(t,n,i,r,e,u,s){var h=2*e/r;if(t.fill.enable){if(_t(n,i,h,-e,+e))return!0}else if(0<u){var o=u*s;if(_t(n,i,h,-e,+e)){var a=2*r*e/(r+Math.sqrt(r*r+4*e*e)),c=e-a,f=c+(-e-c)*Math.max(0,a-o)/a;if(!_t(n,i,h,f,e-o))return!0}}return!1},Ft=function(t,n,i){return.5*(i+t*n)},Ut=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getHitTestSize=function(n){var i=this.gt.formatted;if("boundary"in i){var r=i.boundary;n.width=Math.max(Math.abs(r[0]),Math.abs(r[2])),n.height=Math.max(Math.abs(r[1]),Math.abs(r[3]))}else t.prototype.getHitTestSize.call(this,n);return n},n.prototype.toMarkerSize=function(t){var n=0,i=t.getMarker();if(i){var r=i.head;if(r.type!==J.NONE){var e=r.size;n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y)))}var u=i.tail;u.type!==J.NONE&&(e=u.size,n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y))))}return n},n.prototype.containsAbsMarker=function(t,n,i,r,e,u){var s=t.type;if(s!==J.NONE){var h=t.transform,o=h.a,a=h.b,c=h.c,f=h.d,l=h.tx,v=h.ty,b=1/(o*f-c*a),d=(f*n-c*i+v*c-l*f)*b,g=(o*i-a*n-v*o+l*a)*b,m=t.size,w=.5*m.x,p=.5*m.y;w<0&&(w=-w,n=-n),p<0&&(p=-p,i=-i);var O=r*e*u;switch(w+=O,p+=O,s){case J.CIRCLE:return Lt(this,d,g,w,p,r,e);case J.TRIANGLE:return Pt(this,d,g,w,p,r,e);case J.RECTANGLE:return Bt(this,d,g,w,p,r,e)}}return!1},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=this.gt,o=Ft(e,u,0),a=o+this.toMarkerSize(h);if(this.containsAbsBBox(t,n,i+a,r+a)){var c=h.getMarker();if(c){if(this.containsAbsMarker(c.head,t,n,e,u,s))return!0;if(this.containsAbsMarker(c.tail,t,n,e,u,s))return!0}var f=this.calcHitPointAbsHitTester;return h.calcHitPointAbs(t,n,i,r,o,null,f,null)}return!1},n.prototype.calcHitPart=function(t,n){var i=this.toHitTestData(t,n),r=i.strokeWidth,e=i.strokeScale,u=Ft(r,e,0),s=this.gt,h=u+this.toMarkerSize(s),o=i.x,a=i.y,c=i.width,f=i.height;if(this.containsAbsBBox(o,a,c+h,f+h)){var l=s.getMarker();if(l){var v=i.strokeAlign;if(this.containsAbsMarker(l.head,o,a,r,e,v))return nt.MARKER_HEAD;if(this.containsAbsMarker(l.tail,o,a,r,e,v))return nt.MARKER_TAIL}var b=this.calcHitPointAbsHitTester;if(s.calcHitPointAbs(o,a,c,f,u,null,b,null))return nt.LINE}return this.containsText(t,n)?nt.TEXT:this.containsChildren(t,n)?nt.CHILDREN:nt.NONE},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.gt,h=this.toHitTestData(t,n),o=(i||Ft)(h.strokeWidth,h.strokeScale,0);return!!this.containsAbsBBox(h.x,h.y,h.width+o,h.height+o)&&s.calcHitPointAbs(h.x,h.y,h.width,h.height,o,r,e,u)},n.prototype.calcHitPointAbsHitTester=function(t,n,i,r,e,u,s,h,o){var a=e-i,c=u-r,f=t-i,l=n-r,v=a*a+c*c,b=a*f+c*l,d=f*f+l*l;if(1e-4<v){var g=Math.max(0,Math.min(1,b/v));if(v*g*g-2*b*g+d<h*h)return!0}return!1},n}(kt),Gt=function(t){function n(n){void 0===n&&(n=r.BAR);var i=t.call(this,n)||this;return i.gt=new tt(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbsBBox=function(n,i,r,e){var u=Math.max(0,this.gt.size);return t.prototype.containsAbsBBox.call(this,n,i,r+u,e+u)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.gt.serialize(n),i},n}(Ut),zt=function(t){function n(n,i){var r=t.call(this,n,i,4,2)||this;return r.pointsId=NaN,r.pointsStyle=U.NONE,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset,i=this.indexOffset;t.updateClippings(),t.updateIndices(),c(t.clippings,n),f(t.indices,n,i)},n.prototype.update=function(t,n){this.updateVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexStepAndColorFill=function(t,n){if(n instanceof Gt){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.stroke,h=s.enable?s.width:0,o=s.style,a=h!==this.strokeWidth||o!==this.strokeStyle,c=H(n),f=this.transformLocalId!==c,v=n.points,b=v.id,d=b!==this.pointsId,g=v.style,m=g!==this.pointsStyle;(u||f||a||d||m)&&(this.sizeX=r,this.sizeY=e,this.strokeWidth=h,this.strokeStyle=o,this.transformLocalId=c,this.pointsId=b,this.pointsStyle=g,d&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),l(t.vertices,t.steps,t.colorFills,this.vertexOffset,v.values,v.size,h,o,n.transform.internalTransform))}},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),v(t.uvs,this.vertexOffset,X(i)))},n}(z),Ht=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=NaN,this.size=NaN,this.family="auto",this.value="",this.texture=null,this.textureTransformId=NaN,this.color=NaN,this.alpha=NaN,this.weight=NaN,this.style=NaN,this.alignHorizontal=NaN,this.alignVertical=NaN,this.offsetHorizontal=NaN,this.offsetVertical=NaN,this.outlineWidth=NaN,this.outlineColor=NaN,this.outlineAlpha=NaN,this.spacingHorizontal=NaN,this.spacingVertical=NaN,this.direction=NaN,this.paddingHorizontal=NaN,this.paddingVertical=NaN,this.clipping=!1}return n.prototype.init=function(t){var n=this.vertexCount;if(0<n){var i=this.vertexOffset;t.updateClippings(),S(t.clippings,i,n),t.updateIndices(),T(t.indices,i,this.indexOffset,this.indexCount)}},n.prototype.isCompatible=function(t){return 4*M(t)===this.vertexCount},n.prototype.update=function(t,n){if(0<this.vertexCount){var i=n.text.atlas;null!=i&&(this.updateVertex(t,n,i),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateStep(t,n))}},n.prototype.updateVertex=function(n,i,r){var e=i.size,u=e.x,s=e.y,h=u!==this.sizeX||s!==this.sizeY,o=H(i),a=this.transformLocalId!==o,c=i.text,f=c.size,l=c.family,v=c.value,b=c.style,d=c.align.horizontal,g=c.align.vertical,m=c.offset.horizontal,w=c.offset.vertical,p=c.spacing.horizontal,O=c.spacing.vertical,D=c.direction,E=c.padding.horizontal,M=c.padding.vertical,S=c.clipping,T=c.texture||t.Texture.WHITE,j=W(T),N=v!==this.value||l!==this.family,I=f!==this.size,A=b!==this.style,R=d!==this.alignHorizontal||g!==this.alignVertical,y=m!==this.offsetHorizontal||w!==this.offsetVertical,k=p!==this.spacingHorizontal||O!==this.spacingVertical||E!==this.paddingHorizontal||M!==this.paddingVertical,L=D!==this.direction,x=this.clipping!==S,B=T!==this.texture||j!==this.textureTransformId;if(h||a||N||I||A||R||y||k||L||x||B){this.size=f,this.family=l,this.value=v,this.style=b,this.alignHorizontal=d,this.alignVertical=g,this.offsetHorizontal=m,this.offsetVertical=w,this.spacingHorizontal=p,this.spacingVertical=O,this.direction=D,this.paddingHorizontal=E,this.paddingVertical=M,this.clipping=S,this.texture=T,this.textureTransformId=j,I&&(this.weight=NaN),n.updateVertices(),n.updateUvs();var _=i.size,P=c.world;null==P&&(P=[0,0,0,0,0,0,0,0],c.world=P),C(n.vertices,n.uvs,this.vertexOffset,this.vertexCount,0,0,_.x,_.y,r,f,v,b,d,g,m,w,p,O,D,E,M,S,P,X(T),i.transform.internalTransform)}},n.prototype.updateColorFill=function(t,n){var i=n.text,r=i.color,e=n.visible&&i.enable?i.alpha:0;r===this.color&&e===this.alpha||(this.color=r,this.alpha=e,t.updateColorFills(),G(r,e,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.text,r=i.outline,e=r.color,u=n.visible&&i.enable?r.alpha:0;e===this.outlineColor&&u===this.outlineAlpha||(this.outlineColor=e,this.outlineAlpha=u,t.updateColorStrokes(),G(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.updateStep=function(t,n){var i=n.text,r=i.outline,e=r.enable?r.width:0,u=i.weight;u===this.weight&&e===this.outlineWidth||(this.weight=u,this.outlineWidth=e,t.updateSteps(),j(t.steps,this.vertexOffset,this.vertexCount,i.atlas,i.size,e,u))},n.prototype.buildUnit=function(n){if(0<this.vertexCount){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;r!==n.baseTexture&&(n.baseTexture=r,n.push(i,this.indexOffset))}},n}(),Vt=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=4+h,c=2+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new zt(i,r),new Ht(i+4,r+2,h,o)]).init(n):null},Wt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Xt=function(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)},Kt=function(){function t(){}return t.isActivateKey=function(t){return"Space"===t.key||"Enter"===t.key||32===t.which||13===t.which},t.isArrowUpKey=function(t){return"ArrowUp"===t.key||38===t.which},t.isArrowDownKey=function(t){return"ArrowDown"===t.key||40===t.which},t.isArrowLeftKey=function(t){return"ArrowLeft"===t.key||37===t.which},t.isArrowRightKey=function(t){return"ArrowRight"===t.key||39===t.which},t.isCancelKey=function(t){return"Esc"===t.key||27===t.which},t.isFocusKey=function(t){return"Tab"===t.key||9===t.which},t.isUndoKey=function(t){return t.ctrlKey&&("z"===t.key||90===t.which)},t.isRedoKey=function(t){return t.ctrlKey&&("y"===t.key||89===t.which)},t.isSaveKey=function(t){return t.ctrlKey&&!t.shiftKey&&("s"===t.key||83===t.which)},t.isSaveAsKey=function(t){return t.ctrlKey&&t.shiftKey&&("S"===t.key||83===t.which)},t.isDeleteKey=function(t){return"Delete"===t.key||46===t.which},t.isSelectAllKey=function(t){return t.ctrlKey&&!t.shiftKey&&("a"===t.key||65===t.which)},t.isOkKey=function(t){return"Enter"===t.key||13===t.which},t.getFocusDirection=function(t){return!0!==t.shiftKey},t.toShortcut=function(t){if(at(t)){var n,i=t,r=i.indexOf("->"),e=void 0;0<=r?(e=i.substring(0,r).trim(),n=i.substring(r+2).trim()):e=i.trim();var u=e.toLowerCase().split("+");return function(t){var n=t.key;if(n.length<=1){t.shift&&(t.key=n.toUpperCase());var i=n.charCodeAt(0);t.which=97<=i&&i<=122?i-32:i}else switch(n){case"Enter":t.which=13;break;case"Space":t.key=" ",t.which=32;break;case"Escape":t.which=27;break;case"F1":t.which=112;break;case"F2":t.which=113;break;case"F3":t.which=114;break;case"F4":t.which=115;break;case"F5":t.which=116;break;case"F6":t.which=117;break;case"F7":t.which=118;break;case"F8":t.which=119;break;case"F9":t.which=120;break;case"F10":t.which=121;break;case"F11":t.which=122;break;case"F12":t.which=123;break;case"CapsLock":t.shift?t.which=20:t.which=240;break;case"ArrowUp":t.which=38;break;case"ArrowDown":t.which=40;break;case"ArrowLeft":t.which=37;break;case"ArrowRight":t.which=39;break;case"Insert":t.which=45;break;case"Delete":t.which=46;break;case"PageUp":t.which=33;break;case"PageDown":t.which=34;break;case"Backspace":t.which=8;break;case";":t.which=187;break;case"Pause":t.which=19;break;case"ScrollLock":t.which=145;break;case"Tab":t.which=9}return t}({alt:0<=u.indexOf("alt"),ctrl:0<=u.indexOf("ctrl"),shift:0<=u.indexOf("shift"),key:u[u.length-1],which:0,event:n})}return t},t.toString=function(t){var n=[];return t.ctrl&&n.push("Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),n.push(t.key.toUpperCase()),n.join("+")},t.on=function(t,n,i){var r=this.toShortcut(n);document.body.addEventListener("keydown",(function(n){n.altKey!==r.alt||n.ctrlKey!==r.ctrl||n.shiftKey!==r.shift||n.key!==r.key&&n.which!==r.which||(t.state.isActionable&&(null!=r.event?t.emit(r.event):null!=i&&i(n)),n.preventDefault())}))},t.moveFocusVertically=function(n,i,r){if(i.state.isActionable){var e=t.isArrowUpKey(n),u=t.isArrowDownKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocusHorizontally=function(n,i,r){if(i.state.isActionable){var e=t.isArrowLeftKey(n),u=t.isArrowRightKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocus=function(t,n,i){var r,e=null!==(r=null==i?void 0:i.picked)&&void 0!==r?r:rt.getLayer(n);if(e){var u=e.getFocusController(),s=u.get();if(null!=s){var h=u.find(s,!1,s.state.isFocusRoot||t,t,n);if(null!=h)return u.focus(h),!0}}return!1},t}(),Yt={NONE:0,POSITION_X:1,POSITION_Y:2,POSITION:3,ROTATION:4,COLOR_FILL:8,COLOR_STROKE:16,COLOR_FILL_AND_STROKE:24,COLOR_TEXT:32,COLOR_TEXT_OUTLINE:64,COLOR:120,VISIBILITY:128,HEIGHT:256,WIDTH:512,SIZE:768,TEXT:1024,CURSOR:2048},Jt=function(){function n(n){var i=n.transform,r=i.position;this.x=r.x,this.y=r.y;var e=n.size;this.size=new t.Point(e.x,e.y),this.rotation=i.rotation,this.actions=[],this.fill=n.fill.toObject(),this.stroke=n.stroke.toObject(),this.text=n.text.toObject(),this.cursor=n.cursor,this.reset=Yt.NONE,this.written=Yt.NONE,this.effect=NaN,this.isStateChanged=!1,this.interactive=!1}return n.prototype.initialize=function(t){t.disallowUploadedUpdate(),this.onInitialize(t),t.allowUploadedUpdate()},n.prototype.onInitialize=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].initialize(t,this)},n.prototype.isActionable=function(){return 0<this.actions.length},n.prototype.onClick=function(t,n){var i=t.state;i.isActionable&&(i.isClicked=!0)},n.prototype.onDblClick=function(t,n,i){for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onDblClick(t,this,n,i);return!1},n.prototype.onOver=function(t,n){t.state.isHovered=!0},n.prototype.onOut=function(t,n){t.state.isHovered=!1},n.prototype.onDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onDowning(t,this,n);if(!t.state.isDown){t.state.addAll(lt.DOWN,ht.PRESSED);var u=rt.getLayer(t);if(u){var s=u.getFocusController();s.focus(s.findParent(t))}}for(r=0,e=i.length;r<e;++r)i[r].onDown(t,this,n)},n.prototype.onUp=function(t,n){var i=t.state;i.isUp||i.set(lt.UP,ht.PRESSED)},n.prototype.onUpOutside=function(t,n){t.state.isPressed=!1},n.prototype.onMove=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onMove(t,this,n)},n.prototype.onKeyDown=function(t,n){return Kt.isActivateKey(n)&&this.onDown(t,n),!1},n.prototype.onKeyUp=function(t,n){if(Kt.isActivateKey(n)){var i=t.state,r=i.isUp;this.onUp(t,n),!r&&i.isUp&&this.onClick(t,n)}return!1},n.prototype.onStateChange=function(t,n,i){this.isStateChanged=!0,rt.update(t),n.isFocused?i.isFocused||this.onFocus(t):i.isFocused&&this.onBlur(t)},n.prototype.onFocus=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onFocus(t,this)},n.prototype.onBlur=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onBlur(t,this)},n.prototype.update=function(t,n){var i=t.data,r=this.effect<=n;(i.isChanged||this.isStateChanged||r)&&(r&&(this.effect=NaN),t.disallowUploadedUpdate(),this.onUpdate(t,n),t.allowUploadedUpdate(),t.state.removeAll(lt.CLICKED,lt.DOWN,lt.UP,lt.ACTIVATED,lt.DEACTIVATED),this.isStateChanged=!1,i.isChanged=!1)},n.prototype.onRender=function(t,n,i){for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRender(t,this,n,i);this.update(t,n)},n.prototype.onUpdate=function(t,n){var i=this.actions;if(0<i.length){this.written=Yt.NONE;for(var r=0,e=i.length;r<e;++r)i[r].execute(t,this,n);this.doReset(t)}},n.prototype.doReset=function(t){var n=~this.written&this.reset;if(n!==Yt.NONE){if(n&Yt.POSITION_X&&(t.transform.position.x=this.x),n&Yt.POSITION_Y&&(t.transform.position.y=this.y),n&Yt.VISIBILITY&&(t.visible=!0),n&Yt.COLOR_FILL){var i=this.fill;t.fill.set(void 0,i.color,i.alpha)}if(n&Yt.COLOR_STROKE){var r=this.stroke;t.stroke.set(void 0,r.color,r.alpha)}if(n&Yt.COLOR_TEXT){var e=this.text;t.text.set(void 0,e.color,e.alpha)}if(n&Yt.COLOR_TEXT_OUTLINE){var u=this.text.outline;t.text.outline.set(void 0,u.color,u.alpha)}n&Yt.HEIGHT&&(t.size.y=this.size.y),n&Yt.WIDTH&&(t.size.x=this.size.x),n&Yt.ROTATION&&(t.transform.rotation=this.rotation),n&Yt.TEXT&&(t.text.value=this.text.value),n&Yt.CURSOR&&(t.cursor=this.cursor)}},n}(),Zt=function(){function t(){}return t.toBaseFill=function(t,n){return(n.written&Yt.COLOR_FILL?t:n).fill},t.toBaseStroke=function(t,n){return(n.written&Yt.COLOR_STROKE?t:n).stroke},t.toBaseText=function(t,n){return(n.written&Yt.COLOR_TEXT?t:n).text},t.toBaseTextOutline=function(t,n){return(n.written&Yt.COLOR_TEXT_OUTLINE?t:n).text.outline},t}(),qt=function(){function t(){}return t.from=function(t,n,i,r,e,u){if(t.trim().length<=0)return i;try{var s="try{with( shape ) {with( state ) {"+(e?"var result = ("+t+");return (result != null ? "+n+"(result) : null);":"return "+n+"("+t+");")+"}}} catch( e ) {return "+r+";}";return null==u?Function("shape","time",s):Function("shape","time",u,s)}catch(t){return i}},t.ofNumberOrNull=function(t){return this.from(t,"Number",this.NULL,"null",!0)},t.ofStringOrNull=function(t){return this.from(t,"String",this.NULL,"null",!0)},t.ofUnknown=function(t){return this.from(t,"",this.NULL,"null",!1)},t.ofNumber=function(t){return this.from(t,"Number",this.ZERO,"0",!1)},t.ofNumberOrOne=function(t){return this.from(t,"Number",this.ONE,"1",!1)},t.ofNumberOrOneHundred=function(t){return this.from(t,"Number",this.ONE_HUNDRED,"100",!1)},t.ofString=function(t){return this.from(t,"String",this.EMPTY,'""',!1)},t.ofBoolean=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrTrue=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrFalse=function(t){return this.from(t,"Boolean",this.FALSE,"false",!1)},t.ofElementOrNull=function(t){return this.from(t,"",void 0,"null",!1,"container")},t.NULL=function(){return null},t.ZERO=function(){return 0},t.ONE=function(){return 1},t.ONE_HUNDRED=function(){return 100},t.EMPTY=function(){return""},t.TRUE=function(){return!0},t.FALSE=function(){return!1},t}(),$t=function(){function t(t){this.reset=t||Yt.NONE}return t.prototype.initialize=function(t,n){},t.prototype.execute=function(t,n,i){},t.prototype.onFocus=function(t,n){},t.prototype.onBlur=function(t,n){},t.prototype.onDowning=function(t,n,i){},t.prototype.onDown=function(t,n,i){},t.prototype.onMove=function(t,n,i){},t.prototype.onDblClick=function(t,n,i,r){},t.prototype.onRender=function(t,n,i,r){},t}(),Qt=function(t){function n(n,i){var r=t.call(this,i)||this;return r.condition=qt.ofBoolean(n.condition),r}return _(n,t),n}($t),tn=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.interval=n.interval,r}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.interval,e=r<<1,u=i%e;u<r?(this.toOff(t,n),n.effect=i+(r-u)):(this.toOn(t,n),n.effect=i+(e-u))}},n.prototype.toOn=function(t,n){},n.prototype.toOff=function(t,n){},n}(Qt),nn=function(t){function n(n){return t.call(this,n,Yt.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=Zt.toBaseFill(t,n);t.fill.set(void 0,wt.brighten(i.color,.5),i.alpha);var r=Zt.toBaseStroke(t,n);t.stroke.set(void 0,wt.brighten(r.color,.5),r.alpha);var e=Zt.toBaseText(t,n);t.text.set(void 0,wt.brighten(e.color,.5),e.alpha);var u=Zt.toBaseTextOutline(t,n);t.text.outline.set(void 0,wt.brighten(u.color,.5),u.alpha),n.written|=this.reset},n}(tn),rn=function(t){function n(n){var i=t.call(this,n,Yt.COLOR_FILL)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.fill.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(tn),en=function(t){function n(n){var i=t.call(this,n,Yt.COLOR_STROKE)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.stroke.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(tn),un=function(t){function n(n){return t.call(this,n,Yt.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=Zt.toBaseFill(t,n);t.fill.set(void 0,wt.darken(i.color,.5),i.alpha);var r=Zt.toBaseStroke(t,n);t.stroke.set(void 0,wt.darken(r.color,.5),r.alpha);var e=Zt.toBaseText(t,n);t.text.set(void 0,wt.darken(e.color,.5),e.alpha);var u=Zt.toBaseTextOutline(t,n);t.text.outline.set(void 0,wt.darken(u.color,.5),u.alpha),n.written|=this.reset},n}(tn),sn=function(t){function n(n){return t.call(this,n,Yt.COLOR_FILL_AND_STROKE)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=Zt.toBaseFill(t,n);t.fill.set(void 0,i.color,.5*i.alpha);var r=Zt.toBaseStroke(t,n);t.stroke.set(void 0,r.color,.5*r.alpha),n.written|=this.reset},n}(tn),hn=function(t){function n(n){return t.call(this,n,Yt.VISIBILITY)||this}return _(n,t),n.prototype.toOn=function(t,n){t.visible=!0,n.written|=this.reset},n.prototype.toOff=function(t,n){t.visible=!1,n.written|=this.reset},n}(tn),on={VISIBILITY:0,BRIGHTEN:1,DARKEN:2,OPACITY:3,COLOR_FILL:4,COLOR_STROKE:5},an=function(){function t(t,n){this.type=t,this.condition=n}return t.prototype.isEquals=function(t){return this.type===t.type&&this.condition===t.condition},t.prototype.toLabel=function(){return K.getInstance().get("EShapeActionValue").toLabel(this)},t}(),cn=function(t){function n(n,i,r){var e=t.call(this,n,i)||this;return e.subtype=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.subtype===i.subtype},n}(an),fn={SHOW_HIDE:0,BLINK:1,TRANSFORM:2,OPEN:3,EMIT_EVENT:4,CHANGE_COLOR_LEGACY:5,CHANGE_TEXT:6,CHANGE_CURSOR:7,MISC:8,CHANGE_COLOR:9},ln=function(){function t(){}return t.toResource=function(t,n,i){if(0<=t&&t<n.length){var r=n[t];if(Xt(r)&&0<=r&&r<i.length)return i[r]}return""},t}(),vn=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.BLINK,i,n)||this;return s.interval=r,s.color=e,s.alpha=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.interval===i.interval&&this.color===i.color&&this.alpha===i.alpha},n.prototype.toRuntime=function(){switch(this.subtype){case on.BRIGHTEN:return new nn(this);case on.COLOR_FILL:return new rn(this);case on.COLOR_STROKE:return new en(this);case on.DARKEN:return new un(this);case on.OPACITY:return new sn(this);case on.VISIBILITY:return new hn(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.interval+","+this.color+","+this.alpha+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources);return new n(t[2],r,t[3],t[4],t[5])},n}(cn),bn=function(){function t(){}return t.blend=function(t,n,i){var r=Math.max(0,Math.min(1,i));return Math.max(0,Math.min(1,t*(1-r)+n*r))},t}(),dn=function(t){function n(n){return t.call(this,n,n.subtype<<3)||this}return _(n,t),n.prototype.set=function(t,n,i,r,e,u){var s=this.reset;if(null!=r){if(null!=e)if(null!=u){if(s&Yt.COLOR_FILL){var h=Zt.toBaseFill(t,n);t.fill.set(void 0,wt.blend(h.color,r,u),bn.blend(h.alpha,e,u))}s&Yt.COLOR_STROKE&&(h=Zt.toBaseStroke(t,n),t.stroke.set(void 0,wt.blend(h.color,r,u),bn.blend(h.alpha,e,u))),s&Yt.COLOR_TEXT&&(h=Zt.toBaseText(t,n),t.text.set(void 0,wt.blend(h.color,r,u),bn.blend(h.alpha,e,u))),s&Yt.COLOR_TEXT_OUTLINE&&(h=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,wt.blend(h.color,r,u),bn.blend(h.alpha,e,u)))}else s&Yt.COLOR_FILL&&t.fill.set(void 0,r,e),s&Yt.COLOR_STROKE&&t.stroke.set(void 0,r,e),s&Yt.COLOR_TEXT&&t.text.set(void 0,r,e),s&Yt.COLOR_TEXT_OUTLINE&&t.text.outline.set(void 0,r,e);else null!=u?(s&Yt.COLOR_FILL&&(h=Zt.toBaseFill(t,n),t.fill.set(void 0,wt.blend(h.color,r,u),h.alpha)),s&Yt.COLOR_STROKE&&(h=Zt.toBaseStroke(t,n),t.stroke.set(void 0,wt.blend(h.color,r,u),h.alpha)),s&Yt.COLOR_TEXT&&(h=Zt.toBaseText(t,n),t.text.set(void 0,wt.blend(h.color,r,u),h.alpha)),s&Yt.COLOR_TEXT_OUTLINE&&(h=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,wt.blend(h.color,r,u),h.alpha))):(s&Yt.COLOR_FILL&&(h=Zt.toBaseFill(t,n),t.fill.set(void 0,r,h.alpha)),s&Yt.COLOR_STROKE&&(h=Zt.toBaseStroke(t,n),t.stroke.set(void 0,r,h.alpha)),s&Yt.COLOR_TEXT&&(h=Zt.toBaseText(t,n),t.text.set(void 0,r,h.alpha)),s&Yt.COLOR_TEXT_OUTLINE&&(h=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,r,h.alpha)));n.written|=s}else null!=e&&(null!=u?(s&Yt.COLOR_FILL&&(h=Zt.toBaseFill(t,n),t.fill.set(void 0,h.color,bn.blend(h.alpha,e,u))),s&Yt.COLOR_STROKE&&(h=Zt.toBaseStroke(t,n),t.stroke.set(void 0,h.color,bn.blend(h.alpha,e,u))),s&Yt.COLOR_TEXT&&(h=Zt.toBaseText(t,n),t.text.set(void 0,h.color,bn.blend(h.alpha,e,u))),s&Yt.COLOR_TEXT_OUTLINE&&(h=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,bn.blend(h.alpha,e,u)))):(s&Yt.COLOR_FILL&&(h=Zt.toBaseFill(t,n),t.fill.set(void 0,h.color,e)),s&Yt.COLOR_STROKE&&(h=Zt.toBaseStroke(t,n),t.stroke.set(void 0,h.color,e)),s&Yt.COLOR_TEXT&&(h=Zt.toBaseText(t,n),t.text.set(void 0,h.color,e)),s&Yt.COLOR_TEXT_OUTLINE&&(h=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,e))),n.written|=s)},n}(Qt),gn={COLOR_AND_ALPHA:0,COLOR:1,ALPHA:2,CODE:3,BRIGHTNESS:4},mn=function(t){function n(n){var i=t.call(this,n)||this;switch(n.target){case gn.COLOR:i.color=n.color,i.alpha=null;break;case gn.ALPHA:i.color=null,i.alpha=n.alpha;break;default:i.color=n.color,i.alpha=n.alpha}return i.blend=qt.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.color,e=this.alpha,u=this.blend(t,i);this.set(t,n,i,r,e,u)}},n}(dn),wn={NONE:0,FILL:1,STROKE:2,TEXT:4,TEXT_OUTLINE:8,FILL_AND_STROKE:3,ALL:15},pn={FILL:0,STROKE:1,FILL_AND_STROKE:2,TEXT:3,TEXT_OUTLINE:4,ALL:5},On=function(){function t(){}return t.from=function(t){if(t[0]===fn.CHANGE_COLOR)return t[2];switch(t[2]){case pn.FILL:return wn.FILL;case pn.STROKE:return wn.STROKE;case pn.FILL_AND_STROKE:return wn.FILL_AND_STROKE;case pn.TEXT:return wn.TEXT;case pn.TEXT_OUTLINE:return wn.TEXT_OUTLINE;case pn.ALL:return wn.ALL}},t.unpack=function(t){var n=[];return t&wn.FILL&&n.push(wn.FILL),t&wn.STROKE&&n.push(wn.STROKE),t&wn.TEXT&&n.push(wn.TEXT),t&wn.TEXT_OUTLINE&&n.push(wn.TEXT_OUTLINE),n},t.pack=function(t){for(var n=wn.NONE,i=0,r=t.length;i<r;++i)n|=t[i];return n},t}(),Dn=function(t){function n(n,i,r,e,u,s){var h=t.call(this,fn.CHANGE_COLOR,i,n)||this;return h.target=r,h.color=e,h.alpha=u,h.blend=s,h}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new mn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.blend);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.target+","+this.color+","+this.alpha+","+i+"]")},n.deserialize=function(t,i){var r=On.from(t),e=ln.toResource(1,t,i.resources),u=ln.toResource(6,t,i.resources);return new n(r,e,t[3],t[4],t[5],u)},n}(cn),En=function(t){function n(n){var i=t.call(this,n)||this;return i.brightness=qt.ofNumberOrNull(n.brightness),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.brightness(t,i);this.set(t,n,i,r)}},n.prototype.set=function(t,n,i,r){var e=this.reset;if(null!=r){var u=this.toAdjusted;if(e&Yt.COLOR_FILL){var s=Zt.toBaseFill(t,n);t.fill.set(void 0,u(s.color,r),s.alpha)}e&Yt.COLOR_STROKE&&(s=Zt.toBaseStroke(t,n),t.stroke.set(void 0,u(s.color,r),s.alpha)),e&Yt.COLOR_TEXT&&(s=Zt.toBaseText(t,n),t.text.set(void 0,u(s.color,r),s.alpha)),e&Yt.COLOR_TEXT_OUTLINE&&(s=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,u(s.color,r),s.alpha)),n.written|=e}},n.prototype.toAdjusted=function(t,n){return 0<=n?wt.brighten(t,+n):wt.darken(t,-n)},n}(dn),Mn=function(t){function n(n,i,r){var e=t.call(this,fn.CHANGE_COLOR,i,n)||this;return e.brightness=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.brightness===i.brightness},n.prototype.toRuntime=function(){return new En(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=gn.BRIGHTNESS,r=t.addResource(this.brightness);return t.addResource("["+this.type+","+n+","+this.subtype+","+i+","+r+"]")},n.deserialize=function(t,i){return new n(On.from(t),ln.toResource(1,t,i.resources),ln.toResource(4,t,i.resources))},n}(cn),Sn=function(t){function n(n){var i=t.call(this,n)||this;return i.color=qt.ofNumberOrNull(n.color),i.alpha=qt.ofNumberOrNull(n.alpha),i.blend=qt.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.color(t,i),e=this.alpha(t,i),u=this.blend(t,i);this.set(t,n,i,r,e,u)}},n}(dn),Tn=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.CHANGE_COLOR,i,n)||this;return s.color=r,s.alpha=e,s.blend=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new Sn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=gn.CODE,r=t.addResource(this.color),e=t.addResource(this.alpha),u=t.addResource(this.blend);return t.addResource("["+this.type+","+n+","+this.subtype+","+i+","+r+","+e+","+u+"]")},n.deserialize=function(t,i){return new n(On.from(t),ln.toResource(1,t,i.resources),ln.toResource(4,t,i.resources),ln.toResource(5,t,i.resources),ln.toResource(6,t,i.resources))},n}(cn),jn=function(t){function n(n){var i=t.call(this,n,Yt.CURSOR)||this;return i.name=qt.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.name(t,i);null!=r&&(t.cursor=r,n.written|=this.reset)}},n}(Qt),Nn=function(t){function n(n,i){var r=t.call(this,fn.CHANGE_CURSOR,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new jn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("["+this.type+","+n+","+i+"]")},n.deserialize=function(t,i){return new n(ln.toResource(1,t,i.resources),ln.toResource(2,t,i.resources))},n}(an),In=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"AM":"PM"},t}(),Cn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"am":"pm"},t}(),An=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getDate())},t}(),Rn=function(){function t(){}return t.prototype.format=function(t,n,i){return""+(0|t)},t}(),yn=function(t){this.precision=null!=t?+t.substring(1,t.length):void 0},kn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toExponential(this.precision)},n}(yn),Ln=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toFixed(this.precision)},n}(yn),xn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){var r=this.toAbs(t,n,i);return r<1e-24?this.Wt(t,1,""):r<1e-21?this.Wt(t,1e24,"y"):r<1e-18?this.Wt(t,1e21,"z"):r<1e-15?this.Wt(t,1e18,"a"):r<1e-12?this.Wt(t,1e15,"f"):r<1e-9?this.Wt(t,1e12,"p"):r<1e-6?this.Wt(t,1e9,"n"):r<.001?this.Wt(t,1e6,"μ"):r<1?this.Wt(t,1e3,"m"):r<1e3?this.Wt(t,1,""):r<1e6?this.Wt(t,.001,"k"):r<1e9?this.Wt(t,1e-6,"M"):r<1e12?this.Wt(t,1e-9,"G"):r<1e15?this.Wt(t,1e-12,"T"):r<1e18?this.Wt(t,1e-15,"P"):r<1e21?this.Wt(t,1e-18,"E"):r<1e24?this.Wt(t,1e-21,"Z"):this.Wt(t,1e-24,"Y")},n.prototype.toAbs=function(t,n,i){return Math.abs(t)},n.prototype.Wt=function(t,n,i){return""+(t*n).toFixed(this.precision)+i},n}(yn),Bn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toPrecision(this.precision)},n}(yn),_n=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours())},t}(),Pn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours()%12)},t}(),Fn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMonth()+1)},t}(),Un=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMinutes())},t}(),Gn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMilliseconds())},t}(),zn=function(){function t(){}return t.prototype.format=function(t,n,i){return(100*t|0)+"%"},t}(),Hn=function(){function t(){}return t.prototype.format=function(t,n,i){return(0|t)+"%"},t}(),Vn=function(){function t(t,n,i){this.length=t,this.character=n,this.node=i}return t.prototype.format=function(t,n,i){return mt(this.node.format(t,n,i),this.length,this.character)},t}(),Wn=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"===r[0]?"("+r.substring(1,r.length)+")":r},t}(),Xn=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?"+"+r:r},t}(),Kn=function(){function t(){}return t.prototype.format=function(t,n,i){return Math.round(100*t)+"%"},t}(),Yn=function(){function t(){}return t.prototype.format=function(t,n,i){return Math.round(t)+"%"},t}(),Jn=function(){function t(t,n,i,r,e,u,s){this.Y=t,this.M=n,this.D=i,this.H=r,this.m=e,this.s=u,this.mi=s}return t.prototype.format=function(t,n,i){return n<1e3?this.s.format(t,n,i)+"."+this.mi.format(t,n,i):n<6e4?this.m.format(t,n,i)+":"+this.s.format(t,n,i):n<36e5?this.H.format(t,n,i)+":"+this.m.format(t,n,i):n<864e5?this.M.format(t,n,i)+"/"+this.D.format(t,n,i)+" "+this.H.format(t,n,i):n<2592e6?this.M.format(t,n,i)+"/"+this.D.format(t,n,i):this.Y.format(t,n,i)+"/"+this.M.format(t,n,i)},t}(),Zn=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?" "+r:r},t}(),qn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toAbs=function(t,n,i){return Math.abs(n)},n}(xn),$n=function(){function t(t){this.str=t}return t.prototype.format=function(t,n,i){return this.str},t}(),Qn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear())},t}(),ti=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear()%100)},t}(),ni=function(){function t(){}return t.prototype.format=function(t,n,i){var r=i.getTimezoneOffset();return(r<=0?"+":"-")+mt(String(Math.floor(Math.abs(r)/60)),2,"0")+":"+mt(String(Math.floor(Math.abs(r)%60)),2,"0")},t}(),ii=function(){function t(){}return t.prototype.format=function(t,n,i){return""+Math.round(t)},t}(),ri=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getSeconds())},t}(),ei=void 0,ui=function(t,n,i){switch(t){case"_":return new Vn(n," ",i);case"-":return i;default:return new Vn(n,"0",i)}},si=function(t,n){switch(t){case"_":return new Zn(n);case"+":return new Xn(n);case"(":return new Wn(n);default:return n}},hi=function(){function t(t){var n=function(t){for(var n=0,i=!1,r=[],e=function(){var t=ei;return t?t.lastIndex=0:ei=t=/%(0|_|-|\+|\()?(\.\d+)?(Y(?:MD?)?|y(?:MD?)?|MD?|D|H(?:ms?)?|h(?:ms?)?|m(?:i|s)?|a|A|s(?:s?i|dt)?|z|%|f(?:si)?|e|g|d|r(?:d|p)|p|P|RP)/g,t}();;){var u=e.exec(t);if(null==u){n<t.length&&r.push(new $n(t.substring(n,t.length)));break}var s=u.index;n<s&&r.push(new $n(t.substring(n,s))),n=s+u[0].length;var h=u[0],o=u[1],a=u[2];switch(u[3]){case"Y":i=!0,r.push(new Qn);break;case"YM":i=!0,r.push(new Qn,new $n("/"),ui(o,2,new Fn));break;case"YMD":i=!0,r.push(new Qn,new $n("/"),ui(o,2,new Fn),new $n("/"),ui(o,2,new An));break;case"y":i=!0,r.push(ui(o,2,new ti));break;case"yM":i=!0,r.push(ui(o,2,new ti),new $n("/"),ui(o,2,new Fn));break;case"yMD":r.push(ui(o,2,new ti),new $n("/"),ui(o,2,new Fn),new $n("/"),ui(o,2,new An));break;case"M":i=!0,r.push(ui(o,2,new Fn));break;case"MD":i=!0,r.push(ui(o,2,new Fn),new $n("/"),ui(o,2,new An));break;case"D":i=!0,r.push(ui(o,2,new An));break;case"H":i=!0,r.push(ui(o,2,new _n));break;case"Hm":i=!0,r.push(ui(o,2,new _n),new $n(":"),ui(o,2,new Un));break;case"Hms":i=!0,r.push(ui(o,2,new _n),new $n(":"),ui(o,2,new Un),new $n(":"),ui(o,2,new ri));break;case"h":i=!0,r.push(ui(o,2,new Pn));break;case"hm":i=!0,r.push(ui(o,2,new Pn),new $n(":"),ui(o,2,new Un));break;case"hms":i=!0,r.push(ui(o,2,new Pn),new $n(":"),ui(o,2,new Un),new $n(":"),ui(o,2,new ri));break;case"m":i=!0,r.push(ui(o,2,new Un));break;case"ms":i=!0,r.push(ui(o,2,new Un),new $n(":"),ui(o,2,new ri));break;case"mi":i=!0,r.push(ui(o,3,new Gn));break;case"a":i=!0,r.push(new Cn);break;case"A":i=!0,r.push(new In);break;case"s":i=!0,r.push(ui(o,2,new ri));break;case"sdt":i=!0,r.push(new Jn(new Qn,ui(o,2,new Fn),ui(o,2,new An),ui(o,2,new _n),ui(o,2,new Un),ui(o,2,new ri),ui(o,3,new Gn)));break;case"z":i=!0,r.push(new ni);break;case"%":r.push(new $n("%"));break;case"f":r.push(si(o,new Ln(a)));break;case"e":r.push(si(o,new kn(a)));break;case"g":r.push(si(o,new Bn(a)));break;case"rd":r.push(si(o,new ii));break;case"d":r.push(si(o,new Rn));break;case"P":r.push(si(o,new zn));break;case"p":r.push(si(o,new Hn));break;case"RP":r.push(si(o,new Kn));break;case"rp":r.push(si(o,new Yn));break;case"fsi":r.push(si(o,new xn(a)));break;case"ssi":r.push(si(o,new qn(a)));break;default:r.push(new $n(h))}}return{nodes:r,date:i}}(t);this.date=n.date,this.nodes=n.nodes}return t.prototype.format=function(n,i){var r=this.nodes,e=t.DATE;null==e&&(e=new Date,t.DATE=e),this.date&&e.setTime(n);for(var u="",s=0,h=r.length;s<h;++s)u+=r[s].format(n,i,e);return u},t}(),oi=function(){function t(){}return t.create=function(t){return new hi(t)},t}(),ai=function(t){function n(n){var i=t.call(this,n,Yt.TEXT)||this;return i.number=qt.ofNumber(n.value),i.formatters=new Map,i}return _(n,t),n.prototype.getFormatter=function(t,n){var i=this.formatters,r=n.text.value,e=i.get(r);return void 0===e&&(e=this.newFormatter(r),i.set(r,e)),e},n.prototype.newFormatter=function(t){return 0<(t=t.trim()).length?oi.create(t):null},n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.number(t,i),e=this.getFormatter(t,n);t.text.value=null!=e?e.format(r,0):String(r),n.written|=this.reset}},n}(Qt),ci=function(t){function n(n){var i=t.call(this,n,Yt.TEXT)||this;return i.text=qt.ofString(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i)&&(t.text.value=this.text(t,i),n.written|=this.reset)},n}(Qt),fi={TEXT:0,NUMBER:1},li=function(t){function n(n,i,r){var e=t.call(this,fn.CHANGE_TEXT,i,n)||this;return e.value=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.value===i.value},n.prototype.toRuntime=function(){switch(this.subtype){case fi.TEXT:return new ci(this);case fi.NUMBER:return new ai(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.value);return t.addResource("["+this.type+","+n+","+this.subtype+","+i+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources),e=ln.toResource(3,t,i.resources);return new n(t[2],r,e)},n}(cn),vi=function(){function t(t,n,i){this.Xt=t,this.Kt=i;var r=null==n?void 0:n.background;r&&(this.T=r.color,this.j=r.alpha)}return t.prototype.getTheme=function(){return this.Xt},t.prototype.setTheme=function(t){this.Xt=t},t.prototype.getColor=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBackgroundColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.j;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBackgroundAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.Kt;null!=t&&t()},t}(),bi={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_RIGHT:3,TOP_BOTTOM:5,TOP_LEFT:9,RIGHT_BOTTOM:6,RIGHT_LEFT:10,BOTTOM_LEFT:12,NOT_TOP:14,NOT_RIGHT:13,NOT_BOTTOM:11,NOT_LEFT:7,ALL:15},di=function(t,n){return at(t)?n[t]:t},gi=function(){function t(t,n,i){this.Xt=t,this.Kt=i;var r=null==n?void 0:n.border;r&&(this.T=r.color,this.j=r.alpha,this.Mt=r.width,this.St=r.align,this.Yt=di(r.mask,bi))}return t.prototype.getTheme=function(){return this.Xt},t.prototype.setTheme=function(t){this.Xt=t},t.prototype.getColor=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBorderColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.j;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBorderAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.Mt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBorderWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.Mt},set:function(t){this.Mt!==t&&(this.Mt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.St;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBorderAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.Yt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBorderMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.Yt},set:function(t){this.Yt!==t&&(this.Yt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.Kt;null!=t&&t()},t}(),mi={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},wi=function(){function t(t,n,i){this.Xt=t,this.Kt=i;var r=null==n?void 0:n.corner;r&&(Xt(r)?(this.Ht=r,this.Yt=void 0):(this.Ht=r.radius,this.Yt=di(r.mask,mi)))}return t.prototype.getTheme=function(){return this.Xt},t.prototype.setTheme=function(t){this.Xt=t},t.prototype.getRadius=function(){var t;return null!==(t=this.Ht)&&void 0!==t?t:this.Xt.getCornerRadius()},Object.defineProperty(t.prototype,"radius",{get:function(){return this.Ht},set:function(t){if(this.Ht!==t){this.Ht=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(){var t;return null!==(t=this.Yt)&&void 0!==t?t:this.Xt.getCornerMask()},Object.defineProperty(t.prototype,"mask",{get:function(){return this.Yt},set:function(t){if(this.Yt!==t){this.Yt=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;this.Ht!==t&&(this.Ht=t,i=!0),this.Yt!==n&&(this.Yt=n,i=!0);var r=this.Kt;i&&null!=r&&r()},t}(),pi={NONE:0,SELF:1,CHILDREN:2,BOTH:3},Oi=function(){function t(t,n,i){this.Xt=t,this.Kt=i;var r=null==n?void 0:n.outline;r&&(this.T=r.color,this.j=r.alpha,this.Mt=r.width,this.Jt=r.offset,this.St=r.align,this.Yt=di(r.mask,bi))}return t.prototype.getTheme=function(){return this.Xt},t.prototype.setTheme=function(t){this.Xt=t},t.prototype.getColor=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){if(this.T!==t){this.T=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.j;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){if(this.j!==t){this.j=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.Mt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.Mt},set:function(t){if(this.Mt!==t){this.Mt=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getOffset=function(t){var n=this.Jt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineOffset(t)},Object.defineProperty(t.prototype,"offset",{get:function(){return this.Jt},set:function(t){if(this.Jt!==t){this.Jt=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.St;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.St},set:function(t){if(this.St!==t){this.St=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.Yt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.Yt},set:function(t){if(this.Yt!==t){this.Yt=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t}(),Di=function(){function t(t,n,i){this.Xt=t,this.Kt=i;var r=null==n?void 0:n.padding;null!=r&&(Xt(r)?(this.Zt=r,this.qt=r,this.$t=r,this.Qt=r):(this.Zt=r.left,this.qt=r.top,this.$t=r.right,this.Qt=r.bottom))}return t.prototype.getTheme=function(){return this.Xt},t.prototype.setTheme=function(t){this.Xt=t},t.prototype.getCallback=function(){return this.Kt},t.prototype.getLeft=function(){var t;return null!==(t=this.Zt)&&void 0!==t?t:this.Xt.getPaddingLeft()},Object.defineProperty(t.prototype,"left",{get:function(){return this.Zt},set:function(t){this.Zt!==t&&(this.Zt=t,null!=this.Kt&&this.Kt())},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){var t;return null!==(t=this.qt)&&void 0!==t?t:this.Xt.getPaddingTop()},Object.defineProperty(t.prototype,"top",{get:function(){return this.qt},set:function(t){this.qt!==t&&(this.qt=t,null!=this.Kt&&this.Kt())},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){var t;return null!==(t=this.$t)&&void 0!==t?t:this.Xt.getPaddingRight()},Object.defineProperty(t.prototype,"right",{get:function(){return this.$t},set:function(t){this.$t!==t&&(this.$t=t,null!=this.Kt&&this.Kt())},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){var t;return null!==(t=this.Qt)&&void 0!==t?t:this.Xt.getPaddingBottom()},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.Qt},set:function(t){this.Qt!==t&&(this.Qt=t,null!=this.Kt&&this.Kt())},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r),null!=this.Kt&&this.Kt()},t}(),Ei=function(){function t(t,n){this.tn=t,this.q=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this.tn.x},set:function(t){var n=this.tn,i=n.x;if(i!==t){n.x=t;var r=n.y;this.q(t,r,i,r)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.tn.y},set:function(t){var n=this.tn,i=n.y;if(i!==t){n.y=t;var r=n.x;this.q(r,t,r,i)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=this.tn,r=i.x,e=i.y;return r===t&&e===n||(i.set(t,n),this.q(t,n,r,e)),this},t.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.tn,e=r.x,u=r.y;return e===n&&u===i||(r.copyFrom(t),this.q(n,i,e,u)),this},t.prototype.copyTo=function(t){return t.copyFrom(this.tn)},t.prototype.copy=function(){return this.copyFrom(arguments[0])},t.prototype.clone=function(n){return new t(this.tn,n||this.q)},t.prototype.equals=function(t){return this.tn.equals(t)},t}(),Mi=function(t){function n(n,i,r){var e=t.call(this,n,i,r)||this;return e.Mt=100,e.nn=100,e.rn=0,e.en=mi.NONE,e.un=!0,e.sn=1,e.hn=e.getBuffer("aVertexPosition"),e.an=e.hn.data,e.cn=e.getBuffer("aTextureCoord"),e._uvs=e.cn.data,e.fn=e.getIndex(),e.ln=e.fn.data,e}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.Mt},set:function(t){this.Mt!==t&&(this.Mt=t,this.un=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.nn},set:function(t){this.nn!==t&&(this.nn=t,this.un=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerRadius",{get:function(){return this.rn},set:function(t){this.rn!==t&&(this.rn=t,this.un=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerMask",{get:function(){return this.en},set:function(t){this.en!==t&&(this.en=t,this.un=!0)},enumerable:!1,configurable:!0}),n.prototype.getTables=function(){var t=n.TABLES;return null==t&&(t=this.newTables(n.N),n.TABLES=t),t},n.prototype.newTables=function(t){var n=1/(t-1)*.5;return[this.newTable(t,1,n),this.newTable(t,.5,n),this.newTable(t,0,n),this.newTable(t,1.5,n)]},n.prototype.newTable=function(t,n,i){for(var r=[],e=[],u=Math.PI,s=0,h=n;s<t;s+=1,h-=i){var o=h*u,a=+Math.cos(o),c=-Math.sin(o);r.push(a),e.push(c)}return{cos:r,sin:e}},n.N=4,n}(t.MeshGeometry),Si=function(t){function n(){return t.call(this,new Float32Array(16*Mi.N),new Float32Array(16*Mi.N),new Uint16Array(3*(12*Mi.N-2)))||this}return _(n,t),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a){for(var c=a.cos,f=a.sin,l=c[0],v=f[0],b=c[e-1],d=f[e-1],g=0;g<e;++g){var m=c[g],w=f[g],p=o,O=m*l+w*v;1e-4<O&&(p=Math.min(p,(1/O-1)*h));var D=m*b+w*d;1e-4<D&&(p=Math.min(p,(1/D-1)*h));var E=h+p;t[++i]=u+m*h,t[++i]=s+w*h,t[++i]=u+m*E,t[++i]=s+w*E,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+m),n[++r]=.5*(1+w)}},n.prototype.fillIndices=function(t,n,i,r){for(var e=0;e<r;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2},n.prototype.fillIndicesEnd=function(t,n,i,r){for(var e=0,u=r-1;e<u;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2;t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=2},n.prototype.update=function(t){var n=t.resolution;if(this.un||this.sn!==n){this.un=!1,this.sn=n;var i=this.an,r=this._uvs,e=this.ln,u=this.Mt,s=this.nn,h=Math.min(.5*u,.5*s,this.rn),o=1/n,a=h,c=u-h,f=u,l=h,v=s-h,b=s,d=this.en,g=!(d&mi.TOP_LEFT),m=!(d&mi.TOP_RIGHT),w=!(d&mi.BOTTOM_LEFT),p=!(d&mi.BOTTOM_RIGHT),O=-1,D=-1,E=0,M=-1,S=Mi.N,T=S<<2,j=S<<1,N=6*S,I=this.getTables(),C=I[0],A=I[1],R=I[2],y=I[3];g?this.fillVertices(i,r,O,D,S,a,l,h,o,C):this.fillVertices(i,r,O,D,S,0,0,0,0,C),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,m?this.fillVertices(i,r,O,D,S,c,l,h,o,A):this.fillVertices(i,r,O,D,S,f,0,0,0,A),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,p?this.fillVertices(i,r,O,D,S,c,v,h,o,R):this.fillVertices(i,r,O,D,S,f,b,0,0,R),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,w?this.fillVertices(i,r,O,D,S,a,v,h,o,y):this.fillVertices(i,r,O,D,S,0,b,0,0,y),this.fillIndicesEnd(e,E,M,S),O+=T,D+=T,E+=j,M+=N,E=2;for(var k=1,L=4*S-1;k<L;k+=1,E+=2)e[++M]=0,e[++M]=E,e[++M]=E+2;this.hn.update(),this.cn.update(),this.fn.update()}},n}(Mi),Ti=function(n){function i(i){var r=n.call(this,new Si,new t.MeshMaterial(i))||this;return i.on("update",(function(){rt.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),ji=function(){function t(){}return t.prototype.get=function(t,n){var i=this.vn;return null==i&&((i=new Ti(n.getBackgroundTexture())).parent=t,this.vn=i),i},t.prototype.hide=function(){var t=this.vn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.background,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=this.get(t,r);c.tint=o,c.alpha=a,c.width=n,c.height=i,c.cornerRadius=u,c.cornerMask=s,c.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.vn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.vn)||void 0===t||t.updateTransform()},t}(),Ni=function(t){function n(){var n=t.call(this,new Float32Array(32*Mi.N),new Float32Array(32*Mi.N),new Uint16Array(72*Mi.N))||this;return n.bn=0,n.dn=bi.NONE,n}return _(n,t),Object.defineProperty(n.prototype,"borderWidth",{get:function(){return this.bn},set:function(t){this.bn!==t&&(this.bn=t,this.un=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"borderMask",{get:function(){return this.dn},set:function(t){this.dn!==t&&(this.dn=t,this.un=!0)},enumerable:!1,configurable:!0}),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=.5*a,l=h-f,v=h+f,b=c.cos,d=c.sin,g=b[0],m=d[0],w=b[e-1],p=d[e-1],O=u+(g+w)*l,D=s+(m+p)*l,E=0;E<e;++E){var M=b[E],S=d[E],T=o,j=o,N=M*g+S*m;if(1e-4<N){var I=1/N-1;T=Math.min(T,I*l),j=Math.min(j,I*v)}var C=M*w+S*p;if(1e-4<C){var A=1/C-1;T=Math.min(T,A*l),j=Math.min(j,A*v)}var R=l+T,y=v+j;0<l?(t[++i]=u+M*l,t[++i]=s+S*l,t[++i]=u+M*R,t[++i]=s+S*R):(t[++i]=O,t[++i]=D,t[++i]=O,t[++i]=D),t[++i]=u+M*v,t[++i]=s+S*v,t[++i]=u+M*y,t[++i]=s+S*y,n[++r]=.5*(1+M),n[++r]=.5*(1+S),n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+M),n[++r]=.5*(1+S)}},n.prototype.fillIndices=function(t,n,i,r,e,u){for(var s=0,h=r-1;s<h;++s)t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2;e?u?(t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=1,t[++i]=1,t[++i]=n+1,t[++i]=2,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=2,t[++i]=2,t[++i]=n+1,t[++i]=3,n+=2):(t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2):(t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=2)},n.prototype.update=function(t){var n=t.resolution;if(this.un||this.sn!==n){this.un=!1,this.sn=n;var i=this.an,r=this._uvs,e=this.ln,u=this.Mt,s=this.nn,h=this.bn,o=Math.min(.5*u,.5*s,this.rn),a=1/n,c=o,f=u-o,l=u,v=o,b=s-o,d=s,g=this.dn,m=!(g&bi.TOP),w=!(g&bi.BOTTOM),p=!(g&bi.LEFT),O=!(g&bi.RIGHT),D=this.en,E=!(D&mi.TOP_LEFT),M=!(D&mi.TOP_RIGHT),S=!(D&mi.BOTTOM_LEFT),T=!(D&mi.BOTTOM_RIGHT),j=-1,N=-1,I=0,C=-1,A=Mi.N,R=A<<2,y=A<<3,k=18*A,L=this.getTables(),x=L[0],B=L[1],_=L[2],P=L[3];E?p||m?this.fillVertices(i,r,j,N,A,c,v,o,a,h,x):this.fillVertices(i,r,j,N,A,c,v,o,0,0,x):p||m?this.fillVertices(i,r,j,N,A,0,0,0,0,h,x):this.fillVertices(i,r,j,N,A,0,0,0,0,0,x),this.fillIndices(e,I,C,A,m,!1),j+=y,N+=y,I+=R,C+=k,M?m||O?this.fillVertices(i,r,j,N,A,f,v,o,a,h,B):this.fillVertices(i,r,j,N,A,f,v,o,0,0,B):m||O?this.fillVertices(i,r,j,N,A,l,0,0,0,h,B):this.fillVertices(i,r,j,N,A,l,0,0,0,0,B),this.fillIndices(e,I,C,A,O,!1),j+=y,N+=y,I+=R,C+=k,T?O||w?this.fillVertices(i,r,j,N,A,f,b,o,a,h,_):this.fillVertices(i,r,j,N,A,f,b,o,0,0,_):O||w?this.fillVertices(i,r,j,N,A,l,d,0,0,h,_):this.fillVertices(i,r,j,N,A,l,d,0,0,0,_),this.fillIndices(e,I,C,A,w,!1),j+=y,N+=y,I+=R,C+=k,S?w||p?this.fillVertices(i,r,j,N,A,c,b,o,a,h,P):this.fillVertices(i,r,j,N,A,c,b,o,0,0,P):w||p?this.fillVertices(i,r,j,N,A,0,d,0,0,h,P):this.fillVertices(i,r,j,N,A,0,d,0,0,0,P),this.fillIndices(e,I,C,A,p,!0),j+=y,N+=y,I+=R,C+=k,this.hn.update(),this.cn.update(),this.fn.update()}},n}(Mi),Ii=function(n){function i(i){var r=n.call(this,new Ni,new t.MeshMaterial(i))||this;return i.on("update",(function(){rt.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderWidth",{get:function(){return this.geometry.borderWidth},set:function(t){this.geometry.borderWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderMask",{get:function(){return this.geometry.borderMask},set:function(t){this.geometry.borderMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),Ci=function(){function t(){}return t.prototype.get=function(t,n){var i=this.vn;return null==i&&((i=new Ii(n.getBorderTexture())).parent=t,this.vn=i),i},t.prototype.hide=function(){var t=this.vn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.border,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.vn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.vn)||void 0===t||t.updateTransform()},t}(),Ai=function(){function t(){}return t.prototype.get=function(t,n){var i=this.vn;return null==i&&((i=new Ii(n.getBorderTexture())).parent=t,this.vn=i),i},t.prototype.hide=function(){var t=this.vn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.outline,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=h.getOffset(e)+(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.vn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.vn)||void 0===t||t.updateTransform()},t}(),Ri=function(){function t(t){var n=new ji;this.gn=n,t.snippet.add(n,!0);var i=new Ci;this.mn=i,t.snippet.add(i,!0);var r=new Ai;this.wn=r,t.snippet.add(r,!1),t.reflowable.add(this)}return t.prototype.onReflow=function(t,n,i){var r=t.theme,e=t.state,u=t.corner,s=u.getRadius(),h=u.getMask();this.gn.onReflow(t,n,i,r,e,s,h),this.mn.onReflow(t,n,i,r,e,s,h),this.wn.onReflow(t,n,i,r,e,s,h)},t}(),yi={NONE:0,BEFORE:1,AFTER:2,BOTH:3};!function(t){t[t.OPEN=0]="OPEN",t[t.CLOSE=1]="CLOSE",t[t.PARENSESIS=2]="PARENSESIS",t[t.ADD_OR_PLUS=3]="ADD_OR_PLUS",t[t.SUB_OR_MINUS=4]="SUB_OR_MINUS",t[t.PLUS=5]="PLUS",t[t.MINUS=6]="MINUS",t[t.ADD=7]="ADD",t[t.SUB=8]="SUB",t[t.MUL=9]="MUL",t[t.DIV=10]="DIV",t[t.MIN=11]="MIN",t[t.MAX=12]="MAX",t[t.COMMA=13]="COMMA",t[t.PARENT=14]="PARENT",t[t.SELF=15]="SELF",t[t.PADDING=16]="PADDING",t[t.CURRENT=17]="CURRENT",t[t.NUMBER=18]="NUMBER"}(F||(F={}));var ki,Li={"+":3,"-":4,"*":9,"/":10,"(":0,")":1,",":13,min:11,max:12},xi={"%":14,s:15,p:16,c:17},Bi=function(){function t(t){var n=this.toToken(t),i=0;do{i=this.toParensesis(n,i)}while(i<n.length);if(this.toUnary(n),this.toArithmetic(n,9,10),this.toArithmetic(n,7,8),1===n.length){var r=n[0];if(!Xt(r))return void(this.pn=r)}throw new Error("Failed to parse '"+t+"'")}return t.prototype.toParensesis=function(t,n){for(var i=t.length,r=n;r<i;++r)if(0===t[r]){var e=r,u=2;if(0<r){var s=t[r-1];11!==s&&12!==s||(e-=1,u=s)}for(var h=r+1;h<i;++h){var o=t[h];if(1===o)return t[e]=[u,this.toComma(t,r+1,h)],t.splice(e+1,h-e),e+1;0===o&&(h=this.toParensesis(t,h)-1,i=t.length)}throw new Error("Malformed parensesis")}return i},t.prototype.toCommaOf=function(t,n,i){var r=i-n;if(r<=0)return[18,0];if(r<=1)return t[n];for(var e=[],u=n;u<i;++u)e.push(t[u]);return[2,e]},t.prototype.toComma=function(t,n,i){for(var r=null,e=n,u=n;u<i;++u)13===t[u]&&((r=r||[]).push(this.toCommaOf(t,e,u)),e=u+1);if(e<i){if(null==r){var s=[];for(u=e;u<i;++u)s.push(t[u]);return s}r.push(this.toCommaOf(t,e,i))}return r||[]},t.prototype.toUnaryNode=function(t){Xt(t)||2!==t[0]&&11!==t[0]&&12!==t[0]||this.toUnary(t[1])},t.prototype.toUnary=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(3===r||4===r)if(n<=0||Xt(t[n-1])){if(!(n+1<i)||Xt(t[n+1]))throw new Error("Malformed unary operator");var e=t.splice(n+1,1)[0],u=3===r?5:6;t[n]=[u,e],i=t.length,this.toUnaryNode(e)}else u=3===r?7:8,t[n]=u;else this.toUnaryNode(r),i=t.length}},t.prototype.toArithmeticNode=function(t,n,i){Xt(t)||(2===t[0]||11===t[0]||12===t[0]?this.toArithmetic(t[1],n,i):5===t[0]||6===t[0]?this.toArithmeticNode(t[1],n,i):7!==t[0]&&8!==t[0]&&9!==t[0]&&10!==t[0]||(this.toArithmeticNode(t[1],n,i),this.toArithmeticNode(t[2],n,i)))},t.prototype.toArithmetic=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(u===n||u===i){if(0<r&&r+1<e){var s=t[r-1],h=t[r+1];if(!Xt(s)&&!Xt(h)){t.splice(r,2),t[r-1]=[u,s,h],r-=1,e=t.length,this.toArithmeticNode(s,n,i),this.toArithmeticNode(h,n,i);continue}}throw new Error("Malformed operands for the operator "+u)}this.toArithmeticNode(u,n,i),e=t.length}},t.prototype.toToken=function(n){for(var i=[];;){var r=t.TOKEN_REGEX.exec(n);if(null==r)break;var e=r[0],u=Li[e];if(null!=u)i.push(u);else{var s=parseFloat(e);if(s!=s)throw new Error("Unexpected token '"+e+"' at "+r.index+" in '"+n+"'");var h=xi[e[e.length-1]];null!=h?i.push([h,.01*s]):i.push([18,s])}}return i},t.prototype.evaluate=function(t,n,i,r,e){switch(t[0]){case 2:var u=t[1];return this.evaluate(u[u.length-1],n,i,r,e);case 5:return+this.evaluate(t[1],n,i,r,e);case 6:return-this.evaluate(t[1],n,i,r,e);case 7:return this.evaluate(t[1],n,i,r,e)+this.evaluate(t[2],n,i,r,e);case 8:return this.evaluate(t[1],n,i,r,e)-this.evaluate(t[2],n,i,r,e);case 9:return this.evaluate(t[1],n,i,r,e)*this.evaluate(t[2],n,i,r,e);case 10:return this.evaluate(t[1],n,i,r,e)/this.evaluate(t[2],n,i,r,e);case 11:if(0<t[1].length){for(var s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.min(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case 12:if(0<t[1].length){for(s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.max(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case 14:return t[1]*n;case 15:return t[1]*i;case 16:return t[1]*r;case 17:return t[1]*e;case 18:return t[1]}return 0},t.prototype.calculate=function(t,n,i,r){return this.evaluate(this.pn,t,n,i,r)},t.TOKEN_REGEX=/(?:\+|-|\*|\/|\(|\)|min|max|,|(?:\d+(?:\.\d*)?[%psc]?))/g,t}(),_i=function(t,n){return.5*(t-n)},Pi=function(t,n,i){return i},Fi=function(t){return t},Ui=function(t,n,i){return t-i},Gi=function(){function t(){}return t.position=function(t){if(null==t||Xt(t))return null;if(at(t)){switch(t){case"center":case"CENTER":return _i;case"padding":case"PADDING":return Pi}var n=new Bi(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(ot(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t.size=function(t){if(null==t||Xt(t))return null;if(at(t)){switch(t){case"100%":case"maximized":case"MAXIMIZED":return Fi;case"padding":case"PADDING":return Ui}var n=new Bi(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(ot(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t}(),zi=function(){function t(){}return Object.defineProperty(t,"touchable",{get:function(){return"ontouchstart"in document},enumerable:!1,configurable:!0}),Object.defineProperty(t,"tap",{get:function(){return"pointertap"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"down",{get:function(){return"pointerdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"enter",{get:function(){return"pointerenter"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"leave",{get:function(){return"pointerleave"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"move",{get:function(){return"pointermove"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"out",{get:function(){return"pointerout"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"over",{get:function(){return"pointerover"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"up",{get:function(){return"pointerup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"upoutside",{get:function(){return"pointerupoutside"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cancel",{get:function(){return"pointercancel"},enumerable:!1,configurable:!0}),t.toGlobal=function(t,n,i){if("touches"in t){var r=t.changedTouches,e=r[r.length-1];null!=e?n.mapPositionToPoint(i,e.clientX,e.clientY):n.mapPositionToPoint(i,0,0)}else n.mapPositionToPoint(i,t.clientX,t.clientY);return i},t.isValidDistance=function(t,n,i){var r=t.data.global,e=Math.abs(n-r.x),u=Math.abs(i-r.y),s=this.CLICK_DISTANCE_THRESHOLD;return e<s&&u<s},t.onClick=function(t,n){var i=this,r=!1,e=0,u=0,s=null,h=this.up,o=this.upoutside,a=this.cancel,c=function(){r=!1,s&&(s.off(h,f),s.off(o,l),s.off(a,l),s=null)};t.on("click",(function(t){r&&c(),n(t,!1)}));var f=function(s){r&&(c(),i.contains(t,s.target)&&i.isValidDistance(s,e,u)&&n(s,!0))},l=function(t){r&&c()};t.on(this.down,(function(n){if(r){var i=n.data.global;e=i.x,u=i.y}else{r=!0;var c=n.data.global;e=c.x,u=c.y,s&&(s.off(h,f),s.off(o,l),s.off(a,l),s=null);var v=rt.getLayer(t);v&&((s=v.renderer.plugins.interaction).once(h,f),s.once(o,l),s.once(a,l))}}))},t.onDblClick=function(t,n){var i=this;if(t.addEventListener("dblclick",(function(t){return n(t,!1)})),this.touchable){var r=0,e=0,u=0,s=0;t.addEventListener("touchstart",(function(t){if(0===r||2===r){var n=t.touches,i=n.length;if(i<=0)r=0;else{var s=n.item(i-1);null!=s?(r+=1,e=s.clientX,u=s.clientY):r=0}}else r=0})),t.addEventListener("touchend",(function(t){if(1===r||3===r){var h=t.changedTouches,o=h.length;if(o<=0)r=0;else{var a=h[o-1];if(null!=a){var c=e-a.clientX,f=u-a.clientY;i.CLICK_DISTANCE_THRESHOLD<=Math.abs(c)+Math.abs(f)?r=0:1===r?(s=t.timeStamp,r=2):t.timeStamp-s<i.DBLCLICK_INTERVAL_THRESHOLD?(r=0,n(t,!0)):(s=t.timeStamp,r=2)}else r=0}}else r=0})),t.addEventListener("touchcancel",(function(){r=0}))}},t.contains=function(t,n){for(var i=n;null!=i&&i!==t;)i=i.parent;return i===t},t.CLICK_DISTANCE_THRESHOLD=10,t.DBLCLICK_INTERVAL_THRESHOLD=333,t.LONG_CLICK_THRESHOLD=750,t}(),Hi=function(){function t(){this.On=!1}return Object.defineProperty(t.prototype,"isOff",{get:function(){return!this.On},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOn",{get:function(){return this.On},enumerable:!1,configurable:!0}),t.prototype.toCoordinate=function(t){return this.On?"auto":t},t.prototype.from=function(t){return"auto"===t||"AUTO"===t?(this.On=!0,!0):(this.On=!1,!1)},t}(),Vi=function(){this.width=new Hi,this.height=new Hi},Wi=function(){function t(t){this.O=t,this.Dn=[],this.En=[],this.Mn=!0}return Object.defineProperty(t.prototype,"renderable",{get:function(){return this.Mn},set:function(t){this.Mn=t},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){(n?this.Dn:this.En).push(t),"parent"in t&&(t.parent=this.O)},t.prototype.addAt=function(t,n,i){var r=n?this.Dn:this.En;0===i?r.unshift(t):0<i&&i<r.length?r.splice(i,0,t):r.push(t),"parent"in t&&(t.parent=this.O)},t.prototype.remove=function(t,n){var i=n?this.Dn:this.En,r=i.indexOf(t);0<=r&&(i.splice(r,1),"parent"in t&&(t.parent=null))},t.prototype.render=function(t,n){if(this.Mn)for(var i=n?this.Dn:this.En,r=0,e=i.length;r<e;++r){var u=i[r];u.updateTransform(),u.render(t)}},t}(),Xi=function(){function t(){this.Sn=[]}return t.prototype.add=function(t){this.Sn.push(t)},t.prototype.remove=function(t){var n=this.Sn,i=n.indexOf(t);0<=i&&n.splice(i,1)},t.prototype.onReflow=function(t,n,i){for(var r=this.Sn,e=0,u=r.length;e<u;++e)r[e].onReflow(t,n,i)},t}(),Ki=function(n){function i(t){var r,e,u,s,h,o,a,c,f,l=n.call(this)||this,v=l.transform;l.P=new Ei(v.position,(function(t,n,i,r){l.onMove(t,n,i,r)})),l.Tn=new Ei(v.scale,(function(t,n,i,r){l.onScale(t,n,i,r)})),l.jn=new Ei(v.skew,(function(t,n,i,r){l.onSkew(t,n,i,r)})),l.Nn=t;var b=l.In={};l.Cn=new Vi,l.un=!0,l.An=!1,l.Rn=!1,l.yn=null,l.name=null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"";var d=function(t){var n=null==t?void 0:t.theme;if(n)return at(n)?K.getInstance().get(n):n}(t)||l.getThemeDefault();l.Xt=d,l.kn=new Wi(l),l.Ln=new Xi,l.xn=di(null!==(e=null==t?void 0:t.clear)&&void 0!==e?e:d.getClearType(),yi),l.Bn=new Di(d,t,(function(){l.toParentResized(),l.toChildrenDirty(),rt.update(l)}));var g=function(){l.toDirty(),rt.update(l)};l.gn=new vi(d,t,g),l.mn=new gi(d,t,g),l.wn=new Oi(d,t,g),l.Vt=new wi(d,t,g);var m=v.position,w=null!==(u=null==t?void 0:t.x)&&void 0!==u?u:d.getX();Xt(w)?m.x=w:(m.x=0,b.x=Gi.position(w));var p=null!==(s=null==t?void 0:t.y)&&void 0!==s?s:d.getY();Xt(p)?m.y=p:(m.y=0,b.y=Gi.position(p));var O=null!==(h=null==t?void 0:t.width)&&void 0!==h?h:d.getWidth();l.Cn.width.from(O)?l.Mt=100:Xt(O)?l.Mt=O:(l.Mt=100,b.width=Gi.size(O));var D=null!==(o=null==t?void 0:t.height)&&void 0!==o?o:d.getHeight();l.Cn.height.from(D)?l.nn=100:Xt(D)?l.nn=D:(l.nn=100,b.height=Gi.size(D));var E=null==t?void 0:t.visible;null!=E&&(l.visible=E),l.Et=new ft((function(t,n){l.onStateChange(t,n)}));var M=di(null!==(a=null==t?void 0:t.interactive)&&void 0!==a?a:d.getInteractive(),pi);l.interactive=!!(M&pi.SELF),l.interactiveChildren=!!(M&pi.CHILDREN);var S=null==t?void 0:t.on;if(S)for(var T in S){var j=S[T];j&&l.on(T,j)}l._n=null!==(c=null==t?void 0:t.title)&&void 0!==c?c:d.getTitle(),l.Ut=null!==(f=null==t?void 0:t.weight)&&void 0!==f?f:d.getWeight(),l.initReflowable(),l.Pn=function(){rt.update(l)};var N=null==t?void 0:t.shadow;if(void 0===N&&(N=d.getShadow()),N)if(at(N))switch(N){case"WEAK":l.shadow=d.newShadowWeak();break;case"DEFAULT":l.shadow=d.newShadow()}else l.shadow=N;l.on(zi.over,(function(t){l.onOver(t)})),l.on(zi.out,(function(t){l.onOut(t)})),l.on(zi.down,(function(t){l.onDown(t)})),l.on(zi.up,(function(t){l.onUp(t)})),l.on("added",(function(){l.toParentResized(),(l.isDirty()||l.hasDirty())&&l.toParentHasDirty(),l.Rn&&l.toParentChildrenDirty();var t=l.parent;t instanceof i&&(l.state.parent=t.state),rt.update(l)})),l.on("removed",(function(){l.blur(!0),l.state.parent=null,rt.update(l)}));var I=function(t){if(t){var n=t.shortcut,i=t.shortcuts;if(null!=i||null!=n){var r=[];if(null!=n&&r.push(Kt.toShortcut(n)),null!=i)for(var e=0,u=i.length;e<u;++e)Kt.toShortcut(i[e]);return r}}}(t);if(l.Fn=I,null!=I)for(var C=function(t){l.onShortcut(t)},A=0,R=I.length;A<R;++A)Kt.on(l,I[A],C);l.init(t),d.newState(l.Et);var y=null==t?void 0:t.state;null!=y&&(at(y)?l.Et.add(y):l.Et.addAll(y));var k=null==t?void 0:t.parent;null!=k&&k.addChild(l);var L=null==t?void 0:t.children;if(null!=L)for(A=0,R=L.length;A<R;++A){var x=L[A];null!=x&&l.addChild(x)}var B=null==t?void 0:t.cursor;return l.Un=B,l.cursor=l.toCursor(B,l.Et),l.emit("init",l),l}return _(i,n),i.prototype.toCursor=function(t,n){if(t)if(ot(t)){var i=t(n);if(void 0!==i)return i}else if(void 0!==t)return t;return this.theme.getCursor(n)},Object.defineProperty(i.prototype,"snippet",{get:function(){return this.kn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"reflowable",{get:function(){return this.Ln},enumerable:!1,configurable:!0}),i.prototype.initReflowable=function(){new Ri(this)},i.prototype.onChildrenChange=function(){this.toChildrenDirty(),n.prototype.onChildrenChange.call(this)},i.prototype.onShortcut=function(t){},i.prototype.init=function(t){},Object.defineProperty(i.prototype,"weight",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),i.prototype.onMove=function(t,n,r,e){for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof i&&o.onParentMove(t,n,r,e)}rt.update(this),this.emit("move",t,n,r,e,this)},i.prototype.resize=function(t,n){var i=this.Mt,r=this.nn,e=i!==t,u=r!==n;e&&(this.Mt=t),u&&(this.nn=n);var s,h=e||u;if(h&&this.onResize(t,n,i,r),e&&null!=(s=this.In).x){var o=this.transform.position,a=this.getParentOfSize();a&&(this.x=s.x(a.width,t,a.padding.getLeft(),o.x))}if(u&&null!=(s=this.In).y){o=this.transform.position;var c=this.getParentOfSize();c&&(this.y=s.y(c.height,n,c.padding.getTop(),o.y))}return h},i.prototype.getClearType=function(){return this.xn},i.prototype.onResize=function(t,n,r,e){this.toDirty(),this.toChildrenDirty();for(var u=this.Bn,s=this.children,h=0,o=s.length;h<o;++h){var a=s[h];a instanceof i&&a.onParentResize(t,n,u)}rt.update(this),this.emit("resize",t,n,r,e,this)},i.prototype.onScale=function(t,n,i,r){rt.update(this),this.emit("scale",t,n,i,r,this)},i.prototype.onSkew=function(t,n,i,r){rt.update(this),this.emit("skew",t,n,i,r,this)},Object.defineProperty(i.prototype,"type",{get:function(){return this.getType()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"x",{get:function(){return this.P.x},set:function(t){this.P.x=t},enumerable:!1,configurable:!0}),i.prototype.getX=function(){var t=this.In;return null!=t.x?t.x:this.x},i.prototype.setX=function(t){if(Xt(t))this.x=t;else{var n=this.In,i=Gi.position(t);n.x!==i&&(n.x=i,this.toParentResized())}},Object.defineProperty(i.prototype,"y",{get:function(){return this.P.y},set:function(t){this.P.y=t},enumerable:!1,configurable:!0}),i.prototype.getY=function(){var t=this.In;return null!=t.y?t.y:this.y},i.prototype.setY=function(t){if(Xt(t))this.y=t;else{var n=this.In,i=Gi.position(t);n.y!==i&&(n.y=i,this.toParentResized())}},Object.defineProperty(i.prototype,"width",{get:function(){return this.Mt},set:function(t){var n=this.Mt;if(n!==t){this.Mt=t;var i=this.nn;this.onResize(t,i,n,i);var r=this.In;if(null!=r.x){var e=this.transform.position,u=this.getParentOfSize();u&&(this.x=r.x(u.width,t,u.padding.getLeft(),e.x))}}},enumerable:!1,configurable:!0}),i.prototype.getWidth=function(){return this.Cn.width.toCoordinate(this.In.width||this.Mt)},i.prototype.setWidth=function(t){var n=this.Cn.width,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toChildrenDirty(),rt.update(this)),!r)if(Xt(t))this.width=t;else{var e=this.In,u=Gi.size(t);e.width!==u&&(e.width=u,this.toParentResized())}},Object.defineProperty(i.prototype,"height",{get:function(){return this.nn},set:function(t){var n=this.nn;if(n!==t){this.nn=t;var i=this.Mt;this.onResize(i,t,i,n);var r=this.In;if(null!=r.y){var e=this.transform.position,u=this.getParentOfSize();u&&(this.y=r.y(u.height,t,u.padding.getTop(),e.y))}}},enumerable:!1,configurable:!0}),i.prototype.getHeight=function(){return this.Cn.height.toCoordinate(this.In.height||this.nn)},i.prototype.setHeight=function(t){var n=this.Cn.height,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toChildrenDirty(),rt.update(this)),!r)if(Xt(t))this.height=t;else{var e=this.In,u=Gi.size(t);e.height!==u&&(e.height=u,this.toParentResized())}},Object.defineProperty(i.prototype,"position",{get:function(){return this.P},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Tn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"skew",{get:function(){return this.jn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Bn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"corner",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"background",{get:function(){return this.gn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"border",{get:function(){return this.mn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outline",{get:function(){return this.wn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"unsafe",{get:function(){return this.transform},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._n},set:function(t){this._n!==t&&(this._n=t,this.state.isHovered&&this.applyTitle())},enumerable:!1,configurable:!0}),i.prototype.applyTitle=function(){var t=rt.getLayer(this);t&&(t.view.title=this._n)},i.prototype.show=function(){return this.visible||(this.visible=!0,this.toParentChildrenDirty(),rt.update(this)),this},i.prototype.isShown=function(){return this.visible},i.prototype.hide=function(){return this.visible&&(this.visible=!1,this.toParentChildrenDirty(),this.blur(!0),rt.update(this)),this},i.prototype.isHidden=function(){return!this.visible},i.prototype.toDirty=function(){return!this.un&&(this.un=!0,this.toParentHasDirty(),!0)},i.prototype.toHasDirty=function(){return!this.An&&(this.An=!0,this.toParentHasDirty(),!0)},i.prototype.toParentHasDirty=function(){var t=this.parent;t instanceof i&&t.toHasDirty()},i.prototype.toChildrenDirty=function(){return!this.Rn&&(this.Rn=!0,this.onChildrenDirty(),this.toParentChildrenDirty(),!0)},i.prototype.toParentChildrenDirty=function(){var t=this.parent;t instanceof i&&t.toChildrenDirty()},i.prototype.isChildrenDirty=function(){return this.Rn},i.prototype.onChildrenDirty=function(){},i.prototype.isDirty=function(){return this.un},i.prototype.hasDirty=function(){return this.An},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=rt.getLayer(this);n&&n.getFocusController().set(this,t)}return this},i.prototype.focus=function(){return this.setFocused(!0)},i.prototype.blur=function(t){if(t){var n=rt.getLayer(this);if(n){var r=n.getFocusController().get();if(r instanceof i)for(var e=r;e;){if(e===this){r.setFocused(!1);break}e=e.parent}}}else this.setFocused(!1);return this},i.prototype.onStateChange=function(t,n){this.toDirty(),rt.update(this),this.emit("statechange",t,n,this);for(var r=this.children,e=0,u=r.length;e<u;++e){var s=r[e];s instanceof i&&s.state.onParentChange(t,n)}t.isFocused?n.isFocused||this.onFocus():n.isFocused&&this.onBlur(),this.cursor=this.toCursor(this.Un,t)},i.prototype.onChildFocus=function(t){var n=this.parent;n instanceof i&&n.onChildFocus(t)},i.prototype.onFocus=function(){var t=this.parent;t instanceof i&&t.onChildFocus(this)},i.prototype.onChildBlur=function(t){var n=this.parent;n instanceof i&&n.onChildBlur(t)},i.prototype.onBlur=function(){var t=this.parent;t instanceof i&&t.onChildBlur(this)},Object.defineProperty(i.prototype,"state",{get:function(){return this.Et},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"theme",{get:function(){return this.Xt},set:function(t){this.Xt!==t&&(this.Xt=t,this.Bn.setTheme(t),this.gn.setTheme(t),this.mn.setTheme(t),this.wn.setTheme(t),this.Vt.setTheme(t),this.toDirty(),rt.update(this))},enumerable:!1,configurable:!0}),i.prototype.refit=function(){if(this.Rn){this.Rn=!1;for(var t=this.children,n=0,r=t.length;n<r;++n){var e=t[n];e instanceof i&&e.refit()}this.onRefit()}},i.prototype.onRefit=function(){var t=this.Cn,n=t.width.isOn,i=t.height.isOn;if(n&&i){for(var r=0,e=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&(this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width)),this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height)));var h=this.padding;this.resize(r+h.getRight(),e+h.getBottom())}else if(n){for(r=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width));this.width=r+this.padding.getRight()}else if(i){var o;for(e=0,u=0,s=(o=this.children).length;u<s;++u){var a;(a=o[u]).visible&&this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height))}this.height=e+this.padding.getBottom()}},i.prototype.isRefitable=function(t){return t instanceof i},i.prototype.hasRefitableHeight=function(t){return this.isRefitable(t)&&!(t instanceof i&&ot(t.getHeight()))},i.prototype.hasRefitableWidth=function(t){return this.isRefitable(t)&&!(t instanceof i&&ot(t.getWidth()))},i.prototype.reflow=function(){if(this.un&&(this.onReflow(),this.un=!1),this.An){for(var t=this.children,n=0,r=t.length;n<r;++n){var e=t[n];e instanceof i&&e.reflow()}this.An=!1}},i.prototype.onReflow=function(){this.Ln.onReflow(this,this.Mt,this.nn)},Object.defineProperty(i.prototype,"shadow",{get:function(){return this.yn},set:function(t){var n=this.yn;if(n!==t){var i=this.Ln,r=this.kn,e=this.Pn;null!=n&&(n.off("update",e),i.remove(n),r.remove(n,!0)),this.yn=t,null!=t&&(t.on("update",e),i.add(t),r.addAt(t,!0,0)),rt.update(this)}},enumerable:!1,configurable:!0}),i.prototype.toParentResized=function(){var t=this.getParentOfSize();t&&this.onParentResize(t.width,t.height,t.padding)},i.prototype.getParentOfSize=function(){var t=this.parent;return t instanceof i?t:rt.getLayer(this)},i.prototype.onParentResize=function(t,n,i){var r=this.In,e=this.transform.position,u=e.x,s=e.y,h=this.Mt,o=this.nn,a=i.getLeft()+i.getRight(),c=i.getTop()+i.getBottom(),f=null!=r.width?r.width(t,h,a,h):h,l=null!=r.height?r.height(n,o,c,o):o;this.resize(f,l);var v=null!=r.x?r.x(t,this.Mt,i.getLeft(),u):u,b=null!=r.y?r.y(n,this.nn,i.getTop(),s):s;this.position.set(v,b)},i.prototype.onParentMove=function(t,n,i,r){},i.prototype.onWheel=function(t,n,i){return this.emit("wheel",t,n,i,this),!1},i.prototype.onKeyDown=function(t){return this.emit("keydown",t,this),!1},i.prototype.onKeyUp=function(t){return this.emit("keyup",t,this),!1},i.prototype.isEventTarget=function(t){var n=t.target;if(n===this)return!0;if(null!=n&&!(n instanceof i)){for(var r=n.parent;null!=r&&!(r instanceof i);)r=r.parent;return r===this}return!1},i.prototype.onDown=function(t){this.isEventTarget(t)&&this.onDownThis(t),this.emit("down",t,this)},i.prototype.onDownThis=function(n){if("touches"in n.data.originalEvent){var i=this.Gn||new t.Point;this.Gn=i,i.copyFrom(n.data.global)}else this.focusOnClosest()},i.prototype.onUp=function(t){this.isEventTarget(t)&&this.onUpThis(t),this.emit("up",t,this)},i.prototype.onUpThis=function(t){if("touches"in t.data.originalEvent){var n=this.Gn;if(n){var i=t.data.global,r=Math.abs(i.x-n.x),e=Math.abs(i.y-n.y),u=zi.CLICK_DISTANCE_THRESHOLD;r<u&&e<u&&this.focusOnClosest()}}},i.prototype.focusOnClosest=function(){var t=rt.getLayer(this);if(t){var n=t.getFocusController();n.focus(n.findParent(this))}},i.prototype.onOver=function(t){this.state.isHovered=!0,t.target===this&&this.applyTitle(),this.emit("over",t,this)},i.prototype.onOut=function(t){this.state.isHovered=!1,this.emit("out",t,this)},i.prototype.onDblClick=function(t,n){return this.emit("dblclick",t,n,this),!1},i.prototype.render=function(t){if(this.visible&&0<this.worldAlpha&&this.renderable){var i=this.kn;i.render(t,!0),n.prototype.render.call(this,t),i.render(t,!1)}},i.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},i.prototype.getType=function(){return"DBase"},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,r=this._bounds,e=i.WORK_CONTAINS_POINT;e.set(0,0),t.apply(e,e),r.addPoint(e),e.set(this.Mt,this.nn),t.apply(e,e),r.addPoint(e),n.prototype._calculateBounds.call(this)},i.prototype.containsPoint=function(t){return this.containsGlobalPoint(t)||this.containsLocalPoint(this.worldTransform.applyInverse(t,i.WORK_CONTAINS_POINT))},i.prototype.containsGlobalPoint=function(t){return!1},i.prototype.containsLocalPoint=function(t){var n=t.x,i=t.y,r=this.Mt,e=this.nn;return 0<=n&&n<=r&&0<=i&&i<=e},i.prototype.getClippingRect=function(t,n){n.x=0,n.y=0,n.width=this.Mt,n.height=this.nn},i.prototype.destroy=function(){var t=this.In;t.x=null,t.y=null,t.width=null,t.height=null;var i=this.yn;i&&(this.yn=null,i.destroy());for(var r=this.children,e=r.length-1;0<=e;--e)r[e].destroy();r.length=0,n.prototype.destroy.call(this)},i.WORK_CONTAINS_POINT=new t.Point,i}(t.Container),Yi=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){var r=t.corner,e=Math.max(0,r.getRadius()-.5),u=r.getMask(),s=u&mi.TOP_LEFT?0:e,h=u&mi.TOP_RIGHT?0:e,o=u&mi.BOTTOM_LEFT?0:e,a=u&mi.BOTTOM_RIGHT?0:e;this.clear(),this.beginFill(16777215,1),this.lineStyle(0,0,0,0,!1),s<=0&&h<=0&&o<=0&&a<=0?this.drawRect(0,0,n,i):(this.moveTo(0+s,0),0<h?this.arcTo(0+n,0,0+n,0+i,h):this.lineTo(0+n,0),0<a?this.arcTo(0+n,0+i,0,0+i,a):this.lineTo(0+n,0+i),0<o?this.arcTo(0,0+i,0,0,o):this.lineTo(0,0+i),0<s?this.arcTo(0,0,0+n,0,s):this.lineTo(0,0)),this.endFill()},n}(t.Graphics),Ji={NONE:0,CTRL:1,SHIFT:2,ALT:4,AND:8,OR:16,NOT_NONE:23},Zi=function(){function t(){}return t.from=function(t){var n="data"in t?t.data.originalEvent:t;return(n.ctrlKey?Ji.CTRL:Ji.NONE)|(n.altKey?Ji.ALT:Ji.NONE)|(n.shiftKey?Ji.SHIFT:Ji.NONE)},t.match=function(n,i){return i&Ji.OR?!!(t.from(n)&i):t.from(n)===i},t}(),qi={OFF:0,ON:1,TOUCH:2},$i=function(){function n(){this.pointers=new Map,this.center=new t.Point,this.scale=0,this.time=0}return n.prototype.start=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.isUpdatable=function(t){var n=t.data.originalEvent;return!("pointerId"in n)||this.pointers.has(n.pointerId)},n.prototype.update=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.end=function(t){var n=!0,i=t.data.originalEvent;if("touches"in i)n=i.touches.length<=0;else if("pointerId"in i){var r=this.pointers;r.delete(i.pointerId),n=r.size<=0}return this.doUpdate(t),n},n.prototype.bind=function(t){var n=this.interactionManager;if(n){var i=this.onMove;i&&n.on(zi.move,i);var r=this.onEnd;r&&(n.on(zi.up,r),n.on(zi.upoutside,r),n.on(zi.cancel,r))}},n.prototype.unbind=function(){var t=this.interactionManager;if(t){var n=this.onMove;n&&t.off(zi.move,n);var i=this.onEnd;i&&(t.off(zi.up,i),t.off(zi.upoutside,i),t.off(zi.cancel,i))}},n.prototype.doUpdate=function(t){var n=this.interactionManager,i=this.center,r=t.data.originalEvent;if(this.scale=0,this.time=r.timeStamp,"touches"in r){var e=r.touches,u=e.length;if(0<u){for(var s=0,h=0,o=0,a=e.length;o<a;++o)s+=(f=e[o]).clientX,h+=f.clientY;if(s/=u,h/=u,n?n.mapPositionToPoint(i,s,h):i.set(s,h),1<u){var c=0;for(o=1,a=e.length;o<a;++o){var f,l=(f=e[o]).clientX-s,v=f.clientY-h;c=Math.max(c,l*l+v*v)}this.scale=Math.sqrt(c)}}}else if("pointerId"in r){var b=this.pointers,d=b.size;if(0<d){var g=0,m=0;if(b.forEach((function(t){g+=t.clientX,m+=t.clientY})),g/=d,m/=d,n?n.mapPositionToPoint(i,g,m):i.set(g,m),1<d){var w=0;b.forEach((function(t){var n=t.clientX-g,i=t.clientY-m;w=Math.max(w,n*n+i*i)})),this.scale=Math.sqrt(w)}}}else i.copyFrom(t.data.global)},n}(),Qi=function(){function t(){}return t.LINEAR=function(t){return t},t.ELASTIC=function(t){return t*(3*(1-t)*(1-t)+t*(3*(1-t)+t))},t.QUAD_IN_OUT=function(t){return t<.5?2*t*t:(4-2*t)*t-1},t}(),tr=function(t){function n(n){var i,r,e,u=t.call(this)||this;u.k=null,u.zn=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,u.Hn=0,u.Vn=null!==(r=null==n?void 0:n.duration)&&void 0!==r?r:200,u.Wn=1/Math.max(1,u.Vn),u.Xn=!1,u.Kn=null==n?void 0:n.onTime,u.Yn=function(){u.onTimeBase()},u.Jn=null==n?void 0:n.onStart,u.Zn=null==n?void 0:n.onEnd,u.qn=null!==(e=null==n?void 0:n.timing)&&void 0!==e?e:Qi.ELASTIC;var s=null==n?void 0:n.on;if(s)for(var h in s){var o=s[h];o&&u.on(h,o)}return u}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.zn},set:function(t){this.zn=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return this.Vn},set:function(t){this.Vn=t,this.Wn=1/Math.max(1,t)},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.Hn=Date.now(),this.Xn=t,this.k=window.setTimeout(this.Yn,0),this.onStart(t);var n=this.Vn,i=this.toTime(t?n:0);this.onTime(i,t,0)},n.prototype.onStart=function(t){var n=this.Jn;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.Kn;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.Zn;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return null!=this.k},n.prototype.isReverse=function(){return this.Xn},n.prototype.onTimeBase=function(){if(null!=this.k){this.k=null;var t=Date.now()-this.Hn,n=this.Vn,i=this.Xn;if(t<n){this.k=window.setTimeout(this.Yn,0);var r=this.toTime(i?n-t:t);this.onTime(r,i,t)}else r=this.toTime(i?0:n),this.onTime(r,i,t),this.onEnd(i)}},n.prototype.toTime=function(t){return this.qn(t*this.Wn,this)},n.prototype.stop=function(){var t=this.k;null!=t&&(this.k=null,window.clearTimeout(t))},n.prototype.end=function(){var t=this.k;if(null!=t){this.k=null,window.clearTimeout(t);var n=this.Xn,i=Date.now()-this.Hn,r=this.Vn,e=this.toTime(n?0:r);this.onTime(e,n,i),this.onEnd(n)}},n}(t.utils.EventEmitter),nr=function(){function t(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r}return t.prototype.set=function(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r},t}(),ir=function(){function t(t,n,i){var r,e=this;this.$n=[],this.Qn=[],this.ti=0,this.ni=-1,this.ii=0,this.ri=0,this.ei=0,this.si=0,this.hi=0,this._t=0,this.oi=new tr({onTime:function(t){e.onEase(t)},onEnd:function(){e.onEaseEnd()},timing:Qi.LINEAR,duration:333*(null!==(r=null==i?void 0:i.duration)&&void 0!==r?r:1)}),this.ai=t,this.Zn=n}return t.prototype.onStart=function(){for(var n=this.$n,i=n.length,r=t.HISTORY_CAPACITY;i<r;++i)n.push(new nr(0,0,1,0));this.ti=0,this.ni=-1,this.oi.stop()},t.prototype.onMove=function(n,i,r,e){var u=t.HISTORY_CAPACITY,s=this.ni,h=(s+1)%u;this.ni=h;var o=this.ti;(h<s||0<=s&&s<o)&&(this.ti=(o+1)%u),this.$n[h].set(n,i,r,e)},t.prototype.updateHistoriesSorted=function(t){var n=this.$n,i=this.Qn,r=this.ti,e=this.ni,u=n.length;if(e<0)return i.length=0,t;if(e<r){var s=t;i.length=0;for(var h=e;0<=h;--h){var o=n[h];if(!(s+o.dt<160))return s;s+=o.dt,i.push(o)}for(h=u-1;r<=h;--h){var a=n[h];if(!(s+a.dt<160))return s;s+=a.dt,i.push(a)}return s}for(s=t,i.length=0,h=e;r<=h;--h){var c=n[h];if(!(s+c.dt<160))return s;s+=c.dt,i.push(c)}return s},t.prototype.onEnd=function(t){this.updateHistoriesSorted(t);var n=this.Qn,i=n.length;if(i<=0)return this.onEaseEnd();for(var r=0,e=0,u=0,s=0,h=0;h<i;++h){var o=n[h];r+=o.dx,e+=o.dy,u+=o.ds,s+=o.dt}if(s<=0)return this.onEaseEnd();var a=1/i;r*=a,e*=a,u*=a,s*=a,this.ii=r,this.ri=e,this.ei=u,this.si=s;var c=this.oi,f=c.duration;this._t=-t/f,this.hi=f/s,c.start()},t.prototype.onEase=function(t){var n=this._t;this._t=t;var i=(1-.5*(t+n))*(t-n)*this.hi;this.ai(this.ii*i,this.ri*i,1+(this.ei-1)*i,t)},t.prototype.onEaseEnd=function(){this.Zn()},t.prototype.stop=function(){this.oi.stop()},t.HISTORY_CAPACITY=5,t}(),rr=function(){function t(t){var n,i,r,e=t.on;e&&(this.Jn=e.start,this.ai=e.move,this.Zn=e.end),this.ci=null!==(n=null==t?void 0:t.modifier)&&void 0!==n?n:Ji.NONE;var u=t.checker,s=Zi.match;this.fi=null!==(i=null==u?void 0:u.start)&&void 0!==i?i:s,this.li=null!==(r=null==u?void 0:u.move)&&void 0!==r?r:s,this.vi=t.easing,this.bi=!!t.touch,this.di=[],this.gi=new Map;var h=t.bind;null!=h&&this.bind(h)}return t.prototype.newData=function(t){var n=this.gi,i=n.get(t);if(null!=i)return i;var r=this.di.pop();if(null!=r)return n.set(t,r),r;var e=new $i;return e.easing=this.newEasing(e),e.onMove=this.newOnMove(e),e.onEnd=this.newOnEnd(e),n.set(t,e),e},t.prototype.newEasing=function(t){var n=this,i=this.vi;if(null==i||!1!==i)return new ir((function(i,r,e,u){n.onEasingMove(i,r,e,u,t)}),(function(){n.onEasingEnd(t)}),this.toEasingOptions(i))},t.prototype.toEasingOptions=function(t){return null==t||!0===t?void 0:t},t.prototype.deleteData=function(t){var n=t.target;n&&this.gi.delete(n)&&(t.target=void 0,t.pointers.clear(),this.di.push(t))},t.prototype.bind=function(t){var n=this;return t.on(zi.down,(function(i){n.onDown(t,i)})),this},t.prototype.isTouch=function(t){var n=t.data.originalEvent;return"touches"in n||"pointerId"in n&&"mouse"!==n.pointerType},t.prototype.onDown=function(t,n){var i;if((!this.bi||this.isTouch(n))&&this.fi(n,this.ci,t)){var r=rt.getLayer(t);if(null!=r)if(n.stopPropagation(),t.state.isGesturing)null===(i=this.gi.get(t))||void 0===i||i.start(n);else{var e=this.Jn;null!=e&&e(t);var u=this.newData(t);u.target=t,t.state.isGesturing=!0;var s=r.renderer.plugins.interaction;u.interactionManager=s,u.start(n);var h=u.easing;h&&h.onStart(),u.bind(n)}}},t.prototype.newOnMove=function(t){var n=this;return function(i){n.onMove(i,t)}},t.prototype.newOnEnd=function(t){var n=this;return function(i){n.onEnd(i,t)}},t.prototype.onMove=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.isUpdatable(t)&&this.li(t,this.ci,i)){var r=n.center,e=r.x,u=r.y,s=n.scale,h=n.time;n.update(t);var o=r.x,a=r.y,c=n.scale,f=o-e,l=a-u,v=n.time-h,b=1e-5,d=b<s&&b<c?c/s:1,g=n.easing;g&&g.onMove(f,l,d,v);var m=this.ai;null!=m&&(0===f&&0===l&&1===d||m(i,f,l,o,a,d))}},t.prototype.onEnd=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.end(t)){i.state.isGesturing=!1;var r=n.interactionManager;if(n.interactionManager=void 0,r){var e=n.onMove;e&&r.off(zi.move,e);var u=n.onEnd;u&&(r.off(zi.up,u),r.off(zi.cancel,u))}var s=this.Zn;null!=s&&s(i);var h=n.easing;h?h.onEnd(t.data.originalEvent.timeStamp-n.time):this.deleteData(n)}},t.prototype.onEasingMove=function(t,n,i,r,e){if(null!=e.target){var u=this.ai;if(null!=u&&(0!==t||0!==n||1!==i)){var s=e.center,h=s.x+t,o=s.y+n;s.set(h,o),u(e.target,t,n,h,o,i)}}},t.prototype.onEasingEnd=function(t){this.deleteData(t)},t.prototype.stop=function(t){var n,i=this.gi.get(t);null!=i&&(null===(n=i.easing)||void 0===n||n.stop(),this.deleteData(i))},t}(),er=function(){function t(t,n,i,r,e){var u,s,h=this;this.O=t,this.wi=i;var o=di(null!==(u=null==e?void 0:e.mode)&&void 0!==u?u:r.getGestureMode(),qi),a=di(null!==(s=null==e?void 0:e.modifier)&&void 0!==s?s:r.getGestureModifier(),Ji);o!==qi.ON&&o!==qi.TOUCH||(this.pi=new rr({touch:o===qi.TOUCH,modifier:a,checker:e&&e.checker,easing:{duration:null==e?void 0:e.duration},on:{start:function(){h.wi.stop()},move:function(i,r,e,u,s,o){h.onGestureMove(n(t),r,e,u,s,o)}}}))}return t.prototype.onGestureMove=function(t,n,i,r,e,u){if(t){var s=this.wi,h=t.scale,o=h.x,a=h.y,c=s.toNormalizedScale(o*u),f=s.toNormalizedScale(a*u),l=c/o,v=f/a,b=u<1?Math.max(l,v):Math.min(l,v);c=b*o,f=b*a;var d=r-n,g=e-i,m=t.position,w=(m.x-d)*b+r,p=(m.y-g)*b+e;t.scale.set(c,f),t.position.set(w,p)}},t.prototype.stop=function(){var t;null===(t=this.pi)||void 0===t||t.stop(this.O)},t.prototype.onDown=function(t){var n;null===(n=this.pi)||void 0===n||n.onDown(this.O,t)},t}(),ur=function(){function t(t,n,i,r){var e=this;this.O=t,this.Oi=n,this.Di=1,this.Ei=1,this.Mi=0,this.Si=0,this.Ti=1,this.ji=1,this.Ni=0,this.Ii=0,this.oi=new tr({onTime:function(t){e.onTime(t)},duration:r}),this.wi=i,this.Vn=r}return t.prototype.onTime=function(t){var n=1-t,i=t,r=this.Ti*n+this.Di*i,e=this.ji*n+this.Ei*i,u=this.Ni*n+this.Mi*i,s=this.Ii*n+this.Si*i,h=this.Oi(this.O);null!=h&&(h.scale.set(r,e),h.position.set(u,s))},t.prototype.start=function(t,n,i,r,e,u,s){if(!1!==s&&this.wi.stop(),null==u&&(u=this.Vn),u<=0)t.scale.set(r,e),t.position.set(n,i);else{var h=t.position,o=t.scale;this.Ni=h.x,this.Ii=h.y,this.Ti=o.x,this.ji=o.y,this.Mi=n,this.Si=i,this.Di=r,this.Ei=e,this.oi.duration=u,this.oi.start()}},t.prototype.stop=function(){this.oi.stop()},t}(),sr=function(){function n(n,i,r){var e,u,s,h,o,a,c,f,l,v,b,d,g,m,w,p,O;this.O=n,this.Oi=i,this.Ci=new t.Rectangle;var D=this.toTheme(r)||this.getThemeDefault(),E=null==r?void 0:r.zoom;this.Ai=new t.Point,this.Ri=null!==(e=null==E?void 0:E.min)&&void 0!==e?e:D.getZoomMin(),this.yi=null!==(u=null==E?void 0:E.max)&&void 0!==u?u:D.getZoomMax(),this.ki=null!==(s=null==E?void 0:E.keepRatio)&&void 0!==s?s:D.getZoomKeepRatio();var M=null==E?void 0:E.wheel;this.Li=null!==(h=null==M?void 0:M.enable)&&void 0!==h?h:D.isWheelZoomEnabled(),this.xi=null!==(o=null==M?void 0:M.speed)&&void 0!==o?o:D.getWheelZoomSpeed(),this.Bi=di(null!==(a=null==M?void 0:M.modifier)&&void 0!==a?a:D.getWheelZoomModifier(),Ji),this._i=null!==(c=null==M?void 0:M.checker)&&void 0!==c?c:Zi.match;var S=null==E?void 0:E.dblclick;this.Pi=null!==(f=null==S?void 0:S.enable)&&void 0!==f?f:D.isDblClickZoomEnabled(),this.Fi=null!==(l=null==S?void 0:S.amount)&&void 0!==l?l:D.getDblClickZoomSpeed(),this.Ui=di(null!==(v=null==S?void 0:S.modifier)&&void 0!==v?v:D.getDblClickZoomModifier(),Ji),this.Gi=null!==(b=null==S?void 0:S.checker)&&void 0!==b?b:Zi.match,this.zi=null!==(d=null==S?void 0:S.duration)&&void 0!==d?d:D.getDblClickZoomDuration();var T=null===(g=null==r?void 0:r.translation)||void 0===g?void 0:g.wheel;this.Hi=null!==(m=null==T?void 0:T.enable)&&void 0!==m?m:D.isWheelTranslationEnabled(),this.Vi=null!==(w=null==T?void 0:T.speed)&&void 0!==w?w:D.getWheelTranslationSpeed(),this.Wi=di(null!==(p=null==T?void 0:T.modifier)&&void 0!==p?p:D.getWheelTranslationModifier(),Ji),this.Xi=null!==(O=null==T?void 0:T.checker)&&void 0!==O?O:Zi.match,this.Ki=new er(n,i,this,D,null==r?void 0:r.gesture),this.C=new ur(n,i,this,this.zi)}return Object.defineProperty(n.prototype,"gesture",{get:function(){return this.Ki},enumerable:!1,configurable:!0}),n.prototype.stop=function(){this.Ki.stop(),this.C.stop()},n.prototype.reset=function(t,n){var i=this.O,r=this.Oi(i);if(r){var e=r.getLocalBounds(this.Ci),u=.5*(i.width-e.width)-e.x,s=.5*(i.height-e.height)-e.y;this.C.start(r,u,s,1,1,t,n)}},n.prototype.fit=function(t,n){var i=this.O,r=this.Oi(i);if(r){var e=i.padding,u=i.width,s=i.height,h=r.getLocalBounds(this.Ci),o=h.x,a=h.y,c=h.width,f=h.height,l=(u-e.getLeft()-e.getRight())/c,v=(s-e.getTop()-e.getBottom())/f;if(this.ki){var b=this.toNormalizedScale(Math.min(l,v));l=b,v=b}else l=this.toNormalizedScale(l),v=this.toNormalizedScale(v);var d=.5*(u-c*l)-o*l,g=.5*(s-f*v)-a*v;this.C.start(r,d,g,l,v,t,n)}},n.prototype.zoomIn=function(t,n){var i=this.Oi(this.O);if(i){var r=this.Fi,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomOut=function(t,n){var i=this.Oi(this.O);if(i){var r=1/this.Fi,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomAt=function(t,n,i,r,e,u){var s=this.Oi(this.O);if(s){var h=s.scale.x,o=s.scale.y,a=this.toNormalizedScale(i),c=this.toNormalizedScale(r),f=a/h,l=c/o,v=(s.position.x-t)*f+t,b=(s.position.y-n)*l+n;this.C.start(s,v,b,a,c,e,u)}},n.prototype.zoomAtGlobal=function(t,n,i,r,e,u){var s=this.Ai;s.set(t,n),this.toLocal(s,s),this.zoomAt(s.x,s.y,i,r,e,u)},n.prototype.zoom=function(t,n,i,r){var e=this.O;this.zoomAt(.5*e.width,.5*e.height,t,n,i,r)},Object.defineProperty(n.prototype,"scale",{get:function(){var n=this.Oi(this.O);return n?n.scale:new t.Point(1,1)},set:function(t){var n=this.Oi(this.O);if(n){var i=this.toNormalizedScale(t.x),r=this.toNormalizedScale(t.y);n.scale.set(i,r)}},enumerable:!1,configurable:!0}),n.prototype.moveTo=function(t,n,i,r){var e=this.Oi(this.O);if(e){var u=e.scale;this.C.start(e,t,n,u.x,u.y,i,r)}},Object.defineProperty(n.prototype,"position",{get:function(){var n=this.Oi(this.O);return n?n.position:new t.Point(0,0)},set:function(t){var n=this.Oi(this.O);n&&n.position.set(t.x,t.y)},enumerable:!1,configurable:!0}),n.prototype.transform=function(t,n,i,r,e,u){var s=this.Oi(this.O);s&&this.C.start(s,t,n,i,r,e,u)},n.prototype.toLocal=function(t,n,i){return this.O.toLocal(t,void 0,n,i)},n.prototype.toGlobal=function(t,n,i){return this.O.toGlobal(t,n,i)},n.prototype.toNormalizedScale=function(t){return Math.min(this.yi,Math.max(this.Ri,t))},n.prototype.onWheel=function(t,n,i){var r;if(this.Li&&this._i(t,this.Bi,this.O)&&0!==n.deltaY&&(r=this.Oi(this.O))){var e=n.lowest*this.xi,u=1+n.deltaY*e,s=r.scale;return this.zoomAtGlobal(i.x,i.y,s.x*u,s.y*u,0),!0}return!!(this.Hi&&this.Xi(t,this.Wi,this.O)&&(r=this.Oi(this.O)))&&(this.stop(),e=n.lowest*this.Vi,r.position.set(r.position.x-n.deltaX*e,r.position.y+n.deltaY*e),!0)},n.prototype.onDown=function(t){this.Ki.onDown(t)},n.prototype.onDblClick=function(t,n){if(this.Pi&&this.Gi(t,this.Ui,this.O)){var i=this.Oi(this.O);if(i){var r=this.Ai;zi.toGlobal(t,n,r);var e=this.Fi,u=i.scale;return this.zoomAtGlobal(r.x,r.y,u.x*e,u.y*e,this.zi),!0}}return!1},n.prototype.toTheme=function(t){if(t&&t.theme){var n=t.theme;return at(n)?K.getInstance().get(n):n}return null},n.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},n.prototype.getType=function(){return"DView"},n}(),hr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n),this.Yi=null;var e=this.theme;this.Ji=new sr(this,(function(){return r.Yi}),null==n?void 0:n.view);var u=null==n?void 0:n.canvas;u&&(this.canvas=u),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(this.mask=this.getOverflowMask())},n.prototype.getType=function(){return"DCanvasContainer"},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateContentSize(n,i,r,e)},Object.defineProperty(n.prototype,"canvas",{get:function(){return this.Yi},set:function(t){var n=this.Yi;null!=n&&(this.Yi=null,this.removeChild(n),this.emit("unset",n,this),n.destroy()),this.Yi=t,null!=t?(this.addChild(t),this.Ji.reset(0),this.emit("set",t,this)):rt.update(this)},enumerable:!1,configurable:!0}),n.prototype.getOverflowMask=function(){return null==this.Zi&&(this.Zi=new Yi(this),this.Ln.add(this.Zi),this.toDirty()),this.Zi},n.prototype.updateContentSize=function(t,n,i,r){var e=this.Yi;if(null!=e){var u=e.x+.5*(t-i),s=e.y+.5*(n-r);e.position.set(u,s)}},Object.defineProperty(n.prototype,"view",{get:function(){return this.Ji},enumerable:!1,configurable:!0}),n.prototype.onWheel=function(n,i,r){var e=this.Ji.onWheel(n,i,r),u=t.prototype.onWheel.call(this,n,i,r);return e||u},n.prototype.onDblClick=function(n,i,r){if(!0!==r){var e=this.Ji.onDblClick(n,i),u=t.prototype.onDblClick.call(this,n,i);return e||u}return t.prototype.onDblClick.call(this,n,i)},n.prototype.onDown=function(n,i){!0!==i&&this.Ji.onDown(n),t.prototype.onDown.call(this,n)},n.prototype.destroy=function(){var n=this.Zi;null!=n&&(this.Zi=null,n.destroy()),this.mask=null,t.prototype.destroy.call(this)},n}(Ki),or=function(){function t(){}return t.toContainer=function(t){for(var n=t;null!=n;){if(n instanceof hr)return n;n=n.parent}return null},t.open=function(t,n){var i=this.toContainer(t);i&&i.openByName(n)},t.write=function(t,n,i,r,e){var u=this.toContainer(t);u&&(e?u.data.remote.set(n,i,r):u.data.set(n,i,r))},t.emit=function(n,i,r,e){var u=t.toContainer(n);void 0===e?(n.emit(i,n),u&&u.shape.emit(i,n)):(n.emit(i,r,e,n),u&&u.shape.emit(i,r,e,n))},t}(),ar=function(t){function n(n){var i=t.call(this,n,Yt.NONE)||this;return i.name=qt.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.name(t,i);null!=r&&or.emit(t,r)}},n}(Qt),cr=function(t){function n(n,i){var r=t.call(this,fn.EMIT_EVENT,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new ar(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("["+this.type+","+n+","+i+"]")},n.deserialize=function(t,i){return new n(ln.toResource(1,t,i.resources),ln.toResource(2,t,i.resources))},n}(an),fr=function(t){function n(n){var i=t.call(this,n,Yt.NONE)||this;return i.target=qt.ofStringOrNull(n.target),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.target(t,i);null!=r&&or.emit(t,r)}},n}(Qt),lr={NO_POINTER_EVENTS:"NO_POINTER_EVENTS"},vr={CLICKED:0,DOUBLE_CLICKED:1,FOCUSED:2,ALWAYS:3},br=function(){function n(t,n,i,r){var e=this;this.zn=t,this.qi=n;var u=this.toData(i,r);this.$i=u,this.Qi=!1,this.tr=function(t){e.onElementFocus(t)},this.nr=function(t){e.onBeforeFocus(t)},this.ir=function(t){e.onAfterFocus(t)},this.rr=!1,this.er=!1,this.ur=function(){e.doSelect()},this.sr=this.$i.when===vr.ALWAYS,this.hr=function(){e.updateElement(e.ar)}}return n.prototype.toData=function(t,n){var i,r;return{element:this.toElementData(t,null==n?void 0:n.element),clipper:this.toClipperData(t,null==n?void 0:n.clipper),before:this.toBeforeData(t,null==n?void 0:n.before),after:this.toAfterData(t,null==n?void 0:n.after),when:di(null!==(i=null==n?void 0:n.when)&&void 0!==i?i:t.getWhen(),vr),select:null!==(r=null==n?void 0:n.select)&&void 0!==r?r:t.getSelect()}},n.prototype.toElementData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getElementCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newElementStyler(t)}},n.prototype.newElementStyler=function(t){return function(n,i,r,e,u,s){return t.setElementStyle(n,i,r,e,u,s)}},n.prototype.toClipperData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getClipperCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newClipperStyler(t)}},n.prototype.newClipperStyler=function(t){return function(n,i,r,e,u,s){return t.setClipperStyle(n,i,r,e,u,s)}},n.prototype.toBeforeData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getBeforeCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newBeforeStyler(t)}},n.prototype.newBeforeStyler=function(t){return function(n){t.setBeforeStyle(n)}},n.prototype.toAfterData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getAfterCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newAfterStyler(t)}},n.prototype.newAfterStyler=function(t){return function(n){t.setAfterStyle(n)}},Object.defineProperty(n.prototype,"element",{get:function(){var t;return null!==(t=this.cr)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"when",{get:function(){return this.$i.when},enumerable:!1,configurable:!0}),n.prototype.onDowning=function(t){switch(this.er=this.rr,this.when){case vr.CLICKED:this.start();break;case vr.FOCUSED:this.zn.state.isFocused&&this.start()}},n.prototype.onDown=function(t){!this.er&&this.rr&&("data"in t?t.data.originalEvent.preventDefault():t.preventDefault())},n.prototype.onDblClick=function(t,n){switch(this.when){case vr.DOUBLE_CLICKED:this.start()}},n.prototype.onFocus=function(){var t;switch(this.when){case vr.FOCUSED:this.start();break;default:null===(t=this.cr)||void 0===t||t.focus()}},n.prototype.onBlur=function(){var t;switch(this.when){case vr.CLICKED:case vr.DOUBLE_CLICKED:case vr.FOCUSED:this.onEndByBlur(),this.cancel();break;default:null===(t=this.cr)||void 0===t||t.blur()}},n.prototype.isStartable=function(){switch(this.when){case vr.CLICKED:case vr.DOUBLE_CLICKED:case vr.FOCUSED:return this.zn.state.isActionable;default:return!0}},n.prototype.start=function(){!this.rr&&this.isStartable()&&(this.rr=!0,this.zn.worldVisible?this.doStart():this.sr=!0,rt.update(this.zn))},n.prototype.isShown=function(){return this.Qi},n.prototype.onRender=function(t){(this.sr||!this.Qi&&this.when===vr.ALWAYS)&&(this.sr=!1,this.doStart(t)),this.rr&&(this.rr=!1)},n.prototype.getElementRect=function(n){var i=this.tn||new t.Point(0,0);this.tn=i;var r=this.lr||new t.Rectangle;return this.lr=r,this.qi.getElementRect(n,i,r)},n.prototype.getElementMatrix=function(){return this.qi.getElementMatrix()},n.prototype.getClipperRect=function(n){var i=this.tn||new t.Point(0,0);this.tn=i;var r=this.vr||new t.Rectangle;return this.vr=r,this.qi.getClipperRect(n,i,r)},n.prototype.doStart=function(t){var n,i;if(!this.Qi){this.Qi=!0;var r=this.ar;null!=r&&(this.ar=void 0,r.off("postrender",this.hr));var e=this.zn;null==t&&(t=null===(n=rt.getLayer(e))||void 0===n?void 0:n.renderer),t&&(this.ar=t,t.on("postrender",this.hr)),this.onStart();var u=this.getClipper();if(u){var s=this.getBefore(u),h=this.getElement(u),o=this.getAfter(u);if(h){var a=null!==(i=null==t?void 0:t.resolution)&&void 0!==i?i:rt.getResolution(e),c=this.getElementRect(a),f=this.getElementMatrix(),l=this.toClipperRectAdjusted(c,f,this.getClipperRect(a)),v=e.state,b=this.qi.getPadding(),d=this.$i;d.clipper.styler(u,v,b,c,f,l),d.element.styler(h,v,b,c,f,l),s&&d.before.styler(s),o&&d.after.styler(o),this.onElementAttached(h,s,o),u.style.display="",v.isFocused&&this.toElementFocused(h),u.scrollTop=0,u.scrollLeft=0,this.$i.select&&setTimeout(this.ur,0)}}}},n.prototype.toElementFocused=function(t){t.focus()},n.prototype.onStart=function(){this.qi.onStart()},n.prototype.doSelect=function(){var t=this.cr;t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select()},n.prototype.cancel=function(){if(this.Qi){this.Qi=!1;var t=this.ar;null!=t&&(this.ar=void 0,t.off("postrender",this.hr)),this.onCancel();var n=this.zn,i=rt.getLayer(n);if(i){var r=i.view;switch(this.when){case vr.CLICKED:case vr.DOUBLE_CLICKED:case vr.FOCUSED:document.activeElement===this.cr&&r.focus()}var e=n.state,u=i.renderer.plugins.interaction;this.qi.containsPoint(u.mouse.global)&&!e.isHovered&&(e.isHovered=!0,r.style.cursor=n.cursor),i.update()}var s=this.cr;null!=s&&this.onElementDetached(s,this.br,this.dr);var h=this.gr;null!=h&&(h.style.display="none")}},n.prototype.onCancel=function(){this.qi.onCancel()},n.prototype.onElementAttached=function(t,n,i){null==n||n.addEventListener("focus",this.nr),null==i||i.addEventListener("focus",this.ir),t.addEventListener("focus",this.tr,!0)},n.prototype.onElementDetached=function(t,n,i){null==n||n.removeEventListener("focus",this.nr),null==i||i.removeEventListener("focus",this.ir),t.removeEventListener("focus",this.tr,!0)},n.prototype.getClipper=function(){var t=this.gr;if(null==t){var n=rt.getLayer(this.zn);t=n?this.$i.clipper.creator(n.getElementContainer()):null,this.gr=t}return t},n.prototype.getElement=function(t){var n=this.cr;return null==n&&(n=this.$i.element.creator(t),this.cr=n),n},n.prototype.getBefore=function(t){var n=this.br;return null==n&&(n=this.$i.before.creator(t),this.br=n),n},n.prototype.getAfter=function(t){var n=this.dr;return null==n&&(n=this.$i.after.creator(t),this.dr=n),n},n.prototype.onBeforeFocus=function(t){var n=this.zn,i=rt.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!1);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onAfterFocus=function(t){var n=this.zn,i=rt.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!0);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onElementFocus=function(t){if(this.when===vr.ALWAYS){var n=this.zn;n.state.isFocused||n.focus()}},n.prototype.onEndByBlur=function(){this.onEnd()},n.prototype.onEnd=function(){this.qi.onEnd()},n.prototype.end=function(){this.onEnd(),this.cancel()},n.prototype.select=function(){return this.Qi&&this.$i.select&&this.doSelect(),this},n.prototype.toClipperRectAdjusted=function(t,n,i){if(i&&t&&null==n){var r=t.x,e=t.y,u=r+t.width,s=e+t.height,h=i.x,o=i.y,a=h+i.width,c=o+i.height,f=Math.min(Math.max(h,r),a),l=Math.min(Math.max(h,u),a),v=Math.min(Math.max(o,e),c),b=Math.min(Math.max(o,s),c);i.x=f,i.y=v,i.width=l-f,i.height=b-v}return i},n.prototype.updateElement=function(t){if(this.Qi){var n=this.zn;if(n.worldVisible){var i=this.cr,r=this.gr;if(i&&r){var e=t.resolution,u=this.getElementRect(e),s=this.getElementMatrix(),h=this.toClipperRectAdjusted(u,s,this.getClipperRect(e)),o=n.state,a=this.qi.getPadding(),c=this.$i;c.clipper.styler(r,o,a,u,s,h),c.element.styler(i,o,a,u,s,h)}}else switch(this.when){case vr.ALWAYS:(r=this.gr)&&(r.style.display="none");break;default:this.cancel()}}},n.getClipperRect=function(t,n,i,r,e){for(var u=!0,s=0,h=0,o=0,a=0,c=t;c instanceof Ki;){c.getClippingRect(n,e),r.set(e.x,e.y),c.toGlobal(r,r,!1);var f=(r.x*i|0)/i,l=(r.y*i|0)/i;r.set(e.x+e.width,e.y+e.height),c.toGlobal(r,r,!0);var v=r.x,b=r.y,d=Math.min(f,v),g=Math.min(l,b),m=Math.max(f,v),w=Math.max(l,b);u?(u=!1,s=d,h=g,o=m,a=w):(s=Math.min(Math.max(s,d),m),h=Math.min(Math.max(h,g),w),o=Math.min(Math.max(o,d),m),a=Math.min(Math.max(a,g),w)),c=c.parent}return u?null:(e.x=s,e.y=h,e.width=o-s,e.height=a-h,e)},n}(),dr=function(n){function i(t){var i=n.call(this)||this;return i.condition=qt.ofString(t.condition),i.utils=new Map,i}return _(i,n),i.prototype.getUtil=function(t,n){var i=this.utils,r=i.get(t);return null==r&&(r=this.newUtil(t,n),i.set(t,r)),r},i.prototype.newUtil=function(t,n){return new br(t,this.newOperation(t,n),K.getInstance().get("DHtmlElement"),this.newUtilOptions(t,n))},i.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},i.prototype.newUtilOptions=function(t,n){return{element:{creator:this.newElementCreator(t,n)},when:this.toWhen(t,n)}},i.prototype.toWhen=function(t,n){var i=this.condition(t,Date.now());if(null!=i&&i in vr)return vr[i]},i.prototype.containsPoint=function(n,r,e){if(n.visible){var u=i.WORK||new t.Point;return i.WORK=u,n.toLocal(e,void 0,u),null!=n.contains(u.x,u.y)}return!1},i.prototype.getPadding=function(t,n){return null},i.prototype.getElementRect=function(t,n,i,r,e){var u=t.transform.pivot,s=t.size,h=s.x,o=s.y;return e.x=-.5*h+u.x,e.y=-.5*o+u.y,e.width=h,e.height=o,e},i.prototype.getElementMatrix=function(t,n){return t.updateTransform(),t.transform.worldTransform},i.prototype.getClipperToRect=function(t,n,i,r,e){var u=or.toContainer(t);return br.getClipperRect(u,t,i,r,e)},i.prototype.onRender=function(t,n,i,r){this.getUtil(t,n).onRender(r)},i.prototype.onFocus=function(t,n){this.getUtil(t,n).onFocus()},i.prototype.onBlur=function(t,n){this.getUtil(t,n).onBlur()},i.prototype.onDowning=function(t,n,i){this.getUtil(t,n).onDowning(i)},i.prototype.onDown=function(t,n,i){this.getUtil(t,n).onDown(i)},i.prototype.onDblClick=function(t,n,i,r){this.getUtil(t,n).onDblClick(i,r)},i}($t),gr={INPUT_TEXT:0,INPUT_INTEGER:1,INPUT_REAL:2,EMIT_EVENT:3,WRITE_BOTH:4,WRITE_LOCAL:5,WRITE_REMOTE:6,HTML_ELEMENT:7,HTML_ELEMENT_WITHOUT_POINTER_EVENTS:8,LAYER_SHOW_HIDE:9,LAYER_GESTURE:10,GESTURE:11},mr=function(t){function n(n){var i=t.call(this,n)||this;return i.elementCreator=qt.ofElementOrNull(n.value),i.noPointerEvent=n.subtype===gr.HTML_ELEMENT_WITHOUT_POINTER_EVENTS,i}return _(n,t),n.prototype.newUtil=function(n,i){return this.noPointerEvent&&n.state.add(lr.NO_POINTER_EVENTS),t.prototype.newUtil.call(this,n,i)},n.prototype.newElementCreator=function(t,n){var i=this.elementCreator;if(i)return function(n){return i(t,Date.now(),n)}},n}(dr),wr=function(t){function n(n,i,r,e){var u,s,h,o,a,c,f,l=t.call(this,n,i,r,e)||this;l.qi=i,l.mr=function(t){l.onInputKeyDown(t)},l.wr=function(){l.onInputChange()},l.pr=function(t){l.onInputInput(t)},l.Or=null!==(u=null==e?void 0:e.description)&&void 0!==u?u:"";var v=null==e?void 0:e.editing;return l.Dr=null!==(a=null!==(s=null==v?void 0:v.formatter)&&void 0!==s?s:null===(o=null===(h=e)||void 0===h?void 0:h.text)||void 0===o?void 0:o.formatter)&&void 0!==a?a:r.getEditingFormatter(),l.Er=null!==(c=null==v?void 0:v.unformatter)&&void 0!==c?c:r.getEditingUnformatter(),l.Mr=null!==(f=null==v?void 0:v.validator)&&void 0!==f?f:r.getEditingValidator(),l}return _(n,t),n.prototype.onEnd=function(){t.prototype.onEnd.call(this),this.onInputChange()},n.prototype.onElementAttached=function(n,i,r){n.value=this.fromValue(this.qi.getValue()),n.addEventListener("change",this.wr),n.addEventListener("input",this.pr),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){t.prototype.onElementDetached.call(this,n,i,r),n.removeEventListener("change",this.wr),n.removeEventListener("input",this.pr)},n.prototype.onInputKeyDown=function(t){Kt.isOkKey(t)?(this.end(),this.qi.onEnter()):Kt.isCancelKey(t)&&this.cancel()},n.prototype.toElementFocused=function(n){t.prototype.toElementFocused.call(this,n),n.scrollTop=0,n.scrollLeft=0},n.prototype.onInputChange=function(){if(this.isShown()){var t=this.element;if(null!=t){var n=this.qi,i=this.toValue(t.value),r=n.getValue();r!==i&&n.onValueChange(i,r)}}},n.prototype.toValue=function(t){return this.Er(t,this)},n.prototype.fromValue=function(t){return void 0!==t?this.Dr(t,this):""},n.prototype.onInputInput=function(t){var n=t.target;n instanceof HTMLInputElement&&this.qi.onValueInput(this.toValue(n.value))},n.prototype.validate=function(){var t=this.qi.getValue();if(void 0!==t){var n=this.Mr(t,this);if(this.Sr!==n){this.Sr=n;var i=this.zn.state;i.isInvalid=null!=n,i.isHovered&&this.qi.applyTitle()}return n}return null},n.prototype.applyTitle=function(){var t=this.Sr;if(at(t)){var n=rt.getLayer(this.zn);return n&&(n.view.title=t),!0}return!1},n}(br),pr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.mr),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.mr),t.prototype.onElementDetached.call(this,n,i,r)},n}(wr),Or=function(t){function n(n,i,r,e){var u,s,h,o=t.call(this,n,i,r,e)||this;return o.Tr=null!==(u=null==e?void 0:e.step)&&void 0!==u?u:r.getStep(),o.jr=null!==(s=null==e?void 0:e.min)&&void 0!==s?s:r.getMin(),o.Nr=null!==(h=null==e?void 0:e.max)&&void 0!==h?h:r.getMax(),o}return _(n,t),Object.defineProperty(n.prototype,"step",{get:function(){return this.Tr},set:function(t){this.Tr!==t&&(this.Tr=t,this.onStepChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.jr},set:function(t){this.jr!==t&&(this.jr=t,this.onMinChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.Nr},set:function(t){this.Nr!==t&&(this.Nr=t,this.onMaxChange())},enumerable:!1,configurable:!0}),n.prototype.toValue=function(n){var i=t.prototype.toValue.call(this,n);if(i==i){var r=this.jr;if(null!=r&&i<r)return r;var e=this.Nr;return null!=e&&e<i?e:i}return 0},n.prototype.fromValue=function(t){return void 0!==t?this.Dr(t,this):"0"},n.prototype.onStepChange=function(){if(this.isShown()){var t=this.element;t&&this.updateStep(t)}},n.prototype.onMinChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMin(t)}},n.prototype.onMaxChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMax(t)}},n.prototype.updateStep=function(t){var n=this.step;t.step=null!=n?""+n:"any"},n.prototype.updateMin=function(t){var n=this.min;null!=n?t.min=""+n:t.removeAttribute("min")},n.prototype.updateMax=function(t){var n=this.max;null!=n?t.max=""+n:t.removeAttribute("max")},n.prototype.onElementAttached=function(n,i,r){n.type="number",t.prototype.onElementAttached.call(this,n,i,r),this.updateStep(n),this.updateMin(n),this.updateMax(n)},n}(pr),Dr={EMIT_EVENT:0,WRITE_BOTH:1,WRITE_LOCAL:2,WRITE_REMOTE:3},Er=function(){function t(){}return t.execute=function(t,n,i,r,e){switch(n){case Dr.EMIT_EVENT:t.emit(i,t,r),or.emit(t,i,r,e);break;case Dr.WRITE_LOCAL:or.write(t,i,r,e,!1);break;case Dr.WRITE_REMOTE:or.write(t,i,r,e,!0);break;case Dr.WRITE_BOTH:or.write(t,i,r,e,!1),or.write(t,i,r,e,!0)}},t}(),Mr=function(t){function n(n){var i=t.call(this,n)||this;return i.target=qt.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i}return _(n,t),n.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){t.text.enable=!1},onCancel:function(){t.text.enable=!0},onEnd:function(){},getValue:function(){return i.getUtil(t,n).toValue(t.text.value)},onValueInput:function(t){},onValueChange:function(r,e){i.onValueChange(t,n,r,e)},onEnter:function(){},applyTitle:function(){}}},n.prototype.newElementCreator=function(t,n){},n.prototype.getPadding=function(t,n){return t.text.padding},n.prototype.onValueChange=function(t,n,i,r){t.text.value=this.getUtil(t,n).fromValue(i);var e=Date.now(),u=this.target(t,e);null!=u&&Er.execute(t,this.onInputAction,u,i,e)},n}(dr),Sr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Mr),Tr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Sr),jr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new Or(t,this.newOperation(t,n),K.getInstance().get("DInputInteger"),this.newUtilOptions(t,n))},n}(Tr),Nr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new Or(t,this.newOperation(t,n),K.getInstance().get("DInputReal"),this.newUtilOptions(t,n))},n}(Tr),Ir=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.type="text",t.prototype.onElementAttached.call(this,n,i,r)},n}(pr),Cr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new Ir(t,this.newOperation(t,n),K.getInstance().get("DInputText"),this.newUtilOptions(t,n))},n}(Sr),Ar=function(t){function n(n){var i=t.call(this,n,Yt.NONE)||this;return i.target=qt.ofStringOrNull(n.target),i.value=qt.ofUnknown(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.target(t,i);null!=r&&this.write(t,r,this.value(t,i),i)}},n}(Qt),Rr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){or.write(t,n,i,r,!1),or.write(t,n,i,r,!0)},n}(Ar),yr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){or.write(t,n,i,r,!1)},n}(Ar),kr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){or.write(t,n,i,r,!0)},n}(Ar),Lr=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.MISC,i,n)||this;return s.target=r,s.onInputAction=e,s.value=u,s}return _(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case gr.INPUT_TEXT:return new Cr(this);case gr.INPUT_INTEGER:return new jr(this);case gr.INPUT_REAL:return new Nr(this);case gr.EMIT_EVENT:return new fr(this);case gr.WRITE_BOTH:return new Rr(this);case gr.WRITE_LOCAL:return new yr(this);case gr.WRITE_REMOTE:return new kr(this);case gr.HTML_ELEMENT:case gr.HTML_ELEMENT_WITHOUT_POINTER_EVENTS:return new mr(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.value);return t.addResource("["+this.type+","+n+","+this.subtype+","+i+","+this.onInputAction+","+r+"]")},n.deserialize=function(t,i){var r=i.resources,e=ln.toResource(1,t,r),u=ln.toResource(3,t,r),s=ln.toResource(5,t,r);return new n(t[2],e,u,t[4],s)},n}(cn),xr={NONE:0,DRAG:1,PINCH:2,ALL:3},Br=t.interaction.InteractionEvent,_r=function(n){function i(t){var i=n.call(this,t,Yt.NONE)||this;return i.Ir=t.gestureType,i.Cr=t.scaleMin,i.Ar=t.scaleMax,i}return _(i,n),i.prototype.onDown=function(t,i,r){n.prototype.onDown.call(this,t,i,r),r instanceof Br&&this.condition(t,r.data.originalEvent.timeStamp)&&this.getGestureUtil().onDown(t,r)},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new rr({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.Ir,c=!1,f=1;if(a&xr.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Ar,Math.max(this.Cr,v*u));f=b/v,l.set(b,b),c=!0}if(a&xr.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&rt.update(t)}},i}(Qt),Pr=function(t){function n(n,i,r,e){var u=t.call(this,fn.MISC,n,gr.GESTURE)||this;return u.gestureType=i,u.scaleMin=r,u.scaleMax=e,u}return _(n,t),n.prototype.toRuntime=function(){return new _r(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.gestureType+","+this.scaleMin+","+this.scaleMax+"]")},n.deserialize=function(t,i){return new n(ln.toResource(1,t,i.resources),t[3],t[4],t[5])},n}(cn),Fr=function(){function n(n,i,r,e,u){this.id=n,this.ref=0;var s=u.resolution;this.frame=new t.Rectangle(0,0,i*s,r*s),this.texture=new t.Texture(u,new t.Rectangle(0,0,1,1)),this.width=i,this.height=r,this.strokeWidth=e}return n.prototype.applyFrame=function(){var t=1/this.texture.baseTexture.resolution;this.texture.frame.x=this.frame.x*t,this.texture.frame.y=this.frame.y*t,this.texture.frame.width=this.width,this.texture.frame.height=this.height,this.texture.updateUvs(),this.texture.emit("update",this)},n.prototype.destroy=function(){this.texture.destroy()},n}(),Ur=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){},n}(Fr),Gr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.save(),t.fillStyle="#ffffff",t.fillRect(n.x-1,n.y-1,n.width+2,n.height+2),t.restore()},n}(Fr),zr=function(){function n(n){var i=this.Yi=document.createElement("canvas");i.width=i.height=256;var r=this.Rr=t.BaseTexture.from(i,{mipmap:t.MIPMAP_MODES.OFF,resolution:n});this.yr={},this.kr=[],this.Lr={empty:new Ur("empty",10,10,0,r),white:new Gr("white",10,10,0,r)},this.un=!0}return n.prototype.updateFrames=function(t,n){for(var i=4,r=4,e=0,u=0,s=n.length;u<s;++u){var h=n[u];t<i+h.frame.width+4&&(i=4,r+=e+4,e=0),h.frame.x=0|i,h.frame.y=0|r,i+=h.frame.width+4,e=Math.max(e,h.frame.height)}for(var o=r+e+4,a=256;a<o;)a<<=1;return Math.min(4096,a)},n.prototype.renderFrames=function(t,n,i){var r=this.Yi;r.width=t,r.height=n;var e=r.getContext("2d");if(null!=e)for(var u=0,s=i.length;u<s;++u)i[u].render(e)},n.prototype.applyFrames=function(t){for(var n=0,i=t.length;n<i;++n)t[n].applyFrame()},n.prototype.calcCanvasWidth=function(t){for(var n=128,i=t.length-1;0<=i;--i)for(var r=t[i],e=Math.max(r.frame.width,r.frame.height);n<e;)n<<=1;return Math.min(4096,n<<1)},n.prototype.cleanup=function(t){t.sort(n.ITEM_COMPARATOR);for(var i=t.length-1;0<=i;--i)if(0<t[i].ref)return void(t.length=i+1);t.length=0},n.prototype.begin=function(){for(var t=this.kr,n=0,i=t.length;n<i;++n)t[n].ref=0;this.un=!1},n.prototype.end=function(){for(var t=this.yr,n=this.kr,i=0,r=n.length;i<r;++i){var e=n[i];e.ref<=0&&(e.id in this.Lr||e.destroy(),delete t[e.id],this.un=!0)}},n.prototype.repack=function(t){if(!0===t||this.un){this.un=!1;var n=this.kr;this.cleanup(n);var i=this.calcCanvasWidth(n),r=this.updateFrames(i,n);this.renderFrames(i,r,n),this.Rr.setRealSize(i,r),this.applyFrames(n)}},n.prototype.get=function(t){var n=this.yr[t];if(null!=n)return n.ref+=1,n;var i=this.Lr[t];return null!=i?(this.set(t,i),i):null},n.prototype.set=function(t,n){var i=this.yr[t];return n.ref+=1,this.yr[t]=n,this.kr.push(n),this.un=!0,i},n.prototype.toDirty=function(){this.un=!0},n.prototype.getDefaultTexture=function(){return this.get("white").texture},n.prototype.getBaseTexture=function(){return this.Rr},n.prototype.release=function(t){var n=this.yr,i=n[t];null!=i&&(i.ref-=1,i.ref<=0&&(i.id in this.Lr||i.destroy(),delete n[t],this.un=!0))},n.ITEM_COMPARATOR=function(t,n){return t.ref<=0?n.ref<=0?0:1:n.ref<=0||t.frame.height<n.frame.height?-1:n.frame.height<t.frame.height?1:t.frame.width-n.frame.width},n}(),Hr=function(t){function n(n,i){var r=t.call(this,n.id,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.canvas=n.canvas,r}return _(n,t),n.prototype.render=function(t){var n=this.canvas;if(null!=n){var i=this.frame;t.drawImage(n,i.x,i.y,i.width,i.height)}},n}(Fr),Vr="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",Wr=function(t,n){this.x=t,this.y=n},Xr=function(t,n,i,r,e){this.ref=1,this.life=10,this.character=t,this.x=0,this.y=0,this.width=i,this.height=r,this.advance=n,this.origin=new Wr(0,0),this.type=e},Kr=function(){function t(){var t=this;this.Br=null,this._r=null,this.Pr=null,this.Fr=NaN,this.Ur=NaN,this.Gr=NaN,this.zr=NaN,this.Hr=null,this.Vr=null;var n=this.Yi=document.createElement("canvas");n.width=64,n.height=64,this.Wr=function(t){t.preventDefault()},this.Xr=function(){t.restore()},this.Kr=function(){t.destroy()},n.addEventListener("webglcontextlost",this.Wr,!1),n.addEventListener("webglcontextrestored",this.Xr,!1),window.addEventListener("unload",this.Kr,!1)}return t.prototype.init=function(){var t=this.Yi;if(null!=t&&(null==this.Br||this.Br.isContextLost())){var n={alpha:!0,antialias:!1,depth:!1,stencil:!1,premultipliedAlpha:!1},i=t.getContext("webgl",n)||t.getContext("experimental-webgl",n);this.Br=i,null!=i&&(i.clearColor(1,1,1,0),this.makeVertexBuffer(),this.makeUvBuffer(),this.makeShaders(),this._r=null)}return this},t.prototype.restore=function(){this.init()},t.prototype.getCanvas=function(){return this.Yi},t.prototype.getShader=function(t,n,i){var r=i?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);return null==r||(t.shaderSource(r,n),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))?r:(console&&console.error("Failed to compile the shader: "+t.getShaderInfoLog(r)),null)},t.prototype.makeShaders=function(){var t=this.Br;if(null!=t&&!0!==t.isContextLost()){var n=this.getShader(t,"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying mediump vec2 vTextureCoord;\nvoid main(void) {\n\tgl_Position = vec4(aVertexPosition, 0.0, 1.0);\n\tvTextureCoord = aTextureCoord;\n}\n",!1);if(null!=n){var i=this.getShader(t,"\nprecision mediump float;\n\nvarying mediump vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec2 uSize;\n\nfloat calcDistance( float x, float y, float dx, float dy ) {\n\tfloat xd = x + dx;\n\tfloat yd = y + dy;\n\tfloat u = xd / uSize.x;\n\tfloat v = yd / uSize.y;\n\tfloat ul = (xd - 1.0) / uSize.x;\n\tfloat vt = (yd - 1.0) / uSize.y;\n\n\tfloat m = texture2D(uSampler, vec2(u , v )).a;\n\tfloat l = texture2D(uSampler, vec2(ul, v )).a;\n\tfloat t = texture2D(uSampler, vec2(u , vt)).a;\n\n\tfloat xl = mix( xd - 1.0, xd, (0.5 - l) / (m - l) );\n\tfloat yt = mix( yd - 1.0, yd, (0.5 - t) / (m - t) );\n\n\tbool bl = ( min(l, m) < 0.5 && 0.5 <= max(l, m) );\n\tbool bt = ( min(t, m) < 0.5 && 0.5 <= max(t, m) );\n\n\tfloat ll = (bl ? length( vec2( xl - x, yd - y ) ) : 100.0);\n\tfloat lt = (bt ? length( vec2( xd - x, yt - y ) ) : 100.0);\n\n\treturn min( ll, lt );\n}\n\nfloat calcDistancesY( float x, float y, float dx ) {\n\tfloat d = 100.0;\n\tfor( float dy=-6.0; dy<6.5; dy++ ) {\n\t\td = min( d, calcDistance( x, y, dx, dy ) );\n\t}\n\treturn d;\n}\n\nfloat calcDistances( float x, float y ) {\n\tfloat d = 100.0;\n\tfor( float dx=-6.0; dx<6.5; dx++ ) {\n\t\td = min( d, calcDistancesY( x, y, dx ) );\n\t}\n\treturn d;\n}\n\nvoid main(void) {\n\tfloat t = texture2D(uSampler, vTextureCoord).a;\n\tfloat x = vTextureCoord.x * uSize.x;\n\tfloat y = vTextureCoord.y * uSize.y;\n\tfloat d = min( 6.0, calcDistances( x, y ) ) / 12.0;\n\td = clamp( mix( 0.5 - d, 0.5 + d, step( 0.5, t ) ), 0.0, 1.0 );\n\tgl_FragColor = vec4(1.0, 1.0, 1.0, d);\n}\n",!0);if(null!=i){var r=this.Pr=t.createProgram();if(null!=r)return t.attachShader(r,n),t.attachShader(r,i),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)?(t.deleteShader(n),t.deleteShader(i),t.useProgram(r),this.Fr=t.getAttribLocation(r,"aVertexPosition"),this.Ur=t.getAttribLocation(r,"aTextureCoord"),this.Gr=t.getUniformLocation(r,"uSampler"),this.zr=t.getUniformLocation(r,"uSize"),t.useProgram(null),r):(console&&console.error("Failed to link the program: "+t.getError()),t.deleteShader(n),t.deleteShader(i),null);t.deleteShader(n),t.deleteShader(i)}else t.deleteShader(n)}}return null},t.prototype.destroyShaders=function(){var t=this.Br;if(null!=t&&!0!==t.isContextLost()){var n=this.Pr;null!=n&&(this.Pr=null,t.useProgram(null),t.deleteProgram(n))}},t.prototype.updateTexture=function(t){var n=this.Br,i=this.Yi;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=t.width,e=t.height;i.width===r&&i.height===e||(i.width=r,i.height=e,n.viewport(0,0,r,e));var u=this._r;return null==u?(u=this._r=n.createTexture(),n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.bindTexture(n.TEXTURE_2D,null)):(n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.bindTexture(n.TEXTURE_2D,null)),u}return null},t.prototype.destroyTexture=function(){var t=this.Br,n=this._r;null!=t&&!0!==t.isContextLost()&&null!=n&&(this._r=null,t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n))},t.prototype.makeVertexBuffer=function(){var t=this.Br;if(null!=t&&!0!==t.isContextLost()){var n=this.Hr=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,1,1,1,-1,-1,1,-1]),t.STATIC_DRAW),n}return null},t.prototype.destroyVertexBuffer=function(){var t=this.Br,n=this.Hr;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.Hr=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.makeUvBuffer=function(){var t=this.Br;if(null!=t&&!0!==t.isContextLost()){var n=this.Vr=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),t.STATIC_DRAW),n}return null},t.prototype.destroyUvBuffer=function(){var t=this.Br,n=this.Vr;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.Vr=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.render=function(){var t=this.Br,n=this.Yi,i=this.Pr,r=this.Hr,e=this.Vr,u=this._r;if(null!=t&&!0!==t.isContextLost()&&null!=n&&null!=i&&null!=r&&null!=e&&null!=u){t.clear(t.COLOR_BUFFER_BIT),t.useProgram(i),t.bindBuffer(t.ARRAY_BUFFER,r);var s=this.Fr;t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,e);var h=this.Ur;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,u),t.uniform1i(this.Gr,0),t.uniform2f(this.zr,n.width,n.height),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.bindTexture(t.TEXTURE_2D,null),t.bindBuffer(t.ARRAY_BUFFER,null),t.useProgram(null)}},t.prototype.read=function(t){var n=this.Br,i=this.Yi;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=i.width,e=i.height;t.width=r,t.height=e;var u=t.getContext("2d");null!=u&&u.drawImage(i,0,0)}},t.prototype.destroy=function(){this.destroyVertexBuffer(),this.destroyUvBuffer(),this.destroyShaders();var t=this.Yi;null!=t&&(this.Yi=null,t.removeEventListener("webglcontextlost",this.Wr,!1),t.removeEventListener("webglcontextrestored",this.Xr,!1),window.removeEventListener("unload",this.Kr,!1));var n=this.Br;if(null!=n){this.Br=null;var i=n.getExtension("WEBGL_lose_context");null!=i&&i.loseContext()}},t.getInstance=function(){return null==t.Yr&&(t.Yr=new t),t.Yr},t.Yr=null,t}(),Yr=function(){function t(n){this.k="font-atlas:"+n,this.Jr=Kr.getInstance().init(),this.Yi=document.createElement("canvas"),this.Zr={family:t.toFontFamily(n),size:32,italic:!1},this.qr={},this.$r=0,this.Mt=1,this.nn=1,this.un=!0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.Zr},set:function(t){this.Zr.family=t.family,this.Zr.size=t.size,this.Zr.italic=t.italic},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.nn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this.Yi},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generator",{get:function(){return this.Jr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"characters",{get:function(){return this.qr},enumerable:!1,configurable:!0}),t.prototype.begin=function(){this.$r=0;var t=this.qr;for(var n in t)t[n].ref=0},t.prototype.end=function(){var t=this.qr;for(var n in t){var i=t[n];i.ref<=0&&(i.life-=1,i.life<=0&&(delete t[n],this.un=!0))}},t.prototype.addAscii=function(){this.addChar(" "," ",5),this.addChar("\t"," ",5),this.addChar("...","...",11);for(var t=0,n=Vr.length;t<n;++t){var i=Vr[t];this.addChar(i,i,11)}},t.prototype.addChar=function(t,n,i){var r=this.qr;if(!this.isIgnored(n)){var e=r[t];null!=e?(e.ref<=0&&(this.$r+=1),e.ref+=1):(r[t]=new Xr(n,0,1,1,i),this.$r+=1,this.un=!0)}},t.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},t.prototype.add=function(t,n){void 0===n&&(n=8);for(var i=b.from(t);i.hasNext();){var r=i.next();this.addChar(r,r,n)}},t.prototype.get=function(t){return this.qr[t]},t.prototype.update=function(){if(this.un){var n=this.Yi,i=this.Jr;if(null!=n&&null!=i){var r=n.getContext("2d");if(null!=r){this.un=!1;var e=this.Zr,u=this.qr,s=e.size+14,h=t.toPowerOf2(Math.ceil(Math.sqrt(this.$r))*s);this.Mt=h;var o=(e.italic?"italic ":"")+e.size+"px "+e.family;r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=0,r.fillStyle="#FFFFFF";var a=s>>1,c=0,f=0;for(var l in u){var v=u[l],b=r.measureText(v.character).width,d=Math.ceil(7+b+7),g=s;h<=c+d&&(c=0,f+=s),v.x=c,v.y=f,v.width=d,v.height=g,v.advance=b,v.origin.x=c+7,v.origin.y=f+a,c+=d}var m=this.nn=f+s;for(var l in n.width=h,n.height=m,r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=4,r.fillStyle="#FFFFFF",r.clearRect(0,0,h,m),u)v=u[l],r.fillText(v.character,v.origin.x,v.origin.y);return i.updateTexture(n),i.render(),i.read(n),!0}}}return!1},Object.defineProperty(t.prototype,"length",{get:function(){return this.$r},enumerable:!1,configurable:!0}),t.prototype.toJson=function(){return{width:this.Mt,height:this.nn,font:this.Zr,characters:this.qr}},t.prototype.toString=function(){return JSON.stringify(this.toJson())},t.prototype.destroy=function(){null!=this.Jr&&(this.Jr=null),null!=this.Yi&&(this.Yi=null);var t=this.qr;for(var n in t)delete t[n]},t.toFontFamily=function(n){return"auto"===n?t.getAutoFontFamily():n},t.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},t.getAutoFontFamily=function(){return null==t.FONT_FAMILY_AUTO&&(t.FONT_FAMILY_AUTO=K.getInstance().get("DBase").getFontFamilly()),t.FONT_FAMILY_AUTO},t.FONT_FAMILY_AUTO=null,t}(),Jr=function(){function t(){this.Qr={}}return t.prototype.begin=function(){var t=this.Qr;for(var n in t)t[n].begin()},t.prototype.end=function(){var t=this.Qr;for(var n in t){var i=t[n];0<i.length&&i.addAscii(),i.end(),i.length<=0&&(i.destroy(),delete t[n])}},t.prototype.add=function(t,n){var i=this.Qr[t];if(null!=i)i.add(n);else{var r=new Yr(t);r.add(n),this.Qr[t]=r}},t.prototype.get=function(t){var n=this.Qr[t];return null!=n?n:null},t.prototype.update=function(t){var n=this.Qr,i=t.getBaseTexture();for(var r in n){var e=n[r];if(e.update()){var u=e.id,s=t.get(u);if(null!=s){var h=e.width,o=e.height,a=i.resolution;s.frame.width=h,s.frame.height=o,s.width=h/a,s.height=o/a,t.toDirty()}else t.set(u,new Hr(e,i))}}},t.prototype.destroy=function(){var t=this.Qr;for(var n in t)t[n].destroy();this.Qr={}},t}(),Zr=function(t){function n(n,i){var r=t.call(this,n.src,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.image=n,r}return _(n,t),n.prototype.render=function(t){var n=this.frame,i=n.x,r=n.y,e=n.width,u=n.height,s=this.image;t.drawImage(s,i,r,e,u),t.drawImage(s,0,0,1,u,i-1,r-1,1,u+2),t.drawImage(s,0,0,e,1,i,r-1,e,1),t.drawImage(s,e-1,0,1,u,i+e,r-1,1,u+2),t.drawImage(s,0,u-1,e,1,i,r+u,e,1)},n}(Fr),qr=function(t,n){this.texture=t,this.indexOffset=n},$r=function(){function t(){this.index=0,this.baseTexture=null,this.units=[]}return t.prototype.begin=function(){this.index=0,this.baseTexture=null},t.prototype.push=function(t,n){if(this.index<this.units.length){var i=this.units[this.index];i.texture=t,i.indexOffset=n}else this.units.push(new qr(t,n));this.index+=1},t.prototype.end=function(){this.units.length!==this.index&&(this.units.length=this.index)},t.prototype.destroy=function(){this.units.length=0},t}(),Qr=function(){function n(t,n){var i=3*t,r=i;this.vertices=new Float32Array(2*r),this.te=r,this.o=0,this.hn=null,this.clippings=new Float32Array(3*r),this.ne=null,this.steps=new Float32Array(6*r),this.ie=null,this.colorFills=new Float32Array(4*r),this.re=null,this.colorStrokes=new Float32Array(4*r),this.ee=null,this.uvs=new Float32Array(2*r),this.cn=null;var e=r<=65535;this.indices=e?new Uint16Array(i):new Uint32Array(i),this.ue=t,this.l=0,this.indexCountRequested=0,this.fn=null,this.se=n,this.he=new $r,this.oe=null}return n.prototype.updateVertices=function(){var t=this.hn;t&&t.update()},n.prototype.updateClippings=function(){var t=this.ne;t&&t.update()},n.prototype.updateSteps=function(){var t=this.ie;t&&t.update()},n.prototype.updateColorFills=function(){var t=this.re;t&&t.update()},n.prototype.updateColorStrokes=function(){var t=this.ee;t&&t.update()},n.prototype.updateUvs=function(){var t=this.cn;t&&t.update()},n.prototype.updateIndices=function(){var t=this.fn;t&&t.update()},n.prototype.getGeometry=function(){var n=this.oe;return null==n&&(this.hn=new t.Buffer(this.vertices,!1,!1),this.ne=new t.Buffer(this.clippings,!1,!1),this.ie=new t.Buffer(this.steps,!1,!1),this.re=new t.Buffer(this.colorFills,!1,!1),this.ee=new t.Buffer(this.colorStrokes,!1,!1),this.cn=new t.Buffer(this.uvs,!1,!1),this.fn=new t.Buffer(this.indices,!1,!0),this.oe=n=(new t.Geometry).addIndex(this.fn).addAttribute("aPosition",this.hn,2).addAttribute("aClipping",this.ne,3).addAttribute("aStep",this.ie,2).addAttribute("aAntialias",this.ie,4).addAttribute("aColorFill",this.re,4).addAttribute("aColorStroke",this.ee,4).addAttribute("aUv",this.cn,2)),n},n.prototype.upload=function(){this.se.geometry.bind(this.getGeometry())},n.prototype.render=function(n){var i=this.se;i.geometry.bind(this.getGeometry());var r=this.he.units,e=r.length;if(0<e){for(var u=t.DRAW_MODES.TRIANGLES,s=null,h=r[0],o=0,a=3*h.indexOffset,c=0,f=t.Texture.WHITE,l=0,v=e-1;l<v;++l)s=h,o=a,c=(a=3*(h=r[l+1]).indexOffset)-o,f=s.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,o));c=3*this.l-a,f=h.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,a))}},n.prototype.isCompatible=function(t,n,i,r){return n.getBuffer()===this&&n.getVertexOffset()===i&&n.getIndexOffset()===r&&n.isCompatible(t)},n.prototype.update=function(t,n,i){var u=this.he;u.begin();for(var s=0,h=0,o=t.get();null!=o&&null!=(a=o.uploaded)&&this.isCompatible(o,a,s,h);o=t.next())if(a.update(o),a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i)return t.next(),u.end(),this.o=s,this.l=h,0<u.units.length;for(;null!=o;o=t.next()){var a,c=e[o.type]||e[r.GROUP];if(null==c)break;if(null==(a=c(this,o,s,h,n)))break;if(a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i){t.next();break}}return u.end(),this.o=s,this.l=h,0<u.units.length},n.prototype.check=function(t,n,i,r){return this.indexCountRequested=r,t+i<=this.te&&n+r<=this.ue},n.prototype.destroy=function(){var t=this.oe;t&&t.destroy(),this.he.destroy()},n}(),te=[],ne=function(){function t(){this.index=0,this.shapes=te}return t.prototype.reset=function(t){this.index=-1,this.shapes=t},t.prototype.next=function(){var t=this.index+1;this.index=t;var n=this.shapes;return t<n.length?n[t]:null},t}(),ie=function(){function t(){this.ae=-1,this.ce=new ne,this.$i=[this.ce],this.fe=null}return t.prototype.reset=function(t,n){this.ae=0;var i=this.$i[0];return this.ce=i,i.reset(n),null!=t?(this.fe=t,t):this.next()},t.prototype.get=function(){return this.fe},t.prototype.next=function(){var t=this.ce.next();if(null!=t){this.fe=t;var n=t.children;if(0<n.length)if((r=this.ae=this.ae+1)<(e=this.$i).length)(i=e[r]).reset(n),this.ce=i;else{var i=new ne;e.push(i),i.reset(n),this.ce=i}return t}var r=this.ae=this.ae-1,e=this.$i;return 0<=r?(this.ce=e[r],this.fe=null,this.next()):(this.fe=null,null)},t}(),re=function(n){function i(r){var e=n.call(this,r)||this;return i.SHADER=i.SHADER||t.Shader.from("\nattribute vec2 aPosition;\nattribute vec3 aClipping;\nattribute vec2 aStep;\nattribute vec4 aAntialias;\nattribute vec4 aColorFill;\nattribute vec4 aColorStroke;\nattribute vec2 aUv;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mediump float shapeScale;\nuniform mediump float pixelScale;\nuniform mediump float antialiasWeight;\n\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nvec2 toInverse( in vec2 v ) {\n\treturn vec2( -v.y, v.x );\n}\n\nvec2 toTransformedPosition( in vec2 v ) {\n\treturn (projectionMatrix * translationMatrix * vec3(v, 1.0)).xy;\n}\n\nvec4 toAntialias01( in vec4 antialias ) {\n\t// Taylor series of 1 / ( 1 - a ) = 1 + a + a^2 + ....\n\treturn 1.0 + min( vec4( 1.0 ), antialias * pixelScale );\n}\n\nvec4 toAntialias2( in vec4 antialias, in float strokeWidth ) {\n\tfloat x = min( 0.4, 0.4 / 12.0 * antialias.x * pixelScale * antialiasWeight );\n\tfloat w = clamp( strokeWidth / antialias.y, 0.0, 1.0 ) * 0.4;\n\tfloat p = w * antialias.z + antialias.w;\n\tfloat y = 0.5 - p;\n\tfloat z = 0.5 - p - w;\n\treturn vec4( y, z, y - max( 0.01, y - x ), z - max( 0.01, z - x ) );\n}\n\nvec2 toPosition3456( in float type, in vec2 p, in vec2 pprev, in vec2 pnext, in float strokeWidth, out float shift ) {\n\tvec2 d0 = p - pprev;\n\tvec2 d1 = pnext - p;\n\tfloat l0 = dot( d0, d0 );\n\tfloat l1 = dot( d1, d1 );\n\tvec2 nd0 = normalize( toInverse( d0 ) );\n\tvec2 nd1 = normalize( toInverse( d1 ) );\n\tvec2 nd2 = 0.00001 < l1 ? nd1 : vec2(0.0, 0.0);\n\tvec2 n0 = 0.00001 < l0 ? nd0 : nd2;\n\tvec2 n1 = 0.00001 < l1 ? nd1 : n0;\n\tvec2 n0i = toInverse( n0 );\n\tvec2 n1i = toInverse( n1 );\n\tfloat direction = sign( 4.5 - type );\n\n\t// Offset\n\tfloat cross = dot( n0i, n1 );\n\tfloat crossInverse = ( 0.00001 < abs( cross ) ? 1.0 / cross : 0.0 );\n\tfloat b = dot(n1 - n0, n0) * crossInverse;\n\tfloat offsetSize = direction * strokeWidth * 0.5;\n\tvec2 offset = n1 + n1i * b;\n\n\t// Miter\n\tvec2 pmiter = p + offsetSize * offset;\n\tfloat miterAngle0 = dot( n0i, pmiter - pprev );\n\tfloat miterAngle1 = dot( n1i, pmiter - pnext );\n\tfloat miterLength = dot( offset, offset );\n\tfloat miterSide = direction * cross;\n\n\t// Bevel\n\tvec2 n = ( type == 4.0 || type == 6.0 ? n1 : n0 );\n\tvec2 pbevel = p + offsetSize * n;\n\n\t//\n\tvec2 presult = (\n\t\t0.0 <= miterSide ?\n\t\t( miterAngle0 < 0.0 && 0.0 <= miterAngle1 ? pmiter : pbevel ) :\n\t\t( miterLength < 6.0 ? pmiter : pbevel )\n\t);\n\tvec2 ni = ( type == 4.0 || type == 6.0 ? n1i : n0i );\n\tshift = dot( ni, p - presult );\n\treturn toTransformedPosition( presult );\n}\n\nvec2 toStep3456( in float type ) {\n\treturn ( type < 4.5 ? vec2( 1.0, 0.0 ) : vec2( 0.0, 1.0 ) );\n}\n\nvec4 toAntialias3456( in float strokeWidth ) {\n\tfloat a = antialiasWeight / max( 0.0001, strokeWidth );\n\treturn toAntialias01( vec4( a, a, a, a ) );\n}\n\nfloat toDotAndDashScale( in float scale, in float strokeWidthScale ) {\n\treturn (\n\t\tscale == 4.0 || scale == 5.0 || scale == 6.0 || scale == 7.0 ?\n\t\tstrokeWidthScale : 1.0\n\t);\n}\n\nvec4 toColorStroke3456( in float shift, in float scale ) {\n\tfloat x = aColorFill.x + shift;\n\tfloat y = scale * aColorFill.y;\n\tfloat z = scale * aColorFill.z;\n\tfloat w = aColorFill.w;\n\treturn vec4( x, y, z, w );\n}\n\nfloat toStrokeWidthScale( in float scale ) {\n\treturn (\n\t\tscale == 3.0 || scale == 7.0 ?\n\t\tshapeScale : (\n\t\t\tscale == 1.0 || scale == 5.0 ?\n\t\t\tmin( 1.0, shapeScale ) : (\n\t\t\t\tscale == 2.0 || scale == 6.0 ?\n\t\t\t\tmax( 1.0, shapeScale ) : 1.0\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec2 toStep01(in vec2 size, in vec2 weight, in vec2 strokeWidth) {\n\treturn weight / max(vec2(0.00001), vec2(1.0) - strokeWidth / size);\n}\n\nvec4 toAntialias01b(in vec2 size, in vec2 strokeWidth) {\n\treturn antialiasWeight / max(vec4(0.00001), vec4(size - strokeWidth, size));\n}\n\nvoid main(void) {\n\tvec2 p012 = toTransformedPosition( aPosition );\n\n\tfloat type = aClipping.z;\n\tfloat strokeWidthScale = toStrokeWidthScale( aStep.y );\n\tfloat strokeWidth = strokeWidthScale * aStep.x;\n\n\t// type === 0 or 1\n\tvec2 size01 = aAntialias.xy;\n\tvec2 weight01 = abs(aAntialias.zw - sign(aAntialias.zw));\n\tvec2 strokeWidth01 = step(vec2(0.0), aAntialias.zw) * strokeWidth;\n\tvec2 step01 = toStep01( size01, weight01, strokeWidth01 );\n\tvec4 a01 = toAntialias01( toAntialias01b( size01, strokeWidth01 ) );\n\n\t// type === 2\n\tvec4 a2 = toAntialias2( aAntialias, strokeWidth );\n\n\t// type === 3, 4, 5 or 6\n\tfloat shift3456 = 0.0;\n\tvec2 p3456 = toPosition3456( type, aPosition, aAntialias.xy, aAntialias.zw, strokeWidth, shift3456 );\n\tvec2 step3456 = toStep3456( type );\n\tvec4 a3456 = toAntialias3456( strokeWidth );\n\tvec4 colorStroke3456 = toColorStroke3456( shift3456, toDotAndDashScale( aStep.y, strokeWidthScale ) );\n\n\t//\n\tgl_Position = vec4( ( 2.5 < type ? p3456 : p012 ), 0.0, 1.0 );\n\tvAntialias = ( 1.5 < type ? ( 2.5 < type ? a3456 : a2 ) : a01 );\n\tvClipping = aClipping;\n\tvStep = ( 2.5 < type ? step3456 : step01 );\n\tvColorFill = ( 2.5 < type ? aColorStroke : aColorFill );\n\tvColorStroke = ( 2.5 < type ? colorStroke3456 : aColorStroke );\n\tvUv = aUv;\n}","\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nuniform sampler2D sampler;\nuniform mediump float pixelScale;\n\nvoid main(void) {\n\tvec4 texture = texture2D(sampler, vUv);\n\tfloat type = vClipping.z;\n\tvec2 v0 = vStep;\n\tvec2 v1 = vClipping.xy;\n\tvec2 v2 = v0 * vAntialias.xy;\n\tvec2 v3 = v1 * vAntialias.zw;\n\tvec2 d01 = ( v0.x < v0.y ? vec2( v0.y, v2.y ) : vec2( v0.x, v2.x ) );\n\tvec2 d02 = ( v1.x < v1.y ? vec2( v1.y, v3.y ) : vec2( v1.x, v3.x ) );\n\tvec4 d0 = vec4( d01.x, d02.x, d01.y, d02.y );\n\tvec4 d1 = vec4( dot( v0, v0 ), dot( v1, v1 ), dot( v2, v2 ), dot( v3, v3 ) );\n\tvec4 d = ( type == 1.0 ? d1 : d0 );\n\tvec2 s = smoothstep( 1.0 - (d.zw - d.xy), vec2( 1.0 ), d.xy );\n\tvec4 color01 = texture * (vColorStroke * (s.x - s.y) + vColorFill * (1.0 - s.x));\n\n\tfloat l = vColorStroke.x;\n\tfloat lp0 = vColorStroke.y;\n\tfloat lp1 = vColorStroke.z;\n\tfloat lt = vColorStroke.w;\n\tfloat ld = 0.5 * pixelScale;\n\tfloat lm = mod( l, lp0 + lp1 );\n\tfloat ls0 = ( 0.0 < lp1 ? smoothstep( 0.0, ld, lm ) - smoothstep( lp0, lp0 + ld, lm ) : 1.0 );\n\tfloat ls1 = ( 0.0 <= lt ? smoothstep( 0.0, ld, l ) - smoothstep( lt - ld, lt, l ) : 1.0 );\n\tvec4 color3456 = color01 * ls0 * ls1;\n\n\tvec2 a0 = vAntialias.xy;\n\tvec2 a1 = vAntialias.zw;\n\tvec2 a2 = vec2( texture.a );\n\tvec2 a = smoothstep( a0 - a1, a0 + a1, a2 );\n\tvec4 color2 = a.x * vColorFill + ( a.y - a.x ) * vColorStroke;\n\tgl_FragColor = ( type == 2.0 ? color2 : (2.5 < type ? color3456 : color01) );\n}"),e.le=i.SHADER,e.ve=new ie,e.be=e.getBufferSizeMax(r),e}return _(i,n),i.prototype.getBufferSizeMax=function(t){var n=t.context,i=n.extensions;return 1<n.webGLVersion||i.uint32ElementIndex?1431655765:21845},i.prototype.updateAtlas=function(t,n,i,r,e){var u=t.imageSrc;if(null!=u){var s=n.get(u);if(null!=s)t.texture=s.texture;else{var h=t.image;if(null!=h){var o=new Zr(h,e);t.texture=o.texture,n.set(o.id,o)}else t.texture=r}}else t.texture=r;var a=t.text,c=a.value;0<c.length&&i.add(a.family,c)},i.prototype.updateAtlases=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];this.updateAtlas(h,n,i,r,e);for(var o=h.children,a=0,c=o.length;a<c;++a){var f=o[a];this.updateAtlas(f,n,i,r,e),this.updateAtlases(f.children,n,i,r,e)}}},i.prototype.updateFontAtlas=function(t,n,i,r){var e=t.text,u=i.get(e.family);if(null!=u){var s=n.get(u.id);null!=s?(e.atlas=u,e.texture=s.texture):(e.atlas=void 0,e.texture=r)}else e.atlas=void 0,e.texture=r},i.prototype.updateFontAtlases=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];this.updateFontAtlas(s,n,i,r);for(var h=s.children,o=0,a=h.length;o<a;++o){var c=h[o];this.updateFontAtlas(c,n,i,r),this.updateFontAtlases(c.children,n,i,r)}}},i.prototype.de=function(n,i,r,e){var u=this.renderer,s=this.le;if(null!=s&&(null!=i||0<r.length)){var h=u.resolution,o=n.getBuffers(),a=n.getAntialiasWeight(h);if(e){var c=n.getAtlas(h),f=n.getFontAtlases();c.begin(),f.begin();var l=c.getDefaultTexture(),v=c.getBaseTexture();this.updateAtlases(r,c,f,l,v),f.end(),f.update(c),this.updateFontAtlases(r,c,f,l),c.end(),c.repack(),this.updateBuffers(i,r,o,u,a)}s.uniforms.shapeScale=n.toShapeScale(),s.uniforms.pixelScale=n.toPixelScale(h),s.uniforms.antialiasWeight=a,s.uniforms.translationMatrix=n.worldTransform.toArray(!0),u.shader.bind(s,!1),u.state.setBlendMode(t.utils.correctBlendMode(t.BLEND_MODES.NORMAL,!0));var b=o.length;if(1<b)for(var d=0;d<b;++d)o[d].upload();for(d=0;d<b;++d)o[d].render(s)}},i.prototype.updateBuffers=function(t,n,i,r,e){var u=this.ve;u.reset(t,n);for(var s=0,h=0,o=5e3,a=this.be;null!=u.get();){var c=null,f=!1;if(0<h?(c=new Qr(h,r),i.splice(s,0,c),f=!0):s<i.length?(c=i[s],f=!1):(c=new Qr(o,r),i.push(c),f=!1),c.update(u,e,f))h=0,s+=1;else{if(!((h=c.indexCountRequested)<=a))break;h=Math.ceil(h/o)*o,h=Math.min(h,a)}}if(s<i.length){for(var l=s,v=i.length;l<v;++l)i[l].destroy();i.length=s}},i.SHADER=null,i}(t.ObjectRenderer),ee=function(n){function i(){var i=n.call(this)||this;return i.ge=null,i.children=[],i.me=null,i.we=0,i.pe=-1,i.Oe=null,i.De=new Jr,i.Ee=1,i.Me=NaN,i.Se=1,i.Te=NaN,i.je=new t.Point,i.Ne=[],i}return _(i,n),i.prototype.calculateBounds=function(){this._bounds.clear()},i.prototype.onChildTransformChange=function(){},i.prototype.toDirty=function(){return this.we+=1},i.prototype.isDirty=function(){return this.pe<this.we},i.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var n=this.we,i=this.pe;this.pe=n;var r=i<n,e=this.ge;null==e&&(e=this.ge=new re(t)),t.batch.setObjectRenderer(e);var u=this.mask,s=this.me,h=this.children;u?(t.mask.push(this,u),e.de(this,s,h,r),t.mask.pop(this)):e.de(this,s,h,r)}},i.prototype.containsPoint=function(t){return!1},i.prototype.getFontAtlases=function(){return this.De},i.prototype.getAtlas=function(t){var n=this.Oe;return null==n&&(n=new zr(t),this.Oe=n),n},i.prototype.getBuffers=function(){return this.Ne},i.prototype.toShapeScale=function(){this.updateTransform();var t=this.transform,n=t._worldID;if(n!==this.Te){this.Te=n;var i=t.worldTransform,r=i.a,e=i.b;this.Se=1/Math.sqrt(r*r+e*e)}return this.Se},i.prototype.getShapeScale=function(){return this.Se},i.prototype.toPixelScale=function(t){var n=this.toShapeScale(),i=this.Te;return this.Me!==i&&(this.Me=i,this.Ee=1/t*n),this.Ee},i.prototype.getPixelScale=function(){return this.Ee},i.prototype.getAntialiasWeight=function(t){return 1.25/t},i.prototype.hitTest=function(t,n){for(var i=this.je,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible){u.toLocal(t,void 0,i);var s=u.contains(i.x,i.y);if(null!=s&&(null==n||n(s)))return s}}return null},i.prototype.hitTestBBox=function(t,n){for(var i=this.je,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible&&(u.toLocal(t,void 0,i),u.containsBBox(i.x,i.y)&&(null==n||n(u))))return u}return null},i.prototype.destroy=function(){var t=this.Ne;if(null!=t)for(var i=0,r=t.length;i<r;++i)t[i].destroy();this.Ne.length=0;var e=this.children;for(i=e.length-1;0<=i;--i)e[i].destroy();e.length=0,n.prototype.destroy.call(this)},i}(t.DisplayObject),ue=function(){function t(){}return t.toLayers=function(t,n){var i=[],r=this.toLayer(t);if(r){var e=r.parent;if(e)for(var u=e.children,s=u.length,h=0,o=n.length;h<o;++h){var a=n[h];0<=a&&a<s&&i.push(u[a])}}return i},t.toLayer=function(t){for(var n=t.parent;null!=n;){if(n instanceof ee)return n;if(n.type===r.EMBEDDED_LAYER)return n;n=n.parent}return null},t.show=function(t){return!t.visible&&(t.visible=!0,!0)},t.showAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible||(e.visible=!0,n=!0)}return n},t.hide=function(t){return!!t.visible&&(t.visible=!1,!0)},t.hideAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible&&(e.visible=!1,n=!0)}return n},t.bringToFront=function(t){var n=t.parent;return!!n&&this.doBringToFront(t,n.children,0)},t.bringAllToFront=function(t){var n=t.length;if(0<n){var i=t[0].parent;if(i){for(var r=!1,e=i.children,u=0;u<n;++u){var s=t[n-1-u];this.doBringToFront(s,e,u)&&(r=!0)}return r}}return!1},t.doBringToFront=function(t,n,i){for(var r=n.length-1-i,e=r;0<=e;--e){var u=n[e];if(u===t){if(e!==r){for(var s=e+1;s<=r;++s)n[s-1]=n[s];return n[r]=u,!0}return!1}}return!1},t}(),se=t.interaction.InteractionEvent,he=function(n){function i(t){var i=n.call(this,t,Yt.NONE)||this;return i.Ie=new Map,i.Ir=t.gestureType,i.Cr=t.scaleMin,i.Ar=t.scaleMax,i}return _(i,n),i.prototype.initialize=function(t,i){if(n.prototype.initialize.call(this,t,i),null==this.Ie.get(t)){var r=ue.toLayer(t);null!=r&&this.Ie.set(t,r)}},i.prototype.onDown=function(t,i,r){if(n.prototype.onDown.call(this,t,i,r),r instanceof se){var e=this.Ie.get(t);e&&this.condition(t,r.data.originalEvent.timeStamp)&&this.getGestureUtil().onDown(e,r)}},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new rr({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.Ir,c=!1,f=1;if(a&xr.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Ar,Math.max(this.Cr,v*u));f=b/v,l.set(b,b),c=!0}if(a&xr.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&rt.update(t)}},i.prototype.toSize=function(t,n){return"size"in t?n.copyFrom(t.size):n.set(t.width,t.height),n},i}(Qt),oe=function(t){function n(n,i,r,e){void 0===n&&(n=""),void 0===i&&(i=xr.ALL),void 0===r&&(r=.05),void 0===e&&(e=20);var u=t.call(this,fn.MISC,n,gr.LAYER_GESTURE)||this;return u.gestureType=i,u.scaleMin=r,u.scaleMax=e,u}return _(n,t),n.prototype.toRuntime=function(){return new he(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.gestureType+","+this.scaleMin+","+this.scaleMax+"]")},n.deserialize=function(t,i){return new n(ln.toResource(1,t,i.resources),t[3],t[4],t[5])},n}(cn),ae=function(t){function n(n){var i=t.call(this,n,Yt.NONE)||this;return i.$i=new Map,i.Ie=n.layers,i.Ce=n.bringToFront,i}return _(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i);var r=this.$i.get(n);null==r&&null!=(r=this.newData(n))&&this.$i.set(n,r)},n.prototype.execute=function(t,n,i){var r=this.$i.get(t);if(r){var e=this.condition(t,i);if(r.condition!==e){r.condition=e;var u=r.layers;e?r.bringToFront?(ue.bringAllToFront(u),ue.showAll(u)):ue.showAll(u):ue.hideAll(u)}}},n.prototype.newData=function(t){var n=ue.toLayers(t,this.Ie);if(0<n.length)return{layers:n,bringToFront:this.Ce,condition:null}},n}(Qt),ce=function(t){function n(n,i,r){var e=t.call(this,fn.MISC,n,gr.LAYER_SHOW_HIDE)||this;return e.layers=i,e.bringToFront=r,e}return _(n,t),n.prototype.toRuntime=function(){return new ae(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=this.serializeLayers(t),r=this.bringToFront?1:0;return t.addResource("["+this.type+","+n+","+this.subtype+","+i+","+r+"]")},n.prototype.serializeLayers=function(t){for(var n=this.layers,i="[",r="",e=0,u=n.length;e<u;++e)i+=r+n[e],r=",";return i+="]",t.addResource(i)},n.deserialize=function(t,i){return new n(ln.toResource(1,t,i.resources),this.deserializeLayers(t[3],i),!!t[4])},n.deserializeLayers=function(t,n){var i=n.resources,r=i.length;return 0<=t&&t<r?JSON.parse(i[t]):[]},n}(cn),fe={CLICKED:0,DOUBLE_CLICKED:1},le={LEFT:0,CENTER:1,RIGHT:2},ve={TOP:0,MIDDLE:1,BOTTOM:2},be={TEXT:0,PADDING:1,BORDER:2},de=function(){function t(t){this.Xt=t}return t.prototype.getImageAlignHorizontal=function(){return this.Xt.getSecondaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.Xt.getSecondaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.Xt.getSecondaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.Xt.getSecondaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.Xt.getSecondaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.Xt.getSecondaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.Xt.getSecondaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.Xt.getSecondaryImageSource(t)},t}(),ge=function(){function t(t){this.Xt=t}return t.prototype.getImageAlignHorizontal=function(){return this.Xt.getTertiaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.Xt.getTertiaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.Xt.getTertiaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.Xt.getTertiaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.Xt.getTertiaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.Xt.getTertiaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.Xt.getTertiaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.Xt.getTertiaryImageSource(t)},t}(),me=function(){function n(n,i,r,e){var u=this;this.O=n,this.Xt=i,this.Ae=r,this.bt=null,this.St=function(t,n){var i,r,e,u=null==n?void 0:n.align;return{with:di(null!==(i=null==u?void 0:u.with)&&void 0!==i?i:t.getImageAlignWith(),be),vertical:di(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getImageAlignVertical(),ve),horizontal:di(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getImageAlignHorizontal(),le)}}(i,e),this.Re=function(t,n){var i,r,e=null==n?void 0:n.margin;return{vertical:null!==(i=null==e?void 0:e.vertical)&&void 0!==i?i:t.getImageMarginVertial(),horizontal:null!==(r=null==e?void 0:e.horizontal)&&void 0!==r?r:t.getImageMarginHorizontal()}}(i,e),this.ye=null==e?void 0:e.tint,this.ke=new t.Rectangle,this.Le=null==e?void 0:e.source,this.xe=null,this.Be=function(){u.onUpdate()}}return Object.defineProperty(n.prototype,"image",{get:function(){return this.bt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"align",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Re},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bound",{get:function(){return this.ke},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"source",{get:function(){return this.Le},set:function(t){this.Le!==t&&(this.Le=t,this.onUpdate())},enumerable:!1,configurable:!0}),n.prototype.computeSource=function(){var t=this.Le;if(void 0!==t){if(!ot(t))return t;var n=t(this.O.state);if(void 0!==n)return n}return this.Xt.getImageSource(this.O.state)},n.prototype.onStateChange=function(t,n){this.updateTint()},n.prototype.updateBound=function(){var t=this.ke,n=this.bt;if(null!=n){n.updateTransform(),n.getLocalBounds(t);var i=t.left,r=t.top,e=t.right,u=t.bottom,s=n.localTransform,h=s.a,o=s.b,a=s.c,c=s.d,f=h*i+a*r,l=o*i+c*r,v=h*e+a*r,b=o*e+c*r,d=h*e+a*u,g=o*e+c*u,m=h*i+a*u,w=o*i+c*u,p=Math.min(f,v,d,m),O=Math.max(f,v,d,m),D=Math.min(l,b,g,w),E=Math.max(l,b,g,w);t.x=p+s.tx,t.y=D+s.ty,t.width=O-p,t.height=E-D}else t.x=0,t.y=0,t.width=0,t.height=0},n.prototype.isTintAware=function(t){return null!=t&&"tint"in t},n.prototype.toTintColor=function(t,n){var i=this.ye;if(i){var r=i.color;if(void 0!==r){if(!ot(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintColor(n)},n.prototype.toTintAlpha=function(t,n){var i=this.ye;if(i){var r=i.alpha;if(void 0!==r){if(!ot(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintAlpha(n)},n.prototype.updateTint=function(){var t=this.bt;if(t&&this.isTintAware(t)){var n=this.Xt,i=this.O.state,r=this.toTintColor(n,i);if(null!=r){var e=!1;t.tint!==r&&(t.tint=r,e=!0);var u=this.toTintAlpha(n,i);return t.alpha!==u&&(t.alpha=u,e=!0),e}}return!1},n.prototype.updateSource=function(){var n=this.computeSource(),i=this.xe;if(n!==i){this.xe=n;var r,e=this.O,u=this.bt,s=this.Be;if(n instanceof t.Texture)if(i instanceof t.Texture)i.off("update",s),u instanceof t.Sprite&&(u.texture=n,n.on("update",s));else{null!=u&&e.removeChild(u);var h=new t.Sprite(n);(r=e.getOverflowMask())&&(h.mask=r),n.on("update",s),e.addChild(h),this.bt=h}else i instanceof t.Texture?(i.off("update",s),null!=u&&(e.removeChild(u),u.destroy())):null!=u&&e.removeChild(u),null!=n&&((r=e.getOverflowMask())&&(n.mask=r),e.addChild(n)),this.bt=n;return!0}return!1},n.prototype.isRefitable=function(t){return null!=t&&t===this.bt},n.prototype.destroy=function(){var n=this.bt;if(n){this.bt=null;var i=this.xe;i instanceof t.Texture&&(i.off("update",this.Be,this),n.destroy())}},n.prototype.onUpdate=function(){this.O.toDirty(),rt.update(this.O)},n}(),we=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){this.clear(),this.beginFill(16777215,1),this.drawRect(0,0,n,i),this.endFill()},n}(t.Graphics),pe=function(){function t(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r}return t.prototype.set=function(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r},t}(),Oe=function(){function t(){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.characters=[],this.clipped=!1,this.x=0,this.y=0}return t.prototype.start=function(t,n){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.clipped=!1,this.x=0,this.y=.5*(t-n)},t.prototype.isPushable=function(t,n){return!(t<this.x+n.advance&&!(4&n.type))},t.prototype.isPushableAtNewLine=function(t,n,i){return this.y+1.5*n+.5*i<=t},t.prototype.push=function(t,n){var i=this.x;this.x+=t.advance;var r=this.y,e=this.count,u=this.characters;e<u.length?u[e].set(i,r,t,n):u.push(new pe(i,r,t,n)),this.count+=1,this.countPerLine+=1},t.prototype.newLine=function(t){this.width=Math.max(this.width,this.x),this.x=0,this.y+=t,this.countPerLine=0},t.prototype.wordWrap=function(t){var n=this.countPerLine,i=this.characters;if(0<n){for(var r=this.count,e=r-1,u=r-n;u<e;--e){var s=i[e];if(s.wrappable){var h=s.character.advance,o=s.y+t;s.x=0,s.y=o;for(var a=e+1;a<r;++a)(s=i[a]).x=h,s.y=o,h+=s.character.advance;return this.x=h,this.y=o,this.countPerLine=r-e,!0}}var c=i[r-1];return c.x=0,c.y=c.y+t,this.x=c.character.advance,this.y=c.y,this.countPerLine=1,!1}return!1},t.prototype.pop=function(){var t=this.countPerLine,n=this.characters;if(0<t){var i=n[this.count-1];return this.x-=i.character.advance,this.count-=1,this.countPerLine-=1,!0}return!1},t.prototype.end=function(t,n){this.newLine(t),this.y-=.5*(t-n),this.height=this.y},t}(),De={NONE:0,NORMAL:1,BREAK_ALL:2},Ee="\n",Me=function(){function t(){}return t.measure=function(n,i,r){var e=t.RESULT||new Oe;if(t.RESULT=e,null!=i){var u=b.from(n),s=i.font.height,h=r.lineHeight,o=r.enable,a=r.width,c=r.height,f=r.wordWrap;switch(e.start(h,s),f){case De.BREAK_ALL:o?this.measure1(u,a,c,s,h,i,e):this.measure2(u,a,h,i,e);break;case De.NORMAL:var l=this.newLineBreaker(n);l?o?this.measure1a(l,u,a,c,s,h,i,e):this.measure2a(l,u,a,h,i,e):o?this.measure1b(u,a,c,s,h,i,e):this.measure2b(u,a,h,i,e);break;default:o?this.measure3(u,a,h,i,e):this.measure4(u,h,i,e)}e.end(h,s)}else e.start(0,0),e.end(0,0);return e},t.measure1a=function(t,n,i,r,e,u,s,h){for(var o=t.next();n.hasNext();){var a=n.position,c=n.next();if(c===Ee)h.newLine(u);else{var f=s.get(c);if(null==f)continue;o=this.advance(a,o,t);var l=this.isWrappable1(a,o);h.isPushable(i,f)?h.push(f,l):h.isPushableAtNewLine(r,u,e)?(h.push(f,l),h.wordWrap(u)):this.measure5(n,i,u,s,h,!0)}}},t.measure1b=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===Ee)s.newLine(e);else{var o=u.get(h);if(null==o)continue;var a=this.isWrappable2(s,o);s.isPushable(n,o)?s.push(o,a):s.isPushableAtNewLine(i,e,r)?(s.push(o,a),s.wordWrap(e)):this.measure5(t,n,e,u,s,!0)}}},t.measure1=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===Ee)s.newLine(e);else{var o=u.get(h);if(null==o)continue;s.isPushable(n,o)?s.push(o,!0):s.isPushableAtNewLine(i,e,r)?(s.newLine(e),s.push(o,!0)):this.measure5(t,n,e,u,s,!0)}}},t.measure2a=function(t,n,i,r,e,u){for(var s=t.next();n.hasNext();){var h=n.position,o=n.next();if(o===Ee)u.newLine(r);else{var a=e.get(o);if(null==a)continue;s=this.advance(h,s,t);var c=this.isWrappable1(h,s);u.isPushable(i,a)?u.push(a,c):(u.push(a,c),u.wordWrap(r))}}},t.measure2b=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===Ee)e.newLine(i);else{var s=r.get(u);if(null==s)continue;var h=this.isWrappable2(e,s);e.isPushable(n,s)?e.push(s,h):(e.push(s,h),e.wordWrap(i))}}},t.measure2=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===Ee)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)||e.newLine(i),e.push(s,!1)}}},t.measure3=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===Ee)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)?e.push(s,!1):this.measure5(t,n,i,r,e,!1)}}},t.measure4=function(t,n,i,r){for(;t.hasNext();){var e=t.next();if(e===Ee)r.newLine(n);else{var u=i.get(e);if(null==u)continue;r.push(u,!1)}}},t.measure5=function(t,n,i,r,e,u){e.clipped=!0;var s=r.get("...");if(null!=s){for(;!e.isPushable(n,s)&&e.pop(););e.isPushable(n,s)&&e.push(s,!1)}if(u)t.close();else for(;t.hasNext();)if(t.next()===Ee){e.newLine(i);break}},t.isWrappable2=function(t,n){if(t.countPerLine<=0)return!1;var i=t.characters[t.count-1].character.type,r=n.type;return 4&i?!(4&r||2&i):!(4&r||2&i&&2&r)},t.advance=function(t,n,i){return n.done||t<=n.value.end?n:n=i.next()},t.isWrappable1=function(t,n){if(n.done)return!1;var i=n.value;return i.start===t||i.end===t},t.newLineBreaker=function(t){return"css-line-break"in window?window["css-line-break"].LineBreaker(t,{lineBreak:"strict",wordBreak:"normal"}):null},t.RESULT=null,t}(),Se=function(t){function n(){var n=t.call(this,new Float32Array(64),new Float32Array(64),new Uint16Array(48))||this;return n.width=0,n.height=0,n.clipped=!1,n}return _(n,t),n.prototype.update=function(t,n,i){var r=this.getBuffer("aVertexPosition"),e=this.getBuffer("aTextureCoord"),u=this.getIndex(),s=Me.measure(t,n,i),h=Math.ceil(s.count/8)<<3,o=h<<3;r.data.length<o&&(r.data=new Float32Array(o),e.data=new Float32Array(o));var a=6*h;u.data.length<a&&(u.data=new Uint16Array(a));var c=r.data,f=e.data,l=u.data;if(null!=n){for(var v=s.count,b=s.characters,d=0;d<v;++d){var g=b[d],m=g.x,w=g.y,p=g.character,O=n.width,D=n.height;this.writeCharacter(c,f,l,d,m,w,p,O,D)}d=v;for(var E=c.length>>3;d<E;++d)this.writeCharacterEmpty(c,f,l,d);this.width=s.width,this.height=s.height,this.clipped=s.clipped}else{for(d=0,E=c.length>>3;d<E;++d)this.writeCharacterEmpty(c,f,l,d);this.width=0,this.height=0,this.clipped=!1}r.update(),e.update(),u.update()},n.prototype.writeCharacter=function(t,n,i,r,e,u,s,h,o){var a=s.x,c=s.y,f=s.width,l=s.height,v=e+(a-s.origin.x),b=u,d=v+f,g=b+l,m=r<<3;t[m+0]=v,t[m+1]=b,t[m+2]=d,t[m+3]=b,t[m+4]=d,t[m+5]=g,t[m+6]=v,t[m+7]=g;var w=a/h,p=c/o,O=(a+f)/h,D=(c+l)/o;n[m+0]=w,n[m+1]=p,n[m+2]=O,n[m+3]=p,n[m+4]=O,n[m+5]=D,n[m+6]=w,n[m+7]=D;var E=6*r,M=r<<2;i[E+0]=M+0,i[E+1]=M+1,i[E+2]=M+3,i[E+3]=M+1,i[E+4]=M+2,i[E+5]=M+3},n.prototype.writeCharacterEmpty=function(t,n,i,r){var e=r<<3;t[e+0]=0,t[e+1]=0,t[e+2]=0,t[e+3]=0,t[e+4]=0,t[e+5]=0,t[e+6]=0,t[e+7]=0,n[e+0]=0,n[e+1]=0,n[e+2]=0,n[e+3]=0,n[e+4]=0,n[e+5]=0,n[e+6]=0,n[e+7]=0;var u=6*r,s=r<<2;i[u+0]=s+0,i[u+1]=s+1,i[u+2]=s+3,i[u+3]=s+1,i[u+4]=s+2,i[u+5]=s+3},n}(t.MeshGeometry),Te=function(){function t(t,n){var i,r,e,u,s,h,o,a,c,f;this.k=0,this._e=-1;var l=this.getDefaultOptions();t?(this.St=null!==(i=t.align)&&void 0!==i?i:l.align,this.Pe=null!==(r=t.fontFamily)&&void 0!==r?r:l.fontFamily,this.Fe=null!==(e=t.fontSize)&&void 0!==e?e:l.fontSize,this.Ue=null!==(u=t.fontStyle)&&void 0!==u?u:l.fontStyle,this.Ge=null!==(s=t.fontVariant)&&void 0!==s?s:l.fontVariant,this.ze=null!==(h=t.fontWeight)&&void 0!==h?h:l.fontWeight,this.A=null!==(o=t.fill)&&void 0!==o?o:l.fill,this.zt=null!==(a=t.clipping)&&void 0!==a?a:l.clipping,this.He=di(null!==(c=t.wordWrap)&&void 0!==c?c:l.wordWrap,De),this.Ve=null!==(f=t.lineHeight)&&void 0!==f?f:l.lineHeight):(this.St=l.align,this.Pe=l.fontFamily,this.Fe=l.fontSize,this.Ue=l.fontStyle,this.Ge=l.fontVariant,this.ze=l.fontWeight,this.A=l.fill,this.zt=l.clipping,this.He=di(l.wordWrap,De),this.Ve=l.lineHeight),this.We=-1,this.Xe="",this.Ke="",this.Ye=0,this.q=n}return t.prototype.getDefaultOptions=function(){var n=t.DEFAULT_OPTIONS;return null==n&&(n=this.newDefaultOptions(),t.DEFAULT_OPTIONS=n),n},t.prototype.newDefaultOptions=function(){var t=K.getInstance().get("DBase");return{align:"left",fontFamily:t.getFontFamilly(),fontSize:t.getFontSize(),fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fill:t.getColor(new ct),clipping:!0,wordWrap:De.NONE,lineHeight:t.getLineHeight()}},Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idApproved",{get:function(){return this._e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontId",{get:function(){return this.update(),this.Xe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontIdApproved",{get:function(){return this.Ke},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this.A},set:function(t){this.A!==t&&(this.A=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){this.k+=1,this.q()},Object.defineProperty(t.prototype,"fillApproved",{get:function(){return this.Ye},enumerable:!1,configurable:!0}),t.prototype.approve=function(){this.update(),this._e=this.k,this.Ke=this.Xe,this.Ye=this.A},Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this.Pe},set:function(t){this.Pe!==t&&(this.Pe=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.Fe},set:function(t){this.Fe!==t&&(this.Fe=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this.Ue},set:function(t){this.Ue!==t&&(this.Ue=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this.Ge},set:function(t){this.Ge!==t&&(this.Ge=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this.ze},set:function(t){this.ze!==t&&(this.ze=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.We!==this.k&&(this.We=this.k,this.Xe=this.newFontId())},t.prototype.newFontId=function(){return this.Ue+" "+this.Ge+" "+this.ze+" "+this.Fe+"px "+this.Pe},Object.defineProperty(t.prototype,"clipping",{get:function(){return this.zt},set:function(t){this.zt!==t&&(this.zt=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this.He},set:function(t){this.He!==t&&(this.He=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.Ve},set:function(t){this.Ve!==t&&(this.Ve=t,this.onChange())},enumerable:!1,configurable:!0}),t}(),je=function(n){function i(i,r){var e=n.call(this,new Se,new t.MeshMaterial(t.Texture.EMPTY))||this;return e._=new Te(r,(function(){e.un=!0,e.Je=!0,e.Oe=null,e.Ze()})),e.qe=i,e.$e="",e.un=!0,e.Je=!0,e.Oe=null,e.Qe=0,e.Mt=0,e.nn=0,e.zt={enable:!1,wordWrap:De.NONE,width:0,height:0,lineHeight:0,delta:{width:0,height:0}},e.Ze(),e}return _(i,n),i.prototype.Ze=function(){var t=rt.getLayer(this);if(t){var n=this._;if(this.un){this.un=!1;var i=this.qe,r=this.$e;this.$e=i;var e=n.fontId,u=n.fontIdApproved,s=n.fontSize,h=n.fill,o=n.fillApproved;n.approve();var a=t.getDynamicFontAtlases();i===r&&e===u&&h===o||(a.add(e,s,h,i),a.remove(u,o,r))}}},Object.defineProperty(i.prototype,"text",{get:function(){return this.qe},set:function(t){this.qe!==t&&(this.qe=t,this.un=!0,this.Je=!0,this.Ze())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this.update(),Math.abs(this.scale.x)*this.geometry.width},set:function(t){this.update();var n=this.geometry.width;if(1e-4<n){var i=t/n;this.scale.x=0<=this.scale.x?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.update(),Math.abs(this.scale.y)*this.geometry.height},set:function(t){this.update();var n=this.geometry.height;if(1e-4<n){var i=t/n;this.scale.y=0<=this.scale.y?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clipped",{get:function(){return this.geometry.clipped},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"style",{get:function(){return this._},enumerable:!1,configurable:!0}),i.prototype.update=function(){this.Ze();var t=this.Oe;if(null==t){var n=rt.getLayer(this);if(n){var i=this._;null!=(t=n.getDynamicFontAtlases().get(i.fontId,i.fill))&&(this.Qe=t.getRevisionUpdate(),this.Oe=t,this.texture=t.texture,this.Je=!0)}}else{var r=t.getRevisionUpdate();r!==this.Qe&&(this.Qe=r,this.Je=!0)}var e=this._,u=this.zt;this.updateClipping(e,u)&&(this.Je=!0),this.Je&&(this.Je=!1,this.geometry.update(this.qe,t,u))},i.prototype.updateClipping=function(t,n){var i=!1,r=t.clipping;n.enable!==r&&(n.enable=r,i=!0);var e=t.wordWrap;n.wordWrap!==e&&(n.wordWrap=e,i=!0);var u=t.lineHeight;if(n.lineHeight!==u&&(n.lineHeight=u,i=!0),r||e){var s=this.parent;if(s instanceof Ki){var h=s.width-s.padding.getLeft()-s.padding.getRight()-n.delta.width;n.width!==h&&(n.width=h,i=!0);var o=s.height-s.padding.getTop()-s.padding.getBottom()-n.delta.height;n.height!==o&&(n.height=o,i=!0)}}return i},i.prototype.setClippingDelta=function(t,n){var i=this.zt.delta;i.width=t,i.height=n},i.prototype._calculateBounds=function(){this.update(),n.prototype._calculateBounds.call(this)},i.prototype._render=function(t){this.update(),n.prototype._render.call(this,t)},i}(t.Mesh),Ne=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u;t.prototype.init.call(this,n);var s=this.theme;this.tu=null!==(r=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.value)&&void 0!==r?r:s.newTextValue(),this.nu=this.computeTextValue();var h=null==n?void 0:n.text;this.iu=null==h?void 0:h.color,this.ru=null==h?void 0:h.alpha,this.eu=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v=null===(r=null==n?void 0:n.text)||void 0===r?void 0:r.style;return null!=v?{fill:null!==(e=v.fill)&&void 0!==e?e:t.getColor(i),fontSize:null!==(u=v.fontSize)&&void 0!==u?u:t.getFontSize(),fontFamily:null!==(s=v.fontFamily)&&void 0!==s?s:t.getFontFamilly(),fontWeight:null!==(h=v.fontWeight)&&void 0!==h?h:t.getFontWeight(),fontStyle:null!==(o=v.fontStyle)&&void 0!==o?o:t.getFontStyle(),fontVariant:null!==(a=v.fontVariant)&&void 0!==a?a:t.getFontVariant(),clipping:null!==(c=v.clipping)&&void 0!==c?c:t.getTextStyleClipping(),wordWrap:null!==(f=v.wordWrap)&&void 0!==f?f:t.getTextStyleWordWrap(),lineHeight:null!==(l=v.lineHeight)&&void 0!==l?l:t.getLineHeight()}:{fill:t.getColor(i),fontSize:t.getFontSize(),fontFamily:t.getFontFamilly(),fontWeight:t.getFontWeight(),fontStyle:t.getFontStyle(),fontVariant:t.getFontVariant(),clipping:t.getTextStyleClipping(),wordWrap:t.getTextStyleWordWrap(),lineHeight:t.getLineHeight()}}(s,n,this.state),this.Ae=function(t,n){var i,r,e,u=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.align;return{vertical:di(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getTextAlignVertical(),ve),horizontal:di(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getTextAlignHorizontal(),le)}}(s,n),this.uu=null!==(e=null==h?void 0:h.formatter)&&void 0!==e?e:s.getTextFormatter(),this.su=!0,this.hu=null!==(u=null==n?void 0:n.mask)&&void 0!==u?u:s.isOverflowMaskEnabled(),this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"text",{get:function(){return this.tu},set:function(t){this.tu!==t&&(this.tu=t,this.updateTextValue())},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){},n.prototype.computeTextValue=function(){var t=this.tu;if(void 0!==t){if(!ot(t))return t;var n=t(this.state);if(void 0!==n)return n}return this.theme.getTextValue(this.state)},n.prototype.createOrUpdateText=function(){var t=this.nu;if(void 0!==t){var n=this.uu(t,this),i=this.qe;if(null==i){if(0<n.length){var r=this.createText(n);r.visible=this.su,this.qe=r,this.addChild(r),this.updateTextPosition(r);var e=this.getOverflowMask();e&&(r.mask=e),this.toDirty(),rt.update(this)}}else i.text=n,this.toDirty(),rt.update(this)}},n.prototype.createText=function(t){return new je(t,this.eu)},n.prototype.getOverflowMask=function(){return this.hu?(null==this.Zi&&(this.Zi=new we(this),this.Ln.add(this.Zi),this.toDirty()),this.Zi):null},n.prototype.updateTextPosition=function(t){var n=this.Ae,i=this.Bn,r=this.toRounded;switch(n.horizontal){case le.LEFT:t.x=r(i.getLeft());break;case le.CENTER:t.x=r(.5*(this.width-t.width));break;case le.RIGHT:t.x=r(this.width-t.width-i.getRight())}switch(n.vertical){case ve.TOP:t.y=r(i.getTop());break;case ve.MIDDLE:t.y=r(.5*(this.height-t.height));break;case ve.BOTTOM:t.y=r(this.height-t.height-i.getBottom())}},n.prototype.toRounded=function(t){return Math.round(t)},n.prototype.getTextColor=function(t,n){var i=this.iu;if(void 0!==i){if(!ot(i))return i;var r=i(n);if(void 0!==r)return r}return t.getColor(n)},n.prototype.getTextAlpha=function(t,n){var i=this.ru;if(void 0!==i){if(!ot(i))return i;var r=i(n);if(void 0!==r)return r}return t.getAlpha(n)},n.prototype.updateTextColor=function(t){var n=this.theme,i=this.state;t.style.fill=this.getTextColor(n,i),t.alpha=this.getTextAlpha(n,i)},n.prototype.updateTextValue=function(){var t=this.computeTextValue();this.nu!==t&&(this.nu=t,this.onTextChange(),this.createOrUpdateText())},n.prototype.updateText=function(){var t=this.qe;t&&(this.updateTextValue(),this.updateTextPosition(t),this.updateTextColor(t))},n.prototype.showText=function(){var t=this.qe;t&&(t.visible=!0),this.su=!0},n.prototype.hideText=function(){var t=this.qe;t&&(t.visible=!1),this.su=!1},n.prototype.onReflow=function(){t.prototype.onReflow.call(this),this.updateText()},n.prototype.isRefitable=function(n){return t.prototype.isRefitable.call(this,n)||null!=n&&n===this.qe},n.prototype.applyTitle=function(){var n=this.qe;if(this._n.length<=0&&n&&"clipped"in n&&n.clipped){var i=rt.getLayer(this);i&&(i.view.title=n.text)}else t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DTextBase"},n.prototype.destroy=function(){var n=this.qe;n&&(this.qe=null,n.destroy());var i=this.Zi;i&&(this.Zi=null,i.destroy()),t.prototype.destroy.call(this)},n}(Ki),Ie=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){this.ou=this.newImages(this.theme,n),t.prototype.init.call(this,n)},n.prototype.newImages=function(t,n){var i=[];return i.push(this.newImage(t,this.toImageOptions(t,null==n?void 0:n.image))),function(t){return!!t.getSecondaryImageSource}(t)&&i.push(this.newImage(new de(t))),function(t){return!!t.getTertiaryImageSource}(t)&&i.push(this.newImage(new ge(t))),i},n.prototype.toImageOptions=function(t,n){return n},n.prototype.newImage=function(t,n){return new me(this,t,this.Ae,n)},Object.defineProperty(n.prototype,"image",{get:function(){return this.ou[0].source},set:function(t){this.ou[0].source=t},enumerable:!1,configurable:!0}),n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i);for(var r=this.ou,e=0,u=r.length;e<u;++e)r[e].onStateChange(n,i)},n.prototype.updateText=function(){this.updateTextValue(),this.updateTextAndImage()},n.prototype.updateTextAndImage=function(){for(var t=this.qe,n=this.ou,i=this.Bn,r=this.toRounded,e=this.width,u=this.height,s=i.getLeft(),h=i.getRight(),o=i.getTop(),a=i.getBottom(),c=null==t,f=c,l=c,v=0,b=0,d=0,g=0,m=0,w=0,p=s,O=e-h,D=o,E=u-a,M=0,S=e,T=0,j=u,N=0,I=n.length;N<I;++N)if((K=n[N]).updateSource(),K.updateTint(),K.updateBound(),Y=K.image){var C=(J=K.bound).width,A=J.height,R=K.margin,y=R.horizontal,k=R.vertical;if(K.align.with===be.TEXT){switch(K.align.horizontal){case le.LEFT:Y.x=d,d+=C,f?f=!1:d+=y;break;case le.CENTER:break;case le.RIGHT:g-=C,Y.x=g,g-=y,v=y}switch(K.align.vertical){case ve.TOP:Y.y=m,m+=A,l?l=!1:m+=k;break;case ve.MIDDLE:break;case ve.BOTTOM:w-=A,Y.y=w,w-=k,b=k}}if(K.align.with===be.PADDING){switch(K.align.horizontal){case le.LEFT:p+=y,Y.x=r(p),p+=C;break;case le.CENTER:break;case le.RIGHT:O-=C+y,Y.x=r(O)}switch(K.align.vertical){case ve.TOP:D+=k,Y.y=r(D),D+=A;break;case ve.MIDDLE:break;case ve.BOTTOM:E-=A+k,Y.y=r(E)}}if(K.align.with===be.BORDER){switch(K.align.horizontal){case le.LEFT:M+=y,Y.x=r(M),M+=C;break;case le.CENTER:break;case le.RIGHT:S-=C+y,Y.x=r(S)}switch(K.align.vertical){case ve.TOP:T+=k,Y.y=r(T),T+=A;break;case ve.MIDDLE:break;case ve.BOTTOM:j-=A+k,Y.y=r(j)}}}c&&(g+=v,w+=b);var L=0,x=0,B=0,_=0,P=0,F=0;if(null!=t){this.updateTextColor(t),t.setClippingDelta(d-g,m-w);var U=this.Ae,G=t.width,z=t.height;switch(U.horizontal){case le.LEFT:B=(L=s)+d+G-g;break;case le.CENTER:B=(L=.5*(e-d+g-G))+d+G-g;break;case le.RIGHT:L=(B=e-h)+g-G-d}switch(t.x=r(L+d),x=L+d+.5*G,U.vertical){case ve.TOP:F=(_=o)+m+z-w;break;case ve.MIDDLE:F=(_=.5*(u-m+w-z))+m+z-w;break;case ve.BOTTOM:_=(F=u-a)+w-z-m}t.y=r(_+m),P=_+m+.5*z}else B=(L=.5*(e-d+g))+d-g,x=L+d,F=(_=.5*(u-m+w))+m-w,P=_+m;var H=.5*e,V=.5*u,W=.5*e,X=.5*u;for(N=0,I=n.length;N<I;++N){var K,Y;if(Y=(K=n[N]).image){var J;if(C=(J=K.bound).width,A=J.height,K.align.with===be.TEXT){switch(K.align.horizontal){case le.LEFT:Y.x=r(Y.x+L);break;case le.CENTER:Y.x=r(x-.5*C);break;case le.RIGHT:Y.x=r(Y.x+B)}switch(K.align.vertical){case ve.TOP:Y.y=r(Y.y+_);break;case ve.MIDDLE:Y.y=r(P-.5*A);break;case ve.BOTTOM:Y.y=r(Y.y+F)}}if(K.align.with===be.PADDING){switch(K.align.horizontal){case le.CENTER:Y.x=r(H-.5*C)}switch(K.align.vertical){case ve.MIDDLE:Y.y=r(V-.5*A)}}if(K.align.with===be.BORDER){switch(K.align.horizontal){case le.CENTER:Y.x=r(W-.5*C)}switch(K.align.vertical){case ve.MIDDLE:Y.y=r(X-.5*A)}}}}},n.prototype.isRefitable=function(n){if(t.prototype.isRefitable.call(this,n))return!0;for(var i=this.ou,r=0,e=i.length;r<e;++r)if(i[r].isRefitable(n))return!0;return!1},n.prototype.getType=function(){return"DImageBase"},n.prototype.destroy=function(){for(var n=this.ou,i=0,r=n.length;i<r;++i)n[i].destroy();t.prototype.destroy.call(this)},n}(Ne),Ce=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r;t.prototype.init.call(this,n);var e=this.theme;this.au=null!==(i=null==n?void 0:n.toggle)&&void 0!==i?i:e.isToggle();var u=di(null!==(r=null==n?void 0:n.when)&&void 0!==r?r:e.getWhen(),fe);this.cu=u,this.initOnClick(u,e,n),this.initOnPress(u,e,n);var s=null==n?void 0:n.group;s&&s.add(this)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.onClick(n)},Object.defineProperty(n.prototype,"isToggle",{get:function(){return this.au},enumerable:!1,configurable:!0}),n.prototype.initOnClick=function(t,n,i){var r=this;zi.onClick(this,(function(n){t===fe.CLICKED&&r.onClick(n)}))},n.prototype.initOnPress=function(t,n,i){var r=this,e=null,u=function(){r.state.isPressed=!1,null!=e&&(e.off(zi.up,u),e.off(zi.upoutside,u),e.off(zi.cancel,u),e=null)};this.on(zi.down,(function(){r.state.isPressed=!0;var t=rt.getLayer(r);t&&((e=t.renderer.plugins.interaction).on(zi.up,u),e.on(zi.upoutside,u),e.on(zi.cancel,u))}))},n.prototype.getType=function(){return"DButton"},n.prototype.onClick=function(t){this.state.isActionable&&(this.isToggle?(this.onToggleStart(t),this.onToggleEnd(t)):this.onActivate(t))},n.prototype.onDblClick=function(n,i){return this.cu===fe.DOUBLE_CLICKED&&this.onClick(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onInactivate=function(t){this.emit("inactive",this)},n.prototype.toggle=function(){this.state.isActionable&&this.isToggle&&(this.onToggleStart(),this.onToggleEnd())},n.prototype.onToggleStart=function(t){this.state.isActive=!this.state.isActive},n.prototype.onToggleEnd=function(t){this.state.isActive?this.onActivate(t):this.onInactivate(t)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.isToggle?this.onToggleStart(t):this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.isToggle?this.onToggleEnd(t):(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1))},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.destroy=function(){var n,i;null===(i=null===(n=this.Nn)||void 0===n?void 0:n.group)||void 0===i||i.remove(this),t.prototype.destroy.call(this)},n}(Ie),Ae=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButton"},n}(Ce),Re=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonPrimary"},n}(Ae),ye=function(t){function n(n){var i,r,e=t.call(this,n)||this;e.fu=0,e.lu=0,e.vu=0,e.bu=0,e.du=null,e.gu=null;var u=null==n?void 0:n.shift;return e.mu=null!==(i=null==u?void 0:u.x)&&void 0!==i?i:0,e.wu=null!==(r=null==u?void 0:u.y)&&void 0!==r?r:15,e.pu=function(){e.onPrerender()},e.Ou=function(){e.onPostrender()},e}return _(n,t),n.prototype.stop=function(){this.bu=0,this.removeEventListeners(),t.prototype.stop.call(this)},n.prototype.addEventListeners=function(t){var n=rt.getLayer(t);if(n){this.gu=n;var i=n.renderer;i.on("prerender",this.pu),i.on("postrender",this.Ou)}},n.prototype.removeEventListeners=function(){var t=this.gu;if(t){this.gu=null;var n=t.renderer;n.off("prerender",this.pu),n.off("postrender",this.Ou)}},n.prototype.onStart=function(n){var i=this.du=this.zn;null!=i&&(this.bu=0,this.removeEventListeners(),this.addEventListeners(i),n||(i.visible=!0),t.prototype.onStart.call(this,n))},n.prototype.onTime=function(n,i,r){if(null!=this.du){var e=this.gu;e?(this.bu=n,t.prototype.onTime.call(this,n,i,r),e.update()):(this.bu=n,t.prototype.onTime.call(this,n,i,r))}},n.prototype.onEnd=function(n){var i=this.du;null!=i&&(this.removeEventListeners(),n&&(i.visible=!1),t.prototype.onEnd.call(this,n))},n.prototype.onPrerender=function(){var t=this.du;if(null!=t){var n=this.bu,i=t.unsafe.position;this.fu=i.x,this.lu=i.y,i.set(i.x-this.mu*(1-n),i.y-this.wu*(1-n)),this.vu=t.alpha,t.alpha=n}},n.prototype.onPostrender=function(){var t=this.du;null!=t&&(t.unsafe.position.set(this.fu,this.lu),t.alpha=this.vu)},n}(tr),ke={TOP:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,LEFT:4,LEFT_TOP:5,LEFT_MIDDLE:6,LEFT_BOTTOM:7,RIGHT:8,RIGHT_TOP:9,RIGHT_MIDDLE:10,RIGHT_BOTTOM:11,BOTTOM:12,BOTTOM_LEFT:13,BOTTOM_CENTER:14,BOTTOM_RIGHT:15,OVER:16},Le=function(){function t(){}return t.attach=function(t,n,i,r,e,u,s){var h=t.width,o=t.height,a=0;switch(s){case ke.LEFT:case ke.LEFT_TOP:case ke.LEFT_MIDDLE:case ke.LEFT_BOTTOM:(a=n.left-h-i)<i&&e-i<(a=n.right+i)+h&&(a=i);break;case ke.RIGHT:case ke.RIGHT_TOP:case ke.RIGHT_MIDDLE:case ke.RIGHT_BOTTOM:e-i<(a=n.right+i)+h&&(a=n.left-h-i)<i&&(a=e-h-i);break;case ke.TOP:case ke.TOP_LEFT:case ke.BOTTOM:case ke.BOTTOM_LEFT:a=this.adjust(n.left,h,i,e);break;case ke.TOP_RIGHT:case ke.BOTTOM_RIGHT:a=this.adjust(n.right-h,h,i,e);break;case ke.TOP_CENTER:case ke.BOTTOM_CENTER:case ke.OVER:a=this.adjust(.5*(n.left+n.right-h),h,i,e)}var c=0;switch(s){case ke.LEFT:case ke.LEFT_TOP:case ke.RIGHT:case ke.RIGHT_TOP:c=this.adjust(n.top,o,r,u);break;case ke.LEFT_MIDDLE:case ke.RIGHT_MIDDLE:case ke.OVER:c=this.adjust(.5*(n.top+n.bottom-o),o,r,u);break;case ke.LEFT_BOTTOM:case ke.RIGHT_BOTTOM:c=this.adjust(n.bottom,o,r,u);break;case ke.TOP:case ke.TOP_LEFT:case ke.TOP_RIGHT:case ke.TOP_CENTER:(c=n.top-o-r)<r&&u<(c=n.bottom+r)+o&&(c=r);break;case ke.BOTTOM:case ke.BOTTOM_LEFT:case ke.BOTTOM_RIGHT:case ke.BOTTOM_CENTER:u-r<(c=n.bottom+r)+o&&(c=n.top-o-r)<r&&(c=u-o-r)}t.position.set(a,c)},t.adjust=function(t,n,i,r){return t<i?r-i<t+n?.5*(r-n):i:r-i<t+n?r<n?.5*(r-n):r-n-i:t},t}(),xe={NONE:0,ESC:1,CLICK_OUTSIDE:2},Be={MODAL:0,MODELESS:1,MENU:2},_e={MODAL:"MODAL",MODELESS:"MODELESS",MENU:"MENU"},Pe=function(){function n(){}return n.apply=function(t,n){var i=this;t.on(zi.down,(function(r){if(r.target===t){var e=i.point;e.copyFrom(r.data.global),t.toLocal(e,void 0,e,!0);var u=e.x,s=e.y;(u<0||s<0||t.width<u||t.height<s)&&setTimeout((function(){n(r)}),0)}}))},n.point=new t.Point,n}(),Fe=function(){function t(t){this.gu=null,this.Du=null==(null==t?void 0:t.parent)?rt.last():null}return Object.defineProperty(t.prototype,"picked",{get:function(){return this.gu},enumerable:!1,configurable:!0}),t.prototype.pick=function(t){var n=this.gu;if(null==n){if(!(n=rt.getLayerOverlay(t))){var i=this.Du;n=i?i.getLayerOverlay():rt.last().getLayerOverlay()}this.gu=n}return n},t}(),Ue=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u,s=this;t.prototype.init.call(this,n),this.pu=function(){s.onPrerender()};var h=this.theme,o=di(null!==(i=null==n?void 0:n.mode)&&void 0!==i?i:h.getMode(),Be);this.Eu=o,this.Mu=null!==(r=null==n?void 0:n.sticky)&&void 0!==r?r:h.isSticky();var a=null!==(e=null==n?void 0:n.closeOn)&&void 0!==e?e:h.closeOn();switch(this.Su=a,this.St=di(null!==(u=null==n?void 0:n.align)&&void 0!==u?u:ke.BOTTOM,ke),this.Tu=new Fe,o){case Be.MODAL:case Be.MENU:this.visible=!1;var c=this.state;c.lock(),c.isFocusRoot=!0,c.add(o===Be.MODAL?_e.MODAL:_e.MENU),c.unlock(),a&xe.CLICK_OUTSIDE&&Pe.apply(this,(function(){s.onCloseOn()}));break;case Be.MODELESS:this.state.add(_e.MODELESS)}},n.prototype.getAnimation=function(){var t,n,i,r,e=this,u=this.oi;if(void 0===u){switch(this.Eu){case Be.MODAL:u=null!==(n=null===(t=this.Nn)||void 0===t?void 0:t.animation)&&void 0!==n?n:new ye;break;case Be.MODELESS:u=null;break;case Be.MENU:u=null!==(r=null===(i=this.Nn)||void 0===i?void 0:i.animation)&&void 0!==r?r:null}u&&(u.target=this,u.on("end",(function(t){e.onAnimationEnd(t)}))),this.oi=u}return u},n.prototype.onAnimationEnd=function(t){if(t){var n=this.parent;n&&n.removeChild(this)}else{var i=rt.getLayer(this);if(i){var r=i.getFocusController();this.ju=r.get();var e=r.find(this,!1,!0,!0);r.focus(e||this)}}},n.prototype.open=function(t){var n=this,i=this.Nu;if(null==i){switch(i=new Promise((function(t,i){n.Iu=t,n.Cu=i})),this.Nu=i,this.Au=t,this.Eu){case Be.MODAL:(r=this.Tu.pick(this)).stage.addChild(this);break;case Be.MODELESS:break;case Be.MENU:var r;(r=this.Tu.pick(this)).stage.addChild(this);var e=r.renderer,u=this.pu;this.Mu?e.on("prerender",u):e.once("prerender",u)}this.onOpen()}return i},n.prototype.onPrerender=function(){var t=this.Au;if(t){var n=t.getBounds();if(n){var i=this.Tu.picked;if(i){var r=this.theme;Le.attach(this,n,r.getOffsetX(),r.getOffsetY(),i.width,i.height,this.St)}}}},n.prototype.onOpen=function(){this.emit("open",this);var t=this.getAnimation();t?t.start():this.Eu===Be.MENU&&(this.visible=!0,this.onAnimationEnd(!1))},n.prototype.isOpened=function(){return null!=this.Nu},n.prototype.close=function(){this.doReject()},n.prototype.doResolve=function(t){var n=this.Iu;n&&(this.Nu=void 0,this.Iu=void 0,this.Cu=void 0,this.onClose(),n(t))},n.prototype.doReject=function(t){var n=this.Cu;n&&(this.Nu=void 0,this.Iu=void 0,this.Cu=void 0,this.onClose(),n(t))},n.prototype.onClose=function(){var t=this.Tu.picked,n=this.ju;if(null!=n)if(this.ju=null,t){var i=rt.getLayer(n);null!=i&&t!==i&&i.view.focus(),t.getFocusController().focus(n)}else this.blur(!0);else this.blur(!0);switch(this.Eu){case Be.MODAL:case Be.MODELESS:break;case Be.MENU:t&&t.renderer.off("prerender",this.pu)}this.Au=null;var r=this.getAnimation();r?r.start(!0):this.Eu===Be.MENU&&(this.visible=!1,this.onAnimationEnd(!0)),this.emit("close",this)},n.prototype.onKeyDown=function(n){switch(this.Eu){case Be.MODAL:case Be.MENU:this.Su&xe.ESC&&Kt.isCancelKey(n)&&this.onCloseOn()}return t.prototype.onKeyDown.call(this,n)},n.prototype.onCloseOn=function(){this.close()},n.prototype.containsGlobalPoint=function(n){switch(this.Eu){case Be.MODAL:case Be.MENU:return!0;case Be.MODELESS:return t.prototype.containsGlobalPoint.call(this,n)}},n.prototype.getType=function(){return"DDialog"},n}(Ki),Ge={VERTICAL:0,HORIZONTAL:1},ze=function(t){function n(n){var i=t.call(this,n)||this;return i.visible=!1,i}return _(n,t),n.prototype.getType=function(){return"DLayoutSpace"},n}(Ki),He=function(t){return t instanceof Ki&&(t.visible||t instanceof ze)},Ve=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n);var i=this.theme;this.Re=function(t,n){var i,r,e=null==n?void 0:n.margin;if(null!=e){if(Xt(e))return{horizontal:e,vertical:e};var u=t.getMargin();return{horizontal:null!==(i=e.horizontal)&&void 0!==i?i:u,vertical:null!==(r=e.vertical)&&void 0!==r?r:u}}return{horizontal:u=t.getMargin(),vertical:u}}(i,n),this.Gt=function(t,n){var i=null==n?void 0:n.direction;return null!=i?at(i)?Ge[i]:i:t.getDirection()}(i,n),this.Ru=function(t,n){var i=null==n?void 0:n.corner;if(null!=i&&!Xt(i)){var r=i.adjust;if(null!=r)return r}return t.getCornerAdjust()}(i,n),this.yu=function(t,n){if(n){var i=n.row;if(null!=i)return i;var r=n.column;if(null!=r)return r}return t.getMultiplicity()}(i,n),this.Xn=function(t,n){var i;return null!==(i=null==n?void 0:n.reverse)&&void 0!==i?i:t.getReverse()}(i,n)},Object.defineProperty(n.prototype,"margin",{get:function(){return this.Re},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"multiplicity",{get:function(){return this.yu},enumerable:!1,configurable:!0}),n.prototype.getWeightTotal=function(){for(var t=this.children,n=0,i=this.yu,r=this.Xn,e=0,u=t.length;e<u;){for(var s=-1,h=0;h<i&&e+h<u;++h){var o=t[r?u-1-(e+h):e+h];if(He(o)){var a=o.getClearType();if(0!==h&&a&yi.BEFORE)break;if(s=Math.max(s,o.weight),a&&yi.AFTER){h+=1;break}}else e+=1,h-=1}e+=h,0<=s&&(n+=s)}return n},n.prototype.getSpaceLeft=function(t,n){var i=this.children,r=this.yu,e=this.Xn;if(this.Gt===Ge.VERTICAL){for(var u=t,s=0,h=0,o=i.length;h<o;){for(var a=0,c=-1,f=0;f<r&&h+f<o;++f){var l=i[e?o-1-(h+f):h+f];if(He(l)){var v=l.getClearType();if(0!==f&&v&yi.BEFORE)break;if(a=(c=Math.max(c,l.weight))<0?Math.max(a,l.height+s):s,v&yi.AFTER){f+=1;break}}else h+=1,f-=1}h+=f,u-=a,s=n}return Math.max(0,u)}for(u=t,s=0,h=0,o=i.length;h<o;){var b=0;for(c=-1,f=0;f<r&&h+f<o;++f)if(l=i[e?o-1-(h+f):h+f],He(l)){if(v=l.getClearType(),0!==f&&v&yi.BEFORE)break;if(b=(c=Math.max(c,l.weight))<0?Math.max(b,l.width+s):s,v&yi.AFTER){f+=1;break}}else h+=1,f-=1;h+=f,u-=b,s=n}return Math.max(0,u)},n.prototype.calcSpaceLeft=function(t,n,i,r){return t?0:this.getSpaceLeft(n-i,r)},n.prototype.onRefit=function(){var i=this.children,r=this.Bn,e=r.getTop(),u=r.getBottom(),s=r.getLeft(),h=r.getRight(),o=this.Re,a=o.vertical,c=o.horizontal,f=this.getWeightTotal(),l=this.yu,v=this.Xn,b=this.Cn,d=null;if(this.Ru){var g=4+(i.length<<1);(null==n.CORNER_ADJUST_WORK||n.CORNER_ADJUST_WORK.length<g)&&(n.CORNER_ADJUST_WORK=new Float32Array(g)),(d=n.CORNER_ADJUST_WORK)[0]=-2,d[1]=-2,d[g-2]=-3,d[g-1]=-3}if(this.Gt===Ge.VERTICAL){var m=0,w=e-a;if(0<f){for(var p=1/f,O=this.calcSpaceLeft(b.height.isOn,this.height,e+u,a),D=0,E=i.length;D<E;){for(var M=s-c,S=0,T=0;T<l&&D+T<E;++T){var j=i[v?E-1-(D+T):D+T];if(He(j)){var N=j.getClearType();if(0!==T&&N&yi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.height=O*(U*p)),M+=c+j.width,S=Math.max(S,j.height),N&yi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1}w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],He(j)){var I=d[0+(z=2+(D<<1))],C=d[z+1],A=-2;if(!((N=j.getClearType())&yi.BEFORE)){var R=this.findRowIndexPrevious(z,C,d);this.hasClearTypeAfter(i,R)||(A=d[R])}var y=-2;if(!(N&yi.AFTER)){var k=this.findRowIndexNext(z,C,d);this.hasClearTypeBefore(i,k)||(y=d[k])}var L=this.countColumn(z,C,d);j.corner.mask=this.toCornerMaskColumn(A,I,y,L)}}else{for(D=0,E=i.length;D<E;){for(M=s-c,S=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],He(j)){if(N=j.getClearType(),0!==T&&N&yi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.height=0),M+=c+j.width,S=Math.max(S,j.height),N&yi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1;w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)j=i[v?E-1-D:D],He(j)&&(I=d[0+(z=2+(D<<1))],C=d[z+1],A=-2,(N=j.getClearType())&yi.BEFORE||(R=this.findRowIndexPrevious(z,C,d),this.hasClearTypeAfter(i,R)||(A=d[R])),y=-2,N&yi.AFTER||(k=this.findRowIndexNext(z,C,d),this.hasClearTypeBefore(i,k)||(y=d[k])),L=this.countColumn(z,C,d),j.corner.mask=this.toCornerMaskColumn(A,I,y,L))}}else{var x=0;if(M=s-c,0<f){for(p=1/f,O=this.calcSpaceLeft(b.width.isOn,this.width,s+h,c),D=0,E=i.length;D<E;){w=e-a;var B=0;for(T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],He(j)){if(N=j.getClearType(),0!==T&&N&yi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.width=O*(U*p)),B=Math.max(B,j.width),w+=a+j.height,N&yi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1;M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],He(j)){I=d[0+(z=2+(D<<1))],C=d[z+1];var _=-2;(N=j.getClearType())&yi.BEFORE||(R=this.findColumnIndexPrevious(z,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1]));var P=-2;N&yi.AFTER||(k=this.findColumnIndexNext(z,I,d),this.hasClearTypeBefore(i,k)||(P=d[k+1]));var F=this.countRow(z,I,d);j.corner.mask=this.toCornerMaskRow(_,C,P,F)}}else{for(D=0,E=i.length;D<E;){for(w=e-a,B=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],He(j)){var U;if(N=j.getClearType(),0!==T&&N&yi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.width=0),B=Math.max(B,j.width),w+=a+j.height,N&yi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else{var G;null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1}M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D){var z;j=i[v?E-1-D:D],He(j)&&(I=d[0+(z=2+(D<<1))],C=d[z+1],_=-2,(N=j.getClearType())&yi.BEFORE||(R=this.findColumnIndexPrevious(z,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1])),P=-2,N&yi.AFTER||(k=this.findColumnIndexNext(z,I,d),this.hasClearTypeBefore(i,k)||(P=d[k+1])),F=this.countRow(z,I,d),j.corner.mask=this.toCornerMaskRow(_,C,P,F))}}}t.prototype.onRefit.call(this)},n.prototype.hasClearTypeBefore=function(t,n){return this.hasClearType(t,n,yi.BEFORE)},n.prototype.hasClearTypeAfter=function(t,n){return this.hasClearType(t,n,yi.AFTER)},n.prototype.hasClearType=function(t,n,i){if(2<=n){var r=n-2>>1;if(0<=r&&r<t.length){var e=t[r];if(e instanceof Ki)return!!(e.getClearType()&i)}}return!1},n.prototype.findColumnIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r]!==n)return r;return 0},n.prototype.findColumnIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s]!==u)return s-2;return r}}return i.length-2},n.prototype.countRow=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r]!==n)return i[r-2+1]+1;return 0},n.prototype.findRowIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r+1]!==n)return r;return 0},n.prototype.findRowIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r+1];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s+1]!==u)return s-2;return r}}return i.length-2},n.prototype.countColumn=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r+1]!==n)return i[r-2+0]+1;return 0},n.prototype.toCornerMaskColumn=function(t,n,i,r){var e=mi.NONE;return t+1<n&&0===n&&(e|=mi.TOP_LEFT),i+1<n&&0===n&&(e|=mi.BOTTOM_LEFT),t<n&&n+1===r&&(e|=mi.TOP_RIGHT),i<n&&n+1===r&&(e|=mi.BOTTOM_RIGHT),mi.ALL&~e},n.prototype.toCornerMaskRow=function(t,n,i,r){var e=mi.NONE;return t+1<n&&0===n&&(e|=mi.TOP_LEFT),i+1<n&&0===n&&(e|=mi.TOP_RIGHT),t<n&&n+1===r&&(e|=mi.BOTTOM_LEFT),i<n&&n+1===r&&(e|=mi.BOTTOM_RIGHT),mi.ALL&~e},n.prototype.addSpace=function(t){return this.addChild(new ze(t))},n.prototype.getType=function(){return"DLayout"},n.CORNER_ADJUST_WORK=null,n}(Ki),We=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutHorizontal"},n}(Ve),Xe=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutVertical"},n}(Ve),Ke=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e=this;t.prototype.init.call(this,n);var u=this.theme,s=this.newLayout(u,n);this.onInit(s,n);var h=null!==(i=null==n?void 0:n.ok)&&void 0!==i?i:u.getOk(),o=null!==(r=null==n?void 0:n.cancel)&&void 0!==r?r:u.getCancel();if(null!=h||null!=o){var a=new We({parent:s,width:"padding",height:"auto",padding:{top:Math.max(0,this.padding.getTop()-s.margin.vertical)}});this.ku=a,new ze({parent:a,weight:1}),null!=h&&null!=o?(this.Lu=new Re({parent:a,text:{value:o},on:{active:function(){e.cancel()}}}),this.xu=new Ae({parent:a,text:{value:h},on:{active:function(){e.ok()}}})):null!=h?this.xu=new Re({parent:a,text:{value:h},on:{active:function(){e.ok()}}}):null!=o&&(this.Lu=new Re({parent:a,text:{value:o},on:{active:function(){e.cancel()}}})),new ze({parent:a,weight:1})}},n.prototype.newLayout=function(t,n){return new Xe(this.toLayoutOptions(t,null==n?void 0:n.layout))},n.prototype.toLayoutOptions=function(t,n){var i,r,e,u,s;return null!=n||(n={}),n.parent=this,null!==(i=n.x)&&void 0!==i||(n.x=t.getLayoutX()),null!==(r=n.y)&&void 0!==r||(n.y=t.getLayoutY()),null!==(e=n.width)&&void 0!==e||(n.width=t.getLayoutWidth()),null!==(u=n.height)&&void 0!==u||(n.height=t.getLayoutHeight()),null!==(s=n.margin)&&void 0!==s||(n.margin=t.getLayoutMargin()),n},n.prototype.onInit=function(t,n){},n.prototype.ok=function(){this.onOk(this.getResolvedValue())},n.prototype.onOk=function(t){this.Eu!==Be.MODELESS&&this.doResolve(t),this.emit("ok",t,this)},n.prototype.cancel=function(){this.onCancel(this.getRejectReason())},n.prototype.onCancel=function(t){this.Eu!==Be.MODELESS&&this.doReject(t),this.emit("cancel",t,this)},n.prototype.getRejectReason=function(){},n.prototype.getType=function(){return"DDialogCommand"},n}(Ue),Ye=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DText"},n}(Ne),Je=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i);var r=this.theme,e=this.toMargin(r,i),u=e.horizontal,s=e.vertical,h=this.toLabelOptions(r,i);h&&(this.Bu=new Ye(h),new We({parent:n,width:"padding",height:"auto",margin:0,children:[new ze({width:u}),this.Bu]})),new We({parent:n,width:"padding",height:"auto",margin:0,padding:h?{top:s}:void 0,children:[new ze({width:u}),this.input,new ze({width:u})]})},n.prototype.toMargin=function(t,n){var i=null==n?void 0:n.margin;if(null!=i){if(Xt(i))return{horizontal:i,vertical:i};var r=i.horizontal,e=i.vertical;return{horizontal:null!=r?r:t.getMarginHorizontal(),vertical:null!=e?e:t.getMarginVertical()}}return{horizontal:t.getMarginHorizontal(),vertical:t.getMarginVertical()}},n.prototype.toLabelOptions=function(t,n){var i=null==n?void 0:n.label;if(null==i)return null;if(at(i))return{weight:1,text:{value:i}};var r=i.text||{};return i.text=r,void 0===r.value&&(r.value=t.getLabel()),void 0===i.width&&void 0===i.weight&&(i.weight=1),i},Object.defineProperty(n.prototype,"label",{get:function(){return this.Bu},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"input",{get:function(){var t=this._u;if(null==t){var n=this.Nn;t=this.newInput(null==n?void 0:n.input),this._u=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.input.value},set:function(t){this.input.value=t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.input.value},n.prototype.getType=function(){return"DDialogInput"},n}(Ke),Ze=function(t){function n(n){var i=t.call(this)||this;i.Pu=[],i.Fu=null,i.Uu=function(t){i.active=t};var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i.emit("init",i),i}return _(n,t),n.prototype.add=function(t){if(this.Pu.indexOf(t)<0){this.Pu.push(t);var n=this.Gu;null!=n&&(t.state.isEnabled=n),t.on("active",this.Uu),t.state.isActive&&(this.active=t)}},Object.defineProperty(n.prototype,"active",{get:function(){return this.Fu},set:function(t){if((null==t||t.isToggle)&&this.Fu!==t){var n=this.Fu;this.Fu=null;for(var i=this.Pu,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u.isToggle&&u.state.isActive&&u.toggle()}this.emit("active",t,n,this)}},enumerable:!1,configurable:!0}),n.prototype.remove=function(t){var n=this.Pu,i=n.indexOf(t);0<=i&&(n.splice(i,1),t.off("active",this.Uu),this.Fu===t&&(this.active=null))},n.prototype.contains=function(t){return 0<=this.Pu.indexOf(t)},n.prototype.clear=function(){this.Pu.length=0,this.active=null},n.prototype.size=function(){return this.Pu.length},n.prototype.each=function(t){for(var n=this.Pu,i=0,r=n.length;i<r&&!1!==t(n[i]);++i);},n.prototype.disable=function(){for(var t=this.Pu,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!0;this.Gu=!1},n.prototype.enable=function(){for(var t=this.Pu,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!1;this.Gu=!0},n.prototype.destroy=function(){this.clear()},n}(t.utils.EventEmitter),qe=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOff"},n}(Ae),$e=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOn"},n}(Ae),Qe=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.getButtonOff()),i.addChild(i.getButtonOn());var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i.getButtonGroup().on("active",(function(){var t=i.value;i.emit("change",t,!t,i)})),i}return _(n,t),n.prototype.getButtonGroup=function(){var t=this.zu;return null==t&&(t=this.newButtonGroup(),this.zu=t),t},n.prototype.newButtonGroup=function(){return new Ze},n.prototype.getButtonOn=function(){var t=this.Hu;return null==t&&(t=this.newButtonOn(),this.Hu=t),t},n.prototype.newButtonOn=function(){return new $e({weight:1,group:this.getButtonGroup()})},n.prototype.getButtonOff=function(){var t=this.Vu;return null==t&&(t=this.newButtonOff(),this.Vu=t),t},n.prototype.newButtonOff=function(){return new qe({weight:1,group:this.getButtonGroup(),state:ht.ACTIVE})},Object.defineProperty(n.prototype,"value",{get:function(){return this.getButtonOn().state.isActive},set:function(t){this.value!==t&&(t?this.getButtonOn().onClick():this.getButtonOff().onClick())},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputBoolean"},n}(We),tu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){return new Qe(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputBoolean"},n}(Je),nu=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.target=qt.ofStringOrNull(n.target),r}return _(n,t),n}(Qt),iu=function(t){function n(n){var i=t.call(this,n,Yt.NONE)||this;return i.onInputAction=n.onInputAction,i.isOpened=!1,i}return _(n,t),n.prototype.execute=function(t,n,i){var r=this;if(!this.isOpened&&this.condition(t,i)){var e=this.target(t,i);if(null!=e){var u=this.initial(t,i);this.isOpened=!0,setTimeout((function(){r.open(e,u).then((function(n){r.isOpened=!1,Er.execute(t,r.onInputAction,e,n,i)}),(function(){r.isOpened=!1}))}),0)}}},n}(nu),ru=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofBooleanOrFalse(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=n.DIALOG;if(null==r)r=new tu({label:t}),n.DIALOG=r;else{var e=r.label;e&&(e.text=t)}return r.value=i,r.open()},n}(iu),eu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getUtil=function(){var t=this.Wu;return null==t&&(t=this.newUtil(),this.Wu=t),t},n.prototype.newUtil=function(){return new br(this,this.newOperation(),this.theme,this.Nn)},n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},Object.defineProperty(n.prototype,"element",{get:function(){return this.getUtil().element},enumerable:!1,configurable:!0}),n.prototype.onDownThis=function(n){var i=this.getUtil();i.onDowning(n),t.prototype.onDownThis.call(this,n),i.onDown(n)},n.prototype.onDblClick=function(n,i){return this.getUtil().onDblClick(n,i),t.prototype.onDblClick.call(this,n,i)},n.prototype.onFocus=function(){t.prototype.onFocus.call(this),this.getUtil().onFocus()},n.prototype.onBlur=function(){t.prototype.onBlur.call(this),this.getUtil().onBlur()},n.prototype.start=function(){this.getUtil().start()},n.prototype.render=function(n){this.getUtil().onRender(n),t.prototype.render.call(this,n)},n.prototype.getElementRect=function(t,n,i){return n.set(0,0),this.toGlobal(n,n,!1),i.x=n.x,i.y=n.y,n.set(this.width,this.height),this.toGlobal(n,n,!0),i.width=n.x-i.x,i.height=n.y-i.y,i.x=(i.x*t|0)/t,i.y=(i.y*t|0)/t,i},n.prototype.getClipperRect=function(t,n,i){return br.getClipperRect(this.parent,this,t,n,i)},n.prototype.cancel=function(){this.getUtil().cancel()},n.prototype.end=function(){this.getUtil().end()},n.prototype.select=function(){return this.getUtil().select(),this},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.start(),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DHtmlElement"},n}(Ie),uu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){t.hideText()},onCancel:function(){t.showText()},onEnd:function(){},getValue:function(){return t.nu},onValueInput:function(n){t.onValueInput(n)},onValueChange:function(n,i){t.text=n,t.onValueChange(n,i)},onEnter:function(){t.onEnter()},applyTitle:function(){t.applyTitle()}}},Object.defineProperty(n.prototype,"value",{get:function(){return this.nu},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){t.prototype.onTextChange.call(this),this.validate()},n.prototype.onValueChange=function(t,n){this.emit("change",t,n,this)},n.prototype.onValueInput=function(t){this.emit("input",t,this)},n.prototype.onEnter=function(){this.emit("enter",this)},n.prototype.validate=function(){return this.getUtil().validate()},n.prototype.applyTitle=function(){this.getUtil().applyTitle()||t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DInput"},n}(eu),su=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInput"},n}(uu),hu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new Or(this,this.newOperation(),this.theme,this.Nn)},Object.defineProperty(n.prototype,"step",{get:function(){return this.getUtil().step},set:function(t){this.getUtil().step=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.getUtil().min},set:function(t){this.getUtil().min=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.getUtil().max},set:function(t){this.getUtil().max=t},enumerable:!1,configurable:!0}),n}(su),ou=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInteger"},n}(hu),au=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new ou(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputInteger"},n}(Je),cu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=n.DIALOG;if(null==r)r=new au({label:t}),n.DIALOG=r;else{var e=r.label;e&&(e.text=t)}return r.value=i,r.open()},n}(iu),fu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputReal"},n}(hu),lu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new fu(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputReal"},n}(Je),vu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=n.DIALOG;if(null==r)r=new lu({label:t}),n.DIALOG=r;else{var e=r.label;e&&(e.text=t)}return r.value=i,r.open()},n}(iu),bu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new Ir(this,this.newOperation(),this.theme,this.Nn)},n.prototype.getType=function(){return"DInputText"},n}(su),du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new bu(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputText"},n}(Je),gu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofString(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=n.DIALOG;if(null==r)r=new du({label:t}),n.DIALOG=r;else{var e=r.label;e&&(e.text=t)}return r.value=i,r.open()},n}(iu),mu=function(t){function n(n){return t.call(this,n,Yt.NONE)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.target(t,i);null!=r&&or.open(t,r)}},n}(nu),wu=function(t){function n(n){return t.call(this,n,Yt.NONE)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.target(t,i);null!=r&&window.open(r)}},n}(nu),pu=function(t){function n(n){return t.call(this,n,Yt.NONE)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.target(t,i);null!=r&&(window.location.href=r)}},n}(nu),Ou={DIAGRAM:0,PAGE:1,PAGE_INPLACE:2,DIALOG_TEXT:3,DIALOG_INTEGER:4,DIALOG_REAL:5,DIALOG_BOOLEAN:6,DIALOG_DATE:7,DIALOG_TIME:8,DIALOG_DATETIME:9},Du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonAmbient"},n}(Ae),Eu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonBack"},n}(Du),Mu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonDate"},n}(Du),Su=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonNext"},n}(Du),Tu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabel"},n}(Ye),ju=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabelDate"},n}(Ye),Nu=function(t){function n(n){var i=t.call(this,n)||this;return i.renderable=!1,i}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeSpace"},n}(Ki),Iu={NONE:0,DATE:1,HOURS:2,MINUTES:4,SECONDS:8,TIME:14,ALL:15},Cu=function(){function t(){}return t.from=function(t,n){var i=null==n?void 0:n.mask;if(null==i){if(at(t)){var r=K.getInstance().get(t);if(null!=r)return r.getMask()}else if(null!=t)return t.getMask();return Iu.NONE}if(at(i))return Iu[i];if(Xt(i))return i;for(var e=Iu.NONE,u=0,s=i.length;u<s;++u)e|=Iu[i[u]];return e},t}(),Au=function(){function t(t,n){var i,r;this.Xu=null!==(i=null==t?void 0:t.date)&&void 0!==i?i:null,this.Ku=null!==(r=null==t?void 0:t.inclusive)&&void 0!==r&&r,this.q=n}return Object.defineProperty(t.prototype,"date",{get:function(){return this.Xu},set:function(t){this.Xu!==t&&(this.Xu=t,this.q())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inclusive",{get:function(){return this.Ku},set:function(t){this.Ku!==t&&(this.Ku=t,this.q())},enumerable:!1,configurable:!0}),t}(),Ru=function(){function t(t){this.O=t}return t.prototype.min=function(t){var n=this.O,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(r.getFullYear()<t.getFullYear())return e.hour.min;if(r.getMonth()<t.getMonth())return e.hour.min;if(r.getDate()<t.getDate())return e.hour.min}var s=r.getHours();return i.inclusive||u&Iu.SECONDS&&r.getSeconds()<e.second.max||u&Iu.MINUTES&&r.getMinutes()<e.minute.max?s:s+1}return e.hour.min},t.prototype.max=function(t){var n=this.O,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(t.getFullYear()<r.getFullYear())return e.hour.max;if(t.getMonth()<r.getMonth())return e.hour.max;if(t.getDate()<r.getDate())return e.hour.max}var s=r.getHours();return i.inclusive||u&Iu.SECONDS&&e.second.min<r.getSeconds()||u&Iu.MINUTES&&e.minute.min<r.getMinutes()?s:s-1}return e.hour.max},t}(),yu=function(){function t(t){this.O=t}return t.prototype.min=function(t){var n=this.O,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(r.getFullYear()<t.getFullYear())return e.minute.min;if(r.getMonth()<t.getMonth())return e.minute.min;if(r.getDate()<t.getDate())return e.minute.min}if(u&Iu.HOURS&&r.getHours()<t.getHours())return e.minute.min;var s=r.getMinutes();return i.inclusive||u&Iu.SECONDS&&r.getSeconds()<e.second.max?s:s+1}return e.minute.min},t.prototype.max=function(t){var n=this.O,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(t.getFullYear()<r.getFullYear())return e.minute.max;if(t.getMonth()<r.getMonth())return e.minute.max;if(t.getDate()<r.getDate())return e.minute.max}if(u&Iu.HOURS&&t.getHours()<r.getHours())return e.minute.max;var s=r.getMinutes();return i.inclusive||u&Iu.SECONDS&&e.second.min<r.getSeconds()?s:s-1}return e.minute.max},t}(),ku=function(){function t(t){this.O=t}return t.prototype.min=function(t){var n=this.O,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(r.getFullYear()<t.getFullYear())return e.second.min;if(r.getMonth()<t.getMonth())return e.second.min;if(r.getDate()<t.getDate())return e.second.min}return u&Iu.HOURS&&r.getHours()<t.getHours()||u&Iu.MINUTES&&r.getMinutes()<t.getMinutes()?e.second.min:r.getSeconds()+(i.inclusive?0:1)}return e.second.min},t.prototype.max=function(t){var n=this.O,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(t.getFullYear()<r.getFullYear())return e.second.max;if(t.getMonth()<r.getMonth())return e.second.max;if(t.getDate()<r.getDate())return e.second.max}return u&Iu.HOURS&&t.getHours()<r.getHours()||u&Iu.MINUTES&&t.getMinutes()<r.getMinutes()?e.second.max:r.getSeconds()-(i.inclusive?0:1)}return e.second.max},t}(),Lu=function(){function t(t,n){this.constant=this.newConstant(),this.lower=new Au(t&&t.lower,n),this.upper=new Au(t&&t.upper,n),this.mask=Iu.ALL,this.hours=new Ru(this),this.minutes=new yu(this),this.seconds=new ku(this)}return t.prototype.newConstant=function(){return{second:{min:0,max:59},minute:{min:0,max:59},hour:{min:0,max:23}}},t.prototype.adjust=function(t){var n=this.test(t);if(n<0){var i=this.lower,r=i.date;if(r)return t.setTime(r.getTime()),i.inclusive||((e=this.mask)&Iu.SECONDS?t.setSeconds(r.getSeconds()+1):e&Iu.MINUTES?t.setMinutes(r.getMinutes()+1):e&Iu.HOURS?t.setHours(r.getHours()+1):e&Iu.DATE&&t.setDate(r.getDate()+1)),!0}else if(0<n){var e,u=this.upper,s=u.date;if(s)return t.setTime(s.getTime()),u.inclusive||((e=this.mask)&Iu.SECONDS?t.setSeconds(s.getSeconds()-1):e&Iu.MINUTES?t.setMinutes(s.getMinutes()-1):e&Iu.HOURS?t.setHours(s.getHours()-1):e&Iu.DATE&&t.setDate(s.getDate()-1)),!0}return!1},t.prototype.compare=function(t,n){var i=this.mask;if(i&Iu.DATE){var r,e,u,s,h=t.getFullYear(),o=n.getFullYear();if(h!==o)return h<o?-1:1;if((r=t.getMonth())!==(e=n.getMonth()))return r<e?-1:1;if((u=t.getDate())!==(s=n.getDate()))return u<s?-1:1}if(i&Iu.HOURS){var a=t.getHours(),c=n.getHours();if(a!==c)return a<c?-1:1}return i&Iu.MINUTES&&(r=t.getMinutes())!==(e=n.getMinutes())?r<e?-1:1:i&Iu.SECONDS&&(u=t.getSeconds())!==(s=n.getSeconds())?u<s?-1:1:0},t.prototype.test=function(t){var n=this.lower,i=n.date;if(null!=i){var r=this.compare(i,t);return n.inclusive?r<=0?0:-1:r<0?0:-1}var e=this.upper,u=e.date;return null!=u?(r=this.compare(t,u),e.inclusive?r<=0?0:1:r<0?0:1):0},t.prototype.contains=function(t){return 0===this.test(t)},t}(),xu=function(t,n,i){if(t){var r=t.date,e=t.inclusive;return{date:void 0!==r?r:n,inclusive:void 0!==e?e:i}}return{date:n,inclusive:i}},Bu=function(t){function n(n){var i=t.call(this,n)||this;return i.onNewChange(),i}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n);var e=this.theme;this.Yu=new Date;var u=this.Yu.getTime();this.Ju=new Date(u),this.Zu=new Lu(function(t,n){return n?{lower:xu(n.lower,t.getLowerBound(),t.isLowerBoundInclusive()),upper:xu(n.upper,t.getUpperBound(),t.isUpperBoundInclusive())}:{lower:{date:t.getLowerBound(),inclusive:t.isLowerBoundInclusive()},upper:{date:t.getUpperBound(),inclusive:t.isUpperBoundInclusive()}}}(e,null==n?void 0:n.bounds),(function(){r.onNewChange()}));var s=null!==(i=null==n?void 0:n.margin)&&void 0!==i?i:e.getMargin();new Xe({parent:this,x:"padding",y:"padding",width:"auto",height:"auto",margin:s,children:this.newChildren(e,n,s)})},Object.defineProperty(n.prototype,"current",{get:function(){return this.Yu},set:function(t){this.Yu.getTime()!==t.getTime()&&(this.Yu=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.Ju},set:function(t){this.Ju.getTime()!==t.getTime()&&(this.Ju=t,this.onNewChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bounds",{get:function(){return this.Zu},enumerable:!1,configurable:!0}),n.prototype.hasHours=function(){return null!=this.qu},n.prototype.hasMinutes=function(){return null!=this.$u},n.prototype.hasSeconds=function(){return null!=this.Qu},n.prototype.reset=function(){var t=this.Yu.getTime();this.Ju.setTime(t),this.onReset()},n.prototype.onReset=function(){this.onNewChange()},n.prototype.onNewChange=function(){var t=this.Ju,n=this.Zu;n.adjust(this.Ju);var i=this.qu;if(i){var r=n.hours;i.value=t.getHours(),i.min=r.min(t),i.max=r.max(t)}var e=this.$u;if(e){var u=n.minutes;e.value=t.getMinutes(),e.min=u.min(t),e.max=u.max(t)}var s=this.Qu;if(s){var h=n.seconds;s.value=t.getSeconds(),s.min=h.min(t),s.max=h.max(t)}},n.prototype.newChildren=function(t,n,i){var r=Cu.from(t,n);return this.Zu.mask=r,this.qu=r&Iu.HOURS?this.newInputHours(t,n):null,this.$u=r&Iu.MINUTES?this.newInputMinutes(t,n):null,this.Qu=r&Iu.SECONDS?this.newInputSeconds(t,n):null,[this.newTimeLayout(this.qu,this.$u,this.Qu,i)]},n.prototype.newTimeLayout=function(t,n,i,r){var e=this.newTimeLayoutChildren(t,n,i);return 0<e.length?new We({width:this.getTimeLayoutWidth(),height:this.getTimeLayoutHeight(),margin:r,children:e}):null},n.prototype.getTimeLayoutWidth=function(){return"auto"},n.prototype.getTimeLayoutHeight=function(){return"auto"},n.prototype.newTimeLayoutChildren=function(t,n,i){var r=[];return null!=t&&r.push(t),null!=n&&(0<r.length&&r.push(this.newMinuteSeparator()),r.push(n)),null!=i&&(0<r.length&&r.push(this.newSecondSeparator()),r.push(i)),r},n.prototype.newMinuteSeparator=function(){return new Ye({width:"auto",text:{value:this.getMinuteSeparator()}})},n.prototype.getMinuteSeparator=function(){return":"},n.prototype.newSecondSeparator=function(){return new Ye({width:"auto",text:{value:this.getSecondSeparator()}})},n.prototype.getSecondSeparator=function(){return":"},n.prototype.adjustInputOptions=function(t,n,i){return null==n.step&&(n.step=1),null==n.min&&(n.min=0),null==n.max&&(n.max=i),n},n.prototype.newInputHours=function(t,n){var i,r=this,e=null!==(i=null==n?void 0:n.hours)&&void 0!==i?i:t.getHoursOptions(),u=this.Zu.constant.hour.max,s=new ou(this.adjustInputOptions(t,e,u));return s.on("change",(function(t){r.onHoursChange(t)})),s},n.prototype.onHoursChange=function(t){this.Ju.setHours(t),this.onNewChange()},n.prototype.newInputMinutes=function(t,n){var i=this,r=(null==n?void 0:n.minutes)||t.getMinutesOptions(),e=this.Zu.constant.minute.max,u=new ou(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onMinutesChange(t)})),u},n.prototype.onMinutesChange=function(t){this.Ju.setMinutes(t),this.onNewChange()},n.prototype.newInputSeconds=function(t,n){var i=this,r=(null==n?void 0:n.seconds)||t.getSecondsOptions(),e=this.Zu.constant.second.max,u=new ou(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onSecondsChange(t)})),u},n.prototype.onSecondsChange=function(t){this.Ju.setSeconds(t)},n.prototype.getType=function(){return"DPickerTime"},n}(Ki),_u=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.ts=new Date(this.Yu.getTime())},n.prototype.newChildren=function(n,i,r){var e,u;this.ns=this.newDateButtons(n,i),this.rs=null!==(u=null===(e=null==i?void 0:i.date)||void 0===e?void 0:e.decorator)&&void 0!==u?u:n.getDateDecorator(),this.Bu=this.newLabel(n,i);var s=t.prototype.newChildren.call(this,n,i,r);return s.unshift(new We({width:"100%",height:"auto",children:[this.newBackButton(n,i),this.Bu,this.newNextButton(n,i)]}),new We({width:"auto",height:"auto",margin:r,children:this.newDateLabels(n,i)}),new Xe({width:"auto",height:"auto",margin:r,column:7,children:this.ns})),s},Object.defineProperty(n.prototype,"page",{get:function(){return this.ts},set:function(t){this.ts.getTime()!==t.getTime()&&(this.ts=t,this.onPageChange())},enumerable:!1,configurable:!0}),n.prototype.onReset=function(){this.ts.setTime(this.Yu.getTime()),t.prototype.onReset.call(this)},n.prototype.next=function(){var t=this.ts;t.setFullYear(t.getFullYear(),t.getMonth()+1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.back=function(){var t=this.ts;t.setFullYear(t.getFullYear(),t.getMonth()-1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.onNewChange=function(){this.Zu.adjust(this.ts),t.prototype.onNewChange.call(this),this.onPageChange()},n.prototype.onPageChange=function(){var t=this.ns,n=this.Zu,i=this.ts,r=this.Ju,e=new Date(i.getTime());e.setDate(1),e.setHours(0,0,0,0);for(var u=this.theme,s=(e.getDay()-u.getDayStart()+7)%7,h=0;h<s;++h)t[h].show();for(h=s;h<7;++h)t[h].hide();var o=this.rs;e.setFullYear(e.getFullYear(),e.getMonth()+1,0);var a=e.getDate(),c=r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth()?r.getDate():0;for(h=0;h<a;++h)e.setDate(h+1),(f=t[h+7]).state.isActive=c===h+1,f.state.isDisabled=!n.contains(e),f.show(),o(e,f);for(h=a;h<31;++h){var f;(f=t[h+7]).state.isActive=!1,f.hide()}e.setTime(i.getTime()),this.Bu.text=e},n.prototype.adjustInputOptions=function(n,i,r){return null==i.weight&&(i.weight=1),t.prototype.adjustInputOptions.call(this,n,i,r)},n.prototype.getTimeLayoutWidth=function(){return"100%"},n.prototype.toLabelOptions=function(t,n){var i=n&&n.label||{};void 0===i.weight&&(i.weight=1),void 0===i.padding&&(i.padding=0);var r=i.text=i.text||{},e=r.align=r.align||{};return void 0===e.horizontal&&(e.horizontal="CENTER"),void 0===r.formatter&&(r.formatter=t.getLabelFormatter()),i},n.prototype.newLabel=function(t,n){return new Tu(this.toLabelOptions(t,n))},n.prototype.newBackButton=function(t,n){var i=this,r=null==n?void 0:n.back;if(void 0===r&&(r=t.getBackButtonOptions()),null!=r){var e=new Eu(r);return e.on("active",(function(){i.back()})),e}return null},n.prototype.newNextButton=function(t,n){var i=this,r=null==n?void 0:n.next;if(void 0===r&&(r=t.getNextButtonOptions()),null!=r){var e=new Su(r);return e.on("active",(function(){i.next()})),e}return null},n.prototype.newDateLabels=function(t,n){for(var i=t.getDayLabels(),r=t.getDayStart(),e=[],u=0;u<7;++u){var s=i[(r+u)%7];e.push(this.newDateLabel(t,n,s))}return e},n.prototype.newDateLabel=function(t,n,i){return new ju({text:{value:i}})},n.prototype.newDateButtons=function(t,n){for(var i=[],r=0;r<7;++r)i.push(this.newSpace(t,n));for(r=1;r<=31;++r)i.push(this.newDateButton(t,n,r));return i},n.prototype.newSpace=function(t,n){return new Nu},n.prototype.newDateButton=function(t,n,i){var r=this;return new Mu({text:{value:String(i)},on:{active:function(){r.onDateButtonClicked(i)}}})},n.prototype.onDateButtonClicked=function(t){var n=this.Ju;if(n.getDate()!==t){var i=this.ts;n.setFullYear(i.getFullYear()),n.setMonth(i.getMonth()),n.setDate(t),this.onNewChange()}},n.prototype.getType=function(){return"DPickerDatetime"},n}(Bu),Pu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.picker)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.es;return null==n&&(n=new _u(null===(t=this.Nn)||void 0===t?void 0:t.picker),this.es=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDatetime"},n}(Ke),Fu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=n.DIALOG;return null==r&&(r=new Pu,n.DIALOG=r),r.new=r.current=this.toDate(i),r.open().then((function(t){return t.toISOString()}))},n.prototype.toDate=function(t){return at(t)||Xt(t)?new Date(t):t instanceof Date?t:new Date},n}(iu),Uu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.picker)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.es;return null==n&&(n=new Bu(null===(t=this.Nn)||void 0===t?void 0:t.picker),this.es=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogTime"},n}(Ke),Gu=function(t){return t!=t},zu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=this,e=n.DIALOG;return null==e&&(e=new Uu,n.DIALOG=e),e.new=e.current=this.toDate(i),e.open().then((function(t){return r.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){if(Xt(t))return new Date(t);if(at(t)){var n=new Date,i=this.getPattern().exec(t);if(null!=i){var r=this.toHours(i[1]);null!=r&&n.setHours(r);var e=this.toMinutes(i[2]);null!=e&&n.setMinutes(e);var u=this.toSeconds(i[3]);null!=u&&n.setSeconds(u);var s=this.toMilliseconds(i[4]);null!=s&&n.setMilliseconds(s)}return n}return t instanceof Date?t:new Date},n.prototype.toHours=function(t){return this.toNumber(t,0,23)},n.prototype.toMinutes=function(t){return this.toNumber(t,0,59)},n.prototype.toSeconds=function(t){return this.toNumber(t,0,59)},n.prototype.toMilliseconds=function(t){var n=this.toNumber(t,0,999);if(null!=n){var i=t.length;return 1===i?100*n:2===i?10*n:n}return n},n.prototype.toNumber=function(t,n,i){if(null!=t){var r=+t;if(!Gu(r))return Math.min(i,Math.max(n,r))}return null},n.prototype.getPattern=function(){var t=n.PATTERN;return null==t&&(t=this.newPattern(),n.PATTERN=t),t},n.prototype.newPattern=function(){return/^\s*(?:(\d+)(?::(\d+)(?::(\d+))?)?)?(?:\.(\d+))?\s*$/},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return oi.create("%Hm")},n}(iu),Hu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDate"},n}(_u),Vu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.picker)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.es;return null==n&&(n=new Hu(null===(t=this.Nn)||void 0===t?void 0:t.picker),this.es=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDate"},n}(Ke),Wu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=this,e=n.DIALOG;return null==e&&(e=new Vu,n.DIALOG=e),e.new=e.current=this.toDate(i),e.open().then((function(t){return r.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){return at(t)||Xt(t)?new Date(t):t instanceof Date?t:new Date},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return oi.create("%Y-%M-%D")},n}(iu),Xu=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.OPEN,i,n)||this;return s.target=r,s.onInputAction=e,s.initial=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target},n.prototype.toRuntime=function(){switch(this.subtype){case Ou.DIAGRAM:return new mu(this);case Ou.PAGE:return new wu(this);case Ou.PAGE_INPLACE:return new pu(this);case Ou.DIALOG_TEXT:return new gu(this);case Ou.DIALOG_INTEGER:return new cu(this);case Ou.DIALOG_REAL:return new vu(this);case Ou.DIALOG_BOOLEAN:return new ru(this);case Ou.DIALOG_DATE:return new Wu(this);case Ou.DIALOG_TIME:return new zu(this);case Ou.DIALOG_DATETIME:return new Fu(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.initial);return t.addResource("["+this.type+","+n+","+this.subtype+","+i+","+this.onInputAction+","+r+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources),e=ln.toResource(3,t,i.resources),u=ln.toResource(5,t,i.resources);return new n(t[2],r,e,t[4],u)},n}(cn),Ku={SHOW:0,HIDE:1},Yu=function(t){function n(n){var i=t.call(this,n,Yt.VISIBILITY)||this;return i.visibility=n.subtype===Ku.SHOW,i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i)&&(t.visible=this.visibility,n.written|=this.reset)},n}(Qt),Ju=function(t){function n(n,i){return t.call(this,fn.SHOW_HIDE,i,n)||this}return _(n,t),n.prototype.toRuntime=function(){return new Yu(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("["+this.type+","+n+","+this.subtype+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources);return new n(t[2],r)},n}(cn),Zu=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.amount=qt.ofNumber(n.amount),r}return _(n,t),n}(Qt),qu=function(t){function n(n){return t.call(this,n,Yt.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i);t.transform.position.x=r,n.written|=this.reset}},n}(Zu),$u=function(t){function n(n){return t.call(this,n,Yt.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i);t.transform.position.y=r,n.written|=this.reset}},n}(Zu),Qu=function(t){function n(n){return t.call(this,n,Yt.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=t.transform,u=e.position,s=!!(n.written&Yt.POSITION_X),h=!!(n.written&Yt.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o-c.c*r,a-c.d*r),n.written|=this.reset}},n}(Zu),ts=function(t){function n(n){return t.call(this,n,Yt.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=t.transform,u=e.position,s=!!(n.written&Yt.POSITION_X),h=!!(n.written&Yt.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o+c.a*r,a+c.b*r),n.written|=this.reset}},n}(Zu),ns=function(t){function n(n){return t.call(this,n,Yt.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=!!(n.written&Yt.POSITION_X),u=t.transform.position,s=e?u.x:n.x;u.x=s+r,n.written|=this.reset}},n}(Zu),is=function(t){function n(n){return t.call(this,n,Yt.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=!!(n.written&Yt.POSITION_Y),u=t.transform.position,s=e?u.y:n.y;u.y=s+r,n.written|=this.reset}},n}(Zu),rs=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r)||this;return u.opetype=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.opetype===i.opetype},n}(cn),es={RELATIVE_X:0,RELATIVE_Y:1,ABSOLUTE_X:2,ABSOLUTE_Y:3,FORWARD_OR_BACKWARD:4,LEFT_OR_RIGHT:5},us={RESIZE:0,MOVE:1,ROTATE:2},ss=function(t){function n(n,i,r){var e=t.call(this,fn.TRANSFORM,i,us.MOVE,n)||this;return e.amount=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case es.ABSOLUTE_X:return new qu(this);case es.ABSOLUTE_Y:return new $u(this);case es.FORWARD_OR_BACKWARD:return new Qu(this);case es.LEFT_OR_RIGHT:return new ts(this);case es.RELATIVE_X:return new ns(this);case es.RELATIVE_Y:return new is(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.opetype+","+i+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources),e=ln.toResource(4,t,i.resources);return new n(t[3],r,e)},n}(rs),hs=function(){function t(){}return t.toRounded=function(t){return Math.round(100*t)/100},t.toNormalized=function(n){return Math.abs(n)<.001?n<0?-.001:.001:t.toRounded(n)},t.resize=function(n,i,r,e,u){n.disallowUploadedUpdate();var s=n.transform.position;if(e){var h=Math.abs(r.x-i.x),o=Math.abs(r.y-i.y);if(u){var a=(l=Math.max(h,o))+l;n.size.set(t.toNormalized(a),t.toNormalized(a)),s.set(t.toRounded(i.x),t.toRounded(i.y))}else n.size.set(t.toNormalized(h+h),t.toNormalized(o+o)),s.set(t.toRounded(i.x),t.toRounded(i.y))}else if(u){h=r.x-i.x,o=r.y-i.y,a=Math.max(Math.abs(h),Math.abs(o));var c=i.x+(h<0?-a:+a),f=i.y+(o<0?-a:+a),l=.5*a,v=Math.min(i.x,c)+l,b=Math.min(i.y,f)+l;n.size.set(t.toNormalized(a),t.toNormalized(a)),s.set(t.toRounded(v),t.toRounded(b))}else{var d=Math.min(i.x,r.x),g=Math.min(i.y,r.y),m=Math.max(i.x,r.x)-d,w=Math.max(i.y,r.y)-g,p=.5*m,O=.5*w;n.size.set(t.toNormalized(m),t.toNormalized(w)),s.set(t.toRounded(d+p),t.toRounded(g+O))}n.allowUploadedUpdate()},t}(),os={RELATIVE_SIZE:0,RELATIVE_HEIGHT:1,RELATIVE_WIDTH:2,ABSOLUTE_SIZE:3,ABSOLUTE_HEIGHT:4,ABSOLUTE_WIDTH:5},as=function(t){function n(n,i){var r=t.call(this,n,i)||this;switch(n.opetype){case os.RELATIVE_SIZE:r.size=qt.ofNumberOrOne(n.amount);break;case os.ABSOLUTE_SIZE:r.size=qt.ofNumberOrOneHundred(n.amount);break;case os.RELATIVE_HEIGHT:r.size=qt.ofNumberOrOne(n.amount);break;case os.ABSOLUTE_HEIGHT:r.size=qt.ofNumberOrOneHundred(n.amount);break;case os.RELATIVE_WIDTH:r.size=qt.ofNumberOrOne(n.amount);break;case os.ABSOLUTE_WIDTH:r.size=qt.ofNumberOrOneHundred(n.amount);break;default:r.size=qt.ONE}return r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=(-.5+e)*i,h=(-.5+u)*r;t.updateTransform();var o=t.transform,a=o.position,c=o.localTransform,f=!!(n.written&Yt.POSITION_X),l=!!(n.written&Yt.POSITION_Y),v=f?a.x:n.x,b=l?a.y:n.y;n.written|=Yt.POSITION,a.set(v+s*c.a+h*c.c,b+s*c.b+h*c.d)},n}(Qt),cs=function(t){function n(n){var i=t.call(this,n,Yt.HEIGHT)||this;return i.origin=n.originY,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.size(t,i),e=t.size,u=n.written&Yt.HEIGHT?e.y:n.size.y;e.y=hs.toNormalized(r),n.written|=Yt.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(as),fs=function(t){function n(n){var i=t.call(this,n,Yt.HEIGHT)||this;return i.origin=n.originY,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.size(t,i),e=t.size,u=n.written&Yt.HEIGHT?e.y:n.size.y;e.y=hs.toNormalized(u*r),n.written|=Yt.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(as),ls=function(t){function n(n){var i=t.call(this,n,Yt.SIZE)||this;return i.originX=n.originX,i.originY=n.originY,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=hs.toNormalized(this.size(t,i)),e=t.size,u=!!(n.written&Yt.WIDTH),s=!!(n.written&Yt.HEIGHT),h=u?e.x:n.size.x,o=s?e.y:n.size.y;e.set(r,r),n.written|=Yt.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(as),vs=function(t){function n(n){var i=t.call(this,n,Yt.SIZE)||this;return i.originX=n.originX,i.originY=n.originY,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.size(t,i),e=t.size,u=!!(n.written&Yt.WIDTH),s=!!(n.written&Yt.HEIGHT),h=u?e.x:n.size.x,o=s?e.y:n.size.y;e.set(hs.toNormalized(h*r),hs.toNormalized(o*r)),n.written|=Yt.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(as),bs=function(t){function n(n){var i=t.call(this,n,Yt.WIDTH)||this;return i.origin=n.originX,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.size(t,i),e=t.size,u=n.written&Yt.WIDTH?e.x:n.size.x;e.x=hs.toNormalized(r),n.written|=Yt.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(as),ds=function(t){function n(n){var i=t.call(this,n,Yt.WIDTH)||this;return i.origin=n.originX,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.size(t,i),e=t.size,u=n.written&Yt.WIDTH?e.x:n.size.x;e.x=hs.toNormalized(u*r),n.written|=Yt.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(as),gs=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.TRANSFORM,i,us.RESIZE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case os.ABSOLUTE_HEIGHT:return new cs(this);case os.ABSOLUTE_WIDTH:return new bs(this);case os.ABSOLUTE_SIZE:return new ls(this);case os.RELATIVE_HEIGHT:return new fs(this);case os.RELATIVE_WIDTH:return new ds(this);case os.RELATIVE_SIZE:return new vs(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.opetype+","+this.originX+","+this.originY+","+i+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources),e=ln.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(rs),ms=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.originX=n.originX,r.originY=n.originY,r.amount=qt.ofNumber("("+n.amount+") * (Math.PI / 180)"),r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=!!(n.written&Yt.WIDTH),h=!!(n.written&Yt.HEIGHT),o=(-.5+e)*(s?t.size.x:n.size.x),a=(-.5+u)*(h?t.size.y:n.size.y),c=Math.sin(i)-Math.sin(r),f=Math.cos(i)-Math.cos(r),l=t.transform.position,v=!!(n.written&Yt.POSITION_X),b=!!(n.written&Yt.POSITION_Y),d=v?l.x:n.x,g=b?l.y:n.y;n.written|=Yt.POSITION,l.set(d+o*f-a*c,g+o*c+a*f)},n}(Qt),ws=function(t){function n(n){var i=t.call(this,n,Yt.ROTATION)||this;return i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=t.transform,u=n.written&Yt.ROTATION?e.rotation:n.rotation;e.rotation=r,n.written|=Yt.ROTATION,this.adjustPosition(t,n,u,r,this.originX,this.originY)}},n}(ms),ps=function(t){function n(n){var i=t.call(this,n,Yt.ROTATION)||this;return i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=t.transform,u=n.written&Yt.ROTATION?e.rotation:n.rotation;e.rotation=u+r,n.written|=Yt.ROTATION,this.adjustPosition(t,n,u,e.rotation,this.originX,this.originY)}},n}(ms),Os={RELATIVE:0,ABSOLUTE:1},Ds=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.TRANSFORM,i,us.ROTATE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case Os.ABSOLUTE:return new ws(this);case Os.RELATIVE:return new ps(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.opetype+","+this.originX+","+this.originY+","+i+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources),e=ln.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(rs),Es=function(){function t(){}return t.toSerialized=function(t){try{var n=JSON.parse(t);if(Wt(n)){for(var i=0,r=n.length;i<r;++i)if(!Xt(n[i]))return null;if(2<=n.length)return n}return null}catch(t){return null}},t.deserialize=function(t,n){var i=n.getAction(t);if(null!=i)return i;var r=n.resources[t];if(null!=r){var e=this.toSerialized(r);if(null!=e)switch(e[0]){case fn.SHOW_HIDE:return Ju.deserialize(e,n);case fn.BLINK:return vn.deserialize(e,n);case fn.CHANGE_COLOR:case fn.CHANGE_COLOR_LEGACY:switch(e[3]){case gn.COLOR_AND_ALPHA:case gn.COLOR:case gn.ALPHA:return Dn.deserialize(e,n);case gn.CODE:return Tn.deserialize(e,n);case gn.BRIGHTNESS:return Mn.deserialize(e,n)}break;case fn.CHANGE_TEXT:return li.deserialize(e,n);case fn.CHANGE_CURSOR:return Nn.deserialize(e,n);case fn.EMIT_EVENT:return cr.deserialize(e,n);case fn.OPEN:return Xu.deserialize(e,n);case fn.TRANSFORM:switch(e[2]){case us.MOVE:return ss.deserialize(e,n);case us.RESIZE:return gs.deserialize(e,n);case us.ROTATE:return Ds.deserialize(e,n)}break;case fn.MISC:switch(e[2]){case gr.GESTURE:return Pr.deserialize(e,n);case gr.LAYER_SHOW_HIDE:return ce.deserialize(e,n);case gr.LAYER_GESTURE:return oe.deserialize(e,n);default:return Lr.deserialize(e,n)}}}return new Ju(Ku.SHOW,"")},t}(),Ms=function(){function t(){}return t.toImageElement=function(n){var i=t.imageElements,r=i[n];if(null!=r)return r instanceof HTMLImageElement?Promise.resolve(r):r;var e=new Promise((function(t,r){var e=document.createElement("img");e.onload=function(){i[n]=e,t(e)},e.onabort=e.onerror=function(){r()},e.src=n}));return i[n]=e,e},t.imageElements={},t}(),Ss=function(){function t(t){this.us=t}return t.prototype.find=function(t){return this.getUuidToShape().get(t)},t.prototype.getUuidToShape=function(){var t=this.ss;return null==t&&(t=this.newUuidToShape(),this.ss=t),t},t.prototype.newUuidToShape=function(){var t=new Map;return this.fillUuidToShape(this.us,t),t},t.prototype.fillUuidToShape=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];n.set(e.uuid,e);var u=e.children;0<u.length&&this.fillUuidToShape(u,n)}},t}(),Ts=function(t){function n(n){return void 0===n&&(n=r.NULL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n}(kt),js=function(){function t(){}return t.toShape=function(i,r){var e=n[i[0]];if(null!=e){var u=e(i,r);if(null!=u)return u}return t.deserialize(i,r,new Ts)},t.deserialize=function(n,i,r){r.id=i.resources[n[1]]||"";var e=r.transform;e.position.set(n[2],n[3]),e.rotation=n[6],e.skew.set(n[7],n[7]),e.pivot.set(n[21],n[22]),r.size.set(hs.toNormalized(n[4]),hs.toNormalized(n[5])),r.fill.deserialize(n[8],i),r.stroke.deserialize(n[9],i),r.cursor=i.resources[n[10]]||"",r.text.deserialize(n[11],i),r.data.deserialize(n[12],i),r.radius=n[13],r.corner=n[14];var u=n[23];r.interactive=!!(1&u);var s=r.state;s.isFocusable=!(2&u),s.isActive=!!(4&u);var h=n[24];r.shortcut=0<=h?i.resources[h]:void 0;var o=n[25];r.title=0<=o?i.resources[o]:void 0;var a=n[26];r.uuid=null!=a?a:0;var c=null,f=n[20];if(0<f.length){for(var l=[],v=0,b=f.length;v<b;++v)l.push(t.toShape(f[v],i));c=Promise.all(l).then((function(t){r.children=t;for(var n=0,i=t.length;n<i;++n)t[n].parent=r;return r.onChildTransformChange(),r.toDirty(),r}))}var d=n[17];for(v=0,b=d.length;v<b;++v)r.action.add(Es.deserialize(d[v],i));var g=n[19];if(0<=g&&g<i.resources.length){var m=i.resources[g];at(m)&&(r.gradient=pt.deserializeGradient(m))}var w=null,p=n[18];if(0<=p&&p<i.resources.length){var O=i.resources[p];at(O)&&(w=Ms.toImageElement(O).then((function(t){return r.image=t,r})))}return null!=c?null!=w?Promise.all([c,w]).then((function(){return r})):c:null!=w?w:r},t.deserializeAll=function(n,i){for(var r=this,e=[],u=0,s=n.length;u<s;++u)e.push(t.toShape(n[u],i));return 0<e.length?Promise.all(e).then((function(t){return r.onDeserialized(n,t,new Ss(t),i),t})):null},t.onDeserialized=function(t,n,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u],o=n[u],a=i[h[0]];a&&a(h,o,r,e),this.onDeserialized(h[20],o.children,r,e)}},t}(),Ns=function(t,n){var i=new Gt,r=js.deserialize(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=U.NON_SCALING_MASK|U.DOTTED_MASK|U.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},Is=function(){e[r.BAR]=Vt,n[r.BAR]=Ns},Cs={NONE:0,ID:1,POSITION:2,WIDTH:4,HEIGHT:8,ROTATION:16,SKEW:32,ALIGN:64,REPLACING:128,GROUPING:256,FILL:512,STROKE:1024,STROKE_SIDE:2048,BORDER_RADIUS:4096,TEXT:8192,TEXTURE:16384,TAG:32768,DATA:32768,ACTION:65536,CURSOR:131072,ORDER_IN_LAYER:262144,CHILDREN:524288,COORDINATE:127,SHAPE:1920,LAYER:262144,PRIMITIVE:1042431,EMBEDDED:369151,CONNECTOR:1042049,ALL:1048575},As=function(){function t(){}return t.get=function(t){var n=this.mappings[t];return null!=n?n:Cs.PRIMITIVE},t.contains=function(t,n){if(null!=t){var i=this.get(t.type);if(i&n)return!0;if(i&Cs.CHILDREN)for(var r=t.children,e=0,u=r.length;e<u;++e)if(this.contains(r[e],n))return!0}return!1},t.set=function(t,n){this.mappings[t]=n},t.mappings={},t}(),Rs={},ys=36,ks=[0,0,0],Ls=new t.Point,xs=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+2,t[++r]=n+1,t[++r]=n+3,t[++r]=n+2,t[++r]=n+4,t[++r]=n+5,t[++r]=n+6,t[++r]=n+5,t[++r]=n+7,t[++r]=n+6,t[++r]=n+8,t[++r]=n+9,t[++r]=n+10,t[++r]=n+9,t[++r]=n+11,t[++r]=n+10,t[++r]=n+12,t[++r]=n+13,t[++r]=n+14,t[++r]=n+13,t[++r]=n+15,t[++r]=n+14,t[++r]=n+16,t[++r]=n+17,t[++r]=n+20,t[++r]=n+17,t[++r]=n+21,t[++r]=n+20,t[++r]=n+17,t[++r]=n+18,t[++r]=n+21,t[++r]=n+18,t[++r]=n+22,t[++r]=n+21,t[++r]=n+19,t[++r]=n+21,t[++r]=n+24,t[++r]=n+21,t[++r]=n+25,t[++r]=n+24,t[++r]=n+21,t[++r]=n+23,t[++r]=n+26,t[++r]=n+23,t[++r]=n+27,t[++r]=n+26,t[++r]=n+24,t[++r]=n+25,t[++r]=n+28,t[++r]=n+25,t[++r]=n+30,t[++r]=n+28,t[++r]=n+26,t[++r]=n+27,t[++r]=n+30,t[++r]=n+27,t[++r]=n+32,t[++r]=n+30,t[++r]=n+29,t[++r]=n+30,t[++r]=n+33,t[++r]=n+30,t[++r]=n+34,t[++r]=n+33,t[++r]=n+30,t[++r]=n+31,t[++r]=n+34,t[++r]=n+31,t[++r]=n+35,t[++r]=n+34},Bs=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.abs(l),d=Math.abs(v),g=o*Math.min(b,d),m=g/b,w=g/d,p=Ls;p.set(i-l,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r-v),a.apply(p,p);var M=p.x,S=p.y,T=M-D,j=S-E,N=m*T,I=m*j,C=D+N,A=E+I,R=M+T,y=S+j,k=R-N,L=y-I;p.set(i,r),a.apply(p,p);var x=p.x,B=p.y,_=x-M,P=B-S,F=w*_,U=w*P,G=M+F,z=S+U,H=G-T,V=z-j,W=H+N,X=V+I,K=G+T,Y=z+j,J=K-N,Z=Y-I,q=x-T,$=B-j,Q=x+T,tt=B+j,nt=x+_,it=B+P,rt=nt-F,et=it-U,ut=rt-T,st=et-j,ht=ut+N,ot=st+I,at=rt+T,ct=et+j,ft=at-N,lt=ct-I,vt=nt-T,bt=it-j,dt=vt+N,gt=bt+I,mt=nt+T,wt=it+j,pt=mt-N,Ot=wt-I;c[0]=O(D,E,C,A),c[1]=O(D,E,M,S),c[2]=O(D,E,q,$);var Dt=2*n-1;t[++Dt]=D,t[++Dt]=E,t[++Dt]=C,t[++Dt]=A,t[++Dt]=H,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=k,t[++Dt]=L,t[++Dt]=R,t[++Dt]=y,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=vt,t[++Dt]=bt,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=pt,t[++Dt]=Ot,t[++Dt]=mt,t[++Dt]=wt,t[++Dt]=C,t[++Dt]=A,t[++Dt]=M,t[++Dt]=S,t[++Dt]=k,t[++Dt]=L,t[++Dt]=H,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=G,t[++Dt]=z,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=q,t[++Dt]=$,t[++Dt]=x,t[++Dt]=B,t[++Dt]=x,t[++Dt]=B,t[++Dt]=Q,t[++Dt]=tt,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=rt,t[++Dt]=et,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=nt,t[++Dt]=it,t[++Dt]=pt,t[++Dt]=Ot},_s=function(t,n,i,r){var e=3*n-1,u=1-r[0]/r[1],s=1-r[0]/r[2];i&it.TOP_LEFT?(t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1):(t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0),i&it.TOP_RIGHT?(t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1):(t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0),i&it.BOTTOM_LEFT?(t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0),t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0},Ps=function(t,n,i,r,e,u,s){var h,a,c,f,l,v,b,d,g,m,w,p,O=o(e),D=s[0],E=s[1],M=s[2],S=Math.max(0,1-s[0]/s[1]),T=Math.max(0,1-s[0]/s[2]);r&xt.TOP?(h=2,a=1,c=1+T):(h=-2,a=-1,c=-1-T),r&xt.RIGHT?(f=2,l=1,v=1+S):(f=-2,l=-1,v=-1-S),r&xt.BOTTOM?(b=2,d=1,g=1+T):(b=-2,d=-1,g=-1-T),r&xt.LEFT?(m=2,w=1,p=1+S):(m=-2,w=-1,p=-1-S);var j=6*n-1;u&it.TOP_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c),u&it.TOP_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c),u&it.BOTTOM_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b),u&it.BOTTOM_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=b),t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b},Fs=function(t,n,i,r){var e=i.x0,u=i.x1,s=i.x2,h=i.x3,o=i.y0,a=i.y1,c=i.y2,f=i.y3,l=.5*(e+u),v=.5*(o+a),b=.5*(h+s),d=.5*(f+c),g=.5*r[0]/r[1],m=.5*r[0]/r[2],w=g*(u-e),p=g*(a-o),O=m*(h-e),D=m*(f-o),E=2*n-1;t[++E]=e,t[++E]=o,t[++E]=e+w,t[++E]=o+p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+w+O,t[++E]=o+p+D,t[++E]=u-w,t[++E]=a-p,t[++E]=u,t[++E]=a,t[++E]=u-w+O,t[++E]=a-p+D,t[++E]=u+O,t[++E]=a+D,t[++E]=h-O,t[++E]=f-D,t[++E]=h+w-O,t[++E]=f+p-D,t[++E]=h,t[++E]=f,t[++E]=h+w,t[++E]=f+p,t[++E]=s-w-O,t[++E]=c-p-D,t[++E]=s-O,t[++E]=c-D,t[++E]=s-w,t[++E]=c-p,t[++E]=s,t[++E]=c,t[++E]=e+w,t[++E]=o+p,t[++E]=l,t[++E]=v,t[++E]=u-w,t[++E]=a-p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+O+w,t[++E]=o+D+p,t[++E]=l+O,t[++E]=v+D,t[++E]=u+O-w,t[++E]=a+D-p,t[++E]=u+O,t[++E]=a+D;var M=.5*(e+s),S=.5*(o+c);t[++E]=.5*(e+h),t[++E]=.5*(o+f),t[++E]=M,t[++E]=S,t[++E]=M,t[++E]=S,t[++E]=.5*(u+s),t[++E]=.5*(a+c),t[++E]=h-O,t[++E]=f-D,t[++E]=h-O+w,t[++E]=f-D+p,t[++E]=b-O,t[++E]=d-D,t[++E]=s-O-w,t[++E]=c-D-p,t[++E]=s-O,t[++E]=c-D,t[++E]=h+w,t[++E]=f+p,t[++E]=b,t[++E]=d,t[++E]=s-w,t[++E]=c-p},Us=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),xs(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=n.radius,s=r!==this.sizeX||e!==this.sizeY||u!==this.radius,h=H(n),o=this.transformLocalId!==h,a=n.stroke,c=a.align,f=a.enable?a.width:0,l=a.side,v=a.style,b=this.strokeAlign!==c||this.strokeWidth!==f||this.strokeSide!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=V(n),w=W(m),p=m!==this.texture||w!==this.textureTransformId,O=s||b;if(O||o||g||p){this.sizeX=r,this.sizeY=e,this.radius=u,this.transformLocalId=h,this.strokeAlign=c,this.strokeWidth=f,this.strokeSide=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),Bs(t.vertices,D,0,0,r,e,c,f,u,n.transform.internalTransform,ks),(O||g||o)&&(t.updateSteps(),Ps(t.steps,D,f,l,v,d,ks)),(O||g)&&(t.updateClippings(),_s(t.clippings,D,d,ks)),(O||p)&&(t.updateUvs(),Fs(t.uvs,D,X(m),ks))}},n}(z),Gs=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=ys+h,c=24+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Us(i,r,a-h,c-o),new Ht(i+ys,r+24,h,o)]).init(n):null},zs=function(t,n,i,r,e){return Gs(t,n,i,r)},Hs=function(t,n,i,r,e,u){var s=-i+e;if(t<=s)return n<=(h=-r+e)&&u&it.TOP_LEFT?(a=t-s)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&it.BOTTOM_LEFT?(a=t-s)*a+(c=n-o)*c<=e*e:-i<=t;var h,o,a,c,f=+i-e;return f<=t?n<=(h=-r+e)&&u&it.TOP_RIGHT?(a=t-f)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&it.BOTTOM_RIGHT?(a=t-f)*a+(c=n-o)*c<=e*e:t<=+i:-r<=n&&n<=+r},Vs=function(t,n,i,r,e,u,s){var h=t.fill;if(h.enable||0<u){var o=t.radius*Math.min(r,e),a=t.corner;if(Hs(n,i,r,e,o,a)){if(h.enable)return!0;var c=u*s,f=Math.max(0,r-c),l=Math.max(0,e-c),v=Math.max(0,o-c);if(!Hs(n,i,f,l,v,a)){var b=t.stroke.side;if(b===xt.ALL)return!0;if(n<=-f+v){var d=!!(b&xt.LEFT);return i<=-l+v?!(!(g=!!(b&xt.TOP))||!d)||(g?-f<=i:!!d&&n<=-f):+l-v<=i?!(!(m=!!(b&xt.BOTTOM))||!d)||(m?+f<=i:!!d&&n<=-f):d}if(+f-v<=n){var g,m,w=!!(b&xt.RIGHT);return i<=-l+v?!(!(g=!!(b&xt.TOP))||!w)||(g?-f<=i:!!w&&+f<=n):+l-v<=i?!(!(m=!!(b&xt.BOTTOM))||!w)||(m?+f<=i:!!w&&+f<=n):w}return i<=-l+v?!!(b&xt.TOP):+l-v<=i&&!!(b&xt.BOTTOM)}}}return!1},Ws=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Vs(this,n,i,r,e,u,s)},n}(kt),Xs=function(t){function n(n){void 0===n&&(n=r.BUTTON);var i=t.call(this,n)||this;return i.au=!1,i.hs=!1,i}return _(n,t),Object.defineProperty(n.prototype,"isToggle",{get:function(){return this.au},set:function(t){this.au=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return this.hs},set:function(t){this.hs=t},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.au?1:0,e=this.hs?2:0;return i[15]=n.addResource("["+(r|e)+"]"),i},n}(Ws),Ks=function(t,n){var i=n.resources,r=t[15];if(0<=r&&r<i.length){var e=n.getExtension(r);null==e&&(e=JSON.parse(i[r]),n.setExtension(r,e));var u=new Xs;return u.isToggle=!!(1&e[0]),u.isGrouped=!!(2&e[0]),js.deserialize(t,n,u)}return js.deserialize(t,n,new Xs)},Ys=function(t){function n(n,i){return t.call(this,gr.EMIT_EVENT,n,i,Dr.EMIT_EVENT,"")||this}return _(n,t),n}(Lr),Js=function(t){function n(n,i,r){return t.call(this,n,i,"",Dr.EMIT_EVENT,r)||this}return _(n,t),n}(Lr),Zs=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e,"")||this}return _(n,t),n}(Lr),qs=function(t){function n(n,i,r,e){return t.call(this,n,i,r,Dr.EMIT_EVENT,e)||this}return _(n,t),n}(Lr),$s=function(t){function n(n){var i=t.call(this,Yt.COLOR_FILL_AND_STROKE|Yt.COLOR_TEXT|Yt.COLOR_TEXT_OUTLINE|Yt.CURSOR)||this,r=n.fill,e=r.color,u=i.toOnHovered(e),s=2*u;i.os=e,i.cs=wt.toGrayscale(e),i.fs=wt.darken(e,s),i.ls=wt.darken(e,u);var h=r.alpha;i.vs=h,i.bs=.5*h;var o=n.stroke,a=o.color,c=i.toOnHovered(a),f=2*c;i.gs=a,i.ws=wt.toGrayscale(a),i.ps=wt.darken(a,f),i.Os=wt.darken(a,c);var l=o.alpha;i.Ds=l,i.Es=.5*l;var v=n.text,b=v.color;i.iu=b,i.Ms=wt.toGrayscale(b);var d=v.alpha;i.ru=d,i.Ss=.5*d;var g=v.outline,m=g.color;i.Ts=m,i.js=wt.toGrayscale(m);var w=g.alpha;return i.Ns=w,i.Is=.5*w,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=wt.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.cs:t.isPressed||t.isActive?this.fs:t.isFocused||t.isHovered?this.ls:this.os},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.bs:this.vs},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.ws:t.isPressed||t.isActive?this.ps:t.isFocused||t.isHovered?this.Os:this.gs},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.Es:this.Ds},n.prototype.getTextColor=function(t){return t.inDisabled?this.Ms:this.iu},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.Ss:this.ru},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.js:this.Ts},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.Is:this.Ns},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}($t),Qs=function(t){function n(n){var i=t.call(this,Yt.COLOR_FILL_AND_STROKE|Yt.COLOR_TEXT|Yt.COLOR_TEXT_OUTLINE|Yt.CURSOR)||this,r=n.fill,e=r.color;i.Cs=e;var u=i.toOnHovered(e),s=2*u;i.As=wt.darken(e,s),i.Rs=wt.darken(e,u);var h=15197671;i.os=h;var o=i.toOnHovered(h),a=2*o;i.fs=wt.darken(h,a),i.ls=wt.darken(h,o);var c=r.alpha;i.vs=c,i.bs=.5*c;var f=n.stroke,l=f.color;i.ys=l;var v=i.toOnHovered(l),b=2*v;i.ks=wt.darken(l,b),i.Ls=wt.darken(l,v);var d=15197671;i.gs=d;var g=i.toOnHovered(d),m=2*g;i.ps=wt.darken(d,m),i.xs=wt.darken(d,g);var w=f.alpha;i.Ds=w,i.Es=.5*w;var p=n.text,O=p.color;i.Bs=O,i.Ms=wt.toGrayscale(O),i.iu=5197647;var D=p.alpha;i.ru=D,i.Ss=.5*D;var E=p.outline,M=E.color;i.Ts=M,i.js=wt.toGrayscale(M);var S=E.alpha;return i.Ns=S,i.Is=.5*S,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=wt.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.os:t.isActive?t.isPressed?this.As:t.isFocused||t.isHovered?this.Rs:this.Cs:t.isPressed?this.fs:t.isFocused||t.isHovered?this.ls:this.os},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.bs:this.vs},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.gs:t.isActive?t.isPressed?this.ks:t.isFocused||t.isHovered?this.Ls:this.ys:t.isPressed?this.ps:t.isFocused||t.isHovered?this.xs:this.gs},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.Es:this.Ds},n.prototype.getTextColor=function(t){return t.inDisabled?this.Ms:t.isActive?this.Bs:this.iu},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.Ss:this.ru},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.js:this.Ts},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.Is:this.Ns},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}($t),th=function(t){function n(n){var i=t.call(this,n)||this;return n instanceof Xs&&(i.au=n.isToggle,i.hs=n.isGrouped),i}return _(n,t),n.prototype.isActionable=function(){return!0},n.prototype.initialize=function(n){this.actions.unshift(this.au?new Qs(this):new $s(this)),t.prototype.initialize.call(this,n)},n.prototype.onClick=function(n,i){var r=n.state,e=r.isClicked;r.lock(),t.prototype.onClick.call(this,n,i),!e&&r.isClicked&&(this.au?r.isActive=!r.isActive:r.isActive||(r.isActivated=!0)),r.unlock()},n.prototype.onStateChange=function(n,i,r){t.prototype.onStateChange.call(this,n,i,r),this.au&&this.hs&&i.is(lt.ACTIVATED)&&this.onActivated(n)},n.prototype.onActivated=function(t){var n=t.parent;if(null!=n)for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u instanceof Xs&&u.isToggle&&u.isGrouped&&(u.state.isActive=!1)}},n}(Jt),nh=function(){e[r.BUTTON]=zs,n[r.BUTTON]=Ks,Rs[r.BUTTON]=th,As.set(r.BUTTON,Cs.PRIMITIVE|Cs.STROKE_SIDE|Cs.BORDER_RADIUS)},ih=[0,0],rh=new t.Point,eh=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1},uh=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},sh=function(t,n,i,r,e,u,s,h,o,a){var c=rh,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D+(D-g),S=E+(E-m),T=D-w,j=E-p,N=2*n-1;t[++N]=b,t[++N]=d,t[++N]=g,t[++N]=m,t[++N]=g+w,t[++N]=m+p,t[++N]=T,t[++N]=j,t[++N]=D,t[++N]=E,t[++N]=D+w,t[++N]=E+p,t[++N]=M-w,t[++N]=S-p,t[++N]=M,t[++N]=S,t[++N]=M+w,t[++N]=S+p,a[0]=O(b,d,g,m),a[1]=O(b,d,T,j)},hh=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<9;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},oh=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a),t[++f]=s,t[++f]=c,t[++f]=.5*(s+u),t[++f]=.5*(c+a),t[++f]=u,t[++f]=a},ah=function(t){function n(n,i){return t.call(this,n,i,9,8)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;eh(t.clippings,n),uh(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=H(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),sh(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,ih),hh(t.steps,t.clippings,this.vertexOffset,c,f,ih))},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=X(i);oh(t.uvs,this.vertexOffset,e)}},n}(z),ch=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new ah(i,r),new Ht(i+9,r+8,h,o)]).init(n):null},fh=function(t){function n(n){return void 0===n&&(n=r.CIRCLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Lt(this,n,i,r,e,u,s)},n}(kt),lh=function(t,n){return js.deserialize(t,n,new fh)},vh=function(){e[r.CIRCLE]=ch,n[r.CIRCLE]=lh},bh=new t.Point,dh=function(t){return t?t.formatted.length:0},gh=function(t){return 12*Math.ceil(dh(t)/12)},mh=function(t,n){return n?4*t+2:4*t},wh=function(t,n){return mh(t,n)-2},ph=function(t,n,i,r){for(var e=3*n-1,u=3*(n+i)-1,s=0;s<r;++s)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5,t[++e]=1,t[++e]=0,t[++e]=4,t[++e]=0,t[++e]=1,t[++e]=6;for(;e<u;)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5},Oh=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s+0,t[++e]=s+2,t[++e]=s+1,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=2},Dh=function(t,n,i,r,e,u){for(var s=1/Math.max(1e-5,u),h=e.x0,o=e.x1,a=e.x2,c=e.x3,f=e.y0,l=e.y1,v=e.y2,b=e.y3,d=o-h,g=l-f,m=a-c,w=v-b,p=(i<<1)-1,O=(i+r<<1)-1,D=(i<<2)-8;p<O;){var E=n[D+=8]*s;t[++p]=h+E*d,t[++p]=f+E*g,t[++p]=c+E*m,t[++p]=b+E*w}},Eh=function(t,n,i,r,e,u,s,h,o,a,c,f){var l=ki;null==l&&(ki=l=[]);for(var v=f.a,b=f.b,d=f.c,g=f.d,m=f.tx,w=f.ty,p=0;p<u;++p){var O=p<<1,D=h[O],E=h[O+1];l[O]=v*D+d*E+m,l[O+1]=b*D+g*E+w}return Sh(t,n,i,r,e,u,s,l,o,a,c)},Mh=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=1]=b,n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=4]=b},Sh=function(t,n,i,r,e,u,s,h,o,a,c){var f=o.length;if(0<f){if(s){for(var l=0,v=0,b=r,d=0,g=o[0],m=1;m<f;++m)2<=(d=o[m])-g&&(v=jh(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=mh(d-g,!1)),g=d;return 2<=(d=o[0]+u)-g?(v=jh(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=mh(d-g,!1)):Th(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}for(l=0,v=0,b=r,2<=(d=o[0])&&(v=jh(t,n,i,b,-1,h,0,d,u,a,c,v),l=Math.max(l,v),b+=mh(d,!1)),g=d,m=1;m<f;++m)2<=(d=o[m])-g&&(v=jh(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=mh(d-g,!1)),g=d;return 2<=(d=u)-g?(v=jh(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=mh(d-g,!1)):Th(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}return s?Nh(t,n,i,r,e,h,0,u,u,a,c):jh(t,n,i,r,e,h,0,u,u,a,c,0)},Th=function(t,n,i,r,e,u,s,h,a,c,f,l){if(0<=e)for(var v=o(f),b=(r<<1)-1,d=6*r-1,g=(r<<2)-1,m=(r+e<<1)-1,w=s%a<<1,p=u[w],O=u[w+1];b<m;)t[++b]=p,t[++b]=O,n[++d]=0,n[++d]=v,n[++d]=-1,n[++d]=0,n[++d]=1,n[++d]=0,i[++g]=l,i[++g]=0,i[++g]=0,i[++g]=l;return 0},jh=function(t,n,i,r,e,u,s,a,c,f,l,v){var b=o(l),d=s%c<<1,g=u[d],m=u[d+1],w=(s+1)%c<<1,p=u[w],D=u[w+1],E=g-(p-g),M=m-(D-m),S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=0;Mh(S,t,T,n,j,i,g,m,f,b,E,M,p,D,v),Mh(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;for(var I=s+1,C=a-1;I<C;++I){E=g,M=m,g=p,m=D;var A=(I+1)%c<<1;p=u[A],D=u[A+1],N+=O(E,M,g,m),Mh(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),Mh(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8}E=g,M=m,p=(g=p)+(g-E),D=(m=D)+(m-M),N+=O(E,M,g,m),Mh(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),Mh(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;var R=h(N,f,l,bh),y=R.x,k=R.y,L=(r<<2)-1;for(I=L,C=L+8;I<C;I+=4)i[I+2]=y,i[I+3]=k,i[I+4]=v;for(I=L+8;I<j;I+=4)i[I+2]=y,i[I+3]=k,i[I+4]=N;if(0<=e)for(var x=(r+e<<1)-1;S<x;)t[++S]=g,t[++S]=m,n[++T]=0,n[++T]=b,n[++T]=E,n[++T]=M,n[++T]=p,n[++T]=D,i[++j]=N,i[++j]=y,i[++j]=k,i[++j]=N;return N},Nh=function(t,n,i,r,e,u,s,a,c,f,l){for(var v=o(l),b=(a-1)%c<<1,d=0,g=0,m=u[b],w=u[b+1],p=s%c<<1,D=u[p],E=u[p+1],M=0,S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=s;N<a;++N){d=m,g=w,m=D,w=E;var I=(N+1)%c<<1;D=u[I],E=u[I+1],M+=O(d,g,m,w),Mh(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),Mh(S+=4,t,T+=12,n,j+=8,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8}d=m,g=w,m=D,w=E;var C=(s+1)%c<<1;D=u[C],E=u[C+1],M+=O(d,g,m,w),Mh(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8;var A=h(M,f,l,bh),R=A.x,y=A.y;for(N=(r<<2)-1;N<j;N+=4)i[N+2]=R,i[N+3]=y,i[N+4]=-1;if(0<=e)for(var k=(r+e<<1)-1;S<k;)t[++S]=m,t[++S]=w,n[++T]=f,n[++T]=v,n[++T]=d,n[++T]=g,n[++T]=D,n[++T]=E,i[++j]=M,i[++j]=R,i[++j]=y,i[++j]=-1;return M},Ih=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.pointId=-1,u.pointCount=0,u.pointsClosed=!1,u.length=1,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Oh(t.indices,this.vertexOffset,this.indexOffset,this.indexCount)},n.prototype.isCompatible=function(t){return mh(gh(t.points),!0)===this.vertexCount},n.prototype.update=function(t,n){this.updateLineClipping(t,n),this.updateLineVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateLineUv(t,n)},n.prototype.updateLineClipping=function(t,n){var i=n.points;if(i){var r=i.formatted.length;this.pointCount!==r&&(this.pointCount=r,this.pointId=-1,t.updateClippings(),ph(t.clippings,this.vertexOffset,this.vertexCount,r))}},n.prototype.updateLineVertexStepAndColorFill=function(t,n){var i=n.points;if(i){var r=i.id,e=i.formatted,u=!!(e.style&U.CLOSED),s=r!==this.pointId||u!==this.pointsClosed,h=n.stroke,o=h.enable?h.width:0,a=h.style,c=this.strokeWidth!==o||this.strokeStyle!==a,f=H(n),l=this.transformLocalId!==f;(s||l||c)&&(this.pointId=r,this.pointsClosed=u,this.strokeWidth=o,this.strokeStyle=a,this.transformLocalId=f,s&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),this.length=Eh(t.vertices,t.steps,t.colorFills,this.vertexOffset,this.vertexCount,this.pointCount,this.pointsClosed,e.values,e.segments,o,a,n.transform.internalTransform))}},n.prototype.updateLineUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),Dh(t.uvs,t.colorFills,this.vertexOffset,this.vertexCount,X(i),this.length))},n}(z),Ch=[0,0,0],Ah=new t.Point,Rh=function(t,n){var i=3*n-1;t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0},yh=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+2,t[++r]=n+0,t[++r]=n+3,t[++r]=n+4,t[++r]=n+0,t[++r]=n+5,t[++r]=n+6},kh=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=2*f*l/(f+Math.sqrt(f*f+4*l*l)),b=Ah;b.set(i,r-l),o.apply(b,b);var d=b.x,g=b.y;b.set(i,r),o.apply(b,b);var m=b.x,w=b.y;b.set(i+f,r),o.apply(b,b);var p=m-d,D=w-g,E=b.x+p,M=b.y+D,S=m+(m-b.x)+p,T=w+(w-b.y)+D;b.set(i,r+l-v),o.apply(b,b);var j=b.x,N=b.y,I=m+p,C=w+D;a[0]=O(I,C,j,N),a[1]=O(E,M,I,C),a[2]=O(d,g,m,w);var A=(n<<1)-1;t[++A]=j,t[++A]=N,t[++A]=d,t[++A]=g,t[++A]=E,t[++A]=M,t[++A]=E,t[++A]=M,t[++A]=S,t[++A]=T,t[++A]=S,t[++A]=T,t[++A]=d,t[++A]=g},Lh=function(t,n,i,r,e,u,s){for(var h=o(u),a=s[0],c=6*i-1,f=3*i,l=0;l<r;l+=1,f+=3)t[++c]=e,t[++c]=h,t[++c]=a,t[++c]=a,t[++c]=1+n[f],t[++c]=1+n[f+1]},xh=function(t,n,i,r){var e=n.x0,u=n.x1,s=n.x2,h=n.x3,o=n.y0,a=n.y1,c=n.y2,f=n.y3,l=.5*(e+u),v=.5*(o+a),b=1-.5*r[0]/r[2],d=l+b*(h-e),g=v+b*(f-o),m=(i<<1)-1;t[++m]=d,t[++m]=g,t[++m]=l,t[++m]=v,t[++m]=s,t[++m]=c,t[++m]=s,t[++m]=c,t[++m]=h,t[++m]=f,t[++m]=h,t[++m]=f,t[++m]=l,t[++m]=v},Bh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.updateColorFill=function(t,n){var i=n.points;if(null!=i){var r=i.getMarker();if(null!=r){var e=this.toMarker(r).fill,u=n.visible&&e.enable,s=e.color,h=u?e.alpha:0;s===this.colorFill&&h===this.alphaFill||(this.colorFill=s,this.alphaFill=h,t.updateColorFills(),G(s,h,this.vertexOffset,this.vertexCount,t.colorFills))}}},n}(z),_h=function(n){function i(t,i){var r=n.call(this,t,i,7,3)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices(),Rh(t.clippings,this.vertexOffset),yh(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=H(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=V(r),O=W(p),D=p!==this.texture||O!==this.textureTransformId,E=f||w,M=u.id,S=M!==this.pointId;if(E||v||D||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.texture=p,this.textureTransformId=O,this.pointId=M;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),kh(n.vertices,T,0,0,a,c,d,g,j,Ch),(E||v)&&(n.updateSteps(),Lh(n.steps,n.clippings,T,7,g,m,Ch)),(E||D)&&(n.updateUvs(),xh(n.uvs,X(p),T,Ch))}}}},i}(Bh),Ph=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(_h),Fh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(_h),Uh=function(n){function i(t,i){var r=n.call(this,t,i,9,8)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;eh(t.clippings,n),uh(t.indices,n,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},i.prototype.updateVertexAndStep=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=H(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=u.id,O=p!==this.pointId;if(f||v||w||O){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.pointId=p;var D=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;D.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),n.updateSteps(),sh(n.vertices,this.vertexOffset,0,0,a,c,d,g,D,ih),hh(n.steps,n.clippings,this.vertexOffset,g,m,ih)}}}},i.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=X(i);oh(t.uvs,this.vertexOffset,e)}},i}(Bh),Gh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(Uh),zh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Uh),Hh=function(){function n(t,n){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=0,this.indexCount=0,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=V(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Vh=function(t,n){for(var i=0,r=t.length-1;i<=r;){var e=i+(r-i>>1),u=t[e];if(n<u)r=e-1;else{if(!(u<n))return e;i=e+1}}return-1},Wh=2*Math.PI,Xh=.5*Math.PI,Kh=function(t,n,i,r){return t*i+n*r},Yh=function(t,n){return Math.sqrt(Kh(t,n,t,n))},Jh=function(t,n,i,r){return t*r-n*i},Zh=function(t,n,i,r,e,u,s,h,o,a){var c=a.center;c[0]=t,c[1]=n;var f=a.axis1;f[0]=i,f[1]=r;var l=a.axis2;l[0]=e,l[1]=u;var v=a.angle;return v[0]=s,v[1]=h,v[2]=o,a},qh=function(t,n){var i=t.center,r=t.axis1,e=t.axis2,u=t.angle;return Zh(i[0],i[1],r[0],r[1],e[0],e[1],u[0],u[1],u[2],n)},$h=function(t,n){for(var i=t.length,r=0;r<i;++r)n[r]=t[r];return n.length!==i&&(n.length=i),n},Qh=function(){function t(){}return t.set=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){for(var d=Math.max(Math.abs(n-i),Math.abs(s-h)),g=f?Math.max(1,Math.round(c*(d/Xh))):c,m=l?g+1:g,w=0;w<m;++w){var p=w/g,O=1-p,D=p,E=O*n+D*i,M=Math.cos(E),S=Math.sin(E),T=t[0]+M*r[0]+S*e[0],j=t[1]+M*r[1]+S*e[1],N=O*s+D*h,I=Math.cos(N),C=Math.sin(N),A=u[0]+I*o[0]+C*a[0],R=u[1]+I*o[1]+C*a[1],y=Xh*p,k=Math.cos(y),L=Math.sin(y),x=k*k,B=L*L,_=x*T+B*A,P=x*j+B*R;v[++b]=_,v[++b]=P}return b},t.interpolate=function(t,n,i,r,e,u,s,h){var o=h.values,a=h.segments;if(t<=2)return $h(n,o),$h(i,a),h;var c=this.WORK_P0||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},f=this.WORK_P1||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},l=this.WORK_P2||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]};this.WORK_P0=c,this.WORK_P1=f,this.WORK_P2=l;var v=-1,b=-1;if(e){r(0,t,n,c),qh(c,f);for(var d=1;d<t;++d){if(r(d,t,n,l),0<=Vh(i,d)){var g=d-1<<1;o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1}else v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v);var m=f;f=l,l=m}0<=Vh(i,0)?(g=t-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a.unshift(0),b+=1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v)}else{r(1,t,n,c),0<=Vh(i,1)?(o[++v]=n[0],o[++v]=n[1],a[++b]=1):v=this.set(c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v),qh(c,f),d=2;for(var w=t-1;d<w;++d)r(d,t,n,l),0<=Vh(i,d)?(g=d-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v),m=f,f=l,l=m;0<=Vh(i,t-1)?(g=t-2<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,u,s,!0,o,v)}return v+=1,o.length!==v&&(o.length=v),b+=1,a.length!==b&&(a.length=b),h},t.toCircle=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=a-h,b=c-o,d=f-a,g=l-c,m=h+.5*v,w=o+.5*b,p=a+.5*d,O=c+.5*g,D=-b,E=+v,M=-g,S=+d,T=Jh(D,E,M,S);if(Math.abs(T)<.001){if(0<=Kh(v,b,d,g)||n<=2){var j=.01,N=Math.sin(j),I=Yh(v,b),C=Yh(d,g);return Zh(a,c,0,0,d/N,g/N,-j*I/C,0,j,r)}T=.001}var A=(S*(p-m)+M*(w-O))/T,R=m+A*D,y=w+A*E,k=a-R,L=c-y,x=-L,B=+k,_=f-R,P=l-y,F=Math.atan2(Kh(x,B,_,P),Kh(k,L,_,P)),U=h-R,G=o-y,z=Math.atan2(Kh(x,B,U,G),Kh(k,L,U,G));return 0<z*F&&(Math.abs(z)<Math.abs(F)&&(0<F?F-=Wh:F+=Wh),Math.abs(F)<Math.abs(z)&&(0<z?z-=Wh:z+=Wh)),Zh(R,y,k,L,x,B,z,0,F,r)},t.toEllipse=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=h-a,b=o-c,d=f-a,g=l-c;if(n<=2){var m=.01,w=Math.sin(m);return Zh(a,c,0,0,d/w,g/w,-m,0,m,r)}for(var p=Yh(v,b),O=Yh(d,g),D=Kh(v,b,d,g)/(p*O),E=Math.acos(D),M=.5*E,S=.25*E,T=0,j=0,N=0,I=0,C=Math.max(p,O),A=Math.min(p,O),R=0;R<16;++R){var y=.5*M,k=E-y;T=C*Math.sin(y),j=C*Math.cos(y),N=A*Math.sin(k),1<(1-(I=A*Math.cos(k))/j)*(1-I/j)+N*N/(T*T)?M+=S:M-=S,S*=.5}var L=Math.asin(Math.min(N/T,1));if(p<O){var x=d/O,B=g/O,_=void 0,P=void 0;return 0<Jh(v,b,d,g)?(_=+B,P=-x):(_=-B,P=+x),Zh(H=a-(G=(F=-j*j/O)*x+(U=-j*T/O)*_),V=c-(z=F*B+U*P),G,z,f-H,l-V,-L,0,Xh,r)}var F,U,G,z,H,V,W=v/p,X=b/p;return _=void 0,P=void 0,Jh(v,b,d,g)<0?(_=+X,P=-W):(_=-X,P=+W),Zh(H=a-(G=(F=-j*j/p)*W+(U=-j*T/p)*_),V=c-(z=F*X+U*P),G,z,-(h-H),-(o-V),-Xh,0,L,r)},t.toHybrid=function(n,i,r,e){var u=t.toCircle(n,i,r,e),s=u.angle[0],h=u.angle[2],o=Math.min(s,h),a=Math.max(s,h);return o<-Xh||Xh<a?t.toEllipse(n,i,r,e):u},t}(),to=function(t,n,i,r,e){return Qh.interpolate(t,n,i,Qh.toHybrid,!!(r&U.CLOSED),Y.CURVE_SEGMENT_COUNT,!0,e),e.length=e.values.length>>1,e.style=r,e},no=function(t,n){if(2<=t.length){for(var i=t[0],r=t[1],e=i,u=r,s=2,h=t.length;s<h;s+=2){var o=t[s],a=t[s+1];i=Math.min(i,o),r=Math.min(r,a),e=Math.max(e,o),u=Math.max(u,a)}n[0]=i,n[1]=r,n[2]=e,n[3]=u}else n[0]=0,n[1]=0,n[2]=0,n[3]=0;return n},io=function(){function n(n){var i=this;this.O=n,this._s=0,this.Ps=!1,this.Fs=!1,this.Us=!1,this.jt=J.NONE,this.I=new t.ObservablePoint((function(){i.onSizeChange()}),void 0,.15*Y.SIZE_X,.15*Y.SIZE_Y),this.A=this.newFill(),this.Gs=0}return n.prototype.newFill=function(){return new Z(this,!0,Y.FILL_COLOR,1)},n.prototype.lock=function(){return this._s+=1,1===this._s&&(this.Ps=!1,this.Fs=!1,this.Us=!1),this},n.prototype.unlock=function(){return this._s-=1,0===this._s&&(this.Ps?this.onTypeChange():this.Fs?this.onSizeChange():this.Us&&this.onFillChange(),this.Ps=!1,this.Fs=!1,this.Us=!1),this},Object.defineProperty(n.prototype,"type",{get:function(){return this.jt},set:function(t){this.jt!==t&&(this.jt=t,this.onTypeChange())},enumerable:!1,configurable:!0}),n.prototype.onTypeChange=function(){0<this._s?this.Ps=!0:this.O.onTypeChange()},Object.defineProperty(n.prototype,"size",{get:function(){return this.I},enumerable:!1,configurable:!0}),n.prototype.onSizeChange=function(){0<this._s?this.Fs=!0:this.O.onSizeChange()},Object.defineProperty(n.prototype,"transform",{get:function(){return this.updateTransform()},enumerable:!1,configurable:!0}),n.prototype.updateTransform=function(){var n=this.C;null==n&&(n=new t.Matrix,this.C=n);var i=this.O.parent,r=i.id;if(this.Gs!==r){this.Gs=r;var e=i.formatted;2<=e.length?this.toTransform(e.values,n):n.identity()}return n},n.prototype.toTransformMatrix=function(t,n,i,r,e){var u=t-i,s=n-r,h=u*u+s*s;if(1e-5<h){var o=1/Math.sqrt(h),a=u*o,c=s*o;e.set(c,-a,-a,-c,t,n)}else e.identity();return e},Object.defineProperty(n.prototype,"fill",{get:function(){return this.A},enumerable:!1,configurable:!0}),n.prototype.onFillChange=function(){0<this._s?this.Us=!0:this.O.onFillChange()},n.prototype.updateUploaded=function(){this.onFillChange()},n.prototype.copy=function(t){var n=t.size;return this.set(t.type,n.x,n.y),this},n.prototype.set=function(t,n,i){return this.lock(),null!=t&&(this.type=t),this.size.set(n,i),this.unlock(),this},n.prototype.serialize=function(t){var n=this.I,i=this.A.serialize(t);return t.addResource("["+this.jt+","+n.x+","+n.y+","+i+"]")},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.type=r[0],this.I.set(r[1],r[2]),this.A.deserialize(r[3],n),this.unlock()}},n}(),ro=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){var i=t.length;return 4<=i?this.toTransformMatrix(t[i-2],t[i-1],t[i-4],t[i-3],n):(n.identity(),n)},n}(io),eo=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){return 4<=t.length?this.toTransformMatrix(t[0],t[1],t[2],t[3],n):(n.identity(),n)},n}(io),uo=function(){function t(t){this.O=t,this._s=0,this.Ps=!1,this.Fs=!1,this.Us=!1,this.zs=new ro(this),this.Hs=new eo(this)}return t.prototype.lock=function(){return this._s+=1,1===this._s&&(this.Ps=!1,this.Fs=!1,this.Us=!1),this},t.prototype.unlock=function(){return this._s-=1,0===this._s&&(this.Ps?this.onTypeChange():this.Fs?this.onSizeChange():this.Us&&this.onFillChange(),this.Ps=!1,this.Fs=!1,this.Us=!1),this},Object.defineProperty(t.prototype,"parent",{get:function(){return this.O},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.zs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.Hs},enumerable:!1,configurable:!0}),t.prototype.onTypeChange=function(){0<this._s?this.Ps=!0:this.O.onMarkerTypeChange()},t.prototype.onSizeChange=function(){0<this._s?this.Fs=!0:this.O.onMarkerSizeChange()},t.prototype.onFillChange=function(){0<this._s?this.Us=!0:this.O.onMarkerFillChange()},t.prototype.copy=function(t){return this.lock(),this.zs.copy(t.head),this.Hs.copy(t.tail),this.unlock(),this},t.prototype.serialize=function(t){var n=this.zs.serialize(t),i=this.Hs.serialize(t);return t.addResource("["+n+","+i+"]")},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.zs.deserialize(r[0],n),this.Hs.deserialize(r[1],n),this.unlock()}},t}(),so=function(){function n(n){this.O=n,this.Vs=0,this.L=[],this.B=[];var i=n.size,r=i.x,e=i.y;this.Ws=new t.Point(r,e),this.Xs=new t.Point(r,e),this.k=0,this._=U.NONE,this.Ks=-1}return Object.defineProperty(n.prototype,"length",{get:function(){return this.L.length>>1},enumerable:!1,configurable:!0}),n.prototype.toFitted=function(){this.Ys=void 0;var t=this.O.size;this.Xs.copyFrom(t),this.Ws.copyFrom(t)},n.prototype.fit=function(){var t=this.Xs,n=this.O.size,i=n.x,r=n.y,e=1e-5;if(e<Math.abs(i-t.x)||e<Math.abs(r-t.y)){t.set(i,r);var u=this.Ws,s=e<Math.abs(u.x),h=e<Math.abs(u.y);if(s||h){var o=s?i/u.x:1,a=h?r/u.y:1,c=this.L,f=this.Ys;if(null==f){f=[],this.Ys=f;for(var l=0,v=c.length;l<v;l+=2){var b=c[l],d=c[l+1];c[l]=b*o,c[l+1]=d*a,f.push(b,d)}}else for(l=0,v=c.length;l<v;l+=2)c[l]=f[l]*o,c[l+1]=f[l+1]*a;if(this.k===this.Ks){var g=this.Js;if(null!=g){var m=g.values,w=this.Zs;if(null==w)for(w=[],this.Zs=w,l=0,v=m.length;l<v;l+=2)b=m[l],d=m[l+1],m[l]=b*o,m[l+1]=d*a,w.push(b,d);else for(l=0,v=m.length;l<v;l+=2)m[l]=w[l]*o,m[l+1]=w[l+1]*a;var p=g.boundary,O=this.qs;if(null==O)for(O=[0,0,0,0],this.qs=O,l=0,v=p.length;l<v;l+=2)b=p[l],d=p[l+1],p[l]=b*o,p[l+1]=d*a,O[l]=b,O[l+1]=d;else for(l=0,v=p.length;l<v;l+=2)p[l]=O[l]*o,p[l+1]=O[l+1]*a;this.Ks+=1}}this.k+=1}}},Object.defineProperty(n.prototype,"id",{get:function(){return this.fit(),this.k},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.fit(),this.L},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.B},set:function(t){this.set(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this._},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.R;return null==t&&(t=this.newMarker(),this.R=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){return this.R},n.prototype.newMarker=function(){return new uo(this)},n.prototype.onMarkerTypeChange=function(){var t=this.O;t.uploaded=void 0,t.toDirty()},n.prototype.onMarkerSizeChange=function(){this.O.updateUploaded()},n.prototype.onMarkerFillChange=function(){this.O.updateUploaded()},Object.defineProperty(n.prototype,"formatter",{get:function(){return this.$s||null},set:function(t){this.$s!==t&&(this.Ks=-1,this.$s=t,this.toDirty(!0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){this.fit();var t=this.k,n=this.Js;if(this.Ks!==t){this.Ks=t;var i=this._,r=this.$s;if(null==r&&i&U.CURVE&&(r=to),null!=r){null==n&&(n={length:0,values:[],segments:[],boundary:[0,0,0,0],style:U.NONE});var e=this.Ys,u=this.B;if(null!=e){r(e.length>>1,e,u,i,n),no(n.values,n.boundary);var s=n.values,h=s.splice(0);this.Zs=h;var o=n.boundary,a=[o[0],o[1],o[2],o[3]];this.qs=a,this.toScaled(s,h,o,a)}else{var c=this.L;r(c.length>>1,c,u,i,n),no(n.values,n.boundary),this.Zs=void 0,this.qs=void 0}}else n=void 0,this.Zs=void 0,this.qs=void 0;this.Js=n}return n||this},enumerable:!1,configurable:!0}),n.prototype.toScaled=function(t,n,i,r){var e=this.Xs,u=this.Ws,s=1e-5,h=s<Math.abs(u.x),o=s<Math.abs(u.y);if(h||o){for(var a=h?e.x/u.x:1,c=o?e.y/u.y:1,f=0,l=n.length;f<l;f+=2)t[f]=n[f]*a,t[f+1]=n[f+1]*c;for(f=0,l=r.length;f<l;f+=2)i[f]=r[f]*a,i[f+1]=r[f+1]*c}},n.prototype.copy=function(t){this.set(t.values,t.segments,t.style);var n=t.getMarker();return n&&this.marker.copy(n),this},n.prototype.set=function(t,n,i){var r=!1,e=!1,u=this._,s=u&U.FORMATTER_MASK,h=this.$s;if(null!=t){var o=this.L,a=this.Vs,c=t.length,f=Math.min(c,a);if(this.toFitted(),o!==t){for(var l=0;l<f;++l)o[l]=t[l];for(l=f;l<c;++l)o.push(t[l]);a!==c?(o.length=c,this.Vs=c,r=!0):null!=h||s?r=!0:e=!0}else a!==c?(this.Vs=c,r=!0):null!=h||s?r=!0:e=!0}if(null!=n){var v=this.B;if(v!==n){var b=n.length;for(f=Math.min(v.length,b),l=0;l<f;++l)v[l]=n[l];for(l=f;l<b;++l)v.push(n[l]);v.length!==b&&(v.length=b)}null!=h||s?r=!0:e=!0}return null!=i&&u!==i&&(s!==(i&U.FORMATTER_MASK)||(null!=h||s)&&(u&U.CLOSED)!=(i&U.CLOSED)?r=!0:e=!0,this._=i),(e||r)&&this.toDirty(r),this},n.prototype.toDirty=function(t){if(t){this.k+=1;var n=this.O,i=n.uploaded;i?i.isCompatible(n)?n.updateUploaded():(n.uploaded=void 0,n.toDirty()):n.updateUploaded()}else this.k+=1,this.O.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){var n=JSON.stringify(this.L),i=JSON.stringify(this.B),r=this._,e=-1,u=this.R;return u&&(e=u.serialize(t)),t.addResource("["+n+","+i+","+r+","+e+"]")},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.set(r[0],r[1],r[2]);var e=r[3];null!=e&&0<=e&&this.marker.deserialize(e,n)}},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o){var a=this.formatted,c=a.length;if(2<=c){var f=a.values,l=a.segments,v=a.style,b=0,d=c;if(s){var g=n.WORK_RANGE;s(t,i,u,f,g),b=g[0],d=g[1]}for(var m=b,w=Math.min(d,c-1);m<w;++m){var p;if(Vh(l,m+1)<0&&h(t,i,f[0+(p=m<<1)],f[p+1],f[p+2],f[p+3],m,u,o))return!0}if(2<c&&c<=d&&v&U.CLOSED&&Vh(l,0)<0&&h(t,i,f[0+(p=(m=c-1)<<1)],f[p+1],f[0],f[1],m,u,o))return!0}return!1},n.WORK_RANGE=[0,0],n}(),ho=24,oo=16,ao=[0,0,0,0],co=new t.Point,fo=function(t,n,i){var r=1-i[0],e=1-i[1],u=3*n-1;t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0},lo=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+4,t[++r]=n+4,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+5,t[++r]=n+2,t[++r]=n+3,t[++r]=n+8,t[++r]=n+6,t[++r]=n+9,t[++r]=n+9,t[++r]=n+6,t[++r]=n+7,t[++r]=n+9,t[++r]=n+7,t[++r]=n+10,t[++r]=n+10,t[++r]=n+7,t[++r]=n+11,t[++r]=n+12,t[++r]=n+16,t[++r]=n+13,t[++r]=n+13,t[++r]=n+16,t[++r]=n+17,t[++r]=n+13,t[++r]=n+17,t[++r]=n+14,t[++r]=n+14,t[++r]=n+17,t[++r]=n+15,t[++r]=n+18,t[++r]=n+20,t[++r]=n+21,t[++r]=n+18,t[++r]=n+21,t[++r]=n+22,t[++r]=n+18,t[++r]=n+22,t[++r]=n+19,t[++r]=n+19,t[++r]=n+22,t[++r]=n+23},vo=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=co;v.set(i-f,r-l),o.apply(v,v);var b=v.x,d=v.y;v.set(i+f,r-l),o.apply(v,v);var g=v.x,m=v.y;v.set(i+f,r+l),o.apply(v,v);var w=v.x,p=v.y,D=b+(w-g),E=d+(p-m),M=.5*O(b,d,g,m),S=.5*O(g,m,w,p),T=1,j=1;M<=S?j=M/S:T=S/M,a[0]=T,a[1]=j,a[2]=M,a[3]=S;var N=T*(g-b)*.5,I=T*(m-d)*.5,C=j*(D-b)*.5,A=j*(E-d)*.5,R=(n<<1)-1;t[++R]=b,t[++R]=d,t[++R]=b+N,t[++R]=d+I,t[++R]=g-N,t[++R]=m-I,t[++R]=g,t[++R]=m,t[++R]=b+N+C,t[++R]=d+I+A,t[++R]=g-N+C,t[++R]=m-I+A,t[++R]=D+N-C,t[++R]=E+I-A,t[++R]=w-N-C,t[++R]=p-I-A,t[++R]=D,t[++R]=E,t[++R]=D+N,t[++R]=E+I,t[++R]=w-N,t[++R]=p-I,t[++R]=w,t[++R]=p,t[++R]=b,t[++R]=d,t[++R]=b+C,t[++R]=d+A,t[++R]=D-C,t[++R]=E-A,t[++R]=D,t[++R]=E,t[++R]=b+C+N,t[++R]=d+A+I,t[++R]=D-C+N,t[++R]=E-A+I,t[++R]=g+C-N,t[++R]=m+A-I,t[++R]=w-C-N,t[++R]=p-A-I,t[++R]=g,t[++R]=m,t[++R]=g+C,t[++R]=m+A,t[++R]=w-C,t[++R]=p-A,t[++R]=w,t[++R]=p},bo=function(t,n,i,r,e,u){var s,h,a,c,f,l,v,b,d=o(e),g=u[0],m=u[1],w=Math.max(0,1-g),p=Math.max(0,1-m),O=u[2],D=u[3];r&xt.TOP?(s=2,h=1+p):(s=-2,h=-1-p),r&xt.RIGHT?(a=2,c=1+w):(a=-2,c=-1-w),r&xt.BOTTOM?(f=2,l=1+p):(f=-2,l=-1-p),r&xt.LEFT?(v=2,b=1+w):(v=-2,b=-1-w);var E=6*(t-1)-1;go(n,E+=6,i,d,O,D,v,s),go(n,E+=6,i,d,O,D,b,s),go(n,E+=6,i,d,O,D,c,s),go(n,E+=6,i,d,O,D,a,s),go(n,E+=6,i,d,O,D,b,h),go(n,E+=6,i,d,O,D,c,h),go(n,E+=6,i,d,O,D,b,l),go(n,E+=6,i,d,O,D,c,l),go(n,E+=6,i,d,O,D,v,f),go(n,E+=6,i,d,O,D,b,f),go(n,E+=6,i,d,O,D,c,f),go(n,E+=6,i,d,O,D,a,f),go(n,E+=6,i,d,O,D,v,s),go(n,E+=6,i,d,O,D,v,h),go(n,E+=6,i,d,O,D,v,l),go(n,E+=6,i,d,O,D,v,f),go(n,E+=6,i,d,O,D,b,h),go(n,E+=6,i,d,O,D,b,l),go(n,E+=6,i,d,O,D,c,h),go(n,E+=6,i,d,O,D,c,l),go(n,E+=6,i,d,O,D,a,s),go(n,E+=6,i,d,O,D,a,h),go(n,E+=6,i,d,O,D,a,l),go(n,E+=6,i,d,O,D,a,f)},go=function(t,n,i,r,e,u,s,h){t[++n]=i,t[++n]=r,t[++n]=e,t[++n]=u,t[++n]=s,t[++n]=h},mo=function(t,n,i,r){var e=i.x0,u=i.y0,s=i.y1,h=i.x1,o=i.y2,a=i.x2,c=i.y3,f=i.x3,l=r[0],v=r[1],b=l*(h-e)*.5,d=l*(s-u)*.5,g=v*(f-e)*.5,m=v*(c-u)*.5,w=(n<<1)-1;t[++w]=e,t[++w]=u,t[++w]=e+b,t[++w]=u+d,t[++w]=h-b,t[++w]=s-d,t[++w]=h,t[++w]=s,t[++w]=e+b+g,t[++w]=u+d+m,t[++w]=h-b+g,t[++w]=s-d+m,t[++w]=f+b-g,t[++w]=c+d-m,t[++w]=a-b-g,t[++w]=o-d-m,t[++w]=f,t[++w]=c,t[++w]=f+b,t[++w]=c+d,t[++w]=a-b,t[++w]=o-d,t[++w]=a,t[++w]=o,t[++w]=e,t[++w]=u,t[++w]=e+g,t[++w]=u+m,t[++w]=f-g,t[++w]=c-m,t[++w]=f,t[++w]=c,t[++w]=e+g+b,t[++w]=u+m+d,t[++w]=f-g+b,t[++w]=c-m+d,t[++w]=h+g-b,t[++w]=s+m-d,t[++w]=a-g-b,t[++w]=o-m-d,t[++w]=h,t[++w]=s,t[++w]=h+g,t[++w]=s+m,t[++w]=a-g,t[++w]=o-m,t[++w]=a,t[++w]=o},wo=function(n){function i(t,i){var r=n.call(this,t,i,ho,oo)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateIndices(),lo(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexClippingStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=H(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.side,w=b.style,p=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeSide!==m||this.strokeStyle!==w,O=V(r),D=W(O),E=O!==this.texture||D!==this.textureTransformId,M=f||p,S=u.id!==this.pointId;if(M||v||E||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeSide=m,this.strokeStyle=w,this.texture=O,this.textureTransformId=D;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),vo(n.vertices,T,0,0,a,c,d,g,j,ao),(M||v)&&(n.updateSteps(),bo(T,n.steps,g,m,w,ao)),M&&(n.updateClippings(),fo(n.clippings,T,ao)),(M||E)&&(n.updateUvs(),mo(n.uvs,T,X(O),ao))}}}},i}(Bh),po=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(wo),Oo=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(wo),Do=function(t){switch(t){case J.NONE:return 0;case J.CIRCLE:return 9;case J.TRIANGLE:return 7;case J.RECTANGLE:return ho}return 0},Eo=function(t){switch(t){case J.NONE:return 0;case J.CIRCLE:return 8;case J.TRIANGLE:return 3;case J.RECTANGLE:return oo}return 0},Mo=function(t,n,i){switch(t){case J.NONE:return new Hh(n,i);case J.CIRCLE:return new Gh(n,i);case J.TRIANGLE:return new Ph(n,i);case J.RECTANGLE:return new Oo(n,i)}return new Hh(n,i)},So=function(t,n,i){switch(t){case J.NONE:return new Hh(n,i);case J.CIRCLE:return new zh(n,i);case J.TRIANGLE:return new Fh(n,i);case J.RECTANGLE:return new po(n,i)}return new Hh(n,i)},To=function(t,n,i,r,e){var s=n.points,h=gh(s),o=mh(h,!0),a=wh(h,!0),c=J.NONE,f=J.NONE;if(s&&s instanceof so){var l=s.getMarker();l&&(c=l.tail.type,f=l.head.type)}var v=Do(c),b=Eo(c),d=i+o,g=r+a,m=Do(f),w=Eo(f),p=d+v,O=g+b,D=M(n),E=4*D,S=2*D,T=p+m,j=O+w,N=o+m+v+E,I=a+w+b+S;return t.check(i,r,N,I)?new u(t,i,r,N,I,[new Ih(i,r,o,a),So(c,d,g),Mo(f,p,O),new Ht(T,j,E,S)]).init(n):null},jo=function(){function t(){this.W=new Map}return t.prototype.add=function(t,n,i,r){return this.W.set(t,{type:n,x:i,y:r}),!0},t.prototype.remove=function(t){var n=this.W,i=n.get(t);return null!=i?(n.delete(t),i):null},t.prototype.size=function(){return this.W.size},t.prototype.get=function(t){return this.W.get(t)||null},t.prototype.each=function(t){return this.W.forEach(t),this},t.prototype.contains=function(t){return this.W.has(t)},t.prototype.clear=function(){var t=this.W;return 0<t.size&&(t.clear(),!0)},t}(),No={TAIL:1,HEAD:2,ALL:3},Io=function(){function t(){}return t.set=function(t,n){var i=this.Qs;null==i&&(i=new Map,this.Qs=i),i.set(t,n)},t.get=function(t){var n;return(null===(n=this.Qs)||void 0===n?void 0:n.get(t))||this.getDefault()},t.getDefault=function(){var t=this.th;return null==t&&(t=this.newDefault(),this.th=t),t},t.newDefault=function(){var t=new jo;return t.add("TOP",No.ALL,0,-.5),t.add("LEFT",No.ALL,-.5,0),t.add("RIGHT",No.ALL,.5,0),t.add("BOTTOM",No.ALL,0,.5),t.add("CENTER",No.ALL,0,0),t.add("TOP_LEFT",No.ALL,-.5,-.5),t.add("TOP_RIGHT",No.ALL,.5,-.5),t.add("BOTTOM_LEFT",No.ALL,-.5,.5),t.add("BOTTOM_RIGHT",No.ALL,.5,.5),t},t}(),Co=function(){function t(t){this.O=t,this.me=null,this.nh=null}return Object.defineProperty(t.prototype,"shape",{get:function(){return this.me},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return this.nh},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.set(t.shape,t.edge)},t.prototype.set=function(t,n){var i=!1;return void 0!==t&&this.me!==t&&(this.me=t,i=!0),void 0!==n&&this.nh!==n&&(this.nh=n,i=!0),i&&this.O.onAcceptorChange(),this},t}(),Ao=function(){function n(n,i){var r=this;this.O=n,this.q=i,this.ih=new Co(this),this.Z=new t.ObservablePoint((function(){r.onLocalChange()}),void 0),this.rh=0,this.eh=0,this.Re=0,this._s=0,this.uh=!1,this.sh=!1,this.hh=!1}return n.prototype.lock=function(){this._s+=1,1===this._s&&(this.uh=!1,this.sh=!1,this.hh=!1)},n.prototype.unlock=function(){this._s-=1,0===this._s&&(this.sh?this.onLocalChange():this.uh?this.onAcceptorChange():this.hh&&this.onOtherChange())},Object.defineProperty(n.prototype,"acceptor",{get:function(){return this.ih},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"local",{get:function(){return this.Z},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localId",{get:function(){return this.eh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Re},set:function(t){this.Re!==t&&(this.Re=t,this.onOtherChange())},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e){return this.lock(),this.ih.set(t,n),null!=r&&(this.Z.x=r),null!=e&&(this.Z.y=e),null!=i&&(this.margin=i),this.unlock(),this},n.prototype.copy=function(t){return this.lock(),this.ih.copy(t.acceptor),this.Z.copyFrom(t.local),this.margin=t.margin,this.unlock(),this},n.prototype.serialize=function(t){var n=this.ih,i=n.shape,r=i?i.uuid:null,e=n.edge,u=null!=e?t.addResource(e):-1,s=this.Z;return t.addResource("["+r+","+u+","+s.x+","+s.y+","+this.Re+"]")},n.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e));var u=null,s=e[0];null!=s&&(u=n.find(s)||null),this.lock();var h=this.ih;h.shape=u;var o=e[1];h.edge=0<=o&&o<r.length?r[o]:null,this.Z.set(e[2],e[3]),this.margin=e[4]||0,this.unlock(),u&&u.connector.add(this)}},n.prototype.fit=function(i){var r;i&&(this.rh+=1);var e=this.rh;if(this.eh!==e){this.eh=e;var u=this.ih,s=u.shape,h=u.edge;if(null!=s&&null!=h){var o=Io.get(s.type).get(h);if(o){var a=null!==(r=n.WORK_UPDATE_LOCAL)&&void 0!==r?r:n.WORK_UPDATE_LOCAL=new t.Point,c=s.size;a.set(c.x*o.x,c.y*o.y),s.toGlobal(a,a);var f=this.O,l=f.parent;l&&(f.updateTransform(),l.toLocal(a,void 0,a,!0)),this.Z.copyFrom(a)}}}return this},n.prototype.onAcceptorChange=function(){0<this._s?this.uh=!0:(this.rh+=1,this.fit())},n.prototype.onLocalChange=function(){0<this._s?this.sh=!0:(this.rh+=1,this.eh=this.rh,this.q())},n.prototype.onOtherChange=function(){0<this._s?this.hh=!0:this.q()},n.prototype.attach=function(){var t=this.ih.shape;return t&&t.connector.add(this),this},n.prototype.detach=function(){var t=this.ih.shape;return t&&t.connector.remove(this),this},n}(),Ro=function(){function t(t,n){var i=this;this.O=t,this._s=0,this.xt=!1,this.q=n;var r=function(){i.onChange()};this.Hs=new Ao(t,r),this.zs=new Ao(t,r)}return t.prototype.lock=function(){return this._s+=1,1===this._s&&(this.xt=!1),this},t.prototype.unlock=function(){return this._s-=1,0===this._s&&this.xt&&this.q(),this},t.prototype.onChange=function(){0<this._s?this.xt=!0:this.q()},Object.defineProperty(t.prototype,"tail",{get:function(){return this.Hs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.zs},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.lock(),this.Hs.copy(t.tail),this.zs.copy(t.head),this.unlock(),this},t.prototype.fit=function(t){return this.lock(),this.Hs.fit(t),this.zs.fit(t),this.unlock(),this},t.prototype.serialize=function(t){var n=this.Hs.serialize(t),i=this.zs.serialize(t);return t.addResource("["+n+","+i+"]")},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.lock(),this.Hs.deserialize(e[0],n,i),this.zs.deserialize(e[1],n,i),this.unlock()}},t.prototype.attach=function(){this.lock();var t=this.Hs,n=this.zs;return t.attach(),n.attach(),t.fit(!0),n.fit(!0),this.unlock(),this},t.prototype.detach=function(){return this.lock(),this.Hs.detach(),this.zs.detach(),this.unlock(),this},t}(),yo=function(t){function n(n){void 0===n&&(n=r.CONNECTOR_LINE);var i=t.call(this,n)||this;i.oh=0,i.ah=0,i.fh=0,i.lh=0;var e=.5*Y.SIZE_X,u=.5*Y.SIZE_Y;return i.gt=new so(i).set(i.toValues(-e,-u,+e,+u,0,0,[])),i.nh=new Ro(i,(function(){i.onEdgeChange()})),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"edge",{get:function(){return this.nh},enumerable:!1,configurable:!0}),n.prototype.onAttach=function(){t.prototype.onAttach.call(this),this.nh.attach()},n.prototype.onDetach=function(){this.nh.detach(),t.prototype.onDetach.call(this)},n.prototype.onEdgeChange=function(){var t,i=this.nh,r=i.tail,e=r.localId,u=r.margin,s=i.head,h=s.localId,o=s.margin;if(this.oh!==e||this.ah!==u||this.fh!==h||this.lh!==o){this.oh=e,this.ah=u,this.fh=h,this.lh=o;var a=r.local,c=a.x,f=a.y,l=s.local,v=l.x,b=l.y,d=this.transform,g=d.position,m=g.x,w=g.y,p=this.gt,O=p.values;this.toValues(c-m,f-w,v-m,b-w,u,o,O);var D=null!==(t=n.WORK_BOUNDARY)&&void 0!==t?t:n.WORK_BOUNDARY=[0,0,0,0];no(O,D);for(var E=.5*(D[2]+D[0]),M=.5*(D[3]+D[1]),S=D[2]-D[0],T=D[3]-D[1],j=0,N=O.length;j<N;j+=2)O[j+0]-=E,O[j+1]-=M;this.disallowUploadedUpdate(),g.set(m+E,w+M),d.scale.set(1,1),d.rotation=0,d.skew.set(0,0),this.size.set(S,T),p.toFitted(),p.set(O),this.allowUploadedUpdate()}},n.prototype.toValues=function(t,n,i,r,e,u,s){var h=1e-6,o=s.length;if(o<=4)if(0!==e||0!==u)if(h<(f=i-t)*f+(l=r-n)*l){var a=f*(v=1/Math.sqrt(f*f+l*l)),c=l*v;s[0]=t+e*a,s[1]=n+e*c,s[2]=i-u*a,s[3]=r-u*c}else s[0]=t,s[1]=n,s[2]=i,s[3]=r;else s[0]=t,s[1]=n,s[2]=i,s[3]=r;else{var f,l;if(0!==e)if(h<(f=s[2]-t)*f+(l=s[3]-n)*l){var v=1/Math.sqrt(f*f+l*l);s[0]=t+e*f*v,s[1]=n+e*l*v}else s[0]=t,s[1]=n;else s[0]=t,s[1]=n;0!==u&&h<(f=s[o-4]-i)*f+(l=s[o-3]-r)*l?(v=1/Math.sqrt(f*f+l*l),s[o-2]=i+u*f*v,s[o-1]=r+u*l*v):(s[o-2]=i,s[o-1]=r)}return s},n.prototype.copy=function(i,r){return void 0===r&&(r=st.ALL),t.prototype.copy.call(this,i,r),i instanceof n&&this.nh.copy(i.edge),this},n.prototype.clone=function(){return(new n).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=n.addResource("["+this.nh.serialize(n)+","+this.gt.serialize(n)+"]"),i},n}(Ut),ko=function(t,n){return js.deserialize(t,n,new yo)},Lo=function(t,n,i,r){if(n instanceof yo){var e=r.resources,u=t[15];if(0<=u&&u<e.length){var s=r.getExtension(u);null==s&&(s=JSON.parse(e[u]),r.setExtension(u,s)),n.points.deserialize(s[1],r),n.edge.deserialize(s[0],i,r)}}},xo=function(){e[r.CONNECTOR_LINE]=To,n[r.CONNECTOR_LINE]=ko,i[r.CONNECTOR_LINE]=Lo,As.set(r.CONNECTOR_LINE,Cs.CONNECTOR)},Bo=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),lo(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=H(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=V(n),d=W(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),vo(t.vertices,w,.5*r,.5*e,r,e,a,c,n.transform.internalTransform,ao),(m||h)&&(t.updateSteps(),bo(w,t.steps,c,f,l,ao)),m&&(t.updateClippings(),fo(t.clippings,w,ao)),(m||g)&&(t.updateUvs(),mo(t.uvs,w,X(b),ao))}},n}(z),_o=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=ho+h,c=oo+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Bo(i,r,a-h,c-o),new Ht(i+ho,r+oo,h,o)]).init(n):null},Po=function(t,n,i,r){return new u(t,i,r,0,0,[new Hh(i,r)]).init(n)},Fo=function(){function t(t,n,i,r){this.resources=t.resources,this.data=t.data||t.tags||t.resources,this.pieces=n,this.pieceData=i,this.isEditMode=r,this.bh=new Map,this.dh=new Map,this.gh=new Map,this.$i=new Map,this.mh=new Map,this.wh=new Map,this.ph=new Map,this.Oh=new Map,this.Dh=new Map,this.Eh=new Map,this.Mh=new Map}return t.prototype.getAction=function(t){return this.bh.get(t)},t.prototype.setAction=function(t,n){this.bh.set(t,n)},t.prototype.getFill=function(t){return this.dh.get(t)},t.prototype.setFill=function(t,n){this.dh.set(t,n)},t.prototype.getStroke=function(t){return this.gh.get(t)},t.prototype.setStroke=function(t,n){this.gh.set(t,n)},t.prototype.getData=function(t){return this.$i.get(t)},t.prototype.setData=function(t,n){this.$i.set(t,n)},t.prototype.getDataValue=function(t){return this.mh.get(t)},t.prototype.setDataValue=function(t,n){this.mh.set(t,n)},t.prototype.getRange=function(t){return this.wh.get(t)},t.prototype.setRange=function(t,n){this.wh.set(t,n)},t.prototype.getAlign=function(t){return this.ph.get(t)},t.prototype.setAlign=function(t,n){this.ph.set(t,n)},t.prototype.getMargin=function(t){return this.Oh.get(t)},t.prototype.setMargin=function(t,n){this.Oh.set(t,n)},t.prototype.getText=function(t){return this.Dh.get(t)},t.prototype.setText=function(t,n){this.Dh.set(t,n)},t.prototype.getTextOutline=function(t){return this.Eh.get(t)},t.prototype.setTextOutline=function(t,n){this.Eh.set(t,n)},t.prototype.getExtension=function(t){return this.Mh.get(t)},t.prototype.setExtension=function(t,n){this.Mh.set(t,n)},t}(),Uo=function(t,n,i,r){this.name=t,this.width=n,this.height=i,this.layer=r},Go=function(){function t(){}return t.isConnector=function(t){return null!=t&&t.type===r.CONNECTOR_LINE},t.newMapping=function(n,i,r){var e;null==r&&(r=null!==(e=t.Sh)&&void 0!==e?e:t.Sh=new Map).clear();for(var u=0,s=n.length;u<s;++u){var h=n[u],o=i[u];r.set(h,o),this.newMapping(h.children,o.children,r)}return r},t.moveAll=function(t,n,i,r,e){for(var u=0,s=i.length;u<s;++u){var h=i[u],o=r[u];if(this.isConnector(h)&&this.isConnector(o)){var a=h.edge,c=o.edge,f=a.head,l=f.acceptor.shape;if(l){null==e&&(e=this.newMapping(t,n));var v=e.get(l);if(v){var b=c.head;b.detach(),b.set(v),b.attach(),v.connector.remove(f)}}var d=a.tail,g=d.acceptor.shape;if(g){null==e&&(e=this.newMapping(t,n));var m=e.get(g);if(m){var w=c.tail;w.detach(),w.set(m),w.attach(),m.connector.remove(d)}}}e=this.moveAll(t,n,h.children,o.children,e)}return e},t.move=function(t,n){var i=t.children,r=n.children;this.moveAll(i,r,i,r)},t}(),zo={INVISIBLE:"INVISIBLE",INTERACTIVE:"INTERACTIVE",DRAGGABLE:"DRAGGABLE",PINCHABLE:"PINCHABLE"},Ho=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),Vo=function(){this.localTransform=new t.Matrix,this.internalTransform=new t.Matrix,this.internalTransformParentInverse=new t.Matrix,this.rotation=0,this.size=new t.Point},Wo=function(){function t(){}return t.prepare=function(t){var n=t.editor||new Vo;t.editor=n,t.updateTransform();var i=t.parent;i instanceof Dt?i.transform.internalTransform.copyTo(n.internalTransformParentInverse).invert():n.internalTransformParentInverse.identity(),t.transform.internalTransform.copyTo(n.internalTransform),n.rotation=t.transform.rotation,n.size.copyFrom(t.size),t.disallowOnTransformChange()},t.finalize=function(t){t.allowOnTransformChange(!0)},t.apply=function(t,n,i){var r=t.editor;if(null!=r){var e=r.localTransform;if(r.internalTransformParentInverse.copyTo(e).append(n).append(r.internalTransform),i)this.applyLocal(t,e);else{var u=r.size;this.applyLocal(t,e,u.x,u.y)}}},t.applyLocal=function(t,n,i,r){t.disallowUploadedUpdate();var e=n.a,u=n.b,s=n.c,h=n.d,o=n.tx,a=n.ty,c=t.transform,f=Math.atan2(-s,h),l=Math.atan2(+u,e);c.rotation=.5*(f+l);var v=.5*(l-f);c.skew.set(v,v);var b=c.pivot,d=b.x,g=b.y;if(c.position.set(o+(e*d+s*g),a+(u*d+h*g)),null!=i&&null!=r){var m=Math.sqrt(e*e+u*u),w=Math.sqrt(s*s+h*h);t.size.set(hs.toNormalized(i*m),hs.toNormalized(r*w))}t.allowUploadedUpdate()},t}(),Xo=function(){function n(n,i,r){this.shape=n,this.base=new t.Point(i,r);var e=n.size;this.shapeBase=new t.Point(e.x,e.y),this.transform=new t.Matrix,n.updateTransform(),n.transform.localTransform.copyTo(this.transform)}return n.prototype.isCompatible=function(t){return this.shape===t},n.prototype.reset=function(t,n,i){this.base.set(n,i);var r=t.size;this.shapeBase.copyFrom(r),t.updateTransform(),t.transform.localTransform.copyTo(this.transform)},n.prototype.update=function(t,i,r,e,u){var s=i/this.base.x,h=r/this.base.y,o=this.shapeBase,a=n.WORK_TRANSFORM;a.identity().append(this.transform).translate(-e,-u).scale(s,h).translate(+e,+u),t.disallowOnTransformChange(),Wo.applyLocal(t,a,o.x,o.y),t.allowOnTransformChange(!1)},n.WORK_TRANSFORM=new t.Matrix,n}(),Ko=function(){function n(n,i,r,e){this.Th=new t.Point,this.jh=new t.Rectangle,this.Nh=new t.Rectangle,this.O=n,this.Ih=[],this.I=new t.Point(i,r),this.Ch=e}return n.prototype.init=function(){},Object.defineProperty(n.prototype,"x",{get:function(){return this.I.x},set:function(t){var n=this.I;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.I.y},set:function(t){var n=this.I;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.I,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.I;return new n(this.O,t.x,t.y,this.Ch)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.I,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.I.copyTo(t)},n.prototype.equals=function(t){return this.I.equals(t)},n.prototype.fit=function(){this.Ch&&this.doFit()},n.prototype.doFit=function(){var t=this.O;t.disallowOnTransformChange();var n=this.calcRect(this.Nh),i=this.I;i.set(n.width,n.height),t.updateTransform();var r=t.transform,e=n.x+.5*n.width,u=n.y+.5*n.height,s=r.position,h=r.localTransform,o=h.a,a=h.b,c=h.c,f=h.d,l=r.pivot;s.set(s.x+(o*e+c*u)-(o*l.x+c*l.y),s.y+(a*e+f*u)-(a*l.x+f*l.y)),l.set(e,u),this.reset(t.children,this.Ih,i),t.allowOnTransformChange(!0)},n.prototype.reset=function(t,n,i){for(var r=0,e=Math.min(n.length,t.length);r<e;++r){var u=t[r],s=n[r];if(!s.isCompatible(u)){n.length=r;break}s.reset(u,i.x,i.y)}t.length<n.length&&(n.length=t.length)},n.prototype.calcRect=function(t){var n=this.O.children;if(n.length<=0)t.x=0,t.y=0,t.width=0,t.height=0;else{var i=this.Th,r=this.jh;n[0].getBoundsLocal(i,!1,t);for(var e=1,u=n.length;e<u;++e)n[e].getBoundsLocal(i,!1,r),t.enlarge(r)}return t},n.prototype.onChange=function(t,n){var i=this.O,r=this.I,e=i.transform.pivot;this.Ah(i.children,this.Ih,r.x,r.y,e.x,e.y,t,n),i.onSizeChange()},n.prototype.Ah=function(t,n,i,r,e,u,s,h){for(var o=0,a=Math.min(n.length,t.length);o<a;++o){var c=t[o];if(!(f=n[o]).isCompatible(c)){n.length=o;break}f.update(c,i,r,e,u)}for(o=n.length,a=t.length;o<a;++o){var f;c=t[o],(f=this.newLayout(c,s,h)).update(c,i,r,e,u),n.push(f)}n.length!==t.length&&(n.length=t.length)},n.prototype.newLayout=function(t,n,i){return t.layout||new Xo(t,n,i)},n}(),Yo=function(){function n(n,i,r,e,u){this.O=n,this._x=i,this._y=r,this.Rh=new t.Point(e,u)}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"base",{get:function(){return this.Rh},enumerable:!1,configurable:!0}),n.prototype.init=function(){this.Rh.copyFrom(this),this.onChange()},n.prototype.clone=function(){var t=this.Rh;return new n(this.O,this._x,this._y,t.x,t.y)},n.prototype.set=function(t,n){var i=!1;return null!=t&&this._x!==t&&(this._x=t,i=!0),null!=n&&this._y!==n&&(this._y=n,i=!0),i&&this.onChange(),this},n.prototype.copyFrom=function(t){return t instanceof n&&this.Rh.copyFrom(t.base),this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.onChange()),this},n.prototype.copyTo=function(t){return t instanceof n&&this.Rh.copyTo(t.base),t.set(this._x,this._y),t},n.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},n.prototype.fit=function(){},n.prototype.onChange=function(){var t=this.Rh;this.O.transform.scale.set(this._x/t.x,this._y/t.y)},n}(),Jo=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return xt.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return s.NONE},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i,r,e,u,s){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!1,color:16777215,alpha:1,width:1,align:0,side:xt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),Zo=function(){function t(){}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return m.CENTER},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return w.MIDDLE},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n){},t.prototype.toObject=function(){return{horizontal:m.CENTER,vertical:w.MIDDLE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),qo=function(){function t(){}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n){},t.prototype.toObject=function(){return{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),$o=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i,r){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!1,color:16777215,alpha:1,width:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),Qo=function(){function t(){}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n){},t.prototype.toObject=function(){return{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),ta=function(){function t(){}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n){},t.prototype.toObject=function(){return{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),na=function(){function t(){this.align=new Zo,this.offset=new qo,this.outline=new $o,this.spacing=new ta,this.padding=new Qo}return Object.defineProperty(t.prototype,"enable",{get:function(){return!0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return""},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){return"auto"},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return 24},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return d.NORMAL},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return g.NORMAL},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return p.LEFT_TO_RIGHT},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this},t.prototype.set=function(t,n,i,r,e,u,s,h,o){return this},t.prototype.toObject=function(){return{value:"",color:0,alpha:1,family:"auto",size:24,weight:d.NORMAL,align:this.align.toObject(),offset:this.offset.toObject(),style:g.NORMAL,outline:this.outline.toObject(),spacing:this.spacing.toObject(),direction:p.LEFT_TO_RIGHT,padding:this.padding.toObject(),clipping:!1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),ia=function(t){function n(n,i){var r=t.call(this,i)||this;r.yh=n;var e=r.newData();return r.data=e,r.tag=e,r.size=r.newGroupSize(n),r.fill=r.newGroupFill(),r.stroke=r.newGroupStroke(),r.text=r.newGroupText(),r}return _(n,t),Object.defineProperty(n.prototype,"isEditMode",{get:function(){return this.yh},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t){var n=Y.SIZE_X,i=Y.SIZE_Y;return t?new Ko(this,n,i,this.isGroupSizeFittable()):new Yo(this,n,i,n,i)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newData=function(){return new It},n.prototype.newGroupFill=function(){return new Ho},n.prototype.newGroupStroke=function(){return new Jo},n.prototype.newGroupText=function(){return new na},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof Yo?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){return it.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cursor",{get:function(){return""},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Dt),ra=function(t){function n(n,i,e){void 0===e&&(e=r.EMBEDDED_LAYER);var u=t.call(this,i,e)||this;return u.kh=n,u}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.kh},enumerable:!1,configurable:!0}),n.prototype.newGroupFill=function(){return new Z(this,!1,16777215,1)},n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t.size.init(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.kh,this.yh,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n.deserialize=function(t,i,r,e){var u,s,h,o=new n(this.deserializeName(t[0],i),i.isEditMode),a=t[1];null==a||2&a||(o.visible=!1,o.state.add(zo.INVISIBLE));var c=-.5*r+(t[2]||0),f=-.5*e+(t[3]||0);o.transform.position.set(c,f);var l=null!==(u=t[4])&&void 0!==u?u:r,v=null!==(s=t[5])&&void 0!==s?s:e;o.size.set(l,v);var b=t[6];if(null!=b&&o.fill.deserialize(b,i),!i.isEditMode){var d=null!==(h=t[7])&&void 0!==h?h:1,g=1&d,m=2&d,w=4&d;if(m||w){var p=(m?xr.DRAG:xr.NONE)|(w?xr.PINCH:xr.NONE);o.action.add(new oe("",p))}(g||m||w)&&(o.interactive=!0)}return o},n.deserializeName=function(t,n){if(at(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""},n}(ia),ea=function(){function t(t,n,i){this.children=[],this.Mt=t,this.nn=n,this.yh=i}return t.prototype.hasConnectors=function(t){for(var n=0,i=t.length;n<i;++n){var e=t[n];if(e.type===r.CONNECTOR_LINE)return!0;var u=e.children;if(0<u.length&&this.hasConnectors(u))return!0}return!1},t.prototype.newHasConnectors=function(){for(var t=new Map,n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];t.set(e,this.hasConnectors(e.children))}return t},t.prototype.copyTo=function(t){for(var n,i=null!==(n=this.Lh)&&void 0!==n?n:this.Lh=this.newHasConnectors(),r=this.children,e=t.children,u=0,s=r.length;u<s;++u){var h=r[u],o=h.clone();o.parent=t,e.push(o),i.get(h)&&Go.move(h,o)}t.onChildTransformChange(),t.toDirty(),t.onAttach()},t.prototype.deserialize=function(t,n){var i=t.length;if(0<i)for(var r=this.Mt,e=this.nn,u=0;u<i;++u)this.children.push(ra.deserialize(t[u],n,r,e))},t}(),ua=function(){function t(){}return t.toSimple=function(t){return{version:t.version,id:t.id,name:t.name,thumbnail:t.thumbnail,data:JSON.stringify({width:t.width,height:t.height,background:t.background,tile:t.tile,resources:t.resources,data:t.data||t.tags,pieces:t.pieces,layers:t.layers,items:t.items,snap:t.snap})}},t.toSerialized=function(t){if(!("items"in t)){var n=JSON.parse(t.data),i={version:t.version,id:t.id,name:t.name,width:n.width,height:n.height,background:n.background,tile:n.tile,resources:n.resources,data:n.data||n.tags,pieces:n.pieces,layers:n.layers,items:n.items,snap:n.snap,thumbnail:t.thumbnail};if(null==i.data){var r=t.tags;null!=r&&(i.data=JSON.parse(r))}if(null==i.pieces){var e=t.pieces;null!=e&&(i.pieces=JSON.parse(e))}return i}return t},t.newLayer=function(t,n,i){n.deserialize(t.layers,i);var r=t.items,e=js.deserializeAll(r,i);return null!=e?e.then((function(t){for(var i=n.children,e=0,u=t.length;e<u;++e){var s=r[e],h=t[e];null!=(o=i[s[16]])&&(h.parent=o,h.uploaded=void 0,o.children.push(h))}for(e=0,u=i.length;e<u;++e){var o;(o=i[e]).onChildTransformChange(),o.toDirty();for(var a=o.children,c=0,f=a.length;c<f;++c)a[c].onAttach()}return t})):Promise.resolve([])},t.toPieceData=function(t,n,i){var r=new Map,e=function(){return r};return this.xh(t,n,r,i).then(e,e)},t.xh=function(t,n,i,r){var e=this,u=[];if(n&&0<n.length&&t)for(var s=function(s,h){var o=n[s];i.has(o)||(i.set(o,null),u.push(t.piece.getByName(o).then((function(n){return e.Bh(t,o,n,r,i)}),(function(){return null}))))},h=0,o=n.length;h<o;++h)s(h);return Promise.all(u)},t.Bh=function(t,n,i,r,e){var u=this,s=this.toSerialized(i),h=s.width,o=s.height,a=new ea(h,o,r);e.set(n,new Uo(n,h,o,a));var c=s.pieces;return this.xh(t,c,e,r).then((function(){return u.newLayer(s,a,new Fo(s,c,e,r))}))},t}(),sa=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"horizontal",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.align.horizontal:m.CENTER},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.align.horizontal=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.align.vertical:w.MIDDLE},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.align.vertical=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.align.copy(t)},t.prototype.set=function(t,n){for(var i=this.O.children,r=0,e=i.length;r<e;++r)i[r].text.align.set(t,n)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.align.toObject():{horizontal:m.CENTER,vertical:w.MIDDLE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),ha=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"horizontal",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.offset.horizontal:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.offset.horizontal=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.offset.vertical:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.offset.vertical=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.offset.copy(t)},t.prototype.set=function(t,n){for(var i=this.O.children,r=0,e=i.length;r<e;++r)i[r].text.offset.set(t,n)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.offset.toObject():{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),oa=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.O.children;return 0<t.length&&t[t.length-1].text.outline.enable},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.outline.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.outline.color:16777215},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.outline.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.outline.alpha:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.outline.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.outline.width:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.outline.width=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.outline.copy(t)},t.prototype.set=function(t,n,i,r){for(var e=this.O.children,u=0,s=e.length;u<s;++u)e[u].text.outline.set(t,n,i,r)},t.prototype.clone=function(){return new t(this.O)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.outline.toObject():{enable:!1,color:16777215,alpha:1,width:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),aa=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"horizontal",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.padding.horizontal:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.padding.horizontal=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.padding.vertical:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.padding.vertical=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.padding.copy(t)},t.prototype.set=function(t,n){for(var i=this.O.children,r=0,e=i.length;r<e;++r)i[r].text.padding.set(t,n)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.padding.toObject():{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),ca=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"horizontal",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.spacing.horizontal:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.spacing.horizontal=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.spacing.vertical:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.spacing.vertical=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.spacing.copy(t)},t.prototype.set=function(t,n){for(var i=this.O.children,r=0,e=i.length;r<e;++r)i[r].text.spacing.set(t,n)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.spacing.toObject():{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),fa=function(){function t(t){this.O=t,this.align=new sa(t),this.offset=new ha(t),this.outline=new oa(t),this.spacing=new ca(t),this.padding=new aa(t)}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.O.children;return!(0<t.length)||t[t.length-1].text.enable},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.value:""},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.color:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.alpha:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.family:"auto"},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.family=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.size:24},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.weight:d.NORMAL},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.weight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.style:g.NORMAL},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.style=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.direction:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.direction=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){var t=this.O.children;return 0<t.length&&t[t.length-1].text.clipping},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.clipping=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.copy(t);return this},t.prototype.set=function(t,n,i,r,e,u,s,h){for(var o=this.O.children,a=0,c=o.length;a<c;++a)o[a].text.set(t,n,i,r,e,u,s,h);return this},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.toObject():{value:"",color:0,alpha:1,family:"auto",size:24,weight:d.NORMAL,align:this.align.toObject(),offset:this.offset.toObject(),style:g.NORMAL,outline:this.outline.toObject(),spacing:this.spacing.toObject(),direction:p.LEFT_TO_RIGHT,padding:this.padding.toObject(),clipping:!1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),la=function(t){function n(n,i,e){void 0===e&&(e=r.EMBEDDED);var u=t.call(this,i,e)||this;return u.kh=n,u}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.kh},enumerable:!1,configurable:!0}),n.prototype.newGroupText=function(){return new fa(this)},n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.kh,this.yh,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=n.addPiece(this.kh),i},n.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid)},n.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid)},n}(ia),va=function(){function t(){}return t.from=function(t,n,i){var r=this,e=ua.toSerialized(t),u=e.pieces;return ua.toPieceData(n,u,i).then((function(t){return r._h(e,i,u,t)}))},t._h=function(t,n,i,r){var e=this,u=t.width,s=t.height,h=new ea(u,s,n),o=new Fo(t,i,r,n);return ua.newLayer(t,h,o).then((function(){return e.create(t.name,u,s,h,o)}))},t.deserialize=function(t,n,i,r,e,u){var s=new la(t,e.isEditMode),h=js.deserialize(u,e,s),o=s.size,a=o.x,c=o.y;return s.size.set(n,i),r.copyTo(s),s.size.init(),s.size.set(a,c),h},t.create=function(t,n,i,r,e){var u=new la(t,e.isEditMode);return u.size.set(n,i),r.copyTo(u),u.size.init(),u},t}(),ba=function(t,n){var i=n.pieces,r=t[15];if(i&&0<=r&&r<i.length){var e=n.pieceData;if(e){var u=i[r],s=e.get(u);if(s)return va.deserialize(u,s.width,s.height,s.layer,n,t)}}return null},da=function(){e[r.EMBEDDED]=Po,n[r.EMBEDDED]=ba,As.set(r.EMBEDDED,Cs.EMBEDDED),e[r.EMBEDDED_LAYER]=_o},ga=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.O.children;return!(0<t.length)||t[t.length-1].fill.enable},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].fill.color:16777215},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].fill.alpha:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.alpha=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.copy(t)},t.prototype.set=function(t,n,i){for(var r=this.O.children,e=0,u=r.length;e<u;++e)r[e].fill.set(t,n,i)},t.prototype.clone=function(){return new t(this.O)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].fill.toObject():{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),ma=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"length",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.length}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.id}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.values}return[]},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.values=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segments",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.segments}return[]},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.segments=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.style}return U.NONE},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.style=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"marker",{get:function(){for(var t=this.O.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.marker}return $.getInstance()},enumerable:!1,configurable:!0}),t.prototype.getMarker=function(){for(var t=this.O.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.getMarker()}},Object.defineProperty(t.prototype,"formatter",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatter}return null},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.formatter=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formatted",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatted}return this},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&e.copy(t)}return this},t.prototype.set=function(t,n,i){for(var r=this.O.children,e=0,u=r.length;e<u;++e){var s=r[e].points;null!=s&&s.set(t,n,i)}return this},t.prototype.clone=function(n){return new t(n)},t.prototype.toPoints=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.toPoints(t)}return[]},t.prototype.serialize=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.serialize(t)}return-1},t}(),wa=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.O.children;return 0<t.length&&t[t.length-1].stroke.enable},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.color:16777215},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.alpha:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.width:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.align:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.side:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.side=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.style:s.NONE},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.style=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.copy(t)},t.prototype.set=function(t,n,i,r,e){for(var u=this.O.children,s=0,h=u.length;s<h;++s)u[s].stroke.set(t,n,i,r,e)},t.prototype.clone=function(){return new t(this.O)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.toObject():{enable:!1,color:16777215,alpha:1,width:1,align:0,side:xt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),pa=function(t){function n(n,i){void 0===i&&(i=r.GROUP);var e=t.call(this,i)||this;e.yh=n;var u=new It;return e.data=u,e.tag=u,e.size=e.newGroupSize(n),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e.gt=e.newGroupPoints(),e}return _(n,t),Object.defineProperty(n.prototype,"isEditMode",{get:function(){return this.yh},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t){var n=Y.SIZE_X,i=Y.SIZE_Y;return t?new Ko(this,n,i,this.isGroupSizeFittable()):new Yo(this,n,i,n,i)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newGroupFill=function(){return new ga(this)},n.prototype.newGroupStroke=function(){return new wa(this)},n.prototype.newGroupText=function(){return new fa(this)},n.prototype.newGroupPoints=function(){return new ma(this)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof Yo?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].corner:it.ALL},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].corner=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cursor",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].cursor:""},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].cursor=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].gradient;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].gradient=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].radius:.5},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].radius=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].image;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].image=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n)if(null!=t[n].points)return this.gt},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.yh,this.type)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Dt),Oa=function(t,n){var i=new pa(n.isEditMode),r=js.deserialize(t,n,i);return i.size.init(),r},Da=function(){e[r.GROUP]=Po,n[r.GROUP]=Oa},Ea=function(){function n(n,i,r){this.O=n,this.I=new t.Point(i,r)}return n.prototype.init=function(){},Object.defineProperty(n.prototype,"x",{get:function(){return this.I.x},set:function(t){var n=this.I;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.I.y},set:function(t){var n=this.I;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.I,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.I;return new n(this.O,t.x,t.y)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.I,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.I.copyTo(t)},n.prototype.equals=function(t){return this.I.equals(t)},n.prototype.fit=function(){},n.prototype.onChange=function(t,n){this.O.onSizeChange()},n}(),Ma=function(t){function n(n,i){return void 0===i&&(i=r.GROUP_SHADOWED),t.call(this,n,i)||this}return _(n,t),n.prototype.newGroupSize=function(n){return n?new Ea(this,Y.SIZE_X,Y.SIZE_Y):t.prototype.newGroupSize.call(this,n)},n}(pa),Sa=function(t,n){var i=new Ma(n.isEditMode),r=js.deserialize(t,n,i);return i.size.init(),r},Ta=function(){e[r.GROUP_SHADOWED]=Po,n[r.GROUP_SHADOWED]=Sa},ja=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),lo(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=H(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=V(n),d=W(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),vo(t.vertices,w,0,0,r,e,a,c,n.transform.internalTransform,ao),(m||h)&&(t.updateSteps(),bo(w,t.steps,c,f,l,ao)),m&&(t.updateClippings(),fo(t.clippings,w,ao)),(m||g)&&(t.updateUvs(),mo(t.uvs,w,X(b),ao))}},n}(z),Na=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=ho+h,c=oo+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new ja(i,r,a-h,c-o),new Ht(i+ho,r+oo,h,o)]).init(n):null},Ia=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Bt(this,n,i,r,e,u,s)},n}(kt),Ca=function(t){function n(n,i){void 0===i&&(i=r.IMAGE);var e=t.call(this,i)||this;return null!=n&&(e.image=n,e.size.set(n.width,n.height)),e.fill.alpha=1,e}return _(n,t),n.prototype.clone=function(){return new n(this.image).copy(this)},n}(Ia),Aa=function(t,n){return js.deserialize(t,n,new Ca)},Ra=function(){e[r.IMAGE]=Na,n[r.IMAGE]=Aa},ya=[0,0],ka=new t.Point,La=function(t,n){for(var i=3*n-1,r=3*(n+9)-1;i<r;)t[++i]=0,t[++i]=0,t[++i]=2},xa=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Ba=function(t,n,i,r,e,u,s,h){var a=o(e),c=u/h[0],f=s/h[1],l=.5*(c+f),v=12,b=-1+i,d=6*n-1;t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0},_a=function(t,n,i,r,e,u,s,h){var o=ka,a=.5*e,c=.5*u;o.set(i-a,r-c),s.apply(o,o);var f=o.x,l=o.y;o.set(i+a,r-c),s.apply(o,o);var v=o.x,b=o.y;o.set(i+a,r+c),s.apply(o,o);var d=o.x,g=o.y,m=f+(d-v),w=l+(g-b),p=(n<<1)-1;t[++p]=f,t[++p]=l,t[++p]=.5*(f+v),t[++p]=.5*(l+b),t[++p]=v,t[++p]=b,t[++p]=.5*(f+m),t[++p]=.5*(l+w),t[++p]=.5*(f+d),t[++p]=.5*(l+g),t[++p]=.5*(v+d),t[++p]=.5*(b+g),t[++p]=m,t[++p]=w,t[++p]=.5*(m+d),t[++p]=.5*(w+g),t[++p]=d,t[++p]=g,h[0]=.5*O(f,l,v,b),h[1]=.5*O(f,l,m,w)},Pa=function(t,n,i){var r=i.x0,e=i.y0,u=i.x1,s=i.y1,h=i.x2,o=i.y2,a=i.x3,c=i.y3,f=(n<<1)-1;t[++f]=r,t[++f]=e,t[++f]=.5*(u+r),t[++f]=.5*(s+e),t[++f]=u,t[++f]=s,t[++f]=.5*(r+a),t[++f]=.5*(e+c),t[++f]=.5*(r+h),t[++f]=.5*(e+o),t[++f]=.5*(u+h),t[++f]=.5*(s+o),t[++f]=a,t[++f]=c,t[++f]=.5*(a+h),t[++f]=.5*(c+o),t[++f]=h,t[++f]=o},Fa=function(t){function n(n,i){var r=t.call(this,n,i,9,8)||this;return r.textureWidth=-1,r.textureHeight=-1,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset;t.updateClippings(),t.updateIndices(),La(t.clippings,n),xa(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=H(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=V(n),b=v.width*v.resolution,d=v.height*v.resolution,g=this.textureWidth!==b||this.textureHeight!==d;(u||h||l||g)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.textureWidth=b,this.textureHeight=d,t.updateVertices(),_a(t.vertices,this.vertexOffset,0,0,r,e,n.transform.internalTransform,ya),t.updateSteps(),Ba(t.steps,this.vertexOffset,a,c,f,b,d,ya))},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),Pa(t.uvs,this.vertexOffset,X(i)))},n}(z),Ua=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Fa(i,r),new Ht(i+9,r+8,h,o)]).init(n):null},Ga=function(t){function n(n,i){return void 0===i&&(i=r.IMAGE_SDF),t.call(this,n,i)||this}return _(n,t),n.prototype.clone=function(){return new n(this.image).copy(this)},n}(Ca),za=function(t,n){return js.deserialize(t,n,new Ga)},Ha=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=V(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Va=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=h,c=o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Ha(i,r,a-h,c-o),new Ht(i,r,h,o)]).init(n):null},Wa=function(t){function n(n){return void 0===n&&(n=r.LABEL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n}(kt),Xa=function(t,n){return js.deserialize(t,n,new Wa)},Ka=function(){e[r.LABEL]=Va,n[r.LABEL]=Xa},Ya=function(t){function n(n){void 0===n&&(n=r.LINE);var i=t.call(this,n)||this;return i.gt=new so(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.gt.serialize(n),i},n}(Ut),Ja=function(t,n){var i=new Ya,r=js.deserialize(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=U.NON_SCALING_MASK|U.DOTTED_MASK|U.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},Za=function(){e[r.LINE]=To,n[r.LINE]=Ja},qa=function(t,n,i){for(var r=3*n,e=3*(n+i);r<e;r+=3)t[r+0]=0,t[r+1]=0,t[r+2]=0},$a=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Qa=function(t,n,i){for(var r=6*n,e=6*(n+i);r<e;r+=6)t[r+0]=0,t[r+1]=0,t[r+2]=0,t[r+3]=0,t[r+4]=0,t[r+5]=0},tc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},nc=function(t){return 12*Math.ceil(t/12)},ic=function(t,n,i,r,e,u,s,h){if(u)if(i.isStaticColor()){var o=i.getColor(0,s);if(i.isStaticAlpha()){var a=i.getAlpha(0,h);G(o,a,t,n*r,e)}else for(var c=0,f=t;c<r;c+=1,f+=n)a=i.getAlpha(c,h),G(o,a,f,n,e)}else if(i.isStaticAlpha())for(a=i.getAlpha(0,h),c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),G(o,a,f,n,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),a=i.getAlpha(c,h),G(o,a,f,n,e);else if(i.isStaticColor())o=i.getColor(0,s),G(o,0,t,n*r,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),G(o,0,f,n,e)},rc=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e)||this;return s.pointId=-1,s.pointCount=0,s.pointCountReserved=u,s.pointSizeId=-1,s.pointOffsetId=-1,s.pointFillId=-1,s.pointStrokeId=-1,s}return _(n,t),n.prototype.isCompatible=function(t){return nc(dh(t.points))===this.pointCountReserved},n.prototype.updateLineOfAnyColorFill=function(t,n,i,r){var e=i.fill,u=e.id,s=u!==this.pointFillId,h=n.fill,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorFill||c!==this.alphaFill;(s||f)&&(this.colorFill=a,this.alphaFill=c,this.pointFillId=u,t.updateColorFills(),ic(this.vertexOffset,r,e,this.pointCountReserved,t.colorFills,o,a,c))},n.prototype.updateLineOfAnyColorStroke=function(t,n,i,r){var e=i.stroke,u=e.id,s=u!==this.pointStrokeId,h=n.stroke,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorStroke||c!==this.alphaStroke;(s||f)&&(this.colorStroke=a,this.alphaStroke=c,this.pointStrokeId=u,t.updateColorStrokes(),ic(this.vertexOffset,r,e,this.pointCountReserved,t.colorStrokes,o,a,c))},n}(z),ec=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=3*e,h=3*n,o=0;o<i;++o)t[s+0]=t[h+0],t[s+1]=t[h+1],t[s+2]=t[h+2],s+=3,h+=3;e+=i}},uc=function(t,n,i,r,e){for(var u=n,s=i+r,h=1;h<e;++h){for(var o=3*s,a=3*i,c=0;c<r;++c)t[o+0]=t[a+0]+u,t[o+1]=t[a+1]+u,t[o+2]=t[a+2]+u,o+=3,a+=3;u+=n,s+=r}},sc=function(t,n,i,r){for(var e=6*n,u=6*(n+i),s=1;s<r;++s)for(var h=e,o=0;o<i;++o)t[u+0]=t[h+0],t[u+1]=t[h+1],t[u+2]=t[h+2],t[u+3]=t[h+3],t[u+4]=t[h+4],t[u+5]=t[h+5],u+=6,h+=6},hc=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=e<<1,h=n<<1,o=0;o<i;++o)t[s]=t[h],t[s+1]=t[h+1],s+=2,h+=2;e+=i}},oc=function(t,n,i,r,e,u,s){var h=n.a,o=n.b,a=n.c,c=n.d,f=e-1,l=i+f*r;if(s.isStaticX()&&s.isStaticY())for(var v=s.getX(0),b=s.getY(0);0<=f;--f){for(var d=h*(D=u[O=f<<1]+v)+a*(E=u[O+1]+b),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}else for(;0<=f;--f){var O,D,E;for(d=h*(D=u[O=f<<1]+s.getX(f))+a*(E=u[O+1]+s.getY(f)),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}},ac=function(t){return Xt(t)||null==t},cc=function(t,n,i){return Xt(n)?n:ot(n)?n(t):n?n[t%n.length]:i},fc=function(){function t(t){this.O=t,this.k=0,this.T=null,this.j=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.T!==t&&(i=!0,this.T=t),void 0!==n&&this.j!==n&&(i=!0,this.j=n),i&&(this.k+=1,this.O.updateUploaded())},t.prototype.getColor=function(t,n){return cc(t,this.T,n)},t.prototype.getAlpha=function(t,n){return cc(t,this.j,n)},t.prototype.isStaticColor=function(){return ac(this.T)},t.prototype.isStaticAlpha=function(){return ac(this.j)},t.prototype.toDirty=function(){this.k+=1},t}(),lc=function(){function t(t,n,i){this.O=t,this.k=0,this._x=null,this._y=null,this.Ph=n,this.Fh=i,this.Uh=null,this.Gh=0,this.zh=-1,this.Hh=0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"limit",{get:function(){return this.Uh},set:function(t){this.Uh=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this._x!==t&&(i=!0,this._x=t),void 0!==n&&this._y!==n&&(i=!0,this._y=n),i&&(this.k+=1,this.O.updateUploaded())},t.prototype.getX=function(t){return cc(t,this._x,this.Ph)},t.prototype.getY=function(t){return cc(t,this._y,this.Fh)},t.prototype.getLimit=function(){var t=this.Uh;return null!=t?t:(this.updateLimitComputed(),this.Gh)},t.prototype.updateLimitComputed=function(){var t=this.k,n=this.O.length;this.zh===t&&this.Hh===n||(this.zh=t,this.Hh=n,this.Gh=Math.max(this.calcLimit(this._x,n,this.Ph),this.calcLimit(this._y,n,this.Fh)))},t.prototype.calcLimit=function(t,n,i){if(Xt(t))return Math.abs(t);if(ot(t)){if(0<n){for(var r=Math.abs(t(0)),e=1;e<n;++e)r=Math.max(r,Math.abs(t(e)));return r}return 0}if(null!=t){var u=t.length;if(0<u){for(r=t[0],e=1;e<u;++e)r=Math.max(r,Math.abs(t[e]));return r}return 0}return Math.abs(i)},t.prototype.isStaticX=function(){return ac(this._x)},t.prototype.isStaticY=function(){return ac(this._y)},t.prototype.toDirty=function(){this.k+=1},t}(),vc=function(){function t(t){this.O=t,this.k=0,this.T=null,this.j=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.T!==t&&(i=!0,this.T=t),void 0!==n&&this.j!==n&&(i=!0,this.j=n),i&&(this.k+=1,this.O.updateUploaded())},t.prototype.getColor=function(t,n){return cc(t,this.T,n)},t.prototype.getAlpha=function(t,n){return cc(t,this.j,n)},t.prototype.isStaticColor=function(){return ac(this.T)},t.prototype.isStaticAlpha=function(){return ac(this.j)},t.prototype.toDirty=function(){this.k+=1},t}(),bc=function(){function n(t){this.O=t,this.L=[],this.Vh=0,this.B=[],this.I=new lc(this,Y.SIZE_X,Y.SIZE_Y),this.Jt=new lc(this,0,0),this.A=new fc(t),this.Wh=new vc(t),this.k=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this.L.length>>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.L},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.B},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return U.NONE},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.R;return null==t&&(t=$.getInstance(),this.R=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"size",{get:function(){return this.I},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"offset",{get:function(){return this.Jt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){return this.A},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"stroke",{get:function(){return this.Wh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return this.set(t.values,t.segments,t.style)},n.prototype.set=function(t,n,i){var r=!1,e=!1;if(null!=t){var u=this.L,s=this.Vh,h=t.length;if(u!==t){for(var o=Math.min(s,h),a=0;a<o;++a)u[a]=t[a];for(a=o;a<h;++a)u.push(t[a]);s!==h?(u.length=h,this.Vh=h,r=!0):e=!0}else s!==h?(this.Vh=h,r=!0):e=!0}if(r){this.k+=1;var c=this.O,f=c.uploaded;f?f.isCompatible(c)?c.updateUploaded():(c.uploaded=void 0,c.toDirty()):c.updateUploaded()}else e&&(this.k+=1,this.O.updateUploaded());return this},n.prototype.updateUploaded=function(){this.O.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[]")},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o,a){var c=this.formatted,f=c.length,l=c.values,v=this.I,b=this.Jt,d=0,g=f;if(h){var m=.5*v.getLimit(),w=b.getLimit(),p=n.WORK_RANGE;h(t,i,m,m,w,w,s,l,p),d=p[0],g=p[1]}for(var O=d,D=Math.min(g,f);O<D;++O){var E=O<<1,M=l[E],S=l[E+1];if(o(t,i,.5*v.getX(O),.5*v.getY(O),b.getX(O),b.getY(O),M,S,r,e,u,O,s,a))return!0}return!1},n.WORK_RANGE=[0,0],n}(),dc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(eh(n,r),ec(n,r,9,u),uh(i,r,e),uc(i,9,e,8,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof bc&&(this.updateVertexAndStep(t,n,i),this.updateLineOfAnyColorFill(t,n,i,9),this.updateLineOfAnyColorStroke(t,n,i,9),this.updateUv(t,n))},n.prototype.updateVertexAndStep=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=H(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p;if(s||a||v||d||O){this.pointId=r;var D=i.formatted;this.pointCount=D.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeStyle=p,t.updateVertices(),t.updateSteps();var E=this.pointCount,M=D.values,S=this.vertexOffset,T=t.vertices,j=t.steps,N=t.clippings,I=n.transform.internalTransform;if(0<E&&h.isStaticX()&&h.isStaticY()){var C=h.getX(0),A=h.getY(0);sh(T,S,0,0,C,A,m,w,I,ih),oc(T,I,S,9,E,M,e),hh(j,N,S,w,p,ih),sc(j,S,9,E)}else for(var R=0;R<E;++R){var y=R<<1,k=M[y]+e.getX(R),L=M[y+1]+e.getY(R),x=(C=h.getX(R),A=h.getY(R),S+9*R);sh(T,x,k,L,C,A,m,w,I,ih),hh(j,N,x,w,p,ih)}var B=S+9*E,_=9*(this.pointCountReserved-E);$a(T,B,_),Qa(j,B,_)}},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=t.uvs,u=this.vertexOffset,s=X(i),h=this.pointCountReserved;0<h&&(oh(e,u,s),hc(e,u,9,h))}},n}(rc),gc=function(t,n,i,r,e,s,h,o){var a=M(n),c=4*a,f=2*a,l=n.points,v=nc(dh(l)),b=v*r,d=v*s,g=b+c,m=d+f;return t.check(i,e,g,m)?new u(t,i,e,g,m,[new o(i,e,b,d,v),new Ht(i+b,e+d,c,f)]).init(n):null},mc=function(t,n,i,r,e){return gc(t,n,i,9,r,8,0,dc)},wc=function(t){function n(){var n=t.call(this,r.LINE_OF_CIRCLES)||this;return n.gt=new bc(n),n.Xh=function(t,i,r,e,u,s,h,o,a,c,f){return n.containsPointAbs(t,i,r,e,u,s,h,o,a,c,f)},n}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Ft(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.Xh,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Ft)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.Xh,u)},n}(fh),pc=function(t,n){return js.deserialize(t,n,new wc)},Oc=function(){e[r.LINE_OF_CIRCLES]=mc,n[r.LINE_OF_CIRCLES]=pc},Dc=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(xs(n,i,r),uc(n,ys,r,24,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof bc&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,ys),this.updateLineOfAnyColorStroke(t,n,i,ys))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=n.radius,b=f!==this.sizeX||l!==this.sizeY||v!==this.radius,d=H(n),g=this.transformLocalId!==d,m=n.stroke,w=m.align,p=m.enable?m.width:0,O=m.side,D=m.style,E=this.strokeAlign!==w||this.strokeWidth!==p||this.strokeSide!==O||this.strokeStyle!==D,M=n.corner,S=M!==this.corner,T=V(n),j=W(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||b||E;if(I||g||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=v,this.transformLocalId=d,this.strokeAlign=w,this.strokeWidth=p,this.strokeSide=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||g)&&t.updateSteps(),(I||S)&&t.updateClippings(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,y=this.vertexOffset,k=t.vertices,L=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=X(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var F=h.getX(0),U=h.getY(0);Bs(k,y,0,0,F,U,w,p,v,_,ks),oc(k,_,y,ys,A,R,e),(I||g)&&(Ps(x,y,p,O,D,M,ks),sc(x,y,ys,A)),(I||S)&&(_s(L,y,M,ks),ec(L,y,ys,A)),(I||N)&&(Fs(B,y,P,ks),hc(B,y,ys,A))}else for(var G=0;G<A;++G){var z=G<<1,K=R[z]+e.getX(G),Y=R[z+1]+e.getY(G),J=(F=h.getX(G),U=h.getY(G),y+G*ys);Bs(k,J,K,Y,F,U,w,p,v,_,ks),(I||g)&&Ps(x,J,p,O,D,M,ks),(I||S)&&_s(L,J,M,ks),(I||N)&&Fs(B,J,P,ks)}var Z=this.pointCountReserved,q=y+A*ys,$=ys*(Z-A);$a(k,q,$),Qa(x,q,$),qa(L,q,$),tc(B,q,$)}},n}(rc),Ec=function(t,n,i,r,e){return gc(t,n,i,ys,r,24,0,Dc)},Mc=function(t){function n(){var n=t.call(this,r.LINE_OF_RECTANGLE_ROUNDEDS)||this;return n.gt=new bc(n),n.Xh=function(t,i,r,e,u,s,h,o,a,c,f){return n.containsPointAbs(t,i,r,e,u,s,h,o,a,c,f)},n}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Ft(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,h,e,u,s,null,this.Xh,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Ft)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.Xh,u)},n}(Ws),Sc=function(t,n){return js.deserialize(t,n,new Mc)},Tc=function(){e[r.LINE_OF_RECTANGLE_ROUNDEDS]=Ec,n[r.LINE_OF_RECTANGLE_ROUNDEDS]=Sc,As.set(r.LINE_OF_RECTANGLE_ROUNDEDS,Cs.PRIMITIVE|Cs.STROKE_SIDE|Cs.BORDER_RADIUS)},jc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(lo(n,i,r),uc(n,ho,r,oo,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof bc&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,ho),this.updateLineOfAnyColorStroke(t,n,i,ho))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=H(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.side,O=g.style,D=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeSide!==p||this.strokeStyle!==O,E=V(n),M=W(E),S=E!==this.texture||M!==this.textureTransformId,T=s||a||v||D;if(T||d||S){this.pointId=r;var j=i.formatted;this.pointCount=j.length,this.pointOffsetId=u,this.pointSizeId=o,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeSide=p,this.strokeStyle=O,this.texture=E,this.textureTransformId=M,t.updateVertices(),(T||d)&&t.updateSteps(),T&&t.updateClippings(),(T||S)&&t.updateUvs();var N=this.pointCount,I=j.values,C=this.vertexOffset,A=t.vertices,R=t.clippings,y=t.steps,k=t.uvs,L=n.transform.internalTransform,x=X(E);if(0<N&&h.isStaticX()&&h.isStaticY()){var B=h.getX(0),_=h.getY(0);vo(A,C,0,0,B,_,m,w,L,ao),oc(A,L,C,ho,N,I,e),(T||d)&&(bo(C,y,w,p,O,ao),sc(y,C,ho,N)),T&&(fo(R,C,ao),ec(R,C,ho,N)),(T||S)&&(mo(k,C,x,ao),hc(k,C,ho,N))}else for(var P=0;P<N;++P){var F=P<<1,U=I[F]+e.getX(P),G=I[F+1]+e.getY(P),z=(B=h.getX(P),_=h.getY(P),C+P*ho);vo(A,z,U,G,B,_,m,w,L,ao),(T||d)&&bo(z,y,w,p,O,ao),T&&fo(R,z,ao),(T||S)&&mo(k,z,x,ao)}var K=this.pointCountReserved,Y=C+N*ho,J=ho*(K-N);$a(A,Y,J),Qa(y,Y,J),qa(R,Y,J),tc(k,Y,J)}},n}(rc),Nc=function(t,n,i,r,e){return gc(t,n,i,ho,r,oo,0,jc)},Ic=function(t){function n(){var n=t.call(this,r.LINE_OF_RECTANGLES)||this;return n.gt=new bc(n),n.Xh=function(t,i,r,e,u,s,h,o,a,c,f){return n.containsPointAbs(t,i,r,e,u,s,h,o,a,c,f)},n}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Ft(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.Xh,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Ft)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.Xh,u)},n}(Ia),Cc=function(t,n){return js.deserialize(t,n,new Ic)},Ac=function(){e[r.LINE_OF_RECTANGLES]=Nc,n[r.LINE_OF_RECTANGLES]=Cc,As.set(r.LINE_OF_RECTANGLES,Cs.PRIMITIVE|Cs.STROKE_SIDE)},Rc=22,yc=[0,0,0,0,0],kc=new t.Point,Lc=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+6,t[++r]=n+7,t[++r]=n+8,t[++r]=n+9,t[++r]=n+11,t[++r]=n+9,t[++r]=n+10,t[++r]=n+11,t[++r]=n+12,t[++r]=n+13,t[++r]=n+16,t[++r]=n+13,t[++r]=n+14,t[++r]=n+16,t[++r]=n+14,t[++r]=n+15,t[++r]=n+16,t[++r]=n+12,t[++r]=n+16,t[++r]=n+19,t[++r]=n+16,t[++r]=n+17,t[++r]=n+19,t[++r]=n+17,t[++r]=n+18,t[++r]=n+19,t[++r]=n+12,t[++r]=n+19,t[++r]=n+13,t[++r]=n+19,t[++r]=n+20,t[++r]=n+13,t[++r]=n+20,t[++r]=n+21,t[++r]=n+13},xc=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.sqrt(l*l+4*v*v),d=2*l*v/(l+b),g=d*o/(2*v),m=.5*(b-d)*o/b,w=g*b/(2*l),p=kc;p.set(i,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r),a.apply(p,p);var M=p.x,S=p.y;p.set(i+l,r),a.apply(p,p);var T=M-D,j=S-E,N=p.x+T,I=p.y+j,C=M+(M-p.x)+T,A=S+(S-p.y)+j,R=N-D,y=I-E,k=D+m*R,L=E+m*y,x=N-g*R,B=I-g*y,_=w*(C-N),P=w*(A-I),F=N+_,U=I+P,G=C-_,z=A-P,H=D-C,V=E-A,W=C+g*H,X=A+g*V,K=D-m*H,Y=E-m*V;p.set(i,r+v-d),a.apply(p,p);var J=p.x,Z=p.y,q=D+o*(J-D),$=E+o*(Z-E),Q=N+o*(J-N),tt=I+o*(Z-I),nt=C+o*(J-C),it=A+o*(Z-A),rt=M+T,et=S+j;c[0]=O(rt,et,J,Z),c[1]=w,c[2]=g,c[3]=m,c[4]=1-.5*d/v;var ut=2*n-1;t[++ut]=q,t[++ut]=$,t[++ut]=K,t[++ut]=Y,t[++ut]=D,t[++ut]=E,t[++ut]=k,t[++ut]=L,t[++ut]=Q,t[++ut]=tt,t[++ut]=x,t[++ut]=B,t[++ut]=N,t[++ut]=I,t[++ut]=F,t[++ut]=U,t[++ut]=nt,t[++ut]=it,t[++ut]=G,t[++ut]=z,t[++ut]=C,t[++ut]=A,t[++ut]=W,t[++ut]=X,t[++ut]=J,t[++ut]=Z,t[++ut]=q,t[++ut]=$,t[++ut]=k,t[++ut]=L,t[++ut]=x,t[++ut]=B,t[++ut]=Q,t[++ut]=tt,t[++ut]=F,t[++ut]=U,t[++ut]=G,t[++ut]=z,t[++ut]=nt,t[++ut]=it,t[++ut]=W,t[++ut]=X,t[++ut]=K,t[++ut]=Y},Bc=function(t,n,i,r){var e=3*n-1,u=1-r;i&it.TOP?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_LEFT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0},_c=function(t,n,i,r,e,u,s){for(var h=o(e),a=s[0],c=u*a,f=3*i,l=6*i-1,v=0;v<Rc;v+=1,f+=3)t[++l]=r,t[++l]=h,.5<n[f+2]?(t[++l]=c,t[++l]=c,t[++l]=1+n[f],t[++l]=1+n[f+1]):(t[++l]=a,t[++l]=a,t[++l]=1+n[f],t[++l]=1+n[f+1])},Pc=function(t,n,i,r,e){var u=i.x0,s=i.x1,h=i.x2,o=i.x3,a=i.y0,c=i.y1,f=i.y2,l=i.y3,v=.5*(u+s),b=.5*(a+c),d=e[4],g=v+d*(o-u),m=b+d*(l-a),w=e[1],p=e[2],O=e[3],D=v+O*(o-v),E=b+O*(l-b),M=v+r*(g-v),S=b+r*(m-b),T=v+O*(h-v),j=b+O*(f-b),N=h+p*(v-h),I=f+p*(b-f),C=h+r*(g-h),A=f+r*(m-f),R=h+w*(o-h),y=f+w*(l-f),k=o+w*(h-o),L=l+w*(f-l),x=o+r*(g-o),B=l+r*(m-l),_=o+p*(v-o),P=l+p*(b-l),F=2*n-1;t[++F]=M,t[++F]=S,t[++F]=D,t[++F]=E,t[++F]=v,t[++F]=b,t[++F]=T,t[++F]=j,t[++F]=C,t[++F]=A,t[++F]=N,t[++F]=I,t[++F]=h,t[++F]=f,t[++F]=R,t[++F]=y,t[++F]=x,t[++F]=B,t[++F]=k,t[++F]=L,t[++F]=o,t[++F]=l,t[++F]=_,t[++F]=P,t[++F]=g,t[++F]=m,t[++F]=M,t[++F]=S,t[++F]=T,t[++F]=j,t[++F]=N,t[++F]=I,t[++F]=C,t[++F]=A,t[++F]=R,t[++F]=y,t[++F]=k,t[++F]=L,t[++F]=x,t[++F]=B,t[++F]=_,t[++F]=P,t[++F]=D,t[++F]=E},Fc=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=this.vertexOffset,i=this.indexOffset,r=this.pointCountReserved;0<r&&(Lc(t.indices,n,i),uc(t.indices,Rc,i,15,r))},n.prototype.update=function(t,n){var i=n.points;i instanceof bc&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,Rc),this.updateLineOfAnyColorStroke(t,n,i,Rc))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=n.radius,d=b!==this.radius,g=H(n),m=this.transformLocalId!==g,w=n.stroke,p=w.align,O=w.enable?w.width:0,D=w.style,E=this.strokeAlign!==p||this.strokeWidth!==O||this.strokeStyle!==D,M=n.corner,S=this.corner!==M,T=V(n),j=W(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||v||d||E;if(I||m||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=b,this.transformLocalId=g,this.strokeAlign=p,this.strokeWidth=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||S)&&t.updateClippings(),(I||m||S)&&t.updateSteps(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,y=this.vertexOffset,k=t.vertices,L=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=X(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var F=h.getX(0),U=h.getY(0);xc(k,y,0,0,F,U,p,O,b,_,yc),oc(k,_,y,Rc,A,R,e),(I||S)&&(Bc(L,y,M,b),ec(L,y,Rc,A)),(I||m||S)&&(_c(x,L,y,O,D,b,yc),sc(x,y,Rc,A)),(I||N)&&(Pc(B,y,P,b,yc),hc(B,y,Rc,A))}else for(var G=0;G<A;++G){var z=G<<1,K=R[z]+e.getX(G),Y=R[z+1]+e.getY(G),J=(F=h.getX(G),U=h.getY(G),y+G*Rc);xc(k,J,K,Y,F,U,p,O,b,_,yc),(I||S)&&Bc(L,J,M,b),(I||m||S)&&_c(x,L,J,O,D,b,yc),(I||N)&&Pc(B,J,P,b,yc)}var Z=this.pointCountReserved,q=y+A*Rc,$=Rc*(Z-A);$a(k,q,$),Qa(x,q,$),qa(L,q,$),tc(B,q,$)}},n}(rc),Uc=function(t,n,i,r,e){return gc(t,n,i,Rc,r,15,0,Fc)},Gc=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=u+f*(h-u)-r,w=s+f*(o-s)-e,p=Math.sqrt(m*m+w*w),O=1e-5;if(O<p){var D=1/p,E=m*D,M=w*D,S=(u+l*(a-u)-r)*D,T=(s+l*(c-s)-e)*D,j=E*T-S*M;if(O<Math.abs(j)){var N=1/j,I=n-r,C=i-e;if(function(t,n,i,r,e,u,s){if(t.fill.enable){if(n*n+i*i<=r*r)return!0}else if(0<u){var h=n*n+i*i;if(h<=r*r){var o=Math.max(0,r*(1-u*s/e));if(o*o<=h)return!0}}return!1}(t,(+T*I-S*C)*N,(-M*I+E*C)*N,p,v*b,d,g))return!0}}return!1},zc=function(t,n,i,r,e,u,s){var h=2*e/r;if(_t(n,i,h,-e,+e)){var o=Math.sqrt(r*r+4*e*e),a=2*r*e/(r+o),c=t.radius,f=e-a,l=-e,v=+r,b=+e,d=-v,g=+b,m=0+0*c,w=l+c*(f-l),p=v+c*(0-v),O=b+c*(f-b),D=+O,E=-p,M=-h*n+w-i<=0,S=+h*n+w-i<=0,T=i<=O,j=t.corner;if(!M&&!S&&j&it.TOP){var N=.5*(o-a)*c/o;if(Gc(t,n,i,m,w,0,l,d,g,v,b,N,N,a,c,u,s))return!0}else if(!M&&!T&&j&it.BOTTOM_LEFT){if(Gc(t,n,i,E,D,d,g,v,b,0,l,(I=a*c/(2*e))*o/(2*r),I,a,c,u,s))return!0}else if(!S&&!T&&j&it.BOTTOM_RIGHT){var I;if(Gc(t,n,i,p,O,v,b,0,l,d,g,I=a*c/(2*e),I*o/(2*r),a,c,u,s))return!0}else{if(t.fill.enable)return!0;if(0<u){var C=u*s,A=e-a,R=A+(-e-A)*Math.max(0,a-C)/a;if(!_t(n,i,h,R,e-C))return!0}}}return!1},Hc=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&zc(this,n,i,r,e,u,s)},n}(kt),Vc=function(t){function n(){var n=t.call(this,r.LINE_OF_TRIANGLE_ROUNDEDS)||this;return n.gt=new bc(n),n.Xh=function(t,i,r,e,u,s,h,o,a,c,f){return n.containsPointAbs(t,i,r,e,u,s,h,o,a,c,f)},n}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Ft(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.Xh,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Ft)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.Xh,u)},n}(Hc),Wc=function(t,n){return js.deserialize(t,n,new Vc)},Xc=function(){e[r.LINE_OF_TRIANGLE_ROUNDEDS]=Uc,n[r.LINE_OF_TRIANGLE_ROUNDEDS]=Wc,As.set(r.LINE_OF_TRIANGLE_ROUNDEDS,Cs.PRIMITIVE|Cs.STROKE_SIDE|Cs.BORDER_RADIUS)},Kc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(Rh(n,r),ec(n,r,7,u),yh(i,r,e),uc(i,7,e,3,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof bc&&(this.updateVertexStepAndUvs(t,n,i),this.updateLineOfAnyColorFill(t,n,i,7),this.updateLineOfAnyColorStroke(t,n,i,7))},n.prototype.updateVertexStepAndUvs=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=H(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p,D=V(n),E=W(D),M=D!==this.texture||E!==this.textureTransformId,S=s||a||v||O;if(S||d||M){this.pointId=r;var T=i.formatted;this.pointCount=T.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeAlign=m,this.strokeWidth=w,this.strokeStyle=p,t.updateVertices(),(S||d)&&t.updateSteps(),(S||M)&&t.updateUvs();var j=this.pointCount,N=T.values,I=this.vertexOffset,C=t.vertices,A=t.steps,R=t.clippings,y=t.uvs,k=X(D),L=n.transform.internalTransform;if(0<j&&h.isStaticX()&&h.isStaticY()){var x=h.getX(0),B=h.getY(0);kh(C,I,0,0,x,B,m,w,L,Ch),oc(C,L,I,7,j,N,e),(S||d)&&(Lh(A,R,I,7,w,p,Ch),sc(A,I,7,j)),(S||M)&&(xh(y,k,I,Ch),hc(y,I,7,j))}else for(var _=0;_<j;++_){var P=_<<1,F=N[P]+e.getX(_),U=N[P+1]+e.getY(_),G=(x=h.getX(_),B=h.getY(_),I+7*_);kh(C,G,F,U,x,B,m,w,L,Ch),(S||d)&&Lh(A,R,G,7,w,p,Ch),(S||M)&&xh(y,k,G,Ch)}var z=I+7*j,K=7*(this.pointCountReserved-j);$a(C,z,K),Qa(A,z,K),tc(y,z,K)}},n}(rc),Yc=function(t,n,i,r,e){return gc(t,n,i,7,r,3,0,Kc)},Jc=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Pt(this,n,i,r,e,u,s)},n}(kt),Zc=function(t){function n(){var n=t.call(this,r.LINE_OF_TRIANGLES)||this;return n.gt=new bc(n),n.Xh=function(t,i,r,e,u,s,h,o,a,c,f){return n.containsPointAbs(t,i,r,e,u,s,h,o,a,c,f)},n}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Ft(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.Xh,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Ft)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.Xh,u)},n}(Jc),qc=function(t,n){return js.deserialize(t,n,new Zc)},$c=function(){e[r.LINE_OF_TRIANGLES]=Yc,n[r.LINE_OF_TRIANGLES]=qc},Qc=function(t,n,i,r){return new u(t,i,r,0,0,[new Hh(i,r)]).init(n)},tf=function(t,n){return js.deserialize(t,n,new Ts)},nf=function(){e[r.NULL]=Qc,n[r.NULL]=tf},rf=function(t,n){return js.deserialize(t,n,new Ia)},ef=function(){e[r.RECTANGLE]=Na,n[r.RECTANGLE]=rf,As.set(r.RECTANGLE,Cs.PRIMITIVE|Cs.STROKE_SIDE)},uf=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Lc(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.radius,h=s!==this.radius,o=H(n),a=this.transformLocalId!==o,c=n.stroke,f=c.align,l=c.enable?c.width:0,v=c.style,b=this.strokeAlign!==f||this.strokeWidth!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=V(n),w=W(m),p=m!==this.texture||w!==this.textureTransformId,O=u||h||b;if(O||a||g||p){this.sizeX=r,this.sizeY=e,this.radius=s,this.transformLocalId=o,this.strokeAlign=f,this.strokeWidth=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),xc(t.vertices,D,0,0,r,e,f,l,s,n.transform.internalTransform,yc),(h||g)&&(t.updateClippings(),Bc(t.clippings,D,d,s)),(O||a||g)&&(t.updateSteps(),_c(t.steps,t.clippings,D,l,v,n.radius,yc)),(O||p)&&(t.updateUvs(),Pc(t.uvs,D,X(m),s,yc))}},n}(z),sf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices(),Rh(t.clippings,this.vertexOffset),yh(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=H(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=V(n),b=W(v),d=v!==this.texture||b!==this.textureTransformId,g=u||l;if(g||h||d){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.texture=v,this.textureTransformId=b;var m=this.vertexOffset;t.updateVertices(),kh(t.vertices,m,0,0,r,e,a,c,n.transform.internalTransform,Ch),(g||h)&&(t.updateSteps(),Lh(t.steps,t.clippings,m,7,c,f,Ch)),(g||d)&&(t.updateUvs(),xh(t.uvs,X(v),m,Ch))}},n}(z),hf=function(t,n){return n?Ms.toImageElement(t).then((function(t){var n=Kr.getInstance().init();n.updateTexture(t),n.render();var i=document.createElement("canvas");return n.read(i),hf(i.toDataURL(),!1)})):Ms.toImageElement(t).then((function(t){return new Ga(t)}))},of=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=Rc+h,c=15+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new uf(i,r,a-h,c-o),new Ht(i+Rc,r+15,h,o)]).init(n):null},af=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=7+h,c=3+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new sf(i,r,a-h,c-o),new Ht(i+7,r+3,h,o)]).init(n):null},cf=function(t,n){return js.deserialize(t,n,new Ws)},ff=function(t,n){return js.deserialize(t,n,new Hc)},lf=function(t,n){return js.deserialize(t,n,new Jc)},vf=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_PIVOTED),t.call(this,n)||this}return _(n,t),n.prototype.toHitTestData=function(n,i){var r=t.prototype.toHitTestData.call(this,n,i);return r.x-=r.width,r.y-=r.height,r},n}(Ia),bf=function(t,n){return js.deserialize(t,n,new vf)},df=function(){e[r.RECTANGLE_ROUNDED]=Gs,n[r.RECTANGLE_ROUNDED]=cf,As.set(r.RECTANGLE_ROUNDED,Cs.PRIMITIVE|Cs.STROKE_SIDE|Cs.BORDER_RADIUS)},gf=function(){e[r.TRIANGLE]=af,n[r.TRIANGLE]=lf},mf=function(){e[r.TRIANGLE_ROUNDED]=of,n[r.TRIANGLE_ROUNDED]=ff,As.set(r.TRIANGLE_ROUNDED,Cs.PRIMITIVE|Cs.STROKE_SIDE|Cs.BORDER_RADIUS)},wf=function(){Is(),nh(),vh(),xo(),da(),Ta(),Da(),Ra(),e[r.IMAGE_SDF]=Ua,n[r.IMAGE_SDF]=za,Ka(),Za(),nf(),e[r.RECTANGLE_PIVOTED]=_o,n[r.RECTANGLE_PIVOTED]=bf,As.set(r.RECTANGLE_PIVOTED,Cs.PRIMITIVE|Cs.STROKE_SIDE),df(),ef(),mf(),gf(),Oc(),Tc(),Ac(),Xc(),$c()},pf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DImage"},n}(Ie),Of=function(t){function n(n){var i,r=t.call(this,n)||this;return r.At=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:null,r}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.initOnClick(n)},n.prototype.initOnClick=function(t){var n=this;zi.onClick(this,(function(t){n.state.isActionable&&n.onSelect(t)}))},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},set:function(t){this.At=t},enumerable:!1,configurable:!0}),n.prototype.hasSelection=function(t){return t&&t.selection&&t.selection.add},n.prototype.getSelection=function(){for(var t=this.parent;t;){if(this.hasSelection(t))return t.selection;t=t.parent}return null},n.prototype.onSelect=function(t){this.emit("select",this);var n=this.getSelection();n&&n.add(this)},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},n.prototype.getType=function(){return"DMenuItemBase"},n}(pf),Df=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getContext=function(){for(var t=this.parent;t;){if(t.getContext)return t.getContext();t=t.parent}return null},n.prototype.getCloseable=function(){for(var t=this.parent;t;){if(t.getCloseable)return t.getCloseable();t=t.parent}return null},n.prototype.getType=function(){return"DMenuItem"},n}(Of),Ef=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.initOnOver(n),this.initShortcuts(n)},n.prototype.initOnOver=function(t){var n=this;this.on(zi.over,(function(){var t=n.getContext();null!=t&&n.parent instanceof Ki&&t.trim(n.getCloseable())}))},n.prototype.initShortcuts=function(t){var n=this.Fn;if(null!=n&&0<n.length){var i=n[0],r=Kt.toString(i);this.Kh=this.createText(r),this.snippet.add(this.Kh,!0)}else this.Kh=null;this.Yh=this.theme.getShortcutTextMargin()},n.prototype.updateShortcutText=function(){var t=this.Kh,n=this.Yh;if(null!=t&&null!=n){var i=this.toRounded;t.position.set(i(this.width-n-t.width),i(.5*(this.height-t.height)))}},n.prototype.updateTextColor=function(n){t.prototype.updateTextColor.call(this,n);var i=this.Kh;if(null!=i){var r=this.theme,e=this.state;i.style.fill=r.getShortcutColor(e),i.alpha=r.getShortcutAlpha(e)}},n.prototype.updateText=function(){t.prototype.updateText.call(this),this.updateShortcutText()},n.prototype.getType=function(){return"DMenuItemText"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n);var i=this.getCloseable();null!=i&&i.emit("select",this.value,this,i)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.onSelect(n)},n}(Df),Mf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),(null==n?void 0:n.check)&&(this.state.isActive=!0)},n.prototype.getType=function(){return"DMenuItemCheck"},n.prototype.onSelect=function(n){this.state.isActive=!this.state.isActive,t.prototype.onSelect.call(this,n)},n}(Ef),Sf=function(t){return"check"in t},Tf={OPEN_LINK:0,OPEN_LINK_IN_NEW_WINDOW:1,COPY_LINK_ADDRESS:2},jf=function(){function n(){}return n.addItemCreator=function(t){this.CREATORS.push(t)},n.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},n.setMenuCreator=function(t){this.MENU_CREATOR=t},n.newItemOf=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e](i,r);if(null!=s)return s}return n?n(i,r):null},n.newItem=function(t,n){return this.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)},n.newItemsOf=function(n,i,r,e){for(var u=0,s=r.length;u<s;++u){var h=r[u];if(h instanceof t.DisplayObject)i.addChild(h);else if(null!=h){var o=n.newItem(h,e);if(null==o)throw new Error("No matching menu item creator found: "+JSON.stringify(h));i.addChild(o)}}},n.newItems=function(t,n,i){this.newItemsOf(this,t,n,i)},n.newMenu=function(t){if(null!=this.MENU_CREATOR)return this.MENU_CREATOR(t);throw new Error("Missing DMenu creator.")},n.CREATORS=[],n.CREATOR_DEFAULT=null,n}(),Nf=function(){function n(t,n){this.O=t,this.Nn=n,this.Gu=!0}return Object.defineProperty(n.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu=t},enumerable:!1,configurable:!0}),n.prototype.open=function(t){this.get().open(t)},n.prototype.get=function(){var t=this,n=this.Jh;return null==n&&(n=this.toMenu(this.Nn),this.Jh=n,n.on("select",(function(n,i,r){t.onSelect(n,i,r)}))),n},n.prototype.toMenu=function(n){return n instanceof t.DisplayObject?n:this.newMenu(n)},n.prototype.newMenu=function(t){return jf.newMenu(t)},n.prototype.onSelect=function(t,n,i){var r=this.O;switch(t){case Tf.OPEN_LINK:r.open(!1);break;case Tf.OPEN_LINK_IN_NEW_WINDOW:r.open(!0);break;case Tf.COPY_LINK_ADDRESS:r.copy()}},n}(),If={AUTO:0,THIS_WINDOW:1,NEW_WINDOW:2},Cf=function(t){var n=document.getSelection();if(n){var i=document.createRange();i.selectNodeContents(t),n.removeAllRanges(),n.addRange(i)}return n},Af=function(t){return t.clipboardData||window.clipboardData},Rf=function(t){function n(){var n=t.call(this)||this,i=document.body;return i.addEventListener("copy",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("copy",Af(t)))})),i.addEventListener("cut",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("cut",Af(t)))})),i.addEventListener("paste",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("paste",Af(t)))})),n}return _(n,t),n.copy=function(t){var n=navigator.clipboard;n&&n.writeText?n.writeText(t):function(t,n){if("undefined"==typeof ClipboardEvent){var i=t.clipboardData;if(void 0!==i&&void 0!==i.setData)return i.setData("Text",n),!0}return!1}(window,t)||function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important"),n.textContent="Dummy",document.body.appendChild(n);var i=Cf(n),r=!1;if(i){var e=function(i){if(i.target===n){var e=Af(i);e.setData("text/plain",t),r=e.getData("text/plain")===t,i.preventDefault()}};document.addEventListener("copy",e);try{document.execCommand("copy")}finally{document.removeEventListener("copy",e)}i.removeAllRanges()}return document.body.removeChild(n),r}(t)||navigator.userAgent.indexOf("Edge")<0&&function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important");var i=document.createElement("span");i.innerText=t,(n.attachShadow?n.attachShadow({mode:"open"}):n).appendChild(i),document.body.appendChild(n);var r=Cf(n);r&&(document.execCommand("copy"),r.removeAllRanges()),document.body.removeChild(n)}(t)},n}(t.utils.EventEmitter),yf=t.interaction.InteractionEvent,kf=function(){function t(t){this.Nn=t,this.Zh=null==t?void 0:t.url,this.zn=this.toNormalizedTarget(null==t?void 0:t.target),this.qh=null==t?void 0:t.checker,this.Gu=!0}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this.Zh},set:function(t){this.Zh=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){return this.zn},set:function(t){this.zn=this.toNormalizedTarget(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checker",{get:function(){return this.qh},set:function(t){this.qh=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"menu",{get:function(){var t=this.Jh;return null==t&&(t=this.newMenu(),this.Jh=t),t},enumerable:!1,configurable:!0}),t.prototype.newMenu=function(){var n=this.Nn;if(n){var i=n.menu;if(i)return new Nf(this,i)}var r=t.MENU;return null==r&&(r=new Nf(this,K.getInstance().get("DLink").getMenuOptions()),t.MENU=r),r},t.prototype.toStringifiedUrl=function(t,n){var i=ot(t)?t():t;null!=i&&(at(i)?n(i):i.then((function(t){null!=t&&n(t)})))},t.prototype.toNormalizedUrl=function(n){var i=t.ANCHOR_ELEMENT||document.createElement("a");return t.ANCHOR_ELEMENT=i,i.href=n,i.href},t.prototype.toNormalizedTarget=function(t){return di(null!=t?t:If.AUTO,If)},t.prototype.copy=function(){var t=this;this.toStringifiedUrl(this.Zh,(function(n){Rf.copy(t.toNormalizedUrl(n))}))},t.prototype.open=function(t){var n=this;this.toStringifiedUrl(this.Zh,(function(i){var r=!0===t||!1===t?t:n.inNewWindow(t);n.check(i,r,(function(){n.exec(i,r)}))}))},t.prototype.check=function(t,n,i){var r=this.qh;if(r){var e=r();!0===e?i():!1===e||e.then((function(t){t&&i()}))}else i()},t.prototype.exec=function(t,n){if(n){var i=document.createElement("a");i.href=t,i.target="_blank",i.style.display="none",i.rel="noopener noreferrer",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),100)}else window.location.href=t},t.prototype.inNewWindow=function(t){switch(this.zn){case If.NEW_WINDOW:return!0;case If.THIS_WINDOW:return!1;case If.AUTO:if(null!=t){var n=t instanceof yf?t.data.originalEvent:t;return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey||"button"in n&&0!==n.button}return!1}},t.prototype.add=function(t,n){var i=this;zi.onClick(t,(function(r,e){i.onClick(t,e)||n(r)}))},t.prototype.onClick=function(t,n){if(this.zn===If.AUTO&&n){var i=this.menu;if(i.enable)return this.Gu&&t.state.isActionable&&i.open(t),!0}return!this.Gu||!t.state.isActionable},t}(),Lf=function(){function t(){}return t.toStateOptions=function(t,n){if(n&&(t===If.NEW_WINDOW||"NEW_WINDOW"===t)){var i=n.state;null==i?n.state=ht.NEW_WINDOW:at(i)?i!==ht.NEW_WINDOW&&(n.state=[i,ht.NEW_WINDOW]):i.indexOf(ht.NEW_WINDOW)<0&&i.push(ht.NEW_WINDOW)}return n},t}(),xf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toLinkOptions=function(t){if(t)return{url:this.toUrl(t.url),target:t.target,checker:this.toChecker(t.checker),menu:t.menu}},n.prototype.toUrl=function(t){var n=this;return at(t)||null==t?t:function(){return t(n)}},n.prototype.toChecker=function(t){var n=this;if(null!=t)return function(){return t(n)}},n.prototype.init=function(n){this.$h=new kf(this.toLinkOptions(n)),t.prototype.init.call(this,Lf.toStateOptions(null==n?void 0:n.target,n))},Object.defineProperty(n.prototype,"link",{get:function(){return this.$h},enumerable:!1,configurable:!0}),n.prototype.initOnClick=function(t){var n=this;this.$h.add(this,(function(t){return n.onSelect(t)}))},n.prototype.getType=function(){return"DMenuItemLink"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n),this.$h.open(n)},n.prototype.open=function(t){this.$h.open(t)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.onSelect(n)},n}(Ef),Bf=function(t){return"url"in t},_f=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t),this.initHover(t)},i.prototype.initHover=function(t){var n=this;this.on(zi.over,(function(){n.state.isActionable&&n.open()}))},i.prototype.toMenu=function(n){var i=null==n?void 0:n.menu;return i instanceof t.DisplayObject?i:this.newMenu(i)},i.prototype.newMenu=function(t){return jf.newMenu(t)},Object.defineProperty(i.prototype,"menu",{get:function(){var t=this,n=this.Jh;return null==n&&((n=this.toMenu(this.Nn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Jh=n),n},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DMenuItemMenu"},i.prototype.open=function(){var t=this.menu;t.isHidden()&&this.onOpen(t)},i.prototype.onOpen=function(t){var n=this.getContext();null!=n&&t.open(this,this.getCloseable(),n)},i.prototype.close=function(){this.menu.close()},i.prototype.toggle=function(){var t=this.menu;t.isHidden()?this.onOpen(t):t.close()},i.prototype.onSelect=function(t){this.open(),n.prototype.onSelect.call(this,t)},i.prototype.onMenuSelect=function(t,n,i){var r=this.getCloseable();null!=r&&r.emit("select",t,n,r)},i.prototype.onKeyDown=function(t){return Kt.isArrowRightKey(t)&&this.onKeyDownArrowRight(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyDownArrowRight=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},i}(Df),Pf=function(t){return"menu"in t},Ff=function(n,i){var r=n.menu;return r instanceof t.DisplayObject||(null==r.sticky&&(r.sticky=i),null==r.align&&(r.align=ke.RIGHT)),n},Uf=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){var r=t.state,e=t.border,u=e.getWidth(r),s=e.getColor(r);if(null!=s){var h=e.getAlpha(r),o=e.getAlign(r),a=t.padding,c=.5*i;this.clear(),this.lineStyle(u,s,h,o),this.moveTo(a.getLeft(),c),this.lineTo(n-a.getRight(),c),this.visible=!0}else this.clear(),this.visible=!1},n}(t.Graphics),Gf=function(t){return"separator"in t},zf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){new Uf(this)},n.prototype.getType=function(){return"DMenuItemSeparator"},n}(Of),Hf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemSpace"},n}(ze),Vf=function(t){return"space"in t},Wf=function(){jf.addItemCreator((function(t){return Sf(t)?new Mf(t):null})),jf.addItemCreator((function(t){return Bf(t)?new xf(t):null})),jf.addItemCreator((function(t,n){return Pf(t)?new _f(Ff(t,n)):null})),jf.addItemCreator((function(t){return Gf(t)?new zf(t):null})),jf.addItemCreator((function(t){return Vf(t)?new Hf(t):null})),jf.setItemCreatorDefault((function(t){return new Ef(t)}))},Xf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableBody"},n}(Xe),Kf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuItemExpandableHeader"},n}(Of),Yf=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return jf.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||jf.newItem(t,n)},t.newItems=function(t,n,i){jf.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),Jf=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i,r=this;n.prototype.init.call(this,t);var e=this.theme,u=this.toHeader(e,t);this.Qh=u,u.on("select",(function(){r.toggle()})),this.addChild(u);var s=this.toBody(e,t);this.no=s;var h=null!==(i=null==t?void 0:t.sticky)&&void 0!==i&&i;this.newItems(s,h,e,t),this.addChild(s),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.newItems=function(t,n,i,r){var e=null==r?void 0:r.items;null!=e&&Yf.newItems(t,e,n)},i.prototype.toHeader=function(n,i){return i?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new Kf(n)},i.prototype.toBody=function(n,i){var r=null==i?void 0:i.body;return r?r instanceof t.DisplayObject?r:this.newBody(n,r):this.newBody(n)},i.prototype.newBody=function(t,n){return new Xf(n)},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.no;t instanceof Ki?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.no;t instanceof Ki?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.onKeyDown=function(t){if(Kt.isArrowRightKey(t))this.state.isActionable&&!this.state.isActive&&(i=this.Qh)instanceof Ki&&i.state.isFocused&&(this.state.isActive=!0);else if(Kt.isArrowLeftKey(t)){var i;if(this.state.isActionable&&this.state.isActive)return(i=this.Qh)instanceof Ki?i.focus():this.focus(),this.state.isActive=!1,n.prototype.onKeyDown.call(this,t),!0}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuItemExpandable"},i}(Xe),Zf=function(t){return"header"in t},qf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemCheck"},n}(Mf),$f=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemLink"},n}(xf),Qf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSeparator"},n}(zf),tl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSpace"},n}(Hf),nl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemText"},n}(Ef),il=function(){jf.addItemCreator((function(t){return Zf(t)?new Jf(t):null})),Yf.addItemCreator((function(t){return Sf(t)?new qf(t):null})),Yf.addItemCreator((function(t){return Bf(t)?new $f(t):null})),Yf.addItemCreator((function(t){return Gf(t)?new Qf(t):null})),Yf.addItemCreator((function(t){return Vf(t)?new tl(t):null})),Yf.setItemCreatorDefault((function(t){return new nl(t)}))},rl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemCheck"},n}(Mf),el=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemLink"},n}(xf),ul=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initHover=function(t){},n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=t.prototype.getSelection.call(this);e&&e.add(i)},n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemMenu"},n}(_f),sl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(zf),hl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSpace"},n}(Hf),ol=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemText"},n}(Ef),al=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return jf.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||jf.newItem(t,n)},t.newItems=function(t,n,i){jf.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),cl=function(){al.setItemCreatorDefault((function(t){return new ol(t)})),al.addItemCreator((function(t){return Vf(t)?new hl(t):null})),al.addItemCreator((function(t){return Gf(t)?new sl(t):null})),al.addItemCreator((function(t,n){return Pf(t)?new ul(Ff(t,n)):null})),al.addItemCreator((function(t){return Bf(t)?new el(t):null})),al.addItemCreator((function(t){return Sf(t)?new rl(t):null}))},fl=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return jf.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||al.newItem(t,n)},t.newItems=function(t,n,i){jf.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),ll=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItems=function(t,n,i,r){null!=r&&null!=r.items&&fl.newItems(t,r.items,n)},n.prototype.getType=function(){return"DMenuSidedItemExpandable"},n}(Jf),vl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemCheck"},n}(qf),bl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemLink"},n}(xf),dl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemMenu"},n}(_f),gl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getType=function(){return"DMenuSidedItemExpandableItemMenu"},n}(dl),ml=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(Qf),wl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemSpace"},n}(tl),pl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemText"},n}(nl),Ol=function(){al.addItemCreator((function(t){return Zf(t)?new ll(t):null})),fl.addItemCreator((function(t){return Sf(t)?new vl(t):null})),fl.addItemCreator((function(t){return Bf(t)?new bl(t):null})),fl.addItemCreator((function(t,n){return Pf(t)?new gl(Ff(t,n)):null})),fl.addItemCreator((function(t){return Gf(t)?new ml(t):null})),fl.addItemCreator((function(t){return Vf(t)?new wl(t):null})),fl.setItemCreatorDefault((function(t){return new pl(t)}))},Dl=function(){Wf(),il(),cl(),Ol()},El=function(){Dl(),wf()},Ml=function(){function t(){}return t.toIndices=function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(t[i].index);return n},t.toDepth=function(t){for(var n=0,i=t.parent;i instanceof Dt;)n+=1,i=i.parent;return n},t.toSharedParent=function(t,n){if(this.toDepth(t)<this.toDepth(n)){for(var i=t.parent;i instanceof Dt;){if(this.isParent(n,i))return i;i=i.parent}return i}for(var r=n.parent;r instanceof Dt;){if(this.isParent(t,r))return r;r=r.parent}return r},t.toOfParent=function(t,n){for(var i=t.parent;i!==n&&i instanceof Dt;)t=i,i=i.parent;return t},t.isParent=function(t,n){for(var i=t.parent;i instanceof Dt;){if(i===n)return!0;i=i.parent}return!1},t.toSelected=function(t){for(var n=t;n instanceof Dt;){if(n.selected)return n;n=n.parent}return null},t.findChildById=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.id===i)return h;if(!0===r){var o=t.findChildById(h,i,r);if(null!=o)return o}}return null},t.findChildByType=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.type===i)return h;if(!0===r){var o=t.findChildByType(h,i,r);if(null!=o)return o}}return null},t.findChild=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(i(h))return h;if(!0===r){var o=t.findChild(h,i,r);if(null!=o)return o}}return null},t.findChildrenByType=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];o.type===i&&e.push(o),!0===r&&t.findChildrenByType(o,i,r,e)}return e},t.findChildren=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];i(o)&&e.push(o),!0===r&&t.findChildren(o,i,r,e)}return e},t.COMPARATOR_INDEX=function(t,n){return t.index-n.index},t}(),Sl=function(){function t(){}return t.delete=function(t,n,i){for(var r=t.children,e=r.length,u=0;u<e;++u)(o=r[u]).selected?o.index=e+u:o.index=u;if(r.sort(Ml.COMPARATOR_INDEX),!0===i){for(u=e-1;0<=u;--u){if(!(o=r[u]).selected){var s=r.length-(u+1);if(0<s){var h=r.splice(u+1,s);return null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h}return null!=n&&(n.length=0),null}o.index-=e,o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(h=r.splice(0,r.length),null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h):(null!=n&&(n.length=0),null)}for(u=e-1;0<=u;--u){var o;if(!(o=r[u]).selected)return r.length=u+1,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),null;o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(r.length=0,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty()):null!=n&&(n.length=0),null},t}(),Tl=function(){function t(){}return t.from=function(t){if(at(t))return U[t];if(Xt(t))return t;if(null!=t){for(var n=U.NONE,i=0,r=t.length;i<r;++i)n|=U[t[i]];return n}return U.NONE},t}(),jl=function(){function t(){this.resources=[],this.resourceToIndex=new Map,this.data=[],this.dataToIndex=new Map,this.pieces=[],this.pieceToIndex=new Map,this.uuids=new Set,this.uuidNext=0}return t.prototype.addResource=function(t){return this.io(t,this.resources,this.resourceToIndex)},t.prototype.addData=function(t){return this.io(t,this.data,this.dataToIndex)},t.prototype.addPiece=function(t){return this.io(t,this.pieces,this.pieceToIndex)},t.prototype.addUuid=function(t){if(0!==t){var n=this.uuids;return n.has(t)?0:(n.add(t),t)}return 0},t.prototype.updateUuid=function(t){var n=this.uuids;if(0!==t)return t;var i=this.newUuid();return n.add(i),i},t.prototype.newUuid=function(){for(var t=this.uuids,n=this.uuidNext;;)if(0!==(n+=1)&&!t.has(n))return this.uuidNext=n,n},t.prototype.io=function(t,n,i){var r=i.get(t);if(null!=r)return r;var e=n.length;return n.push(t),i.set(t,e),e},t}(),Nl=function(t){function n(){var n=t.call(this)||this;return n.ro=!0,n.Gu=!0,n.I=10,n}return _(n,t),Object.defineProperty(n.prototype,"visible",{get:function(){return this.ro},set:function(t){this.ro!==t&&(this.ro=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu!==t&&(this.Gu=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.I},set:function(t){this.I!==t&&(this.I=t,this.emit("change",t,this))},enumerable:!1,configurable:!0}),n.prototype.snap=function(t,n){if(this.Gu){var i=this.I;n.set(t,Math.round(t/i)*i)}},n.prototype.reset=function(){this.Gu=!0,this.I=10,this.emit("change",this)},n.prototype.serialize=function(){return[this.Gu?1:0,this.ro?1:0,this.I]},n.prototype.deserialize=function(t){this.enable=!!t[0],2 in t?(this.visible=!!t[1],this.size=t[2]):(this.visible=!1,this.size=t[1])},n}(t.utils.EventEmitter),Il=function(){function t(){this.distance=NaN,this.result=0,this.threshold=10}return t.prototype.reset=function(t,n){this.distance=NaN,this.result=t,this.threshold=1e-4<n?10/n:10},t.prototype.set=function(t,n){var i=Math.abs(n-t);if(i<=this.threshold){var r=this.distance;(r!=r||i<r)&&(this.distance=i,this.result=n)}},t}(),Cl={HORIZONTAL:0,VERTICAL:1},Al=function(){function t(t,n){this.type=t,this.position=n}return t.prototype.serialize=function(){return[this.type,this.position]},t}(),Rl=function(t){function n(){var n=t.call(this)||this;return n.values=[],n.ro=!0,n.Gu=!0,n}return _(n,t),Object.defineProperty(n.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu!==t&&(this.Gu=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this.ro},set:function(t){this.ro!==t&&(this.ro=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.values.length},enumerable:!1,configurable:!0}),n.prototype.add=function(t,n){null!=n?this.values.splice(n,0,t):this.values.push(t),this.emit("change",this)},n.prototype.remove=function(t){var n=this.values;0<=t&&t<n.length&&(n.splice(t,1),this.emit("change",this))},n.prototype.replace=function(t,n){var i=this.values;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.emit("change",this),r}return null},n.prototype.swap=function(t,n){if(t!==n){var i=this.values,r=i[t];i[t]=i[n],i[n]=r,this.emit("change",this)}},n.prototype.snap=function(t,n,i,r){if(this.Gu)for(var e=this.values,u=0,s=e.length;u<s;++u){var h=e[u];h.type===Cl.VERTICAL?i.set(t,h.position):r.set(n,h.position)}},n.prototype.reset=function(){this.Gu=!0,this.ro=!0,this.values.length=0,this.emit("change",this)},n.prototype.serialize=function(){for(var t=[],n=this.values,i=0,r=n.length;i<r;++i)t.push(n[i].serialize());return[this.Gu?1:0,this.ro?1:0,t]},n.prototype.deserialize=function(t){this.Gu=!!t[0],this.ro=!!t[1];var n=t[2],i=this.values;i.length=0;for(var r=0,e=n.length;r<e;++r){var u=n[r];i.push(new Al(u[0],u[1]))}this.emit("change",this)},n}(t.utils.EventEmitter),yl=1e-5,kl={NONE:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,MIDDLE_LEFT:4,MIDDLE_RIGHT:5,BOTTOM_LEFT:6,BOTTOM_CENTER:7,BOTTOM_RIGHT:8,ROTATION:9},Ll=function(n){function i(i){var r=n.call(this)||this;return r.gt=[new t.Point,new t.Point,new t.Point,new t.Point,new t.Point],r.eo=[new t.Point,new t.Point],r.uo=[1,1],r.so=new t.Point,r.ho=new Il,r.oo=new Il,r.ao={distance:0,scale:new t.Point},r.co=new t.Point,r.fo=new t.Rectangle,r.lo=new t.Point,r.grid=new Nl,r.target=new Rl,r.O=i,r.Gu=!0,r}return _(i,n),Object.defineProperty(i.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu!==t&&(this.Gu=t,this.emit("change",this))},enumerable:!1,configurable:!0}),i.prototype.prepare=function(t){t.updateTransform();var n=t.transform.localTransform,i=t.width,r=t.height,e=this.gt;e[0].set(0,0),e[1].set(i,0),e[2].set(i,r),e[3].set(0,r),e[4].set(.5*i,.5*r),n.apply(e[0],e[0]),n.apply(e[1],e[1]),n.apply(e[2],e[2]),n.apply(e[3],e[3]),n.apply(e[4],e[4])},i.prototype.prepareForTranslate=function(t){this.Gu&&this.prepare(t)},i.prototype.snap=function(t,n){var i=t.x,r=t.y,e=this.O.canvas,u=this.ho,s=this.oo;if(null!=e){var h=Math.max(e.scale.x,e.scale.y);u.reset(i,h),s.reset(r,h),u.set(i,0),u.set(i,e.width),s.set(r,0),s.set(r,e.height)}else u.reset(i,1),s.reset(r,1);return this.target.snap(i,r,u,s),this.grid.snap(i,u),this.grid.snap(r,s),n.x=Gu(u.distance)?NaN:u.result,n.y=Gu(s.distance)?NaN:s.result,n},i.prototype.toSnapped=function(t,n){var i=t.x,r=t.y;if(this.Gu){this.snap(t,n);var e=n.x,u=n.y;n.set(Gu(e)?i:e,Gu(u)?r:u)}else n.set(i,r);return n},i.prototype.toTranslationSnapped=function(t,n){var i=t.x,r=t.y,e=NaN,u=NaN;if(this.Gu)for(var s=this.co,h=this.gt,o=0,a=h.length;o<a;++o){var c=h[o];if(s.set(c.x+i,c.y+r),this.snap(s,s),!Gu(s.x)){var f=s.x-c.x;(Gu(e)||Math.abs(f-i)<Math.abs(e-i))&&(e=f)}if(!Gu(s.y)){var l=s.y-c.y;(Gu(u)||Math.abs(l-r)<Math.abs(u-r))&&(u=l)}}return n.x=Gu(e)?i:e,n.y=Gu(u)?r:u,n},i.prototype.prepareForRotate=function(t){},i.prototype.getGridSizeRotation=function(){return 5},i.prototype.toRadian=function(t){return t/180*Math.PI},i.prototype.toDegree=function(t){return t/Math.PI*180},i.prototype.toRotationSnapped=function(t,n){if(this.Gu){var i=this.getGridSizeRotation(),r=t+n,e=Math.round(this.toDegree(r)),u=e%90;return Math.abs(u)<=i?this.toRadian(e-u)-t:90-i<=u?this.toRadian(e+(90-u))-t:u<=-90+i?this.toRadian(e-(90+u))-t:n}return n},i.prototype.calcNormalizedVector=function(t,n,i){var r=n.x-t.x,e=n.y-t.y,u=Math.sqrt(r*r+e*e);if(yl<u){var s=1/u;i.x=r*s,i.y=e*s}else i.x=1,i.y=0;return u},i.prototype.prepareForScale=function(t,n){if(this.Gu){this.prepare(t);var i=this.gt,r=this.eo,e=this.uo;switch(n){case kl.TOP_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]),e[1]=this.calcNormalizedVector(i[3],i[0],r[1]);break;case kl.TOP_CENTER:e[0]=this.calcNormalizedVector(i[3],i[0],r[0]);break;case kl.TOP_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]),e[1]=this.calcNormalizedVector(i[2],i[1],r[1]);break;case kl.MIDDLE_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]);break;case kl.NONE:break;case kl.MIDDLE_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]);break;case kl.BOTTOM_LEFT:e[0]=this.calcNormalizedVector(i[2],i[3],r[0]),e[1]=this.calcNormalizedVector(i[0],i[3],r[1]);break;case kl.BOTTOM_CENTER:e[0]=this.calcNormalizedVector(i[0],i[3],r[0]);break;case kl.BOTTOM_RIGHT:e[0]=this.calcNormalizedVector(i[3],i[2],r[0]),e[1]=this.calcNormalizedVector(i[1],i[2],r[1])}}},i.prototype.setScaleSnappedResult=function(t,n,i,r,e){if(yl<n&&(Gu(e.distance)||t<e.distance)){e.distance=t;var u=1+i/n;r?e.scale.x=u:e.scale.y=u}},i.prototype.calcScaleSnapped1D=function(t,n,i,r,e,u){var s=this.so;t.apply(n,s);var h=s.x,o=s.y;this.snap(s,s);var a=s.x,c=s.y;if(!Gu(a)){var f=Math.abs(i.x);if(yl<f){var l=(a-h)/i.x,v=Math.abs(l),b=(a-n.x)/i.x;this.setScaleSnappedResult(v,r,b,e,u)}}if(!Gu(c)){var d=Math.abs(i.y);if(yl<d){var g=(c-o)/i.y,m=(v=Math.abs(g),(c-n.y)/i.y);this.setScaleSnappedResult(v,r,m,e,u)}}},i.prototype.calcScaleSnappedX=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!0,e)},i.prototype.calcScaleSnappedY=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!1,e)},i.prototype.calcScaleSnapped2D=function(t,n,i,r,e){var u=this.so;t.apply(n,u);var s=u.x,h=u.y;this.snap(u,u);var o=u.x,a=u.y;if(Gu(o)){if(Gu(a))return;o=s}else Gu(a)&&(a=h);var c=i[0].x*i[1].y-i[1].x*i[0].y;if(yl<Math.abs(c)){var f=o-s,l=a-h,v=Math.abs(f*f+l*l);if(Gu(e.distance)||v<e.distance){e.distance=v;var b=o-n.x,d=a-n.y,g=(+i[1].y*b-i[1].x*d)/c,m=(-i[0].y*b+i[0].x*d)/c;e.scale.set(1+g/r[0],1+m/r[1])}}},i.prototype.calcScaleSnappedXY=function(t,n,i,r,e,u,s){this.calcScaleSnapped2D(t,n,e,u,s),this.calcScaleSnappedX(t,r,e[0],u[0],s),this.calcScaleSnappedY(t,i,e[1],u[1],s)},i.prototype.toScaleSnapped=function(t,n,i,r){if(this.Gu){var e=this.gt,u=this.eo,s=this.uo,h=this.ao;switch(h.distance=NaN,h.scale.set(r.x,r.y),n){case kl.TOP_LEFT:this.calcScaleSnappedXY(t,e[0],e[1],e[3],u,s,h);break;case kl.TOP_CENTER:this.calcScaleSnappedY(t,e[0],u[0],s[0],h),this.calcScaleSnappedY(t,e[1],u[0],s[0],h);break;case kl.TOP_RIGHT:this.calcScaleSnappedXY(t,e[1],e[0],e[2],u,s,h);break;case kl.MIDDLE_LEFT:this.calcScaleSnappedX(t,e[0],u[0],s[0],h),this.calcScaleSnappedX(t,e[3],u[0],s[0],h);break;case kl.NONE:break;case kl.MIDDLE_RIGHT:this.calcScaleSnappedX(t,e[1],u[0],s[0],h),this.calcScaleSnappedX(t,e[2],u[0],s[0],h);break;case kl.BOTTOM_LEFT:this.calcScaleSnappedXY(t,e[3],e[2],e[0],u,s,h);break;case kl.BOTTOM_CENTER:this.calcScaleSnappedY(t,e[2],u[0],s[0],h),this.calcScaleSnappedY(t,e[3],u[0],s[0],h);break;case kl.BOTTOM_RIGHT:this.calcScaleSnappedXY(t,e[2],e[3],e[1],u,s,h)}if(!Gu(h.distance)){if(r.copyFrom(h.scale),i)switch(n){case kl.TOP_LEFT:case kl.TOP_RIGHT:case kl.BOTTOM_LEFT:case kl.BOTTOM_RIGHT:r.x=r.y=Math.max(r.x,r.y);break;case kl.TOP_CENTER:case kl.BOTTOM_CENTER:r.x=r.y;break;case kl.MIDDLE_LEFT:case kl.MIDDLE_RIGHT:r.y=r.x}return!0}}return!1},i.prototype.reset=function(){this.enable=!0,this.target.reset(),this.grid.reset()},i.prototype.serialize=function(){return[this.Gu?1:0,this.target.serialize(),this.grid.serialize()]},i.prototype.deserialize=function(t){this.enable=!!t[0],this.target.deserialize(t[1]),this.grid.deserialize(t[2])},i}(t.utils.EventEmitter),xl=function(t){function n(n,i,r){var e=t.call(this,n,i.width,i.height,0,r)||this;return e.qe=i,e}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.drawImage(this.qe.canvas,n.x,n.y,n.width,n.height)},n}(Fr),Bl=function(n,i,r,e){this.id=n,this.size=i,this.color=t.utils.hex2string(r),this.height=i+2*e;var u=t.TextMetrics.measureFont(n);this.ascent=u.ascent,this.descent=u.descent},_l=function(){function n(n,i,r,e){this.k=n,this.Yi=document.createElement("canvas"),this.vo=null;var u=this.toPadding(i);this.Bn=u,this.Zr=new Bl(n,i,r,u),this.qr={},this.$r=0,this.bo=0,this.Mt=1,this.nn=1,this.do=0,this.mo=0,this._r=t.Texture.from(this.Yi,{mipmap:t.MIPMAP_MODES.OFF,resolution:e,scaleMode:t.SCALE_MODES.NEAREST});var s=this.qr;this.io(" "," ",s,5),this.io("\t"," ",s,5),this.io("...","...",s,11);for(var h=0,o=Vr.length;h<o;++h){var a=Vr[h];this.io(a,a,s,11)}}return n.prototype.toPadding=function(t){return Math.max(3,Math.ceil(.2*t))},Object.defineProperty(n.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"font",{get:function(){return this.Zr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.nn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canvas",{get:function(){return this.Yi},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"characters",{get:function(){return this.qr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){return this._r},enumerable:!1,configurable:!0}),n.prototype.io=function(t,n,i,r){if(!this.isIgnored(n)){var e=i[t];if(null!=e)1&e.type||(0===e.ref&&(this.bo-=1),e.ref+=1);else{var u=this.getAdvance(n),s=this.Bn,h=Math.ceil(s+u+s),o=this.font.height;i[t]=new Xr(n,u,h,o,r),this.$r+=1,this.do+=1}}},n.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},n.prototype.wo=function(t,n){var i=n[t];null!=i&&!(1&i.type)&&0<i.ref&&(i.ref-=1,0===i.ref&&(this.bo+=1))},n.prototype.po=function(){if(this.$r>>1<=this.bo){var t=this.qr;for(var n in t)t[n].ref<=0&&delete t[n];this.$r-=this.bo,this.do+=1,this.bo=0}},n.prototype.add=function(t,n){void 0===n&&(n=8);for(var i=this.qr,r=b.from(t);r.hasNext();){var e=r.next();this.io(e,e,i,n)}},n.prototype.remove=function(t){for(var n=this.qr,i=b.from(t);i.hasNext();)this.wo(i.next(),n)},n.prototype.get=function(t){return this.qr[t]},n.prototype.getAdvance=function(t){var n=this.getContext();return null!=n?n.measureText(t).width:0},n.prototype.getContext=function(){var t=this.vo;if(null==t){var n=this.Yi;if(null==n)return null;if(null==(t=this.vo=n.getContext("2d",{alpha:!0})))return null}var i=this.Zr;return t.font!==i.id&&(t.font=i.id,i.id=t.font,t.textAlign="left",t.textBaseline="alphabetic",t.lineWidth=0,t.lineCap="round",t.lineJoin="miter",t.miterLimit=0,t.fillStyle=i.color,t.strokeStyle="#0000ff"),t},n.prototype.update=function(){if(this.po(),this.mo<this.do){this.mo=this.do;var t=this.Yi;if(null!=t){var n=this.Zr,i=n.height,r=this.qr,e=this.Mt=this.toPowerOf2(Math.ceil(Math.sqrt(this.$r))*i),u=this.Bn,s=Math.round(.5*(i-(n.ascent+n.descent))+n.ascent),h=0,o=0;for(var a in r)e<=h+(g=r[a]).width&&(h=0,o+=i),g.x=h,g.y=o,g.origin.x=h+u,g.origin.y=o+s,h+=g.width;var c=this.nn=o+i,f=this._r.baseTexture,l=f.resolution,v=Math.ceil(e*l),b=Math.ceil(c*l);t.width=v,t.height=b;var d=this.getContext();if(null!=d){for(var a in d.save(),d.scale(l,l),d.clearRect(0,0,e,c),r){var g=r[a];d.fillText(a,g.origin.x,g.origin.y)}d.restore()}return f.setRealSize(v,b),!0}}return!1},n.prototype.getRevision=function(){return this.do},n.prototype.getRevisionUpdate=function(){return this.mo},Object.defineProperty(n.prototype,"length",{get:function(){return this.$r},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){null!=this.Yi&&(this.Yi=null);var t=this.qr;for(var n in t)delete t[n]},n.prototype.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},n}(),Pl=function(t){t.update()},Fl=function(t){t.forEach(Pl)},Ul=function(t){t.update()},Gl=function(t){t.forEach(Ul)},zl=function(){function t(t){var n=this;this.Qr=new Map,this.sn=t.renderer.resolution,t.renderer.on("prerender",(function(){n.update()}))}return t.prototype.add=function(t,n,i,r){var e=this.Qr,u=e.get(t);null==u&&(u=new Map,e.set(t,u));var s=u.get(i);null==s&&(s=new _l(t,n,i,this.sn),u.set(i,s)),s.add(r)},t.prototype.remove=function(t,n,i){var r=this.Qr.get(t);if(null!=r){var e=r.get(n);null!=e&&e.remove(i)}},t.prototype.get=function(t,n){var i=this.Qr.get(t);if(null==i)return null;var r=i.get(n);return null==r?null:r},t.prototype.update=function(){this.Qr.forEach(Fl)},t.prototype.destroy=function(){var t=this.Qr;t.forEach(Gl),t.clear()},t}(),Hl=function(){function t(t,n,i){var r=this;this.instance=null,this.newInstance=t,this.options=n,null!=i&&(i.state.isActive&&setTimeout((function(){r.get()}),0),i.on("active",(function(){r.get()})))}return t.prototype.get=function(){var t=this.instance;return null==t&&(t=new this.newInstance(this.options),this.instance=t),t},t}(),Vl=function(t,n,i,r){for(var e=0,u=Math.floor(t.length/i)-1;e<=u;){var s=e+(u-e>>1),h=t[s*i+r];if(n<h)u=s-1;else{if(!(h<n))return s;e=s+1}}return Math.max(e,u)},Wl=function(t){if(null!=t){if(at(t))return t;if(Xt(t))return String(t);if("name"in t)return t.name;if("label"in t)return t.label;if("id"in t)return t.id}return""},Xl=function(){function n(t,n,i){this.Mt=t,this.Oo=n,this.Re=i,this.Do={},this.Eo="",this.Mo=0,this.So=0,this.nn=0}return Object.defineProperty(n.prototype,"width",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ratio",{get:function(){return this.Oo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Re},enumerable:!1,configurable:!0}),n.prototype.add=function(n,i,r,e){var u=this.Do;if(!(n in u)){var s=this.Re,h=this.Mo,o=this.So;this.Mt<=h+i?(h=0,o=this.So+this.nn+s,this.nn=r,this.So=o):this.nn=Math.max(this.nn,r),this.Mo=h+i+s,u[n]=new t.Rectangle(h,o,i,r);var a=this.Oo;return this.Eo+='<g transform="translate('+h*a+","+o*a+')">'+e+"</g>",!0}return!1},n.prototype.has=function(t){return t in this.Do},Object.defineProperty(n.prototype,"mappings",{get:function(){return this.build()},enumerable:!1,configurable:!0}),n.prototype.build=function(n){var i,r,e,u=this.To;if(null==u||(null==n?void 0:n.force)){var s=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1,h=this.Mt,o=Math.pow(2,Math.ceil(Math.log(this.So+this.nn)/Math.LN2)),a=h*s,c=o*s,f=this.Oo,l=gt('<svg width="'+a+'" height="'+c+'" viewBox="0 0 '+h*f+" "+o*f+'" xmlns="http://www.w3.org/2000/svg">'+this.Eo+"</svg>"),v=null!==(e=null==n?void 0:n.scaling)&&void 0!==e?e:t.SCALE_MODES.NEAREST,b=t.BaseTexture.from(l,{resolution:s,scaleMode:v}),d=this.Do;for(var g in u=this.To={},d)u[g]=new t.Texture(b,d[g])}return u},n}(),Kl=function(){function n(){}return n.toTexture=function(n,i,r,e){var u=n.transform.scale,s=t.RenderTexture.create({width:n.width*u.x,height:n.height*u.y,scaleMode:t.SCALE_MODES.LINEAR,resolution:i}),h=new t.Matrix(void 0,void 0,void 0,void 0,-n.position.x,-n.position.y),o=rt.getLayer(n);return o&&o.renderer.render(n,s,r,h,e),s},n.toPixels=function(t,n){var i=t.resolution,r=t.frame,e=Math.floor(r.width*i),u=Math.floor(r.height*i),s=new Uint8Array(4*e*u);n.renderTexture.bind(t);var h=n.gl;return h.readPixels(r.x*i,r.y*i,e,u,h.RGBA,h.UNSIGNED_BYTE,s),{width:e,height:u,array:s}},n.toCanvas=function(n,i,r){var e=n.width,u=n.height,s=n.array,h=new t.utils.CanvasRenderTarget(e,u,1),o=h.context.getImageData(0,0,e,u);if(r?o.data.set(s):t.Extract.arrayPostDivide(s,o.data),h.context.putImageData(o,0,0),null!=i&&1!==i){h.context.scale(i,i),h.context.drawImage(h.canvas,0,0);var a=Math.floor(e*i),c=Math.floor(u*i),f=h.context.getImageData(0,0,a,c);h.resize(a,c),h.context.putImageData(f,0,0)}return h},n.toBase64=function(t,n,i){return t.toDataURL(n,i)},n}(),Yl=function(){function t(){}return t.downloadUrl=function(t,n){var i=document.createElement("a");"download"in i?(i.href=n,i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),66)):window.open(n)||(location.href=n)},t.download=function(t,n,i){var r=new Blob(!1!==i?["\ufeff",n]:[n],{type:"text/plain"}),e=window.navigator;"msSaveBlob"in e?e.msSaveBlob(r,t):this.downloadUrl(t,URL.createObjectURL(r))},t}(),Jl=function(){function t(){}return t.texture=function(t){var n,i=t.target,r=function(t){var n,i=t.target,r=t.resolution;if(null!=r){if(Xt(r))return r;var e=i.transform.scale,u=Math.max(i.width*e.x,i.height*e.y);return Math.min(1,r.size/u)}return null!==(n=window.devicePixelRatio)&&void 0!==n?n:1}(t),e=null===(n=t.transform)||void 0===n?void 0:n.update;return Kl.toTexture(i,r,t.clear,e)},t.pixels=function(t){var n=function(t){var n=t.renderer;if(n)return n;var i=t.application;if(i)return i.getLayerBase().renderer;var r=t.layer||rt.getLayer(t.target);if(r)return r.renderer;throw new Error("No renderer / application / layer found.")}(t),i=this.texture(t);try{return Kl.toPixels(i,n)}finally{i&&i.destroy()}},t.canvas=function(t){var n,i,r=this.pixels(t),e=null===(i=null===(n=t.alpha)||void 0===n?void 0:n.premultiplied)||void 0===i?void 0:i.ignore,u=function(t,n){var i=n.scale;if(null!=i){if(Xt(i))return i;var r=i.size;return Math.min(1,r/t.width,r/t.height)}}(r,t);return Kl.toCanvas(r,u,e)},t.base64=function(t){var n=this.canvas(t);try{return Kl.toBase64(n.canvas,t.format,t.quality)}finally{n&&n.destroy()}},t.file=function(t){Yl.downloadUrl(t.filename,this.base64(t))},t}(),Zl={TEXT:0,DATA_URL:1,BINARY_STRING:2,ARRAY_BUTTER:3,FILE:4},ql=function(){function t(t,n){this._u=null,this.jo=t,this.No=n}return t.prototype.open=function(){var t=this.getOrCreateInput();null!=t?t.click():this.onCancel()},t.prototype.getOrCreateInput=function(){var t=this;if("FileReader"in window&&null==this._u){var n=document.createElement("input");this._u=n,n.setAttribute("type","file"),n.setAttribute("style","display:none"),n.addEventListener("change",(function(i){t.onInputChange(n),n.value="",i.stopImmediatePropagation(),i.preventDefault()})),document.body.appendChild(n)}return this._u},t.prototype.onInputChange=function(t){var n=this,i=t.files;if(null!=i&&0<i.length){var r=i[0];if(this.jo===Zl.FILE)this.onOpen(r,r);else{var e=new FileReader;switch(e.onload=function(t){if(null!=t.target){var i=t.target;n.onOpen(i.result,r)}},e.onabort=function(t){n.onAboart(t)},this.jo){case Zl.TEXT:e.readAsText(r);break;case Zl.DATA_URL:e.readAsDataURL(r);break;case Zl.BINARY_STRING:e.readAsBinaryString(r);break;case Zl.ARRAY_BUTTER:e.readAsArrayBuffer(r);break;default:e.readAsText(r)}}}else this.onCancel()},t.prototype.onOpen=function(t,n){var i=this.No;i.emit("open",t,n,i)},t.prototype.onAboart=function(t){var n=this.No;n.emit("abort",t,n)},t.prototype.onCancel=function(){var t=this.No;t.emit("cancel",t)},t}(),$l=function(){function t(){}return t.fromRgb=function(t){var n=(16711680&t)>>16,i=(65280&t)>>8,r=255&t|0,e=Math.max(n,i,r),u=e-Math.min(n,i,r),s=0;return 0<u&&(n===e?s=60*(i-r)/u:i===e?s=60*(r-n)/u+120:r===e&&(s=60*(n-i)/u+240),s<0&&(s+=360)),[s,u/e*255,e]},t.toRgb=function(t,n,i){var r=i-n/255*i,e=i-r,u=0,s=0,h=0;return t<=60?(u=i,s=t/60*e+r,h=r):t<=120?(u=(120-t)/60*e+r,s=i,h=r):t<=180?(u=r,s=i,h=(t-120)/60*e+r):t<=240?(u=r,s=(240-t)/60*e+r,h=i):t<=300?(u=(t-240)/60*e+r,s=r,h=i):(u=i,s=r,h=(360-t)/60*e+r),(u=Math.max(0,Math.min(255,u)))<<16|(s=Math.max(0,Math.min(255,s)))<<8|Math.max(0,Math.min(255,h))},t}(),Ql=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.mr),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.mr),t.prototype.onElementDetached.call(this,n,i,r)},n.prototype.onInputKeyDown=function(t){Kt.isOkKey(t)&&this.qi.onEnter()},n}(wr),tv=function(){function t(){}return t.create=function(t){var n=this.Io;return t in n?t+" "+ ++n[t]:(n[t]=1,t+" 1")},t.Io={},t}(),nv=function(){function t(){}return t.toCode=function(t,n){return"rgba("+(t>>16&255)+","+(t>>8&255)+","+(255&t)+","+n+")"},t}(),iv=function(){function t(t,n,i){var r=this;this.On=!0,this.Co=new Set,this.Et=t,this.Ao=n,this.Ro=i,this.yo=null;var e=function(){r.advance(),r.update(),r.yo=window.setTimeout(e,i)};this.ko=e}return t.prototype.start=function(){return null==this.yo&&(this.yo=window.setTimeout(this.ko,this.Ao)),this},t.prototype.stop=function(){var t=this.yo;return null!=t&&(this.yo=null,clearTimeout(t)),this},t.prototype.add=function(t){return this.Co.add(t),t.state.set(this.Et,this.isOn()),this},t.prototype.remove=function(t){return!!this.Co.delete(t)&&(t.state.remove(this.Et),!0)},t.prototype.contains=function(t){return this.Co.has(t)},t.prototype.clear=function(){return this.Co.clear(),this},t.prototype.isOn=function(){return this.On},t.prototype.isOff=function(){return!this.On},t.prototype.advance=function(){return this.On=!this.On,this},t.prototype.update=function(){var t=this.isOn(),n=this.Et;return this.Co.forEach((function(i){i.state.set(n,t)})),this},t}(),rv=function(){function t(t){var n;this.Vn=null!==(n=null==t?void 0:t.duration)&&void 0!==n?n:300,this.fe=null,this.Lo=0,this.xo=null}return t.prototype.show=function(t,n){var i=this,r=this.xo;null!=r&&clearTimeout(r);var e=this.fe;if(t!==e){var u=this.Vn,s=this.Lo,h=Date.now(),o=s+u-h;!0===n||o<=0?this.update(h,t):this.xo=window.setTimeout((function(){i.update(Date.now(),t)}),o)}},t.prototype.update=function(t,n){var i=this.fe;i!==n&&(this.Lo=t,null!=i&&i.hide(),this.fe=n,null!=n&&n.show())},t.prototype.hide=function(){this.show(null)},t}(),ev=function(){function t(){this.Bo=null,this._o=0,this.Ve=null,this.Po=null}return t.prototype.getNames=function(){var t=this.Fo;return null==t&&(t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DOMMouseScroll","MozMousePixelScroll"],this.Fo=t),t},t.prototype.on=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.addEventListener(u,n,i)}},t.prototype.off=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.removeEventListener(u,n,i)}},t.prototype.getLineHeight=function(){if(null==this.Ve){var t=K.getInstance().get("DBase");this.Ve=t.getLineHeight()}return this.Ve},t.prototype.getPageHeight=function(){return null==this.Po&&(this.Po=12*this.getLineHeight()),this.Po},t.prototype.normalize=function(t){var n=0,i=0;if("detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(n=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(n=-1*i,i=0),"deltaY"in t&&(i=-1*t.deltaY),"deltaX"in t&&(n=t.deltaX),0===i&&0===n)return null;var r=Math.max(Math.abs(i),Math.abs(n)),e=Date.now();this._o+200<=e&&(this.Bo=null),this._o=e;var u="mousewheel"===t.type&&r%120==0;(!this.Bo||r<this.Bo)&&(this.Bo=r,u&&(this.Bo/=40)),u&&(r/=40,n/=40,i/=40);var s=this.Bo;r=Math.floor(r/s),n=Math[1<=n?"floor":"ceil"](n/s),i=Math[1<=i?"floor":"ceil"](i/s);var h=t.deltaMode||0;if(0!==h){var o=1===h?this.getLineHeight():this.getPageHeight();r*=o,n*=o,i*=o}return{mode:h,delta:r,deltaX:n,deltaY:i,lowest:s}},t.getInstance=function(){return null==this.INSTANCE&&(this.INSTANCE=new t),this.INSTANCE},t}(),uv=function(t){function n(n){var i,r=t.call(this)||this;return r.zn=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,r.Xn=!1,r.rr=!1,r.Kn=null==n?void 0:n.onTime,r.Jn=null==n?void 0:n.onStart,r.Zn=null==n?void 0:n.onEnd,r}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.zn},set:function(t){this.zn=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.rr=!0,this.Xn=t,this.onStart(t),this.rr&&(this.onTime(t?1:0,t,0),this.rr&&(this.onTime(t?0:1,t,0),this.rr||this.onEnd(t)))},n.prototype.onStart=function(t){var n=this.Jn;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.Kn;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.Zn;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return this.rr},n.prototype.isReverse=function(){return this.Xn},n.prototype.stop=function(){this.rr=!1},n.prototype.end=function(){if(this.rr){this.rr=!1;var t=this.Xn,n=t?0:1;this.onTime(n,t,0),this.onEnd(t)}},n}(t.utils.EventEmitter),sv=function(){function t(t){var n,i,r,e;Xt(t)?(this.top=t,this.right=t,this.bottom=t,this.left=t):null!=t?(this.top=null!==(n=t.top)&&void 0!==n?n:6,this.right=null!==(i=t.right)&&void 0!==i?i:6,this.bottom=null!==(r=t.bottom)&&void 0!==r?r:6,this.left=null!==(e=t.left)&&void 0!==e?e:6):(this.top=6,this.right=6,this.bottom=6,this.left=6)}return t.prototype.getTheme=function(){throw new Error("Not supported")},t.prototype.setTheme=function(t){throw new Error("Not supported")},t.prototype.getTop=function(){return this.left},t.prototype.getRight=function(){return this.right},t.prototype.getBottom=function(){return this.bottom},t.prototype.getLeft=function(){return this.left},t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r)},t}(),hv=function(){function t(t){var n,i=t.root;this.Uo=i,this.Tu=t.overlay,this.Bn=new sv(null==t?void 0:t.padding);var r=100,e=100;if(t)if(null!=t.width)r=t.width,e=null!=t.height?t.height:i.getBoundingClientRect().height;else if(null!=t.height)r=i.getBoundingClientRect().width,e=t.height;else{var u;r=(u=i.getBoundingClientRect()).width,e=u.height}else r=(u=i.getBoundingClientRect()).width,e=u.height;var s=null==t?void 0:t.background,h=0,o=!0;if(null!=s){var a=s.color;null!=a&&(h=a,o=!1)}var c=t.resolution,f=null!==(n=null==t?void 0:t.antialias)&&void 0!==n&&n;this.Go={width:r,height:e,autoStart:!1,backgroundColor:h,transparent:o,resolution:c,antialias:f}}return t.prototype.getRootElement=function(){return this.Uo},t.prototype.setRootElement=function(t,n){if(this.Uo!==t&&(this.Uo=t,!1!==n)){var i=t.getBoundingClientRect(),r=this.Go;r.width=i.width,r.height=i.height}return this},t.prototype.getWidth=function(){return this.Go.width},t.prototype.setWidth=function(t){return this.Go.width=t,this},t.prototype.getHeight=function(){return this.Go.height},t.prototype.setHeight=function(t){return this.Go.height=t,this},t.prototype.getPadding=function(){return this.Bn},t.prototype.setPadding=function(t,n,i,r){var e=this.Bn;return e.left=t,e.top=n,e.right=i,e.bottom=r,this},t.prototype.getBackgroundColor=function(){return this.Go.backgroundColor},t.prototype.setBackgroundColor=function(t){return this.Go.backgroundColor=t,this},t.prototype.getAntialias=function(){return this.Go.antialias},t.prototype.setAntialias=function(t){return this.Go.antialias=t,this},t.prototype.isOverlay=function(){return this.Tu},t.prototype.getPixiApplicationOptions=function(){return this.Go},t}(),ov={NONE:0,UNSTORABLE:1,CLEAR:2},av=function(){function t(){}return t.prototype.execute=function(){return!0},t.prototype.redo=function(){throw new Error("Method not implemented.")},t.prototype.undo=function(){throw new Error("Method not implemented.")},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE|ov.CLEAR},t}(),cv=function(){function t(){}return t.prototype.execute=function(){throw new Error("Not supported")},t.prototype.redo=function(){throw new Error("Not supported")},t.prototype.undo=function(){throw new Error("Not supported")},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE},t}(),fv=function(){function t(){}return t.prototype.execute=function(){throw new Error("Not supported")},t.prototype.redo=function(){throw new Error("Not supported")},t.prototype.undo=function(){throw new Error("Not supported")},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE},t}(),lv=function(t){return!(t.getFlag()&ov.UNSTORABLE)},vv=function(t){function n(){var n=t.call(this)||this;return n.P=0,n.zo=[],n.Ho=[],n.Vo=null,n}return _(n,t),n.prototype.last=function(){var t=this.zo,n=this.Ho;return n.length<=0?0<t.length?t[t.length-1]:null:n[n.length-1]},n.prototype.push=function(t){this.Ho.push(t),this.next()},n.prototype.next=function(){var t=this;if(null==this.Vo){var n=this.Ho;if(0<n.length){var i=n.shift();if(null!=i)if(i instanceof fv){var r=this.zo;if(this.P<r.length){var e=r[r.length-1-this.P];this.P+=1,this.emit("change",this),!0===(u=e.undo())?this.onSuccess(i):!1===u?this.onFail(i):this.Vo=u.then((function(){t.onSuccess(i)}),(function(){t.onFail(i)}))}}else if(i instanceof cv)r=this.zo,0<this.P&&(e=r[r.length-this.P],this.P-=1,this.emit("change",this),!0===(u=e.redo())?this.onSuccess(i):!1===u?this.onFail(i):this.Vo=u.then((function(){t.onSuccess(i)}),(function(){t.onFail(i)})));else{var u,s=!!(i.getFlag()&ov.CLEAR),h=lv(i);if(s||h){var o=s?this.zo.length:this.P;0<o&&(this.remove(o),this.P=0,this.emit("change",this)),this.cleanup()}!0===(u=i.execute())?this.onSuccess(i):!1===u?this.onFail(i):this.Vo=u.then((function(){t.onSuccess(i)}),(function(){t.onFail(i)}))}}}},n.prototype.cleanup=function(){var t=this.zo,n=t.length-100;if(0<n)for(var i=0;i<n;++i)t[i].destroy(),t.shift()},n.prototype.remove=function(t){var n=this.zo;if(0<t){var i=Math.max(0,n.length-t);if(0<(t=n.length-i)){for(var r=i,e=n.length;r<e;++r)n[r].destroy();return n.splice(i,n.length-i),!0}}return!1},n.prototype.onSuccess=function(t){this.Vo=null,lv(t)?(this.zo.push(t),this.emit("dirty",this)):(t instanceof fv||t instanceof cv)&&this.emit("dirty",this),this.emit("change",this),this.next()},n.prototype.onFail=function(t){this.Vo=null;var n=this.Ho;t.destroy();for(var i=0,r=n.length;i<r;++i)n[i].destroy();n.length=0,this.emit("change",this)},n.prototype.size=function(){return this.zo.length},n.prototype.clear=function(){this.push(new av)},n.prototype.redo=function(){this.isRedoable()&&(this.Ho.push(new cv),this.next())},n.prototype.undo=function(){this.isUndoable()&&(this.Ho.push(new fv),this.next())},n.prototype.isRedoable=function(){return 0<this.P&&null==this.Vo},n.prototype.isUndoable=function(){return this.P<this.zo.length&&null==this.Vo},n}(t.utils.EventEmitter),bv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t,n,i){var r=this;t.addEventListener("keydown",(function(t){r.emit("keydown",t);var e=i.get();if(null!=e)for(var u=e;null!=u;){if(r.hasOnKeyDown(u)&&u.onKeyDown(t))return;u=u.parent}if(Kt.isFocusKey(t)){var s=Kt.getFocusDirection(t),h=null!=e?i.find(e,!1,e.state.isFocusRoot||s,s):i.find(n,!1,!0,s);null!=h&&(i.focus(h),t.preventDefault(),t.stopImmediatePropagation())}})),t.addEventListener("keyup",(function(t){r.emit("keyup",t);var n=i.get();if(null!=n)for(var e=n;null!=e;){if(r.hasOnKeyUp(e)&&e.onKeyUp(t))return;e=e.parent}}))},n.prototype.hasOnKeyDown=function(t){return"onKeyDown"in t},n.prototype.hasOnKeyUp=function(t){return"onKeyUp"in t},n}(t.utils.EventEmitter),dv=function(){function t(){}return t.getKeyboardController=function(){return null==this.KEYBOARD&&(this.KEYBOARD=new bv),this.KEYBOARD},t.setKeyboardController=function(t){var n=this.KEYBOARD;return this.KEYBOARD=t,n},t.getCommandController=function(){return null==this.COMMAND&&(this.COMMAND=new vv),this.COMMAND},t.setCommandController=function(t){var n=this.COMMAND;return this.COMMAND=t,n},t.getDocumentController=function(){if(null==this.DOCUMENT)throw new Error("Not supported");return this.DOCUMENT},t.setDocumentController=function(t){var n=this.DOCUMENT;return this.DOCUMENT=t,n},t}(),gv=function(n){function i(t,i){var r=n.call(this,i.getPixiApplicationOptions())||this;return r.Wo=null,r.Xo=null,r.Nn=i,r.$=!1,r.ro=!0,r.Ko=i.isOverlay(),r.Bn=i.getPadding(),r.Yo=i.getRootElement(),r.Jo=5,r.Zo=5,r.qo=r.newElementContainer(),r.application=t,r.$o=function(){null!=r.Wo&&r.render()},r.initStage(),r.initView(),r.initRootElement(),r.initFocusHandling(),r.initResizeHandling(),r.initWheelHandling(),r.initDoubleClickHandling(),r}return _(i,n),i.prototype.newElementContainer=function(){var t=document.createElement("div");return t.setAttribute("style","position: absolute; top: 0; left: 0; width: 0; height: 0;margin: 0; padding: 0; outline: none;"),t},i.prototype.initStage=function(){var t=this.stage;t.layer=this,t.application=this.application,t.interactive=!0},i.prototype.initView=function(){var t=this.view.style;t.position="absolute",t.top="0",t.left="0",t.width="100%",t.height="100%",t.display="block",t.outline="none",t.webkitTapHighlightColor="rgba(255,255,255,0)",t.webkitUserSelect="none",t.setProperty("-khtml-user-select","none"),t.setProperty("-moz-user-select","none"),t.setProperty("-ms-user-select","none"),t.userSelect="none"},i.prototype.initRootElement=function(){var t=this,n=this.view,i=this.Ko,r=this.Yo,e=this.qo,u=i?2:0,s=r.children;if(u<s.length){var h=s[u];r.insertBefore(n,h),r.insertBefore(e,h)}else r.appendChild(n),r.appendChild(e);if(i){var o=this.stage,a=o.onChildrenChange;o.onChildrenChange=function(){t.onStageDirty(),a.call(o)}}var c=r.style;r!==document.body&&"static"===window.getComputedStyle(r).position&&(c.position="relative"),c.margin="0",c.padding="0",c.overflow="hidden"},i.prototype.initFocusHandling=function(){var t=this.view,n=this.stage,i=this.getFocusController();t.setAttribute("tabindex","0"),dv.getKeyboardController().init(t,n,i),this.renderer.plugins.interaction.on(zi.down,(function(t){null!=t.target&&t.target!==n||i.clear()}))},i.prototype.initResizeHandling=function(){var t=this,n=function(){t.onResize()};window.addEventListener("resize",n),window.addEventListener("orientationchange",n)},i.prototype.onResize=function(){var t=this.Yo.getBoundingClientRect(),n=t.width,i=t.height;this.renderer.resize(n,i);for(var r=this.Bn,e=this.stage.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof Ki&&h.onParentResize(n,i,r)}this.update()},i.prototype.initWheelHandling=function(){var n=new t.Point,i=ev.getInstance(),r=this.renderer.plugins.interaction;i.on(this.view,(function(t){var e=t;zi.toGlobal(e,r,n);var u,s=r.hitTest(n),h=i.normalize(t);if(null!=h)for(;null!=s;){if(null!=(u=s)&&null!=u.onWheel&&s.onWheel(e,h,n)){e.preventDefault();break}s=s.parent}}))},i.prototype.initDoubleClickHandling=function(){var t=this.getFocusController(),n=this.renderer.plugins.interaction;zi.onDblClick(this.view,(function(i){var r,e=t.get();if(null!=e)for(var u=e;null!=u&&(null==(r=u)||null==r.onDblClick||!u.onDblClick(i,n));)u=u.parent}))},i.prototype.lock=function(){this.$=!0},i.prototype.unlock=function(){this.$=!1},i.prototype.update=function(){this.$||null!=this.Wo||(this.Wo=requestAnimationFrame(this.$o))},i.prototype.onStageDirty=function(){this.Ko&&(0<this.stage.children.length?this.ro||(this.ro=!0,this.view.style.display="block"):this.ro&&(this.ro=!1,this.view.style.display="none"))},i.prototype.render=function(){this.refit(),this.reflow(),this.Wo=null,n.prototype.render.call(this)},Object.defineProperty(i.prototype,"width",{get:function(){return this.screen.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.screen.height},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Bn},enumerable:!1,configurable:!0}),i.prototype.refit=function(){for(var t=this.stage.children,n=0,i=this.Jo;n<i;++n){for(var r=!1,e=0,u=t.length;e<u;++e){var s=t[e];s instanceof Ki&&(s.refit(),r=r||s.isChildrenDirty())}if(!r)break}},i.prototype.reflow=function(){for(var t=this.stage.children,n=0,i=this.Jo;n<i;++n){for(var r=!1,e=0,u=t.length;e<u;++e){var s=t[e];s instanceof Ki&&(s.reflow(),r=r||s.isDirty()||s.hasDirty())}if(!r)break}},i.prototype.getFocusController=function(){return this.application.getFocusController()},i.prototype.getRootElement=function(){return this.Yo},i.prototype.getElementContainer=function(){return this.qo},i.prototype.getDynamicFontAtlases=function(){return null==this.Xo&&(this.Xo=new zl(this)),this.Xo},i}(t.Application),mv=function(){function t(){this.ju=null}return t.prototype.focus=function(t){var n=this.ju;return n!==t?(null!=n&&(n.state.isFocused=!1),this.ju=t,this.isFocusable(t)&&(t.state.isFocused=!0),n):null},t.prototype.blur=function(t){return null!=t&&this.ju===t?(this.ju=null,t.state.isFocused=!1,t):null},t.prototype.clear=function(){return this.focus(null)},t.prototype.set=function(t,n){return n?this.focus(t):this.blur(t)},t.prototype.get=function(){return this.ju},t.prototype.findParent=function(t){for(var n=t;null!=n;){if(this.isFocusable(n))return n;n=n.parent}return null},t.prototype.find=function(t,n,i,r,e){if(r){if(null!=(o=this.findNext(t,n,i)))return o;if(this.isFocusRoot(t,e))return null;var u=t.parent;if(null!=u&&0<=(c=(a=u.children).indexOf(t))){var s=a.length;if(this.isFocusReverse(u)){for(var h=c-1;0<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=s-1;c<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}else{for(h=c+1;h<s;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}}}else{var o;if(null!=(o=this.findPrevious(t,n,i)))return o;var a,c,f=t.parent;if(null!=f&&0<=(c=(a=f.children).indexOf(t)))if(s=a.length,this.isFocusReverse(f)){for(h=c+1;h<s;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}else{for(h=c-1;0<=h;--h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=s-1;c<=h;--h){var l;if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}}}return null},t.prototype.findNext=function(t,n,i){if(n&&this.isFocusable(t))return t;if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=e-1;0<=u;--u)if(null!=(s=this.findNext(r[u],!0,!0)))return s}else for(u=0;u<e;++u){var s;if(null!=(s=this.findNext(r[u],!0,!0)))return s}}return null},t.prototype.findPrevious=function(t,n,i){if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=0;u<e;++u)if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}else for(u=e-1;0<=u;--u){var s;if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}}return n&&this.isFocusable(t)?t:null},t.prototype.isFocusable=function(t){return null!=t&&"state"in t&&t.state.inEnabled&&t.state.isFocusable&&t.visible},t.prototype.isFocusableContainer=function(t){return null!=t&&"children"in t},t.prototype.isFocusRoot=function(t,n){return t===n||null!=t&&"state"in t&&t.state.isFocusRoot&&t.visible},t.prototype.isFocusReverse=function(t){return null!=t&&"state"in t&&t.state.isFocusReverse},t}(),wv=function(){function n(n){var i,r;rt.add(this);var e=this.toRootElement(n);this.Uo=e,this.initFocusHandling(e);var u=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1;this.sn=u,delete t.Renderer.__plugins.accessibility,this.Nn=n;var s=this.newLayerBase(n);this.Rh=s,this.Qo=!!(null==n?void 0:n.overlay),this.Qo||(this.Tu=s)}return Object.defineProperty(n.prototype,"stage",{get:function(){return this.Rh.stage},enumerable:!1,configurable:!0}),n.prototype.getRootElement=function(){return this.Uo},n.prototype.getResolution=function(){return this.sn},n.prototype.toRootElement=function(t){var n=null==t?void 0:t.root;if(null!=n){if(!at(n))return n;var i=document.querySelector(n);if(i)return i}return document.body},n.prototype.toLayerBaseOptions=function(t){var n=this.Uo,i=this.sn;return new hv(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:t.background,resolution:i,antialias:t.antialias,overlay:!1}:{root:n,resolution:i,overlay:!1})},n.prototype.getFocusController=function(){return null==this.ta&&(this.ta=new mv),this.ta},n.prototype.initFocusHandling=function(t){var n=this,i=!1,r=function(){i||n.getFocusController().clear()};t.addEventListener("focus",(function(){i=!0}),!0),t.addEventListener("blur",(function(){i=!1,setTimeout(r,0)}),!0)},n.prototype.newLayerBase=function(t){return new gv(this,this.toLayerBaseOptions(t))},n.prototype.getLayerBase=function(){return this.Rh},n.prototype.toLayerOverlayOptions=function(t){var n=this.Uo,i=this.sn;return new hv(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:{color:null},resolution:i,antialias:t.antialias,overlay:!0}:{root:n,resolution:i,overlay:!0})},n.prototype.newLayerOverlay=function(t){return new gv(this,this.toLayerOverlayOptions(t))},n.prototype.getLayerOverlay=function(){return this.Qo?(null==this.Tu&&(this.Tu=this.newLayerOverlay(this.Nn)),this.Tu):this.Rh},n.prototype.update=function(){if(!this.Qo)return this.Rh.update();this.Rh.update();var t=this.Tu;t&&t.update()},n.prototype.render=function(){if(!this.Qo)return this.Rh.render();this.Rh.render();var t=this.Tu;t&&t.render()},n}(),pv=function(){function t(t){this.zn=t,this.qt=0,this.$t=0,this.Qt=0,this.Zt=0,t instanceof Di&&(this.Kt=t.getCallback())}return t.prototype.getTheme=function(){return this.zn.getTheme()},t.prototype.setTheme=function(t){this.zn.setTheme(t)},t.prototype.getLeft=function(){return this.zn.getLeft()+this.Zt},t.prototype.adjLeft=function(t){if(this.Zt!==t){this.Zt=t;var n=this.Kt;n&&n()}},Object.defineProperty(t.prototype,"left",{get:function(){return this.zn.left},set:function(t){this.zn.left=t},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){return this.zn.getTop()+this.qt},t.prototype.adjTop=function(t){if(this.qt!==t){this.qt=t;var n=this.Kt;n&&n()}},Object.defineProperty(t.prototype,"top",{get:function(){return this.zn.top},set:function(t){this.zn.top=t},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){return this.zn.getRight()+this.$t},t.prototype.adjRight=function(t){if(this.$t!==t){this.$t=t;var n=this.Kt;n&&n()}},Object.defineProperty(t.prototype,"right",{get:function(){return this.zn.right},set:function(t){this.zn.right=t},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){return this.zn.getBottom()+this.Qt},t.prototype.adjBottom=function(t){if(this.Qt!==t){this.Qt=t;var n=this.Kt;n&&n()}},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.zn.bottom},set:function(t){this.zn.bottom=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){var e=this.zn;null==n?e.set(t):null==i?e.set(t,n):null==r?e.set(t,n,i):e.set(t,n,i,r)},t}(),Ov=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DBoard"},n}(Ki),Dv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheck"},n}(Ce),Ev=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheckRight"},n}(Dv),Mv=function(){function t(t,n,i,r,e){this.T=t,this.j=n,this.P=i,this.Kt=e,this.na=r}return t.prototype.set=function(t,n,i,r){this.T===t&&this.j===n&&this.P===i&&this.na===r||(this.T=t,this.j=n,this.P=i,this.na=r,this.Kt(this))},Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.Kt(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.Kt(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.P},set:function(t){this.P!==t&&(this.P=t,this.Kt(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this.na},set:function(t){this.na!==t&&(this.na=t,this.Kt(this))},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){return{color:this.T,alpha:this.j,position:this.P}},t}(),Sv=function(t,n){return t.position-n.position},Tv=function(n){function i(){var t=n.call(this)||this,i=function(n){t.onChange(n)};t.ia=i;var r=new Mv(16777215,1,0,!1,i),e=new Mv(8421504,1,1,!0,i);return t.gt=[r,e],t.Gt=-90,t.na=e,t.ra=[0,0,0],t}return _(i,n),i.prototype.onChange=function(t){var n=t.selected&&this.na!==t;if(n){var i=this.na;null!=i&&(i.na=!1),this.na=t}this.gt.sort(Sv),n&&this.emit("selectionchange",this.na,this),this.emit("change",this)},Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"direction",{get:function(){return this.Gt},set:function(t){this.Gt!==t&&(this.Gt=t,this.emit("directionchange",t,this),this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selected",{get:function(){return this.na},enumerable:!1,configurable:!0}),i.prototype.size=function(){return this.gt.length},i.prototype.get=function(t){var n=this.gt;return 0<=t&&t<n.length?n[t]:null},i.prototype.addAt=function(n){for(var i=this.gt,r=null,e=0,u=i.length;e<u;++e){var s=i[e];if(n<=s.position){if(null==r)return this.add(s.color,s.alpha,n,!0);var h=s.position-r.position;if(.001<h){var o=t.utils.hex2rgb(s.color,this.ra),a=o[0],c=o[1],f=o[2],l=t.utils.hex2rgb(r.color,this.ra),v=l[0],b=l[1],d=l[2],g=(n-r.position)/h,m=a*g+v*(1-g),w=c*g+b*(1-g),p=f*g+d*(1-g),O=this.ra;O[0]=m,O[1]=w,O[2]=p;var D=t.utils.rgb2hex(O),E=s.alpha*g+r.alpha*(1-g);return this.add(D,E,n,!0)}}r=s}return null!=r?this.add(r.color,r.alpha,n,!0):this.add(16777215,1,n,!0)},i.prototype.add=function(t,n,i,r){var e=this.ia,u=new Mv(t,n,i,r,e);return this.gt.push(u),e(u),u},i.prototype.remove=function(t){var n=this.gt;if(2<n.length)for(var i=0,r=n.length;i<r;++i)if(n[i]===t){n.splice(i,1);var e=this.na===t;return e&&(this.na=i+1<r?n[i]:n[i-1]),e&&this.emit("selectionchange",this.na,this),this.emit("change",this),!0}return!1},i.prototype.reset=function(){var t=this.Gt;this.Gt=-90;var n=this.gt,i=this.na,r=i?n.indexOf(i):-1;n.length=0;var e=this.ia;if(n.push(new Mv(16777215,0,0,!1,e)),n.push(new Mv(16777215,0,1,!1,e)),0<=r&&r<n.length)(u=n[r]).na=!0,this.na=u;else if(0<n.length){var u;(u=n[n.length-1]).na=!0,this.na=u}else this.na=null;return i!==this.na&&this.emit("selectionchange",this.na,this),t!==this.Gt&&this.emit("directionchange",this.Gt,this),this.emit("change",this),this},i.prototype.toObject=function(){for(var t=[],n=this.gt,i=0,r=n.length;i<r;++i)t.push(n[i].toObject());return{points:t,direction:this.Gt}},i.prototype.fromObject=function(t){var n=this.Gt;this.Gt=t.direction;var i=this.gt,r=this.na,e=r?i.indexOf(r):-1;i.length=0;for(var u=this.ia,s=0,h=t.points.length;s<h;++s){var o=t.points[s],a=new Mv(o.color,o.alpha,o.position,!1,u);i.push(a)}return i.sort(Sv),0<=e&&e<i.length?((a=i[e]).na=!0,this.na=a):0<i.length?((a=i[i.length-1]).na=!0,this.na=a):this.na=null,r!==this.na&&this.emit("selectionchange",this.na,this),n!==this.Gt&&this.emit("directionchange",this.Gt,this),this.emit("change",this),this},i}(t.utils.EventEmitter),jv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputLabel"},n}(Ye),Nv=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.Bu=new jv(null==n?void 0:n.label)),i.addChild(i._u=i.createInput(null==n?void 0:n.input));var r=null==n?void 0:n.space;return null!=r&&i.addChild(new ze(r)),i}return _(n,t),Object.defineProperty(n.prototype,"input",{get:function(){return this._u},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"label",{get:function(){return this.Bu},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputAndLabel"},n}(We),Iv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new fu(t)},n}(Nv),Cv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new bu(t)},n}(Nv),Av=function(){function t(t,n,i){this.ea=t,this.ua=n,this.sa=i}return Object.defineProperty(t.prototype,"color",{get:function(){return this.ea.color},set:function(t){if(this.ea.color!==t){var n=this.ua;null!=n&&n(t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.ea.alpha},set:function(t){if(this.ea.alpha!==t){var n=this.sa;null!=n&&n(t)}},enumerable:!1,configurable:!0}),t}(),Rv=function(t){function n(n,i){var r=t.call(this)||this;return r.ha=n,r.yt=i,r}return _(n,t),n.prototype.get=function(t){var n=this.ha;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.ha;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]={color:n.color,alpha:n.alpha},this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.ha,i=0,r=n.length;i<r;++i){var e=n[i];if(e.color===t.color&&e.alpha===t.alpha)return!0}return!1},n.prototype.add=function(t){var n=this.ha;return n.push({color:t.color,alpha:t.alpha}),this.yt<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.ha.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.ha.length},n}(t.utils.EventEmitter),yv=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),Object.defineProperty(i.prototype,"current",{get:function(){return this.oa},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"new",{get:function(){return this.aa},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.ca},enumerable:!1,configurable:!0}),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r),this.Rh=16711680,this.fa={color:16777215,alpha:1},this.aa=new Av(this.fa,(function(t){e.setColorNew(t)}),(function(t){e.setAlphaNew(t)})),this.fe={color:16777215,alpha:1},this.oa=new Av(this.fe,(function(t){e.setColorCurrent(t)}),(function(t){e.setAlphaCurrent(t)}));var u=this.theme,s=this.Bn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.la=new t.Point;var f=u.getMainWidth(),l=u.getMainHeight(),v=new t.Sprite(t.Texture.WHITE);this.va=v,v.x=c,v.y=h,v.width=f,v.height=l,v.interactive=!0,this.addChild(v);var b=new t.Sprite(u.getMainTexture());this.ba=b,b.x=c,b.y=h,b.tint=this.Rh,b.interactive=!1,this.addChild(b),this.da=function(t){e.onMainMove(t)},this.ga=function(t){e.onMainUp(t)},v.on(zi.down,(function(t){e.onMainDown(t)}));var d=new t.Sprite(u.getBaseTexture());this.ma=d,d.x=c,d.y=v.y+v.height+u.getBaseMargin(),d.interactive=!0,this.addChild(d),this.wa=function(t){e.onBaseMove(t)},this.pa=function(t){e.onBaseUp(t)},d.on(zi.down,(function(t){e.onBaseDown(t)}));var g=new t.Sprite(u.getAlphaCheckerboardTexture());this.Oa=g,g.x=s.getLeft(),g.y=d.y+u.getBaseHeight()+u.getBaseMargin(),g.interactive=!1,this.addChild(g);var m=new t.Sprite(u.getAlphaTexture());m.tint=this.fa.color,m.interactive=!0,g.addChild(m),this.Da=function(t){e.onAlphaMove(t)},this.Ea=function(t){e.onAlphaUp(t)},m.on(zi.down,(function(t){e.onAlphaDown(t)}));var w=new t.Sprite(u.getMainPointerTexture());this.Ma=w,w.x=c,w.y=h,w.anchor.x=.5,w.anchor.y=.5,w.tint=u.getMainPointerColor(),w.alpha=u.getMainPointerAlpha(),w.interactive=!1,this.addChild(w);var p=new t.Sprite(u.getAlphaPointerTexture());this.Sa=p,p.x=f,p.y=.5*g.height,p.tint=u.getAlphaPointerColor(),p.alpha=u.getAlphaPointerAlpha(),p.anchor.set(.5,.5),p.interactive=!1,g.addChild(p);var O=new t.Sprite(u.getBasePointerTexture());this.Ta=O,O.x=0,O.y=.5*d.height,O.tint=u.getBasePointerColor(),O.alpha=u.getBasePointerAlpha(),O.anchor.set(.5,.5),O.interactive=!1,d.addChild(O),this.ja=[];var D=this.ja,E=u.getRecentColorCount(),M=u.getRecentColorWidth(),S=u.getRecentColorHeight(),T=.5*M,j=.5*S,N=u.getRecentColorMargin(),I=g.y+u.getAlphaHeight()+u.getRecentMargin(),C=u.getRecentCheckerboardTexture();null==i.RECENT_COLORS&&(i.RECENT_COLORS=new Rv(u.getRecents().slice(0),E));var A=this.ca=i.RECENT_COLORS;A.on("change",(function(){e.onRecentChange()}));for(var R=function(n){var i=n.currentTarget;if(i instanceof t.Container){var r=i.children[0];r instanceof t.Sprite&&(e.setColorNew(r.tint),e.setAlphaNew(r.alpha))}},y=0;y<E;++y){var k=c+y*(M+N),L=new t.Sprite(C);L.x=k+T,L.y=I+j,L.anchor.x=.5,L.anchor.y=.5,L.buttonMode=!0,L.interactive=!0,zi.onClick(L,R),this.addChild(L);var x=new t.Sprite(t.Texture.WHITE),B=A.get(y);null!=B?(x.tint=B.color,x.alpha=B.alpha):(x.tint=16777215,x.alpha=0),x.width=M,x.height=S,x.anchor.x=.5,x.anchor.y=.5,x.interactive=!1,L.addChild(x),D.push(x)}var _=u.getInputMargin(),P=u.getInputLabelWidth(),F=I+S+_,U=.5*(f-_),G=new Cv({parent:this,x:c,y:F,width:U,label:{width:P,text:{value:"#"}},input:{weight:1,text:{value:"FFFFFF"},on:{input:function(t){var n=wt.fromCode(t);null!=n&&e.setColorNew(n)}}}});this.Na=G;var z=G.height,H=new Iv({parent:this,x:c,y:F+z+_,width:U,label:{width:P,text:{value:"A"}},input:{weight:1,text:{value:1},min:0,max:1,on:{input:function(t){e.setAlphaNew(t)}}}});this.Ia=H;var V=.5*(U-P-_),W=z+_+z,X=c+.5*(f-_)+_,K=F+.5*(z+_+H.height-W),Y=new t.Sprite(u.getSampleCheckerboardTexture());this.Ca=Y,Y.x=X,Y.y=K,Y.width=V,Y.height=W,Y.interactive=!1,this.addChild(Y);var J=this.fe,Z=new t.Sprite(t.Texture.WHITE);this.Aa=Z,Z.x=X,Z.y=K,Z.tint=J.color,Z.alpha=J.alpha,Z.width=V,Z.height=W,Z.interactive=!0,Z.buttonMode=!0,zi.onClick(Z,(function(){e.setColorNew(J.color),e.setAlphaNew(J.alpha)})),this.addChild(Z);var q=new t.Sprite(u.getSampleCheckerboardTexture());this.Ra=q,q.x=X+V,q.y=K,q.width=V,q.height=W,q.interactive=!1,this.addChild(q);var $=new t.Sprite(t.Texture.WHITE);this.ya=$,$.x=X+V,$.y=K,$.tint=this.fa.color,$.alpha=this.fa.alpha,$.width=V,$.height=W,$.interactive=!1,this.addChild($),null!=r&&null!=r.width||(this.width=c+f+o),null!=r&&null!=r.height||(this.height=F+G.height+_+H.height+a)},i.prototype.onMainDown=function(t){this.onMainPick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(zi.move,this.da),i.on(zi.up,this.ga)}},i.prototype.onMainMove=function(t){this.onMainPick(t.data.global)},i.prototype.onMainUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(zi.move,this.da),i.off(zi.up,this.ga)}},i.prototype.toMainHex=function(t,n,i,r){return Math.max(0,Math.min(255,255*n+i*(t>>r&255)))<<r},i.prototype.toMainColor=function(t,n,i,r,e){var u=.5*r,s=Math.max(0,Math.min(1,((n-u)*(1-i/e)+u)/r)),h=Math.max(0,Math.min(1,i/e)),o=Math.abs(.5*h-s),a=1-o-h;return this.toMainHex(t,a,o,16)|this.toMainHex(t,a,o,8)|this.toMainHex(t,a,o,0)},i.prototype.onMainPick=function(t){var n=this.la,i=this.Bn,r=i.getLeft(),e=i.getTop(),u=this.theme,s=u.getMainWidth(),h=u.getMainHeight();this.toLocal(t,void 0,n);var o=Math.max(0,Math.min(s,n.x-r)),a=Math.max(0,Math.min(h,n.y-e));this.Ma.position.set(r+o,e+a),this.onColorNew(this.toMainColor(this.Rh,o,a,s,h))},i.prototype.setColorCurrent=function(t){this.Aa.tint=this.fe.color=t},i.prototype.setAlphaCurrent=function(t){this.Aa.alpha=this.fe.alpha=t},i.prototype.setColorNew=function(t){var n=this.theme,i=n.getMainWidth(),r=n.getMainHeight(),e=this.Bn,u=$l.fromRgb(t);this.ba.tint=this.Rh=$l.toRgb(u[0],255,255),this.Ta.x=Math.max(0,Math.min(1,u[0]/360))*i;var s=Math.max(0,Math.min(1,u[1]/255)),h=Math.max(0,Math.min(1,1-u[2]/255)),o=this.Ma;o.tint=h<.45?n.getMainPointerColor():16777215,o.position.set(e.getLeft()+s*i,e.getTop()+h*r),this.onColorNew(t)},i.prototype.onColorNew=function(t){var n=rt.getLayer(this);n&&n.lock(),this.ya.tint=this.fa.color=t,this.Na.input.value=wt.toCode(t),this.emit("newcolorchange",t,this),n&&(n.unlock(),n.update())},i.prototype.onBaseDown=function(t){this.onBasePick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(zi.move,this.wa),i.on(zi.up,this.pa)}},i.prototype.onBaseMove=function(t){this.onBasePick(t.data.global)},i.prototype.onBaseUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(zi.move,this.wa),i.off(zi.up,this.pa)}},i.prototype.toBaseHex=function(t,n){return Math.max(0,Math.min(255,6*t*255))<<n},i.prototype.toBaseColor=function(t){return t<=.167?16711680+this.toBaseHex(t,8):t<=.333?(t=.333-t,65280+this.toBaseHex(t,16)):t<=.5?(t-=.333,65280+this.toBaseHex(t,0)):t<.667?(t=.667-t,255+this.toBaseHex(t,8)):t<.883?(t-=.667,255+this.toBaseHex(t,16)):(t=.883-t,16711680+this.toBaseHex(t,0))},i.prototype.onBasePick=function(t){var n=this.la,i=this.Bn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.Ta.x=e,this.onColorBase(this.toBaseColor(e/r))},i.prototype.setColorBase=function(t){var n=this.theme.getMainWidth();this.Ta.x=Math.max(0,Math.min(1,t/360))*n,this.onColorBase($l.toRgb(t,255,255))},i.prototype.onColorBase=function(t){this.ba.tint=this.Rh=t;var n=this.Ma,i=this.theme,r=i.getMainWidth(),e=i.getMainHeight(),u=this.Bn;this.onColorNew(this.toMainColor(this.Rh,n.x-u.getLeft(),n.y-u.getTop(),r,e))},i.prototype.onAlphaDown=function(t){this.onAlphaPick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(zi.move,this.Da),i.on(zi.up,this.Ea)}},i.prototype.onAlphaMove=function(t){this.onAlphaPick(t.data.global)},i.prototype.onAlphaUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(zi.move,this.Da),i.off(zi.up,this.Ea)}},i.prototype.onAlphaPick=function(t){var n=this.la,i=this.Bn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.Sa.x=e,this.onAlphaNew(e/r)},i.prototype.setAlphaNew=function(t){var n=this.theme.getMainWidth();this.Sa.x=Math.max(0,Math.min(1,t))*n,this.onAlphaNew(t)},i.prototype.onAlphaNew=function(t){var n=rt.getLayer(this);n&&n.lock(),this.ya.alpha=this.fa.alpha=t,this.Ia.input.value=Number(t.toFixed(2)),this.emit("newalphachange",t,this),n&&(n.unlock(),n.update())},i.prototype.onRecentChange=function(){for(var t=this.ja,n=this.ca,i=0,r=t.length;i<r;++i){var e=t[i],u=n.get(i);null!=u?(e.tint=u.color,e.alpha=u.alpha):(e.tint=16777215,e.alpha=0)}},i.prototype.getType=function(){return"DPickerColor"},i.RECENT_COLORS=null,i}(Ki),kv=function(t,n){if(t.direction!==n.direction)return!1;var i=t.points,r=n.points;if(i.length!==r.length)return!1;for(var e=0,u=i.length;e<u;++e){var s=i[e],h=r[e];if(s.color!==h.color||s.alpha!==h.alpha||s.position!==h.position)return!1}return!0},Lv=function(t){function n(n,i){var r=t.call(this)||this;return r.ha=n,r.yt=i,r}return _(n,t),n.prototype.getCapacity=function(){return this.yt},n.prototype.get=function(t){var n=this.ha;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.ha;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]=n,this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.ha,i=0,r=n.length;i<r;++i)if(kv(n[i],t))return!0;return!1},n.prototype.add=function(t){var n=this.ha;return n.push(t),this.yt<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.ha.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.ha.length},n}(t.utils.EventEmitter),xv=function(n){function i(i,r,e,u,s,h,o,a){var c=n.call(this,o,a)||this;return c.interactive=!0,c.interactiveChildren=!1,c.cursor="pointer",c.ka=i,c.an=r,c._uvs=e,c.La=u,c.ln=s,c.xa=-1,c.ra=[0,0,0],c.Th=new t.Point,c.Ba=h,a.uniforms.uSampler.on("update",(function(){c.update(),rt.update(c)})),c.update(),c}return _(i,n),i.prototype.getRectangle=function(t){var n=this.Ba;return 0<=t&&t<n.length?n[t].rect:null},i.prototype.setRectangle=function(t,n,i,r,e){var u=this.Ba;if(0<=t&&t<u.length){var s=u[t].rect;s.x=n,s.y=i,s.width=r,s.height=e}},i.prototype.getData=function(t){var n=this.Ba;return 0<=t&&t<n.length?n[t].data:null},i.prototype.setData=function(t,n){var i=this.Ba;0<=t&&t<i.length&&(i[t].data=n)},i.prototype.getLastHitIndex=function(){return this.xa},i.prototype.setColors=function(t,n,i,r){n[t+0]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=r,n[t+4]=i[0],n[t+5]=i[1],n[t+6]=i[2],n[t+7]=r},i.prototype.setColorsHex=function(n,i,r,e){var u=t.utils.hex2rgb(r,this.ra);this.setColors(n,i,u,e)},i.prototype.setColorsWhite=function(t,n){var i=this.ra;i[0]=1,i[1]=1,i[2]=1,this.setColors(t,n,i,0)},i.prototype.setColorsPoint=function(t,n,i,r){var e=n.points[i];null!=e?this.setColorsHex(t,r,e.color,e.alpha):this.setColorsWhite(t,r)},i.prototype.setVertices=function(t,n,i,r){var e=r.y+r.height*i;n[t+0]=r.x,n[t+1]=e,n[t+2]=r.x+r.width,n[t+3]=e},i.prototype.setUvs=function(t,n,i,r){var e=r.x0+(r.x3-r.x0)*i,u=r.y0+(r.y3-r.y0)*i,s=r.x1+(r.x2-r.x1)*i,h=r.y1+(r.y2-r.y1)*i;n[t+0]=e,n[t+1]=u,n[t+2]=s,n[t+3]=h},i.prototype.newIndices=function(t,n,i,r){for(var e=0;e<i;++e)r[t+0]=n+0,r[t+1]=n+1,r[t+2]=n+2,r[t+3]=n+2,r[t+4]=n+1,r[t+5]=n+3,t+=6,n+=2;return r},i.prototype._calculateBounds=function(){var t=this.Ba[0].rect,n=this._bounds,i=this.Th;i.set(t.x,t.y),n.addPoint(i),i.set(t.x+t.width,t.y+t.height),n.addPoint(i)},i.prototype.update=function(){var t=this.an,n=this._uvs,i=this.La,r=this.ln,e=this.shader.uniforms.uSampler;null==e._uvs&&e.updateUvs();for(var u=e._uvs,s=0,h=0,o=0,a=0,c=this.Ba,f=0,l=c.length;f<l;++f){var v=c[f].data,b=c[f].rect;if(null==v)this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsWhite(o,i),this.setVertices(s+4,t,1,b),this.setUvs(s,n,1,u),this.setColorsWhite(o+8,i),this.newIndices(a,h,1,r),s+=8,o+=16,h+=4,a+=6;else{this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsPoint(o,v,0,i),s+=4,o+=8;for(var d=v.points.length,g=0,m=Math.min(d,this.ka);g<m;++g){var w=v.points[g];this.setVertices(s,t,w.position,b),this.setUvs(s,n,w.position,u),this.setColorsHex(o,i,w.color,w.alpha),s+=4,o+=8}this.setVertices(s,t,1,b),this.setUvs(s,n,1,u),this.setColorsPoint(o,v,d-1,i),s+=4,o+=8,this.newIndices(a,h,d+1,r),a+=6*(d+1),h+=2*(d+2)}}this.size=a;var p=this.geometry;p.getBuffer("aPosition").update(),p.getBuffer("aUv").update(),p.getBuffer("aColor").update(),p.getIndex().update()},i.prototype.containsPoint=function(t){for(var n=this.toLocal(t,void 0,this.Th),i=this.Ba,r=0,e=i.length;r<e;++r)if(i[r].rect.contains(n.x,n.y))return this.xa=r,!0;return!1},i.from=function(n,r,e,u){void 0===u&&(u=t.Texture.WHITE);for(var s=new Float32Array(n*(r+2)*2*2),h=new Float32Array(n*(r+2)*2*2),o=new Float32Array(n*(r+2)*2*4),a=new Uint16Array(n*(r+1)*6),c=[],f=0;f<n;++f)c.push({data:null,rect:new t.Rectangle});return new i(r,s,h,o,a,c,(new t.Geometry).addIndex(new t.Buffer(a,!1,!0)).addAttribute("aPosition",new t.Buffer(s,!1,!1),2).addAttribute("aUv",new t.Buffer(h,!1,!1),2).addAttribute("aColor",new t.Buffer(o,!1,!1),4),t.Shader.from("\nattribute vec2 aPosition;\nattribute vec2 aUv;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\n\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nvoid main(void) {\n\tvec3 position = vec3(aPosition.x, aPosition.y, 1.0);\n\tgl_Position = vec4((projectionMatrix * translationMatrix * position).xy, 0.0, 1.0);\n\tvUv = aUv;\n\tvColor = aColor;\n}\n","\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform vec2 uCheckerColors;\n\nvoid main(void) {\n\tvec4 texture = texture2D(uSampler, vUv);\n\tfloat cy = step( 1.0, mod( gl_FragCoord.y / 10.0, 2.0 ) );\n\tfloat cx = step( 1.0, mod( gl_FragCoord.x / 10.0 + cy, 2.0 ) );\n\tfloat c = mix( uCheckerColors.x, uCheckerColors.y, cx );\n\tgl_FragColor = texture * vec4( mix( vec3( c ), vColor.xyz, vColor.a ), 1.0 );\n}",{uSampler:u,uCheckerColors:e}))},i}(t.Mesh),Bv=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r);var u=this.theme,s=this.Bn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.je=new t.Point;var f=u.getGradientPointsWidth(),l=u.getGradientPointsMargin(),v=new yv({x:c+f+l,y:h});this.es=v,v.on("newcolorchange",(function(t){e.onAnchorColorChange(t)})),v.on("newalphachange",(function(t){e.onAnchorAlphaChange(t)})),this.addChild(v);var b=this.Ji=xv.from(17,10,u.getGradientCheckerColors());b.setRectangle(0,c,h,f,v.height),this.addChild(b),b.on(zi.down,(function(t){0===b.getLastHitIndex()&&e.onViewDown(t)})),this.Pa=function(t){e.onAnchorDown(t)},this.Fa=function(t){e.onAnchorMove(t)},this.Ua=function(t){e.onAnchorUp(t)},this.Ga=[];var d=v.theme.getInputLabelWidth(),g=.5*v.theme.getMainWidth(),m=u.getGradientDirectionMargin(),w=u.getGradientDirectionTexture(),p=v.x+v.width+m,O=new fu({parent:this,x:p+d+5,y:h,width:g-d-5,step:1,image:{source:w,align:{with:be.BORDER},margin:{horizontal:-w.width-5}},on:{change:function(t){e.At.Gt=t}}}),D=u.getGradientRecentColumn(),E=u.getGradientRecentWidth(),M=u.getGradientRecentMargin(),S=E+M,T=p,j=O.y+O.height+m;null==i.RECENT_COLOR_GRADIENT&&(i.RECENT_COLOR_GRADIENT=new Lv(u.getGradientRecents(),u.getGradientRecentCount())),this.ca=i.RECENT_COLOR_GRADIENT;for(var N=this.ca,I=0,C=N.getCapacity();I<C;++I){var A=T+I%D*S,R=j+(I/D|0)*S;b.setRectangle(1+I,A,R,E,E)}N.on("change",(function(){e.onRecentUpdate()})),zi.onClick(b,(function(t){var n=b.getLastHitIndex();1<=n&&e.onRecentClick(b.getData(n))}));var y=new Tv;this.At=y,y.on("change",(function(){e.updateAnchors(),b.update()})),y.on("selectionchange",(function(t){e.onAnchorSelect(t)})),y.on("directionchange",(function(t){O.value=t})),b.setData(0,y),b.update(),O.value=y.direction,this.updateAnchors();var k=y.selected;null!=k&&this.onAnchorSelect(k),null!=r&&null!=r.width||(this.width=c+f+l+v.width+m+(D-1)*M+D*E+o),null!=r&&null!=r.height||(this.height=h+v.height+a)},Object.defineProperty(i.prototype,"value",{get:function(){return this.At},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.ca},enumerable:!1,configurable:!0}),i.prototype.onRecentClick=function(t){var n=this.At;null!=t?n.fromObject(t):n.reset()},i.prototype.onRecentUpdate=function(){for(var t=this.ca,n=this.Ji,i=0,r=t.size();i<r;++i)n.setData(1+i,t.get(i));n.update(),rt.update(this)},i.prototype.toAnchorPosition=function(t){var n=this.toLocal(t.data.global,void 0,this.je);return Math.max(0,Math.min(1,(n.y-this.padding.getTop())/this.es.height))},i.prototype.onViewDown=function(t){this.At.addAt(this.toAnchorPosition(t)),this.onAnchorDragStart()},i.prototype.onAnchorDown=function(n){var i=n.target;if(i instanceof t.Sprite){var r=this.At,e=this.Ga.indexOf(i);0<=e&&e<r.points.length&&(r.points[e].selected=!0,this.onAnchorDragStart())}},i.prototype.onAnchorSelect=function(t){var n=this.es;n.current.color=t.color,n.current.alpha=t.alpha,n.new.color=t.color,n.new.alpha=t.alpha},i.prototype.onAnchorColorChange=function(t){var n=this.At;if(null!=n){var i=n.selected;null!=i&&(i.color=t)}},i.prototype.onAnchorAlphaChange=function(t){var n=this.At;if(null!=n){var i=n.selected;null!=i&&(i.alpha=t)}},i.prototype.onAnchorDragStart=function(){var t=rt.getLayer(this);if(t){var n=t.stage;n.on(zi.move,this.Fa),n.on(zi.up,this.Ua)}},i.prototype.onAnchorMove=function(t){var n=this.At;if(null!=n){var i=n.selected;null!=i&&(i.position=this.toAnchorPosition(t))}},i.prototype.onAnchorUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(zi.move,this.Fa),i.off(zi.up,this.Ua)}},i.prototype.updateAnchors=function(){for(var n=this.theme,i=n.getGradientAnchorTexture(),r=n.getGradientAnchorOutlinedTexture(),e=n.getGradientPointsWidth(),u=this.At,s=u.points.length,h=this.Ga,o=h.length,a=o;a<s;++a){var c=new t.Sprite(i);c.anchor.set(.5,.5),c.cursor="pointer",c.interactive=!0,c.on(zi.down,this.Pa),h.push(c),this.addChild(c)}for(a=o-1;s<=a;--a){var f=h[a];f.off(zi.down,this.Pa),f.destroy()}h.length=s;var l=this.padding.getTop(),v=this.padding.getLeft()+e,b=this.es.height;for(a=0;a<s;++a){var d=u.points[a],g=h[a];g.tint=d.color,g.position.set(v,l+b*d.position),g.texture=d.selected?r:i}rt.update(this)},i.prototype.onKeyDown=function(t){if(Kt.isDeleteKey(t)){var i=this.At;if(null!=i){var r=i.selected;if(null!=r)return i.remove(r),n.prototype.onKeyDown.call(this,t),!0}}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DPickerColorGradient"},i.RECENT_COLOR_GRADIENT=null,i}(Ki),_v=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.picker)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.value,e=i.recent;e.contains(r)||e.add(r.toObject())},Object.defineProperty(n.prototype,"value",{get:function(){return this.picker.value},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.es;return null==n&&(n=new Bv(null===(t=this.Nn)||void 0===t?void 0:t.picker),this.es=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.value},n.prototype.onKeyDown=function(n){return this.picker.onKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DDialogColorGradient"},n}(Ke),Pv=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r;if(n.prototype.init.call(this,i),void 0===(null===(r=null==i?void 0:i.image)||void 0===r?void 0:r.source)){var e=this.theme,u=e.getViewBaseTexture();if(u instanceof t.Texture){var s=e.getCheckerColors(),h=xv.from(1,10,s,u);this.Ji=h,h.setRectangle(0,0,0,u.width,u.height),h.setData(0,this.nu),h.update(),this.image=h}}},i.prototype.onActivate=function(t){var i=this;n.prototype.onActivate.call(this,t);var r=this.nu,e=this.dialog;e.value.fromObject(r),e.open().then((function(){var t=e.value,n=(new Tv).fromObject(r);r.fromObject(t);var u=i.Ji;null!=u&&u.update(),i.onTextChange(),i.createOrUpdateText(),rt.update(i),i.emit("change",t,n,i)}))},Object.defineProperty(i.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var r=null===(t=this.Nn)||void 0===t?void 0:t.dialog;r?n=new _v(r):(null==i.DIALOG&&(i.DIALOG=new _v),n=i.DIALOG),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return this.nu},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DButtonColorGradient"},i}(Ae),Fv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.picker)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.recent;r.contains(i.new)||r.add(i.new)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.es;return null==n&&(n=new yv(null===(t=this.Nn)||void 0===t?void 0:t.picker),this.es=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogColor"},n}(Ke),Uv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n);var r=this.nu;this.At=new Av(r,(function(t){r.color=t,i.onColorChange()}),(function(t){r.alpha=t,i.updateTextForcibly()}))},n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.nu,e=this.dialog,u=e.current,s=e.new;u.color=r.color,u.alpha=r.alpha,s.color=r.color,s.alpha=r.alpha,e.open().then((function(){r.color=s.color,r.alpha=s.alpha,i.onColorChange(),i.onValueChange(i.toClone(s),i.toClone(u))}))},n.prototype.toClone=function(t){return{color:t.color,alpha:t.alpha}},n.prototype.onValueChange=function(t,n){this.emit("change",t,n,this)},n.prototype.toImageTintOptions=function(t){var n=this,i=function(){return n.nu.color};return t?{color:t.color||i,alpha:t.alpha}:{color:i}},n.prototype.toImageOptions=function(t,n){return n?{source:n.source,tint:this.toImageTintOptions(n.tint),align:n.align,margin:n.margin}:{tint:this.toImageTintOptions()}},n.prototype.onColorChange=function(){this.ou[0].updateTint()&&rt.update(this),this.updateTextForcibly()},n.prototype.updateTextForcibly=function(){this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.za;if(null==i){var r=null===(t=this.Nn)||void 0===t?void 0:t.dialog;r?i=new Fv(r):(null==n.DIALOG&&(n.DIALOG=new Fv),i=n.DIALOG),this.za=i}return i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.At},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonColor"},n}(Ae),Gv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonDanger"},n}(Ae),zv=function(){function t(){}return t.getInstance=function(){return null==t.INSTANCE&&(t.INSTANCE=new Vu),t.INSTANCE},t}(),Hv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime()),e.emit("change",t,n,e)}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Vu(i):zv.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.nu)&&void 0!==t?t:new Date},set:function(t){var n=this.nu;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDate"},n}(Ae),Vv=function(){function t(){}return t.getInstance=function(){return null==t.INSTANCE&&(t.INSTANCE=new Pu),t.INSTANCE},t}(),Wv=function(){function t(){}return t.format=function(t){return mt(String(t.getFullYear()),4,"0")+"/"+mt(String(t.getMonth()+1),2,"0")+"/"+mt(String(t.getDate()),2,"0")},t}(),Xv=function(){function t(){}return t.format=function(t,n){var i="";return n&Iu.HOURS&&(i+=mt(String(t.getHours()),2,"0")),n&Iu.MINUTES&&(0<i.length&&(i+=":"),i+=mt(String(t.getMinutes()),2,"0")),n&Iu.SECONDS&&(0<i.length&&(i+=":"),i+=mt(String(t.getSeconds()),2,"0")),i},t.toMask=function(t){return Cu.from("DPickerTime",t)},t}(),Kv=function(){function t(){}return t.format=function(t,n){var i=Xv.format(t,n);return 0<i.length?Wv.format(t)+" "+i:""+Wv.format(t)},t.toMask=function(t){return Cu.from("DPickerDatetime",t)},t}(),Yv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime()),e.emit("change",t,n,e)}))},n.prototype.getDatetimeMask=function(){var t,n,i=this.Ha;return null==i&&(i=Kv.toMask(null===(n=null===(t=this.Nn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Ha=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Pu(i):Vv.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.nu)&&void 0!==t?t:new Date},set:function(t){var n=this.nu;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDatetime"},n}(Ae),Jv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getChecker=function(){var t,n,i=this.qh;return void 0===i&&(i=null!==(n=null===(t=this.Nn)||void 0===t?void 0:t.checker)&&void 0!==n?n:null,this.qh=i),i},n.prototype.getOpener=function(){var t=this.Va;return null==t&&(t=this.newOpener(),this.Va=t),t},n.prototype.newOpener=function(){var t,n;return new ql(di(null!==(n=null===(t=this.Nn)||void 0===t?void 0:t.as)&&void 0!==n?n:Zl.TEXT,Zl),this)},n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n),this.check((function(){i.open()}))},n.prototype.check=function(t){var n=this.getChecker();if(null!=n){var i=n();!0===i?t():!1===i||i.then((function(){t()}))}else t()},n.prototype.open=function(){this.getOpener().open()},n.prototype.getType=function(){return"DButtonFile"},n}(Ae),Zv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initOnClick=function(t,n,i){var r=this,e=new kf(i);this.$h=e,e.add(this,(function(n){t===fe.CLICKED&&r.onClick(n)}))},Object.defineProperty(n.prototype,"link",{get:function(){return this.$h},enumerable:!1,configurable:!0}),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.$h.open(n)},n.prototype.open=function(t){this.$h.open(t)},n.prototype.getType=function(){return"DButtonLink"},n}(Ce),qv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadio"},n}(Ce),$v=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadioRight"},n}(qv),Qv=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=dv.getCommandController();return r.isDisabled=!e.isRedoable(),e.on("change",(function(){r.isDisabled=!e.isRedoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),dv.getCommandController().redo()},n}(Ae),tb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonSecondary"},n}(Ae),nb={NONE:0,SINGLE:1,MULTIPLE:2},ib=function(t){function n(n,i){var r=t.call(this,i)||this;return r.$i=n,r.initOnClick(n,i),r}return _(n,t),n.prototype.initOnClick=function(t,n){var i=this,r=t.accessor.link;if(r){var e=new kf(this.toLinkOptions(r));e.add(this,(function(t){var n=i.At;void 0!==n&&i.onSelect(t,n)})),this.$h=e}else zi.onClick(this,(function(t){if(i.state.isActionable){var n=i.At;void 0!==n&&i.onSelect(t,n)}}))},n.prototype.toLinkOptions=function(t){return{url:this.toLinkUrl(t.toUrl),target:t.target,checker:this.toLinkChecker(t.checker)}},n.prototype.toLinkUrl=function(t){var n=this;return function(){var i=n.At;if(void 0!==i)return t(i)}},n.prototype.toLinkChecker=function(t){var n=this;if(t)return function(){var i=n.At;return null!=i&&t(i)}},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.ae},enumerable:!1,configurable:!0}),n.prototype.onSelect=function(t,n){var i,r=this.$i,e=r.selection;if(e.type!==nb.MULTIPLE)e.clearAndAdd(n);else{var u=t&&"data"in t?t.data.originalEvent:t;if(null==u?void 0:u.ctrlKey)e.toggle(n);else if(null==u?void 0:u.shiftKey){var s=r.mapped,h=e.last;if(n===h)e.clearAndAdd(n);else{var o=!1,a=!1,c=[];s.each((function(t){if(o){if(a){if(c.unshift(t),t===n)return!1}else if(c.push(t),t===h)return!1}else t===n?(o=!0,a=!1,c.push(t)):t===h&&(o=!0,a=!0,c.push(t))})),e.clearAndAddAll(c)}}else e.clearAndAdd(n)}null===(i=this.$h)||void 0===i||i.open(t)},n.prototype.set=function(t,n,i){var r=this.$i,e=i||this.At!==t;if(e){this.At=t,this.ae=n;var u=r.accessor;this.text=u.toLabel(t),this.title=u.toTitle(t)||"",this.image=u.toImage(t)}var s=this.state;s.lock(),s.set(ht.ACTIVE,r.selection.contains(t)),s.remove(ht.DISABLED),s.unlock(),e&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.At){this.At=void 0,this.ae=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ht.DISABLED),t.remove(ht.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){if(this.state.isActionable&&this.state.isFocused){var n=this.At;return void 0!==n&&this.onSelect(t,n),!0}return!1},n.prototype.getType=function(){return"DListItem"},n}(Ie),rb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogSelectListItem"},n}(ib),eb=function(){function t(t,n,i,r){this.Wa=0,this.Xa=!1,this.Ka=!1,this.Ya=-1,this.Ja=-1,this.yu=1,this.Za=0,this.qa=0,this.$a=[],this.$i=t,this.Qa=n,this.tc=i,this.nc=this.toNewItem(r),this.ic=this.toInitItem(r)}return t.prototype.toNewItem=function(t){return(null==t?void 0:t.newItem)||this.newItem},t.prototype.toInitItem=function(t){return t?t.initItem||(!1!==t.stripe?this.initItem:this.initItemNoStriping):this.initItem},t.prototype.initItem=function(t,n,i){return t.state.isAlternated=n%2==1,t},t.prototype.initItemNoStriping=function(t,n,i){return t},Object.defineProperty(t.prototype,"multiplicity",{get:function(){return this.yu},enumerable:!1,configurable:!0}),t.prototype.lock=function(){this.Wa+=1,1===this.Wa&&(this.Xa=!1,this.Ka=!1)},t.prototype.unlock=function(t){this.Wa-=1,0===this.Wa&&(t&&this.Xa&&this.update(this.Ka),this.Xa=!1,this.Ka=!1)},t.prototype.update=function(t){var n=this;if(0<this.Wa)return this.Xa=!0,void(t&&(this.Ka=!0));var i=this.Qa,r=i.parent;if(null!=r){var e=this.tc,u=e.children,s=r.height,h=this.$i,o=this.toMapped(h),a=o.size(),c=this.Za,f=this.qa,l=f-c,v=this.nc,b=this.ic,d=this.Ya,g=this.Ja;if(this.Ya<0){var m=void 0;0<u.length?m=u[0]:(m=b(v(h),c,h),e.addChild(m),f+=1,l+=1),d=Math.max(1,m.height),Xt(m.getWidth())&&(g=Math.max(1,m.width)),this.Ya=d,this.Ja=g}var w=i.padding,p=w.getTop(),O=w.getBottom(),D=w.getLeft(),E=w.getRight(),M=Math.max(0,i.width-D-E),S=0<g?Math.max(1,Math.floor(M/g)):1;this.yu=S;var T=i!==e?e.transform.position.y:p,j=Math.ceil(a/S)*d,N=Math.max(s,p+j+O),I=Math.max(s-N,i.position.y),C=Math.floor((0-(I+T))*S/d),A=Math.floor((s-(I+T))*S/d),R=C-S;R%2!=0&&(R-=1);var y=A+S+S;y%2!=0&&(y+=1);var k=y-R;if(k<l&&l-2<=k&&(y=R+(k=l)),l<k){for(var L=l;L<k;++L){var x=c+L;m=b(v(h),x,h),e.addChild(m)}f=c+(l=k)}else if(k<l){for(L=l-1;k<=L;--L)e.removeChild(u[L]);f=c+(l=k)}this.Za=R,this.qa=y;var B=R-c,_=Math.abs(B),P=u.length;if(0<_&&_<P){var F=this.$a;if(0<B){for(L=0;L<_;++L)m=u[L],this.reset(m),F.push(m);for(L=_;L<P;++L)u[L-_]=u[L];for(L=0;L<_;++L)u[P-_+L]=F[L]}else{for(L=0;L<_;++L)m=u[P-_+L],this.reset(m),F.push(m);for(L=P-_-1;0<=L;--L)u[L+_]=u[L];for(L=0;L<_;++L)u[L]=F[L]}F.length=0}var U=0,G=0;for(i===e&&(U=D,G=p),o.each((function(i,r){var e=u[r-R],s=r%S,h=Math.floor(r/S);e.position.set(U+s*g,G+h*d),n.set(e,i,r,t)}),R,R+P),L=0;R+L<0&&L<P;++L){m=u[L];var z=(V=R+L)%S,H=Math.floor(V/S);m.position.set(U+z*g,G+H*d),this.unset(m)}for(L=P-1;a<=R+L&&0<=L;--L){var V;m=u[L],z=(V=R+L)%S,H=Math.floor(V/S),m.position.set(U+z*g,G+H*d),this.unset(m)}this.lock(),i.position.y=I,i.height=N,i!==e&&(e.height=j),this.unlock(!1)}},t.prototype.set=function(t,n,i,r){t.set(n,i,r)},t.prototype.unset=function(t){t.unset()},t.prototype.reset=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof Ki){var u=e.state;u.lock(),u.isPressed=!1,u.isHovered=!1,u.unlock()}}return t.state.isHovered=!1,t},t.prototype.moveFocus=function(t,n,i,r){if(!i&&!r)return!1;var e=i&&Kt.isArrowUpKey(t),u=i&&Kt.isArrowDownKey(t),s=r&&Kt.isArrowLeftKey(t),h=r&&Kt.isArrowRightKey(t);if(!(e||u||s||h))return!1;if(!n.state.isActionable)return!1;var o=rt.getLayer(n);if(null==o)return!1;var a=o.getFocusController(),c=a.get();if(null==c)return!1;var f=this.tc;if(c.parent!==f)return!1;var l=c,v=l.index;if(null==v)return!1;var b=this.yu,d=this.$i,g=this.toMapped(d).size(),m=v;if((s||h)&&(s?0<=m-1&&(m-=1):m+1<g&&(m+=1)),(e||u)&&(e?0<=m-b&&(m-=b):m+b<g&&(m+=b)),m===v)return!1;var w=f.children,p=w.indexOf(l);if(p<0)return!1;var O=p+(m-v);if(O<0||w.length<=O)return!1;var D=w[O];return a.focus(D),!0},t}(),ub=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new ib(t)},n}(eb),sb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItem=function(t){return new rb(t)},n}(ub),hb=function(){function t(t){this.O=t}return t.prototype.size=function(){var t=this.O;return t.before.length+t.items.length+t.after.length},t.prototype.each=function(t,n,i){var r=this.O,e=this.rc(t,r.before,0,n,i);if(!(e<0)){var u=this.rc(t,r.items,e,n,i);u<0||this.rc(t,r.after,u,n,i)}},t.prototype.rc=function(t,n,i,r,e){for(var u=i+n.length,s=null!=r?Math.max(i,r):i,h=null!=e?Math.min(u,e):u,o=s;o<h;++o)if(!1===t(n[o-i],o))return-1;return h},t}(),ob=function(t){function n(n,i,r){var e=t.call(this)||this;e.O=n,e.ec=i,e.uc=new Set;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return nb.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.get(0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.uc;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.uc;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.uc;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.uc;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.uc;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.uc;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.uc,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.uc=i,this.onChange()),n},n.prototype.contains=function(t){return this.uc.has(t)},n.prototype.size=function(){return this.uc.size},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=!1;this.uc.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.uc.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.toItemIdMap=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];i.set(n(u),u)}},n.prototype.toItemSet=function(t,n){for(var i=0,r=t.length;i<r;++i)n.add(t[i])},n.prototype.onItemChange=function(t,n,i){var r=this.uc,e=new Set,u=this.ec.toId;if(u){var s=new Map;this.toItemIdMap(t,u,s),this.toItemIdMap(n,u,s),this.toItemIdMap(i,u,s),r.forEach((function(t){var n=u(t),i=s.get(n);null!=i&&e.add(i)})),this.uc=e,this.onChange()}else{var h=new Set;this.toItemSet(t,h),this.toItemSet(n,h),this.toItemSet(i,h),r.forEach((function(t){h.has(t)&&e.add(t)})),r.size!==e.size&&(this.uc=e,this.onChange())}},n.prototype.newItems=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];n.has(u)&&i.add(u)}return i},n}(t.utils.EventEmitter),ab=function(t){function n(n,i,r){var e=t.call(this)||this;e.O=n;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return nb.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.onItemChange=function(t,n,i){},n}(t.utils.EventEmitter),cb=function(t){function n(n,i,r){var e=t.call(this)||this;e.O=n,e.ec=i,e.sc=null;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return nb.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.sc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.sc:null},n.prototype.add=function(t){return this.sc!==t&&(this.sc=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.sc===t&&(this.sc=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.sc===t?this.sc=null:this.sc=t,this.onChange(),!0},n.prototype.clear=function(){null!=this.sc&&(this.sc=null,this.onChange())},n.prototype.clearAndAdd=function(t){return this.sc!==t&&(this.sc=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){var n=t.length;if(0<n){var i=t[n-1];if(this.sc!==i)return this.sc=i,this.onChange(),!0}else if(null!=this.sc)return this.sc=null,this.onChange(),!0;return!1},n.prototype.contains=function(t){return this.sc===t},n.prototype.size=function(){return null!=this.sc?1:0},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=this.sc;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.sc;return null!=t?[t]:[]},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.findById=function(t,n,i){for(var r=0,e=i.length;r<e;++r){var u=i[r];if(t===n(u))return u}return null},n.prototype.find=function(t,n){for(var i=0,r=n.length;i<r;++i){var e=n[i];if(t===e)return e}return null},n.prototype.onItemChange=function(t,n,i){var r=this.sc;if(null!=r){var e=null,u=this.ec.toId;if(u){var s=u(r);e=this.findById(s,u,t)||this.findById(s,u,n)||this.findById(s,u,i)}else e=this.find(r,t)||this.find(r,n)||this.find(r,i);r!==e&&(this.sc=e,this.onChange())}},n}(t.utils.EventEmitter),fb=function(t){return t.image},lb=function(t){return t.title},vb=function(t){return t.url},bb=function(){function t(t){this.toLabel=(null==t?void 0:t.toLabel)||Wl,this.toTitle=(null==t?void 0:t.toTitle)||lb,this.toImage=(null==t?void 0:t.toImage)||fb,this.toId=null==t?void 0:t.toId,this.link=this.toLink(t)}return t.prototype.toLink=function(t){if(t){var n=t.link;if(n){var i=n.toUrl,r=n.target,e=n.checker;if(void 0!==i||void 0!==r||void 0!==e)return{toUrl:i||vb,target:r,checker:e}}}},t}(),db=function(){function t(t,n){this.O=t,n?(this.br=n.before||[],this.uc=n.items||[],this.dr=n.after||[]):(this.br=[],this.uc=[],this.dr=[]);var i=new bb(n);this.ec=i,this.hc=this.toSelection(i,n),this.oc=new hb(this)}return t.prototype.toSelection=function(t,n){var i=null==n?void 0:n.selection;switch(null==i?void 0:i.type){case nb.NONE:case"NONE":return new ab(this,t,i);case nb.MULTIPLE:case"MULTIPLE":return new ob(this,t,i);default:return new cb(this,t,i)}},Object.defineProperty(t.prototype,"before",{get:function(){return this.br},set:function(t){this.br=t,this.hc.onItemChange(t,this.uc,this.dr),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this.uc},set:function(t){this.uc=t,this.hc.onItemChange(this.br,t,this.dr),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.dr},set:function(t){this.dr=t,this.hc.onItemChange(this.br,this.uc,t),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.oc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.ec},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),t.prototype.update=function(t){this.O.update(t)},t.prototype.size=function(){return this.uc.length},t.prototype.clear=function(){var t=this.uc;return 0<t.length&&(t.length=0,this.onChange(),!0)},t.prototype.clearAndAdd=function(t){var n=this.uc;return 1===n.length?n[0]!==t&&(n[0]=t,this.onChange(),!0):(n.length=0,n.push(t),this.onChange(),!0)},t.prototype.clearAndAddAll=function(t){var n=!1,i=this.uc;if(0<i.length&&(i.length=0,n=!0),0<t.length){for(var r=0,e=t.length;r<e;++r)i.push(t[r]);n=!0}return!!n&&(this.onChange(),!0)},t.prototype.add=function(t,n){var i=this.uc;return null==n?(i.push(t),this.onChange(),!0):0<=n&&n<i.length&&(i.splice(n,0,t),this.onChange(),!0)},t.prototype.addAll=function(t,n){if(0<t.length){var i=this.uc,r=i.length;if(null==n){for(var e=0,u=t.length;e<u;++e)i.push(t[e]);return this.onChange(),!0}if(0<=n&&n<r){for(e=0,u=t.length;e<u;++e)i.splice(n+e,0,t[e]);return this.onChange(),!0}}return!1},t.prototype.get=function(t){var n=this.uc;return 0<=t&&t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.uc;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.onChange(),r}return null},t.prototype.remove=function(t){var n=this.uc;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.onChange(),i}return null},t.prototype.each=function(t,n,i){for(var r=this.uc,e=r.length,u=null!=n?Math.max(0,n):0,s=null!=i?Math.min(e,i):e,h=u;h<s&&!1!==t(r[h],h);++h);},t.prototype.onChange=function(){this.update()},t}(),gb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DContent"},n}(Ki),mb=function(t){function n(n){var i,r,e=t.call(this,n)||this;e.ac=0,e.cc=1,e.visible=!1,e.fc=-1,e.lc=!1,e.vc=null,e.bc=null!==(r=null===(i=null==n?void 0:n.fadeOut)||void 0===i?void 0:i.delay)&&void 0!==r?r:e.theme.getFadeOutDelay(),e.dc=!0,e.gc=function(){e.onFadeOutTimeout()};var u=e.newThumb(null==n?void 0:n.thumb);return u.on("statechange",(function(t,n){e.onThumbStateChange(t,n)})),e.mc=u,e.addChild(u),e}return _(n,t),Object.defineProperty(n.prototype,"thumb",{get:function(){return this.mc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"start",{get:function(){return this.ac},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"end",{get:function(){return this.cc},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r){i<1?(t=0,n=1):(t=Math.max(0,Math.min(1,t/i)),n=Math.max(t,Math.min(1,n/i))),this.ac===t&&this.cc===n||(this.ac=t,this.cc=n,this.onChange(r))},n.prototype.onChange=function(t){this.updateThumb(this.width,this.height),t&&(this.dc=!0),this.lc||(this.lc=!0,rt.update(this))},n.prototype.isRegionVisible=function(){return 0<this.ac||this.cc<1},n.prototype.render=function(n){if(this.lc)if(this.lc=!1,!this.dc&&this.isRegionVisible()){var i=this.bc;0<=i&&(this.fc=Date.now(),null==this.vc&&(this.vc=window.setTimeout(this.gc,i))),this.visible||(this.visible=!0)}else this.bc<0&&this.visible&&(this.visible=!1);this.dc&&(this.dc=!1),t.prototype.render.call(this,n)},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateThumb(n,i)},n.prototype.onFadeOutTimeout=function(){this.vc=null;var t=this.bc,n=this.gc,i=this.state;if(i.isGesturing||i.isHovered||i.isPressed)this.vc=window.setTimeout(n,t);else{var r=this.mc.state;if(r.isGesturing||r.isHovered||r.isPressed)this.vc=window.setTimeout(n,t);else{var e=t-(Date.now()-this.fc);0<e?this.vc=window.setTimeout(n,e):this.visible&&(this.visible=!1,rt.update(this))}}},n.prototype.onThumbStateChange=function(t,n){t.isGesturing||t.isHovered||t.isPressed||(n.isGesturing||n.isHovered||n.isPressed)&&(this.fc=Date.now())},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isGesturing||n.isHovered||n.isPressed||(i.isGesturing||i.isHovered||i.isPressed)&&(this.fc=Date.now())},n.prototype.getType=function(){return"DScrollBar"},n}(Ki),wb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r=this;n.prototype.init.call(this,i);var e=new t.Point;this.pi=new rr({bind:this,easing:!0,on:{start:function(){e.copyFrom(r.position)},move:function(t,n,i){e.set(e.x+n,e.y+i),r.onGestureMove(e.x,e.y)}}})},i.prototype.getMinimumLength=function(){return this.theme.getThumbMinimumLength()},i.prototype.getType=function(){return"DScrollBarThumb"},i}(Ki),pb=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(0,o*(i-h),n,h),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Ob=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",t,this)},n.prototype.initReflowable=function(){new pb(this)},n}(wb),Db=function(t){function n(n){var i=t.call(this,n)||this;return i.mc.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.width;if(0<n){var i=this.cc-this.ac,r=Math.min(1-i,Math.max(0,t/n));this.ac!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.width;if(0<i){var r=this.cc-this.ac,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.x/i-.5*r));this.ac!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Ob(t)},n.prototype.updateThumb=function(t,n){var i=this.mc,r=Math.min(.5*t,i.getMinimumLength()),e=t-r,u=e*this.ac,s=e*this.cc+r-u;i.position.set(u,0),i.resize(s,n)},n}(mb),Eb=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(o*(n-h),0,h,i),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Mb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",n,this)},n.prototype.initReflowable=function(){new Eb(this)},n}(wb),Sb=function(t){function n(n){var i=t.call(this,n)||this;return i.mc.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.height;if(0<n){var i=this.cc-this.ac,r=Math.min(1-i,Math.max(0,t/n));this.ac!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.height;if(0<i){var r=this.cc-this.ac,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.y/i-.5*r));this.ac!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Mb(t)},n.prototype.updateThumb=function(t,n){var i=this.mc,r=Math.min(.5*n,i.getMinimumLength()),e=n-r,u=e*this.ac,s=e*this.cc+r-u;i.position.set(0,u),i.resize(t,s)},n}(mb),Tb=function(){function t(t,n,i){this.O=t,this.wc=i,this.$=0,this.Oc=!1,this.vertical=new Sb(null==n?void 0:n.vertical),this.horizontal=new Db(null==n?void 0:n.horizontal)}return t.prototype.lock=function(){this.$+=1,1===this.$&&(this.Oc=!1,this.Dc=void 0)},t.prototype.unlock=function(t){this.$-=1,0===this.$&&(t&&this.Oc&&this.update(this.Dc),this.Oc=!1,this.Dc=void 0)},t.prototype.update=function(t){if(0<this.$)return this.Oc=!0,void(null!=t&&(this.Dc||(this.Dc=t)));var n=this.O,i=n.width,r=n.height,e=n.content,u=-e.x,s=-e.y,h=this.vertical,o=h.width,a=this.getOffsetVerticalStart(o),c=this.getOffsetVerticalEnd(o);h.set(s,s+r,e.height,t),h.position.set(i-o,a),h.height=r-a-c;var f=this.horizontal,l=f.height,v=this.getOffsetHorizontalStart(l),b=this.getOffsetHorizontalEnd(l);f.set(u,u+i,e.width,t),f.position.set(v,r-l),f.width=i-v-b,this.wc(h.isRegionVisible()||f.isRegionVisible())},t.prototype.getOffsetHorizontalStart=function(t){return.5*t},t.prototype.getOffsetHorizontalEnd=function(t){return.5*t},t.prototype.getOffsetVerticalStart=function(t){return.5*t},t.prototype.getOffsetVerticalEnd=function(t){return.5*t},t}(),jb=function(n){function i(t){var i,r=n.call(this,t)||this,e=r.theme;(null!==(i=null==t?void 0:t.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(r.mask=r.getOverflowMask()),r.addChild(r.content);var u=r.scrollbar;return r.addChild(u.vertical),r.addChild(u.horizontal),u.update(),r.initGesture(e,t),r}return _(i,n),i.prototype.initGesture=function(n,i){var r,e,u=this,s=di(null!==(e=null===(r=null==i?void 0:i.gesture)||void 0===r?void 0:r.mode)&&void 0!==e?e:n.getGestureMode(),qi);if(s===qi.ON||s===qi.TOUCH){var h=new t.Point,o=this.content;this.pi=new rr({bind:this,touch:s===qi.TOUCH,on:{start:function(){h.copyFrom(o.position)},move:function(t,n,i){h.set(h.x+n,h.y+i),o.position.set(u.toContentX(o,h.x),u.toContentY(o,h.y))}}})}},Object.defineProperty(i.prototype,"scrollbar",{get:function(){var t,n=this.Ec;return null==n&&(n=this.newScrollBar(null===(t=this.Nn)||void 0===t?void 0:t.scrollbar),this.initScrollBar(n),this.Ec=n),n},enumerable:!1,configurable:!0}),i.prototype.newScrollBar=function(t){var n=this;return new Tb(this,t,(function(t){n.onScrollBarUpdate(t)}))},i.prototype.onScrollBarUpdate=function(t){var n=this.Zi;if(null!=n){var i=this.content;t?i.mask!==n&&(i.mask=n,rt.update(this)):i.mask&&(i.mask=null,rt.update(this))}},i.prototype.initScrollBar=function(t){var n=this;t.vertical.on("regionmove",(function(t){n.onScrollBarMoveY(t)})),t.horizontal.on("regionmove",(function(t){n.onScrollBarMoveX(t)}))},i.prototype.onScrollBarMoveX=function(t){var n=this.pi;null!=n&&n.stop(this);var i=this.content;i.x=-i.width*t},i.prototype.onScrollBarMoveY=function(t){var n=this.pi;null!=n&&n.stop(this);var i=this.content;i.y=-i.height*t},i.prototype.getType=function(){return"DPane"},Object.defineProperty(i.prototype,"content",{get:function(){var t=this.Qa;return null==t&&(t=this.toContent(this.Nn),this.initContent(t),this.Qa=t),t},enumerable:!1,configurable:!0}),i.prototype.toContent=function(t){var n=null==t?void 0:t.content;return n?n instanceof Ki?n:this.newContent(n):this.newContent()},i.prototype.newContent=function(t){return new gb(t)},i.prototype.initContent=function(t){var n=this;t.on("move",(function(){n.onContentChange()})),t.on("resize",(function(){n.onContentChange()}))},i.prototype.getOverflowMask=function(){var t=this.Zi;return null==t&&(t=new Yi(this),this.Zi=t,this.reflowable.add(t),this.toDirty()),t},i.prototype.onWheel=function(t,n,i){var r=this.content,e=this.getWheelContentX(r,n.deltaX*n.lowest),u=this.getWheelContentY(r,n.deltaY*n.lowest);if(r.x!==e||r.y!==u){var s=this.pi;return null!=s&&s.stop(this),r.position.set(e,u),!0}return!1},i.prototype.getWheelContentX=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentX(t,t.x-n*i)}return t.x},i.prototype.getWheelContentY=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentY(t,t.y+n*i)}return t.y},i.prototype.toContentX=function(t,n){return Math.min(0,Math.max(this.width-t.width,n))},i.prototype.toContentY=function(t,n){return Math.min(0,Math.max(this.height-t.height,n))},i.prototype.isRefitable=function(t){return n.prototype.isRefitable.call(this,t)&&!(t instanceof mb)},i.prototype.onResize=function(t,i,r,e){var u=this.scrollbar;u.lock(),n.prototype.onResize.call(this,t,i,r,e),u.update(),u.unlock(!0)},i.prototype.onContentChange=function(){this.scrollbar.update()},i.prototype.getFocusedChildClippingRect=function(t,n,i,r,e,u,s,h){return h.x=0,h.y=0,h.width=u,h.height=s,h},i.prototype.onChildFocus=function(r){var e=i.WORK_POINT||new t.Point;i.WORK_POINT=e;var u=this.content,s=u.x,h=u.y,o=u.width,a=u.height;e.set(0,0),r.toGlobal(e,e,!1),u.toLocal(e,void 0,e,!1);var c=s+Math.min(o,Math.max(0,e.x)),f=h+Math.min(a,Math.max(0,e.y));e.set(r.width,r.height),r.toGlobal(e,e,!0),u.toLocal(e,void 0,e,!0);var l=s+Math.min(o,Math.max(0,e.x)),v=h+Math.min(a,Math.max(0,e.y)),b=this.width,d=this.height,g=i.WORK_RECTANGLE||new t.Rectangle;i.WORK_RECTANGLE=g,this.getFocusedChildClippingRect(r,s,h,o,a,b,d,g);var m=g.x,w=g.y,p=m,O=w,D=m+g.width,E=w+g.height,M=null;c<p?l<=D&&(M=s+Math.min(p-c,D-l),M=Math.max(b-o,Math.min(0,M))):D<l&&(M=s-Math.min(c-p,l-D),M=Math.max(b-o,Math.min(0,M)));var S=null;f<O?v<=E&&(S=h+Math.min(O-f,E-v),S=Math.max(d-a,Math.min(0,S))):E<v&&(S=h-Math.min(f-O,v-E),S=Math.max(d-a,Math.min(0,S)));var T=u.position;null!=M?null!=S?T.set(M,S):T.x=M:null!=S&&(T.y=S),n.prototype.onChildFocus.call(this,r)},i.prototype.destroy=function(){var t=this.Zi;null!=t&&(this.Zi=null,t.destroy()),this.mask=null,n.prototype.destroy.call(this)},i}(Ki),Nb=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.Mc;return null==t&&(t=this.newUpdater(this.data,this.content,this.Nn),this.Mc=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new ub(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.$i;return null==t&&(t=this.toData(this.Nn),this.$i=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.items),i=null==t?void 0:t.selection;return null==n?i?new db(this,{selection:i}):new db(this):Wt(n)?new db(this,i?{items:n,selection:i}:{items:n}):"each"in n?n:i?(void 0===n.selection&&(n.selection=i),new db(this,n)):new db(this,n)},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!0),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DList"},n}(jb),Ib=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUpdater=function(t,n,i){return new sb(t,n,n,null==i?void 0:i.updater)},n.prototype.getType=function(){return"DDialogSelectList"},n}(Nb),Cb=function(t){function n(n){var i=t.call(this)||this;return i.Sc=n||function(t){return Promise.resolve([])},i.k=0,i.Tc=0,i.jc=null,i}return _(n,t),n.prototype.create=function(t){var n=this,i=++this.k;this.Sc(t[0]).then((function(t){n.k===i&&(n.Tc=i,n.jc=t,n.emit("success",n,t),n.emit("change",n))}),(function(){n.k===i&&(n.Tc=i,n.jc=null,n.emit("fail",n),n.emit("change",n))})),this.emit("change",this)},n.prototype.isDone=function(){return this.k===this.Tc},n.prototype.getResult=function(){return this.jc},n}(t.utils.EventEmitter),Ab=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputSearch"},n}(bu),Rb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNote"},n}(Ie),yb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmall"},n}(Rb),kb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallError"},n}(yb),Lb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallNoItemsFound"},n}(yb),xb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallSearching"},n}(yb),Bb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(t,n){var i=this;this.At=null;var r=this.theme,e=this.newInput(r,n);this._u=e,t.addChild(this.newInputLayout(t,e,r,n));var u=this.newList(r,n);this.Sn=u,t.addChild(u);var s=null==n?void 0:n.note,h=this.newNoteError(u,s);this.Nc=h;var o=this.newNoteNoItemsFound(u,s);this.Ic=o;var a=this.newNoteSearching(u,s);this.Cc=a;var c=this.toSearch(null==n?void 0:n.controller);this.Sc=c,e.on("input",(function(t){c.create([t])})),c.on("success",(function(t,n){i.onSearched(n)})),c.on("fail",(function(){i.onSearched([])}));var f=new rv;c.on("change",(function(){if(c.isDone()){var t=c.getResult();null!=t?0<t.length?f.hide():f.show(o):f.show(h)}else a&&f.show(a)}))},n.prototype.newInput=function(t,n){return new Ab(this.toInputOptions(t,n))},n.prototype.toInputOptions=function(t,n){var i=(null==n?void 0:n.input)||{};return void 0===i.width&&void 0===i.weight&&(i.weight=1),i},n.prototype.newInputLayout=function(t,n,i,r){return new We(this.toInputLayoutOptions(t,n,i,r))},n.prototype.toInputLayoutOptions=function(t,n,i,r){var e=this.toInputMargin(i,r),u=e.horizontal,s=e.vertical+this.padding.getTop()-t.margin.vertical;return{width:"padding",height:"auto",padding:{bottom:Math.max(0,s)},children:[new ze({width:u}),n,new ze({width:u})]}},n.prototype.toInputMargin=function(t,n){var i,r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin;if(null!=r){if(Xt(r))return{horizontal:r,vertical:r};var e=r.horizontal,u=r.vertical;return{horizontal:null!=e?e:t.getInputMarginHorizontal(),vertical:null!=u?u:t.getInputMarginVertical()}}return{horizontal:t.getInputMarginHorizontal(),vertical:t.getInputMarginVertical()}},n.prototype.toListOptions=function(t,n){var i=(null==n?void 0:n.list)||{};return void 0===i.width&&(i.width="padding"),i},n.prototype.newList=function(t,n){var i=this,r=new Ib(this.toListOptions(t,n));return r.selection.on("change",(function(t){var n=t.first;null!=n&&(i.At=n,i.onOk(n))})),r},n.prototype.toNoteOptions=function(t,n){return null!=n?(null==n.parent&&(n.parent=t),null==n.visible&&(n.visible=!1),n):{parent:t,visible:!1}},n.prototype.newNoteError=function(t,n){var i=null==n?void 0:n.error;return null!==i?new kb(this.toNoteOptions(t,i)):null},n.prototype.newNoteNoItemsFound=function(t,n){var i=null==n?void 0:n.noItemsFound;return null!==i?new Lb(this.toNoteOptions(t,i)):null},n.prototype.newNoteSearching=function(t,n){var i=null==n?void 0:n.searching;return null!=i?new xb(this.toNoteOptions(t,i)):null},n.prototype.toSearch=function(t){if(t){var n=t.search;return"create"in n?n:new Cb(n)}return new Cb},Object.defineProperty(n.prototype,"input",{get:function(){return this._u},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"list",{get:function(){return this.Sn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.At},enumerable:!1,configurable:!0}),n.prototype.onSearched=function(t){this.Sn.data.items=t},n.prototype.getResolvedValue=function(){return this.At},n.prototype.getType=function(){return"DDialogSelect"},n.prototype.onOpen=function(){t.prototype.onOpen.call(this),this.Sn.selection.clear(),this.Sc.create([this._u.value])},n.prototype.onOk=function(n){this.emit("select",n,this),t.prototype.onOk.call(this,n)},n.prototype.destroy=function(){var n,i,r;this._u.destroy(),null===(n=this.Nc)||void 0===n||n.destroy(),null===(i=this.Ic)||void 0===i||i.destroy(),null===(r=this.Cc)||void 0===r||r.destroy(),this.Sn.destroy(),t.prototype.destroy.call(this)},n}(Ke),_b=function(t){return t.value},Pb=function(){},Fb=function(t){function n(n){var i,r,e=t.call(this,function(t){var n,i,r;if(t){var e,u=null===(n=t.text)||void 0===n?void 0:n.formatter;if(void 0!==u){if(!(e=t.dialog)||!("open"in e)){var s=(e=e||{}).item=e.item||{};void 0===(o=s.text=s.text||{}).formatter&&(o.formatter=u)}}else if(!(e=t.dialog)||!("open"in e)){var h=null===(r=null===(i=null==e?void 0:e.item)||void 0===i?void 0:i.text)||void 0===r?void 0:r.formatter;if(void 0!==h){var o=t.text||{};t.text=o,void 0===o.formatter&&(o.formatter=h)}}}return t}(n))||this;return e.Ac=null!==(i=null==n?void 0:n.getter)&&void 0!==i?i:_b,e.Rc=null!==(r=null==n?void 0:n.setter)&&void 0!==r?r:Pb,e}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.dialog,u=null!==(i=this.nu)&&void 0!==i?i:null;this.Rc(e,u),e.open().then((function(){var t=r.Ac(e);t!==u&&(r.text=t,r.emit("change",t,u,r))}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i&&"open"in i?i:new Bb(i),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.nu)&&void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonSelect"},n}(Ae),Ub=function(){function t(){}return t.getInstance=function(){return null==t.INSTANCE&&(t.INSTANCE=new Uu),t.INSTANCE},t}(),Gb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime()),e.emit("change",t,n,e)}))},n.prototype.getDatetimeMask=function(){var t,n,i=this.Ha;return null==i&&(i=Xv.toMask(null===(n=null===(t=this.Nn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Ha=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Uu(i):Ub.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.nu)&&void 0!==t?t:new Date},set:function(t){var n=this.nu;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonTime"},n}(Ae),zb=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=dv.getCommandController();return r.isDisabled=!e.isUndoable(),e.on("change",(function(){r.isDisabled=!e.isUndoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),dv.getCommandController().undo()},n}(Ae),Hb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DCanvas"},n}(Ki),Vb={TOP:0,BOTTOM:1,LEFT:2,RIGHT:3},Wb={INSIDE:0,OUTSIDE:1},Xb=function(){function t(t,n){var i,r;this.yc=null!==(i=null==n?void 0:n.coordinate)&&void 0!==i?i:0,this.P=this.toPosition(t,n),this.kc=this.toTickContainer(t,n),this.Bu=this.toLabel(t,n),this.Bn=null!==(r=null==n?void 0:n.padding)&&void 0!==r?r:t.getPadding(),this.Lc=this.toBar(t,n)}return Object.defineProperty(t.prototype,"coordinateIndex",{get:function(){return this.yc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this.Bn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.P},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bar",{get:function(){return this.Lc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tick",{get:function(){return this.kc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this.Bu},enumerable:!1,configurable:!0}),t.prototype.toPosition=function(t,n){var i=null==n?void 0:n.position;return at(i)?Vb[i]:null!=i?i:t.getPosition()},t.prototype.toBar=function(t,n){var i;return{style:null!==(i=null==n?void 0:n.style)&&void 0!==i?i:t.getStyle(),stroke:this.toBarStroke(t,null==n?void 0:n.stroke),shape:void 0}},t.prototype.toTickContainer=function(t,n){var i,r=null==n?void 0:n.tick;return{enable:null!==(i=null==r?void 0:r.enable)&&void 0!==i?i:t.getTickEnable(),major:this.toTickMajor(t,r),minor:this.toMinorTick(t,r)}},t.prototype.toTickMajor=function(t,n){var i,r,e,u,s,h,o=null==n?void 0:n.major,a=null!==(r=null!==(i=null==o?void 0:o.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMajorTickPosition(),c=null==n?void 0:n.style,f=Tl.from(null!==(u=null!==(e=null==o?void 0:o.style)&&void 0!==e?e:c)&&void 0!==u?u:t.getMajorTickStyle()),l=null==n?void 0:n.stroke,v=this.toTickMajorStroke(t,null==o?void 0:o.stroke,l);return{count:null!==(s=null==o?void 0:o.count)&&void 0!==s?s:t.getMajorTickCount(),size:null!==(h=null==o?void 0:o.size)&&void 0!==h?h:t.getMajorTickSize(),position:this.toTickPosition(a),style:f,stroke:v,text:this.toMajorTickText(t,null==o?void 0:o.text),formatter:this.toMajorTickFormatter(t,o),shapes:void 0,gridline:this.toTickMajorGridline(t,null==o?void 0:o.gridline,c,l)}},t.prototype.toTickMajorGridline=function(t,n,i,r){var e,u,s,h=Tl.from(null!==(u=null!==(e=null==n?void 0:n.style)&&void 0!==e?e:i)&&void 0!==u?u:t.getMajorTickGridlineStyle());return{enable:null!==(s=null==n?void 0:n.enable)&&void 0!==s?s:t.getMajorTickGridlineEnable(),style:h,stroke:this.toTickMajorGridlineStroke(t,null==n?void 0:n.stroke,r),shapes:void 0}},t.prototype.toTickPosition=function(t){var n=this.P;if(t===Wb.OUTSIDE||"OUTSIDE"===t)switch(n){case Vb.TOP:return Q.BOTTOM;case Vb.BOTTOM:return Q.TOP;case Vb.LEFT:return Q.RIGHT;case Vb.RIGHT:return Q.LEFT;default:return Q.TOP}else switch(n){case Vb.TOP:return Q.TOP;case Vb.BOTTOM:return Q.BOTTOM;case Vb.LEFT:return Q.LEFT;case Vb.RIGHT:return Q.RIGHT;default:return Q.TOP}},t.prototype.toMinorTick=function(t,n){var i,r,e,u,s,h,o=null==n?void 0:n.major,a=null!==(r=null!==(i=null==o?void 0:o.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMinorTickPosition(),c=Tl.from(null!==(u=null!==(e=null==o?void 0:o.style)&&void 0!==e?e:null==n?void 0:n.style)&&void 0!==u?u:t.getMinorTickStyle());return{count:null!==(s=null==o?void 0:o.count)&&void 0!==s?s:t.getMinorTickCount(),size:null!==(h=null==o?void 0:o.size)&&void 0!==h?h:t.getMinorTickSize(),position:this.toTickPosition(a),style:c,stroke:this.toTickMinorStroke(t,null==o?void 0:o.stroke,null==n?void 0:n.stroke),shapes:void 0}},t.prototype.toBarStroke=function(t,n){return this.toStroke(n,void 0,t.getStrokeEnable(),t.getStrokeColor(),t.getStrokeAlpha(),t.getStrokeWidth(),t.getStrokeAlign(),t.getStrokeSide(),t.getStrokeStyle())},t.prototype.toTickMajorStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickStrokeEnable(),t.getMajorTickStrokeColor(),t.getMajorTickStrokeAlpha(),t.getMajorTickStrokeWidth(),t.getMajorTickStrokeAlign(),t.getMajorTickStrokeSide(),t.getMajorTickStrokeStyle())},t.prototype.toTickMajorGridlineStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickGridlineStrokeEnable(),t.getMajorTickGridlineStrokeColor(),t.getMajorTickGridlineStrokeAlpha(),t.getMajorTickGridlineStrokeWidth(),t.getMajorTickGridlineStrokeAlign(),t.getMajorTickGridlineStrokeSide(),t.getMajorTickGridlineStrokeStyle())},t.prototype.toTickMinorStroke=function(t,n,i){return this.toStroke(n,i,t.getMinorTickStrokeEnable(),t.getMinorTickStrokeColor(),t.getMinorTickStrokeAlpha(),t.getMinorTickStrokeWidth(),t.getMinorTickStrokeAlign(),t.getMinorTickStrokeSide(),t.getMinorTickStrokeStyle())},t.prototype.toStroke=function(t,n,i,r,e,u,s,h,o){var a,c,f,l,v,b,d,g,m,w,p,O,D,E,M,S,T,j,N,I,C,A,R,y,k,L,x,B;return t?n?{enable:null!==(c=null!==(a=t.enable)&&void 0!==a?a:n.enable)&&void 0!==c?c:i,color:null!==(l=null!==(f=t.color)&&void 0!==f?f:n.color)&&void 0!==l?l:r,alpha:null!==(b=null!==(v=t.alpha)&&void 0!==v?v:n.alpha)&&void 0!==b?b:e,width:null!==(g=null!==(d=t.width)&&void 0!==d?d:n.width)&&void 0!==g?g:u,align:null!==(w=null!==(m=t.align)&&void 0!==m?m:n.align)&&void 0!==w?w:s,side:null!==(O=null!==(p=t.side)&&void 0!==p?p:n.side)&&void 0!==O?O:h,style:null!==(E=null!==(D=t.style)&&void 0!==D?D:n.style)&&void 0!==E?E:o}:{enable:null!==(M=t.enable)&&void 0!==M?M:i,color:null!==(S=t.color)&&void 0!==S?S:r,alpha:null!==(T=t.alpha)&&void 0!==T?T:e,width:null!==(j=t.width)&&void 0!==j?j:u,align:null!==(N=t.align)&&void 0!==N?N:s,side:null!==(I=t.side)&&void 0!==I?I:h,style:null!==(C=t.style)&&void 0!==C?C:o}:n?{enable:null!==(A=n.enable)&&void 0!==A?A:i,color:null!==(R=n.color)&&void 0!==R?R:r,alpha:null!==(y=n.alpha)&&void 0!==y?y:e,width:null!==(k=n.width)&&void 0!==k?k:u,align:null!==(L=n.align)&&void 0!==L?L:s,side:null!==(x=n.side)&&void 0!==x?x:h,style:null!==(B=n.style)&&void 0!==B?B:o}:{enable:i,color:r,alpha:e,width:u,align:s,side:h,style:o}},t.prototype.toMajorTickFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null!=r)return oi.create(r);var e=i.formatter;if(e)return{format:e}}return oi.create(t.getMajorTickTextFormat())},t.prototype.toMajorTickText=function(t,n){return{format:(n=n||{}).format,color:this.toMajorTickTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:n.weight,align:this.toMajorTickTextAlign(t,n.align),offset:this.toMajorTickTextOffset(t,n.offset),style:n.style,outline:this.toMajorTickTextOutline(t,n.outline),spacing:this.toMajorTickTextSpacing(t,n.spacing),direction:this.toTickMajorTextDirection(t,n.direction),padding:this.toMajorTickTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toMajorTickTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toMajorTickTextAlign=function(t,n){var i,r,e=this.P;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextAlignVertical(e)}},t.prototype.toMajorTickTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toMajorTickTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toMajorTickTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextPaddingVertical()}},t.prototype.toTickMajorTextDirection=function(t,n){return null!=n?n:t.getMajorTickTextDirection()},t.prototype.toMajorTickTextColor=function(t,n){return null!=n?n:t.getMajorTickTextColor()},t.prototype.toLabel=function(t,n){var i=null==n?void 0:n.label;if(i)return{value:i.value,color:this.toLabelColor(t,i.color),alpha:i.alpha,family:i.family,size:i.size,weight:i.weight,align:this.toLabelAlign(t,i.align),offset:this.toLabelOffset(t,i.offset),style:i.style,outline:this.toLabelOutline(t,i.outline),spacing:this.toLabelSpacing(t,i.spacing),direction:this.toLabelDirection(t,i.direction),padding:this.toLabelPadding(t,i.padding),clipping:i.clipping}},t.prototype.toLabelOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toLabelAlign=function(t,n){var i,r,e=this.P;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelAlignVertical(e)}},t.prototype.toLabelOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelPaddingVertical()}},t.prototype.toLabelDirection=function(t,n){return null!=n?n:t.getLabelDirection()},t.prototype.toLabelColor=function(t,n){return null!=n?n:t.getLabelColor()},t}(),Kb=function(){function t(t){var n=this.toTheme(t);this.Xt=n,this.ae=0;var i=new Xb(n,t);this.yc=i.coordinateIndex,this.Bn=i.padding,this.P=i.position;var r=i.tick;this.kc=r,this.Bu=i.label,this.Lc=i.bar;var e=r.major.count,u=r.minor.count;this.xc=new Float64Array(3*e),this.Bc=new Float64Array((e+1)*u*3)}return Object.defineProperty(t.prototype,"position",{get:function(){return this.P},enumerable:!1,configurable:!0}),t.prototype.updateBar=function(t){var n=this.Lc.shape;if(n){var i=t.plotArea,r=i.width,e=i.height,u=this.Bn*this.ae;n.disallowUploadedUpdate();var s=n.transform.position,h=n.size;switch(this.P){case Vb.TOP:s.set(.5*r,0-u),h.set(r,0);break;case Vb.BOTTOM:s.set(.5*r,e+u),h.set(r,0);break;case Vb.LEFT:s.set(0-u,.5*e),h.set(0,e);break;case Vb.RIGHT:s.set(r+u,.5*e),h.set(0,e)}n.allowUploadedUpdate()}},t.prototype.updateTicksX=function(t,n,i,r,e,u,s,h,o){var a=this.kc,c=a.major.count,f=a.major.formatter,l=a.minor.count,v=(c+1)*l,b=this.xc,d=this.Bc;i.ticks(t,n,c,l,v,b,d);for(var g=h.a,m=h.tx,w=0;w<c;++w){var p=r[w],O=3*w,D=b[O+0];if(Gu(D))p.visible=!1,u&&(u[w].visible=!1);else{var E=g*b[O+1]+m,M=b[O+2];if(p.disallowUploadedUpdate(),p.visible=!0,p.transform.position.set(E,s),p.text.value=f.format(D,M),p.allowUploadedUpdate(),u){var S=u[w];S.disallowUploadedUpdate(),S.visible=!0,S.transform.position.set(E,.5*o),S.size.set(0,o),S.allowUploadedUpdate()}}}for(w=0;w<v;++w){var T=e[w],j=3*w,N=d[j+0],I=d[j+1];Gu(N)?T.visible=!1:(T.disallowUploadedUpdate(),T.visible=!0,T.transform.position.set(g*I+m,s),T.allowUploadedUpdate())}},t.prototype.updateTicksY=function(t,n,i,r,e,u,s,h,o){var a=this.kc,c=a.major.count,f=a.major.formatter,l=a.minor.count,v=(c+1)*l,b=this.xc,d=this.Bc;i.ticks(t,n,c,l,v,b,d);for(var g=h.d,m=h.ty,w=0;w<c;++w){var p=r[w],O=3*w,D=b[O+0];if(Gu(D))p.visible=!1,u&&(u[w].visible=!1);else{var E=g*b[O+1]+m,M=b[O+2];if(p.disallowUploadedUpdate(),p.visible=!0,p.transform.position.set(s,E),p.text.value=f.format(D,M),p.allowUploadedUpdate(),u){var S=u[w];S.disallowUploadedUpdate(),S.visible=!0,S.transform.position.set(.5*o,E),S.size.set(o,0),S.allowUploadedUpdate()}}}for(w=0;w<v;++w){var T=e[w],j=3*w,N=d[j+0],I=d[j+1];Gu(N)?T.visible=!1:(T.disallowUploadedUpdate(),T.visible=!0,T.transform.position.set(s,g*I+m),T.allowUploadedUpdate())}},t.prototype.updateTicks=function(t){var n=this.kc,i=n.major.shapes,r=n.minor.shapes;if(i&&r){var e=t.plotArea,u=e.getBoundsInContainer(),s=e.container.transform.localTransform,h=n.major.gridline.shapes,o=this.yc,a=this.Bn*this.ae,c=void 0;switch(this.P){case Vb.TOP:if(c=e.coordinate.x.get(o)){var f=c.unmap(c.transform.unmap(u.x)),l=c.unmap(c.transform.unmap(u.x+u.width)),v=e.height;this.updateTicksX(f,l,c,i,r,h,0-a,s,v)}break;case Vb.BOTTOM:(c=e.coordinate.x.get(o))&&(f=c.unmap(c.transform.unmap(u.x)),l=c.unmap(c.transform.unmap(u.x+u.width)),v=e.height,this.updateTicksX(f,l,c,i,r,h,v+a,s,v));break;case Vb.LEFT:if(c=e.coordinate.y.get(o)){f=c.unmap(c.transform.unmap(u.y)),l=c.unmap(c.transform.unmap(u.y+u.height));var b=e.width;this.updateTicksY(f,l,c,i,r,h,0-a,s,b)}break;case Vb.RIGHT:(c=e.coordinate.y.get(o))&&(f=c.unmap(c.transform.unmap(u.y)),l=c.unmap(c.transform.unmap(u.y+u.height)),b=e.width,this.updateTicksY(f,l,c,i,r,h,b+a,s,b))}}},t.prototype.bind=function(t,n){this.tc=t,this.ae=n;var i=t.container,r=this.Lc,e=r.shape;if(!e){var u=(f=this.P)===Vb.LEFT||f===Vb.RIGHT?Q.TOP:Q.LEFT,s=r.style||U.NONE;(e=new Gt).points.position=u,e.points.style=s,e.stroke.copy(r.stroke),e.text.copy(this.Bu),this.Lc.shape=e}e.attach(t.container);var h=this.kc,o=h.major,a=o.gridline,c=a.shapes;if(!c&&h.enable&&a.enable){c=[],a.shapes=c;for(var f,l=(f=this.P)===Vb.LEFT||f===Vb.RIGHT?Q.LEFT:Q.TOP,v=o.count,b=a.style||U.NONE,d=0;d<v;++d){var g=new Gt;g.points.position=l,g.points.style=b,g.stroke.copy(a.stroke),c.push(g)}}if(c){d=0;for(var m=c.length;d<m;++d)c[d].attach(i)}var w=o.shapes;if(!w&&h.enable){w=[],o.shapes=w;var p=o.count,O=o.size,D=o.position,E=o.style||U.NONE;for(d=0;d<p;++d){var M=new Gt;M.points.position=D,M.points.size=O,M.points.style=E,M.stroke.copy(o.stroke),M.text.copy(o.text),M.size.set(0,0),w.push(M)}}if(w)for(d=0,m=w.length;d<m;++d)w[d].attach(i);var S=h.minor,T=S.shapes;if(!T&&h.enable){T=[],S.shapes=T;var j=S.count,N=S.size,I=S.position,C=S.style||U.NONE;for(d=0,m=(o.count+1)*j;d<m;++d){var A=new Gt;A.points.position=I,A.points.size=N,A.points.style=C,A.stroke.copy(S.stroke),A.size.set(0,0),T.push(A)}}if(T)for(d=0,m=T.length;d<m;++d)T[d].attach(i)},t.prototype.unbind=function(){var t=this.Lc.shape;t&&t.detach();var n=this.kc,i=n.major.shapes;if(i)for(var r=0,e=i.length;r<e;++r)i[r].detach();var u=n.major.gridline.shapes;if(u)for(r=0,e=u.length;r<e;++r)u[r].detach();var s=n.minor.shapes;if(s)for(r=0,e=s.length;r<e;++r)s[r].detach();this.tc=void 0},t.prototype.update=function(){var t=this.tc;t&&(this.updateBar(t),this.updateTicks(t))},t.prototype.destroy=function(){var t=this.Lc.shape;t&&t.destroy();var n=this.kc,i=n.major.shapes;if(i)for(var r=0,e=i.length;r<e;++r)i[r].destroy();var u=n.major.gridline.shapes;if(u)for(r=0,e=u.length;r<e;++r)u[r].destroy();var s=n.minor.shapes;if(s)for(r=0,e=s.length;r<e;++r)s[r].destroy();this.tc=void 0},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartAxisBase"},t}(),Yb=function(){function t(t,n){this._c=t,this.tc=new ee,this.Sn=new Map;var i=n&&n.list;if(i)for(var r=0,e=i.length;r<e;++r)this.add(i[r])}return Object.defineProperty(t.prototype,"container",{get:function(){return this.tc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this._c},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var n=this.Sn,i=n.get(t.position);null==i&&(i=[],n.set(t.position,i)),i.push(t),t.bind(this,i.length-1)},t.prototype.get=function(t,n){var i=this.Sn.get(t);return i&&0<=n&&n<i.length?i[n]:null},t.prototype.indexOf=function(t){var n=this.Sn.get(t.position);return n?n.indexOf(t):-1},t.prototype.clear=function(t){var n=this.Sn.get(t);if(n){for(var i=0,r=n.length;i<r;++i)n[i].destroy();n.length=0}return this},t.prototype.size=function(t){var n=this.Sn.get(t);return n?n.length:0},t.prototype.update=function(){this.Sn.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].update()}))},t.prototype.destroy=function(){this.Sn.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].destroy();t.length=0}))},t}(),Jb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisX"},n}(Kb),Zb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisXDatetime"},n}(Jb),qb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisY"},n}(Kb),$b=[1095651,16667680,15778578,1858929],Qb=[$b[0],wt.brighten($b[0],.4),$b[1],wt.brighten($b[1],.4),$b[2],wt.brighten($b[2],.4),$b[3],wt.brighten($b[3],.4)],td=function(t){return Qb[t%Qb.length]},nd={X:0,Y:1},id=function(){function t(t,n){this.tc=t,this.Gt=n,this.Sn=[]}return Object.defineProperty(t.prototype,"container",{get:function(){return this.tc},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.Sn;return null==n?i.push(t):0<=n&&n<i.length?i.splice(n,0,t):i.push(t),t.bind(this,this.Gt),this},t.prototype.get=function(t){var n=this.Sn;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Sn.indexOf(t)},t.prototype.remove=function(t){var n=this.Sn;if(Xt(t)){if(0<=(r=t)&&r<n.length){var i=n.splice(r,1)[0];return i.unbind(),i}}else{var r,e=t;if(0<=(r=n.indexOf(e)))return n.splice(r,1),e.unbind(),e}return null},t.prototype.clear=function(){for(var t=this.Sn,n=0,i=t.length;n<i;++n)t[n].unbind();return t.length=0,this},t.prototype.destroy=function(){return this.clear()},t.prototype.size=function(){return this.Sn.length},t.prototype.fit=function(t,n){for(var i=this.Sn,r=0,e=i.length;r<e;++r)i[r].fit(t,n);return this},t.prototype.mark=function(t,n){for(var i=this.Sn,r=0,e=i.length;r<e;++r)i[r].mark(t,n);return this},t.prototype.blend=function(t){for(var n=this.Sn,i=0,r=n.length;i<r;++i)n[i].blend(t);return this},t}(),rd=function(){function t(t,n){this._c=t;var i=new id(this,nd.X);this._x=i;var r=new id(this,nd.Y);if(this._y=r,n){var e=n.x;if(e)if(Wt(e))for(var u=0,s=e.length;u<s;++u)i.add(e[u]);else i.add(e);var h=n.y;if(h)if(Wt(h))for(u=0,s=h.length;u<s;++u)r.add(h[u]);else r.add(h)}}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this._c},enumerable:!1,configurable:!0}),t.prototype.fit=function(t,n,i,r){return this._x.fit(t,n),this._y.fit(i,r),this},t.prototype.mark=function(t,n,i,r){return this._x.mark(t,n),this._y.mark(i,r),this},t.prototype.blend=function(t){return this._x.blend(t),this._y.blend(t),this},t}(),ed=function(){function t(t){this.Xt=t}return t.prototype.calcStepMajor=function(t,n,i){if(0<i){var r=Math.abs(n-t)/i,e=Math.floor(Math.log(r)/Math.LN10),u=Math.pow(10,e);return this.Xt.toStepScale(r/u)*u}return-1},t.prototype.calcStepMinor=function(t,n){return 0<=t?t/(n+1):-1},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h){if(!(i<=0)){var o=h.transform,a=Math.min(t,n),c=Math.max(t,n),f=this.calcStepMajor(a,c,i);if(f<=0){u[0]=a,u[1]=o.map(h.map(a)),u[2]=0;for(var l=1;l<i;++l)u[0+(M=3*l)]=NaN,u[M+1]=NaN,u[M+2]=NaN;for(l=0;l<e;++l)s[0+(S=3*l)]=NaN,s[S+1]=NaN,s[S+2]=NaN}else{var v=Math.floor(a/f)-1,b=Math.ceil(c/f)+1,d=this.calcStepMinor(f,r),g=0,m=0;for(l=v;l<=b;++l){var w=l*f;if(g<i&&a<=w&&w<=c){var p=o.map(h.map(w));u[0+(M=3*g)]=w,u[M+1]=p,u[M+2]=f,g+=1}for(var O=0;O<r;O+=1)if(m<e){var D=w+(O+1)*d;if(a<=D&&D<=c){var E=o.map(h.map(D));s[0+(S=3*m)]=D,s[S+1]=E,s[S+2]=d,m+=1}}}for(l=g;l<i;++l){var M;u[0+(M=3*l)]=NaN,u[M+1]=NaN,u[M+2]=NaN}for(l=m;l<e;++l){var S;s[0+(S=3*l)]=NaN,s[S+1]=NaN,s[S+2]=NaN}}}},t}(),ud=function(){function t(t){this.Xt=t,this.k=0,this.Pc=0,this.Tn=1,this.Fc=0,this.Uc=1}return Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translate",{get:function(){return this.Pc},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this.Tn},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.set(0,n===nd.X?1:-1)},t.prototype.unbind=function(){},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Pc!==t&&(i=!0,this.Pc=t),null!=n&&this.Tn!==n&&(i=!0,this.Tn=n),i&&(this.k+=1,this.Uc=this.Xt.isZero(this.Tn)?0:1/this.Tn,this.Fc=-this.Pc*this.Uc)},t.prototype.blend=function(t,n){var i=1-t,r=n.newTranslate*t+n.oldTranslate*i,e=n.newScale*t+n.oldScale*i;this.set(r,e)},t.prototype.map=function(t){return this.Pc+this.Tn*t},t.prototype.mapAll=function(t,n,i,r,e){for(var u=this.Pc,s=this.Tn,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.unmap=function(t){return this.Fc+this.Uc*t},t.prototype.unmapAll=function(t,n,i,r,e){for(var u=this.Fc,s=this.Uc,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t}(),sd=function(){function t(){this.oldTranslate=0,this.oldScale=1,this.newTranslate=0,this.newScale=1}return t.prototype.set=function(t,n){null!=t&&(this.newTranslate=t),null!=n&&(this.newScale=n)},t}(),hd=function(){function t(t,n){this.from=t,this.to=n}return t.prototype.set=function(t,n){return null!=t&&(this.from=t),null!=n&&(this.to=n),this},t.prototype.add=function(t,n){return Gu(t)||(this.from=Gu(this.from)?t:Math.min(this.from,t)),Gu(n)||(this.to=Gu(this.to)?n:Math.max(this.to,n)),this},t.prototype.clear=function(){return this.from=NaN,this.to=NaN,this},t}(),od=function(){function t(t){this.k=0,this.Gt=nd.X;var n=this.toTheme(t);this.Xt=n,this.C=new ud(n),this.kc=new ed(n),this.je=new hd(NaN,NaN),this.Gc=new sd}return t.prototype.bind=function(t,n){this.tc=t,this.Gt=n,this.C.bind(t,n)},t.prototype.unbind=function(){this.tc=void 0,this.C.unbind()},t.prototype.fit=function(t,n){this.doFit(t,n,this.C)},t.prototype.mark=function(t,n){var i=this.Gc,r=this.C;i.oldTranslate=r.translate,i.oldScale=r.scale,this.doFit(t,n,i)},t.prototype.blend=function(t){this.C.blend(t,this.Gc)},t.prototype.doFit=function(t,n,i){var r=this.tc;if(r){var e=r.container.plotArea,u=e.padding,s=this.je;switch(this.Gt){case nd.X:this.zc(u.getLeft(),e.width-u.getRight(),this.toFitDomain(t,n,e,s),i);break;case nd.Y:this.zc(e.height-u.getBottom(),u.getTop(),this.toFitRange(t,n,e,s),i)}}},t.prototype.toFitDomain=function(t,n,i,r){return null!=t&&null!=n||i.series.getDomain(this,r),r.set(t,n),r},t.prototype.toFitRange=function(t,n,i,r){return null!=t&&null!=n||i.series.getRange(this,r),r.set(t,n),r},t.prototype.zc=function(t,n,i,r){var e=i.from,u=i.to;if(!Gu(e)&&!Gu(u)){var s,h=u-e,o=t-e*(s=this.Xt.isZero(h)?n<t?-1:1:(n-t)/h);r.set(o,s)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this.C},enumerable:!1,configurable:!0}),t.prototype.map=function(t){return t},t.prototype.mapAll=function(t,n,i,r,e){},t.prototype.unmap=function(t){return t},t.prototype.unmapAll=function(t,n,i,r,e){},t.prototype.ticks=function(t,n,i,r,e,u,s){this.kc.calculate(t,n,i,r,e,u,s,this)},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateLinear"},t}(),ad=function(){function t(t){this.Xt=t}return t.prototype.calcStepMajor=function(t,n,i){if(0<i){var r=Math.abs(n-t)/i,e=Math.floor(Math.log(r)/Math.LN10),u=Math.pow(10,e);return this.Xt.toStepScale(r/u)*u}return-1},t.prototype.calcStepMinor=function(t,n){return 0<=t?t/(n+1):-1},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h){if(!(i<=0)){var o=h.transform,a=h.map(t),c=h.map(n),f=Math.min(a,c),l=Math.max(a,c),v=this.calcStepMajor(f,l,i);if(v<=0){var b=Math.min(t,n);u[0]=b,u[1]=o.map(h.map(b)),u[2]=0;for(var d=1;d<i;++d)u[0+(A=3*d)]=NaN,u[A+1]=NaN,u[A+2]=NaN;for(d=0;d<e;++d)s[0+(R=3*d)]=NaN,s[R+1]=NaN,s[R+2]=NaN}else{var g=Math.floor(f/v)-1,m=Math.ceil(l/v)+1,w=this.calcStepMinor(v,r),p=0,O=0;for(d=g;d<=m;++d){var D=d*v;if(p<i&&f<=D&&D<=l){var E=h.unmap(D),M=o.map(D),S=h.unmap(D-1);u[0+(A=3*p)]=E,u[A+1]=M,u[A+2]=S,p+=1}for(var T=0;T<r;T+=1)if(O<e){var j=D+(T+1)*w;if(f<=j&&j<=l){var N=h.unmap(j),I=o.map(j),C=h.unmap(j-1);s[0+(R=3*O)]=N,s[R+1]=I,s[R+2]=C,O+=1}}}for(d=p;d<i;++d){var A;u[0+(A=3*d)]=NaN,u[A+1]=NaN,u[A+2]=NaN}for(d=O;d<e;++d){var R;s[0+(R=3*d)]=NaN,s[R+1]=NaN,s[R+2]=NaN}}}},t}(),cd=function(){function t(t){this.k=0,this.Gt=nd.X;var n=this.toTheme(t);this.Xt=n,this.C=new ud(n),this.kc=new ad(n),this.je=new hd(NaN,NaN),this.Gc=new sd}return t.prototype.bind=function(t,n){this.tc=t,this.Gt=n},t.prototype.unbind=function(){this.tc=void 0},t.prototype.fit=function(t,n){this.doFit(t,n,this.C)},t.prototype.mark=function(t,n){var i=this.Gc,r=this.C;i.oldTranslate=r.translate,i.oldScale=r.scale,this.doFit(t,n,i)},t.prototype.blend=function(t){this.C.blend(t,this.Gc)},t.prototype.doFit=function(t,n,i){var r=this.tc;if(r){var e=r.container.plotArea,u=e.padding,s=this.je;switch(this.Gt){case nd.X:this.zc(u.getLeft(),e.width-u.getRight(),this.toFitDomain(t,n,e,s),i);break;case nd.Y:this.zc(e.height-u.getBottom(),u.getTop(),this.toFitRange(t,n,e,s),i)}}},t.prototype.toFitDomain=function(t,n,i,r){return null!=t&&null!=n||i.series.getDomain(this,r),r.set(t,n),r},t.prototype.toFitRange=function(t,n,i,r){return null!=t&&null!=n||i.series.getRange(this,r),r.set(t,n),r},t.prototype.zc=function(t,n,i,r){var e=i.from,u=i.to;if(!Gu(e)&&!Gu(u)){var s,h=this.map(e),o=this.map(u)-h,a=t-h*(s=this.Xt.isZero(o)?n<t?-1:1:(n-t)/o);r.set(a,s)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this.C},enumerable:!1,configurable:!0}),t.prototype.map=function(t){return Math.log(Math.max(0,t))/Math.LN10},t.prototype.mapAll=function(t,n,i,r,e){for(var u=1/Math.LN10,s=n+e;s<i;s+=r){var h=t[s];t[s]=Math.log(Math.max(0,h))*u}},t.prototype.unmap=function(t){return Math.pow(10,t)},t.prototype.unmapAll=function(t,n,i,r,e){for(var u=n+e;u<i;u+=r)t[u]=Math.pow(10,t[u])},t.prototype.ticks=function(t,n,i,r,e,u,s){this.kc.calculate(t,n,i,r,e,u,s,this)},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateLog"},t}(),fd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegendItem"},n}(Ki),ld=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegend"},n}(Ki),vd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartOverview"},n}(Ki),bd=function(n){function i(i){var r=n.call(this)||this,e=r.transform;return r.P=new Ei(e.position,i),r.Tn=new Ei(e.scale,i),r.Ci=new t.Rectangle,r}return _(i,n),Object.defineProperty(i.prototype,"position",{get:function(){return this.P},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Tn},enumerable:!1,configurable:!0}),i.prototype.getBounds=function(t,i){return this._lastBoundsID=-1,n.prototype.getBounds.call(this,t,i)},i.prototype.calculateBounds=function(){var t=this._bounds,n=this.je,i=this.Ci,r=this.transform.worldTransform,e=0,u=0,s=0,h=0,o=this.children;if(0<o.length)for(var a=!0,c=0,f=o.length;c<f;++c){var l=o[c];l.visible&&(l.getBoundsInternal(n,!1,i),a?(a=!1,e=i.x,s=i.y,u=i.x+i.width,h=i.y+i.height):(e=Math.min(e,i.x),s=Math.min(s,i.y),u=Math.max(u,i.x+i.width),h=Math.max(h,i.y+i.height)))}t.clear(),n.set(e,s),r.apply(n,n),t.addPoint(n),n.set(u,h),r.apply(n,n),t.addPoint(n)},i}(ee),dd=function(){function t(){this.shape=null,this.x=0,this.y=0,this.p0x=0,this.p0y=0,this.p1x=0,this.p1y=0,this.index=0,this.t=0,this.distance=0}return t.prototype.copyFrom=function(t){return this.shape=t.shape,this.x=t.x,this.y=t.y,this.p0x=t.p0x,this.p0y=t.p0y,this.p1x=t.p1x,this.p1y=t.p1y,this.index=t.index,this.t=t.t,this.distance=t.distance,this},t}(),gd=function(){function t(t,n,i){this.enable=t,this.color=n,this.alpha=i}return t.from=function(n,i,r){var e,u,s;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i))},t}(),md=function(){function t(){}return t.from=function(t,n){return Wt(t)?function(n){return t[n%t.length]}:ot(t)?t:null!=t?function(){return t}:Wt(n)?function(t){return n[t%n.length]}:ot(n)?n:function(){return n}},t}(),wd=function(t){this.enable=md.from(null==t?void 0:t.enable,!0),this.color=md.from(null==t?void 0:t.color,td),this.alpha=md.from(null==t?void 0:t.alpha,Y.FILL_ALPHA)},pd=function(){function t(t,n){this.outer=t,this.inner=n}return t.from=function(n,i,r){var e,u;return new t(null!==(e=null==r?void 0:r.outer)&&void 0!==e?e:n.outer(i),null!==(u=null==r?void 0:r.inner)&&void 0!==u?u:n.inner(i))},t}(),Od=function(t){this.outer=md.from(null==t?void 0:t.outer,.2),this.inner=md.from(null==t?void 0:t.inner,.1)},Dd=function(){function t(t,n){this.x=t,this.y=n}return t.from=function(n,i,r,e,u){var s,h;return new t(null!==(s=null==r?void 0:r.x)&&void 0!==s?s:null!=n.x?n.x(i):e,null!==(h=null==r?void 0:r.y)&&void 0!==h?h:null!=n.y?n.y(i):u)},t}(),Ed=function(t){t&&(null!=t.x&&(this.x=md.from(t.x,0)),null!=t.y&&(this.y=md.from(t.y,0)))},Md=function(){function t(t,n,i,r,e,u,s){this.enable=t,this.color=n,this.alpha=i,this.width=r,this.align=e,this.side=u,this.style=s}return t.from=function(n,i,r){var e,u,s,h,o,a,c;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i),null!==(h=null==r?void 0:r.width)&&void 0!==h?h:n.width(i),null!==(o=null==r?void 0:r.align)&&void 0!==o?o:n.align(i),null!==(a=null==r?void 0:r.side)&&void 0!==a?a:n.side(i),null!==(c=null==r?void 0:r.style)&&void 0!==c?c:n.style(i))},t}(),Sd=function(t){this.enable=md.from(null==t?void 0:t.enable,!0),this.color=md.from(null==t?void 0:t.color,td),this.alpha=md.from(null==t?void 0:t.alpha,Y.STROKE_ALPHA),this.width=md.from(null==t?void 0:t.width,Y.STROKE_WIDTH),this.align=md.from(null==t?void 0:t.width,Y.STROKE_ALIGN),this.side=md.from(null==t?void 0:t.side,xt.ALL),this.style=md.from(null==t?void 0:t.style,s.NON_SCALING)},Td=function(){function t(t,n){var i;this._c=t,this.Hc=new hd(NaN,NaN),this.Vc=new hd(NaN,NaN),this.hc=null!==(i=null==n?void 0:n.selection)&&void 0!==i?i:null,this.A=new wd(null==n?void 0:n.fill),this.Wh=new Sd(null==n?void 0:n.stroke),this.I=new Ed(null==n?void 0:n.size),this.Jt=new Ed(null==n?void 0:n.offset),this.Bn=new Od(null==n?void 0:n.padding),this.Sn=[];var r=n&&n.list;if(r){var e=r.length;if(0<e){for(var u=0;u<e;++u)this.add(r[u]);this.update()}}}return t.prototype.newFill=function(t,n){return gd.from(this.A,t,n)},t.prototype.newStroke=function(t,n){return Md.from(this.Wh,t,n)},t.prototype.newSize=function(t,n,i,r){return Dd.from(this.I,t,n,i,r)},t.prototype.newOffset=function(t,n,i,r){return Dd.from(this.Jt,t,n,i,r)},t.prototype.newPadding=function(t,n){return pd.from(this.Bn,t,n)},Object.defineProperty(t.prototype,"plotArea",{get:function(){return this._c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),t.prototype.update=function(){for(var t=this.Sn,n=0,i=t.length;n<i;++n)t[n].update();var r=this.hc;r&&r.update()},t.prototype.add=function(t){var n=this.Sn;t.bind(this,n.length),n.push(t)},t.prototype.get=function(t){var n=this.Sn;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Sn.indexOf(t)},t.prototype.clear=function(){for(var t=this.Sn,n=0,i=t.length;n<i;++n)t[n].destroy();return t.length=0,this},t.prototype.size=function(){return this.Sn.length},t.prototype.destroy=function(){this.clear();var t=this.hc;t&&t.unbind()},t.prototype.getDomain=function(t,n){n.clear();for(var i=this.Sn,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.x===t){var s=u.domain;n.add(s.from,s.to)}}return n},t.prototype.getRange=function(t,n){n.clear();for(var i=this.Sn,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.y===t){var s=u.range;n.add(s.from,s.to)}}return n},Object.defineProperty(t.prototype,"domain",{get:function(){var t=this.Hc;t.clear();for(var n=this.Sn,i=0,r=n.length;i<r;++i){var e=n[i].domain;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.Vc;t.clear();for(var n=this.Sn,i=0,r=n.length;i<r;++i){var e=n[i].range;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(t,n){for(var i=this.Sn,r=i.length-1;0<=r;--r){var e=i[r];if(e.hitTest(t,n))return e}return null},t.prototype.calcHitPoint=function(n,i,r){var e=r,u=t.WORK_CALCHITPOINT,s=this.Sn,h=null;u.distance=1/0;for(var o=s.length-1;0<=o;--o){var a=s[o];if(a.calcHitPoint(n,i,e)&&e.distance<u.distance){h=a;var c=e;e=u,u=c}}return h&&u!==r&&r.copyFrom(u),h},t.WORK_CALCHITPOINT=new dd,t}(),jd=function(n){function i(t,i){var r=n.call(this,i)||this;return r.Wc=t,r.Xc=0,r.Kc=1e3,r.Yc=null,r.Jc=function(){r.onBlend()},r}return _(i,n),i.prototype.init=function(i){var r,e=this;n.prototype.init.call(this,i);var u=new bd((function(){e.Zc=!0,e.qc=!0,rt.update(e)}));this.tc=u,this.$c=new rd(this,null==i?void 0:i.coordinate);var s=new Td(this,null==i?void 0:i.series);this.Qc=s;var h=new Yb(this,null==i?void 0:i.axis);this.tf=h,this.Zc=!0,this.qc=!0,this.nf=new t.Rectangle,this.Th=new t.Point,this.addChild(u),this.addChild(h.container),this.Ji=new sr(this,(function(){return u}),null==i?void 0:i.view);var o=s.selection;o&&o.bind(s),(null!==(r=null==i?void 0:i.mask)&&void 0!==r?r:this.theme.isOverflowMaskEnabled())&&(u.mask=this.getOverflowMask())},i.prototype.onResize=function(t,i,r,e){this.Zc=!0,this.qc=!0,n.prototype.onResize.call(this,t,i,r,e)},i.prototype.getOverflowMask=function(){return null==this.Zi&&(this.Zi=new Yi(this),this.reflowable.add(this.Zi),this.toDirty()),this.Zi},Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.$c},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chart",{get:function(){return this.Wc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"series",{get:function(){return this.Qc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"container",{get:function(){return this.tc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"axis",{get:function(){return this.tf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"view",{get:function(){return this.Ji},enumerable:!1,configurable:!0}),i.prototype.onWheel=function(t,i,r){var e=this.Ji.onWheel(t,i,r),u=n.prototype.onWheel.call(this,t,i,r);return e||u},i.prototype.onDblClick=function(t,i){var r=this.Ji.onDblClick(t,i),e=n.prototype.onDblClick.call(this,t,i);return r||e},i.prototype.onDown=function(t){this.Ji.onDown(t),n.prototype.onDown.call(this,t)},i.prototype.render=function(t){if(this.Zc){this.Zc=!1,this.tf.update();var i=this.Qc.selection;i&&i.update()}n.prototype.render.call(this,t)},i.prototype.destroy=function(){this.tc.destroy(),this.Qc.destroy(),this.tf.destroy()},i.prototype.getType=function(){return"DChartPlotArea"},i.prototype.getBoundsInContainer=function(){var t=this.nf;if(this.qc){this.qc=!1;var n=this.container;n.updateTransform();var i=n.transform.localTransform,r=this.Th;r.set(0,0),i.applyInverse(r,r),t.x=r.x,t.y=r.y,r.set(this.width,this.height),i.applyInverse(r,r),t.width=r.x-t.x,t.height=r.y-t.y}return t},i.prototype.fit=function(t,n,i,r,e){var u=this.$c,s=this.tf,h=this.Qc;if(null!=t&&t<=0)u.fit(n,i,r,e),s.update(),h.update();else{this.Kc=null!=t?t:200,this.Xc=Date.now(),u.mark(n,i,r,e);var o=this.Yc;null!=o&&window.clearTimeout(o),this.Yc=window.setTimeout(this.Jc,0)}return this},i.prototype.onBlend=function(){var t=(Date.now()-this.Xc)/this.Kc;t<1?this.Yc=window.setTimeout(this.Jc,0):(this.Yc=null,t=1),this.$c.blend(Qi.ELASTIC(t)),this.tf.update(),this.Qc.update()},i}(Ki),Nd=function(){function t(t,n,i){this.Nt=t,this.It=n,this.q=i}return Object.defineProperty(t.prototype,"from",{get:function(){return this.Nt},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.It},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;return null!=t&&this.Nt!==t&&(Gu(this.Nt)&&Gu(t)||(this.Nt=t,i=!0)),null!=n&&this.It!==n&&(Gu(this.It)&&Gu(n)||(this.It=n,i=!0)),i&&this.q(),this},t.prototype.add=function(t,n){var i,r;return Gu(t)||(i=Gu(this.from)?t:Math.min(this.from,t)),Gu(n)||(r=Gu(this.to)?n:Math.max(this.to,n)),this.set(i,r)},t.prototype.clear=function(){return this.set(NaN,NaN)},t}(),Id=function(){function t(t){var n,i,r,e=this.toTheme(t);this.Xt=e;var u=(new ct).add(null!==(n=null==t?void 0:t.state)&&void 0!==n?n:ht.HOVERED);this.Et=u,this.Gu=null!==(i=null==t?void 0:t.enable)&&void 0!==i?i:e.isEnabled(u),this.me=null==t?void 0:t.shape,this._=null!==(r=null==t?void 0:t.style)&&void 0!==r?r:this.setStyle}return t.prototype.bind=function(t){if(this.Gu){var n=this.me||this.newShape(this.Xt);this.me=n,n.attach(t.plotArea.axis.container),n.visible=!1}},t.prototype.unbind=function(){var t=this.me;t&&t.detach()},t.prototype.newShape=function(t){return t.newShape(this.Et)},t.prototype.set=function(t,n,i){this.update(t,n);var r=this.me;r&&this._(r,i)},t.prototype.setStyle=function(t,n){var i=n.shape;i&&(t.stroke.color=i.stroke.color)},t.prototype.unset=function(){var t=this.me;t&&(t.visible=!1)},t.prototype.toTheme=function(t){var n=null==t?void 0:t.theme;return at(n)?this.getTheme(n):null!=n?n:this.getTheme(this.getType())},t.prototype.getTheme=function(t){return K.getInstance().get(t)},t}(),Cd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n){var i=this.me;if(i){var r=n.x,e=t.plotArea.height;i.transform.position.set(r,.5*e),i.size.set(0,e),i.visible=this.isVisible(t,r)}},n.prototype.isVisible=function(t,n){return 0<=n&&n<=t.plotArea.width},n.prototype.getType=function(){return"DChartSelectionGridlineX"},n}(Id),Ad=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n){var i=this.me;if(i){var r=n.y,e=t.plotArea.width;i.transform.position.set(.5*e,r),i.size.set(e,0),i.visible=this.isVisible(t,r)}},n.prototype.isVisible=function(t,n){return 0<=n&&n<=t.plotArea.height},n.prototype.getType=function(){return"DChartSelectionGridlineY"},n}(Id),Rd=function(){function t(t){this._x=new Cd(null==t?void 0:t.x),this._y=new Ad(null==t?void 0:t.y)}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),t.prototype.bind=function(t){this._x.bind(t),this._y.bind(t)},t.prototype.unbind=function(){this._x.unbind(),this._y.unbind()},t.prototype.set=function(t,n,i){this._x.set(t,n,i),this._y.set(t,n,i)},t.prototype.unset=function(){this._x.unset(),this._y.unset()},t.prototype.update=function(t,n){this._x.update(t,n),this._y.update(t,n)},t}(),yd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n){var i=this.me;i&&(i.transform.position.copyFrom(n),i.visible=this.isVisible(t,n))},n.prototype.isVisible=function(t,n){var i=n.x,r=n.y,e=t.plotArea;return 0<=i&&i<=e.width&&0<=r&&r<=e.height},n.prototype.getType=function(){return"DChartSelectionMarker"},n}(Id),kd={PREVIOUS:0,NEXT:1,CLOSER:2,INTERSECTION:3},Ld=function(n){function i(i){var r,e,u,s=n.call(this)||this;s.tc=null,s.Qc=null,s.Gu=null===(r=i.enable)||void 0===r||r,s.if=new Rd(i.gridline),s.R=new yd(i.marker),s.Et=null!==(e=i.state)&&void 0!==e?e:ht.HOVERED,s.rf=null,s.ef=null,s.P=new t.Point,s.tn=null!==(u=i.point)&&void 0!==u?u:kd.CLOSER,s.je=new t.Point;var h=i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return _(i,n),i.prototype.bind=function(t){this.Gu&&(this.tc=t,this.if.bind(t),this.R.bind(t))},i.prototype.unbind=function(){this.R.unbind(),this.if.unbind(),this.tc=null,this.rf=null,this.ef=null},Object.defineProperty(i.prototype,"series",{get:function(){return this.Qc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"position",{get:function(){return this.P},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gridline",{get:function(){return this.if},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"marker",{get:function(){return this.R},enumerable:!1,configurable:!0}),i.prototype.set=function(t,n){var i=this.tc,r=this.rf=t.coordinate.x,e=this.ef=t.coordinate.y;if(i&&r&&e){var u=i.plotArea.container.localTransform,s=this.P,h=this.je;if(n instanceof dd){var o=n.x,a=n.y;switch(this.tn){case kd.PREVIOUS:o=n.p0x,a=n.p0y;break;case kd.NEXT:o=n.p1x,a=n.p1y;break;case kd.CLOSER:Math.abs(n.p0x-n.x)<Math.abs(n.p1x-n.x)?(o=n.p0x,a=n.p0y):(o=n.p1x,a=n.p1y)}h.set(o,a),u.apply(h,h),s.set(r.unmap(r.transform.unmap(o)),e.unmap(e.transform.unmap(a)))}else s.copyFrom(n.position),h.set(r.transform.map(r.map(s.x)),e.transform.map(e.map(s.y))),u.apply(h,h);this.if.set(i,h,t),this.R.set(i,h,t),rt.update(i.plotArea)}var c=this.Qc;if(c!==t){var f=this.Et;c&&c.state.remove(f),this.Qc=t,t.state.add(f)}this.emit("change",this)},i.prototype.setStyle=function(t,n){var i=n.shape;i&&(t.stroke.color=i.stroke.color)},i.prototype.unset=function(){var t=this.Qc;t&&(this.Qc=null,this.rf=null,this.ef=null,t.state.remove(this.Et),this.if.unset(),this.R.unset(),this.emit("change",this))},i.prototype.update=function(){var t=this.tc,n=this.rf,i=this.ef;if(t&&n&&i){var r=this.P,e=this.je;e.set(n.transform.map(n.map(r.x)),i.transform.map(i.map(r.y))),t.plotArea.container.localTransform.apply(e,e),this.if.update(t,e),this.R.update(t,e)}},i}(t.utils.EventEmitter),xd=function(t){function n(n){var i,r=t.call(this)||this;r.tc=null;var e=di(null!==(i=null==n?void 0:n.point)&&void 0!==i?i:kd.CLOSER,kd);r.na=r.newSelected(e,null==n?void 0:n.selected),r.uf=r.newHovered(e,null==n?void 0:n.hovered);var u=null==n?void 0:n.on;if(null!=u)for(var s in u){var h=u[s];h&&r.on(s,h)}return r.sf=function(t){r.onMove(t)},r.hf=function(t){r.onClick(t)},r}return _(n,t),n.prototype.newSelected=function(t,n){return new Ld(this.toSubOptions(t,n,ht.ACTIVE))},n.prototype.newHovered=function(t,n){return new Ld(this.toSubOptions(t,n,ht.HOVERED))},n.prototype.toSubOptions=function(t,n,i){null==(n=n||{}).point&&(n.point=t),null==n.state&&(n.state=i);var r=n.gridline||{},e=r.x||{};null==e.state&&(e.state=i);var u=r.y||{};null==u.state&&(u.state=i);var s=n.marker||{};return null==s.state&&(s.state=i),n},n.prototype.onClick=function(t){var n=this.tc;if(n&&t.target===n.plotArea){var i=this.uf,r=i.series,e=this.na;r?e.set(r,i):e.unset()}},n.prototype.onMove=function(t){var i=this.tc;if(i){var r=this.uf;if(t.target===i.plotArea){var e=n.WORK_SELECT,u=t.data.global,s=i.calcHitPoint(u.x,u.y,e);s?r.set(s,e):r.unset()}else r.unset()}},n.prototype.bind=function(t){this.tc=t,this.na.bind(t),this.uf.bind(t);var n=t.plotArea;n.on(zi.move,this.sf),zi.onClick(n,this.hf)},n.prototype.unbind=function(){var t=this.tc;this.tc=null,t&&t.plotArea.off(zi.move,this.sf),this.na.unbind(),this.uf.unbind()},Object.defineProperty(n.prototype,"selected",{get:function(){return this.na},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hovered",{get:function(){return this.uf},enumerable:!1,configurable:!0}),n.prototype.update=function(){this.na.update(),this.uf.update()},n.WORK_SELECT=new dd,n}(t.utils.EventEmitter),Bd=function(){function t(t,n){var i,r;this.O=t,this.af=null!==(i=null==n?void 0:n.x)&&void 0!==i?i:0,this.cf=null!==(r=null==n?void 0:n.y)&&void 0!==r?r:0,this.ff=NaN,this.lf=NaN,this.vf=NaN,this.bf=NaN}return Object.defineProperty(t.prototype,"x",{get:function(){var t=this.O.container;return t?t.plotArea.coordinate.x.get(this.af):null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){var t=this.O.container;return t?t.plotArea.coordinate.y.get(this.cf):null},enumerable:!1,configurable:!0}),t.prototype.isDirty=function(t,n){var i=t.id,r=n.id,e=i!==this.ff,u=r!==this.lf;return this.ff=i,this.lf=r,e||u},t.prototype.isTransformDirty=function(t,n){var i=t.transform.id,r=n.transform.id,e=i!==this.vf,u=r!==this.bf;return this.vf=i,this.bf=r,e||u},t.prototype.reset=function(){this.ff=NaN,this.lf=NaN},t.prototype.destroy=function(){this.reset()},t}(),_d=function(t){function n(n){var i=t.call(this)||this;i.$c=new Bd(i,null==n?void 0:n.coordinate),i.ae=0,i.Hc=new hd(NaN,NaN),i.Vc=new hd(NaN,NaN),i.df=NaN,i.Et=new ft((function(t,n){i.onStateChange(t,n)}));var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i}return _(n,t),n.prototype.bind=function(t,n){this.tc=t,this.$c.reset(),this.ae=n;var i=t.plotArea.chart;i&&(this.Et.parent=i.state)},n.prototype.unbind=function(){this.tc=void 0},Object.defineProperty(n.prototype,"domain",{get:function(){return this.updateRegion(),this.Hc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"range",{get:function(){return this.updateRegion(),this.Vc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"container",{get:function(){return this.tc||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.ae},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinate",{get:function(){return this.$c},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Et},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){this.tc=void 0,this.$c.destroy()},n.prototype.hitTest=function(t,n){return!1},n.prototype.calcHitPoint=function(t,n,i){return!1},n.prototype.onStateChange=function(t,n){var i;this.toDirty();var r=null===(i=this.tc)||void 0===i?void 0:i.plotArea.chart;rt.update(r),this.emit("statechange",t,n,this)},n}(t.utils.EventEmitter),Pd=function(n){function i(t){var i=n.call(this,t)||this;return i.gf=null,i.Nn=t,i.gt=t&&t.points||[],i.mf=0,i.wf=NaN,i}return _(i,n),i.prototype.getSizeDefault=function(){return 10},i.prototype.getOffsetDefault=function(){return 0},i.prototype.bind=function(t,i){var r=this.gf;if(!r){r=this.gf=this.newLineOfAny();var e=this.Nn;this.initLine(r,e,t,i)}r.attach(t.plotArea.container,i),this.wf=NaN,n.prototype.bind.call(this,t,i)},i.prototype.initLine=function(t,n,i,r){var e=i.newFill(r,null==n?void 0:n.fill);this.A=e,t.fill.copy(e);var u=i.newStroke(r,null==n?void 0:n.stroke);this.Wh=u,t.stroke.copy(u);var s=this.getSizeDefault(),h=i.newSize(r,null==n?void 0:n.size,s,s);this.I=h,t.points.size.set(h.x,h.y);var o=this.getOffsetDefault(),a=i.newOffset(r,n&&n.offset,o,o);this.Jt=a,t.points.offset.set(a.x,a.y)},i.prototype.unbind=function(){var t=this.gf;t&&t.detach(),n.prototype.unbind.call(this)},Object.defineProperty(i.prototype,"shape",{get:function(){return this.gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},set:function(t){this.gt=t,this.mf+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){this.mf+=1},i.prototype.update=function(){var t=this.gf;if(t){var n=this.$c,i=n.x,r=n.y;if(i&&r){var e=this.mf,u=e!==this.wf,s=n.isDirty(i,r),h=n.isTransformDirty(i,r);(u||s||h)&&(this.wf=e,this.updateLine(t,i,r))}}},i.prototype.updateLine=function(t,n,r){for(var e=t.points.values,u=e.length,s=0,h=this.gt,o=NaN,a=NaN,c=NaN,f=NaN,l=0,v=h.length;l<v;l+=2){var b=h[l],d=h[l+1];null!=b&&null!=d&&(s<u?(e[s]=b,e[s+1]=d):e.push(b,d),s+=2,o!=o?(o=b,a=b,c=d,f=d):(o=Math.min(o,b),a=Math.max(a,b),c=Math.min(c,d),f=Math.max(f,d)))}e.length!==s&&(e.length=s),n.mapAll(e,0,s,2,0),r.mapAll(e,0,s,2,1),n.transform.mapAll(e,0,s,2,0),r.transform.mapAll(e,0,s,2,1),o!=o&&(o=0,a=0,c=0,f=0);var g=i.WORK_REGION||{xmin:0,xmax:0,ymin:0,ymax:0};i.WORK_REGION=g,this.adjustLineRegion(o,a,c,f,g),o=n.transform.map(n.map(g.xmin)),a=n.transform.map(n.map(g.xmax)),c=r.transform.map(r.map(g.ymin)),f=r.transform.map(r.map(g.ymax));var m=Math.abs(a-o),w=Math.abs(f-c),p=.5*(o+a),O=.5*(c+f);for(l=0,v=e.length;l<v;l+=2)e[l+0]-=p,e[l+1]-=O;t.disallowUploadedUpdate(),this.applyLine(t,n,r,m,w,p,O,e),t.allowUploadedUpdate(),rt.update(t)},i.prototype.adjustLineRegion=function(t,n,i,r,e){return e.xmin=t,e.xmax=n,e.ymin=i,e.ymax=r,e},i.prototype.applyLine=function(t,n,i,r,e,u,s,h){t.points.set(h),t.size.set(r,e),t.transform.position.set(u,s)},i.prototype.updateRegion=function(){var t=this.mf;if(this.df!==t){this.df=t;var n=this.gt,i=this.Hc,r=this.Vc;i.clear(),r.clear(),this.calcRegion(n,i,r)}},i.prototype.calcRegion=function(t,n,i){for(var r=0,e=t.length;r<e;r+=2){var u=t[r];null!=u&&n.add(u,u);var s=t[r+1];null!=s&&i.add(s,s)}},i.prototype.destroy=function(){var t=this.gf;t&&(this.gf=null,t.detach(),t.destroy()),this.gt.length=0,this.mf=0,this.wf=NaN,n.prototype.destroy.call(this)},i.prototype.hitTest=function(t,n){var r=this.gf;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.gf;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,null,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.calcHitPointTestRange=function(t,n,i,r,e,u,s,h,o){for(var a=Vl(h,t+i+e,2,0),c=0,f=a-1,l=f<<1;0<=f;f-=1,l-=2)if(h[l]<=t-i){c=f;break}return o[0]=c,o[1]=c!==a?a:Math.min(h.length<<1,a+1),o},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v){var b=v.shape;if(b.containsPointAbs(t,n,i,r,e,u,s,h,o,a,c)){var d=b.transform,g=d.position,m=d.scale;v.x=v.p0x=v.p1x=g.x+m.x*s,v.y=v.p0y=v.p1y=g.y+m.y*h,v.t=l,v.index=f;var w=t-(s+e),p=n-(h+u);return v.distance=Math.sqrt(w*w+p*p),!0}return!1},i.WORK=new t.Point,i}(_d),Fd=function(t){function n(n){var i=t.call(this,n)||this;return i.pf=-1,i.Of=-1,i.Df=-1,i.Ef=-1,i.Mf=!1!==(n&&n.size&&n.size.auto),i}return _(n,t),n.prototype.bind=function(n,i){this.pf=-1,this.Of=-1,this.Df=-1,this.Ef=-1,t.prototype.bind.call(this,n,i)},n.prototype.initLine=function(n,i,r,e){t.prototype.initLine.call(this,n,i,r,e),this.Bn=r.newPadding(e,i&&i.padding)},n.prototype.newLineOfAny=function(){return new Ic},n.prototype.getSizeDefault=function(){return 1},n.prototype.adjustLineRegion=function(n,i,r,e,u){return t.prototype.adjustLineRegion.call(this,n,i,Math.min(0,r),Math.max(0,e),u)},n.prototype.updateBarCountAndIndex=function(){if(this.Of<0||this.pf<0){var t=0,i=0,r=this.tc;if(r)for(var e=0,u=r.size();e<u;++e){var s=r.get(e);s===this&&(t=i),s instanceof n&&(i+=1)}return i=Math.max(1,i),this.pf=i,this.Of=t,!0}return!1},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=n.points,c=a.offset,f=a.size,l=this.I,v=this.Jt,b=this.Bn;if(l&&v&&b){var d=i.id,g=i.transform.id;if(this.updateBarCountAndIndex()||this.Df!==d||this.Ef!==g){var m=this.pf,w=this.Of;this.Df=d,this.Ef=g;var p=i.transform.map(i.map(0)),O=i.transform.map(i.map(l.x)),D=Math.abs(p-O)*(1-b.outer);if(m<=1)c.x=v.x,f.x=D;else{var E=D*(1-b.inner),M=E/m,S=M*(w+.5)+w*((D-E)/(m-1));c.x=v.x+S-.5*D,f.x=M}}}var T=f.y;Wt(T)||(T=[]);var j=T.length,N=c.y;Wt(N)||(N=[]);for(var I=N.length,C=0,A=r.transform.map(r.map(0))-h,R=0,y=o.length;R<y;R+=2,C+=1){var k=o[R+1]-A,L=Math.abs(k);C<j?T[C]=L:T.push(L);var x=-.5*k;C<I?N[C]=x:N.push(x)}T.length!==C&&(T.length=C),N.length!==C&&(N.length=C),c.y=N,f.y=T,t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n.prototype.calcSizeX=function(t){var n=this.gt;if(2<n.length)for(var i=n.length,r=n[i-2],e=i-4;0<=e;e-=2){var u=n[e];if(null!=r&&null!=u)return Math.abs(r-u);r=u}return t},n.prototype.calcRegion=function(n,i,r){t.prototype.calcRegion.call(this,n,i,r);var e=this.I;if(e){var u=e.x;this.Mf&&(u=this.calcSizeX(u),e.x=u);var s=.5*u;i.set(i.from-s,i.to+s)}r.add(0,0)},n}(Pd),Ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new wc},n}(Pd),Gd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Mc},n}(Pd),zd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Ic},n}(Pd),Hd=function(t){function n(n){var i=t.call(this,n)||this;return i.Sf=0,i}return _(n,t),n.prototype.newLineOfAny=function(){return new Zc},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=this.I,c=this.Jt;a&&c&&this.Sf!==a.y&&(this.Sf=a.y,n.points.offset.y=c.y-.2*a.y),t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n}(Pd),Vd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Vc},n}(Hd),Wd=function(n){function i(t){var i,r=n.call(this,t)||this;return r.gf=null,r.Nn=t,r.gt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.mf=0,r.wf=NaN,r.Tf=0,r.jf=0,r}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.gf;if(!e){var u=t.newStroke(i,null===(r=this.Nn)||void 0===r?void 0:r.stroke);this.Wh=u,(e=new Ya).stroke.copy(u),this.gf=e}e.attach(t.plotArea.container,i),this.wf=NaN,n.prototype.bind.call(this,t,i)},i.prototype.unbind=function(){var t=this.gf;t&&t.detach(),n.prototype.unbind.call(this)},Object.defineProperty(i.prototype,"shape",{get:function(){return this.gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},set:function(t){this.gt=t,this.mf+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){this.mf+=1},i.prototype.update=function(){var t=this.gf;if(t){var n=this.$c,i=n.x,r=n.y;if(i&&r){var e=this.mf,u=e!==this.wf,s=n.isDirty(i,r),h=n.isTransformDirty(i,r);(u||s||h)&&(this.wf=e,this.updateLine(t,i,r,u||s))}}},i.prototype.updateLine=function(t,n,i,r){if(t.disallowUploadedUpdate(),r){for(var e=t.points.values,u=t.points.segments,s=e.length,h=u.length,o=0,a=0,c=this.gt,f=NaN,l=NaN,v=NaN,b=NaN,d=0,g=c.length;d<g;d+=2){var m=c[d],w=c[d+1];if(null!=m&&null!=w)o<s?(e[o]=m,e[o+1]=w):e.push(m,w),o+=2,f!=f?(f=m,l=m,v=w,b=w):(f=Math.min(f,m),l=Math.max(l,m),v=Math.min(v,w),b=Math.max(b,w));else{var p=(d>>1)-a;a<h?u[a]=p:u.push(p),a+=1}}e.length!==o&&(e.length=o),u.length!==a&&(u.length=a),n.mapAll(e,0,o,2,0),i.mapAll(e,0,o,2,1),f!=f&&(f=0,l=0,v=0,b=0),f=n.map(f),l=n.map(l),v=i.map(v),b=i.map(b);var O=Math.abs(l-f),D=Math.abs(b-v),E=.5*(f+l),M=.5*(v+b);for(d=0,g=e.length;d<g;d+=2)e[d+0]-=E,e[d+1]-=M;t.size.set(O,D),t.points.set(e,u),this.Tf=E,this.jf=M}t.transform.position.set(n.transform.map(this.Tf),i.transform.map(this.jf)),t.transform.scale.set(n.transform.scale,i.transform.scale),t.allowUploadedUpdate(),rt.update(t)},i.prototype.updateRegion=function(){var t=this.mf;if(this.df!==t){this.df=t;var n=this.gt,i=this.Hc,r=this.Vc;if(i.clear(),r.clear(),null!=n)for(var e=0,u=n.length;e<u;e+=2){var s=n[e];null!=s&&i.add(s,s);var h=n[e+1];null!=h&&r.add(h,h)}}},i.prototype.destroy=function(){var t=this.gf;t&&(this.gf=null,t.detach(),t.destroy()),this.gt.length=0,this.mf=0,this.wf=NaN,n.prototype.destroy.call(this)},i.prototype.hitTest=function(t,n){var r=this.gf;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.gf;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointTestRange=function(t,n,i,r,e){var u=Vl(r,t,2,0);return e[0]=Math.max(0,u-1),e[1]=u,e},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=g+p*f,o.y=m+O*l,o.p0x=g+p*i,o.p0y=m+O*r,o.p1x=g+p*e,o.p1y=m+O*u,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(_d),Xd=function(){function t(t,n,i,r){this.k=0,this.Nf=NaN,this._a=t,this._b=n,this._x0=i,this._y0=r}return Object.defineProperty(t.prototype,"a",{get:function(){return this._a},set:function(t){this._a!==t&&(this.k+=1,this._a=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._b},set:function(t){this._b!==t&&(this.k+=1,this._b=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x0",{get:function(){return this._x0},set:function(t){this._x0!==t&&(this.k+=1,this._x0=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y0",{get:function(){return this._y0},set:function(t){this._y0!==t&&(this.k+=1,this._y0=t)},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.k+=1},t.prototype.isDirty=function(){return this.k!==this.Nf},t.prototype.toClean=function(){this.Nf=this.k},t.from=function(n){var i,r,e,u;return new t(null!==(i=null==n?void 0:n.a)&&void 0!==i?i:1,null!==(r=null==n?void 0:n.b)&&void 0!==r?r:1,null!==(e=null==n?void 0:n.x0)&&void 0!==e?e:0,null!==(u=null==n?void 0:n.y0)&&void 0!==u?u:0)},t}(),Kd=function(n){function i(t){var i=n.call(this,t)||this;return i.gf=null,i.Nn=t,i.If=NaN,i.Cf=NaN,i.Af=Xd.from(t),i}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.gf;if(!e){var u=t.newStroke(i,null===(r=this.Nn)||void 0===r?void 0:r.stroke);this.Wh=u,(e=new Ya).stroke.copy(u),this.gf=e}e.attach(t.plotArea.container,i),this.Af.toDirty(),this.If=NaN,this.Cf=NaN,n.prototype.bind.call(this,t,i)},i.prototype.unbind=function(){var t=this.gf;t&&t.detach(),n.prototype.unbind.call(this)},Object.defineProperty(i.prototype,"shape",{get:function(){return this.gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parameters",{get:function(){return this.Af},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){this.Af.toDirty()},i.prototype.update=function(){var t=this.gf,n=this.tc;if(t&&n){var i=n.plotArea,r=this.$c,e=r.x,u=r.y;if(e&&u){var s=i.width,h=i.height,o=this.Af,a=o.isDirty(),c=r.isDirty(e,u),f=r.isTransformDirty(e,u),l=s!==this.If||h!==this.Cf;(a||c||f||l)&&(o.toClean(),this.If=s,this.Cf=h,this.updateLine(t,e,u,s,h))}}},i.prototype.updateLine=function(t,n,i,r,e){var u=t.points.values,s=t.points.segments,h=this.Af,o=h.a,a=h.b,c=h.x0,f=h.y0,l=Math.abs(o),v=Math.abs(a),b=NaN,d=NaN,g=NaN,m=NaN,w=1e-5;if(v<=l){var p=n.unmap(n.transform.unmap(0)),O=n.unmap(n.transform.unmap(r));if(b=Math.min(p,O),g=Math.max(p,O),w<l){var D=a*(i.unmap(i.transform.unmap(0))-f)/o+c,E=a*(i.unmap(i.transform.unmap(e))-f)/o+c,M=Math.min(D,E),S=Math.max(D,E);b<M&&(b=M),S<g&&(g=S)}d=o*(b-c)+a*f,m=o*(g-c)+a*f}else{var T=i.unmap(i.transform.unmap(0)),j=i.unmap(i.transform.unmap(e));if(d=Math.min(T,j),m=Math.max(T,j),w<v){var N=o*(n.unmap(n.transform.unmap(0))-c)/a+f,I=o*(n.unmap(n.transform.unmap(r))-c)/a+f,C=Math.min(N,I),A=Math.max(N,I);d<C&&(d=C),A<m&&(m=A)}b=a*(d-f)+o*c,g=a*(m-f)+o*c}b=n.transform.map(n.map(b)),d=i.transform.map(i.map(d));var R=.5*(b+(g=n.transform.map(n.map(g)))),y=.5*(d+(m=i.transform.map(i.map(m)))),k=Math.abs(g-b),L=Math.abs(m-d);b-=R,d-=y,g-=R,m-=y,4!==u.length?(u.length=0,u.push(b,d,g,m)):(u[0]=b,u[1]=d,u[2]=g,u[3]=m),0<s.length&&(s.length=0),t.disallowUploadedUpdate(),t.points.set(u,s),t.size.set(k,L),t.transform.position.set(R,y),t.allowUploadedUpdate(),rt.update(t)},i.prototype.updateRegion=function(){},i.prototype.destroy=function(){var t=this.gf;t&&(this.gf=null,t.detach(),t.destroy()),n.prototype.destroy.call(this)},i.prototype.hitTest=function(t,n){var r=this.gf;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.gf;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,null,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=o.p0x=o.p1x=g+p*f,o.y=o.p0y=o.p1y=m+O*l,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(_d),Yd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n);var r=this.plotArea;this.addChild(r),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:this.theme.isOverflowMaskEnabled())&&(r.axis.container.mask=this.getOverflowMask())},n.prototype.getOverflowMask=function(){return null==this.Zi&&(this.Zi=new Yi(this),this.reflowable.add(this.Zi),this.toDirty()),this.Zi},Object.defineProperty(n.prototype,"plotArea",{get:function(){var t=this._c;return null==t&&(t=this.newPlotArea(),this._c=t),t},enumerable:!1,configurable:!0}),n.prototype.newPlotArea=function(){var t;return new jd(this,null===(t=this.Nn)||void 0===t?void 0:t.plotArea)},n.prototype.getType=function(){return"DChart"},n.prototype.destroy=function(){var n;this._destroyed||(null===(n=this._c)||void 0===n||n.destroy(),t.prototype.destroy.call(this))},n}(Ki),Jd=function(){function t(){}return t.prototype.redo=function(){throw new Error("Method not implemented.")},t.prototype.undo=function(){throw new Error("Method not implemented.")},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE|ov.CLEAR},t}(),Zd=function(){function t(){}return t.prototype.execute=function(){return dv.getDocumentController().delete()},t.prototype.redo=function(){throw new Error("Method not implemented.")},t.prototype.undo=function(){throw new Error("Method not implemented.")},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE|ov.CLEAR},t}(),qd=function(){function t(t){this.kh=t}return t.prototype.execute=function(){return dv.getDocumentController().saveAs(this.kh)},t.prototype.redo=function(){return!0},t.prototype.undo=function(){return!0},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE},t}(),$d=function(){function t(){}return t.prototype.execute=function(){return dv.getDocumentController().save()},t.prototype.redo=function(){return!0},t.prototype.undo=function(){return!0},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE},t}(),Qd=function(t){function n(n,i){var r=t.call(this)||this;r.O=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),n.prototype.createAsUrl=function(t){return null==t||Xt(t)?this.create({size:t,extractor:function(t){return Jl.base64({target:t})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(t){return Jl.base64({target:t})}})},n.prototype.createAsFile=function(t,n){at(t)?this.create({extractor:function(n){Jl.file({target:n,filename:t})}}):null===t||Xt(t)?this.create({size:t,extractor:function(t){Jl.file({target:t,filename:n})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(n){Jl.file({target:n,filename:t.filename})}})},n.prototype.toScale=function(t,n){return null==t?1:t/rt.getResolution(n)/Math.max(n.width,n.height)},n.prototype.toCleanupSnap=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.snap},n.prototype.toCleanupBackground=function(t){if(null==t)return!1;var n=t.cleanup;return null!=n&&!1!==n&&(!0===n||!0===n.background)},n.prototype.toCleanupRefit=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.refit},n.prototype.toCleanupReflow=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.reflow},n.prototype.create=function(t){var n=this.O,i=n.canvas;if(i){var r=n.view,e=r.position,u=r.scale,s=e.x,h=e.y,o=u.x,a=u.y,c=this.toScale(t.size,i);r.transform(0,0,c,c,0);var f=void 0;if(this.toCleanupSnap(t)&&"snap"in i){var l=i.snap;null!=l&&((f=l.container).renderable?f.renderable=!1:f=void 0)}var v=void 0;this.toCleanupBackground(t)&&((v=i.snippet).renderable?v.renderable=!1:v=void 0);var b=this.toCleanupRefit(t),d=this.toCleanupReflow(t);if(b||d){var g=rt.getLayer(i);g&&(b&&g.refit(),d&&g.reflow())}this.emit("taking",i,this);var m=t.extractor(i);return this.emit("took",i,null,this),v&&(v.renderable=!0),null!=f&&(f.renderable=!0),r.transform(s,h,o,a,0),m}},n}(t.utils.EventEmitter),tg=function(t){function n(n){var i,r=t.call(this,n)||this;return r.Rf=null,r.yf=null==n?void 0:n.tile,r.kf=null==n?void 0:n.controller,r.Lf=null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:r.theme.isAmbient(),r.xf=new Qd(r,null==n?void 0:n.snapshot),r}return _(n,t),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.xf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"controller",{get:function(){return this.kf||null},enumerable:!1,configurable:!0}),n.prototype.set=function(t){var n=this.Rf;n!==t&&(n&&(this.Rf=null,this.onUnset()),this.Rf=t,t&&this.onSet(t))},n.prototype.onSet=function(t){var n=this,i=this.newCanvas(t),r=t.pieces,e=this.isEditMode();ua.toPieceData(this.kf,r,e).then((function(u){n.newLayer(t,i,e,r,u)})),this.canvas=i},n.prototype.newLayer=function(t,n,i,r,e){var u=this,s=n.layer,h=new Fo(t,r,e,i);if(ua.newLayer(t,s,h).then((function(t){s.init(),u.initialize(t),n.initialize(t),rt.update(u),u.emit("ready",u)})),this.Lf){var o=this.toCanvasBaseBackgroundOptions(t,this.theme,!1);this.background.color=o.color,this.background.alpha=o.alpha}},n.prototype.toCanvasBaseOptions=function(t){var n,i=this.theme,r=this.Lf;return{name:t.name,width:t.width,height:t.height,background:this.toCanvasBaseBackgroundOptions(t,i,r),border:r?{color:null}:void 0,outline:r?{color:null}:void 0,shadow:r?null:i.getCanvasShadow(),tile:{factory:this.yf,mapping:null===(n=t.tile)||void 0===n?void 0:n.mapping},ambient:r}},n.prototype.toCanvasBaseBackgroundOptions=function(t,n,i){var r,e;if(i)return{color:null};var u=t.background;return{color:null!==(r=null==u?void 0:u.color)&&void 0!==r?r:n.getCanvasBackgroundColor(),alpha:null!==(e=null==u?void 0:u.alpha)&&void 0!==e?e:n.getCanvasBackgroundAlpha()}},n.prototype.openByName=function(t){var n=this,i=this.kf;i&&i.getByName(t).then((function(t){n.set(ua.toSerialized(t))}))},n.prototype.initialize=function(t){},n.prototype.onUnset=function(){this.canvas&&(this.canvas=null)},n.prototype.get=function(){return this.Rf},Object.defineProperty(n.prototype,"layer",{get:function(){var t=this.canvas;return t?t.layer.active:null},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DDiagramBase"},n}(hr),ng=function(){function t(t,n){this.zn=t,this.Rh=n}return t.prototype.getTheme=function(){return this.zn.getTheme()},t.prototype.setTheme=function(t){this.zn.setTheme(t)},t.prototype.getBaseColor=function(){return this.Rh},t.prototype.setBaseColor=function(t){this.Rh=t},t.prototype.getColor=function(t){var n=this.zn,i=this.Rh,r=n.getColor(t);return null!=i?null!=r?wt.blend(i,r,n.getAlpha(t)):i:r},Object.defineProperty(t.prototype,"color",{get:function(){return this.zn.color},set:function(t){this.zn.color=t},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){return null!=this.Rh?1:this.zn.getAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.zn.alpha},set:function(t){this.zn.alpha=t},enumerable:!1,configurable:!0}),t}(),ig=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),Object.defineProperty(n.prototype,"lon",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lat",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!0}),n.prototype.toObject=function(){return{lon:this.x,lat:this.y}},n}(t.ObservablePoint),rg=function(){function t(t,n,i,r,e,u){if(this.Bf=t,!0===n||!1===n)this.S=n,this.Nt=new ig(t,null,i,r),this.It=new ig(t,null,e,u);else if(null!=n){this.S=n.enable;var s=n.from,h=n.to;this.Nt=new ig(t,null,s.lon,s.lat),this.It=new ig(t,null,h.lon,h.lat)}else this.S=!1,this.Nt=new ig(t,null,-180,85.05112877980659),this.It=new ig(t,null,180,-85.05112877980659)}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.Bf())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.Nt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.It},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{enable:this.S,from:this.Nt.toObject(),to:this.It.toObject()}},t}(),eg=function(){function t(t,n){var i=this;this.Yi=t,this._f=null==n?void 0:n.factory,this.Io=new rg((function(){i.onMappingChange()}),null==n?void 0:n.mapping)}return t.prototype.init=function(){this.onMappingChange()},t.prototype.onMappingChange=function(){var t=this._f;if(t){var n,i=this.Io;i.enable?(n=this.Pf)?n.mapping=i:this.Pf=t(this.Yi).fit():(n=this.Pf)&&(this.Pf=void 0,n.destroy())}},Object.defineProperty(t.prototype,"pyramid",{get:function(){return this.Pf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"factory",{get:function(){return this._f},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapping",{get:function(){return this.Io},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{mapping:this.Io.serialize()}},t.prototype.destroy=function(){var t=this.Pf;null!=t&&(this.Pf=void 0,t.destroy())},t}(),ug=function(t){function n(n){var i=t.call(this)||this;i.name=n,i.interactive=!1,i.reference=0;var r=i.newShape();return r.parent=i,i.me=r,i.interactives=[],i}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.me.size.x},set:function(t){this.me.size.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.me.size.y},set:function(t){this.me.size.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"background",{get:function(){return this.me.fill},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.me.state},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){var t=new vf;return t.fill.set(!1,16777215,1),t.stroke.set(!1),t.state.add(zo.INTERACTIVE),t},n.prototype.initialize=function(t,n,i){var r=this.interactives,e=this.me,u=e.state.is(zo.INTERACTIVE),s=e.state.is(zo.DRAGGABLE),h=e.state.is(zo.PINCHABLE);if(s||h){var o=new Jt(e);e.runtime=o;var a=(s?xr.DRAG:xr.NONE)|(h?xr.PINCH:xr.NONE);o.actions.push(new oe("",a).toRuntime()),i.push(e),o.initialize(e)}(u||s||h)&&(e.interactive=!0,r.push(e)),this.doInitialize(this.children,t,r,i,n)},n.prototype.doInitialize=function(t,n,i,r,e){for(var u=function(u,h){for(var o=t[u],a=o.data,c=0,f=a.size();c<f;++c){var l=a.get(c);if(l){var v=l.id;if(0<v.length){var b=n[v];null==b&&(b=[],n[v]=b),b.push(l)}}}var d=o.id;if(0<d.length){var g=e[d];null==g?e[d]=[o]:g.push(o)}var m=o.runtime;if(m){(o.interactive||0<o.cursor.length||m.interactive)&&i.push(o),m.isActionable()&&r.push(o);var w=o.shortcut;null!=w&&Kt.on(o,w,(function(t){m.onClick(o,t)})),m.initialize(o)}var p=o.children;0<p.length&&s.doInitialize(p,n,i,r,e)},s=this,h=0,o=t.length;h<o;++h)u(h)},n.prototype.hitTestInteractives=function(t){for(var n=this.je,i=this.interactives,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible&&(e.toLocal(t,void 0,n),null!=e.contains(n.x,n.y)))return e}return null},n.prototype.addUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},n.prototype.updateUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},n.prototype.destroy=function(){if(!this._destroyed){for(var n=this.children,i=n.length-1;0<=i;--i)n[i].destroy();n.length=0,t.prototype.destroy.call(this)}},n.prototype.serialize=function(t,n,i){for(var r=this.children,e=0,u=r.length;e<u;++e){var s=r[e].serialize(n);s[16]=t,i.push(s)}var h=this.me,o=n.addResource(this.name||""),a=(this.visible?1:0)|(h.state.is(zo.INVISIBLE)?0:2),c=this.position,f=h.size,l=h.fill.serialize(n),v=h.state.is(zo.INTERACTIVE)?1:0,b=h.state.is(zo.DRAGGABLE)?2:0,d=h.state.is(zo.PINCHABLE)?4:0;return[o,a,c.x,c.y,f.x,f.y,l,v|b|d]},n.deserialize=function(t,i,r,e){var u,s,h,o=new n(this.deserializeName(t[0],i)),a=o.me,c=t[1];null!=c&&(!i.isEditMode||1&c||(o.visible=!1),2&c||(a.state.add(zo.INVISIBLE),i.isEditMode||(o.visible=!1)));var f=t[2],l=t[3];o.position.set(f,l);var v=null!==(u=t[4])&&void 0!==u?u:r,b=null!==(s=t[5])&&void 0!==s?s:e;a.size.set(v,b);var d=t[6];null!=d&&a.fill.deserialize(d,i);var g=null!==(h=t[7])&&void 0!==h?h:1;return a.state.set(zo.INTERACTIVE,!!(1&g)),a.state.set(zo.DRAGGABLE,!!(2&g)),a.state.set(zo.PINCHABLE,!!(4&g)),o},n.deserializeName=function(t,n){if(at(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""},n}(ee),sg=function(t){function n(n,i){var r=t.call(this)||this;return r.Fu=null,r.Mt=n,r.nn=i,r.interactive=!1,r.interactiveChildren=!1,r}return _(n,t),n.prototype.init=function(){if(null==this.Fu){var t=this.children,n=t.length;0<n&&(this.Fu=t[n-1])}},Object.defineProperty(n.prototype,"active",{get:function(){return this.Fu},set:function(t){this.Fu!==t&&(null==t||0<=this.children.indexOf(t))&&(this.Fu=t,this.onLayerChange())},enumerable:!1,configurable:!0}),n.prototype.create=function(t,n){var i=new ug(t);return this.attach(i,n),i},n.prototype.attach=function(t,n){this.addChild(t),!0===n&&(this.Fu=t),this.onLayerChange(),rt.update(this)},n.prototype.attachAt=function(t,n,i){this.addChildAt(t,n),!0===i&&(this.Fu=t),this.onLayerChange(),rt.update(this)},n.prototype.detach=function(t,n){var i=this.children,r=i.indexOf(t);0<=r&&(this.Fu=n,i.splice(r,1),t.parent=void 0,this.onLayerChange(),rt.update(this))},n.prototype.delete=function(t,n){var i=this.children,r=i.indexOf(t);return 0<=r&&(i.splice(r,1),t.parent=void 0,this.Fu===t&&(!0===n?r<i.length?this.Fu=i[r]:0<i.length?this.Fu=i[r-1]:this.Fu=null:this.Fu=null),this.onLayerChange(),rt.update(this)),r},n.prototype.get=function(t){var n=this.children[t];return null!=n?n:null},n.prototype.clear=function(){var t=this.children;if(0<t.length){for(var n=t.length-1;0<=n;--n){var i=t[n];i.parent=null,i.destroy()}t.length=0,this.onLayerChange(),rt.update(this)}},n.prototype.destroy=function(){this._destroyed||(this.clear(),t.prototype.destroy.call(this))},n.prototype.size=function(){return this.children.length},n.prototype.onLayerChange=function(){this.emit("change",this)},n.prototype.serialize=function(t,n){for(var i=[],r=this.children,e=0,u=r.length;e<u;++e)r[e].addUuid(t);for(e=0,u=r.length;e<u;++e)r[e].updateUuid(t);for(e=0,u=r.length;e<u;++e)i.push(r[e].serialize(e,t,n));return i},n.prototype.deserialize=function(t,n){var i=t.length;if(0<i){for(var r=this.Mt,e=this.nn,u=0;u<i;++u)this.addChild(ug.deserialize(t[u],n,r,e));this.onLayerChange(),rt.update(this)}},n}(t.Container),hg=function(t){function n(n){var i=t.call(this,n)||this,r=i.theme;i.isAmbient(r,n)||(i.gn=new ng(i.gn,i.toBackgroundBase(r,n)));var e=new sg(i.width,i.height);i.gu=e,i.addChild(e);var u=new eg(i,null==n?void 0:n.tile);return i.Ff=u,u.init(),i}return _(n,t),n.prototype.isAmbient=function(t,n){var i;return null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:t.isAmbient()},n.prototype.toBackgroundBase=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.background)||void 0===i?void 0:i.base)&&void 0!==r?r:t.getBackgroundBase()},Object.defineProperty(n.prototype,"tile",{get:function(){return this.Ff},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"layer",{get:function(){return this.gu},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t){},n.prototype.destroy=function(){this._destroyed||(this.Ff.destroy(),this.gu.destroy(),t.prototype.destroy.call(this))},n.prototype.hitTest=function(t,n){for(var i=this.gu.children,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible){var u=e.hitTest(t,n);if(null!=u)return u}}return null},n.prototype.getType=function(){return"DDiagramCanvasBase"},n}(Hb),og=function(){function t(t,n,i){var r=this;this.O=t;var e=i.controller;this.kf=e;var u=function(){r.onChange()};e.grid.on("change",u),e.target.on("change",u);var s=new ee;s.visible=!1,this.tc=s,t.addChildAt(s,t.children.length-1),this.Uf=this.toGrid(n,i.grid),this.zn=this.toTarget(n,i.target)}return t.prototype.toGrid=function(t,n){var i;return{major:this.toGridMajor(t,null==n?void 0:n.major),minor:this.toGridMinor(t,null==n?void 0:n.minor),size:null!==(i=null==n?void 0:n.size)&&void 0!==i?i:t.getSnapGridSize()}},t.prototype.toGridMajor=function(t,n){var i,r,e,u,s;return{interval:null!==(i=null==n?void 0:n.interval)&&void 0!==i?i:t.getSnapGridMajorInterval(),color:null!==(r=null==n?void 0:n.color)&&void 0!==r?r:t.getSnapGridMajorColor(),alpha:null!==(e=null==n?void 0:n.alpha)&&void 0!==e?e:t.getSnapGridMajorAlpha(),width:null!==(u=null==n?void 0:n.width)&&void 0!==u?u:t.getSnapGridMajorWidth(),style:null!==(s=null==n?void 0:n.style)&&void 0!==s?s:t.getSnapGridMajorStyle()}},t.prototype.toGridMinor=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapGridMinorColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapGridMinorAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapGridMinorWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapGridMinorStyle()}},t.prototype.toTarget=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapTargetColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapTargetAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapTargetWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapTargetStyle()}},t.prototype.onChange=function(){var t=this.O;t.toDirty(),rt.update(t)},Object.defineProperty(t.prototype,"container",{get:function(){return this.tc},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return this.kf.serialize()},t.prototype.onReflow=function(){var t=this.O,n=this.tc,i=this.kf,r=i.grid.visible,e=i.target.visible;if(r||e){var u=t.width,s=t.height,h=.5*u,o=.5*s,a=Q.TOP,c=Q.LEFT,f=n.children,l=0;if(r){for(var v=this.Uf,b=v.major,d=v.minor,g=b.interval,m=v.size(i.grid.size,u,s),w=m,p=1;w<u;w+=m,p+=1,l+=1){var O=p%g==0?b:d;this.update(n,f,l,w,o,a,u,s,O)}for(var D=m,E=1;D<s;D+=m,E+=1,l+=1)O=E%g==0?b:d,this.update(n,f,l,h,D,c,u,s,O)}if(e)for(var M=i.target.values,S=this.zn,T=0,j=M.length;T<j;T+=1,l+=1){var N=M[T],I=N.position;N.type===Cl.VERTICAL?this.update(n,f,l,I,o,a,u,s,S):this.update(n,f,l,h,I,c,u,s,S)}for(T=l,j=f.length;T<j;++T)f[T].visible=!1;n.visible=!0}else n.visible=!1},t.prototype.update=function(t,n,i,r,e,u,s,h,o){var a=null;i<n.length?((a=n[i]).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate()):((a=new Gt).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate(),a.attach(t))},t}(),ag=function(t){function n(n){var i=t.call(this,n)||this;return i.Gf=i.toSnap(i.theme,n.snap),i}return _(n,t),n.prototype.toSnap=function(t,n){return n?new og(this,t,n):null},Object.defineProperty(n.prototype,"snap",{get:function(){return this.Gf},enumerable:!1,configurable:!0}),n.prototype.serialize=function(t,n){var i,r=new jl,e=[],u=this.gn,s=u.color,h=u.alpha;return{version:1,id:t,name:this.name,width:this.width,height:this.height,background:{color:Xt(s)?s:16777215,alpha:Xt(h)?h:0},tile:this.Ff.serialize(),resources:r.resources,data:r.data,pieces:r.pieces,layers:this.gu.serialize(r,e),items:e,snap:null===(i=this.Gf)||void 0===i?void 0:i.serialize(),thumbnail:null==n?void 0:n.serialize()}},n.prototype.onReflow=function(){var n;t.prototype.onReflow.call(this),null===(n=this.Gf)||void 0===n||n.onReflow()},n.prototype.getType=function(){return"DDiagramCanvasEditor"},n}(hg),cg=function(n){function i(t){var i=n.call(this,t)||this,r={};return i.data=r,i.tags=r,i.actionables=[],i.ids={},i.zf=new Set,i}return _(i,n),i.prototype.initialize=function(){for(var t=Date.now(),n=this.data,i=this.actionables,r=this.ids,e=this.gu.children,u=0,s=e.length;u<s;++u)e[u].initialize(n,r,i);for(u=0,s=e.length;u<s;++u)for(var h=e[u].children,o=0,a=h.length;o<a;++o)h[o].update(t)},i.prototype.hitTestInteractives=function(t){for(var n=this.gu.children,i=n.length-1;0<=i;--i){var r=n[i];if(r.visible){var e=r.hitTestInteractives(t);if(null!=e)return e}}return null},i.prototype.onShapeMove=function(t){var n=this.hitTestInteractives(t.data.global),i=rt.getLayer(this);if(i){var r=i.view,e=this.toShapeCursor(n),u=r.style;u.cursor!==e&&(u.cursor=e);var s=this.toShapeTitle(n);r.title!==s&&(r.title=s)}var h=this.Hf;if(this.Hf=n,n===h){if(null!=n){var o=n.runtime;o&&o.onMove(n,t)}}else this.onShapeOut(t,h,n),this.onShapeOver(t,n);return null!=n},i.prototype.toShapeCursor=function(t){if(null!=t){var n=t.cursor;if(0<n.length)return n}return"auto"},i.prototype.toShapeTitle=function(t){return null!=t&&t.title||""},i.prototype.onShapeOut=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Dt;){var r=n.runtime;r&&r.onOut(n,t),n=n.parent}},i.prototype.onShapeOver=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Dt;){var r=n.runtime;r&&r.onOver(n,t),n=n.parent}},i.prototype.onShapeDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Vf=n,n){this.zf.add(n);for(var i=n;;){var r=i.runtime;r&&r.onDown(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}return!0}return!1},i.prototype.onShapeUp=function(t){var n=this.zf,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onUp(r,t);var u=r.parent;if(!(u instanceof Dt))break;r=u}}return this.onShapeCancel(t),null!=i},i.prototype.onShapeCancel=function(t){var n=this.zf;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onUpOutside(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}})),n.clear(),!0)},i.prototype.onShapeClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Vf===n){for(var i=n;;){var r=i.runtime;r&&r.onClick(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}return!0}return!1},i.prototype.onShapeDblClick=function(n,r){var e,u=null!==(e=i.WORK_DBLCLICK)&&void 0!==e?e:i.WORK_DBLCLICK=new t.Point;zi.toGlobal(n,r,u);var s=this.hitTestInteractives(u);if(s){for(var h=s;;){var o=h.runtime;o&&o.onDblClick(h,n,r);var a=h.parent;if(!(a instanceof Dt))break;h=a}return!0}return!1},i.prototype.getType=function(){return"DDiagramCanvas"},i}(hg),fg=function(){function t(t){this.kf=t&&t.controller}return t.prototype.set=function(t,n,i){var r=this.kf;r&&r.write(t,n)},t}(),lg=function(){function t(t,n){this.Wf=t,this.Xf=n&&n.mapper||null,this.Kf=new fg(n&&n.remote)}return t.prototype.update=function(){},Object.defineProperty(t.prototype,"mapper",{get:function(){return this.Xf},set:function(t){this.Xf=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remote",{get:function(){return this.Kf},enumerable:!1,configurable:!0}),t.prototype.getIds=function(){var t=this.Wf.canvas;return null!=t?Object.keys(t.data):[]},t.prototype.each=function(t){var n=this.Wf.canvas;if(null!=n){var i=n.data;for(var r in i)if(!1===t(r))return r}return null},t.prototype.set=function(t,n,i,r,e){var u=this.Wf.canvas;if(null!=u){var s=u.data[t];if(null!=s)for(var h=0,o=s.length;h<o;++h){var a=s[h];a.range.set(r,e),void 0!==i&&(a.time=i),a.value=n}}},t.prototype.clear=function(t){var n=this.Wf.canvas;if(null!=n){var i=n.data[t];if(null!=i)for(var r=0,e=i.length;r<e;++r)i[r].clear()}},t.prototype.setAll=function(t,n,i,r,e){var u=this.Wf.canvas;if(null!=u){var s=u.data[t];if(null!=s)for(var h=0,o=s.length;h<o;++h){var a=s[h];a.range.set(r,e),void 0!==i&&(a.times=i),a.values=n}}},t.prototype.setValue=function(t,n,i){var r=this.Wf.canvas;if(null!=r){var e=r.data[t];if(null!=e)for(var u=0,s=e.length;u<s;++u){var h=e[u];void 0!==i&&(h.time=i),h.value=n}}},t.prototype.setValues=function(t,n,i){var r=this.Wf.canvas;if(null!=r){var e=r.data[t];if(null!=e)for(var u=0,s=e.length;u<s;++u){var h=e[u];void 0!==i&&(h.times=i),h.values=n}}},t.prototype.setTime=function(t,n){var i=this.Wf.canvas;if(null!=i){var r=i.data[t];if(null!=r)for(var e=0,u=r.length;e<u;++e)r[e].time=n}},t.prototype.setTimes=function(t,n){var i=this.Wf.canvas;if(null!=i){var r=i.data[t];if(null!=r)for(var e=0,u=r.length;e<u;++e)r[e].times=n}},t.prototype.setRange=function(t,n,i){var r=this.Wf.canvas;if(null!=r){var e=r.data[t];if(null!=e)for(var u=0,s=e.length;u<s;++u){var h=e[u].range;void 0!==n&&(null!==n?(h.type|=St.FROM,h.from=n):h.type&=~St.FROM),void 0!==i&&(null!==i?(h.type|=St.TO,h.to=i):h.type&=~St.TO)}}},t}(),vg=function(){function t(t,n,i){this.xf=t,this.Gu=this.toIsEnabled(n,i),this.Nn=this.toCreateAsUrlOptions(n,i)}return t.prototype.toIsEnabled=function(t,n){var i;return null!==(i=null==n?void 0:n.enable)&&void 0!==i?i:t.isThumbnailEnabled()},t.prototype.toSize=function(t,n){return void 0!==n?n:t.getThumbnailSize()},t.prototype.toCleanup=function(t,n){var i,r;return null==n||!0===n?{snap:!0,background:!0}:!1===n?{snap:!1,background:!1}:{snap:null===(i=n.snap)||void 0===i||i,background:null===(r=n.background)||void 0===r||r}},t.prototype.toCreateAsUrlOptions=function(t,n){return{size:this.toSize(t,null==n?void 0:n.size),cleanup:this.toCleanup(t,null==n?void 0:n.cleanup)}},Object.defineProperty(t.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.Nn.size},set:function(t){this.Nn.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cleanup",{get:function(){return this.Nn.cleanup},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){if(this.Gu)return this.xf.createAsUrl(this.Nn)},t}(),bg=function(t){function n(n){var i=t.call(this,n)||this;return i.xt=!1,i.xt=!1,dv.getCommandController().on("dirty",(function(){!0!==i.xt&&(i.xt=!0,i.emit("change",i))})),i.Yf=new Ll(i),i.Jf=new vg(i.xf,i.theme,null==n?void 0:n.thumbnail),i}return _(n,t),Object.defineProperty(n.prototype,"thumbnail",{get:function(){return this.Jf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"snapper",{get:function(){return this.Yf},enumerable:!1,configurable:!0}),n.prototype.isEditMode=function(){return!0},n.prototype.newCanvas=function(t){return new ag(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){var n=this.toCanvasBaseOptions(t),i=this.Yf,r=n.snap;return null==r?n.snap={controller:i}:null==r.controller&&(r.controller=i),n},n.prototype.serialize=function(){var t=this.canvas,n=this.Rf;if(null!=t&&null!=n){this.emit("serializing",t,this);try{var i=t.serialize(n.id,this.Jf);return this.emit("serialized",t,null,this),i}catch(n){return this.emit("serialized",t,"exception",this),null}}return null},n.prototype.save=function(){var t=this,n=this.serialize();if(null!=n){var i=this.kf;if(i){var r=ua.toSimple(n);return this.emit("saving",r,this),i.save(r).then((function(i){t.xt=!1,n.id=i,t.Rf=n,t.emit("change",t),t.emit("saved",null,t)}),(function(n){t.emit("saved",n,t)}))}return this.emit("saved","no-controller",this),Promise.reject()}return this.emit("saved",null,this),Promise.resolve()},n.prototype.saveAs=function(t){var n=this,i=this.serialize();if(null!=i){var r=this.kf;if(r){i.id=void 0,i.name=t;var e=ua.toSimple(i);return this.emit("saving",e,this),r.save(e).then((function(r){n.xt=!1,i.id=r,n.Rf=i;var e=n.canvas;null!=e&&(e.name=t),n.emit("change",n),n.emit("saved",null,n)}),(function(t){n.emit("saved",t,n)}))}return this.emit("saved","no-controller",this),Promise.reject("no-controller")}return this.emit("saved",null,this),Promise.resolve()},n.prototype.delete=function(){var t=this,n=this.Rf;if(n&&null!=n.id){var i=this.kf;return i?(this.emit("deleting",this),i.delete(n.id).then((function(){t.set(null),t.emit("deleted",t)}),(function(n){t.emit("deleted",n,t)}))):(this.emit("deleted","no-controller",this),Promise.reject("no-controller"))}return this.set(null),this.emit("deleted",null,this),Promise.resolve()},n.prototype.create=function(t,n,i){this.set({version:1,id:void 0,name:t,width:n,height:i,resources:[],data:[],layers:[["Default layer"]],items:[],snap:void 0})},n.prototype.onSet=function(n){t.prototype.onSet.call(this,n);var i=n.snap,r=this.Yf;null!=i?r.deserialize(i):r.reset(),this.Lf&&(r.target.visible=!1,r.grid.visible=!1),this.xt=!1,this.emit("change",this)},n.prototype.onUnset=function(){t.prototype.onUnset.call(this),this.xt=!1,this.emit("change",this)},n.prototype.open=function(t){var n=this,i=this.kf;return i?(this.emit("opening",this),i.get(t).then((function(t){n.set(ua.toSerialized(t)),n.emit("opened",null,n)}),(function(t){n.emit("opened",t,n)}))):(this.emit("opened","no-controller",this),Promise.reject("no-controller"))},n.prototype.close=function(){this.set(null)},n.prototype.isChanged=function(){return this.xt||this.isNew()},n.prototype.isNew=function(){var t=this.Rf;return null!=t&&null==t.id},n.prototype.getName=function(){var t=this.Rf;return null!=t?t.name:null},n.prototype.getType=function(){return"DDiagramEditor"},n}(tg),dg=function(t){function n(n){var i=t.call(this)||this;return i.Wf=n,i.ko=function(){rt.update(n)},i}return _(n,t),n.prototype.update=function(){var t=this.Wf.canvas;if(t){var n=t.actionables;if(0<n.length){for(var i=-1,r=Date.now(),e=0,u=n.length;e<u;++e){var s=n[e];s.update(r);var h=s.runtime;if(h&&r<h.effect){var o=h.effect;r<o&&(i=i<0?o:Math.min(i,o))}}0<=i&&setTimeout(this.ko,i-Date.now())}}},n.prototype.onRender=function(t){var n=this.Wf.canvas;if(n){var i=n.actionables;if(0<i.length){for(var r=-1,e=Date.now(),u=0,s=i.length;u<s;++u){var h=i[u];h.onRender(e,t);var o=h.runtime;if(o&&e<o.effect){var a=o.effect;e<a&&(r=r<0?a:Math.min(r,a))}}0<=r&&setTimeout(this.ko,r-Date.now())}}},n.prototype.get=function(t){var n,i=null===(n=this.Wf.canvas)||void 0===n?void 0:n.ids[t];return i&&0<i.length?i[0]:null},n.prototype.getAll=function(t){var n;return(null===(n=this.Wf.canvas)||void 0===n?void 0:n.ids[t])||[]},n.prototype.each=function(t,n){void 0===n&&(n=!1);var i=this.Wf.canvas;if(null!=i){var r=i.layer.children;if(n){for(e=r.length-1;0<=e;--e)for(h=(s=r[e].children).length-1;0<=h;--h)if(!1===t(a=s[h]))return a}else for(var e=0,u=r.length;e<u;++e)for(var s,h=0,o=(s=r[e].children).length;h<o;++h){var a;if(!1===t(a=s[h]))return a}}return null},n}(t.utils.EventEmitter),gg=function(t){function n(n){var i=t.call(this,n)||this;i.on(zi.move,(function(t){var n=i.canvas;n&&n.onShapeMove(t)})),i.on(zi.up,(function(t){var n=i.canvas;n&&n.onShapeUp(t)})),i.on(zi.upoutside,(function(t){var n=i.canvas;n&&n.onShapeCancel(t)})),i.on(zi.cancel,(function(t){var n=i.canvas;n&&n.onShapeCancel(t)})),zi.onClick(i,(function(t){var n=i.canvas;n&&n.onShapeClick(t)}));var r=new lg(i,n&&(n.data||n.tag));return i.data=r,i.tag=r,i.shape=new dg(i),i}return _(n,t),n.prototype.initialize=function(t){this.initializeShapes(t,null,this.data.mapper)},n.prototype.initializeShapes=function(t,n,i){for(var r={},e={},u=new Map,s=0,h=t.length;s<h;++s){for(var o=t[s],a=Rs[o.type]||Jt,c=o.runtime=new a(o),f=o.data,l=0,v=f.size();l<v;++l){var b=f.get(l);if(b){i&&i(b,n||o);var d=b.format,g=b.initial;if(d in r)b.formatter=r[d];else if(0<d.length)try{var m=Function("value","try {return ("+d+");} catch( e1 ) {try {return ("+(0<g.length?g:0)+");} catch( e2 ) {return 0;}}");r[d]=m,b.formatter=m}catch(t){}if(g in e)b.value=e[g];else if(0<g.length)try{b.value=e[g]=Function("try {return ("+g+");} catch( e ) {return 0;}")()}catch(t){}}}var w=o.action.values,p=c.actions;for(l=0,v=w.length;l<v;++l){var O=w[l],D=u.get(O);null==D?null!=(D=O.toRuntime())&&(D instanceof nu&&o.cursor.length<=0&&(o.cursor="pointer"),u.set(O,D),p.push(D),c.reset|=D.reset):(p.push(D),c.reset|=D.reset)}var E=o.children;0<E.length&&this.initializeShapes(E,this.toDataShape(n,o),i)}},n.prototype.toDataShape=function(t,n){return null!=t?t:n.type===r.EMBEDDED?n:null},n.prototype.isEditMode=function(){return!1},n.prototype.newCanvas=function(t){return new cg(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){return this.toCanvasBaseOptions(t)},n.prototype.onDown=function(n){var i;t.prototype.onDown.call(this,n,null===(i=this.canvas)||void 0===i?void 0:i.onShapeDown(n))},n.prototype.onDblClick=function(n,i){var r;return t.prototype.onDblClick.call(this,n,i,null===(r=this.canvas)||void 0===r?void 0:r.onShapeDblClick(n,i))},n.prototype.render=function(n){this.shape.onRender(n),t.prototype.render.call(this,n)},n.prototype.getType=function(){return"DDiagram"},n}(tg),mg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmMessage"},n}(pf),wg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.message)},n.prototype.toMessage=function(t,n){var i=null==n?void 0:n.message;return null!=i?at(i)||ot(i)?this.newMessage(this.toMessageOptions(i)):i instanceof Ki?i:this.newMessage(this.toMessageOptionsMerged(i,t.getMessage())):this.newMessage(this.toMessageOptions(t.getMessage()))},n.prototype.toMessageOptionsMerged=function(t,n){var i=t.text;return null==i&&(i={},t.text=i),void 0===i.value&&(i.value=n),t},n.prototype.toMessageOptions=function(t){return{text:{value:t}}},n.prototype.newMessage=function(t){return new mg(t)},Object.defineProperty(n.prototype,"message",{get:function(){var t=this.Zf;return null==t&&(t=this.toMessage(this.theme,this.Nn),this.Zf=t),t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){},n.prototype.getType=function(){return"DDialogConfirm"},n}(Ke),pg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDelete"},n}(wg),Og=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDiscard"},n}(wg),Dg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogMessage"},n}(wg),Eg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogProcessingMessage"},n}(mg),Mg=function(t){function n(n){var i,r=t.call(this,n)||this;r.qf=!0,r.Hn=0;var e=null==n?void 0:n.delay;r.$f=null!==(i=null==e?void 0:e.done)&&void 0!==i?i:r.theme.getDoneDelay();var u=null==e?void 0:e.close;return r.Qf=void 0!==u?u:r.theme.getCloseDelay(),r.tl=r.message.text,r}return _(n,t),n.prototype.newMessage=function(t){return new Eg(t)},n.prototype.onOpen=function(){this.qf=!1,this.Hn=Date.now();var n=this.nl;null!=n&&clearTimeout(n);var i=this.il;null!=i&&clearTimeout(i);var r=this.message;r.text=this.tl,r.state.removeAll(ht.SUCCEEDED,ht.FAILED);var e=this.ku;null!=e&&e.hide(),t.prototype.onOpen.call(this)},n.prototype.onDone=function(t){var n=this;null!=t?this.il=window.setTimeout((function(){n.close()}),t):this.close()},n.prototype.onResolved=function(t){null!=t&&(this.message.text=t),this.message.state.set(ht.SUCCEEDED,ht.FAILED);var n=this.Qf;if(null!=n)this.onDone(n);else{var i=this.ku;null!=i?i.show():this.close()}},n.prototype.onRejected=function(t){null!=t&&(this.message.text=t),this.message.state.set(ht.FAILED,ht.SUCCEEDED);var n=this.ku;null!=n?n.show():this.onDone(this.Qf)},n.prototype.resolve=function(t){var n=this;if(!this.qf){this.qf=!0;var i=Date.now()-this.Hn,r=this.$f-i;0<r?this.nl=window.setTimeout((function(){n.nl=void 0,n.onResolved(t)}),r):this.onResolved(t)}},n.prototype.reject=function(t){var n=this;if(!this.qf){this.qf=!0;var i=Date.now()-this.Hn,r=this.$f-i;0<r?this.nl=window.setTimeout((function(){n.nl=void 0,n.onRejected(t)}),r):this.onRejected(t)}},n.prototype.onCloseOn=function(){this.qf&&t.prototype.onCloseOn.call(this)},n.prototype.getType=function(){return"DDialogProcessing"},n}(wg),Sg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(){var n=dv.getDocumentController().getName();null!=n&&(this.input.value=n),t.prototype.onOpen.call(this)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=dv.getCommandController();at(n)?i.push(new qd(n)):n.then((function(t){i.push(new qd(t))}))},n.prototype.getType=function(){return"DDialogSaveAs"},n}(du),Tg=function(){function t(t){this.Au=t,this.rl=[]}return t.prototype.indexOf=function(t){return this.rl.indexOf(t)},t.prototype.close=function(t){for(var n=this.rl,i=Math.max(0,t),r=n.length-1;i<=r;--r)n[r].close()},t.prototype.add=function(t){this.rl.push(t)},t.prototype.trim=function(t){this.close(this.indexOf(t)+1)},t.prototype.remove=function(t){var n=this.indexOf(t);0<=n&&(this.close(n+1),this.rl.splice(n,1))},t}(),jg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u=this;t.prototype.init.call(this,n),this.pu=function(){u.onPrerender()},this.St=di(null!==(i=null==n?void 0:n.align)&&void 0!==i?i:ke.BOTTOM,ke),this.el=null!==(r=null==n?void 0:n.fit)&&void 0!==r&&r,this.Mu=null!==(e=null==n?void 0:n.sticky)&&void 0!==e&&e,this.ul=!1,this.Au=null,this.vo=null,this.visible=!1,Pe.apply(this,(function(){u.close()})),this.on("select",(function(){u.close()}));var s=null==n?void 0:n.items;s&&jf.newItems(this,s,this.Mu),this.Tu=new Fe(n)},n.prototype.findItem=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof Df&&e.value===t)return e}return null},n.prototype.getType=function(){return"DMenu"},n.prototype.getContext=function(){return this.vo},n.prototype.getCloseable=function(){return this},n.prototype.open=function(n,i,r){if(this.isHidden()){var e=this.Tu.pick(this);this.Au=n;for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof Ki&&o.state.removeAll(ht.FOCUSED,ht.HOVERED)}var a=e.renderer,c=this.pu;if(this.Mu?a.on("prerender",c):a.once("prerender",c),this.el){var f=n.getBounds();null!=f&&(this.width=f.width)}this.ul=null!=r,r=r||new Tg(n),null!=i&&r.trim(i),r.add(this),this.vo=r,e.stage.addChild(this),this.ju=e.getFocusController().get(),this.focus(),t.prototype.show.call(this),this.emit("open",this)}return this},n.prototype.onPrerender=function(){var t=this.Au;if(t){var n=t.getBounds();if(n){this.el&&(this.width=n.width);var i=this.Tu.picked;if(i){var r=this.theme;Le.attach(this,n,r.getOffsetX(),r.getOffsetY(),i.width,i.height,this.St)}}}},n.prototype.close=function(){if(this.isShown()){var n=this.vo;n&&n.remove(this);var i=this.Tu.picked;i&&i.renderer.off("prerender",this.pu),this.Au=null;var r=this.ju;if(null!=r)if(this.ju=null,i){var e=rt.getLayer(r);null!=e&&i!==e&&e.view.focus(),i.getFocusController().focus(r)}else this.blur(!0);else this.blur(!0);t.prototype.hide.call(this);var u=this.parent;u&&u.removeChild(this),this.emit("close",this)}return this},n.prototype.onKeyDown=function(n){return Kt.moveFocusVertically(n,this,this.Tu),this.state.isActionable&&(Kt.isArrowLeftKey(n)||Kt.isCancelKey(n))&&this.close(),t.prototype.onKeyDown.call(this,n)},n.prototype.containsGlobalPoint=function(t){return!this.ul},n}(Xe);jf.setMenuCreator((function(t){return new jg(t)}));var Ng=function(t){function n(n){return t.call(this,n)||this}return _(n,t),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this)},n.prototype.onMenuClose=function(t){if(t){var n=this.sl;n&&t.off("select",n);var i=this.hl;i&&t.off("close",i)}},n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof jg?i:new jg(this.toMenuOptions(t,i))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!0),n):{fit:!0}},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this.Jh;return null==t&&(t=this.toMenu(this.theme,this.Nn),this.Jh=t),t},set:function(t){var n=this.Jh;n!=t&&(this.Jh=t,this.onMenuReplaced(t,n))},enumerable:!1,configurable:!0}),n.prototype.onMenuReplaced=function(t,n){null!=n&&this.onMenuClose(n)},n.prototype.getType=function(){return"DDropdownBase"},n.prototype.onKeyDown=function(n){return Kt.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onClick(t),0))},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.start()},n.prototype.start=function(){var t=this,n=this.menu;if(n.isHidden()){var i=this.sl;null==i&&(i=function(n,i,r){t.onMenuSelect(n,i,r)},this.sl=i);var r=this.hl;null==r&&(r=function(){t.onMenuClose(t.Jh)}),n.on("select",i),n.on("close",r),n.open(this)}},n.prototype.close=function(){this.menu.close()},n}(Ce),Ig=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDropdown"},n}(Ng),Cg=function(t){function n(n){var i=t.call(this,n)||this;return i.on(zi.down,(function(t){i.state.isActionable&&i.onSelect(t)})),i}return _(n,t),n.prototype.onSelect=function(t){this.emit("select",this)},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},n.prototype.getType=function(){return"DExpandableHeader"},n}(pf),Ag=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i=this;n.prototype.init.call(this,t);var r=this.theme,e=this.toHeader(r,t);this.Qh=e,e.on("select",(function(){i.toggle()})),this.addChild(e);var u=this.toBody(r,t);this.no=u,this.addChild(u),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.toHeader=function(n,i){return i&&i.header?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new Cg(n)},i.prototype.toBody=function(t,n){return n.body},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.no;t instanceof Ki?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.no;t instanceof Ki?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.getType=function(){return"DExpandable"},i}(Xe),Rg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new ou(t)},n}(Nv),yg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new Ql(this,this.newOperation(),this.theme,this.Nn)},n.prototype.getType=function(){return"DInputTextArea"},n}(uu),kg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DListItemAmbient"},n}(ib),Lg=function(){function t(t){void 0===t&&(t=256),this.ol=t}return t.prototype.getTileSize=function(){return this.ol},t.prototype.lonLatToMeters=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x*r/180,i.y=Math.log(Math.tan((90+n.y)*Math.PI/360))*r/Math.PI,i},t.prototype.metersToLonLat=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x/r*180,i.y=360*Math.atan(Math.exp(n.y*Math.PI/r))/Math.PI-90,i},t.prototype.pixelsToMeters=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=n.x*u-s,e.y=s-n.y*u,e},t.prototype.metersToPixels=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=(n.x+s)/u,e.y=(s-n.y)/u,e},t.prototype.pixelsToTile=function(t,n,i){return i.x=Math.ceil(t.x/n)-1,i.y=Math.ceil(t.y/n)-1,i},t.prototype.metersToTile=function(n,i,r){var e=t.CIRCUMFERENCE_HALF,u=1<<i;return r.x=Math.ceil(.5*(n.x/e+1)*u)-1,r.y=Math.ceil(.5*(1-n.y/e)*u)-1,r},t.prototype.lonLatToTile=function(t,n,i){return this.metersToTile(this.lonLatToMeters(t,i),n,i)},t.prototype.lonLatToPixels=function(t,n,i,r){return this.metersToPixels(this.lonLatToMeters(t,r),n,i,r)},t.prototype.pixelsToLonLat=function(t,n,i,r){return this.metersToLonLat(this.pixelsToMeters(t,n,i,r),r)},t.prototype.tileToPixels=function(t,n,i){return i.x=t.x*n,i.y=t.y*n,i},t.prototype.tileToMeters=function(n,i,r){var e=this.toResolutionMeter(i),u=t.CIRCUMFERENCE_HALF;return r.x=n.x*e+u,r.y=u-n.y*e,r},t.prototype.toResolutionMeter=function(n){return 2*t.CIRCUMFERENCE_HALF/(1<<n)},t.prototype.toResolution=function(n,i){return 2*t.CIRCUMFERENCE_HALF/(i<<n)},t.prototype.toTileCount=function(t){return 1<<t},t.prototype.toTileCode=function(t,n,i){return(n<<t)+i},t.CIRCUMFERENCE_HALF=6378137*Math.PI,t}(),xg=function(){function t(){}return Object.defineProperty(t,"DEFAULT",{get:function(){return null==this.th&&(this.th=new Lg),this.th},enumerable:!1,configurable:!0}),t}(),Bg=function(){function n(n,i,r,e,u,s){this.tx=i,this.ty=r;var h=new t.Sprite(t.Texture.EMPTY);h.parent=n,h.position.set(e,u),h.scale.set(s,s),this.al=h}return n.prototype.load=function(n,i){var r=t.Texture.from(n,{resolution:1});this.al.texture=r,r.valid?i():r.on("update",i)},n.prototype.transform=function(t,n,i){var r=this.al;r.position.set(t,n),r.scale.set(i,i)},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.al.texture.valid},enumerable:!1,configurable:!0}),n.prototype.render=function(t){var n=this.al;n.updateTransform(),n.render(t)},n.prototype.destroy=function(){var n=this.al,i=n.texture,r=i.baseTexture.resource,e=null;r instanceof t.resources.BaseImageResource&&r.source instanceof HTMLImageElement&&(e=r.source),i.destroy(!0),n.destroy(),e&&(e.src="")},n}(),_g=function(){function n(t,n,i,r,e,u){var s=this;this.O=t,this.he=n,this.cl=u,this.fl=!1,this.ll=!0,this.vl=function(){s.onLoaded()},this.bl=i,this._lon0=NaN,this._lat0=NaN,this._lon1=NaN,this._lat1=NaN,this.dl=new Map,this.ml=function(t){s.renderTile(t)},this.wl=NaN,this.pl=NaN,this.Ol=NaN,this.Dl=NaN,this.El=function(t,n,i){s.deleteTile(t,n,i)},this.Ml=function(t){s.destroyTile(t)},this.Sl=function(t){t.loaded||(s.Tl=!1)},this.jl=e.toTileCount(i),this.Nl=1/this.jl,this.Il=r.scale*this.Nl,this.ol=e.getTileSize()*r.scale,this.Io=r,this.$c=e,this.Tl=!0}return n.prototype.newTile=function(t,n,i,r,e){return new Bg(this.O,t,n,i,r,e)},n.prototype.renderTile=function(t){t.render(this.se)},Object.defineProperty(n.prototype,"tz",{get:function(){return this.bl},enumerable:!1,configurable:!0}),n.prototype.render=function(t){this.se=t,this.dl.forEach(this.ml)},n.prototype.move=function(t,i,r,e){var u=this._lon0,s=this._lat0,h=this._lon1,o=this._lat1;if(u!==t||s!==i||h!==r||o!==e){this._lon0=t,this._lat0=i,this._lon1=r,this._lat1=e;var a=this.bl,c=this.$c,f=n.WORK;f.set(t,i),c.lonLatToTile(f,a,f);var l=f.x,v=f.y;f.set(r,e),c.lonLatToTile(f,a,f);var b=f.x,d=f.y,g=this.jl,m=Math.max(0,l),w=Math.min(g-1,b),p=Math.max(0,v),O=Math.min(g-1,d),D=m-this.wl,E=w-this.pl,M=p-this.Ol,S=O-this.Dl,T=D!=D||D<0||1<D,j=E!=E||0<E||E<-1,N=M!=M||M<0||1<M,I=S!=S||0<S||S<-1;if(T||j||N||I){T?this.wl=m:m=this.wl,j?this.pl=w:w=this.pl,N?this.Ol=p:p=this.Ol,I?this.Dl=O:O=this.Dl,this.dl.forEach(this.El);var C=m+w>>1,A=p+O>>1,R=Math.max(C-m,w-C),y=Math.max(A-p,O-A),k=Math.max(R,y);this.toOffset(f);var L=f.x,x=f.y;this.fl=!1,this.ll=!1,this.loadTile(a,C,A,L,x,f);for(var B=1;B<=k;++B){var _=C-B;m<=_&&this.loadTilesY(a,_,A,B,p,O,L,x,f);var P=C+B;P<=w&&this.loadTilesY(a,P,A,B,p,O,L,x,f);var F=A-B;p<=F&&this.loadTilesX(a,C,B-1,m,w,F,L,x,f);var U=A+B;U<=O&&this.loadTilesX(a,C,B-1,m,w,U,L,x,f)}this.ll=!0,this.fl&&this.onLoaded()}}},n.prototype.loadTilesX=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,u,s,h,o);for(var a=1;a<=i;++a){var c=n-a;r<=c&&this.loadTile(t,c,u,s,h,o);var f=n+a;f<=e&&this.loadTile(t,f,u,s,h,o)}},n.prototype.loadTilesY=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,i,s,h,o);for(var a=1;a<=r;++a){var c=i-a;e<=c&&this.loadTile(t,n,c,s,h,o);var f=i+a;f<=u&&this.loadTile(t,n,f,s,h,o)}},n.prototype.loadTile=function(t,n,i,r,e,u){var s=this.$c.toTileCode(t,n,i),h=this.dl,o=h.get(s);null==o&&(this.toTilePosition(n,i,r,e,u),o=this.newTile(n,i,u.x,u.y,this.Il),h.set(s,o),o.load(this.he(t,n,i),this.vl),this.Tl=!1)},n.prototype.toTilePosition=function(t,n,i,r,e){var u=this.ol,s=this.Nl;return e.set(t,n),this.$c.tileToPixels(e,u,e),e.set(e.x*s+i,e.y*s+r),e},n.prototype.toOffset=function(t){var n=this.O,i=this.Io,r=this.ol;return t.set(-i.x*r+.5*n.width,-i.y*r+.5*n.height),t},n.prototype.deleteTile=function(t,n,i){var r=t.tx,e=t.ty;(r<this.wl||this.pl<r||e<this.Ol||this.Dl<e)&&(i.delete(n),t.destroy())},n.prototype.destroy=function(){var t=this.dl;t.forEach(this.Ml),t.clear()},n.prototype.destroyTile=function(t){t.destroy()},n.prototype.updateLoadingState=function(){this.Tl=!0,this.dl.forEach(this.Sl)},n.prototype.onLoaded=function(){this.ll?this.cl():this.fl=!0},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.Tl||this.updateLoadingState(),this.Tl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mapping",{get:function(){return this.Io},set:function(t){var i=this,r=this.$c,e=t.scale*this.Nl,u=r.getTileSize()*t.scale;this.Il=e,this.ol=u,this.Io=t;var s=n.WORK;this.toOffset(s);var h=s.x,o=s.y;this.dl.forEach((function(t){i.toTilePosition(t.tx,t.ty,h,o,s),t.transform(s.x,s.y,e)}))},enumerable:!1,configurable:!0}),n.WORK=new t.Point,n}(),Pg=function(n){function i(t){var i=n.call(this)||this,r=t.canvas;i.Yi=r,i.he=t.builder;var e=t.mapping;i.Io=e;var u=t.coordinate;i.$c=u,i.Cl=i.toMapping(r,e,u),i._z=NaN,i.bl=NaN,i.Al=t.plane.min,i.Rl=t.plane.max,i.yl=[],i.vl=function(){i.onLoaded()},i.kl=function(){i.Ll=void 0,i.fit()},i.xl=t.plane.throttle;var s=function(){i.fitThrottled()};return i.Bl=s,r.on("scale",s),r.on("move",s),r.snippet.add(i,!0),i}return _(i,n),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.$c},enumerable:!1,configurable:!0}),i.prototype.fitThrottled=function(){null==this.Ll&&(this.Ll=window.setTimeout(this.kl,this.xl))},i.prototype.toMapping=function(t,n,r){var e=i.WORK_LONLAT,u=r.getTileSize();e.set(n.from.lon,n.from.lat),r.lonLatToPixels(e,0,u,e);var s=e.x,h=e.y;e.set(n.to.lon,n.to.lat),r.lonLatToPixels(e,0,u,e);var o=e.x,a=e.y,c=Math.abs(o-s),f=Math.abs(a-h),l=1e-7,v=1;return l<c?v=l<f?Math.max(t.width/c,t.height/f):t.width/c:l<f&&(v=t.height/f),{scale:v,x:.5*(o+s)/u,y:.5*(a+h)/u}},Object.defineProperty(i.prototype,"mapping",{get:function(){return this.Io},set:function(t){var n=this.Cl,i=this.toMapping(this.Yi,t,this.$c),r=1e-7;if(r<Math.abs(n.scale-i.scale)||r<Math.abs(n.x-i.x)||r<Math.abs(n.y-i.y)){this.Cl=i;for(var e=this.yl,u=0,s=e.length;u<s;++u){var h=e[u];h&&(h.mapping=i)}rt.update(this.Yi),this.Bl()}},enumerable:!1,configurable:!0}),i.prototype.newPlane=function(t){return new _g(this.Yi,this.he,t,this.Cl,this.$c,this.vl)},i.prototype.render=function(t){for(var n=this.bl,i=this.yl,r=0;r<n;++r)null!=(e=i[r])&&e.render(t);for(r=i.length-1;n<r;--r){var e;null!=(e=i[r])&&e.render(t)}var u=i[n];null!=u&&u.render(t)},i.prototype.toTileZ=function(t){return Math.min(this.Rl,Math.max(this.Al,Math.floor(t)))},i.prototype.updateTransform=function(){},i.prototype.toZ=function(t){return Math.log(this.Cl.scale*t)/Math.log(2)},i.prototype.move=function(t,n,i,r,e){var u=this.yl,s=this.toZ(t);if(this._z!==s){this._z=s;var h=this.toTileZ(s);if(this.bl!==h){this.bl=h;var o=u[h];null==o&&(o=this.newPlane(h),u[h]=o)}}var a=u[this.bl];return null!=a&&a.move(n,i,r,e),this},i.prototype.fit=function(){var t=this.Yi;if(null!=t){var n=t.parent;if(null!=n){var r=t.scale,e=r.x,u=r.y,s=t.x,h=t.y,o=this.$c,a=this.Cl,c=o.getTileSize()*a.scale,f=a.x*c-(s/e+.5*t.width),l=f+n.width/e,v=a.y*c-(h/u+.5*t.height),b=v+n.height/u,d=i.WORK_LONLAT;d.set(f,v),o.pixelsToLonLat(d,0,c,d);var g=d.x,m=d.y;d.set(l,b),o.pixelsToLonLat(d,0,c,d);var w=d.x,p=d.y;this.move(e,g,m,w,p)}}return this},i.prototype.destroyPlanesBefore=function(t,n){for(var i=0;i<t;++i){var r=n[i];r&&(r.destroy(),n[i]=void 0)}},i.prototype.destroyPlanesAfter=function(t,n){for(var i=t+1,r=n.length;i<r;++i){var e=n[i];e&&(e.destroy(),n[i]=void 0)}},i.prototype.cleanup=function(){var t=this.bl,n=this.yl,i=n[t];if(i&&i.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(t,n);for(var r=t+1,e=n.length;r<e;++r)if((u=n[r])&&u.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(r,n);for(r=t-1;0<=r;--r){var u;if((u=n[r])&&u.loaded)return void this.destroyPlanesBefore(r,n)}},i.prototype.onLoaded=function(){this.cleanup(),rt.update(this.Yi)},i.prototype.destroy=function(){for(var t=this.yl,n=0,i=t.length;n<i;++n){var r=t[n];r&&(r.destroy(),t[n]=void 0)}var e=this.Yi,u=this.Bl;return e.off("scale",u),e.off("move",u),e.snippet.remove(this,!0),this},i.WORK_LONLAT=new t.Point,i}(t.utils.EventEmitter),Fg=function(t,n,i){return"https://j.tile.openstreetmap.jp/"+t+"/"+n+"/"+i+".png"},Ug=function(){function t(){}return t.toPlaneOptions=function(t){var n,i,r,e=t.plane;return{min:null!==(n=null==e?void 0:e.min)&&void 0!==n?n:this.MIN,max:null!==(i=null==e?void 0:e.max)&&void 0!==i?i:this.MAX,throttle:null!==(r=null==e?void 0:e.throttle)&&void 0!==r?r:this.THROTTLE}},t.from=function(t){return new Pg({canvas:t.canvas,builder:t.builder||Fg,mapping:t.canvas.tile.mapping,coordinate:t.coordinate||xg.DEFAULT,plane:this.toPlaneOptions(t)})},t.MIN=0,t.MAX=18,t.THROTTLE=333,t}(),Gg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof jg?i:new jg(this.toMenuOptions(t,i))},n.prototype.newMenu=function(t,n){return new jg(this.toMenuOptions(t,n))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!1),n):{fit:!1}},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){this.menu.open(this)},n.prototype.close=function(){this.menu.close()},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this,n=this.Jh;return null==n&&((n=this.toMenu(this.theme,this.Nn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this);var r=this.parent;r&&r.emit("select",t,n,r)},n.prototype.onKeyDown=function(n){return Kt.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onActivate(t),0))},n.prototype.getType=function(){return"DMenuBarItem"},n}(Ae),zg=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t);var i=null==t?void 0:t.items;if(i)for(var r=0,e=i.length;r<e;++r){var u=this.toItem(i[r]);u&&this.addChild(u)}},i.prototype.toItem=function(n){return null==n?null:n instanceof t.DisplayObject?n:"space"in n?new ze(n):new Gg(n)},i.prototype.onKeyDown=function(t){return Kt.moveFocusHorizontally(t,this),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuBar"},i}(We),Hg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DMenuSidedContent"},n}(We),Vg={NONE:0,SINGLE:1,SINGLE_ONCE:2},Wg=function(){return!0},Xg=function(n){function i(t,i){var r,e,u,s=n.call(this)||this;s.Qa=t,s.sc=null,s.un=!0,s.jt=di(null!==(e=null!==(r=null==i?void 0:i.mode)&&void 0!==r?r:null==i?void 0:i.type)&&void 0!==e?e:Vg.SINGLE_ONCE,Vg),s._l=null!==(u=null==i?void 0:i.filter)&&void 0!==u?u:s.getFilterDefault();var h=null==i?void 0:i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return _(i,n),i.prototype.first=function(){return this.sc},i.prototype.toDirty=function(){this.un=!0},i.prototype.update=function(){this.un&&(this.un=!1,this.Ze(this.Qa))},i.prototype.hasMenu=function(t){return t&&t.menu instanceof jg},i.prototype.Ze=function(n){for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u instanceof Of&&u.state.isActive&&this.Pl(u,!1),u instanceof t.Container&&this.Ze(u),this.hasMenu(u)&&this.Ze(u.menu)}},i.prototype.add=function(t){this.update(),this.Pl(t,!0)},i.prototype.set=function(t){this.update(),this.Pl(t,!0)},i.prototype.get=function(t){return this.update(),this.sc},i.prototype.getIndex=function(t){return null},i.prototype.size=function(){return this.sc?1:0},i.prototype.isEmpty=function(){return null==this.sc},i.prototype.remove=function(t){this.update(),this.sc===t&&this.Pl(null,!0)},i.prototype.clear=function(){this.update(),this.Pl(null,!0)},i.prototype.getFilterDefault=function(){return Wg},i.prototype.Pl=function(t,n){var i=this.sc,r=this.jt;r!==Vg.NONE&&this._l(t)&&i!==t&&(this.setState(i,r,!1),this.sc=t,this.setState(t,r,!0),n&&this.emit("change",this))},i.prototype.setState=function(t,n,i){t&&(n===Vg.SINGLE?t.state.isActive=i:i?t.state.addAll(ht.ACTIVE,ht.READ_ONLY):t.state.removeAll(ht.ACTIVE,ht.READ_ONLY))},i}(t.utils.EventEmitter),Kg=function(t){function n(n){var i,r=t.call(this,n)||this,e=new Tg(r);r.vo=e,e.add(r);var u=null==n?void 0:n.items;if(null!=u){var s=null!==(i=null==n?void 0:n.sticky)&&void 0!==i&&i;r.newItems(u,s)}var h=null==n?void 0:n.selection;return r.hc=h instanceof Xg?h:r.newSelection(h),r}return _(n,t),n.prototype.newSelection=function(t){return new Xg(this.content,t)},n.prototype.onChildrenDirty=function(){var n=this.hc;null!=n&&n.toDirty(),t.prototype.onChildrenDirty.call(this)},n.prototype.newItems=function(t,n){al.newItems(this.content,t,n)},n.prototype.newContent=function(t){return new Hg(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),n.prototype.getContext=function(){return this.vo},n.prototype.getCloseable=function(){return this},n.prototype.open=function(){},n.prototype.close=function(){},n.prototype.onKeyDown=function(n){return Kt.moveFocusVertically(n,this),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DMenuSided"},n}(jb),Yg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteError"},n}(Rb),Jg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteNoItemsFound"},n}(Rb),Zg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSearching"},n}(Rb),qg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Ki),$g=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationDotsButton"},n}(Du),Qg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.Fl=new $g({width:n.button.width,visible:!!n.button.dotsLeft}),this.Ul=new $g({width:n.button.width,visible:!!n.button.dotsRight}),this.addChild(this.Fl),this.addChild(this.Ul)},n.prototype.update=function(t){var n=this;if(null!=t.start&&null!=t.end){var i=t.end-t.start+1>0?t.end-t.start+1:0,r=this.children.slice(1,this.children.length-1);if(r.length<i){for(var e=r.length;e<i;e++){var u=new Ae({width:t.button.width});this.addChildAt(u,this.children.length-1),u.on("active",(function(t){n.emit("active",t)}))}r=this.children.slice(1,this.children.length-1)}else if(r.length>i)for(e=i;e<r.length;e++)r[e].hide();for(e=0;e<i;e++)(u=r[e]).text=t.start+e+1,u.state.isActive=t.start+e===t.selected,u.isHidden()&&u.show();t.button.dotsLeft?this.Fl.show():this.Fl.hide(),t.button.dotsRight?this.Ul.show():this.Ul.hide()}},n.prototype.getType=function(){return"DPaginationDynamicButtons"},n}(We),tm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationNavigationButton"},n}(Du),nm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n),this.DEFAULT_SELECTED=0,this.Gl=n.total,this.na=null!==(i=n.selected)&&void 0!==i?i:this.DEFAULT_SELECTED;var e=n.button;this.zl={first:!!(null==e?void 0:e.first),last:!!(null==e?void 0:e.last),width:null==e?void 0:e.width},this.initButtons(this.getButtonWidth()),this.listenButtonClicked(),this.on("resize",(function(){r.Hl=r.toNumberVisible(),r.update()}))},Object.defineProperty(n.prototype,"selected",{get:function(){return this.na},set:function(t){(t<0||t>=this.Gl||!Number.isInteger(t))&&(t=this.DEFAULT_SELECTED),this.na=t,this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"total",{get:function(){return this.Gl},set:function(t){t>=0&&Number.isInteger(t)&&(this.Gl=t,this.Hl=this.toNumberVisible(),this.selected=this.na,this.Vl.text=this.Gl,this.update())},enumerable:!1,configurable:!0}),n.prototype.initButtons=function(t){this.Wl=new tm({width:t,image:{source:K.getInstance().getAtlas().mappings.pagination_navigation_button_previous}}),this.Xl=new tm({width:t,image:{source:K.getInstance().getAtlas().mappings.pagination_navigation_button_next}}),this.Kl=new tm({width:t,image:{source:K.getInstance().getAtlas().mappings.pagination_navigation_button_go_first},visible:this.zl.first}),this.Yl=new tm({width:t,image:{source:K.getInstance().getAtlas().mappings.pagination_navigation_button_go_last},visible:this.zl.last}),this.Jl=new Qg({button:{width:t}}),this.Zl=new Ae({width:t,text:{value:1}}),this.Vl=new Ae({width:t,text:{value:this.Gl}}),this.addChild(this.Kl),this.addChild(this.Wl),this.addChild(this.Zl),this.addChild(this.Jl),this.addChild(this.Vl),this.addChild(this.Xl),this.addChild(this.Yl)},n.prototype.listenButtonClicked=function(){var t=this;this.Zl.on("active",(function(n){t.onClickPageButton(n)})),this.Vl.on("active",(function(n){t.onClickPageButton(n)})),this.Jl.on("active",(function(n){t.onClickPageButton(n)})),this.Kl.on("active",(function(n){t.selected=t.DEFAULT_SELECTED})),this.Yl.on("active",(function(n){t.selected=t.Gl-1})),this.Xl.on("active",(function(n){t.selected!==t.Gl+1&&(t.selected=t.na+1)})),this.Wl.on("active",(function(n){0!==t.na&&(t.selected=t.na-1)}))},n.prototype.update=function(){var t,n,i,r,e=0,u=0;this.updateStaticButtons();var s=Math.ceil(.5*(this.Hl-1)),h=Math.floor(.5*(this.Hl-1));this.na<s?(e=this.na,u=this.Hl-e-1):this.na+h>this.Gl-1?(u=this.Gl-1-this.selected,e=this.Hl-u-1):(e=s,u=h),this.na<=e?(t=1,i=!1):(t=this.na-e+2,i=!0),this.na+u>=this.Gl-1?(n=this.Gl-2,r=!1):(n=this.na+u-2,r=!0),this.Jl.update({start:t,end:n,selected:this.na,button:{width:this.getButtonWidth(),dotsLeft:i,dotsRight:r}})},n.prototype.updateStaticButtons=function(){this.Gl>0?this.Zl.show():this.Zl.hide(),this.Gl>1?this.Vl.show():this.Vl.hide();var t=this.na===this.DEFAULT_SELECTED,n=this.na===this.Gl-1||0===this.Gl;this.Zl.state.isActive=t,this.Vl.state.isActive=n,this.Kl.state.isDisabled=t,this.Wl.state.isDisabled=t,this.Xl.state.isDisabled=n,this.Yl.state.isDisabled=n},n.prototype.getButtonWidth=function(){return this.zl.width?this.zl.width:this.theme.getButtonWidth()},n.prototype.toNumberVisible=function(){var t=2;this.zl.first&&t++,this.zl.last&&t++;var n=t*(this.getButtonWidth()+2*this.Re.horizontal),i=this.width-n,r=Math.floor(i/(this.getButtonWidth()+2*this.Re.horizontal));return Math.min(this.Gl,Math.max(r,5))},n.prototype.onClickPageButton=function(t){var n=Number(t.text)-1;this.na!==n&&(this.na=n,this.update())},n.prototype.getType=function(){return"DPagination"},n}(We),im=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Ki),rm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Ki),em=function(t){function n(n){var i=t.call(this,n)||this;i.L=[];var r=null==n?void 0:n.values;return r&&(i.values=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){if(t.prototype.onMenuSelect.call(this,n,i,r),i instanceof Mf){var e=this.L,u=[],s=[];i.state.isActive?this.updateMenuItems(r,e,n,void 0,u,s):this.updateMenuItems(r,e,void 0,n,u,s),this.L=u,this.text=s,this.onValueChange(u,e,s)}},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.L,e=[],u=[];this.updateMenuItems(n,r,void 0,void 0,e,u),this.L=e,this.text=u},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.start=function(){this.updateMenuItems(this.menu,this.L),t.prototype.start.call(this)},Object.defineProperty(n.prototype,"values",{get:function(){return this.L},set:function(t){var n=this.L;if(!this.isSameValues(t,n)){var i=[],r=[];this.updateMenuItems(this.menu,t,void 0,void 0,i,r),this.L=i,this.text=r}},enumerable:!1,configurable:!0}),n.prototype.isSameValues=function(t,n){if(t.length===n.length)for(var i=0,r=t.length;i<r;++i)if(n.indexOf(t[i])<0)return!1;return!1},n.prototype.updateMenuItems=function(t,n,i,r,e,u){for(var s=t.children,h=0,o=s.length;h<o;++h){var a=s[h];if(a instanceof _f)this.updateMenuItems(a.menu,n,i,r,e,u);else if(a instanceof Mf){var c=a.value;void 0!==r&&r===c?a.state.isActive=!1:void 0!==i&&a.value===i||0<=n.indexOf(a.value)?(e&&e.push(a.value),u&&u.push(a),a.state.isActive=!0):a.state.isActive=!1}}},n.prototype.getType=function(){return"DSelectMultiple"},n}(Ng),um=function(t){function n(n){var i=t.call(this,n)||this;i.At=null;var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=this.At;e!==n&&(this.At=n,this.text=i,this.onValueChange(n,e,i))},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.At;if(null!=r){var e=this.findMenuItem(n,r);null!=e?(this.At=r,this.text=e):(this.At=null,this.text=null)}else this.At=null,this.text=null},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.findMenuItem=function(t,n){for(var i=t.children,r=0,e=i.length;r<e;++r){var u=i[r];if(u instanceof _f){var s=this.findMenuItem(u.menu,n);if(null!=s)return s}else if(u instanceof Df&&u.value===n)return u}return null},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},set:function(t){if(this.At!==t){var n=this.findMenuItem(this.menu,t);null!=n?(this.At=t,this.text=n):(this.At=null,this.text=null)}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSelect"},n}(Ng),sm=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,i,r)||this;return s.ql=e,s.$l=u,s.mu=.5*i,s.wu=.5*r,s.interactive=!1,s.interactiveChildren=!1,n.on("update",(function(){s.onTextureUpdate()})),s}return _(n,t),n.prototype.onTextureUpdate=function(){this.emit("update",this)},n.prototype.onReflow=function(t,n,i){var r=this.mu,e=this.wu;this.x=-r+this.ql,this.y=-e+this.$l,this.width=r+n+r,this.height=e+i+e},n}(t.NineSlicePlane),hm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n),this.At=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},set:function(t){this.At=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderLabel"},n}(Ne),om=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderThumb"},n}(Ae),am=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n),this.At=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0,this.Ql=this.toRounder(n)},n.prototype.toRounder=function(t){var n,i=null==t?void 0:t.rounder;if(i)return i;var r=null!==(n=null==t?void 0:t.precision)&&void 0!==n?n:this.theme.getPrecision();return function(t){var n=Math.pow(10,r);return Math.round(t*n)/n}},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},set:function(t){this.At=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rounder",{get:function(){return this.Ql},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderValue"},n}(Ne),cm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.tv=0,this.nv=this.newTrack(n),this.addChild(this.nv),this.iv=this.newTrackSelected(n),this.iv.state.isActive=!0,this.addChild(this.iv),this.mc=this.newThumb(n),this.addChild(this.mc),this.jr=this.newLabelMin(n),this.addChild(this.jr),this.Nr=this.newLabelMax(n),this.addChild(this.Nr),this.At=this.newValue(n),this.addChild(this.At),this.nv.on(zi.down,(function(t){i.At.visible=i.state.inEnabled,i.onTrackDown(t.data.global)})),this.iv.on(zi.down,(function(t){i.At.visible=i.state.inEnabled,i.onTrackSelectedDown(t.data.global)})),this.rv=function(t){i.onTrackUpBound(t),i.At.visible=!1},this.ev=function(t){i.onTrackSelectedUpBound(t),i.At.visible=!1},this.mc.on(zi.down,(function(t){i.At.visible=!0,i.onThumbDown(t)})),this.uv=function(t){i.onThumbMove(t)},this.sv=function(t){i.onThumbUp(t),i.At.visible=!1},this.onValuesChange()},n.prototype.newThumb=function(t){return new om(null==t?void 0:t.thumb)},n.prototype.newValue=function(t){return new am(this.toValueOptions(null==t?void 0:t.value))},n.prototype.toValueOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value=t.value),null==t.visible&&(t.visible=!1),t},n.prototype.newLabelMin=function(t){return new hm(this.toLabelMinOptions(null==t?void 0:t.min))},n.prototype.toLabelMinOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value=""+t.value),t},n.prototype.newLabelMax=function(t){return new hm(this.toLabelMaxOptions(null==t?void 0:t.max))},n.prototype.toLabelMaxOptions=function(t){null==(t=t||{}).value&&(t.value=1);var n=t.text||{};return t.text=n,null==n.value&&(n.value=""+t.value),t},n.prototype.getValueMargin=function(){return 14},n.prototype.onTrackDown=function(t){if(!this.state.inDisabled){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.hv=i;var r=this.rv;i.on(zi.up,r),i.on(zi.upoutside,r),i.on(zi.cancel,r)}this.onPick(t)}},n.prototype.onTrackSelectedDown=function(t){if(!this.state.inDisabled){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.hv=i;var r=this.ev;i.on(zi.up,r),i.on(zi.upoutside,r),i.on(zi.cancel,r)}this.onPick(t)}},n.prototype.onTrackUpBound=function(t){var n=this.hv;if(n){this.hv=void 0;var i=this.rv;n.off(zi.up,i),n.off(zi.upoutside,i),n.off(zi.cancel,i)}},n.prototype.onTrackSelectedUpBound=function(t){var n=this.hv;if(n){this.hv=void 0;var i=this.ev;n.off(zi.up,i),n.off(zi.upoutside,i),n.off(zi.cancel,i)}},n.prototype.onThumbMove=function(t){this.state.inDisabled||this.onPick(t.data.global)},n.prototype.onThumbDown=function(t){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.hv=i;var r=this.uv;i.on(zi.move,r);var e=this.sv;i.on(zi.up,e),i.on(zi.upoutside,e),i.on(zi.cancel,e)}},n.prototype.onThumbUp=function(t){var n=this.hv;if(n){this.hv=void 0;var i=this.uv;n.off(zi.move,i);var r=this.sv;n.off(zi.up,r),n.off(zi.upoutside,r),n.off(zi.cancel,r)}},n.prototype.updateValue=function(){var t=this.jr.value,n=this.Nr.value,i=this.At,r=i.rounder(t+this.tv*(n-t)),e=i.value;r!==e&&(i.value=r,i.text=i.value,this.emit("change",r,e,this))},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.onValuesChange()},Object.defineProperty(n.prototype,"value",{get:function(){return this.At.value},set:function(t){t=Math.max(this.jr.value,Math.min(this.Nr.value,t)),this.At.value!==t&&(this.At.value=t,this.onValuesChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.jr.value},set:function(t){var n=this.jr;if(t=Math.min(this.Nr.value,t),n.value!==t){var i=this.At;n.text=n.value=t,i.value=Math.max(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.Nr.value},set:function(t){var n=this.Nr;if(t=Math.max(this.jr.value,t),n.value!==t){var i=this.At;n.text=n.value=t,i.value=Math.min(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSlider"},n}(Ki),fm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrack"},n}(Ae),lm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackHorizontal"},n}(fm),vm=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new lm(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new lm(null==t?void 0:t.track)},i.prototype.toValueOptions=function(t){var i=this;return null==(t=n.prototype.toValueOptions.call(this,t)).y&&(t.y=function(t,n){return.5*t-n-i.getValueMargin()}),t},i.prototype.toLabelMinOptions=function(t){return null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return.5*-n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.toLabelMaxOptions=function(t){return null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return t-.5*n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=Math.max(0,Math.min(this.nv.width,i.x));this.tv=r/this.nv.width,this.moveThumbPosition(r)},i.prototype.onValuesChange=function(){var t=this.jr.value,n=this.Nr.value,i=this.At.value;this.tv=(i-t)/(n-t);var r=this.tv*this.nv.width;this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.mc;n.x=t-.5*n.width,this.iv.width=t;var i=this.At;i.x=t-.5*i.width,this.updateValue()},i.prototype.toThumbCoordinate=function(t){return t-.5*this.mc.width},i.prototype.getType=function(){return"DSliderHorizontal"},i}(cm),bm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackVertical"},n}(fm),dm=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new bm(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new bm(null==t?void 0:t.track)},i.prototype.toLabelMinOptions=function(t){null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return t-.5*n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=le.RIGHT),t},i.prototype.toLabelMaxOptions=function(t){null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return.5*-n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=le.RIGHT),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=this.height,e=Math.max(0,Math.min(r,i.y));this.tv=(r-e)/r,this.moveThumbPosition(e)},i.prototype.onValuesChange=function(){var t=this.jr.value,n=this.Nr.value,i=this.At.value;this.tv=(i-t)/(n-t);var r=this.height*(1-this.tv);this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.mc;n.y=t-.5*n.height;var i=this.iv;i.y=t,i.height=this.height-t;var r=this.At;r.y=t-r.height-this.getValueMargin(),this.updateValue()},i.prototype.getType=function(){return"DSliderVertical"},i}(cm),gm=function(){function t(){}return t.setReadOnly=function(t,n,i,r){t.state.isReadOnly=this.toReadOnly(n,i,r)},t.setRenderable=function(t,n,i,r){var e=this.toRenderable(n,i,r);t.renderable=e,t.state.isDisabled=!e},t.toReadOnly=function(t,n,i){var r=i.editing.enable;return!0!==r&&(!1===r||!r(t,n))},t.toRenderable=function(t,n,i){var r=i.renderable;return!0===r||!1!==r&&r(t,n)},t}(),mm=function(t){function n(n,i,r,e){var u,s=t.call(this,e)||this;return s.ov=-1,s.av=n,s.cv=i,s.q=r,s.fv=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.cv.selecting,u=e.dialog;if(u){var s=null!==(i=this.nu)&&void 0!==i?i:null;e.setter(u,s),u.open().then((function(){var t=e.getter(u);r.fv?t!==s&&(r.text=t,r.onValueChange(t,s)):r.onValueChange(t,null)}))}},n.prototype.onValueChange=function(t,n){var i=this.lv;if(void 0!==i){var r=this.ov,e=this.av;this.cv.setter(i,e,t),this.emit("change",t,n,this),this.q(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.nu;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,u?(this.tu=t,this.nu=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellSelectDialog"},n}(Ae),wm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionDialog"},n}(mm),pm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){var e=this.lv;if(void 0!==e){var u=this.ov,s=this.av;this.cv.setter(e,s,n),t.prototype.onMenuSelect.call(this,n,i,r),this.q(n,null,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellActionMenu"},n}(Ig),Om=function(t){function n(n,i,r,e){var u,s=t.call(this,e)||this;return s.ov=-1,s.av=n,s.cv=i,s.q=r,s.fv=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.cv.selecting.promise;r&&r().then((function(t){var n;if(i.fv){var r=null!==(n=i.nu)&&void 0!==n?n:null;t!==r&&(i.text=t,i.onValueChange(t,r))}else i.onValueChange(t,null)}))},n.prototype.onValueChange=function(t,n){var i=this.lv;if(void 0!==i){var r=this.ov,e=this.av;this.cv.setter(i,e,t),this.emit("change",t,n,this),this.q(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.nu;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,u?(this.tu=t,this.nu=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellSelectPromise"},n}(Ae),Dm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionPromise"},n}(Om),Em=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellText"},n}(Ie),Mm=function(t){function n(n,i,r,e){var u,s=t.call(this,n,i,r,e)||this,h=di(null!==(u=null==e?void 0:e.when)&&void 0!==u?u:fe.CLICKED,fe);return s.cu=h,s.initOnClick(h,s.theme,e),s}return _(n,t),n.prototype.initOnClick=function(t,n,i){var r=this;zi.onClick(this,(function(n){t===fe.CLICKED&&r.onClick(n)}))},n.prototype.onClick=function(t){this.state.isActionable&&this.onActivate(t)},n.prototype.onDblClick=function(n,i){return this.cu===fe.DOUBLE_CLICKED&&this.onClick(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.onActivate=function(t){this.emit("active",this);var n=this.lv;if(void 0!==n){var i=this.ov,r=this.av;this.emit("change",null,null,this),this.q(null,null,n,i,r,this)}},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTableBodyCellButton"},n}(Em),Sm={INDEX:0,TEXT:1,INTEGER:2,REAL:3,CHECK:4,CHECK_SINGLE:5,COLOR:6,BUTTON:7,SELECT:8,DATE:9,DATETIME:10,TIME:11,ACTION:12,LINK:13,TREE:14},Tm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.onValueChange(!0,!1)},n.prototype.onInactivate=function(n){t.prototype.onInactivate.call(this,n),this.onValueChange(!1,!0)},n.prototype.onValueChange=function(t,n){var i=this.lv;if(void 0!==i){var r=this.ov,e=this.av,u=this.cv;u.setter(i,e,t),this.emit("change",t,n,this);var s=this.q;s(t,n,i,r,e,this),t&&u.type===Sm.CHECK_SINGLE&&this.onChangeSingle(r,e,u,s)}},n.prototype.onChangeSingle=function(t,n,i,r){var e=this,u=this.parent;if(u){var s=u.parent;if(s){var h=!1,o=i.getter,a=i.setter;s.data.each((function(i,u){return t===u||!o(i,n)||(a(i,n,!1),h=!0,r(!1,!0,i,u,n,e),!1)})),h&&s.update(!0)}}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.state.isActive=!!t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellCheck"},n}(Dv),jm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.lv;if(void 0!==r){var e=this.ov,u=this.av;this.cv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.q(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r;var s=this.At;if(Xt(t))s.color=t,s.alpha=1;else if(at(t)){var h=Number(t);s.color=h==h?h:16777215,s.alpha=1}else if(null!=t){var o=t.color,a=t.alpha;s.color=Xt(o)?o:16777215,s.alpha=Xt(a)?a:1}else s.color=16777215,s.alpha=1;var c=this.cv;gm.setReadOnly(this,n,e,c),gm.setRenderable(this,n,e,c)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellColor"},n}(Uv),Nm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime());var i=e.lv;if(void 0!==i){var r=e.ov,u=e.av;e.cv.setter(i,u,t),e.emit("change",t,n,e),e.q(t,n,i,r,u,e)}}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Vu(i):zv.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.lv=n,this.ov=r,t instanceof Date)u?(this.tu=t,this.nu=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(Xt(t)){var s=this.nu;void 0===s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}var h=this.cv;gm.setReadOnly(this,n,e,h),gm.setRenderable(this,n,e,h)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellDate"},n}(Ae),Im=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime());var i=e.lv;if(void 0!==i){var r=e.ov,u=e.av;e.cv.setter(i,u,t),e.emit("change",t,n,e),e.q(t,n,i,r,u,e)}}))},n.prototype.getDatetimeMask=function(){var t,n,i=this.Ha;return null==i&&(i=Kv.toMask(null===(n=null===(t=this.Nn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Ha=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Pu(i):Vv.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.lv=n,this.ov=r,t instanceof Date)u?(this.tu=t,this.nu=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(Xt(t)){var s=this.nu;void 0===s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}var h=this.cv;gm.setReadOnly(this,n,e,h),gm.setRenderable(this,n,e,h)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellDatetime"},n}(Ae),Cm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=r;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellIndex"},n}(Ie),Am=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.lv;if(void 0!==r){var e=this.ov,u=this.av;this.cv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.q(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=Number(t);var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellInputInteger"},n}(ou),Rm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.lv;if(void 0!==r){var e=this.ov,u=this.av;this.cv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.q(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=Number(t);var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellInputReal"},n}(fu),ym=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.lv;if(void 0!==r){var e=this.ov,u=this.av;this.cv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.q(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=String(t);var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellInputText"},n}(bu),km=function(t){function n(n){var i=t.call(this,n)||this;return i.Bn=new pv(i.Bn),i}return _(n,t),Object.defineProperty(n.prototype,"padding",{get:function(){return this.Bn},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellInputTreeInput"},n}(bu),Lm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellInputTreeMarker"},n}(Ce),xm={START:"START",END:"END",FROZEN:"FROZEN",FROZEN_END:"FROZEN_END",SORTABLE:"SORTABLE",SORTED_ASCENDING:"SORTED_ASCENDING",SORTED_DESCENDING:"SORTED_DESCENDING",HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED",CHECKABLE:"CHECKABLE",SELECTABLE:"SELECTABLE"},Bm=function(t){function n(n,i,r,e){var u=t.call(this,function(t){if(null!=t)return{weight:t.weight,width:t.width}}(e))||this;u.ov=-1,u.av=n,u.cv=i,u.q=r;var s=u.newInput(e);u._u=s,u.addChild(s);var h=u.newMarker(e);return u.R=h,u.addChild(h),u}return _(n,t),n.prototype.newInput=function(t){return new km(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){var n=this;return{weight:1,text:null==t?void 0:t.text,editing:null==t?void 0:t.editing,when:null==t?void 0:t.when,cursor:null==t?void 0:t.cursor,on:{change:function(t,i){n.onInputChange(t,i)}}}},n.prototype.onInputChange=function(t,n){var i=this.lv;if(void 0!==i){var r=this.ov,e=this.av;this.cv.setter(i,e,t),this.emit("change",t,n,this),this.q(t,n,i,r,e,this)}},n.prototype.newMarker=function(t){var n=this;return new Lm({visible:!1,on:{active:function(){n.onMarkerActive()}}})},n.prototype.onMarkerActive=function(){if(this.R.state.is(xm.HAS_CHILDREN)){var t=this.parent;if(t){var n=t.parent;if(n){var i=n.data;i&&i.toggle&&(i.toggle(this.lv),this.emit("cellchange",null,null,this.lv,this.ov,this.av,this))}}}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this._u.padding.getLeft()},n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r;var s=this._u;s.visible=!0,s.text=String(t);var h=this.R;if(Xt(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=h.state;f.lock(),f.set(xm.HAS_CHILDREN,a),f.set(ht.DISABLED,!a),f.set(xm.OPENED,o),f.unlock();var l=this.theme.getLevelPadding(c);h.width=l,a?h.show():h.hide(),s.padding.adjLeft(l)}else h.state.removeAll(xm.OPENED,xm.HAS_CHILDREN),h.hide(),s.padding.adjLeft(0);var v=this.cv;gm.setReadOnly(this._u,n,e,v),gm.setRenderable(this,n,e,v)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1,this._u.visible=!1,this.R.hide()},n.prototype.getType=function(){return"DTableBodyCellInputTree"},n}(Ki),_m=function(t,n){if(n)return{url:Pm(t,n.url),target:n.target,checker:Fm(t,n.checker),menu:n.menu}},Pm=function(t,n){return at(n)||null==n?n:function(){var i=t.row;return void 0!==i?n(i,t.rowIndex,t.columnIndex,t):null}},Fm=function(t,n){if(null!=n)return function(){var i=t.row;return void 0!==i&&n(i,t.rowIndex,t.columnIndex,t)}},Um=function(t){function n(n,i,r,e){var u;return t.call(this,n,i,r,Lf.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this}return _(n,t),n.prototype.initOnClick=function(t,n,i){var r=this;this.link.add(this,(function(n){t===fe.CLICKED&&r.onClick(n)}))},Object.defineProperty(n.prototype,"link",{get:function(){var t,n=this.$h;return null==n&&(n=new kf(_m(this,null===(t=this.Nn)||void 0===t?void 0:t.link)),this.$h=n),n},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellLink"},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n}(Mm),Gm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.lv;if(void 0!==e){var u=this.ov,s=this.av;this.cv.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.q(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.value=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMenu"},n}(um),zm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.lv;if(void 0!==e){var u=this.ov,s=this.av;this.cv.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.q(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.values=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMultiple"},n}(em),Hm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime());var i=e.lv;if(void 0!==i){var r=e.ov,u=e.av;e.cv.setter(i,u,t),e.emit("change",t,n,e),e.q(t,n,i,r,u,e)}}))},n.prototype.getDatetimeMask=function(){var t,n,i=this.Ha;return null==i&&(i=Xv.toMask(null===(n=null===(t=this.Nn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Ha=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Uu(i):Ub.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.lv=n,this.ov=r,t instanceof Date)u?(this.tu=t,this.nu=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(Xt(t)){var s=this.nu;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}var h=this.cv;gm.setReadOnly(this,n,e,h),gm.setRenderable(this,n,e,h)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellTime"},n}(Ae),Vm=function(t){function n(n,i,r,e){var u,s=t.call(this,n,i,r,Lf.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this;return s.Bn=new pv(s.Bn),s}return _(n,t),n.prototype.initOnClick=function(n,i,r){var e=this,u=this.link;u?u.add(this,(function(t){n===fe.CLICKED&&e.onClick(t)})):t.prototype.initOnClick.call(this,n,i,r)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.$h;return void 0===t&&(t=this.newLink(),this.$h=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t,n=null===(t=this.Nn)||void 0===t?void 0:t.link;return n?new kf(_m(this,n)):null},n.prototype.onActivate=function(n){var i;t.prototype.onActivate.call(this,n),this.state.is(xm.HAS_CHILDREN)?this.toggle():null===(i=this.link)||void 0===i||i.open(n)},n.prototype.toggle=function(){var t=this.lv;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&r.toggle(t)}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.padding.getLeft()&&(this.toggle(),!0)},n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=t;var s=this.cv;gm.setRenderable(this,n,e,s);var h=this.link,o=this.Bn;if(Xt(i)){var a=!!(1&i),c=!!(2&i),f=i>>2,l=this.state;l.lock(),l.set(xm.HAS_CHILDREN,c),l.set(xm.OPENED,a),l.unlock(),o.adjLeft(this.theme.getLevelPadding(f)),h&&(h.menu.enable=!c)}else this.state.removeAll(xm.OPENED,xm.HAS_CHILDREN),o.adjLeft(0),h&&(h.menu.enable=!1)},n.prototype.getType=function(){return"DTableBodyCellTree"},n}(Mm),Wm={NONE:0,SINGLE:1,MULTIPLE:2},Xm=function(t){function n(n){var i,r,e=t.call(this,n)||this;return e.Xn=!0,e.vv=null!==(i=n.frozen)&&void 0!==i?i:0,e.bv=null!==(r=n.columns)&&void 0!==r?r:[],e}return _(n,t),n.prototype.initCells=function(t,n,i){for(var r=this.toIndexEnd(n),e=n.length-1;0<=e;--e){var u=this.newCell(e,n[e],n,t),s=u.state;s.lock(!1),0===e&&s.add(xm.START),e===r&&s.add(xm.END),e<i&&s.add(xm.FROZEN),e===i-1&&s.add(xm.FROZEN_END),s.unlock(),this.addChild(u)}},n.prototype.toIndexEnd=function(t){for(var n=t.length,i=0;i<n;++i)if(void 0!==t[i].weight)return n-1;return n},n.prototype.onRefit=function(){t.prototype.onRefit.call(this),this.resetFrozenCellPosition()},n.prototype.updateFrozenCellPosition=function(t){for(var n=this.bv,i=this.children,r=i.length,e=this.vv,u=0;u<e;++u){var s=n[u];i[r-1-u].position.x=-t+s.offset}},n.prototype.resetFrozenCellPosition=function(){for(var t=this.bv,n=this.children,i=n.length,r=this.vv,e=this.getContentPositionX(),u=0;u<r;++u){var s=t[u],h=n[i-1-u];s.offset=h.position.x,h.position.x=-e+s.offset}},n.prototype.getClippingRect=function(n,i){t.prototype.getClippingRect.call(this,n,i);var r=this.vv;if(0<r){var e=n;if(e&&e.parent===this){var u=this.children,s=u.indexOf(e);if(0<=s&&r<=u.length-1-s){var h=u[s+1],o=h.position.x+h.width;i.x+=o,i.width-=o}}}},n.prototype.getType=function(){return"DTableRow"},n}(We),Km=function(t){function n(n,i,r){var e=t.call(this,r)||this;return e.ae=-1,e.dv=function(t,i,r,u,s){e.emit("change",t,i,r,u,s,e),n(t,i,r,u,s,e)},e.state.isAlternated=!i,e.initCells(r,e.bv,e.vv),e}return _(n,t),n.prototype.newCell=function(t,n,i,r){var e=this.dv,u=this.toCellOptions(t,n,r);if(!1!==n.editing.enable)return this.newCellEditable(t,n,e,u);var s=this.newCellUnediable(t,n,e,u);return n.type!==Sm.TREE&&(s.state.isReadOnly=!0),s},n.prototype.newCellEditable=function(t,n,i,r){switch(n.type){case Sm.INDEX:return new Cm(t,n,i,r);case Sm.TEXT:return new ym(t,n,i,r);case Sm.TREE:return new Bm(t,n,i,r);case Sm.INTEGER:return new Am(t,n,i,r);case Sm.REAL:return new Rm(t,n,i,r);case Sm.CHECK:case Sm.CHECK_SINGLE:return new Tm(t,n,i,r);case Sm.COLOR:return new jm(t,n,i,r);case Sm.BUTTON:return new Mm(t,n,i,r);case Sm.LINK:return new Um(t,n,i,r);case Sm.SELECT:return this.newCellSelect(t,n,i,r);case Sm.ACTION:return this.newCellAction(t,n,i,r);case Sm.DATE:return new Nm(t,n,i,r);case Sm.DATETIME:return new Im(t,n,i,r);case Sm.TIME:return new Hm(t,n,i,r);default:return new Em(t,n,i,r)}},n.prototype.newCellUnediable=function(t,n,i,r){switch(n.type){case Sm.INDEX:return new Cm(t,n,i,r);case Sm.TEXT:return new Em(t,n,i,r);case Sm.TREE:return new Vm(t,n,i,r);case Sm.INTEGER:case Sm.REAL:return new Em(t,n,i,r);case Sm.CHECK:case Sm.CHECK_SINGLE:return new Tm(t,n,i,r);case Sm.COLOR:return new jm(t,n,i,r);case Sm.BUTTON:return new Mm(t,n,i,r);case Sm.LINK:return new Um(t,n,i,r);case Sm.SELECT:return this.newCellSelect(t,n,i,r);case Sm.ACTION:return this.newCellAction(t,n,i,r);case Sm.DATE:return new Nm(t,n,i,r);case Sm.DATETIME:return new Im(t,n,i,r);case Sm.TIME:return new Hm(t,n,i,r);default:return new Em(t,n,i,r)}},n.prototype.newCellSelect=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new Gm(t,n,i,r):null!=e.multiple?new zm(t,n,i,r):null!=e.dialog?new mm(t,n,i,r):null!=e.promise?new Om(t,n,i,r):new Em(t,n,i,r)},n.prototype.newCellAction=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new pm(t,n,i,r):null!=e.dialog?new wm(t,n,i,r):null!=e.promise?new Dm(t,n,i,r):new Em(t,n,i,r)},n.prototype.toCellOptions=function(t,n,i){var r,e,u=n.body||i.cell,s=n.weight,h=n.width,o=n.formatter,a=n.align,c=n.selecting,f=c.menu||c.multiple;if(null!=u){u.weight=s,u.width=h;var l=u.text||{};u.text=l,l.formatter||(l.formatter=o);var v=l.align||{};l.align=v,v.horizontal=a,u.menu||(u.menu=f)}else u={weight:s,width:h,text:{formatter:o,align:{horizontal:a}},menu:f};var b=n.editing;if(!1!==b.enable){var d=u.editing||{};u.editing=d,d.formatter||(d.formatter=b.formatter),d.unformatter||(d.unformatter=b.unformatter),d.validator||(d.validator=b.validator)}var g=n.link;return g&&(u.link=g),(null!==(e=null===(r=null==i?void 0:i.selection)||void 0===r?void 0:r.type)&&void 0!==e?e:Wm.NONE)!==Wm.NONE&&(u.when="DOUBLE_CLICKED",u.cursor=function(t){if(t.in(xm.SELECTABLE))return"pointer"}),u},n.prototype.getType=function(){return"DTableBodyRow"},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.ae},enumerable:!1,configurable:!0}),n.prototype.isCell=function(t){return null!=t&&"set"in t},n.prototype.set=function(t,n,i,r){if(r||this.At!==t||this.ae!==i){this.At=t,this.ae=i;for(var e=this.children,u=e.length,s=this.bv,h=s.length,o=0;o<u;++o){var a=e[o],c=h-1-o,f=s[c];this.isCell(a)&&a.set(f.getter(t,c),t,n,i,c,r)}this.onSet(t,i)}},n.prototype.onSet=function(t,n){this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.At){this.At=void 0,this.ae=-1;for(var t=this.children,n=t.length,i=0;i<n;++i){var r=t[i];this.isCell(r)&&r.unset()}this.onUnset()}},n.prototype.onUnset=function(){this.emit("unset",this)},n.prototype.getContentPositionX=function(){var t=this.parent;if(t){var n=t.parent;if(n)return n.position.x}return 0},n}(Xm),Ym=function(t){function n(n){var i=t.call(this)||this;return i.k=0,i.Nf=-1,i.gv=!1,i.mv=-1,i.O=n,i._l=null,i.wv=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.gv=!0,this.k+=1,this.O.update()},n.prototype.unapply=function(){this.gv&&(this.gv=!1,this.k+=1,this.O.update())},n.prototype.isApplied=function(){return this.gv},n.prototype.newFiltered=function(){var t=this._l;if(null!=t){var n,i=[],r=this.O,e=r.sorter,u=r.rows;if(ot(t))if(n=e.indices)for(var s=0,h=n.length;s<h;++s)t(u[o=n[s]],o)&&i.push(s);else for(s=0,h=u.length;s<h;++s)t(u[s],s)&&i.push(s);else if(n=e.indices)for(s=0,h=n.length;s<h;++s){var o=n[s];t.test(u[o],o)&&i.push(s)}else for(s=0,h=u.length;s<h;++s)t.test(u[s],s)&&i.push(s);return i}return null},n.prototype.get=function(){return this._l},n.prototype.set=function(t){this._l!==t&&(this._l=t)},n.prototype.toDirty=function(){this.k+=1},n.prototype.update=function(){this.k===this.Nf&&this.O.sorter.id===this.mv||(this.Nf=this.k,this.mv=this.O.sorter.id,this.gv?(this.wv=this.newFiltered(),this.emit("change",this)):null!=this.wv&&(this.wv=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.wv},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Jm=function(){function t(t){this.O=t}return t.prototype.map=function(t){var n=this.O,i=n.sorter.map(t);return null!=i?n.filter.map(i):null},t.prototype.unmap=function(t){var n=this.O;return n.sorter.unmap(n.filter.unmap(t))},t.prototype.size=function(){var t=this.O,n=t.filter.indices;return null!=n?n.length:t.size()},t.prototype.get=function(t){return this.O.get(this.unmap(t))},t.prototype.each=function(t,n,i){var r=this.O,e=r.rows,u=r.supplimentals,s=r.filter.indices,h=r.sorter.indices;if(n=null!=n?Math.max(0,n):0,s){var o=s.length;if(i=null!=i?Math.min(o,i):o,h)for(var a=n;a<i&&!1!==t(e[c=h[s[a]]],u?u[c]:null,a,c);++a);else for(a=n;a<i&&!1!==t(e[c=s[a]],u?u[c]:null,a,c);++a);}else if(o=e.length,i=null!=i?Math.min(o,i):o,h)for(a=n;a<i;++a){var c;if(!1===t(e[c=h[a]],u?u[c]:null,a,c))break}else for(a=n;a<i&&!1!==t(e[a],u?u[a]:null,a,a);++a);},t}(),Zm=function(t,n){return t[0]-n[0]},qm=function(t){function n(n,i){var r,e=t.call(this)||this;return e.O=n,e.jt=di(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:Wm.NONE,Wm),e.ln=new Set,e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.ln;n.has(t)?n.delete(t):n.add(t),this.onChange()},n.prototype.add=function(t){var n=this.ln,i=n.size;n.add(t),i!==n.size&&this.onChange()},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.ln;if(0<t.size){var n=NaN;return t.forEach((function(t){n!=n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.ln;if(0<t.size){var n=0;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.ln,u=e.size;if(t<i)for(var s=i+(r?1:0),h=t+(n?0:1);h<s;++h)e.add(h);else for(s=t+(n?1:0),h=i+(r?0:1);h<s;++h)e.add(h);u!==e.size&&this.onChange()},n.prototype.addAll=function(t){for(var n=this.ln,i=n.size,r=0,e=t.length;r<e;++r)n.add(t[r]);i!==n.size&&this.onChange()},n.prototype.contains=function(t){return this.ln.has(t)},n.prototype.remove=function(t){this.ln.delete(t)&&this.onChange()},n.prototype.clear=function(){var t=this.ln;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.ln;n.has(t)&&1===n.size||(n.clear(),n.add(t),this.onChange())},n.prototype.clearAndAddAll=function(t){var n=this.ln;if(0<n.size||0<t.length){n.clear();for(var i=0,r=t.length;i<r;++i)n.add(t[i]);this.onChange()}},n.prototype.shift=function(t,n){var i=[],r=this.ln;if(r.forEach((function(n){t<=n&&i.push(n)})),0<i.length){for(var e=0,u=i.length;e<u;++e)r.delete(i[e]);for(e=0,u=i.length;e<u;++e)r.add(i[e]+n);this.onChange()}},n.prototype.size=function(){return this.ln.size},n.prototype.isEmpty=function(){return 0===this.ln.size},Object.defineProperty(n.prototype,"indices",{get:function(){var t=[];return this.ln.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[],n=this.O;return this.ln.forEach((function(i){t.push(n.get(i))})),t},enumerable:!1,configurable:!0}),n.prototype.toArray=function(){var t=[],n=this.O;return this.ln.forEach((function(i){t.push([i,n.get(i)])})),t},n.prototype.toSortedArray=function(){return this.toArray().sort(Zm)},n.prototype.toObject=function(){var t={},n=this.O;return this.ln.forEach((function(i){t[i]=n.get(i)})),t},n.prototype.toMap=function(){var t=new Map,n=this.O;return this.ln.forEach((function(i){t.set(i,n.get(i))})),t},n}(t.utils.EventEmitter),$m={ASCENDING:0,DESCENDING:1},Qm=function(t){function n(n){var i=t.call(this)||this;return i.k=0,i.Nf=-1,i.gv=!1,i.O=n,i.pv=null,i.Ov=null,i.kt=$m.ASCENDING,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return this.kt},set:function(t){this.kt=t},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.gv=!0,this.k+=1,this.O.update()},n.prototype.unapply=function(){this.gv&&(this.gv=!1,this.k+=1,this.O.update())},n.prototype.isApplied=function(){return this.gv},n.prototype.newSorted=function(){var t=this.pv;if(null!=t){for(var n=[],i=this.O.rows,r=0,e=i.length;r<e;++r)n.push(r);return n.sort(this.toComparator(i,t)),n}return null},n.prototype.toComparator=function(t,n){var i=this.kt;return ot(n)?i===$m.ASCENDING?function(i,r){return n(t[i],t[r],i,r)}:function(i,r){return n(t[r],t[i],r,i)}:i===$m.ASCENDING?function(i,r){return n.compare(t[i],t[r],i,r)}:function(i,r){return n.compare(t[r],t[i],r,i)}},n.prototype.get=function(){return this.pv},n.prototype.set=function(t){this.pv!==t&&(this.pv=t)},n.prototype.toDirty=function(){this.k+=1},n.prototype.update=function(){this.k!==this.Nf&&(this.Nf=this.k,this.gv?(this.Ov=this.newSorted(),this.emit("change",this)):null!=this.Ov&&(this.Ov=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.Ov},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),tw=function(n){function i(t){var i=n.call(this)||this;if(i.O=null,i.Dv=i.toRows(null==t?void 0:t.rows),i.oc=new Jm(i),i.hc=i.toSelection(null==t?void 0:t.selection),i._l=new Ym(i),i.Ev=new Qm(i),t){var r=t.filter;r&&i._l.set(r);var e=t.comparator;e&&i.Ev.set(e);var u=t.on;if(u)for(var s in u){var h=u[s];h&&i.on(s,h)}}return i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:ot(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new qm(this,t)},i.prototype.bind=function(t){this.O=t},i.prototype.toRows=function(t){var n=[];if(null!=t)for(var i=0,r=t.length;i<r;++i)n.push(t[i]);return n},Object.defineProperty(i.prototype,"rows",{get:function(){return this.Dv},enumerable:!1,configurable:!0}),i.prototype.update=function(){var t=this.O;t&&t.update()},i.prototype.lock=function(){var t=this.O;t&&t.lock()},i.prototype.unlock=function(){var t=this.O;t&&(t.unlock(!1),t.update())},i.prototype.size=function(){return this.Dv.length},i.prototype.clear=function(){var t=this.Dv;0<t.length&&(t.length=0,this.lock(),this.hc.clear(),this.Ev.toDirty(),this._l.toDirty(),this.unlock())},i.prototype.clearAndAdd=function(t){var n=this.Dv;n.length=0,n.push(t),this.lock(),this.hc.clear(),this.Ev.toDirty(),this._l.toDirty(),this.unlock()},i.prototype.clearAndAddAll=function(t){var n=this.Dv;n.length=0;for(var i=0,r=t.length;i<r;++i)n.push(t[i]);this.lock(),this.hc.clear(),this.Ev.toDirty(),this._l.toDirty(),this.unlock()},i.prototype.add=function(t,n){var i=this.Dv,r=this.hc,e=this.Ev,u=this._l;null==n?(i.push(t),this.lock(),e.toDirty(),u.toDirty(),this.unlock()):0<=n&&n<i.length&&(i.splice(n,0,t),this.lock(),r.shift(n,1),e.toDirty(),u.toDirty(),this.unlock())},i.prototype.addAll=function(t,n){var i=this.Dv,r=i.length,e=this.hc,u=this.Ev,s=this._l;if(null==n){for(var h=0,o=a=t.length;h<o;++h)i.push(t[h]);this.lock(),u.toDirty(),s.toDirty(),this.unlock()}else if(0<=n&&n<r){var a=t.length;for(h=0;h<a;++h)i.splice(n+h,0,t[h]);this.lock(),e.shift(n,a),u.toDirty(),s.toDirty(),this.unlock()}},i.prototype.get=function(t){var n=this.Dv;return 0<=t&&t<n.length?n[t]:null},i.prototype.set=function(t,n){var i=this.Dv;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.lock(),this.Ev.toDirty(),this._l.toDirty(),this.unlock(),r}return null},i.prototype.remove=function(t){var n=this.Dv;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.lock(),this.hc.remove(t),this.Ev.toDirty(),this._l.toDirty(),this.unlock(),i}return null},i.prototype.each=function(t,n,i){var r=this.Dv;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this._l},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.Ev},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.oc},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),nw=function(n){function i(t){var i,r=n.call(this,t)||this;r.transform.position.y=null!==(i=t.offset)&&void 0!==i?i:0;var e=r.toData(t.data);r.$i=e,e.bind(r);var u=r.theme,s=function(t,n,i){var r=n.columns||[],e=n.row;return null!=e?(null==e.height&&(e.height=t.getRowHeight()),void 0===e.columns&&(e.columns=r),null==e.frozen&&(e.frozen=n.frozen),void 0===e.selection?e.selection={type:i}:void 0===e.selection.type&&(e.selection.type=i)):e={columns:r,height:t.getRowHeight(),frozen:n.frozen,selection:{type:i}},e}(u,t,e.selection.type);return r.Mv=s,r.Sv=null!=s.height?s.height:u.getRowHeight(),r.bv=s.columns||[],r.Tv=0,r.jv=0,r.Nv=0,r.Iv=!1,r.Cv=!1,r.Av=[],r.Rv=function(t,n,i,r,u){e.emit("change",t,n,i,r,u,e)},r.$i.emit("init",r.$i),r}return _(i,n),i.prototype.toData=function(t){return this.isData(t)?t:new tw(t)},i.prototype.isData=function(t){return null!=t&&"mapped"in t},i.prototype.onResize=function(t,i,r,e){n.prototype.onResize.call(this,t,i,r,e),this.update()},Object.defineProperty(i.prototype,"selection",{get:function(){return this.$i.selection},enumerable:!1,configurable:!0}),i.prototype.lock=function(){this.Nv+=1,1===this.Nv&&(this.Iv=!1,this.Cv=!1)},i.prototype.unlock=function(t){this.Nv-=1,0===this.Nv&&(t&&this.Iv&&this.update(this.Cv),this.Iv=!1,this.Cv=!1)},i.prototype.update=function(t){if(0<this.Nv)return this.Iv=!0,void(t&&(this.Cv=!0));var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=this.children,e=i.height,u=this.Sv,s=this.$i,h=s.mapped.size(),o=this.Tv,a=this.jv,c=a-o,f=this.transform.position.y,l=f+h*u,v=Math.max(e,l),b=Math.max(e-v,n.position.y),d=Math.floor((0-(b+f))/u),g=Math.floor((e-(b+f))/u),m=d-(d%2==0?2:1),w=g+((g-m+1)%2==0?3:2),p=w-m;if(p<c&&c-2<=p&&(w=m+(p=c)),c<p){for(var O=c;O<p;++O){var D=o+O,E=this.newRow(D%2==0);this.addChild(E)}a=o+(c=p)}else if(p<c){for(O=c-1;p<=O;--O)this.removeChild(r[O]);a=o+(c=p)}this.Tv=m,this.jv=w;var M=m-o,S=Math.abs(M),T=r.length;if(0<S&&S<T){var j=this.Av;if(0<M){for(O=0;O<S;++O)j.push(this.resetRow(r[O]));for(O=S;O<T;++O)r[O-S]=r[O];for(O=0;O<S;++O)r[T-S+O]=j[O]}else{for(O=0;O<S;++O)j.push(this.resetRow(r[T-S+O]));for(O=T-S-1;0<=O;--O)r[O+S]=r[O];for(O=0;O<S;++O)r[O]=j[O]}j.length=0}var N=s.selection,I=N.type!==Wm.NONE;for(s.mapped.each((function(n,i,e,s){var h=r[e-m];h.position.y=e*u;var o=h.state;o.lock(),o.set(xm.SELECTABLE,I),o.set(ht.ACTIVE,N.contains(s)),o.remove(ht.DISABLED),o.unlock(),h.set(n,i,s,t)}),m,m+T),O=0;m+O<0&&O<T;++O)(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ht.DISABLED),A.removeAll(xm.SELECTABLE,ht.ACTIVE),A.unlock(),C.unset();for(O=T-1;h<=m+O&&0<=O;--O){var C,A;(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ht.DISABLED),A.removeAll(xm.SELECTABLE,ht.ACTIVE),A.unlock(),C.unset()}this.lock(),n.position.y=b,n.height=v,this.height=l,this.unlock(!1)}}},i.prototype.resetRow=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];e instanceof Ki&&(e.state.isPressed=!1)}return t},i.prototype.newRow=function(t){return new Km(this.Rv,t,this.Mv)},i.prototype.onParentMove=function(t,i,r,e){n.prototype.onParentMove.call(this,t,i,r,e),this.updateFrozenCellPosition(t)},i.prototype.updateFrozenCellPosition=function(t){var n=this.Mv.frozen;if(null!=n&&0<n)for(var i=this.children,r=0,e=i.length;r<e;++r)i[r].updateFrozenCellPosition(t)},i.prototype.getClippingRect=function(t,i){n.prototype.getClippingRect.call(this,t,i);var r=this.parent;if(r){var e=-r.transform.position.y;i.y+=e,i.height-=e}},i.prototype.toRowIndexMapped=function(t){return 0<=this.parent.position.y+t.y?Math.floor(t.y/this.Sv):-1},i.prototype.toRow=function(t){var n=t-this.Tv,i=this.children;return 0<=n&&n<i.length?i[n]:null},i.prototype.toCell=function(t,n){for(var i=t.children,r=i.length,e=this.bv.length,u=0,s=Math.min(r,e);u<s;++u){var h=i[r-u-1],o=n.x-h.position.x;if(0<=o&&o<=h.width)return h}return null},i.prototype.onRowClick=function(t){if(this.state.isActionable){var n=i.WORK_ON_CLICK;n.copyFrom(t.data.global),this.toLocal(n,void 0,n,!1);var r=this.toRowIndexMapped(n);if(0<=r&&r<this.$i.mapped.size()){var e=this.toRow(r);if(e){var u=this.toCell(e,n);if(u&&u.onRowSelect&&u.onRowSelect(t,n))return}this.onRowSelect(t,r)}}},i.prototype.onRowSelect=function(t,n){var i=this.$i,r=i.selection,e=r.type===Wm.SINGLE,u=!e,s=i.mapped.unmap(n),h=t.data.originalEvent,o=h.ctrlKey,a=h.shiftKey;if(e||r.isEmpty()||!u||!o&&!a)r.clearAndAdd(s);else if(o)r.toggle(s);else if(a){var c=r.last;if(null!=c){var f=i.sorter,l=i.filter,v=f.map(s),b=f.map(c);if(null!=v&&null!=b){var d=b+1,g=v+1;if(v<b&&(d=v,g=b),d<g){var m=[],w=l.indices,p=f.indices;if(w)if(p)for(var O=0,D=w.length;O<D;++O)d<=(E=w[O])&&E<g&&m.push(p[E]);else for(O=0,D=w.length;O<D;++O){var E;d<=(E=w[O])&&E<g&&m.push(E)}else if(p)for(O=d;O<g;++O)m.push(p[O]);else for(O=d;O<g;++O)m.push(O);r.addAll(m)}}}}},i.prototype.getType=function(){return"DTableBody"},Object.defineProperty(i.prototype,"data",{get:function(){return this.$i},enumerable:!1,configurable:!0}),i.WORK_ON_CLICK=new t.Point,i}(Ki),iw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableCategoryCell"},n}(pf),rw=function(t){function n(n){var i,r=t.call(this,n)||this,e=null!==(i=n.offset)&&void 0!==i?i:0;return r.Jt=e,r.transform.position.y=e,r.initCells(n,r.bv,r.vv),r}return _(n,t),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.Jt,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new iw(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=i.cell;if(r){r.weight=n.weight,r.width=n.width;var e=r.text||{};return r.text=e,e.value=e.value||n.label,r}return{weight:n.weight,width:n.width,text:{value:n.label}}},n.prototype.getType=function(){return"DTableCategory"},n}(Xm),ew=function(t){function n(n){var i=t.call(this)||this;return i.k=0,i.Nf=-1,i.gv=!1,i.O=n,i._l=null,i.wv=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.gv=!0,this.k+=1,this.O.update()},n.prototype.unapply=function(){this.gv&&(this.gv=!1,this.k+=1,this.O.update())},n.prototype.isApplied=function(){return this.gv},n.prototype.isFiltered=function(t,n,i){return ot(i)?i(t,n):i.test(t,n)},n.prototype.hasFiltered=function(t,n,i){for(var r=this.O.accessor.toChildren,e=0,u=n.length;e<u;++e){var s=n[e];if(this.isFiltered(s,-1,i))return!0;var h=r(s);if(null!=h&&0<h.length&&this.hasFiltered(t,h,i))return!0}return!1},n.prototype.addAllToFiltered=function(t,n,i,r){for(var e=this.O.accessor.toChildren,u=0,s=n.length;u<s;++u){var h=n[u];i.push(r[0]),r[0]+=1;var o=e(h);null!=o&&0<o.length&&t.isOpened(h)&&this.addAllToFiltered(t,o,i,r)}},n.prototype.newFilteredSub=function(t,n,i,r,e){for(var u=!1,s=this.O.accessor.toChildren,h=0,o=n.length;h<o;++h){var a=n[h],c=e[0];e[0]+=1;var f=this.isFiltered(a,c,i),l=s(a);if(null!=l&&0<l.length)if(t.isOpened(a))if(f)r.push(c),u=!0,this.addAllToFiltered(t,l,r,e);else{var v=r.length;this.newFilteredSub(t,l,i,r,e)&&(r.splice(v,0,c),u=!0)}else(f||this.hasFiltered(t,l,i))&&(r.push(c),u=!0);else f&&(r.push(c),u=!0)}return u},n.prototype.newFiltered=function(){var t=this._l;if(null!=t){var n=[],i=this.O,r=i.nodes;return r&&this.newFilteredSub(i,r,t,n,[0]),n}return null},n.prototype.get=function(){return this._l},n.prototype.set=function(t){this._l!==t&&(this._l=t)},n.prototype.toDirty=function(){this.k+=1},n.prototype.update=function(){this.k!==this.Nf&&(this.Nf=this.k,this.gv?(this.wv=this.newFiltered(),this.emit("change",this)):null!=this.wv&&(this.wv=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.wv},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),uw=function(t){return t.parent},sw=function(t){return t.children},hw=function(t){var n,i;this.toParent=null!==(n=null==t?void 0:t.toParent)&&void 0!==n?n:uw,this.toChildren=null!==(i=null==t?void 0:t.toChildren)&&void 0!==i?i:sw},ow=function(t,n){return t[0]-n[0]},aw=function(t){function n(n,i){var r,e=t.call(this)||this;return e.O=n,e.jt=di(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:Wm.NONE,Wm),e.Dv=new Set,e}return _(n,t),n.prototype.onNodeChange=function(t){if(null!=t){var n=this.O.accessor.toChildren,i=this.Dv,r=this.newRows(t,n,i,new Set);i.size!==r.size&&(this.Dv=r,this.onChange())}else{var e=this.Dv;0<e.size&&(e.clear(),this.onChange())}},n.prototype.newRows=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];i.has(s)&&r.add(s);var h=n(s);null!=h&&this.newRows(h,n,i,r)}return r},Object.defineProperty(n.prototype,"indices",{get:function(){var t=this.Dv,n=[];return this.O.each((function(i,r){t.has(i)&&n.push(r)})),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[];return this.Dv.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.getFirst=function(){var t=this.Dv;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},n.prototype.getLast=function(){var t=this.Dv;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},n.prototype.toIndex=function(t){var n=null;return this.O.each((function(i,r){return t!==i||(n=r,!1)})),n},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.getFirst();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.getLast();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.O.get(t);if(n){var i=this.Dv;i.has(n)?i.delete(n):i.add(n),this.onChange()}},n.prototype.add=function(t){var n=this.O.get(t);if(n){var i=this.Dv;i.has(n)||(i.add(n),this.onChange())}},n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.Dv,u=e.size,s=this.O;t<i?s.each((function(t){e.add(t)}),t+(n?0:1),i+(r?1:0)):s.each((function(t){e.add(t)}),i+(r?0:1),t+(n?1:0)),u!==e.size&&this.onChange()},n.prototype.addAll=function(t){if(0<t.length){for(var n=this.Dv,i=this.O,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.contains=function(t){var n=this.O.get(t);return!!n&&this.Dv.has(n)},n.prototype.remove=function(t){var n=this.O.get(t);if(n){var i=this.Dv;i.has(n)&&(i.delete(n),this.onChange())}},n.prototype.clear=function(){var t=this.Dv;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.O.get(t);if(n){var i=this.Dv;i.has(n)?1<i.size&&(i.clear(),i.add(n),this.onChange()):(i.clear(),i.add(n),this.onChange())}},n.prototype.clearAndAddAll=function(t){var n=this.Dv;if(0<n.size||0<t.length){n.clear();for(var i=this.O,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.shift=function(t,n){},n.prototype.size=function(){return this.Dv.size},n.prototype.isEmpty=function(){return this.Dv.size<=0},n.prototype.toArray=function(){var t=this.Dv,n=[];return this.O.each((function(i,r){t.has(i)&&n.push([r,i])})),n},n.prototype.toSortedArray=function(){return this.toArray().sort(ow)},n.prototype.toObject=function(){var t=this.Dv,n={};return this.O.each((function(i,r){t.has(i)&&(n[r]=i)})),n},n.prototype.toMap=function(){var t=this.Dv,n=new Map;return this.O.each((function(i,r){t.has(i)&&n.set(r,i)})),n},n}(t.utils.EventEmitter),cw=function(t){function n(){return t.call(this)||this}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return $m.ASCENDING},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.apply=function(){},n.prototype.unapply=function(){},n.prototype.isApplied=function(){return!1},n.prototype.get=function(){return null},n.prototype.set=function(t){},n.prototype.toDirty=function(){},n.prototype.update=function(){},Object.defineProperty(n.prototype,"indices",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.map=function(t){return t},n.prototype.unmap=function(t){return t},n}(t.utils.EventEmitter),fw=function(n){function i(t){var i=n.call(this)||this;if(i.O=null,i.ec=i.toAccessor(t),i.oc=new Jm(i),i.Dv=[],i.yv=!1,i.kv=[],i.Lv=new WeakMap,i.Xn=!!(null==t?void 0:t.reverse),i.hc=i.toSelection(null==t?void 0:t.selection),i._l=new ew(i),i.Ev=new cw,t){var r=t.filter;r&&i._l.set(r);var e=t.on;if(e)for(var u in e){var s=e[u];s&&i.on(u,s)}}return i.nodes=null==t?void 0:t.nodes,i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:ot(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new aw(this,t)},i.prototype.toAccessor=function(t){return new hw(t)},i.prototype.bind=function(t){this.O=t},Object.defineProperty(i.prototype,"nodes",{get:function(){return this.xv},set:function(t){this.xv=t,this.yv=!0,this.hc.onNodeChange(t),this._l.toDirty(),this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"rows",{get:function(){return this.yv&&(this.yv=!1,this.updateRows(this.xv)),this.Dv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supplimentals",{get:function(){return this.kv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"accessor",{get:function(){return this.ec},enumerable:!1,configurable:!0}),i.prototype.updateRows=function(t){var n=this.Dv,i=this.kv,r=this.Lv;if(null!=t){var e=this.newRows(t,0,0,n,i,r,this.Xn,this.ec.toChildren);e!==n.length&&(n.length=e,i.length=e)}else n.length=0,i.length=0},i.prototype.toSupplimental=function(t,n,i){return t<<2|(n?2:0)|(i?1:0)},i.prototype.newRows=function(t,n,i,r,e,u,s,h){for(var o=t.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=t[c],l=h(f),v=u.has(f),b=this.toSupplimental(i,!!(l&&0<l.length),v);n<r.length?(r[n]=f,e[n]=b):(r.push(f),e.push(b)),n+=1,v&&l&&(n=this.newRows(l,n,i+1,r,e,u,s,h))}return n},i.prototype.update=function(t){var n=this.O;n&&n.update(t)},i.prototype.size=function(){return this.rows.length},i.prototype.get=function(t){var n=this.rows;return 0<=t&&t<n.length?n[t]:null},i.prototype.open=function(t){var n=this.Lv;n.has(t)||(n.set(t,1),this.yv=!0,this._l.toDirty(),this.update(!0))},i.prototype.close=function(t){var n=this.Lv;n.has(t)&&(n.delete(t),this.yv=!0,this._l.toDirty(),this.update(!0))},i.prototype.isOpened=function(t){return this.Lv.has(t)},i.prototype.toggle=function(t){var n=this.Lv;n.has(t)?n.delete(t):n.set(t,1),this.yv=!0,this._l.toDirty(),this.update(!0)},i.prototype.each=function(t,n,i){var r=this.rows;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this._l},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.Ev},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.oc},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),lw=function(){function t(t,n){var i,r,e;this.O=t,this.Gu=null!==(i=null==n?void 0:n.enable)&&void 0!==i&&i,this.Bv=null===(r=null==n?void 0:n.filterable)||void 0===r||r,this._v=null===(e=null==n?void 0:n.emittable)||void 0===e||e}return Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this.Gu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFilterable",{get:function(){return this.Bv},set:function(t){this.Bv=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEmittable",{get:function(){return this._v},set:function(t){this._v=t},enumerable:!1,configurable:!0}),t.prototype.newIteratee=function(t,n){var i=this.O,r=i.column,e=i.columnIndex;if(null!=r&&null!=e){var u=r.getter,s=r.setter;if(this._v){var h=t.data;return function(t,i){return u(t,e)!==n&&(s(t,e,n),h.emit("change",n,!n,t,i,e,h),!0)}}return function(t){return u(t,e)!==n&&(s(t,e,n),!0)}}return null},t.prototype.execute=function(t){var n,i=null===(n=this.O.header)||void 0===n?void 0:n.table;if(i){var r=this.newIteratee(i,t);if(r){var e=!1;this.Bv?i.data.mapped.each((function(t,n,i,u){r(t,u)&&(e=!0)})):i.data.each((function(t,n){r(t,n)&&(e=!0)})),e&&i.body.update(!0)}}},t}(),vw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){null!=t?(this.Qh=t.header,this.cv=t.column,this.av=t.columnIndex,this.Pv=new lw(this,t.check)):this.Pv=new lw(this),n.prototype.init.call(this,t),this.initOnClick(t)},Object.defineProperty(i.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"header",{get:function(){return this.Qh},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"check",{get:function(){return this.Pv},enumerable:!1,configurable:!0}),i.prototype.initOnClick=function(t){var n=this,i=this.cv;if(i){var r=i.sorting.enable,e=this.Pv.isEnabled;if(e||r){zi.onClick(this,(function(t){n.onClick(t)}));var u=this.state;u.lock(),u.set(xm.SORTABLE,r),u.set(xm.CHECKABLE,e),u.unlock()}}},Object.defineProperty(i.prototype,"sorter",{get:function(){var t=this,n=this.Ev;if(null==n){var i=this.Qh;if(!i)return null;var r=i.table;if(!r)return null;n=r.data.sorter,this.Ev=n,this.Fv=this.Fv||function(){t.onSorterChange()},n.on("change",this.Fv)}return n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comparator",{get:function(){var t=this.cv;return t&&t.sorting.comparator||null},enumerable:!1,configurable:!0}),i.prototype.onSorterChange=function(){var t=this.comparator;if(t){var n=this.Ev;if(n){var i=xm.SORTED_ASCENDING,r=xm.SORTED_DESCENDING;n.isApplied()&&n.get()===t?n.order===$m.ASCENDING?this.state.set(i,r):this.state.set(r,i):this.state.removeAll(i,r)}}},i.prototype.toClickPosition=function(n){var i=this.Uv||new t.Point;return this.Uv=i,n.data.getLocalPosition(this,i).x},i.prototype.isCheckClicked=function(t){if(this.Pv.isEnabled){if(!this.isSortable)return!0;var n=this.ou[1];if(n&&null!=n.image){var i=this.toClickPosition(t),r=n.bound,e=n.margin.horizontal;return r.left-e<=i&&i<=r.right+e}}return!1},i.prototype.onClick=function(t){this.state.isActionable&&(this.isCheckClicked(t)?(this.onToggleStart(),this.onToggleEnd()):this.onActivate(t))},i.prototype.onActivate=function(t){this.doSort(t),this.emit("active",this)},i.prototype.doSort=function(t){if(this.isSortable){var n=this.comparator;if(n){var i=this.sorter;i&&(i.get()===n?i.order===$m.ASCENDING?(i.order=$m.DESCENDING,i.apply()):(i.set(null),i.apply()):(i.set(n),i.order=$m.ASCENDING,i.apply()))}}},Object.defineProperty(i.prototype,"isSortable",{get:function(){var t=this.cv;return!!t&&t.sorting.enable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isToggle",{get:function(){return this.Pv.isEnabled},enumerable:!1,configurable:!0}),i.prototype.toggle=function(){this.state.isActionable&&this.isToggle&&(this.onToggleStart(),this.onToggleEnd())},i.prototype.onToggleStart=function(){this.state.isActive=!this.state.isActive},i.prototype.onToggleEnd=function(){this.state.isActive?(this.Pv.execute(!0),this.emit("active",this)):(this.Pv.execute(!1),this.emit("inactive",this))},i.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.isToggle?this.onToggleStart():this.state.isPressed=!0)},i.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.isToggle?this.onToggleEnd():(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1))},i.prototype.onKeyDown=function(t){return Kt.isActivateKey(t)&&this.onActivateKeyDown(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyUp=function(t){return Kt.isActivateKey(t)&&this.onActivateKeyUp(t),n.prototype.onKeyUp.call(this,t)},i.prototype.getType=function(){return"DTableHeaderCell"},i.prototype.destroy=function(){var t=this.Ev,i=this.Fv;t&&i&&t.off("change",i),this.Ev=void 0,this.Fv=void 0,n.prototype.destroy.call(this)},i}(pf),bw=function(t){function n(n){var i,r,e=t.call(this,n)||this;e.Gv=null!==(i=n.table)&&void 0!==i?i:null;var u=null!==(r=n.offset)&&void 0!==r?r:0;return e.Jt=u,e.transform.position.y=u,e.initCells(n,e.bv,e.vv),e}return _(n,t),Object.defineProperty(n.prototype,"table",{get:function(){return this.Gv},enumerable:!1,configurable:!0}),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.Jt,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new vw(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=n.header||i.cell;return null!=r?(void 0===r.weight&&(r.weight=n.weight),void 0===r.width&&(r.width=n.width),void 0===r.text?r.text={value:n.label}:void 0===r.text.value&&(r.text.value=n.label),void 0===r.header&&(r.header=this),void 0===r.column&&(r.column=n),void 0===r.columnIndex&&(r.columnIndex=t),r):{weight:n.weight,width:n.width,text:{value:n.label},header:this,column:n,columnIndex:t}},n.prototype.getType=function(){return"DTableHeader"},n}(Xm),dw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getOffsetVerticalStart=function(t){return.5*t+this.O.body.position.y},n}(Tb),gw=function(t,n){return t[n]},mw=function(t,n,i){t[n]=i},ww=function(){return""},pw=function(){},Ow=function(t){if(null!=t){var n=t.length;if(n<=1){var i=t[0];return function(t){return i in t}}return function(i){for(var r=0;r<n;++r){var e=t[r];if(!(e in i))return!1;i=i[e]}return!0}}return function(t,n){return n<t.length}},Dw=function(t,n){return at(t)?Ow(n):null!=t&&t},Ew=function(t,n){var i,r=t.editing,e=t.editable;return r?{enable:Dw(null!==(i=r.enable)&&void 0!==i?i:e,n),formatter:r.formatter,unformatter:r.unformatter,validator:r.validator}:{enable:Dw(e,n)}},Mw=function(t,n){return function(i,r){var e=t(i,n),u=t(r,n);return e<u?-1:u<e?1:0}},Sw=function(t,n,i){var r=i.sorting,e=i.sortable;return r?r.enable||e?{enable:!0,comparator:r.comparator||Mw(t,n)}:{enable:!1}:e?{enable:!0,comparator:Mw(t,n)}:{enable:!1}},Tw=function(t){return null==t?void 0:t instanceof jg?t:new jg(t)},jw=function(t){return null==t?void 0:"open"in t?t:new Bb(t)},Nw=function(t){return t.value},Iw=function(){},Cw=function(t){return t?{getter:t.getter||Nw,setter:t.setter||Iw,menu:Tw(t.menu),multiple:Tw(t.multiple),dialog:jw(t.dialog),promise:t.promise}:{getter:Nw,setter:Iw}},Aw=function(t,n){var i=t.renderable;return at(i)?Ow(n):null==i||i},Rw=function(t,n){var i,r=n.weight,e=n.width;null!=r?null!=e&&(e=void 0):null==e&&(r=1);var u=di(null!==(i=n.type)&&void 0!==i?i:Sm.TEXT,Sm),s=function(t,n){var i=t.align;if(null!=i)return at(i)?le[i]:i;switch(n){case Sm.TEXT:return le.LEFT;case Sm.REAL:case Sm.INTEGER:return le.RIGHT;case Sm.BUTTON:case Sm.INDEX:case Sm.SELECT:case Sm.ACTION:case Sm.LINK:return le.CENTER;default:return le.LEFT}}(n,u),h=n.label||"",o=function(t){return null!=t.path?t.path.split("."):null}(n),a=function(t,n,i){var r=t.getter;if(r)return r;switch(n){case Sm.ACTION:case Sm.LINK:return ww;default:return null==i?gw:function(t,n){if(t.length<=1){var i=t[0];return void 0===n?function(t){return t[i]}:function(t){return i in t?t[i]:n}}return void 0===n?function(n){for(var i=0,r=t.length-1;i<r;++i)n=n[t[i]];return n[t[t.length-1]]}:function(i){for(var r=0,e=t.length-1;r<e;++r)i=i[t[r]];var u=t[t.length-1];return u in i?i[u]:n}}(i,t.default)}}(n,u,o);return{weight:r,width:e,type:u,label:h,getter:a,setter:function(t,n,i){var r=t.setter;if(r)return r;switch(n){case Sm.BUTTON:case Sm.ACTION:case Sm.LINK:return pw;default:return null==i?mw:function(t){if(t.length<=1){var n=t[0];return function(t,i,r){t[n]=r}}return function(n,i,r){for(var e=0,u=t.length-1;e<u;++e)n=n[t[e]]||{};n[t[t.length-1]]=r}}(i)}}(n,u,o),formatter:n.formatter,renderable:Aw(n,o),align:s,editing:Ew(n,o),sorting:Sw(a,t,n),header:n.header,body:n.body,selecting:Cw(n.selecting),category:n.category,frozen:n.frozen,offset:0,link:n.link}},yw=function(t){function n(n){var i=t.call(this,n)||this,r=i.content;r.setWidth(i.toContentWidth(n));var e=i.body;r.addChild(e),e.data.selection.type!==Wm.NONE&&zi.onClick(i,(function(t){e.onRowClick(t)}));var u=i.header;u&&r.addChild(u);for(var s=i.categories,h=s.length-1;0<=h;--h)r.addChild(s[h]);return e.update(),i}return _(n,t),Object.defineProperty(n.prototype,"columns",{get:function(){var t=this.bv;if(null==t){var n=this.Nn;t=n?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(Rw(i,t[i]));return n}(n.columns):[],this.bv=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"frozen",{get:function(){var t=this.vv;return null==t&&(t=function(t){for(var n=t.length-1;0<=n;--n)if(!0===t[n].frozen)return n+1;return 0}(this.columns),this.vv=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"categories",{get:function(){var t=this.zv;return null==t&&(t=this.newCategories(this.Nn,this.columns,this.frozen),this.zv=t),t},enumerable:!1,configurable:!0}),n.prototype.initContent=function(n){t.prototype.initContent.call(this,n),n.state.isFocusReverse=!0},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.body.update()},n.prototype.onResize=function(n,i,r,e){var u=this.scrollbar;u.lock();var s=this.body;s.lock(),t.prototype.onResize.call(this,n,i,r,e),s.update(),s.unlock(!0),u.unlock(!0)},n.prototype.getCategoryCount=function(t){for(var n=0,i=0,r=t.length;i<r;++i){var e=t[i].category;if(null!=e){var u=at(e)?1:e.length;n=Math.max(n,u)}}return n},n.prototype.toCategoryLabel=function(t,n){if(n)if(at(n)){if(0===t)return n}else if(t<n.length)return n[t]},n.prototype.isSameCategory=function(t,n,i){if(null!=n){if(null!=i){if(at(n))return at(i)?0<t||n===i:0<t?i.length<=t:1===i.length&&n===i[0];if(at(i))return 0<t?n.length<=t:1===n.length&&n[0]===i;if(n.length<=t&&i.length<=t)return!0;if(i.length===n.length){for(var r=t,e=n.length;r<e;++r)if(n[r]!==i[r])return!1;return!0}return!1}return at(n)?0<t:n.length<=t}return null==i||(at(i)?0<t:i.length<=t)},n.prototype.toCategoryColumns=function(t,n,i){for(var r=[],e=null,u=null,s=0,h=n.length;s<h;++s){var o=n[s];s!==i&&u&&e&&this.isSameCategory(t,e.category,o.category)?null!=u.weight&&null!=o.weight?u.weight+=o.weight:null!=u.width&&null!=o.width?u.width+=o.width:(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u)):(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u))}return r},n.prototype.toCategoryOptions=function(t,n,i,r,e){return n?(void 0===n.columns&&(n.columns=this.toCategoryColumns(t,i,r)),null==n.frozen&&(n.frozen=r),null==n.offset&&(n.offset=e),n):{columns:this.toCategoryColumns(t,i,r),frozen:r,offset:e}},n.prototype.newCategories=function(t,n,i){for(var r=[],e=0,u=this.getCategoryCount(n)-1;0<=u;--u){var s=new rw(this.toCategoryOptions(u,null==t?void 0:t.category,n,i,e));r.push(s),e+=s.height}return r},n.prototype.onDblClick=function(n,i){var r=this.body.onDblClick(n,i);return t.prototype.onDblClick.call(this,n,i)||r},n.prototype.newScrollBar=function(t){var n=this;return new dw(this,t,(function(t){n.onScrollBarUpdate(t)}))},n.prototype.toContentWidth=function(t){var n=0,i=null==t?void 0:t.columns;if(i)for(var r=0,e=i.length;r<e;++r){var u=i[r].width;null!=u&&(n+=u)}return 0<n?function(t){return Math.max(t,n)}:"100%"},Object.defineProperty(n.prototype,"headerOffset",{get:function(){var t=this.Hv;return null==t&&(t=this.newHeaderOffset(),this.Hv=t),t},enumerable:!1,configurable:!0}),n.prototype.newHeaderOffset=function(){for(var t=0,n=this.categories,i=0,r=n.length;i<r;++i)t+=n[i].height;return t},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.Qh;return void 0===t&&(t=this.newHeader(this.Nn,this.columns,this.frozen,this.headerOffset),this.Qh=t),t},enumerable:!1,configurable:!0}),n.prototype.hasHeader=function(t){if(t)for(var n=t.columns,i=0,r=n.length;i<r;++i)if(null!=n[i].label)return!0;return!1},n.prototype.newHeader=function(t,n,i,r){return this.hasHeader(t)?new bw(this.toHeaderOptions(null==t?void 0:t.header,n,i,r)):null},n.prototype.toHeaderOptions=function(t,n,i,r){return t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.table&&(t.table=this),t):{columns:n,frozen:i,offset:r,table:this}},Object.defineProperty(n.prototype,"bodyOffset",{get:function(){var t=this.Vv;return null==t&&(t=this.newBodyOffset(),this.Vv=t),t},enumerable:!1,configurable:!0}),n.prototype.newBodyOffset=function(){var t,n;return this.headerOffset+(null!==(n=null===(t=this.header)||void 0===t?void 0:t.height)&&void 0!==n?n:0)},Object.defineProperty(n.prototype,"body",{get:function(){var t=this.no;return null==t&&(t=this.newBody(this.Nn,this.columns,this.frozen,this.bodyOffset),this.no=t),t},enumerable:!1,configurable:!0}),n.prototype.newBody=function(t,n,i,r){return new nw(this.toBodyOptions(null==t?void 0:t.body,n,i,r,null==t?void 0:t.data))},n.prototype.toBodyOptions=function(t,n,i,r,e){return null!=t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.data&&void 0!==e&&(Wt(e)?t.data={rows:e}:t.data=e),void 0===t.height&&void 0===t.weight&&(t.weight=1),t):Wt(e)?{columns:n,frozen:i,offset:r,data:{rows:e},weight:1}:{columns:n,frozen:i,offset:r,data:e,weight:1}},Object.defineProperty(n.prototype,"data",{get:function(){return this.body.data},enumerable:!1,configurable:!0}),n.prototype.getFocusedChildClippingRect=function(n,i,r,e,u,s,h,o){t.prototype.getFocusedChildClippingRect.call(this,n,i,r,e,u,s,h,o);var a=this.toCell(n);if(a){var c=i+this.toFrozenCellX(a)-o.x;if(0<c&&(o.x+=c,o.width-=c),a.parent.parent===this.body){var f=this.bodyOffset;o.y+=f,o.height-=f}}return o},n.prototype.toFrozenCellX=function(t){var n=this.frozen;if(0<n){var i=t.parent.children,r=i.indexOf(t);if(0<=r){var e=i.length;if(n<=e-1-r){var u=i[e-n];return u.position.x+u.width}}}return 0},n.prototype.onKeyDown=function(n){Kt.moveFocusHorizontally(n,this);var i=Kt.isArrowUpKey(n),r=Kt.isArrowDownKey(n);return(i||r)&&this.onKeyDownArrowUpOrDown(n,r),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowUpOrDown=function(t,n){var i=rt.getLayer(this);if(null==i)return!1;var r=i.getFocusController(),e=r.get();if(null==e)return!1;var u=this.toCell(e);if(null==u)return!1;var s=u.parent;if(null==s)return!1;var h=r.find(s,!1,!1,n,this);if(null==h)return!1;var o=this.toCell(h);if(null==o)return!1;var a=o.parent;if(null==a)return!1;var c=s.children.indexOf(u);if(c<0)return!1;var f=a.children[c];if(null==f||f===u||!("state"in f))return!1;var l=r.find(f,!0,!0,n,this);return null!=l&&(r.focus(l),!0)},n.prototype.toCell=function(t){for(var n=t;null!=n;){var i=n.parent;if(i instanceof Xm)return n instanceof Ki?n:null;n=i}return null},n.prototype.getType=function(){return"DTable"},n}(jb),kw=function(t){var n=t.text;if(at(n))return n;var i=t.label;if(at(i))return i;var r=t.name;return at(r)?r:void 0},Lw=function(t){var n=t.title;if(at(n))return n},xw=function(t){return t.image},Bw=function(t){return t.children},_w=function(t){return t.children=[]},Pw=function(t){var n,i,r,e,u;this.toLabel=null!==(n=null==t?void 0:t.toLabel)&&void 0!==n?n:kw,this.toTitle=null!==(i=null==t?void 0:t.toTitle)&&void 0!==i?i:Lw,this.toImage=null!==(r=null==t?void 0:t.toImage)&&void 0!==r?r:xw,this.toChildren=null!==(e=null==t?void 0:t.toChildren)&&void 0!==e?e:Bw,this.newChildren=null!==(u=null==t?void 0:t.newChildren)&&void 0!==u?u:_w},Fw={NONE:0,SINGLE:1,MULTIPLE:2},Uw=function(){function t(t,n){this.O=t,this.xv=[],this.Wv=[],this.Xn=n,this.un=!1}return Object.defineProperty(t.prototype,"nodes",{get:function(){return this.update(),this.xv},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"levels",{get:function(){return this.update(),this.Wv},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.un=!0},t.prototype.size=function(){return this.update(),this.xv.length},t.prototype.each=function(t,n,i){this.update();for(var r=this.xv,e=null!=n?Math.max(0,n):0,u=null!=i?Math.min(r.length,i):r.length,s=e;s<u&&!1!==t(r[s],s);++s);},t.prototype.update=function(){if(this.un){this.un=!1;var t=this.O,n=t.nodes,i=t.accessor.toChildren,r=this.xv,e=this.Wv,u=this.newNodes(t,n,0,0,r,e,this.Xn,i);r.length!==u&&(r.length=u,e.length=u)}},t.prototype.newNodes=function(t,n,i,r,e,u,s,h){for(var o=n.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=n[c];i<e.length?(e[i]=f,u[i]=r):(e.push(f),u.push(r)),i+=1;var l=h(f);l&&t.isExpanded(f)&&(i=this.newNodes(t,l,i,r+1,e,u,s,h))}return i},t}(),Gw=function(t){function n(n,i){var r=t.call(this)||this;r.O=n,r.xv=new Set;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return Fw.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){var t=this.xv;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.xv;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.xv;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.xv;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.xv;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.xv;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.xv;return 0<t.size&&(t.clear(),this.onChange(),!0)},n.prototype.clearAndAdd=function(t){var n=this.xv;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.xv,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.xv=i,this.onChange()),n},n.prototype.contains=function(t){return this.xv.has(t)},n.prototype.size=function(){return this.xv.size},n.prototype.isEmpty=function(){return this.xv.size<=0},n.prototype.each=function(t){var n=!1;this.xv.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.xv.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.xv,i=this.newNodes(t,n,new Set);n.size!==i.size&&(this.xv=i,this.onChange())},n.prototype.newNodes=function(t,n,i){for(var r=this.O.accessor.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];n.has(s)&&i.add(s);var h=r(s);h&&this.newNodes(h,n,i)}return i},n}(t.utils.EventEmitter),zw=function(t){function n(n,i){var r=t.call(this)||this;r.O=n,r.pn=null;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return Fw.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.pn},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.pn:null},n.prototype.add=function(t){return this.pn!==t&&(this.pn=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.pn===t&&(this.pn=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.pn===t?this.pn=null:this.pn=t,this.onChange(),!0},n.prototype.clear=function(){return null!=this.pn&&(this.pn=null,this.onChange(),!0)},n.prototype.clearAndAdd=function(t){return this.pn!==t&&(this.pn=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){if(0<t.length){var n=t[t.length-1];return this.clearAndAdd(n)}return this.clear()},n.prototype.contains=function(t){return this.pn===t},n.prototype.size=function(){return null!=this.pn?1:0},n.prototype.isEmpty=function(){return null==this.pn},n.prototype.each=function(t){var n=this.pn;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.pn;return null!=t?[t]:[]},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.pn,i=this.newNode(t,n);n!==i&&(this.pn=i,this.onChange())},n.prototype.newNode=function(t,n){for(var i=this.O.accessor.toChildren,r=0,e=t.length;r<e;++r){var u=t[r];if(n===u)return u;var s=i(u);if(s){var h=this.newNode(s,n);if(null!=h)return h}}return null},n}(t.utils.EventEmitter),Hw=function(t){function n(n,i){var r=t.call(this)||this;r.O=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return Fw.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){return!1},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onNodeChange=function(t){},n}(t.utils.EventEmitter),Vw=function(){function t(t,n){this.O=t,this.Xv=new WeakMap,this.hc=this.toSelection(n),this.ec=new Pw(n);var i=new Uw(this,!!(null==n?void 0:n.reverse));this.oc=i;var r=null==n?void 0:n.nodes;null!=r?(this.xv=r,i.toDirty()):this.xv=[]}return t.prototype.toSelection=function(t){var n=null==t?void 0:t.selection;switch(null==n?void 0:n.type){case Fw.NONE:case"NONE":return new Hw(this,n);case Fw.MULTIPLE:case"MULTIPLE":return new Gw(this,n);default:return new zw(this,n)}},Object.defineProperty(t.prototype,"nodes",{get:function(){return this.xv},set:function(t){this.xv=t,this.oc.toDirty(),this.hc.onNodeChange(t),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.oc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.ec},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.O.update()},t.prototype.toggle=function(t){var n=this.Xv;return n.has(t)?n.delete(t):n.set(t,1),this.oc.toDirty(),this.update(),!0},t.prototype.expand=function(t){var n=this.Xv;return!n.has(t)&&(n.set(t,1),this.oc.toDirty(),this.update(),!0)},t.prototype.collapse=function(t){var n=this.Xv;return!!n.has(t)&&(n.delete(t),this.oc.toDirty(),this.update(),!0)},t.prototype.expandAll=function(){var t=!1,n=this.Xv;return this.each((function(i){n.has(i)||(n.set(i,1),t=!0)})),!!t&&(this.oc.toDirty(),this.update(),!0)},t.prototype.collapseAll=function(){var t=!1,n=this.Xv;return this.each((function(i){n.has(i)&&(n.delete(i),t=!0)})),!!t&&(this.oc.toDirty(),this.update(),!0)},t.prototype.isCollapsed=function(t){return!this.isExpanded(t)},t.prototype.isExpanded=function(t){return this.Xv.has(t)},t.prototype.clear=function(){var t=this.xv;return 0<t.length&&(t.length=0,this.oc.toDirty(),this.hc.clear(),this.update(),!0)},t.prototype.remove=function(t){var n=!1;return this.each((function(i,r,e){return i!==t||(e.splice(r,1),n=!0,!1)})),!!n&&(this.oc.toDirty(),this.hc.remove(t),this.update(),!0)},t.prototype.add=function(t,n){var i=!1;if(n){var r=this.ec,e=r.toChildren(n);if(e)e.push(t),i=!0;else{var u=r.newChildren(n);u&&(u.push(t),i=!0)}}else{var s=this.xv;s?s.push(t):this.xv=[t],i=!0}return i&&(this.oc.toDirty(),this.update()),!0},t.prototype.addBefore=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e,0,t),i=!0,!1)})),i&&(this.oc.toDirty(),this.update()),i},t.prototype.addAfter=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e+1,0,t),i=!0,!1)})),i&&(this.oc.toDirty(),this.update()),i},t.prototype.each=function(t){var n=this.xv;n&&this.rc(n,null,t)},t.prototype.rc=function(t,n,i){for(var r=this.ec.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];if(!1===i(s,e,t,n))return;var h=r(s);h&&this.rc(h,s,i)}},t}(),Ww={HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED"},Xw=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Bn=new pv(r.Bn),r.$i=n,r}return _(n,t),Object.defineProperty(n.prototype,"node",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.ae},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){return this.$i},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.pn;void 0!==t&&this.$i.toggle(t)},n.prototype.set=function(t,n,i){var r,e=this.$i,u=i||this.pn!==t;if(u){this.pn=t,this.ae=n;var s=e.accessor;this.text=s.toLabel(t),this.title=null!==(r=s.toTitle(t))&&void 0!==r?r:"",this.image=s.toImage(t)}var h=e.mapped.levels[n];this.Bn.adjLeft(this.theme.getLevelPadding(h));var o=e.accessor.toChildren(t),a=!!(o&&0<o.length),c=this.state;c.lock(),c.set(ht.ACTIVE,e.selection.contains(t)),c.remove(ht.DISABLED),c.set(Ww.HAS_CHILDREN,a),c.set(Ww.OPENED,e.isExpanded(t)),c.unlock(),u&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.pn){this.pn=void 0,this.ae=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ht.DISABLED),t.remove(ht.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onSelect=function(t,n){var i=this.$i,r=i.selection;if(r.type!==Fw.MULTIPLE)r.clearAndAdd(n);else{var e=t&&"data"in t?t.data.originalEvent:t;if(null==e?void 0:e.ctrlKey)r.toggle(n);else if(null==e?void 0:e.shiftKey){var u=i.mapped,s=r.last;if(n===s)r.clearAndAdd(n);else{var h=!1,o=!1,a=[];u.each((function(t){if(h){if(o){if(a.unshift(t),t===n)return!1}else if(a.push(t),t===s)return!1}else t===n?(h=!0,o=!1,a.push(t)):t===s&&(h=!0,o=!0,a.push(t))})),r.clearAndAddAll(a)}}else r.clearAndAdd(n)}},n.prototype.onKeyDown=function(n){var i;return Kt.isActivateKey(n)&&this.onKeyDownActivate(n),Kt.isArrowRightKey(n)&&void 0!==(i=this.pn)&&this.state.is(Ww.HAS_CHILDREN)&&this.$i.expand(i),Kt.isArrowLeftKey(n)&&void 0!==(i=this.pn)&&this.state.is(Ww.HAS_CHILDREN)&&this.$i.collapse(i),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){if(this.state.isActionable&&this.state.isFocused){var n=this.pn;return void 0!==n&&this.onSelect(t,n),!0}return!1},n.prototype.getType=function(){return"DTreeItemText"},n}(Ie),Kw=function(t){function n(n,i){var r,e=t.call(this,n,i)||this,u=di(null!==(r=null==i?void 0:i.when)&&void 0!==r?r:fe.CLICKED,fe);return e.cu=u,e.initOnClick(u,e.theme,i),e}return _(n,t),n.prototype.initOnClick=function(t,n,i){var r=this;zi.onClick(this,(function(n){t===fe.CLICKED&&r.onClick(n)}))},n.prototype.onClick=function(t){this.state.isActionable&&this.onActivate(t)},n.prototype.onDblClick=function(n,i){return this.cu===fe.DOUBLE_CLICKED&&this.onClick(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTreeItemButton"},n}(Xw),Yw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(i){t.prototype.onActivate.call(this,i);var r=this.pn;void 0!==r&&(this.state.is(Ww.HAS_CHILDREN)?i&&"data"in i&&(this.toLocal(i.data.global,void 0,n.WORK_CONTAINS_POINT).x<=this.padding.getLeft()?this.toggle():this.onSelect(i,r)):this.onSelect(i,r))},n.prototype.getType=function(){return"DTreeItemNonEditable"},n}(Kw),Jw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new Yw(t)},n}(eb),Zw=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.Mc;return null==t&&(t=this.newUpdater(this.data,this.content,this.Nn),this.Mc=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new Jw(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.$i;return null==t&&(t=this.toData(this.Nn),this.$i=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.nodes||t.value)||[];return Wt(n)?new Vw(this,{nodes:n}):"add"in n?n:new Vw(this,n)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nodes",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),n.prototype.toggle=function(t){return this.data.toggle(t)},n.prototype.expand=function(t){return this.data.expand(t)},n.prototype.collapse=function(t){return this.data.collapse(t)},n.prototype.expandAll=function(){return this.data.expandAll()},n.prototype.collapseAll=function(){return this.data.collapseAll()},n.prototype.isCollapsed=function(t){return this.data.isCollapsed(t)},n.prototype.isExpanded=function(t){return this.data.isExpanded(t)},n.prototype.clear=function(){return this.data.clear()},n.prototype.remove=function(t){return this.data.remove(t)},n.prototype.add=function(t,n){return this.data.add(t,n)},n.prototype.addBefore=function(t,n){return this.data.addBefore(t,n)},n.prototype.addAfter=function(t,n){return this.data.addAfter(t,n)},n.prototype.each=function(t){return this.data.each(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!1),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DTree"},n}(jb),qw={__proto__:null,loadAll:El,loadMenuItemAll:Dl,loadMenuItemExpandable:il,loadMenuItem:Wf,loadMenuSidedItemExpandable:Ol,loadMenuSidedItem:cl,EShapeActionBases:Zt,EShapeActionExpressions:qt,EShapeActionRuntimeBlinkBrighten:nn,EShapeActionRuntimeBlinkColorFill:rn,EShapeActionRuntimeBlinkColorStroke:en,EShapeActionRuntimeBlinkDarken:un,EShapeActionRuntimeBlinkOpacity:sn,EShapeActionRuntimeBlinkVisibility:hn,EShapeActionRuntimeBlink:tn,EShapeActionRuntimeChangeColorBrightness:En,EShapeActionRuntimeChangeColorCode:Sn,EShapeActionRuntimeChangeColor:mn,EShapeActionRuntimeChangeCursor:jn,EShapeActionRuntimeChangeTextNumber:ai,EShapeActionRuntimeChangeTextText:ci,EShapeActionRuntimeConditional:Qt,EShapeActionRuntimeEmitEvent:ar,EShapeActionRuntimeMiscGesture:_r,EShapeActionRuntimeMiscEmitEvent:fr,EShapeActionRuntimeMiscHtmlElement:mr,EShapeActionRuntimeMiscInputInput:Sr,EShapeActionRuntimeMiscInputInteger:jr,EShapeActionRuntimeMiscInputNumber:Tr,EShapeActionRuntimeMiscInputReal:Nr,EShapeActionRuntimeMiscInputText:Cr,EShapeActionRuntimeMiscInput:Mr,EShapeActionRuntimeMiscLayerGesture:he,EShapeActionRuntimeMiscLayerShowHide:ae,EShapeActionRuntimeMiscWriteBoth:Rr,EShapeActionRuntimeMiscWriteLocal:yr,EShapeActionRuntimeMiscWriteRemote:kr,EShapeActionRuntimeMiscWrite:Ar,EShapeActionRuntimeOpenDiagram:mu,EShapeActionRuntimeOpenDialogBoolean:ru,EShapeActionRuntimeOpenDialogInteger:cu,EShapeActionRuntimeOpenDialogReal:vu,EShapeActionRuntimeOpenDialogText:gu,EShapeActionRuntimeOpenDialog:iu,EShapeActionRuntimeOpenPageInplace:pu,EShapeActionRuntimeOpenPage:wu,EShapeActionRuntimeOpen:nu,EShapeActionRuntimeShowHide:Yu,EShapeActionRuntimeTransformMoveAbsoluteX:qu,EShapeActionRuntimeTransformMoveAbsoluteY:$u,EShapeActionRuntimeTransformMoveForwardOrBackward:Qu,EShapeActionRuntimeTransformMoveLeftOrRight:ts,EShapeActionRuntimeTransformMoveRelativeX:ns,EShapeActionRuntimeTransformMoveRelativeY:is,EShapeActionRuntimeTransformMove:Zu,EShapeActionRuntimeTransformResizeHeightAbsolute:cs,EShapeActionRuntimeTransformResizeHeightRelative:fs,EShapeActionRuntimeTransformResizeSizeAbsolute:ls,EShapeActionRuntimeTransformResizeSizeRelative:vs,EShapeActionRuntimeTransformResizeWidthAbsolute:bs,EShapeActionRuntimeTransformResizeWidthRelative:ds,EShapeActionRuntimeTransformResize:as,EShapeActionRuntimeTransformRotateAbsolute:ws,EShapeActionRuntimeTransformRotateRelative:ps,EShapeActionRuntimeTransformRotate:ms,EShapeActionRuntime:$t,EShapeActionRuntimes:or,EShapeActionValueBase:an,EShapeActionValueBlinkType:on,EShapeActionValueBlink:vn,EShapeActionValueChangeColorBrightness:Mn,EShapeActionValueChangeColorCode:Tn,EShapeActionValueChangeColorTarget:gn,EShapeActionValueChangeColorTypeLegacy:pn,EShapeActionValueChangeColorType:wn,EShapeActionValueChangeColorTypes:On,EShapeActionValueChangeColor:Dn,EShapeActionValueChangeCursor:Nn,EShapeActionValueChangeTextType:fi,EShapeActionValueChangeText:li,EShapeActionValueDeserializer:Es,EShapeActionValueEmitEvent:cr,EShapeActionValueMiscEmitEvent:Ys,EShapeActionValueMiscGestureType:xr,EShapeActionValueMiscGesture:Pr,EShapeActionValueMiscHtmlElement:Js,EShapeActionValueMiscInput:Zs,EShapeActionValueMiscLayerGesture:oe,EShapeActionValueMiscLayerShowHide:ce,EShapeActionValueMiscType:gr,EShapeActionValueMiscWrite:qs,EShapeActionValueMisc:Lr,EShapeActionValueOnInputAction:Dr,EShapeActionValueOnInputActions:Er,EShapeActionValueOpenType:Ou,EShapeActionValueOpen:Xu,EShapeActionValueOpetyped:rs,EShapeActionValueShowHideType:Ku,EShapeActionValueShowHide:Ju,EShapeActionValueSubtyped:cn,EShapeActionValueTransformMoveType:es,EShapeActionValueTransformMove:ss,EShapeActionValueTransformResizeType:os,EShapeActionValueTransformResize:gs,EShapeActionValueTransformRotateType:Os,EShapeActionValueTransformRotate:Ds,EShapeActionValueTransformType:us,EShapeActionValueType:fn,EShapeActionValues:ln,EShapeAction:et,loadShapeAll:wf,loadShapeBar:Is,loadShapeButton:nh,loadShapeCircle:vh,loadShapeConnectorLine:xo,loadShapeEmbedded:da,loadShapeGroupShadowed:Ta,loadShapeGroup:Da,loadShapeImage:Ra,loadShapeLabel:Ka,loadShapeLineOfCircles:Oc,loadShapeLineOfRectangleRoundeds:Tc,loadShapeLineOfRectangles:Ac,loadShapeLineOfTriangleRoundeds:Xc,loadShapeLineOfTriangles:$c,loadShapeLine:Za,loadShapeNull:nf,loadShapeRectangleRounded:df,loadShapeRectangle:ef,loadShapeTriangleRounded:mf,loadShapeTriangle:gf,BAR_VERTEX_COUNT:4,BAR_INDEX_COUNT:2,buildBarClipping:c,buildBarIndex:f,buildBarVertexStepAndColorFill:l,buildBarUv:v,CIRCLE_VERTEX_COUNT:9,CIRCLE_INDEX_COUNT:8,CIRCLE_WORLD_SIZE:ih,buildCircleClipping:eh,buildCircleIndex:uh,buildCircleVertex:sh,buildCircleStep:hh,buildCircleUv:oh,buildColor:G,IMAGE_SDF_VERTEX_COUNT:9,IMAGE_SDF_INDEX_COUNT:8,IMAGE_SDF_WORLD_SIZE:ya,buildImageSdfClipping:La,buildImageSdfIndex:xa,buildImageSdfStep:Ba,buildImageSdfVertex:_a,buildImageSdfUv:Pa,toLineOfAnyPointCount:nc,buildLineOfAnyColor:ic,toPointsCount:dh,toLinePointCount:gh,toLineVertexCount:mh,toLineIndexCount:wh,buildLineClipping:ph,buildLineIndex:Oh,buildLineUv:Dh,buildLineVertexStepAndColorFill:Eh,buildNullClipping:qa,buildNullIndex:function(t,n,i,r){for(var e=3*i,u=3*(i+r);e<u;e+=3)t[e+0]=n,t[e+1]=n,t[e+2]=n},buildNullVertex:$a,buildNullStep:Qa,buildNullUv:tc,RECTANGLE_ROUNDED_VERTEX_COUNT:ys,RECTANGLE_ROUNDED_INDEX_COUNT:24,RECTANGLE_ROUNDED_WORLD_SIZE:ks,buildRectangleRoundedIndex:xs,buildRectangleRoundedVertex:Bs,buildRectangleRoundedClipping:_s,buildRectangleRoundedStep:Ps,buildRectangleRoundedUv:Fs,RECTANGLE_VERTEX_COUNT:ho,RECTANGLE_INDEX_COUNT:oo,RECTANGLE_WORLD_SIZE:ao,buildRectangleClipping:fo,buildRectangleIndex:lo,buildRectangleVertex:vo,buildRectangleStep:bo,buildRectangleUv:mo,TEXT_VERTEX_COUNT:4,TEXT_INDEX_COUNT:2,toTextBufferCount:M,buildTextClipping:S,buildTextIndex:T,buildTextStep:j,buildTextVertex:C,TRIANGLE_ROUNDED_VERTEX_COUNT:Rc,TRIANGLE_ROUNDED_INDEX_COUNT:15,TRIANGLE_ROUNDED_WORLD_SIZE:yc,buildTriangleRoundedIndex:Lc,buildTriangleRoundedVertex:xc,buildTriangleRoundedClipping:Bc,buildTriangleRoundedStep:_c,buildTriangleRoundedUv:Pc,TRIANGLE_VERTEX_COUNT:7,TRIANGLE_INDEX_COUNT:3,TRIANGLE_WORLD_SIZE:Ch,buildTriangleClipping:Rh,buildTriangleIndex:yh,buildTriangleVertex:kh,buildTriangleStep:Lh,buildTriangleUv:xh,BuilderBar:zt,BuilderBase:z,BuilderCircle:ah,BuilderImageSdf:Fa,BuilderLabel:Ha,BuilderLineOfAny:rc,BuilderLineOfCircles:dc,BuilderLineOfRectangleRoundeds:Dc,BuilderLineOfRectangles:jc,BuilderLineOfTriangleRoundeds:Fc,BuilderLineOfTriangles:Kc,BuilderLine:Ih,BuilderMarkerCircleHead:Gh,BuilderMarkerCircleTail:zh,BuilderMarkerCircle:Uh,BuilderMarkerRectangleHead:Oo,BuilderMarkerRectangleTail:po,BuilderMarkerRectangle:wo,BuilderMarkerTriangleHead:Ph,BuilderMarkerTriangleTail:Fh,BuilderMarkerTriangle:_h,BuilderNull:Hh,BuilderRectanglePivoted:Bo,BuilderRectangleRounded:Us,BuilderRectangle:ja,BuilderText:Ht,BuilderTriangleRounded:uf,BuilderTriangle:sf,toTransformLocalId:H,toTexture:V,toTextureTransformId:W,toTextureUvs:X,copyClipping:ec,copyIndex:uc,copyStep:sc,copyUvs:hc,copyVertex:oc,createBarUploaded:Vt,createButtonUploaded:zs,createCircle:ch,createRectanglePivotedUploaded:_o,createGroupUploaded:Po,createImageSdfUploaded:Ua,createImageSdf:hf,createImage:function(t){return Ms.toImageElement(t).then((function(t){return new Ca(t)}))},createLabelUploaded:Va,createLineOfAnyUploaded:gc,createLineOfCirclesUploaded:mc,createLineOfRectangleRoundedsUploaded:Ec,createLineOfRectanglesUploaded:Nc,createLineOfTriangleRoundedsUploaded:Uc,createLineOfTrianglesUploaded:Yc,createLineUploaded:To,createLine:function(t,n,i,r){for(var e=no(t,[0,0,0,0]),u=.5*(e[2]+e[0]),s=.5*(e[3]+e[1]),h=e[2]-e[0],o=e[3]-e[1],a=[],c=0,f=t.length;c<f;c+=2)a.push(t[c]-u,t[c+1]-s);var l=new Ya;return l.stroke.set(!0,void 0,void 0,i),l.transform.position.set(u,s),l.size.set(h,o),l.points.set(a,n,r),l},createNullUploaded:Qc,createRectangleRoundedUploaded:Gs,createRectangleUploaded:Na,createTriangleRoundedUploaded:of,createTriangleUploaded:af,deserializeBar:Ns,deserializeButton:Ks,deserializeCircle:lh,deserializeConnectorLine:ko,onConnectorLineDeserialized:Lo,deserializeEmbedded:ba,deserializeGroupShadowed:Sa,deserializeGroup:Oa,deserializeImageSdf:za,deserializeImage:Aa,deserializeLabel:Xa,deserializeLineOfCircles:pc,deserializeLineOfRectangleRoundeds:Sc,deserializeLineOfRectangles:Cc,deserializeLineOfTriangleRoundeds:Wc,deserializeLineOfTriangles:qc,deserializeLine:Ja,deserializeNull:tf,deserializeRectangleRounded:cf,deserializeRectangle:rf,deserializeTriangleRounded:ff,deserializeTriangle:lf,EShapeBarPoints:tt,EShapeBarPosition:Q,EShapeBar:Gt,EShapeBaseHitTestData:dt,EShapeBase:Dt,EShapeButtonRuntimeActionToggle:Qs,EShapeButtonRuntimeAction:$s,EShapeButtonRuntime:th,EShapeButton:Xs,EShapeCircle:fh,EShapeConnectorLine:yo,EShapeDataImpl:It,EShapeDataValueImpl:Nt,EShapeDataValueRangeImpl:Tt,EShapeEmbeddedDatum:Uo,EShapeEmbeddedLayerContainer:ea,EShapeEmbeddedLayer:ra,EShapeEmbedded:la,EShapeEmbeddeds:va,EShapeFillImpl:Z,EShapeGradients:pt,EShapeGroupFillEditor:ga,EShapeGroupFillViewer:Ho,EShapeGroupPoints:ma,EShapeGroupShadowed:Ma,EShapeGroupSizeEditor:Ko,EShapeGroupSizeLayout:Xo,EShapeGroupSizeShadowed:Ea,EShapeGroupSizeViewer:Yo,EShapeGroupStrokeEditor:wa,EShapeGroupStrokeViewer:Jo,EShapeGroupTextAlignEditor:sa,EShapeGroupTextAlignViewer:Zo,EShapeGroupTextEditor:fa,EShapeGroupTextOffsetEditor:ha,EShapeGroupTextOffsetViewer:qo,EShapeGroupTextOutlineEditor:oa,EShapeGroupTextOutlineViewer:$o,EShapeGroupTextPaddingEditor:aa,EShapeGroupTextPaddingViewer:Qo,EShapeGroupTextSpacingEditor:ca,EShapeGroupTextSpacingViewer:ta,EShapeGroupTextViewer:na,EShapeGroupViewer:ia,EShapeGroup:pa,EShapeImageSdf:Ga,EShapeImage:Ca,EShapeLabel:Wa,EShapeLineBaseHitPart:nt,EShapeLineBase:Ut,EShapeLineOfAnyPointsFillImpl:fc,EShapeLineOfAnyPointsImpl:bc,EShapeLineOfAnyPointsPointImpl:lc,EShapeLineOfAnyPointsStrokeImpl:vc,EShapeLineOfCircles:wc,EShapeLineOfRectangleRoundeds:Mc,EShapeLineOfRectangles:Ic,EShapeLineOfTriangleRoundeds:Vc,EShapeLineOfTriangles:Zc,EShapeLinePoints:so,EShapeLine:Ya,EShapeNull:Ts,EShapePrimitive:kt,EShapeRectanglePivoted:vf,EShapeRectangleRounded:Ws,EShapeRectangle:Ia,EShapeStrokeImpl:Et,EShapeTextAlignImpl:Ct,EShapeTextImpl:yt,EShapeTextOffsetImpl:At,EShapeTextOutlineImpl:Rt,EShapeTriangleRounded:Hc,EShapeTriangle:Jc,hitTestBBox:Ot,hitTestCircle:Lt,hitTestRectangleRounded:Vs,hitTestRectangle:Bt,hitTestTriangleRounded:zc,hitTestTriangleFilled:_t,hitTestTriangle:Pt,isStatic:ac,toComputed:cc,toDash:h,toThresholdDefault:Ft,toLength:O,toScaleInvariant:o,EShapeAcceptorImpl:jo,EShapeAcceptorType:No,EShapeAcceptors:Io,EShapeBufferUnitBuilder:$r,EShapeBufferUnit:qr,EShapeBuffer:Qr,EShapeCapabilities:As,EShapeCapability:Cs,EShapeConnectorContainerImpl:ut,EShapeConnectorEdgeAcceptorImpl:Co,EShapeConnectorEdgeContainerImpl:Ro,EShapeConnectorEdgeImpl:Ao,EShapeConnectors:Go,EShapeContainer:ee,EShapeCopyPart:st,EShapeCorner:it,EShapeDataValueRangeType:St,EShapeDataValueOrder:Mt,EShapeDefaults:Y,EShapeDeleter:Sl,EShapeDeserializer:js,EShapeDeserializers:n,EShapeOnDeserialized:i,EShapeEditor:Vo,EShapeImageElements:Ms,EShapeLayerState:zo,toPointsBoundary:no,eShapePointsFormatterCurve:to,EShapePointsMarkerBase:io,EShapePointsMarkerContainerImplNoop:$,EShapePointsMarkerContainerImpl:uo,EShapePointsMarkerHead:ro,EShapePointsMarkerNoop:q,EShapePointsMarkerTail:eo,EShapePointsMarkerType:J,EShapePointsStyle:U,EShapePointsStyles:Tl,EShapeRendererIteratorDatum:ne,EShapeRendererIterator:ie,EShapeRenderer:re,EShapeResourceManagerDeserialization:Fo,EShapeResourceManagerSerialization:jl,EShapeRuntimeReset:Yt,EShapeRuntime:Jt,EShapeRuntimes:Rs,EShapeSearch:Ml,EShapeSizes:hs,EShapeStateSetImplObservable:vt,EShapeState:lt,EShapeStrokeSide:xt,EShapeStrokeStyle:s,EShapeTextAlignHorizontal:m,EShapeTextAlignVertical:w,EShapeTextDirection:p,EShapeTextWeight:d,EShapeTextStyle:g,EShapeTransformImpl:bt,EShapeTransforms:Wo,EShapeType:r,EShapeUploadedImpl:u,EShapeUploadeds:e,EShapeUuidMappingImpl:Ss,ESnapperGrid:Nl,ESnapperResultScale:function(){this.distance=NaN,this.scale=new t.Point},ESnapperResult:Il,ESnapperTargetValueType:Cl,ESnapperTargetValue:Al,ESnapperTarget:Rl,ESnapperModifierAnchor:kl,ESnapper:Ll,DThemes:K,DynamicAtlasItemEmpty:Ur,DynamicAtlasItemFontAtlas:Hr,DynamicAtlasItemImage:Zr,DynamicAtlasItemText:xl,DynamicAtlasItemWhite:Gr,DynamicAtlasItem:Fr,DynamicAtlas:zr,DynamicFontAtlasCharacterOrigin:Wr,DynamicFontAtlasCharacter:Xr,DynamicFontAtlasFont:Bl,DynamicFontAtlas:_l,DynamicFontAtlases:zl,DynamicSDFFontAtlas:Yr,DynamicSDFFontAtlases:Jr,DynamicSDFFontGenerator:Kr,isArray:Wt,isFunction:ot,isNaN:Gu,isNumber:Xt,isString:at,Lazy:Hl,NumberFormatterImpl:hi,NumberFormatters:oi,toCeilingIndex:Vl,toEnum:di,toIndexOf:Vh,toLabel:Wl,toPadded:mt,toString:function(t){return null!=t?String(t):""},toSvgTexture:function(n,i){return t.Texture.from(gt(n),{resolution:i})},toSvgUrl:gt,UtilAlpha:bn,UtilSvgAtlasBuilder:Xl,UtilAttachAlign:ke,UtilAttach:Le,UtilClickOutside:Pe,UtilClipboard:Rf,UtilGestureData:$i,UtilGestureEasingHistory:nr,UtilGestureEasing:ir,UtilGestureMode:qi,UtilGestureModifier:Ji,UtilGestureModifiers:Zi,UtilGesture:rr,UtilExtract:Jl,UtilExtractor:Kl,UtilFileDownloader:Yl,UtilFileAs:Zl,UtilFileOpener:ql,UtilHsv:$l,UtilHtmlElementWhen:vr,UtilHtmlElement:br,UtilInputInput:pr,UtilInputNumber:Or,UtilInputTextArea:Ql,UtilInputText:Ir,UtilInput:wr,UtilKeyboardEvent:Kt,UtilName:tv,UtilOverlay:Fe,UtilPointerEvent:zi,UtilRgb:wt,UtilRgba:nv,UtilStateBlinker:iv,UtilTransition:rv,UtilWheelEvent:ev,DAlignHorizontal:le,DAlignVertical:ve,DAlignWith:be,DAnimationBase:tr,DAnimationEmpty:uv,DAnimationFadeIn:ye,DAnimationTimings:Qi,DApplicationLayerOptions:hv,DApplicationLayer:gv,DApplicationPadding:sv,DApplication:wv,DApplications:rt,DBaseAutoSet:Vi,DBaseAuto:Hi,DBaseBackgroundMeshGeometry:Si,DBaseBackgroundMesh:Ti,DBaseBackgroundSnippet:ji,DBaseBackground:vi,DBaseBorderMeshGeometry:Ni,DBaseBorderMesh:Ii,DBaseBorderSnippet:Ci,DBaseBorder:gi,DBaseCorner:wi,DBaseInteractive:pi,DBaseMeshGeometry:Mi,DBaseOutlineSnippet:Ai,DBaseOutline:Oi,DBaseOverflowMaskSimple:we,DBaseOverflowMask:Yi,DBasePaddingAdjustable:pv,DBasePadding:Di,DBasePoint:Ei,DBaseReflowableContainer:Xi,DBaseReflowableImpl:Ri,DBaseSnippetContainer:Wi,DBaseStateSetImplObservable:ft,DBaseStateSetImpl:ct,DBaseState:ht,DBase:Ki,DBoard:Ov,DBorderMask:bi,DButtonAmbient:Du,DButtonBaseWhen:fe,DButtonBase:Ce,DButtonCheckRight:Ev,DButtonCheck:Dv,DButtonColorGradient:Pv,DButtonColor:Uv,DButtonDanger:Gv,DButtonDate:Hv,DButtonDatetime:Yv,DButtonFileAs:Zl,DButtonFile:Jv,DButtonGroup:Ze,DButtonLink:Zv,DButtonPrimary:Re,DButtonRadioRight:$v,DButtonRadio:qv,DButtonRedo:Qv,DButtonSecondary:tb,DButtonSelect:Fb,DButtonTime:Gb,DButtonUndo:zb,DButton:Ae,DCanvasContainer:hr,DCanvas:Hb,DChartAxisBaseOptionParser:Xb,DChartAxisBase:Kb,DChartAxisContainerImpl:Yb,DChartAxisPosition:Vb,DChartAxisTickPosition:Wb,DChartAxisXDatetime:Zb,DChartAxisX:Jb,DChartAxisY:qb,DChartColorSet1:function(t){return $b[t%$b.length]},DChartColorSet2:td,DChartCoordinateContainerImpl:rd,DChartCoordinateContainerSubImpl:id,DChartCoordinateLinearTick:ed,DChartCoordinateLinear:od,DChartCoordinateLogTick:ad,DChartCoordinateLog:cd,DChartCoordinateTransformImpl:ud,DChartCoordinateTransformMarkImpl:sd,DChartCoordinateDirection:nd,DChartLegendItem:fd,DChartLegend:ld,DChartOverview:vd,DChartPlotAreaContainer:bd,DChartPlotAreaImpl:jd,DChartRegionImplObservable:Nd,DChartRegionImpl:hd,DChartSelectionGridlineContainerImpl:Rd,DChartSelectionGridlineX:Cd,DChartSelectionGridlineY:Ad,DChartSelectionMarker:yd,DChartSelectionShapeBase:Id,DChartSelectionSimple:xd,DChartSelectionSubImpl:Ld,DChartSelectionPoint:kd,DChartSeriesBar:Fd,DChartSeriesBaseCoordinateContainer:Bd,DChartSeriesBase:_d,DChartSeriesContainerImpl:Td,DChartSeriesFillComputedImpl:gd,DChartSeriesFillImpl:wd,DChartSeriesLineOfAny:Pd,DChartSeriesLineOfCircles:Ud,DChartSeriesLineOfRectangleRoundeds:Gd,DChartSeriesLineOfRectangles:zd,DChartSeriesLineOfTriangleRoundeds:Vd,DChartSeriesLineOfTriangles:Hd,DChartSeriesLine:Wd,DChartSeriesExpressionParametersImpl:Xd,DChartSeriesLinear:Kd,DChartSeriesPaddingComputedImpl:pd,DChartSeriesPaddingImpl:Od,DChartSeriesPointComputedImpl:Dd,DChartSeriesPointImpl:Ed,DChartSeriesScalars:md,DChartSeriesStrokeComputedImpl:Md,DChartSeriesStrokeImpl:Sd,DChartSeriesHitResult:dd,DChart:Yd,DColorGradientObservable:Tv,DColorGradientPointObservable:Mv,DCommandClear:av,DCommandCreate:Jd,DCommandDelete:Zd,DCommandFlag:ov,DCommandRedo:cv,DCommandSaveAs:qd,DCommandSave:$d,DCommandUndo:fv,DContent:gb,DControllerDefaultCommand:vv,DControllerDefaultFocus:mv,DControllerKeyboard:bv,DControllers:dv,DCornerMask:mi,DDiagramBase:tg,DDiagramCanvasBase:hg,DDiagramCanvasEditorBackground:ng,DDiagramCanvasEditorSnap:og,DDiagramCanvasEditor:ag,DDiagramCanvasTileMappingImpl:rg,DDiagramCanvasTileMappingPointImpl:ig,DDiagramCanvasTile:eg,DDiagramCanvas:cg,DDiagramDataRemote:fg,DDiagramData:lg,DDiagramEditorThumbnail:vg,DDiagramEditor:bg,DDiagramLayerContainer:sg,DDiagramLayer:ug,DDiagramLayers:ue,DDiagramSerializedVersion:1,DDiagramShape:dg,DDiagramSnapshot:Qd,DDiagram:gg,DDiagrams:ua,DDialogAlign:ke,DDialogCloseOn:xe,DDialogColorGradient:_v,DDialogColor:Fv,DDialogCommand:Ke,DDialogConfirmDelete:pg,DDialogConfirmDiscard:Og,DDialogConfirmMessage:mg,DDialogConfirm:wg,DDialogDate:Vu,DDialogDates:zv,DDialogDatetime:Pu,DDialogDatetimes:Vv,DDialogInputBoolean:tu,DDialogInputInteger:au,DDialogInputReal:lu,DDialogInputText:du,DDialogInput:Je,DDialogMessage:Dg,DDialogMode:Be,DDialogProcessingMessage:Eg,DDialogProcessing:Mg,DDialogSaveAs:Sg,DDialogSelectListItem:rb,DDialogSelectList:Ib,DDialogSelectSearh:Cb,DDialogSelect:Bb,DDialogState:_e,DDialogTime:Uu,DDialogTimes:Ub,DDialog:Ue,DDropdownBase:Ng,DDropdown:Ig,DDynamicTextGeometry:Se,DDynamicTextMeasureResultCharacter:pe,DDynamicTextMeasureResult:Oe,DDynamicTextMeasure:Me,DDynamicTextStyleWordWrap:De,DDynamicTextStyle:Te,DDynamicText:je,DExpandableHeader:Cg,DExpandable:Ag,DHtmlElementState:lr,DHtmlElement:eu,DImageBaseThemeWrapperSecondary:de,DImageBaseThemeWrapperTertiary:ge,DImageBase:Ie,DImagePiece:me,DImage:pf,DInputAndLabel:Nv,DInputBooleanButtonOff:qe,DInputBooleanButtonOn:$e,DInputBoolean:Qe,DInputInput:su,DInputIntegerAndLabel:Rg,DInputInteger:ou,DInputLabel:jv,DInputNumber:hu,DInputRealAndLabel:Iv,DInputReal:fu,DInputSearch:Ab,DInputTextAndLabel:Cv,DInputTextArea:yg,DInputText:bu,DInput:uu,DItemUpdater:eb,DLayoutClearType:yi,DLayoutDirection:Ge,DLayoutHorizontal:We,DLayoutSpace:ze,DLayoutVertical:Xe,DLayout:Ve,DLinkMenuItemId:Tf,DLinkMenu:Nf,DLinkTarget:If,DLink:kf,DLinks:Lf,DListDataImpl:db,DListDataMappedImpl:hb,DListDataSelectionMultiple:ob,DListDataSelectionNone:ab,DListDataSelectionSingle:cb,DListDataSelectionType:nb,DListItemAccessorImpl:bb,DListItemAmbient:kg,DListItemUpdater:ub,DListItem:ib,DList:Nb,DMapCoordinateEPSG3857:Lg,DMapCoordinates:xg,DMapTilePlane:_g,DMapTilePyramidImpl:Pg,DMapTileUrlBuilderKokudo:function(t,n,i){return 5<=t?"https://cyberjapandata.gsi.go.jp/xyz/pale/"+t+"/"+n+"/"+i+".png":2<=t?"https://cyberjapandata.gsi.go.jp/xyz/std/"+t+"/"+n+"/"+i+".png":"https://cyberjapandata.gsi.go.jp/xyz/earthhillshade/"+t+"/"+n+"/"+i+".png"},DMapTileUrlBuilderOsm:function(t,n,i){return"https://"+"abc"[(n+i)%3]+".tile.openstreetmap.org/"+t+"/"+n+"/"+i+".png"},DMapTileUrlBuilderOsmfj:Fg,DMapTilePyramids:Ug,DMapTile:Bg,DMenuAlign:ke,DMenuBarItem:Gg,DMenuBar:zg,DMenuContext:Tg,DMenuItemBase:Of,DMenuItemCheckIsCompatible:Sf,DMenuItemCheck:Mf,DMenuItemExpandableBody:Xf,DMenuItemExpandableHeader:Kf,DMenuItemExpandableIsCompatible:Zf,DMenuItemExpandableItemCheck:qf,DMenuItemExpandableItemLink:$f,DMenuItemExpandableItemMenu:dl,DMenuItemExpandableItemSeparator:Qf,DMenuItemExpandableItemSpace:tl,DMenuItemExpandableItemText:nl,DMenuItemExpandable:Jf,DMenuItemExpandables:Yf,DMenuItemLinkIsCompatible:Bf,DMenuItemLink:xf,DMenuItemMenuIsCompatible:Pf,DMenuItemMenuToSubMenuOptions:Ff,DMenuItemMenu:_f,DMenuItemSeparatorReflowable:Uf,DMenuItemSeparatorIsCompatible:Gf,DMenuItemSeparator:zf,DMenuItemSpaceIsCompatible:Vf,DMenuItemSpace:Hf,DMenuItemText:Ef,DMenuItem:Df,DMenuSidedContent:Hg,DMenuSidedItemCheck:rl,DMenuSidedItemExpandableItemCheck:vl,DMenuSidedItemExpandableItemLink:bl,DMenuSidedItemExpandableItemMenu:gl,DMenuSidedItemExpandableItemSeparator:ml,DMenuSidedItemExpandableItemSpace:wl,DMenuSidedItemExpandableItemText:pl,DMenuSidedItemExpandable:ll,DMenuSidedItemExpandables:fl,DMenuSidedItemLink:el,DMenuSidedItemMenu:ul,DMenuSidedItemSeparator:sl,DMenuSidedItemSpace:hl,DMenuSidedItemText:ol,DMenuSidedSelectionType:Vg,DMenuSidedSelection:Xg,DMenuSided:Kg,DMenuSideds:al,DMenu:jg,DMenus:jf,DNoteError:Yg,DNoteNoItemsFound:Jg,DNoteSearching:Zg,DNoteSmallError:kb,DNoteSmallNoItemsFound:Lb,DNoteSmallSearching:xb,DNoteSmall:yb,DNote:Rb,DNotification:qg,DPaginationDotsButton:$g,DPaginationDynamicButtons:Qg,DPaginationNavigationButton:tm,DPagination:nm,DPane:jb,DPickerColorAndAlpha:Av,DPickerColorGradientRecent:Lv,DPickerColorGradientView:xv,DPickerColorGradient:Bv,DPickerColorRecent:Rv,DPickerColor:yv,DPickerDate:Hu,DPickerDates:Wv,DPickerDatetimeButtonBack:Eu,DPickerDatetimeButtonDate:Mu,DPickerDatetimeButtonNext:Su,DPickerDatetimeLabelDate:ju,DPickerDatetimeLabel:Tu,DPickerDatetimeMask:Iu,DPickerDatetimeMasks:Cu,DPickerDatetimeRange:im,DPickerDatetimeSpace:Nu,DPickerDatetime:_u,DPickerDatetimes:Kv,DPickerTimeBoundHours:Ru,DPickerTimeBoundMinutes:yu,DPickerTimeBoundSeconds:ku,DPickerTimeBound:Au,DPickerTimeBounds:Lu,DPickerTimeRange:rm,DPickerTime:Bu,DPickerTimes:Xv,DScalarExpression:Bi,DScalarFunctions:Gi,DScrollBarHorizontal:Db,DScrollBarThumbHorizontal:Ob,DScrollBarThumbReflowableHorizontal:pb,DScrollBarThumbReflowableVertical:Eb,DScrollBarThumbVertical:Mb,DScrollBarThumb:wb,DScrollBarVertical:Sb,DScrollBar:mb,DSelectMultiple:em,DSelect:um,DShadowImpl:sm,DSliderHorizontal:vm,DSliderLabel:hm,DSliderThumb:om,DSliderTrackHorizontal:lm,DSliderTrackVertical:bm,DSliderTrack:fm,DSliderValue:am,DSliderVertical:dm,DSlider:cm,DTableBodyCellActionDialog:wm,DTableBodyCellActionMenu:pm,DTableBodyCellActionPromise:Dm,DTableBodyCellButton:Mm,DTableBodyCellCheck:Tm,DTableBodyCellColor:jm,DTableBodyCellDate:Nm,DTableBodyCellDatetime:Im,DTableBodyCellIndex:Cm,DTableBodyCellInputInteger:Am,DTableBodyCellInputReal:Rm,DTableBodyCellInputText:ym,DTableBodyCellInputTreeInput:km,DTableBodyCellInputTreeMarker:Lm,DTableBodyCellInputTree:Bm,toLinkOptions:_m,toUrl:Pm,toChecker:Fm,DTableBodyCellLink:Um,DTableBodyCellSelectDialog:mm,DTableBodyCellSelectMenu:Gm,DTableBodyCellSelectMultiple:zm,DTableBodyCellSelectPromise:Om,DTableBodyCellText:Em,DTableBodyCellTime:Hm,DTableBodyCellTree:Vm,DTableBodyCells:gm,DTableBodyRow:Km,DTableBody:nw,DTableCategoryCell:iw,DTableCategory:rw,DTableColumnType:Sm,DTableDataListFilter:Ym,DTableDataListMapped:Jm,DTableDataListSelection:qm,DTableDataListSorter:Qm,DTableDataList:tw,DTableDataSelectionType:Wm,DTableDataOrder:$m,DTableDataTreeFilter:ew,DTableDataTreeItemAccessor:hw,DTableDataTreeSelectionImpl:aw,DTableDataTreeSorter:cw,DTableDataTree:fw,DTableHeaderCellCheck:lw,DTableHeaderCell:vw,DTableHeader:bw,DTableRow:Xm,DTableState:xm,DTable:yw,DTextBase:Ne,DText:Ye,DTreeDataImpl:Vw,DTreeDataMappedImpl:Uw,DTreeDataSelectionMultiple:Gw,DTreeDataSelectionNone:Hw,DTreeDataSelectionSingle:zw,DTreeDataSelectionType:Fw,DTreeItemButton:Kw,DTreeItemNonEditable:Yw,DTreeItemState:Ww,DTreeItemText:Xw,DTreeItemUpdater:Jw,DTreeNodeAccessorImpl:Pw,DTree:Zw,DViewGestureImpl:er,DViewImpl:sr,DViewTransformImpl:ur};El();var $w=window;$w.wcardinal=$w.wcardinal||{},$w.wcardinal.ui=qw}(PIXI);
9
+ !function(t){"use strict";var n={},i={},r={CIRCLE:0,RECTANGLE:1,RECTANGLE_ROUNDED:2,TRIANGLE:3,TRIANGLE_ROUNDED:4,LINE:5,IMAGE:6,IMAGE_SDF:7,GROUP:8,BAR:9,LABEL:10,NULL:11,GROUP_SHADOWED:12,LINE_OF_CIRCLES:13,LINE_OF_RECTANGLES:14,LINE_OF_RECTANGLE_ROUNDEDS:15,LINE_OF_TRIANGLES:16,LINE_OF_TRIANGLE_ROUNDEDS:17,EMBEDDED:18,EMBEDDED_LAYER:19,BUTTON:20,RECTANGLE_PIVOTED:21,CONNECTOR_LINE:22,EXTENSION:1e3},e={},u=function(){function t(t,n,i,r,e,u){this.buffer=t,this.i=u,this.u=n,this.h=i,this.o=r,this.l=e}return t.prototype.init=function(t){t.uploaded=this;for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].init(n);return this.update(t),this},t.prototype.update=function(t){for(var n=this.buffer,i=this.i,r=0,e=i.length;r<e;++r)i[r].update(n,t)},t.prototype.isCompatible=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)if(!n[i].isCompatible(t))return!1;return!0},t.prototype.getBuffer=function(){return this.buffer},t.prototype.getVertexOffset=function(){return this.u},t.prototype.getVertexCount=function(){return this.o},t.prototype.getIndexOffset=function(){return this.h},t.prototype.getIndexCount=function(){return this.l},t.prototype.buildUnit=function(t){for(var n=this.i,i=0,r=n.length;i<r;++i)n[i].buildUnit(t)},t}(),s={NONE:0,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING:14,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896},h=function(t,n,i,r){return i&s.DOTTED_MASK?i&s.DOTTED?r.set(n,n):i&s.DOTTED_DENSELY?r.set(n,.5*n):r.set(n,2*n):i&s.DASHED_MASK?i&s.DASHED?r.set(2*n,n):i&s.DASHED_DENSELY?r.set(2*n,.5*n):r.set(2*n,2*n):r.set(2*t,0),r},o=function(t){var n=t&s.NON_EXPANDING_WIDTH?1:0,i=t&s.NON_SHRINKING_WIDTH?2:0;return t&(s.DOTTED_MASK||s.DASHED_MASK)?n|i|(t&s.NON_SCALING_DOT_AND_DASH?4:0):n|i},a=new t.Point,c=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5,t[++i]=1,t[++i]=0,t[++i]=3,t[++i]=0,t[++i]=1,t[++i]=5},f=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+2,t[++r]=n+1,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3},l=function(t,n,i,r,e,u,s,c,f){var l=f.a,v=f.b,b=f.c,d=f.d,g=f.tx,m=f.ty,w=e[0],p=e[1],O=l*w+b*p+g,D=v*w+d*p+m,E=e[2],M=e[3],S=l*E+b*M+g,T=v*E+d*M+m,j=S-O,N=T-D,I=Math.sqrt(j*j+N*N),C=I;if(0<=u&&1e-5<I){var A=u/I;S=O+(j*=A),T=D+(N*=A),C=u}var R=O-j,y=D-N,k=S+j,L=T+N,x=o(c),B=h(C,s,c,a),_=B.x,P=B.y,F=(r<<1)-1,U=(r<<2)-1,G=6*r-1;t[++F]=O,t[++F]=D,t[++F]=O,t[++F]=D,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=y,n[++G]=S,n[++G]=T,n[++G]=s,n[++G]=x,n[++G]=R,n[++G]=y,n[++G]=S,n[++G]=T,i[++U]=0,i[++U]=_,i[++U]=P,i[++U]=C,i[++U]=0,i[++U]=_,i[++U]=P,i[++U]=C,t[++F]=S,t[++F]=T,t[++F]=S,t[++F]=T,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=k,n[++G]=L,n[++G]=s,n[++G]=x,n[++G]=O,n[++G]=D,n[++G]=k,n[++G]=L,i[++U]=C,i[++U]=_,i[++U]=P,i[++U]=C,i[++U]=C,i[++U]=_,i[++U]=P,i[++U]=C},v=function(t,n,i){var r=(n<<1)-1;t[++r]=i.x0,t[++r]=i.y0,t[++r]=i.x3,t[++r]=i.y3,t[++r]=i.x1,t[++r]=i.y1,t[++r]=i.x2,t[++r]=i.y2},b=function(){function t(){this.target="",this.position=0}return t.prototype.init=function(t){this.target=t,this.position=0},t.prototype.hasNext=function(){return this.position<this.target.length},t.prototype.findNextBreak=function(t,n){for(var i=t.length,r=n;r<i;++r){var e=t.charCodeAt(r);if(!this.isLowSurrogate(e)&&!this.isVariationSelector(e))return r}return i},t.prototype.isHighSurrogate=function(t){return 55296<=t&&t<=56319},t.prototype.isLowSurrogate=function(t){return 56320<=t&&t<=57343},t.prototype.isVariationSelector=function(t){return 65024<=t&&t<=65039},t.prototype.next=function(){var t=this.target,n=this.position,i=this.findNextBreak(t,n+1),r=t.substring(n,i);return this.position=i,r},t.prototype.advance=function(t){var n=this.target,i=this.position,r=this.findNextBreak(n,i+1);return n.substring(i,r)!==t&&(this.position=r,!0)},t.prototype.close=function(){var t=this.target.length;return this.position<t&&(this.position=t,!0)},t.from=function(n){null==t.v&&(t.v=new t);var i=t.v;return i.init(n),i},t.v=null,t}(),d={NORMAL:0,BOLD:1},g={NORMAL:0,ITALIC:1},m={LEFT:0,CENTER:1,RIGHT:2,OUTSIDE_LEFT:3,OUTSIDE_RIGHT:4},w={TOP:0,MIDDLE:1,BOTTOM:2,OUTSIDE_TOP:3,OUTSIDE_BOTTOM:4},p={LEFT_TO_RIGHT:0,TOP_TO_BOTTOM:1,BOTTOM_TO_TOP:2},O=function(t,n,i,r){var e=i-t,u=r-n;return Math.sqrt(e*e+u*u)},D=1e-5,E=new t.Point,M=function(t){return 12*Math.ceil(t.text.value.length/12)},S=function(t,n,i){for(var r=3*n-1,e=3*(n+i)-1;r<e;)t[++r]=0,t[++r]=0,t[++r]=2},T=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s,t[++e]=s+1,t[++e]=s+3,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=4},j=function(t,n,i,r,e,u,h){var a=6*n-1,c=6*(n+i)-1,f=o(s.NONE);if(null!=r)for(var l=r.font.size/e,v=h===d.NORMAL?0:.05;a<c;)t[++a]=u,t[++a]=f,t[++a]=l,t[++a]=1,t[++a]=0,t[++a]=v;else for(;a<c;)t[++a]=0,t[++a]=f,t[++a]=0,t[++a]=1,t[++a]=0,t[++a]=0},N=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g,p,O,D,E){switch(t){case m.LEFT:switch(n){case w.TOP:E.x=o+g*(i+e)+O*(r+u),E.y=a+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i+e)+O*(r-.5*h),E.y=.5*(a+d)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i+e)+O*(r-u-h),E.y=d+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i+e)+O*(r-u-h),E.y=a+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i+e)+O*(r+u),E.y=d+p*(i+e)+D*(r+u)}break;case m.CENTER:switch(n){case w.TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r+u),E.y=.5*(a+f)+p*(i-.5*s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+l)+g*(i-.5*s)+O*(r-.5*h),E.y=.5*(a+v)+p*(i-.5*s)+D*(r-.5*h);break;case w.BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(d+v)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=.5*(o+c)+g*(i-.5*s)+O*(r-u-h),E.y=.5*(a+f)+p*(i-.5*s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=.5*(b+l)+g*(i-.5*s)+O*(r+u),E.y=.5*(d+v)+p*(i-.5*s)+D*(r+u)}break;case m.RIGHT:switch(n){case w.TOP:E.x=c+g*(i-e-s)+O*(r+u),E.y=f+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(f+v)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i-e-s)+O*(r-u-h),E.y=v+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i-e-s)+O*(r-u-h),E.y=f+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i-e-s)+O*(r+u),E.y=v+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_LEFT:switch(n){case w.TOP:E.x=o+g*(i-e-s)+O*(r+u),E.y=a+p*(i-e-s)+D*(r+u);break;case w.MIDDLE:E.x=.5*(o+b)+g*(i-e-s)+O*(r-.5*h),E.y=.5*(a+d)+p*(i-e-s)+D*(r-.5*h);break;case w.BOTTOM:E.x=b+g*(i-e-s)+O*(r-u-h),E.y=d+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=o+g*(i-e-s)+O*(r-u-h),E.y=a+p*(i-e-s)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=b+g*(i-e-s)+O*(r+u),E.y=d+p*(i-e-s)+D*(r+u)}break;case m.OUTSIDE_RIGHT:switch(n){case w.TOP:E.x=c+g*(i+e)+O*(r+u),E.y=f+p*(i+e)+D*(r+u);break;case w.MIDDLE:E.x=.5*(c+l)+g*(i+e)+O*(r-.5*h),E.y=.5*(f+v)+p*(i+e)+D*(r-.5*h);break;case w.BOTTOM:E.x=l+g*(i+e)+O*(r-u-h),E.y=v+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_TOP:E.x=c+g*(i+e)+O*(r-u-h),E.y=f+p*(i+e)+D*(r-u-h);break;case w.OUTSIDE_BOTTOM:E.x=l+g*(i+e)+O*(r+u),E.y=v+p*(i+e)+D*(r+u)}}},I=function(t,n,i,r,e){var u=t*t+n*n;if(D<u){var s=Math.sqrt(u),h=1/s;return e.set(t*h,n*h),s}return e.set(i,r),0},C=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,d,D,M,S,T,j,C,y,k,L,B){var _=.5*s,P=.5*h,F=E;F.set(e-_,u-P),B.apply(F,F);var U=F.x,G=F.y;F.set(e+_,u-P),B.apply(F,F);var z=F.x,H=F.y;F.set(e+_,u+P),B.apply(F,F);var V=F.x,W=F.y,X=U+(V-z),K=G+(W-H),Y=O(U,G,z,H);I(B.a,B.b,1,0,F);var J=F.x,Z=F.y,q=O(U,G,X,K);I(B.c,B.d,0,1,F);for(var $=F.x,Q=F.y,tt=0,nt=0,it=0,rt=Math.max(0,a+S),et=0,ut=o.characters,st=b.from(c),ht=0;st.hasNext();)"\n"!==(Gt=st.next())?(0<ht&&(et+=Math.max(0,ht+M)),(Ht=ut[Gt])?(ht=Ht.advance,it=Ht.height):ht=0):(et+=ht,ht=0,tt=Math.max(tt,et),et=0,nt+=rt);var ot=a/o.font.size;et+=ht,tt=Math.max(tt,et)*ot,et=0,it*=ot,nt+=a;var at=0,ct=0,ft=NaN;switch(T){case p.LEFT_TO_RIGHT:if(N(l,v,d,D,j,C,tt,nt,U,G,z,H,V,W,X,K,J,Z,$,Q,F),at=F.x,ct=F.y,y)switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:ft=Y-2*j}}break;case p.TOP_TO_BOTTOM:if(F.set($,Q),$=-J,Q=-Z,J=F.x,Z=F.y,N(function(t){switch(t){case w.TOP:return m.LEFT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.RIGHT;case w.OUTSIDE_TOP:return m.OUTSIDE_LEFT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_RIGHT}}(v),function(t){switch(t){case m.LEFT:return w.BOTTOM;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.TOP;case m.OUTSIDE_LEFT:return w.OUTSIDE_BOTTOM;case m.OUTSIDE_RIGHT:return w.OUTSIDE_TOP}}(l),D,d,C,j,tt,nt,z,H,V,W,X,K,U,G,J,Z,$,Q,F),at=F.x,ct=F.y,y)switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:ft=q-2*C}}break;case p.BOTTOM_TO_TOP:if(F.set($,Q),$=J,Q=Z,J=-F.x,Z=-F.y,N(function(t){switch(t){case w.TOP:return m.RIGHT;case w.MIDDLE:return m.CENTER;case w.BOTTOM:return m.LEFT;case w.OUTSIDE_TOP:return m.OUTSIDE_RIGHT;case w.OUTSIDE_BOTTOM:return m.OUTSIDE_LEFT}}(v),function(t){switch(t){case m.LEFT:return w.TOP;case m.CENTER:return w.MIDDLE;case m.RIGHT:return w.BOTTOM;case m.OUTSIDE_LEFT:return w.OUTSIDE_TOP;case m.OUTSIDE_RIGHT:return w.OUTSIDE_BOTTOM}}(l),D,d,C,j,tt,nt,X,K,U,G,z,H,V,W,J,Z,$,Q,F),at=F.x,ct=F.y,y)switch(v){case w.TOP:case w.MIDDLE:case w.BOTTOM:switch(l){case m.LEFT:case m.CENTER:case m.RIGHT:ft=q-2*C}}}if(ft<tt){var lt=.5*(tt-ft);k[0]=at+J*lt,k[1]=ct+Z*lt,k[2]=J,k[3]=Z,k[4]=$,k[5]=Q,k[6]=ft,k[7]=nt}else k[0]=at,k[1]=ct,k[2]=J,k[3]=Z,k[4]=$,k[5]=Q,k[6]=tt,k[7]=nt;var vt=L.x0,bt=L.x1,dt=L.x3,gt=L.y0,mt=L.y1,wt=L.y3,pt=bt-vt,Ot=mt-gt,Dt=dt-vt,Et=wt-gt,Mt=rt*$,St=rt*Q,Tt=ot*J,jt=ot*Z,Nt=.5*(it-a),It=Nt*$,Ct=Nt*Q,At=f===g.NORMAL?0:.25*a,Rt=at-It+At*Tt,yt=ct-Ct+At*jt,kt=at+It+a*$,Lt=ct+Ct+a*Q,xt=Rt,Bt=yt,_t=kt,Pt=Lt;et=0,ht=0,st.position=0;for(var Ft=0,Ut=2*i;st.hasNext();Ut+=8){var Gt;if("\n"!==(Gt=st.next())){var zt=et;0<ht&&(et+=Math.max(0,ht+M));var Ht,Vt=et*Tt,Wt=et*jt;if(xt=Rt+Vt,Bt=yt+Wt,_t=kt+Vt,Pt=Lt+Wt,Ft+=1,Ht=ut[Gt]){var Xt=Ht.advance;if(ft<(et+Xt)*ot){var Kt=ut["..."];if(Kt){if(1<Ft&&ft<(et+Kt.advance)*ot){Ut-=8,Ft-=1;var Yt=(et=zt)*Tt,Jt=et*jt;xt=Rt+Yt,Bt=yt+Jt,_t=kt+Yt,Pt=Lt+Jt}for(ht=Kt.advance,R(t,n,Ut,Kt,o,Tt,jt,xt,Bt,_t,Pt,pt,Ot,Dt,Et,vt,gt),Ut+=8;;Ut+=8){if(!st.hasNext()||!st.advance("\n")){Ut-=8;break}A(t,n,Ut,xt,Bt,_t,Pt,vt,gt,dt,wt),Ft+=1}}else ht=Xt,A(t,n,Ut,xt,Bt,_t,Pt,vt,gt,dt,wt)}else ht=Xt,R(t,n,Ut,Ht,o,Tt,jt,xt,Bt,_t,Pt,pt,Ot,Dt,Et,vt,gt)}else ht=0,A(t,n,Ut,xt,Bt,_t,Pt,vt,gt,dt,wt)}else et+=ht,ht=0,A(t,n,Ut,xt=Rt+=Mt,Bt=yt+=St,_t=kt+=Mt,Pt=Lt+=St,vt,gt,dt,wt),x(t,J,Z,Ft,Ut,tt-et*ot,T,l,v),et=0,Ft=0}x(t,J,Z,Ft,Ut,tt-(et+=ht)*ot,T,l,v);for(var Zt=2*(i+r);Ut<Zt;Ut+=2)t[Ut+0]=at,t[Ut+1]=ct,n[Ut+0]=vt,n[Ut+1]=gt},A=function(t,n,i,r,e,u,s,h,o,a,c){t[i+0]=r,t[i+1]=e,t[i+2]=r,t[i+3]=e,t[i+4]=u,t[i+5]=s,t[i+6]=u,t[i+7]=s,n[i+0]=h,n[i+1]=o,n[i+2]=h,n[i+3]=o,n[i+4]=a,n[i+5]=c,n[i+6]=a,n[i+7]=c},R=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=r.x-r.origin.x,w=r.width,p=m*u,O=m*s,D=(m+w)*u,E=(m+w)*s;t[i+0]=h+p,t[i+1]=o+O,t[i+2]=h+D,t[i+3]=o+E,t[i+4]=a+D,t[i+5]=c+E,t[i+6]=a+p,t[i+7]=c+O;var M=r.x/e.width,S=r.y/e.height,T=(r.x+r.width)/e.width,j=(r.y+r.height)/e.height,N=f*M,I=l*M,C=f*T,A=l*T,R=v*S,y=b*S,k=v*j,L=b*j;n[i+0]=d+N+R,n[i+1]=g+I+y,n[i+2]=d+C+R,n[i+3]=g+A+y,n[i+4]=d+C+k,n[i+5]=g+A+L,n[i+6]=d+N+k,n[i+7]=g+I+L},y=function(t,n,i,r,e){for(var u=n-8*i-1,s=0;s<i;++s)t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e,t[++u]+=r,t[++u]+=e},k=function(t,n,i,r,e,u){y(t,n,i,(r*=.5)*e,r*u)},L=function(t,n,i,r,e,u){y(t,n,i,r*e,r*u)},x=function(t,n,i,r,e,u,s,h,o){if(D<u)switch(s){case p.LEFT_TO_RIGHT:switch(h){case m.OUTSIDE_RIGHT:case m.LEFT:break;case m.CENTER:k(t,e,r,u,n,i);break;case m.OUTSIDE_LEFT:case m.RIGHT:L(t,e,r,u,n,i)}break;case p.TOP_TO_BOTTOM:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:break;case w.MIDDLE:k(t,e,r,u,n,i);break;case w.OUTSIDE_TOP:case w.BOTTOM:L(t,e,r,u,n,i)}break;case p.BOTTOM_TO_TOP:switch(o){case w.OUTSIDE_BOTTOM:case w.TOP:L(t,e,r,u,n,i);break;case w.MIDDLE:k(t,e,r,u,n,i)}}},B=function(t,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])})(t,n)};function _(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}B(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var P,F,U={NONE:0,CLOSED:1,NON_EXPANDING_WIDTH:2,NON_SHRINKING_WIDTH:4,NON_SCALING_DOT_AND_DASH:8,NON_SCALING_MASK:14,DOTTED:16,DOTTED_DENSELY:32,DOTTED_LOOSELY:64,DOTTED_MASK:112,DASHED:128,DASHED_DENSELY:256,DASHED_LOOSELY:512,DASHED_MASK:896,CURVE:1024,FORMATTER_MASK:1024},G=function(t,n,i,r,e){for(var u=(t>>16&255)/255*n,s=(t>>8&255)/255*n,h=(t>>0&255)/255*n,o=n,a=(i<<2)-1,c=(i+r<<2)-1;a<c;)e[++a]=u,e[++a]=s,e[++a]=h,e[++a]=o},z=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=-1,this.strokeAlign=NaN,this.strokeWidth=NaN,this.strokeSide=NaN,this.strokeStyle=NaN,this.colorFill=NaN,this.alphaFill=-1,this.colorStroke=NaN,this.alphaStroke=-1,this.texture=null,this.textureTransformId=NaN}return n.prototype.isCompatible=function(t){return!0},n.prototype.updateColorFill=function(t,n){var i=n.fill,r=n.visible&&i.enable,e=i.color,u=r?i.alpha:0;e===this.colorFill&&u===this.alphaFill||(this.colorFill=e,this.alphaFill=u,t.updateColorFills(),G(e,u,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.stroke,r=n.visible&&i.enable&&0<i.width,e=i.color,u=r?i.alpha:0;e===this.colorStroke&&u===this.alphaStroke||(this.colorStroke=e,this.alphaStroke=u,t.updateColorStrokes(),G(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),H=function(t){return t.updateTransform(),t.transform.getLocalId()},V=function(n){return n.texture||t.Texture.WHITE},W=function(t){var n=t;return null==n._uvs&&t.updateUvs(),n._updateID},X=function(t){return t._uvs},K=function(){function t(){}return t.setDefaultThemeClass=function(t){this.DEFAULT_THEME_CLASS=t},t.getDefaultThemeClass=function(){return this.DEFAULT_THEME_CLASS},t.getInstance=function(){if(null==this.INSTANCE){var t=this.getDefaultThemeClass();if(null==t)throw new Error("No default theme class found");this.INSTANCE=new t}return this.INSTANCE},t.setInstance=function(t){var n=this.INSTANCE;return this.INSTANCE=t,n},t.DEFAULT_THEME_CLASS=null,t.INSTANCE=null,t}(),Y=function(){function t(){}return Object.defineProperty(t,"THEME",{get:function(){var t=this.g;if(null!=t)return t;var n=K.getInstance().get("EShape");return this.g=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_COLOR",{get:function(){return this.THEME.getFillColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"FILL_ALPHA",{get:function(){return this.THEME.getFillAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_COLOR",{get:function(){return this.THEME.getStrokeColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALPHA",{get:function(){return this.THEME.getStrokeAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_WIDTH",{get:function(){return this.THEME.getStrokeWidth()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_ALIGN",{get:function(){return this.THEME.getStrokeAlign()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_SIDE",{get:function(){return this.THEME.getStrokeSide()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"STROKE_STYLE",{get:function(){return this.THEME.getStrokeStyle()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_VALUE",{get:function(){return this.THEME.getTextValue()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_COLOR",{get:function(){return this.THEME.getTextColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_ALPHA",{get:function(){return this.THEME.getTextAlpha()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_FAMILY",{get:function(){return this.THEME.getTextFamily()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"TEXT_SIZE",{get:function(){return this.THEME.getTextSize()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"CURSOR",{get:function(){return this.THEME.getCursor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"RADIUS",{get:function(){return this.THEME.getRadius()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_X",{get:function(){return this.THEME.getSizeX()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"SIZE_Y",{get:function(){return this.THEME.getSizeY()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"HIGHLIGHT_COLOR",{get:function(){return this.THEME.getHighlightColor()},enumerable:!1,configurable:!0}),Object.defineProperty(t,"CURVE_SEGMENT_COUNT",{get:function(){return this.THEME.getCurveSegmentCount()},enumerable:!1,configurable:!0}),t}(),J={NONE:0,CIRCLE:1,TRIANGLE:2,RECTANGLE:3},Z=function(){function t(t,n,i,r){this.O=t,this.S=n,this.T=i,this.j=r}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha)},t.prototype.set=function(t,n,i){var r=!1;void 0!==t&&this.S!==t&&(this.S=t,r=!0),void 0!==n&&this.T!==n&&(this.T=n,r=!0),void 0!==i&&this.j!==i&&(this.j=i,r=!0),r&&this.O.updateUploaded()},t.prototype.clone=function(){return new t(this.O,this.S,this.T,this.j)},t.prototype.toObject=function(){return{enable:this.S,color:this.T,alpha:this.j}},t.prototype.serialize=function(t){var n="["+(this.S?1:0)+","+this.T+","+this.j+"]";return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getFill(t);if(null!=r)this.set(!!r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setFill(t,e),this.set(!!e[0],e[1],e[2])}}},t}(),q=function(){function n(){}return n.prototype.lock=function(){return this},n.prototype.unlock=function(){return this},Object.defineProperty(n.prototype,"type",{get:function(){return J.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){var n=this.I;return null==n&&(n=new t.Point,this.I=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"transform",{get:function(){var n=this.C;return null==n&&(n=new t.Matrix,this.C=n),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){var t=this.A;return null==t&&(t=new Z(this,!0,Y.FILL_COLOR,1),this.A=t),t},enumerable:!1,configurable:!0}),n.prototype.updateUploaded=function(){},n.prototype.copy=function(t){return this},n.prototype.set=function(t,n,i){return this},n.prototype.serialize=function(t){return-1},n.prototype.deserialize=function(t,n){},n}(),$=function(){function t(){this.R=new q}return t.prototype.lock=function(){return this},t.prototype.unlock=function(){return this},Object.defineProperty(t.prototype,"head",{get:function(){return this.R},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.R},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t.getInstance=function(){var n=this.INSTANCE;return null==n&&(n=new t,this.INSTANCE=n),n},t}(),Q={TOP:0,LEFT:1,RIGHT:2,BOTTOM:3},tt=function(){function n(t){this.O=t,this.k=0,this.L=[0,0,0,0],this.B=[],this._=U.NONE,this.I=-1,this.P=Q.TOP,this.F=NaN,this.U=NaN,this.G=NaN,this.V=NaN}return n.prototype.getComputedSize=function(t,n,i,r){if(0<=t)return t;switch(n){case Q.TOP:case Q.BOTTOM:return Math.abs(r);case Q.RIGHT:case Q.LEFT:return Math.abs(i)}return 0},n.prototype.update=function(){var t=this.O.size,n=t.x,i=t.y,r=this.P,e=this.I;if(this.F!==e||this.U!==n||this.G!==i||this.V!==r){this.k+=1,this.F=e,this.U=n,this.G=i,this.V=r;var u=.5*n,s=.5*i,h=this.getComputedSize(e,r,n,i),o=this.L;switch(r){case Q.TOP:o[0]=0,o[1]=-s,o[2]=0,o[3]=-s+h;break;case Q.RIGHT:o[0]=u,o[1]=0,o[2]=u-h,o[3]=0;break;case Q.BOTTOM:o[0]=0,o[1]=s,o[2]=0,o[3]=s-h;break;case Q.LEFT:o[0]=-u,o[1]=0,o[2]=-u+h,o[3]=0}}},Object.defineProperty(n.prototype,"length",{get:function(){return 2},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.update(),this.k},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.update(),this.L},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.B},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.I},set:function(t){this.moveTo(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"position",{get:function(){return this.P},set:function(t){this.moveTo(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this._},set:function(t){this.moveTo(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.R;return null==t&&(t=$.getInstance(),this.R=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return t instanceof n?this.moveTo(t.position,t.size,t.style):this.moveTo(void 0,void 0,t.style)},n.prototype.set=function(t,n,i){var r,e;if(null!=t){var u=t[0];if(0===u){var s=t[1];r=s<=0?Q.TOP:Q.BOTTOM,e=Math.abs(t[3]-s)}else r=u<=0?Q.LEFT:Q.RIGHT,e=Math.abs(t[2]-u)}return this.moveTo(r,e,i)},n.prototype.moveTo=function(t,n,i){var r=!1;return null!=i&&this._!==i&&(this._=i,r=!0),null!=t&&this.P!==t&&(this.P=t,r=!0),null!=n&&this.I!==n&&(this.I=n,r=!0),r&&this.O.updateUploaded(),this},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("["+this.P+","+this.I+","+this._+"]")},n.prototype.deserialize=function(t,n){if(0<=t&&t<n.resources.length){var i=n.resources[t],r=JSON.parse(i);this.moveTo(r[0],r[1],r[2])}},n.prototype.calcHitPointAbs=function(t,n,i,r,e,u,s,h){if(2<=this.length){var o=this.L;if(s(t,n,o[0],o[1],o[2],o[3],0,e,h))return!0}return!1},n}(),nt={NONE:0,LINE:1,MARKER_TAIL:2,MARKER_HEAD:3,TEXT:4,CHILDREN:5},it={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},rt=function(){function t(){}return t.add=function(n){t.INSTANCES.push(n)},t.first=function(){var n=t.INSTANCES;if(0<n.length)return n[0];throw new Error("No application found.")},t.last=function(){var n=t.INSTANCES;if(0<n.length)return n[n.length-1];throw new Error("No application found.")},t.get=function(n){var i=t.INSTANCES;return 0<=n&&n<i.length?i[n]:null},t.indexOf=function(n){return t.INSTANCES.indexOf(n)},t.size=function(){return t.INSTANCES.length},t.getStage=function(t){for(var n=t;n.parent;)n=n.parent;return"application"in n&&"layer"in n?n:null},t.find=function(t){var n=this.getStage(t);return n?n.layer.application:null},t.getLayerBase=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerBase():null},t.getLayerOverlay=function(t){var n=this.getStage(t);return n?n.layer.application.getLayerOverlay():null},t.getLayer=function(t){var n=this.getStage(t);return n?n.layer:null},t.getResolution=function(t){var n,i=this.getLayer(t);return i?i.renderer.resolution:null!==(n=window.devicePixelRatio)&&void 0!==n?n:1},t.update=function(n){if(n){var i=this.getStage(n);i&&i.layer.update()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].update()},t.render=function(n){if(n){var i=this.getStage(n);i&&i.layer.render()}else for(var r=t.INSTANCES,e=0,u=r.length;e<u;++e)r[e].render()},t.INSTANCES=[],t}(),et=function(){function t(){this.values=[]}return t.prototype.add=function(t,n){var i=this.values;return null!=n?i.splice(n,0,t):i.push(t),this},t.prototype.addAll=function(t){for(var n=this.values,i=0,r=t.length;i<r;++i)n.push(t[i]);return this},t.prototype.clearAndAdd=function(t){return this.clear(),this.add(t),this},t.prototype.clearAndAddAll=function(t){return this.clear(),this.addAll(t),this},t.prototype.indexOf=function(t){for(var n=this.values,i=0,r=n.length;i<r;++i)if(n[i]===t)return i;for(i=0,r=n.length;i<r;++i)if(n[i].isEquals(t))return i;return-1},t.prototype.get=function(t){var n=this.values;return 0<=t||t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.values;if(0<=t||t<i.length){var r=i[t];return i[t]=n,r}return null},t.prototype.remove=function(t){var n=this.values;return 0<=t||t<n.length?n.splice(t,1)[0]:null},t.prototype.clear=function(){return this.values.length=0,this},t.prototype.size=function(){return this.values.length},t.prototype.swap=function(t,n){var i=this.values,r=i[n];return i[n]=i[t],i[t]=r,this},t.prototype.serialize=function(t){for(var n=[],i=this.values,r=0,e=i.length;r<e;++r)n.push(i[r].serialize(t));return n},t}(),ut=function(){function t(t){this.O=t,this.W=new Set}return t.prototype.add=function(t){var n=this.W;return!n.has(t)&&(n.add(t),!0)},t.prototype.contains=function(t){return this.W.has(t)},t.prototype.size=function(){return this.W.size},t.prototype.remove=function(t){return this.W.delete(t)},t.prototype.clear=function(){return 0<this.W.size&&(this.W.clear(),!0)},t.prototype.copy=function(t){var n=this.W;return n.clear(),t.each((function(t){n.add(t)})),this},t.prototype.each=function(t){return this.W.forEach(t),this},t.prototype.fit=function(t){this.W.forEach(this.toOnFitBound(t))},t.prototype.toOnFitBound=function(t){var n;return t?(null==(n=this.K)&&(n=this.newOnFitBound(!0),this.K=n),n):(null==(n=this.J)&&(n=this.newOnFitBound(!1),this.J=n),n)},t.prototype.newOnFitBound=function(t){var n=this;return function(i){n.onFit(i,t)}},t.prototype.onFit=function(t,n){t.fit(n)},t.prototype.attach=function(){var t=this.O;return this.W.forEach((function(n){n.set(t)})),this},t.prototype.detach=function(){return this.W.forEach((function(t){t.set(null)})),this},t}(),st={NONE:0,TRANSFORM:1,SIZE:2,STYLE:4,ACTION:8,POINTS:16,STATE:32,IMAGE:64,DATA:128,TAG:128,CONNECTOR:256,ALL:511},ht={HOVERED:"HOVERED",ACTIVE:"ACTIVE",FOCUSED:"FOCUSED",UNFOCUSABLE:"UNFOCUSABLE",FOCUS_ROOT:"FOCUS_ROOT",FOCUS_REVERSE:"FOCUS_REVERSE",READ_ONLY:"READ_ONLY",DISABLED:"DISABLED",GESTURING:"GESTURING",PRESSED:"PRESSED",INVALID:"INVALID",SUCCEEDED:"SUCCEEDED",FAILED:"FAILED",WARNED:"WARNED",CHANGED:"CHANGED",ALTERNATED:"ALTERNATED",NEW_WINDOW:"NEW_WINDOW"},ot=function(t){return"function"==typeof t},at=function(t){return"string"==typeof t||"[object String]"===Object.prototype.toString.call(t)},ct=function(){function t(){this.Z=new Set,this.O=null}return t.prototype.is=function(t){return this.Z.has(t)},t.prototype.in=function(t){return this.is(t)||this.under(t)},t.prototype.on=function(t){var n,i;return null!==(i=null===(n=this.O)||void 0===n?void 0:n.is(t))&&void 0!==i&&i},t.prototype.under=function(t){var n,i;return null!==(i=null===(n=this.O)||void 0===n?void 0:n.in(t))&&void 0!==i&&i},t.prototype.lock=function(t){return this},t.prototype.unlock=function(){return this},t.prototype.begin=function(){return this},t.prototype.end=function(){return this},t.prototype.checkAdded=function(t){return!this.Z.has(t)},t.prototype.add=function(t){return this.checkAdded(t)&&(this.begin(),this.Z.add(t),this.end()),this},t.prototype.checkAddeds=function(t){for(var n=this.Z,i=0,r=t.length;i<r;++i)if(!n.has(t[i]))return!0;return!1},t.prototype.addAll=function(t){var n=at(t)?arguments:t;if(this.checkAddeds(n)){this.begin();for(var i=this.Z,r=0,e=n.length;r<e;++r)i.add(n[r]);this.end()}return this},t.prototype.checkRemoved=function(t){return this.Z.has(t)},t.prototype.remove=function(t){return this.checkRemoved(t)&&(this.begin(),this.Z.delete(t),this.end()),this},t.prototype.checkRemoveds=function(t){for(var n=this.Z,i=0,r=t.length;i<r;++i)if(n.has(t[i]))return!0;return!1},t.prototype.removeAll=function(t){var n=this,i=this.Z;if(ot(t)){var r=!1;i.forEach((function(e){t(e)&&(r||(r=!0,n.begin()),i.delete(e))})),r&&this.end()}else{var e=at(t)?arguments:t;if(this.checkRemoveds(e)){this.begin();for(var u=0,s=e.length;u<s;++u)i.delete(e[u]);this.end()}}return this},t.prototype.clear=function(){var t=this.Z;return 0<t.size&&(this.begin(),t.clear(),this.end()),this},t.prototype.set=function(t,n){if(!0===n)null!=t&&this.add(t);else if(!1===n)null!=t&&this.remove(t);else{var i=t,r=n;null!=i?null!=r?(this.checkAdded(i)||this.checkRemoved(r))&&(this.begin(),this.Z.add(i).delete(r),this.end()):this.add(i):null!=r&&this.remove(r)}return this},t.prototype.setAll=function(t,n){if(!0===n)null!=t&&this.addAll(t);else if(!1===n)null!=t&&this.removeAll(t);else{var i=t,r=n;if(null!=i)if(null!=r){if(this.checkAddeds(i)||this.checkRemoveds(r)){this.begin();for(var e=this.Z,u=0,s=i.length;u<s;++u)e.add(i[u]);for(u=0,s=r.length;u<s;++u)e.delete(r[u]);this.end()}}else this.addAll(i);else null!=r&&this.removeAll(r)}return this},t.prototype.each=function(t){return this.Z.forEach((function(n){t(n)})),this},t.prototype.size=function(){return this.Z.size},t.prototype.copy=function(n){if(n instanceof t){this.begin();var i=this.Z;i.clear(),n.local.forEach((function(t){i.add(t)})),this.O=n.parent,this.end()}return this},Object.defineProperty(t.prototype,"local",{get:function(){return this.Z},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parent",{get:function(){return this.O},set:function(t){this.O!==t&&(this.begin(),this.O=t,this.end())},enumerable:!1,configurable:!0}),t.prototype.onParentChange=function(t,n){this.O=n,this.begin(),this.O=t,this.end()},Object.defineProperty(t.prototype,"isHovered",{get:function(){return this.is(ht.HOVERED)},set:function(t){this.set(ht.HOVERED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inHovered",{get:function(){return this.in(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onHovered",{get:function(){return this.on(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underHovered",{get:function(){return this.under(ht.HOVERED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActive",{get:function(){return this.is(ht.ACTIVE)},set:function(t){this.set(ht.ACTIVE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inActive",{get:function(){return this.in(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onActive",{get:function(){return this.on(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underActive",{get:function(){return this.under(ht.ACTIVE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isPressed",{get:function(){return this.is(ht.PRESSED)},set:function(t){this.set(ht.PRESSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inPressed",{get:function(){return this.in(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onPressed",{get:function(){return this.on(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underPressed",{get:function(){return this.under(ht.PRESSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isReadOnly",{get:function(){return this.is(ht.READ_ONLY)},set:function(t){this.set(ht.READ_ONLY,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inReadOnly",{get:function(){return this.in(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onReadOnly",{get:function(){return this.on(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underReadOnly",{get:function(){return this.under(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEnabled",{get:function(){return!this.is(ht.DISABLED)},set:function(t){this.set(ht.DISABLED,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inEnabled",{get:function(){return!this.in(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onEnabled",{get:function(){return!this.on(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underEnabled",{get:function(){return!this.under(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isDisabled",{get:function(){return this.is(ht.DISABLED)},set:function(t){this.set(ht.DISABLED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inDisabled",{get:function(){return this.in(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onDisabled",{get:function(){return this.on(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underDisabled",{get:function(){return this.under(ht.DISABLED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isActionable",{get:function(){return!this.in(ht.DISABLED)&&!this.in(ht.READ_ONLY)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isGesturing",{get:function(){return this.is(ht.GESTURING)},set:function(t){this.set(ht.GESTURING,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inGesturing",{get:function(){return this.in(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onGesturing",{get:function(){return this.on(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underGesturing",{get:function(){return this.under(ht.GESTURING)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocused",{get:function(){return this.is(ht.FOCUSED)},set:function(t){this.set(ht.FOCUSED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocused",{get:function(){return this.in(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocused",{get:function(){return this.on(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocused",{get:function(){return this.under(ht.FOCUSED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusRoot",{get:function(){return this.is(ht.FOCUS_ROOT)},set:function(t){this.set(ht.FOCUS_ROOT,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusRoot",{get:function(){return this.in(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusRoot",{get:function(){return this.on(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusRoot",{get:function(){return this.under(ht.FOCUS_ROOT)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusReverse",{get:function(){return this.is(ht.FOCUS_REVERSE)},set:function(t){this.set(ht.FOCUS_REVERSE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusReverse",{get:function(){return this.in(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusReverse",{get:function(){return this.on(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusReverse",{get:function(){return this.under(ht.FOCUS_REVERSE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFocusable",{get:function(){return!this.is(ht.UNFOCUSABLE)},set:function(t){this.set(ht.UNFOCUSABLE,!t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFocusable",{get:function(){return!this.in(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFocusable",{get:function(){return!this.on(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFocusable",{get:function(){return!this.under(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isUnfocusable",{get:function(){return this.is(ht.UNFOCUSABLE)},set:function(t){this.set(ht.UNFOCUSABLE,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inUnfocusable",{get:function(){return this.in(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUnfocusable",{get:function(){return this.on(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underUnfocusable",{get:function(){return this.under(ht.UNFOCUSABLE)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isInvalid",{get:function(){return this.is(ht.INVALID)},set:function(t){this.set(ht.INVALID,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inInvalid",{get:function(){return this.in(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onInvalid",{get:function(){return this.on(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underInvalid",{get:function(){return this.on(ht.INVALID)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isSucceeded",{get:function(){return this.is(ht.SUCCEEDED)},set:function(t){this.set(ht.SUCCEEDED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inSucceeded",{get:function(){return this.in(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSucceeded",{get:function(){return this.on(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underSucceeded",{get:function(){return this.under(ht.SUCCEEDED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFailed",{get:function(){return this.is(ht.FAILED)},set:function(t){this.set(ht.FAILED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inFailed",{get:function(){return this.in(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onFailed",{get:function(){return this.on(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underFailed",{get:function(){return this.under(ht.FAILED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isWarned",{get:function(){return this.is(ht.WARNED)},set:function(t){this.set(ht.WARNED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inWarned",{get:function(){return this.in(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onWarned",{get:function(){return this.on(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underWarned",{get:function(){return this.on(ht.WARNED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.is(ht.CHANGED)},set:function(t){this.set(ht.CHANGED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inChanged",{get:function(){return this.in(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onChanged",{get:function(){return this.on(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underChanged",{get:function(){return this.on(ht.CHANGED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAlternated",{get:function(){return this.is(ht.ALTERNATED)},set:function(t){this.set(ht.ALTERNATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inAlternated",{get:function(){return this.in(ht.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onAlternated",{get:function(){return this.on(ht.ALTERNATED)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"underAlternated",{get:function(){return this.on(ht.ALTERNATED)},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){var t=[];return this.Z.forEach((function(n){t.push(n)})),{local:t}},t.prototype.toString=function(){return JSON.stringify(this.toObject())},t}(),ft=function(t){function n(n){var i=t.call(this)||this;return i.q=n,i.$=0,i.tt=!1,i.nt=!0,i}return _(n,t),n.prototype.lock=function(t){return this.$+=1,!1===t&&(this.nt=!1),this},n.prototype.unlock=function(){return this.$-=1,this.end()},Object.defineProperty(n.prototype,"saved",{get:function(){var t=this.it;return null==t&&(t=new ct,this.it=t),t},enumerable:!1,configurable:!0}),n.prototype.begin=function(){return this.nt&&!this.tt&&(this.tt=!0,this.saved.copy(this)),this},n.prototype.end=function(){return this.$<=0&&(this.nt=!0,this.tt&&(this.tt=!1,this.onChange(this,this.saved))),this},n.prototype.onChange=function(t,n){this.q(t,n)},n}(ct),lt={CLICKED:"CLICKED",DOWN:"DOWN",UP:"UP",ACTIVATED:"ACTIVATED",DEACTIVATED:"DEACTIVATED"},vt=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onChange=function(n,i){n.isActive?i.isActive||this.Z.add(lt.ACTIVATED).delete(lt.DEACTIVATED):i.isActive&&this.Z.add(lt.DEACTIVATED).delete(lt.ACTIVATED),t.prototype.onChange.call(this,n,i)},Object.defineProperty(n.prototype,"isClicked",{get:function(){return this.is(lt.CLICKED)},set:function(t){this.set(lt.CLICKED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inClicked",{get:function(){return this.in(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onClicked",{get:function(){return this.on(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underClicked",{get:function(){return this.under(lt.CLICKED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDown",{get:function(){return this.is(lt.DOWN)},set:function(t){this.set(lt.DOWN,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDown",{get:function(){return this.in(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDown",{get:function(){return this.on(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDown",{get:function(){return this.under(lt.DOWN)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isUp",{get:function(){return this.is(lt.UP)},set:function(t){this.set(lt.UP,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inUp",{get:function(){return this.in(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onUp",{get:function(){return this.on(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underUp",{get:function(){return this.under(lt.UP)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isActivated",{get:function(){return this.is(lt.ACTIVATED)},set:function(t){this.set(lt.ACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inActivated",{get:function(){return this.in(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onActivated",{get:function(){return this.on(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underActivated",{get:function(){return this.under(lt.ACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isDeactivated",{get:function(){return this.is(lt.DEACTIVATED)},set:function(t){this.set(lt.DEACTIVATED,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"inDeactivated",{get:function(){return this.in(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onDeactivated",{get:function(){return this.on(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"underDeactivated",{get:function(){return this.under(lt.DEACTIVATED)},enumerable:!1,configurable:!0}),n}(ft),bt=function(n){function i(i){var r=n.call(this)||this;return r.internalTransform=new t.Matrix,r.O=i,r}return _(i,n),i.prototype.onChange=function(){n.prototype.onChange.call(this),this.O.onTransformChange()},i.prototype.updateSkew=function(){n.prototype.updateSkew.call(this),this.O.onTransformChange()},i.prototype.getLocalIdCurrent=function(){return this._currentLocalID},i.prototype.getLocalId=function(){return this._localID},i.prototype.getParentId=function(){return this._parentID},i.prototype.getWorldId=function(){return this._worldID},i.prototype.updateTransform=function(t){var r=this._currentLocalID,e=this._worldID;n.prototype.updateTransform.call(this,t);var u=this._currentLocalID,s=this._worldID;if(r!==u){var h=this.localTransform,o=this.internalTransform;h.copyTo(o),t instanceof i&&o.prepend(t.internalTransform)}else e!==s&&(h=this.localTransform,o=this.internalTransform,t instanceof i&&(h.copyTo(o).prepend(t.internalTransform),this._currentLocalID+=1,this._localID=this._currentLocalID))},i}(t.Transform),dt=function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0,this.strokeWidth=0,this.strokeScale=1,this.strokeAlign=0}return t.prototype.set=function(t,n,i,r,e,u,s){return this.x=t,this.y=n,this.width=i,this.height=r,this.strokeWidth=e,this.strokeScale=u,this.strokeAlign=s,this},t}(),gt=function(t){return"data:image/svg+xml;base64,"+btoa(t)},mt=function(t,n,i){var r=t.length;if(n<r)return t;for(var e="",u=0,s=n-r;u<s;++u)e+=i;return e+t},wt=function(){function t(){}return t.toCode=function(t){return mt(t.toString(16).toUpperCase(),6,"0")},t.fromCode=function(t){var n=t.trim().toLowerCase();if(6===n.length){var i=Number("0x"+n);if(i==i)return i}return null},t.fromRgb=function(t,n,i){return 255*t<<16|255*n<<8|255*i|0},t.blend=function(t,n,i){var r=t>>16&255,e=t>>8&255,u=255&(0|t),s=n>>16&255,h=n>>8&255,o=255&(0|n),a=Math.max(0,Math.min(1,i)),c=1-a;return Math.max(0,Math.min(255,r*c+s*a))<<16|Math.max(0,Math.min(255,e*c+h*a))<<8|0|Math.max(0,Math.min(255,u*c+o*a))},t.brighten=function(t,n){return 0<=n?this.blend(t,16777215,n):this.blend(t,0,-n)},t.darken=function(t,n){return 0<=n?this.blend(t,0,n):this.blend(t,16777215,-n)},t.toGrayscale=function(t){var n=this.toLuma(t);return n<<16|n<<8|n},t.toLuma=function(t){return.2126*(t>>16&255)+.7152*(t>>8&255)+.0722*(255&(0|t))&255},t}(),pt=function(){function t(){}return t.serializeGradient=function(t){for(var n=t.points,i="["+t.direction,r=0,e=n.length,u=1;r<e;r+=1,u+=3){var s=n[r];i+=","+s.color+","+s.alpha+","+s.position}return i+"]"},t.parseGradient=function(t){try{return JSON.parse(t)}catch(t){return null}},t.deserializeGradient=function(t){var n=this.parseGradient(t);if(!(null==n||n.length<7)){for(var i=n[0],r=[],e=1,u=n.length;e<u;e+=3)r.push({color:n[e+0],alpha:n[e+1],position:n[e+2]});return{points:r,direction:i}}},t.toGradientId=function(t,n){return null!=t?(null==t.serialized&&(t.serialized=this.serializeGradient(t)),n.addResource(t.serialized)):-1},t.toGradientImageUrl=function(t){for(var n=t.direction,i=t.points,r="",e=0,u=i.length;e<u;++e){var s=i[e],h=wt.toCode(s.color),o=s.alpha;r+='<stop offset="'+100*s.position+'%" stop-color="#'+h+'" stop-opacity="'+o+'" />'}var a=n*Math.PI/180,c=.5*Math.cos(a),f=-.5*Math.sin(a);return gt('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><defs><linearGradient id="o2glkm3aeu2oio" x1="'+(.5-c)+'" x2="'+(.5+c)+'" y1="'+(.5-f)+'" y2="'+(.5+f)+'">'+r+'</linearGradient></defs><rect x="0" y="0" width="32" height="32" stroke="none" fill="url(#o2glkm3aeu2oio)" /></svg>')},t}(),Ot=function(t,n,i,r){return-i<=t&&t<=+i&&-r<=n&&n<=+r},Dt=function(n){function i(t){var i=n.call(this)||this;return i.id="",i.uuid=0,i.type=t,i.transform=i.newTransform(),i.rt=0,i.et=!1,i.action=new et,i.ut=!0,i.st=0,i.ht=!1,i.ot=!1,i.at=NaN,i.ct=NaN,i.ft=NaN,i.interactive=!1,i.parent=null,i.children=[],i.selected=!1,i.index=0,i.reference=0,i}return _(i,n),i.prototype.newTransform=function(){return new bt(this)},i.prototype.onSizeChange=function(){var t;this.at=NaN,this.ct=NaN,this.ft=NaN,this.lt(),this.updateUploaded(),null===(t=this.vt)||void 0===t||t.fit(!0)},i.prototype.onTransformChange=function(){this.lt(),this.onParentTransformChange()},i.prototype.onParentTransformChange=function(){var t;this.updateUploaded(),null===(t=this.vt)||void 0===t||t.fit(!0);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onParentTransformChange()},i.prototype.lt=function(){if(0===this.rt){var t=this.parent;null!=t&&t.onChildTransformChange()}else this.et=!0},i.prototype.disallowOnTransformChange=function(){this.rt+=1,1===this.rt&&(this.et=!1)},i.prototype.allowOnTransformChange=function(t){this.rt-=1,0===this.rt&&this.et&&(this.et=!1,t&&this.onTransformChange())},i.prototype.onChildTransformChange=function(){},i.prototype.disallowUploadedUpdate=function(){this.st+=1,1===this.st&&(this.ht=!1,this.ot=!1)},i.prototype.allowUploadedUpdate=function(){this.st-=1,0===this.st&&(this.ot?(this.ot=!1,this.ht=!1,this.updateUploadedRecursively()):this.ht&&(this.ht=!1,this.updateUploaded()))},i.prototype.updateUploadedRecursively=function(){if(0===this.st){this.updateUploaded();for(var t=this.children,n=0,i=t.length;n<i;++n)t[n].updateUploadedRecursively()}else this.ot=!0},i.prototype.updateUploaded=function(){if(0===this.st){var t=this.uploaded;null!=t&&t.update(this)}else this.ht=!0},Object.defineProperty(i.prototype,"image",{get:function(){return this.bt},set:function(t){this.bt=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"root",{get:function(){for(var t=this;t.parent instanceof i;)t=t.parent;return t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"connector",{get:function(){var t=this.vt;return null==t&&(t=new ut(this),this.vt=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"visible",{get:function(){if(this.ut){var t=this.parent;return!(t instanceof i)||t.visible}return!1},set:function(t){this.ut!==t&&(this.ut=t,this.updateUploadedRecursively())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"worldVisible",{get:function(){if(this.ut){var t=this.parent;return!t||t.worldVisible}return!1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){var t;null===(t=this.parent)||void 0===t||t.toDirty()},i.prototype.attach=function(t,n){this.detach(),this.parent=t;var i=t.children;return null!=n&&0<=n&&n<i.length?i.splice(n,0,this):i.push(this),this.uploaded=void 0,t.onChildTransformChange(),t.toDirty(),this.onAttach(),this},i.prototype.onAttach=function(){var t=this.vt;t&&(t.attach(),t.fit(!0));for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onAttach()},i.prototype.detach=function(){var t=this.parent;if(t){this.parent=null,this.uploaded=void 0;var n=t.children,i=n.indexOf(this);0<=i&&(n.splice(i,1),t.onChildTransformChange(),t.toDirty(),this.onDetach())}return this},i.prototype.onDetach=function(){var t=this.vt;t&&t.detach();for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].onDetach()},i.prototype.updateTransform=function(){var n=this.parent;n?(n.parent&&n.updateTransform(),this.transform.updateTransform(n.transform)):this.transform.updateTransform(t.Transform.IDENTITY)},i.prototype.serializeChildren=function(t){for(var n=this.children,i=[],r=0,e=n.length;r<e;++r){var u=n[r];i.push(u.serialize(t))}return i},i.prototype.serializeImage=function(t){var n=this.bt;return null!=n?t.addResource(n.src):-1},i.prototype.serializeGradient=function(t){return pt.toGradientId(this.gradient,t)},i.prototype.serializeState=function(t){var n=this.state;return(this.interactive?1:0)|(n.isFocusable?0:2)|(n.isActive?4:0)},i.prototype.serialize=function(t){var n=this.transform,i=n.position,r=n.pivot,e=this.size,u=this.shortcut,s=null!=u?t.addResource(u):-1,h=this.title,o=null!=h?t.addResource(h):-1;return[this.type,t.addResource(this.id),i.x,i.y,e.x,e.y,n.rotation,n.skew.x,this.fill.serialize(t),this.stroke.serialize(t),t.addResource(this.cursor.trim()),this.text.serialize(t),this.data.serialize(t),this.radius,this.corner,-1,-1,this.action.serialize(t),this.serializeImage(t),this.serializeGradient(t),this.serializeChildren(t),r.x,r.y,this.serializeState(t),s,o,this.uuid]},i.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},i.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},i.prototype.getShapeScale=function(){var t=this.root.parent;return null!=t&&null!=t.getShapeScale?t.getShapeScale():1},i.prototype.getStrokeWidthScale=function(t){return t&s.NON_EXPANDING_WIDTH?t&s.NON_SHRINKING_WIDTH?this.getShapeScale():Math.min(1,this.getShapeScale()):t&s.NON_SHRINKING_WIDTH?Math.max(1,this.getShapeScale()):1},i.prototype.getHitTestSize=function(t){var n=this.size;return t.width=.5*n.x,t.height=.5*n.y,t},i.prototype.toHitTestData=function(t,n){var r,e=this.getHitTestSize(null!==(r=i.WORK_HIT_TEST_DATA)&&void 0!==r?r:i.WORK_HIT_TEST_DATA=new dt),u=e.width,s=e.height,h=this.transform.pivot,o=t-h.x,a=n-h.y,c=this.stroke,f=c.enable?c.width:0,l=this.getStrokeWidthScale(c.style),v=c.align,b=f*l*v;return e.set(0<=u?+o:-o,0<=s?+a:-a,Math.abs(u)+b,Math.abs(s)+b,f,l,v)},i.prototype.contains=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbs(i.x,i.y,i.width,i.height,i.strokeWidth,i.strokeScale,i.strokeAlign)?this:this.containsText(t,n)||this.containsChildren(t,n)},i.prototype.containsText=function(t,n){var i=this.text;if(null!=i.atlas){var r=i.world;if(null!=r){var e=this.transform.internalTransform,u=e.a*t+e.c*n+e.tx-r[0],s=e.b*t+e.d*n+e.ty-r[1],h=r[2]*u+r[3]*s,o=r[4]*u+r[5]*s;if(0<=h&&h<=r[6]&&0<=o&&o<=r[7])return this}}return null},i.prototype.containsChildren=function(t,n){for(var i=this.children,r=i.length-1;0<=r;--r){var e=i[r];e.updateTransform();var u=e.transform.localTransform,s=u.a,h=u.b,o=u.c,a=u.d,c=u.tx,f=u.ty,l=1/(s*a-o*h),v=(a*t-o*n+f*o-c*a)*l,b=(s*n-h*t-f*s+c*h)*l,d=e.contains(v,b);if(null!=d)return d}return null},i.prototype.containsBBox=function(t,n){var i=this.toHitTestData(t,n);return this.containsAbsBBox(i.x,i.y,i.width,i.height)},i.prototype.containsAbs=function(t,n,i,r,e,u,s){return this.containsAbsBBox(t,n,i,r)},i.prototype.containsAbsBBox=function(t,n,i,r){return Ot(t,n,i,r)},i.prototype.select=function(t){return!1},i.prototype.toGlobal=function(t,n,i){return!0!==i&&this.updateTransform(),n.copyFrom(t),this.transform.worldTransform.apply(n,n),n},i.prototype.toLocal=function(n,i,r,e){return!0!==e&&this.updateTransform(),void 0===r&&(r=new t.Point),r.copyFrom(n),this.transform.worldTransform.applyInverse(r,r),r},i.prototype.getBounds=function(n,i,r){!0!==i&&this.updateTransform();var e=this._bounds||new t.Rectangle;this._bounds=e;var u=this.transform.getWorldId();return u!==this.at&&(this.at=u,this.wt(this.transform.worldTransform,n,e)),r.copyFrom(e),r},i.prototype.getBoundsInternal=function(n,i,r){!0!==i&&this.updateTransform();var e=this.Ot||new t.Rectangle;this.Ot=e;var u=this.transform.getLocalIdCurrent();return u!==this.ct&&(this.ct=u,this.wt(this.transform.internalTransform,n,e)),r.copyFrom(e),r},i.prototype.getBoundsLocal=function(n,i,r){!0!==i&&this.updateTransform();var e=this.Dt||new t.Rectangle;this.Dt=e;var u=this.transform.getLocalIdCurrent();return u!==this.ft&&(this.ft=u,this.wt(this.transform.localTransform,n,e)),r.copyFrom(e),r},i.prototype.getBoundsSize=function(){return this.size},i.prototype.wt=function(t,n,i){var r=this.transform.pivot,e=r.x,u=r.y,s=this.getBoundsSize(),h=.5*s.x,o=.5*s.y,a=t.a,c=t.b,f=t.c,l=t.d,v=-h+e,b=-o+u,d=a*v+f*b,g=c*v+l*b,m=a*(v=+h+e)+f*(b=-o+u),w=c*v+l*b,p=a*(v=-h+e)+f*(b=+o+u),O=c*v+l*b,D=a*(v=+h+e)+f*(b=+o+u),E=c*v+l*b,M=Math.min(d,m,p,D),S=Math.min(g,w,O,E),T=Math.max(d,m,p,D),j=Math.max(g,w,O,E);return i.x=M+t.tx,i.y=S+t.ty,i.width=T-M,i.height=j-S,i},i.prototype.destroy=function(){for(var t=this.children,n=t.length-1;0<=n;--n)t[n].destroy();t.length=0},i.prototype.onStateChange=function(t,n){var r;null===(r=this.runtime)||void 0===r||r.onStateChange(this,t,n);for(var e=this.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof i&&h.state.onParentChange(t,n)}},Object.defineProperty(i.prototype,"state",{get:function(){var t=this,n=this.Et;return null==n&&(n=new vt((function(n,i){t.onStateChange(n,i)})),this.Et=n),n},enumerable:!1,configurable:!0}),i.prototype.focus=function(){return this.setFocused(!0),this},i.prototype.blur=function(){return this.setFocused(!1),this},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=rt.getLayer(this);n&&n.getFocusController().set(this,t)}},i.prototype.onKeyDown=function(t){var n=this.runtime;return!!n&&n.onKeyDown(this,t)},i.prototype.onKeyUp=function(t){var n=this.runtime;return!!n&&n.onKeyUp(this,t)},i.prototype.update=function(t){var n=this.runtime;n&&n.update(this,t)},i.prototype.onRender=function(t,n){var i=this.runtime;i&&i.onRender(this,t,n)},i.prototype.updateRecursively=function(t){this.update(t);for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].update(t)},i.prototype.copy=function(t,n){if(void 0===n&&(n=st.ALL),this.id=t.id,this.uuid=t.uuid,n&st.TRANSFORM){var r=this.transform,e=t.transform;r.position.copyFrom(e.position),r.rotation=e.rotation,r.skew.copyFrom(e.skew),r.pivot.copyFrom(e.pivot),r.scale.copyFrom(e.scale)}if(n&st.SIZE&&this.size.copyFrom(t.size),n&st.STYLE&&(this.fill.copy(t.fill),this.stroke.copy(t.stroke),this.text.copy(t.text),this.radius=t.radius,this.corner=t.corner),n&st.DATA&&this.data.copy(t.data),n&st.IMAGE&&(this.image=t.image),n&st.ACTION&&(this.action.clearAndAddAll(t.action.values),this.interactive=t.interactive,this.cursor=t.cursor,this.shortcut=t.shortcut),n&st.POINTS){var u=t.points;if(null!=u){var s=this.points;null!=s&&s.copy(u)}}if(n&st.STATE&&this.state.lock(!1).copy(t.state).unlock(),n&st.CONNECTOR)if(t instanceof i){var h=t.vt;h?this.connector.copy(h):(o=this.vt)&&o.clear()}else{var o;(o=this.vt)&&o.clear()}return this},i}(t.utils.EventEmitter),Et=function(){function t(t,n,i,r,e,u,s,h){this.O=t,this.S=n,this.T=i,this.j=r,this.Mt=e,this.St=u,this.Tt=s,this._=h}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.Mt},set:function(t){this.Mt!==t&&(this.Mt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return this.Tt},set:function(t){this.Tt!==t&&(this.Tt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this._},set:function(t){this._!==t&&(this._=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width,t.align,t.side,t.style)},t.prototype.set=function(t,n,i,r,e,u,s){var h=!1;void 0!==t&&this.S!==t&&(this.S=t,h=!0),void 0!==n&&this.T!==n&&(this.T=n,h=!0),void 0!==i&&this.j!==i&&(this.j=i,h=!0),void 0!==r&&this.Mt!==r&&(this.Mt=r,h=!0),void 0!==e&&this.St!==e&&(this.St=e,h=!0),void 0!==u&&this.Tt!==u&&(this.Tt=u,h=!0),void 0!==s&&this._!==s&&(this._=s,h=!0),h&&this.O.updateUploaded()},t.prototype.clone=function(){return new t(this.O,this.S,this.T,this.j,this.Mt,this.St,this.Tt,this._)},t.prototype.toObject=function(){return{enable:this.S,color:this.T,alpha:this.j,width:this.Mt,align:this.St,side:this.Tt,style:this._}},t.prototype.serialize=function(t){var n="["+(this.S?1:0)+","+this.T+","+this.j+","+this.Mt+","+this.St+","+this.Tt+","+this._+"]";return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getStroke(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3],r[4],r[5],r[6]);else{var e=JSON.parse(i[t]);n.setStroke(t,e),this.set(!!e[0],e[1],e[2],e[3],e[4],e[5],e[6])}}},t}(),Mt={ASCENDING:0,DESCENDING:1},St={NONE:0,FROM:1,TO:2,FROM_TO:3},Tt=function(){function t(){this.jt=St.NONE,this.Nt=0,this.It=1}return Object.defineProperty(t.prototype,"type",{get:function(){return this.jt},set:function(t){if(this.jt!==t){this.jt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.Nt},set:function(t){if(this.Nt!==t){this.Nt=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.It},set:function(t){if(this.It!==t){this.It=t;var n=this.parent;null!=n&&(n.isChanged=!0)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;if(void 0!==t&&void 0!==n)if(null!==t&&null!==n){var r=this.jt|St.FROM|St.TO;this.jt===r&&this.Nt===t&&this.It===n||(this.jt=r,this.Nt=t,this.It=n,i=!0)}else null!==t?(r=(this.jt|St.FROM)&~St.TO,this.jt===r&&this.Nt===t||(this.jt=r,this.Nt=t,i=!0)):null!==n?(r=(this.jt|St.TO)&~St.FROM,this.jt===r&&this.Nt===t||(this.jt=r,this.It=n,i=!0)):(r=this.jt&~(St.TO|St.FROM),this.jt!==r&&(this.jt=r,i=!0));else void 0!==t?null!==t?(r=this.jt|St.FROM,this.jt===r&&this.Nt===t||(this.jt=r,this.Nt=t,i=!0)):(r=this.jt&~St.FROM,this.jt!==r&&(this.jt=r,i=!0)):void 0!==n&&(null!==n?(r=this.jt|St.TO,this.jt===r&&this.It===n||(this.jt=r,this.It=n,i=!0)):(r=this.jt&~St.TO,this.jt!==r&&(this.jt=r,i=!0)));if(i){var e=this.parent;null!=e&&(e.isChanged=!0)}return i},t.prototype.normalize=function(t){var n=this.jt,i=this.Nt,r=this.It;switch(n){case St.FROM_TO:return(t-i)/(r-i);case St.FROM:return t-i;case St.TO:return r-t;case St.NONE:default:return t}},t.prototype.isEquals=function(t){return this.jt===t.type&&this.Nt===t.from&&this.It===t.to},t.prototype.copy=function(t){return this.Ct(t.type,t.from,t.to)},t.prototype.Ct=function(t,n,i){var r=!1;if(this.jt!==t&&(this.jt=t,r=!0),this.Nt!==n&&(this.Nt=n,r=!0),this.It!==i&&(this.It=i,r=!0),r){var e=this.parent;null!=e&&(e.isChanged=!0)}return this},t.prototype.toObject=function(){return{type:this.type,from:this.from,to:this.to}},t.prototype.serialize=function(t){var n="["+this.jt+","+this.Nt+","+this.It+"]";return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getRange(t);if(null!=r)this.Ct(r[0],r[1],r[2]);else{var e=JSON.parse(i[t]);n.setRange(t,e),this.Ct(e[0],e[1],e[2])}}},t}(),jt=function(t,n){return t-n},Nt=function(){function t(){this.id="",this.initial="",this.format="",this.range=new Tt,this.At=0,this.Rt=0,this.yt=0,this.kt=Mt.ASCENDING}return Object.defineProperty(t.prototype,"parent",{get:function(){return this.O},set:function(t){this.O!==t&&(this.O=t,this.range.parent=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.At},set:function(t){var n=this.formatter;null!=n&&(t=n(t));var i=this.yt;if(i<=0){if(this.At!==t){this.At=t;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.L;null==e&&(e=[],this.L=e),this.At=t;var u=this.kt;u===Mt.ASCENDING?e.push(t):e.unshift(t);var s=e.length-i;if(0<s)if(u===Mt.ASCENDING)for(var h=0;h<s;++h)e.shift();else e.length=i;var o=this.parent;null!=o&&(o.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){return this.range.normalize(this.At)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.L;return null==t&&(t=[],this.L=t),t},set:function(t){if(0<t.length){var n=this.yt;if(n<=0){var i=t[t.length-1];if(null!=(u=this.formatter)&&(i=u(i)),this.At!==i){this.At=i;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.L;null==e&&(e=[],this.L=e);var u,s=this.kt;if(null!=(u=this.formatter))if(this.At=u(t[t.length-1]),s===Mt.ASCENDING)for(var h=0,o=t.length;h<o;++h)e.push(u(t[h]));else for(h=0,o=t.length;h<o;++h)e.unshift(u(t[h]));else if(this.At=t[t.length-1],s===Mt.ASCENDING)for(h=0,o=t.length;h<o;++h)e.push(t[h]);else for(h=0,o=t.length;h<o;++h)e.unshift(t[h]);var a=e.length-n;if(0<a)if(s===Mt.ASCENDING)for(h=0;h<a;++h)e.shift();else e.length=n;var c=this.parent;null!=c&&(c.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){return this.Rt},set:function(t){var n=this.yt;if(n<=0){if(this.Rt!==t){this.Rt=t;var i=this.parent;null!=i&&(i.isChanged=!0)}}else{var r=this.Lt;null==r&&(r=[],this.Lt=r),this.Rt=t;var e=this.kt;e===Mt.ASCENDING?r.push(t):r.unshift(t);var u=r.length-n;if(0<u)if(e===Mt.ASCENDING)for(var s=0;s<u;++s)r.shift();else r.length=n;var h=this.parent;null!=h&&(h.isChanged=!0)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"times",{get:function(){var t=this.Lt;return null==t&&(t=[],this.Lt=t),t},set:function(t){if(0<t.length){var n=this.yt;if(n<=0){var i=t[t.length-1];if(this.Rt!==i){this.Rt=i;var r=this.parent;null!=r&&(r.isChanged=!0)}}else{var e=this.Lt;null==e&&(e=[],this.Lt=e),this.Rt=t[t.length-1];var u=this.kt;if(u===Mt.ASCENDING)for(var s=0,h=t.length;s<h;++s)e.push(t[s]);else for(s=0,h=t.length;s<h;++s)e.unshift(t[s]);var o=e.length-n;if(0<o)if(u===Mt.ASCENDING)for(s=0;s<o;++s)e.shift();else e.length=n;var a=this.parent;null!=a&&(a.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){return this.yt},set:function(t){if(this.yt<t)this.yt=t;else if(t<this.yt){this.yt=t;var n=!1,i=this.kt,r=this.L;if(null!=r&&0<(u=r.length-t)){if(i===Mt.ASCENDING)for(var e=0;e<u;++e)r.shift();else r.length=t;n=!0}var u,s=this.Lt;if(null!=s&&0<(u=s.length-t)){if(i===Mt.ASCENDING)for(e=0;e<u;++e)s.shift();else s.length=t;n=!0}if(n){var h=this.parent;null!=h&&(h.isChanged=!0)}}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"order",{get:function(){return this.kt},set:function(t){this.kt=t},enumerable:!1,configurable:!0}),t.prototype.remove=function(t){var n=!1,i=this.L;null!=i&&0<=t&&t<i.length&&(i.splice(t,1),n=!0);var r=this.Lt;if(null!=r&&0<=t&&t<r.length&&(r.splice(t,1),n=!0),n){var e=this.parent;null!=e&&(e.isChanged=!0)}},t.prototype.removeAll=function(t){var n=!1,i=this.L,r=this.Lt,e=t.slice(0).sort(jt);if(null!=i)if(null!=r)for(var u=e.length-1;0<=u;--u)0<=(s=e[u])&&(s<i.length&&(i.splice(s,1),n=!0),s<r.length&&(r.splice(s,1),n=!0));else for(u=e.length-1;0<=u;--u)0<=(s=e[u])&&s<i.length&&(i.splice(s,1),n=!0);else if(null!=r)for(u=e.length-1;0<=u;--u){var s;0<=(s=e[u])&&s<r.length&&(r.splice(s,1),n=!0)}if(n){var h=this.parent;null!=h&&(h.isChanged=!0)}},t.prototype.clear=function(){var t=!1,n=this.L;null!=n&&(n.length=0,t=!0);var i=this.Lt;if(null!=i&&(i.length=0,t=!0),t){var r=this.parent;null!=r&&(r.isChanged=!0)}},t.prototype.copy=function(t){return this.id=t.id,this.initial=t.initial,this.format=t.format,this.formatter=t.formatter,this.range.copy(t.range),this.At=t.value,this.Rt=t.time,this.yt=t.capacity,this},t.prototype.isEquals=function(t){return this.id===t.id&&this.initial===t.initial&&this.formatter===t.formatter&&this.range.isEquals(t.range)},t.prototype.serialize=function(t){var n=t.addData(this.id),i=t.addResource(this.initial),r=t.addResource(this.format.trim()),e=this.range.serialize(t);return t.addResource("["+n+","+i+","+r+","+e+","+this.yt+","+this.kt+"]")},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getDataValue(t);null==r&&(r=JSON.parse(i[t]),n.setDataValue(t,r)),this.id=n.data[r[0]]||"",this.initial=i[r[1]]||"",this.format=i[r[2]]||"",this.range.deserialize(r[3],n),this.yt=r[4],this.kt=r[5]}return this},t}(),It=function(){function t(){this.L=[],this.xt=!0}return Object.defineProperty(t.prototype,"values",{get:function(){return this.L},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isChanged",{get:function(){return this.xt},set:function(t){this.xt=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.L;return 0<t.length?t[0].id:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"initial",{get:function(){var t=this.L;return 0<t.length?t[0].initial:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){var t=this.L;return 0<t.length?t[0].format:""},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.L;return 0<t.length?t[0].range:null!=P?P:P=new Tt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this.L;return 0<t.length?t[0].value:0},set:function(t){var n=this.L;0<n.length&&(n[0].value=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"nvalue",{get:function(){var t=this.L;return 0<t.length?t[0].nvalue:0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"time",{get:function(){var t=this.L;return 0<t.length?t[0].time:0},set:function(t){var n=this.L;0<n.length&&(n[0].time=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"capacity",{get:function(){var t=this.L;return 0<t.length?t[0].capacity:0},set:function(t){var n=this.L;0<n.length&&(n[0].capacity=t)},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.L;t.parent=this,void 0===n?i.push(t):i.splice(n,0,t)},t.prototype.set=function(t,n){var i=this.L;if(0<=t&&t<i.length){var r=i[t];return n.parent=this,i[t]=n,r.parent=void 0,r}return null},t.prototype.remove=function(t){var n=this.L;0<=t&&t<n.length&&(n.splice(t,1)[0].parent=void 0)},t.prototype.indexOf=function(t){for(var n=this.L,i=n.length,r=0;r<i;++r)if(n[r]===t)return r;for(r=0;r<i;++r)if(n[r].isEquals(t))return r;for(r=0;r<i;++r)if(n[r].id===t.id)return r;return-1},t.prototype.get=function(t){var n=this.L;return 0<=t&&t<n.length?n[t]:null},t.prototype.size=function(){return this.L.length},t.prototype.swap=function(t,n){var i=this.L,r=i[n];i[n]=i[t],i[t]=r},t.prototype.copy=function(t){var n=this.L;n.length=0;for(var i=0,r=t.size();i<r;++i){var e=t.get(i);if(null!=e){var u=(new Nt).copy(e);u.parent=this,n.push(u)}}return this},t.prototype.serialize=function(t){var n=this.L;if(n.length<=0)return t.addResource("[]");for(var i="["+n[0].serialize(t),r=1,e=n.length;r<e;++r)i+=","+n[r].serialize(t);return i+="]",t.addResource(i)},t.prototype.deserialize=function(t,n){if(0<=t&&t<n.resources.length){var i=n.getData(t);null==i&&(i=JSON.parse(n.resources[t]),n.setData(t,i));var r=this.L;r.length=0;for(var e=i.length,u=0;u<e;++u){var s=i[u],h=new Nt;h.parent=this,h.deserialize(s,n),r.push(h)}}},t}(),Ct=function(){function t(t,n,i){this.O=t,this.Bt=n,this.Pt=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Bt},set:function(t){this.Bt!==t&&(this.Bt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.Pt},set:function(t){this.Pt!==t&&(this.Pt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Bt!==t&&(this.Bt=t,i=!0),null!=n&&this.Pt!==n&&(this.Pt=n,i=!0),i&&this.O.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Bt,vertical:this.Pt}},t.prototype.serialize=function(t){return t.addResource("["+this.Bt+","+this.Pt+"]")},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getAlign(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setAlign(t,e),this.set(e[0],e[1])}}},t}(),At=function(){function t(t,n,i){this.O=t,this.Bt=n,this.Pt=i}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return this.Bt},set:function(t){this.Bt!==t&&(this.Bt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return this.Pt},set:function(t){this.Pt!==t&&(this.Pt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.horizontal,t.vertical)},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Bt!==t&&(this.Bt=t,i=!0),null!=n&&this.Pt!==n&&(this.Pt=n,i=!0),i&&this.O.updateUploaded()},t.prototype.toObject=function(){return{horizontal:this.Bt,vertical:this.Pt}},t.prototype.serialize=function(t){return t.addResource("["+this.Bt+","+this.Pt+"]")},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getMargin(t);if(null!=r)this.set(r[0],r[1]);else{var e=JSON.parse(i[t]);n.setMargin(t,e),this.set(e[0],e[1])}}},t}(),Rt=function(){function t(t,n,i,r,e){this.O=t,this.S=n,this.T=i,this.j=r,this.Mt=e}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.Mt},set:function(t){this.Mt!==t&&(this.Mt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){t&&this.set(t.enable,t.color,t.alpha,t.width)},t.prototype.set=function(t,n,i,r){var e=!1;void 0!==t&&this.S!==t&&(this.S=t,e=!0),void 0!==n&&this.T!==n&&(this.T=n,e=!0),void 0!==i&&this.j!==i&&(this.j=i,e=!0),void 0!==r&&this.Mt!==r&&(this.Mt=r,e=!0),e&&this.O.updateUploaded()},t.prototype.clone=function(){return new t(this.O,this.S,this.T,this.j,this.Mt)},t.prototype.toObject=function(){return{enable:this.S,color:this.T,alpha:this.j,width:this.Mt}},t.prototype.serialize=function(t){var n="["+(this.S?1:0)+","+this.T+","+this.j+","+this.Mt+"]";return t.addResource(n)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getTextOutline(t);if(null!=r)this.set(!!r[0],r[1],r[2],r[3]);else{var e=JSON.parse(i[t]);n.setTextOutline(t,e),this.set(!!e[0],e[1],e[2],e[3])}}},t}(),yt=function(){function t(t,n,i,r,e,u){this.O=t,this.S=!0,this.At=n,this.T=i,this.j=r,this.Ft=e,this.I=u,this.Ut=d.NORMAL,this.align=new Ct(t,m.CENTER,w.MIDDLE),this.offset=new At(t,0,0),this._=g.NORMAL,this.spacing=new At(t,0,0),this.outline=new Rt(t,!1,16777215,1,.5),this.Gt=p.LEFT_TO_RIGHT,this.padding=new At(t,10,10),this.zt=!1}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return this.At},set:function(t){if(this.At!==t){this.At=t;var n=this.O,i=n.uploaded;if(null==i||!i.isCompatible(n))return this.atlas=void 0,void n.toDirty();var r=this.atlas,e=r&&r.characters;if(null==e)return this.atlas=void 0,void n.toDirty();for(var u=0,s=t.length;u<s;++u)if(!(t[u]in e))return this.atlas=void 0,void n.toDirty();n.updateUploaded()}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){return this.Ft},set:function(t){this.Ft!==t&&(this.Ft=t,this.O.toDirty())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.I},set:function(t){this.I!==t&&(this.I=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return this.Ut},set:function(t){this.Ut!==t&&(this.Ut=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this._},set:function(t){this._!==t&&(this._=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return this.Gt},set:function(t){this.Gt!==t&&(this.Gt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){return this.zt},set:function(t){this.zt!==t&&(this.zt=t,this.O.updateUploaded())},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return t&&(this.set(t.value,t.color,t.alpha,t.family,t.size,t.weight,t.style,t.direction,t.clipping),this.align.copy(t.align),this.offset.copy(t.offset),this.outline.copy(t.outline),this.spacing.copy(t.spacing),this.padding.copy(t.padding)),this},t.prototype.set=function(t,n,i,r,e,u,s,h,o){var a=!1,c=!1;return null!=t&&this.At!==t&&(this.At=t,a=!0),null!=n&&this.T!==n&&(this.T=n,c=!0),null!=i&&this.j!==i&&(this.j=i,c=!0),null!=r&&this.Ft!==r&&(this.Ft=r,a=!0),null!=e&&this.I!==e&&(this.I=e,c=!0),null!=u&&this.Ut!==u&&(this.Ut=u,c=!0),null!=s&&this._!==s&&(this._=s,c=!0),null!=h&&this.Gt!==h&&(this.Gt=h,c=!0),null!=o&&this.zt!==o&&(this.zt=o,c=!0),a?this.O.toDirty():c&&this.O.updateUploaded(),this},t.prototype.toObject=function(){return{value:this.At,color:this.T,alpha:this.j,family:this.Ft,size:this.I,weight:this.Ut,align:this.align.toObject(),offset:this.offset.toObject(),style:this._,outline:this.outline.toObject(),direction:this.Gt,spacing:this.spacing.toObject(),padding:this.padding.toObject(),clipping:this.zt}},t.prototype.serialize=function(t){var n=t.addResource(this.At),i=t.addResource(this.Ft),r=this.align.serialize(t),e=this.offset.serialize(t),u=this.outline.serialize(t),s=this.spacing.serialize(t),h=this.padding.serialize(t),o="["+n+","+this.T+","+this.j+","+i+","+this.I+","+this.Ut+","+r+","+e+","+this._+","+u+","+s+","+this.Gt+","+h+","+(this.zt?1:0)+"]";return t.addResource(o)},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getText(t);null==r&&(r=JSON.parse(i[t]),n.setText(t,r)),this.set(i[r[0]]||"",r[1],r[2],i[r[3]]||"auto",r[4],r[5],r[8],r[11],!!r[13]),this.align.deserialize(r[6],n),this.offset.deserialize(r[7],n),this.outline.deserialize(r[9],n),this.spacing.deserialize(r[10],n),this.padding.deserialize(r[12],n)}},t}(),kt=function(n){function i(t){var i=n.call(this,t)||this;i.size=i.newSize(),i.fill=i.newFill(),i.stroke=i.newStroke(),i.Ht=Y.RADIUS,i.Vt=it.ALL;var r=new It;return i.data=r,i.tag=r,i.text=i.newText(),i.cursor=Y.CURSOR,i}return _(i,n),i.prototype.newSize=function(){var n=this;return new t.ObservablePoint((function(){n.onSizeChange()}),void 0,Y.SIZE_X,Y.SIZE_Y)},i.prototype.newFill=function(){return new Z(this,!0,Y.FILL_COLOR,Y.FILL_ALPHA)},i.prototype.newStroke=function(){return new Et(this,!0,Y.STROKE_COLOR,Y.STROKE_ALPHA,Y.STROKE_WIDTH,Y.STROKE_ALIGN,Y.STROKE_SIDE,Y.STROKE_STYLE)},i.prototype.newText=function(){return new yt(this,Y.TEXT_VALUE,Y.TEXT_COLOR,Y.TEXT_ALPHA,Y.TEXT_FAMILY,Y.TEXT_SIZE)},Object.defineProperty(i.prototype,"corner",{get:function(){return this.Vt},set:function(t){this.Vt!==t&&(this.Vt=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"radius",{get:function(){return this.Ht},set:function(t){this.Ht!==t&&(this.Ht=t,this.updateUploaded())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"image",{get:function(){return this.bt},set:function(t){if(this.bt!==t){null!=t?(this.bt=t,this.imageSrc=t.src):(this.bt=void 0,this.imageSrc=void 0);var n=this.parent;null!=n&&n.toDirty()}},enumerable:!1,configurable:!0}),i}(Dt),Lt=function(t,n,i,r,e,u,s){if(t.fill.enable){if((c=n*n)*(o=e*e)+(f=i*i)*(h=r*r)<=h*o)return!0}else if(0<u){var h,o,a=u*s,c=n*n,f=i*i,l=Math.max(0,r-a),v=Math.max(0,e-a),b=l*l,d=v*v;if(b*d<=c*d+f*b&&c*(o=e*e)+f*(h=r*r)<=h*o)return!0}return!1},xt={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_OR_LEFT:9,TOP_OR_RIGHT:3,BOTTOM_OR_LEFT:12,BOTTOM_OR_RIGHT:6,ALL:15},Bt=function(t,n,i,r,e,u,s){if(Ot(n,i,r,e)){if(t.fill.enable)return!0;var h=t.stroke.side;if(0<u&&h!==xt.NONE){var o=u*s,a=Math.max(0,r-o),c=Math.max(0,e-o);if(!Ot(n,i,a,c))return!(h!==xt.ALL&&!(n<=-a?i<=-c?h&xt.TOP_OR_LEFT:+c<=i?h&xt.BOTTOM_OR_LEFT:h&xt.LEFT:+a<=n?i<=-c?h&xt.TOP_OR_RIGHT:+c<=i?h&xt.BOTTOM_OR_RIGHT:h&xt.RIGHT:i<=-c?h&xt.TOP:+c<=i&&h&xt.BOTTOM))}}return!1},_t=function(t,n,i,r,e){return+i*t+r-n<=0&&-i*t+r-n<=0&&n<=e},Pt=function(t,n,i,r,e,u,s){var h=2*e/r;if(t.fill.enable){if(_t(n,i,h,-e,+e))return!0}else if(0<u){var o=u*s;if(_t(n,i,h,-e,+e)){var a=2*r*e/(r+Math.sqrt(r*r+4*e*e)),c=e-a,f=c+(-e-c)*Math.max(0,a-o)/a;if(!_t(n,i,h,f,e-o))return!0}}return!1},Ft=function(t,n,i){return.5*(i+t*n)},Ut=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getHitTestSize=function(n){var i=this.gt.formatted;if("boundary"in i){var r=i.boundary;n.width=Math.max(Math.abs(r[0]),Math.abs(r[2])),n.height=Math.max(Math.abs(r[1]),Math.abs(r[3]))}else t.prototype.getHitTestSize.call(this,n);return n},n.prototype.toMarkerSize=function(t){var n=0,i=t.getMarker();if(i){var r=i.head;if(r.type!==J.NONE){var e=r.size;n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y)))}var u=i.tail;u.type!==J.NONE&&(e=u.size,n=Math.max(n,2*Math.max(Math.abs(e.x),Math.abs(e.y))))}return n},n.prototype.containsAbsMarker=function(t,n,i,r,e,u){var s=t.type;if(s!==J.NONE){var h=t.transform,o=h.a,a=h.b,c=h.c,f=h.d,l=h.tx,v=h.ty,b=1/(o*f-c*a),d=(f*n-c*i+v*c-l*f)*b,g=(o*i-a*n-v*o+l*a)*b,m=t.size,w=.5*m.x,p=.5*m.y;w<0&&(w=-w,n=-n),p<0&&(p=-p,i=-i);var O=r*e*u;switch(w+=O,p+=O,s){case J.CIRCLE:return Lt(this,d,g,w,p,r,e);case J.TRIANGLE:return Pt(this,d,g,w,p,r,e);case J.RECTANGLE:return Bt(this,d,g,w,p,r,e)}}return!1},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=this.gt,o=Ft(e,u,0),a=o+this.toMarkerSize(h);if(this.containsAbsBBox(t,n,i+a,r+a)){var c=h.getMarker();if(c){if(this.containsAbsMarker(c.head,t,n,e,u,s))return!0;if(this.containsAbsMarker(c.tail,t,n,e,u,s))return!0}var f=this.calcHitPointAbsHitTester;return h.calcHitPointAbs(t,n,i,r,o,null,f,null)}return!1},n.prototype.calcHitPart=function(t,n){var i=this.toHitTestData(t,n),r=i.strokeWidth,e=i.strokeScale,u=Ft(r,e,0),s=this.gt,h=u+this.toMarkerSize(s),o=i.x,a=i.y,c=i.width,f=i.height;if(this.containsAbsBBox(o,a,c+h,f+h)){var l=s.getMarker();if(l){var v=i.strokeAlign;if(this.containsAbsMarker(l.head,o,a,r,e,v))return nt.MARKER_HEAD;if(this.containsAbsMarker(l.tail,o,a,r,e,v))return nt.MARKER_TAIL}var b=this.calcHitPointAbsHitTester;if(s.calcHitPointAbs(o,a,c,f,u,null,b,null))return nt.LINE}return this.containsText(t,n)?nt.TEXT:this.containsChildren(t,n)?nt.CHILDREN:nt.NONE},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.gt,h=this.toHitTestData(t,n),o=(i||Ft)(h.strokeWidth,h.strokeScale,0);return!!this.containsAbsBBox(h.x,h.y,h.width+o,h.height+o)&&s.calcHitPointAbs(h.x,h.y,h.width,h.height,o,r,e,u)},n.prototype.calcHitPointAbsHitTester=function(t,n,i,r,e,u,s,h,o){var a=e-i,c=u-r,f=t-i,l=n-r,v=a*a+c*c,b=a*f+c*l,d=f*f+l*l;if(1e-4<v){var g=Math.max(0,Math.min(1,b/v));if(v*g*g-2*b*g+d<h*h)return!0}return!1},n}(kt),Gt=function(t){function n(n){void 0===n&&(n=r.BAR);var i=t.call(this,n)||this;return i.gt=new tt(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbsBBox=function(n,i,r,e){var u=Math.max(0,this.gt.size);return t.prototype.containsAbsBBox.call(this,n,i,r+u,e+u)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.gt.serialize(n),i},n}(Ut),zt=function(t){function n(n,i){var r=t.call(this,n,i,4,2)||this;return r.pointsId=NaN,r.pointsStyle=U.NONE,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset,i=this.indexOffset;t.updateClippings(),t.updateIndices(),c(t.clippings,n),f(t.indices,n,i)},n.prototype.update=function(t,n){this.updateVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexStepAndColorFill=function(t,n){if(n instanceof Gt){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.stroke,h=s.enable?s.width:0,o=s.style,a=h!==this.strokeWidth||o!==this.strokeStyle,c=H(n),f=this.transformLocalId!==c,v=n.points,b=v.id,d=b!==this.pointsId,g=v.style,m=g!==this.pointsStyle;(u||f||a||d||m)&&(this.sizeX=r,this.sizeY=e,this.strokeWidth=h,this.strokeStyle=o,this.transformLocalId=c,this.pointsId=b,this.pointsStyle=g,d&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),l(t.vertices,t.steps,t.colorFills,this.vertexOffset,v.values,v.size,h,o,n.transform.internalTransform))}},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),v(t.uvs,this.vertexOffset,X(i)))},n}(z),Ht=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.sizeX=NaN,this.sizeY=NaN,this.transformLocalId=NaN,this.size=NaN,this.family="auto",this.value="",this.texture=null,this.textureTransformId=NaN,this.color=NaN,this.alpha=NaN,this.weight=NaN,this.style=NaN,this.alignHorizontal=NaN,this.alignVertical=NaN,this.offsetHorizontal=NaN,this.offsetVertical=NaN,this.outlineWidth=NaN,this.outlineColor=NaN,this.outlineAlpha=NaN,this.spacingHorizontal=NaN,this.spacingVertical=NaN,this.direction=NaN,this.paddingHorizontal=NaN,this.paddingVertical=NaN,this.clipping=!1}return n.prototype.init=function(t){var n=this.vertexCount;if(0<n){var i=this.vertexOffset;t.updateClippings(),S(t.clippings,i,n),t.updateIndices(),T(t.indices,i,this.indexOffset,this.indexCount)}},n.prototype.isCompatible=function(t){return 4*M(t)===this.vertexCount},n.prototype.update=function(t,n){if(0<this.vertexCount){var i=n.text.atlas;null!=i&&(this.updateVertex(t,n,i),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateStep(t,n))}},n.prototype.updateVertex=function(n,i,r){var e=i.size,u=e.x,s=e.y,h=u!==this.sizeX||s!==this.sizeY,o=H(i),a=this.transformLocalId!==o,c=i.text,f=c.size,l=c.family,v=c.value,b=c.style,d=c.align.horizontal,g=c.align.vertical,m=c.offset.horizontal,w=c.offset.vertical,p=c.spacing.horizontal,O=c.spacing.vertical,D=c.direction,E=c.padding.horizontal,M=c.padding.vertical,S=c.clipping,T=c.texture||t.Texture.WHITE,j=W(T),N=v!==this.value||l!==this.family,I=f!==this.size,A=b!==this.style,R=d!==this.alignHorizontal||g!==this.alignVertical,y=m!==this.offsetHorizontal||w!==this.offsetVertical,k=p!==this.spacingHorizontal||O!==this.spacingVertical||E!==this.paddingHorizontal||M!==this.paddingVertical,L=D!==this.direction,x=this.clipping!==S,B=T!==this.texture||j!==this.textureTransformId;if(h||a||N||I||A||R||y||k||L||x||B){this.size=f,this.family=l,this.value=v,this.style=b,this.alignHorizontal=d,this.alignVertical=g,this.offsetHorizontal=m,this.offsetVertical=w,this.spacingHorizontal=p,this.spacingVertical=O,this.direction=D,this.paddingHorizontal=E,this.paddingVertical=M,this.clipping=S,this.texture=T,this.textureTransformId=j,I&&(this.weight=NaN),n.updateVertices(),n.updateUvs();var _=i.size,P=c.world;null==P&&(P=[0,0,0,0,0,0,0,0],c.world=P),C(n.vertices,n.uvs,this.vertexOffset,this.vertexCount,0,0,_.x,_.y,r,f,v,b,d,g,m,w,p,O,D,E,M,S,P,X(T),i.transform.internalTransform)}},n.prototype.updateColorFill=function(t,n){var i=n.text,r=i.color,e=n.visible&&i.enable?i.alpha:0;r===this.color&&e===this.alpha||(this.color=r,this.alpha=e,t.updateColorFills(),G(r,e,this.vertexOffset,this.vertexCount,t.colorFills))},n.prototype.updateColorStroke=function(t,n){var i=n.text,r=i.outline,e=r.color,u=n.visible&&i.enable?r.alpha:0;e===this.outlineColor&&u===this.outlineAlpha||(this.outlineColor=e,this.outlineAlpha=u,t.updateColorStrokes(),G(e,u,this.vertexOffset,this.vertexCount,t.colorStrokes))},n.prototype.updateStep=function(t,n){var i=n.text,r=i.outline,e=r.enable?r.width:0,u=i.weight;u===this.weight&&e===this.outlineWidth||(this.weight=u,this.outlineWidth=e,t.updateSteps(),j(t.steps,this.vertexOffset,this.vertexCount,i.atlas,i.size,e,u))},n.prototype.buildUnit=function(n){if(0<this.vertexCount){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;r!==n.baseTexture&&(n.baseTexture=r,n.push(i,this.indexOffset))}},n}(),Vt=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=4+h,c=2+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new zt(i,r),new Ht(i+4,r+2,h,o)]).init(n):null},Wt=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},Xt=function(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)},Kt=function(){function t(){}return t.isActivateKey=function(t){return"Space"===t.key||"Enter"===t.key||32===t.which||13===t.which},t.isArrowUpKey=function(t){return"ArrowUp"===t.key||38===t.which},t.isArrowDownKey=function(t){return"ArrowDown"===t.key||40===t.which},t.isArrowLeftKey=function(t){return"ArrowLeft"===t.key||37===t.which},t.isArrowRightKey=function(t){return"ArrowRight"===t.key||39===t.which},t.isCancelKey=function(t){return"Esc"===t.key||27===t.which},t.isFocusKey=function(t){return"Tab"===t.key||9===t.which},t.isUndoKey=function(t){return t.ctrlKey&&("z"===t.key||90===t.which)},t.isRedoKey=function(t){return t.ctrlKey&&("y"===t.key||89===t.which)},t.isSaveKey=function(t){return t.ctrlKey&&!t.shiftKey&&("s"===t.key||83===t.which)},t.isSaveAsKey=function(t){return t.ctrlKey&&t.shiftKey&&("S"===t.key||83===t.which)},t.isDeleteKey=function(t){return"Delete"===t.key||46===t.which},t.isSelectAllKey=function(t){return t.ctrlKey&&!t.shiftKey&&("a"===t.key||65===t.which)},t.isOkKey=function(t){return"Enter"===t.key||13===t.which},t.getFocusDirection=function(t){return!0!==t.shiftKey},t.toShortcut=function(t){if(at(t)){var n,i=t,r=i.indexOf("->"),e=void 0;0<=r?(e=i.substring(0,r).trim(),n=i.substring(r+2).trim()):e=i.trim();var u=e.toLowerCase().split("+");return function(t){var n=t.key;if(n.length<=1){t.shift&&(t.key=n.toUpperCase());var i=n.charCodeAt(0);t.which=97<=i&&i<=122?i-32:i}else switch(n){case"Enter":t.which=13;break;case"Space":t.key=" ",t.which=32;break;case"Escape":t.which=27;break;case"F1":t.which=112;break;case"F2":t.which=113;break;case"F3":t.which=114;break;case"F4":t.which=115;break;case"F5":t.which=116;break;case"F6":t.which=117;break;case"F7":t.which=118;break;case"F8":t.which=119;break;case"F9":t.which=120;break;case"F10":t.which=121;break;case"F11":t.which=122;break;case"F12":t.which=123;break;case"CapsLock":t.shift?t.which=20:t.which=240;break;case"ArrowUp":t.which=38;break;case"ArrowDown":t.which=40;break;case"ArrowLeft":t.which=37;break;case"ArrowRight":t.which=39;break;case"Insert":t.which=45;break;case"Delete":t.which=46;break;case"PageUp":t.which=33;break;case"PageDown":t.which=34;break;case"Backspace":t.which=8;break;case";":t.which=187;break;case"Pause":t.which=19;break;case"ScrollLock":t.which=145;break;case"Tab":t.which=9}return t}({alt:0<=u.indexOf("alt"),ctrl:0<=u.indexOf("ctrl"),shift:0<=u.indexOf("shift"),key:u[u.length-1],which:0,event:n})}return t},t.toString=function(t){var n=[];return t.ctrl&&n.push("Ctrl"),t.shift&&n.push("Shift"),t.alt&&n.push("Alt"),n.push(t.key.toUpperCase()),n.join("+")},t.on=function(t,n,i){var r=this.toShortcut(n);document.body.addEventListener("keydown",(function(n){n.altKey!==r.alt||n.ctrlKey!==r.ctrl||n.shiftKey!==r.shift||n.key!==r.key&&n.which!==r.which||(t.state.isActionable&&(null!=r.event?t.emit(r.event):null!=i&&i(n)),n.preventDefault())}))},t.moveFocusVertically=function(n,i,r){if(i.state.isActionable){var e=t.isArrowUpKey(n),u=t.isArrowDownKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocusHorizontally=function(n,i,r){if(i.state.isActionable){var e=t.isArrowLeftKey(n),u=t.isArrowRightKey(n);if(e||u)return this.moveFocus(u,i,r)}return!1},t.moveFocus=function(t,n,i){var r,e=null!==(r=null==i?void 0:i.picked)&&void 0!==r?r:rt.getLayer(n);if(e){var u=e.getFocusController(),s=u.get();if(null!=s){var h=u.find(s,!1,s.state.isFocusRoot||t,t,n);if(null!=h)return u.focus(h),!0}}return!1},t}(),Yt={NONE:0,POSITION_X:1,POSITION_Y:2,POSITION:3,ROTATION:4,COLOR_FILL:8,COLOR_STROKE:16,COLOR_FILL_AND_STROKE:24,COLOR_TEXT:32,COLOR_TEXT_OUTLINE:64,COLOR:120,VISIBILITY:128,HEIGHT:256,WIDTH:512,SIZE:768,TEXT:1024,CURSOR:2048},Jt=function(){function n(n){var i=n.transform,r=i.position;this.x=r.x,this.y=r.y;var e=n.size;this.size=new t.Point(e.x,e.y),this.rotation=i.rotation,this.actions=[],this.fill=n.fill.toObject(),this.stroke=n.stroke.toObject(),this.text=n.text.toObject(),this.cursor=n.cursor,this.reset=Yt.NONE,this.written=Yt.NONE,this.effect=NaN,this.isStateChanged=!1,this.interactive=!1}return n.prototype.initialize=function(t){t.disallowUploadedUpdate(),this.onInitialize(t),t.allowUploadedUpdate()},n.prototype.onInitialize=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].initialize(t,this)},n.prototype.isActionable=function(){return 0<this.actions.length},n.prototype.onClick=function(t,n){var i=t.state;i.isActionable&&(i.isClicked=!0)},n.prototype.onDblClick=function(t,n,i){for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onDblClick(t,this,n,i);return!1},n.prototype.onOver=function(t,n){t.state.isHovered=!0},n.prototype.onOut=function(t,n){t.state.isHovered=!1},n.prototype.onDown=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onDowning(t,this,n);if(!t.state.isDown){t.state.addAll(lt.DOWN,ht.PRESSED);var u=rt.getLayer(t);if(u){var s=u.getFocusController();s.focus(s.findParent(t))}}for(r=0,e=i.length;r<e;++r)i[r].onDown(t,this,n)},n.prototype.onUp=function(t,n){var i=t.state;i.isUp||i.set(lt.UP,ht.PRESSED)},n.prototype.onUpOutside=function(t,n){t.state.isPressed=!1},n.prototype.onMove=function(t,n){for(var i=this.actions,r=0,e=i.length;r<e;++r)i[r].onMove(t,this,n)},n.prototype.onKeyDown=function(t,n){return Kt.isActivateKey(n)&&this.onDown(t,n),!1},n.prototype.onKeyUp=function(t,n){if(Kt.isActivateKey(n)){var i=t.state;if(i.isPressed){var r=i.isUp;this.onUp(t,n),!r&&i.isUp&&this.onClick(t,n)}}return!1},n.prototype.onStateChange=function(t,n,i){this.isStateChanged=!0,rt.update(t),n.isFocused?i.isFocused||this.onFocus(t):i.isFocused&&this.onBlur(t)},n.prototype.onFocus=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onFocus(t,this)},n.prototype.onBlur=function(t){for(var n=this.actions,i=0,r=n.length;i<r;++i)n[i].onBlur(t,this)},n.prototype.update=function(t,n){var i=t.data,r=this.effect<=n;(i.isChanged||this.isStateChanged||r)&&(r&&(this.effect=NaN),t.disallowUploadedUpdate(),this.onUpdate(t,n),t.allowUploadedUpdate(),t.state.removeAll(lt.CLICKED,lt.DOWN,lt.UP,lt.ACTIVATED,lt.DEACTIVATED),this.isStateChanged=!1,i.isChanged=!1)},n.prototype.onRender=function(t,n,i){for(var r=this.actions,e=0,u=r.length;e<u;++e)r[e].onRender(t,this,n,i);this.update(t,n)},n.prototype.onUpdate=function(t,n){var i=this.actions;if(0<i.length){this.written=Yt.NONE;for(var r=0,e=i.length;r<e;++r)i[r].execute(t,this,n);this.doReset(t)}},n.prototype.doReset=function(t){var n=~this.written&this.reset;if(n!==Yt.NONE){if(n&Yt.POSITION_X&&(t.transform.position.x=this.x),n&Yt.POSITION_Y&&(t.transform.position.y=this.y),n&Yt.VISIBILITY&&(t.visible=!0),n&Yt.COLOR_FILL){var i=this.fill;t.fill.set(void 0,i.color,i.alpha)}if(n&Yt.COLOR_STROKE){var r=this.stroke;t.stroke.set(void 0,r.color,r.alpha)}if(n&Yt.COLOR_TEXT){var e=this.text;t.text.set(void 0,e.color,e.alpha)}if(n&Yt.COLOR_TEXT_OUTLINE){var u=this.text.outline;t.text.outline.set(void 0,u.color,u.alpha)}n&Yt.HEIGHT&&(t.size.y=this.size.y),n&Yt.WIDTH&&(t.size.x=this.size.x),n&Yt.ROTATION&&(t.transform.rotation=this.rotation),n&Yt.TEXT&&(t.text.value=this.text.value),n&Yt.CURSOR&&(t.cursor=this.cursor)}},n}(),Zt=function(){function t(){}return t.toBaseFill=function(t,n){return(n.written&Yt.COLOR_FILL?t:n).fill},t.toBaseStroke=function(t,n){return(n.written&Yt.COLOR_STROKE?t:n).stroke},t.toBaseText=function(t,n){return(n.written&Yt.COLOR_TEXT?t:n).text},t.toBaseTextOutline=function(t,n){return(n.written&Yt.COLOR_TEXT_OUTLINE?t:n).text.outline},t}(),qt=function(){function t(){}return t.from=function(t,n,i,r,e,u){if(t.trim().length<=0)return i;try{var s="try{with( shape ) {with( state ) {"+(e?"var result = ("+t+");return (result != null ? "+n+"(result) : null);":"return "+n+"("+t+");")+"}}} catch( e ) {return "+r+";}";return null==u?Function("shape","time",s):Function("shape","time",u,s)}catch(t){return i}},t.ofNumberOrNull=function(t){return this.from(t,"Number",this.NULL,"null",!0)},t.ofStringOrNull=function(t){return this.from(t,"String",this.NULL,"null",!0)},t.ofUnknown=function(t){return this.from(t,"",this.NULL,"null",!1)},t.ofNumber=function(t){return this.from(t,"Number",this.ZERO,"0",!1)},t.ofNumberOrOne=function(t){return this.from(t,"Number",this.ONE,"1",!1)},t.ofNumberOrOneHundred=function(t){return this.from(t,"Number",this.ONE_HUNDRED,"100",!1)},t.ofString=function(t){return this.from(t,"String",this.EMPTY,'""',!1)},t.ofBoolean=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrTrue=function(t){return this.from(t,"Boolean",this.TRUE,"true",!1)},t.ofBooleanOrFalse=function(t){return this.from(t,"Boolean",this.FALSE,"false",!1)},t.ofElementOrNull=function(t){return this.from(t,"",void 0,"null",!1,"container")},t.NULL=function(){return null},t.ZERO=function(){return 0},t.ONE=function(){return 1},t.ONE_HUNDRED=function(){return 100},t.EMPTY=function(){return""},t.TRUE=function(){return!0},t.FALSE=function(){return!1},t}(),$t=function(){function t(t){this.reset=t||Yt.NONE}return t.prototype.initialize=function(t,n){},t.prototype.execute=function(t,n,i){},t.prototype.onFocus=function(t,n){},t.prototype.onBlur=function(t,n){},t.prototype.onDowning=function(t,n,i){},t.prototype.onDown=function(t,n,i){},t.prototype.onMove=function(t,n,i){},t.prototype.onDblClick=function(t,n,i,r){},t.prototype.onRender=function(t,n,i,r){},t}(),Qt=function(t){function n(n,i){var r=t.call(this,i)||this;return r.condition=qt.ofBoolean(n.condition),r}return _(n,t),n}($t),tn=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.interval=n.interval,r}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.interval,e=r<<1,u=i%e;u<r?(this.toOff(t,n),n.effect=i+(r-u)):(this.toOn(t,n),n.effect=i+(e-u))}},n.prototype.toOn=function(t,n){},n.prototype.toOff=function(t,n){},n}(Qt),nn=function(t){function n(n){return t.call(this,n,Yt.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=Zt.toBaseFill(t,n);t.fill.set(void 0,wt.brighten(i.color,.5),i.alpha);var r=Zt.toBaseStroke(t,n);t.stroke.set(void 0,wt.brighten(r.color,.5),r.alpha);var e=Zt.toBaseText(t,n);t.text.set(void 0,wt.brighten(e.color,.5),e.alpha);var u=Zt.toBaseTextOutline(t,n);t.text.outline.set(void 0,wt.brighten(u.color,.5),u.alpha),n.written|=this.reset},n}(tn),rn=function(t){function n(n){var i=t.call(this,n,Yt.COLOR_FILL)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.fill.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(tn),en=function(t){function n(n){var i=t.call(this,n,Yt.COLOR_STROKE)||this;return i.color=n.color,i.alpha=n.alpha,i}return _(n,t),n.prototype.toOn=function(t,n){t.stroke.set(void 0,this.color,this.alpha),n.written|=this.reset},n}(tn),un=function(t){function n(n){return t.call(this,n,Yt.COLOR)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=Zt.toBaseFill(t,n);t.fill.set(void 0,wt.darken(i.color,.5),i.alpha);var r=Zt.toBaseStroke(t,n);t.stroke.set(void 0,wt.darken(r.color,.5),r.alpha);var e=Zt.toBaseText(t,n);t.text.set(void 0,wt.darken(e.color,.5),e.alpha);var u=Zt.toBaseTextOutline(t,n);t.text.outline.set(void 0,wt.darken(u.color,.5),u.alpha),n.written|=this.reset},n}(tn),sn=function(t){function n(n){return t.call(this,n,Yt.COLOR_FILL_AND_STROKE)||this}return _(n,t),n.prototype.toOn=function(t,n){var i=Zt.toBaseFill(t,n);t.fill.set(void 0,i.color,.5*i.alpha);var r=Zt.toBaseStroke(t,n);t.stroke.set(void 0,r.color,.5*r.alpha),n.written|=this.reset},n}(tn),hn=function(t){function n(n){return t.call(this,n,Yt.VISIBILITY)||this}return _(n,t),n.prototype.toOn=function(t,n){t.visible=!0,n.written|=this.reset},n.prototype.toOff=function(t,n){t.visible=!1,n.written|=this.reset},n}(tn),on={VISIBILITY:0,BRIGHTEN:1,DARKEN:2,OPACITY:3,COLOR_FILL:4,COLOR_STROKE:5},an=function(){function t(t,n){this.type=t,this.condition=n}return t.prototype.isEquals=function(t){return this.type===t.type&&this.condition===t.condition},t.prototype.toLabel=function(){return K.getInstance().get("EShapeActionValue").toLabel(this)},t}(),cn=function(t){function n(n,i,r){var e=t.call(this,n,i)||this;return e.subtype=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.subtype===i.subtype},n}(an),fn={SHOW_HIDE:0,BLINK:1,TRANSFORM:2,OPEN:3,EMIT_EVENT:4,CHANGE_COLOR_LEGACY:5,CHANGE_TEXT:6,CHANGE_CURSOR:7,MISC:8,CHANGE_COLOR:9},ln=function(){function t(){}return t.toResource=function(t,n,i){if(0<=t&&t<n.length){var r=n[t];if(Xt(r)&&0<=r&&r<i.length)return i[r]}return""},t}(),vn=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.BLINK,i,n)||this;return s.interval=r,s.color=e,s.alpha=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.interval===i.interval&&this.color===i.color&&this.alpha===i.alpha},n.prototype.toRuntime=function(){switch(this.subtype){case on.BRIGHTEN:return new nn(this);case on.COLOR_FILL:return new rn(this);case on.COLOR_STROKE:return new en(this);case on.DARKEN:return new un(this);case on.OPACITY:return new sn(this);case on.VISIBILITY:return new hn(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.interval+","+this.color+","+this.alpha+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources);return new n(t[2],r,t[3],t[4],t[5])},n}(cn),bn=function(){function t(){}return t.blend=function(t,n,i){var r=Math.max(0,Math.min(1,i));return Math.max(0,Math.min(1,t*(1-r)+n*r))},t}(),dn=function(t){function n(n){return t.call(this,n,n.subtype<<3)||this}return _(n,t),n.prototype.set=function(t,n,i,r,e,u){var s=this.reset;if(null!=r){if(null!=e)if(null!=u){if(s&Yt.COLOR_FILL){var h=Zt.toBaseFill(t,n);t.fill.set(void 0,wt.blend(h.color,r,u),bn.blend(h.alpha,e,u))}s&Yt.COLOR_STROKE&&(h=Zt.toBaseStroke(t,n),t.stroke.set(void 0,wt.blend(h.color,r,u),bn.blend(h.alpha,e,u))),s&Yt.COLOR_TEXT&&(h=Zt.toBaseText(t,n),t.text.set(void 0,wt.blend(h.color,r,u),bn.blend(h.alpha,e,u))),s&Yt.COLOR_TEXT_OUTLINE&&(h=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,wt.blend(h.color,r,u),bn.blend(h.alpha,e,u)))}else s&Yt.COLOR_FILL&&t.fill.set(void 0,r,e),s&Yt.COLOR_STROKE&&t.stroke.set(void 0,r,e),s&Yt.COLOR_TEXT&&t.text.set(void 0,r,e),s&Yt.COLOR_TEXT_OUTLINE&&t.text.outline.set(void 0,r,e);else null!=u?(s&Yt.COLOR_FILL&&(h=Zt.toBaseFill(t,n),t.fill.set(void 0,wt.blend(h.color,r,u),h.alpha)),s&Yt.COLOR_STROKE&&(h=Zt.toBaseStroke(t,n),t.stroke.set(void 0,wt.blend(h.color,r,u),h.alpha)),s&Yt.COLOR_TEXT&&(h=Zt.toBaseText(t,n),t.text.set(void 0,wt.blend(h.color,r,u),h.alpha)),s&Yt.COLOR_TEXT_OUTLINE&&(h=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,wt.blend(h.color,r,u),h.alpha))):(s&Yt.COLOR_FILL&&(h=Zt.toBaseFill(t,n),t.fill.set(void 0,r,h.alpha)),s&Yt.COLOR_STROKE&&(h=Zt.toBaseStroke(t,n),t.stroke.set(void 0,r,h.alpha)),s&Yt.COLOR_TEXT&&(h=Zt.toBaseText(t,n),t.text.set(void 0,r,h.alpha)),s&Yt.COLOR_TEXT_OUTLINE&&(h=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,r,h.alpha)));n.written|=s}else null!=e&&(null!=u?(s&Yt.COLOR_FILL&&(h=Zt.toBaseFill(t,n),t.fill.set(void 0,h.color,bn.blend(h.alpha,e,u))),s&Yt.COLOR_STROKE&&(h=Zt.toBaseStroke(t,n),t.stroke.set(void 0,h.color,bn.blend(h.alpha,e,u))),s&Yt.COLOR_TEXT&&(h=Zt.toBaseText(t,n),t.text.set(void 0,h.color,bn.blend(h.alpha,e,u))),s&Yt.COLOR_TEXT_OUTLINE&&(h=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,bn.blend(h.alpha,e,u)))):(s&Yt.COLOR_FILL&&(h=Zt.toBaseFill(t,n),t.fill.set(void 0,h.color,e)),s&Yt.COLOR_STROKE&&(h=Zt.toBaseStroke(t,n),t.stroke.set(void 0,h.color,e)),s&Yt.COLOR_TEXT&&(h=Zt.toBaseText(t,n),t.text.set(void 0,h.color,e)),s&Yt.COLOR_TEXT_OUTLINE&&(h=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,h.color,e))),n.written|=s)},n}(Qt),gn={COLOR_AND_ALPHA:0,COLOR:1,ALPHA:2,CODE:3,BRIGHTNESS:4},mn=function(t){function n(n){var i=t.call(this,n)||this;switch(n.target){case gn.COLOR:i.color=n.color,i.alpha=null;break;case gn.ALPHA:i.color=null,i.alpha=n.alpha;break;default:i.color=n.color,i.alpha=n.alpha}return i.blend=qt.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.color,e=this.alpha,u=this.blend(t,i);this.set(t,n,i,r,e,u)}},n}(dn),wn={NONE:0,FILL:1,STROKE:2,TEXT:4,TEXT_OUTLINE:8,FILL_AND_STROKE:3,ALL:15},pn={FILL:0,STROKE:1,FILL_AND_STROKE:2,TEXT:3,TEXT_OUTLINE:4,ALL:5},On=function(){function t(){}return t.from=function(t){if(t[0]===fn.CHANGE_COLOR)return t[2];switch(t[2]){case pn.FILL:return wn.FILL;case pn.STROKE:return wn.STROKE;case pn.FILL_AND_STROKE:return wn.FILL_AND_STROKE;case pn.TEXT:return wn.TEXT;case pn.TEXT_OUTLINE:return wn.TEXT_OUTLINE;case pn.ALL:return wn.ALL}},t.unpack=function(t){var n=[];return t&wn.FILL&&n.push(wn.FILL),t&wn.STROKE&&n.push(wn.STROKE),t&wn.TEXT&&n.push(wn.TEXT),t&wn.TEXT_OUTLINE&&n.push(wn.TEXT_OUTLINE),n},t.pack=function(t){for(var n=wn.NONE,i=0,r=t.length;i<r;++i)n|=t[i];return n},t}(),Dn=function(t){function n(n,i,r,e,u,s){var h=t.call(this,fn.CHANGE_COLOR,i,n)||this;return h.target=r,h.color=e,h.alpha=u,h.blend=s,h}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new mn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.blend);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.target+","+this.color+","+this.alpha+","+i+"]")},n.deserialize=function(t,i){var r=On.from(t),e=ln.toResource(1,t,i.resources),u=ln.toResource(6,t,i.resources);return new n(r,e,t[3],t[4],t[5],u)},n}(cn),En=function(t){function n(n){var i=t.call(this,n)||this;return i.brightness=qt.ofNumberOrNull(n.brightness),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.brightness(t,i);this.set(t,n,i,r)}},n.prototype.set=function(t,n,i,r){var e=this.reset;if(null!=r){var u=this.toAdjusted;if(e&Yt.COLOR_FILL){var s=Zt.toBaseFill(t,n);t.fill.set(void 0,u(s.color,r),s.alpha)}e&Yt.COLOR_STROKE&&(s=Zt.toBaseStroke(t,n),t.stroke.set(void 0,u(s.color,r),s.alpha)),e&Yt.COLOR_TEXT&&(s=Zt.toBaseText(t,n),t.text.set(void 0,u(s.color,r),s.alpha)),e&Yt.COLOR_TEXT_OUTLINE&&(s=Zt.toBaseTextOutline(t,n),t.text.outline.set(void 0,u(s.color,r),s.alpha)),n.written|=e}},n.prototype.toAdjusted=function(t,n){return 0<=n?wt.brighten(t,+n):wt.darken(t,-n)},n}(dn),Mn=function(t){function n(n,i,r){var e=t.call(this,fn.CHANGE_COLOR,i,n)||this;return e.brightness=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.brightness===i.brightness},n.prototype.toRuntime=function(){return new En(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=gn.BRIGHTNESS,r=t.addResource(this.brightness);return t.addResource("["+this.type+","+n+","+this.subtype+","+i+","+r+"]")},n.deserialize=function(t,i){return new n(On.from(t),ln.toResource(1,t,i.resources),ln.toResource(4,t,i.resources))},n}(cn),Sn=function(t){function n(n){var i=t.call(this,n)||this;return i.color=qt.ofNumberOrNull(n.color),i.alpha=qt.ofNumberOrNull(n.alpha),i.blend=qt.ofNumberOrNull(n.blend),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.color(t,i),e=this.alpha(t,i),u=this.blend(t,i);this.set(t,n,i,r,e,u)}},n}(dn),Tn=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.CHANGE_COLOR,i,n)||this;return s.color=r,s.alpha=e,s.blend=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.color===i.color&&this.alpha===i.alpha&&this.blend===i.blend},n.prototype.toRuntime=function(){return new Sn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=gn.CODE,r=t.addResource(this.color),e=t.addResource(this.alpha),u=t.addResource(this.blend);return t.addResource("["+this.type+","+n+","+this.subtype+","+i+","+r+","+e+","+u+"]")},n.deserialize=function(t,i){return new n(On.from(t),ln.toResource(1,t,i.resources),ln.toResource(4,t,i.resources),ln.toResource(5,t,i.resources),ln.toResource(6,t,i.resources))},n}(cn),jn=function(t){function n(n){var i=t.call(this,n,Yt.CURSOR)||this;return i.name=qt.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.name(t,i);null!=r&&(t.cursor=r,n.written|=this.reset)}},n}(Qt),Nn=function(t){function n(n,i){var r=t.call(this,fn.CHANGE_CURSOR,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new jn(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("["+this.type+","+n+","+i+"]")},n.deserialize=function(t,i){return new n(ln.toResource(1,t,i.resources),ln.toResource(2,t,i.resources))},n}(an),In=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"AM":"PM"},t}(),Cn=function(){function t(){}return t.prototype.format=function(t,n,i){return i.getHours()<12?"am":"pm"},t}(),An=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getDate())},t}(),Rn=function(){function t(){}return t.prototype.format=function(t,n,i){return""+(0|t)},t}(),yn=function(t){this.precision=null!=t?+t.substring(1,t.length):void 0},kn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toExponential(this.precision)},n}(yn),Ln=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toFixed(this.precision)},n}(yn),xn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){var r=this.toAbs(t,n,i);return r<1e-24?this.Wt(t,1,""):r<1e-21?this.Wt(t,1e24,"y"):r<1e-18?this.Wt(t,1e21,"z"):r<1e-15?this.Wt(t,1e18,"a"):r<1e-12?this.Wt(t,1e15,"f"):r<1e-9?this.Wt(t,1e12,"p"):r<1e-6?this.Wt(t,1e9,"n"):r<.001?this.Wt(t,1e6,"μ"):r<1?this.Wt(t,1e3,"m"):r<1e3?this.Wt(t,1,""):r<1e6?this.Wt(t,.001,"k"):r<1e9?this.Wt(t,1e-6,"M"):r<1e12?this.Wt(t,1e-9,"G"):r<1e15?this.Wt(t,1e-12,"T"):r<1e18?this.Wt(t,1e-15,"P"):r<1e21?this.Wt(t,1e-18,"E"):r<1e24?this.Wt(t,1e-21,"Z"):this.Wt(t,1e-24,"Y")},n.prototype.toAbs=function(t,n,i){return Math.abs(t)},n.prototype.Wt=function(t,n,i){return""+(t*n).toFixed(this.precision)+i},n}(yn),Bn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.format=function(t,n,i){return t.toPrecision(this.precision)},n}(yn),_n=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours())},t}(),Pn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getHours()%12)},t}(),Fn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMonth()+1)},t}(),Un=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMinutes())},t}(),Gn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getMilliseconds())},t}(),zn=function(){function t(){}return t.prototype.format=function(t,n,i){return(100*t|0)+"%"},t}(),Hn=function(){function t(){}return t.prototype.format=function(t,n,i){return(0|t)+"%"},t}(),Vn=function(){function t(t,n,i){this.length=t,this.character=n,this.node=i}return t.prototype.format=function(t,n,i){return mt(this.node.format(t,n,i),this.length,this.character)},t}(),Wn=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"===r[0]?"("+r.substring(1,r.length)+")":r},t}(),Xn=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?"+"+r:r},t}(),Kn=function(){function t(){}return t.prototype.format=function(t,n,i){return Math.round(100*t)+"%"},t}(),Yn=function(){function t(){}return t.prototype.format=function(t,n,i){return Math.round(t)+"%"},t}(),Jn=function(){function t(t,n,i,r,e,u,s){this.Y=t,this.M=n,this.D=i,this.H=r,this.m=e,this.s=u,this.mi=s}return t.prototype.format=function(t,n,i){return n<1e3?this.s.format(t,n,i)+"."+this.mi.format(t,n,i):n<6e4?this.m.format(t,n,i)+":"+this.s.format(t,n,i):n<36e5?this.H.format(t,n,i)+":"+this.m.format(t,n,i):n<864e5?this.M.format(t,n,i)+"/"+this.D.format(t,n,i)+" "+this.H.format(t,n,i):n<2592e6?this.M.format(t,n,i)+"/"+this.D.format(t,n,i):this.Y.format(t,n,i)+"/"+this.M.format(t,n,i)},t}(),Zn=function(){function t(t){this.node=t}return t.prototype.format=function(t,n,i){var r=this.node.format(t,n,i);return 0<r.length&&"-"!==r[0]?" "+r:r},t}(),qn=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toAbs=function(t,n,i){return Math.abs(n)},n}(xn),$n=function(){function t(t){this.str=t}return t.prototype.format=function(t,n,i){return this.str},t}(),Qn=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear())},t}(),ti=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getFullYear()%100)},t}(),ni=function(){function t(){}return t.prototype.format=function(t,n,i){var r=i.getTimezoneOffset();return(r<=0?"+":"-")+mt(String(Math.floor(Math.abs(r)/60)),2,"0")+":"+mt(String(Math.floor(Math.abs(r)%60)),2,"0")},t}(),ii=function(){function t(){}return t.prototype.format=function(t,n,i){return""+Math.round(t)},t}(),ri=function(){function t(){}return t.prototype.format=function(t,n,i){return String(i.getSeconds())},t}(),ei=void 0,ui=function(t,n,i){switch(t){case"_":return new Vn(n," ",i);case"-":return i;default:return new Vn(n,"0",i)}},si=function(t,n){switch(t){case"_":return new Zn(n);case"+":return new Xn(n);case"(":return new Wn(n);default:return n}},hi=function(){function t(t){var n=function(t){for(var n=0,i=!1,r=[],e=function(){var t=ei;return t?t.lastIndex=0:ei=t=/%(0|_|-|\+|\()?(\.\d+)?(Y(?:MD?)?|y(?:MD?)?|MD?|D|H(?:ms?)?|h(?:ms?)?|m(?:i|s)?|a|A|s(?:s?i|dt)?|z|%|f(?:si)?|e|g|d|r(?:d|p)|p|P|RP)/g,t}();;){var u=e.exec(t);if(null==u){n<t.length&&r.push(new $n(t.substring(n,t.length)));break}var s=u.index;n<s&&r.push(new $n(t.substring(n,s))),n=s+u[0].length;var h=u[0],o=u[1],a=u[2];switch(u[3]){case"Y":i=!0,r.push(new Qn);break;case"YM":i=!0,r.push(new Qn,new $n("/"),ui(o,2,new Fn));break;case"YMD":i=!0,r.push(new Qn,new $n("/"),ui(o,2,new Fn),new $n("/"),ui(o,2,new An));break;case"y":i=!0,r.push(ui(o,2,new ti));break;case"yM":i=!0,r.push(ui(o,2,new ti),new $n("/"),ui(o,2,new Fn));break;case"yMD":r.push(ui(o,2,new ti),new $n("/"),ui(o,2,new Fn),new $n("/"),ui(o,2,new An));break;case"M":i=!0,r.push(ui(o,2,new Fn));break;case"MD":i=!0,r.push(ui(o,2,new Fn),new $n("/"),ui(o,2,new An));break;case"D":i=!0,r.push(ui(o,2,new An));break;case"H":i=!0,r.push(ui(o,2,new _n));break;case"Hm":i=!0,r.push(ui(o,2,new _n),new $n(":"),ui(o,2,new Un));break;case"Hms":i=!0,r.push(ui(o,2,new _n),new $n(":"),ui(o,2,new Un),new $n(":"),ui(o,2,new ri));break;case"h":i=!0,r.push(ui(o,2,new Pn));break;case"hm":i=!0,r.push(ui(o,2,new Pn),new $n(":"),ui(o,2,new Un));break;case"hms":i=!0,r.push(ui(o,2,new Pn),new $n(":"),ui(o,2,new Un),new $n(":"),ui(o,2,new ri));break;case"m":i=!0,r.push(ui(o,2,new Un));break;case"ms":i=!0,r.push(ui(o,2,new Un),new $n(":"),ui(o,2,new ri));break;case"mi":i=!0,r.push(ui(o,3,new Gn));break;case"a":i=!0,r.push(new Cn);break;case"A":i=!0,r.push(new In);break;case"s":i=!0,r.push(ui(o,2,new ri));break;case"sdt":i=!0,r.push(new Jn(new Qn,ui(o,2,new Fn),ui(o,2,new An),ui(o,2,new _n),ui(o,2,new Un),ui(o,2,new ri),ui(o,3,new Gn)));break;case"z":i=!0,r.push(new ni);break;case"%":r.push(new $n("%"));break;case"f":r.push(si(o,new Ln(a)));break;case"e":r.push(si(o,new kn(a)));break;case"g":r.push(si(o,new Bn(a)));break;case"rd":r.push(si(o,new ii));break;case"d":r.push(si(o,new Rn));break;case"P":r.push(si(o,new zn));break;case"p":r.push(si(o,new Hn));break;case"RP":r.push(si(o,new Kn));break;case"rp":r.push(si(o,new Yn));break;case"fsi":r.push(si(o,new xn(a)));break;case"ssi":r.push(si(o,new qn(a)));break;default:r.push(new $n(h))}}return{nodes:r,date:i}}(t);this.date=n.date,this.nodes=n.nodes}return t.prototype.format=function(n,i){var r=this.nodes,e=t.DATE;null==e&&(e=new Date,t.DATE=e),this.date&&e.setTime(n);for(var u="",s=0,h=r.length;s<h;++s)u+=r[s].format(n,i,e);return u},t}(),oi=function(){function t(){}return t.create=function(t){return new hi(t)},t}(),ai=function(t){function n(n){var i=t.call(this,n,Yt.TEXT)||this;return i.number=qt.ofNumber(n.value),i.formatters=new Map,i}return _(n,t),n.prototype.getFormatter=function(t,n){var i=this.formatters,r=n.text.value,e=i.get(r);return void 0===e&&(e=this.newFormatter(r),i.set(r,e)),e},n.prototype.newFormatter=function(t){return 0<(t=t.trim()).length?oi.create(t):null},n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.number(t,i),e=this.getFormatter(t,n);t.text.value=null!=e?e.format(r,0):String(r),n.written|=this.reset}},n}(Qt),ci=function(t){function n(n){var i=t.call(this,n,Yt.TEXT)||this;return i.text=qt.ofString(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i)&&(t.text.value=this.text(t,i),n.written|=this.reset)},n}(Qt),fi={TEXT:0,NUMBER:1},li=function(t){function n(n,i,r){var e=t.call(this,fn.CHANGE_TEXT,i,n)||this;return e.value=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.value===i.value},n.prototype.toRuntime=function(){switch(this.subtype){case fi.TEXT:return new ci(this);case fi.NUMBER:return new ai(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.value);return t.addResource("["+this.type+","+n+","+this.subtype+","+i+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources),e=ln.toResource(3,t,i.resources);return new n(t[2],r,e)},n}(cn),vi=function(){function t(t,n,i){this.Xt=t,this.Kt=i;var r=null==n?void 0:n.background;r&&(this.T=r.color,this.j=r.alpha)}return t.prototype.getTheme=function(){return this.Xt},t.prototype.setTheme=function(t){this.Xt=t},t.prototype.getColor=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBackgroundColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.j;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBackgroundAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.Kt;null!=t&&t()},t}(),bi={NONE:0,TOP:1,RIGHT:2,BOTTOM:4,LEFT:8,TOP_RIGHT:3,TOP_BOTTOM:5,TOP_LEFT:9,RIGHT_BOTTOM:6,RIGHT_LEFT:10,BOTTOM_LEFT:12,NOT_TOP:14,NOT_RIGHT:13,NOT_BOTTOM:11,NOT_LEFT:7,ALL:15},di=function(t,n){return at(t)?n[t]:t},gi=function(){function t(t,n,i){this.Xt=t,this.Kt=i;var r=null==n?void 0:n.border;r&&(this.T=r.color,this.j=r.alpha,this.Mt=r.width,this.St=r.align,this.Yt=di(r.mask,bi))}return t.prototype.getTheme=function(){return this.Xt},t.prototype.setTheme=function(t){this.Xt=t},t.prototype.getColor=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBorderColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.j;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBorderAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.Mt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBorderWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.Mt},set:function(t){this.Mt!==t&&(this.Mt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.St;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBorderAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.St},set:function(t){this.St!==t&&(this.St=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.Yt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getBorderMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.Yt},set:function(t){this.Yt!==t&&(this.Yt=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){var t=this.Kt;null!=t&&t()},t}(),mi={NONE:0,TOP_LEFT:1,TOP_RIGHT:2,BOTTOM_LEFT:4,BOTTOM_RIGHT:8,TOP:3,BOTTOM:12,LEFT:5,RIGHT:10,ALL:15},wi=function(){function t(t,n,i){this.Xt=t,this.Kt=i;var r=null==n?void 0:n.corner;r&&(Xt(r)?(this.Ht=r,this.Yt=void 0):(this.Ht=r.radius,this.Yt=di(r.mask,mi)))}return t.prototype.getTheme=function(){return this.Xt},t.prototype.setTheme=function(t){this.Xt=t},t.prototype.getRadius=function(){var t;return null!==(t=this.Ht)&&void 0!==t?t:this.Xt.getCornerRadius()},Object.defineProperty(t.prototype,"radius",{get:function(){return this.Ht},set:function(t){if(this.Ht!==t){this.Ht=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(){var t;return null!==(t=this.Yt)&&void 0!==t?t:this.Xt.getCornerMask()},Object.defineProperty(t.prototype,"mask",{get:function(){return this.Yt},set:function(t){if(this.Yt!==t){this.Yt=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;this.Ht!==t&&(this.Ht=t,i=!0),this.Yt!==n&&(this.Yt=n,i=!0);var r=this.Kt;i&&null!=r&&r()},t}(),pi={NONE:0,SELF:1,CHILDREN:2,BOTH:3},Oi=function(){function t(t,n,i){this.Xt=t,this.Kt=i;var r=null==n?void 0:n.outline;r&&(this.T=r.color,this.j=r.alpha,this.Mt=r.width,this.Jt=r.offset,this.St=r.align,this.Yt=di(r.mask,bi))}return t.prototype.getTheme=function(){return this.Xt},t.prototype.setTheme=function(t){this.Xt=t},t.prototype.getColor=function(t){var n=this.T;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineColor(t)},Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){if(this.T!==t){this.T=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){var n=this.j;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){if(this.j!==t){this.j=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getWidth=function(t){var n=this.Mt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineWidth(t)},Object.defineProperty(t.prototype,"width",{get:function(){return this.Mt},set:function(t){if(this.Mt!==t){this.Mt=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getOffset=function(t){var n=this.Jt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineOffset(t)},Object.defineProperty(t.prototype,"offset",{get:function(){return this.Jt},set:function(t){if(this.Jt!==t){this.Jt=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getAlign=function(t){var n=this.St;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineAlign(t)},Object.defineProperty(t.prototype,"align",{get:function(){return this.St},set:function(t){if(this.St!==t){this.St=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t.prototype.getMask=function(t){var n=this.Yt;if(void 0!==n){if(!ot(n))return n;var i=n(t);if(void 0!==i)return i}return this.Xt.getOutlineMask(t)},Object.defineProperty(t.prototype,"mask",{get:function(){return this.Yt},set:function(t){if(this.Yt!==t){this.Yt=t;var n=this.Kt;null!=n&&n()}},enumerable:!1,configurable:!0}),t}(),Di=function(){function t(t,n,i){this.Xt=t,this.Kt=i;var r=null==n?void 0:n.padding;null!=r&&(Xt(r)?(this.Zt=r,this.qt=r,this.$t=r,this.Qt=r):(this.Zt=r.left,this.qt=r.top,this.$t=r.right,this.Qt=r.bottom))}return t.prototype.getTheme=function(){return this.Xt},t.prototype.setTheme=function(t){this.Xt=t},t.prototype.getCallback=function(){return this.Kt},t.prototype.getLeft=function(){var t;return null!==(t=this.Zt)&&void 0!==t?t:this.Xt.getPaddingLeft()},Object.defineProperty(t.prototype,"left",{get:function(){return this.Zt},set:function(t){this.Zt!==t&&(this.Zt=t,null!=this.Kt&&this.Kt())},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){var t;return null!==(t=this.qt)&&void 0!==t?t:this.Xt.getPaddingTop()},Object.defineProperty(t.prototype,"top",{get:function(){return this.qt},set:function(t){this.qt!==t&&(this.qt=t,null!=this.Kt&&this.Kt())},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){var t;return null!==(t=this.$t)&&void 0!==t?t:this.Xt.getPaddingRight()},Object.defineProperty(t.prototype,"right",{get:function(){return this.$t},set:function(t){this.$t!==t&&(this.$t=t,null!=this.Kt&&this.Kt())},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){var t;return null!==(t=this.Qt)&&void 0!==t?t:this.Xt.getPaddingBottom()},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.Qt},set:function(t){this.Qt!==t&&(this.Qt=t,null!=this.Kt&&this.Kt())},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r),null!=this.Kt&&this.Kt()},t}(),Ei=function(){function t(t,n){this.tn=t,this.q=n}return Object.defineProperty(t.prototype,"x",{get:function(){return this.tn.x},set:function(t){var n=this.tn,i=n.x;if(i!==t){n.x=t;var r=n.y;this.q(t,r,i,r)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this.tn.y},set:function(t){var n=this.tn,i=n.y;if(i!==t){n.y=t;var r=n.x;this.q(r,t,r,i)}},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=this.tn,r=i.x,e=i.y;return r===t&&e===n||(i.set(t,n),this.q(t,n,r,e)),this},t.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.tn,e=r.x,u=r.y;return e===n&&u===i||(r.copyFrom(t),this.q(n,i,e,u)),this},t.prototype.copyTo=function(t){return t.copyFrom(this.tn)},t.prototype.copy=function(){return this.copyFrom(arguments[0])},t.prototype.clone=function(n){return new t(this.tn,n||this.q)},t.prototype.equals=function(t){return this.tn.equals(t)},t}(),Mi=function(t){function n(n,i,r){var e=t.call(this,n,i,r)||this;return e.Mt=100,e.nn=100,e.rn=0,e.en=mi.NONE,e.un=!0,e.sn=1,e.hn=e.getBuffer("aVertexPosition"),e.an=e.hn.data,e.cn=e.getBuffer("aTextureCoord"),e._uvs=e.cn.data,e.fn=e.getIndex(),e.ln=e.fn.data,e}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.Mt},set:function(t){this.Mt!==t&&(this.Mt=t,this.un=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.nn},set:function(t){this.nn!==t&&(this.nn=t,this.un=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerRadius",{get:function(){return this.rn},set:function(t){this.rn!==t&&(this.rn=t,this.un=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cornerMask",{get:function(){return this.en},set:function(t){this.en!==t&&(this.en=t,this.un=!0)},enumerable:!1,configurable:!0}),n.prototype.getTables=function(){var t=n.TABLES;return null==t&&(t=this.newTables(n.N),n.TABLES=t),t},n.prototype.newTables=function(t){var n=1/(t-1)*.5;return[this.newTable(t,1,n),this.newTable(t,.5,n),this.newTable(t,0,n),this.newTable(t,1.5,n)]},n.prototype.newTable=function(t,n,i){for(var r=[],e=[],u=Math.PI,s=0,h=n;s<t;s+=1,h-=i){var o=h*u,a=+Math.cos(o),c=-Math.sin(o);r.push(a),e.push(c)}return{cos:r,sin:e}},n.N=4,n}(t.MeshGeometry),Si=function(t){function n(){return t.call(this,new Float32Array(16*Mi.N),new Float32Array(16*Mi.N),new Uint16Array(3*(12*Mi.N-2)))||this}return _(n,t),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a){for(var c=a.cos,f=a.sin,l=c[0],v=f[0],b=c[e-1],d=f[e-1],g=0;g<e;++g){var m=c[g],w=f[g],p=o,O=m*l+w*v;1e-4<O&&(p=Math.min(p,(1/O-1)*h));var D=m*b+w*d;1e-4<D&&(p=Math.min(p,(1/D-1)*h));var E=h+p;t[++i]=u+m*h,t[++i]=s+w*h,t[++i]=u+m*E,t[++i]=s+w*E,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+m),n[++r]=.5*(1+w)}},n.prototype.fillIndices=function(t,n,i,r){for(var e=0;e<r;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2},n.prototype.fillIndicesEnd=function(t,n,i,r){for(var e=0,u=r-1;e<u;++e)t[++i]=n+0,t[++i]=n+1,t[++i]=n+2,t[++i]=n+2,t[++i]=n+1,t[++i]=n+3,n+=2;t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=2},n.prototype.update=function(t){var n=t.resolution;if(this.un||this.sn!==n){this.un=!1,this.sn=n;var i=this.an,r=this._uvs,e=this.ln,u=this.Mt,s=this.nn,h=Math.min(.5*u,.5*s,this.rn),o=1/n,a=h,c=u-h,f=u,l=h,v=s-h,b=s,d=this.en,g=!(d&mi.TOP_LEFT),m=!(d&mi.TOP_RIGHT),w=!(d&mi.BOTTOM_LEFT),p=!(d&mi.BOTTOM_RIGHT),O=-1,D=-1,E=0,M=-1,S=Mi.N,T=S<<2,j=S<<1,N=6*S,I=this.getTables(),C=I[0],A=I[1],R=I[2],y=I[3];g?this.fillVertices(i,r,O,D,S,a,l,h,o,C):this.fillVertices(i,r,O,D,S,0,0,0,0,C),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,m?this.fillVertices(i,r,O,D,S,c,l,h,o,A):this.fillVertices(i,r,O,D,S,f,0,0,0,A),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,p?this.fillVertices(i,r,O,D,S,c,v,h,o,R):this.fillVertices(i,r,O,D,S,f,b,0,0,R),this.fillIndices(e,E,M,S),O+=T,D+=T,E+=j,M+=N,w?this.fillVertices(i,r,O,D,S,a,v,h,o,y):this.fillVertices(i,r,O,D,S,0,b,0,0,y),this.fillIndicesEnd(e,E,M,S),O+=T,D+=T,E+=j,M+=N,E=2;for(var k=1,L=4*S-1;k<L;k+=1,E+=2)e[++M]=0,e[++M]=E,e[++M]=E+2;this.hn.update(),this.cn.update(),this.fn.update()}},n}(Mi),Ti=function(n){function i(i){var r=n.call(this,new Si,new t.MeshMaterial(i))||this;return i.on("update",(function(){rt.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),ji=function(){function t(){}return t.prototype.get=function(t,n){var i=this.vn;return null==i&&((i=new Ti(n.getBackgroundTexture())).parent=t,this.vn=i),i},t.prototype.hide=function(){var t=this.vn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.background,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=this.get(t,r);c.tint=o,c.alpha=a,c.width=n,c.height=i,c.cornerRadius=u,c.cornerMask=s,c.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.vn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.vn)||void 0===t||t.updateTransform()},t}(),Ni=function(t){function n(){var n=t.call(this,new Float32Array(32*Mi.N),new Float32Array(32*Mi.N),new Uint16Array(72*Mi.N))||this;return n.bn=0,n.dn=bi.NONE,n}return _(n,t),Object.defineProperty(n.prototype,"borderWidth",{get:function(){return this.bn},set:function(t){this.bn!==t&&(this.bn=t,this.un=!0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"borderMask",{get:function(){return this.dn},set:function(t){this.dn!==t&&(this.dn=t,this.un=!0)},enumerable:!1,configurable:!0}),n.prototype.fillVertices=function(t,n,i,r,e,u,s,h,o,a,c){for(var f=.5*a,l=h-f,v=h+f,b=c.cos,d=c.sin,g=b[0],m=d[0],w=b[e-1],p=d[e-1],O=u+(g+w)*l,D=s+(m+p)*l,E=0;E<e;++E){var M=b[E],S=d[E],T=o,j=o,N=M*g+S*m;if(1e-4<N){var I=1/N-1;T=Math.min(T,I*l),j=Math.min(j,I*v)}var C=M*w+S*p;if(1e-4<C){var A=1/C-1;T=Math.min(T,A*l),j=Math.min(j,A*v)}var R=l+T,y=v+j;0<l?(t[++i]=u+M*l,t[++i]=s+S*l,t[++i]=u+M*R,t[++i]=s+S*R):(t[++i]=O,t[++i]=D,t[++i]=O,t[++i]=D),t[++i]=u+M*v,t[++i]=s+S*v,t[++i]=u+M*y,t[++i]=s+S*y,n[++r]=.5*(1+M),n[++r]=.5*(1+S),n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5,n[++r]=.5*(1+M),n[++r]=.5*(1+S)}},n.prototype.fillIndices=function(t,n,i,r,e,u){for(var s=0,h=r-1;s<h;++s)t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2;e?u?(t[++i]=n+0,t[++i]=n+1,t[++i]=0,t[++i]=0,t[++i]=n+1,t[++i]=1,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=1,t[++i]=1,t[++i]=n+1,t[++i]=2,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=2,t[++i]=2,t[++i]=n+1,t[++i]=3,n+=2):(t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=1,t[++i]=n+0,t[++i]=n+1,t[++i]=n+4,t[++i]=n+4,t[++i]=n+1,t[++i]=n+5,n+=2):(t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=1,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,t[++i]=n,n+=2)},n.prototype.update=function(t){var n=t.resolution;if(this.un||this.sn!==n){this.un=!1,this.sn=n;var i=this.an,r=this._uvs,e=this.ln,u=this.Mt,s=this.nn,h=this.bn,o=Math.min(.5*u,.5*s,this.rn),a=1/n,c=o,f=u-o,l=u,v=o,b=s-o,d=s,g=this.dn,m=!(g&bi.TOP),w=!(g&bi.BOTTOM),p=!(g&bi.LEFT),O=!(g&bi.RIGHT),D=this.en,E=!(D&mi.TOP_LEFT),M=!(D&mi.TOP_RIGHT),S=!(D&mi.BOTTOM_LEFT),T=!(D&mi.BOTTOM_RIGHT),j=-1,N=-1,I=0,C=-1,A=Mi.N,R=A<<2,y=A<<3,k=18*A,L=this.getTables(),x=L[0],B=L[1],_=L[2],P=L[3];E?p||m?this.fillVertices(i,r,j,N,A,c,v,o,a,h,x):this.fillVertices(i,r,j,N,A,c,v,o,0,0,x):p||m?this.fillVertices(i,r,j,N,A,0,0,0,0,h,x):this.fillVertices(i,r,j,N,A,0,0,0,0,0,x),this.fillIndices(e,I,C,A,m,!1),j+=y,N+=y,I+=R,C+=k,M?m||O?this.fillVertices(i,r,j,N,A,f,v,o,a,h,B):this.fillVertices(i,r,j,N,A,f,v,o,0,0,B):m||O?this.fillVertices(i,r,j,N,A,l,0,0,0,h,B):this.fillVertices(i,r,j,N,A,l,0,0,0,0,B),this.fillIndices(e,I,C,A,O,!1),j+=y,N+=y,I+=R,C+=k,T?O||w?this.fillVertices(i,r,j,N,A,f,b,o,a,h,_):this.fillVertices(i,r,j,N,A,f,b,o,0,0,_):O||w?this.fillVertices(i,r,j,N,A,l,d,0,0,h,_):this.fillVertices(i,r,j,N,A,l,d,0,0,0,_),this.fillIndices(e,I,C,A,w,!1),j+=y,N+=y,I+=R,C+=k,S?w||p?this.fillVertices(i,r,j,N,A,c,b,o,a,h,P):this.fillVertices(i,r,j,N,A,c,b,o,0,0,P):w||p?this.fillVertices(i,r,j,N,A,0,d,0,0,h,P):this.fillVertices(i,r,j,N,A,0,d,0,0,0,P),this.fillIndices(e,I,C,A,p,!0),j+=y,N+=y,I+=R,C+=k,this.hn.update(),this.cn.update(),this.fn.update()}},n}(Mi),Ii=function(n){function i(i){var r=n.call(this,new Ni,new t.MeshMaterial(i))||this;return i.on("update",(function(){rt.update(r)})),r}return _(i,n),Object.defineProperty(i.prototype,"width",{get:function(){return this.geometry.width},set:function(t){this.geometry.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.geometry.height},set:function(t){this.geometry.height=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerRadius",{get:function(){return this.geometry.cornerRadius},set:function(t){this.geometry.cornerRadius=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"cornerMask",{get:function(){return this.geometry.cornerMask},set:function(t){this.geometry.cornerMask=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderWidth",{get:function(){return this.geometry.borderWidth},set:function(t){this.geometry.borderWidth=t},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"borderMask",{get:function(){return this.geometry.borderMask},set:function(t){this.geometry.borderMask=t},enumerable:!1,configurable:!0}),i.prototype._render=function(t){this.geometry.update(t),n.prototype._render.call(this,t)},i}(t.Mesh),Ci=function(){function t(){}return t.prototype.get=function(t,n){var i=this.vn;return null==i&&((i=new Ii(n.getBorderTexture())).parent=t,this.vn=i),i},t.prototype.hide=function(){var t=this.vn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.border,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.vn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.vn)||void 0===t||t.updateTransform()},t}(),Ai=function(){function t(){}return t.prototype.get=function(t,n){var i=this.vn;return null==i&&((i=new Ii(n.getBorderTexture())).parent=t,this.vn=i),i},t.prototype.hide=function(){var t=this.vn;null!=t&&(t.visible=!1)},t.prototype.onReflow=function(t,n,i,r,e,u,s){var h=t.outline,o=h.getColor(e);if(null!=o){var a=h.getAlpha(e);if(0<a){var c=h.getWidth(e),f=h.getMask(e),l=this.get(t,r),v=h.getOffset(e)+(h.getAlign(e)-.5)*c;l.tint=o,l.alpha=a,l.x=-v,l.y=-v,l.width=n+2*v,l.height=i+2*v,l.cornerRadius=u,l.cornerMask=s,l.borderWidth=c,l.borderMask=f,l.visible=!0}else this.hide()}else this.hide()},t.prototype.render=function(t){var n;null===(n=this.vn)||void 0===n||n.render(t)},t.prototype.updateTransform=function(){var t;null===(t=this.vn)||void 0===t||t.updateTransform()},t}(),Ri=function(){function t(t){var n=new ji;this.gn=n,t.snippet.add(n,!0);var i=new Ci;this.mn=i,t.snippet.add(i,!0);var r=new Ai;this.wn=r,t.snippet.add(r,!1),t.reflowable.add(this)}return t.prototype.onReflow=function(t,n,i){var r=t.theme,e=t.state,u=t.corner,s=u.getRadius(),h=u.getMask();this.gn.onReflow(t,n,i,r,e,s,h),this.mn.onReflow(t,n,i,r,e,s,h),this.wn.onReflow(t,n,i,r,e,s,h)},t}(),yi={NONE:0,BEFORE:1,AFTER:2,BOTH:3};!function(t){t[t.OPEN=0]="OPEN",t[t.CLOSE=1]="CLOSE",t[t.PARENSESIS=2]="PARENSESIS",t[t.ADD_OR_PLUS=3]="ADD_OR_PLUS",t[t.SUB_OR_MINUS=4]="SUB_OR_MINUS",t[t.PLUS=5]="PLUS",t[t.MINUS=6]="MINUS",t[t.ADD=7]="ADD",t[t.SUB=8]="SUB",t[t.MUL=9]="MUL",t[t.DIV=10]="DIV",t[t.MIN=11]="MIN",t[t.MAX=12]="MAX",t[t.COMMA=13]="COMMA",t[t.PARENT=14]="PARENT",t[t.SELF=15]="SELF",t[t.PADDING=16]="PADDING",t[t.CURRENT=17]="CURRENT",t[t.NUMBER=18]="NUMBER"}(F||(F={}));var ki,Li={"+":3,"-":4,"*":9,"/":10,"(":0,")":1,",":13,min:11,max:12},xi={"%":14,s:15,p:16,c:17},Bi=function(){function t(t){var n=this.toToken(t),i=0;do{i=this.toParensesis(n,i)}while(i<n.length);if(this.toUnary(n),this.toArithmetic(n,9,10),this.toArithmetic(n,7,8),1===n.length){var r=n[0];if(!Xt(r))return void(this.pn=r)}throw new Error("Failed to parse '"+t+"'")}return t.prototype.toParensesis=function(t,n){for(var i=t.length,r=n;r<i;++r)if(0===t[r]){var e=r,u=2;if(0<r){var s=t[r-1];11!==s&&12!==s||(e-=1,u=s)}for(var h=r+1;h<i;++h){var o=t[h];if(1===o)return t[e]=[u,this.toComma(t,r+1,h)],t.splice(e+1,h-e),e+1;0===o&&(h=this.toParensesis(t,h)-1,i=t.length)}throw new Error("Malformed parensesis")}return i},t.prototype.toCommaOf=function(t,n,i){var r=i-n;if(r<=0)return[18,0];if(r<=1)return t[n];for(var e=[],u=n;u<i;++u)e.push(t[u]);return[2,e]},t.prototype.toComma=function(t,n,i){for(var r=null,e=n,u=n;u<i;++u)13===t[u]&&((r=r||[]).push(this.toCommaOf(t,e,u)),e=u+1);if(e<i){if(null==r){var s=[];for(u=e;u<i;++u)s.push(t[u]);return s}r.push(this.toCommaOf(t,e,i))}return r||[]},t.prototype.toUnaryNode=function(t){Xt(t)||2!==t[0]&&11!==t[0]&&12!==t[0]||this.toUnary(t[1])},t.prototype.toUnary=function(t){for(var n=0,i=t.length;n<i;++n){var r=t[n];if(3===r||4===r)if(n<=0||Xt(t[n-1])){if(!(n+1<i)||Xt(t[n+1]))throw new Error("Malformed unary operator");var e=t.splice(n+1,1)[0],u=3===r?5:6;t[n]=[u,e],i=t.length,this.toUnaryNode(e)}else u=3===r?7:8,t[n]=u;else this.toUnaryNode(r),i=t.length}},t.prototype.toArithmeticNode=function(t,n,i){Xt(t)||(2===t[0]||11===t[0]||12===t[0]?this.toArithmetic(t[1],n,i):5===t[0]||6===t[0]?this.toArithmeticNode(t[1],n,i):7!==t[0]&&8!==t[0]&&9!==t[0]&&10!==t[0]||(this.toArithmeticNode(t[1],n,i),this.toArithmeticNode(t[2],n,i)))},t.prototype.toArithmetic=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];if(u===n||u===i){if(0<r&&r+1<e){var s=t[r-1],h=t[r+1];if(!Xt(s)&&!Xt(h)){t.splice(r,2),t[r-1]=[u,s,h],r-=1,e=t.length,this.toArithmeticNode(s,n,i),this.toArithmeticNode(h,n,i);continue}}throw new Error("Malformed operands for the operator "+u)}this.toArithmeticNode(u,n,i),e=t.length}},t.prototype.toToken=function(n){for(var i=[];;){var r=t.TOKEN_REGEX.exec(n);if(null==r)break;var e=r[0],u=Li[e];if(null!=u)i.push(u);else{var s=parseFloat(e);if(s!=s)throw new Error("Unexpected token '"+e+"' at "+r.index+" in '"+n+"'");var h=xi[e[e.length-1]];null!=h?i.push([h,.01*s]):i.push([18,s])}}return i},t.prototype.evaluate=function(t,n,i,r,e){switch(t[0]){case 2:var u=t[1];return this.evaluate(u[u.length-1],n,i,r,e);case 5:return+this.evaluate(t[1],n,i,r,e);case 6:return-this.evaluate(t[1],n,i,r,e);case 7:return this.evaluate(t[1],n,i,r,e)+this.evaluate(t[2],n,i,r,e);case 8:return this.evaluate(t[1],n,i,r,e)-this.evaluate(t[2],n,i,r,e);case 9:return this.evaluate(t[1],n,i,r,e)*this.evaluate(t[2],n,i,r,e);case 10:return this.evaluate(t[1],n,i,r,e)/this.evaluate(t[2],n,i,r,e);case 11:if(0<t[1].length){for(var s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.min(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case 12:if(0<t[1].length){for(s=t[1],h=this.evaluate(s[0],n,i,r,e),o=1,a=s.length;o<a;++o)h=Math.max(h,this.evaluate(s[o],n,i,r,e));return h}return 0;case 14:return t[1]*n;case 15:return t[1]*i;case 16:return t[1]*r;case 17:return t[1]*e;case 18:return t[1]}return 0},t.prototype.calculate=function(t,n,i,r){return this.evaluate(this.pn,t,n,i,r)},t.TOKEN_REGEX=/(?:\+|-|\*|\/|\(|\)|min|max|,|(?:\d+(?:\.\d*)?[%psc]?))/g,t}(),_i=function(t,n){return.5*(t-n)},Pi=function(t,n,i){return i},Fi=function(t){return t},Ui=function(t,n,i){return t-i},Gi=function(){function t(){}return t.position=function(t){if(null==t||Xt(t))return null;if(at(t)){switch(t){case"center":case"CENTER":return _i;case"padding":case"PADDING":return Pi}var n=new Bi(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(ot(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t.size=function(t){if(null==t||Xt(t))return null;if(at(t)){switch(t){case"100%":case"maximized":case"MAXIMIZED":return Fi;case"padding":case"PADDING":return Ui}var n=new Bi(t);return function(t,i,r,e){return n.calculate(t,i,r,e)}}if(ot(t))return t;var i=t;return function(t,n,r,e){return i.calculate(t,n,r,e)}},t}(),zi=function(){function t(){}return Object.defineProperty(t,"touchable",{get:function(){return"ontouchstart"in document},enumerable:!1,configurable:!0}),Object.defineProperty(t,"tap",{get:function(){return"pointertap"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"down",{get:function(){return"pointerdown"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"enter",{get:function(){return"pointerenter"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"leave",{get:function(){return"pointerleave"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"move",{get:function(){return"pointermove"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"out",{get:function(){return"pointerout"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"over",{get:function(){return"pointerover"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"up",{get:function(){return"pointerup"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"upoutside",{get:function(){return"pointerupoutside"},enumerable:!1,configurable:!0}),Object.defineProperty(t,"cancel",{get:function(){return"pointercancel"},enumerable:!1,configurable:!0}),t.toGlobal=function(t,n,i){if("touches"in t){var r=t.changedTouches,e=r[r.length-1];null!=e?n.mapPositionToPoint(i,e.clientX,e.clientY):n.mapPositionToPoint(i,0,0)}else n.mapPositionToPoint(i,t.clientX,t.clientY);return i},t.isValidDistance=function(t,n,i){var r=t.data.global,e=Math.abs(n-r.x),u=Math.abs(i-r.y),s=this.CLICK_DISTANCE_THRESHOLD;return e<s&&u<s},t.onClick=function(t,n){var i=this,r=!1,e=0,u=0,s=null,h=this.up,o=this.upoutside,a=this.cancel,c=function(){r=!1,s&&(s.off(h,f),s.off(o,l),s.off(a,l),s=null)};t.on("click",(function(t){r&&c(),n(t,!1)}));var f=function(s){r&&(c(),i.contains(t,s.target)&&i.isValidDistance(s,e,u)&&n(s,!0))},l=function(t){r&&c()};t.on(this.down,(function(n){if(r){var i=n.data.global;e=i.x,u=i.y}else{r=!0;var c=n.data.global;e=c.x,u=c.y,s&&(s.off(h,f),s.off(o,l),s.off(a,l),s=null);var v=rt.getLayer(t);v&&((s=v.renderer.plugins.interaction).once(h,f),s.once(o,l),s.once(a,l))}}))},t.onDblClick=function(t,n){var i=this;if(t.addEventListener("dblclick",(function(t){return n(t,!1)})),this.touchable){var r=0,e=0,u=0,s=0;t.addEventListener("touchstart",(function(t){if(0===r||2===r){var n=t.touches,i=n.length;if(i<=0)r=0;else{var s=n.item(i-1);null!=s?(r+=1,e=s.clientX,u=s.clientY):r=0}}else r=0})),t.addEventListener("touchend",(function(t){if(1===r||3===r){var h=t.changedTouches,o=h.length;if(o<=0)r=0;else{var a=h[o-1];if(null!=a){var c=e-a.clientX,f=u-a.clientY;i.CLICK_DISTANCE_THRESHOLD<=Math.abs(c)+Math.abs(f)?r=0:1===r?(s=t.timeStamp,r=2):t.timeStamp-s<i.DBLCLICK_INTERVAL_THRESHOLD?(r=0,n(t,!0)):(s=t.timeStamp,r=2)}else r=0}}else r=0})),t.addEventListener("touchcancel",(function(){r=0}))}},t.contains=function(t,n){for(var i=n;null!=i&&i!==t;)i=i.parent;return i===t},t.CLICK_DISTANCE_THRESHOLD=10,t.DBLCLICK_INTERVAL_THRESHOLD=333,t.LONG_CLICK_THRESHOLD=750,t}(),Hi=function(){function t(){this.On=!1}return Object.defineProperty(t.prototype,"isOff",{get:function(){return!this.On},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isOn",{get:function(){return this.On},enumerable:!1,configurable:!0}),t.prototype.toCoordinate=function(t){return this.On?"auto":t},t.prototype.from=function(t){return"auto"===t||"AUTO"===t?(this.On=!0,!0):(this.On=!1,!1)},t}(),Vi=function(){this.width=new Hi,this.height=new Hi},Wi=function(){function t(t){this.O=t,this.Dn=[],this.En=[],this.Mn=!0}return Object.defineProperty(t.prototype,"renderable",{get:function(){return this.Mn},set:function(t){this.Mn=t},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){(n?this.Dn:this.En).push(t),"parent"in t&&(t.parent=this.O)},t.prototype.addAt=function(t,n,i){var r=n?this.Dn:this.En;0===i?r.unshift(t):0<i&&i<r.length?r.splice(i,0,t):r.push(t),"parent"in t&&(t.parent=this.O)},t.prototype.remove=function(t,n){var i=n?this.Dn:this.En,r=i.indexOf(t);0<=r&&(i.splice(r,1),"parent"in t&&(t.parent=null))},t.prototype.render=function(t,n){if(this.Mn)for(var i=n?this.Dn:this.En,r=0,e=i.length;r<e;++r){var u=i[r];u.updateTransform(),u.render(t)}},t}(),Xi=function(){function t(){this.Sn=[]}return t.prototype.add=function(t){this.Sn.push(t)},t.prototype.remove=function(t){var n=this.Sn,i=n.indexOf(t);0<=i&&n.splice(i,1)},t.prototype.onReflow=function(t,n,i){for(var r=this.Sn,e=0,u=r.length;e<u;++e)r[e].onReflow(t,n,i)},t}(),Ki=function(n){function i(t){var r,e,u,s,h,o,a,c,f,l=n.call(this)||this,v=l.transform;l.P=new Ei(v.position,(function(t,n,i,r){l.onMove(t,n,i,r)})),l.Tn=new Ei(v.scale,(function(t,n,i,r){l.onScale(t,n,i,r)})),l.jn=new Ei(v.skew,(function(t,n,i,r){l.onSkew(t,n,i,r)})),l.Nn=t;var b=l.In={};l.Cn=new Vi,l.un=!0,l.An=!1,l.Rn=!1,l.yn=null,l.name=null!==(r=null==t?void 0:t.name)&&void 0!==r?r:"";var d=function(t){var n=null==t?void 0:t.theme;if(n)return at(n)?K.getInstance().get(n):n}(t)||l.getThemeDefault();l.Xt=d,l.kn=new Wi(l),l.Ln=new Xi,l.xn=di(null!==(e=null==t?void 0:t.clear)&&void 0!==e?e:d.getClearType(),yi),l.Bn=new Di(d,t,(function(){l.toParentResized(),l.toChildrenDirty(),rt.update(l)}));var g=function(){l.toDirty(),rt.update(l)};l.gn=new vi(d,t,g),l.mn=new gi(d,t,g),l.wn=new Oi(d,t,g),l.Vt=new wi(d,t,g);var m=v.position,w=null!==(u=null==t?void 0:t.x)&&void 0!==u?u:d.getX();Xt(w)?m.x=w:(m.x=0,b.x=Gi.position(w));var p=null!==(s=null==t?void 0:t.y)&&void 0!==s?s:d.getY();Xt(p)?m.y=p:(m.y=0,b.y=Gi.position(p));var O=null!==(h=null==t?void 0:t.width)&&void 0!==h?h:d.getWidth();l.Cn.width.from(O)?l.Mt=100:Xt(O)?l.Mt=O:(l.Mt=100,b.width=Gi.size(O));var D=null!==(o=null==t?void 0:t.height)&&void 0!==o?o:d.getHeight();l.Cn.height.from(D)?l.nn=100:Xt(D)?l.nn=D:(l.nn=100,b.height=Gi.size(D));var E=null==t?void 0:t.visible;null!=E&&(l.visible=E),l.Et=new ft((function(t,n){l.onStateChange(t,n)}));var M=di(null!==(a=null==t?void 0:t.interactive)&&void 0!==a?a:d.getInteractive(),pi);l.interactive=!!(M&pi.SELF),l.interactiveChildren=!!(M&pi.CHILDREN);var S=null==t?void 0:t.on;if(S)for(var T in S){var j=S[T];j&&l.on(T,j)}l._n=null!==(c=null==t?void 0:t.title)&&void 0!==c?c:d.getTitle(),l.Ut=null!==(f=null==t?void 0:t.weight)&&void 0!==f?f:d.getWeight(),l.initReflowable(),l.Pn=function(){rt.update(l)};var N=null==t?void 0:t.shadow;if(void 0===N&&(N=d.getShadow()),N)if(at(N))switch(N){case"WEAK":l.shadow=d.newShadowWeak();break;case"DEFAULT":l.shadow=d.newShadow()}else l.shadow=N;l.on(zi.over,(function(t){l.onOver(t)})),l.on(zi.out,(function(t){l.onOut(t)})),l.on(zi.down,(function(t){l.onDown(t)})),l.on(zi.up,(function(t){l.onUp(t)})),l.on("added",(function(){l.toParentResized(),(l.isDirty()||l.hasDirty())&&l.toParentHasDirty(),l.Rn&&l.toParentChildrenDirty();var t=l.parent;t instanceof i&&(l.state.parent=t.state),rt.update(l)})),l.on("removed",(function(){l.blur(!0),l.state.parent=null,rt.update(l)}));var I=function(t){if(t){var n=t.shortcut,i=t.shortcuts;if(null!=i||null!=n){var r=[];if(null!=n&&r.push(Kt.toShortcut(n)),null!=i)for(var e=0,u=i.length;e<u;++e)Kt.toShortcut(i[e]);return r}}}(t);if(l.Fn=I,null!=I)for(var C=function(t){l.onShortcut(t)},A=0,R=I.length;A<R;++A)Kt.on(l,I[A],C);l.init(t),d.newState(l.Et);var y=null==t?void 0:t.state;null!=y&&(at(y)?l.Et.add(y):l.Et.addAll(y));var k=null==t?void 0:t.parent;null!=k&&k.addChild(l);var L=null==t?void 0:t.children;if(null!=L)for(A=0,R=L.length;A<R;++A){var x=L[A];null!=x&&l.addChild(x)}var B=null==t?void 0:t.cursor;return l.Un=B,l.cursor=l.toCursor(B,l.Et),l.emit("init",l),l}return _(i,n),i.prototype.toCursor=function(t,n){if(t)if(ot(t)){var i=t(n);if(void 0!==i)return i}else if(void 0!==t)return t;return this.theme.getCursor(n)},Object.defineProperty(i.prototype,"snippet",{get:function(){return this.kn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"reflowable",{get:function(){return this.Ln},enumerable:!1,configurable:!0}),i.prototype.initReflowable=function(){new Ri(this)},i.prototype.onChildrenChange=function(){this.toChildrenDirty(),n.prototype.onChildrenChange.call(this)},i.prototype.onShortcut=function(t){},i.prototype.init=function(t){},Object.defineProperty(i.prototype,"weight",{get:function(){return this.Ut},enumerable:!1,configurable:!0}),i.prototype.onMove=function(t,n,r,e){for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof i&&o.onParentMove(t,n,r,e)}rt.update(this),this.emit("move",t,n,r,e,this)},i.prototype.resize=function(t,n){var i=this.Mt,r=this.nn,e=i!==t,u=r!==n;e&&(this.Mt=t),u&&(this.nn=n);var s,h=e||u;if(h&&this.onResize(t,n,i,r),e&&null!=(s=this.In).x){var o=this.transform.position,a=this.getParentOfSize();a&&(this.x=s.x(a.width,t,a.padding.getLeft(),o.x))}if(u&&null!=(s=this.In).y){o=this.transform.position;var c=this.getParentOfSize();c&&(this.y=s.y(c.height,n,c.padding.getTop(),o.y))}return h},i.prototype.getClearType=function(){return this.xn},i.prototype.onResize=function(t,n,r,e){this.toDirty(),this.toChildrenDirty();for(var u=this.Bn,s=this.children,h=0,o=s.length;h<o;++h){var a=s[h];a instanceof i&&a.onParentResize(t,n,u)}rt.update(this),this.emit("resize",t,n,r,e,this)},i.prototype.onScale=function(t,n,i,r){rt.update(this),this.emit("scale",t,n,i,r,this)},i.prototype.onSkew=function(t,n,i,r){rt.update(this),this.emit("skew",t,n,i,r,this)},Object.defineProperty(i.prototype,"type",{get:function(){return this.getType()},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"x",{get:function(){return this.P.x},set:function(t){this.P.x=t},enumerable:!1,configurable:!0}),i.prototype.getX=function(){var t=this.In;return null!=t.x?t.x:this.x},i.prototype.setX=function(t){if(Xt(t))this.x=t;else{var n=this.In,i=Gi.position(t);n.x!==i&&(n.x=i,this.toParentResized())}},Object.defineProperty(i.prototype,"y",{get:function(){return this.P.y},set:function(t){this.P.y=t},enumerable:!1,configurable:!0}),i.prototype.getY=function(){var t=this.In;return null!=t.y?t.y:this.y},i.prototype.setY=function(t){if(Xt(t))this.y=t;else{var n=this.In,i=Gi.position(t);n.y!==i&&(n.y=i,this.toParentResized())}},Object.defineProperty(i.prototype,"width",{get:function(){return this.Mt},set:function(t){var n=this.Mt;if(n!==t){this.Mt=t;var i=this.nn;this.onResize(t,i,n,i);var r=this.In;if(null!=r.x){var e=this.transform.position,u=this.getParentOfSize();u&&(this.x=r.x(u.width,t,u.padding.getLeft(),e.x))}}},enumerable:!1,configurable:!0}),i.prototype.getWidth=function(){return this.Cn.width.toCoordinate(this.In.width||this.Mt)},i.prototype.setWidth=function(t){var n=this.Cn.width,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toChildrenDirty(),rt.update(this)),!r)if(Xt(t))this.width=t;else{var e=this.In,u=Gi.size(t);e.width!==u&&(e.width=u,this.toParentResized())}},Object.defineProperty(i.prototype,"height",{get:function(){return this.nn},set:function(t){var n=this.nn;if(n!==t){this.nn=t;var i=this.Mt;this.onResize(i,t,i,n);var r=this.In;if(null!=r.y){var e=this.transform.position,u=this.getParentOfSize();u&&(this.y=r.y(u.height,t,u.padding.getTop(),e.y))}}},enumerable:!1,configurable:!0}),i.prototype.getHeight=function(){return this.Cn.height.toCoordinate(this.In.height||this.nn)},i.prototype.setHeight=function(t){var n=this.Cn.height,i=n.isOn,r=n.from(t);if(n.isOn!==i&&(this.toChildrenDirty(),rt.update(this)),!r)if(Xt(t))this.height=t;else{var e=this.In,u=Gi.size(t);e.height!==u&&(e.height=u,this.toParentResized())}},Object.defineProperty(i.prototype,"position",{get:function(){return this.P},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Tn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"skew",{get:function(){return this.jn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Bn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"corner",{get:function(){return this.Vt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"background",{get:function(){return this.gn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"border",{get:function(){return this.mn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"outline",{get:function(){return this.wn},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"unsafe",{get:function(){return this.transform},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"title",{get:function(){return this._n},set:function(t){this._n!==t&&(this._n=t,this.state.isHovered&&this.applyTitle())},enumerable:!1,configurable:!0}),i.prototype.applyTitle=function(){var t=rt.getLayer(this);t&&(t.view.title=this._n)},i.prototype.show=function(){return this.visible||(this.visible=!0,this.toParentChildrenDirty(),rt.update(this)),this},i.prototype.isShown=function(){return this.visible},i.prototype.hide=function(){return this.visible&&(this.visible=!1,this.toParentChildrenDirty(),this.blur(!0),rt.update(this)),this},i.prototype.isHidden=function(){return!this.visible},i.prototype.toDirty=function(){return!this.un&&(this.un=!0,this.toParentHasDirty(),!0)},i.prototype.toHasDirty=function(){return!this.An&&(this.An=!0,this.toParentHasDirty(),!0)},i.prototype.toParentHasDirty=function(){var t=this.parent;t instanceof i&&t.toHasDirty()},i.prototype.toChildrenDirty=function(){return!this.Rn&&(this.Rn=!0,this.onChildrenDirty(),this.toParentChildrenDirty(),!0)},i.prototype.toParentChildrenDirty=function(){var t=this.parent;t instanceof i&&t.toChildrenDirty()},i.prototype.isChildrenDirty=function(){return this.Rn},i.prototype.onChildrenDirty=function(){},i.prototype.isDirty=function(){return this.un},i.prototype.hasDirty=function(){return this.An},i.prototype.setFocused=function(t){if(this.state.isFocused!==t){var n=rt.getLayer(this);n&&n.getFocusController().set(this,t)}return this},i.prototype.focus=function(){return this.setFocused(!0)},i.prototype.blur=function(t){if(t){var n=rt.getLayer(this);if(n){var r=n.getFocusController().get();if(r instanceof i)for(var e=r;e;){if(e===this){r.setFocused(!1);break}e=e.parent}}}else this.setFocused(!1);return this},i.prototype.onStateChange=function(t,n){this.toDirty(),rt.update(this),this.emit("statechange",t,n,this);for(var r=this.children,e=0,u=r.length;e<u;++e){var s=r[e];s instanceof i&&s.state.onParentChange(t,n)}t.isFocused?n.isFocused||this.onFocus():n.isFocused&&this.onBlur(),this.cursor=this.toCursor(this.Un,t)},i.prototype.onChildFocus=function(t){var n=this.parent;n instanceof i&&n.onChildFocus(t)},i.prototype.onFocus=function(){var t=this.parent;t instanceof i&&t.onChildFocus(this)},i.prototype.onChildBlur=function(t){var n=this.parent;n instanceof i&&n.onChildBlur(t)},i.prototype.onBlur=function(){var t=this.parent;t instanceof i&&t.onChildBlur(this)},Object.defineProperty(i.prototype,"state",{get:function(){return this.Et},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"theme",{get:function(){return this.Xt},set:function(t){this.Xt!==t&&(this.Xt=t,this.Bn.setTheme(t),this.gn.setTheme(t),this.mn.setTheme(t),this.wn.setTheme(t),this.Vt.setTheme(t),this.toDirty(),rt.update(this))},enumerable:!1,configurable:!0}),i.prototype.refit=function(){if(this.Rn){this.Rn=!1;for(var t=this.children,n=0,r=t.length;n<r;++n){var e=t[n];e instanceof i&&e.refit()}this.onRefit()}},i.prototype.onRefit=function(){var t=this.Cn,n=t.width.isOn,i=t.height.isOn;if(n&&i){for(var r=0,e=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&(this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width)),this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height)));var h=this.padding;this.resize(r+h.getRight(),e+h.getBottom())}else if(n){for(r=0,u=0,s=(o=this.children).length;u<s;++u)(a=o[u]).visible&&this.hasRefitableWidth(a)&&(r=Math.max(r,a.x+a.width));this.width=r+this.padding.getRight()}else if(i){var o;for(e=0,u=0,s=(o=this.children).length;u<s;++u){var a;(a=o[u]).visible&&this.hasRefitableHeight(a)&&(e=Math.max(e,a.y+a.height))}this.height=e+this.padding.getBottom()}},i.prototype.isRefitable=function(t){return t instanceof i},i.prototype.hasRefitableHeight=function(t){return this.isRefitable(t)&&!(t instanceof i&&ot(t.getHeight()))},i.prototype.hasRefitableWidth=function(t){return this.isRefitable(t)&&!(t instanceof i&&ot(t.getWidth()))},i.prototype.reflow=function(){if(this.un&&(this.onReflow(),this.un=!1),this.An){for(var t=this.children,n=0,r=t.length;n<r;++n){var e=t[n];e instanceof i&&e.reflow()}this.An=!1}},i.prototype.onReflow=function(){this.Ln.onReflow(this,this.Mt,this.nn)},Object.defineProperty(i.prototype,"shadow",{get:function(){return this.yn},set:function(t){var n=this.yn;if(n!==t){var i=this.Ln,r=this.kn,e=this.Pn;null!=n&&(n.off("update",e),i.remove(n),r.remove(n,!0)),this.yn=t,null!=t&&(t.on("update",e),i.add(t),r.addAt(t,!0,0)),rt.update(this)}},enumerable:!1,configurable:!0}),i.prototype.toParentResized=function(){var t=this.getParentOfSize();t&&this.onParentResize(t.width,t.height,t.padding)},i.prototype.getParentOfSize=function(){var t=this.parent;return t instanceof i?t:rt.getLayer(this)},i.prototype.onParentResize=function(t,n,i){var r=this.In,e=this.transform.position,u=e.x,s=e.y,h=this.Mt,o=this.nn,a=i.getLeft()+i.getRight(),c=i.getTop()+i.getBottom(),f=null!=r.width?r.width(t,h,a,h):h,l=null!=r.height?r.height(n,o,c,o):o;this.resize(f,l);var v=null!=r.x?r.x(t,this.Mt,i.getLeft(),u):u,b=null!=r.y?r.y(n,this.nn,i.getTop(),s):s;this.position.set(v,b)},i.prototype.onParentMove=function(t,n,i,r){},i.prototype.onWheel=function(t,n,i){return this.emit("wheel",t,n,i,this),!1},i.prototype.onKeyDown=function(t){return this.emit("keydown",t,this),!1},i.prototype.onKeyUp=function(t){return this.emit("keyup",t,this),!1},i.prototype.isEventTarget=function(t){var n=t.target;if(n===this)return!0;if(null!=n&&!(n instanceof i)){for(var r=n.parent;null!=r&&!(r instanceof i);)r=r.parent;return r===this}return!1},i.prototype.onDown=function(t){this.isEventTarget(t)&&this.onDownThis(t),this.emit("down",t,this)},i.prototype.onDownThis=function(n){if("touches"in n.data.originalEvent){var i=this.Gn||new t.Point;this.Gn=i,i.copyFrom(n.data.global)}else this.focusOnClosest()},i.prototype.onUp=function(t){this.isEventTarget(t)&&this.onUpThis(t),this.emit("up",t,this)},i.prototype.onUpThis=function(t){if("touches"in t.data.originalEvent){var n=this.Gn;if(n){var i=t.data.global,r=Math.abs(i.x-n.x),e=Math.abs(i.y-n.y),u=zi.CLICK_DISTANCE_THRESHOLD;r<u&&e<u&&this.focusOnClosest()}}},i.prototype.focusOnClosest=function(){var t=rt.getLayer(this);if(t){var n=t.getFocusController();n.focus(n.findParent(this))}},i.prototype.onOver=function(t){this.state.isHovered=!0,t.target===this&&this.applyTitle(),this.emit("over",t,this)},i.prototype.onOut=function(t){this.state.isHovered=!1,this.emit("out",t,this)},i.prototype.onDblClick=function(t,n){return this.emit("dblclick",t,n,this),!1},i.prototype.render=function(t){if(this.visible&&0<this.worldAlpha&&this.renderable){var i=this.kn;i.render(t,!0),n.prototype.render.call(this,t),i.render(t,!1)}},i.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},i.prototype.getType=function(){return"DBase"},i.prototype._calculateBounds=function(){var t=this.transform.worldTransform,r=this._bounds,e=i.WORK_CONTAINS_POINT;e.set(0,0),t.apply(e,e),r.addPoint(e),e.set(this.Mt,this.nn),t.apply(e,e),r.addPoint(e),n.prototype._calculateBounds.call(this)},i.prototype.containsPoint=function(t){return this.containsGlobalPoint(t)||this.containsLocalPoint(this.worldTransform.applyInverse(t,i.WORK_CONTAINS_POINT))},i.prototype.containsGlobalPoint=function(t){return!1},i.prototype.containsLocalPoint=function(t){var n=t.x,i=t.y,r=this.Mt,e=this.nn;return 0<=n&&n<=r&&0<=i&&i<=e},i.prototype.getClippingRect=function(t,n){n.x=0,n.y=0,n.width=this.Mt,n.height=this.nn},i.prototype.destroy=function(){var t=this.In;t.x=null,t.y=null,t.width=null,t.height=null;var i=this.yn;i&&(this.yn=null,i.destroy());for(var r=this.children,e=r.length-1;0<=e;--e)r[e].destroy();r.length=0,n.prototype.destroy.call(this)},i.WORK_CONTAINS_POINT=new t.Point,i}(t.Container),Yi=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){var r=t.corner,e=Math.max(0,r.getRadius()-.5),u=r.getMask(),s=u&mi.TOP_LEFT?0:e,h=u&mi.TOP_RIGHT?0:e,o=u&mi.BOTTOM_LEFT?0:e,a=u&mi.BOTTOM_RIGHT?0:e;this.clear(),this.beginFill(16777215,1),this.lineStyle(0,0,0,0,!1),s<=0&&h<=0&&o<=0&&a<=0?this.drawRect(0,0,n,i):(this.moveTo(0+s,0),0<h?this.arcTo(0+n,0,0+n,0+i,h):this.lineTo(0+n,0),0<a?this.arcTo(0+n,0+i,0,0+i,a):this.lineTo(0+n,0+i),0<o?this.arcTo(0,0+i,0,0,o):this.lineTo(0,0+i),0<s?this.arcTo(0,0,0+n,0,s):this.lineTo(0,0)),this.endFill()},n}(t.Graphics),Ji={NONE:0,CTRL:1,SHIFT:2,ALT:4,AND:8,OR:16,NOT_NONE:23},Zi=function(){function t(){}return t.from=function(t){var n="data"in t?t.data.originalEvent:t;return(n.ctrlKey?Ji.CTRL:Ji.NONE)|(n.altKey?Ji.ALT:Ji.NONE)|(n.shiftKey?Ji.SHIFT:Ji.NONE)},t.match=function(n,i){return i&Ji.OR?!!(t.from(n)&i):t.from(n)===i},t}(),qi={OFF:0,ON:1,TOUCH:2},$i=function(){function n(){this.pointers=new Map,this.center=new t.Point,this.scale=0,this.time=0}return n.prototype.start=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.isUpdatable=function(t){var n=t.data.originalEvent;return!("pointerId"in n)||this.pointers.has(n.pointerId)},n.prototype.update=function(t){var n=t.data.originalEvent;"pointerId"in n&&this.pointers.set(n.pointerId,n),this.doUpdate(t)},n.prototype.end=function(t){var n=!0,i=t.data.originalEvent;if("touches"in i)n=i.touches.length<=0;else if("pointerId"in i){var r=this.pointers;r.delete(i.pointerId),n=r.size<=0}return this.doUpdate(t),n},n.prototype.bind=function(t){var n=this.interactionManager;if(n){var i=this.onMove;i&&n.on(zi.move,i);var r=this.onEnd;r&&(n.on(zi.up,r),n.on(zi.upoutside,r),n.on(zi.cancel,r))}},n.prototype.unbind=function(){var t=this.interactionManager;if(t){var n=this.onMove;n&&t.off(zi.move,n);var i=this.onEnd;i&&(t.off(zi.up,i),t.off(zi.upoutside,i),t.off(zi.cancel,i))}},n.prototype.doUpdate=function(t){var n=this.interactionManager,i=this.center,r=t.data.originalEvent;if(this.scale=0,this.time=r.timeStamp,"touches"in r){var e=r.touches,u=e.length;if(0<u){for(var s=0,h=0,o=0,a=e.length;o<a;++o)s+=(f=e[o]).clientX,h+=f.clientY;if(s/=u,h/=u,n?n.mapPositionToPoint(i,s,h):i.set(s,h),1<u){var c=0;for(o=1,a=e.length;o<a;++o){var f,l=(f=e[o]).clientX-s,v=f.clientY-h;c=Math.max(c,l*l+v*v)}this.scale=Math.sqrt(c)}}}else if("pointerId"in r){var b=this.pointers,d=b.size;if(0<d){var g=0,m=0;if(b.forEach((function(t){g+=t.clientX,m+=t.clientY})),g/=d,m/=d,n?n.mapPositionToPoint(i,g,m):i.set(g,m),1<d){var w=0;b.forEach((function(t){var n=t.clientX-g,i=t.clientY-m;w=Math.max(w,n*n+i*i)})),this.scale=Math.sqrt(w)}}}else i.copyFrom(t.data.global)},n}(),Qi=function(){function t(){}return t.LINEAR=function(t){return t},t.ELASTIC=function(t){return t*(3*(1-t)*(1-t)+t*(3*(1-t)+t))},t.QUAD_IN_OUT=function(t){return t<.5?2*t*t:(4-2*t)*t-1},t}(),tr=function(t){function n(n){var i,r,e,u=t.call(this)||this;u.k=null,u.zn=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,u.Hn=0,u.Vn=null!==(r=null==n?void 0:n.duration)&&void 0!==r?r:200,u.Wn=1/Math.max(1,u.Vn),u.Xn=!1,u.Kn=null==n?void 0:n.onTime,u.Yn=function(){u.onTimeBase()},u.Jn=null==n?void 0:n.onStart,u.Zn=null==n?void 0:n.onEnd,u.qn=null!==(e=null==n?void 0:n.timing)&&void 0!==e?e:Qi.ELASTIC;var s=null==n?void 0:n.on;if(s)for(var h in s){var o=s[h];o&&u.on(h,o)}return u}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.zn},set:function(t){this.zn=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return this.Vn},set:function(t){this.Vn=t,this.Wn=1/Math.max(1,t)},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.Hn=Date.now(),this.Xn=t,this.k=window.setTimeout(this.Yn,0),this.onStart(t);var n=this.Vn,i=this.toTime(t?n:0);this.onTime(i,t,0)},n.prototype.onStart=function(t){var n=this.Jn;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.Kn;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.Zn;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return null!=this.k},n.prototype.isReverse=function(){return this.Xn},n.prototype.onTimeBase=function(){if(null!=this.k){this.k=null;var t=Date.now()-this.Hn,n=this.Vn,i=this.Xn;if(t<n){this.k=window.setTimeout(this.Yn,0);var r=this.toTime(i?n-t:t);this.onTime(r,i,t)}else r=this.toTime(i?0:n),this.onTime(r,i,t),this.onEnd(i)}},n.prototype.toTime=function(t){return this.qn(t*this.Wn,this)},n.prototype.stop=function(){var t=this.k;null!=t&&(this.k=null,window.clearTimeout(t))},n.prototype.end=function(){var t=this.k;if(null!=t){this.k=null,window.clearTimeout(t);var n=this.Xn,i=Date.now()-this.Hn,r=this.Vn,e=this.toTime(n?0:r);this.onTime(e,n,i),this.onEnd(n)}},n}(t.utils.EventEmitter),nr=function(){function t(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r}return t.prototype.set=function(t,n,i,r){this.dx=t,this.dy=n,this.ds=i,this.dt=r},t}(),ir=function(){function t(t,n,i){var r,e=this;this.$n=[],this.Qn=[],this.ti=0,this.ni=-1,this.ii=0,this.ri=0,this.ei=0,this.si=0,this.hi=0,this._t=0,this.oi=new tr({onTime:function(t){e.onEase(t)},onEnd:function(){e.onEaseEnd()},timing:Qi.LINEAR,duration:333*(null!==(r=null==i?void 0:i.duration)&&void 0!==r?r:1)}),this.ai=t,this.Zn=n}return t.prototype.onStart=function(){for(var n=this.$n,i=n.length,r=t.HISTORY_CAPACITY;i<r;++i)n.push(new nr(0,0,1,0));this.ti=0,this.ni=-1,this.oi.stop()},t.prototype.onMove=function(n,i,r,e){var u=t.HISTORY_CAPACITY,s=this.ni,h=(s+1)%u;this.ni=h;var o=this.ti;(h<s||0<=s&&s<o)&&(this.ti=(o+1)%u),this.$n[h].set(n,i,r,e)},t.prototype.updateHistoriesSorted=function(t){var n=this.$n,i=this.Qn,r=this.ti,e=this.ni,u=n.length;if(e<0)return i.length=0,t;if(e<r){var s=t;i.length=0;for(var h=e;0<=h;--h){var o=n[h];if(!(s+o.dt<160))return s;s+=o.dt,i.push(o)}for(h=u-1;r<=h;--h){var a=n[h];if(!(s+a.dt<160))return s;s+=a.dt,i.push(a)}return s}for(s=t,i.length=0,h=e;r<=h;--h){var c=n[h];if(!(s+c.dt<160))return s;s+=c.dt,i.push(c)}return s},t.prototype.onEnd=function(t){this.updateHistoriesSorted(t);var n=this.Qn,i=n.length;if(i<=0)return this.onEaseEnd();for(var r=0,e=0,u=0,s=0,h=0;h<i;++h){var o=n[h];r+=o.dx,e+=o.dy,u+=o.ds,s+=o.dt}if(s<=0)return this.onEaseEnd();var a=1/i;r*=a,e*=a,u*=a,s*=a,this.ii=r,this.ri=e,this.ei=u,this.si=s;var c=this.oi,f=c.duration;this._t=-t/f,this.hi=f/s,c.start()},t.prototype.onEase=function(t){var n=this._t;this._t=t;var i=(1-.5*(t+n))*(t-n)*this.hi;this.ai(this.ii*i,this.ri*i,1+(this.ei-1)*i,t)},t.prototype.onEaseEnd=function(){this.Zn()},t.prototype.stop=function(){this.oi.stop()},t.HISTORY_CAPACITY=5,t}(),rr=function(){function t(t){var n,i,r,e=t.on;e&&(this.Jn=e.start,this.ai=e.move,this.Zn=e.end),this.ci=null!==(n=null==t?void 0:t.modifier)&&void 0!==n?n:Ji.NONE;var u=t.checker,s=Zi.match;this.fi=null!==(i=null==u?void 0:u.start)&&void 0!==i?i:s,this.li=null!==(r=null==u?void 0:u.move)&&void 0!==r?r:s,this.vi=t.easing,this.bi=!!t.touch,this.di=[],this.gi=new Map;var h=t.bind;null!=h&&this.bind(h)}return t.prototype.newData=function(t){var n=this.gi,i=n.get(t);if(null!=i)return i;var r=this.di.pop();if(null!=r)return n.set(t,r),r;var e=new $i;return e.easing=this.newEasing(e),e.onMove=this.newOnMove(e),e.onEnd=this.newOnEnd(e),n.set(t,e),e},t.prototype.newEasing=function(t){var n=this,i=this.vi;if(null==i||!1!==i)return new ir((function(i,r,e,u){n.onEasingMove(i,r,e,u,t)}),(function(){n.onEasingEnd(t)}),this.toEasingOptions(i))},t.prototype.toEasingOptions=function(t){return null==t||!0===t?void 0:t},t.prototype.deleteData=function(t){var n=t.target;n&&this.gi.delete(n)&&(t.target=void 0,t.pointers.clear(),this.di.push(t))},t.prototype.bind=function(t){var n=this;return t.on(zi.down,(function(i){n.onDown(t,i)})),this},t.prototype.isTouch=function(t){var n=t.data.originalEvent;return"touches"in n||"pointerId"in n&&"mouse"!==n.pointerType},t.prototype.onDown=function(t,n){var i;if((!this.bi||this.isTouch(n))&&this.fi(n,this.ci,t)){var r=rt.getLayer(t);if(null!=r)if(n.stopPropagation(),t.state.isGesturing)null===(i=this.gi.get(t))||void 0===i||i.start(n);else{var e=this.Jn;null!=e&&e(t);var u=this.newData(t);u.target=t,t.state.isGesturing=!0;var s=r.renderer.plugins.interaction;u.interactionManager=s,u.start(n);var h=u.easing;h&&h.onStart(),u.bind(n)}}},t.prototype.newOnMove=function(t){var n=this;return function(i){n.onMove(i,t)}},t.prototype.newOnEnd=function(t){var n=this;return function(i){n.onEnd(i,t)}},t.prototype.onMove=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.isUpdatable(t)&&this.li(t,this.ci,i)){var r=n.center,e=r.x,u=r.y,s=n.scale,h=n.time;n.update(t);var o=r.x,a=r.y,c=n.scale,f=o-e,l=a-u,v=n.time-h,b=1e-5,d=b<s&&b<c?c/s:1,g=n.easing;g&&g.onMove(f,l,d,v);var m=this.ai;null!=m&&(0===f&&0===l&&1===d||m(i,f,l,o,a,d))}},t.prototype.onEnd=function(t,n){var i=n.target;if(null!=i&&i.state.isGesturing&&n.end(t)){i.state.isGesturing=!1;var r=n.interactionManager;if(n.interactionManager=void 0,r){var e=n.onMove;e&&r.off(zi.move,e);var u=n.onEnd;u&&(r.off(zi.up,u),r.off(zi.cancel,u))}var s=this.Zn;null!=s&&s(i);var h=n.easing;h?h.onEnd(t.data.originalEvent.timeStamp-n.time):this.deleteData(n)}},t.prototype.onEasingMove=function(t,n,i,r,e){if(null!=e.target){var u=this.ai;if(null!=u&&(0!==t||0!==n||1!==i)){var s=e.center,h=s.x+t,o=s.y+n;s.set(h,o),u(e.target,t,n,h,o,i)}}},t.prototype.onEasingEnd=function(t){this.deleteData(t)},t.prototype.stop=function(t){var n,i=this.gi.get(t);null!=i&&(null===(n=i.easing)||void 0===n||n.stop(),this.deleteData(i))},t}(),er=function(){function t(t,n,i,r,e){var u,s,h=this;this.O=t,this.wi=i;var o=di(null!==(u=null==e?void 0:e.mode)&&void 0!==u?u:r.getGestureMode(),qi),a=di(null!==(s=null==e?void 0:e.modifier)&&void 0!==s?s:r.getGestureModifier(),Ji);o!==qi.ON&&o!==qi.TOUCH||(this.pi=new rr({touch:o===qi.TOUCH,modifier:a,checker:e&&e.checker,easing:{duration:null==e?void 0:e.duration},on:{start:function(){h.wi.stop()},move:function(i,r,e,u,s,o){h.onGestureMove(n(t),r,e,u,s,o)}}}))}return t.prototype.onGestureMove=function(t,n,i,r,e,u){if(t){var s=this.wi,h=t.scale,o=h.x,a=h.y,c=s.toNormalizedScale(o*u),f=s.toNormalizedScale(a*u),l=c/o,v=f/a,b=u<1?Math.max(l,v):Math.min(l,v);c=b*o,f=b*a;var d=r-n,g=e-i,m=t.position,w=(m.x-d)*b+r,p=(m.y-g)*b+e;t.scale.set(c,f),t.position.set(w,p)}},t.prototype.stop=function(){var t;null===(t=this.pi)||void 0===t||t.stop(this.O)},t.prototype.onDown=function(t){var n;null===(n=this.pi)||void 0===n||n.onDown(this.O,t)},t}(),ur=function(){function t(t,n,i,r){var e=this;this.O=t,this.Oi=n,this.Di=1,this.Ei=1,this.Mi=0,this.Si=0,this.Ti=1,this.ji=1,this.Ni=0,this.Ii=0,this.oi=new tr({onTime:function(t){e.onTime(t)},duration:r}),this.wi=i,this.Vn=r}return t.prototype.onTime=function(t){var n=1-t,i=t,r=this.Ti*n+this.Di*i,e=this.ji*n+this.Ei*i,u=this.Ni*n+this.Mi*i,s=this.Ii*n+this.Si*i,h=this.Oi(this.O);null!=h&&(h.scale.set(r,e),h.position.set(u,s))},t.prototype.start=function(t,n,i,r,e,u,s){if(!1!==s&&this.wi.stop(),null==u&&(u=this.Vn),u<=0)t.scale.set(r,e),t.position.set(n,i);else{var h=t.position,o=t.scale;this.Ni=h.x,this.Ii=h.y,this.Ti=o.x,this.ji=o.y,this.Mi=n,this.Si=i,this.Di=r,this.Ei=e,this.oi.duration=u,this.oi.start()}},t.prototype.stop=function(){this.oi.stop()},t}(),sr=function(){function n(n,i,r){var e,u,s,h,o,a,c,f,l,v,b,d,g,m,w,p,O;this.O=n,this.Oi=i,this.Ci=new t.Rectangle;var D=this.toTheme(r)||this.getThemeDefault(),E=null==r?void 0:r.zoom;this.Ai=new t.Point,this.Ri=null!==(e=null==E?void 0:E.min)&&void 0!==e?e:D.getZoomMin(),this.yi=null!==(u=null==E?void 0:E.max)&&void 0!==u?u:D.getZoomMax(),this.ki=null!==(s=null==E?void 0:E.keepRatio)&&void 0!==s?s:D.getZoomKeepRatio();var M=null==E?void 0:E.wheel;this.Li=null!==(h=null==M?void 0:M.enable)&&void 0!==h?h:D.isWheelZoomEnabled(),this.xi=null!==(o=null==M?void 0:M.speed)&&void 0!==o?o:D.getWheelZoomSpeed(),this.Bi=di(null!==(a=null==M?void 0:M.modifier)&&void 0!==a?a:D.getWheelZoomModifier(),Ji),this._i=null!==(c=null==M?void 0:M.checker)&&void 0!==c?c:Zi.match;var S=null==E?void 0:E.dblclick;this.Pi=null!==(f=null==S?void 0:S.enable)&&void 0!==f?f:D.isDblClickZoomEnabled(),this.Fi=null!==(l=null==S?void 0:S.amount)&&void 0!==l?l:D.getDblClickZoomSpeed(),this.Ui=di(null!==(v=null==S?void 0:S.modifier)&&void 0!==v?v:D.getDblClickZoomModifier(),Ji),this.Gi=null!==(b=null==S?void 0:S.checker)&&void 0!==b?b:Zi.match,this.zi=null!==(d=null==S?void 0:S.duration)&&void 0!==d?d:D.getDblClickZoomDuration();var T=null===(g=null==r?void 0:r.translation)||void 0===g?void 0:g.wheel;this.Hi=null!==(m=null==T?void 0:T.enable)&&void 0!==m?m:D.isWheelTranslationEnabled(),this.Vi=null!==(w=null==T?void 0:T.speed)&&void 0!==w?w:D.getWheelTranslationSpeed(),this.Wi=di(null!==(p=null==T?void 0:T.modifier)&&void 0!==p?p:D.getWheelTranslationModifier(),Ji),this.Xi=null!==(O=null==T?void 0:T.checker)&&void 0!==O?O:Zi.match,this.Ki=new er(n,i,this,D,null==r?void 0:r.gesture),this.C=new ur(n,i,this,this.zi)}return Object.defineProperty(n.prototype,"gesture",{get:function(){return this.Ki},enumerable:!1,configurable:!0}),n.prototype.stop=function(){this.Ki.stop(),this.C.stop()},n.prototype.reset=function(t,n){var i=this.O,r=this.Oi(i);if(r){var e=r.getLocalBounds(this.Ci),u=.5*(i.width-e.width)-e.x,s=.5*(i.height-e.height)-e.y;this.C.start(r,u,s,1,1,t,n)}},n.prototype.fit=function(t,n){var i=this.O,r=this.Oi(i);if(r){var e=i.padding,u=i.width,s=i.height,h=r.getLocalBounds(this.Ci),o=h.x,a=h.y,c=h.width,f=h.height,l=(u-e.getLeft()-e.getRight())/c,v=(s-e.getTop()-e.getBottom())/f;if(this.ki){var b=this.toNormalizedScale(Math.min(l,v));l=b,v=b}else l=this.toNormalizedScale(l),v=this.toNormalizedScale(v);var d=.5*(u-c*l)-o*l,g=.5*(s-f*v)-a*v;this.C.start(r,d,g,l,v,t,n)}},n.prototype.zoomIn=function(t,n){var i=this.Oi(this.O);if(i){var r=this.Fi,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomOut=function(t,n){var i=this.Oi(this.O);if(i){var r=1/this.Fi,e=i.scale;this.zoom(e.x*r,e.y*r,t,n)}},n.prototype.zoomAt=function(t,n,i,r,e,u){var s=this.Oi(this.O);if(s){var h=s.scale.x,o=s.scale.y,a=this.toNormalizedScale(i),c=this.toNormalizedScale(r),f=a/h,l=c/o,v=(s.position.x-t)*f+t,b=(s.position.y-n)*l+n;this.C.start(s,v,b,a,c,e,u)}},n.prototype.zoomAtGlobal=function(t,n,i,r,e,u){var s=this.Ai;s.set(t,n),this.toLocal(s,s),this.zoomAt(s.x,s.y,i,r,e,u)},n.prototype.zoom=function(t,n,i,r){var e=this.O;this.zoomAt(.5*e.width,.5*e.height,t,n,i,r)},Object.defineProperty(n.prototype,"scale",{get:function(){var n=this.Oi(this.O);return n?n.scale:new t.Point(1,1)},set:function(t){var n=this.Oi(this.O);if(n){var i=this.toNormalizedScale(t.x),r=this.toNormalizedScale(t.y);n.scale.set(i,r)}},enumerable:!1,configurable:!0}),n.prototype.moveTo=function(t,n,i,r){var e=this.Oi(this.O);if(e){var u=e.scale;this.C.start(e,t,n,u.x,u.y,i,r)}},Object.defineProperty(n.prototype,"position",{get:function(){var n=this.Oi(this.O);return n?n.position:new t.Point(0,0)},set:function(t){var n=this.Oi(this.O);n&&n.position.set(t.x,t.y)},enumerable:!1,configurable:!0}),n.prototype.transform=function(t,n,i,r,e,u){var s=this.Oi(this.O);s&&this.C.start(s,t,n,i,r,e,u)},n.prototype.toLocal=function(t,n,i){return this.O.toLocal(t,void 0,n,i)},n.prototype.toGlobal=function(t,n,i){return this.O.toGlobal(t,n,i)},n.prototype.toNormalizedScale=function(t){return Math.min(this.yi,Math.max(this.Ri,t))},n.prototype.onWheel=function(t,n,i){var r;if(this.Li&&this._i(t,this.Bi,this.O)&&0!==n.deltaY&&(r=this.Oi(this.O))){var e=n.lowest*this.xi,u=1+n.deltaY*e,s=r.scale;return this.zoomAtGlobal(i.x,i.y,s.x*u,s.y*u,0),!0}return!!(this.Hi&&this.Xi(t,this.Wi,this.O)&&(r=this.Oi(this.O)))&&(this.stop(),e=n.lowest*this.Vi,r.position.set(r.position.x-n.deltaX*e,r.position.y+n.deltaY*e),!0)},n.prototype.onDown=function(t){this.Ki.onDown(t)},n.prototype.onDblClick=function(t,n){if(this.Pi&&this.Gi(t,this.Ui,this.O)){var i=this.Oi(this.O);if(i){var r=this.Ai;zi.toGlobal(t,n,r);var e=this.Fi,u=i.scale;return this.zoomAtGlobal(r.x,r.y,u.x*e,u.y*e,this.zi),!0}}return!1},n.prototype.toTheme=function(t){if(t&&t.theme){var n=t.theme;return at(n)?K.getInstance().get(n):n}return null},n.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},n.prototype.getType=function(){return"DView"},n}(),hr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n),this.Yi=null;var e=this.theme;this.Ji=new sr(this,(function(){return r.Yi}),null==n?void 0:n.view);var u=null==n?void 0:n.canvas;u&&(this.canvas=u),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(this.mask=this.getOverflowMask())},n.prototype.getType=function(){return"DCanvasContainer"},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateContentSize(n,i,r,e)},Object.defineProperty(n.prototype,"canvas",{get:function(){return this.Yi},set:function(t){var n=this.Yi;null!=n&&(this.Yi=null,this.removeChild(n),this.emit("unset",n,this),n.destroy()),this.Yi=t,null!=t?(this.addChild(t),this.Ji.reset(0),this.emit("set",t,this)):rt.update(this)},enumerable:!1,configurable:!0}),n.prototype.getOverflowMask=function(){return null==this.Zi&&(this.Zi=new Yi(this),this.Ln.add(this.Zi),this.toDirty()),this.Zi},n.prototype.updateContentSize=function(t,n,i,r){var e=this.Yi;if(null!=e){var u=e.x+.5*(t-i),s=e.y+.5*(n-r);e.position.set(u,s)}},Object.defineProperty(n.prototype,"view",{get:function(){return this.Ji},enumerable:!1,configurable:!0}),n.prototype.onWheel=function(n,i,r){var e=this.Ji.onWheel(n,i,r),u=t.prototype.onWheel.call(this,n,i,r);return e||u},n.prototype.onDblClick=function(n,i,r){if(!0!==r){var e=this.Ji.onDblClick(n,i),u=t.prototype.onDblClick.call(this,n,i);return e||u}return t.prototype.onDblClick.call(this,n,i)},n.prototype.onDown=function(n,i){!0!==i&&this.Ji.onDown(n),t.prototype.onDown.call(this,n)},n.prototype.destroy=function(){var n=this.Zi;null!=n&&(this.Zi=null,n.destroy()),this.mask=null,t.prototype.destroy.call(this)},n}(Ki),or=function(){function t(){}return t.toContainer=function(t){for(var n=t;null!=n;){if(n instanceof hr)return n;n=n.parent}return null},t.open=function(t,n){var i=this.toContainer(t);i&&i.openByName(n)},t.write=function(t,n,i,r,e){var u=this.toContainer(t);u&&(e?u.data.remote.set(n,i,r):u.data.set(n,i,r))},t.emit=function(n,i,r,e){var u=t.toContainer(n);void 0===e?(n.emit(i,n),u&&u.shape.emit(i,n)):(n.emit(i,r,e,n),u&&u.shape.emit(i,r,e,n))},t}(),ar=function(t){function n(n){var i=t.call(this,n,Yt.NONE)||this;return i.name=qt.ofStringOrNull(n.name),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.name(t,i);null!=r&&or.emit(t,r)}},n}(Qt),cr=function(t){function n(n,i){var r=t.call(this,fn.EMIT_EVENT,n)||this;return r.name=i,r}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.name===i.name},n.prototype.toRuntime=function(){return new ar(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.name);return t.addResource("["+this.type+","+n+","+i+"]")},n.deserialize=function(t,i){return new n(ln.toResource(1,t,i.resources),ln.toResource(2,t,i.resources))},n}(an),fr=function(t){function n(n){var i=t.call(this,n,Yt.NONE)||this;return i.target=qt.ofStringOrNull(n.target),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.target(t,i);null!=r&&or.emit(t,r)}},n}(Qt),lr={NO_POINTER_EVENTS:"NO_POINTER_EVENTS"},vr={CLICKED:0,DOUBLE_CLICKED:1,FOCUSED:2,ALWAYS:3},br=function(){function n(t,n,i,r){var e=this;this.zn=t,this.qi=n;var u=this.toData(i,r);this.$i=u,this.Qi=!1,this.tr=function(t){e.onElementFocus(t)},this.nr=function(t){e.onBeforeFocus(t)},this.ir=function(t){e.onAfterFocus(t)},this.rr=!1,this.er=!1,this.ur=function(){e.doSelect()},this.sr=this.$i.when===vr.ALWAYS,this.hr=function(){e.updateElement(e.ar)}}return n.prototype.toData=function(t,n){var i,r;return{element:this.toElementData(t,null==n?void 0:n.element),clipper:this.toClipperData(t,null==n?void 0:n.clipper),before:this.toBeforeData(t,null==n?void 0:n.before),after:this.toAfterData(t,null==n?void 0:n.after),when:di(null!==(i=null==n?void 0:n.when)&&void 0!==i?i:t.getWhen(),vr),select:null!==(r=null==n?void 0:n.select)&&void 0!==r?r:t.getSelect()}},n.prototype.toElementData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getElementCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newElementStyler(t)}},n.prototype.newElementStyler=function(t){return function(n,i,r,e,u,s){return t.setElementStyle(n,i,r,e,u,s)}},n.prototype.toClipperData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getClipperCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newClipperStyler(t)}},n.prototype.newClipperStyler=function(t){return function(n,i,r,e,u,s){return t.setClipperStyle(n,i,r,e,u,s)}},n.prototype.toBeforeData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getBeforeCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newBeforeStyler(t)}},n.prototype.newBeforeStyler=function(t){return function(n){t.setBeforeStyle(n)}},n.prototype.toAfterData=function(t,n){var i,r;return{creator:null!==(i=null==n?void 0:n.creator)&&void 0!==i?i:t.getAfterCreator(),styler:null!==(r=null==n?void 0:n.styler)&&void 0!==r?r:this.newAfterStyler(t)}},n.prototype.newAfterStyler=function(t){return function(n){t.setAfterStyle(n)}},Object.defineProperty(n.prototype,"element",{get:function(){var t;return null!==(t=this.cr)&&void 0!==t?t:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"when",{get:function(){return this.$i.when},enumerable:!1,configurable:!0}),n.prototype.onDowning=function(t){switch(this.er=this.rr,this.when){case vr.CLICKED:this.start();break;case vr.FOCUSED:this.zn.state.isFocused&&this.start()}},n.prototype.onDown=function(t){!this.er&&this.rr&&("data"in t?t.data.originalEvent.preventDefault():t.preventDefault())},n.prototype.onDblClick=function(t,n){switch(this.when){case vr.DOUBLE_CLICKED:this.start()}},n.prototype.onFocus=function(){var t;switch(this.when){case vr.FOCUSED:this.start();break;default:null===(t=this.cr)||void 0===t||t.focus()}},n.prototype.onBlur=function(){var t;switch(this.when){case vr.CLICKED:case vr.DOUBLE_CLICKED:case vr.FOCUSED:this.onEndByBlur(),this.cancel();break;default:null===(t=this.cr)||void 0===t||t.blur()}},n.prototype.isStartable=function(){switch(this.when){case vr.CLICKED:case vr.DOUBLE_CLICKED:case vr.FOCUSED:return this.zn.state.isActionable;default:return!0}},n.prototype.start=function(){!this.rr&&this.isStartable()&&(this.rr=!0,this.zn.worldVisible?this.doStart():this.sr=!0,rt.update(this.zn))},n.prototype.isShown=function(){return this.Qi},n.prototype.onRender=function(t){(this.sr||!this.Qi&&this.when===vr.ALWAYS)&&(this.sr=!1,this.doStart(t)),this.rr&&(this.rr=!1)},n.prototype.getElementRect=function(n){var i=this.tn||new t.Point(0,0);this.tn=i;var r=this.lr||new t.Rectangle;return this.lr=r,this.qi.getElementRect(n,i,r)},n.prototype.getElementMatrix=function(){return this.qi.getElementMatrix()},n.prototype.getClipperRect=function(n){var i=this.tn||new t.Point(0,0);this.tn=i;var r=this.vr||new t.Rectangle;return this.vr=r,this.qi.getClipperRect(n,i,r)},n.prototype.doStart=function(t){var n,i;if(!this.Qi){this.Qi=!0;var r=this.ar;null!=r&&(this.ar=void 0,r.off("postrender",this.hr));var e=this.zn;null==t&&(t=null===(n=rt.getLayer(e))||void 0===n?void 0:n.renderer),t&&(this.ar=t,t.on("postrender",this.hr)),this.onStart();var u=this.getClipper();if(u){var s=this.getBefore(u),h=this.getElement(u),o=this.getAfter(u);if(h){var a=null!==(i=null==t?void 0:t.resolution)&&void 0!==i?i:rt.getResolution(e),c=this.getElementRect(a),f=this.getElementMatrix(),l=this.toClipperRectAdjusted(c,f,this.getClipperRect(a)),v=e.state,b=this.qi.getPadding(),d=this.$i;d.clipper.styler(u,v,b,c,f,l),d.element.styler(h,v,b,c,f,l),s&&d.before.styler(s),o&&d.after.styler(o),this.onElementAttached(h,s,o),u.style.display="",v.isFocused&&this.toElementFocused(h),u.scrollTop=0,u.scrollLeft=0,this.$i.select&&setTimeout(this.ur,0)}}}},n.prototype.toElementFocused=function(t){t.focus()},n.prototype.onStart=function(){this.qi.onStart()},n.prototype.doSelect=function(){var t=this.cr;t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&t.select()},n.prototype.cancel=function(){if(this.Qi){this.Qi=!1;var t=this.ar;null!=t&&(this.ar=void 0,t.off("postrender",this.hr)),this.onCancel();var n=this.zn,i=rt.getLayer(n);if(i){var r=i.view;switch(this.when){case vr.CLICKED:case vr.DOUBLE_CLICKED:case vr.FOCUSED:document.activeElement===this.cr&&r.focus()}var e=n.state,u=i.renderer.plugins.interaction;this.qi.containsPoint(u.mouse.global)&&!e.isHovered&&(e.isHovered=!0,r.style.cursor=n.cursor),i.update()}var s=this.cr;null!=s&&this.onElementDetached(s,this.br,this.dr);var h=this.gr;null!=h&&(h.style.display="none")}},n.prototype.onCancel=function(){this.qi.onCancel()},n.prototype.onElementAttached=function(t,n,i){null==n||n.addEventListener("focus",this.nr),null==i||i.addEventListener("focus",this.ir),t.addEventListener("focus",this.tr,!0)},n.prototype.onElementDetached=function(t,n,i){null==n||n.removeEventListener("focus",this.nr),null==i||i.removeEventListener("focus",this.ir),t.removeEventListener("focus",this.tr,!0)},n.prototype.getClipper=function(){var t=this.gr;if(null==t){var n=rt.getLayer(this.zn);t=n?this.$i.clipper.creator(n.getElementContainer()):null,this.gr=t}return t},n.prototype.getElement=function(t){var n=this.cr;return null==n&&(n=this.$i.element.creator(t),this.cr=n),n},n.prototype.getBefore=function(t){var n=this.br;return null==n&&(n=this.$i.before.creator(t),this.br=n),n},n.prototype.getAfter=function(t){var n=this.dr;return null==n&&(n=this.$i.after.creator(t),this.dr=n),n},n.prototype.onBeforeFocus=function(t){var n=this.zn,i=rt.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!1);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onAfterFocus=function(t){var n=this.zn,i=rt.getLayer(n);if(i){var r=i.getFocusController(),e=r.find(n,!1,!1,!0);i.view.focus(),r.focus(e),t.preventDefault(),t.stopImmediatePropagation()}},n.prototype.onElementFocus=function(t){if(this.when===vr.ALWAYS){var n=this.zn;n.state.isFocused||n.focus()}},n.prototype.onEndByBlur=function(){this.onEnd()},n.prototype.onEnd=function(){this.qi.onEnd()},n.prototype.end=function(){this.onEnd(),this.cancel()},n.prototype.select=function(){return this.Qi&&this.$i.select&&this.doSelect(),this},n.prototype.toClipperRectAdjusted=function(t,n,i){if(i&&t&&null==n){var r=t.x,e=t.y,u=r+t.width,s=e+t.height,h=i.x,o=i.y,a=h+i.width,c=o+i.height,f=Math.min(Math.max(h,r),a),l=Math.min(Math.max(h,u),a),v=Math.min(Math.max(o,e),c),b=Math.min(Math.max(o,s),c);i.x=f,i.y=v,i.width=l-f,i.height=b-v}return i},n.prototype.updateElement=function(t){if(this.Qi){var n=this.zn;if(n.worldVisible){var i=this.cr,r=this.gr;if(i&&r){var e=t.resolution,u=this.getElementRect(e),s=this.getElementMatrix(),h=this.toClipperRectAdjusted(u,s,this.getClipperRect(e)),o=n.state,a=this.qi.getPadding(),c=this.$i;c.clipper.styler(r,o,a,u,s,h),c.element.styler(i,o,a,u,s,h)}}else switch(this.when){case vr.ALWAYS:(r=this.gr)&&(r.style.display="none");break;default:this.cancel()}}},n.getClipperRect=function(t,n,i,r,e){for(var u=!0,s=0,h=0,o=0,a=0,c=t;c instanceof Ki;){c.getClippingRect(n,e),r.set(e.x,e.y),c.toGlobal(r,r,!1);var f=(r.x*i|0)/i,l=(r.y*i|0)/i;r.set(e.x+e.width,e.y+e.height),c.toGlobal(r,r,!0);var v=r.x,b=r.y,d=Math.min(f,v),g=Math.min(l,b),m=Math.max(f,v),w=Math.max(l,b);u?(u=!1,s=d,h=g,o=m,a=w):(s=Math.min(Math.max(s,d),m),h=Math.min(Math.max(h,g),w),o=Math.min(Math.max(o,d),m),a=Math.min(Math.max(a,g),w)),c=c.parent}return u?null:(e.x=s,e.y=h,e.width=o-s,e.height=a-h,e)},n}(),dr=function(n){function i(t){var i=n.call(this)||this;return i.condition=qt.ofString(t.condition),i.utils=new Map,i}return _(i,n),i.prototype.getUtil=function(t,n){var i=this.utils,r=i.get(t);return null==r&&(r=this.newUtil(t,n),i.set(t,r)),r},i.prototype.newUtil=function(t,n){return new br(t,this.newOperation(t,n),K.getInstance().get("DHtmlElement"),this.newUtilOptions(t,n))},i.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},i.prototype.newUtilOptions=function(t,n){return{element:{creator:this.newElementCreator(t,n)},when:this.toWhen(t,n)}},i.prototype.toWhen=function(t,n){var i=this.condition(t,Date.now());if(null!=i&&i in vr)return vr[i]},i.prototype.containsPoint=function(n,r,e){if(n.visible){var u=i.WORK||new t.Point;return i.WORK=u,n.toLocal(e,void 0,u),null!=n.contains(u.x,u.y)}return!1},i.prototype.getPadding=function(t,n){return null},i.prototype.getElementRect=function(t,n,i,r,e){var u=t.transform.pivot,s=t.size,h=s.x,o=s.y;return e.x=-.5*h+u.x,e.y=-.5*o+u.y,e.width=h,e.height=o,e},i.prototype.getElementMatrix=function(t,n){return t.updateTransform(),t.transform.worldTransform},i.prototype.getClipperToRect=function(t,n,i,r,e){var u=or.toContainer(t);return br.getClipperRect(u,t,i,r,e)},i.prototype.onRender=function(t,n,i,r){this.getUtil(t,n).onRender(r)},i.prototype.onFocus=function(t,n){this.getUtil(t,n).onFocus()},i.prototype.onBlur=function(t,n){this.getUtil(t,n).onBlur()},i.prototype.onDowning=function(t,n,i){this.getUtil(t,n).onDowning(i)},i.prototype.onDown=function(t,n,i){this.getUtil(t,n).onDown(i)},i.prototype.onDblClick=function(t,n,i,r){this.getUtil(t,n).onDblClick(i,r)},i}($t),gr={INPUT_TEXT:0,INPUT_INTEGER:1,INPUT_REAL:2,EMIT_EVENT:3,WRITE_BOTH:4,WRITE_LOCAL:5,WRITE_REMOTE:6,HTML_ELEMENT:7,HTML_ELEMENT_WITHOUT_POINTER_EVENTS:8,LAYER_SHOW_HIDE:9,LAYER_GESTURE:10,GESTURE:11},mr=function(t){function n(n){var i=t.call(this,n)||this;return i.elementCreator=qt.ofElementOrNull(n.value),i.noPointerEvent=n.subtype===gr.HTML_ELEMENT_WITHOUT_POINTER_EVENTS,i}return _(n,t),n.prototype.newUtil=function(n,i){return this.noPointerEvent&&n.state.add(lr.NO_POINTER_EVENTS),t.prototype.newUtil.call(this,n,i)},n.prototype.newElementCreator=function(t,n){var i=this.elementCreator;if(i)return function(n){return i(t,Date.now(),n)}},n}(dr),wr=function(t){function n(n,i,r,e){var u,s,h,o,a,c,f,l=t.call(this,n,i,r,e)||this;l.qi=i,l.mr=function(t){l.onInputKeyDown(t)},l.wr=function(){l.onInputChange()},l.pr=function(t){l.onInputInput(t)},l.Or=null!==(u=null==e?void 0:e.description)&&void 0!==u?u:"";var v=null==e?void 0:e.editing;return l.Dr=null!==(a=null!==(s=null==v?void 0:v.formatter)&&void 0!==s?s:null===(o=null===(h=e)||void 0===h?void 0:h.text)||void 0===o?void 0:o.formatter)&&void 0!==a?a:r.getEditingFormatter(),l.Er=null!==(c=null==v?void 0:v.unformatter)&&void 0!==c?c:r.getEditingUnformatter(),l.Mr=null!==(f=null==v?void 0:v.validator)&&void 0!==f?f:r.getEditingValidator(),l}return _(n,t),n.prototype.onEnd=function(){t.prototype.onEnd.call(this),this.onInputChange()},n.prototype.onElementAttached=function(n,i,r){n.value=this.fromValue(this.qi.getValue()),n.addEventListener("change",this.wr),n.addEventListener("input",this.pr),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){t.prototype.onElementDetached.call(this,n,i,r),n.removeEventListener("change",this.wr),n.removeEventListener("input",this.pr)},n.prototype.onInputKeyDown=function(t){Kt.isOkKey(t)?(this.end(),this.qi.onEnter()):Kt.isCancelKey(t)&&this.cancel()},n.prototype.toElementFocused=function(n){t.prototype.toElementFocused.call(this,n),n.scrollTop=0,n.scrollLeft=0},n.prototype.onInputChange=function(){if(this.isShown()){var t=this.element;if(null!=t){var n=this.qi,i=this.toValue(t.value),r=n.getValue();r!==i&&n.onValueChange(i,r)}}},n.prototype.toValue=function(t){return this.Er(t,this)},n.prototype.fromValue=function(t){return void 0!==t?this.Dr(t,this):""},n.prototype.onInputInput=function(t){var n=t.target;n instanceof HTMLInputElement&&this.qi.onValueInput(this.toValue(n.value))},n.prototype.validate=function(){var t=this.qi.getValue();if(void 0!==t){var n=this.Mr(t,this);if(this.Sr!==n){this.Sr=n;var i=this.zn.state;i.isInvalid=null!=n,i.isHovered&&this.qi.applyTitle()}return n}return null},n.prototype.applyTitle=function(){var t=this.Sr;if(at(t)){var n=rt.getLayer(this.zn);return n&&(n.view.title=t),!0}return!1},n}(br),pr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.mr),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.mr),t.prototype.onElementDetached.call(this,n,i,r)},n}(wr),Or=function(t){function n(n,i,r,e){var u,s,h,o=t.call(this,n,i,r,e)||this;return o.Tr=null!==(u=null==e?void 0:e.step)&&void 0!==u?u:r.getStep(),o.jr=null!==(s=null==e?void 0:e.min)&&void 0!==s?s:r.getMin(),o.Nr=null!==(h=null==e?void 0:e.max)&&void 0!==h?h:r.getMax(),o}return _(n,t),Object.defineProperty(n.prototype,"step",{get:function(){return this.Tr},set:function(t){this.Tr!==t&&(this.Tr=t,this.onStepChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.jr},set:function(t){this.jr!==t&&(this.jr=t,this.onMinChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.Nr},set:function(t){this.Nr!==t&&(this.Nr=t,this.onMaxChange())},enumerable:!1,configurable:!0}),n.prototype.toValue=function(n){var i=t.prototype.toValue.call(this,n);if(i==i){var r=this.jr;if(null!=r&&i<r)return r;var e=this.Nr;return null!=e&&e<i?e:i}return 0},n.prototype.fromValue=function(t){return void 0!==t?this.Dr(t,this):"0"},n.prototype.onStepChange=function(){if(this.isShown()){var t=this.element;t&&this.updateStep(t)}},n.prototype.onMinChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMin(t)}},n.prototype.onMaxChange=function(){if(this.isShown()){var t=this.element;t&&this.updateMax(t)}},n.prototype.updateStep=function(t){var n=this.step;t.step=null!=n?""+n:"any"},n.prototype.updateMin=function(t){var n=this.min;null!=n?t.min=""+n:t.removeAttribute("min")},n.prototype.updateMax=function(t){var n=this.max;null!=n?t.max=""+n:t.removeAttribute("max")},n.prototype.onElementAttached=function(n,i,r){n.type="number",t.prototype.onElementAttached.call(this,n,i,r),this.updateStep(n),this.updateMin(n),this.updateMax(n)},n}(pr),Dr={EMIT_EVENT:0,WRITE_BOTH:1,WRITE_LOCAL:2,WRITE_REMOTE:3},Er=function(){function t(){}return t.execute=function(t,n,i,r,e){switch(n){case Dr.EMIT_EVENT:t.emit(i,t,r),or.emit(t,i,r,e);break;case Dr.WRITE_LOCAL:or.write(t,i,r,e,!1);break;case Dr.WRITE_REMOTE:or.write(t,i,r,e,!0);break;case Dr.WRITE_BOTH:or.write(t,i,r,e,!1),or.write(t,i,r,e,!0)}},t}(),Mr=function(t){function n(n){var i=t.call(this,n)||this;return i.target=qt.ofStringOrNull(n.target),i.onInputAction=n.onInputAction,i}return _(n,t),n.prototype.newOperation=function(t,n){var i=this;return{getElementRect:function(r,e,u){return i.getElementRect(t,n,r,e,u)},getElementMatrix:function(){return i.getElementMatrix(t,n)},getClipperRect:function(r,e,u){return i.getClipperToRect(t,n,r,e,u)},getPadding:function(){return i.getPadding(t,n)},containsPoint:function(r){return i.containsPoint(t,n,r)},onStart:function(){t.text.enable=!1},onCancel:function(){t.text.enable=!0},onEnd:function(){},getValue:function(){return i.getUtil(t,n).toValue(t.text.value)},onValueInput:function(t){},onValueChange:function(r,e){i.onValueChange(t,n,r,e)},onEnter:function(){},applyTitle:function(){}}},n.prototype.newElementCreator=function(t,n){},n.prototype.getPadding=function(t,n){return t.text.padding},n.prototype.onValueChange=function(t,n,i,r){t.text.value=this.getUtil(t,n).fromValue(i);var e=Date.now(),u=this.target(t,e);null!=u&&Er.execute(t,this.onInputAction,u,i,e)},n}(dr),Sr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Mr),Tr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Sr),jr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new Or(t,this.newOperation(t,n),K.getInstance().get("DInputInteger"),this.newUtilOptions(t,n))},n}(Tr),Nr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new Or(t,this.newOperation(t,n),K.getInstance().get("DInputReal"),this.newUtilOptions(t,n))},n}(Tr),Ir=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.type="text",t.prototype.onElementAttached.call(this,n,i,r)},n}(pr),Cr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(t,n){return new Ir(t,this.newOperation(t,n),K.getInstance().get("DInputText"),this.newUtilOptions(t,n))},n}(Sr),Ar=function(t){function n(n){var i=t.call(this,n,Yt.NONE)||this;return i.target=qt.ofStringOrNull(n.target),i.value=qt.ofUnknown(n.value),i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.target(t,i);null!=r&&this.write(t,r,this.value(t,i),i)}},n}(Qt),Rr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){or.write(t,n,i,r,!1),or.write(t,n,i,r,!0)},n}(Ar),yr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){or.write(t,n,i,r,!1)},n}(Ar),kr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.write=function(t,n,i,r){or.write(t,n,i,r,!0)},n}(Ar),Lr=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.MISC,i,n)||this;return s.target=r,s.onInputAction=e,s.value=u,s}return _(n,t),n.prototype.toRuntime=function(){switch(this.subtype){case gr.INPUT_TEXT:return new Cr(this);case gr.INPUT_INTEGER:return new jr(this);case gr.INPUT_REAL:return new Nr(this);case gr.EMIT_EVENT:return new fr(this);case gr.WRITE_BOTH:return new Rr(this);case gr.WRITE_LOCAL:return new yr(this);case gr.WRITE_REMOTE:return new kr(this);case gr.HTML_ELEMENT:case gr.HTML_ELEMENT_WITHOUT_POINTER_EVENTS:return new mr(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.value);return t.addResource("["+this.type+","+n+","+this.subtype+","+i+","+this.onInputAction+","+r+"]")},n.deserialize=function(t,i){var r=i.resources,e=ln.toResource(1,t,r),u=ln.toResource(3,t,r),s=ln.toResource(5,t,r);return new n(t[2],e,u,t[4],s)},n}(cn),xr={NONE:0,DRAG:1,PINCH:2,ALL:3},Br=t.interaction.InteractionEvent,_r=function(n){function i(t){var i=n.call(this,t,Yt.NONE)||this;return i.Ir=t.gestureType,i.Cr=t.scaleMin,i.Ar=t.scaleMax,i}return _(i,n),i.prototype.onDown=function(t,i,r){n.prototype.onDown.call(this,t,i,r),r instanceof Br&&this.condition(t,r.data.originalEvent.timeStamp)&&this.getGestureUtil().onDown(t,r)},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new rr({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.Ir,c=!1,f=1;if(a&xr.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Ar,Math.max(this.Cr,v*u));f=b/v,l.set(b,b),c=!0}if(a&xr.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&rt.update(t)}},i}(Qt),Pr=function(t){function n(n,i,r,e){var u=t.call(this,fn.MISC,n,gr.GESTURE)||this;return u.gestureType=i,u.scaleMin=r,u.scaleMax=e,u}return _(n,t),n.prototype.toRuntime=function(){return new _r(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.gestureType+","+this.scaleMin+","+this.scaleMax+"]")},n.deserialize=function(t,i){return new n(ln.toResource(1,t,i.resources),t[3],t[4],t[5])},n}(cn),Fr=function(){function n(n,i,r,e,u){this.id=n,this.ref=0;var s=u.resolution;this.frame=new t.Rectangle(0,0,i*s,r*s),this.texture=new t.Texture(u,new t.Rectangle(0,0,1,1)),this.width=i,this.height=r,this.strokeWidth=e}return n.prototype.applyFrame=function(){var t=1/this.texture.baseTexture.resolution;this.texture.frame.x=this.frame.x*t,this.texture.frame.y=this.frame.y*t,this.texture.frame.width=this.width,this.texture.frame.height=this.height,this.texture.updateUvs(),this.texture.emit("update",this)},n.prototype.destroy=function(){this.texture.destroy()},n}(),Ur=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){},n}(Fr),Gr=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.save(),t.fillStyle="#ffffff",t.fillRect(n.x-1,n.y-1,n.width+2,n.height+2),t.restore()},n}(Fr),zr=function(){function n(n){var i=this.Yi=document.createElement("canvas");i.width=i.height=256;var r=this.Rr=t.BaseTexture.from(i,{mipmap:t.MIPMAP_MODES.OFF,resolution:n});this.yr={},this.kr=[],this.Lr={empty:new Ur("empty",10,10,0,r),white:new Gr("white",10,10,0,r)},this.un=!0}return n.prototype.updateFrames=function(t,n){for(var i=4,r=4,e=0,u=0,s=n.length;u<s;++u){var h=n[u];t<i+h.frame.width+4&&(i=4,r+=e+4,e=0),h.frame.x=0|i,h.frame.y=0|r,i+=h.frame.width+4,e=Math.max(e,h.frame.height)}for(var o=r+e+4,a=256;a<o;)a<<=1;return Math.min(4096,a)},n.prototype.renderFrames=function(t,n,i){var r=this.Yi;r.width=t,r.height=n;var e=r.getContext("2d");if(null!=e)for(var u=0,s=i.length;u<s;++u)i[u].render(e)},n.prototype.applyFrames=function(t){for(var n=0,i=t.length;n<i;++n)t[n].applyFrame()},n.prototype.calcCanvasWidth=function(t){for(var n=128,i=t.length-1;0<=i;--i)for(var r=t[i],e=Math.max(r.frame.width,r.frame.height);n<e;)n<<=1;return Math.min(4096,n<<1)},n.prototype.cleanup=function(t){t.sort(n.ITEM_COMPARATOR);for(var i=t.length-1;0<=i;--i)if(0<t[i].ref)return void(t.length=i+1);t.length=0},n.prototype.begin=function(){for(var t=this.kr,n=0,i=t.length;n<i;++n)t[n].ref=0;this.un=!1},n.prototype.end=function(){for(var t=this.yr,n=this.kr,i=0,r=n.length;i<r;++i){var e=n[i];e.ref<=0&&(e.id in this.Lr||e.destroy(),delete t[e.id],this.un=!0)}},n.prototype.repack=function(t){if(!0===t||this.un){this.un=!1;var n=this.kr;this.cleanup(n);var i=this.calcCanvasWidth(n),r=this.updateFrames(i,n);this.renderFrames(i,r,n),this.Rr.setRealSize(i,r),this.applyFrames(n)}},n.prototype.get=function(t){var n=this.yr[t];if(null!=n)return n.ref+=1,n;var i=this.Lr[t];return null!=i?(this.set(t,i),i):null},n.prototype.set=function(t,n){var i=this.yr[t];return n.ref+=1,this.yr[t]=n,this.kr.push(n),this.un=!0,i},n.prototype.toDirty=function(){this.un=!0},n.prototype.getDefaultTexture=function(){return this.get("white").texture},n.prototype.getBaseTexture=function(){return this.Rr},n.prototype.release=function(t){var n=this.yr,i=n[t];null!=i&&(i.ref-=1,i.ref<=0&&(i.id in this.Lr||i.destroy(),delete n[t],this.un=!0))},n.ITEM_COMPARATOR=function(t,n){return t.ref<=0?n.ref<=0?0:1:n.ref<=0||t.frame.height<n.frame.height?-1:n.frame.height<t.frame.height?1:t.frame.width-n.frame.width},n}(),Hr=function(t){function n(n,i){var r=t.call(this,n.id,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.canvas=n.canvas,r}return _(n,t),n.prototype.render=function(t){var n=this.canvas;if(null!=n){var i=this.frame;t.drawImage(n,i.x,i.y,i.width,i.height)}},n}(Fr),Vr="!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",Wr=function(t,n){this.x=t,this.y=n},Xr=function(t,n,i,r,e){this.ref=1,this.life=10,this.character=t,this.x=0,this.y=0,this.width=i,this.height=r,this.advance=n,this.origin=new Wr(0,0),this.type=e},Kr=function(){function t(){var t=this;this.Br=null,this._r=null,this.Pr=null,this.Fr=NaN,this.Ur=NaN,this.Gr=NaN,this.zr=NaN,this.Hr=null,this.Vr=null;var n=this.Yi=document.createElement("canvas");n.width=64,n.height=64,this.Wr=function(t){t.preventDefault()},this.Xr=function(){t.restore()},this.Kr=function(){t.destroy()},n.addEventListener("webglcontextlost",this.Wr,!1),n.addEventListener("webglcontextrestored",this.Xr,!1),window.addEventListener("unload",this.Kr,!1)}return t.prototype.init=function(){var t=this.Yi;if(null!=t&&(null==this.Br||this.Br.isContextLost())){var n={alpha:!0,antialias:!1,depth:!1,stencil:!1,premultipliedAlpha:!1},i=t.getContext("webgl",n)||t.getContext("experimental-webgl",n);this.Br=i,null!=i&&(i.clearColor(1,1,1,0),this.makeVertexBuffer(),this.makeUvBuffer(),this.makeShaders(),this._r=null)}return this},t.prototype.restore=function(){this.init()},t.prototype.getCanvas=function(){return this.Yi},t.prototype.getShader=function(t,n,i){var r=i?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER);return null==r||(t.shaderSource(r,n),t.compileShader(r),t.getShaderParameter(r,t.COMPILE_STATUS))?r:(console&&console.error("Failed to compile the shader: "+t.getShaderInfoLog(r)),null)},t.prototype.makeShaders=function(){var t=this.Br;if(null!=t&&!0!==t.isContextLost()){var n=this.getShader(t,"\nattribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nvarying mediump vec2 vTextureCoord;\nvoid main(void) {\n\tgl_Position = vec4(aVertexPosition, 0.0, 1.0);\n\tvTextureCoord = aTextureCoord;\n}\n",!1);if(null!=n){var i=this.getShader(t,"\nprecision mediump float;\n\nvarying mediump vec2 vTextureCoord;\nuniform sampler2D uSampler;\nuniform vec2 uSize;\n\nfloat calcDistance( float x, float y, float dx, float dy ) {\n\tfloat xd = x + dx;\n\tfloat yd = y + dy;\n\tfloat u = xd / uSize.x;\n\tfloat v = yd / uSize.y;\n\tfloat ul = (xd - 1.0) / uSize.x;\n\tfloat vt = (yd - 1.0) / uSize.y;\n\n\tfloat m = texture2D(uSampler, vec2(u , v )).a;\n\tfloat l = texture2D(uSampler, vec2(ul, v )).a;\n\tfloat t = texture2D(uSampler, vec2(u , vt)).a;\n\n\tfloat xl = mix( xd - 1.0, xd, (0.5 - l) / (m - l) );\n\tfloat yt = mix( yd - 1.0, yd, (0.5 - t) / (m - t) );\n\n\tbool bl = ( min(l, m) < 0.5 && 0.5 <= max(l, m) );\n\tbool bt = ( min(t, m) < 0.5 && 0.5 <= max(t, m) );\n\n\tfloat ll = (bl ? length( vec2( xl - x, yd - y ) ) : 100.0);\n\tfloat lt = (bt ? length( vec2( xd - x, yt - y ) ) : 100.0);\n\n\treturn min( ll, lt );\n}\n\nfloat calcDistancesY( float x, float y, float dx ) {\n\tfloat d = 100.0;\n\tfor( float dy=-6.0; dy<6.5; dy++ ) {\n\t\td = min( d, calcDistance( x, y, dx, dy ) );\n\t}\n\treturn d;\n}\n\nfloat calcDistances( float x, float y ) {\n\tfloat d = 100.0;\n\tfor( float dx=-6.0; dx<6.5; dx++ ) {\n\t\td = min( d, calcDistancesY( x, y, dx ) );\n\t}\n\treturn d;\n}\n\nvoid main(void) {\n\tfloat t = texture2D(uSampler, vTextureCoord).a;\n\tfloat x = vTextureCoord.x * uSize.x;\n\tfloat y = vTextureCoord.y * uSize.y;\n\tfloat d = min( 6.0, calcDistances( x, y ) ) / 12.0;\n\td = clamp( mix( 0.5 - d, 0.5 + d, step( 0.5, t ) ), 0.0, 1.0 );\n\tgl_FragColor = vec4(1.0, 1.0, 1.0, d);\n}\n",!0);if(null!=i){var r=this.Pr=t.createProgram();if(null!=r)return t.attachShader(r,n),t.attachShader(r,i),t.linkProgram(r),t.getProgramParameter(r,t.LINK_STATUS)?(t.deleteShader(n),t.deleteShader(i),t.useProgram(r),this.Fr=t.getAttribLocation(r,"aVertexPosition"),this.Ur=t.getAttribLocation(r,"aTextureCoord"),this.Gr=t.getUniformLocation(r,"uSampler"),this.zr=t.getUniformLocation(r,"uSize"),t.useProgram(null),r):(console&&console.error("Failed to link the program: "+t.getError()),t.deleteShader(n),t.deleteShader(i),null);t.deleteShader(n),t.deleteShader(i)}else t.deleteShader(n)}}return null},t.prototype.destroyShaders=function(){var t=this.Br;if(null!=t&&!0!==t.isContextLost()){var n=this.Pr;null!=n&&(this.Pr=null,t.useProgram(null),t.deleteProgram(n))}},t.prototype.updateTexture=function(t){var n=this.Br,i=this.Yi;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=t.width,e=t.height;i.width===r&&i.height===e||(i.width=r,i.height=e,n.viewport(0,0,r,e));var u=this._r;return null==u?(u=this._r=n.createTexture(),n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.NEAREST),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.NEAREST),n.bindTexture(n.TEXTURE_2D,null)):(n.bindTexture(n.TEXTURE_2D,u),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),n.bindTexture(n.TEXTURE_2D,null)),u}return null},t.prototype.destroyTexture=function(){var t=this.Br,n=this._r;null!=t&&!0!==t.isContextLost()&&null!=n&&(this._r=null,t.bindTexture(t.TEXTURE_2D,null),t.deleteTexture(n))},t.prototype.makeVertexBuffer=function(){var t=this.Br;if(null!=t&&!0!==t.isContextLost()){var n=this.Hr=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,1,1,1,-1,-1,1,-1]),t.STATIC_DRAW),n}return null},t.prototype.destroyVertexBuffer=function(){var t=this.Br,n=this.Hr;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.Hr=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.makeUvBuffer=function(){var t=this.Br;if(null!=t&&!0!==t.isContextLost()){var n=this.Vr=t.createBuffer();return t.bindBuffer(t.ARRAY_BUFFER,n),t.bufferData(t.ARRAY_BUFFER,new Float32Array([0,0,1,0,0,1,1,1]),t.STATIC_DRAW),n}return null},t.prototype.destroyUvBuffer=function(){var t=this.Br,n=this.Vr;null!=t&&!0!==t.isContextLost()&&null!=n&&(this.Vr=null,t.bindBuffer(t.ARRAY_BUFFER,null),t.deleteBuffer(n))},t.prototype.render=function(){var t=this.Br,n=this.Yi,i=this.Pr,r=this.Hr,e=this.Vr,u=this._r;if(null!=t&&!0!==t.isContextLost()&&null!=n&&null!=i&&null!=r&&null!=e&&null!=u){t.clear(t.COLOR_BUFFER_BIT),t.useProgram(i),t.bindBuffer(t.ARRAY_BUFFER,r);var s=this.Fr;t.enableVertexAttribArray(s),t.vertexAttribPointer(s,2,t.FLOAT,!1,0,0),t.bindBuffer(t.ARRAY_BUFFER,e);var h=this.Ur;t.enableVertexAttribArray(h),t.vertexAttribPointer(h,2,t.FLOAT,!1,0,0),t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,u),t.uniform1i(this.Gr,0),t.uniform2f(this.zr,n.width,n.height),t.drawArrays(t.TRIANGLE_STRIP,0,4),t.bindTexture(t.TEXTURE_2D,null),t.bindBuffer(t.ARRAY_BUFFER,null),t.useProgram(null)}},t.prototype.read=function(t){var n=this.Br,i=this.Yi;if(null!=n&&!0!==n.isContextLost()&&null!=i){var r=i.width,e=i.height;t.width=r,t.height=e;var u=t.getContext("2d");null!=u&&u.drawImage(i,0,0)}},t.prototype.destroy=function(){this.destroyVertexBuffer(),this.destroyUvBuffer(),this.destroyShaders();var t=this.Yi;null!=t&&(this.Yi=null,t.removeEventListener("webglcontextlost",this.Wr,!1),t.removeEventListener("webglcontextrestored",this.Xr,!1),window.removeEventListener("unload",this.Kr,!1));var n=this.Br;if(null!=n){this.Br=null;var i=n.getExtension("WEBGL_lose_context");null!=i&&i.loseContext()}},t.getInstance=function(){return null==t.Yr&&(t.Yr=new t),t.Yr},t.Yr=null,t}(),Yr=function(){function t(n){this.k="font-atlas:"+n,this.Jr=Kr.getInstance().init(),this.Yi=document.createElement("canvas"),this.Zr={family:t.toFontFamily(n),size:32,italic:!1},this.qr={},this.$r=0,this.Mt=1,this.nn=1,this.un=!0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"font",{get:function(){return this.Zr},set:function(t){this.Zr.family=t.family,this.Zr.size=t.size,this.Zr.italic=t.italic},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.nn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canvas",{get:function(){return this.Yi},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generator",{get:function(){return this.Jr},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"characters",{get:function(){return this.qr},enumerable:!1,configurable:!0}),t.prototype.begin=function(){this.$r=0;var t=this.qr;for(var n in t)t[n].ref=0},t.prototype.end=function(){var t=this.qr;for(var n in t){var i=t[n];i.ref<=0&&(i.life-=1,i.life<=0&&(delete t[n],this.un=!0))}},t.prototype.addAscii=function(){this.addChar(" "," ",5),this.addChar("\t"," ",5),this.addChar("...","...",11);for(var t=0,n=Vr.length;t<n;++t){var i=Vr[t];this.addChar(i,i,11)}},t.prototype.addChar=function(t,n,i){var r=this.qr;if(!this.isIgnored(n)){var e=r[t];null!=e?(e.ref<=0&&(this.$r+=1),e.ref+=1):(r[t]=new Xr(n,0,1,1,i),this.$r+=1,this.un=!0)}},t.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},t.prototype.add=function(t,n){void 0===n&&(n=8);for(var i=b.from(t);i.hasNext();){var r=i.next();this.addChar(r,r,n)}},t.prototype.get=function(t){return this.qr[t]},t.prototype.update=function(){if(this.un){var n=this.Yi,i=this.Jr;if(null!=n&&null!=i){var r=n.getContext("2d");if(null!=r){this.un=!1;var e=this.Zr,u=this.qr,s=e.size+14,h=t.toPowerOf2(Math.ceil(Math.sqrt(this.$r))*s);this.Mt=h;var o=(e.italic?"italic ":"")+e.size+"px "+e.family;r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=0,r.fillStyle="#FFFFFF";var a=s>>1,c=0,f=0;for(var l in u){var v=u[l],b=r.measureText(v.character).width,d=Math.ceil(7+b+7),g=s;h<=c+d&&(c=0,f+=s),v.x=c,v.y=f,v.width=d,v.height=g,v.advance=b,v.origin.x=c+7,v.origin.y=f+a,c+=d}var m=this.nn=f+s;for(var l in n.width=h,n.height=m,r.font=o,r.textAlign="left",r.textBaseline="middle",r.lineWidth=0,r.lineCap="round",r.lineJoin="miter",r.miterLimit=4,r.fillStyle="#FFFFFF",r.clearRect(0,0,h,m),u)v=u[l],r.fillText(v.character,v.origin.x,v.origin.y);return i.updateTexture(n),i.render(),i.read(n),!0}}}return!1},Object.defineProperty(t.prototype,"length",{get:function(){return this.$r},enumerable:!1,configurable:!0}),t.prototype.toJson=function(){return{width:this.Mt,height:this.nn,font:this.Zr,characters:this.qr}},t.prototype.toString=function(){return JSON.stringify(this.toJson())},t.prototype.destroy=function(){null!=this.Jr&&(this.Jr=null),null!=this.Yi&&(this.Yi=null);var t=this.qr;for(var n in t)delete t[n]},t.toFontFamily=function(n){return"auto"===n?t.getAutoFontFamily():n},t.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},t.getAutoFontFamily=function(){return null==t.FONT_FAMILY_AUTO&&(t.FONT_FAMILY_AUTO=K.getInstance().get("DBase").getFontFamilly()),t.FONT_FAMILY_AUTO},t.FONT_FAMILY_AUTO=null,t}(),Jr=function(){function t(){this.Qr={}}return t.prototype.begin=function(){var t=this.Qr;for(var n in t)t[n].begin()},t.prototype.end=function(){var t=this.Qr;for(var n in t){var i=t[n];0<i.length&&i.addAscii(),i.end(),i.length<=0&&(i.destroy(),delete t[n])}},t.prototype.add=function(t,n){var i=this.Qr[t];if(null!=i)i.add(n);else{var r=new Yr(t);r.add(n),this.Qr[t]=r}},t.prototype.get=function(t){var n=this.Qr[t];return null!=n?n:null},t.prototype.update=function(t){var n=this.Qr,i=t.getBaseTexture();for(var r in n){var e=n[r];if(e.update()){var u=e.id,s=t.get(u);if(null!=s){var h=e.width,o=e.height,a=i.resolution;s.frame.width=h,s.frame.height=o,s.width=h/a,s.height=o/a,t.toDirty()}else t.set(u,new Hr(e,i))}}},t.prototype.destroy=function(){var t=this.Qr;for(var n in t)t[n].destroy();this.Qr={}},t}(),Zr=function(t){function n(n,i){var r=t.call(this,n.src,n.width/i.resolution,n.height/i.resolution,0,i)||this;return r.image=n,r}return _(n,t),n.prototype.render=function(t){var n=this.frame,i=n.x,r=n.y,e=n.width,u=n.height,s=this.image;t.drawImage(s,i,r,e,u),t.drawImage(s,0,0,1,u,i-1,r-1,1,u+2),t.drawImage(s,0,0,e,1,i,r-1,e,1),t.drawImage(s,e-1,0,1,u,i+e,r-1,1,u+2),t.drawImage(s,0,u-1,e,1,i,r+u,e,1)},n}(Fr),qr=function(t,n){this.texture=t,this.indexOffset=n},$r=function(){function t(){this.index=0,this.baseTexture=null,this.units=[]}return t.prototype.begin=function(){this.index=0,this.baseTexture=null},t.prototype.push=function(t,n){if(this.index<this.units.length){var i=this.units[this.index];i.texture=t,i.indexOffset=n}else this.units.push(new qr(t,n));this.index+=1},t.prototype.end=function(){this.units.length!==this.index&&(this.units.length=this.index)},t.prototype.destroy=function(){this.units.length=0},t}(),Qr=function(){function n(t,n){var i=3*t,r=i;this.vertices=new Float32Array(2*r),this.te=r,this.o=0,this.hn=null,this.clippings=new Float32Array(3*r),this.ne=null,this.steps=new Float32Array(6*r),this.ie=null,this.colorFills=new Float32Array(4*r),this.re=null,this.colorStrokes=new Float32Array(4*r),this.ee=null,this.uvs=new Float32Array(2*r),this.cn=null;var e=r<=65535;this.indices=e?new Uint16Array(i):new Uint32Array(i),this.ue=t,this.l=0,this.indexCountRequested=0,this.fn=null,this.se=n,this.he=new $r,this.oe=null}return n.prototype.updateVertices=function(){var t=this.hn;t&&t.update()},n.prototype.updateClippings=function(){var t=this.ne;t&&t.update()},n.prototype.updateSteps=function(){var t=this.ie;t&&t.update()},n.prototype.updateColorFills=function(){var t=this.re;t&&t.update()},n.prototype.updateColorStrokes=function(){var t=this.ee;t&&t.update()},n.prototype.updateUvs=function(){var t=this.cn;t&&t.update()},n.prototype.updateIndices=function(){var t=this.fn;t&&t.update()},n.prototype.getGeometry=function(){var n=this.oe;return null==n&&(this.hn=new t.Buffer(this.vertices,!1,!1),this.ne=new t.Buffer(this.clippings,!1,!1),this.ie=new t.Buffer(this.steps,!1,!1),this.re=new t.Buffer(this.colorFills,!1,!1),this.ee=new t.Buffer(this.colorStrokes,!1,!1),this.cn=new t.Buffer(this.uvs,!1,!1),this.fn=new t.Buffer(this.indices,!1,!0),this.oe=n=(new t.Geometry).addIndex(this.fn).addAttribute("aPosition",this.hn,2).addAttribute("aClipping",this.ne,3).addAttribute("aStep",this.ie,2).addAttribute("aAntialias",this.ie,4).addAttribute("aColorFill",this.re,4).addAttribute("aColorStroke",this.ee,4).addAttribute("aUv",this.cn,2)),n},n.prototype.upload=function(){this.se.geometry.bind(this.getGeometry())},n.prototype.render=function(n){var i=this.se;i.geometry.bind(this.getGeometry());var r=this.he.units,e=r.length;if(0<e){for(var u=t.DRAW_MODES.TRIANGLES,s=null,h=r[0],o=0,a=3*h.indexOffset,c=0,f=t.Texture.WHITE,l=0,v=e-1;l<v;++l)s=h,o=a,c=(a=3*(h=r[l+1]).indexOffset)-o,f=s.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,o));c=3*this.l-a,f=h.texture||t.Texture.WHITE,0<c&&f.valid&&(n.uniforms.sampler=i.texture.bind(f),i.geometry.draw(u,c,a))}},n.prototype.isCompatible=function(t,n,i,r){return n.getBuffer()===this&&n.getVertexOffset()===i&&n.getIndexOffset()===r&&n.isCompatible(t)},n.prototype.update=function(t,n,i){var u=this.he;u.begin();for(var s=0,h=0,o=t.get();null!=o&&null!=(a=o.uploaded)&&this.isCompatible(o,a,s,h);o=t.next())if(a.update(o),a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i)return t.next(),u.end(),this.o=s,this.l=h,0<u.units.length;for(;null!=o;o=t.next()){var a,c=e[o.type]||e[r.GROUP];if(null==c)break;if(null==(a=c(this,o,s,h,n)))break;if(a.buildUnit(u),s+=a.getVertexCount(),h+=a.getIndexCount(),i){t.next();break}}return u.end(),this.o=s,this.l=h,0<u.units.length},n.prototype.check=function(t,n,i,r){return this.indexCountRequested=r,t+i<=this.te&&n+r<=this.ue},n.prototype.destroy=function(){var t=this.oe;t&&t.destroy(),this.he.destroy()},n}(),te=[],ne=function(){function t(){this.index=0,this.shapes=te}return t.prototype.reset=function(t){this.index=-1,this.shapes=t},t.prototype.next=function(){var t=this.index+1;this.index=t;var n=this.shapes;return t<n.length?n[t]:null},t}(),ie=function(){function t(){this.ae=-1,this.ce=new ne,this.$i=[this.ce],this.fe=null}return t.prototype.reset=function(t,n){this.ae=0;var i=this.$i[0];return this.ce=i,i.reset(n),null!=t?(this.fe=t,t):this.next()},t.prototype.get=function(){return this.fe},t.prototype.next=function(){var t=this.ce.next();if(null!=t){this.fe=t;var n=t.children;if(0<n.length)if((r=this.ae=this.ae+1)<(e=this.$i).length)(i=e[r]).reset(n),this.ce=i;else{var i=new ne;e.push(i),i.reset(n),this.ce=i}return t}var r=this.ae=this.ae-1,e=this.$i;return 0<=r?(this.ce=e[r],this.fe=null,this.next()):(this.fe=null,null)},t}(),re=function(n){function i(r){var e=n.call(this,r)||this;return i.SHADER=i.SHADER||t.Shader.from("\nattribute vec2 aPosition;\nattribute vec3 aClipping;\nattribute vec2 aStep;\nattribute vec4 aAntialias;\nattribute vec4 aColorFill;\nattribute vec4 aColorStroke;\nattribute vec2 aUv;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\nuniform mediump float shapeScale;\nuniform mediump float pixelScale;\nuniform mediump float antialiasWeight;\n\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nvec2 toInverse( in vec2 v ) {\n\treturn vec2( -v.y, v.x );\n}\n\nvec2 toTransformedPosition( in vec2 v ) {\n\treturn (projectionMatrix * translationMatrix * vec3(v, 1.0)).xy;\n}\n\nvec4 toAntialias01( in vec4 antialias ) {\n\t// Taylor series of 1 / ( 1 - a ) = 1 + a + a^2 + ....\n\treturn 1.0 + min( vec4( 1.0 ), antialias * pixelScale );\n}\n\nvec4 toAntialias2( in vec4 antialias, in float strokeWidth ) {\n\tfloat x = min( 0.4, 0.4 / 12.0 * antialias.x * pixelScale * antialiasWeight );\n\tfloat w = clamp( strokeWidth / antialias.y, 0.0, 1.0 ) * 0.4;\n\tfloat p = w * antialias.z + antialias.w;\n\tfloat y = 0.5 - p;\n\tfloat z = 0.5 - p - w;\n\treturn vec4( y, z, y - max( 0.01, y - x ), z - max( 0.01, z - x ) );\n}\n\nvec2 toPosition3456( in float type, in vec2 p, in vec2 pprev, in vec2 pnext, in float strokeWidth, out float shift ) {\n\tvec2 d0 = p - pprev;\n\tvec2 d1 = pnext - p;\n\tfloat l0 = dot( d0, d0 );\n\tfloat l1 = dot( d1, d1 );\n\tvec2 nd0 = normalize( toInverse( d0 ) );\n\tvec2 nd1 = normalize( toInverse( d1 ) );\n\tvec2 nd2 = 0.00001 < l1 ? nd1 : vec2(0.0, 0.0);\n\tvec2 n0 = 0.00001 < l0 ? nd0 : nd2;\n\tvec2 n1 = 0.00001 < l1 ? nd1 : n0;\n\tvec2 n0i = toInverse( n0 );\n\tvec2 n1i = toInverse( n1 );\n\tfloat direction = sign( 4.5 - type );\n\n\t// Offset\n\tfloat cross = dot( n0i, n1 );\n\tfloat crossInverse = ( 0.00001 < abs( cross ) ? 1.0 / cross : 0.0 );\n\tfloat b = dot(n1 - n0, n0) * crossInverse;\n\tfloat offsetSize = direction * strokeWidth * 0.5;\n\tvec2 offset = n1 + n1i * b;\n\n\t// Miter\n\tvec2 pmiter = p + offsetSize * offset;\n\tfloat miterAngle0 = dot( n0i, pmiter - pprev );\n\tfloat miterAngle1 = dot( n1i, pmiter - pnext );\n\tfloat miterLength = dot( offset, offset );\n\tfloat miterSide = direction * cross;\n\n\t// Bevel\n\tvec2 n = ( type == 4.0 || type == 6.0 ? n1 : n0 );\n\tvec2 pbevel = p + offsetSize * n;\n\n\t//\n\tvec2 presult = (\n\t\t0.0 <= miterSide ?\n\t\t( miterAngle0 < 0.0 && 0.0 <= miterAngle1 ? pmiter : pbevel ) :\n\t\t( miterLength < 6.0 ? pmiter : pbevel )\n\t);\n\tvec2 ni = ( type == 4.0 || type == 6.0 ? n1i : n0i );\n\tshift = dot( ni, p - presult );\n\treturn toTransformedPosition( presult );\n}\n\nvec2 toStep3456( in float type ) {\n\treturn ( type < 4.5 ? vec2( 1.0, 0.0 ) : vec2( 0.0, 1.0 ) );\n}\n\nvec4 toAntialias3456( in float strokeWidth ) {\n\tfloat a = antialiasWeight / max( 0.0001, strokeWidth );\n\treturn toAntialias01( vec4( a, a, a, a ) );\n}\n\nfloat toDotAndDashScale( in float scale, in float strokeWidthScale ) {\n\treturn (\n\t\tscale == 4.0 || scale == 5.0 || scale == 6.0 || scale == 7.0 ?\n\t\tstrokeWidthScale : 1.0\n\t);\n}\n\nvec4 toColorStroke3456( in float shift, in float scale ) {\n\tfloat x = aColorFill.x + shift;\n\tfloat y = scale * aColorFill.y;\n\tfloat z = scale * aColorFill.z;\n\tfloat w = aColorFill.w;\n\treturn vec4( x, y, z, w );\n}\n\nfloat toStrokeWidthScale( in float scale ) {\n\treturn (\n\t\tscale == 3.0 || scale == 7.0 ?\n\t\tshapeScale : (\n\t\t\tscale == 1.0 || scale == 5.0 ?\n\t\t\tmin( 1.0, shapeScale ) : (\n\t\t\t\tscale == 2.0 || scale == 6.0 ?\n\t\t\t\tmax( 1.0, shapeScale ) : 1.0\n\t\t\t)\n\t\t)\n\t);\n}\n\nvec2 toStep01(in vec2 size, in vec2 weight, in vec2 strokeWidth) {\n\treturn weight / max(vec2(0.00001), vec2(1.0) - strokeWidth / size);\n}\n\nvec4 toAntialias01b(in vec2 size, in vec2 strokeWidth) {\n\treturn antialiasWeight / max(vec4(0.00001), vec4(size - strokeWidth, size));\n}\n\nvoid main(void) {\n\tvec2 p012 = toTransformedPosition( aPosition );\n\n\tfloat type = aClipping.z;\n\tfloat strokeWidthScale = toStrokeWidthScale( aStep.y );\n\tfloat strokeWidth = strokeWidthScale * aStep.x;\n\n\t// type === 0 or 1\n\tvec2 size01 = aAntialias.xy;\n\tvec2 weight01 = abs(aAntialias.zw - sign(aAntialias.zw));\n\tvec2 strokeWidth01 = step(vec2(0.0), aAntialias.zw) * strokeWidth;\n\tvec2 step01 = toStep01( size01, weight01, strokeWidth01 );\n\tvec4 a01 = toAntialias01( toAntialias01b( size01, strokeWidth01 ) );\n\n\t// type === 2\n\tvec4 a2 = toAntialias2( aAntialias, strokeWidth );\n\n\t// type === 3, 4, 5 or 6\n\tfloat shift3456 = 0.0;\n\tvec2 p3456 = toPosition3456( type, aPosition, aAntialias.xy, aAntialias.zw, strokeWidth, shift3456 );\n\tvec2 step3456 = toStep3456( type );\n\tvec4 a3456 = toAntialias3456( strokeWidth );\n\tvec4 colorStroke3456 = toColorStroke3456( shift3456, toDotAndDashScale( aStep.y, strokeWidthScale ) );\n\n\t//\n\tgl_Position = vec4( ( 2.5 < type ? p3456 : p012 ), 0.0, 1.0 );\n\tvAntialias = ( 1.5 < type ? ( 2.5 < type ? a3456 : a2 ) : a01 );\n\tvClipping = aClipping;\n\tvStep = ( 2.5 < type ? step3456 : step01 );\n\tvColorFill = ( 2.5 < type ? aColorStroke : aColorFill );\n\tvColorStroke = ( 2.5 < type ? colorStroke3456 : aColorStroke );\n\tvUv = aUv;\n}","\nvarying mediump vec3 vClipping;\nvarying mediump vec2 vStep;\nvarying mediump vec4 vAntialias;\nvarying mediump vec4 vColorFill;\nvarying mediump vec4 vColorStroke;\nvarying mediump vec2 vUv;\n\nuniform sampler2D sampler;\nuniform mediump float pixelScale;\n\nvoid main(void) {\n\tvec4 texture = texture2D(sampler, vUv);\n\tfloat type = vClipping.z;\n\tvec2 v0 = vStep;\n\tvec2 v1 = vClipping.xy;\n\tvec2 v2 = v0 * vAntialias.xy;\n\tvec2 v3 = v1 * vAntialias.zw;\n\tvec2 d01 = ( v0.x < v0.y ? vec2( v0.y, v2.y ) : vec2( v0.x, v2.x ) );\n\tvec2 d02 = ( v1.x < v1.y ? vec2( v1.y, v3.y ) : vec2( v1.x, v3.x ) );\n\tvec4 d0 = vec4( d01.x, d02.x, d01.y, d02.y );\n\tvec4 d1 = vec4( dot( v0, v0 ), dot( v1, v1 ), dot( v2, v2 ), dot( v3, v3 ) );\n\tvec4 d = ( type == 1.0 ? d1 : d0 );\n\tvec2 s = smoothstep( 1.0 - (d.zw - d.xy), vec2( 1.0 ), d.xy );\n\tvec4 color01 = texture * (vColorStroke * (s.x - s.y) + vColorFill * (1.0 - s.x));\n\n\tfloat l = vColorStroke.x;\n\tfloat lp0 = vColorStroke.y;\n\tfloat lp1 = vColorStroke.z;\n\tfloat lt = vColorStroke.w;\n\tfloat ld = 0.5 * pixelScale;\n\tfloat lm = mod( l, lp0 + lp1 );\n\tfloat ls0 = ( 0.0 < lp1 ? smoothstep( 0.0, ld, lm ) - smoothstep( lp0, lp0 + ld, lm ) : 1.0 );\n\tfloat ls1 = ( 0.0 <= lt ? smoothstep( 0.0, ld, l ) - smoothstep( lt - ld, lt, l ) : 1.0 );\n\tvec4 color3456 = color01 * ls0 * ls1;\n\n\tvec2 a0 = vAntialias.xy;\n\tvec2 a1 = vAntialias.zw;\n\tvec2 a2 = vec2( texture.a );\n\tvec2 a = smoothstep( a0 - a1, a0 + a1, a2 );\n\tvec4 color2 = a.x * vColorFill + ( a.y - a.x ) * vColorStroke;\n\tgl_FragColor = ( type == 2.0 ? color2 : (2.5 < type ? color3456 : color01) );\n}"),e.le=i.SHADER,e.ve=new ie,e.be=e.getBufferSizeMax(r),e}return _(i,n),i.prototype.getBufferSizeMax=function(t){var n=t.context,i=n.extensions;return 1<n.webGLVersion||i.uint32ElementIndex?1431655765:21845},i.prototype.updateAtlas=function(t,n,i,r,e){var u=t.imageSrc;if(null!=u){var s=n.get(u);if(null!=s)t.texture=s.texture;else{var h=t.image;if(null!=h){var o=new Zr(h,e);t.texture=o.texture,n.set(o.id,o)}else t.texture=r}}else t.texture=r;var a=t.text,c=a.value;0<c.length&&i.add(a.family,c)},i.prototype.updateAtlases=function(t,n,i,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u];this.updateAtlas(h,n,i,r,e);for(var o=h.children,a=0,c=o.length;a<c;++a){var f=o[a];this.updateAtlas(f,n,i,r,e),this.updateAtlases(f.children,n,i,r,e)}}},i.prototype.updateFontAtlas=function(t,n,i,r){var e=t.text,u=i.get(e.family);if(null!=u){var s=n.get(u.id);null!=s?(e.atlas=u,e.texture=s.texture):(e.atlas=void 0,e.texture=r)}else e.atlas=void 0,e.texture=r},i.prototype.updateFontAtlases=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];this.updateFontAtlas(s,n,i,r);for(var h=s.children,o=0,a=h.length;o<a;++o){var c=h[o];this.updateFontAtlas(c,n,i,r),this.updateFontAtlases(c.children,n,i,r)}}},i.prototype.de=function(n,i,r,e){var u=this.renderer,s=this.le;if(null!=s&&(null!=i||0<r.length)){var h=u.resolution,o=n.getBuffers(),a=n.getAntialiasWeight(h);if(e){var c=n.getAtlas(h),f=n.getFontAtlases();c.begin(),f.begin();var l=c.getDefaultTexture(),v=c.getBaseTexture();this.updateAtlases(r,c,f,l,v),f.end(),f.update(c),this.updateFontAtlases(r,c,f,l),c.end(),c.repack(),this.updateBuffers(i,r,o,u,a)}s.uniforms.shapeScale=n.toShapeScale(),s.uniforms.pixelScale=n.toPixelScale(h),s.uniforms.antialiasWeight=a,s.uniforms.translationMatrix=n.worldTransform.toArray(!0),u.shader.bind(s,!1),u.state.setBlendMode(t.utils.correctBlendMode(t.BLEND_MODES.NORMAL,!0));var b=o.length;if(1<b)for(var d=0;d<b;++d)o[d].upload();for(d=0;d<b;++d)o[d].render(s)}},i.prototype.updateBuffers=function(t,n,i,r,e){var u=this.ve;u.reset(t,n);for(var s=0,h=0,o=5e3,a=this.be;null!=u.get();){var c=null,f=!1;if(0<h?(c=new Qr(h,r),i.splice(s,0,c),f=!0):s<i.length?(c=i[s],f=!1):(c=new Qr(o,r),i.push(c),f=!1),c.update(u,e,f))h=0,s+=1;else{if(!((h=c.indexCountRequested)<=a))break;h=Math.ceil(h/o)*o,h=Math.min(h,a)}}if(s<i.length){for(var l=s,v=i.length;l<v;++l)i[l].destroy();i.length=s}},i.SHADER=null,i}(t.ObjectRenderer),ee=function(n){function i(){var i=n.call(this)||this;return i.ge=null,i.children=[],i.me=null,i.we=0,i.pe=-1,i.Oe=null,i.De=new Jr,i.Ee=1,i.Me=NaN,i.Se=1,i.Te=NaN,i.je=new t.Point,i.Ne=[],i}return _(i,n),i.prototype.calculateBounds=function(){this._bounds.clear()},i.prototype.onChildTransformChange=function(){},i.prototype.toDirty=function(){return this.we+=1},i.prototype.isDirty=function(){return this.pe<this.we},i.prototype.render=function(t){if(this.visible&&!(this.worldAlpha<=0)&&this.renderable){var n=this.we,i=this.pe;this.pe=n;var r=i<n,e=this.ge;null==e&&(e=this.ge=new re(t)),t.batch.setObjectRenderer(e);var u=this.mask,s=this.me,h=this.children;u?(t.mask.push(this,u),e.de(this,s,h,r),t.mask.pop(this)):e.de(this,s,h,r)}},i.prototype.containsPoint=function(t){return!1},i.prototype.getFontAtlases=function(){return this.De},i.prototype.getAtlas=function(t){var n=this.Oe;return null==n&&(n=new zr(t),this.Oe=n),n},i.prototype.getBuffers=function(){return this.Ne},i.prototype.toShapeScale=function(){this.updateTransform();var t=this.transform,n=t._worldID;if(n!==this.Te){this.Te=n;var i=t.worldTransform,r=i.a,e=i.b;this.Se=1/Math.sqrt(r*r+e*e)}return this.Se},i.prototype.getShapeScale=function(){return this.Se},i.prototype.toPixelScale=function(t){var n=this.toShapeScale(),i=this.Te;return this.Me!==i&&(this.Me=i,this.Ee=1/t*n),this.Ee},i.prototype.getPixelScale=function(){return this.Ee},i.prototype.getAntialiasWeight=function(t){return 1.25/t},i.prototype.hitTest=function(t,n){for(var i=this.je,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible){u.toLocal(t,void 0,i);var s=u.contains(i.x,i.y);if(null!=s&&(null==n||n(s)))return s}}return null},i.prototype.hitTestBBox=function(t,n){for(var i=this.je,r=this.children,e=r.length-1;0<=e;--e){var u=r[e];if(u.visible&&(u.toLocal(t,void 0,i),u.containsBBox(i.x,i.y)&&(null==n||n(u))))return u}return null},i.prototype.destroy=function(){var t=this.Ne;if(null!=t)for(var i=0,r=t.length;i<r;++i)t[i].destroy();this.Ne.length=0;var e=this.children;for(i=e.length-1;0<=i;--i)e[i].destroy();e.length=0,n.prototype.destroy.call(this)},i}(t.DisplayObject),ue=function(){function t(){}return t.toLayers=function(t,n){var i=[],r=this.toLayer(t);if(r){var e=r.parent;if(e)for(var u=e.children,s=u.length,h=0,o=n.length;h<o;++h){var a=n[h];0<=a&&a<s&&i.push(u[a])}}return i},t.toLayer=function(t){for(var n=t.parent;null!=n;){if(n instanceof ee)return n;if(n.type===r.EMBEDDED_LAYER)return n;n=n.parent}return null},t.show=function(t){return!t.visible&&(t.visible=!0,!0)},t.showAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible||(e.visible=!0,n=!0)}return n},t.hide=function(t){return!!t.visible&&(t.visible=!1,!0)},t.hideAll=function(t){for(var n=!1,i=0,r=t.length;i<r;++i){var e=t[i];e.visible&&(e.visible=!1,n=!0)}return n},t.bringToFront=function(t){var n=t.parent;return!!n&&this.doBringToFront(t,n.children,0)},t.bringAllToFront=function(t){var n=t.length;if(0<n){var i=t[0].parent;if(i){for(var r=!1,e=i.children,u=0;u<n;++u){var s=t[n-1-u];this.doBringToFront(s,e,u)&&(r=!0)}return r}}return!1},t.doBringToFront=function(t,n,i){for(var r=n.length-1-i,e=r;0<=e;--e){var u=n[e];if(u===t){if(e!==r){for(var s=e+1;s<=r;++s)n[s-1]=n[s];return n[r]=u,!0}return!1}}return!1},t}(),se=t.interaction.InteractionEvent,he=function(n){function i(t){var i=n.call(this,t,Yt.NONE)||this;return i.Ie=new Map,i.Ir=t.gestureType,i.Cr=t.scaleMin,i.Ar=t.scaleMax,i}return _(i,n),i.prototype.initialize=function(t,i){if(n.prototype.initialize.call(this,t,i),null==this.Ie.get(t)){var r=ue.toLayer(t);null!=r&&this.Ie.set(t,r)}},i.prototype.onDown=function(t,i,r){if(n.prototype.onDown.call(this,t,i,r),r instanceof se){var e=this.Ie.get(t);e&&this.condition(t,r.data.originalEvent.timeStamp)&&this.getGestureUtil().onDown(e,r)}},i.prototype.getGestureUtil=function(){var t;return null!==(t=i.GESTURE_UTIL)&&void 0!==t?t:i.GESTURE_UTIL=this.newGestureUtil()},i.prototype.newGestureUtil=function(){var n=this,i=new t.Point;return new rr({on:{move:function(t,r,e,u,s,h){n.onGestureMove(t,r,e,u,s,h,i)}}})},i.prototype.onGestureMove=function(t,n,i,r,e,u,s){var h=t.parent;if(h){var o=t.transform,a=this.Ir,c=!1,f=1;if(a&xr.PINCH){var l=o.scale,v=l.y,b=Math.min(this.Ar,Math.max(this.Cr,v*u));f=b/v,l.set(b,b),c=!0}if(a&xr.DRAG){h.toLocal(s.set(r,e),void 0,s);var d=s.x,g=s.y,m=r-n,w=e-i;h.toLocal(s.set(m,w),void 0,s);var p=s.x,O=s.y,D=o.position,E=(D.x-p)*f+d,M=(D.y-O)*f+g;D.set(E,M),c=!0}c&&rt.update(t)}},i.prototype.toSize=function(t,n){return"size"in t?n.copyFrom(t.size):n.set(t.width,t.height),n},i}(Qt),oe=function(t){function n(n,i,r,e){void 0===n&&(n=""),void 0===i&&(i=xr.ALL),void 0===r&&(r=.05),void 0===e&&(e=20);var u=t.call(this,fn.MISC,n,gr.LAYER_GESTURE)||this;return u.gestureType=i,u.scaleMin=r,u.scaleMax=e,u}return _(n,t),n.prototype.toRuntime=function(){return new he(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.gestureType+","+this.scaleMin+","+this.scaleMax+"]")},n.deserialize=function(t,i){return new n(ln.toResource(1,t,i.resources),t[3],t[4],t[5])},n}(cn),ae=function(t){function n(n){var i=t.call(this,n,Yt.NONE)||this;return i.$i=new Map,i.Ie=n.layers,i.Ce=n.bringToFront,i}return _(n,t),n.prototype.initialize=function(n,i){t.prototype.initialize.call(this,n,i);var r=this.$i.get(n);null==r&&null!=(r=this.newData(n))&&this.$i.set(n,r)},n.prototype.execute=function(t,n,i){var r=this.$i.get(t);if(r){var e=this.condition(t,i);if(r.condition!==e){r.condition=e;var u=r.layers;e?r.bringToFront?(ue.bringAllToFront(u),ue.showAll(u)):ue.showAll(u):ue.hideAll(u)}}},n.prototype.newData=function(t){var n=ue.toLayers(t,this.Ie);if(0<n.length)return{layers:n,bringToFront:this.Ce,condition:null}},n}(Qt),ce=function(t){function n(n,i,r){var e=t.call(this,fn.MISC,n,gr.LAYER_SHOW_HIDE)||this;return e.layers=i,e.bringToFront=r,e}return _(n,t),n.prototype.toRuntime=function(){return new ae(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=this.serializeLayers(t),r=this.bringToFront?1:0;return t.addResource("["+this.type+","+n+","+this.subtype+","+i+","+r+"]")},n.prototype.serializeLayers=function(t){for(var n=this.layers,i="[",r="",e=0,u=n.length;e<u;++e)i+=r+n[e],r=",";return i+="]",t.addResource(i)},n.deserialize=function(t,i){return new n(ln.toResource(1,t,i.resources),this.deserializeLayers(t[3],i),!!t[4])},n.deserializeLayers=function(t,n){var i=n.resources,r=i.length;return 0<=t&&t<r?JSON.parse(i[t]):[]},n}(cn),fe={CLICKED:0,DOUBLE_CLICKED:1},le={LEFT:0,CENTER:1,RIGHT:2},ve={TOP:0,MIDDLE:1,BOTTOM:2},be={TEXT:0,PADDING:1,BORDER:2},de=function(){function t(t){this.Xt=t}return t.prototype.getImageAlignHorizontal=function(){return this.Xt.getSecondaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.Xt.getSecondaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.Xt.getSecondaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.Xt.getSecondaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.Xt.getSecondaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.Xt.getSecondaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.Xt.getSecondaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.Xt.getSecondaryImageSource(t)},t}(),ge=function(){function t(t){this.Xt=t}return t.prototype.getImageAlignHorizontal=function(){return this.Xt.getTertiaryImageAlignHorizontal()},t.prototype.getImageAlignVertical=function(){return this.Xt.getTertiaryImageAlignVertical()},t.prototype.getImageAlignWith=function(){return this.Xt.getTertiaryImageAlignWith()},t.prototype.getImageMarginHorizontal=function(){return this.Xt.getTertiaryImageMarginHorizontal()},t.prototype.getImageMarginVertial=function(){return this.Xt.getTertiaryImageMarginVertial()},t.prototype.getImageTintColor=function(t){return this.Xt.getTertiaryImageTintColor(t)},t.prototype.getImageTintAlpha=function(t){return this.Xt.getTertiaryImageTintAlpha(t)},t.prototype.getImageSource=function(t){return this.Xt.getTertiaryImageSource(t)},t}(),me=function(){function n(n,i,r,e){var u=this;this.O=n,this.Xt=i,this.Ae=r,this.bt=null,this.St=function(t,n){var i,r,e,u=null==n?void 0:n.align;return{with:di(null!==(i=null==u?void 0:u.with)&&void 0!==i?i:t.getImageAlignWith(),be),vertical:di(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getImageAlignVertical(),ve),horizontal:di(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getImageAlignHorizontal(),le)}}(i,e),this.Re=function(t,n){var i,r,e=null==n?void 0:n.margin;return{vertical:null!==(i=null==e?void 0:e.vertical)&&void 0!==i?i:t.getImageMarginVertial(),horizontal:null!==(r=null==e?void 0:e.horizontal)&&void 0!==r?r:t.getImageMarginHorizontal()}}(i,e),this.ye=null==e?void 0:e.tint,this.ke=new t.Rectangle,this.Le=null==e?void 0:e.source,this.xe=null,this.Be=function(){u.onUpdate()}}return Object.defineProperty(n.prototype,"image",{get:function(){return this.bt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"align",{get:function(){return this.St},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Re},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bound",{get:function(){return this.ke},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"source",{get:function(){return this.Le},set:function(t){this.Le!==t&&(this.Le=t,this.onUpdate())},enumerable:!1,configurable:!0}),n.prototype.computeSource=function(){var t=this.Le;if(void 0!==t){if(!ot(t))return t;var n=t(this.O.state);if(void 0!==n)return n}return this.Xt.getImageSource(this.O.state)},n.prototype.onStateChange=function(t,n){this.updateTint()},n.prototype.updateBound=function(){var t=this.ke,n=this.bt;if(null!=n){n.updateTransform(),n.getLocalBounds(t);var i=t.left,r=t.top,e=t.right,u=t.bottom,s=n.localTransform,h=s.a,o=s.b,a=s.c,c=s.d,f=h*i+a*r,l=o*i+c*r,v=h*e+a*r,b=o*e+c*r,d=h*e+a*u,g=o*e+c*u,m=h*i+a*u,w=o*i+c*u,p=Math.min(f,v,d,m),O=Math.max(f,v,d,m),D=Math.min(l,b,g,w),E=Math.max(l,b,g,w);t.x=p+s.tx,t.y=D+s.ty,t.width=O-p,t.height=E-D}else t.x=0,t.y=0,t.width=0,t.height=0},n.prototype.isTintAware=function(t){return null!=t&&"tint"in t},n.prototype.toTintColor=function(t,n){var i=this.ye;if(i){var r=i.color;if(void 0!==r){if(!ot(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintColor(n)},n.prototype.toTintAlpha=function(t,n){var i=this.ye;if(i){var r=i.alpha;if(void 0!==r){if(!ot(r))return r;var e=r(n);if(void 0!==e)return e}}return t.getImageTintAlpha(n)},n.prototype.updateTint=function(){var t=this.bt;if(t&&this.isTintAware(t)){var n=this.Xt,i=this.O.state,r=this.toTintColor(n,i);if(null!=r){var e=!1;t.tint!==r&&(t.tint=r,e=!0);var u=this.toTintAlpha(n,i);return t.alpha!==u&&(t.alpha=u,e=!0),e}}return!1},n.prototype.updateSource=function(){var n=this.computeSource(),i=this.xe;if(n!==i){this.xe=n;var r,e=this.O,u=this.bt,s=this.Be;if(n instanceof t.Texture)if(i instanceof t.Texture)i.off("update",s),u instanceof t.Sprite&&(u.texture=n,n.on("update",s));else{null!=u&&e.removeChild(u);var h=new t.Sprite(n);(r=e.getOverflowMask())&&(h.mask=r),n.on("update",s),e.addChild(h),this.bt=h}else i instanceof t.Texture?(i.off("update",s),null!=u&&(e.removeChild(u),u.destroy())):null!=u&&e.removeChild(u),null!=n&&((r=e.getOverflowMask())&&(n.mask=r),e.addChild(n)),this.bt=n;return!0}return!1},n.prototype.isRefitable=function(t){return null!=t&&t===this.bt},n.prototype.destroy=function(){var n=this.bt;if(n){this.bt=null;var i=this.xe;i instanceof t.Texture&&(i.off("update",this.Be,this),n.destroy())}},n.prototype.onUpdate=function(){this.O.toDirty(),rt.update(this.O)},n}(),we=function(t){function n(n){var i=t.call(this)||this;return i.parent=n,i}return _(n,t),n.prototype.render=function(n){this.updateTransform(),t.prototype.render.call(this,n)},n.prototype.onReflow=function(t,n,i){this.clear(),this.beginFill(16777215,1),this.drawRect(0,0,n,i),this.endFill()},n}(t.Graphics),pe=function(){function t(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r}return t.prototype.set=function(t,n,i,r){this.x=t,this.y=n,this.character=i,this.wrappable=r},t}(),Oe=function(){function t(){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.characters=[],this.clipped=!1,this.x=0,this.y=0}return t.prototype.start=function(t,n){this.count=0,this.countPerLine=0,this.width=0,this.height=0,this.clipped=!1,this.x=0,this.y=.5*(t-n)},t.prototype.isPushable=function(t,n){return!(t<this.x+n.advance&&!(4&n.type))},t.prototype.isPushableAtNewLine=function(t,n,i){return this.y+1.5*n+.5*i<=t},t.prototype.push=function(t,n){var i=this.x;this.x+=t.advance;var r=this.y,e=this.count,u=this.characters;e<u.length?u[e].set(i,r,t,n):u.push(new pe(i,r,t,n)),this.count+=1,this.countPerLine+=1},t.prototype.newLine=function(t){this.width=Math.max(this.width,this.x),this.x=0,this.y+=t,this.countPerLine=0},t.prototype.wordWrap=function(t){var n=this.countPerLine,i=this.characters;if(0<n){for(var r=this.count,e=r-1,u=r-n;u<e;--e){var s=i[e];if(s.wrappable){var h=s.character.advance,o=s.y+t;s.x=0,s.y=o;for(var a=e+1;a<r;++a)(s=i[a]).x=h,s.y=o,h+=s.character.advance;return this.x=h,this.y=o,this.countPerLine=r-e,!0}}var c=i[r-1];return c.x=0,c.y=c.y+t,this.x=c.character.advance,this.y=c.y,this.countPerLine=1,!1}return!1},t.prototype.pop=function(){var t=this.countPerLine,n=this.characters;if(0<t){var i=n[this.count-1];return this.x-=i.character.advance,this.count-=1,this.countPerLine-=1,!0}return!1},t.prototype.end=function(t,n){this.newLine(t),this.y-=.5*(t-n),this.height=this.y},t}(),De={NONE:0,NORMAL:1,BREAK_ALL:2},Ee="\n",Me=function(){function t(){}return t.measure=function(n,i,r){var e=t.RESULT||new Oe;if(t.RESULT=e,null!=i){var u=b.from(n),s=i.font.height,h=r.lineHeight,o=r.enable,a=r.width,c=r.height,f=r.wordWrap;switch(e.start(h,s),f){case De.BREAK_ALL:o?this.measure1(u,a,c,s,h,i,e):this.measure2(u,a,h,i,e);break;case De.NORMAL:var l=this.newLineBreaker(n);l?o?this.measure1a(l,u,a,c,s,h,i,e):this.measure2a(l,u,a,h,i,e):o?this.measure1b(u,a,c,s,h,i,e):this.measure2b(u,a,h,i,e);break;default:o?this.measure3(u,a,h,i,e):this.measure4(u,h,i,e)}e.end(h,s)}else e.start(0,0),e.end(0,0);return e},t.measure1a=function(t,n,i,r,e,u,s,h){for(var o=t.next();n.hasNext();){var a=n.position,c=n.next();if(c===Ee)h.newLine(u);else{var f=s.get(c);if(null==f)continue;o=this.advance(a,o,t);var l=this.isWrappable1(a,o);h.isPushable(i,f)?h.push(f,l):h.isPushableAtNewLine(r,u,e)?(h.push(f,l),h.wordWrap(u)):this.measure5(n,i,u,s,h,!0)}}},t.measure1b=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===Ee)s.newLine(e);else{var o=u.get(h);if(null==o)continue;var a=this.isWrappable2(s,o);s.isPushable(n,o)?s.push(o,a):s.isPushableAtNewLine(i,e,r)?(s.push(o,a),s.wordWrap(e)):this.measure5(t,n,e,u,s,!0)}}},t.measure1=function(t,n,i,r,e,u,s){for(;t.hasNext();){var h=t.next();if(h===Ee)s.newLine(e);else{var o=u.get(h);if(null==o)continue;s.isPushable(n,o)?s.push(o,!0):s.isPushableAtNewLine(i,e,r)?(s.newLine(e),s.push(o,!0)):this.measure5(t,n,e,u,s,!0)}}},t.measure2a=function(t,n,i,r,e,u){for(var s=t.next();n.hasNext();){var h=n.position,o=n.next();if(o===Ee)u.newLine(r);else{var a=e.get(o);if(null==a)continue;s=this.advance(h,s,t);var c=this.isWrappable1(h,s);u.isPushable(i,a)?u.push(a,c):(u.push(a,c),u.wordWrap(r))}}},t.measure2b=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===Ee)e.newLine(i);else{var s=r.get(u);if(null==s)continue;var h=this.isWrappable2(e,s);e.isPushable(n,s)?e.push(s,h):(e.push(s,h),e.wordWrap(i))}}},t.measure2=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===Ee)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)||e.newLine(i),e.push(s,!1)}}},t.measure3=function(t,n,i,r,e){for(;t.hasNext();){var u=t.next();if(u===Ee)e.newLine(i);else{var s=r.get(u);if(null==s)continue;e.isPushable(n,s)?e.push(s,!1):this.measure5(t,n,i,r,e,!1)}}},t.measure4=function(t,n,i,r){for(;t.hasNext();){var e=t.next();if(e===Ee)r.newLine(n);else{var u=i.get(e);if(null==u)continue;r.push(u,!1)}}},t.measure5=function(t,n,i,r,e,u){e.clipped=!0;var s=r.get("...");if(null!=s){for(;!e.isPushable(n,s)&&e.pop(););e.isPushable(n,s)&&e.push(s,!1)}if(u)t.close();else for(;t.hasNext();)if(t.next()===Ee){e.newLine(i);break}},t.isWrappable2=function(t,n){if(t.countPerLine<=0)return!1;var i=t.characters[t.count-1].character.type,r=n.type;return 4&i?!(4&r||2&i):!(4&r||2&i&&2&r)},t.advance=function(t,n,i){return n.done||t<=n.value.end?n:n=i.next()},t.isWrappable1=function(t,n){if(n.done)return!1;var i=n.value;return i.start===t||i.end===t},t.newLineBreaker=function(t){return"css-line-break"in window?window["css-line-break"].LineBreaker(t,{lineBreak:"strict",wordBreak:"normal"}):null},t.RESULT=null,t}(),Se=function(t){function n(){var n=t.call(this,new Float32Array(64),new Float32Array(64),new Uint16Array(48))||this;return n.width=0,n.height=0,n.clipped=!1,n}return _(n,t),n.prototype.update=function(t,n,i){var r=this.getBuffer("aVertexPosition"),e=this.getBuffer("aTextureCoord"),u=this.getIndex(),s=Me.measure(t,n,i),h=Math.ceil(s.count/8)<<3,o=h<<3;r.data.length<o&&(r.data=new Float32Array(o),e.data=new Float32Array(o));var a=6*h;u.data.length<a&&(u.data=new Uint16Array(a));var c=r.data,f=e.data,l=u.data;if(null!=n){for(var v=s.count,b=s.characters,d=0;d<v;++d){var g=b[d],m=g.x,w=g.y,p=g.character,O=n.width,D=n.height;this.writeCharacter(c,f,l,d,m,w,p,O,D)}d=v;for(var E=c.length>>3;d<E;++d)this.writeCharacterEmpty(c,f,l,d);this.width=s.width,this.height=s.height,this.clipped=s.clipped}else{for(d=0,E=c.length>>3;d<E;++d)this.writeCharacterEmpty(c,f,l,d);this.width=0,this.height=0,this.clipped=!1}r.update(),e.update(),u.update()},n.prototype.writeCharacter=function(t,n,i,r,e,u,s,h,o){var a=s.x,c=s.y,f=s.width,l=s.height,v=e+(a-s.origin.x),b=u,d=v+f,g=b+l,m=r<<3;t[m+0]=v,t[m+1]=b,t[m+2]=d,t[m+3]=b,t[m+4]=d,t[m+5]=g,t[m+6]=v,t[m+7]=g;var w=a/h,p=c/o,O=(a+f)/h,D=(c+l)/o;n[m+0]=w,n[m+1]=p,n[m+2]=O,n[m+3]=p,n[m+4]=O,n[m+5]=D,n[m+6]=w,n[m+7]=D;var E=6*r,M=r<<2;i[E+0]=M+0,i[E+1]=M+1,i[E+2]=M+3,i[E+3]=M+1,i[E+4]=M+2,i[E+5]=M+3},n.prototype.writeCharacterEmpty=function(t,n,i,r){var e=r<<3;t[e+0]=0,t[e+1]=0,t[e+2]=0,t[e+3]=0,t[e+4]=0,t[e+5]=0,t[e+6]=0,t[e+7]=0,n[e+0]=0,n[e+1]=0,n[e+2]=0,n[e+3]=0,n[e+4]=0,n[e+5]=0,n[e+6]=0,n[e+7]=0;var u=6*r,s=r<<2;i[u+0]=s+0,i[u+1]=s+1,i[u+2]=s+3,i[u+3]=s+1,i[u+4]=s+2,i[u+5]=s+3},n}(t.MeshGeometry),Te=function(){function t(t,n){var i,r,e,u,s,h,o,a,c,f;this.k=0,this._e=-1;var l=this.getDefaultOptions();t?(this.St=null!==(i=t.align)&&void 0!==i?i:l.align,this.Pe=null!==(r=t.fontFamily)&&void 0!==r?r:l.fontFamily,this.Fe=null!==(e=t.fontSize)&&void 0!==e?e:l.fontSize,this.Ue=null!==(u=t.fontStyle)&&void 0!==u?u:l.fontStyle,this.Ge=null!==(s=t.fontVariant)&&void 0!==s?s:l.fontVariant,this.ze=null!==(h=t.fontWeight)&&void 0!==h?h:l.fontWeight,this.A=null!==(o=t.fill)&&void 0!==o?o:l.fill,this.zt=null!==(a=t.clipping)&&void 0!==a?a:l.clipping,this.He=di(null!==(c=t.wordWrap)&&void 0!==c?c:l.wordWrap,De),this.Ve=null!==(f=t.lineHeight)&&void 0!==f?f:l.lineHeight):(this.St=l.align,this.Pe=l.fontFamily,this.Fe=l.fontSize,this.Ue=l.fontStyle,this.Ge=l.fontVariant,this.ze=l.fontWeight,this.A=l.fill,this.zt=l.clipping,this.He=di(l.wordWrap,De),this.Ve=l.lineHeight),this.We=-1,this.Xe="",this.Ke="",this.Ye=0,this.q=n}return t.prototype.getDefaultOptions=function(){var n=t.DEFAULT_OPTIONS;return null==n&&(n=this.newDefaultOptions(),t.DEFAULT_OPTIONS=n),n},t.prototype.newDefaultOptions=function(){var t=K.getInstance().get("DBase");return{align:"left",fontFamily:t.getFontFamilly(),fontSize:t.getFontSize(),fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fill:t.getColor(new ct),clipping:!0,wordWrap:De.NONE,lineHeight:t.getLineHeight()}},Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"idApproved",{get:function(){return this._e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontId",{get:function(){return this.update(),this.Xe},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontIdApproved",{get:function(){return this.Ke},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this.A},set:function(t){this.A!==t&&(this.A=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.onChange=function(){this.k+=1,this.q()},Object.defineProperty(t.prototype,"fillApproved",{get:function(){return this.Ye},enumerable:!1,configurable:!0}),t.prototype.approve=function(){this.update(),this._e=this.k,this.Ke=this.Xe,this.Ye=this.A},Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this.Pe},set:function(t){this.Pe!==t&&(this.Pe=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this.Fe},set:function(t){this.Fe!==t&&(this.Fe=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontStyle",{get:function(){return this.Ue},set:function(t){this.Ue!==t&&(this.Ue=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontVariant",{get:function(){return this.Ge},set:function(t){this.Ge!==t&&(this.Ge=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontWeight",{get:function(){return this.ze},set:function(t){this.ze!==t&&(this.ze=t,this.onChange())},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.We!==this.k&&(this.We=this.k,this.Xe=this.newFontId())},t.prototype.newFontId=function(){return this.Ue+" "+this.Ge+" "+this.ze+" "+this.Fe+"px "+this.Pe},Object.defineProperty(t.prototype,"clipping",{get:function(){return this.zt},set:function(t){this.zt!==t&&(this.zt=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"wordWrap",{get:function(){return this.He},set:function(t){this.He!==t&&(this.He=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lineHeight",{get:function(){return this.Ve},set:function(t){this.Ve!==t&&(this.Ve=t,this.onChange())},enumerable:!1,configurable:!0}),t}(),je=function(n){function i(i,r){var e=n.call(this,new Se,new t.MeshMaterial(t.Texture.EMPTY))||this;return e._=new Te(r,(function(){e.un=!0,e.Je=!0,e.Oe=null,e.Ze()})),e.qe=i,e.$e="",e.un=!0,e.Je=!0,e.Oe=null,e.Qe=0,e.Mt=0,e.nn=0,e.zt={enable:!1,wordWrap:De.NONE,width:0,height:0,lineHeight:0,delta:{width:0,height:0}},e.Ze(),e}return _(i,n),i.prototype.Ze=function(){var t=rt.getLayer(this);if(t){var n=this._;if(this.un){this.un=!1;var i=this.qe,r=this.$e;this.$e=i;var e=n.fontId,u=n.fontIdApproved,s=n.fontSize,h=n.fill,o=n.fillApproved;n.approve();var a=t.getDynamicFontAtlases();i===r&&e===u&&h===o||(a.add(e,s,h,i),a.remove(u,o,r))}}},Object.defineProperty(i.prototype,"text",{get:function(){return this.qe},set:function(t){this.qe!==t&&(this.qe=t,this.un=!0,this.Je=!0,this.Ze())},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this.update(),Math.abs(this.scale.x)*this.geometry.width},set:function(t){this.update();var n=this.geometry.width;if(1e-4<n){var i=t/n;this.scale.x=0<=this.scale.x?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.update(),Math.abs(this.scale.y)*this.geometry.height},set:function(t){this.update();var n=this.geometry.height;if(1e-4<n){var i=t/n;this.scale.y=0<=this.scale.y?+i:-i}},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"clipped",{get:function(){return this.geometry.clipped},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"style",{get:function(){return this._},enumerable:!1,configurable:!0}),i.prototype.update=function(){this.Ze();var t=this.Oe;if(null==t){var n=rt.getLayer(this);if(n){var i=this._;null!=(t=n.getDynamicFontAtlases().get(i.fontId,i.fill))&&(this.Qe=t.getRevisionUpdate(),this.Oe=t,this.texture=t.texture,this.Je=!0)}}else{var r=t.getRevisionUpdate();r!==this.Qe&&(this.Qe=r,this.Je=!0)}var e=this._,u=this.zt;this.updateClipping(e,u)&&(this.Je=!0),this.Je&&(this.Je=!1,this.geometry.update(this.qe,t,u))},i.prototype.updateClipping=function(t,n){var i=!1,r=t.clipping;n.enable!==r&&(n.enable=r,i=!0);var e=t.wordWrap;n.wordWrap!==e&&(n.wordWrap=e,i=!0);var u=t.lineHeight;if(n.lineHeight!==u&&(n.lineHeight=u,i=!0),r||e){var s=this.parent;if(s instanceof Ki){var h=s.width-s.padding.getLeft()-s.padding.getRight()-n.delta.width;n.width!==h&&(n.width=h,i=!0);var o=s.height-s.padding.getTop()-s.padding.getBottom()-n.delta.height;n.height!==o&&(n.height=o,i=!0)}}return i},i.prototype.setClippingDelta=function(t,n){var i=this.zt.delta;i.width=t,i.height=n},i.prototype._calculateBounds=function(){this.update(),n.prototype._calculateBounds.call(this)},i.prototype._render=function(t){this.update(),n.prototype._render.call(this,t)},i}(t.Mesh),Ne=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u;t.prototype.init.call(this,n);var s=this.theme;this.tu=null!==(r=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.value)&&void 0!==r?r:s.newTextValue(),this.nu=this.computeTextValue();var h=null==n?void 0:n.text;this.iu=null==h?void 0:h.color,this.ru=null==h?void 0:h.alpha,this.eu=function(t,n,i){var r,e,u,s,h,o,a,c,f,l,v=null===(r=null==n?void 0:n.text)||void 0===r?void 0:r.style;return null!=v?{fill:null!==(e=v.fill)&&void 0!==e?e:t.getColor(i),fontSize:null!==(u=v.fontSize)&&void 0!==u?u:t.getFontSize(),fontFamily:null!==(s=v.fontFamily)&&void 0!==s?s:t.getFontFamilly(),fontWeight:null!==(h=v.fontWeight)&&void 0!==h?h:t.getFontWeight(),fontStyle:null!==(o=v.fontStyle)&&void 0!==o?o:t.getFontStyle(),fontVariant:null!==(a=v.fontVariant)&&void 0!==a?a:t.getFontVariant(),clipping:null!==(c=v.clipping)&&void 0!==c?c:t.getTextStyleClipping(),wordWrap:null!==(f=v.wordWrap)&&void 0!==f?f:t.getTextStyleWordWrap(),lineHeight:null!==(l=v.lineHeight)&&void 0!==l?l:t.getLineHeight()}:{fill:t.getColor(i),fontSize:t.getFontSize(),fontFamily:t.getFontFamilly(),fontWeight:t.getFontWeight(),fontStyle:t.getFontStyle(),fontVariant:t.getFontVariant(),clipping:t.getTextStyleClipping(),wordWrap:t.getTextStyleWordWrap(),lineHeight:t.getLineHeight()}}(s,n,this.state),this.Ae=function(t,n){var i,r,e,u=null===(i=null==n?void 0:n.text)||void 0===i?void 0:i.align;return{vertical:di(null!==(r=null==u?void 0:u.vertical)&&void 0!==r?r:t.getTextAlignVertical(),ve),horizontal:di(null!==(e=null==u?void 0:u.horizontal)&&void 0!==e?e:t.getTextAlignHorizontal(),le)}}(s,n),this.uu=null!==(e=null==h?void 0:h.formatter)&&void 0!==e?e:s.getTextFormatter(),this.su=!0,this.hu=null!==(u=null==n?void 0:n.mask)&&void 0!==u?u:s.isOverflowMaskEnabled(),this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"text",{get:function(){return this.tu},set:function(t){this.tu!==t&&(this.tu=t,this.updateTextValue())},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){},n.prototype.computeTextValue=function(){var t=this.tu;if(void 0!==t){if(!ot(t))return t;var n=t(this.state);if(void 0!==n)return n}return this.theme.getTextValue(this.state)},n.prototype.createOrUpdateText=function(){var t=this.nu;if(void 0!==t){var n=this.uu(t,this),i=this.qe;if(null==i){if(0<n.length){var r=this.createText(n);r.visible=this.su,this.qe=r,this.addChild(r),this.updateTextPosition(r);var e=this.getOverflowMask();e&&(r.mask=e),this.toDirty(),rt.update(this)}}else i.text=n,this.toDirty(),rt.update(this)}},n.prototype.createText=function(t){return new je(t,this.eu)},n.prototype.getOverflowMask=function(){return this.hu?(null==this.Zi&&(this.Zi=new we(this),this.Ln.add(this.Zi),this.toDirty()),this.Zi):null},n.prototype.updateTextPosition=function(t){var n=this.Ae,i=this.Bn,r=this.toRounded;switch(n.horizontal){case le.LEFT:t.x=r(i.getLeft());break;case le.CENTER:t.x=r(.5*(this.width-t.width));break;case le.RIGHT:t.x=r(this.width-t.width-i.getRight())}switch(n.vertical){case ve.TOP:t.y=r(i.getTop());break;case ve.MIDDLE:t.y=r(.5*(this.height-t.height));break;case ve.BOTTOM:t.y=r(this.height-t.height-i.getBottom())}},n.prototype.toRounded=function(t){return Math.round(t)},n.prototype.getTextColor=function(t,n){var i=this.iu;if(void 0!==i){if(!ot(i))return i;var r=i(n);if(void 0!==r)return r}return t.getColor(n)},n.prototype.getTextAlpha=function(t,n){var i=this.ru;if(void 0!==i){if(!ot(i))return i;var r=i(n);if(void 0!==r)return r}return t.getAlpha(n)},n.prototype.updateTextColor=function(t){var n=this.theme,i=this.state;t.style.fill=this.getTextColor(n,i),t.alpha=this.getTextAlpha(n,i)},n.prototype.updateTextValue=function(){var t=this.computeTextValue();this.nu!==t&&(this.nu=t,this.onTextChange(),this.createOrUpdateText())},n.prototype.updateText=function(){var t=this.qe;t&&(this.updateTextValue(),this.updateTextPosition(t),this.updateTextColor(t))},n.prototype.showText=function(){var t=this.qe;t&&(t.visible=!0),this.su=!0},n.prototype.hideText=function(){var t=this.qe;t&&(t.visible=!1),this.su=!1},n.prototype.onReflow=function(){t.prototype.onReflow.call(this),this.updateText()},n.prototype.isRefitable=function(n){return t.prototype.isRefitable.call(this,n)||null!=n&&n===this.qe},n.prototype.applyTitle=function(){var n=this.qe;if(this._n.length<=0&&n&&"clipped"in n&&n.clipped){var i=rt.getLayer(this);i&&(i.view.title=n.text)}else t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DTextBase"},n.prototype.destroy=function(){var n=this.qe;n&&(this.qe=null,n.destroy());var i=this.Zi;i&&(this.Zi=null,i.destroy()),t.prototype.destroy.call(this)},n}(Ki),Ie=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){this.ou=this.newImages(this.theme,n),t.prototype.init.call(this,n)},n.prototype.newImages=function(t,n){var i=[];return i.push(this.newImage(t,this.toImageOptions(t,null==n?void 0:n.image))),function(t){return!!t.getSecondaryImageSource}(t)&&i.push(this.newImage(new de(t))),function(t){return!!t.getTertiaryImageSource}(t)&&i.push(this.newImage(new ge(t))),i},n.prototype.toImageOptions=function(t,n){return n},n.prototype.newImage=function(t,n){return new me(this,t,this.Ae,n)},Object.defineProperty(n.prototype,"image",{get:function(){return this.ou[0].source},set:function(t){this.ou[0].source=t},enumerable:!1,configurable:!0}),n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i);for(var r=this.ou,e=0,u=r.length;e<u;++e)r[e].onStateChange(n,i)},n.prototype.updateText=function(){this.updateTextValue(),this.updateTextAndImage()},n.prototype.updateTextAndImage=function(){for(var t=this.qe,n=this.ou,i=this.Bn,r=this.toRounded,e=this.width,u=this.height,s=i.getLeft(),h=i.getRight(),o=i.getTop(),a=i.getBottom(),c=null==t,f=c,l=c,v=0,b=0,d=0,g=0,m=0,w=0,p=s,O=e-h,D=o,E=u-a,M=0,S=e,T=0,j=u,N=0,I=n.length;N<I;++N)if((K=n[N]).updateSource(),K.updateTint(),K.updateBound(),Y=K.image){var C=(J=K.bound).width,A=J.height,R=K.margin,y=R.horizontal,k=R.vertical;if(K.align.with===be.TEXT){switch(K.align.horizontal){case le.LEFT:Y.x=d,d+=C,f?f=!1:d+=y;break;case le.CENTER:break;case le.RIGHT:g-=C,Y.x=g,g-=y,v=y}switch(K.align.vertical){case ve.TOP:Y.y=m,m+=A,l?l=!1:m+=k;break;case ve.MIDDLE:break;case ve.BOTTOM:w-=A,Y.y=w,w-=k,b=k}}if(K.align.with===be.PADDING){switch(K.align.horizontal){case le.LEFT:p+=y,Y.x=r(p),p+=C;break;case le.CENTER:break;case le.RIGHT:O-=C+y,Y.x=r(O)}switch(K.align.vertical){case ve.TOP:D+=k,Y.y=r(D),D+=A;break;case ve.MIDDLE:break;case ve.BOTTOM:E-=A+k,Y.y=r(E)}}if(K.align.with===be.BORDER){switch(K.align.horizontal){case le.LEFT:M+=y,Y.x=r(M),M+=C;break;case le.CENTER:break;case le.RIGHT:S-=C+y,Y.x=r(S)}switch(K.align.vertical){case ve.TOP:T+=k,Y.y=r(T),T+=A;break;case ve.MIDDLE:break;case ve.BOTTOM:j-=A+k,Y.y=r(j)}}}c&&(g+=v,w+=b);var L=0,x=0,B=0,_=0,P=0,F=0;if(null!=t){this.updateTextColor(t),t.setClippingDelta(d-g,m-w);var U=this.Ae,G=t.width,z=t.height;switch(U.horizontal){case le.LEFT:B=(L=s)+d+G-g;break;case le.CENTER:B=(L=.5*(e-d+g-G))+d+G-g;break;case le.RIGHT:L=(B=e-h)+g-G-d}switch(t.x=r(L+d),x=L+d+.5*G,U.vertical){case ve.TOP:F=(_=o)+m+z-w;break;case ve.MIDDLE:F=(_=.5*(u-m+w-z))+m+z-w;break;case ve.BOTTOM:_=(F=u-a)+w-z-m}t.y=r(_+m),P=_+m+.5*z}else B=(L=.5*(e-d+g))+d-g,x=L+d,F=(_=.5*(u-m+w))+m-w,P=_+m;var H=.5*e,V=.5*u,W=.5*e,X=.5*u;for(N=0,I=n.length;N<I;++N){var K,Y;if(Y=(K=n[N]).image){var J;if(C=(J=K.bound).width,A=J.height,K.align.with===be.TEXT){switch(K.align.horizontal){case le.LEFT:Y.x=r(Y.x+L);break;case le.CENTER:Y.x=r(x-.5*C);break;case le.RIGHT:Y.x=r(Y.x+B)}switch(K.align.vertical){case ve.TOP:Y.y=r(Y.y+_);break;case ve.MIDDLE:Y.y=r(P-.5*A);break;case ve.BOTTOM:Y.y=r(Y.y+F)}}if(K.align.with===be.PADDING){switch(K.align.horizontal){case le.CENTER:Y.x=r(H-.5*C)}switch(K.align.vertical){case ve.MIDDLE:Y.y=r(V-.5*A)}}if(K.align.with===be.BORDER){switch(K.align.horizontal){case le.CENTER:Y.x=r(W-.5*C)}switch(K.align.vertical){case ve.MIDDLE:Y.y=r(X-.5*A)}}}}},n.prototype.isRefitable=function(n){if(t.prototype.isRefitable.call(this,n))return!0;for(var i=this.ou,r=0,e=i.length;r<e;++r)if(i[r].isRefitable(n))return!0;return!1},n.prototype.getType=function(){return"DImageBase"},n.prototype.destroy=function(){for(var n=this.ou,i=0,r=n.length;i<r;++i)n[i].destroy();t.prototype.destroy.call(this)},n}(Ne),Ce=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r;t.prototype.init.call(this,n);var e=this.theme;this.au=null!==(i=null==n?void 0:n.toggle)&&void 0!==i?i:e.isToggle();var u=di(null!==(r=null==n?void 0:n.when)&&void 0!==r?r:e.getWhen(),fe);this.cu=u,this.initOnClick(u,e,n),this.initOnPress(u,e,n);var s=null==n?void 0:n.group;s&&s.add(this)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.onClick(n)},Object.defineProperty(n.prototype,"isToggle",{get:function(){return this.au},enumerable:!1,configurable:!0}),n.prototype.initOnClick=function(t,n,i){var r=this;zi.onClick(this,(function(n){t===fe.CLICKED&&r.onClick(n)}))},n.prototype.initOnPress=function(t,n,i){var r=this,e=null,u=function(){r.state.isPressed=!1,null!=e&&(e.off(zi.up,u),e.off(zi.upoutside,u),e.off(zi.cancel,u),e=null)};this.on(zi.down,(function(){r.state.isPressed=!0;var t=rt.getLayer(r);t&&((e=t.renderer.plugins.interaction).on(zi.up,u),e.on(zi.upoutside,u),e.on(zi.cancel,u))}))},n.prototype.getType=function(){return"DButton"},n.prototype.onClick=function(t){this.state.isActionable&&(this.isToggle?(this.onToggleStart(t),this.onToggleEnd(t)):this.onActivate(t))},n.prototype.onDblClick=function(n,i){return this.cu===fe.DOUBLE_CLICKED&&this.onClick(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onInactivate=function(t){this.emit("inactive",this)},n.prototype.toggle=function(){this.state.isActionable&&this.isToggle&&(this.onToggleStart(),this.onToggleEnd())},n.prototype.onToggleStart=function(t){this.state.isActive=!this.state.isActive},n.prototype.onToggleEnd=function(t){this.state.isActive?this.onActivate(t):this.onInactivate(t)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.isToggle?this.onToggleStart(t):this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.isToggle?this.onToggleEnd(t):(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1))},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.destroy=function(){var n,i;null===(i=null===(n=this.Nn)||void 0===n?void 0:n.group)||void 0===i||i.remove(this),t.prototype.destroy.call(this)},n}(Ie),Ae=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButton"},n}(Ce),Re=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonPrimary"},n}(Ae),ye=function(t){function n(n){var i,r,e=t.call(this,n)||this;e.fu=0,e.lu=0,e.vu=0,e.bu=0,e.du=null,e.gu=null;var u=null==n?void 0:n.shift;return e.mu=null!==(i=null==u?void 0:u.x)&&void 0!==i?i:0,e.wu=null!==(r=null==u?void 0:u.y)&&void 0!==r?r:15,e.pu=function(){e.onPrerender()},e.Ou=function(){e.onPostrender()},e}return _(n,t),n.prototype.stop=function(){this.bu=0,this.removeEventListeners(),t.prototype.stop.call(this)},n.prototype.addEventListeners=function(t){var n=rt.getLayer(t);if(n){this.gu=n;var i=n.renderer;i.on("prerender",this.pu),i.on("postrender",this.Ou)}},n.prototype.removeEventListeners=function(){var t=this.gu;if(t){this.gu=null;var n=t.renderer;n.off("prerender",this.pu),n.off("postrender",this.Ou)}},n.prototype.onStart=function(n){var i=this.du=this.zn;null!=i&&(this.bu=0,this.removeEventListeners(),this.addEventListeners(i),n||(i.visible=!0),t.prototype.onStart.call(this,n))},n.prototype.onTime=function(n,i,r){if(null!=this.du){var e=this.gu;e?(this.bu=n,t.prototype.onTime.call(this,n,i,r),e.update()):(this.bu=n,t.prototype.onTime.call(this,n,i,r))}},n.prototype.onEnd=function(n){var i=this.du;null!=i&&(this.removeEventListeners(),n&&(i.visible=!1),t.prototype.onEnd.call(this,n))},n.prototype.onPrerender=function(){var t=this.du;if(null!=t){var n=this.bu,i=t.unsafe.position;this.fu=i.x,this.lu=i.y,i.set(i.x-this.mu*(1-n),i.y-this.wu*(1-n)),this.vu=t.alpha,t.alpha=n}},n.prototype.onPostrender=function(){var t=this.du;null!=t&&(t.unsafe.position.set(this.fu,this.lu),t.alpha=this.vu)},n}(tr),ke={TOP:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,LEFT:4,LEFT_TOP:5,LEFT_MIDDLE:6,LEFT_BOTTOM:7,RIGHT:8,RIGHT_TOP:9,RIGHT_MIDDLE:10,RIGHT_BOTTOM:11,BOTTOM:12,BOTTOM_LEFT:13,BOTTOM_CENTER:14,BOTTOM_RIGHT:15,OVER:16},Le=function(){function t(){}return t.attach=function(t,n,i,r,e,u,s){var h=t.width,o=t.height,a=0;switch(s){case ke.LEFT:case ke.LEFT_TOP:case ke.LEFT_MIDDLE:case ke.LEFT_BOTTOM:(a=n.left-h-i)<i&&e-i<(a=n.right+i)+h&&(a=i);break;case ke.RIGHT:case ke.RIGHT_TOP:case ke.RIGHT_MIDDLE:case ke.RIGHT_BOTTOM:e-i<(a=n.right+i)+h&&(a=n.left-h-i)<i&&(a=e-h-i);break;case ke.TOP:case ke.TOP_LEFT:case ke.BOTTOM:case ke.BOTTOM_LEFT:a=this.adjust(n.left,h,i,e);break;case ke.TOP_RIGHT:case ke.BOTTOM_RIGHT:a=this.adjust(n.right-h,h,i,e);break;case ke.TOP_CENTER:case ke.BOTTOM_CENTER:case ke.OVER:a=this.adjust(.5*(n.left+n.right-h),h,i,e)}var c=0;switch(s){case ke.LEFT:case ke.LEFT_TOP:case ke.RIGHT:case ke.RIGHT_TOP:c=this.adjust(n.top,o,r,u);break;case ke.LEFT_MIDDLE:case ke.RIGHT_MIDDLE:case ke.OVER:c=this.adjust(.5*(n.top+n.bottom-o),o,r,u);break;case ke.LEFT_BOTTOM:case ke.RIGHT_BOTTOM:c=this.adjust(n.bottom,o,r,u);break;case ke.TOP:case ke.TOP_LEFT:case ke.TOP_RIGHT:case ke.TOP_CENTER:(c=n.top-o-r)<r&&u<(c=n.bottom+r)+o&&(c=r);break;case ke.BOTTOM:case ke.BOTTOM_LEFT:case ke.BOTTOM_RIGHT:case ke.BOTTOM_CENTER:u-r<(c=n.bottom+r)+o&&(c=n.top-o-r)<r&&(c=u-o-r)}t.position.set(a,c)},t.adjust=function(t,n,i,r){return t<i?r-i<t+n?.5*(r-n):i:r-i<t+n?r<n?.5*(r-n):r-n-i:t},t}(),xe={NONE:0,ESC:1,CLICK_OUTSIDE:2},Be={MODAL:0,MODELESS:1,MENU:2},_e={MODAL:"MODAL",MODELESS:"MODELESS",MENU:"MENU"},Pe=function(){function n(){}return n.apply=function(t,n){var i=this;t.on(zi.down,(function(r){if(r.target===t){var e=i.point;e.copyFrom(r.data.global),t.toLocal(e,void 0,e,!0);var u=e.x,s=e.y;(u<0||s<0||t.width<u||t.height<s)&&setTimeout((function(){n(r)}),0)}}))},n.point=new t.Point,n}(),Fe=function(){function t(t){this.gu=null,this.Du=null==(null==t?void 0:t.parent)?rt.last():null}return Object.defineProperty(t.prototype,"picked",{get:function(){return this.gu},enumerable:!1,configurable:!0}),t.prototype.pick=function(t){var n=this.gu;if(null==n){if(!(n=rt.getLayerOverlay(t))){var i=this.Du;n=i?i.getLayerOverlay():rt.last().getLayerOverlay()}this.gu=n}return n},t}(),Ue=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u,s=this;t.prototype.init.call(this,n),this.pu=function(){s.onPrerender()};var h=this.theme,o=di(null!==(i=null==n?void 0:n.mode)&&void 0!==i?i:h.getMode(),Be);this.Eu=o,this.Mu=null!==(r=null==n?void 0:n.sticky)&&void 0!==r?r:h.isSticky();var a=null!==(e=null==n?void 0:n.closeOn)&&void 0!==e?e:h.closeOn();switch(this.Su=a,this.St=di(null!==(u=null==n?void 0:n.align)&&void 0!==u?u:ke.BOTTOM,ke),this.Tu=new Fe,o){case Be.MODAL:case Be.MENU:this.visible=!1;var c=this.state;c.lock(),c.isFocusRoot=!0,c.add(o===Be.MODAL?_e.MODAL:_e.MENU),c.unlock(),a&xe.CLICK_OUTSIDE&&Pe.apply(this,(function(){s.onCloseOn()}));break;case Be.MODELESS:this.state.add(_e.MODELESS)}},n.prototype.getAnimation=function(){var t,n,i,r,e=this,u=this.oi;if(void 0===u){switch(this.Eu){case Be.MODAL:u=null!==(n=null===(t=this.Nn)||void 0===t?void 0:t.animation)&&void 0!==n?n:new ye;break;case Be.MODELESS:u=null;break;case Be.MENU:u=null!==(r=null===(i=this.Nn)||void 0===i?void 0:i.animation)&&void 0!==r?r:null}u&&(u.target=this,u.on("end",(function(t){e.onAnimationEnd(t)}))),this.oi=u}return u},n.prototype.onAnimationEnd=function(t){if(t){var n=this.parent;n&&n.removeChild(this)}else{var i=rt.getLayer(this);if(i){var r=i.getFocusController();this.ju=r.get();var e=r.find(this,!1,!0,!0);r.focus(e||this)}}},n.prototype.open=function(t){var n=this,i=this.Nu;if(null==i){switch(i=new Promise((function(t,i){n.Iu=t,n.Cu=i})),this.Nu=i,this.Au=t,this.Eu){case Be.MODAL:(r=this.Tu.pick(this)).stage.addChild(this);break;case Be.MODELESS:break;case Be.MENU:var r;(r=this.Tu.pick(this)).stage.addChild(this);var e=r.renderer,u=this.pu;this.Mu?e.on("prerender",u):e.once("prerender",u)}this.onOpen()}return i},n.prototype.onPrerender=function(){var t=this.Au;if(t){var n=t.getBounds();if(n){var i=this.Tu.picked;if(i){var r=this.theme;Le.attach(this,n,r.getOffsetX(),r.getOffsetY(),i.width,i.height,this.St)}}}},n.prototype.onOpen=function(){this.emit("open",this);var t=this.getAnimation();t?t.start():this.Eu===Be.MENU&&(this.visible=!0,this.onAnimationEnd(!1))},n.prototype.isOpened=function(){return null!=this.Nu},n.prototype.close=function(){this.doReject()},n.prototype.doResolve=function(t){var n=this.Iu;n&&(this.Nu=void 0,this.Iu=void 0,this.Cu=void 0,this.onClose(),n(t))},n.prototype.doReject=function(t){var n=this.Cu;n&&(this.Nu=void 0,this.Iu=void 0,this.Cu=void 0,this.onClose(),n(t))},n.prototype.onClose=function(){var t=this.Tu.picked,n=this.ju;if(null!=n)if(this.ju=null,t){var i=rt.getLayer(n);null!=i&&t!==i&&i.view.focus(),t.getFocusController().focus(n)}else this.blur(!0);else this.blur(!0);switch(this.Eu){case Be.MODAL:case Be.MODELESS:break;case Be.MENU:t&&t.renderer.off("prerender",this.pu)}this.Au=null;var r=this.getAnimation();r?r.start(!0):this.Eu===Be.MENU&&(this.visible=!1,this.onAnimationEnd(!0)),this.emit("close",this)},n.prototype.onKeyDown=function(n){switch(this.Eu){case Be.MODAL:case Be.MENU:this.Su&xe.ESC&&Kt.isCancelKey(n)&&this.onCloseOn()}return t.prototype.onKeyDown.call(this,n)},n.prototype.onCloseOn=function(){this.close()},n.prototype.containsGlobalPoint=function(n){switch(this.Eu){case Be.MODAL:case Be.MENU:return!0;case Be.MODELESS:return t.prototype.containsGlobalPoint.call(this,n)}},n.prototype.getType=function(){return"DDialog"},n}(Ki),Ge={VERTICAL:0,HORIZONTAL:1},ze=function(t){function n(n){var i=t.call(this,n)||this;return i.visible=!1,i}return _(n,t),n.prototype.getType=function(){return"DLayoutSpace"},n}(Ki),He=function(t){return t instanceof Ki&&(t.visible||t instanceof ze)},Ve=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n);var i=this.theme;this.Re=function(t,n){var i,r,e=null==n?void 0:n.margin;if(null!=e){if(Xt(e))return{horizontal:e,vertical:e};var u=t.getMargin();return{horizontal:null!==(i=e.horizontal)&&void 0!==i?i:u,vertical:null!==(r=e.vertical)&&void 0!==r?r:u}}return{horizontal:u=t.getMargin(),vertical:u}}(i,n),this.Gt=function(t,n){var i=null==n?void 0:n.direction;return null!=i?at(i)?Ge[i]:i:t.getDirection()}(i,n),this.Ru=function(t,n){var i=null==n?void 0:n.corner;if(null!=i&&!Xt(i)){var r=i.adjust;if(null!=r)return r}return t.getCornerAdjust()}(i,n),this.yu=function(t,n){if(n){var i=n.row;if(null!=i)return i;var r=n.column;if(null!=r)return r}return t.getMultiplicity()}(i,n),this.Xn=function(t,n){var i;return null!==(i=null==n?void 0:n.reverse)&&void 0!==i?i:t.getReverse()}(i,n)},Object.defineProperty(n.prototype,"margin",{get:function(){return this.Re},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"multiplicity",{get:function(){return this.yu},enumerable:!1,configurable:!0}),n.prototype.getWeightTotal=function(){for(var t=this.children,n=0,i=this.yu,r=this.Xn,e=0,u=t.length;e<u;){for(var s=-1,h=0;h<i&&e+h<u;++h){var o=t[r?u-1-(e+h):e+h];if(He(o)){var a=o.getClearType();if(0!==h&&a&yi.BEFORE)break;if(s=Math.max(s,o.weight),a&&yi.AFTER){h+=1;break}}else e+=1,h-=1}e+=h,0<=s&&(n+=s)}return n},n.prototype.getSpaceLeft=function(t,n){var i=this.children,r=this.yu,e=this.Xn;if(this.Gt===Ge.VERTICAL){for(var u=t,s=0,h=0,o=i.length;h<o;){for(var a=0,c=-1,f=0;f<r&&h+f<o;++f){var l=i[e?o-1-(h+f):h+f];if(He(l)){var v=l.getClearType();if(0!==f&&v&yi.BEFORE)break;if(a=(c=Math.max(c,l.weight))<0?Math.max(a,l.height+s):s,v&yi.AFTER){f+=1;break}}else h+=1,f-=1}h+=f,u-=a,s=n}return Math.max(0,u)}for(u=t,s=0,h=0,o=i.length;h<o;){var b=0;for(c=-1,f=0;f<r&&h+f<o;++f)if(l=i[e?o-1-(h+f):h+f],He(l)){if(v=l.getClearType(),0!==f&&v&yi.BEFORE)break;if(b=(c=Math.max(c,l.weight))<0?Math.max(b,l.width+s):s,v&yi.AFTER){f+=1;break}}else h+=1,f-=1;h+=f,u-=b,s=n}return Math.max(0,u)},n.prototype.calcSpaceLeft=function(t,n,i,r){return t?0:this.getSpaceLeft(n-i,r)},n.prototype.onRefit=function(){var i=this.children,r=this.Bn,e=r.getTop(),u=r.getBottom(),s=r.getLeft(),h=r.getRight(),o=this.Re,a=o.vertical,c=o.horizontal,f=this.getWeightTotal(),l=this.yu,v=this.Xn,b=this.Cn,d=null;if(this.Ru){var g=4+(i.length<<1);(null==n.CORNER_ADJUST_WORK||n.CORNER_ADJUST_WORK.length<g)&&(n.CORNER_ADJUST_WORK=new Float32Array(g)),(d=n.CORNER_ADJUST_WORK)[0]=-2,d[1]=-2,d[g-2]=-3,d[g-1]=-3}if(this.Gt===Ge.VERTICAL){var m=0,w=e-a;if(0<f){for(var p=1/f,O=this.calcSpaceLeft(b.height.isOn,this.height,e+u,a),D=0,E=i.length;D<E;){for(var M=s-c,S=0,T=0;T<l&&D+T<E;++T){var j=i[v?E-1-(D+T):D+T];if(He(j)){var N=j.getClearType();if(0!==T&&N&yi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.height=O*(U*p)),M+=c+j.width,S=Math.max(S,j.height),N&yi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1}w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],He(j)){var I=d[0+(z=2+(D<<1))],C=d[z+1],A=-2;if(!((N=j.getClearType())&yi.BEFORE)){var R=this.findRowIndexPrevious(z,C,d);this.hasClearTypeAfter(i,R)||(A=d[R])}var y=-2;if(!(N&yi.AFTER)){var k=this.findRowIndexNext(z,C,d);this.hasClearTypeBefore(i,k)||(y=d[k])}var L=this.countColumn(z,C,d);j.corner.mask=this.toCornerMaskColumn(A,I,y,L)}}else{for(D=0,E=i.length;D<E;){for(M=s-c,S=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],He(j)){if(N=j.getClearType(),0!==T&&N&yi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.height=0),M+=c+j.width,S=Math.max(S,j.height),N&yi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=T,d[G+1]=m)}else null!=d&&(d[0+(G=D+T+1<<1)]=T-1,d[G+1]=m),D+=1,T-=1;w+=a+S,D+=T,m+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)j=i[v?E-1-D:D],He(j)&&(I=d[0+(z=2+(D<<1))],C=d[z+1],A=-2,(N=j.getClearType())&yi.BEFORE||(R=this.findRowIndexPrevious(z,C,d),this.hasClearTypeAfter(i,R)||(A=d[R])),y=-2,N&yi.AFTER||(k=this.findRowIndexNext(z,C,d),this.hasClearTypeBefore(i,k)||(y=d[k])),L=this.countColumn(z,C,d),j.corner.mask=this.toCornerMaskColumn(A,I,y,L))}}else{var x=0;if(M=s-c,0<f){for(p=1/f,O=this.calcSpaceLeft(b.width.isOn,this.width,s+h,c),D=0,E=i.length;D<E;){w=e-a;var B=0;for(T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],He(j)){if(N=j.getClearType(),0!==T&&N&yi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.width=O*(U*p)),B=Math.max(B,j.width),w+=a+j.height,N&yi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1;M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D)if(j=i[v?E-1-D:D],He(j)){I=d[0+(z=2+(D<<1))],C=d[z+1];var _=-2;(N=j.getClearType())&yi.BEFORE||(R=this.findColumnIndexPrevious(z,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1]));var P=-2;N&yi.AFTER||(k=this.findColumnIndexNext(z,I,d),this.hasClearTypeBefore(i,k)||(P=d[k+1]));var F=this.countRow(z,I,d);j.corner.mask=this.toCornerMaskRow(_,C,P,F)}}else{for(D=0,E=i.length;D<E;){for(w=e-a,B=0,T=0;T<l&&D+T<E;++T)if(j=i[v?E-1-(D+T):D+T],He(j)){var U;if(N=j.getClearType(),0!==T&&N&yi.BEFORE)break;if(j.position.set(c+M,a+w),0<=(U=j.weight)&&(j.width=0),B=Math.max(B,j.width),w+=a+j.height,N&yi.AFTER){null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T),T+=1;break}null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T)}else{var G;null!=d&&(d[0+(G=D+T+1<<1)]=x,d[G+1]=T-1),D+=1,T-=1}M+=c+B,D+=T,x+=1}if(null!=d)for(D=0,E=i.length;D<E;++D){var z;j=i[v?E-1-D:D],He(j)&&(I=d[0+(z=2+(D<<1))],C=d[z+1],_=-2,(N=j.getClearType())&yi.BEFORE||(R=this.findColumnIndexPrevious(z,I,d),this.hasClearTypeAfter(i,R)||(_=d[R+1])),P=-2,N&yi.AFTER||(k=this.findColumnIndexNext(z,I,d),this.hasClearTypeBefore(i,k)||(P=d[k+1])),F=this.countRow(z,I,d),j.corner.mask=this.toCornerMaskRow(_,C,P,F))}}}t.prototype.onRefit.call(this)},n.prototype.hasClearTypeBefore=function(t,n){return this.hasClearType(t,n,yi.BEFORE)},n.prototype.hasClearTypeAfter=function(t,n){return this.hasClearType(t,n,yi.AFTER)},n.prototype.hasClearType=function(t,n,i){if(2<=n){var r=n-2>>1;if(0<=r&&r<t.length){var e=t[r];if(e instanceof Ki)return!!(e.getClearType()&i)}}return!1},n.prototype.findColumnIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r]!==n)return r;return 0},n.prototype.findColumnIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s]!==u)return s-2;return r}}return i.length-2},n.prototype.countRow=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r]!==n)return i[r-2+1]+1;return 0},n.prototype.findRowIndexPrevious=function(t,n,i){for(var r=t-2;0<=r;r-=2)if(i[r+1]!==n)return r;return 0},n.prototype.findRowIndexNext=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2){var u=i[r+1];if(u!==n){for(var s=r+2;s<e;s+=2)if(i[s+1]!==u)return s-2;return r}}return i.length-2},n.prototype.countColumn=function(t,n,i){for(var r=t+2,e=i.length;r<e;r+=2)if(i[r+1]!==n)return i[r-2+0]+1;return 0},n.prototype.toCornerMaskColumn=function(t,n,i,r){var e=mi.NONE;return t+1<n&&0===n&&(e|=mi.TOP_LEFT),i+1<n&&0===n&&(e|=mi.BOTTOM_LEFT),t<n&&n+1===r&&(e|=mi.TOP_RIGHT),i<n&&n+1===r&&(e|=mi.BOTTOM_RIGHT),mi.ALL&~e},n.prototype.toCornerMaskRow=function(t,n,i,r){var e=mi.NONE;return t+1<n&&0===n&&(e|=mi.TOP_LEFT),i+1<n&&0===n&&(e|=mi.TOP_RIGHT),t<n&&n+1===r&&(e|=mi.BOTTOM_LEFT),i<n&&n+1===r&&(e|=mi.BOTTOM_RIGHT),mi.ALL&~e},n.prototype.addSpace=function(t){return this.addChild(new ze(t))},n.prototype.getType=function(){return"DLayout"},n.CORNER_ADJUST_WORK=null,n}(Ki),We=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutHorizontal"},n}(Ve),Xe=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DLayoutVertical"},n}(Ve),Ke=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e=this;t.prototype.init.call(this,n);var u=this.theme,s=this.newLayout(u,n);this.onInit(s,n);var h=null!==(i=null==n?void 0:n.ok)&&void 0!==i?i:u.getOk(),o=null!==(r=null==n?void 0:n.cancel)&&void 0!==r?r:u.getCancel();if(null!=h||null!=o){var a=new We({parent:s,width:"padding",height:"auto",padding:{top:Math.max(0,this.padding.getTop()-s.margin.vertical)}});this.ku=a,new ze({parent:a,weight:1}),null!=h&&null!=o?(this.Lu=new Re({parent:a,text:{value:o},on:{active:function(){e.cancel()}}}),this.xu=new Ae({parent:a,text:{value:h},on:{active:function(){e.ok()}}})):null!=h?this.xu=new Re({parent:a,text:{value:h},on:{active:function(){e.ok()}}}):null!=o&&(this.Lu=new Re({parent:a,text:{value:o},on:{active:function(){e.cancel()}}})),new ze({parent:a,weight:1})}},n.prototype.newLayout=function(t,n){return new Xe(this.toLayoutOptions(t,null==n?void 0:n.layout))},n.prototype.toLayoutOptions=function(t,n){var i,r,e,u,s;return null!=n||(n={}),n.parent=this,null!==(i=n.x)&&void 0!==i||(n.x=t.getLayoutX()),null!==(r=n.y)&&void 0!==r||(n.y=t.getLayoutY()),null!==(e=n.width)&&void 0!==e||(n.width=t.getLayoutWidth()),null!==(u=n.height)&&void 0!==u||(n.height=t.getLayoutHeight()),null!==(s=n.margin)&&void 0!==s||(n.margin=t.getLayoutMargin()),n},n.prototype.onInit=function(t,n){},n.prototype.ok=function(){this.onOk(this.getResolvedValue())},n.prototype.onOk=function(t){this.Eu!==Be.MODELESS&&this.doResolve(t),this.emit("ok",t,this)},n.prototype.cancel=function(){this.onCancel(this.getRejectReason())},n.prototype.onCancel=function(t){this.Eu!==Be.MODELESS&&this.doReject(t),this.emit("cancel",t,this)},n.prototype.getRejectReason=function(){},n.prototype.getType=function(){return"DDialogCommand"},n}(Ue),Ye=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DText"},n}(Ne),Je=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i);var r=this.theme,e=this.toMargin(r,i),u=e.horizontal,s=e.vertical,h=this.toLabelOptions(r,i);h&&(this.Bu=new Ye(h),new We({parent:n,width:"padding",height:"auto",margin:0,children:[new ze({width:u}),this.Bu]})),new We({parent:n,width:"padding",height:"auto",margin:0,padding:h?{top:s}:void 0,children:[new ze({width:u}),this.input,new ze({width:u})]})},n.prototype.toMargin=function(t,n){var i=null==n?void 0:n.margin;if(null!=i){if(Xt(i))return{horizontal:i,vertical:i};var r=i.horizontal,e=i.vertical;return{horizontal:null!=r?r:t.getMarginHorizontal(),vertical:null!=e?e:t.getMarginVertical()}}return{horizontal:t.getMarginHorizontal(),vertical:t.getMarginVertical()}},n.prototype.toLabelOptions=function(t,n){var i=null==n?void 0:n.label;if(null==i)return null;if(at(i))return{weight:1,text:{value:i}};var r=i.text||{};return i.text=r,void 0===r.value&&(r.value=t.getLabel()),void 0===i.width&&void 0===i.weight&&(i.weight=1),i},Object.defineProperty(n.prototype,"label",{get:function(){return this.Bu},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"input",{get:function(){var t=this._u;if(null==t){var n=this.Nn;t=this.newInput(null==n?void 0:n.input),this._u=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.input.value},set:function(t){this.input.value=t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.input.value},n.prototype.getType=function(){return"DDialogInput"},n}(Ke),Ze=function(t){function n(n){var i=t.call(this)||this;i.Pu=[],i.Fu=null,i.Uu=function(t){i.active=t};var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i.emit("init",i),i}return _(n,t),n.prototype.add=function(t){if(this.Pu.indexOf(t)<0){this.Pu.push(t);var n=this.Gu;null!=n&&(t.state.isEnabled=n),t.on("active",this.Uu),t.state.isActive&&(this.active=t)}},Object.defineProperty(n.prototype,"active",{get:function(){return this.Fu},set:function(t){if((null==t||t.isToggle)&&this.Fu!==t){var n=this.Fu;this.Fu=null;for(var i=this.Pu,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u.isToggle&&u.state.isActive&&u.toggle()}this.emit("active",t,n,this)}},enumerable:!1,configurable:!0}),n.prototype.remove=function(t){var n=this.Pu,i=n.indexOf(t);0<=i&&(n.splice(i,1),t.off("active",this.Uu),this.Fu===t&&(this.active=null))},n.prototype.contains=function(t){return 0<=this.Pu.indexOf(t)},n.prototype.clear=function(){this.Pu.length=0,this.active=null},n.prototype.size=function(){return this.Pu.length},n.prototype.each=function(t){for(var n=this.Pu,i=0,r=n.length;i<r&&!1!==t(n[i]);++i);},n.prototype.disable=function(){for(var t=this.Pu,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!0;this.Gu=!1},n.prototype.enable=function(){for(var t=this.Pu,n=0,i=t.length;n<i;++n)t[n].state.isDisabled=!1;this.Gu=!0},n.prototype.destroy=function(){this.clear()},n}(t.utils.EventEmitter),qe=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOff"},n}(Ae),$e=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputBooleanButtonOn"},n}(Ae),Qe=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.getButtonOff()),i.addChild(i.getButtonOn());var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i.getButtonGroup().on("active",(function(){var t=i.value;i.emit("change",t,!t,i)})),i}return _(n,t),n.prototype.getButtonGroup=function(){var t=this.zu;return null==t&&(t=this.newButtonGroup(),this.zu=t),t},n.prototype.newButtonGroup=function(){return new Ze},n.prototype.getButtonOn=function(){var t=this.Hu;return null==t&&(t=this.newButtonOn(),this.Hu=t),t},n.prototype.newButtonOn=function(){return new $e({weight:1,group:this.getButtonGroup()})},n.prototype.getButtonOff=function(){var t=this.Vu;return null==t&&(t=this.newButtonOff(),this.Vu=t),t},n.prototype.newButtonOff=function(){return new qe({weight:1,group:this.getButtonGroup(),state:ht.ACTIVE})},Object.defineProperty(n.prototype,"value",{get:function(){return this.getButtonOn().state.isActive},set:function(t){this.value!==t&&(t?this.getButtonOn().onClick():this.getButtonOff().onClick())},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputBoolean"},n}(We),tu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){return new Qe(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputBoolean"},n}(Je),nu=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.target=qt.ofStringOrNull(n.target),r}return _(n,t),n}(Qt),iu=function(t){function n(n){var i=t.call(this,n,Yt.NONE)||this;return i.onInputAction=n.onInputAction,i.isOpened=!1,i}return _(n,t),n.prototype.execute=function(t,n,i){var r=this;if(!this.isOpened&&this.condition(t,i)){var e=this.target(t,i);if(null!=e){var u=this.initial(t,i);this.isOpened=!0,setTimeout((function(){r.open(e,u).then((function(n){r.isOpened=!1,Er.execute(t,r.onInputAction,e,n,i)}),(function(){r.isOpened=!1}))}),0)}}},n}(nu),ru=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofBooleanOrFalse(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=n.DIALOG;if(null==r)r=new tu({label:t}),n.DIALOG=r;else{var e=r.label;e&&(e.text=t)}return r.value=i,r.open()},n}(iu),eu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getUtil=function(){var t=this.Wu;return null==t&&(t=this.newUtil(),this.Wu=t),t},n.prototype.newUtil=function(){return new br(this,this.newOperation(),this.theme,this.Nn)},n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){},onCancel:function(){},onEnd:function(){}}},Object.defineProperty(n.prototype,"element",{get:function(){return this.getUtil().element},enumerable:!1,configurable:!0}),n.prototype.onDownThis=function(n){var i=this.getUtil();i.onDowning(n),t.prototype.onDownThis.call(this,n),i.onDown(n)},n.prototype.onDblClick=function(n,i){return this.getUtil().onDblClick(n,i),t.prototype.onDblClick.call(this,n,i)},n.prototype.onFocus=function(){t.prototype.onFocus.call(this),this.getUtil().onFocus()},n.prototype.onBlur=function(){t.prototype.onBlur.call(this),this.getUtil().onBlur()},n.prototype.start=function(){this.getUtil().start()},n.prototype.render=function(n){this.getUtil().onRender(n),t.prototype.render.call(this,n)},n.prototype.getElementRect=function(t,n,i){return n.set(0,0),this.toGlobal(n,n,!1),i.x=n.x,i.y=n.y,n.set(this.width,this.height),this.toGlobal(n,n,!0),i.width=n.x-i.x,i.height=n.y-i.y,i.x=(i.x*t|0)/t,i.y=(i.y*t|0)/t,i},n.prototype.getClipperRect=function(t,n,i){return br.getClipperRect(this.parent,this,t,n,i)},n.prototype.cancel=function(){this.getUtil().cancel()},n.prototype.end=function(){this.getUtil().end()},n.prototype.select=function(){return this.getUtil().select(),this},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.start(),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DHtmlElement"},n}(Ie),uu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newOperation=function(){var t=this;return{getElementRect:function(n,i,r){return t.getElementRect(n,i,r)},getElementMatrix:function(){return null},getClipperRect:function(n,i,r){return t.getClipperRect(n,i,r)},getPadding:function(){return t.padding},containsPoint:function(n){return t.containsPoint(n)},onStart:function(){t.hideText()},onCancel:function(){t.showText()},onEnd:function(){},getValue:function(){return t.nu},onValueInput:function(n){t.onValueInput(n)},onValueChange:function(n,i){t.text=n,t.onValueChange(n,i)},onEnter:function(){t.onEnter()},applyTitle:function(){t.applyTitle()}}},Object.defineProperty(n.prototype,"value",{get:function(){return this.nu},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.onTextChange=function(){t.prototype.onTextChange.call(this),this.validate()},n.prototype.onValueChange=function(t,n){this.emit("change",t,n,this)},n.prototype.onValueInput=function(t){this.emit("input",t,this)},n.prototype.onEnter=function(){this.emit("enter",this)},n.prototype.validate=function(){return this.getUtil().validate()},n.prototype.applyTitle=function(){this.getUtil().applyTitle()||t.prototype.applyTitle.call(this)},n.prototype.getType=function(){return"DInput"},n}(eu),su=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInput"},n}(uu),hu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new Or(this,this.newOperation(),this.theme,this.Nn)},Object.defineProperty(n.prototype,"step",{get:function(){return this.getUtil().step},set:function(t){this.getUtil().step=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.getUtil().min},set:function(t){this.getUtil().min=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.getUtil().max},set:function(t){this.getUtil().max=t},enumerable:!1,configurable:!0}),n}(su),ou=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputInteger"},n}(hu),au=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new ou(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputInteger"},n}(Je),cu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=n.DIALOG;if(null==r)r=new au({label:t}),n.DIALOG=r;else{var e=r.label;e&&(e.text=t)}return r.value=i,r.open()},n}(iu),fu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputReal"},n}(hu),lu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new fu(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputReal"},n}(Je),vu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofNumber(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=n.DIALOG;if(null==r)r=new lu({label:t}),n.DIALOG=r;else{var e=r.label;e&&(e.text=t)}return r.value=i,r.open()},n}(iu),bu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new Ir(this,this.newOperation(),this.theme,this.Nn)},n.prototype.getType=function(){return"DInputText"},n}(su),du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newInput=function(t){var n=this,i=new bu(this.toInputOptions(t));return i.on("enter",(function(){n.ok()})),i},n.prototype.toInputOptions=function(t){return t?(void 0===t.weight&&(t.weight=1),t):{weight:1}},n.prototype.getType=function(){return"DDialogInputText"},n}(Je),gu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofString(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=n.DIALOG;if(null==r)r=new du({label:t}),n.DIALOG=r;else{var e=r.label;e&&(e.text=t)}return r.value=i,r.open()},n}(iu),mu=function(t){function n(n){return t.call(this,n,Yt.NONE)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.target(t,i);null!=r&&or.open(t,r)}},n}(nu),wu=function(t){function n(n){return t.call(this,n,Yt.NONE)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.target(t,i);null!=r&&window.open(r)}},n}(nu),pu=function(t){function n(n){return t.call(this,n,Yt.NONE)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.target(t,i);null!=r&&(window.location.href=r)}},n}(nu),Ou={DIAGRAM:0,PAGE:1,PAGE_INPLACE:2,DIALOG_TEXT:3,DIALOG_INTEGER:4,DIALOG_REAL:5,DIALOG_BOOLEAN:6,DIALOG_DATE:7,DIALOG_TIME:8,DIALOG_DATETIME:9},Du=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonAmbient"},n}(Ae),Eu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonBack"},n}(Du),Mu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonDate"},n}(Du),Su=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeButtonNext"},n}(Du),Tu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabel"},n}(Ye),ju=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeLabelDate"},n}(Ye),Nu=function(t){function n(n){var i=t.call(this,n)||this;return i.renderable=!1,i}return _(n,t),n.prototype.getType=function(){return"DPickerDatetimeSpace"},n}(Ki),Iu={NONE:0,DATE:1,HOURS:2,MINUTES:4,SECONDS:8,TIME:14,ALL:15},Cu=function(){function t(){}return t.from=function(t,n){var i=null==n?void 0:n.mask;if(null==i){if(at(t)){var r=K.getInstance().get(t);if(null!=r)return r.getMask()}else if(null!=t)return t.getMask();return Iu.NONE}if(at(i))return Iu[i];if(Xt(i))return i;for(var e=Iu.NONE,u=0,s=i.length;u<s;++u)e|=Iu[i[u]];return e},t}(),Au=function(){function t(t,n){var i,r;this.Xu=null!==(i=null==t?void 0:t.date)&&void 0!==i?i:null,this.Ku=null!==(r=null==t?void 0:t.inclusive)&&void 0!==r&&r,this.q=n}return Object.defineProperty(t.prototype,"date",{get:function(){return this.Xu},set:function(t){this.Xu!==t&&(this.Xu=t,this.q())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"inclusive",{get:function(){return this.Ku},set:function(t){this.Ku!==t&&(this.Ku=t,this.q())},enumerable:!1,configurable:!0}),t}(),Ru=function(){function t(t){this.O=t}return t.prototype.min=function(t){var n=this.O,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(r.getFullYear()<t.getFullYear())return e.hour.min;if(r.getMonth()<t.getMonth())return e.hour.min;if(r.getDate()<t.getDate())return e.hour.min}var s=r.getHours();return i.inclusive||u&Iu.SECONDS&&r.getSeconds()<e.second.max||u&Iu.MINUTES&&r.getMinutes()<e.minute.max?s:s+1}return e.hour.min},t.prototype.max=function(t){var n=this.O,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(t.getFullYear()<r.getFullYear())return e.hour.max;if(t.getMonth()<r.getMonth())return e.hour.max;if(t.getDate()<r.getDate())return e.hour.max}var s=r.getHours();return i.inclusive||u&Iu.SECONDS&&e.second.min<r.getSeconds()||u&Iu.MINUTES&&e.minute.min<r.getMinutes()?s:s-1}return e.hour.max},t}(),yu=function(){function t(t){this.O=t}return t.prototype.min=function(t){var n=this.O,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(r.getFullYear()<t.getFullYear())return e.minute.min;if(r.getMonth()<t.getMonth())return e.minute.min;if(r.getDate()<t.getDate())return e.minute.min}if(u&Iu.HOURS&&r.getHours()<t.getHours())return e.minute.min;var s=r.getMinutes();return i.inclusive||u&Iu.SECONDS&&r.getSeconds()<e.second.max?s:s+1}return e.minute.min},t.prototype.max=function(t){var n=this.O,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(t.getFullYear()<r.getFullYear())return e.minute.max;if(t.getMonth()<r.getMonth())return e.minute.max;if(t.getDate()<r.getDate())return e.minute.max}if(u&Iu.HOURS&&t.getHours()<r.getHours())return e.minute.max;var s=r.getMinutes();return i.inclusive||u&Iu.SECONDS&&e.second.min<r.getSeconds()?s:s-1}return e.minute.max},t}(),ku=function(){function t(t){this.O=t}return t.prototype.min=function(t){var n=this.O,i=n.lower,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(r.getFullYear()<t.getFullYear())return e.second.min;if(r.getMonth()<t.getMonth())return e.second.min;if(r.getDate()<t.getDate())return e.second.min}return u&Iu.HOURS&&r.getHours()<t.getHours()||u&Iu.MINUTES&&r.getMinutes()<t.getMinutes()?e.second.min:r.getSeconds()+(i.inclusive?0:1)}return e.second.min},t.prototype.max=function(t){var n=this.O,i=n.upper,r=i.date,e=n.constant;if(null!=r){var u=n.mask;if(u&Iu.DATE){if(t.getFullYear()<r.getFullYear())return e.second.max;if(t.getMonth()<r.getMonth())return e.second.max;if(t.getDate()<r.getDate())return e.second.max}return u&Iu.HOURS&&t.getHours()<r.getHours()||u&Iu.MINUTES&&t.getMinutes()<r.getMinutes()?e.second.max:r.getSeconds()-(i.inclusive?0:1)}return e.second.max},t}(),Lu=function(){function t(t,n){this.constant=this.newConstant(),this.lower=new Au(t&&t.lower,n),this.upper=new Au(t&&t.upper,n),this.mask=Iu.ALL,this.hours=new Ru(this),this.minutes=new yu(this),this.seconds=new ku(this)}return t.prototype.newConstant=function(){return{second:{min:0,max:59},minute:{min:0,max:59},hour:{min:0,max:23}}},t.prototype.adjust=function(t){var n=this.test(t);if(n<0){var i=this.lower,r=i.date;if(r)return t.setTime(r.getTime()),i.inclusive||((e=this.mask)&Iu.SECONDS?t.setSeconds(r.getSeconds()+1):e&Iu.MINUTES?t.setMinutes(r.getMinutes()+1):e&Iu.HOURS?t.setHours(r.getHours()+1):e&Iu.DATE&&t.setDate(r.getDate()+1)),!0}else if(0<n){var e,u=this.upper,s=u.date;if(s)return t.setTime(s.getTime()),u.inclusive||((e=this.mask)&Iu.SECONDS?t.setSeconds(s.getSeconds()-1):e&Iu.MINUTES?t.setMinutes(s.getMinutes()-1):e&Iu.HOURS?t.setHours(s.getHours()-1):e&Iu.DATE&&t.setDate(s.getDate()-1)),!0}return!1},t.prototype.compare=function(t,n){var i=this.mask;if(i&Iu.DATE){var r,e,u,s,h=t.getFullYear(),o=n.getFullYear();if(h!==o)return h<o?-1:1;if((r=t.getMonth())!==(e=n.getMonth()))return r<e?-1:1;if((u=t.getDate())!==(s=n.getDate()))return u<s?-1:1}if(i&Iu.HOURS){var a=t.getHours(),c=n.getHours();if(a!==c)return a<c?-1:1}return i&Iu.MINUTES&&(r=t.getMinutes())!==(e=n.getMinutes())?r<e?-1:1:i&Iu.SECONDS&&(u=t.getSeconds())!==(s=n.getSeconds())?u<s?-1:1:0},t.prototype.test=function(t){var n=this.lower,i=n.date;if(null!=i){var r=this.compare(i,t);return n.inclusive?r<=0?0:-1:r<0?0:-1}var e=this.upper,u=e.date;return null!=u?(r=this.compare(t,u),e.inclusive?r<=0?0:1:r<0?0:1):0},t.prototype.contains=function(t){return 0===this.test(t)},t}(),xu=function(t,n,i){if(t){var r=t.date,e=t.inclusive;return{date:void 0!==r?r:n,inclusive:void 0!==e?e:i}}return{date:n,inclusive:i}},Bu=function(t){function n(n){var i=t.call(this,n)||this;return i.onNewChange(),i}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n);var e=this.theme;this.Yu=new Date;var u=this.Yu.getTime();this.Ju=new Date(u),this.Zu=new Lu(function(t,n){return n?{lower:xu(n.lower,t.getLowerBound(),t.isLowerBoundInclusive()),upper:xu(n.upper,t.getUpperBound(),t.isUpperBoundInclusive())}:{lower:{date:t.getLowerBound(),inclusive:t.isLowerBoundInclusive()},upper:{date:t.getUpperBound(),inclusive:t.isUpperBoundInclusive()}}}(e,null==n?void 0:n.bounds),(function(){r.onNewChange()}));var s=null!==(i=null==n?void 0:n.margin)&&void 0!==i?i:e.getMargin();new Xe({parent:this,x:"padding",y:"padding",width:"auto",height:"auto",margin:s,children:this.newChildren(e,n,s)})},Object.defineProperty(n.prototype,"current",{get:function(){return this.Yu},set:function(t){this.Yu.getTime()!==t.getTime()&&(this.Yu=t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.Ju},set:function(t){this.Ju.getTime()!==t.getTime()&&(this.Ju=t,this.onNewChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bounds",{get:function(){return this.Zu},enumerable:!1,configurable:!0}),n.prototype.hasHours=function(){return null!=this.qu},n.prototype.hasMinutes=function(){return null!=this.$u},n.prototype.hasSeconds=function(){return null!=this.Qu},n.prototype.reset=function(){var t=this.Yu.getTime();this.Ju.setTime(t),this.onReset()},n.prototype.onReset=function(){this.onNewChange()},n.prototype.onNewChange=function(){var t=this.Ju,n=this.Zu;n.adjust(this.Ju);var i=this.qu;if(i){var r=n.hours;i.value=t.getHours(),i.min=r.min(t),i.max=r.max(t)}var e=this.$u;if(e){var u=n.minutes;e.value=t.getMinutes(),e.min=u.min(t),e.max=u.max(t)}var s=this.Qu;if(s){var h=n.seconds;s.value=t.getSeconds(),s.min=h.min(t),s.max=h.max(t)}},n.prototype.newChildren=function(t,n,i){var r=Cu.from(t,n);return this.Zu.mask=r,this.qu=r&Iu.HOURS?this.newInputHours(t,n):null,this.$u=r&Iu.MINUTES?this.newInputMinutes(t,n):null,this.Qu=r&Iu.SECONDS?this.newInputSeconds(t,n):null,[this.newTimeLayout(this.qu,this.$u,this.Qu,i)]},n.prototype.newTimeLayout=function(t,n,i,r){var e=this.newTimeLayoutChildren(t,n,i);return 0<e.length?new We({width:this.getTimeLayoutWidth(),height:this.getTimeLayoutHeight(),margin:r,children:e}):null},n.prototype.getTimeLayoutWidth=function(){return"auto"},n.prototype.getTimeLayoutHeight=function(){return"auto"},n.prototype.newTimeLayoutChildren=function(t,n,i){var r=[];return null!=t&&r.push(t),null!=n&&(0<r.length&&r.push(this.newMinuteSeparator()),r.push(n)),null!=i&&(0<r.length&&r.push(this.newSecondSeparator()),r.push(i)),r},n.prototype.newMinuteSeparator=function(){return new Ye({width:"auto",text:{value:this.getMinuteSeparator()}})},n.prototype.getMinuteSeparator=function(){return":"},n.prototype.newSecondSeparator=function(){return new Ye({width:"auto",text:{value:this.getSecondSeparator()}})},n.prototype.getSecondSeparator=function(){return":"},n.prototype.adjustInputOptions=function(t,n,i){return null==n.step&&(n.step=1),null==n.min&&(n.min=0),null==n.max&&(n.max=i),n},n.prototype.newInputHours=function(t,n){var i,r=this,e=null!==(i=null==n?void 0:n.hours)&&void 0!==i?i:t.getHoursOptions(),u=this.Zu.constant.hour.max,s=new ou(this.adjustInputOptions(t,e,u));return s.on("change",(function(t){r.onHoursChange(t)})),s},n.prototype.onHoursChange=function(t){this.Ju.setHours(t),this.onNewChange()},n.prototype.newInputMinutes=function(t,n){var i=this,r=(null==n?void 0:n.minutes)||t.getMinutesOptions(),e=this.Zu.constant.minute.max,u=new ou(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onMinutesChange(t)})),u},n.prototype.onMinutesChange=function(t){this.Ju.setMinutes(t),this.onNewChange()},n.prototype.newInputSeconds=function(t,n){var i=this,r=(null==n?void 0:n.seconds)||t.getSecondsOptions(),e=this.Zu.constant.second.max,u=new ou(this.adjustInputOptions(t,r,e));return u.on("change",(function(t){i.onSecondsChange(t)})),u},n.prototype.onSecondsChange=function(t){this.Ju.setSeconds(t)},n.prototype.getType=function(){return"DPickerTime"},n}(Ki),_u=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.ts=new Date(this.Yu.getTime())},n.prototype.newChildren=function(n,i,r){var e,u;this.ns=this.newDateButtons(n,i),this.rs=null!==(u=null===(e=null==i?void 0:i.date)||void 0===e?void 0:e.decorator)&&void 0!==u?u:n.getDateDecorator(),this.Bu=this.newLabel(n,i);var s=t.prototype.newChildren.call(this,n,i,r);return s.unshift(new We({width:"100%",height:"auto",children:[this.newBackButton(n,i),this.Bu,this.newNextButton(n,i)]}),new We({width:"auto",height:"auto",margin:r,children:this.newDateLabels(n,i)}),new Xe({width:"auto",height:"auto",margin:r,column:7,children:this.ns})),s},Object.defineProperty(n.prototype,"page",{get:function(){return this.ts},set:function(t){this.ts.getTime()!==t.getTime()&&(this.ts=t,this.onPageChange())},enumerable:!1,configurable:!0}),n.prototype.onReset=function(){this.ts.setTime(this.Yu.getTime()),t.prototype.onReset.call(this)},n.prototype.next=function(){var t=this.ts;t.setFullYear(t.getFullYear(),t.getMonth()+1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.back=function(){var t=this.ts;t.setFullYear(t.getFullYear(),t.getMonth()-1,1),t.setHours(0,0,0,0),this.onPageChange()},n.prototype.onNewChange=function(){this.Zu.adjust(this.ts),t.prototype.onNewChange.call(this),this.onPageChange()},n.prototype.onPageChange=function(){var t=this.ns,n=this.Zu,i=this.ts,r=this.Ju,e=new Date(i.getTime());e.setDate(1),e.setHours(0,0,0,0);for(var u=this.theme,s=(e.getDay()-u.getDayStart()+7)%7,h=0;h<s;++h)t[h].show();for(h=s;h<7;++h)t[h].hide();var o=this.rs;e.setFullYear(e.getFullYear(),e.getMonth()+1,0);var a=e.getDate(),c=r.getFullYear()===e.getFullYear()&&r.getMonth()===e.getMonth()?r.getDate():0;for(h=0;h<a;++h)e.setDate(h+1),(f=t[h+7]).state.isActive=c===h+1,f.state.isDisabled=!n.contains(e),f.show(),o(e,f);for(h=a;h<31;++h){var f;(f=t[h+7]).state.isActive=!1,f.hide()}e.setTime(i.getTime()),this.Bu.text=e},n.prototype.adjustInputOptions=function(n,i,r){return null==i.weight&&(i.weight=1),t.prototype.adjustInputOptions.call(this,n,i,r)},n.prototype.getTimeLayoutWidth=function(){return"100%"},n.prototype.toLabelOptions=function(t,n){var i=n&&n.label||{};void 0===i.weight&&(i.weight=1),void 0===i.padding&&(i.padding=0);var r=i.text=i.text||{},e=r.align=r.align||{};return void 0===e.horizontal&&(e.horizontal="CENTER"),void 0===r.formatter&&(r.formatter=t.getLabelFormatter()),i},n.prototype.newLabel=function(t,n){return new Tu(this.toLabelOptions(t,n))},n.prototype.newBackButton=function(t,n){var i=this,r=null==n?void 0:n.back;if(void 0===r&&(r=t.getBackButtonOptions()),null!=r){var e=new Eu(r);return e.on("active",(function(){i.back()})),e}return null},n.prototype.newNextButton=function(t,n){var i=this,r=null==n?void 0:n.next;if(void 0===r&&(r=t.getNextButtonOptions()),null!=r){var e=new Su(r);return e.on("active",(function(){i.next()})),e}return null},n.prototype.newDateLabels=function(t,n){for(var i=t.getDayLabels(),r=t.getDayStart(),e=[],u=0;u<7;++u){var s=i[(r+u)%7];e.push(this.newDateLabel(t,n,s))}return e},n.prototype.newDateLabel=function(t,n,i){return new ju({text:{value:i}})},n.prototype.newDateButtons=function(t,n){for(var i=[],r=0;r<7;++r)i.push(this.newSpace(t,n));for(r=1;r<=31;++r)i.push(this.newDateButton(t,n,r));return i},n.prototype.newSpace=function(t,n){return new Nu},n.prototype.newDateButton=function(t,n,i){var r=this;return new Mu({text:{value:String(i)},on:{active:function(){r.onDateButtonClicked(i)}}})},n.prototype.onDateButtonClicked=function(t){var n=this.Ju;if(n.getDate()!==t){var i=this.ts;n.setFullYear(i.getFullYear()),n.setMonth(i.getMonth()),n.setDate(t),this.onNewChange()}},n.prototype.getType=function(){return"DPickerDatetime"},n}(Bu),Pu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.picker)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.es;return null==n&&(n=new _u(null===(t=this.Nn)||void 0===t?void 0:t.picker),this.es=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDatetime"},n}(Ke),Fu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=n.DIALOG;return null==r&&(r=new Pu,n.DIALOG=r),r.new=r.current=this.toDate(i),r.open().then((function(t){return t.toISOString()}))},n.prototype.toDate=function(t){return at(t)||Xt(t)?new Date(t):t instanceof Date?t:new Date},n}(iu),Uu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.picker)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.es;return null==n&&(n=new Bu(null===(t=this.Nn)||void 0===t?void 0:t.picker),this.es=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogTime"},n}(Ke),Gu=function(t){return t!=t},zu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=this,e=n.DIALOG;return null==e&&(e=new Uu,n.DIALOG=e),e.new=e.current=this.toDate(i),e.open().then((function(t){return r.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){if(Xt(t))return new Date(t);if(at(t)){var n=new Date,i=this.getPattern().exec(t);if(null!=i){var r=this.toHours(i[1]);null!=r&&n.setHours(r);var e=this.toMinutes(i[2]);null!=e&&n.setMinutes(e);var u=this.toSeconds(i[3]);null!=u&&n.setSeconds(u);var s=this.toMilliseconds(i[4]);null!=s&&n.setMilliseconds(s)}return n}return t instanceof Date?t:new Date},n.prototype.toHours=function(t){return this.toNumber(t,0,23)},n.prototype.toMinutes=function(t){return this.toNumber(t,0,59)},n.prototype.toSeconds=function(t){return this.toNumber(t,0,59)},n.prototype.toMilliseconds=function(t){var n=this.toNumber(t,0,999);if(null!=n){var i=t.length;return 1===i?100*n:2===i?10*n:n}return n},n.prototype.toNumber=function(t,n,i){if(null!=t){var r=+t;if(!Gu(r))return Math.min(i,Math.max(n,r))}return null},n.prototype.getPattern=function(){var t=n.PATTERN;return null==t&&(t=this.newPattern(),n.PATTERN=t),t},n.prototype.newPattern=function(){return/^\s*(?:(\d+)(?::(\d+)(?::(\d+))?)?)?(?:\.(\d+))?\s*$/},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return oi.create("%Hm")},n}(iu),Hu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPickerDate"},n}(_u),Vu=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.picker)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},set:function(t){this.picker.current=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},set:function(t){this.picker.new=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"page",{get:function(){return this.picker.new},set:function(t){this.picker.page=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.es;return null==n&&(n=new Hu(null===(t=this.Nn)||void 0===t?void 0:t.picker),this.es=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogDate"},n}(Ke),Wu=function(t){function n(n){var i=t.call(this,n)||this;return i.initial=qt.ofUnknown(n.initial),i}return _(n,t),n.prototype.open=function(t,i){var r=this,e=n.DIALOG;return null==e&&(e=new Vu,n.DIALOG=e),e.new=e.current=this.toDate(i),e.open().then((function(t){return r.getFormatter().format(t.getTime(),0)}))},n.prototype.toDate=function(t){return at(t)||Xt(t)?new Date(t):t instanceof Date?t:new Date},n.prototype.getFormatter=function(){var t=n.FORMATTER;return null==t&&(t=this.newFormatter(),n.FORMATTER=t),t},n.prototype.newFormatter=function(){return oi.create("%Y-%M-%D")},n}(iu),Xu=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.OPEN,i,n)||this;return s.target=r,s.onInputAction=e,s.initial=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.target===i.target},n.prototype.toRuntime=function(){switch(this.subtype){case Ou.DIAGRAM:return new mu(this);case Ou.PAGE:return new wu(this);case Ou.PAGE_INPLACE:return new pu(this);case Ou.DIALOG_TEXT:return new gu(this);case Ou.DIALOG_INTEGER:return new cu(this);case Ou.DIALOG_REAL:return new vu(this);case Ou.DIALOG_BOOLEAN:return new ru(this);case Ou.DIALOG_DATE:return new Wu(this);case Ou.DIALOG_TIME:return new zu(this);case Ou.DIALOG_DATETIME:return new Fu(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.target),r=t.addResource(this.initial);return t.addResource("["+this.type+","+n+","+this.subtype+","+i+","+this.onInputAction+","+r+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources),e=ln.toResource(3,t,i.resources),u=ln.toResource(5,t,i.resources);return new n(t[2],r,e,t[4],u)},n}(cn),Ku={SHOW:0,HIDE:1},Yu=function(t){function n(n){var i=t.call(this,n,Yt.VISIBILITY)||this;return i.visibility=n.subtype===Ku.SHOW,i}return _(n,t),n.prototype.execute=function(t,n,i){this.condition(t,i)&&(t.visible=this.visibility,n.written|=this.reset)},n}(Qt),Ju=function(t){function n(n,i){return t.call(this,fn.SHOW_HIDE,i,n)||this}return _(n,t),n.prototype.toRuntime=function(){return new Yu(this)},n.prototype.serialize=function(t){var n=t.addResource(this.condition);return t.addResource("["+this.type+","+n+","+this.subtype+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources);return new n(t[2],r)},n}(cn),Zu=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.amount=qt.ofNumber(n.amount),r}return _(n,t),n}(Qt),qu=function(t){function n(n){return t.call(this,n,Yt.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i);t.transform.position.x=r,n.written|=this.reset}},n}(Zu),$u=function(t){function n(n){return t.call(this,n,Yt.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i);t.transform.position.y=r,n.written|=this.reset}},n}(Zu),Qu=function(t){function n(n){return t.call(this,n,Yt.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=t.transform,u=e.position,s=!!(n.written&Yt.POSITION_X),h=!!(n.written&Yt.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o-c.c*r,a-c.d*r),n.written|=this.reset}},n}(Zu),ts=function(t){function n(n){return t.call(this,n,Yt.POSITION)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=t.transform,u=e.position,s=!!(n.written&Yt.POSITION_X),h=!!(n.written&Yt.POSITION_Y),o=s?u.x:n.x,a=h?u.y:n.y;t.updateTransform();var c=e.localTransform;u.set(o+c.a*r,a+c.b*r),n.written|=this.reset}},n}(Zu),ns=function(t){function n(n){return t.call(this,n,Yt.POSITION_X)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=!!(n.written&Yt.POSITION_X),u=t.transform.position,s=e?u.x:n.x;u.x=s+r,n.written|=this.reset}},n}(Zu),is=function(t){function n(n){return t.call(this,n,Yt.POSITION_Y)||this}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=!!(n.written&Yt.POSITION_Y),u=t.transform.position,s=e?u.y:n.y;u.y=s+r,n.written|=this.reset}},n}(Zu),rs=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r)||this;return u.opetype=e,u}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.opetype===i.opetype},n}(cn),es={RELATIVE_X:0,RELATIVE_Y:1,ABSOLUTE_X:2,ABSOLUTE_Y:3,FORWARD_OR_BACKWARD:4,LEFT_OR_RIGHT:5},us={RESIZE:0,MOVE:1,ROTATE:2},ss=function(t){function n(n,i,r){var e=t.call(this,fn.TRANSFORM,i,us.MOVE,n)||this;return e.amount=r,e}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case es.ABSOLUTE_X:return new qu(this);case es.ABSOLUTE_Y:return new $u(this);case es.FORWARD_OR_BACKWARD:return new Qu(this);case es.LEFT_OR_RIGHT:return new ts(this);case es.RELATIVE_X:return new ns(this);case es.RELATIVE_Y:return new is(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.opetype+","+i+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources),e=ln.toResource(4,t,i.resources);return new n(t[3],r,e)},n}(rs),hs=function(){function t(){}return t.toRounded=function(t){return Math.round(100*t)/100},t.toNormalized=function(n){return Math.abs(n)<.001?n<0?-.001:.001:t.toRounded(n)},t.resize=function(n,i,r,e,u){n.disallowUploadedUpdate();var s=n.transform.position;if(e){var h=Math.abs(r.x-i.x),o=Math.abs(r.y-i.y);if(u){var a=(l=Math.max(h,o))+l;n.size.set(t.toNormalized(a),t.toNormalized(a)),s.set(t.toRounded(i.x),t.toRounded(i.y))}else n.size.set(t.toNormalized(h+h),t.toNormalized(o+o)),s.set(t.toRounded(i.x),t.toRounded(i.y))}else if(u){h=r.x-i.x,o=r.y-i.y,a=Math.max(Math.abs(h),Math.abs(o));var c=i.x+(h<0?-a:+a),f=i.y+(o<0?-a:+a),l=.5*a,v=Math.min(i.x,c)+l,b=Math.min(i.y,f)+l;n.size.set(t.toNormalized(a),t.toNormalized(a)),s.set(t.toRounded(v),t.toRounded(b))}else{var d=Math.min(i.x,r.x),g=Math.min(i.y,r.y),m=Math.max(i.x,r.x)-d,w=Math.max(i.y,r.y)-g,p=.5*m,O=.5*w;n.size.set(t.toNormalized(m),t.toNormalized(w)),s.set(t.toRounded(d+p),t.toRounded(g+O))}n.allowUploadedUpdate()},t}(),os={RELATIVE_SIZE:0,RELATIVE_HEIGHT:1,RELATIVE_WIDTH:2,ABSOLUTE_SIZE:3,ABSOLUTE_HEIGHT:4,ABSOLUTE_WIDTH:5},as=function(t){function n(n,i){var r=t.call(this,n,i)||this;switch(n.opetype){case os.RELATIVE_SIZE:r.size=qt.ofNumberOrOne(n.amount);break;case os.ABSOLUTE_SIZE:r.size=qt.ofNumberOrOneHundred(n.amount);break;case os.RELATIVE_HEIGHT:r.size=qt.ofNumberOrOne(n.amount);break;case os.ABSOLUTE_HEIGHT:r.size=qt.ofNumberOrOneHundred(n.amount);break;case os.RELATIVE_WIDTH:r.size=qt.ofNumberOrOne(n.amount);break;case os.ABSOLUTE_WIDTH:r.size=qt.ofNumberOrOneHundred(n.amount);break;default:r.size=qt.ONE}return r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=(-.5+e)*i,h=(-.5+u)*r;t.updateTransform();var o=t.transform,a=o.position,c=o.localTransform,f=!!(n.written&Yt.POSITION_X),l=!!(n.written&Yt.POSITION_Y),v=f?a.x:n.x,b=l?a.y:n.y;n.written|=Yt.POSITION,a.set(v+s*c.a+h*c.c,b+s*c.b+h*c.d)},n}(Qt),cs=function(t){function n(n){var i=t.call(this,n,Yt.HEIGHT)||this;return i.origin=n.originY,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.size(t,i),e=t.size,u=n.written&Yt.HEIGHT?e.y:n.size.y;e.y=hs.toNormalized(r),n.written|=Yt.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(as),fs=function(t){function n(n){var i=t.call(this,n,Yt.HEIGHT)||this;return i.origin=n.originY,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.size(t,i),e=t.size,u=n.written&Yt.HEIGHT?e.y:n.size.y;e.y=hs.toNormalized(u*r),n.written|=Yt.HEIGHT,this.adjustPosition(t,n,0,u-e.y,.5,this.origin)}},n}(as),ls=function(t){function n(n){var i=t.call(this,n,Yt.SIZE)||this;return i.originX=n.originX,i.originY=n.originY,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=hs.toNormalized(this.size(t,i)),e=t.size,u=!!(n.written&Yt.WIDTH),s=!!(n.written&Yt.HEIGHT),h=u?e.x:n.size.x,o=s?e.y:n.size.y;e.set(r,r),n.written|=Yt.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(as),vs=function(t){function n(n){var i=t.call(this,n,Yt.SIZE)||this;return i.originX=n.originX,i.originY=n.originY,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.size(t,i),e=t.size,u=!!(n.written&Yt.WIDTH),s=!!(n.written&Yt.HEIGHT),h=u?e.x:n.size.x,o=s?e.y:n.size.y;e.set(hs.toNormalized(h*r),hs.toNormalized(o*r)),n.written|=Yt.SIZE,this.adjustPosition(t,n,h-e.x,o-e.y,this.originX,this.originY)}},n}(as),bs=function(t){function n(n){var i=t.call(this,n,Yt.WIDTH)||this;return i.origin=n.originX,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.size(t,i),e=t.size,u=n.written&Yt.WIDTH?e.x:n.size.x;e.x=hs.toNormalized(r),n.written|=Yt.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(as),ds=function(t){function n(n){var i=t.call(this,n,Yt.WIDTH)||this;return i.origin=n.originX,i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.size(t,i),e=t.size,u=n.written&Yt.WIDTH?e.x:n.size.x;e.x=hs.toNormalized(u*r),n.written|=Yt.WIDTH,this.adjustPosition(t,n,u-e.x,0,this.origin,.5)}},n}(as),gs=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.TRANSFORM,i,us.RESIZE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case os.ABSOLUTE_HEIGHT:return new cs(this);case os.ABSOLUTE_WIDTH:return new bs(this);case os.ABSOLUTE_SIZE:return new ls(this);case os.RELATIVE_HEIGHT:return new fs(this);case os.RELATIVE_WIDTH:return new ds(this);case os.RELATIVE_SIZE:return new vs(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.opetype+","+this.originX+","+this.originY+","+i+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources),e=ln.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(rs),ms=function(t){function n(n,i){var r=t.call(this,n,i)||this;return r.originX=n.originX,r.originY=n.originY,r.amount=qt.ofNumber("("+n.amount+") * (Math.PI / 180)"),r}return _(n,t),n.prototype.adjustPosition=function(t,n,i,r,e,u){var s=!!(n.written&Yt.WIDTH),h=!!(n.written&Yt.HEIGHT),o=(-.5+e)*(s?t.size.x:n.size.x),a=(-.5+u)*(h?t.size.y:n.size.y),c=Math.sin(i)-Math.sin(r),f=Math.cos(i)-Math.cos(r),l=t.transform.position,v=!!(n.written&Yt.POSITION_X),b=!!(n.written&Yt.POSITION_Y),d=v?l.x:n.x,g=b?l.y:n.y;n.written|=Yt.POSITION,l.set(d+o*f-a*c,g+o*c+a*f)},n}(Qt),ws=function(t){function n(n){var i=t.call(this,n,Yt.ROTATION)||this;return i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=t.transform,u=n.written&Yt.ROTATION?e.rotation:n.rotation;e.rotation=r,n.written|=Yt.ROTATION,this.adjustPosition(t,n,u,r,this.originX,this.originY)}},n}(ms),ps=function(t){function n(n){var i=t.call(this,n,Yt.ROTATION)||this;return i.reset|=Yt.POSITION,i}return _(n,t),n.prototype.execute=function(t,n,i){if(this.condition(t,i)){var r=this.amount(t,i),e=t.transform,u=n.written&Yt.ROTATION?e.rotation:n.rotation;e.rotation=u+r,n.written|=Yt.ROTATION,this.adjustPosition(t,n,u,e.rotation,this.originX,this.originY)}},n}(ms),Os={RELATIVE:0,ABSOLUTE:1},Ds=function(t){function n(n,i,r,e,u){var s=t.call(this,fn.TRANSFORM,i,us.ROTATE,n)||this;return s.originX=r,s.originY=e,s.amount=u,s}return _(n,t),n.prototype.isEquals=function(i){return t.prototype.isEquals.call(this,i)&&i instanceof n&&this.originX===i.originX&&this.originY===i.originY&&this.amount===i.amount},n.prototype.toRuntime=function(){switch(this.opetype){case Os.ABSOLUTE:return new ws(this);case Os.RELATIVE:return new ps(this)}},n.prototype.serialize=function(t){var n=t.addResource(this.condition),i=t.addResource(this.amount);return t.addResource("["+this.type+","+n+","+this.subtype+","+this.opetype+","+this.originX+","+this.originY+","+i+"]")},n.deserialize=function(t,i){var r=ln.toResource(1,t,i.resources),e=ln.toResource(6,t,i.resources);return new n(t[3],r,t[4],t[5],e)},n}(rs),Es=function(){function t(){}return t.toSerialized=function(t){try{var n=JSON.parse(t);if(Wt(n)){for(var i=0,r=n.length;i<r;++i)if(!Xt(n[i]))return null;if(2<=n.length)return n}return null}catch(t){return null}},t.deserialize=function(t,n){var i=n.getAction(t);if(null!=i)return i;var r=n.resources[t];if(null!=r){var e=this.toSerialized(r);if(null!=e)switch(e[0]){case fn.SHOW_HIDE:return Ju.deserialize(e,n);case fn.BLINK:return vn.deserialize(e,n);case fn.CHANGE_COLOR:case fn.CHANGE_COLOR_LEGACY:switch(e[3]){case gn.COLOR_AND_ALPHA:case gn.COLOR:case gn.ALPHA:return Dn.deserialize(e,n);case gn.CODE:return Tn.deserialize(e,n);case gn.BRIGHTNESS:return Mn.deserialize(e,n)}break;case fn.CHANGE_TEXT:return li.deserialize(e,n);case fn.CHANGE_CURSOR:return Nn.deserialize(e,n);case fn.EMIT_EVENT:return cr.deserialize(e,n);case fn.OPEN:return Xu.deserialize(e,n);case fn.TRANSFORM:switch(e[2]){case us.MOVE:return ss.deserialize(e,n);case us.RESIZE:return gs.deserialize(e,n);case us.ROTATE:return Ds.deserialize(e,n)}break;case fn.MISC:switch(e[2]){case gr.GESTURE:return Pr.deserialize(e,n);case gr.LAYER_SHOW_HIDE:return ce.deserialize(e,n);case gr.LAYER_GESTURE:return oe.deserialize(e,n);default:return Lr.deserialize(e,n)}}}return new Ju(Ku.SHOW,"")},t}(),Ms=function(){function t(){}return t.toImageElement=function(n){var i=t.imageElements,r=i[n];if(null!=r)return r instanceof HTMLImageElement?Promise.resolve(r):r;var e=new Promise((function(t,r){var e=document.createElement("img");e.onload=function(){i[n]=e,t(e)},e.onabort=e.onerror=function(){r()},e.src=n}));return i[n]=e,e},t.imageElements={},t}(),Ss=function(){function t(t){this.us=t}return t.prototype.find=function(t){return this.getUuidToShape().get(t)},t.prototype.getUuidToShape=function(){var t=this.ss;return null==t&&(t=this.newUuidToShape(),this.ss=t),t},t.prototype.newUuidToShape=function(){var t=new Map;return this.fillUuidToShape(this.us,t),t},t.prototype.fillUuidToShape=function(t,n){for(var i=0,r=t.length;i<r;++i){var e=t[i];n.set(e.uuid,e);var u=e.children;0<u.length&&this.fillUuidToShape(u,n)}},t}(),Ts=function(t){function n(n){return void 0===n&&(n=r.NULL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n}(kt),js=function(){function t(){}return t.toShape=function(i,r){var e=n[i[0]];if(null!=e){var u=e(i,r);if(null!=u)return u}return t.deserialize(i,r,new Ts)},t.deserialize=function(n,i,r){r.id=i.resources[n[1]]||"";var e=r.transform;e.position.set(n[2],n[3]),e.rotation=n[6],e.skew.set(n[7],n[7]),e.pivot.set(n[21],n[22]),r.size.set(hs.toNormalized(n[4]),hs.toNormalized(n[5])),r.fill.deserialize(n[8],i),r.stroke.deserialize(n[9],i),r.cursor=i.resources[n[10]]||"",r.text.deserialize(n[11],i),r.data.deserialize(n[12],i),r.radius=n[13],r.corner=n[14];var u=n[23];r.interactive=!!(1&u);var s=r.state;s.isFocusable=!(2&u),s.isActive=!!(4&u);var h=n[24];r.shortcut=0<=h?i.resources[h]:void 0;var o=n[25];r.title=0<=o?i.resources[o]:void 0;var a=n[26];r.uuid=null!=a?a:0;var c=null,f=n[20];if(0<f.length){for(var l=[],v=0,b=f.length;v<b;++v)l.push(t.toShape(f[v],i));c=Promise.all(l).then((function(t){r.children=t;for(var n=0,i=t.length;n<i;++n)t[n].parent=r;return r.onChildTransformChange(),r.toDirty(),r}))}var d=n[17];for(v=0,b=d.length;v<b;++v)r.action.add(Es.deserialize(d[v],i));var g=n[19];if(0<=g&&g<i.resources.length){var m=i.resources[g];at(m)&&(r.gradient=pt.deserializeGradient(m))}var w=null,p=n[18];if(0<=p&&p<i.resources.length){var O=i.resources[p];at(O)&&(w=Ms.toImageElement(O).then((function(t){return r.image=t,r})))}return null!=c?null!=w?Promise.all([c,w]).then((function(){return r})):c:null!=w?w:r},t.deserializeAll=function(n,i){for(var r=this,e=[],u=0,s=n.length;u<s;++u)e.push(t.toShape(n[u],i));return 0<e.length?Promise.all(e).then((function(t){return r.onDeserialized(n,t,new Ss(t),i),t})):null},t.onDeserialized=function(t,n,r,e){for(var u=0,s=t.length;u<s;++u){var h=t[u],o=n[u],a=i[h[0]];a&&a(h,o,r,e),this.onDeserialized(h[20],o.children,r,e)}},t}(),Ns=function(t,n){var i=new Gt,r=js.deserialize(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=U.NON_SCALING_MASK|U.DOTTED_MASK|U.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},Is=function(){e[r.BAR]=Vt,n[r.BAR]=Ns},Cs={NONE:0,ID:1,POSITION:2,WIDTH:4,HEIGHT:8,ROTATION:16,SKEW:32,ALIGN:64,REPLACING:128,GROUPING:256,FILL:512,STROKE:1024,STROKE_SIDE:2048,BORDER_RADIUS:4096,TEXT:8192,TEXTURE:16384,TAG:32768,DATA:32768,ACTION:65536,CURSOR:131072,ORDER_IN_LAYER:262144,CHILDREN:524288,COORDINATE:127,SHAPE:1920,LAYER:262144,PRIMITIVE:1042431,EMBEDDED:369151,CONNECTOR:1042049,ALL:1048575},As=function(){function t(){}return t.get=function(t){var n=this.mappings[t];return null!=n?n:Cs.PRIMITIVE},t.contains=function(t,n){if(null!=t){var i=this.get(t.type);if(i&n)return!0;if(i&Cs.CHILDREN)for(var r=t.children,e=0,u=r.length;e<u;++e)if(this.contains(r[e],n))return!0}return!1},t.set=function(t,n){this.mappings[t]=n},t.mappings={},t}(),Rs={},ys=36,ks=[0,0,0],Ls=new t.Point,xs=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+2,t[++r]=n+1,t[++r]=n+3,t[++r]=n+2,t[++r]=n+4,t[++r]=n+5,t[++r]=n+6,t[++r]=n+5,t[++r]=n+7,t[++r]=n+6,t[++r]=n+8,t[++r]=n+9,t[++r]=n+10,t[++r]=n+9,t[++r]=n+11,t[++r]=n+10,t[++r]=n+12,t[++r]=n+13,t[++r]=n+14,t[++r]=n+13,t[++r]=n+15,t[++r]=n+14,t[++r]=n+16,t[++r]=n+17,t[++r]=n+20,t[++r]=n+17,t[++r]=n+21,t[++r]=n+20,t[++r]=n+17,t[++r]=n+18,t[++r]=n+21,t[++r]=n+18,t[++r]=n+22,t[++r]=n+21,t[++r]=n+19,t[++r]=n+21,t[++r]=n+24,t[++r]=n+21,t[++r]=n+25,t[++r]=n+24,t[++r]=n+21,t[++r]=n+23,t[++r]=n+26,t[++r]=n+23,t[++r]=n+27,t[++r]=n+26,t[++r]=n+24,t[++r]=n+25,t[++r]=n+28,t[++r]=n+25,t[++r]=n+30,t[++r]=n+28,t[++r]=n+26,t[++r]=n+27,t[++r]=n+30,t[++r]=n+27,t[++r]=n+32,t[++r]=n+30,t[++r]=n+29,t[++r]=n+30,t[++r]=n+33,t[++r]=n+30,t[++r]=n+34,t[++r]=n+33,t[++r]=n+30,t[++r]=n+31,t[++r]=n+34,t[++r]=n+31,t[++r]=n+35,t[++r]=n+34},Bs=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.abs(l),d=Math.abs(v),g=o*Math.min(b,d),m=g/b,w=g/d,p=Ls;p.set(i-l,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r-v),a.apply(p,p);var M=p.x,S=p.y,T=M-D,j=S-E,N=m*T,I=m*j,C=D+N,A=E+I,R=M+T,y=S+j,k=R-N,L=y-I;p.set(i,r),a.apply(p,p);var x=p.x,B=p.y,_=x-M,P=B-S,F=w*_,U=w*P,G=M+F,z=S+U,H=G-T,V=z-j,W=H+N,X=V+I,K=G+T,Y=z+j,J=K-N,Z=Y-I,q=x-T,$=B-j,Q=x+T,tt=B+j,nt=x+_,it=B+P,rt=nt-F,et=it-U,ut=rt-T,st=et-j,ht=ut+N,ot=st+I,at=rt+T,ct=et+j,ft=at-N,lt=ct-I,vt=nt-T,bt=it-j,dt=vt+N,gt=bt+I,mt=nt+T,wt=it+j,pt=mt-N,Ot=wt-I;c[0]=O(D,E,C,A),c[1]=O(D,E,M,S),c[2]=O(D,E,q,$);var Dt=2*n-1;t[++Dt]=D,t[++Dt]=E,t[++Dt]=C,t[++Dt]=A,t[++Dt]=H,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=k,t[++Dt]=L,t[++Dt]=R,t[++Dt]=y,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=vt,t[++Dt]=bt,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=pt,t[++Dt]=Ot,t[++Dt]=mt,t[++Dt]=wt,t[++Dt]=C,t[++Dt]=A,t[++Dt]=M,t[++Dt]=S,t[++Dt]=k,t[++Dt]=L,t[++Dt]=H,t[++Dt]=V,t[++Dt]=W,t[++Dt]=X,t[++Dt]=G,t[++Dt]=z,t[++Dt]=J,t[++Dt]=Z,t[++Dt]=K,t[++Dt]=Y,t[++Dt]=q,t[++Dt]=$,t[++Dt]=x,t[++Dt]=B,t[++Dt]=x,t[++Dt]=B,t[++Dt]=Q,t[++Dt]=tt,t[++Dt]=ut,t[++Dt]=st,t[++Dt]=ht,t[++Dt]=ot,t[++Dt]=rt,t[++Dt]=et,t[++Dt]=ft,t[++Dt]=lt,t[++Dt]=at,t[++Dt]=ct,t[++Dt]=dt,t[++Dt]=gt,t[++Dt]=nt,t[++Dt]=it,t[++Dt]=pt,t[++Dt]=Ot},_s=function(t,n,i,r){var e=3*n-1,u=1-r[0]/r[1],s=1-r[0]/r[2];i&it.TOP_LEFT?(t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1):(t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0),i&it.TOP_RIGHT?(t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1):(t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0),i&it.BOTTOM_LEFT?(t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0),t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=0,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=s,t[++e]=0,t[++e]=1,t[++e]=s,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0},Ps=function(t,n,i,r,e,u,s){var h,a,c,f,l,v,b,d,g,m,w,p,O=o(e),D=s[0],E=s[1],M=s[2],S=Math.max(0,1-s[0]/s[1]),T=Math.max(0,1-s[0]/s[2]);r&xt.TOP?(h=2,a=1,c=1+T):(h=-2,a=-1,c=-1-T),r&xt.RIGHT?(f=2,l=1,v=1+S):(f=-2,l=-1,v=-1-S),r&xt.BOTTOM?(b=2,d=1,g=1+T):(b=-2,d=-1,g=-1-T),r&xt.LEFT?(m=2,w=1,p=1+S):(m=-2,w=-1,p=-1-S);var j=6*n-1;u&it.TOP_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c),u&it.TOP_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=a):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c),u&it.BOTTOM_LEFT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=w,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b),u&it.BOTTOM_RIGHT?(t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=l,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=D,t[++j]=D,t[++j]=f,t[++j]=b):(t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=b),t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=h,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=c,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=w,t[++j]=a,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=l,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=d,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=m,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=f,t[++j]=g,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=p,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=d,t[++j]=b,t[++j]=i,t[++j]=O,t[++j]=E,t[++j]=M,t[++j]=v,t[++j]=b},Fs=function(t,n,i,r){var e=i.x0,u=i.x1,s=i.x2,h=i.x3,o=i.y0,a=i.y1,c=i.y2,f=i.y3,l=.5*(e+u),v=.5*(o+a),b=.5*(h+s),d=.5*(f+c),g=.5*r[0]/r[1],m=.5*r[0]/r[2],w=g*(u-e),p=g*(a-o),O=m*(h-e),D=m*(f-o),E=2*n-1;t[++E]=e,t[++E]=o,t[++E]=e+w,t[++E]=o+p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+w+O,t[++E]=o+p+D,t[++E]=u-w,t[++E]=a-p,t[++E]=u,t[++E]=a,t[++E]=u-w+O,t[++E]=a-p+D,t[++E]=u+O,t[++E]=a+D,t[++E]=h-O,t[++E]=f-D,t[++E]=h+w-O,t[++E]=f+p-D,t[++E]=h,t[++E]=f,t[++E]=h+w,t[++E]=f+p,t[++E]=s-w-O,t[++E]=c-p-D,t[++E]=s-O,t[++E]=c-D,t[++E]=s-w,t[++E]=c-p,t[++E]=s,t[++E]=c,t[++E]=e+w,t[++E]=o+p,t[++E]=l,t[++E]=v,t[++E]=u-w,t[++E]=a-p,t[++E]=e+O,t[++E]=o+D,t[++E]=e+O+w,t[++E]=o+D+p,t[++E]=l+O,t[++E]=v+D,t[++E]=u+O-w,t[++E]=a+D-p,t[++E]=u+O,t[++E]=a+D;var M=.5*(e+s),S=.5*(o+c);t[++E]=.5*(e+h),t[++E]=.5*(o+f),t[++E]=M,t[++E]=S,t[++E]=M,t[++E]=S,t[++E]=.5*(u+s),t[++E]=.5*(a+c),t[++E]=h-O,t[++E]=f-D,t[++E]=h-O+w,t[++E]=f-D+p,t[++E]=b-O,t[++E]=d-D,t[++E]=s-O-w,t[++E]=c-D-p,t[++E]=s-O,t[++E]=c-D,t[++E]=h+w,t[++E]=f+p,t[++E]=b,t[++E]=d,t[++E]=s-w,t[++E]=c-p},Us=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),xs(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=n.radius,s=r!==this.sizeX||e!==this.sizeY||u!==this.radius,h=H(n),o=this.transformLocalId!==h,a=n.stroke,c=a.align,f=a.enable?a.width:0,l=a.side,v=a.style,b=this.strokeAlign!==c||this.strokeWidth!==f||this.strokeSide!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=V(n),w=W(m),p=m!==this.texture||w!==this.textureTransformId,O=s||b;if(O||o||g||p){this.sizeX=r,this.sizeY=e,this.radius=u,this.transformLocalId=h,this.strokeAlign=c,this.strokeWidth=f,this.strokeSide=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),Bs(t.vertices,D,0,0,r,e,c,f,u,n.transform.internalTransform,ks),(O||g||o)&&(t.updateSteps(),Ps(t.steps,D,f,l,v,d,ks)),(O||g)&&(t.updateClippings(),_s(t.clippings,D,d,ks)),(O||p)&&(t.updateUvs(),Fs(t.uvs,D,X(m),ks))}},n}(z),Gs=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=ys+h,c=24+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Us(i,r,a-h,c-o),new Ht(i+ys,r+24,h,o)]).init(n):null},zs=function(t,n,i,r,e){return Gs(t,n,i,r)},Hs=function(t,n,i,r,e,u){var s=-i+e;if(t<=s)return n<=(h=-r+e)&&u&it.TOP_LEFT?(a=t-s)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&it.BOTTOM_LEFT?(a=t-s)*a+(c=n-o)*c<=e*e:-i<=t;var h,o,a,c,f=+i-e;return f<=t?n<=(h=-r+e)&&u&it.TOP_RIGHT?(a=t-f)*a+(c=n-h)*c<=e*e:(o=+r-e)<=n&&u&it.BOTTOM_RIGHT?(a=t-f)*a+(c=n-o)*c<=e*e:t<=+i:-r<=n&&n<=+r},Vs=function(t,n,i,r,e,u,s){var h=t.fill;if(h.enable||0<u){var o=t.radius*Math.min(r,e),a=t.corner;if(Hs(n,i,r,e,o,a)){if(h.enable)return!0;var c=u*s,f=Math.max(0,r-c),l=Math.max(0,e-c),v=Math.max(0,o-c);if(!Hs(n,i,f,l,v,a)){var b=t.stroke.side;if(b===xt.ALL)return!0;if(n<=-f+v){var d=!!(b&xt.LEFT);return i<=-l+v?!(!(g=!!(b&xt.TOP))||!d)||(g?-f<=i:!!d&&n<=-f):+l-v<=i?!(!(m=!!(b&xt.BOTTOM))||!d)||(m?+f<=i:!!d&&n<=-f):d}if(+f-v<=n){var g,m,w=!!(b&xt.RIGHT);return i<=-l+v?!(!(g=!!(b&xt.TOP))||!w)||(g?-f<=i:!!w&&+f<=n):+l-v<=i?!(!(m=!!(b&xt.BOTTOM))||!w)||(m?+f<=i:!!w&&+f<=n):w}return i<=-l+v?!!(b&xt.TOP):+l-v<=i&&!!(b&xt.BOTTOM)}}}return!1},Ws=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Vs(this,n,i,r,e,u,s)},n}(kt),Xs=function(t){function n(n){void 0===n&&(n=r.BUTTON);var i=t.call(this,n)||this;return i.au=!1,i.hs=!1,i}return _(n,t),Object.defineProperty(n.prototype,"isToggle",{get:function(){return this.au},set:function(t){this.au=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isGrouped",{get:function(){return this.hs},set:function(t){this.hs=t},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n),r=this.au?1:0,e=this.hs?2:0;return i[15]=n.addResource("["+(r|e)+"]"),i},n}(Ws),Ks=function(t,n){var i=n.resources,r=t[15];if(0<=r&&r<i.length){var e=n.getExtension(r);null==e&&(e=JSON.parse(i[r]),n.setExtension(r,e));var u=new Xs;return u.isToggle=!!(1&e[0]),u.isGrouped=!!(2&e[0]),js.deserialize(t,n,u)}return js.deserialize(t,n,new Xs)},Ys=function(t){function n(n,i){return t.call(this,gr.EMIT_EVENT,n,i,Dr.EMIT_EVENT,"")||this}return _(n,t),n}(Lr),Js=function(t){function n(n,i,r){return t.call(this,n,i,"",Dr.EMIT_EVENT,r)||this}return _(n,t),n}(Lr),Zs=function(t){function n(n,i,r,e){return t.call(this,n,i,r,e,"")||this}return _(n,t),n}(Lr),qs=function(t){function n(n,i,r,e){return t.call(this,n,i,r,Dr.EMIT_EVENT,e)||this}return _(n,t),n}(Lr),$s=function(t){function n(n){var i=t.call(this,Yt.COLOR_FILL_AND_STROKE|Yt.COLOR_TEXT|Yt.COLOR_TEXT_OUTLINE|Yt.CURSOR)||this,r=n.fill,e=r.color,u=i.toOnHovered(e),s=2*u;i.os=e,i.cs=wt.toGrayscale(e),i.fs=wt.darken(e,s),i.ls=wt.darken(e,u);var h=r.alpha;i.vs=h,i.bs=.5*h;var o=n.stroke,a=o.color,c=i.toOnHovered(a),f=2*c;i.gs=a,i.ws=wt.toGrayscale(a),i.ps=wt.darken(a,f),i.Os=wt.darken(a,c);var l=o.alpha;i.Ds=l,i.Es=.5*l;var v=n.text,b=v.color;i.iu=b,i.Ms=wt.toGrayscale(b);var d=v.alpha;i.ru=d,i.Ss=.5*d;var g=v.outline,m=g.color;i.Ts=m,i.js=wt.toGrayscale(m);var w=g.alpha;return i.Ns=w,i.Is=.5*w,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=wt.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.cs:t.isPressed||t.isActive?this.fs:t.isFocused||t.isHovered?this.ls:this.os},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.bs:this.vs},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.ws:t.isPressed||t.isActive?this.ps:t.isFocused||t.isHovered?this.Os:this.gs},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.Es:this.Ds},n.prototype.getTextColor=function(t){return t.inDisabled?this.Ms:this.iu},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.Ss:this.ru},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.js:this.Ts},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.Is:this.Ns},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}($t),Qs=function(t){function n(n){var i=t.call(this,Yt.COLOR_FILL_AND_STROKE|Yt.COLOR_TEXT|Yt.COLOR_TEXT_OUTLINE|Yt.CURSOR)||this,r=n.fill,e=r.color;i.Cs=e;var u=i.toOnHovered(e),s=2*u;i.As=wt.darken(e,s),i.Rs=wt.darken(e,u);var h=15197671;i.os=h;var o=i.toOnHovered(h),a=2*o;i.fs=wt.darken(h,a),i.ls=wt.darken(h,o);var c=r.alpha;i.vs=c,i.bs=.5*c;var f=n.stroke,l=f.color;i.ys=l;var v=i.toOnHovered(l),b=2*v;i.ks=wt.darken(l,b),i.Ls=wt.darken(l,v);var d=15197671;i.gs=d;var g=i.toOnHovered(d),m=2*g;i.ps=wt.darken(d,m),i.xs=wt.darken(d,g);var w=f.alpha;i.Ds=w,i.Es=.5*w;var p=n.text,O=p.color;i.Bs=O,i.Ms=wt.toGrayscale(O),i.iu=5197647;var D=p.alpha;i.ru=D,i.Ss=.5*D;var E=p.outline,M=E.color;i.Ts=M,i.js=wt.toGrayscale(M);var S=E.alpha;return i.Ns=S,i.Is=.5*S,i}return _(n,t),n.prototype.toOnHovered=function(t){var n,i=wt.toLuma(t);return 128<=i?.15*(1-(n=(i-128)/127))+.03*n:-.15*(1-(n=(127-i)/127))-.175*n},n.prototype.execute=function(t,n,i){var r=t.state;t.fill.set(void 0,this.getFillColor(r),this.getFillAlpha(r)),t.stroke.set(void 0,this.getStrokeColor(r),this.getStrokeAlpha(r)),t.text.set(void 0,this.getTextColor(r),this.getTextAlpha(r)),t.text.outline.set(void 0,this.getTextOutlineColor(r),this.getTextOutlineAlpha(r)),t.cursor=this.getCursor(r),n.written|=this.reset},n.prototype.getFillColor=function(t){return t.inDisabled?this.os:t.isActive?t.isPressed?this.As:t.isFocused||t.isHovered?this.Rs:this.Cs:t.isPressed?this.fs:t.isFocused||t.isHovered?this.ls:this.os},n.prototype.getFillAlpha=function(t){return t.inDisabled?this.bs:this.vs},n.prototype.getStrokeColor=function(t){return t.inDisabled?this.gs:t.isActive?t.isPressed?this.ks:t.isFocused||t.isHovered?this.Ls:this.ys:t.isPressed?this.ps:t.isFocused||t.isHovered?this.xs:this.gs},n.prototype.getStrokeAlpha=function(t){return t.inDisabled?this.Es:this.Ds},n.prototype.getTextColor=function(t){return t.inDisabled?this.Ms:t.isActive?this.Bs:this.iu},n.prototype.getTextAlpha=function(t){return t.inDisabled?this.Ss:this.ru},n.prototype.getTextOutlineColor=function(t){return t.inDisabled?this.js:this.Ts},n.prototype.getTextOutlineAlpha=function(t){return t.inDisabled?this.Is:this.Ns},n.prototype.getCursor=function(t){return t.isActionable?"pointer":""},n}($t),th=function(t){function n(n){var i=t.call(this,n)||this;return n instanceof Xs&&(i.au=n.isToggle,i.hs=n.isGrouped),i}return _(n,t),n.prototype.isActionable=function(){return!0},n.prototype.initialize=function(n){this.actions.unshift(this.au?new Qs(this):new $s(this)),t.prototype.initialize.call(this,n)},n.prototype.onClick=function(n,i){var r=n.state,e=r.isClicked;r.lock(),t.prototype.onClick.call(this,n,i),!e&&r.isClicked&&(this.au?r.isActive=!r.isActive:r.isActive||(r.isActivated=!0)),r.unlock()},n.prototype.onStateChange=function(n,i,r){t.prototype.onStateChange.call(this,n,i,r),this.au&&this.hs&&i.is(lt.ACTIVATED)&&this.onActivated(n)},n.prototype.onActivated=function(t){var n=t.parent;if(null!=n)for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u!==t&&u instanceof Xs&&u.isToggle&&u.isGrouped&&(u.state.isActive=!1)}},n}(Jt),nh=function(){e[r.BUTTON]=zs,n[r.BUTTON]=Ks,Rs[r.BUTTON]=th,As.set(r.BUTTON,Cs.PRIMITIVE|Cs.STROKE_SIDE|Cs.BORDER_RADIUS)},ih=[0,0],rh=new t.Point,eh=function(t,n){var i=3*n-1;t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1,t[++i]=1},uh=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},sh=function(t,n,i,r,e,u,s,h,o,a){var c=rh,f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f);c.set(-l+i,-v+r),o.apply(c,c);var b=c.x,d=c.y;c.set(0+i,-v+r),o.apply(c,c);var g=c.x,m=c.y,w=g-b,p=m-d;c.set(i,r),o.apply(c,c);var D=c.x,E=c.y,M=D+(D-g),S=E+(E-m),T=D-w,j=E-p,N=2*n-1;t[++N]=b,t[++N]=d,t[++N]=g,t[++N]=m,t[++N]=g+w,t[++N]=m+p,t[++N]=T,t[++N]=j,t[++N]=D,t[++N]=E,t[++N]=D+w,t[++N]=E+p,t[++N]=M-w,t[++N]=S-p,t[++N]=M,t[++N]=S,t[++N]=M+w,t[++N]=S+p,a[0]=O(b,d,g,m),a[1]=O(b,d,T,j)},hh=function(t,n,i,r,e,u){for(var s=o(e),h=6*i-1,a=3*i,c=0;c<9;c+=1,a+=3)t[++h]=r,t[++h]=s,t[++h]=u[0],t[++h]=u[1],t[++h]=1+n[a],t[++h]=1+n[a+1]},oh=function(t,n,i){var r=i.x0,e=i.x1,u=i.x2,s=i.x3,h=i.y0,o=i.y1,a=i.y2,c=i.y3,f=2*n-1;t[++f]=r,t[++f]=h,t[++f]=.5*(r+e),t[++f]=.5*(h+o),t[++f]=e,t[++f]=o,t[++f]=.5*(r+s),t[++f]=.5*(h+c),t[++f]=.5*(r+u),t[++f]=.5*(h+a),t[++f]=.5*(e+u),t[++f]=.5*(o+a),t[++f]=s,t[++f]=c,t[++f]=.5*(s+u),t[++f]=.5*(c+a),t[++f]=u,t[++f]=a},ah=function(t){function n(n,i){return t.call(this,n,i,9,8)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;eh(t.clippings,n),uh(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=H(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f;(u||h||l)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,t.updateVertices(),t.updateSteps(),sh(t.vertices,this.vertexOffset,0,0,r,e,a,c,n.transform.internalTransform,ih),hh(t.steps,t.clippings,this.vertexOffset,c,f,ih))},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=X(i);oh(t.uvs,this.vertexOffset,e)}},n}(z),ch=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new ah(i,r),new Ht(i+9,r+8,h,o)]).init(n):null},fh=function(t){function n(n){return void 0===n&&(n=r.CIRCLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Lt(this,n,i,r,e,u,s)},n}(kt),lh=function(t,n){return js.deserialize(t,n,new fh)},vh=function(){e[r.CIRCLE]=ch,n[r.CIRCLE]=lh},bh=new t.Point,dh=function(t){return t?t.formatted.length:0},gh=function(t){return 12*Math.ceil(dh(t)/12)},mh=function(t,n){return n?4*t+2:4*t},wh=function(t,n){return mh(t,n)-2},ph=function(t,n,i,r){for(var e=3*n-1,u=3*(n+i)-1,s=0;s<r;++s)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5,t[++e]=1,t[++e]=0,t[++e]=4,t[++e]=0,t[++e]=1,t[++e]=6;for(;e<u;)t[++e]=1,t[++e]=0,t[++e]=3,t[++e]=0,t[++e]=1,t[++e]=5},Oh=function(t,n,i,r){for(var e=3*i-1,u=3*(i+r)-1,s=n;e<u;)t[++e]=s+0,t[++e]=s+2,t[++e]=s+1,t[++e]=s+1,t[++e]=s+2,t[++e]=s+3,s+=2},Dh=function(t,n,i,r,e,u){for(var s=1/Math.max(1e-5,u),h=e.x0,o=e.x1,a=e.x2,c=e.x3,f=e.y0,l=e.y1,v=e.y2,b=e.y3,d=o-h,g=l-f,m=a-c,w=v-b,p=(i<<1)-1,O=(i+r<<1)-1,D=(i<<2)-8;p<O;){var E=n[D+=8]*s;t[++p]=h+E*d,t[++p]=f+E*g,t[++p]=c+E*m,t[++p]=b+E*w}},Eh=function(t,n,i,r,e,u,s,h,o,a,c,f){var l=ki;null==l&&(ki=l=[]);for(var v=f.a,b=f.b,d=f.c,g=f.d,m=f.tx,w=f.ty,p=0;p<u;++p){var O=p<<1,D=h[O],E=h[O+1];l[O]=v*D+d*E+m,l[O+1]=b*D+g*E+w}return Sh(t,n,i,r,e,u,s,l,o,a,c)},Mh=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=1]=b,n[++t]=s,n[++t]=h,r[++i]=o,r[++i]=a,r[++i]=c,r[++i]=f,r[++i]=l,r[++i]=v,u[e+=4]=b},Sh=function(t,n,i,r,e,u,s,h,o,a,c){var f=o.length;if(0<f){if(s){for(var l=0,v=0,b=r,d=0,g=o[0],m=1;m<f;++m)2<=(d=o[m])-g&&(v=jh(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=mh(d-g,!1)),g=d;return 2<=(d=o[0]+u)-g?(v=jh(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=mh(d-g,!1)):Th(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}for(l=0,v=0,b=r,2<=(d=o[0])&&(v=jh(t,n,i,b,-1,h,0,d,u,a,c,v),l=Math.max(l,v),b+=mh(d,!1)),g=d,m=1;m<f;++m)2<=(d=o[m])-g&&(v=jh(t,n,i,b,-1,h,g,d,u,a,c,v),l=Math.max(l,v),b+=mh(d-g,!1)),g=d;return 2<=(d=u)-g?(v=jh(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l=Math.max(l,v),b+=mh(d-g,!1)):Th(t,n,i,b,r+e-b,h,g,d,u,a,c,v),l}return s?Nh(t,n,i,r,e,h,0,u,u,a,c):jh(t,n,i,r,e,h,0,u,u,a,c,0)},Th=function(t,n,i,r,e,u,s,h,a,c,f,l){if(0<=e)for(var v=o(f),b=(r<<1)-1,d=6*r-1,g=(r<<2)-1,m=(r+e<<1)-1,w=s%a<<1,p=u[w],O=u[w+1];b<m;)t[++b]=p,t[++b]=O,n[++d]=0,n[++d]=v,n[++d]=-1,n[++d]=0,n[++d]=1,n[++d]=0,i[++g]=l,i[++g]=0,i[++g]=0,i[++g]=l;return 0},jh=function(t,n,i,r,e,u,s,a,c,f,l,v){var b=o(l),d=s%c<<1,g=u[d],m=u[d+1],w=(s+1)%c<<1,p=u[w],D=u[w+1],E=g-(p-g),M=m-(D-m),S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=0;Mh(S,t,T,n,j,i,g,m,f,b,E,M,p,D,v),Mh(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;for(var I=s+1,C=a-1;I<C;++I){E=g,M=m,g=p,m=D;var A=(I+1)%c<<1;p=u[A],D=u[A+1],N+=O(E,M,g,m),Mh(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),Mh(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8}E=g,M=m,p=(g=p)+(g-E),D=(m=D)+(m-M),N+=O(E,M,g,m),Mh(S,t,T,n,j,i,g,m,f,b,E,M,p,D,N),Mh(S+=4,t,T+=12,n,j+=8,i,g,m,f,b,E,M,p,D,N),S+=4,T+=12,j+=8;var R=h(N,f,l,bh),y=R.x,k=R.y,L=(r<<2)-1;for(I=L,C=L+8;I<C;I+=4)i[I+2]=y,i[I+3]=k,i[I+4]=v;for(I=L+8;I<j;I+=4)i[I+2]=y,i[I+3]=k,i[I+4]=N;if(0<=e)for(var x=(r+e<<1)-1;S<x;)t[++S]=g,t[++S]=m,n[++T]=0,n[++T]=b,n[++T]=E,n[++T]=M,n[++T]=p,n[++T]=D,i[++j]=N,i[++j]=y,i[++j]=k,i[++j]=N;return N},Nh=function(t,n,i,r,e,u,s,a,c,f,l){for(var v=o(l),b=(a-1)%c<<1,d=0,g=0,m=u[b],w=u[b+1],p=s%c<<1,D=u[p],E=u[p+1],M=0,S=(r<<1)-1,T=6*r-1,j=(r<<2)-1,N=s;N<a;++N){d=m,g=w,m=D,w=E;var I=(N+1)%c<<1;D=u[I],E=u[I+1],M+=O(d,g,m,w),Mh(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),Mh(S+=4,t,T+=12,n,j+=8,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8}d=m,g=w,m=D,w=E;var C=(s+1)%c<<1;D=u[C],E=u[C+1],M+=O(d,g,m,w),Mh(S,t,T,n,j,i,m,w,f,v,d,g,D,E,M),S+=4,T+=12,j+=8;var A=h(M,f,l,bh),R=A.x,y=A.y;for(N=(r<<2)-1;N<j;N+=4)i[N+2]=R,i[N+3]=y,i[N+4]=-1;if(0<=e)for(var k=(r+e<<1)-1;S<k;)t[++S]=m,t[++S]=w,n[++T]=f,n[++T]=v,n[++T]=d,n[++T]=g,n[++T]=D,n[++T]=E,i[++j]=M,i[++j]=R,i[++j]=y,i[++j]=-1;return M},Ih=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.pointId=-1,u.pointCount=0,u.pointsClosed=!1,u.length=1,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Oh(t.indices,this.vertexOffset,this.indexOffset,this.indexCount)},n.prototype.isCompatible=function(t){return mh(gh(t.points),!0)===this.vertexCount},n.prototype.update=function(t,n){this.updateLineClipping(t,n),this.updateLineVertexStepAndColorFill(t,n),this.updateColorStroke(t,n),this.updateLineUv(t,n)},n.prototype.updateLineClipping=function(t,n){var i=n.points;if(i){var r=i.formatted.length;this.pointCount!==r&&(this.pointCount=r,this.pointId=-1,t.updateClippings(),ph(t.clippings,this.vertexOffset,this.vertexCount,r))}},n.prototype.updateLineVertexStepAndColorFill=function(t,n){var i=n.points;if(i){var r=i.id,e=i.formatted,u=!!(e.style&U.CLOSED),s=r!==this.pointId||u!==this.pointsClosed,h=n.stroke,o=h.enable?h.width:0,a=h.style,c=this.strokeWidth!==o||this.strokeStyle!==a,f=H(n),l=this.transformLocalId!==f;(s||l||c)&&(this.pointId=r,this.pointsClosed=u,this.strokeWidth=o,this.strokeStyle=a,this.transformLocalId=f,s&&(this.textureTransformId=NaN),t.updateVertices(),t.updateSteps(),t.updateColorFills(),this.length=Eh(t.vertices,t.steps,t.colorFills,this.vertexOffset,this.vertexCount,this.pointCount,this.pointsClosed,e.values,e.segments,o,a,n.transform.internalTransform))}},n.prototype.updateLineUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),Dh(t.uvs,t.colorFills,this.vertexOffset,this.vertexCount,X(i),this.length))},n}(z),Ch=[0,0,0],Ah=new t.Point,Rh=function(t,n){var i=3*n-1;t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0,t[++i]=1,t[++i]=0,t[++i]=0},yh=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+2,t[++r]=n+0,t[++r]=n+3,t[++r]=n+4,t[++r]=n+0,t[++r]=n+5,t[++r]=n+6},kh=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=2*f*l/(f+Math.sqrt(f*f+4*l*l)),b=Ah;b.set(i,r-l),o.apply(b,b);var d=b.x,g=b.y;b.set(i,r),o.apply(b,b);var m=b.x,w=b.y;b.set(i+f,r),o.apply(b,b);var p=m-d,D=w-g,E=b.x+p,M=b.y+D,S=m+(m-b.x)+p,T=w+(w-b.y)+D;b.set(i,r+l-v),o.apply(b,b);var j=b.x,N=b.y,I=m+p,C=w+D;a[0]=O(I,C,j,N),a[1]=O(E,M,I,C),a[2]=O(d,g,m,w);var A=(n<<1)-1;t[++A]=j,t[++A]=N,t[++A]=d,t[++A]=g,t[++A]=E,t[++A]=M,t[++A]=E,t[++A]=M,t[++A]=S,t[++A]=T,t[++A]=S,t[++A]=T,t[++A]=d,t[++A]=g},Lh=function(t,n,i,r,e,u,s){for(var h=o(u),a=s[0],c=6*i-1,f=3*i,l=0;l<r;l+=1,f+=3)t[++c]=e,t[++c]=h,t[++c]=a,t[++c]=a,t[++c]=1+n[f],t[++c]=1+n[f+1]},xh=function(t,n,i,r){var e=n.x0,u=n.x1,s=n.x2,h=n.x3,o=n.y0,a=n.y1,c=n.y2,f=n.y3,l=.5*(e+u),v=.5*(o+a),b=1-.5*r[0]/r[2],d=l+b*(h-e),g=v+b*(f-o),m=(i<<1)-1;t[++m]=d,t[++m]=g,t[++m]=l,t[++m]=v,t[++m]=s,t[++m]=c,t[++m]=s,t[++m]=c,t[++m]=h,t[++m]=f,t[++m]=h,t[++m]=f,t[++m]=l,t[++m]=v},Bh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.updateColorFill=function(t,n){var i=n.points;if(null!=i){var r=i.getMarker();if(null!=r){var e=this.toMarker(r).fill,u=n.visible&&e.enable,s=e.color,h=u?e.alpha:0;s===this.colorFill&&h===this.alphaFill||(this.colorFill=s,this.alphaFill=h,t.updateColorFills(),G(s,h,this.vertexOffset,this.vertexCount,t.colorFills))}}},n}(z),_h=function(n){function i(t,i){var r=n.call(this,t,i,7,3)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices(),Rh(t.clippings,this.vertexOffset),yh(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=H(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=V(r),O=W(p),D=p!==this.texture||O!==this.textureTransformId,E=f||w,M=u.id,S=M!==this.pointId;if(E||v||D||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.texture=p,this.textureTransformId=O,this.pointId=M;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),kh(n.vertices,T,0,0,a,c,d,g,j,Ch),(E||v)&&(n.updateSteps(),Lh(n.steps,n.clippings,T,7,g,m,Ch)),(E||D)&&(n.updateUvs(),xh(n.uvs,X(p),T,Ch))}}}},i}(Bh),Ph=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(_h),Fh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(_h),Uh=function(n){function i(t,i){var r=n.call(this,t,i,9,8)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=this.vertexOffset;eh(t.clippings,n),uh(t.indices,n,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},i.prototype.updateVertexAndStep=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=H(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.style,w=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeStyle!==m,p=u.id,O=p!==this.pointId;if(f||v||w||O){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeStyle=m,this.pointId=p;var D=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;D.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),n.updateSteps(),sh(n.vertices,this.vertexOffset,0,0,a,c,d,g,D,ih),hh(n.steps,n.clippings,this.vertexOffset,g,m,ih)}}}},i.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=X(i);oh(t.uvs,this.vertexOffset,e)}},i}(Bh),Gh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(Uh),zh=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(Uh),Hh=function(){function n(t,n){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=0,this.indexCount=0,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=V(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Vh=function(t,n){for(var i=0,r=t.length-1;i<=r;){var e=i+(r-i>>1),u=t[e];if(n<u)r=e-1;else{if(!(u<n))return e;i=e+1}}return-1},Wh=2*Math.PI,Xh=.5*Math.PI,Kh=function(t,n,i,r){return t*i+n*r},Yh=function(t,n){return Math.sqrt(Kh(t,n,t,n))},Jh=function(t,n,i,r){return t*r-n*i},Zh=function(t,n,i,r,e,u,s,h,o,a){var c=a.center;c[0]=t,c[1]=n;var f=a.axis1;f[0]=i,f[1]=r;var l=a.axis2;l[0]=e,l[1]=u;var v=a.angle;return v[0]=s,v[1]=h,v[2]=o,a},qh=function(t,n){var i=t.center,r=t.axis1,e=t.axis2,u=t.angle;return Zh(i[0],i[1],r[0],r[1],e[0],e[1],u[0],u[1],u[2],n)},$h=function(t,n){for(var i=t.length,r=0;r<i;++r)n[r]=t[r];return n.length!==i&&(n.length=i),n},Qh=function(){function t(){}return t.set=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b){for(var d=Math.max(Math.abs(n-i),Math.abs(s-h)),g=f?Math.max(1,Math.round(c*(d/Xh))):c,m=l?g+1:g,w=0;w<m;++w){var p=w/g,O=1-p,D=p,E=O*n+D*i,M=Math.cos(E),S=Math.sin(E),T=t[0]+M*r[0]+S*e[0],j=t[1]+M*r[1]+S*e[1],N=O*s+D*h,I=Math.cos(N),C=Math.sin(N),A=u[0]+I*o[0]+C*a[0],R=u[1]+I*o[1]+C*a[1],y=Xh*p,k=Math.cos(y),L=Math.sin(y),x=k*k,B=L*L,_=x*T+B*A,P=x*j+B*R;v[++b]=_,v[++b]=P}return b},t.interpolate=function(t,n,i,r,e,u,s,h){var o=h.values,a=h.segments;if(t<=2)return $h(n,o),$h(i,a),h;var c=this.WORK_P0||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},f=this.WORK_P1||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]},l=this.WORK_P2||{center:[0,0],axis1:[0,0],axis2:[0,0],angle:[0,0,0]};this.WORK_P0=c,this.WORK_P1=f,this.WORK_P2=l;var v=-1,b=-1;if(e){r(0,t,n,c),qh(c,f);for(var d=1;d<t;++d){if(r(d,t,n,l),0<=Vh(i,d)){var g=d-1<<1;o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1}else v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v);var m=f;f=l,l=m}0<=Vh(i,0)?(g=t-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a.unshift(0),b+=1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v)}else{r(1,t,n,c),0<=Vh(i,1)?(o[++v]=n[0],o[++v]=n[1],a[++b]=1):v=this.set(c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,c.center,c.angle[0],c.angle[1],c.axis1,c.axis2,u,s,!1,o,v),qh(c,f),d=2;for(var w=t-1;d<w;++d)r(d,t,n,l),0<=Vh(i,d)?(g=d-1<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,l.center,l.angle[0],l.angle[1],l.axis1,l.axis2,u,s,!1,o,v),m=f,f=l,l=m;0<=Vh(i,t-1)?(g=t-2<<1,o[++v]=n[g+0],o[++v]=n[g+1],a[++b]=v+1>>1):v=this.set(f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,f.center,f.angle[1],f.angle[2],f.axis1,f.axis2,u,s,!0,o,v)}return v+=1,o.length!==v&&(o.length=v),b+=1,a.length!==b&&(a.length=b),h},t.toCircle=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=a-h,b=c-o,d=f-a,g=l-c,m=h+.5*v,w=o+.5*b,p=a+.5*d,O=c+.5*g,D=-b,E=+v,M=-g,S=+d,T=Jh(D,E,M,S);if(Math.abs(T)<.001){if(0<=Kh(v,b,d,g)||n<=2){var j=.01,N=Math.sin(j),I=Yh(v,b),C=Yh(d,g);return Zh(a,c,0,0,d/N,g/N,-j*I/C,0,j,r)}T=.001}var A=(S*(p-m)+M*(w-O))/T,R=m+A*D,y=w+A*E,k=a-R,L=c-y,x=-L,B=+k,_=f-R,P=l-y,F=Math.atan2(Kh(x,B,_,P),Kh(k,L,_,P)),U=h-R,G=o-y,z=Math.atan2(Kh(x,B,U,G),Kh(k,L,U,G));return 0<z*F&&(Math.abs(z)<Math.abs(F)&&(0<F?F-=Wh:F+=Wh),Math.abs(F)<Math.abs(z)&&(0<z?z-=Wh:z+=Wh)),Zh(R,y,k,L,x,B,z,0,F,r)},t.toEllipse=function(t,n,i,r){var e=(0<t?t-1:n-1)<<1,u=t<<1,s=(t<n-1?t+1:0)<<1,h=i[e+0],o=i[e+1],a=i[u+0],c=i[u+1],f=i[s+0],l=i[s+1],v=h-a,b=o-c,d=f-a,g=l-c;if(n<=2){var m=.01,w=Math.sin(m);return Zh(a,c,0,0,d/w,g/w,-m,0,m,r)}for(var p=Yh(v,b),O=Yh(d,g),D=Kh(v,b,d,g)/(p*O),E=Math.acos(D),M=.5*E,S=.25*E,T=0,j=0,N=0,I=0,C=Math.max(p,O),A=Math.min(p,O),R=0;R<16;++R){var y=.5*M,k=E-y;T=C*Math.sin(y),j=C*Math.cos(y),N=A*Math.sin(k),1<(1-(I=A*Math.cos(k))/j)*(1-I/j)+N*N/(T*T)?M+=S:M-=S,S*=.5}var L=Math.asin(Math.min(N/T,1));if(p<O){var x=d/O,B=g/O,_=void 0,P=void 0;return 0<Jh(v,b,d,g)?(_=+B,P=-x):(_=-B,P=+x),Zh(H=a-(G=(F=-j*j/O)*x+(U=-j*T/O)*_),V=c-(z=F*B+U*P),G,z,f-H,l-V,-L,0,Xh,r)}var F,U,G,z,H,V,W=v/p,X=b/p;return _=void 0,P=void 0,Jh(v,b,d,g)<0?(_=+X,P=-W):(_=-X,P=+W),Zh(H=a-(G=(F=-j*j/p)*W+(U=-j*T/p)*_),V=c-(z=F*X+U*P),G,z,-(h-H),-(o-V),-Xh,0,L,r)},t.toHybrid=function(n,i,r,e){var u=t.toCircle(n,i,r,e),s=u.angle[0],h=u.angle[2],o=Math.min(s,h),a=Math.max(s,h);return o<-Xh||Xh<a?t.toEllipse(n,i,r,e):u},t}(),to=function(t,n,i,r,e){return Qh.interpolate(t,n,i,Qh.toHybrid,!!(r&U.CLOSED),Y.CURVE_SEGMENT_COUNT,!0,e),e.length=e.values.length>>1,e.style=r,e},no=function(t,n){if(2<=t.length){for(var i=t[0],r=t[1],e=i,u=r,s=2,h=t.length;s<h;s+=2){var o=t[s],a=t[s+1];i=Math.min(i,o),r=Math.min(r,a),e=Math.max(e,o),u=Math.max(u,a)}n[0]=i,n[1]=r,n[2]=e,n[3]=u}else n[0]=0,n[1]=0,n[2]=0,n[3]=0;return n},io=function(){function n(n){var i=this;this.O=n,this._s=0,this.Ps=!1,this.Fs=!1,this.Us=!1,this.jt=J.NONE,this.I=new t.ObservablePoint((function(){i.onSizeChange()}),void 0,.15*Y.SIZE_X,.15*Y.SIZE_Y),this.A=this.newFill(),this.Gs=0}return n.prototype.newFill=function(){return new Z(this,!0,Y.FILL_COLOR,1)},n.prototype.lock=function(){return this._s+=1,1===this._s&&(this.Ps=!1,this.Fs=!1,this.Us=!1),this},n.prototype.unlock=function(){return this._s-=1,0===this._s&&(this.Ps?this.onTypeChange():this.Fs?this.onSizeChange():this.Us&&this.onFillChange(),this.Ps=!1,this.Fs=!1,this.Us=!1),this},Object.defineProperty(n.prototype,"type",{get:function(){return this.jt},set:function(t){this.jt!==t&&(this.jt=t,this.onTypeChange())},enumerable:!1,configurable:!0}),n.prototype.onTypeChange=function(){0<this._s?this.Ps=!0:this.O.onTypeChange()},Object.defineProperty(n.prototype,"size",{get:function(){return this.I},enumerable:!1,configurable:!0}),n.prototype.onSizeChange=function(){0<this._s?this.Fs=!0:this.O.onSizeChange()},Object.defineProperty(n.prototype,"transform",{get:function(){return this.updateTransform()},enumerable:!1,configurable:!0}),n.prototype.updateTransform=function(){var n=this.C;null==n&&(n=new t.Matrix,this.C=n);var i=this.O.parent,r=i.id;if(this.Gs!==r){this.Gs=r;var e=i.formatted;2<=e.length?this.toTransform(e.values,n):n.identity()}return n},n.prototype.toTransformMatrix=function(t,n,i,r,e){var u=t-i,s=n-r,h=u*u+s*s;if(1e-5<h){var o=1/Math.sqrt(h),a=u*o,c=s*o;e.set(c,-a,-a,-c,t,n)}else e.identity();return e},Object.defineProperty(n.prototype,"fill",{get:function(){return this.A},enumerable:!1,configurable:!0}),n.prototype.onFillChange=function(){0<this._s?this.Us=!0:this.O.onFillChange()},n.prototype.updateUploaded=function(){this.onFillChange()},n.prototype.copy=function(t){var n=t.size;return this.set(t.type,n.x,n.y),this},n.prototype.set=function(t,n,i){return this.lock(),null!=t&&(this.type=t),this.size.set(n,i),this.unlock(),this},n.prototype.serialize=function(t){var n=this.I,i=this.A.serialize(t);return t.addResource("["+this.jt+","+n.x+","+n.y+","+i+"]")},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.type=r[0],this.I.set(r[1],r[2]),this.A.deserialize(r[3],n),this.unlock()}},n}(),ro=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){var i=t.length;return 4<=i?this.toTransformMatrix(t[i-2],t[i-1],t[i-4],t[i-3],n):(n.identity(),n)},n}(io),eo=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toTransform=function(t,n){return 4<=t.length?this.toTransformMatrix(t[0],t[1],t[2],t[3],n):(n.identity(),n)},n}(io),uo=function(){function t(t){this.O=t,this._s=0,this.Ps=!1,this.Fs=!1,this.Us=!1,this.zs=new ro(this),this.Hs=new eo(this)}return t.prototype.lock=function(){return this._s+=1,1===this._s&&(this.Ps=!1,this.Fs=!1,this.Us=!1),this},t.prototype.unlock=function(){return this._s-=1,0===this._s&&(this.Ps?this.onTypeChange():this.Fs?this.onSizeChange():this.Us&&this.onFillChange(),this.Ps=!1,this.Fs=!1,this.Us=!1),this},Object.defineProperty(t.prototype,"parent",{get:function(){return this.O},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.zs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tail",{get:function(){return this.Hs},enumerable:!1,configurable:!0}),t.prototype.onTypeChange=function(){0<this._s?this.Ps=!0:this.O.onMarkerTypeChange()},t.prototype.onSizeChange=function(){0<this._s?this.Fs=!0:this.O.onMarkerSizeChange()},t.prototype.onFillChange=function(){0<this._s?this.Us=!0:this.O.onMarkerFillChange()},t.prototype.copy=function(t){return this.lock(),this.zs.copy(t.head),this.Hs.copy(t.tail),this.unlock(),this},t.prototype.serialize=function(t){var n=this.zs.serialize(t),i=this.Hs.serialize(t);return t.addResource("["+n+","+i+"]")},t.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.lock(),this.zs.deserialize(r[0],n),this.Hs.deserialize(r[1],n),this.unlock()}},t}(),so=function(){function n(n){this.O=n,this.Vs=0,this.L=[],this.B=[];var i=n.size,r=i.x,e=i.y;this.Ws=new t.Point(r,e),this.Xs=new t.Point(r,e),this.k=0,this._=U.NONE,this.Ks=-1}return Object.defineProperty(n.prototype,"length",{get:function(){return this.L.length>>1},enumerable:!1,configurable:!0}),n.prototype.toFitted=function(){this.Ys=void 0;var t=this.O.size;this.Xs.copyFrom(t),this.Ws.copyFrom(t)},n.prototype.fit=function(){var t=this.Xs,n=this.O.size,i=n.x,r=n.y,e=1e-5;if(e<Math.abs(i-t.x)||e<Math.abs(r-t.y)){t.set(i,r);var u=this.Ws,s=e<Math.abs(u.x),h=e<Math.abs(u.y);if(s||h){var o=s?i/u.x:1,a=h?r/u.y:1,c=this.L,f=this.Ys;if(null==f){f=[],this.Ys=f;for(var l=0,v=c.length;l<v;l+=2){var b=c[l],d=c[l+1];c[l]=b*o,c[l+1]=d*a,f.push(b,d)}}else for(l=0,v=c.length;l<v;l+=2)c[l]=f[l]*o,c[l+1]=f[l+1]*a;if(this.k===this.Ks){var g=this.Js;if(null!=g){var m=g.values,w=this.Zs;if(null==w)for(w=[],this.Zs=w,l=0,v=m.length;l<v;l+=2)b=m[l],d=m[l+1],m[l]=b*o,m[l+1]=d*a,w.push(b,d);else for(l=0,v=m.length;l<v;l+=2)m[l]=w[l]*o,m[l+1]=w[l+1]*a;var p=g.boundary,O=this.qs;if(null==O)for(O=[0,0,0,0],this.qs=O,l=0,v=p.length;l<v;l+=2)b=p[l],d=p[l+1],p[l]=b*o,p[l+1]=d*a,O[l]=b,O[l+1]=d;else for(l=0,v=p.length;l<v;l+=2)p[l]=O[l]*o,p[l+1]=O[l+1]*a;this.Ks+=1}}this.k+=1}}},Object.defineProperty(n.prototype,"id",{get:function(){return this.fit(),this.k},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.fit(),this.L},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.B},set:function(t){this.set(void 0,t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return this._},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.R;return null==t&&(t=this.newMarker(),this.R=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){return this.R},n.prototype.newMarker=function(){return new uo(this)},n.prototype.onMarkerTypeChange=function(){var t=this.O;t.uploaded=void 0,t.toDirty()},n.prototype.onMarkerSizeChange=function(){this.O.updateUploaded()},n.prototype.onMarkerFillChange=function(){this.O.updateUploaded()},Object.defineProperty(n.prototype,"formatter",{get:function(){return this.$s||null},set:function(t){this.$s!==t&&(this.Ks=-1,this.$s=t,this.toDirty(!0))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){this.fit();var t=this.k,n=this.Js;if(this.Ks!==t){this.Ks=t;var i=this._,r=this.$s;if(null==r&&i&U.CURVE&&(r=to),null!=r){null==n&&(n={length:0,values:[],segments:[],boundary:[0,0,0,0],style:U.NONE});var e=this.Ys,u=this.B;if(null!=e){r(e.length>>1,e,u,i,n),no(n.values,n.boundary);var s=n.values,h=s.splice(0);this.Zs=h;var o=n.boundary,a=[o[0],o[1],o[2],o[3]];this.qs=a,this.toScaled(s,h,o,a)}else{var c=this.L;r(c.length>>1,c,u,i,n),no(n.values,n.boundary),this.Zs=void 0,this.qs=void 0}}else n=void 0,this.Zs=void 0,this.qs=void 0;this.Js=n}return n||this},enumerable:!1,configurable:!0}),n.prototype.toScaled=function(t,n,i,r){var e=this.Xs,u=this.Ws,s=1e-5,h=s<Math.abs(u.x),o=s<Math.abs(u.y);if(h||o){for(var a=h?e.x/u.x:1,c=o?e.y/u.y:1,f=0,l=n.length;f<l;f+=2)t[f]=n[f]*a,t[f+1]=n[f+1]*c;for(f=0,l=r.length;f<l;f+=2)i[f]=r[f]*a,i[f+1]=r[f+1]*c}},n.prototype.copy=function(t){this.set(t.values,t.segments,t.style);var n=t.getMarker();return n&&this.marker.copy(n),this},n.prototype.set=function(t,n,i){var r=!1,e=!1,u=this._,s=u&U.FORMATTER_MASK,h=this.$s;if(null!=t){var o=this.L,a=this.Vs,c=t.length,f=Math.min(c,a);if(this.toFitted(),o!==t){for(var l=0;l<f;++l)o[l]=t[l];for(l=f;l<c;++l)o.push(t[l]);a!==c?(o.length=c,this.Vs=c,r=!0):null!=h||s?r=!0:e=!0}else a!==c?(this.Vs=c,r=!0):null!=h||s?r=!0:e=!0}if(null!=n){var v=this.B;if(v!==n){var b=n.length;for(f=Math.min(v.length,b),l=0;l<f;++l)v[l]=n[l];for(l=f;l<b;++l)v.push(n[l]);v.length!==b&&(v.length=b)}null!=h||s?r=!0:e=!0}return null!=i&&u!==i&&(s!==(i&U.FORMATTER_MASK)||(null!=h||s)&&(u&U.CLOSED)!=(i&U.CLOSED)?r=!0:e=!0,this._=i),(e||r)&&this.toDirty(r),this},n.prototype.toDirty=function(t){if(t){this.k+=1;var n=this.O,i=n.uploaded;i?i.isCompatible(n)?n.updateUploaded():(n.uploaded=void 0,n.toDirty()):n.updateUploaded()}else this.k+=1,this.O.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){var n=JSON.stringify(this.L),i=JSON.stringify(this.B),r=this._,e=-1,u=this.R;return u&&(e=u.serialize(t)),t.addResource("["+n+","+i+","+r+","+e+"]")},n.prototype.deserialize=function(t,n){var i=n.resources;if(0<=t&&t<i.length){var r=n.getExtension(t);null==r&&(r=JSON.parse(i[t]),n.setExtension(t,r)),this.set(r[0],r[1],r[2]);var e=r[3];null!=e&&0<=e&&this.marker.deserialize(e,n)}},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o){var a=this.formatted,c=a.length;if(2<=c){var f=a.values,l=a.segments,v=a.style,b=0,d=c;if(s){var g=n.WORK_RANGE;s(t,i,u,f,g),b=g[0],d=g[1]}for(var m=b,w=Math.min(d,c-1);m<w;++m){var p;if(Vh(l,m+1)<0&&h(t,i,f[0+(p=m<<1)],f[p+1],f[p+2],f[p+3],m,u,o))return!0}if(2<c&&c<=d&&v&U.CLOSED&&Vh(l,0)<0&&h(t,i,f[0+(p=(m=c-1)<<1)],f[p+1],f[0],f[1],m,u,o))return!0}return!1},n.WORK_RANGE=[0,0],n}(),ho=24,oo=16,ao=[0,0,0,0],co=new t.Point,fo=function(t,n,i){var r=1-i[0],e=1-i[1],u=3*n-1;t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=e,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=r,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0,t[++u]=1,t[++u]=0,t[++u]=0},lo=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+4,t[++r]=n+4,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+5,t[++r]=n+2,t[++r]=n+3,t[++r]=n+8,t[++r]=n+6,t[++r]=n+9,t[++r]=n+9,t[++r]=n+6,t[++r]=n+7,t[++r]=n+9,t[++r]=n+7,t[++r]=n+10,t[++r]=n+10,t[++r]=n+7,t[++r]=n+11,t[++r]=n+12,t[++r]=n+16,t[++r]=n+13,t[++r]=n+13,t[++r]=n+16,t[++r]=n+17,t[++r]=n+13,t[++r]=n+17,t[++r]=n+14,t[++r]=n+14,t[++r]=n+17,t[++r]=n+15,t[++r]=n+18,t[++r]=n+20,t[++r]=n+21,t[++r]=n+18,t[++r]=n+21,t[++r]=n+22,t[++r]=n+18,t[++r]=n+22,t[++r]=n+19,t[++r]=n+19,t[++r]=n+22,t[++r]=n+23},vo=function(t,n,i,r,e,u,s,h,o,a){var c=s*h,f=.5*e+(0<=e?+c:-c),l=.5*u+(0<=u?+c:-c),v=co;v.set(i-f,r-l),o.apply(v,v);var b=v.x,d=v.y;v.set(i+f,r-l),o.apply(v,v);var g=v.x,m=v.y;v.set(i+f,r+l),o.apply(v,v);var w=v.x,p=v.y,D=b+(w-g),E=d+(p-m),M=.5*O(b,d,g,m),S=.5*O(g,m,w,p),T=1,j=1;M<=S?j=M/S:T=S/M,a[0]=T,a[1]=j,a[2]=M,a[3]=S;var N=T*(g-b)*.5,I=T*(m-d)*.5,C=j*(D-b)*.5,A=j*(E-d)*.5,R=(n<<1)-1;t[++R]=b,t[++R]=d,t[++R]=b+N,t[++R]=d+I,t[++R]=g-N,t[++R]=m-I,t[++R]=g,t[++R]=m,t[++R]=b+N+C,t[++R]=d+I+A,t[++R]=g-N+C,t[++R]=m-I+A,t[++R]=D+N-C,t[++R]=E+I-A,t[++R]=w-N-C,t[++R]=p-I-A,t[++R]=D,t[++R]=E,t[++R]=D+N,t[++R]=E+I,t[++R]=w-N,t[++R]=p-I,t[++R]=w,t[++R]=p,t[++R]=b,t[++R]=d,t[++R]=b+C,t[++R]=d+A,t[++R]=D-C,t[++R]=E-A,t[++R]=D,t[++R]=E,t[++R]=b+C+N,t[++R]=d+A+I,t[++R]=D-C+N,t[++R]=E-A+I,t[++R]=g+C-N,t[++R]=m+A-I,t[++R]=w-C-N,t[++R]=p-A-I,t[++R]=g,t[++R]=m,t[++R]=g+C,t[++R]=m+A,t[++R]=w-C,t[++R]=p-A,t[++R]=w,t[++R]=p},bo=function(t,n,i,r,e,u){var s,h,a,c,f,l,v,b,d=o(e),g=u[0],m=u[1],w=Math.max(0,1-g),p=Math.max(0,1-m),O=u[2],D=u[3];r&xt.TOP?(s=2,h=1+p):(s=-2,h=-1-p),r&xt.RIGHT?(a=2,c=1+w):(a=-2,c=-1-w),r&xt.BOTTOM?(f=2,l=1+p):(f=-2,l=-1-p),r&xt.LEFT?(v=2,b=1+w):(v=-2,b=-1-w);var E=6*(t-1)-1;go(n,E+=6,i,d,O,D,v,s),go(n,E+=6,i,d,O,D,b,s),go(n,E+=6,i,d,O,D,c,s),go(n,E+=6,i,d,O,D,a,s),go(n,E+=6,i,d,O,D,b,h),go(n,E+=6,i,d,O,D,c,h),go(n,E+=6,i,d,O,D,b,l),go(n,E+=6,i,d,O,D,c,l),go(n,E+=6,i,d,O,D,v,f),go(n,E+=6,i,d,O,D,b,f),go(n,E+=6,i,d,O,D,c,f),go(n,E+=6,i,d,O,D,a,f),go(n,E+=6,i,d,O,D,v,s),go(n,E+=6,i,d,O,D,v,h),go(n,E+=6,i,d,O,D,v,l),go(n,E+=6,i,d,O,D,v,f),go(n,E+=6,i,d,O,D,b,h),go(n,E+=6,i,d,O,D,b,l),go(n,E+=6,i,d,O,D,c,h),go(n,E+=6,i,d,O,D,c,l),go(n,E+=6,i,d,O,D,a,s),go(n,E+=6,i,d,O,D,a,h),go(n,E+=6,i,d,O,D,a,l),go(n,E+=6,i,d,O,D,a,f)},go=function(t,n,i,r,e,u,s,h){t[++n]=i,t[++n]=r,t[++n]=e,t[++n]=u,t[++n]=s,t[++n]=h},mo=function(t,n,i,r){var e=i.x0,u=i.y0,s=i.y1,h=i.x1,o=i.y2,a=i.x2,c=i.y3,f=i.x3,l=r[0],v=r[1],b=l*(h-e)*.5,d=l*(s-u)*.5,g=v*(f-e)*.5,m=v*(c-u)*.5,w=(n<<1)-1;t[++w]=e,t[++w]=u,t[++w]=e+b,t[++w]=u+d,t[++w]=h-b,t[++w]=s-d,t[++w]=h,t[++w]=s,t[++w]=e+b+g,t[++w]=u+d+m,t[++w]=h-b+g,t[++w]=s-d+m,t[++w]=f+b-g,t[++w]=c+d-m,t[++w]=a-b-g,t[++w]=o-d-m,t[++w]=f,t[++w]=c,t[++w]=f+b,t[++w]=c+d,t[++w]=a-b,t[++w]=o-d,t[++w]=a,t[++w]=o,t[++w]=e,t[++w]=u,t[++w]=e+g,t[++w]=u+m,t[++w]=f-g,t[++w]=c-m,t[++w]=f,t[++w]=c,t[++w]=e+g+b,t[++w]=u+m+d,t[++w]=f-g+b,t[++w]=c-m+d,t[++w]=h+g-b,t[++w]=s+m-d,t[++w]=a-g-b,t[++w]=o-m-d,t[++w]=h,t[++w]=s,t[++w]=h+g,t[++w]=s+m,t[++w]=a-g,t[++w]=o-m,t[++w]=a,t[++w]=o},wo=function(n){function i(t,i){var r=n.call(this,t,i,ho,oo)||this;return r.pointId=-1,r}return _(i,n),i.prototype.init=function(t){t.updateIndices(),lo(t.indices,this.vertexOffset,this.indexOffset)},i.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},i.prototype.updateVertexClippingStepAndUv=function(n,r){var e,u=r.points;if(null!=u){var s=u.getMarker();if(null!=s){var h=this.toMarker(s),o=h.size,a=o.x,c=o.y,f=a!==this.sizeX||c!==this.sizeY,l=H(r),v=this.transformLocalId!==l,b=r.stroke,d=b.align,g=b.enable?b.width:0,m=b.side,w=b.style,p=this.strokeAlign!==d||this.strokeWidth!==g||this.strokeSide!==m||this.strokeStyle!==w,O=V(r),D=W(O),E=O!==this.texture||D!==this.textureTransformId,M=f||p,S=u.id!==this.pointId;if(M||v||E||S){this.sizeX=a,this.sizeY=c,this.transformLocalId=l,this.strokeAlign=d,this.strokeWidth=g,this.strokeSide=m,this.strokeStyle=w,this.texture=O,this.textureTransformId=D;var T=this.vertexOffset,j=null!==(e=i.WORK)&&void 0!==e?e:i.WORK=new t.Matrix;j.copyFrom(h.transform).prepend(r.transform.internalTransform),n.updateVertices(),vo(n.vertices,T,0,0,a,c,d,g,j,ao),(M||v)&&(n.updateSteps(),bo(T,n.steps,g,m,w,ao)),M&&(n.updateClippings(),fo(n.clippings,T,ao)),(M||E)&&(n.updateUvs(),mo(n.uvs,T,X(O),ao))}}}},i}(Bh),po=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.tail},n}(wo),Oo=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMarker=function(t){return t.head},n}(wo),Do=function(t){switch(t){case J.NONE:return 0;case J.CIRCLE:return 9;case J.TRIANGLE:return 7;case J.RECTANGLE:return ho}return 0},Eo=function(t){switch(t){case J.NONE:return 0;case J.CIRCLE:return 8;case J.TRIANGLE:return 3;case J.RECTANGLE:return oo}return 0},Mo=function(t,n,i){switch(t){case J.NONE:return new Hh(n,i);case J.CIRCLE:return new Gh(n,i);case J.TRIANGLE:return new Ph(n,i);case J.RECTANGLE:return new Oo(n,i)}return new Hh(n,i)},So=function(t,n,i){switch(t){case J.NONE:return new Hh(n,i);case J.CIRCLE:return new zh(n,i);case J.TRIANGLE:return new Fh(n,i);case J.RECTANGLE:return new po(n,i)}return new Hh(n,i)},To=function(t,n,i,r,e){var s=n.points,h=gh(s),o=mh(h,!0),a=wh(h,!0),c=J.NONE,f=J.NONE;if(s&&s instanceof so){var l=s.getMarker();l&&(c=l.tail.type,f=l.head.type)}var v=Do(c),b=Eo(c),d=i+o,g=r+a,m=Do(f),w=Eo(f),p=d+v,O=g+b,D=M(n),E=4*D,S=2*D,T=p+m,j=O+w,N=o+m+v+E,I=a+w+b+S;return t.check(i,r,N,I)?new u(t,i,r,N,I,[new Ih(i,r,o,a),So(c,d,g),Mo(f,p,O),new Ht(T,j,E,S)]).init(n):null},jo=function(){function t(){this.W=new Map}return t.prototype.add=function(t,n,i,r){return this.W.set(t,{type:n,x:i,y:r}),!0},t.prototype.remove=function(t){var n=this.W,i=n.get(t);return null!=i?(n.delete(t),i):null},t.prototype.size=function(){return this.W.size},t.prototype.get=function(t){return this.W.get(t)||null},t.prototype.each=function(t){return this.W.forEach(t),this},t.prototype.contains=function(t){return this.W.has(t)},t.prototype.clear=function(){var t=this.W;return 0<t.size&&(t.clear(),!0)},t}(),No={TAIL:1,HEAD:2,ALL:3},Io=function(){function t(){}return t.set=function(t,n){var i=this.Qs;null==i&&(i=new Map,this.Qs=i),i.set(t,n)},t.get=function(t){var n;return(null===(n=this.Qs)||void 0===n?void 0:n.get(t))||this.getDefault()},t.getDefault=function(){var t=this.th;return null==t&&(t=this.newDefault(),this.th=t),t},t.newDefault=function(){var t=new jo;return t.add("TOP",No.ALL,0,-.5),t.add("LEFT",No.ALL,-.5,0),t.add("RIGHT",No.ALL,.5,0),t.add("BOTTOM",No.ALL,0,.5),t.add("CENTER",No.ALL,0,0),t.add("TOP_LEFT",No.ALL,-.5,-.5),t.add("TOP_RIGHT",No.ALL,.5,-.5),t.add("BOTTOM_LEFT",No.ALL,-.5,.5),t.add("BOTTOM_RIGHT",No.ALL,.5,.5),t},t}(),Co=function(){function t(t){this.O=t,this.me=null,this.nh=null}return Object.defineProperty(t.prototype,"shape",{get:function(){return this.me},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"edge",{get:function(){return this.nh},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.set(t.shape,t.edge)},t.prototype.set=function(t,n){var i=!1;return void 0!==t&&this.me!==t&&(this.me=t,i=!0),void 0!==n&&this.nh!==n&&(this.nh=n,i=!0),i&&this.O.onAcceptorChange(),this},t}(),Ao=function(){function n(n,i){var r=this;this.O=n,this.q=i,this.ih=new Co(this),this.Z=new t.ObservablePoint((function(){r.onLocalChange()}),void 0),this.rh=0,this.eh=0,this.Re=0,this._s=0,this.uh=!1,this.sh=!1,this.hh=!1}return n.prototype.lock=function(){this._s+=1,1===this._s&&(this.uh=!1,this.sh=!1,this.hh=!1)},n.prototype.unlock=function(){this._s-=1,0===this._s&&(this.sh?this.onLocalChange():this.uh?this.onAcceptorChange():this.hh&&this.onOtherChange())},Object.defineProperty(n.prototype,"acceptor",{get:function(){return this.ih},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"local",{get:function(){return this.Z},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"localId",{get:function(){return this.eh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Re},set:function(t){this.Re!==t&&(this.Re=t,this.onOtherChange())},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e){return this.lock(),this.ih.set(t,n),null!=r&&(this.Z.x=r),null!=e&&(this.Z.y=e),null!=i&&(this.margin=i),this.unlock(),this},n.prototype.copy=function(t){return this.lock(),this.ih.copy(t.acceptor),this.Z.copyFrom(t.local),this.margin=t.margin,this.unlock(),this},n.prototype.serialize=function(t){var n=this.ih,i=n.shape,r=i?i.uuid:null,e=n.edge,u=null!=e?t.addResource(e):-1,s=this.Z;return t.addResource("["+r+","+u+","+s.x+","+s.y+","+this.Re+"]")},n.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e));var u=null,s=e[0];null!=s&&(u=n.find(s)||null),this.lock();var h=this.ih;h.shape=u;var o=e[1];h.edge=0<=o&&o<r.length?r[o]:null,this.Z.set(e[2],e[3]),this.margin=e[4]||0,this.unlock(),u&&u.connector.add(this)}},n.prototype.fit=function(i){var r;i&&(this.rh+=1);var e=this.rh;if(this.eh!==e){this.eh=e;var u=this.ih,s=u.shape,h=u.edge;if(null!=s&&null!=h){var o=Io.get(s.type).get(h);if(o){var a=null!==(r=n.WORK_UPDATE_LOCAL)&&void 0!==r?r:n.WORK_UPDATE_LOCAL=new t.Point,c=s.size;a.set(c.x*o.x,c.y*o.y),s.toGlobal(a,a);var f=this.O,l=f.parent;l&&(f.updateTransform(),l.toLocal(a,void 0,a,!0)),this.Z.copyFrom(a)}}}return this},n.prototype.onAcceptorChange=function(){0<this._s?this.uh=!0:(this.rh+=1,this.fit())},n.prototype.onLocalChange=function(){0<this._s?this.sh=!0:(this.rh+=1,this.eh=this.rh,this.q())},n.prototype.onOtherChange=function(){0<this._s?this.hh=!0:this.q()},n.prototype.attach=function(){var t=this.ih.shape;return t&&t.connector.add(this),this},n.prototype.detach=function(){var t=this.ih.shape;return t&&t.connector.remove(this),this},n}(),Ro=function(){function t(t,n){var i=this;this.O=t,this._s=0,this.xt=!1,this.q=n;var r=function(){i.onChange()};this.Hs=new Ao(t,r),this.zs=new Ao(t,r)}return t.prototype.lock=function(){return this._s+=1,1===this._s&&(this.xt=!1),this},t.prototype.unlock=function(){return this._s-=1,0===this._s&&this.xt&&this.q(),this},t.prototype.onChange=function(){0<this._s?this.xt=!0:this.q()},Object.defineProperty(t.prototype,"tail",{get:function(){return this.Hs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"head",{get:function(){return this.zs},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this.lock(),this.Hs.copy(t.tail),this.zs.copy(t.head),this.unlock(),this},t.prototype.fit=function(t){return this.lock(),this.Hs.fit(t),this.zs.fit(t),this.unlock(),this},t.prototype.serialize=function(t){var n=this.Hs.serialize(t),i=this.zs.serialize(t);return t.addResource("["+n+","+i+"]")},t.prototype.deserialize=function(t,n,i){var r=i.resources;if(0<=t&&t<r.length){var e=i.getExtension(t);null==e&&(e=JSON.parse(r[t]),i.setExtension(t,e)),this.lock(),this.Hs.deserialize(e[0],n,i),this.zs.deserialize(e[1],n,i),this.unlock()}},t.prototype.attach=function(){this.lock();var t=this.Hs,n=this.zs;return t.attach(),n.attach(),t.fit(!0),n.fit(!0),this.unlock(),this},t.prototype.detach=function(){return this.lock(),this.Hs.detach(),this.zs.detach(),this.unlock(),this},t}(),yo=function(t){function n(n){void 0===n&&(n=r.CONNECTOR_LINE);var i=t.call(this,n)||this;i.oh=0,i.ah=0,i.fh=0,i.lh=0;var e=.5*Y.SIZE_X,u=.5*Y.SIZE_Y;return i.gt=new so(i).set(i.toValues(-e,-u,+e,+u,0,0,[])),i.nh=new Ro(i,(function(){i.onEdgeChange()})),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"edge",{get:function(){return this.nh},enumerable:!1,configurable:!0}),n.prototype.onAttach=function(){t.prototype.onAttach.call(this),this.nh.attach()},n.prototype.onDetach=function(){this.nh.detach(),t.prototype.onDetach.call(this)},n.prototype.onEdgeChange=function(){var t,i=this.nh,r=i.tail,e=r.localId,u=r.margin,s=i.head,h=s.localId,o=s.margin;if(this.oh!==e||this.ah!==u||this.fh!==h||this.lh!==o){this.oh=e,this.ah=u,this.fh=h,this.lh=o;var a=r.local,c=a.x,f=a.y,l=s.local,v=l.x,b=l.y,d=this.transform,g=d.position,m=g.x,w=g.y,p=this.gt,O=p.values;this.toValues(c-m,f-w,v-m,b-w,u,o,O);var D=null!==(t=n.WORK_BOUNDARY)&&void 0!==t?t:n.WORK_BOUNDARY=[0,0,0,0];no(O,D);for(var E=.5*(D[2]+D[0]),M=.5*(D[3]+D[1]),S=D[2]-D[0],T=D[3]-D[1],j=0,N=O.length;j<N;j+=2)O[j+0]-=E,O[j+1]-=M;this.disallowUploadedUpdate(),g.set(m+E,w+M),d.scale.set(1,1),d.rotation=0,d.skew.set(0,0),this.size.set(S,T),p.toFitted(),p.set(O),this.allowUploadedUpdate()}},n.prototype.toValues=function(t,n,i,r,e,u,s){var h=1e-6,o=s.length;if(o<=4)if(0!==e||0!==u)if(h<(f=i-t)*f+(l=r-n)*l){var a=f*(v=1/Math.sqrt(f*f+l*l)),c=l*v;s[0]=t+e*a,s[1]=n+e*c,s[2]=i-u*a,s[3]=r-u*c}else s[0]=t,s[1]=n,s[2]=i,s[3]=r;else s[0]=t,s[1]=n,s[2]=i,s[3]=r;else{var f,l;if(0!==e)if(h<(f=s[2]-t)*f+(l=s[3]-n)*l){var v=1/Math.sqrt(f*f+l*l);s[0]=t+e*f*v,s[1]=n+e*l*v}else s[0]=t,s[1]=n;else s[0]=t,s[1]=n;0!==u&&h<(f=s[o-4]-i)*f+(l=s[o-3]-r)*l?(v=1/Math.sqrt(f*f+l*l),s[o-2]=i+u*f*v,s[o-1]=r+u*l*v):(s[o-2]=i,s[o-1]=r)}return s},n.prototype.copy=function(i,r){return void 0===r&&(r=st.ALL),t.prototype.copy.call(this,i,r),i instanceof n&&this.nh.copy(i.edge),this},n.prototype.clone=function(){return(new n).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=n.addResource("["+this.nh.serialize(n)+","+this.gt.serialize(n)+"]"),i},n}(Ut),ko=function(t,n){return js.deserialize(t,n,new yo)},Lo=function(t,n,i,r){if(n instanceof yo){var e=r.resources,u=t[15];if(0<=u&&u<e.length){var s=r.getExtension(u);null==s&&(s=JSON.parse(e[u]),r.setExtension(u,s)),n.points.deserialize(s[1],r),n.edge.deserialize(s[0],i,r)}}},xo=function(){e[r.CONNECTOR_LINE]=To,n[r.CONNECTOR_LINE]=ko,i[r.CONNECTOR_LINE]=Lo,As.set(r.CONNECTOR_LINE,Cs.CONNECTOR)},Bo=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),lo(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=H(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=V(n),d=W(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),vo(t.vertices,w,.5*r,.5*e,r,e,a,c,n.transform.internalTransform,ao),(m||h)&&(t.updateSteps(),bo(w,t.steps,c,f,l,ao)),m&&(t.updateClippings(),fo(t.clippings,w,ao)),(m||g)&&(t.updateUvs(),mo(t.uvs,w,X(b),ao))}},n}(z),_o=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=ho+h,c=oo+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Bo(i,r,a-h,c-o),new Ht(i+ho,r+oo,h,o)]).init(n):null},Po=function(t,n,i,r){return new u(t,i,r,0,0,[new Hh(i,r)]).init(n)},Fo=function(){function t(t,n,i,r){this.resources=t.resources,this.data=t.data||t.tags||t.resources,this.pieces=n,this.pieceData=i,this.isEditMode=r,this.bh=new Map,this.dh=new Map,this.gh=new Map,this.$i=new Map,this.mh=new Map,this.wh=new Map,this.ph=new Map,this.Oh=new Map,this.Dh=new Map,this.Eh=new Map,this.Mh=new Map}return t.prototype.getAction=function(t){return this.bh.get(t)},t.prototype.setAction=function(t,n){this.bh.set(t,n)},t.prototype.getFill=function(t){return this.dh.get(t)},t.prototype.setFill=function(t,n){this.dh.set(t,n)},t.prototype.getStroke=function(t){return this.gh.get(t)},t.prototype.setStroke=function(t,n){this.gh.set(t,n)},t.prototype.getData=function(t){return this.$i.get(t)},t.prototype.setData=function(t,n){this.$i.set(t,n)},t.prototype.getDataValue=function(t){return this.mh.get(t)},t.prototype.setDataValue=function(t,n){this.mh.set(t,n)},t.prototype.getRange=function(t){return this.wh.get(t)},t.prototype.setRange=function(t,n){this.wh.set(t,n)},t.prototype.getAlign=function(t){return this.ph.get(t)},t.prototype.setAlign=function(t,n){this.ph.set(t,n)},t.prototype.getMargin=function(t){return this.Oh.get(t)},t.prototype.setMargin=function(t,n){this.Oh.set(t,n)},t.prototype.getText=function(t){return this.Dh.get(t)},t.prototype.setText=function(t,n){this.Dh.set(t,n)},t.prototype.getTextOutline=function(t){return this.Eh.get(t)},t.prototype.setTextOutline=function(t,n){this.Eh.set(t,n)},t.prototype.getExtension=function(t){return this.Mh.get(t)},t.prototype.setExtension=function(t,n){this.Mh.set(t,n)},t}(),Uo=function(t,n,i,r){this.name=t,this.width=n,this.height=i,this.layer=r},Go=function(){function t(){}return t.isConnector=function(t){return null!=t&&t.type===r.CONNECTOR_LINE},t.newMapping=function(n,i,r){var e;null==r&&(r=null!==(e=t.Sh)&&void 0!==e?e:t.Sh=new Map).clear();for(var u=0,s=n.length;u<s;++u){var h=n[u],o=i[u];r.set(h,o),this.newMapping(h.children,o.children,r)}return r},t.moveAll=function(t,n,i,r,e){for(var u=0,s=i.length;u<s;++u){var h=i[u],o=r[u];if(this.isConnector(h)&&this.isConnector(o)){var a=h.edge,c=o.edge,f=a.head,l=f.acceptor.shape;if(l){null==e&&(e=this.newMapping(t,n));var v=e.get(l);if(v){var b=c.head;b.detach(),b.set(v),b.attach(),v.connector.remove(f)}}var d=a.tail,g=d.acceptor.shape;if(g){null==e&&(e=this.newMapping(t,n));var m=e.get(g);if(m){var w=c.tail;w.detach(),w.set(m),w.attach(),m.connector.remove(d)}}}e=this.moveAll(t,n,h.children,o.children,e)}return e},t.move=function(t,n){var i=t.children,r=n.children;this.moveAll(i,r,i,r)},t}(),zo={INVISIBLE:"INVISIBLE",INTERACTIVE:"INTERACTIVE",DRAGGABLE:"DRAGGABLE",PINCHABLE:"PINCHABLE"},Ho=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),Vo=function(){this.localTransform=new t.Matrix,this.internalTransform=new t.Matrix,this.internalTransformParentInverse=new t.Matrix,this.rotation=0,this.size=new t.Point},Wo=function(){function t(){}return t.prepare=function(t){var n=t.editor||new Vo;t.editor=n,t.updateTransform();var i=t.parent;i instanceof Dt?i.transform.internalTransform.copyTo(n.internalTransformParentInverse).invert():n.internalTransformParentInverse.identity(),t.transform.internalTransform.copyTo(n.internalTransform),n.rotation=t.transform.rotation,n.size.copyFrom(t.size),t.disallowOnTransformChange()},t.finalize=function(t){t.allowOnTransformChange(!0)},t.apply=function(t,n,i){var r=t.editor;if(null!=r){var e=r.localTransform;if(r.internalTransformParentInverse.copyTo(e).append(n).append(r.internalTransform),i)this.applyLocal(t,e);else{var u=r.size;this.applyLocal(t,e,u.x,u.y)}}},t.applyLocal=function(t,n,i,r){t.disallowUploadedUpdate();var e=n.a,u=n.b,s=n.c,h=n.d,o=n.tx,a=n.ty,c=t.transform,f=Math.atan2(-s,h),l=Math.atan2(+u,e);c.rotation=.5*(f+l);var v=.5*(l-f);c.skew.set(v,v);var b=c.pivot,d=b.x,g=b.y;if(c.position.set(o+(e*d+s*g),a+(u*d+h*g)),null!=i&&null!=r){var m=Math.sqrt(e*e+u*u),w=Math.sqrt(s*s+h*h);t.size.set(hs.toNormalized(i*m),hs.toNormalized(r*w))}t.allowUploadedUpdate()},t}(),Xo=function(){function n(n,i,r){this.shape=n,this.base=new t.Point(i,r);var e=n.size;this.shapeBase=new t.Point(e.x,e.y),this.transform=new t.Matrix,n.updateTransform(),n.transform.localTransform.copyTo(this.transform)}return n.prototype.isCompatible=function(t){return this.shape===t},n.prototype.reset=function(t,n,i){this.base.set(n,i);var r=t.size;this.shapeBase.copyFrom(r),t.updateTransform(),t.transform.localTransform.copyTo(this.transform)},n.prototype.update=function(t,i,r,e,u){var s=i/this.base.x,h=r/this.base.y,o=this.shapeBase,a=n.WORK_TRANSFORM;a.identity().append(this.transform).translate(-e,-u).scale(s,h).translate(+e,+u),t.disallowOnTransformChange(),Wo.applyLocal(t,a,o.x,o.y),t.allowOnTransformChange(!1)},n.WORK_TRANSFORM=new t.Matrix,n}(),Ko=function(){function n(n,i,r,e){this.Th=new t.Point,this.jh=new t.Rectangle,this.Nh=new t.Rectangle,this.O=n,this.Ih=[],this.I=new t.Point(i,r),this.Ch=e}return n.prototype.init=function(){},Object.defineProperty(n.prototype,"x",{get:function(){return this.I.x},set:function(t){var n=this.I;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.I.y},set:function(t){var n=this.I;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.I,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.I;return new n(this.O,t.x,t.y,this.Ch)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.I,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.I.copyTo(t)},n.prototype.equals=function(t){return this.I.equals(t)},n.prototype.fit=function(){this.Ch&&this.doFit()},n.prototype.doFit=function(){var t=this.O;t.disallowOnTransformChange();var n=this.calcRect(this.Nh),i=this.I;i.set(n.width,n.height),t.updateTransform();var r=t.transform,e=n.x+.5*n.width,u=n.y+.5*n.height,s=r.position,h=r.localTransform,o=h.a,a=h.b,c=h.c,f=h.d,l=r.pivot;s.set(s.x+(o*e+c*u)-(o*l.x+c*l.y),s.y+(a*e+f*u)-(a*l.x+f*l.y)),l.set(e,u),this.reset(t.children,this.Ih,i),t.allowOnTransformChange(!0)},n.prototype.reset=function(t,n,i){for(var r=0,e=Math.min(n.length,t.length);r<e;++r){var u=t[r],s=n[r];if(!s.isCompatible(u)){n.length=r;break}s.reset(u,i.x,i.y)}t.length<n.length&&(n.length=t.length)},n.prototype.calcRect=function(t){var n=this.O.children;if(n.length<=0)t.x=0,t.y=0,t.width=0,t.height=0;else{var i=this.Th,r=this.jh;n[0].getBoundsLocal(i,!1,t);for(var e=1,u=n.length;e<u;++e)n[e].getBoundsLocal(i,!1,r),t.enlarge(r)}return t},n.prototype.onChange=function(t,n){var i=this.O,r=this.I,e=i.transform.pivot;this.Ah(i.children,this.Ih,r.x,r.y,e.x,e.y,t,n),i.onSizeChange()},n.prototype.Ah=function(t,n,i,r,e,u,s,h){for(var o=0,a=Math.min(n.length,t.length);o<a;++o){var c=t[o];if(!(f=n[o]).isCompatible(c)){n.length=o;break}f.update(c,i,r,e,u)}for(o=n.length,a=t.length;o<a;++o){var f;c=t[o],(f=this.newLayout(c,s,h)).update(c,i,r,e,u),n.push(f)}n.length!==t.length&&(n.length=t.length)},n.prototype.newLayout=function(t,n,i){return t.layout||new Xo(t,n,i)},n}(),Yo=function(){function n(n,i,r,e,u){this.O=n,this._x=i,this._y=r,this.Rh=new t.Point(e,u)}return Object.defineProperty(n.prototype,"x",{get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this.onChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"base",{get:function(){return this.Rh},enumerable:!1,configurable:!0}),n.prototype.init=function(){this.Rh.copyFrom(this),this.onChange()},n.prototype.clone=function(){var t=this.Rh;return new n(this.O,this._x,this._y,t.x,t.y)},n.prototype.set=function(t,n){var i=!1;return null!=t&&this._x!==t&&(this._x=t,i=!0),null!=n&&this._y!==n&&(this._y=n,i=!0),i&&this.onChange(),this},n.prototype.copyFrom=function(t){return t instanceof n&&this.Rh.copyFrom(t.base),this._x===t.x&&this._y===t.y||(this._x=t.x,this._y=t.y,this.onChange()),this},n.prototype.copyTo=function(t){return t instanceof n&&this.Rh.copyTo(t.base),t.set(this._x,this._y),t},n.prototype.equals=function(t){return t.x===this._x&&t.y===this._y},n.prototype.fit=function(){},n.prototype.onChange=function(){var t=this.Rh;this.O.transform.scale.set(this._x/t.x,this._y/t.y)},n}(),Jo=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){return xt.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return s.NONE},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i,r,e,u,s){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!1,color:16777215,alpha:1,width:1,align:0,side:xt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),Zo=function(){function t(){}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return m.CENTER},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return w.MIDDLE},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n){},t.prototype.toObject=function(){return{horizontal:m.CENTER,vertical:w.MIDDLE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),qo=function(){function t(){}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n){},t.prototype.toObject=function(){return{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),$o=function(){function t(){}return Object.defineProperty(t.prototype,"enable",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 16777215},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n,i,r){},t.prototype.clone=function(){return new t},t.prototype.toObject=function(){return{enable:!1,color:16777215,alpha:1,width:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),Qo=function(){function t(){}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n){},t.prototype.toObject=function(){return{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),ta=function(){function t(){}return Object.defineProperty(t.prototype,"horizontal",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){},t.prototype.set=function(t,n){},t.prototype.toObject=function(){return{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),na=function(){function t(){this.align=new Zo,this.offset=new qo,this.outline=new $o,this.spacing=new ta,this.padding=new Qo}return Object.defineProperty(t.prototype,"enable",{get:function(){return!0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){return""},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return 1},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){return"auto"},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return 24},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){return d.NORMAL},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return g.NORMAL},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){return p.LEFT_TO_RIGHT},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){return!1},set:function(t){},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){return this},t.prototype.set=function(t,n,i,r,e,u,s,h,o){return this},t.prototype.toObject=function(){return{value:"",color:0,alpha:1,family:"auto",size:24,weight:d.NORMAL,align:this.align.toObject(),offset:this.offset.toObject(),style:g.NORMAL,outline:this.outline.toObject(),spacing:this.spacing.toObject(),direction:p.LEFT_TO_RIGHT,padding:this.padding.toObject(),clipping:!1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),ia=function(t){function n(n,i){var r=t.call(this,i)||this;r.yh=n;var e=r.newData();return r.data=e,r.tag=e,r.size=r.newGroupSize(n),r.fill=r.newGroupFill(),r.stroke=r.newGroupStroke(),r.text=r.newGroupText(),r}return _(n,t),Object.defineProperty(n.prototype,"isEditMode",{get:function(){return this.yh},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t){var n=Y.SIZE_X,i=Y.SIZE_Y;return t?new Ko(this,n,i,this.isGroupSizeFittable()):new Yo(this,n,i,n,i)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newData=function(){return new It},n.prototype.newGroupFill=function(){return new Ho},n.prototype.newGroupStroke=function(){return new Jo},n.prototype.newGroupText=function(){return new na},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof Yo?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){return it.NONE},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cursor",{get:function(){return""},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Dt),ra=function(t){function n(n,i,e){void 0===e&&(e=r.EMBEDDED_LAYER);var u=t.call(this,i,e)||this;return u.kh=n,u}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.kh},enumerable:!1,configurable:!0}),n.prototype.newGroupFill=function(){return new Z(this,!1,16777215,1)},n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t.size.init(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.kh,this.yh,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n.deserialize=function(t,i,r,e){var u,s,h,o=new n(this.deserializeName(t[0],i),i.isEditMode),a=t[1];null==a||2&a||(o.visible=!1,o.state.add(zo.INVISIBLE));var c=-.5*r+(t[2]||0),f=-.5*e+(t[3]||0);o.transform.position.set(c,f);var l=null!==(u=t[4])&&void 0!==u?u:r,v=null!==(s=t[5])&&void 0!==s?s:e;o.size.set(l,v);var b=t[6];if(null!=b&&o.fill.deserialize(b,i),!i.isEditMode){var d=null!==(h=t[7])&&void 0!==h?h:1,g=1&d,m=2&d,w=4&d;if(m||w){var p=(m?xr.DRAG:xr.NONE)|(w?xr.PINCH:xr.NONE);o.action.add(new oe("",p))}(g||m||w)&&(o.interactive=!0)}return o},n.deserializeName=function(t,n){if(at(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""},n}(ia),ea=function(){function t(t,n,i){this.children=[],this.Mt=t,this.nn=n,this.yh=i}return t.prototype.hasConnectors=function(t){for(var n=0,i=t.length;n<i;++n){var e=t[n];if(e.type===r.CONNECTOR_LINE)return!0;var u=e.children;if(0<u.length&&this.hasConnectors(u))return!0}return!1},t.prototype.newHasConnectors=function(){for(var t=new Map,n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];t.set(e,this.hasConnectors(e.children))}return t},t.prototype.copyTo=function(t){for(var n,i=null!==(n=this.Lh)&&void 0!==n?n:this.Lh=this.newHasConnectors(),r=this.children,e=t.children,u=0,s=r.length;u<s;++u){var h=r[u],o=h.clone();o.parent=t,e.push(o),i.get(h)&&Go.move(h,o)}t.onChildTransformChange(),t.toDirty(),t.onAttach()},t.prototype.deserialize=function(t,n){var i=t.length;if(0<i)for(var r=this.Mt,e=this.nn,u=0;u<i;++u)this.children.push(ra.deserialize(t[u],n,r,e))},t}(),ua=function(){function t(){}return t.toSimple=function(t){return{version:t.version,id:t.id,name:t.name,thumbnail:t.thumbnail,data:JSON.stringify({width:t.width,height:t.height,background:t.background,tile:t.tile,resources:t.resources,data:t.data||t.tags,pieces:t.pieces,layers:t.layers,items:t.items,snap:t.snap})}},t.toSerialized=function(t){if(!("items"in t)){var n=JSON.parse(t.data),i={version:t.version,id:t.id,name:t.name,width:n.width,height:n.height,background:n.background,tile:n.tile,resources:n.resources,data:n.data||n.tags,pieces:n.pieces,layers:n.layers,items:n.items,snap:n.snap,thumbnail:t.thumbnail};if(null==i.data){var r=t.tags;null!=r&&(i.data=JSON.parse(r))}if(null==i.pieces){var e=t.pieces;null!=e&&(i.pieces=JSON.parse(e))}return i}return t},t.newLayer=function(t,n,i){n.deserialize(t.layers,i);var r=t.items,e=js.deserializeAll(r,i);return null!=e?e.then((function(t){for(var i=n.children,e=0,u=t.length;e<u;++e){var s=r[e],h=t[e];null!=(o=i[s[16]])&&(h.parent=o,h.uploaded=void 0,o.children.push(h))}for(e=0,u=i.length;e<u;++e){var o;(o=i[e]).onChildTransformChange(),o.toDirty();for(var a=o.children,c=0,f=a.length;c<f;++c)a[c].onAttach()}return t})):Promise.resolve([])},t.toPieceData=function(t,n,i){var r=new Map,e=function(){return r};return this.xh(t,n,r,i).then(e,e)},t.xh=function(t,n,i,r){var e=this,u=[];if(n&&0<n.length&&t)for(var s=function(s,h){var o=n[s];i.has(o)||(i.set(o,null),u.push(t.piece.getByName(o).then((function(n){return e.Bh(t,o,n,r,i)}),(function(){return null}))))},h=0,o=n.length;h<o;++h)s(h);return Promise.all(u)},t.Bh=function(t,n,i,r,e){var u=this,s=this.toSerialized(i),h=s.width,o=s.height,a=new ea(h,o,r);e.set(n,new Uo(n,h,o,a));var c=s.pieces;return this.xh(t,c,e,r).then((function(){return u.newLayer(s,a,new Fo(s,c,e,r))}))},t}(),sa=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"horizontal",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.align.horizontal:m.CENTER},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.align.horizontal=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.align.vertical:w.MIDDLE},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.align.vertical=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.align.copy(t)},t.prototype.set=function(t,n){for(var i=this.O.children,r=0,e=i.length;r<e;++r)i[r].text.align.set(t,n)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.align.toObject():{horizontal:m.CENTER,vertical:w.MIDDLE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),ha=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"horizontal",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.offset.horizontal:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.offset.horizontal=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.offset.vertical:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.offset.vertical=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.offset.copy(t)},t.prototype.set=function(t,n){for(var i=this.O.children,r=0,e=i.length;r<e;++r)i[r].text.offset.set(t,n)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.offset.toObject():{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),oa=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.O.children;return 0<t.length&&t[t.length-1].text.outline.enable},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.outline.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.outline.color:16777215},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.outline.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.outline.alpha:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.outline.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.outline.width:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.outline.width=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.outline.copy(t)},t.prototype.set=function(t,n,i,r){for(var e=this.O.children,u=0,s=e.length;u<s;++u)e[u].text.outline.set(t,n,i,r)},t.prototype.clone=function(){return new t(this.O)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.outline.toObject():{enable:!1,color:16777215,alpha:1,width:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),aa=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"horizontal",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.padding.horizontal:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.padding.horizontal=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.padding.vertical:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.padding.vertical=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.padding.copy(t)},t.prototype.set=function(t,n){for(var i=this.O.children,r=0,e=i.length;r<e;++r)i[r].text.padding.set(t,n)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.padding.toObject():{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),ca=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"horizontal",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.spacing.horizontal:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.spacing.horizontal=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"vertical",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.spacing.vertical:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.spacing.vertical=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.spacing.copy(t)},t.prototype.set=function(t,n){for(var i=this.O.children,r=0,e=i.length;r<e;++r)i[r].text.spacing.set(t,n)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.spacing.toObject():{horizontal:0,vertical:0}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),fa=function(){function t(t){this.O=t,this.align=new sa(t),this.offset=new ha(t),this.outline=new oa(t),this.spacing=new ca(t),this.padding=new aa(t)}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.O.children;return!(0<t.length)||t[t.length-1].text.enable},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.value:""},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.value=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.color:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.alpha:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"family",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.family:"auto"},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.family=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.size:24},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"weight",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.weight:d.NORMAL},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.weight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.style:g.NORMAL},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.style=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"direction",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.direction:0},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.direction=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clipping",{get:function(){var t=this.O.children;return 0<t.length&&t[t.length-1].text.clipping},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.clipping=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].text.copy(t);return this},t.prototype.set=function(t,n,i,r,e,u,s,h){for(var o=this.O.children,a=0,c=o.length;a<c;++a)o[a].text.set(t,n,i,r,e,u,s,h);return this},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].text.toObject():{value:"",color:0,alpha:1,family:"auto",size:24,weight:d.NORMAL,align:this.align.toObject(),offset:this.offset.toObject(),style:g.NORMAL,outline:this.outline.toObject(),spacing:this.spacing.toObject(),direction:p.LEFT_TO_RIGHT,padding:this.padding.toObject(),clipping:!1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),la=function(t){function n(n,i,e){void 0===e&&(e=r.EMBEDDED);var u=t.call(this,i,e)||this;return u.kh=n,u}return _(n,t),Object.defineProperty(n.prototype,"name",{get:function(){return this.kh},enumerable:!1,configurable:!0}),n.prototype.newGroupText=function(){return new fa(this)},n.prototype.isGroupSizeFittable=function(){return!1},n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.kh,this.yh,this.type)},n.prototype.serializeChildren=function(t){return[]},n.prototype.serializeImage=function(t){return-1},n.prototype.serializeGradient=function(t){return-1},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=n.addPiece(this.kh),i},n.prototype.addUuid=function(t){this.uuid=t.addUuid(this.uuid)},n.prototype.updateUuid=function(t){this.uuid=t.updateUuid(this.uuid)},n}(ia),va=function(){function t(){}return t.from=function(t,n,i){var r=this,e=ua.toSerialized(t),u=e.pieces;return ua.toPieceData(n,u,i).then((function(t){return r._h(e,i,u,t)}))},t._h=function(t,n,i,r){var e=this,u=t.width,s=t.height,h=new ea(u,s,n),o=new Fo(t,i,r,n);return ua.newLayer(t,h,o).then((function(){return e.create(t.name,u,s,h,o)}))},t.deserialize=function(t,n,i,r,e,u){var s=new la(t,e.isEditMode),h=js.deserialize(u,e,s),o=s.size,a=o.x,c=o.y;return s.size.set(n,i),r.copyTo(s),s.size.init(),s.size.set(a,c),h},t.create=function(t,n,i,r,e){var u=new la(t,e.isEditMode);return u.size.set(n,i),r.copyTo(u),u.size.init(),u},t}(),ba=function(t,n){var i=n.pieces,r=t[15];if(i&&0<=r&&r<i.length){var e=n.pieceData;if(e){var u=i[r],s=e.get(u);if(s)return va.deserialize(u,s.width,s.height,s.layer,n,t)}}return null},da=function(){e[r.EMBEDDED]=Po,n[r.EMBEDDED]=ba,As.set(r.EMBEDDED,Cs.EMBEDDED),e[r.EMBEDDED_LAYER]=_o},ga=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.O.children;return!(0<t.length)||t[t.length-1].fill.enable},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].fill.color:16777215},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].fill.alpha:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.alpha=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].fill.copy(t)},t.prototype.set=function(t,n,i){for(var r=this.O.children,e=0,u=r.length;e<u;++e)r[e].fill.set(t,n,i)},t.prototype.clone=function(){return new t(this.O)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].fill.toObject():{enable:!0,color:16777215,alpha:1}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),ma=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"length",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.length}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.id}return 0},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"values",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.values}return[]},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.values=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"segments",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.segments}return[]},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.segments=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.style}return U.NONE},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.style=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"marker",{get:function(){for(var t=this.O.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.marker}return $.getInstance()},enumerable:!1,configurable:!0}),t.prototype.getMarker=function(){for(var t=this.O.children,n=0,i=t.length;n<i;++n){var r=t[n].points;if(null!=r)return r.getMarker()}},Object.defineProperty(t.prototype,"formatter",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatter}return null},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&(e.formatter=t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"formatted",{get:function(){var t=this.O.children;if(0<t.length){var n=t[t.length-1].points;if(null!=n)return n.formatted}return this},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;null!=e&&e.copy(t)}return this},t.prototype.set=function(t,n,i){for(var r=this.O.children,e=0,u=r.length;e<u;++e){var s=r[e].points;null!=s&&s.set(t,n,i)}return this},t.prototype.clone=function(n){return new t(n)},t.prototype.toPoints=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.toPoints(t)}return[]},t.prototype.serialize=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i){var e=n[i].points;if(null!=e)return e.serialize(t)}return-1},t}(),wa=function(){function t(t){this.O=t}return Object.defineProperty(t.prototype,"enable",{get:function(){var t=this.O.children;return 0<t.length&&t[t.length-1].stroke.enable},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.enable=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.color:16777215},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.color=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.alpha:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.alpha=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.width:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.width=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"align",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.align:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.align=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"side",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.side:1},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.side=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.style:s.NONE},set:function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.style=t},enumerable:!1,configurable:!0}),t.prototype.copy=function(t){for(var n=this.O.children,i=0,r=n.length;i<r;++i)n[i].stroke.copy(t)},t.prototype.set=function(t,n,i,r,e){for(var u=this.O.children,s=0,h=u.length;s<h;++s)u[s].stroke.set(t,n,i,r,e)},t.prototype.clone=function(){return new t(this.O)},t.prototype.toObject=function(){var t=this.O.children;return 0<t.length?t[t.length-1].stroke.toObject():{enable:!1,color:16777215,alpha:1,width:1,align:0,side:xt.NONE,style:s.NONE}},t.prototype.serialize=function(t){return-1},t.prototype.deserialize=function(t,n){},t}(),pa=function(t){function n(n,i){void 0===i&&(i=r.GROUP);var e=t.call(this,i)||this;e.yh=n;var u=new It;return e.data=u,e.tag=u,e.size=e.newGroupSize(n),e.fill=e.newGroupFill(),e.stroke=e.newGroupStroke(),e.text=e.newGroupText(),e.gt=e.newGroupPoints(),e}return _(n,t),Object.defineProperty(n.prototype,"isEditMode",{get:function(){return this.yh},enumerable:!1,configurable:!0}),n.prototype.newGroupSize=function(t){var n=Y.SIZE_X,i=Y.SIZE_Y;return t?new Ko(this,n,i,this.isGroupSizeFittable()):new Yo(this,n,i,n,i)},n.prototype.isGroupSizeFittable=function(){return!0},n.prototype.newGroupFill=function(){return new ga(this)},n.prototype.newGroupStroke=function(){return new wa(this)},n.prototype.newGroupText=function(){return new fa(this)},n.prototype.newGroupPoints=function(){return new ma(this)},n.prototype.getBoundsSize=function(){var t=this.size;return t instanceof Yo?t.base:t},n.prototype.onChildTransformChange=function(){t.prototype.onChildTransformChange.call(this),this.size.fit()},Object.defineProperty(n.prototype,"corner",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].corner:it.ALL},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].corner=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"cursor",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].cursor:""},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].cursor=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"gradient",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].gradient;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].gradient=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"radius",{get:function(){var t=this.children;return 0<t.length?t[t.length-1].radius:.5},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].radius=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"image",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n){var i=t[n].image;if(null!=i)return i}},set:function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].image=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"points",{get:function(){for(var t=this.children,n=t.length-1;0<=n;--n)if(null!=t[n].points)return this.gt},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.clone=function(){for(var t=this.newClone().copy(this),n=this.children,i=0,r=n.length;i<r;++i){var e=n[i].clone();e.parent=t,t.children.push(e)}return t.onChildTransformChange(),t.toDirty(),t},n.prototype.newClone=function(){return new(0,this.constructor)(this.yh,this.type)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){return!1},n}(Dt),Oa=function(t,n){var i=new pa(n.isEditMode),r=js.deserialize(t,n,i);return i.size.init(),r},Da=function(){e[r.GROUP]=Po,n[r.GROUP]=Oa},Ea=function(){function n(n,i,r){this.O=n,this.I=new t.Point(i,r)}return n.prototype.init=function(){},Object.defineProperty(n.prototype,"x",{get:function(){return this.I.x},set:function(t){var n=this.I;if(n.x!==t){var i=n.x;n.x=t,this.onChange(i,n.y)}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"y",{get:function(){return this.I.y},set:function(t){var n=this.I;if(n.y!==t){var i=n.y;n.y=t,this.onChange(n.x,i)}},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n){var i=!1,r=this.I,e=r.x,u=r.y;return null!=t&&e!==t&&(i=!0,r.x=t),null!=n&&u!==n&&(i=!0,r.y=n),i&&this.onChange(e,u),this},n.prototype.clone=function(){var t=this.I;return new n(this.O,t.x,t.y)},n.prototype.copy=function(){},n.prototype.copyFrom=function(t){var n=t.x,i=t.y,r=this.I,e=r.x,u=r.y;return e===n&&u===i||(r.x=n,r.y=i,this.onChange(e,u)),this},n.prototype.copyTo=function(t){return this.I.copyTo(t)},n.prototype.equals=function(t){return this.I.equals(t)},n.prototype.fit=function(){},n.prototype.onChange=function(t,n){this.O.onSizeChange()},n}(),Ma=function(t){function n(n,i){return void 0===i&&(i=r.GROUP_SHADOWED),t.call(this,n,i)||this}return _(n,t),n.prototype.newGroupSize=function(n){return n?new Ea(this,Y.SIZE_X,Y.SIZE_Y):t.prototype.newGroupSize.call(this,n)},n}(pa),Sa=function(t,n){var i=new Ma(n.isEditMode),r=js.deserialize(t,n,i);return i.size.init(),r},Ta=function(){e[r.GROUP_SHADOWED]=Po,n[r.GROUP_SHADOWED]=Sa},ja=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices(),lo(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=H(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.side,l=o.style,v=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeSide!==f||this.strokeStyle!==l,b=V(n),d=W(b),g=b!==this.texture||d!==this.textureTransformId,m=u||v;if(m||h||g){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeSide=f,this.strokeStyle=l,this.texture=b,this.textureTransformId=d;var w=this.vertexOffset;t.updateVertices(),vo(t.vertices,w,0,0,r,e,a,c,n.transform.internalTransform,ao),(m||h)&&(t.updateSteps(),bo(w,t.steps,c,f,l,ao)),m&&(t.updateClippings(),fo(t.clippings,w,ao)),(m||g)&&(t.updateUvs(),mo(t.uvs,w,X(b),ao))}},n}(z),Na=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=ho+h,c=oo+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new ja(i,r,a-h,c-o),new Ht(i+ho,r+oo,h,o)]).init(n):null},Ia=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Bt(this,n,i,r,e,u,s)},n}(kt),Ca=function(t){function n(n,i){void 0===i&&(i=r.IMAGE);var e=t.call(this,i)||this;return null!=n&&(e.image=n,e.size.set(n.width,n.height)),e.fill.alpha=1,e}return _(n,t),n.prototype.clone=function(){return new n(this.image).copy(this)},n}(Ia),Aa=function(t,n){return js.deserialize(t,n,new Ca)},Ra=function(){e[r.IMAGE]=Na,n[r.IMAGE]=Aa},ya=[0,0],ka=new t.Point,La=function(t,n){for(var i=3*n-1,r=3*(n+9)-1;i<r;)t[++i]=0,t[++i]=0,t[++i]=2},xa=function(t,n,i){var r=3*i-1;t[++r]=n,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+4,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+4,t[++r]=n+2,t[++r]=n+5,t[++r]=n+4,t[++r]=n+3,t[++r]=n+4,t[++r]=n+6,t[++r]=n+4,t[++r]=n+7,t[++r]=n+6,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+8,t[++r]=n+7},Ba=function(t,n,i,r,e,u,s,h){var a=o(e),c=u/h[0],f=s/h[1],l=.5*(c+f),v=12,b=-1+i,d=6*n-1;t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=c,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=l,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0,t[++d]=r,t[++d]=a,t[++d]=f,t[++d]=v,t[++d]=b,t[++d]=0},_a=function(t,n,i,r,e,u,s,h){var o=ka,a=.5*e,c=.5*u;o.set(i-a,r-c),s.apply(o,o);var f=o.x,l=o.y;o.set(i+a,r-c),s.apply(o,o);var v=o.x,b=o.y;o.set(i+a,r+c),s.apply(o,o);var d=o.x,g=o.y,m=f+(d-v),w=l+(g-b),p=(n<<1)-1;t[++p]=f,t[++p]=l,t[++p]=.5*(f+v),t[++p]=.5*(l+b),t[++p]=v,t[++p]=b,t[++p]=.5*(f+m),t[++p]=.5*(l+w),t[++p]=.5*(f+d),t[++p]=.5*(l+g),t[++p]=.5*(v+d),t[++p]=.5*(b+g),t[++p]=m,t[++p]=w,t[++p]=.5*(m+d),t[++p]=.5*(w+g),t[++p]=d,t[++p]=g,h[0]=.5*O(f,l,v,b),h[1]=.5*O(f,l,m,w)},Pa=function(t,n,i){var r=i.x0,e=i.y0,u=i.x1,s=i.y1,h=i.x2,o=i.y2,a=i.x3,c=i.y3,f=(n<<1)-1;t[++f]=r,t[++f]=e,t[++f]=.5*(u+r),t[++f]=.5*(s+e),t[++f]=u,t[++f]=s,t[++f]=.5*(r+a),t[++f]=.5*(e+c),t[++f]=.5*(r+h),t[++f]=.5*(e+o),t[++f]=.5*(u+h),t[++f]=.5*(s+o),t[++f]=a,t[++f]=c,t[++f]=.5*(a+h),t[++f]=.5*(c+o),t[++f]=h,t[++f]=o},Fa=function(t){function n(n,i){var r=t.call(this,n,i,9,8)||this;return r.textureWidth=-1,r.textureHeight=-1,r}return _(n,t),n.prototype.init=function(t){var n=this.vertexOffset;t.updateClippings(),t.updateIndices(),La(t.clippings,n),xa(t.indices,n,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexAndStep(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n),this.updateUv(t,n)},n.prototype.updateVertexAndStep=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=H(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=V(n),b=v.width*v.resolution,d=v.height*v.resolution,g=this.textureWidth!==b||this.textureHeight!==d;(u||h||l||g)&&(this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.textureWidth=b,this.textureHeight=d,t.updateVertices(),_a(t.vertices,this.vertexOffset,0,0,r,e,n.transform.internalTransform,ya),t.updateSteps(),Ba(t.steps,this.vertexOffset,a,c,f,b,d,ya))},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);i===this.texture&&r===this.textureTransformId||(this.texture=i,this.textureTransformId=r,t.updateUvs(),Pa(t.uvs,this.vertexOffset,X(i)))},n}(z),Ua=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=9+h,c=8+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Fa(i,r),new Ht(i+9,r+8,h,o)]).init(n):null},Ga=function(t){function n(n,i){return void 0===i&&(i=r.IMAGE_SDF),t.call(this,n,i)||this}return _(n,t),n.prototype.clone=function(){return new n(this.image).copy(this)},n}(Ca),za=function(t,n){return js.deserialize(t,n,new Ga)},Ha=function(){function n(t,n,i,r){this.vertexOffset=t,this.indexOffset=n,this.vertexCount=i,this.indexCount=r,this.texture=null}return n.prototype.init=function(t){},n.prototype.isCompatible=function(t){return!0},n.prototype.update=function(t,n){this.texture=V(n)},n.prototype.buildUnit=function(n){var i=this.texture||t.Texture.WHITE,r=i.baseTexture;if(r!==n.baseTexture){n.baseTexture=r;var e=this.indexOffset;n.push(i,e)}},n}(),Va=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=h,c=o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new Ha(i,r,a-h,c-o),new Ht(i,r,h,o)]).init(n):null},Wa=function(t){function n(n){return void 0===n&&(n=r.LABEL),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n}(kt),Xa=function(t,n){return js.deserialize(t,n,new Wa)},Ka=function(){e[r.LABEL]=Va,n[r.LABEL]=Xa},Ya=function(t){function n(n){void 0===n&&(n=r.LINE);var i=t.call(this,n)||this;return i.gt=new so(i),i}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.serialize=function(n){var i=t.prototype.serialize.call(this,n);return i[15]=this.gt.serialize(n),i},n}(Ut),Ja=function(t,n){var i=new Ya,r=js.deserialize(t,n,i);i.points.deserialize(t[15],n);var e=i.points.style,u=U.NON_SCALING_MASK|U.DOTTED_MASK|U.DASHED_MASK,s=e&u;return s&&(i.points.style&=~u,i.stroke.style|=s),r},Za=function(){e[r.LINE]=To,n[r.LINE]=Ja},qa=function(t,n,i){for(var r=3*n,e=3*(n+i);r<e;r+=3)t[r+0]=0,t[r+1]=0,t[r+2]=0},$a=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},Qa=function(t,n,i){for(var r=6*n,e=6*(n+i);r<e;r+=6)t[r+0]=0,t[r+1]=0,t[r+2]=0,t[r+3]=0,t[r+4]=0,t[r+5]=0},tc=function(t,n,i){for(var r=2*n,e=2*(n+i);r<e;r+=2)t[r+0]=0,t[r+1]=0},nc=function(t){return 12*Math.ceil(t/12)},ic=function(t,n,i,r,e,u,s,h){if(u)if(i.isStaticColor()){var o=i.getColor(0,s);if(i.isStaticAlpha()){var a=i.getAlpha(0,h);G(o,a,t,n*r,e)}else for(var c=0,f=t;c<r;c+=1,f+=n)a=i.getAlpha(c,h),G(o,a,f,n,e)}else if(i.isStaticAlpha())for(a=i.getAlpha(0,h),c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),G(o,a,f,n,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),a=i.getAlpha(c,h),G(o,a,f,n,e);else if(i.isStaticColor())o=i.getColor(0,s),G(o,0,t,n*r,e);else for(c=0,f=t;c<r;c+=1,f+=n)o=i.getColor(c,s),G(o,0,f,n,e)},rc=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e)||this;return s.pointId=-1,s.pointCount=0,s.pointCountReserved=u,s.pointSizeId=-1,s.pointOffsetId=-1,s.pointFillId=-1,s.pointStrokeId=-1,s}return _(n,t),n.prototype.isCompatible=function(t){return nc(dh(t.points))===this.pointCountReserved},n.prototype.updateLineOfAnyColorFill=function(t,n,i,r){var e=i.fill,u=e.id,s=u!==this.pointFillId,h=n.fill,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorFill||c!==this.alphaFill;(s||f)&&(this.colorFill=a,this.alphaFill=c,this.pointFillId=u,t.updateColorFills(),ic(this.vertexOffset,r,e,this.pointCountReserved,t.colorFills,o,a,c))},n.prototype.updateLineOfAnyColorStroke=function(t,n,i,r){var e=i.stroke,u=e.id,s=u!==this.pointStrokeId,h=n.stroke,o=n.visible&&h.enable,a=h.color,c=o?h.alpha:0,f=a!==this.colorStroke||c!==this.alphaStroke;(s||f)&&(this.colorStroke=a,this.alphaStroke=c,this.pointStrokeId=u,t.updateColorStrokes(),ic(this.vertexOffset,r,e,this.pointCountReserved,t.colorStrokes,o,a,c))},n}(z),ec=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=3*e,h=3*n,o=0;o<i;++o)t[s+0]=t[h+0],t[s+1]=t[h+1],t[s+2]=t[h+2],s+=3,h+=3;e+=i}},uc=function(t,n,i,r,e){for(var u=n,s=i+r,h=1;h<e;++h){for(var o=3*s,a=3*i,c=0;c<r;++c)t[o+0]=t[a+0]+u,t[o+1]=t[a+1]+u,t[o+2]=t[a+2]+u,o+=3,a+=3;u+=n,s+=r}},sc=function(t,n,i,r){for(var e=6*n,u=6*(n+i),s=1;s<r;++s)for(var h=e,o=0;o<i;++o)t[u+0]=t[h+0],t[u+1]=t[h+1],t[u+2]=t[h+2],t[u+3]=t[h+3],t[u+4]=t[h+4],t[u+5]=t[h+5],u+=6,h+=6},hc=function(t,n,i,r){for(var e=n+i,u=1;u<r;++u){for(var s=e<<1,h=n<<1,o=0;o<i;++o)t[s]=t[h],t[s+1]=t[h+1],s+=2,h+=2;e+=i}},oc=function(t,n,i,r,e,u,s){var h=n.a,o=n.b,a=n.c,c=n.d,f=e-1,l=i+f*r;if(s.isStaticX()&&s.isStaticY())for(var v=s.getX(0),b=s.getY(0);0<=f;--f){for(var d=h*(D=u[O=f<<1]+v)+a*(E=u[O+1]+b),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}else for(;0<=f;--f){var O,D,E;for(d=h*(D=u[O=f<<1]+s.getX(f))+a*(E=u[O+1]+s.getY(f)),g=o*D+c*E,m=l<<1,w=i<<1,p=0;p<r;++p)t[m]=t[w]+d,t[m+1]=t[w+1]+g,m+=2,w+=2;l-=r}},ac=function(t){return Xt(t)||null==t},cc=function(t,n,i){return Xt(n)?n:ot(n)?n(t):n?n[t%n.length]:i},fc=function(){function t(t){this.O=t,this.k=0,this.T=null,this.j=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.T!==t&&(i=!0,this.T=t),void 0!==n&&this.j!==n&&(i=!0,this.j=n),i&&(this.k+=1,this.O.updateUploaded())},t.prototype.getColor=function(t,n){return cc(t,this.T,n)},t.prototype.getAlpha=function(t,n){return cc(t,this.j,n)},t.prototype.isStaticColor=function(){return ac(this.T)},t.prototype.isStaticAlpha=function(){return ac(this.j)},t.prototype.toDirty=function(){this.k+=1},t}(),lc=function(){function t(t,n,i){this.O=t,this.k=0,this._x=null,this._y=null,this.Ph=n,this.Fh=i,this.Uh=null,this.Gh=0,this.zh=-1,this.Hh=0}return Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return this._x},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"limit",{get:function(){return this.Uh},set:function(t){this.Uh=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this._x!==t&&(i=!0,this._x=t),void 0!==n&&this._y!==n&&(i=!0,this._y=n),i&&(this.k+=1,this.O.updateUploaded())},t.prototype.getX=function(t){return cc(t,this._x,this.Ph)},t.prototype.getY=function(t){return cc(t,this._y,this.Fh)},t.prototype.getLimit=function(){var t=this.Uh;return null!=t?t:(this.updateLimitComputed(),this.Gh)},t.prototype.updateLimitComputed=function(){var t=this.k,n=this.O.length;this.zh===t&&this.Hh===n||(this.zh=t,this.Hh=n,this.Gh=Math.max(this.calcLimit(this._x,n,this.Ph),this.calcLimit(this._y,n,this.Fh)))},t.prototype.calcLimit=function(t,n,i){if(Xt(t))return Math.abs(t);if(ot(t)){if(0<n){for(var r=Math.abs(t(0)),e=1;e<n;++e)r=Math.max(r,Math.abs(t(e)));return r}return 0}if(null!=t){var u=t.length;if(0<u){for(r=t[0],e=1;e<u;++e)r=Math.max(r,Math.abs(t[e]));return r}return 0}return Math.abs(i)},t.prototype.isStaticX=function(){return ac(this._x)},t.prototype.isStaticY=function(){return ac(this._y)},t.prototype.toDirty=function(){this.k+=1},t}(),vc=function(){function t(t){this.O=t,this.k=0,this.T=null,this.j=null}return Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;void 0!==t&&this.T!==t&&(i=!0,this.T=t),void 0!==n&&this.j!==n&&(i=!0,this.j=n),i&&(this.k+=1,this.O.updateUploaded())},t.prototype.getColor=function(t,n){return cc(t,this.T,n)},t.prototype.getAlpha=function(t,n){return cc(t,this.j,n)},t.prototype.isStaticColor=function(){return ac(this.T)},t.prototype.isStaticAlpha=function(){return ac(this.j)},t.prototype.toDirty=function(){this.k+=1},t}(),bc=function(){function n(t){this.O=t,this.L=[],this.Vh=0,this.B=[],this.I=new lc(this,Y.SIZE_X,Y.SIZE_Y),this.Jt=new lc(this,0,0),this.A=new fc(t),this.Wh=new vc(t),this.k=0}return Object.defineProperty(n.prototype,"length",{get:function(){return this.L.length>>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"values",{get:function(){return this.L},set:function(t){this.set(t,void 0,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"segments",{get:function(){return this.B},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return U.NONE},set:function(t){this.set(void 0,void 0,t)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"marker",{get:function(){var t=this.R;return null==t&&(t=$.getInstance(),this.R=t),t},enumerable:!1,configurable:!0}),n.prototype.getMarker=function(){},Object.defineProperty(n.prototype,"size",{get:function(){return this.I},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"offset",{get:function(){return this.Jt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fill",{get:function(){return this.A},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"stroke",{get:function(){return this.Wh},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatter",{get:function(){return null},set:function(t){},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"formatted",{get:function(){return this},enumerable:!1,configurable:!0}),n.prototype.copy=function(t){return this.set(t.values,t.segments,t.style)},n.prototype.set=function(t,n,i){var r=!1,e=!1;if(null!=t){var u=this.L,s=this.Vh,h=t.length;if(u!==t){for(var o=Math.min(s,h),a=0;a<o;++a)u[a]=t[a];for(a=o;a<h;++a)u.push(t[a]);s!==h?(u.length=h,this.Vh=h,r=!0):e=!0}else s!==h?(this.Vh=h,r=!0):e=!0}if(r){this.k+=1;var c=this.O,f=c.uploaded;f?f.isCompatible(c)?c.updateUploaded():(c.uploaded=void 0,c.toDirty()):c.updateUploaded()}else e&&(this.k+=1,this.O.updateUploaded());return this},n.prototype.updateUploaded=function(){this.O.updateUploaded()},n.prototype.clone=function(t){return new n(t).copy(this)},n.prototype.toPoints=function(n){for(var i=[],r=this.values,e=0,u=r.length;e<u;e+=2){var s=new t.Point(r[e+0],r[e+1]);i.push(n.apply(s,s))}return i},n.prototype.serialize=function(t){return t.addResource("[]")},n.prototype.calcHitPointAbs=function(t,i,r,e,u,s,h,o,a){var c=this.formatted,f=c.length,l=c.values,v=this.I,b=this.Jt,d=0,g=f;if(h){var m=.5*v.getLimit(),w=b.getLimit(),p=n.WORK_RANGE;h(t,i,m,m,w,w,s,l,p),d=p[0],g=p[1]}for(var O=d,D=Math.min(g,f);O<D;++O){var E=O<<1,M=l[E],S=l[E+1];if(o(t,i,.5*v.getX(O),.5*v.getY(O),b.getX(O),b.getY(O),M,S,r,e,u,O,s,a))return!0}return!1},n.WORK_RANGE=[0,0],n}(),dc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(eh(n,r),ec(n,r,9,u),uh(i,r,e),uc(i,9,e,8,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof bc&&(this.updateVertexAndStep(t,n,i),this.updateLineOfAnyColorFill(t,n,i,9),this.updateLineOfAnyColorStroke(t,n,i,9),this.updateUv(t,n))},n.prototype.updateVertexAndStep=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=H(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p;if(s||a||v||d||O){this.pointId=r;var D=i.formatted;this.pointCount=D.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeStyle=p,t.updateVertices(),t.updateSteps();var E=this.pointCount,M=D.values,S=this.vertexOffset,T=t.vertices,j=t.steps,N=t.clippings,I=n.transform.internalTransform;if(0<E&&h.isStaticX()&&h.isStaticY()){var C=h.getX(0),A=h.getY(0);sh(T,S,0,0,C,A,m,w,I,ih),oc(T,I,S,9,E,M,e),hh(j,N,S,w,p,ih),sc(j,S,9,E)}else for(var R=0;R<E;++R){var y=R<<1,k=M[y]+e.getX(R),L=M[y+1]+e.getY(R),x=(C=h.getX(R),A=h.getY(R),S+9*R);sh(T,x,k,L,C,A,m,w,I,ih),hh(j,N,x,w,p,ih)}var B=S+9*E,_=9*(this.pointCountReserved-E);$a(T,B,_),Qa(j,B,_)}},n.prototype.updateUv=function(t,n){var i=V(n),r=W(i);if(i!==this.texture||r!==this.textureTransformId){this.texture=i,this.textureTransformId=r,t.updateUvs();var e=t.uvs,u=this.vertexOffset,s=X(i),h=this.pointCountReserved;0<h&&(oh(e,u,s),hc(e,u,9,h))}},n}(rc),gc=function(t,n,i,r,e,s,h,o){var a=M(n),c=4*a,f=2*a,l=n.points,v=nc(dh(l)),b=v*r,d=v*s,g=b+c,m=d+f;return t.check(i,e,g,m)?new u(t,i,e,g,m,[new o(i,e,b,d,v),new Ht(i+b,e+d,c,f)]).init(n):null},mc=function(t,n,i,r,e){return gc(t,n,i,9,r,8,0,dc)},wc=function(t){function n(){var n=t.call(this,r.LINE_OF_CIRCLES)||this;return n.gt=new bc(n),n.Xh=function(t,i,r,e,u,s,h,o,a,c,f){return n.containsPointAbs(t,i,r,e,u,s,h,o,a,c,f)},n}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Ft(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.Xh,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Ft)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.Xh,u)},n}(fh),pc=function(t,n){return js.deserialize(t,n,new wc)},Oc=function(){e[r.LINE_OF_CIRCLES]=mc,n[r.LINE_OF_CIRCLES]=pc},Dc=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(xs(n,i,r),uc(n,ys,r,24,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof bc&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,ys),this.updateLineOfAnyColorStroke(t,n,i,ys))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=n.radius,b=f!==this.sizeX||l!==this.sizeY||v!==this.radius,d=H(n),g=this.transformLocalId!==d,m=n.stroke,w=m.align,p=m.enable?m.width:0,O=m.side,D=m.style,E=this.strokeAlign!==w||this.strokeWidth!==p||this.strokeSide!==O||this.strokeStyle!==D,M=n.corner,S=M!==this.corner,T=V(n),j=W(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||b||E;if(I||g||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=v,this.transformLocalId=d,this.strokeAlign=w,this.strokeWidth=p,this.strokeSide=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||g)&&t.updateSteps(),(I||S)&&t.updateClippings(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,y=this.vertexOffset,k=t.vertices,L=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=X(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var F=h.getX(0),U=h.getY(0);Bs(k,y,0,0,F,U,w,p,v,_,ks),oc(k,_,y,ys,A,R,e),(I||g)&&(Ps(x,y,p,O,D,M,ks),sc(x,y,ys,A)),(I||S)&&(_s(L,y,M,ks),ec(L,y,ys,A)),(I||N)&&(Fs(B,y,P,ks),hc(B,y,ys,A))}else for(var G=0;G<A;++G){var z=G<<1,K=R[z]+e.getX(G),Y=R[z+1]+e.getY(G),J=(F=h.getX(G),U=h.getY(G),y+G*ys);Bs(k,J,K,Y,F,U,w,p,v,_,ks),(I||g)&&Ps(x,J,p,O,D,M,ks),(I||S)&&_s(L,J,M,ks),(I||N)&&Fs(B,J,P,ks)}var Z=this.pointCountReserved,q=y+A*ys,$=ys*(Z-A);$a(k,q,$),Qa(x,q,$),qa(L,q,$),tc(B,q,$)}},n}(rc),Ec=function(t,n,i,r,e){return gc(t,n,i,ys,r,24,0,Dc)},Mc=function(t){function n(){var n=t.call(this,r.LINE_OF_RECTANGLE_ROUNDEDS)||this;return n.gt=new bc(n),n.Xh=function(t,i,r,e,u,s,h,o,a,c,f){return n.containsPointAbs(t,i,r,e,u,s,h,o,a,c,f)},n}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Ft(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,h,e,u,s,null,this.Xh,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Ft)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.Xh,u)},n}(Ws),Sc=function(t,n){return js.deserialize(t,n,new Mc)},Tc=function(){e[r.LINE_OF_RECTANGLE_ROUNDEDS]=Ec,n[r.LINE_OF_RECTANGLE_ROUNDEDS]=Sc,As.set(r.LINE_OF_RECTANGLE_ROUNDEDS,Cs.PRIMITIVE|Cs.STROKE_SIDE|Cs.BORDER_RADIUS)},jc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=t.indices,i=this.vertexOffset,r=this.indexOffset,e=this.pointCountReserved;0<e&&(lo(n,i,r),uc(n,ho,r,oo,e))},n.prototype.update=function(t,n){var i=n.points;i instanceof bc&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,ho),this.updateLineOfAnyColorStroke(t,n,i,ho))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=H(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.side,O=g.style,D=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeSide!==p||this.strokeStyle!==O,E=V(n),M=W(E),S=E!==this.texture||M!==this.textureTransformId,T=s||a||v||D;if(T||d||S){this.pointId=r;var j=i.formatted;this.pointCount=j.length,this.pointOffsetId=u,this.pointSizeId=o,this.transformLocalId=b,this.strokeWidth=w,this.strokeAlign=m,this.strokeSide=p,this.strokeStyle=O,this.texture=E,this.textureTransformId=M,t.updateVertices(),(T||d)&&t.updateSteps(),T&&t.updateClippings(),(T||S)&&t.updateUvs();var N=this.pointCount,I=j.values,C=this.vertexOffset,A=t.vertices,R=t.clippings,y=t.steps,k=t.uvs,L=n.transform.internalTransform,x=X(E);if(0<N&&h.isStaticX()&&h.isStaticY()){var B=h.getX(0),_=h.getY(0);vo(A,C,0,0,B,_,m,w,L,ao),oc(A,L,C,ho,N,I,e),(T||d)&&(bo(C,y,w,p,O,ao),sc(y,C,ho,N)),T&&(fo(R,C,ao),ec(R,C,ho,N)),(T||S)&&(mo(k,C,x,ao),hc(k,C,ho,N))}else for(var P=0;P<N;++P){var F=P<<1,U=I[F]+e.getX(P),G=I[F+1]+e.getY(P),z=(B=h.getX(P),_=h.getY(P),C+P*ho);vo(A,z,U,G,B,_,m,w,L,ao),(T||d)&&bo(z,y,w,p,O,ao),T&&fo(R,z,ao),(T||S)&&mo(k,z,x,ao)}var K=this.pointCountReserved,Y=C+N*ho,J=ho*(K-N);$a(A,Y,J),Qa(y,Y,J),qa(R,Y,J),tc(k,Y,J)}},n}(rc),Nc=function(t,n,i,r,e){return gc(t,n,i,ho,r,oo,0,jc)},Ic=function(t){function n(){var n=t.call(this,r.LINE_OF_RECTANGLES)||this;return n.gt=new bc(n),n.Xh=function(t,i,r,e,u,s,h,o,a,c,f){return n.containsPointAbs(t,i,r,e,u,s,h,o,a,c,f)},n}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Ft(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.Xh,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Ft)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.Xh,u)},n}(Ia),Cc=function(t,n){return js.deserialize(t,n,new Ic)},Ac=function(){e[r.LINE_OF_RECTANGLES]=Nc,n[r.LINE_OF_RECTANGLES]=Cc,As.set(r.LINE_OF_RECTANGLES,Cs.PRIMITIVE|Cs.STROKE_SIDE)},Rc=22,yc=[0,0,0,0,0],kc=new t.Point,Lc=function(t,n,i){var r=3*i-1;t[++r]=n+0,t[++r]=n+1,t[++r]=n+3,t[++r]=n+1,t[++r]=n+2,t[++r]=n+3,t[++r]=n+4,t[++r]=n+5,t[++r]=n+7,t[++r]=n+5,t[++r]=n+6,t[++r]=n+7,t[++r]=n+8,t[++r]=n+9,t[++r]=n+11,t[++r]=n+9,t[++r]=n+10,t[++r]=n+11,t[++r]=n+12,t[++r]=n+13,t[++r]=n+16,t[++r]=n+13,t[++r]=n+14,t[++r]=n+16,t[++r]=n+14,t[++r]=n+15,t[++r]=n+16,t[++r]=n+12,t[++r]=n+16,t[++r]=n+19,t[++r]=n+16,t[++r]=n+17,t[++r]=n+19,t[++r]=n+17,t[++r]=n+18,t[++r]=n+19,t[++r]=n+12,t[++r]=n+19,t[++r]=n+13,t[++r]=n+19,t[++r]=n+20,t[++r]=n+13,t[++r]=n+20,t[++r]=n+21,t[++r]=n+13},xc=function(t,n,i,r,e,u,s,h,o,a,c){var f=s*h,l=.5*e+(0<=e?+f:-f),v=.5*u+(0<=u?+f:-f),b=Math.sqrt(l*l+4*v*v),d=2*l*v/(l+b),g=d*o/(2*v),m=.5*(b-d)*o/b,w=g*b/(2*l),p=kc;p.set(i,r-v),a.apply(p,p);var D=p.x,E=p.y;p.set(i,r),a.apply(p,p);var M=p.x,S=p.y;p.set(i+l,r),a.apply(p,p);var T=M-D,j=S-E,N=p.x+T,I=p.y+j,C=M+(M-p.x)+T,A=S+(S-p.y)+j,R=N-D,y=I-E,k=D+m*R,L=E+m*y,x=N-g*R,B=I-g*y,_=w*(C-N),P=w*(A-I),F=N+_,U=I+P,G=C-_,z=A-P,H=D-C,V=E-A,W=C+g*H,X=A+g*V,K=D-m*H,Y=E-m*V;p.set(i,r+v-d),a.apply(p,p);var J=p.x,Z=p.y,q=D+o*(J-D),$=E+o*(Z-E),Q=N+o*(J-N),tt=I+o*(Z-I),nt=C+o*(J-C),it=A+o*(Z-A),rt=M+T,et=S+j;c[0]=O(rt,et,J,Z),c[1]=w,c[2]=g,c[3]=m,c[4]=1-.5*d/v;var ut=2*n-1;t[++ut]=q,t[++ut]=$,t[++ut]=K,t[++ut]=Y,t[++ut]=D,t[++ut]=E,t[++ut]=k,t[++ut]=L,t[++ut]=Q,t[++ut]=tt,t[++ut]=x,t[++ut]=B,t[++ut]=N,t[++ut]=I,t[++ut]=F,t[++ut]=U,t[++ut]=nt,t[++ut]=it,t[++ut]=G,t[++ut]=z,t[++ut]=C,t[++ut]=A,t[++ut]=W,t[++ut]=X,t[++ut]=J,t[++ut]=Z,t[++ut]=q,t[++ut]=$,t[++ut]=k,t[++ut]=L,t[++ut]=x,t[++ut]=B,t[++ut]=Q,t[++ut]=tt,t[++ut]=F,t[++ut]=U,t[++ut]=G,t[++ut]=z,t[++ut]=nt,t[++ut]=it,t[++ut]=W,t[++ut]=X,t[++ut]=K,t[++ut]=Y},Bc=function(t,n,i,r){var e=3*n-1,u=1-r;i&it.TOP?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_RIGHT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),i&it.BOTTOM_LEFT?(t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=1,t[++e]=1):(t[++e]=u,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=u,t[++e]=0,t[++e]=1,t[++e]=1,t[++e]=0,t[++e]=u,t[++e]=1,t[++e]=0),t[++e]=0,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=u,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0,t[++e]=1,t[++e]=0,t[++e]=0},_c=function(t,n,i,r,e,u,s){for(var h=o(e),a=s[0],c=u*a,f=3*i,l=6*i-1,v=0;v<Rc;v+=1,f+=3)t[++l]=r,t[++l]=h,.5<n[f+2]?(t[++l]=c,t[++l]=c,t[++l]=1+n[f],t[++l]=1+n[f+1]):(t[++l]=a,t[++l]=a,t[++l]=1+n[f],t[++l]=1+n[f+1])},Pc=function(t,n,i,r,e){var u=i.x0,s=i.x1,h=i.x2,o=i.x3,a=i.y0,c=i.y1,f=i.y2,l=i.y3,v=.5*(u+s),b=.5*(a+c),d=e[4],g=v+d*(o-u),m=b+d*(l-a),w=e[1],p=e[2],O=e[3],D=v+O*(o-v),E=b+O*(l-b),M=v+r*(g-v),S=b+r*(m-b),T=v+O*(h-v),j=b+O*(f-b),N=h+p*(v-h),I=f+p*(b-f),C=h+r*(g-h),A=f+r*(m-f),R=h+w*(o-h),y=f+w*(l-f),k=o+w*(h-o),L=l+w*(f-l),x=o+r*(g-o),B=l+r*(m-l),_=o+p*(v-o),P=l+p*(b-l),F=2*n-1;t[++F]=M,t[++F]=S,t[++F]=D,t[++F]=E,t[++F]=v,t[++F]=b,t[++F]=T,t[++F]=j,t[++F]=C,t[++F]=A,t[++F]=N,t[++F]=I,t[++F]=h,t[++F]=f,t[++F]=R,t[++F]=y,t[++F]=x,t[++F]=B,t[++F]=k,t[++F]=L,t[++F]=o,t[++F]=l,t[++F]=_,t[++F]=P,t[++F]=g,t[++F]=m,t[++F]=M,t[++F]=S,t[++F]=T,t[++F]=j,t[++F]=N,t[++F]=I,t[++F]=C,t[++F]=A,t[++F]=R,t[++F]=y,t[++F]=k,t[++F]=L,t[++F]=x,t[++F]=B,t[++F]=_,t[++F]=P,t[++F]=D,t[++F]=E},Fc=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,e,u)||this;return s.radius=NaN,s.corner=NaN,s}return _(n,t),n.prototype.init=function(t){t.updateIndices();var n=this.vertexOffset,i=this.indexOffset,r=this.pointCountReserved;0<r&&(Lc(t.indices,n,i),uc(t.indices,Rc,i,15,r))},n.prototype.update=function(t,n){var i=n.points;i instanceof bc&&(this.updateVertexClippingStepAndUv(t,n,i),this.updateLineOfAnyColorFill(t,n,i,Rc),this.updateLineOfAnyColorStroke(t,n,i,Rc))},n.prototype.updateVertexClippingStepAndUv=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=n.radius,d=b!==this.radius,g=H(n),m=this.transformLocalId!==g,w=n.stroke,p=w.align,O=w.enable?w.width:0,D=w.style,E=this.strokeAlign!==p||this.strokeWidth!==O||this.strokeStyle!==D,M=n.corner,S=this.corner!==M,T=V(n),j=W(T),N=T!==this.texture||j!==this.textureTransformId,I=s||a||v||d||E;if(I||m||S||N){this.pointId=r;var C=i.formatted;this.pointCount=C.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.radius=b,this.transformLocalId=g,this.strokeAlign=p,this.strokeWidth=O,this.strokeStyle=D,this.corner=M,this.texture=T,this.textureTransformId=j,t.updateVertices(),(I||S)&&t.updateClippings(),(I||m||S)&&t.updateSteps(),(I||N)&&t.updateUvs();var A=this.pointCount,R=C.values,y=this.vertexOffset,k=t.vertices,L=t.clippings,x=t.steps,B=t.uvs,_=n.transform.internalTransform,P=X(T);if(0<A&&h.isStaticX()&&h.isStaticY()){var F=h.getX(0),U=h.getY(0);xc(k,y,0,0,F,U,p,O,b,_,yc),oc(k,_,y,Rc,A,R,e),(I||S)&&(Bc(L,y,M,b),ec(L,y,Rc,A)),(I||m||S)&&(_c(x,L,y,O,D,b,yc),sc(x,y,Rc,A)),(I||N)&&(Pc(B,y,P,b,yc),hc(B,y,Rc,A))}else for(var G=0;G<A;++G){var z=G<<1,K=R[z]+e.getX(G),Y=R[z+1]+e.getY(G),J=(F=h.getX(G),U=h.getY(G),y+G*Rc);xc(k,J,K,Y,F,U,p,O,b,_,yc),(I||S)&&Bc(L,J,M,b),(I||m||S)&&_c(x,L,J,O,D,b,yc),(I||N)&&Pc(B,J,P,b,yc)}var Z=this.pointCountReserved,q=y+A*Rc,$=Rc*(Z-A);$a(k,q,$),Qa(x,q,$),qa(L,q,$),tc(B,q,$)}},n}(rc),Uc=function(t,n,i,r,e){return gc(t,n,i,Rc,r,15,0,Fc)},Gc=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v,b,d,g){var m=u+f*(h-u)-r,w=s+f*(o-s)-e,p=Math.sqrt(m*m+w*w),O=1e-5;if(O<p){var D=1/p,E=m*D,M=w*D,S=(u+l*(a-u)-r)*D,T=(s+l*(c-s)-e)*D,j=E*T-S*M;if(O<Math.abs(j)){var N=1/j,I=n-r,C=i-e;if(function(t,n,i,r,e,u,s){if(t.fill.enable){if(n*n+i*i<=r*r)return!0}else if(0<u){var h=n*n+i*i;if(h<=r*r){var o=Math.max(0,r*(1-u*s/e));if(o*o<=h)return!0}}return!1}(t,(+T*I-S*C)*N,(-M*I+E*C)*N,p,v*b,d,g))return!0}}return!1},zc=function(t,n,i,r,e,u,s){var h=2*e/r;if(_t(n,i,h,-e,+e)){var o=Math.sqrt(r*r+4*e*e),a=2*r*e/(r+o),c=t.radius,f=e-a,l=-e,v=+r,b=+e,d=-v,g=+b,m=0+0*c,w=l+c*(f-l),p=v+c*(0-v),O=b+c*(f-b),D=+O,E=-p,M=-h*n+w-i<=0,S=+h*n+w-i<=0,T=i<=O,j=t.corner;if(!M&&!S&&j&it.TOP){var N=.5*(o-a)*c/o;if(Gc(t,n,i,m,w,0,l,d,g,v,b,N,N,a,c,u,s))return!0}else if(!M&&!T&&j&it.BOTTOM_LEFT){if(Gc(t,n,i,E,D,d,g,v,b,0,l,(I=a*c/(2*e))*o/(2*r),I,a,c,u,s))return!0}else if(!S&&!T&&j&it.BOTTOM_RIGHT){var I;if(Gc(t,n,i,p,O,v,b,0,l,d,g,I=a*c/(2*e),I*o/(2*r),a,c,u,s))return!0}else{if(t.fill.enable)return!0;if(0<u){var C=u*s,A=e-a,R=A+(-e-A)*Math.max(0,a-C)/a;if(!_t(n,i,h,R,e-C))return!0}}}return!1},Hc=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE_ROUNDED),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&zc(this,n,i,r,e,u,s)},n}(kt),Vc=function(t){function n(){var n=t.call(this,r.LINE_OF_TRIANGLE_ROUNDEDS)||this;return n.gt=new bc(n),n.Xh=function(t,i,r,e,u,s,h,o,a,c,f){return n.containsPointAbs(t,i,r,e,u,s,h,o,a,c,f)},n}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Ft(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.Xh,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Ft)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.Xh,u)},n}(Hc),Wc=function(t,n){return js.deserialize(t,n,new Vc)},Xc=function(){e[r.LINE_OF_TRIANGLE_ROUNDEDS]=Uc,n[r.LINE_OF_TRIANGLE_ROUNDEDS]=Wc,As.set(r.LINE_OF_TRIANGLE_ROUNDEDS,Cs.PRIMITIVE|Cs.STROKE_SIDE|Cs.BORDER_RADIUS)},Kc=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices();var n=t.clippings,i=t.indices,r=this.vertexOffset,e=this.indexOffset,u=this.pointCountReserved;0<u&&(Rh(n,r),ec(n,r,7,u),yh(i,r,e),uc(i,7,e,3,u))},n.prototype.update=function(t,n){var i=n.points;i instanceof bc&&(this.updateVertexStepAndUvs(t,n,i),this.updateLineOfAnyColorFill(t,n,i,7),this.updateLineOfAnyColorStroke(t,n,i,7))},n.prototype.updateVertexStepAndUvs=function(t,n,i){var r=i.id,e=i.offset,u=e.id,s=r!==this.pointId||u!==this.pointOffsetId,h=i.size,o=h.id,a=o!==this.pointSizeId,c=n.size,f=c.x,l=c.y,v=f!==this.sizeX||l!==this.sizeY,b=H(n),d=this.transformLocalId!==b,g=n.stroke,m=g.align,w=g.enable?g.width:0,p=g.style,O=this.strokeAlign!==m||this.strokeWidth!==w||this.strokeStyle!==p,D=V(n),E=W(D),M=D!==this.texture||E!==this.textureTransformId,S=s||a||v||O;if(S||d||M){this.pointId=r;var T=i.formatted;this.pointCount=T.length,this.pointOffsetId=u,this.pointSizeId=o,this.sizeX=f,this.sizeY=l,this.transformLocalId=b,this.strokeAlign=m,this.strokeWidth=w,this.strokeStyle=p,t.updateVertices(),(S||d)&&t.updateSteps(),(S||M)&&t.updateUvs();var j=this.pointCount,N=T.values,I=this.vertexOffset,C=t.vertices,A=t.steps,R=t.clippings,y=t.uvs,k=X(D),L=n.transform.internalTransform;if(0<j&&h.isStaticX()&&h.isStaticY()){var x=h.getX(0),B=h.getY(0);kh(C,I,0,0,x,B,m,w,L,Ch),oc(C,L,I,7,j,N,e),(S||d)&&(Lh(A,R,I,7,w,p,Ch),sc(A,I,7,j)),(S||M)&&(xh(y,k,I,Ch),hc(y,I,7,j))}else for(var _=0;_<j;++_){var P=_<<1,F=N[P]+e.getX(_),U=N[P+1]+e.getY(_),G=(x=h.getX(_),B=h.getY(_),I+7*_);kh(C,G,F,U,x,B,m,w,L,Ch),(S||d)&&Lh(A,R,G,7,w,p,Ch),(S||M)&&xh(y,k,G,Ch)}var z=I+7*j,K=7*(this.pointCountReserved-j);$a(C,z,K),Qa(A,z,K),tc(y,z,K)}},n}(rc),Yc=function(t,n,i,r,e){return gc(t,n,i,7,r,3,0,Kc)},Jc=function(t){function n(n){return void 0===n&&(n=r.TRIANGLE),t.call(this,n)||this}return _(n,t),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(n,i,r,e,u,s,h){return!!t.prototype.containsAbsBBox.call(this,n,i,r,e)&&Pt(this,n,i,r,e,u,s)},n}(kt),Zc=function(t){function n(){var n=t.call(this,r.LINE_OF_TRIANGLES)||this;return n.gt=new bc(n),n.Xh=function(t,i,r,e,u,s,h,o,a,c,f){return n.containsPointAbs(t,i,r,e,u,s,h,o,a,c,f)},n}return _(n,t),Object.defineProperty(n.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return(new n).copy(this)},n.prototype.containsAbs=function(t,n,i,r,e,u,s){var h=Ft(e,u,this.gt.size.getLimit());return!!this.containsAbsBBox(t,n,i+h,r+h)&&this.gt.calcHitPointAbs(t,n,e,u,s,h,null,this.Xh,null)},n.prototype.containsPointAbs=function(n,i,r,e,u,s,h,o,a,c,f){return t.prototype.containsAbs.call(this,n-h-u,i-o-s,r,e,a,c,f)},n.prototype.calcHitPoint=function(t,n,i,r,e,u){var s=this.toHitTestData(t,n),h=(i||Ft)(s.strokeWidth,s.strokeScale,this.gt.size.getLimit());return!!this.containsAbsBBox(s.x,s.y,s.width+h,s.height+h)&&this.gt.calcHitPointAbs(s.x,s.y,s.strokeWidth,s.strokeScale,s.strokeAlign,h,r,e||this.Xh,u)},n}(Jc),qc=function(t,n){return js.deserialize(t,n,new Zc)},$c=function(){e[r.LINE_OF_TRIANGLES]=Yc,n[r.LINE_OF_TRIANGLES]=qc},Qc=function(t,n,i,r){return new u(t,i,r,0,0,[new Hh(i,r)]).init(n)},tf=function(t,n){return js.deserialize(t,n,new Ts)},nf=function(){e[r.NULL]=Qc,n[r.NULL]=tf},rf=function(t,n){return js.deserialize(t,n,new Ia)},ef=function(){e[r.RECTANGLE]=Na,n[r.RECTANGLE]=rf,As.set(r.RECTANGLE,Cs.PRIMITIVE|Cs.STROKE_SIDE)},uf=function(t){function n(n,i,r,e){var u=t.call(this,n,i,r,e)||this;return u.radius=NaN,u.corner=NaN,u}return _(n,t),n.prototype.init=function(t){t.updateIndices(),Lc(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexClippingStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexClippingStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=n.radius,h=s!==this.radius,o=H(n),a=this.transformLocalId!==o,c=n.stroke,f=c.align,l=c.enable?c.width:0,v=c.style,b=this.strokeAlign!==f||this.strokeWidth!==l||this.strokeStyle!==v,d=n.corner,g=d!==this.corner,m=V(n),w=W(m),p=m!==this.texture||w!==this.textureTransformId,O=u||h||b;if(O||a||g||p){this.sizeX=r,this.sizeY=e,this.radius=s,this.transformLocalId=o,this.strokeAlign=f,this.strokeWidth=l,this.strokeStyle=v,this.corner=d,this.texture=m,this.textureTransformId=w;var D=this.vertexOffset;t.updateVertices(),xc(t.vertices,D,0,0,r,e,f,l,s,n.transform.internalTransform,yc),(h||g)&&(t.updateClippings(),Bc(t.clippings,D,d,s)),(O||a||g)&&(t.updateSteps(),_c(t.steps,t.clippings,D,l,v,n.radius,yc)),(O||p)&&(t.updateUvs(),Pc(t.uvs,D,X(m),s,yc))}},n}(z),sf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t){t.updateClippings(),t.updateIndices(),Rh(t.clippings,this.vertexOffset),yh(t.indices,this.vertexOffset,this.indexOffset)},n.prototype.update=function(t,n){this.updateVertexStepAndUv(t,n),this.updateColorFill(t,n),this.updateColorStroke(t,n)},n.prototype.updateVertexStepAndUv=function(t,n){var i=n.size,r=i.x,e=i.y,u=r!==this.sizeX||e!==this.sizeY,s=H(n),h=this.transformLocalId!==s,o=n.stroke,a=o.align,c=o.enable?o.width:0,f=o.style,l=this.strokeAlign!==a||this.strokeWidth!==c||this.strokeStyle!==f,v=V(n),b=W(v),d=v!==this.texture||b!==this.textureTransformId,g=u||l;if(g||h||d){this.sizeX=r,this.sizeY=e,this.transformLocalId=s,this.strokeAlign=a,this.strokeWidth=c,this.strokeStyle=f,this.texture=v,this.textureTransformId=b;var m=this.vertexOffset;t.updateVertices(),kh(t.vertices,m,0,0,r,e,a,c,n.transform.internalTransform,Ch),(g||h)&&(t.updateSteps(),Lh(t.steps,t.clippings,m,7,c,f,Ch)),(g||d)&&(t.updateUvs(),xh(t.uvs,X(v),m,Ch))}},n}(z),hf=function(t,n){return n?Ms.toImageElement(t).then((function(t){var n=Kr.getInstance().init();n.updateTexture(t),n.render();var i=document.createElement("canvas");return n.read(i),hf(i.toDataURL(),!1)})):Ms.toImageElement(t).then((function(t){return new Ga(t)}))},of=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=Rc+h,c=15+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new uf(i,r,a-h,c-o),new Ht(i+Rc,r+15,h,o)]).init(n):null},af=function(t,n,i,r,e){var s=M(n),h=4*s,o=2*s,a=7+h,c=3+o;return t.check(i,r,a,c)?new u(t,i,r,a,c,[new sf(i,r,a-h,c-o),new Ht(i+7,r+3,h,o)]).init(n):null},cf=function(t,n){return js.deserialize(t,n,new Ws)},ff=function(t,n){return js.deserialize(t,n,new Hc)},lf=function(t,n){return js.deserialize(t,n,new Jc)},vf=function(t){function n(n){return void 0===n&&(n=r.RECTANGLE_PIVOTED),t.call(this,n)||this}return _(n,t),n.prototype.toHitTestData=function(n,i){var r=t.prototype.toHitTestData.call(this,n,i);return r.x-=r.width,r.y-=r.height,r},n}(Ia),bf=function(t,n){return js.deserialize(t,n,new vf)},df=function(){e[r.RECTANGLE_ROUNDED]=Gs,n[r.RECTANGLE_ROUNDED]=cf,As.set(r.RECTANGLE_ROUNDED,Cs.PRIMITIVE|Cs.STROKE_SIDE|Cs.BORDER_RADIUS)},gf=function(){e[r.TRIANGLE]=af,n[r.TRIANGLE]=lf},mf=function(){e[r.TRIANGLE_ROUNDED]=of,n[r.TRIANGLE_ROUNDED]=ff,As.set(r.TRIANGLE_ROUNDED,Cs.PRIMITIVE|Cs.STROKE_SIDE|Cs.BORDER_RADIUS)},wf=function(){Is(),nh(),vh(),xo(),da(),Ta(),Da(),Ra(),e[r.IMAGE_SDF]=Ua,n[r.IMAGE_SDF]=za,Ka(),Za(),nf(),e[r.RECTANGLE_PIVOTED]=_o,n[r.RECTANGLE_PIVOTED]=bf,As.set(r.RECTANGLE_PIVOTED,Cs.PRIMITIVE|Cs.STROKE_SIDE),df(),ef(),mf(),gf(),Oc(),Tc(),Ac(),Xc(),$c()},pf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DImage"},n}(Ie),Of=function(t){function n(n){var i,r=t.call(this,n)||this;return r.At=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:null,r}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.initOnClick(n)},n.prototype.initOnClick=function(t){var n=this;zi.onClick(this,(function(t){n.state.isActionable&&n.onSelect(t)}))},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},set:function(t){this.At=t},enumerable:!1,configurable:!0}),n.prototype.hasSelection=function(t){return t&&t.selection&&t.selection.add},n.prototype.getSelection=function(){for(var t=this.parent;t;){if(this.hasSelection(t))return t.selection;t=t.parent}return null},n.prototype.onSelect=function(t){this.emit("select",this);var n=this.getSelection();n&&n.add(this)},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},n.prototype.getType=function(){return"DMenuItemBase"},n}(pf),Df=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getContext=function(){for(var t=this.parent;t;){if(t.getContext)return t.getContext();t=t.parent}return null},n.prototype.getCloseable=function(){for(var t=this.parent;t;){if(t.getCloseable)return t.getCloseable();t=t.parent}return null},n.prototype.getType=function(){return"DMenuItem"},n}(Of),Ef=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.initOnOver(n),this.initShortcuts(n)},n.prototype.initOnOver=function(t){var n=this;this.on(zi.over,(function(){var t=n.getContext();null!=t&&n.parent instanceof Ki&&t.trim(n.getCloseable())}))},n.prototype.initShortcuts=function(t){var n=this.Fn;if(null!=n&&0<n.length){var i=n[0],r=Kt.toString(i);this.Kh=this.createText(r),this.snippet.add(this.Kh,!0)}else this.Kh=null;this.Yh=this.theme.getShortcutTextMargin()},n.prototype.updateShortcutText=function(){var t=this.Kh,n=this.Yh;if(null!=t&&null!=n){var i=this.toRounded;t.position.set(i(this.width-n-t.width),i(.5*(this.height-t.height)))}},n.prototype.updateTextColor=function(n){t.prototype.updateTextColor.call(this,n);var i=this.Kh;if(null!=i){var r=this.theme,e=this.state;i.style.fill=r.getShortcutColor(e),i.alpha=r.getShortcutAlpha(e)}},n.prototype.updateText=function(){t.prototype.updateText.call(this),this.updateShortcutText()},n.prototype.getType=function(){return"DMenuItemText"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n);var i=this.getCloseable();null!=i&&i.emit("select",this.value,this,i)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.onSelect(n)},n}(Df),Mf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),(null==n?void 0:n.check)&&(this.state.isActive=!0)},n.prototype.getType=function(){return"DMenuItemCheck"},n.prototype.onSelect=function(n){this.state.isActive=!this.state.isActive,t.prototype.onSelect.call(this,n)},n}(Ef),Sf=function(t){return"check"in t},Tf={OPEN_LINK:0,OPEN_LINK_IN_NEW_WINDOW:1,COPY_LINK_ADDRESS:2},jf=function(){function n(){}return n.addItemCreator=function(t){this.CREATORS.push(t)},n.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},n.setMenuCreator=function(t){this.MENU_CREATOR=t},n.newItemOf=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e](i,r);if(null!=s)return s}return n?n(i,r):null},n.newItem=function(t,n){return this.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)},n.newItemsOf=function(n,i,r,e){for(var u=0,s=r.length;u<s;++u){var h=r[u];if(h instanceof t.DisplayObject)i.addChild(h);else if(null!=h){var o=n.newItem(h,e);if(null==o)throw new Error("No matching menu item creator found: "+JSON.stringify(h));i.addChild(o)}}},n.newItems=function(t,n,i){this.newItemsOf(this,t,n,i)},n.newMenu=function(t){if(null!=this.MENU_CREATOR)return this.MENU_CREATOR(t);throw new Error("Missing DMenu creator.")},n.CREATORS=[],n.CREATOR_DEFAULT=null,n}(),Nf=function(){function n(t,n){this.O=t,this.Nn=n,this.Gu=!0}return Object.defineProperty(n.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu=t},enumerable:!1,configurable:!0}),n.prototype.open=function(t){this.get().open(t)},n.prototype.get=function(){var t=this,n=this.Jh;return null==n&&(n=this.toMenu(this.Nn),this.Jh=n,n.on("select",(function(n,i,r){t.onSelect(n,i,r)}))),n},n.prototype.toMenu=function(n){return n instanceof t.DisplayObject?n:this.newMenu(n)},n.prototype.newMenu=function(t){return jf.newMenu(t)},n.prototype.onSelect=function(t,n,i){var r=this.O;switch(t){case Tf.OPEN_LINK:r.open(!1);break;case Tf.OPEN_LINK_IN_NEW_WINDOW:r.open(!0);break;case Tf.COPY_LINK_ADDRESS:r.copy()}},n}(),If={AUTO:0,THIS_WINDOW:1,NEW_WINDOW:2},Cf=function(t){var n=document.getSelection();if(n){var i=document.createRange();i.selectNodeContents(t),n.removeAllRanges(),n.addRange(i)}return n},Af=function(t){return t.clipboardData||window.clipboardData},Rf=function(t){function n(){var n=t.call(this)||this,i=document.body;return i.addEventListener("copy",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("copy",Af(t)))})),i.addEventListener("cut",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("cut",Af(t)))})),i.addEventListener("paste",(function(t){t.target===i&&(t.preventDefault(),t.stopPropagation(),n.emit("paste",Af(t)))})),n}return _(n,t),n.copy=function(t){var n=navigator.clipboard;n&&n.writeText?n.writeText(t):function(t,n){if("undefined"==typeof ClipboardEvent){var i=t.clipboardData;if(void 0!==i&&void 0!==i.setData)return i.setData("Text",n),!0}return!1}(window,t)||function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important"),n.textContent="Dummy",document.body.appendChild(n);var i=Cf(n),r=!1;if(i){var e=function(i){if(i.target===n){var e=Af(i);e.setData("text/plain",t),r=e.getData("text/plain")===t,i.preventDefault()}};document.addEventListener("copy",e);try{document.execCommand("copy")}finally{document.removeEventListener("copy",e)}i.removeAllRanges()}return document.body.removeChild(n),r}(t)||navigator.userAgent.indexOf("Edge")<0&&function(t){var n=document.createElement("div");n.setAttribute("style","-webkit-user-select: text !important");var i=document.createElement("span");i.innerText=t,(n.attachShadow?n.attachShadow({mode:"open"}):n).appendChild(i),document.body.appendChild(n);var r=Cf(n);r&&(document.execCommand("copy"),r.removeAllRanges()),document.body.removeChild(n)}(t)},n}(t.utils.EventEmitter),yf=t.interaction.InteractionEvent,kf=function(){function t(t){this.Nn=t,this.Zh=null==t?void 0:t.url,this.zn=this.toNormalizedTarget(null==t?void 0:t.target),this.qh=null==t?void 0:t.checker,this.Gu=!0}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"url",{get:function(){return this.Zh},set:function(t){this.Zh=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"target",{get:function(){return this.zn},set:function(t){this.zn=this.toNormalizedTarget(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"checker",{get:function(){return this.qh},set:function(t){this.qh=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"menu",{get:function(){var t=this.Jh;return null==t&&(t=this.newMenu(),this.Jh=t),t},enumerable:!1,configurable:!0}),t.prototype.newMenu=function(){var n=this.Nn;if(n){var i=n.menu;if(i)return new Nf(this,i)}var r=t.MENU;return null==r&&(r=new Nf(this,K.getInstance().get("DLink").getMenuOptions()),t.MENU=r),r},t.prototype.toStringifiedUrl=function(t,n){var i=ot(t)?t():t;null!=i&&(at(i)?n(i):i.then((function(t){null!=t&&n(t)})))},t.prototype.toNormalizedUrl=function(n){var i=t.ANCHOR_ELEMENT||document.createElement("a");return t.ANCHOR_ELEMENT=i,i.href=n,i.href},t.prototype.toNormalizedTarget=function(t){return di(null!=t?t:If.AUTO,If)},t.prototype.copy=function(){var t=this;this.toStringifiedUrl(this.Zh,(function(n){Rf.copy(t.toNormalizedUrl(n))}))},t.prototype.open=function(t){var n=this;this.toStringifiedUrl(this.Zh,(function(i){var r=!0===t||!1===t?t:n.inNewWindow(t);n.check(i,r,(function(){n.exec(i,r)}))}))},t.prototype.check=function(t,n,i){var r=this.qh;if(r){var e=r();!0===e?i():!1===e||e.then((function(t){t&&i()}))}else i()},t.prototype.exec=function(t,n){if(n){var i=document.createElement("a");i.href=t,i.target="_blank",i.style.display="none",i.rel="noopener noreferrer",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),100)}else window.location.href=t},t.prototype.inNewWindow=function(t){switch(this.zn){case If.NEW_WINDOW:return!0;case If.THIS_WINDOW:return!1;case If.AUTO:if(null!=t){var n=t instanceof yf?t.data.originalEvent:t;return n.ctrlKey||n.shiftKey||n.altKey||n.metaKey||"button"in n&&0!==n.button}return!1}},t.prototype.add=function(t,n){var i=this;zi.onClick(t,(function(r,e){i.onClick(t,e)||n(r)}))},t.prototype.onClick=function(t,n){if(this.zn===If.AUTO&&n){var i=this.menu;if(i.enable)return this.Gu&&t.state.isActionable&&i.open(t),!0}return!this.Gu||!t.state.isActionable},t}(),Lf=function(){function t(){}return t.toStateOptions=function(t,n){if(n&&(t===If.NEW_WINDOW||"NEW_WINDOW"===t)){var i=n.state;null==i?n.state=ht.NEW_WINDOW:at(i)?i!==ht.NEW_WINDOW&&(n.state=[i,ht.NEW_WINDOW]):i.indexOf(ht.NEW_WINDOW)<0&&i.push(ht.NEW_WINDOW)}return n},t}(),xf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toLinkOptions=function(t){if(t)return{url:this.toUrl(t.url),target:t.target,checker:this.toChecker(t.checker),menu:t.menu}},n.prototype.toUrl=function(t){var n=this;return at(t)||null==t?t:function(){return t(n)}},n.prototype.toChecker=function(t){var n=this;if(null!=t)return function(){return t(n)}},n.prototype.init=function(n){this.$h=new kf(this.toLinkOptions(n)),t.prototype.init.call(this,Lf.toStateOptions(null==n?void 0:n.target,n))},Object.defineProperty(n.prototype,"link",{get:function(){return this.$h},enumerable:!1,configurable:!0}),n.prototype.initOnClick=function(t){var n=this;this.$h.add(this,(function(t){return n.onSelect(t)}))},n.prototype.getType=function(){return"DMenuItemLink"},n.prototype.onSelect=function(n){t.prototype.onSelect.call(this,n),this.$h.open(n)},n.prototype.open=function(t){this.$h.open(t)},n.prototype.onShortcut=function(n){t.prototype.onShortcut.call(this,n),this.onSelect(n)},n}(Ef),Bf=function(t){return"url"in t},_f=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t),this.initHover(t)},i.prototype.initHover=function(t){var n=this;this.on(zi.over,(function(){n.state.isActionable&&n.open()}))},i.prototype.toMenu=function(n){var i=null==n?void 0:n.menu;return i instanceof t.DisplayObject?i:this.newMenu(i)},i.prototype.newMenu=function(t){return jf.newMenu(t)},Object.defineProperty(i.prototype,"menu",{get:function(){var t=this,n=this.Jh;return null==n&&((n=this.toMenu(this.Nn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Jh=n),n},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DMenuItemMenu"},i.prototype.open=function(){var t=this.menu;t.isHidden()&&this.onOpen(t)},i.prototype.onOpen=function(t){var n=this.getContext();null!=n&&t.open(this,this.getCloseable(),n)},i.prototype.close=function(){this.menu.close()},i.prototype.toggle=function(){var t=this.menu;t.isHidden()?this.onOpen(t):t.close()},i.prototype.onSelect=function(t){this.open(),n.prototype.onSelect.call(this,t)},i.prototype.onMenuSelect=function(t,n,i){var r=this.getCloseable();null!=r&&r.emit("select",t,n,r)},i.prototype.onKeyDown=function(t){return Kt.isArrowRightKey(t)&&this.onKeyDownArrowRight(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyDownArrowRight=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},i}(Df),Pf=function(t){return"menu"in t},Ff=function(n,i){var r=n.menu;return r instanceof t.DisplayObject||(null==r.sticky&&(r.sticky=i),null==r.align&&(r.align=ke.RIGHT)),n},Uf=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){var r=t.state,e=t.border,u=e.getWidth(r),s=e.getColor(r);if(null!=s){var h=e.getAlpha(r),o=e.getAlign(r),a=t.padding,c=.5*i;this.clear(),this.lineStyle(u,s,h,o),this.moveTo(a.getLeft(),c),this.lineTo(n-a.getRight(),c),this.visible=!0}else this.clear(),this.visible=!1},n}(t.Graphics),Gf=function(t){return"separator"in t},zf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){new Uf(this)},n.prototype.getType=function(){return"DMenuItemSeparator"},n}(Of),Hf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemSpace"},n}(ze),Vf=function(t){return"space"in t},Wf=function(){jf.addItemCreator((function(t){return Sf(t)?new Mf(t):null})),jf.addItemCreator((function(t){return Bf(t)?new xf(t):null})),jf.addItemCreator((function(t,n){return Pf(t)?new _f(Ff(t,n)):null})),jf.addItemCreator((function(t){return Gf(t)?new zf(t):null})),jf.addItemCreator((function(t){return Vf(t)?new Hf(t):null})),jf.setItemCreatorDefault((function(t){return new Ef(t)}))},Xf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableBody"},n}(Xe),Kf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuItemExpandableHeader"},n}(Of),Yf=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return jf.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||jf.newItem(t,n)},t.newItems=function(t,n,i){jf.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),Jf=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i,r=this;n.prototype.init.call(this,t);var e=this.theme,u=this.toHeader(e,t);this.Qh=u,u.on("select",(function(){r.toggle()})),this.addChild(u);var s=this.toBody(e,t);this.no=s;var h=null!==(i=null==t?void 0:t.sticky)&&void 0!==i&&i;this.newItems(s,h,e,t),this.addChild(s),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.newItems=function(t,n,i,r){var e=null==r?void 0:r.items;null!=e&&Yf.newItems(t,e,n)},i.prototype.toHeader=function(n,i){return i?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new Kf(n)},i.prototype.toBody=function(n,i){var r=null==i?void 0:i.body;return r?r instanceof t.DisplayObject?r:this.newBody(n,r):this.newBody(n)},i.prototype.newBody=function(t,n){return new Xf(n)},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.no;t instanceof Ki?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.no;t instanceof Ki?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.onKeyDown=function(t){if(Kt.isArrowRightKey(t))this.state.isActionable&&!this.state.isActive&&(i=this.Qh)instanceof Ki&&i.state.isFocused&&(this.state.isActive=!0);else if(Kt.isArrowLeftKey(t)){var i;if(this.state.isActionable&&this.state.isActive)return(i=this.Qh)instanceof Ki?i.focus():this.focus(),this.state.isActive=!1,n.prototype.onKeyDown.call(this,t),!0}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuItemExpandable"},i}(Xe),Zf=function(t){return"header"in t},qf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemCheck"},n}(Mf),$f=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemLink"},n}(xf),Qf=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSeparator"},n}(zf),tl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemSpace"},n}(Hf),nl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemText"},n}(Ef),il=function(){jf.addItemCreator((function(t){return Zf(t)?new Jf(t):null})),Yf.addItemCreator((function(t){return Sf(t)?new qf(t):null})),Yf.addItemCreator((function(t){return Bf(t)?new $f(t):null})),Yf.addItemCreator((function(t){return Gf(t)?new Qf(t):null})),Yf.addItemCreator((function(t){return Vf(t)?new tl(t):null})),Yf.setItemCreatorDefault((function(t){return new nl(t)}))},rl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemCheck"},n}(Mf),el=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemLink"},n}(xf),ul=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initHover=function(t){},n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=t.prototype.getSelection.call(this);e&&e.add(i)},n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getSelection=function(){return null},n.prototype.getType=function(){return"DMenuSidedItemMenu"},n}(_f),sl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(zf),hl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSpace"},n}(Hf),ol=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemText"},n}(Ef),al=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return jf.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||jf.newItem(t,n)},t.newItems=function(t,n,i){jf.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),cl=function(){al.setItemCreatorDefault((function(t){return new ol(t)})),al.addItemCreator((function(t){return Vf(t)?new hl(t):null})),al.addItemCreator((function(t){return Gf(t)?new sl(t):null})),al.addItemCreator((function(t,n){return Pf(t)?new ul(Ff(t,n)):null})),al.addItemCreator((function(t){return Bf(t)?new el(t):null})),al.addItemCreator((function(t){return Sf(t)?new rl(t):null}))},fl=function(){function t(){}return t.addItemCreator=function(t){this.CREATORS.push(t)},t.setItemCreatorDefault=function(t){this.CREATOR_DEFAULT=t},t.newItem=function(t,n){return jf.newItemOf(this.CREATORS,this.CREATOR_DEFAULT,t,n)||al.newItem(t,n)},t.newItems=function(t,n,i){jf.newItemsOf(this,t,n,i)},t.CREATORS=[],t.CREATOR_DEFAULT=null,t}(),ll=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItems=function(t,n,i,r){null!=r&&null!=r.items&&fl.newItems(t,r.items,n)},n.prototype.getType=function(){return"DMenuSidedItemExpandable"},n}(Jf),vl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemCheck"},n}(qf),bl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemLink"},n}(xf),dl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuItemExpandableItemMenu"},n}(_f),gl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(t){t.open(this,this)},n.prototype.getType=function(){return"DMenuSidedItemExpandableItemMenu"},n}(dl),ml=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemSeparator"},n}(Qf),wl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemSpace"},n}(tl),pl=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DMenuSidedItemExpandableItemText"},n}(nl),Ol=function(){al.addItemCreator((function(t){return Zf(t)?new ll(t):null})),fl.addItemCreator((function(t){return Sf(t)?new vl(t):null})),fl.addItemCreator((function(t){return Bf(t)?new bl(t):null})),fl.addItemCreator((function(t,n){return Pf(t)?new gl(Ff(t,n)):null})),fl.addItemCreator((function(t){return Gf(t)?new ml(t):null})),fl.addItemCreator((function(t){return Vf(t)?new wl(t):null})),fl.setItemCreatorDefault((function(t){return new pl(t)}))},Dl=function(){Wf(),il(),cl(),Ol()},El=function(){Dl(),wf()},Ml=function(){function t(){}return t.toIndices=function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(t[i].index);return n},t.toDepth=function(t){for(var n=0,i=t.parent;i instanceof Dt;)n+=1,i=i.parent;return n},t.toSharedParent=function(t,n){if(this.toDepth(t)<this.toDepth(n)){for(var i=t.parent;i instanceof Dt;){if(this.isParent(n,i))return i;i=i.parent}return i}for(var r=n.parent;r instanceof Dt;){if(this.isParent(t,r))return r;r=r.parent}return r},t.toOfParent=function(t,n){for(var i=t.parent;i!==n&&i instanceof Dt;)t=i,i=i.parent;return t},t.isParent=function(t,n){for(var i=t.parent;i instanceof Dt;){if(i===n)return!0;i=i.parent}return!1},t.toSelected=function(t){for(var n=t;n instanceof Dt;){if(n.selected)return n;n=n.parent}return null},t.findChildById=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.id===i)return h;if(!0===r){var o=t.findChildById(h,i,r);if(null!=o)return o}}return null},t.findChildByType=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(h.type===i)return h;if(!0===r){var o=t.findChildByType(h,i,r);if(null!=o)return o}}return null},t.findChild=function(n,i,r){for(var e=n.children,u=0,s=e.length;u<s;++u){var h=e[u];if(i(h))return h;if(!0===r){var o=t.findChild(h,i,r);if(null!=o)return o}}return null},t.findChildrenByType=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];o.type===i&&e.push(o),!0===r&&t.findChildrenByType(o,i,r,e)}return e},t.findChildren=function(n,i,r,e){e=e||[];for(var u=n.children,s=0,h=u.length;s<h;++s){var o=u[s];i(o)&&e.push(o),!0===r&&t.findChildren(o,i,r,e)}return e},t.COMPARATOR_INDEX=function(t,n){return t.index-n.index},t}(),Sl=function(){function t(){}return t.delete=function(t,n,i){for(var r=t.children,e=r.length,u=0;u<e;++u)(o=r[u]).selected?o.index=e+u:o.index=u;if(r.sort(Ml.COMPARATOR_INDEX),!0===i){for(u=e-1;0<=u;--u){if(!(o=r[u]).selected){var s=r.length-(u+1);if(0<s){var h=r.splice(u+1,s);return null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h}return null!=n&&(n.length=0),null}o.index-=e,o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(h=r.splice(0,r.length),null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),h):(null!=n&&(n.length=0),null)}for(u=e-1;0<=u;--u){var o;if(!(o=r[u]).selected)return r.length=u+1,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty(),null;o.parent=null,o.selected=!1,o.uploaded=void 0,o.onDetach()}return 0<r.length?(r.length=0,null!=n&&(n.length=0),t.onChildTransformChange(),t.toDirty()):null!=n&&(n.length=0),null},t}(),Tl=function(){function t(){}return t.from=function(t){if(at(t))return U[t];if(Xt(t))return t;if(null!=t){for(var n=U.NONE,i=0,r=t.length;i<r;++i)n|=U[t[i]];return n}return U.NONE},t}(),jl=function(){function t(){this.resources=[],this.resourceToIndex=new Map,this.data=[],this.dataToIndex=new Map,this.pieces=[],this.pieceToIndex=new Map,this.uuids=new Set,this.uuidNext=0}return t.prototype.addResource=function(t){return this.io(t,this.resources,this.resourceToIndex)},t.prototype.addData=function(t){return this.io(t,this.data,this.dataToIndex)},t.prototype.addPiece=function(t){return this.io(t,this.pieces,this.pieceToIndex)},t.prototype.addUuid=function(t){if(0!==t){var n=this.uuids;return n.has(t)?0:(n.add(t),t)}return 0},t.prototype.updateUuid=function(t){var n=this.uuids;if(0!==t)return t;var i=this.newUuid();return n.add(i),i},t.prototype.newUuid=function(){for(var t=this.uuids,n=this.uuidNext;;)if(0!==(n+=1)&&!t.has(n))return this.uuidNext=n,n},t.prototype.io=function(t,n,i){var r=i.get(t);if(null!=r)return r;var e=n.length;return n.push(t),i.set(t,e),e},t}(),Nl=function(t){function n(){var n=t.call(this)||this;return n.ro=!0,n.Gu=!0,n.I=10,n}return _(n,t),Object.defineProperty(n.prototype,"visible",{get:function(){return this.ro},set:function(t){this.ro!==t&&(this.ro=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu!==t&&(this.Gu=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.I},set:function(t){this.I!==t&&(this.I=t,this.emit("change",t,this))},enumerable:!1,configurable:!0}),n.prototype.snap=function(t,n){if(this.Gu){var i=this.I;n.set(t,Math.round(t/i)*i)}},n.prototype.reset=function(){this.Gu=!0,this.I=10,this.emit("change",this)},n.prototype.serialize=function(){return[this.Gu?1:0,this.ro?1:0,this.I]},n.prototype.deserialize=function(t){this.enable=!!t[0],2 in t?(this.visible=!!t[1],this.size=t[2]):(this.visible=!1,this.size=t[1])},n}(t.utils.EventEmitter),Il=function(){function t(){this.distance=NaN,this.result=0,this.threshold=10}return t.prototype.reset=function(t,n){this.distance=NaN,this.result=t,this.threshold=1e-4<n?10/n:10},t.prototype.set=function(t,n){var i=Math.abs(n-t);if(i<=this.threshold){var r=this.distance;(r!=r||i<r)&&(this.distance=i,this.result=n)}},t}(),Cl={HORIZONTAL:0,VERTICAL:1},Al=function(){function t(t,n){this.type=t,this.position=n}return t.prototype.serialize=function(){return[this.type,this.position]},t}(),Rl=function(t){function n(){var n=t.call(this)||this;return n.values=[],n.ro=!0,n.Gu=!0,n}return _(n,t),Object.defineProperty(n.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu!==t&&(this.Gu=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"visible",{get:function(){return this.ro},set:function(t){this.ro!==t&&(this.ro=t,this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"size",{get:function(){return this.values.length},enumerable:!1,configurable:!0}),n.prototype.add=function(t,n){null!=n?this.values.splice(n,0,t):this.values.push(t),this.emit("change",this)},n.prototype.remove=function(t){var n=this.values;0<=t&&t<n.length&&(n.splice(t,1),this.emit("change",this))},n.prototype.replace=function(t,n){var i=this.values;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.emit("change",this),r}return null},n.prototype.swap=function(t,n){if(t!==n){var i=this.values,r=i[t];i[t]=i[n],i[n]=r,this.emit("change",this)}},n.prototype.snap=function(t,n,i,r){if(this.Gu)for(var e=this.values,u=0,s=e.length;u<s;++u){var h=e[u];h.type===Cl.VERTICAL?i.set(t,h.position):r.set(n,h.position)}},n.prototype.reset=function(){this.Gu=!0,this.ro=!0,this.values.length=0,this.emit("change",this)},n.prototype.serialize=function(){for(var t=[],n=this.values,i=0,r=n.length;i<r;++i)t.push(n[i].serialize());return[this.Gu?1:0,this.ro?1:0,t]},n.prototype.deserialize=function(t){this.Gu=!!t[0],this.ro=!!t[1];var n=t[2],i=this.values;i.length=0;for(var r=0,e=n.length;r<e;++r){var u=n[r];i.push(new Al(u[0],u[1]))}this.emit("change",this)},n}(t.utils.EventEmitter),yl=1e-5,kl={NONE:0,TOP_LEFT:1,TOP_CENTER:2,TOP_RIGHT:3,MIDDLE_LEFT:4,MIDDLE_RIGHT:5,BOTTOM_LEFT:6,BOTTOM_CENTER:7,BOTTOM_RIGHT:8,ROTATION:9},Ll=function(n){function i(i){var r=n.call(this)||this;return r.gt=[new t.Point,new t.Point,new t.Point,new t.Point,new t.Point],r.eo=[new t.Point,new t.Point],r.uo=[1,1],r.so=new t.Point,r.ho=new Il,r.oo=new Il,r.ao={distance:0,scale:new t.Point},r.co=new t.Point,r.fo=new t.Rectangle,r.lo=new t.Point,r.grid=new Nl,r.target=new Rl,r.O=i,r.Gu=!0,r}return _(i,n),Object.defineProperty(i.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu!==t&&(this.Gu=t,this.emit("change",this))},enumerable:!1,configurable:!0}),i.prototype.prepare=function(t){t.updateTransform();var n=t.transform.localTransform,i=t.width,r=t.height,e=this.gt;e[0].set(0,0),e[1].set(i,0),e[2].set(i,r),e[3].set(0,r),e[4].set(.5*i,.5*r),n.apply(e[0],e[0]),n.apply(e[1],e[1]),n.apply(e[2],e[2]),n.apply(e[3],e[3]),n.apply(e[4],e[4])},i.prototype.prepareForTranslate=function(t){this.Gu&&this.prepare(t)},i.prototype.snap=function(t,n){var i=t.x,r=t.y,e=this.O.canvas,u=this.ho,s=this.oo;if(null!=e){var h=Math.max(e.scale.x,e.scale.y);u.reset(i,h),s.reset(r,h),u.set(i,0),u.set(i,e.width),s.set(r,0),s.set(r,e.height)}else u.reset(i,1),s.reset(r,1);return this.target.snap(i,r,u,s),this.grid.snap(i,u),this.grid.snap(r,s),n.x=Gu(u.distance)?NaN:u.result,n.y=Gu(s.distance)?NaN:s.result,n},i.prototype.toSnapped=function(t,n){var i=t.x,r=t.y;if(this.Gu){this.snap(t,n);var e=n.x,u=n.y;n.set(Gu(e)?i:e,Gu(u)?r:u)}else n.set(i,r);return n},i.prototype.toTranslationSnapped=function(t,n){var i=t.x,r=t.y,e=NaN,u=NaN;if(this.Gu)for(var s=this.co,h=this.gt,o=0,a=h.length;o<a;++o){var c=h[o];if(s.set(c.x+i,c.y+r),this.snap(s,s),!Gu(s.x)){var f=s.x-c.x;(Gu(e)||Math.abs(f-i)<Math.abs(e-i))&&(e=f)}if(!Gu(s.y)){var l=s.y-c.y;(Gu(u)||Math.abs(l-r)<Math.abs(u-r))&&(u=l)}}return n.x=Gu(e)?i:e,n.y=Gu(u)?r:u,n},i.prototype.prepareForRotate=function(t){},i.prototype.getGridSizeRotation=function(){return 5},i.prototype.toRadian=function(t){return t/180*Math.PI},i.prototype.toDegree=function(t){return t/Math.PI*180},i.prototype.toRotationSnapped=function(t,n){if(this.Gu){var i=this.getGridSizeRotation(),r=t+n,e=Math.round(this.toDegree(r)),u=e%90;return Math.abs(u)<=i?this.toRadian(e-u)-t:90-i<=u?this.toRadian(e+(90-u))-t:u<=-90+i?this.toRadian(e-(90+u))-t:n}return n},i.prototype.calcNormalizedVector=function(t,n,i){var r=n.x-t.x,e=n.y-t.y,u=Math.sqrt(r*r+e*e);if(yl<u){var s=1/u;i.x=r*s,i.y=e*s}else i.x=1,i.y=0;return u},i.prototype.prepareForScale=function(t,n){if(this.Gu){this.prepare(t);var i=this.gt,r=this.eo,e=this.uo;switch(n){case kl.TOP_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]),e[1]=this.calcNormalizedVector(i[3],i[0],r[1]);break;case kl.TOP_CENTER:e[0]=this.calcNormalizedVector(i[3],i[0],r[0]);break;case kl.TOP_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]),e[1]=this.calcNormalizedVector(i[2],i[1],r[1]);break;case kl.MIDDLE_LEFT:e[0]=this.calcNormalizedVector(i[1],i[0],r[0]);break;case kl.NONE:break;case kl.MIDDLE_RIGHT:e[0]=this.calcNormalizedVector(i[0],i[1],r[0]);break;case kl.BOTTOM_LEFT:e[0]=this.calcNormalizedVector(i[2],i[3],r[0]),e[1]=this.calcNormalizedVector(i[0],i[3],r[1]);break;case kl.BOTTOM_CENTER:e[0]=this.calcNormalizedVector(i[0],i[3],r[0]);break;case kl.BOTTOM_RIGHT:e[0]=this.calcNormalizedVector(i[3],i[2],r[0]),e[1]=this.calcNormalizedVector(i[1],i[2],r[1])}}},i.prototype.setScaleSnappedResult=function(t,n,i,r,e){if(yl<n&&(Gu(e.distance)||t<e.distance)){e.distance=t;var u=1+i/n;r?e.scale.x=u:e.scale.y=u}},i.prototype.calcScaleSnapped1D=function(t,n,i,r,e,u){var s=this.so;t.apply(n,s);var h=s.x,o=s.y;this.snap(s,s);var a=s.x,c=s.y;if(!Gu(a)){var f=Math.abs(i.x);if(yl<f){var l=(a-h)/i.x,v=Math.abs(l),b=(a-n.x)/i.x;this.setScaleSnappedResult(v,r,b,e,u)}}if(!Gu(c)){var d=Math.abs(i.y);if(yl<d){var g=(c-o)/i.y,m=(v=Math.abs(g),(c-n.y)/i.y);this.setScaleSnappedResult(v,r,m,e,u)}}},i.prototype.calcScaleSnappedX=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!0,e)},i.prototype.calcScaleSnappedY=function(t,n,i,r,e){this.calcScaleSnapped1D(t,n,i,r,!1,e)},i.prototype.calcScaleSnapped2D=function(t,n,i,r,e){var u=this.so;t.apply(n,u);var s=u.x,h=u.y;this.snap(u,u);var o=u.x,a=u.y;if(Gu(o)){if(Gu(a))return;o=s}else Gu(a)&&(a=h);var c=i[0].x*i[1].y-i[1].x*i[0].y;if(yl<Math.abs(c)){var f=o-s,l=a-h,v=Math.abs(f*f+l*l);if(Gu(e.distance)||v<e.distance){e.distance=v;var b=o-n.x,d=a-n.y,g=(+i[1].y*b-i[1].x*d)/c,m=(-i[0].y*b+i[0].x*d)/c;e.scale.set(1+g/r[0],1+m/r[1])}}},i.prototype.calcScaleSnappedXY=function(t,n,i,r,e,u,s){this.calcScaleSnapped2D(t,n,e,u,s),this.calcScaleSnappedX(t,r,e[0],u[0],s),this.calcScaleSnappedY(t,i,e[1],u[1],s)},i.prototype.toScaleSnapped=function(t,n,i,r){if(this.Gu){var e=this.gt,u=this.eo,s=this.uo,h=this.ao;switch(h.distance=NaN,h.scale.set(r.x,r.y),n){case kl.TOP_LEFT:this.calcScaleSnappedXY(t,e[0],e[1],e[3],u,s,h);break;case kl.TOP_CENTER:this.calcScaleSnappedY(t,e[0],u[0],s[0],h),this.calcScaleSnappedY(t,e[1],u[0],s[0],h);break;case kl.TOP_RIGHT:this.calcScaleSnappedXY(t,e[1],e[0],e[2],u,s,h);break;case kl.MIDDLE_LEFT:this.calcScaleSnappedX(t,e[0],u[0],s[0],h),this.calcScaleSnappedX(t,e[3],u[0],s[0],h);break;case kl.NONE:break;case kl.MIDDLE_RIGHT:this.calcScaleSnappedX(t,e[1],u[0],s[0],h),this.calcScaleSnappedX(t,e[2],u[0],s[0],h);break;case kl.BOTTOM_LEFT:this.calcScaleSnappedXY(t,e[3],e[2],e[0],u,s,h);break;case kl.BOTTOM_CENTER:this.calcScaleSnappedY(t,e[2],u[0],s[0],h),this.calcScaleSnappedY(t,e[3],u[0],s[0],h);break;case kl.BOTTOM_RIGHT:this.calcScaleSnappedXY(t,e[2],e[3],e[1],u,s,h)}if(!Gu(h.distance)){if(r.copyFrom(h.scale),i)switch(n){case kl.TOP_LEFT:case kl.TOP_RIGHT:case kl.BOTTOM_LEFT:case kl.BOTTOM_RIGHT:r.x=r.y=Math.max(r.x,r.y);break;case kl.TOP_CENTER:case kl.BOTTOM_CENTER:r.x=r.y;break;case kl.MIDDLE_LEFT:case kl.MIDDLE_RIGHT:r.y=r.x}return!0}}return!1},i.prototype.reset=function(){this.enable=!0,this.target.reset(),this.grid.reset()},i.prototype.serialize=function(){return[this.Gu?1:0,this.target.serialize(),this.grid.serialize()]},i.prototype.deserialize=function(t){this.enable=!!t[0],this.target.deserialize(t[1]),this.grid.deserialize(t[2])},i}(t.utils.EventEmitter),xl=function(t){function n(n,i,r){var e=t.call(this,n,i.width,i.height,0,r)||this;return e.qe=i,e}return _(n,t),n.prototype.render=function(t){var n=this.frame;t.drawImage(this.qe.canvas,n.x,n.y,n.width,n.height)},n}(Fr),Bl=function(n,i,r,e){this.id=n,this.size=i,this.color=t.utils.hex2string(r),this.height=i+2*e;var u=t.TextMetrics.measureFont(n);this.ascent=u.ascent,this.descent=u.descent},_l=function(){function n(n,i,r,e){this.k=n,this.Yi=document.createElement("canvas"),this.vo=null;var u=this.toPadding(i);this.Bn=u,this.Zr=new Bl(n,i,r,u),this.qr={},this.$r=0,this.bo=0,this.Mt=1,this.nn=1,this.do=0,this.mo=0,this._r=t.Texture.from(this.Yi,{mipmap:t.MIPMAP_MODES.OFF,resolution:e,scaleMode:t.SCALE_MODES.NEAREST});var s=this.qr;this.io(" "," ",s,5),this.io("\t"," ",s,5),this.io("...","...",s,11);for(var h=0,o=Vr.length;h<o;++h){var a=Vr[h];this.io(a,a,s,11)}}return n.prototype.toPadding=function(t){return Math.max(3,Math.ceil(.2*t))},Object.defineProperty(n.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"font",{get:function(){return this.Zr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"width",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.nn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"canvas",{get:function(){return this.Yi},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"characters",{get:function(){return this.qr},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"texture",{get:function(){return this._r},enumerable:!1,configurable:!0}),n.prototype.io=function(t,n,i,r){if(!this.isIgnored(n)){var e=i[t];if(null!=e)1&e.type||(0===e.ref&&(this.bo-=1),e.ref+=1);else{var u=this.getAdvance(n),s=this.Bn,h=Math.ceil(s+u+s),o=this.font.height;i[t]=new Xr(n,u,h,o,r),this.$r+=1,this.do+=1}}},n.prototype.isIgnored=function(t){switch(t){case"\n":case"\r":case"\v":case"\f":case"…":return!0}return!1},n.prototype.wo=function(t,n){var i=n[t];null!=i&&!(1&i.type)&&0<i.ref&&(i.ref-=1,0===i.ref&&(this.bo+=1))},n.prototype.po=function(){if(this.$r>>1<=this.bo){var t=this.qr;for(var n in t)t[n].ref<=0&&delete t[n];this.$r-=this.bo,this.do+=1,this.bo=0}},n.prototype.add=function(t,n){void 0===n&&(n=8);for(var i=this.qr,r=b.from(t);r.hasNext();){var e=r.next();this.io(e,e,i,n)}},n.prototype.remove=function(t){for(var n=this.qr,i=b.from(t);i.hasNext();)this.wo(i.next(),n)},n.prototype.get=function(t){return this.qr[t]},n.prototype.getAdvance=function(t){var n=this.getContext();return null!=n?n.measureText(t).width:0},n.prototype.getContext=function(){var t=this.vo;if(null==t){var n=this.Yi;if(null==n)return null;if(null==(t=this.vo=n.getContext("2d",{alpha:!0})))return null}var i=this.Zr;return t.font!==i.id&&(t.font=i.id,i.id=t.font,t.textAlign="left",t.textBaseline="alphabetic",t.lineWidth=0,t.lineCap="round",t.lineJoin="miter",t.miterLimit=0,t.fillStyle=i.color,t.strokeStyle="#0000ff"),t},n.prototype.update=function(){if(this.po(),this.mo<this.do){this.mo=this.do;var t=this.Yi;if(null!=t){var n=this.Zr,i=n.height,r=this.qr,e=this.Mt=this.toPowerOf2(Math.ceil(Math.sqrt(this.$r))*i),u=this.Bn,s=Math.round(.5*(i-(n.ascent+n.descent))+n.ascent),h=0,o=0;for(var a in r)e<=h+(g=r[a]).width&&(h=0,o+=i),g.x=h,g.y=o,g.origin.x=h+u,g.origin.y=o+s,h+=g.width;var c=this.nn=o+i,f=this._r.baseTexture,l=f.resolution,v=Math.ceil(e*l),b=Math.ceil(c*l);t.width=v,t.height=b;var d=this.getContext();if(null!=d){for(var a in d.save(),d.scale(l,l),d.clearRect(0,0,e,c),r){var g=r[a];d.fillText(a,g.origin.x,g.origin.y)}d.restore()}return f.setRealSize(v,b),!0}}return!1},n.prototype.getRevision=function(){return this.do},n.prototype.getRevisionUpdate=function(){return this.mo},Object.defineProperty(n.prototype,"length",{get:function(){return this.$r},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){null!=this.Yi&&(this.Yi=null);var t=this.qr;for(var n in t)delete t[n]},n.prototype.toPowerOf2=function(t){for(var n=32;n<t;)n<<=1;return n},n}(),Pl=function(t){t.update()},Fl=function(t){t.forEach(Pl)},Ul=function(t){t.update()},Gl=function(t){t.forEach(Ul)},zl=function(){function t(t){var n=this;this.Qr=new Map,this.sn=t.renderer.resolution,t.renderer.on("prerender",(function(){n.update()}))}return t.prototype.add=function(t,n,i,r){var e=this.Qr,u=e.get(t);null==u&&(u=new Map,e.set(t,u));var s=u.get(i);null==s&&(s=new _l(t,n,i,this.sn),u.set(i,s)),s.add(r)},t.prototype.remove=function(t,n,i){var r=this.Qr.get(t);if(null!=r){var e=r.get(n);null!=e&&e.remove(i)}},t.prototype.get=function(t,n){var i=this.Qr.get(t);if(null==i)return null;var r=i.get(n);return null==r?null:r},t.prototype.update=function(){this.Qr.forEach(Fl)},t.prototype.destroy=function(){var t=this.Qr;t.forEach(Gl),t.clear()},t}(),Hl=function(){function t(t,n,i){var r=this;this.instance=null,this.newInstance=t,this.options=n,null!=i&&(i.state.isActive&&setTimeout((function(){r.get()}),0),i.on("active",(function(){r.get()})))}return t.prototype.get=function(){var t=this.instance;return null==t&&(t=new this.newInstance(this.options),this.instance=t),t},t}(),Vl=function(t,n,i,r){for(var e=0,u=Math.floor(t.length/i)-1;e<=u;){var s=e+(u-e>>1),h=t[s*i+r];if(n<h)u=s-1;else{if(!(h<n))return s;e=s+1}}return Math.max(e,u)},Wl=function(t){if(null!=t){if(at(t))return t;if(Xt(t))return String(t);if("name"in t)return t.name;if("label"in t)return t.label;if("id"in t)return t.id}return""},Xl=function(){function n(t,n,i){this.Mt=t,this.Oo=n,this.Re=i,this.Do={},this.Eo="",this.Mo=0,this.So=0,this.nn=0}return Object.defineProperty(n.prototype,"width",{get:function(){return this.Mt},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ratio",{get:function(){return this.Oo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"margin",{get:function(){return this.Re},enumerable:!1,configurable:!0}),n.prototype.add=function(n,i,r,e){var u=this.Do;if(!(n in u)){var s=this.Re,h=this.Mo,o=this.So;this.Mt<=h+i?(h=0,o=this.So+this.nn+s,this.nn=r,this.So=o):this.nn=Math.max(this.nn,r),this.Mo=h+i+s,u[n]=new t.Rectangle(h,o,i,r);var a=this.Oo;return this.Eo+='<g transform="translate('+h*a+","+o*a+')">'+e+"</g>",!0}return!1},n.prototype.has=function(t){return t in this.Do},Object.defineProperty(n.prototype,"mappings",{get:function(){return this.build()},enumerable:!1,configurable:!0}),n.prototype.build=function(n){var i,r,e,u=this.To;if(null==u||(null==n?void 0:n.force)){var s=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1,h=this.Mt,o=Math.pow(2,Math.ceil(Math.log(this.So+this.nn)/Math.LN2)),a=h*s,c=o*s,f=this.Oo,l=gt('<svg width="'+a+'" height="'+c+'" viewBox="0 0 '+h*f+" "+o*f+'" xmlns="http://www.w3.org/2000/svg">'+this.Eo+"</svg>"),v=null!==(e=null==n?void 0:n.scaling)&&void 0!==e?e:t.SCALE_MODES.NEAREST,b=t.BaseTexture.from(l,{resolution:s,scaleMode:v}),d=this.Do;for(var g in u=this.To={},d)u[g]=new t.Texture(b,d[g])}return u},n}(),Kl=function(){function n(){}return n.toTexture=function(n,i,r,e){var u=n.transform.scale,s=t.RenderTexture.create({width:n.width*u.x,height:n.height*u.y,scaleMode:t.SCALE_MODES.LINEAR,resolution:i}),h=new t.Matrix(void 0,void 0,void 0,void 0,-n.position.x,-n.position.y),o=rt.getLayer(n);return o&&o.renderer.render(n,s,r,h,e),s},n.toPixels=function(t,n){var i=t.resolution,r=t.frame,e=Math.floor(r.width*i),u=Math.floor(r.height*i),s=new Uint8Array(4*e*u);n.renderTexture.bind(t);var h=n.gl;return h.readPixels(r.x*i,r.y*i,e,u,h.RGBA,h.UNSIGNED_BYTE,s),{width:e,height:u,array:s}},n.toCanvas=function(n,i,r){var e=n.width,u=n.height,s=n.array,h=new t.utils.CanvasRenderTarget(e,u,1),o=h.context.getImageData(0,0,e,u);if(r?o.data.set(s):t.Extract.arrayPostDivide(s,o.data),h.context.putImageData(o,0,0),null!=i&&1!==i){h.context.scale(i,i),h.context.drawImage(h.canvas,0,0);var a=Math.floor(e*i),c=Math.floor(u*i),f=h.context.getImageData(0,0,a,c);h.resize(a,c),h.context.putImageData(f,0,0)}return h},n.toBase64=function(t,n,i){return t.toDataURL(n,i)},n}(),Yl=function(){function t(){}return t.downloadUrl=function(t,n){var i=document.createElement("a");"download"in i?(i.href=n,i.setAttribute("download",t),i.style.display="none",document.body.appendChild(i),i.click(),setTimeout((function(){document.body.removeChild(i)}),66)):window.open(n)||(location.href=n)},t.download=function(t,n,i){var r=new Blob(!1!==i?["\ufeff",n]:[n],{type:"text/plain"}),e=window.navigator;"msSaveBlob"in e?e.msSaveBlob(r,t):this.downloadUrl(t,URL.createObjectURL(r))},t}(),Jl=function(){function t(){}return t.texture=function(t){var n,i=t.target,r=function(t){var n,i=t.target,r=t.resolution;if(null!=r){if(Xt(r))return r;var e=i.transform.scale,u=Math.max(i.width*e.x,i.height*e.y);return Math.min(1,r.size/u)}return null!==(n=window.devicePixelRatio)&&void 0!==n?n:1}(t),e=null===(n=t.transform)||void 0===n?void 0:n.update;return Kl.toTexture(i,r,t.clear,e)},t.pixels=function(t){var n=function(t){var n=t.renderer;if(n)return n;var i=t.application;if(i)return i.getLayerBase().renderer;var r=t.layer||rt.getLayer(t.target);if(r)return r.renderer;throw new Error("No renderer / application / layer found.")}(t),i=this.texture(t);try{return Kl.toPixels(i,n)}finally{i&&i.destroy()}},t.canvas=function(t){var n,i,r=this.pixels(t),e=null===(i=null===(n=t.alpha)||void 0===n?void 0:n.premultiplied)||void 0===i?void 0:i.ignore,u=function(t,n){var i=n.scale;if(null!=i){if(Xt(i))return i;var r=i.size;return Math.min(1,r/t.width,r/t.height)}}(r,t);return Kl.toCanvas(r,u,e)},t.base64=function(t){var n=this.canvas(t);try{return Kl.toBase64(n.canvas,t.format,t.quality)}finally{n&&n.destroy()}},t.file=function(t){Yl.downloadUrl(t.filename,this.base64(t))},t}(),Zl={TEXT:0,DATA_URL:1,BINARY_STRING:2,ARRAY_BUTTER:3,FILE:4},ql=function(){function t(t,n){this._u=null,this.jo=t,this.No=n}return t.prototype.open=function(){var t=this.getOrCreateInput();null!=t?t.click():this.onCancel()},t.prototype.getOrCreateInput=function(){var t=this;if("FileReader"in window&&null==this._u){var n=document.createElement("input");this._u=n,n.setAttribute("type","file"),n.setAttribute("style","display:none"),n.addEventListener("change",(function(i){t.onInputChange(n),n.value="",i.stopImmediatePropagation(),i.preventDefault()})),document.body.appendChild(n)}return this._u},t.prototype.onInputChange=function(t){var n=this,i=t.files;if(null!=i&&0<i.length){var r=i[0];if(this.jo===Zl.FILE)this.onOpen(r,r);else{var e=new FileReader;switch(e.onload=function(t){if(null!=t.target){var i=t.target;n.onOpen(i.result,r)}},e.onabort=function(t){n.onAboart(t)},this.jo){case Zl.TEXT:e.readAsText(r);break;case Zl.DATA_URL:e.readAsDataURL(r);break;case Zl.BINARY_STRING:e.readAsBinaryString(r);break;case Zl.ARRAY_BUTTER:e.readAsArrayBuffer(r);break;default:e.readAsText(r)}}}else this.onCancel()},t.prototype.onOpen=function(t,n){var i=this.No;i.emit("open",t,n,i)},t.prototype.onAboart=function(t){var n=this.No;n.emit("abort",t,n)},t.prototype.onCancel=function(){var t=this.No;t.emit("cancel",t)},t}(),$l=function(){function t(){}return t.fromRgb=function(t){var n=(16711680&t)>>16,i=(65280&t)>>8,r=255&t|0,e=Math.max(n,i,r),u=e-Math.min(n,i,r),s=0;return 0<u&&(n===e?s=60*(i-r)/u:i===e?s=60*(r-n)/u+120:r===e&&(s=60*(n-i)/u+240),s<0&&(s+=360)),[s,u/e*255,e]},t.toRgb=function(t,n,i){var r=i-n/255*i,e=i-r,u=0,s=0,h=0;return t<=60?(u=i,s=t/60*e+r,h=r):t<=120?(u=(120-t)/60*e+r,s=i,h=r):t<=180?(u=r,s=i,h=(t-120)/60*e+r):t<=240?(u=r,s=(240-t)/60*e+r,h=i):t<=300?(u=(t-240)/60*e+r,s=r,h=i):(u=i,s=r,h=(360-t)/60*e+r),(u=Math.max(0,Math.min(255,u)))<<16|(s=Math.max(0,Math.min(255,s)))<<8|Math.max(0,Math.min(255,h))},t}(),Ql=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onElementAttached=function(n,i,r){n.addEventListener("keydown",this.mr),t.prototype.onElementAttached.call(this,n,i,r)},n.prototype.onElementDetached=function(n,i,r){n.removeEventListener("keydown",this.mr),t.prototype.onElementDetached.call(this,n,i,r)},n.prototype.onInputKeyDown=function(t){Kt.isOkKey(t)&&this.qi.onEnter()},n}(wr),tv=function(){function t(){}return t.create=function(t){var n=this.Io;return t in n?t+" "+ ++n[t]:(n[t]=1,t+" 1")},t.Io={},t}(),nv=function(){function t(){}return t.toCode=function(t,n){return"rgba("+(t>>16&255)+","+(t>>8&255)+","+(255&t)+","+n+")"},t}(),iv=function(){function t(t,n,i){var r=this;this.On=!0,this.Co=new Set,this.Et=t,this.Ao=n,this.Ro=i,this.yo=null;var e=function(){r.advance(),r.update(),r.yo=window.setTimeout(e,i)};this.ko=e}return t.prototype.start=function(){return null==this.yo&&(this.yo=window.setTimeout(this.ko,this.Ao)),this},t.prototype.stop=function(){var t=this.yo;return null!=t&&(this.yo=null,clearTimeout(t)),this},t.prototype.add=function(t){return this.Co.add(t),t.state.set(this.Et,this.isOn()),this},t.prototype.remove=function(t){return!!this.Co.delete(t)&&(t.state.remove(this.Et),!0)},t.prototype.contains=function(t){return this.Co.has(t)},t.prototype.clear=function(){return this.Co.clear(),this},t.prototype.isOn=function(){return this.On},t.prototype.isOff=function(){return!this.On},t.prototype.advance=function(){return this.On=!this.On,this},t.prototype.update=function(){var t=this.isOn(),n=this.Et;return this.Co.forEach((function(i){i.state.set(n,t)})),this},t}(),rv=function(){function t(t){var n;this.Vn=null!==(n=null==t?void 0:t.duration)&&void 0!==n?n:300,this.fe=null,this.Lo=0,this.xo=null}return t.prototype.show=function(t,n){var i=this,r=this.xo;null!=r&&clearTimeout(r);var e=this.fe;if(t!==e){var u=this.Vn,s=this.Lo,h=Date.now(),o=s+u-h;!0===n||o<=0?this.update(h,t):this.xo=window.setTimeout((function(){i.update(Date.now(),t)}),o)}},t.prototype.update=function(t,n){var i=this.fe;i!==n&&(this.Lo=t,null!=i&&i.hide(),this.fe=n,null!=n&&n.show())},t.prototype.hide=function(){this.show(null)},t}(),ev=function(){function t(){this.Bo=null,this._o=0,this.Ve=null,this.Po=null}return t.prototype.getNames=function(){var t=this.Fo;return null==t&&(t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DOMMouseScroll","MozMousePixelScroll"],this.Fo=t),t},t.prototype.on=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.addEventListener(u,n,i)}},t.prototype.off=function(t,n,i){void 0===i&&(i=!1);for(var r=this.getNames(),e=r.length-1;0<=e;--e){var u=r[e];t.removeEventListener(u,n,i)}},t.prototype.getLineHeight=function(){if(null==this.Ve){var t=K.getInstance().get("DBase");this.Ve=t.getLineHeight()}return this.Ve},t.prototype.getPageHeight=function(){return null==this.Po&&(this.Po=12*this.getLineHeight()),this.Po},t.prototype.normalize=function(t){var n=0,i=0;if("detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(n=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(n=-1*i,i=0),"deltaY"in t&&(i=-1*t.deltaY),"deltaX"in t&&(n=t.deltaX),0===i&&0===n)return null;var r=Math.max(Math.abs(i),Math.abs(n)),e=Date.now();this._o+200<=e&&(this.Bo=null),this._o=e;var u="mousewheel"===t.type&&r%120==0;(!this.Bo||r<this.Bo)&&(this.Bo=r,u&&(this.Bo/=40)),u&&(r/=40,n/=40,i/=40);var s=this.Bo;r=Math.floor(r/s),n=Math[1<=n?"floor":"ceil"](n/s),i=Math[1<=i?"floor":"ceil"](i/s);var h=t.deltaMode||0;if(0!==h){var o=1===h?this.getLineHeight():this.getPageHeight();r*=o,n*=o,i*=o}return{mode:h,delta:r,deltaX:n,deltaY:i,lowest:s}},t.getInstance=function(){return null==this.INSTANCE&&(this.INSTANCE=new t),this.INSTANCE},t}(),uv=function(t){function n(n){var i,r=t.call(this)||this;return r.zn=null!==(i=null==n?void 0:n.target)&&void 0!==i?i:null,r.Xn=!1,r.rr=!1,r.Kn=null==n?void 0:n.onTime,r.Jn=null==n?void 0:n.onStart,r.Zn=null==n?void 0:n.onEnd,r}return _(n,t),Object.defineProperty(n.prototype,"target",{get:function(){return this.zn},set:function(t){this.zn=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"duration",{get:function(){return 0},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.start=function(t){void 0===t&&(t=!1),this.stop(),this.rr=!0,this.Xn=t,this.onStart(t),this.rr&&(this.onTime(t?1:0,t,0),this.rr&&(this.onTime(t?0:1,t,0),this.rr||this.onEnd(t)))},n.prototype.onStart=function(t){var n=this.Jn;null!=n&&n(t,this),this.emit("start",t,this)},n.prototype.onTime=function(t,n,i){var r=this.Kn;null!=r&&r(t,n,i,this),this.emit("time",t,n,i,this)},n.prototype.onEnd=function(t){var n=this.Zn;null!=n&&n(t,this),this.emit("end",t,this)},n.prototype.isStarted=function(){return this.rr},n.prototype.isReverse=function(){return this.Xn},n.prototype.stop=function(){this.rr=!1},n.prototype.end=function(){if(this.rr){this.rr=!1;var t=this.Xn,n=t?0:1;this.onTime(n,t,0),this.onEnd(t)}},n}(t.utils.EventEmitter),sv=function(){function t(t){var n,i,r,e;Xt(t)?(this.top=t,this.right=t,this.bottom=t,this.left=t):null!=t?(this.top=null!==(n=t.top)&&void 0!==n?n:6,this.right=null!==(i=t.right)&&void 0!==i?i:6,this.bottom=null!==(r=t.bottom)&&void 0!==r?r:6,this.left=null!==(e=t.left)&&void 0!==e?e:6):(this.top=6,this.right=6,this.bottom=6,this.left=6)}return t.prototype.getTheme=function(){throw new Error("Not supported")},t.prototype.setTheme=function(t){throw new Error("Not supported")},t.prototype.getTop=function(){return this.left},t.prototype.getRight=function(){return this.right},t.prototype.getBottom=function(){return this.bottom},t.prototype.getLeft=function(){return this.left},t.prototype.set=function(t,n,i,r){null==n?(this.top=t,this.right=t,this.bottom=t,this.left=t):null==i?(this.top=t,this.right=n,this.bottom=t,this.left=n):null==r?(this.top=t,this.right=n,this.bottom=i,this.left=n):(this.top=t,this.right=n,this.bottom=i,this.left=r)},t}(),hv=function(){function t(t){var n,i=t.root;this.Uo=i,this.Tu=t.overlay,this.Bn=new sv(null==t?void 0:t.padding);var r=100,e=100;if(t)if(null!=t.width)r=t.width,e=null!=t.height?t.height:i.getBoundingClientRect().height;else if(null!=t.height)r=i.getBoundingClientRect().width,e=t.height;else{var u;r=(u=i.getBoundingClientRect()).width,e=u.height}else r=(u=i.getBoundingClientRect()).width,e=u.height;var s=null==t?void 0:t.background,h=0,o=!0;if(null!=s){var a=s.color;null!=a&&(h=a,o=!1)}var c=t.resolution,f=null!==(n=null==t?void 0:t.antialias)&&void 0!==n&&n;this.Go={width:r,height:e,autoStart:!1,backgroundColor:h,transparent:o,resolution:c,antialias:f}}return t.prototype.getRootElement=function(){return this.Uo},t.prototype.setRootElement=function(t,n){if(this.Uo!==t&&(this.Uo=t,!1!==n)){var i=t.getBoundingClientRect(),r=this.Go;r.width=i.width,r.height=i.height}return this},t.prototype.getWidth=function(){return this.Go.width},t.prototype.setWidth=function(t){return this.Go.width=t,this},t.prototype.getHeight=function(){return this.Go.height},t.prototype.setHeight=function(t){return this.Go.height=t,this},t.prototype.getPadding=function(){return this.Bn},t.prototype.setPadding=function(t,n,i,r){var e=this.Bn;return e.left=t,e.top=n,e.right=i,e.bottom=r,this},t.prototype.getBackgroundColor=function(){return this.Go.backgroundColor},t.prototype.setBackgroundColor=function(t){return this.Go.backgroundColor=t,this},t.prototype.getAntialias=function(){return this.Go.antialias},t.prototype.setAntialias=function(t){return this.Go.antialias=t,this},t.prototype.isOverlay=function(){return this.Tu},t.prototype.getPixiApplicationOptions=function(){return this.Go},t}(),ov={NONE:0,UNSTORABLE:1,CLEAR:2},av=function(){function t(){}return t.prototype.execute=function(){return!0},t.prototype.redo=function(){throw new Error("Method not implemented.")},t.prototype.undo=function(){throw new Error("Method not implemented.")},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE|ov.CLEAR},t}(),cv=function(){function t(){}return t.prototype.execute=function(){throw new Error("Not supported")},t.prototype.redo=function(){throw new Error("Not supported")},t.prototype.undo=function(){throw new Error("Not supported")},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE},t}(),fv=function(){function t(){}return t.prototype.execute=function(){throw new Error("Not supported")},t.prototype.redo=function(){throw new Error("Not supported")},t.prototype.undo=function(){throw new Error("Not supported")},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE},t}(),lv=function(t){return!(t.getFlag()&ov.UNSTORABLE)},vv=function(t){function n(){var n=t.call(this)||this;return n.P=0,n.zo=[],n.Ho=[],n.Vo=null,n}return _(n,t),n.prototype.last=function(){var t=this.zo,n=this.Ho;return n.length<=0?0<t.length?t[t.length-1]:null:n[n.length-1]},n.prototype.push=function(t){this.Ho.push(t),this.next()},n.prototype.next=function(){var t=this;if(null==this.Vo){var n=this.Ho;if(0<n.length){var i=n.shift();if(null!=i)if(i instanceof fv){var r=this.zo;if(this.P<r.length){var e=r[r.length-1-this.P];this.P+=1,this.emit("change",this),!0===(u=e.undo())?this.onSuccess(i):!1===u?this.onFail(i):this.Vo=u.then((function(){t.onSuccess(i)}),(function(){t.onFail(i)}))}}else if(i instanceof cv)r=this.zo,0<this.P&&(e=r[r.length-this.P],this.P-=1,this.emit("change",this),!0===(u=e.redo())?this.onSuccess(i):!1===u?this.onFail(i):this.Vo=u.then((function(){t.onSuccess(i)}),(function(){t.onFail(i)})));else{var u,s=!!(i.getFlag()&ov.CLEAR),h=lv(i);if(s||h){var o=s?this.zo.length:this.P;0<o&&(this.remove(o),this.P=0,this.emit("change",this)),this.cleanup()}!0===(u=i.execute())?this.onSuccess(i):!1===u?this.onFail(i):this.Vo=u.then((function(){t.onSuccess(i)}),(function(){t.onFail(i)}))}}}},n.prototype.cleanup=function(){var t=this.zo,n=t.length-100;if(0<n)for(var i=0;i<n;++i)t[i].destroy(),t.shift()},n.prototype.remove=function(t){var n=this.zo;if(0<t){var i=Math.max(0,n.length-t);if(0<(t=n.length-i)){for(var r=i,e=n.length;r<e;++r)n[r].destroy();return n.splice(i,n.length-i),!0}}return!1},n.prototype.onSuccess=function(t){this.Vo=null,lv(t)?(this.zo.push(t),this.emit("dirty",this)):(t instanceof fv||t instanceof cv)&&this.emit("dirty",this),this.emit("change",this),this.next()},n.prototype.onFail=function(t){this.Vo=null;var n=this.Ho;t.destroy();for(var i=0,r=n.length;i<r;++i)n[i].destroy();n.length=0,this.emit("change",this)},n.prototype.size=function(){return this.zo.length},n.prototype.clear=function(){this.push(new av)},n.prototype.redo=function(){this.isRedoable()&&(this.Ho.push(new cv),this.next())},n.prototype.undo=function(){this.isUndoable()&&(this.Ho.push(new fv),this.next())},n.prototype.isRedoable=function(){return 0<this.P&&null==this.Vo},n.prototype.isUndoable=function(){return this.P<this.zo.length&&null==this.Vo},n}(t.utils.EventEmitter),bv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(t,n,i){var r=this;t.addEventListener("keydown",(function(t){r.emit("keydown",t);var e=i.get();if(null!=e)for(var u=e;null!=u;){if(r.hasOnKeyDown(u)&&u.onKeyDown(t))return;u=u.parent}if(Kt.isFocusKey(t)){var s=Kt.getFocusDirection(t),h=null!=e?i.find(e,!1,e.state.isFocusRoot||s,s):i.find(n,!1,!0,s);null!=h&&(i.focus(h),t.preventDefault(),t.stopImmediatePropagation())}})),t.addEventListener("keyup",(function(t){r.emit("keyup",t);var n=i.get();if(null!=n)for(var e=n;null!=e;){if(r.hasOnKeyUp(e)&&e.onKeyUp(t))return;e=e.parent}}))},n.prototype.hasOnKeyDown=function(t){return"onKeyDown"in t},n.prototype.hasOnKeyUp=function(t){return"onKeyUp"in t},n}(t.utils.EventEmitter),dv=function(){function t(){}return t.getKeyboardController=function(){return null==this.KEYBOARD&&(this.KEYBOARD=new bv),this.KEYBOARD},t.setKeyboardController=function(t){var n=this.KEYBOARD;return this.KEYBOARD=t,n},t.getCommandController=function(){return null==this.COMMAND&&(this.COMMAND=new vv),this.COMMAND},t.setCommandController=function(t){var n=this.COMMAND;return this.COMMAND=t,n},t.getDocumentController=function(){if(null==this.DOCUMENT)throw new Error("Not supported");return this.DOCUMENT},t.setDocumentController=function(t){var n=this.DOCUMENT;return this.DOCUMENT=t,n},t}(),gv=function(n){function i(t,i){var r=n.call(this,i.getPixiApplicationOptions())||this;return r.Wo=null,r.Xo=null,r.Nn=i,r.$=!1,r.ro=!0,r.Ko=i.isOverlay(),r.Bn=i.getPadding(),r.Yo=i.getRootElement(),r.Jo=5,r.Zo=5,r.qo=r.newElementContainer(),r.application=t,r.$o=function(){null!=r.Wo&&r.render()},r.initStage(),r.initView(),r.initRootElement(),r.initFocusHandling(),r.initResizeHandling(),r.initWheelHandling(),r.initDoubleClickHandling(),r}return _(i,n),i.prototype.newElementContainer=function(){var t=document.createElement("div");return t.setAttribute("style","position: absolute; top: 0; left: 0; width: 0; height: 0;margin: 0; padding: 0; outline: none;"),t},i.prototype.initStage=function(){var t=this.stage;t.layer=this,t.application=this.application,t.interactive=!0},i.prototype.initView=function(){var t=this.view.style;t.position="absolute",t.top="0",t.left="0",t.width="100%",t.height="100%",t.display="block",t.outline="none",t.webkitTapHighlightColor="rgba(255,255,255,0)",t.webkitUserSelect="none",t.setProperty("-khtml-user-select","none"),t.setProperty("-moz-user-select","none"),t.setProperty("-ms-user-select","none"),t.userSelect="none"},i.prototype.initRootElement=function(){var t=this,n=this.view,i=this.Ko,r=this.Yo,e=this.qo,u=i?2:0,s=r.children;if(u<s.length){var h=s[u];r.insertBefore(n,h),r.insertBefore(e,h)}else r.appendChild(n),r.appendChild(e);if(i){var o=this.stage,a=o.onChildrenChange;o.onChildrenChange=function(){t.onStageDirty(),a.call(o)}}var c=r.style;r!==document.body&&"static"===window.getComputedStyle(r).position&&(c.position="relative"),c.margin="0",c.padding="0",c.overflow="hidden"},i.prototype.initFocusHandling=function(){var t=this.view,n=this.stage,i=this.getFocusController();t.setAttribute("tabindex","0"),dv.getKeyboardController().init(t,n,i),this.renderer.plugins.interaction.on(zi.down,(function(t){null!=t.target&&t.target!==n||i.clear()}))},i.prototype.initResizeHandling=function(){var t=this,n=function(){t.onResize()};window.addEventListener("resize",n),window.addEventListener("orientationchange",n)},i.prototype.onResize=function(){var t=this.Yo.getBoundingClientRect(),n=t.width,i=t.height;this.renderer.resize(n,i);for(var r=this.Bn,e=this.stage.children,u=0,s=e.length;u<s;++u){var h=e[u];h instanceof Ki&&h.onParentResize(n,i,r)}this.update()},i.prototype.initWheelHandling=function(){var n=new t.Point,i=ev.getInstance(),r=this.renderer.plugins.interaction;i.on(this.view,(function(t){var e=t;zi.toGlobal(e,r,n);var u,s=r.hitTest(n),h=i.normalize(t);if(null!=h)for(;null!=s;){if(null!=(u=s)&&null!=u.onWheel&&s.onWheel(e,h,n)){e.preventDefault();break}s=s.parent}}))},i.prototype.initDoubleClickHandling=function(){var t=this.getFocusController(),n=this.renderer.plugins.interaction;zi.onDblClick(this.view,(function(i){var r,e=t.get();if(null!=e)for(var u=e;null!=u&&(null==(r=u)||null==r.onDblClick||!u.onDblClick(i,n));)u=u.parent}))},i.prototype.lock=function(){this.$=!0},i.prototype.unlock=function(){this.$=!1},i.prototype.update=function(){this.$||null!=this.Wo||(this.Wo=requestAnimationFrame(this.$o))},i.prototype.onStageDirty=function(){this.Ko&&(0<this.stage.children.length?this.ro||(this.ro=!0,this.view.style.display="block"):this.ro&&(this.ro=!1,this.view.style.display="none"))},i.prototype.render=function(){this.refit(),this.reflow(),this.Wo=null,n.prototype.render.call(this)},Object.defineProperty(i.prototype,"width",{get:function(){return this.screen.width},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this.screen.height},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"padding",{get:function(){return this.Bn},enumerable:!1,configurable:!0}),i.prototype.refit=function(){for(var t=this.stage.children,n=0,i=this.Jo;n<i;++n){for(var r=!1,e=0,u=t.length;e<u;++e){var s=t[e];s instanceof Ki&&(s.refit(),r=r||s.isChildrenDirty())}if(!r)break}},i.prototype.reflow=function(){for(var t=this.stage.children,n=0,i=this.Jo;n<i;++n){for(var r=!1,e=0,u=t.length;e<u;++e){var s=t[e];s instanceof Ki&&(s.reflow(),r=r||s.isDirty()||s.hasDirty())}if(!r)break}},i.prototype.getFocusController=function(){return this.application.getFocusController()},i.prototype.getRootElement=function(){return this.Yo},i.prototype.getElementContainer=function(){return this.qo},i.prototype.getDynamicFontAtlases=function(){return null==this.Xo&&(this.Xo=new zl(this)),this.Xo},i}(t.Application),mv=function(){function t(){this.ju=null}return t.prototype.focus=function(t){var n=this.ju;return n!==t?(null!=n&&(n.state.isFocused=!1),this.ju=t,this.isFocusable(t)&&(t.state.isFocused=!0),n):null},t.prototype.blur=function(t){return null!=t&&this.ju===t?(this.ju=null,t.state.isFocused=!1,t):null},t.prototype.clear=function(){return this.focus(null)},t.prototype.set=function(t,n){return n?this.focus(t):this.blur(t)},t.prototype.get=function(){return this.ju},t.prototype.findParent=function(t){for(var n=t;null!=n;){if(this.isFocusable(n))return n;n=n.parent}return null},t.prototype.find=function(t,n,i,r,e){if(r){if(null!=(o=this.findNext(t,n,i)))return o;if(this.isFocusRoot(t,e))return null;var u=t.parent;if(null!=u&&0<=(c=(a=u.children).indexOf(t))){var s=a.length;if(this.isFocusReverse(u)){for(var h=c-1;0<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=s-1;c<=h;--h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}else{for(h=c+1;h<s;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l;if(!this.isFocusRoot(u,e)&&null!=(l=this.find(u,!1,!1,!0,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findNext(a[h],!0,!0)))return l}}}else{var o;if(null!=(o=this.findPrevious(t,n,i)))return o;var a,c,f=t.parent;if(null!=f&&0<=(c=(a=f.children).indexOf(t)))if(s=a.length,this.isFocusReverse(f)){for(h=c+1;h<s;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=0;h<=c;++h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}else{for(h=c-1;0<=h;--h)if(null!=(l=this.findPrevious(a[h],!0,!0)))return l;if(!this.isFocusRoot(f,e)&&null!=(l=this.find(f,!0,!1,!1,e)))return l;for(h=s-1;c<=h;--h){var l;if(null!=(l=this.findPrevious(a[h],!0,!0)))return l}}}return null},t.prototype.findNext=function(t,n,i){if(n&&this.isFocusable(t))return t;if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=e-1;0<=u;--u)if(null!=(s=this.findNext(r[u],!0,!0)))return s}else for(u=0;u<e;++u){var s;if(null!=(s=this.findNext(r[u],!0,!0)))return s}}return null},t.prototype.findPrevious=function(t,n,i){if(i&&this.isFocusableContainer(t)&&t.visible){var r=t.children,e=r.length;if(this.isFocusReverse(t)){for(var u=0;u<e;++u)if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}else for(u=e-1;0<=u;--u){var s;if(null!=(s=this.findPrevious(r[u],!0,!0)))return s}}return n&&this.isFocusable(t)?t:null},t.prototype.isFocusable=function(t){return null!=t&&"state"in t&&t.state.inEnabled&&t.state.isFocusable&&t.visible},t.prototype.isFocusableContainer=function(t){return null!=t&&"children"in t},t.prototype.isFocusRoot=function(t,n){return t===n||null!=t&&"state"in t&&t.state.isFocusRoot&&t.visible},t.prototype.isFocusReverse=function(t){return null!=t&&"state"in t&&t.state.isFocusReverse},t}(),wv=function(){function n(n){var i,r;rt.add(this);var e=this.toRootElement(n);this.Uo=e,this.initFocusHandling(e);var u=null!==(r=null!==(i=null==n?void 0:n.resolution)&&void 0!==i?i:window.devicePixelRatio)&&void 0!==r?r:1;this.sn=u,delete t.Renderer.__plugins.accessibility,this.Nn=n;var s=this.newLayerBase(n);this.Rh=s,this.Qo=!!(null==n?void 0:n.overlay),this.Qo||(this.Tu=s)}return Object.defineProperty(n.prototype,"stage",{get:function(){return this.Rh.stage},enumerable:!1,configurable:!0}),n.prototype.getRootElement=function(){return this.Uo},n.prototype.getResolution=function(){return this.sn},n.prototype.toRootElement=function(t){var n=null==t?void 0:t.root;if(null!=n){if(!at(n))return n;var i=document.querySelector(n);if(i)return i}return document.body},n.prototype.toLayerBaseOptions=function(t){var n=this.Uo,i=this.sn;return new hv(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:t.background,resolution:i,antialias:t.antialias,overlay:!1}:{root:n,resolution:i,overlay:!1})},n.prototype.getFocusController=function(){return null==this.ta&&(this.ta=new mv),this.ta},n.prototype.initFocusHandling=function(t){var n=this,i=!1,r=function(){i||n.getFocusController().clear()};t.addEventListener("focus",(function(){i=!0}),!0),t.addEventListener("blur",(function(){i=!1,setTimeout(r,0)}),!0)},n.prototype.newLayerBase=function(t){return new gv(this,this.toLayerBaseOptions(t))},n.prototype.getLayerBase=function(){return this.Rh},n.prototype.toLayerOverlayOptions=function(t){var n=this.Uo,i=this.sn;return new hv(t?{root:n,padding:t.padding,width:t.width,height:t.height,background:{color:null},resolution:i,antialias:t.antialias,overlay:!0}:{root:n,resolution:i,overlay:!0})},n.prototype.newLayerOverlay=function(t){return new gv(this,this.toLayerOverlayOptions(t))},n.prototype.getLayerOverlay=function(){return this.Qo?(null==this.Tu&&(this.Tu=this.newLayerOverlay(this.Nn)),this.Tu):this.Rh},n.prototype.update=function(){if(!this.Qo)return this.Rh.update();this.Rh.update();var t=this.Tu;t&&t.update()},n.prototype.render=function(){if(!this.Qo)return this.Rh.render();this.Rh.render();var t=this.Tu;t&&t.render()},n}(),pv=function(){function t(t){this.zn=t,this.qt=0,this.$t=0,this.Qt=0,this.Zt=0,t instanceof Di&&(this.Kt=t.getCallback())}return t.prototype.getTheme=function(){return this.zn.getTheme()},t.prototype.setTheme=function(t){this.zn.setTheme(t)},t.prototype.getLeft=function(){return this.zn.getLeft()+this.Zt},t.prototype.adjLeft=function(t){if(this.Zt!==t){this.Zt=t;var n=this.Kt;n&&n()}},Object.defineProperty(t.prototype,"left",{get:function(){return this.zn.left},set:function(t){this.zn.left=t},enumerable:!1,configurable:!0}),t.prototype.getTop=function(){return this.zn.getTop()+this.qt},t.prototype.adjTop=function(t){if(this.qt!==t){this.qt=t;var n=this.Kt;n&&n()}},Object.defineProperty(t.prototype,"top",{get:function(){return this.zn.top},set:function(t){this.zn.top=t},enumerable:!1,configurable:!0}),t.prototype.getRight=function(){return this.zn.getRight()+this.$t},t.prototype.adjRight=function(t){if(this.$t!==t){this.$t=t;var n=this.Kt;n&&n()}},Object.defineProperty(t.prototype,"right",{get:function(){return this.zn.right},set:function(t){this.zn.right=t},enumerable:!1,configurable:!0}),t.prototype.getBottom=function(){return this.zn.getBottom()+this.Qt},t.prototype.adjBottom=function(t){if(this.Qt!==t){this.Qt=t;var n=this.Kt;n&&n()}},Object.defineProperty(t.prototype,"bottom",{get:function(){return this.zn.bottom},set:function(t){this.zn.bottom=t},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n,i,r){var e=this.zn;null==n?e.set(t):null==i?e.set(t,n):null==r?e.set(t,n,i):e.set(t,n,i,r)},t}(),Ov=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DBoard"},n}(Ki),Dv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheck"},n}(Ce),Ev=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonCheckRight"},n}(Dv),Mv=function(){function t(t,n,i,r,e){this.T=t,this.j=n,this.P=i,this.Kt=e,this.na=r}return t.prototype.set=function(t,n,i,r){this.T===t&&this.j===n&&this.P===i&&this.na===r||(this.T=t,this.j=n,this.P=i,this.na=r,this.Kt(this))},Object.defineProperty(t.prototype,"color",{get:function(){return this.T},set:function(t){this.T!==t&&(this.T=t,this.Kt(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.j},set:function(t){this.j!==t&&(this.j=t,this.Kt(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.P},set:function(t){this.P!==t&&(this.P=t,this.Kt(this))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selected",{get:function(){return this.na},set:function(t){this.na!==t&&(this.na=t,this.Kt(this))},enumerable:!1,configurable:!0}),t.prototype.toObject=function(){return{color:this.T,alpha:this.j,position:this.P}},t}(),Sv=function(t,n){return t.position-n.position},Tv=function(n){function i(){var t=n.call(this)||this,i=function(n){t.onChange(n)};t.ia=i;var r=new Mv(16777215,1,0,!1,i),e=new Mv(8421504,1,1,!0,i);return t.gt=[r,e],t.Gt=-90,t.na=e,t.ra=[0,0,0],t}return _(i,n),i.prototype.onChange=function(t){var n=t.selected&&this.na!==t;if(n){var i=this.na;null!=i&&(i.na=!1),this.na=t}this.gt.sort(Sv),n&&this.emit("selectionchange",this.na,this),this.emit("change",this)},Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"direction",{get:function(){return this.Gt},set:function(t){this.Gt!==t&&(this.Gt=t,this.emit("directionchange",t,this),this.emit("change",this))},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"selected",{get:function(){return this.na},enumerable:!1,configurable:!0}),i.prototype.size=function(){return this.gt.length},i.prototype.get=function(t){var n=this.gt;return 0<=t&&t<n.length?n[t]:null},i.prototype.addAt=function(n){for(var i=this.gt,r=null,e=0,u=i.length;e<u;++e){var s=i[e];if(n<=s.position){if(null==r)return this.add(s.color,s.alpha,n,!0);var h=s.position-r.position;if(.001<h){var o=t.utils.hex2rgb(s.color,this.ra),a=o[0],c=o[1],f=o[2],l=t.utils.hex2rgb(r.color,this.ra),v=l[0],b=l[1],d=l[2],g=(n-r.position)/h,m=a*g+v*(1-g),w=c*g+b*(1-g),p=f*g+d*(1-g),O=this.ra;O[0]=m,O[1]=w,O[2]=p;var D=t.utils.rgb2hex(O),E=s.alpha*g+r.alpha*(1-g);return this.add(D,E,n,!0)}}r=s}return null!=r?this.add(r.color,r.alpha,n,!0):this.add(16777215,1,n,!0)},i.prototype.add=function(t,n,i,r){var e=this.ia,u=new Mv(t,n,i,r,e);return this.gt.push(u),e(u),u},i.prototype.remove=function(t){var n=this.gt;if(2<n.length)for(var i=0,r=n.length;i<r;++i)if(n[i]===t){n.splice(i,1);var e=this.na===t;return e&&(this.na=i+1<r?n[i]:n[i-1]),e&&this.emit("selectionchange",this.na,this),this.emit("change",this),!0}return!1},i.prototype.reset=function(){var t=this.Gt;this.Gt=-90;var n=this.gt,i=this.na,r=i?n.indexOf(i):-1;n.length=0;var e=this.ia;if(n.push(new Mv(16777215,0,0,!1,e)),n.push(new Mv(16777215,0,1,!1,e)),0<=r&&r<n.length)(u=n[r]).na=!0,this.na=u;else if(0<n.length){var u;(u=n[n.length-1]).na=!0,this.na=u}else this.na=null;return i!==this.na&&this.emit("selectionchange",this.na,this),t!==this.Gt&&this.emit("directionchange",this.Gt,this),this.emit("change",this),this},i.prototype.toObject=function(){for(var t=[],n=this.gt,i=0,r=n.length;i<r;++i)t.push(n[i].toObject());return{points:t,direction:this.Gt}},i.prototype.fromObject=function(t){var n=this.Gt;this.Gt=t.direction;var i=this.gt,r=this.na,e=r?i.indexOf(r):-1;i.length=0;for(var u=this.ia,s=0,h=t.points.length;s<h;++s){var o=t.points[s],a=new Mv(o.color,o.alpha,o.position,!1,u);i.push(a)}return i.sort(Sv),0<=e&&e<i.length?((a=i[e]).na=!0,this.na=a):0<i.length?((a=i[i.length-1]).na=!0,this.na=a):this.na=null,r!==this.na&&this.emit("selectionchange",this.na,this),n!==this.Gt&&this.emit("directionchange",this.Gt,this),this.emit("change",this),this},i}(t.utils.EventEmitter),jv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputLabel"},n}(Ye),Nv=function(t){function n(n){var i=t.call(this,n)||this;i.addChild(i.Bu=new jv(null==n?void 0:n.label)),i.addChild(i._u=i.createInput(null==n?void 0:n.input));var r=null==n?void 0:n.space;return null!=r&&i.addChild(new ze(r)),i}return _(n,t),Object.defineProperty(n.prototype,"input",{get:function(){return this._u},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"label",{get:function(){return this.Bu},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DInputAndLabel"},n}(We),Iv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new fu(t)},n}(Nv),Cv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new bu(t)},n}(Nv),Av=function(){function t(t,n,i){this.ea=t,this.ua=n,this.sa=i}return Object.defineProperty(t.prototype,"color",{get:function(){return this.ea.color},set:function(t){if(this.ea.color!==t){var n=this.ua;null!=n&&n(t)}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alpha",{get:function(){return this.ea.alpha},set:function(t){if(this.ea.alpha!==t){var n=this.sa;null!=n&&n(t)}},enumerable:!1,configurable:!0}),t}(),Rv=function(t){function n(n,i){var r=t.call(this)||this;return r.ha=n,r.yt=i,r}return _(n,t),n.prototype.get=function(t){var n=this.ha;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.ha;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]={color:n.color,alpha:n.alpha},this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.ha,i=0,r=n.length;i<r;++i){var e=n[i];if(e.color===t.color&&e.alpha===t.alpha)return!0}return!1},n.prototype.add=function(t){var n=this.ha;return n.push({color:t.color,alpha:t.alpha}),this.yt<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.ha.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.ha.length},n}(t.utils.EventEmitter),yv=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),Object.defineProperty(i.prototype,"current",{get:function(){return this.oa},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"new",{get:function(){return this.aa},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.ca},enumerable:!1,configurable:!0}),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r),this.Rh=16711680,this.fa={color:16777215,alpha:1},this.aa=new Av(this.fa,(function(t){e.setColorNew(t)}),(function(t){e.setAlphaNew(t)})),this.fe={color:16777215,alpha:1},this.oa=new Av(this.fe,(function(t){e.setColorCurrent(t)}),(function(t){e.setAlphaCurrent(t)}));var u=this.theme,s=this.Bn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.la=new t.Point;var f=u.getMainWidth(),l=u.getMainHeight(),v=new t.Sprite(t.Texture.WHITE);this.va=v,v.x=c,v.y=h,v.width=f,v.height=l,v.interactive=!0,this.addChild(v);var b=new t.Sprite(u.getMainTexture());this.ba=b,b.x=c,b.y=h,b.tint=this.Rh,b.interactive=!1,this.addChild(b),this.da=function(t){e.onMainMove(t)},this.ga=function(t){e.onMainUp(t)},v.on(zi.down,(function(t){e.onMainDown(t)}));var d=new t.Sprite(u.getBaseTexture());this.ma=d,d.x=c,d.y=v.y+v.height+u.getBaseMargin(),d.interactive=!0,this.addChild(d),this.wa=function(t){e.onBaseMove(t)},this.pa=function(t){e.onBaseUp(t)},d.on(zi.down,(function(t){e.onBaseDown(t)}));var g=new t.Sprite(u.getAlphaCheckerboardTexture());this.Oa=g,g.x=s.getLeft(),g.y=d.y+u.getBaseHeight()+u.getBaseMargin(),g.interactive=!1,this.addChild(g);var m=new t.Sprite(u.getAlphaTexture());m.tint=this.fa.color,m.interactive=!0,g.addChild(m),this.Da=function(t){e.onAlphaMove(t)},this.Ea=function(t){e.onAlphaUp(t)},m.on(zi.down,(function(t){e.onAlphaDown(t)}));var w=new t.Sprite(u.getMainPointerTexture());this.Ma=w,w.x=c,w.y=h,w.anchor.x=.5,w.anchor.y=.5,w.tint=u.getMainPointerColor(),w.alpha=u.getMainPointerAlpha(),w.interactive=!1,this.addChild(w);var p=new t.Sprite(u.getAlphaPointerTexture());this.Sa=p,p.x=f,p.y=.5*g.height,p.tint=u.getAlphaPointerColor(),p.alpha=u.getAlphaPointerAlpha(),p.anchor.set(.5,.5),p.interactive=!1,g.addChild(p);var O=new t.Sprite(u.getBasePointerTexture());this.Ta=O,O.x=0,O.y=.5*d.height,O.tint=u.getBasePointerColor(),O.alpha=u.getBasePointerAlpha(),O.anchor.set(.5,.5),O.interactive=!1,d.addChild(O),this.ja=[];var D=this.ja,E=u.getRecentColorCount(),M=u.getRecentColorWidth(),S=u.getRecentColorHeight(),T=.5*M,j=.5*S,N=u.getRecentColorMargin(),I=g.y+u.getAlphaHeight()+u.getRecentMargin(),C=u.getRecentCheckerboardTexture();null==i.RECENT_COLORS&&(i.RECENT_COLORS=new Rv(u.getRecents().slice(0),E));var A=this.ca=i.RECENT_COLORS;A.on("change",(function(){e.onRecentChange()}));for(var R=function(n){var i=n.currentTarget;if(i instanceof t.Container){var r=i.children[0];r instanceof t.Sprite&&(e.setColorNew(r.tint),e.setAlphaNew(r.alpha))}},y=0;y<E;++y){var k=c+y*(M+N),L=new t.Sprite(C);L.x=k+T,L.y=I+j,L.anchor.x=.5,L.anchor.y=.5,L.buttonMode=!0,L.interactive=!0,zi.onClick(L,R),this.addChild(L);var x=new t.Sprite(t.Texture.WHITE),B=A.get(y);null!=B?(x.tint=B.color,x.alpha=B.alpha):(x.tint=16777215,x.alpha=0),x.width=M,x.height=S,x.anchor.x=.5,x.anchor.y=.5,x.interactive=!1,L.addChild(x),D.push(x)}var _=u.getInputMargin(),P=u.getInputLabelWidth(),F=I+S+_,U=.5*(f-_),G=new Cv({parent:this,x:c,y:F,width:U,label:{width:P,text:{value:"#"}},input:{weight:1,text:{value:"FFFFFF"},on:{input:function(t){var n=wt.fromCode(t);null!=n&&e.setColorNew(n)}}}});this.Na=G;var z=G.height,H=new Iv({parent:this,x:c,y:F+z+_,width:U,label:{width:P,text:{value:"A"}},input:{weight:1,text:{value:1},min:0,max:1,on:{input:function(t){e.setAlphaNew(t)}}}});this.Ia=H;var V=.5*(U-P-_),W=z+_+z,X=c+.5*(f-_)+_,K=F+.5*(z+_+H.height-W),Y=new t.Sprite(u.getSampleCheckerboardTexture());this.Ca=Y,Y.x=X,Y.y=K,Y.width=V,Y.height=W,Y.interactive=!1,this.addChild(Y);var J=this.fe,Z=new t.Sprite(t.Texture.WHITE);this.Aa=Z,Z.x=X,Z.y=K,Z.tint=J.color,Z.alpha=J.alpha,Z.width=V,Z.height=W,Z.interactive=!0,Z.buttonMode=!0,zi.onClick(Z,(function(){e.setColorNew(J.color),e.setAlphaNew(J.alpha)})),this.addChild(Z);var q=new t.Sprite(u.getSampleCheckerboardTexture());this.Ra=q,q.x=X+V,q.y=K,q.width=V,q.height=W,q.interactive=!1,this.addChild(q);var $=new t.Sprite(t.Texture.WHITE);this.ya=$,$.x=X+V,$.y=K,$.tint=this.fa.color,$.alpha=this.fa.alpha,$.width=V,$.height=W,$.interactive=!1,this.addChild($),null!=r&&null!=r.width||(this.width=c+f+o),null!=r&&null!=r.height||(this.height=F+G.height+_+H.height+a)},i.prototype.onMainDown=function(t){this.onMainPick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(zi.move,this.da),i.on(zi.up,this.ga)}},i.prototype.onMainMove=function(t){this.onMainPick(t.data.global)},i.prototype.onMainUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(zi.move,this.da),i.off(zi.up,this.ga)}},i.prototype.toMainHex=function(t,n,i,r){return Math.max(0,Math.min(255,255*n+i*(t>>r&255)))<<r},i.prototype.toMainColor=function(t,n,i,r,e){var u=.5*r,s=Math.max(0,Math.min(1,((n-u)*(1-i/e)+u)/r)),h=Math.max(0,Math.min(1,i/e)),o=Math.abs(.5*h-s),a=1-o-h;return this.toMainHex(t,a,o,16)|this.toMainHex(t,a,o,8)|this.toMainHex(t,a,o,0)},i.prototype.onMainPick=function(t){var n=this.la,i=this.Bn,r=i.getLeft(),e=i.getTop(),u=this.theme,s=u.getMainWidth(),h=u.getMainHeight();this.toLocal(t,void 0,n);var o=Math.max(0,Math.min(s,n.x-r)),a=Math.max(0,Math.min(h,n.y-e));this.Ma.position.set(r+o,e+a),this.onColorNew(this.toMainColor(this.Rh,o,a,s,h))},i.prototype.setColorCurrent=function(t){this.Aa.tint=this.fe.color=t},i.prototype.setAlphaCurrent=function(t){this.Aa.alpha=this.fe.alpha=t},i.prototype.setColorNew=function(t){var n=this.theme,i=n.getMainWidth(),r=n.getMainHeight(),e=this.Bn,u=$l.fromRgb(t);this.ba.tint=this.Rh=$l.toRgb(u[0],255,255),this.Ta.x=Math.max(0,Math.min(1,u[0]/360))*i;var s=Math.max(0,Math.min(1,u[1]/255)),h=Math.max(0,Math.min(1,1-u[2]/255)),o=this.Ma;o.tint=h<.45?n.getMainPointerColor():16777215,o.position.set(e.getLeft()+s*i,e.getTop()+h*r),this.onColorNew(t)},i.prototype.onColorNew=function(t){var n=rt.getLayer(this);n&&n.lock(),this.ya.tint=this.fa.color=t,this.Na.input.value=wt.toCode(t),this.emit("newcolorchange",t,this),n&&(n.unlock(),n.update())},i.prototype.onBaseDown=function(t){this.onBasePick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(zi.move,this.wa),i.on(zi.up,this.pa)}},i.prototype.onBaseMove=function(t){this.onBasePick(t.data.global)},i.prototype.onBaseUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(zi.move,this.wa),i.off(zi.up,this.pa)}},i.prototype.toBaseHex=function(t,n){return Math.max(0,Math.min(255,6*t*255))<<n},i.prototype.toBaseColor=function(t){return t<=.167?16711680+this.toBaseHex(t,8):t<=.333?(t=.333-t,65280+this.toBaseHex(t,16)):t<=.5?(t-=.333,65280+this.toBaseHex(t,0)):t<.667?(t=.667-t,255+this.toBaseHex(t,8)):t<.883?(t-=.667,255+this.toBaseHex(t,16)):(t=.883-t,16711680+this.toBaseHex(t,0))},i.prototype.onBasePick=function(t){var n=this.la,i=this.Bn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.Ta.x=e,this.onColorBase(this.toBaseColor(e/r))},i.prototype.setColorBase=function(t){var n=this.theme.getMainWidth();this.Ta.x=Math.max(0,Math.min(1,t/360))*n,this.onColorBase($l.toRgb(t,255,255))},i.prototype.onColorBase=function(t){this.ba.tint=this.Rh=t;var n=this.Ma,i=this.theme,r=i.getMainWidth(),e=i.getMainHeight(),u=this.Bn;this.onColorNew(this.toMainColor(this.Rh,n.x-u.getLeft(),n.y-u.getTop(),r,e))},i.prototype.onAlphaDown=function(t){this.onAlphaPick(t.data.global);var n=rt.getLayer(this);if(n){var i=n.stage;i.on(zi.move,this.Da),i.on(zi.up,this.Ea)}},i.prototype.onAlphaMove=function(t){this.onAlphaPick(t.data.global)},i.prototype.onAlphaUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(zi.move,this.Da),i.off(zi.up,this.Ea)}},i.prototype.onAlphaPick=function(t){var n=this.la,i=this.Bn,r=this.theme.getMainWidth();this.toLocal(t,void 0,n);var e=Math.max(0,Math.min(r,n.x-i.getLeft()));this.Sa.x=e,this.onAlphaNew(e/r)},i.prototype.setAlphaNew=function(t){var n=this.theme.getMainWidth();this.Sa.x=Math.max(0,Math.min(1,t))*n,this.onAlphaNew(t)},i.prototype.onAlphaNew=function(t){var n=rt.getLayer(this);n&&n.lock(),this.ya.alpha=this.fa.alpha=t,this.Ia.input.value=Number(t.toFixed(2)),this.emit("newalphachange",t,this),n&&(n.unlock(),n.update())},i.prototype.onRecentChange=function(){for(var t=this.ja,n=this.ca,i=0,r=t.length;i<r;++i){var e=t[i],u=n.get(i);null!=u?(e.tint=u.color,e.alpha=u.alpha):(e.tint=16777215,e.alpha=0)}},i.prototype.getType=function(){return"DPickerColor"},i.RECENT_COLORS=null,i}(Ki),kv=function(t,n){if(t.direction!==n.direction)return!1;var i=t.points,r=n.points;if(i.length!==r.length)return!1;for(var e=0,u=i.length;e<u;++e){var s=i[e],h=r[e];if(s.color!==h.color||s.alpha!==h.alpha||s.position!==h.position)return!1}return!0},Lv=function(t){function n(n,i){var r=t.call(this)||this;return r.ha=n,r.yt=i,r}return _(n,t),n.prototype.getCapacity=function(){return this.yt},n.prototype.get=function(t){var n=this.ha;return 0<=t&&t<n.length?n[n.length-1-t]:null},n.prototype.set=function(t,n){var i=this.ha;if(0<=t&&t<i.length){var r=i[i.length-1-t];return i[i.length-1-t]=n,this.emit("change",this),r}return null},n.prototype.contains=function(t){for(var n=this.ha,i=0,r=n.length;i<r;++i)if(kv(n[i],t))return!0;return!1},n.prototype.add=function(t){var n=this.ha;return n.push(t),this.yt<n.length&&n.shift(),this.emit("change",this),this},n.prototype.pop=function(){var t=this.ha.shift();return null!=t?(this.emit("change",this),t):null},n.prototype.size=function(){return this.ha.length},n}(t.utils.EventEmitter),xv=function(n){function i(i,r,e,u,s,h,o,a){var c=n.call(this,o,a)||this;return c.interactive=!0,c.interactiveChildren=!1,c.cursor="pointer",c.ka=i,c.an=r,c._uvs=e,c.La=u,c.ln=s,c.xa=-1,c.ra=[0,0,0],c.Th=new t.Point,c.Ba=h,a.uniforms.uSampler.on("update",(function(){c.update(),rt.update(c)})),c.update(),c}return _(i,n),i.prototype.getRectangle=function(t){var n=this.Ba;return 0<=t&&t<n.length?n[t].rect:null},i.prototype.setRectangle=function(t,n,i,r,e){var u=this.Ba;if(0<=t&&t<u.length){var s=u[t].rect;s.x=n,s.y=i,s.width=r,s.height=e}},i.prototype.getData=function(t){var n=this.Ba;return 0<=t&&t<n.length?n[t].data:null},i.prototype.setData=function(t,n){var i=this.Ba;0<=t&&t<i.length&&(i[t].data=n)},i.prototype.getLastHitIndex=function(){return this.xa},i.prototype.setColors=function(t,n,i,r){n[t+0]=i[0],n[t+1]=i[1],n[t+2]=i[2],n[t+3]=r,n[t+4]=i[0],n[t+5]=i[1],n[t+6]=i[2],n[t+7]=r},i.prototype.setColorsHex=function(n,i,r,e){var u=t.utils.hex2rgb(r,this.ra);this.setColors(n,i,u,e)},i.prototype.setColorsWhite=function(t,n){var i=this.ra;i[0]=1,i[1]=1,i[2]=1,this.setColors(t,n,i,0)},i.prototype.setColorsPoint=function(t,n,i,r){var e=n.points[i];null!=e?this.setColorsHex(t,r,e.color,e.alpha):this.setColorsWhite(t,r)},i.prototype.setVertices=function(t,n,i,r){var e=r.y+r.height*i;n[t+0]=r.x,n[t+1]=e,n[t+2]=r.x+r.width,n[t+3]=e},i.prototype.setUvs=function(t,n,i,r){var e=r.x0+(r.x3-r.x0)*i,u=r.y0+(r.y3-r.y0)*i,s=r.x1+(r.x2-r.x1)*i,h=r.y1+(r.y2-r.y1)*i;n[t+0]=e,n[t+1]=u,n[t+2]=s,n[t+3]=h},i.prototype.newIndices=function(t,n,i,r){for(var e=0;e<i;++e)r[t+0]=n+0,r[t+1]=n+1,r[t+2]=n+2,r[t+3]=n+2,r[t+4]=n+1,r[t+5]=n+3,t+=6,n+=2;return r},i.prototype._calculateBounds=function(){var t=this.Ba[0].rect,n=this._bounds,i=this.Th;i.set(t.x,t.y),n.addPoint(i),i.set(t.x+t.width,t.y+t.height),n.addPoint(i)},i.prototype.update=function(){var t=this.an,n=this._uvs,i=this.La,r=this.ln,e=this.shader.uniforms.uSampler;null==e._uvs&&e.updateUvs();for(var u=e._uvs,s=0,h=0,o=0,a=0,c=this.Ba,f=0,l=c.length;f<l;++f){var v=c[f].data,b=c[f].rect;if(null==v)this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsWhite(o,i),this.setVertices(s+4,t,1,b),this.setUvs(s,n,1,u),this.setColorsWhite(o+8,i),this.newIndices(a,h,1,r),s+=8,o+=16,h+=4,a+=6;else{this.setVertices(s,t,0,b),this.setUvs(s,n,0,u),this.setColorsPoint(o,v,0,i),s+=4,o+=8;for(var d=v.points.length,g=0,m=Math.min(d,this.ka);g<m;++g){var w=v.points[g];this.setVertices(s,t,w.position,b),this.setUvs(s,n,w.position,u),this.setColorsHex(o,i,w.color,w.alpha),s+=4,o+=8}this.setVertices(s,t,1,b),this.setUvs(s,n,1,u),this.setColorsPoint(o,v,d-1,i),s+=4,o+=8,this.newIndices(a,h,d+1,r),a+=6*(d+1),h+=2*(d+2)}}this.size=a;var p=this.geometry;p.getBuffer("aPosition").update(),p.getBuffer("aUv").update(),p.getBuffer("aColor").update(),p.getIndex().update()},i.prototype.containsPoint=function(t){for(var n=this.toLocal(t,void 0,this.Th),i=this.Ba,r=0,e=i.length;r<e;++r)if(i[r].rect.contains(n.x,n.y))return this.xa=r,!0;return!1},i.from=function(n,r,e,u){void 0===u&&(u=t.Texture.WHITE);for(var s=new Float32Array(n*(r+2)*2*2),h=new Float32Array(n*(r+2)*2*2),o=new Float32Array(n*(r+2)*2*4),a=new Uint16Array(n*(r+1)*6),c=[],f=0;f<n;++f)c.push({data:null,rect:new t.Rectangle});return new i(r,s,h,o,a,c,(new t.Geometry).addIndex(new t.Buffer(a,!1,!0)).addAttribute("aPosition",new t.Buffer(s,!1,!1),2).addAttribute("aUv",new t.Buffer(h,!1,!1),2).addAttribute("aColor",new t.Buffer(o,!1,!1),4),t.Shader.from("\nattribute vec2 aPosition;\nattribute vec2 aUv;\nattribute vec4 aColor;\n\nuniform mat3 projectionMatrix;\nuniform mat3 translationMatrix;\n\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nvoid main(void) {\n\tvec3 position = vec3(aPosition.x, aPosition.y, 1.0);\n\tgl_Position = vec4((projectionMatrix * translationMatrix * position).xy, 0.0, 1.0);\n\tvUv = aUv;\n\tvColor = aColor;\n}\n","\nvarying vec2 vUv;\nvarying vec4 vColor;\n\nuniform sampler2D uSampler;\nuniform vec2 uCheckerColors;\n\nvoid main(void) {\n\tvec4 texture = texture2D(uSampler, vUv);\n\tfloat cy = step( 1.0, mod( gl_FragCoord.y / 10.0, 2.0 ) );\n\tfloat cx = step( 1.0, mod( gl_FragCoord.x / 10.0 + cy, 2.0 ) );\n\tfloat c = mix( uCheckerColors.x, uCheckerColors.y, cx );\n\tgl_FragColor = texture * vec4( mix( vec3( c ), vColor.xyz, vColor.a ), 1.0 );\n}",{uSampler:u,uCheckerColors:e}))},i}(t.Mesh),Bv=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(r){var e=this;n.prototype.init.call(this,r);var u=this.theme,s=this.Bn,h=s.getTop(),o=s.getRight(),a=s.getBottom(),c=s.getLeft();this.je=new t.Point;var f=u.getGradientPointsWidth(),l=u.getGradientPointsMargin(),v=new yv({x:c+f+l,y:h});this.es=v,v.on("newcolorchange",(function(t){e.onAnchorColorChange(t)})),v.on("newalphachange",(function(t){e.onAnchorAlphaChange(t)})),this.addChild(v);var b=this.Ji=xv.from(17,10,u.getGradientCheckerColors());b.setRectangle(0,c,h,f,v.height),this.addChild(b),b.on(zi.down,(function(t){0===b.getLastHitIndex()&&e.onViewDown(t)})),this.Pa=function(t){e.onAnchorDown(t)},this.Fa=function(t){e.onAnchorMove(t)},this.Ua=function(t){e.onAnchorUp(t)},this.Ga=[];var d=v.theme.getInputLabelWidth(),g=.5*v.theme.getMainWidth(),m=u.getGradientDirectionMargin(),w=u.getGradientDirectionTexture(),p=v.x+v.width+m,O=new fu({parent:this,x:p+d+5,y:h,width:g-d-5,step:1,image:{source:w,align:{with:be.BORDER},margin:{horizontal:-w.width-5}},on:{change:function(t){e.At.Gt=t}}}),D=u.getGradientRecentColumn(),E=u.getGradientRecentWidth(),M=u.getGradientRecentMargin(),S=E+M,T=p,j=O.y+O.height+m;null==i.RECENT_COLOR_GRADIENT&&(i.RECENT_COLOR_GRADIENT=new Lv(u.getGradientRecents(),u.getGradientRecentCount())),this.ca=i.RECENT_COLOR_GRADIENT;for(var N=this.ca,I=0,C=N.getCapacity();I<C;++I){var A=T+I%D*S,R=j+(I/D|0)*S;b.setRectangle(1+I,A,R,E,E)}N.on("change",(function(){e.onRecentUpdate()})),zi.onClick(b,(function(t){var n=b.getLastHitIndex();1<=n&&e.onRecentClick(b.getData(n))}));var y=new Tv;this.At=y,y.on("change",(function(){e.updateAnchors(),b.update()})),y.on("selectionchange",(function(t){e.onAnchorSelect(t)})),y.on("directionchange",(function(t){O.value=t})),b.setData(0,y),b.update(),O.value=y.direction,this.updateAnchors();var k=y.selected;null!=k&&this.onAnchorSelect(k),null!=r&&null!=r.width||(this.width=c+f+l+v.width+m+(D-1)*M+D*E+o),null!=r&&null!=r.height||(this.height=h+v.height+a)},Object.defineProperty(i.prototype,"value",{get:function(){return this.At},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"recent",{get:function(){return this.ca},enumerable:!1,configurable:!0}),i.prototype.onRecentClick=function(t){var n=this.At;null!=t?n.fromObject(t):n.reset()},i.prototype.onRecentUpdate=function(){for(var t=this.ca,n=this.Ji,i=0,r=t.size();i<r;++i)n.setData(1+i,t.get(i));n.update(),rt.update(this)},i.prototype.toAnchorPosition=function(t){var n=this.toLocal(t.data.global,void 0,this.je);return Math.max(0,Math.min(1,(n.y-this.padding.getTop())/this.es.height))},i.prototype.onViewDown=function(t){this.At.addAt(this.toAnchorPosition(t)),this.onAnchorDragStart()},i.prototype.onAnchorDown=function(n){var i=n.target;if(i instanceof t.Sprite){var r=this.At,e=this.Ga.indexOf(i);0<=e&&e<r.points.length&&(r.points[e].selected=!0,this.onAnchorDragStart())}},i.prototype.onAnchorSelect=function(t){var n=this.es;n.current.color=t.color,n.current.alpha=t.alpha,n.new.color=t.color,n.new.alpha=t.alpha},i.prototype.onAnchorColorChange=function(t){var n=this.At;if(null!=n){var i=n.selected;null!=i&&(i.color=t)}},i.prototype.onAnchorAlphaChange=function(t){var n=this.At;if(null!=n){var i=n.selected;null!=i&&(i.alpha=t)}},i.prototype.onAnchorDragStart=function(){var t=rt.getLayer(this);if(t){var n=t.stage;n.on(zi.move,this.Fa),n.on(zi.up,this.Ua)}},i.prototype.onAnchorMove=function(t){var n=this.At;if(null!=n){var i=n.selected;null!=i&&(i.position=this.toAnchorPosition(t))}},i.prototype.onAnchorUp=function(t){var n=rt.getLayer(this);if(n){var i=n.stage;i.off(zi.move,this.Fa),i.off(zi.up,this.Ua)}},i.prototype.updateAnchors=function(){for(var n=this.theme,i=n.getGradientAnchorTexture(),r=n.getGradientAnchorOutlinedTexture(),e=n.getGradientPointsWidth(),u=this.At,s=u.points.length,h=this.Ga,o=h.length,a=o;a<s;++a){var c=new t.Sprite(i);c.anchor.set(.5,.5),c.cursor="pointer",c.interactive=!0,c.on(zi.down,this.Pa),h.push(c),this.addChild(c)}for(a=o-1;s<=a;--a){var f=h[a];f.off(zi.down,this.Pa),f.destroy()}h.length=s;var l=this.padding.getTop(),v=this.padding.getLeft()+e,b=this.es.height;for(a=0;a<s;++a){var d=u.points[a],g=h[a];g.tint=d.color,g.position.set(v,l+b*d.position),g.texture=d.selected?r:i}rt.update(this)},i.prototype.onKeyDown=function(t){if(Kt.isDeleteKey(t)){var i=this.At;if(null!=i){var r=i.selected;if(null!=r)return i.remove(r),n.prototype.onKeyDown.call(this,t),!0}}return n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DPickerColorGradient"},i.RECENT_COLOR_GRADIENT=null,i}(Ki),_v=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.picker)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.value,e=i.recent;e.contains(r)||e.add(r.toObject())},Object.defineProperty(n.prototype,"value",{get:function(){return this.picker.value},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.es;return null==n&&(n=new Bv(null===(t=this.Nn)||void 0===t?void 0:t.picker),this.es=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.value},n.prototype.onKeyDown=function(n){return this.picker.onKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DDialogColorGradient"},n}(Ke),Pv=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r;if(n.prototype.init.call(this,i),void 0===(null===(r=null==i?void 0:i.image)||void 0===r?void 0:r.source)){var e=this.theme,u=e.getViewBaseTexture();if(u instanceof t.Texture){var s=e.getCheckerColors(),h=xv.from(1,10,s,u);this.Ji=h,h.setRectangle(0,0,0,u.width,u.height),h.setData(0,this.nu),h.update(),this.image=h}}},i.prototype.onActivate=function(t){var i=this;n.prototype.onActivate.call(this,t);var r=this.nu,e=this.dialog;e.value.fromObject(r),e.open().then((function(){var t=e.value,n=(new Tv).fromObject(r);r.fromObject(t);var u=i.Ji;null!=u&&u.update(),i.onTextChange(),i.createOrUpdateText(),rt.update(i),i.emit("change",t,n,i)}))},Object.defineProperty(i.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var r=null===(t=this.Nn)||void 0===t?void 0:t.dialog;r?n=new _v(r):(null==i.DIALOG&&(i.DIALOG=new _v),n=i.DIALOG),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"value",{get:function(){return this.nu},enumerable:!1,configurable:!0}),i.prototype.getType=function(){return"DButtonColorGradient"},i}(Ae),Fv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.picker)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=this.picker,r=i.recent;r.contains(i.new)||r.add(i.new)},Object.defineProperty(n.prototype,"current",{get:function(){return this.picker.current},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"new",{get:function(){return this.picker.new},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"recent",{get:function(){return this.picker.recent},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"picker",{get:function(){var t,n=this.es;return null==n&&(n=new yv(null===(t=this.Nn)||void 0===t?void 0:t.picker),this.es=n),n},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){return this.picker.new},n.prototype.getType=function(){return"DDialogColor"},n}(Ke),Uv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n);var r=this.nu;this.At=new Av(r,(function(t){r.color=t,i.onColorChange()}),(function(t){r.alpha=t,i.updateTextForcibly()}))},n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.nu,e=this.dialog,u=e.current,s=e.new;u.color=r.color,u.alpha=r.alpha,s.color=r.color,s.alpha=r.alpha,e.open().then((function(){r.color=s.color,r.alpha=s.alpha,i.onColorChange(),i.onValueChange(i.toClone(s),i.toClone(u))}))},n.prototype.toClone=function(t){return{color:t.color,alpha:t.alpha}},n.prototype.onValueChange=function(t,n){this.emit("change",t,n,this)},n.prototype.toImageTintOptions=function(t){var n=this,i=function(){return n.nu.color};return t?{color:t.color||i,alpha:t.alpha}:{color:i}},n.prototype.toImageOptions=function(t,n){return n?{source:n.source,tint:this.toImageTintOptions(n.tint),align:n.align,margin:n.margin}:{tint:this.toImageTintOptions()}},n.prototype.onColorChange=function(){this.ou[0].updateTint()&&rt.update(this),this.updateTextForcibly()},n.prototype.updateTextForcibly=function(){this.onTextChange(),this.createOrUpdateText()},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,i=this.za;if(null==i){var r=null===(t=this.Nn)||void 0===t?void 0:t.dialog;r?i=new Fv(r):(null==n.DIALOG&&(n.DIALOG=new Fv),i=n.DIALOG),this.za=i}return i},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.At},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonColor"},n}(Ae),Gv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonDanger"},n}(Ae),zv=function(){function t(){}return t.getInstance=function(){return null==t.INSTANCE&&(t.INSTANCE=new Vu),t.INSTANCE},t}(),Hv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime()),e.emit("change",t,n,e)}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Vu(i):zv.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.nu)&&void 0!==t?t:new Date},set:function(t){var n=this.nu;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDate"},n}(Ae),Vv=function(){function t(){}return t.getInstance=function(){return null==t.INSTANCE&&(t.INSTANCE=new Pu),t.INSTANCE},t}(),Wv=function(){function t(){}return t.format=function(t){return mt(String(t.getFullYear()),4,"0")+"/"+mt(String(t.getMonth()+1),2,"0")+"/"+mt(String(t.getDate()),2,"0")},t}(),Xv=function(){function t(){}return t.format=function(t,n){var i="";return n&Iu.HOURS&&(i+=mt(String(t.getHours()),2,"0")),n&Iu.MINUTES&&(0<i.length&&(i+=":"),i+=mt(String(t.getMinutes()),2,"0")),n&Iu.SECONDS&&(0<i.length&&(i+=":"),i+=mt(String(t.getSeconds()),2,"0")),i},t.toMask=function(t){return Cu.from("DPickerTime",t)},t}(),Kv=function(){function t(){}return t.format=function(t,n){var i=Xv.format(t,n);return 0<i.length?Wv.format(t)+" "+i:""+Wv.format(t)},t.toMask=function(t){return Cu.from("DPickerDatetime",t)},t}(),Yv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime()),e.emit("change",t,n,e)}))},n.prototype.getDatetimeMask=function(){var t,n,i=this.Ha;return null==i&&(i=Kv.toMask(null===(n=null===(t=this.Nn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Ha=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Pu(i):Vv.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.nu)&&void 0!==t?t:new Date},set:function(t){var n=this.nu;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonDatetime"},n}(Ae),Jv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getChecker=function(){var t,n,i=this.qh;return void 0===i&&(i=null!==(n=null===(t=this.Nn)||void 0===t?void 0:t.checker)&&void 0!==n?n:null,this.qh=i),i},n.prototype.getOpener=function(){var t=this.Va;return null==t&&(t=this.newOpener(),this.Va=t),t},n.prototype.newOpener=function(){var t,n;return new ql(di(null!==(n=null===(t=this.Nn)||void 0===t?void 0:t.as)&&void 0!==n?n:Zl.TEXT,Zl),this)},n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n),this.check((function(){i.open()}))},n.prototype.check=function(t){var n=this.getChecker();if(null!=n){var i=n();!0===i?t():!1===i||i.then((function(){t()}))}else t()},n.prototype.open=function(){this.getOpener().open()},n.prototype.getType=function(){return"DButtonFile"},n}(Ae),Zv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initOnClick=function(t,n,i){var r=this,e=new kf(i);this.$h=e,e.add(this,(function(n){t===fe.CLICKED&&r.onClick(n)}))},Object.defineProperty(n.prototype,"link",{get:function(){return this.$h},enumerable:!1,configurable:!0}),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.$h.open(n)},n.prototype.open=function(t){this.$h.open(t)},n.prototype.getType=function(){return"DButtonLink"},n}(Ce),qv=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadio"},n}(Ce),$v=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonRadioRight"},n}(qv),Qv=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=dv.getCommandController();return r.isDisabled=!e.isRedoable(),e.on("change",(function(){r.isDisabled=!e.isRedoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),dv.getCommandController().redo()},n}(Ae),tb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DButtonSecondary"},n}(Ae),nb={NONE:0,SINGLE:1,MULTIPLE:2},ib=function(t){function n(n,i){var r=t.call(this,i)||this;return r.$i=n,r.initOnClick(n,i),r}return _(n,t),n.prototype.initOnClick=function(t,n){var i=this,r=t.accessor.link;if(r){var e=new kf(this.toLinkOptions(r));e.add(this,(function(t){var n=i.At;void 0!==n&&i.onSelect(t,n)})),this.$h=e}else zi.onClick(this,(function(t){if(i.state.isActionable){var n=i.At;void 0!==n&&i.onSelect(t,n)}}))},n.prototype.toLinkOptions=function(t){return{url:this.toLinkUrl(t.toUrl),target:t.target,checker:this.toLinkChecker(t.checker)}},n.prototype.toLinkUrl=function(t){var n=this;return function(){var i=n.At;if(void 0!==i)return t(i)}},n.prototype.toLinkChecker=function(t){var n=this;if(t)return function(){var i=n.At;return null!=i&&t(i)}},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.ae},enumerable:!1,configurable:!0}),n.prototype.onSelect=function(t,n){var i,r=this.$i,e=r.selection;if(e.type!==nb.MULTIPLE)e.clearAndAdd(n);else{var u=t&&"data"in t?t.data.originalEvent:t;if(null==u?void 0:u.ctrlKey)e.toggle(n);else if(null==u?void 0:u.shiftKey){var s=r.mapped,h=e.last;if(n===h)e.clearAndAdd(n);else{var o=!1,a=!1,c=[];s.each((function(t){if(o){if(a){if(c.unshift(t),t===n)return!1}else if(c.push(t),t===h)return!1}else t===n?(o=!0,a=!1,c.push(t)):t===h&&(o=!0,a=!0,c.push(t))})),e.clearAndAddAll(c)}}else e.clearAndAdd(n)}null===(i=this.$h)||void 0===i||i.open(t)},n.prototype.set=function(t,n,i){var r=this.$i,e=i||this.At!==t;if(e){this.At=t,this.ae=n;var u=r.accessor;this.text=u.toLabel(t),this.title=u.toTitle(t)||"",this.image=u.toImage(t)}var s=this.state;s.lock(),s.set(ht.ACTIVE,r.selection.contains(t)),s.remove(ht.DISABLED),s.unlock(),e&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.At){this.At=void 0,this.ae=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ht.DISABLED),t.remove(ht.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){if(this.state.isActionable&&this.state.isFocused){var n=this.At;return void 0!==n&&this.onSelect(t,n),!0}return!1},n.prototype.getType=function(){return"DListItem"},n}(Ie),rb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogSelectListItem"},n}(ib),eb=function(){function t(t,n,i,r){this.Wa=0,this.Xa=!1,this.Ka=!1,this.Ya=-1,this.Ja=-1,this.yu=1,this.Za=0,this.qa=0,this.$a=[],this.$i=t,this.Qa=n,this.tc=i,this.nc=this.toNewItem(r),this.ic=this.toInitItem(r)}return t.prototype.toNewItem=function(t){return(null==t?void 0:t.newItem)||this.newItem},t.prototype.toInitItem=function(t){return t?t.initItem||(!1!==t.stripe?this.initItem:this.initItemNoStriping):this.initItem},t.prototype.initItem=function(t,n,i){return t.state.isAlternated=n%2==1,t},t.prototype.initItemNoStriping=function(t,n,i){return t},Object.defineProperty(t.prototype,"multiplicity",{get:function(){return this.yu},enumerable:!1,configurable:!0}),t.prototype.lock=function(){this.Wa+=1,1===this.Wa&&(this.Xa=!1,this.Ka=!1)},t.prototype.unlock=function(t){this.Wa-=1,0===this.Wa&&(t&&this.Xa&&this.update(this.Ka),this.Xa=!1,this.Ka=!1)},t.prototype.update=function(t){var n=this;if(0<this.Wa)return this.Xa=!0,void(t&&(this.Ka=!0));var i=this.Qa,r=i.parent;if(null!=r){var e=this.tc,u=e.children,s=r.height,h=this.$i,o=this.toMapped(h),a=o.size(),c=this.Za,f=this.qa,l=f-c,v=this.nc,b=this.ic,d=this.Ya,g=this.Ja;if(this.Ya<0){var m=void 0;0<u.length?m=u[0]:(m=b(v(h),c,h),e.addChild(m),f+=1,l+=1),d=Math.max(1,m.height),Xt(m.getWidth())&&(g=Math.max(1,m.width)),this.Ya=d,this.Ja=g}var w=i.padding,p=w.getTop(),O=w.getBottom(),D=w.getLeft(),E=w.getRight(),M=Math.max(0,i.width-D-E),S=0<g?Math.max(1,Math.floor(M/g)):1;this.yu=S;var T=i!==e?e.transform.position.y:p,j=Math.ceil(a/S)*d,N=Math.max(s,p+j+O),I=Math.max(s-N,i.position.y),C=Math.floor((0-(I+T))*S/d),A=Math.floor((s-(I+T))*S/d),R=C-S;R%2!=0&&(R-=1);var y=A+S+S;y%2!=0&&(y+=1);var k=y-R;if(k<l&&l-2<=k&&(y=R+(k=l)),l<k){for(var L=l;L<k;++L){var x=c+L;m=b(v(h),x,h),e.addChild(m)}f=c+(l=k)}else if(k<l){for(L=l-1;k<=L;--L)e.removeChild(u[L]);f=c+(l=k)}this.Za=R,this.qa=y;var B=R-c,_=Math.abs(B),P=u.length;if(0<_&&_<P){var F=this.$a;if(0<B){for(L=0;L<_;++L)m=u[L],this.reset(m),F.push(m);for(L=_;L<P;++L)u[L-_]=u[L];for(L=0;L<_;++L)u[P-_+L]=F[L]}else{for(L=0;L<_;++L)m=u[P-_+L],this.reset(m),F.push(m);for(L=P-_-1;0<=L;--L)u[L+_]=u[L];for(L=0;L<_;++L)u[L]=F[L]}F.length=0}var U=0,G=0;for(i===e&&(U=D,G=p),o.each((function(i,r){var e=u[r-R],s=r%S,h=Math.floor(r/S);e.position.set(U+s*g,G+h*d),n.set(e,i,r,t)}),R,R+P),L=0;R+L<0&&L<P;++L){m=u[L];var z=(V=R+L)%S,H=Math.floor(V/S);m.position.set(U+z*g,G+H*d),this.unset(m)}for(L=P-1;a<=R+L&&0<=L;--L){var V;m=u[L],z=(V=R+L)%S,H=Math.floor(V/S),m.position.set(U+z*g,G+H*d),this.unset(m)}this.lock(),i.position.y=I,i.height=N,i!==e&&(e.height=j),this.unlock(!1)}},t.prototype.set=function(t,n,i,r){t.set(n,i,r)},t.prototype.unset=function(t){t.unset()},t.prototype.reset=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof Ki){var u=e.state;u.lock(),u.isPressed=!1,u.isHovered=!1,u.unlock()}}return t.state.isHovered=!1,t},t.prototype.moveFocus=function(t,n,i,r){if(!i&&!r)return!1;var e=i&&Kt.isArrowUpKey(t),u=i&&Kt.isArrowDownKey(t),s=r&&Kt.isArrowLeftKey(t),h=r&&Kt.isArrowRightKey(t);if(!(e||u||s||h))return!1;if(!n.state.isActionable)return!1;var o=rt.getLayer(n);if(null==o)return!1;var a=o.getFocusController(),c=a.get();if(null==c)return!1;var f=this.tc;if(c.parent!==f)return!1;var l=c,v=l.index;if(null==v)return!1;var b=this.yu,d=this.$i,g=this.toMapped(d).size(),m=v;if((s||h)&&(s?0<=m-1&&(m-=1):m+1<g&&(m+=1)),(e||u)&&(e?0<=m-b&&(m-=b):m+b<g&&(m+=b)),m===v)return!1;var w=f.children,p=w.indexOf(l);if(p<0)return!1;var O=p+(m-v);if(O<0||w.length<=O)return!1;var D=w[O];return a.focus(D),!0},t}(),ub=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new ib(t)},n}(eb),sb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newItem=function(t){return new rb(t)},n}(ub),hb=function(){function t(t){this.O=t}return t.prototype.size=function(){var t=this.O;return t.before.length+t.items.length+t.after.length},t.prototype.each=function(t,n,i){var r=this.O,e=this.rc(t,r.before,0,n,i);if(!(e<0)){var u=this.rc(t,r.items,e,n,i);u<0||this.rc(t,r.after,u,n,i)}},t.prototype.rc=function(t,n,i,r,e){for(var u=i+n.length,s=null!=r?Math.max(i,r):i,h=null!=e?Math.min(u,e):u,o=s;o<h;++o)if(!1===t(n[o-i],o))return-1;return h},t}(),ob=function(t){function n(n,i,r){var e=t.call(this)||this;e.O=n,e.ec=i,e.uc=new Set;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return nb.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.get(0)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.uc;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.uc;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.uc;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.uc;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.uc;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.uc;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.uc,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.uc=i,this.onChange()),n},n.prototype.contains=function(t){return this.uc.has(t)},n.prototype.size=function(){return this.uc.size},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=!1;this.uc.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.uc.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.toItemIdMap=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];i.set(n(u),u)}},n.prototype.toItemSet=function(t,n){for(var i=0,r=t.length;i<r;++i)n.add(t[i])},n.prototype.onItemChange=function(t,n,i){var r=this.uc,e=new Set,u=this.ec.toId;if(u){var s=new Map;this.toItemIdMap(t,u,s),this.toItemIdMap(n,u,s),this.toItemIdMap(i,u,s),r.forEach((function(t){var n=u(t),i=s.get(n);null!=i&&e.add(i)})),this.uc=e,this.onChange()}else{var h=new Set;this.toItemSet(t,h),this.toItemSet(n,h),this.toItemSet(i,h),r.forEach((function(t){h.has(t)&&e.add(t)})),r.size!==e.size&&(this.uc=e,this.onChange())}},n.prototype.newItems=function(t,n,i){for(var r=0,e=t.length;r<e;++r){var u=t[r];n.has(u)&&i.add(u)}return i},n}(t.utils.EventEmitter),ab=function(t){function n(n,i,r){var e=t.call(this)||this;e.O=n;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return nb.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.onItemChange=function(t,n,i){},n}(t.utils.EventEmitter),cb=function(t){function n(n,i,r){var e=t.call(this)||this;e.O=n,e.ec=i,e.sc=null;var u=null==r?void 0:r.on;if(u)for(var s in u){var h=u[s];h&&e.on(s,h)}return e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return nb.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.sc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.get(this.size()-1)},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.sc:null},n.prototype.add=function(t){return this.sc!==t&&(this.sc=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.sc===t&&(this.sc=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.sc===t?this.sc=null:this.sc=t,this.onChange(),!0},n.prototype.clear=function(){null!=this.sc&&(this.sc=null,this.onChange())},n.prototype.clearAndAdd=function(t){return this.sc!==t&&(this.sc=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){var n=t.length;if(0<n){var i=t[n-1];if(this.sc!==i)return this.sc=i,this.onChange(),!0}else if(null!=this.sc)return this.sc=null,this.onChange(),!0;return!1},n.prototype.contains=function(t){return this.sc===t},n.prototype.size=function(){return null!=this.sc?1:0},n.prototype.isEmpty=function(){return this.size()<=0},n.prototype.each=function(t){var n=this.sc;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.sc;return null!=t?[t]:[]},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.findById=function(t,n,i){for(var r=0,e=i.length;r<e;++r){var u=i[r];if(t===n(u))return u}return null},n.prototype.find=function(t,n){for(var i=0,r=n.length;i<r;++i){var e=n[i];if(t===e)return e}return null},n.prototype.onItemChange=function(t,n,i){var r=this.sc;if(null!=r){var e=null,u=this.ec.toId;if(u){var s=u(r);e=this.findById(s,u,t)||this.findById(s,u,n)||this.findById(s,u,i)}else e=this.find(r,t)||this.find(r,n)||this.find(r,i);r!==e&&(this.sc=e,this.onChange())}},n}(t.utils.EventEmitter),fb=function(t){return t.image},lb=function(t){return t.title},vb=function(t){return t.url},bb=function(){function t(t){this.toLabel=(null==t?void 0:t.toLabel)||Wl,this.toTitle=(null==t?void 0:t.toTitle)||lb,this.toImage=(null==t?void 0:t.toImage)||fb,this.toId=null==t?void 0:t.toId,this.link=this.toLink(t)}return t.prototype.toLink=function(t){if(t){var n=t.link;if(n){var i=n.toUrl,r=n.target,e=n.checker;if(void 0!==i||void 0!==r||void 0!==e)return{toUrl:i||vb,target:r,checker:e}}}},t}(),db=function(){function t(t,n){this.O=t,n?(this.br=n.before||[],this.uc=n.items||[],this.dr=n.after||[]):(this.br=[],this.uc=[],this.dr=[]);var i=new bb(n);this.ec=i,this.hc=this.toSelection(i,n),this.oc=new hb(this)}return t.prototype.toSelection=function(t,n){var i=null==n?void 0:n.selection;switch(null==i?void 0:i.type){case nb.NONE:case"NONE":return new ab(this,t,i);case nb.MULTIPLE:case"MULTIPLE":return new ob(this,t,i);default:return new cb(this,t,i)}},Object.defineProperty(t.prototype,"before",{get:function(){return this.br},set:function(t){this.br=t,this.hc.onItemChange(t,this.uc,this.dr),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"items",{get:function(){return this.uc},set:function(t){this.uc=t,this.hc.onItemChange(this.br,t,this.dr),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"after",{get:function(){return this.dr},set:function(t){this.dr=t,this.hc.onItemChange(this.br,this.uc,t),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.oc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.ec},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),t.prototype.update=function(t){this.O.update(t)},t.prototype.size=function(){return this.uc.length},t.prototype.clear=function(){var t=this.uc;return 0<t.length&&(t.length=0,this.onChange(),!0)},t.prototype.clearAndAdd=function(t){var n=this.uc;return 1===n.length?n[0]!==t&&(n[0]=t,this.onChange(),!0):(n.length=0,n.push(t),this.onChange(),!0)},t.prototype.clearAndAddAll=function(t){var n=!1,i=this.uc;if(0<i.length&&(i.length=0,n=!0),0<t.length){for(var r=0,e=t.length;r<e;++r)i.push(t[r]);n=!0}return!!n&&(this.onChange(),!0)},t.prototype.add=function(t,n){var i=this.uc;return null==n?(i.push(t),this.onChange(),!0):0<=n&&n<i.length&&(i.splice(n,0,t),this.onChange(),!0)},t.prototype.addAll=function(t,n){if(0<t.length){var i=this.uc,r=i.length;if(null==n){for(var e=0,u=t.length;e<u;++e)i.push(t[e]);return this.onChange(),!0}if(0<=n&&n<r){for(e=0,u=t.length;e<u;++e)i.splice(n+e,0,t[e]);return this.onChange(),!0}}return!1},t.prototype.get=function(t){var n=this.uc;return 0<=t&&t<n.length?n[t]:null},t.prototype.set=function(t,n){var i=this.uc;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.onChange(),r}return null},t.prototype.remove=function(t){var n=this.uc;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.onChange(),i}return null},t.prototype.each=function(t,n,i){for(var r=this.uc,e=r.length,u=null!=n?Math.max(0,n):0,s=null!=i?Math.min(e,i):e,h=u;h<s&&!1!==t(r[h],h);++h);},t.prototype.onChange=function(){this.update()},t}(),gb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DContent"},n}(Ki),mb=function(t){function n(n){var i,r,e=t.call(this,n)||this;e.ac=0,e.cc=1,e.visible=!1,e.fc=-1,e.lc=!1,e.vc=null,e.bc=null!==(r=null===(i=null==n?void 0:n.fadeOut)||void 0===i?void 0:i.delay)&&void 0!==r?r:e.theme.getFadeOutDelay(),e.dc=!0,e.gc=function(){e.onFadeOutTimeout()};var u=e.newThumb(null==n?void 0:n.thumb);return u.on("statechange",(function(t,n){e.onThumbStateChange(t,n)})),e.mc=u,e.addChild(u),e}return _(n,t),Object.defineProperty(n.prototype,"thumb",{get:function(){return this.mc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"start",{get:function(){return this.ac},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"end",{get:function(){return this.cc},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r){i<1?(t=0,n=1):(t=Math.max(0,Math.min(1,t/i)),n=Math.max(t,Math.min(1,n/i))),this.ac===t&&this.cc===n||(this.ac=t,this.cc=n,this.onChange(r))},n.prototype.onChange=function(t){this.updateThumb(this.width,this.height),t&&(this.dc=!0),this.lc||(this.lc=!0,rt.update(this))},n.prototype.isRegionVisible=function(){return 0<this.ac||this.cc<1},n.prototype.render=function(n){if(this.lc)if(this.lc=!1,!this.dc&&this.isRegionVisible()){var i=this.bc;0<=i&&(this.fc=Date.now(),null==this.vc&&(this.vc=window.setTimeout(this.gc,i))),this.visible||(this.visible=!0)}else this.bc<0&&this.visible&&(this.visible=!1);this.dc&&(this.dc=!1),t.prototype.render.call(this,n)},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.updateThumb(n,i)},n.prototype.onFadeOutTimeout=function(){this.vc=null;var t=this.bc,n=this.gc,i=this.state;if(i.isGesturing||i.isHovered||i.isPressed)this.vc=window.setTimeout(n,t);else{var r=this.mc.state;if(r.isGesturing||r.isHovered||r.isPressed)this.vc=window.setTimeout(n,t);else{var e=t-(Date.now()-this.fc);0<e?this.vc=window.setTimeout(n,e):this.visible&&(this.visible=!1,rt.update(this))}}},n.prototype.onThumbStateChange=function(t,n){t.isGesturing||t.isHovered||t.isPressed||(n.isGesturing||n.isHovered||n.isPressed)&&(this.fc=Date.now())},n.prototype.onStateChange=function(n,i){t.prototype.onStateChange.call(this,n,i),n.isGesturing||n.isHovered||n.isPressed||(i.isGesturing||i.isHovered||i.isPressed)&&(this.fc=Date.now())},n.prototype.getType=function(){return"DScrollBar"},n}(Ki),wb=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(i){var r=this;n.prototype.init.call(this,i);var e=new t.Point;this.pi=new rr({bind:this,easing:!0,on:{start:function(){e.copyFrom(r.position)},move:function(t,n,i){e.set(e.x+n,e.y+i),r.onGestureMove(e.x,e.y)}}})},i.prototype.getMinimumLength=function(){return this.theme.getThumbMinimumLength()},i.prototype.getType=function(){return"DScrollBarThumb"},i}(Ki),pb=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(0,o*(i-h),n,h),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Ob=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",t,this)},n.prototype.initReflowable=function(){new pb(this)},n}(wb),Db=function(t){function n(n){var i=t.call(this,n)||this;return i.mc.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.width;if(0<n){var i=this.cc-this.ac,r=Math.min(1-i,Math.max(0,t/n));this.ac!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.width;if(0<i){var r=this.cc-this.ac,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.x/i-.5*r));this.ac!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Ob(t)},n.prototype.updateThumb=function(t,n){var i=this.mc,r=Math.min(.5*t,i.getMinimumLength()),e=t-r,u=e*this.ac,s=e*this.cc+r-u;i.position.set(u,0),i.resize(s,n)},n}(mb),Eb=function(t){function n(n){var i=t.call(this)||this;return n.snippet.add(i,!0),n.reflowable.add(i),i}return _(n,t),n.prototype.onReflow=function(t,n,i){this.clear();var r=t.state,e=t.border,u=e.getColor(r);if(null!=u){var s=e.getAlpha(r),h=e.getWidth(r),o=e.getAlign(r);this.beginFill(u,s),this.lineStyle(0,0,0,0),this.drawRect(o*(n-h),0,h,i),this.endFill(),this.visible=!0}else this.visible=!1},n}(t.Graphics),Mb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onGestureMove=function(t,n){this.emit("regionmove",n,this)},n.prototype.initReflowable=function(){new Eb(this)},n}(wb),Sb=function(t){function n(n){var i=t.call(this,n)||this;return i.mc.on("regionmove",(function(t){i.onThumbRegionMove(t)})),i}return _(n,t),n.prototype.onThumbRegionMove=function(t){var n=this.height;if(0<n){var i=this.cc-this.ac,r=Math.min(1-i,Math.max(0,t/n));this.ac!==r&&this.emit("regionmove",r,this)}},n.prototype.onDownThis=function(n){t.prototype.onDownThis.call(this,n);var i=this.height;if(0<i){var r=this.cc-this.ac,e=n.data.getLocalPosition(this),u=Math.min(1-r,Math.max(0,e.y/i-.5*r));this.ac!==u&&this.emit("regionmove",u,this)}},n.prototype.newThumb=function(t){return new Mb(t)},n.prototype.updateThumb=function(t,n){var i=this.mc,r=Math.min(.5*n,i.getMinimumLength()),e=n-r,u=e*this.ac,s=e*this.cc+r-u;i.position.set(0,u),i.resize(t,s)},n}(mb),Tb=function(){function t(t,n,i){this.O=t,this.wc=i,this.$=0,this.Oc=!1,this.vertical=new Sb(null==n?void 0:n.vertical),this.horizontal=new Db(null==n?void 0:n.horizontal)}return t.prototype.lock=function(){this.$+=1,1===this.$&&(this.Oc=!1,this.Dc=void 0)},t.prototype.unlock=function(t){this.$-=1,0===this.$&&(t&&this.Oc&&this.update(this.Dc),this.Oc=!1,this.Dc=void 0)},t.prototype.update=function(t){if(0<this.$)return this.Oc=!0,void(null!=t&&(this.Dc||(this.Dc=t)));var n=this.O,i=n.width,r=n.height,e=n.content,u=-e.x,s=-e.y,h=this.vertical,o=h.width,a=this.getOffsetVerticalStart(o),c=this.getOffsetVerticalEnd(o);h.set(s,s+r,e.height,t),h.position.set(i-o,a),h.height=r-a-c;var f=this.horizontal,l=f.height,v=this.getOffsetHorizontalStart(l),b=this.getOffsetHorizontalEnd(l);f.set(u,u+i,e.width,t),f.position.set(v,r-l),f.width=i-v-b,this.wc(h.isRegionVisible()||f.isRegionVisible())},t.prototype.getOffsetHorizontalStart=function(t){return.5*t},t.prototype.getOffsetHorizontalEnd=function(t){return.5*t},t.prototype.getOffsetVerticalStart=function(t){return.5*t},t.prototype.getOffsetVerticalEnd=function(t){return.5*t},t}(),jb=function(n){function i(t){var i,r=n.call(this,t)||this,e=r.theme;(null!==(i=null==t?void 0:t.mask)&&void 0!==i?i:e.isOverflowMaskEnabled())&&(r.mask=r.getOverflowMask()),r.addChild(r.content);var u=r.scrollbar;return r.addChild(u.vertical),r.addChild(u.horizontal),u.update(),r.initGesture(e,t),r}return _(i,n),i.prototype.initGesture=function(n,i){var r,e,u=this,s=di(null!==(e=null===(r=null==i?void 0:i.gesture)||void 0===r?void 0:r.mode)&&void 0!==e?e:n.getGestureMode(),qi);if(s===qi.ON||s===qi.TOUCH){var h=new t.Point,o=this.content;this.pi=new rr({bind:this,touch:s===qi.TOUCH,on:{start:function(){h.copyFrom(o.position)},move:function(t,n,i){h.set(h.x+n,h.y+i),o.position.set(u.toContentX(o,h.x),u.toContentY(o,h.y))}}})}},Object.defineProperty(i.prototype,"scrollbar",{get:function(){var t,n=this.Ec;return null==n&&(n=this.newScrollBar(null===(t=this.Nn)||void 0===t?void 0:t.scrollbar),this.initScrollBar(n),this.Ec=n),n},enumerable:!1,configurable:!0}),i.prototype.newScrollBar=function(t){var n=this;return new Tb(this,t,(function(t){n.onScrollBarUpdate(t)}))},i.prototype.onScrollBarUpdate=function(t){var n=this.Zi;if(null!=n){var i=this.content;t?i.mask!==n&&(i.mask=n,rt.update(this)):i.mask&&(i.mask=null,rt.update(this))}},i.prototype.initScrollBar=function(t){var n=this;t.vertical.on("regionmove",(function(t){n.onScrollBarMoveY(t)})),t.horizontal.on("regionmove",(function(t){n.onScrollBarMoveX(t)}))},i.prototype.onScrollBarMoveX=function(t){var n=this.pi;null!=n&&n.stop(this);var i=this.content;i.x=-i.width*t},i.prototype.onScrollBarMoveY=function(t){var n=this.pi;null!=n&&n.stop(this);var i=this.content;i.y=-i.height*t},i.prototype.getType=function(){return"DPane"},Object.defineProperty(i.prototype,"content",{get:function(){var t=this.Qa;return null==t&&(t=this.toContent(this.Nn),this.initContent(t),this.Qa=t),t},enumerable:!1,configurable:!0}),i.prototype.toContent=function(t){var n=null==t?void 0:t.content;return n?n instanceof Ki?n:this.newContent(n):this.newContent()},i.prototype.newContent=function(t){return new gb(t)},i.prototype.initContent=function(t){var n=this;t.on("move",(function(){n.onContentChange()})),t.on("resize",(function(){n.onContentChange()}))},i.prototype.getOverflowMask=function(){var t=this.Zi;return null==t&&(t=new Yi(this),this.Zi=t,this.reflowable.add(t),this.toDirty()),t},i.prototype.onWheel=function(t,n,i){var r=this.content,e=this.getWheelContentX(r,n.deltaX*n.lowest),u=this.getWheelContentY(r,n.deltaY*n.lowest);if(r.x!==e||r.y!==u){var s=this.pi;return null!=s&&s.stop(this),r.position.set(e,u),!0}return!1},i.prototype.getWheelContentX=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentX(t,t.x-n*i)}return t.x},i.prototype.getWheelContentY=function(t,n){if(0<n||n<0){var i=this.theme.getWheelSpeed();return this.toContentY(t,t.y+n*i)}return t.y},i.prototype.toContentX=function(t,n){return Math.min(0,Math.max(this.width-t.width,n))},i.prototype.toContentY=function(t,n){return Math.min(0,Math.max(this.height-t.height,n))},i.prototype.isRefitable=function(t){return n.prototype.isRefitable.call(this,t)&&!(t instanceof mb)},i.prototype.onResize=function(t,i,r,e){var u=this.scrollbar;u.lock(),n.prototype.onResize.call(this,t,i,r,e),u.update(),u.unlock(!0)},i.prototype.onContentChange=function(){this.scrollbar.update()},i.prototype.getFocusedChildClippingRect=function(t,n,i,r,e,u,s,h){return h.x=0,h.y=0,h.width=u,h.height=s,h},i.prototype.onChildFocus=function(r){var e=i.WORK_POINT||new t.Point;i.WORK_POINT=e;var u=this.content,s=u.x,h=u.y,o=u.width,a=u.height;e.set(0,0),r.toGlobal(e,e,!1),u.toLocal(e,void 0,e,!1);var c=s+Math.min(o,Math.max(0,e.x)),f=h+Math.min(a,Math.max(0,e.y));e.set(r.width,r.height),r.toGlobal(e,e,!0),u.toLocal(e,void 0,e,!0);var l=s+Math.min(o,Math.max(0,e.x)),v=h+Math.min(a,Math.max(0,e.y)),b=this.width,d=this.height,g=i.WORK_RECTANGLE||new t.Rectangle;i.WORK_RECTANGLE=g,this.getFocusedChildClippingRect(r,s,h,o,a,b,d,g);var m=g.x,w=g.y,p=m,O=w,D=m+g.width,E=w+g.height,M=null;c<p?l<=D&&(M=s+Math.min(p-c,D-l),M=Math.max(b-o,Math.min(0,M))):D<l&&(M=s-Math.min(c-p,l-D),M=Math.max(b-o,Math.min(0,M)));var S=null;f<O?v<=E&&(S=h+Math.min(O-f,E-v),S=Math.max(d-a,Math.min(0,S))):E<v&&(S=h-Math.min(f-O,v-E),S=Math.max(d-a,Math.min(0,S)));var T=u.position;null!=M?null!=S?T.set(M,S):T.x=M:null!=S&&(T.y=S),n.prototype.onChildFocus.call(this,r)},i.prototype.destroy=function(){var t=this.Zi;null!=t&&(this.Zi=null,t.destroy()),this.mask=null,n.prototype.destroy.call(this)},i}(Ki),Nb=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.Mc;return null==t&&(t=this.newUpdater(this.data,this.content,this.Nn),this.Mc=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new ub(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.$i;return null==t&&(t=this.toData(this.Nn),this.$i=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.items),i=null==t?void 0:t.selection;return null==n?i?new db(this,{selection:i}):new db(this):Wt(n)?new db(this,i?{items:n,selection:i}:{items:n}):"each"in n?n:i?(void 0===n.selection&&(n.selection=i),new db(this,n)):new db(this,n)},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!0),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DList"},n}(jb),Ib=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUpdater=function(t,n,i){return new sb(t,n,n,null==i?void 0:i.updater)},n.prototype.getType=function(){return"DDialogSelectList"},n}(Nb),Cb=function(t){function n(n){var i=t.call(this)||this;return i.Sc=n||function(t){return Promise.resolve([])},i.k=0,i.Tc=0,i.jc=null,i}return _(n,t),n.prototype.create=function(t){var n=this,i=++this.k;this.Sc(t[0]).then((function(t){n.k===i&&(n.Tc=i,n.jc=t,n.emit("success",n,t),n.emit("change",n))}),(function(){n.k===i&&(n.Tc=i,n.jc=null,n.emit("fail",n),n.emit("change",n))})),this.emit("change",this)},n.prototype.isDone=function(){return this.k===this.Tc},n.prototype.getResult=function(){return this.jc},n}(t.utils.EventEmitter),Ab=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DInputSearch"},n}(bu),Rb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNote"},n}(Ie),yb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmall"},n}(Rb),kb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallError"},n}(yb),Lb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallNoItemsFound"},n}(yb),xb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSmallSearching"},n}(yb),Bb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(t,n){var i=this;this.At=null;var r=this.theme,e=this.newInput(r,n);this._u=e,t.addChild(this.newInputLayout(t,e,r,n));var u=this.newList(r,n);this.Sn=u,t.addChild(u);var s=null==n?void 0:n.note,h=this.newNoteError(u,s);this.Nc=h;var o=this.newNoteNoItemsFound(u,s);this.Ic=o;var a=this.newNoteSearching(u,s);this.Cc=a;var c=this.toSearch(null==n?void 0:n.controller);this.Sc=c,e.on("input",(function(t){c.create([t])})),c.on("success",(function(t,n){i.onSearched(n)})),c.on("fail",(function(){i.onSearched([])}));var f=new rv;c.on("change",(function(){if(c.isDone()){var t=c.getResult();null!=t?0<t.length?f.hide():f.show(o):f.show(h)}else a&&f.show(a)}))},n.prototype.newInput=function(t,n){return new Ab(this.toInputOptions(t,n))},n.prototype.toInputOptions=function(t,n){var i=(null==n?void 0:n.input)||{};return void 0===i.width&&void 0===i.weight&&(i.weight=1),i},n.prototype.newInputLayout=function(t,n,i,r){return new We(this.toInputLayoutOptions(t,n,i,r))},n.prototype.toInputLayoutOptions=function(t,n,i,r){var e=this.toInputMargin(i,r),u=e.horizontal,s=e.vertical+this.padding.getTop()-t.margin.vertical;return{width:"padding",height:"auto",padding:{bottom:Math.max(0,s)},children:[new ze({width:u}),n,new ze({width:u})]}},n.prototype.toInputMargin=function(t,n){var i,r=null===(i=null==n?void 0:n.input)||void 0===i?void 0:i.margin;if(null!=r){if(Xt(r))return{horizontal:r,vertical:r};var e=r.horizontal,u=r.vertical;return{horizontal:null!=e?e:t.getInputMarginHorizontal(),vertical:null!=u?u:t.getInputMarginVertical()}}return{horizontal:t.getInputMarginHorizontal(),vertical:t.getInputMarginVertical()}},n.prototype.toListOptions=function(t,n){var i=(null==n?void 0:n.list)||{};return void 0===i.width&&(i.width="padding"),i},n.prototype.newList=function(t,n){var i=this,r=new Ib(this.toListOptions(t,n));return r.selection.on("change",(function(t){var n=t.first;null!=n&&(i.At=n,i.onOk(n))})),r},n.prototype.toNoteOptions=function(t,n){return null!=n?(null==n.parent&&(n.parent=t),null==n.visible&&(n.visible=!1),n):{parent:t,visible:!1}},n.prototype.newNoteError=function(t,n){var i=null==n?void 0:n.error;return null!==i?new kb(this.toNoteOptions(t,i)):null},n.prototype.newNoteNoItemsFound=function(t,n){var i=null==n?void 0:n.noItemsFound;return null!==i?new Lb(this.toNoteOptions(t,i)):null},n.prototype.newNoteSearching=function(t,n){var i=null==n?void 0:n.searching;return null!=i?new xb(this.toNoteOptions(t,i)):null},n.prototype.toSearch=function(t){if(t){var n=t.search;return"create"in n?n:new Cb(n)}return new Cb},Object.defineProperty(n.prototype,"input",{get:function(){return this._u},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"list",{get:function(){return this.Sn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.At},enumerable:!1,configurable:!0}),n.prototype.onSearched=function(t){this.Sn.data.items=t},n.prototype.getResolvedValue=function(){return this.At},n.prototype.getType=function(){return"DDialogSelect"},n.prototype.onOpen=function(){t.prototype.onOpen.call(this),this.Sn.selection.clear(),this.Sc.create([this._u.value])},n.prototype.onOk=function(n){this.emit("select",n,this),t.prototype.onOk.call(this,n)},n.prototype.destroy=function(){var n,i,r;this._u.destroy(),null===(n=this.Nc)||void 0===n||n.destroy(),null===(i=this.Ic)||void 0===i||i.destroy(),null===(r=this.Cc)||void 0===r||r.destroy(),this.Sn.destroy(),t.prototype.destroy.call(this)},n}(Ke),_b=function(t){return t.value},Pb=function(){},Fb=function(t){function n(n){var i,r,e=t.call(this,function(t){var n,i,r;if(t){var e,u=null===(n=t.text)||void 0===n?void 0:n.formatter;if(void 0!==u){if(!(e=t.dialog)||!("open"in e)){var s=(e=e||{}).item=e.item||{};void 0===(o=s.text=s.text||{}).formatter&&(o.formatter=u)}}else if(!(e=t.dialog)||!("open"in e)){var h=null===(r=null===(i=null==e?void 0:e.item)||void 0===i?void 0:i.text)||void 0===r?void 0:r.formatter;if(void 0!==h){var o=t.text||{};t.text=o,void 0===o.formatter&&(o.formatter=h)}}}return t}(n))||this;return e.Ac=null!==(i=null==n?void 0:n.getter)&&void 0!==i?i:_b,e.Rc=null!==(r=null==n?void 0:n.setter)&&void 0!==r?r:Pb,e}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.dialog,u=null!==(i=this.nu)&&void 0!==i?i:null;this.Rc(e,u),e.open().then((function(){var t=r.Ac(e);t!==u&&(r.text=t,r.emit("change",t,u,r))}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i&&"open"in i?i:new Bb(i),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.nu)&&void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonSelect"},n}(Ae),Ub=function(){function t(){}return t.getInstance=function(){return null==t.INSTANCE&&(t.INSTANCE=new Uu),t.INSTANCE},t}(),Gb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime()),e.emit("change",t,n,e)}))},n.prototype.getDatetimeMask=function(){var t,n,i=this.Ha;return null==i&&(i=Xv.toMask(null===(n=null===(t=this.Nn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Ha=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Uu(i):Ub.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t;return null!==(t=this.nu)&&void 0!==t?t:new Date},set:function(t){var n=this.nu;void 0!==n&&n.getTime()===t.getTime()||(this.text=t)},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DButtonTime"},n}(Ae),zb=function(t){function n(n){var i=t.call(this,n)||this,r=i.state,e=dv.getCommandController();return r.isDisabled=!e.isUndoable(),e.on("change",(function(){r.isDisabled=!e.isUndoable()})),i}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),dv.getCommandController().undo()},n}(Ae),Hb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DCanvas"},n}(Ki),Vb={TOP:0,BOTTOM:1,LEFT:2,RIGHT:3},Wb={INSIDE:0,OUTSIDE:1},Xb=function(){function t(t,n){var i,r;this.yc=null!==(i=null==n?void 0:n.coordinate)&&void 0!==i?i:0,this.P=this.toPosition(t,n),this.kc=this.toTickContainer(t,n),this.Bu=this.toLabel(t,n),this.Bn=null!==(r=null==n?void 0:n.padding)&&void 0!==r?r:t.getPadding(),this.Lc=this.toBar(t,n)}return Object.defineProperty(t.prototype,"coordinateIndex",{get:function(){return this.yc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"padding",{get:function(){return this.Bn},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this.P},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"bar",{get:function(){return this.Lc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tick",{get:function(){return this.kc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"label",{get:function(){return this.Bu},enumerable:!1,configurable:!0}),t.prototype.toPosition=function(t,n){var i=null==n?void 0:n.position;return at(i)?Vb[i]:null!=i?i:t.getPosition()},t.prototype.toBar=function(t,n){var i;return{style:null!==(i=null==n?void 0:n.style)&&void 0!==i?i:t.getStyle(),stroke:this.toBarStroke(t,null==n?void 0:n.stroke),shape:void 0}},t.prototype.toTickContainer=function(t,n){var i,r=null==n?void 0:n.tick;return{enable:null!==(i=null==r?void 0:r.enable)&&void 0!==i?i:t.getTickEnable(),major:this.toTickMajor(t,r),minor:this.toMinorTick(t,r)}},t.prototype.toTickMajor=function(t,n){var i,r,e,u,s,h,o=null==n?void 0:n.major,a=null!==(r=null!==(i=null==o?void 0:o.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMajorTickPosition(),c=null==n?void 0:n.style,f=Tl.from(null!==(u=null!==(e=null==o?void 0:o.style)&&void 0!==e?e:c)&&void 0!==u?u:t.getMajorTickStyle()),l=null==n?void 0:n.stroke,v=this.toTickMajorStroke(t,null==o?void 0:o.stroke,l);return{count:null!==(s=null==o?void 0:o.count)&&void 0!==s?s:t.getMajorTickCount(),size:null!==(h=null==o?void 0:o.size)&&void 0!==h?h:t.getMajorTickSize(),position:this.toTickPosition(a),style:f,stroke:v,text:this.toMajorTickText(t,null==o?void 0:o.text),formatter:this.toMajorTickFormatter(t,o),shapes:void 0,gridline:this.toTickMajorGridline(t,null==o?void 0:o.gridline,c,l)}},t.prototype.toTickMajorGridline=function(t,n,i,r){var e,u,s,h=Tl.from(null!==(u=null!==(e=null==n?void 0:n.style)&&void 0!==e?e:i)&&void 0!==u?u:t.getMajorTickGridlineStyle());return{enable:null!==(s=null==n?void 0:n.enable)&&void 0!==s?s:t.getMajorTickGridlineEnable(),style:h,stroke:this.toTickMajorGridlineStroke(t,null==n?void 0:n.stroke,r),shapes:void 0}},t.prototype.toTickPosition=function(t){var n=this.P;if(t===Wb.OUTSIDE||"OUTSIDE"===t)switch(n){case Vb.TOP:return Q.BOTTOM;case Vb.BOTTOM:return Q.TOP;case Vb.LEFT:return Q.RIGHT;case Vb.RIGHT:return Q.LEFT;default:return Q.TOP}else switch(n){case Vb.TOP:return Q.TOP;case Vb.BOTTOM:return Q.BOTTOM;case Vb.LEFT:return Q.LEFT;case Vb.RIGHT:return Q.RIGHT;default:return Q.TOP}},t.prototype.toMinorTick=function(t,n){var i,r,e,u,s,h,o=null==n?void 0:n.major,a=null!==(r=null!==(i=null==o?void 0:o.position)&&void 0!==i?i:null==n?void 0:n.position)&&void 0!==r?r:t.getMinorTickPosition(),c=Tl.from(null!==(u=null!==(e=null==o?void 0:o.style)&&void 0!==e?e:null==n?void 0:n.style)&&void 0!==u?u:t.getMinorTickStyle());return{count:null!==(s=null==o?void 0:o.count)&&void 0!==s?s:t.getMinorTickCount(),size:null!==(h=null==o?void 0:o.size)&&void 0!==h?h:t.getMinorTickSize(),position:this.toTickPosition(a),style:c,stroke:this.toTickMinorStroke(t,null==o?void 0:o.stroke,null==n?void 0:n.stroke),shapes:void 0}},t.prototype.toBarStroke=function(t,n){return this.toStroke(n,void 0,t.getStrokeEnable(),t.getStrokeColor(),t.getStrokeAlpha(),t.getStrokeWidth(),t.getStrokeAlign(),t.getStrokeSide(),t.getStrokeStyle())},t.prototype.toTickMajorStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickStrokeEnable(),t.getMajorTickStrokeColor(),t.getMajorTickStrokeAlpha(),t.getMajorTickStrokeWidth(),t.getMajorTickStrokeAlign(),t.getMajorTickStrokeSide(),t.getMajorTickStrokeStyle())},t.prototype.toTickMajorGridlineStroke=function(t,n,i){return this.toStroke(n,i,t.getMajorTickGridlineStrokeEnable(),t.getMajorTickGridlineStrokeColor(),t.getMajorTickGridlineStrokeAlpha(),t.getMajorTickGridlineStrokeWidth(),t.getMajorTickGridlineStrokeAlign(),t.getMajorTickGridlineStrokeSide(),t.getMajorTickGridlineStrokeStyle())},t.prototype.toTickMinorStroke=function(t,n,i){return this.toStroke(n,i,t.getMinorTickStrokeEnable(),t.getMinorTickStrokeColor(),t.getMinorTickStrokeAlpha(),t.getMinorTickStrokeWidth(),t.getMinorTickStrokeAlign(),t.getMinorTickStrokeSide(),t.getMinorTickStrokeStyle())},t.prototype.toStroke=function(t,n,i,r,e,u,s,h,o){var a,c,f,l,v,b,d,g,m,w,p,O,D,E,M,S,T,j,N,I,C,A,R,y,k,L,x,B;return t?n?{enable:null!==(c=null!==(a=t.enable)&&void 0!==a?a:n.enable)&&void 0!==c?c:i,color:null!==(l=null!==(f=t.color)&&void 0!==f?f:n.color)&&void 0!==l?l:r,alpha:null!==(b=null!==(v=t.alpha)&&void 0!==v?v:n.alpha)&&void 0!==b?b:e,width:null!==(g=null!==(d=t.width)&&void 0!==d?d:n.width)&&void 0!==g?g:u,align:null!==(w=null!==(m=t.align)&&void 0!==m?m:n.align)&&void 0!==w?w:s,side:null!==(O=null!==(p=t.side)&&void 0!==p?p:n.side)&&void 0!==O?O:h,style:null!==(E=null!==(D=t.style)&&void 0!==D?D:n.style)&&void 0!==E?E:o}:{enable:null!==(M=t.enable)&&void 0!==M?M:i,color:null!==(S=t.color)&&void 0!==S?S:r,alpha:null!==(T=t.alpha)&&void 0!==T?T:e,width:null!==(j=t.width)&&void 0!==j?j:u,align:null!==(N=t.align)&&void 0!==N?N:s,side:null!==(I=t.side)&&void 0!==I?I:h,style:null!==(C=t.style)&&void 0!==C?C:o}:n?{enable:null!==(A=n.enable)&&void 0!==A?A:i,color:null!==(R=n.color)&&void 0!==R?R:r,alpha:null!==(y=n.alpha)&&void 0!==y?y:e,width:null!==(k=n.width)&&void 0!==k?k:u,align:null!==(L=n.align)&&void 0!==L?L:s,side:null!==(x=n.side)&&void 0!==x?x:h,style:null!==(B=n.style)&&void 0!==B?B:o}:{enable:i,color:r,alpha:e,width:u,align:s,side:h,style:o}},t.prototype.toMajorTickFormatter=function(t,n){var i=null==n?void 0:n.text;if(i){var r=i.format;if(null!=r)return oi.create(r);var e=i.formatter;if(e)return{format:e}}return oi.create(t.getMajorTickTextFormat())},t.prototype.toMajorTickText=function(t,n){return{format:(n=n||{}).format,color:this.toMajorTickTextColor(t,n.color),alpha:n.alpha,family:n.family,size:n.size,weight:n.weight,align:this.toMajorTickTextAlign(t,n.align),offset:this.toMajorTickTextOffset(t,n.offset),style:n.style,outline:this.toMajorTickTextOutline(t,n.outline),spacing:this.toMajorTickTextSpacing(t,n.spacing),direction:this.toTickMajorTextDirection(t,n.direction),padding:this.toMajorTickTextPadding(t,n.padding),clipping:n.clipping}},t.prototype.toMajorTickTextOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toMajorTickTextAlign=function(t,n){var i,r,e=this.P;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextAlignVertical(e)}},t.prototype.toMajorTickTextOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toMajorTickTextSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toMajorTickTextPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getMajorTickTextPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getMajorTickTextPaddingVertical()}},t.prototype.toTickMajorTextDirection=function(t,n){return null!=n?n:t.getMajorTickTextDirection()},t.prototype.toMajorTickTextColor=function(t,n){return null!=n?n:t.getMajorTickTextColor()},t.prototype.toLabel=function(t,n){var i=null==n?void 0:n.label;if(i)return{value:i.value,color:this.toLabelColor(t,i.color),alpha:i.alpha,family:i.family,size:i.size,weight:i.weight,align:this.toLabelAlign(t,i.align),offset:this.toLabelOffset(t,i.offset),style:i.style,outline:this.toLabelOutline(t,i.outline),spacing:this.toLabelSpacing(t,i.spacing),direction:this.toLabelDirection(t,i.direction),padding:this.toLabelPadding(t,i.padding),clipping:i.clipping}},t.prototype.toLabelOutline=function(t,n){if(n)return{enable:n.enable,color:n.color,alpha:n.alpha,width:n.width}},t.prototype.toLabelAlign=function(t,n){var i,r,e=this.P;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelAlignHorizontal(e),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelAlignVertical(e)}},t.prototype.toLabelOffset=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelSpacing=function(t,n){if(n)return{horizontal:n.horizontal,vertical:n.vertical}},t.prototype.toLabelPadding=function(t,n){var i,r;return{horizontal:null!==(i=null==n?void 0:n.horizontal)&&void 0!==i?i:t.getLabelPaddingHorizontal(),vertical:null!==(r=null==n?void 0:n.vertical)&&void 0!==r?r:t.getLabelPaddingVertical()}},t.prototype.toLabelDirection=function(t,n){return null!=n?n:t.getLabelDirection()},t.prototype.toLabelColor=function(t,n){return null!=n?n:t.getLabelColor()},t}(),Kb=function(){function t(t){var n=this.toTheme(t);this.Xt=n,this.ae=0;var i=new Xb(n,t);this.yc=i.coordinateIndex,this.Bn=i.padding,this.P=i.position;var r=i.tick;this.kc=r,this.Bu=i.label,this.Lc=i.bar;var e=r.major.count,u=r.minor.count;this.xc=new Float64Array(3*e),this.Bc=new Float64Array((e+1)*u*3)}return Object.defineProperty(t.prototype,"position",{get:function(){return this.P},enumerable:!1,configurable:!0}),t.prototype.updateBar=function(t){var n=this.Lc.shape;if(n){var i=t.plotArea,r=i.width,e=i.height,u=this.Bn*this.ae;n.disallowUploadedUpdate();var s=n.transform.position,h=n.size;switch(this.P){case Vb.TOP:s.set(.5*r,0-u),h.set(r,0);break;case Vb.BOTTOM:s.set(.5*r,e+u),h.set(r,0);break;case Vb.LEFT:s.set(0-u,.5*e),h.set(0,e);break;case Vb.RIGHT:s.set(r+u,.5*e),h.set(0,e)}n.allowUploadedUpdate()}},t.prototype.updateTicksX=function(t,n,i,r,e,u,s,h,o){var a=this.kc,c=a.major.count,f=a.major.formatter,l=a.minor.count,v=(c+1)*l,b=this.xc,d=this.Bc;i.ticks(t,n,c,l,v,b,d);for(var g=h.a,m=h.tx,w=0;w<c;++w){var p=r[w],O=3*w,D=b[O+0];if(Gu(D))p.visible=!1,u&&(u[w].visible=!1);else{var E=g*b[O+1]+m,M=b[O+2];if(p.disallowUploadedUpdate(),p.visible=!0,p.transform.position.set(E,s),p.text.value=f.format(D,M),p.allowUploadedUpdate(),u){var S=u[w];S.disallowUploadedUpdate(),S.visible=!0,S.transform.position.set(E,.5*o),S.size.set(0,o),S.allowUploadedUpdate()}}}for(w=0;w<v;++w){var T=e[w],j=3*w,N=d[j+0],I=d[j+1];Gu(N)?T.visible=!1:(T.disallowUploadedUpdate(),T.visible=!0,T.transform.position.set(g*I+m,s),T.allowUploadedUpdate())}},t.prototype.updateTicksY=function(t,n,i,r,e,u,s,h,o){var a=this.kc,c=a.major.count,f=a.major.formatter,l=a.minor.count,v=(c+1)*l,b=this.xc,d=this.Bc;i.ticks(t,n,c,l,v,b,d);for(var g=h.d,m=h.ty,w=0;w<c;++w){var p=r[w],O=3*w,D=b[O+0];if(Gu(D))p.visible=!1,u&&(u[w].visible=!1);else{var E=g*b[O+1]+m,M=b[O+2];if(p.disallowUploadedUpdate(),p.visible=!0,p.transform.position.set(s,E),p.text.value=f.format(D,M),p.allowUploadedUpdate(),u){var S=u[w];S.disallowUploadedUpdate(),S.visible=!0,S.transform.position.set(.5*o,E),S.size.set(o,0),S.allowUploadedUpdate()}}}for(w=0;w<v;++w){var T=e[w],j=3*w,N=d[j+0],I=d[j+1];Gu(N)?T.visible=!1:(T.disallowUploadedUpdate(),T.visible=!0,T.transform.position.set(s,g*I+m),T.allowUploadedUpdate())}},t.prototype.updateTicks=function(t){var n=this.kc,i=n.major.shapes,r=n.minor.shapes;if(i&&r){var e=t.plotArea,u=e.getBoundsInContainer(),s=e.container.transform.localTransform,h=n.major.gridline.shapes,o=this.yc,a=this.Bn*this.ae,c=void 0;switch(this.P){case Vb.TOP:if(c=e.coordinate.x.get(o)){var f=c.unmap(c.transform.unmap(u.x)),l=c.unmap(c.transform.unmap(u.x+u.width)),v=e.height;this.updateTicksX(f,l,c,i,r,h,0-a,s,v)}break;case Vb.BOTTOM:(c=e.coordinate.x.get(o))&&(f=c.unmap(c.transform.unmap(u.x)),l=c.unmap(c.transform.unmap(u.x+u.width)),v=e.height,this.updateTicksX(f,l,c,i,r,h,v+a,s,v));break;case Vb.LEFT:if(c=e.coordinate.y.get(o)){f=c.unmap(c.transform.unmap(u.y)),l=c.unmap(c.transform.unmap(u.y+u.height));var b=e.width;this.updateTicksY(f,l,c,i,r,h,0-a,s,b)}break;case Vb.RIGHT:(c=e.coordinate.y.get(o))&&(f=c.unmap(c.transform.unmap(u.y)),l=c.unmap(c.transform.unmap(u.y+u.height)),b=e.width,this.updateTicksY(f,l,c,i,r,h,b+a,s,b))}}},t.prototype.bind=function(t,n){this.tc=t,this.ae=n;var i=t.container,r=this.Lc,e=r.shape;if(!e){var u=(f=this.P)===Vb.LEFT||f===Vb.RIGHT?Q.TOP:Q.LEFT,s=r.style||U.NONE;(e=new Gt).points.position=u,e.points.style=s,e.stroke.copy(r.stroke),e.text.copy(this.Bu),this.Lc.shape=e}e.attach(t.container);var h=this.kc,o=h.major,a=o.gridline,c=a.shapes;if(!c&&h.enable&&a.enable){c=[],a.shapes=c;for(var f,l=(f=this.P)===Vb.LEFT||f===Vb.RIGHT?Q.LEFT:Q.TOP,v=o.count,b=a.style||U.NONE,d=0;d<v;++d){var g=new Gt;g.points.position=l,g.points.style=b,g.stroke.copy(a.stroke),c.push(g)}}if(c){d=0;for(var m=c.length;d<m;++d)c[d].attach(i)}var w=o.shapes;if(!w&&h.enable){w=[],o.shapes=w;var p=o.count,O=o.size,D=o.position,E=o.style||U.NONE;for(d=0;d<p;++d){var M=new Gt;M.points.position=D,M.points.size=O,M.points.style=E,M.stroke.copy(o.stroke),M.text.copy(o.text),M.size.set(0,0),w.push(M)}}if(w)for(d=0,m=w.length;d<m;++d)w[d].attach(i);var S=h.minor,T=S.shapes;if(!T&&h.enable){T=[],S.shapes=T;var j=S.count,N=S.size,I=S.position,C=S.style||U.NONE;for(d=0,m=(o.count+1)*j;d<m;++d){var A=new Gt;A.points.position=I,A.points.size=N,A.points.style=C,A.stroke.copy(S.stroke),A.size.set(0,0),T.push(A)}}if(T)for(d=0,m=T.length;d<m;++d)T[d].attach(i)},t.prototype.unbind=function(){var t=this.Lc.shape;t&&t.detach();var n=this.kc,i=n.major.shapes;if(i)for(var r=0,e=i.length;r<e;++r)i[r].detach();var u=n.major.gridline.shapes;if(u)for(r=0,e=u.length;r<e;++r)u[r].detach();var s=n.minor.shapes;if(s)for(r=0,e=s.length;r<e;++r)s[r].detach();this.tc=void 0},t.prototype.update=function(){var t=this.tc;t&&(this.updateBar(t),this.updateTicks(t))},t.prototype.destroy=function(){var t=this.Lc.shape;t&&t.destroy();var n=this.kc,i=n.major.shapes;if(i)for(var r=0,e=i.length;r<e;++r)i[r].destroy();var u=n.major.gridline.shapes;if(u)for(r=0,e=u.length;r<e;++r)u[r].destroy();var s=n.minor.shapes;if(s)for(r=0,e=s.length;r<e;++r)s[r].destroy();this.tc=void 0},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartAxisBase"},t}(),Yb=function(){function t(t,n){this._c=t,this.tc=new ee,this.Sn=new Map;var i=n&&n.list;if(i)for(var r=0,e=i.length;r<e;++r)this.add(i[r])}return Object.defineProperty(t.prototype,"container",{get:function(){return this.tc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this._c},enumerable:!1,configurable:!0}),t.prototype.add=function(t){var n=this.Sn,i=n.get(t.position);null==i&&(i=[],n.set(t.position,i)),i.push(t),t.bind(this,i.length-1)},t.prototype.get=function(t,n){var i=this.Sn.get(t);return i&&0<=n&&n<i.length?i[n]:null},t.prototype.indexOf=function(t){var n=this.Sn.get(t.position);return n?n.indexOf(t):-1},t.prototype.clear=function(t){var n=this.Sn.get(t);if(n){for(var i=0,r=n.length;i<r;++i)n[i].destroy();n.length=0}return this},t.prototype.size=function(t){var n=this.Sn.get(t);return n?n.length:0},t.prototype.update=function(){this.Sn.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].update()}))},t.prototype.destroy=function(){this.Sn.forEach((function(t){for(var n=0,i=t.length;n<i;++n)t[n].destroy();t.length=0}))},t}(),Jb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisX"},n}(Kb),Zb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisXDatetime"},n}(Jb),qb=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartAxisY"},n}(Kb),$b=[1095651,16667680,15778578,1858929],Qb=[$b[0],wt.brighten($b[0],.4),$b[1],wt.brighten($b[1],.4),$b[2],wt.brighten($b[2],.4),$b[3],wt.brighten($b[3],.4)],td=function(t){return Qb[t%Qb.length]},nd={X:0,Y:1},id=function(){function t(t,n){this.tc=t,this.Gt=n,this.Sn=[]}return Object.defineProperty(t.prototype,"container",{get:function(){return this.tc},enumerable:!1,configurable:!0}),t.prototype.add=function(t,n){var i=this.Sn;return null==n?i.push(t):0<=n&&n<i.length?i.splice(n,0,t):i.push(t),t.bind(this,this.Gt),this},t.prototype.get=function(t){var n=this.Sn;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Sn.indexOf(t)},t.prototype.remove=function(t){var n=this.Sn;if(Xt(t)){if(0<=(r=t)&&r<n.length){var i=n.splice(r,1)[0];return i.unbind(),i}}else{var r,e=t;if(0<=(r=n.indexOf(e)))return n.splice(r,1),e.unbind(),e}return null},t.prototype.clear=function(){for(var t=this.Sn,n=0,i=t.length;n<i;++n)t[n].unbind();return t.length=0,this},t.prototype.destroy=function(){return this.clear()},t.prototype.size=function(){return this.Sn.length},t.prototype.fit=function(t,n){for(var i=this.Sn,r=0,e=i.length;r<e;++r)i[r].fit(t,n);return this},t.prototype.mark=function(t,n){for(var i=this.Sn,r=0,e=i.length;r<e;++r)i[r].mark(t,n);return this},t.prototype.blend=function(t){for(var n=this.Sn,i=0,r=n.length;i<r;++i)n[i].blend(t);return this},t}(),rd=function(){function t(t,n){this._c=t;var i=new id(this,nd.X);this._x=i;var r=new id(this,nd.Y);if(this._y=r,n){var e=n.x;if(e)if(Wt(e))for(var u=0,s=e.length;u<s;++u)i.add(e[u]);else i.add(e);var h=n.y;if(h)if(Wt(h))for(u=0,s=h.length;u<s;++u)r.add(h[u]);else r.add(h)}}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this._c},enumerable:!1,configurable:!0}),t.prototype.fit=function(t,n,i,r){return this._x.fit(t,n),this._y.fit(i,r),this},t.prototype.mark=function(t,n,i,r){return this._x.mark(t,n),this._y.mark(i,r),this},t.prototype.blend=function(t){return this._x.blend(t),this._y.blend(t),this},t}(),ed=function(){function t(t){this.Xt=t}return t.prototype.calcStepMajor=function(t,n,i){if(0<i){var r=Math.abs(n-t)/i,e=Math.floor(Math.log(r)/Math.LN10),u=Math.pow(10,e);return this.Xt.toStepScale(r/u)*u}return-1},t.prototype.calcStepMinor=function(t,n){return 0<=t?t/(n+1):-1},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h){if(!(i<=0)){var o=h.transform,a=Math.min(t,n),c=Math.max(t,n),f=this.calcStepMajor(a,c,i);if(f<=0){u[0]=a,u[1]=o.map(h.map(a)),u[2]=0;for(var l=1;l<i;++l)u[0+(M=3*l)]=NaN,u[M+1]=NaN,u[M+2]=NaN;for(l=0;l<e;++l)s[0+(S=3*l)]=NaN,s[S+1]=NaN,s[S+2]=NaN}else{var v=Math.floor(a/f)-1,b=Math.ceil(c/f)+1,d=this.calcStepMinor(f,r),g=0,m=0;for(l=v;l<=b;++l){var w=l*f;if(g<i&&a<=w&&w<=c){var p=o.map(h.map(w));u[0+(M=3*g)]=w,u[M+1]=p,u[M+2]=f,g+=1}for(var O=0;O<r;O+=1)if(m<e){var D=w+(O+1)*d;if(a<=D&&D<=c){var E=o.map(h.map(D));s[0+(S=3*m)]=D,s[S+1]=E,s[S+2]=d,m+=1}}}for(l=g;l<i;++l){var M;u[0+(M=3*l)]=NaN,u[M+1]=NaN,u[M+2]=NaN}for(l=m;l<e;++l){var S;s[0+(S=3*l)]=NaN,s[S+1]=NaN,s[S+2]=NaN}}}},t}(),ud=function(){function t(t){this.Xt=t,this.k=0,this.Pc=0,this.Tn=1,this.Fc=0,this.Uc=1}return Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"translate",{get:function(){return this.Pc},set:function(t){this.set(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"scale",{get:function(){return this.Tn},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.bind=function(t,n){this.set(0,n===nd.X?1:-1)},t.prototype.unbind=function(){},t.prototype.set=function(t,n){var i=!1;null!=t&&this.Pc!==t&&(i=!0,this.Pc=t),null!=n&&this.Tn!==n&&(i=!0,this.Tn=n),i&&(this.k+=1,this.Uc=this.Xt.isZero(this.Tn)?0:1/this.Tn,this.Fc=-this.Pc*this.Uc)},t.prototype.blend=function(t,n){var i=1-t,r=n.newTranslate*t+n.oldTranslate*i,e=n.newScale*t+n.oldScale*i;this.set(r,e)},t.prototype.map=function(t){return this.Pc+this.Tn*t},t.prototype.mapAll=function(t,n,i,r,e){for(var u=this.Pc,s=this.Tn,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t.prototype.unmap=function(t){return this.Fc+this.Uc*t},t.prototype.unmapAll=function(t,n,i,r,e){for(var u=this.Fc,s=this.Uc,h=n+e;h<i;h+=r)t[h]=u+s*t[h]},t}(),sd=function(){function t(){this.oldTranslate=0,this.oldScale=1,this.newTranslate=0,this.newScale=1}return t.prototype.set=function(t,n){null!=t&&(this.newTranslate=t),null!=n&&(this.newScale=n)},t}(),hd=function(){function t(t,n){this.from=t,this.to=n}return t.prototype.set=function(t,n){return null!=t&&(this.from=t),null!=n&&(this.to=n),this},t.prototype.add=function(t,n){return Gu(t)||(this.from=Gu(this.from)?t:Math.min(this.from,t)),Gu(n)||(this.to=Gu(this.to)?n:Math.max(this.to,n)),this},t.prototype.clear=function(){return this.from=NaN,this.to=NaN,this},t}(),od=function(){function t(t){this.k=0,this.Gt=nd.X;var n=this.toTheme(t);this.Xt=n,this.C=new ud(n),this.kc=new ed(n),this.je=new hd(NaN,NaN),this.Gc=new sd}return t.prototype.bind=function(t,n){this.tc=t,this.Gt=n,this.C.bind(t,n)},t.prototype.unbind=function(){this.tc=void 0,this.C.unbind()},t.prototype.fit=function(t,n){this.doFit(t,n,this.C)},t.prototype.mark=function(t,n){var i=this.Gc,r=this.C;i.oldTranslate=r.translate,i.oldScale=r.scale,this.doFit(t,n,i)},t.prototype.blend=function(t){this.C.blend(t,this.Gc)},t.prototype.doFit=function(t,n,i){var r=this.tc;if(r){var e=r.container.plotArea,u=e.padding,s=this.je;switch(this.Gt){case nd.X:this.zc(u.getLeft(),e.width-u.getRight(),this.toFitDomain(t,n,e,s),i);break;case nd.Y:this.zc(e.height-u.getBottom(),u.getTop(),this.toFitRange(t,n,e,s),i)}}},t.prototype.toFitDomain=function(t,n,i,r){return null!=t&&null!=n||i.series.getDomain(this,r),r.set(t,n),r},t.prototype.toFitRange=function(t,n,i,r){return null!=t&&null!=n||i.series.getRange(this,r),r.set(t,n),r},t.prototype.zc=function(t,n,i,r){var e=i.from,u=i.to;if(!Gu(e)&&!Gu(u)){var s,h=u-e,o=t-e*(s=this.Xt.isZero(h)?n<t?-1:1:(n-t)/h);r.set(o,s)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this.C},enumerable:!1,configurable:!0}),t.prototype.map=function(t){return t},t.prototype.mapAll=function(t,n,i,r,e){},t.prototype.unmap=function(t){return t},t.prototype.unmapAll=function(t,n,i,r,e){},t.prototype.ticks=function(t,n,i,r,e,u,s){this.kc.calculate(t,n,i,r,e,u,s,this)},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateLinear"},t}(),ad=function(){function t(t){this.Xt=t}return t.prototype.calcStepMajor=function(t,n,i){if(0<i){var r=Math.abs(n-t)/i,e=Math.floor(Math.log(r)/Math.LN10),u=Math.pow(10,e);return this.Xt.toStepScale(r/u)*u}return-1},t.prototype.calcStepMinor=function(t,n){return 0<=t?t/(n+1):-1},t.prototype.calcTickMinorPositions=function(t,n,i,r,e,u,s){for(var h=0;h<n;h+=1){var o=i+(h+1)*t;r<=o&&o<=e&&(s[u++]=o)}},t.prototype.calculate=function(t,n,i,r,e,u,s,h){if(!(i<=0)){var o=h.transform,a=h.map(t),c=h.map(n),f=Math.min(a,c),l=Math.max(a,c),v=this.calcStepMajor(f,l,i);if(v<=0){var b=Math.min(t,n);u[0]=b,u[1]=o.map(h.map(b)),u[2]=0;for(var d=1;d<i;++d)u[0+(A=3*d)]=NaN,u[A+1]=NaN,u[A+2]=NaN;for(d=0;d<e;++d)s[0+(R=3*d)]=NaN,s[R+1]=NaN,s[R+2]=NaN}else{var g=Math.floor(f/v)-1,m=Math.ceil(l/v)+1,w=this.calcStepMinor(v,r),p=0,O=0;for(d=g;d<=m;++d){var D=d*v;if(p<i&&f<=D&&D<=l){var E=h.unmap(D),M=o.map(D),S=h.unmap(D-1);u[0+(A=3*p)]=E,u[A+1]=M,u[A+2]=S,p+=1}for(var T=0;T<r;T+=1)if(O<e){var j=D+(T+1)*w;if(f<=j&&j<=l){var N=h.unmap(j),I=o.map(j),C=h.unmap(j-1);s[0+(R=3*O)]=N,s[R+1]=I,s[R+2]=C,O+=1}}}for(d=p;d<i;++d){var A;u[0+(A=3*d)]=NaN,u[A+1]=NaN,u[A+2]=NaN}for(d=O;d<e;++d){var R;s[0+(R=3*d)]=NaN,s[R+1]=NaN,s[R+2]=NaN}}}},t}(),cd=function(){function t(t){this.k=0,this.Gt=nd.X;var n=this.toTheme(t);this.Xt=n,this.C=new ud(n),this.kc=new ad(n),this.je=new hd(NaN,NaN),this.Gc=new sd}return t.prototype.bind=function(t,n){this.tc=t,this.Gt=n},t.prototype.unbind=function(){this.tc=void 0},t.prototype.fit=function(t,n){this.doFit(t,n,this.C)},t.prototype.mark=function(t,n){var i=this.Gc,r=this.C;i.oldTranslate=r.translate,i.oldScale=r.scale,this.doFit(t,n,i)},t.prototype.blend=function(t){this.C.blend(t,this.Gc)},t.prototype.doFit=function(t,n,i){var r=this.tc;if(r){var e=r.container.plotArea,u=e.padding,s=this.je;switch(this.Gt){case nd.X:this.zc(u.getLeft(),e.width-u.getRight(),this.toFitDomain(t,n,e,s),i);break;case nd.Y:this.zc(e.height-u.getBottom(),u.getTop(),this.toFitRange(t,n,e,s),i)}}},t.prototype.toFitDomain=function(t,n,i,r){return null!=t&&null!=n||i.series.getDomain(this,r),r.set(t,n),r},t.prototype.toFitRange=function(t,n,i,r){return null!=t&&null!=n||i.series.getRange(this,r),r.set(t,n),r},t.prototype.zc=function(t,n,i,r){var e=i.from,u=i.to;if(!Gu(e)&&!Gu(u)){var s,h=this.map(e),o=this.map(u)-h,a=t-h*(s=this.Xt.isZero(o)?n<t?-1:1:(n-t)/o);r.set(a,s)}},Object.defineProperty(t.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"transform",{get:function(){return this.C},enumerable:!1,configurable:!0}),t.prototype.map=function(t){return Math.log(Math.max(0,t))/Math.LN10},t.prototype.mapAll=function(t,n,i,r,e){for(var u=1/Math.LN10,s=n+e;s<i;s+=r){var h=t[s];t[s]=Math.log(Math.max(0,h))*u}},t.prototype.unmap=function(t){return Math.pow(10,t)},t.prototype.unmapAll=function(t,n,i,r,e){for(var u=n+e;u<i;u+=r)t[u]=Math.pow(10,t[u])},t.prototype.ticks=function(t,n,i,r,e,u,s){this.kc.calculate(t,n,i,r,e,u,s,this)},t.prototype.toTheme=function(t){return t&&t.theme||this.getThemeDefault()},t.prototype.getThemeDefault=function(){return K.getInstance().get(this.getType())},t.prototype.getType=function(){return"DChartCoordinateLog"},t}(),fd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegendItem"},n}(Ki),ld=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartLegend"},n}(Ki),vd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DChartOverview"},n}(Ki),bd=function(n){function i(i){var r=n.call(this)||this,e=r.transform;return r.P=new Ei(e.position,i),r.Tn=new Ei(e.scale,i),r.Ci=new t.Rectangle,r}return _(i,n),Object.defineProperty(i.prototype,"position",{get:function(){return this.P},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"scale",{get:function(){return this.Tn},enumerable:!1,configurable:!0}),i.prototype.getBounds=function(t,i){return this._lastBoundsID=-1,n.prototype.getBounds.call(this,t,i)},i.prototype.calculateBounds=function(){var t=this._bounds,n=this.je,i=this.Ci,r=this.transform.worldTransform,e=0,u=0,s=0,h=0,o=this.children;if(0<o.length)for(var a=!0,c=0,f=o.length;c<f;++c){var l=o[c];l.visible&&(l.getBoundsInternal(n,!1,i),a?(a=!1,e=i.x,s=i.y,u=i.x+i.width,h=i.y+i.height):(e=Math.min(e,i.x),s=Math.min(s,i.y),u=Math.max(u,i.x+i.width),h=Math.max(h,i.y+i.height)))}t.clear(),n.set(e,s),r.apply(n,n),t.addPoint(n),n.set(u,h),r.apply(n,n),t.addPoint(n)},i}(ee),dd=function(){function t(){this.shape=null,this.x=0,this.y=0,this.p0x=0,this.p0y=0,this.p1x=0,this.p1y=0,this.index=0,this.t=0,this.distance=0}return t.prototype.copyFrom=function(t){return this.shape=t.shape,this.x=t.x,this.y=t.y,this.p0x=t.p0x,this.p0y=t.p0y,this.p1x=t.p1x,this.p1y=t.p1y,this.index=t.index,this.t=t.t,this.distance=t.distance,this},t}(),gd=function(){function t(t,n,i){this.enable=t,this.color=n,this.alpha=i}return t.from=function(n,i,r){var e,u,s;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i))},t}(),md=function(){function t(){}return t.from=function(t,n){return Wt(t)?function(n){return t[n%t.length]}:ot(t)?t:null!=t?function(){return t}:Wt(n)?function(t){return n[t%n.length]}:ot(n)?n:function(){return n}},t}(),wd=function(t){this.enable=md.from(null==t?void 0:t.enable,!0),this.color=md.from(null==t?void 0:t.color,td),this.alpha=md.from(null==t?void 0:t.alpha,Y.FILL_ALPHA)},pd=function(){function t(t,n){this.outer=t,this.inner=n}return t.from=function(n,i,r){var e,u;return new t(null!==(e=null==r?void 0:r.outer)&&void 0!==e?e:n.outer(i),null!==(u=null==r?void 0:r.inner)&&void 0!==u?u:n.inner(i))},t}(),Od=function(t){this.outer=md.from(null==t?void 0:t.outer,.2),this.inner=md.from(null==t?void 0:t.inner,.1)},Dd=function(){function t(t,n){this.x=t,this.y=n}return t.from=function(n,i,r,e,u){var s,h;return new t(null!==(s=null==r?void 0:r.x)&&void 0!==s?s:null!=n.x?n.x(i):e,null!==(h=null==r?void 0:r.y)&&void 0!==h?h:null!=n.y?n.y(i):u)},t}(),Ed=function(t){t&&(null!=t.x&&(this.x=md.from(t.x,0)),null!=t.y&&(this.y=md.from(t.y,0)))},Md=function(){function t(t,n,i,r,e,u,s){this.enable=t,this.color=n,this.alpha=i,this.width=r,this.align=e,this.side=u,this.style=s}return t.from=function(n,i,r){var e,u,s,h,o,a,c;return new t(null!==(e=null==r?void 0:r.enable)&&void 0!==e?e:n.enable(i),null!==(u=null==r?void 0:r.color)&&void 0!==u?u:n.color(i),null!==(s=null==r?void 0:r.alpha)&&void 0!==s?s:n.alpha(i),null!==(h=null==r?void 0:r.width)&&void 0!==h?h:n.width(i),null!==(o=null==r?void 0:r.align)&&void 0!==o?o:n.align(i),null!==(a=null==r?void 0:r.side)&&void 0!==a?a:n.side(i),null!==(c=null==r?void 0:r.style)&&void 0!==c?c:n.style(i))},t}(),Sd=function(t){this.enable=md.from(null==t?void 0:t.enable,!0),this.color=md.from(null==t?void 0:t.color,td),this.alpha=md.from(null==t?void 0:t.alpha,Y.STROKE_ALPHA),this.width=md.from(null==t?void 0:t.width,Y.STROKE_WIDTH),this.align=md.from(null==t?void 0:t.width,Y.STROKE_ALIGN),this.side=md.from(null==t?void 0:t.side,xt.ALL),this.style=md.from(null==t?void 0:t.style,s.NON_SCALING)},Td=function(){function t(t,n){var i;this._c=t,this.Hc=new hd(NaN,NaN),this.Vc=new hd(NaN,NaN),this.hc=null!==(i=null==n?void 0:n.selection)&&void 0!==i?i:null,this.A=new wd(null==n?void 0:n.fill),this.Wh=new Sd(null==n?void 0:n.stroke),this.I=new Ed(null==n?void 0:n.size),this.Jt=new Ed(null==n?void 0:n.offset),this.Bn=new Od(null==n?void 0:n.padding),this.Sn=[];var r=n&&n.list;if(r){var e=r.length;if(0<e){for(var u=0;u<e;++u)this.add(r[u]);this.update()}}}return t.prototype.newFill=function(t,n){return gd.from(this.A,t,n)},t.prototype.newStroke=function(t,n){return Md.from(this.Wh,t,n)},t.prototype.newSize=function(t,n,i,r){return Dd.from(this.I,t,n,i,r)},t.prototype.newOffset=function(t,n,i,r){return Dd.from(this.Jt,t,n,i,r)},t.prototype.newPadding=function(t,n){return pd.from(this.Bn,t,n)},Object.defineProperty(t.prototype,"plotArea",{get:function(){return this._c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),t.prototype.update=function(){for(var t=this.Sn,n=0,i=t.length;n<i;++n)t[n].update();var r=this.hc;r&&r.update()},t.prototype.add=function(t){var n=this.Sn;t.bind(this,n.length),n.push(t)},t.prototype.get=function(t){var n=this.Sn;return 0<=t&&t<n.length?n[t]:null},t.prototype.indexOf=function(t){return this.Sn.indexOf(t)},t.prototype.clear=function(){for(var t=this.Sn,n=0,i=t.length;n<i;++n)t[n].destroy();return t.length=0,this},t.prototype.size=function(){return this.Sn.length},t.prototype.destroy=function(){this.clear();var t=this.hc;t&&t.unbind()},t.prototype.getDomain=function(t,n){n.clear();for(var i=this.Sn,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.x===t){var s=u.domain;n.add(s.from,s.to)}}return n},t.prototype.getRange=function(t,n){n.clear();for(var i=this.Sn,r=0,e=i.length;r<e;++r){var u=i[r];if(u.coordinate.y===t){var s=u.range;n.add(s.from,s.to)}}return n},Object.defineProperty(t.prototype,"domain",{get:function(){var t=this.Hc;t.clear();for(var n=this.Sn,i=0,r=n.length;i<r;++i){var e=n[i].domain;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"range",{get:function(){var t=this.Vc;t.clear();for(var n=this.Sn,i=0,r=n.length;i<r;++i){var e=n[i].range;t.add(e.from,e.to)}return t},enumerable:!1,configurable:!0}),t.prototype.hitTest=function(t,n){for(var i=this.Sn,r=i.length-1;0<=r;--r){var e=i[r];if(e.hitTest(t,n))return e}return null},t.prototype.calcHitPoint=function(n,i,r){var e=r,u=t.WORK_CALCHITPOINT,s=this.Sn,h=null;u.distance=1/0;for(var o=s.length-1;0<=o;--o){var a=s[o];if(a.calcHitPoint(n,i,e)&&e.distance<u.distance){h=a;var c=e;e=u,u=c}}return h&&u!==r&&r.copyFrom(u),h},t.WORK_CALCHITPOINT=new dd,t}(),jd=function(n){function i(t,i){var r=n.call(this,i)||this;return r.Wc=t,r.Xc=0,r.Kc=1e3,r.Yc=null,r.Jc=function(){r.onBlend()},r}return _(i,n),i.prototype.init=function(i){var r,e=this;n.prototype.init.call(this,i);var u=new bd((function(){e.Zc=!0,e.qc=!0,rt.update(e)}));this.tc=u,this.$c=new rd(this,null==i?void 0:i.coordinate);var s=new Td(this,null==i?void 0:i.series);this.Qc=s;var h=new Yb(this,null==i?void 0:i.axis);this.tf=h,this.Zc=!0,this.qc=!0,this.nf=new t.Rectangle,this.Th=new t.Point,this.addChild(u),this.addChild(h.container),this.Ji=new sr(this,(function(){return u}),null==i?void 0:i.view);var o=s.selection;o&&o.bind(s),(null!==(r=null==i?void 0:i.mask)&&void 0!==r?r:this.theme.isOverflowMaskEnabled())&&(u.mask=this.getOverflowMask())},i.prototype.onResize=function(t,i,r,e){this.Zc=!0,this.qc=!0,n.prototype.onResize.call(this,t,i,r,e)},i.prototype.getOverflowMask=function(){return null==this.Zi&&(this.Zi=new Yi(this),this.reflowable.add(this.Zi),this.toDirty()),this.Zi},Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.$c},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"chart",{get:function(){return this.Wc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"series",{get:function(){return this.Qc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"container",{get:function(){return this.tc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"axis",{get:function(){return this.tf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"view",{get:function(){return this.Ji},enumerable:!1,configurable:!0}),i.prototype.onWheel=function(t,i,r){var e=this.Ji.onWheel(t,i,r),u=n.prototype.onWheel.call(this,t,i,r);return e||u},i.prototype.onDblClick=function(t,i){var r=this.Ji.onDblClick(t,i),e=n.prototype.onDblClick.call(this,t,i);return r||e},i.prototype.onDown=function(t){this.Ji.onDown(t),n.prototype.onDown.call(this,t)},i.prototype.render=function(t){if(this.Zc){this.Zc=!1,this.tf.update();var i=this.Qc.selection;i&&i.update()}n.prototype.render.call(this,t)},i.prototype.destroy=function(){this.tc.destroy(),this.Qc.destroy(),this.tf.destroy()},i.prototype.getType=function(){return"DChartPlotArea"},i.prototype.getBoundsInContainer=function(){var t=this.nf;if(this.qc){this.qc=!1;var n=this.container;n.updateTransform();var i=n.transform.localTransform,r=this.Th;r.set(0,0),i.applyInverse(r,r),t.x=r.x,t.y=r.y,r.set(this.width,this.height),i.applyInverse(r,r),t.width=r.x-t.x,t.height=r.y-t.y}return t},i.prototype.fit=function(t,n,i,r,e){var u=this.$c,s=this.tf,h=this.Qc;if(null!=t&&t<=0)u.fit(n,i,r,e),s.update(),h.update();else{this.Kc=null!=t?t:200,this.Xc=Date.now(),u.mark(n,i,r,e);var o=this.Yc;null!=o&&window.clearTimeout(o),this.Yc=window.setTimeout(this.Jc,0)}return this},i.prototype.onBlend=function(){var t=(Date.now()-this.Xc)/this.Kc;t<1?this.Yc=window.setTimeout(this.Jc,0):(this.Yc=null,t=1),this.$c.blend(Qi.ELASTIC(t)),this.tf.update(),this.Qc.update()},i}(Ki),Nd=function(){function t(t,n,i){this.Nt=t,this.It=n,this.q=i}return Object.defineProperty(t.prototype,"from",{get:function(){return this.Nt},set:function(t){this.set(t,void 0)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.It},set:function(t){this.set(void 0,t)},enumerable:!1,configurable:!0}),t.prototype.set=function(t,n){var i=!1;return null!=t&&this.Nt!==t&&(Gu(this.Nt)&&Gu(t)||(this.Nt=t,i=!0)),null!=n&&this.It!==n&&(Gu(this.It)&&Gu(n)||(this.It=n,i=!0)),i&&this.q(),this},t.prototype.add=function(t,n){var i,r;return Gu(t)||(i=Gu(this.from)?t:Math.min(this.from,t)),Gu(n)||(r=Gu(this.to)?n:Math.max(this.to,n)),this.set(i,r)},t.prototype.clear=function(){return this.set(NaN,NaN)},t}(),Id=function(){function t(t){var n,i,r,e=this.toTheme(t);this.Xt=e;var u=(new ct).add(null!==(n=null==t?void 0:t.state)&&void 0!==n?n:ht.HOVERED);this.Et=u,this.Gu=null!==(i=null==t?void 0:t.enable)&&void 0!==i?i:e.isEnabled(u),this.me=null==t?void 0:t.shape,this._=null!==(r=null==t?void 0:t.style)&&void 0!==r?r:this.setStyle}return t.prototype.bind=function(t){if(this.Gu){var n=this.me||this.newShape(this.Xt);this.me=n,n.attach(t.plotArea.axis.container),n.visible=!1}},t.prototype.unbind=function(){var t=this.me;t&&t.detach()},t.prototype.newShape=function(t){return t.newShape(this.Et)},t.prototype.set=function(t,n,i){this.update(t,n);var r=this.me;r&&this._(r,i)},t.prototype.setStyle=function(t,n){var i=n.shape;i&&(t.stroke.color=i.stroke.color)},t.prototype.unset=function(){var t=this.me;t&&(t.visible=!1)},t.prototype.toTheme=function(t){var n=null==t?void 0:t.theme;return at(n)?this.getTheme(n):null!=n?n:this.getTheme(this.getType())},t.prototype.getTheme=function(t){return K.getInstance().get(t)},t}(),Cd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n){var i=this.me;if(i){var r=n.x,e=t.plotArea.height;i.transform.position.set(r,.5*e),i.size.set(0,e),i.visible=this.isVisible(t,r)}},n.prototype.isVisible=function(t,n){return 0<=n&&n<=t.plotArea.width},n.prototype.getType=function(){return"DChartSelectionGridlineX"},n}(Id),Ad=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n){var i=this.me;if(i){var r=n.y,e=t.plotArea.width;i.transform.position.set(.5*e,r),i.size.set(e,0),i.visible=this.isVisible(t,r)}},n.prototype.isVisible=function(t,n){return 0<=n&&n<=t.plotArea.height},n.prototype.getType=function(){return"DChartSelectionGridlineY"},n}(Id),Rd=function(){function t(t){this._x=new Cd(null==t?void 0:t.x),this._y=new Ad(null==t?void 0:t.y)}return Object.defineProperty(t.prototype,"x",{get:function(){return this._x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return this._y},enumerable:!1,configurable:!0}),t.prototype.bind=function(t){this._x.bind(t),this._y.bind(t)},t.prototype.unbind=function(){this._x.unbind(),this._y.unbind()},t.prototype.set=function(t,n,i){this._x.set(t,n,i),this._y.set(t,n,i)},t.prototype.unset=function(){this._x.unset(),this._y.unset()},t.prototype.update=function(t,n){this._x.update(t,n),this._y.update(t,n)},t}(),yd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.update=function(t,n){var i=this.me;i&&(i.transform.position.copyFrom(n),i.visible=this.isVisible(t,n))},n.prototype.isVisible=function(t,n){var i=n.x,r=n.y,e=t.plotArea;return 0<=i&&i<=e.width&&0<=r&&r<=e.height},n.prototype.getType=function(){return"DChartSelectionMarker"},n}(Id),kd={PREVIOUS:0,NEXT:1,CLOSER:2,INTERSECTION:3},Ld=function(n){function i(i){var r,e,u,s=n.call(this)||this;s.tc=null,s.Qc=null,s.Gu=null===(r=i.enable)||void 0===r||r,s.if=new Rd(i.gridline),s.R=new yd(i.marker),s.Et=null!==(e=i.state)&&void 0!==e?e:ht.HOVERED,s.rf=null,s.ef=null,s.P=new t.Point,s.tn=null!==(u=i.point)&&void 0!==u?u:kd.CLOSER,s.je=new t.Point;var h=i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return _(i,n),i.prototype.bind=function(t){this.Gu&&(this.tc=t,this.if.bind(t),this.R.bind(t))},i.prototype.unbind=function(){this.R.unbind(),this.if.unbind(),this.tc=null,this.rf=null,this.ef=null},Object.defineProperty(i.prototype,"series",{get:function(){return this.Qc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"position",{get:function(){return this.P},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"gridline",{get:function(){return this.if},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"marker",{get:function(){return this.R},enumerable:!1,configurable:!0}),i.prototype.set=function(t,n){var i=this.tc,r=this.rf=t.coordinate.x,e=this.ef=t.coordinate.y;if(i&&r&&e){var u=i.plotArea.container.localTransform,s=this.P,h=this.je;if(n instanceof dd){var o=n.x,a=n.y;switch(this.tn){case kd.PREVIOUS:o=n.p0x,a=n.p0y;break;case kd.NEXT:o=n.p1x,a=n.p1y;break;case kd.CLOSER:Math.abs(n.p0x-n.x)<Math.abs(n.p1x-n.x)?(o=n.p0x,a=n.p0y):(o=n.p1x,a=n.p1y)}h.set(o,a),u.apply(h,h),s.set(r.unmap(r.transform.unmap(o)),e.unmap(e.transform.unmap(a)))}else s.copyFrom(n.position),h.set(r.transform.map(r.map(s.x)),e.transform.map(e.map(s.y))),u.apply(h,h);this.if.set(i,h,t),this.R.set(i,h,t),rt.update(i.plotArea)}var c=this.Qc;if(c!==t){var f=this.Et;c&&c.state.remove(f),this.Qc=t,t.state.add(f)}this.emit("change",this)},i.prototype.setStyle=function(t,n){var i=n.shape;i&&(t.stroke.color=i.stroke.color)},i.prototype.unset=function(){var t=this.Qc;t&&(this.Qc=null,this.rf=null,this.ef=null,t.state.remove(this.Et),this.if.unset(),this.R.unset(),this.emit("change",this))},i.prototype.update=function(){var t=this.tc,n=this.rf,i=this.ef;if(t&&n&&i){var r=this.P,e=this.je;e.set(n.transform.map(n.map(r.x)),i.transform.map(i.map(r.y))),t.plotArea.container.localTransform.apply(e,e),this.if.update(t,e),this.R.update(t,e)}},i}(t.utils.EventEmitter),xd=function(t){function n(n){var i,r=t.call(this)||this;r.tc=null;var e=di(null!==(i=null==n?void 0:n.point)&&void 0!==i?i:kd.CLOSER,kd);r.na=r.newSelected(e,null==n?void 0:n.selected),r.uf=r.newHovered(e,null==n?void 0:n.hovered);var u=null==n?void 0:n.on;if(null!=u)for(var s in u){var h=u[s];h&&r.on(s,h)}return r.sf=function(t){r.onMove(t)},r.hf=function(t){r.onClick(t)},r}return _(n,t),n.prototype.newSelected=function(t,n){return new Ld(this.toSubOptions(t,n,ht.ACTIVE))},n.prototype.newHovered=function(t,n){return new Ld(this.toSubOptions(t,n,ht.HOVERED))},n.prototype.toSubOptions=function(t,n,i){null==(n=n||{}).point&&(n.point=t),null==n.state&&(n.state=i);var r=n.gridline||{},e=r.x||{};null==e.state&&(e.state=i);var u=r.y||{};null==u.state&&(u.state=i);var s=n.marker||{};return null==s.state&&(s.state=i),n},n.prototype.onClick=function(t){var n=this.tc;if(n&&t.target===n.plotArea){var i=this.uf,r=i.series,e=this.na;r?e.set(r,i):e.unset()}},n.prototype.onMove=function(t){var i=this.tc;if(i){var r=this.uf;if(t.target===i.plotArea){var e=n.WORK_SELECT,u=t.data.global,s=i.calcHitPoint(u.x,u.y,e);s?r.set(s,e):r.unset()}else r.unset()}},n.prototype.bind=function(t){this.tc=t,this.na.bind(t),this.uf.bind(t);var n=t.plotArea;n.on(zi.move,this.sf),zi.onClick(n,this.hf)},n.prototype.unbind=function(){var t=this.tc;this.tc=null,t&&t.plotArea.off(zi.move,this.sf),this.na.unbind(),this.uf.unbind()},Object.defineProperty(n.prototype,"selected",{get:function(){return this.na},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"hovered",{get:function(){return this.uf},enumerable:!1,configurable:!0}),n.prototype.update=function(){this.na.update(),this.uf.update()},n.WORK_SELECT=new dd,n}(t.utils.EventEmitter),Bd=function(){function t(t,n){var i,r;this.O=t,this.af=null!==(i=null==n?void 0:n.x)&&void 0!==i?i:0,this.cf=null!==(r=null==n?void 0:n.y)&&void 0!==r?r:0,this.ff=NaN,this.lf=NaN,this.vf=NaN,this.bf=NaN}return Object.defineProperty(t.prototype,"x",{get:function(){var t=this.O.container;return t?t.plotArea.coordinate.x.get(this.af):null},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){var t=this.O.container;return t?t.plotArea.coordinate.y.get(this.cf):null},enumerable:!1,configurable:!0}),t.prototype.isDirty=function(t,n){var i=t.id,r=n.id,e=i!==this.ff,u=r!==this.lf;return this.ff=i,this.lf=r,e||u},t.prototype.isTransformDirty=function(t,n){var i=t.transform.id,r=n.transform.id,e=i!==this.vf,u=r!==this.bf;return this.vf=i,this.bf=r,e||u},t.prototype.reset=function(){this.ff=NaN,this.lf=NaN},t.prototype.destroy=function(){this.reset()},t}(),_d=function(t){function n(n){var i=t.call(this)||this;i.$c=new Bd(i,null==n?void 0:n.coordinate),i.ae=0,i.Hc=new hd(NaN,NaN),i.Vc=new hd(NaN,NaN),i.df=NaN,i.Et=new ft((function(t,n){i.onStateChange(t,n)}));var r=null==n?void 0:n.on;if(null!=r)for(var e in r){var u=r[e];u&&i.on(e,u)}return i}return _(n,t),n.prototype.bind=function(t,n){this.tc=t,this.$c.reset(),this.ae=n;var i=t.plotArea.chart;i&&(this.Et.parent=i.state)},n.prototype.unbind=function(){this.tc=void 0},Object.defineProperty(n.prototype,"domain",{get:function(){return this.updateRegion(),this.Hc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"range",{get:function(){return this.updateRegion(),this.Vc},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"container",{get:function(){return this.tc||null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.ae},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"coordinate",{get:function(){return this.$c},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.Et},enumerable:!1,configurable:!0}),n.prototype.destroy=function(){this.tc=void 0,this.$c.destroy()},n.prototype.hitTest=function(t,n){return!1},n.prototype.calcHitPoint=function(t,n,i){return!1},n.prototype.onStateChange=function(t,n){var i;this.toDirty();var r=null===(i=this.tc)||void 0===i?void 0:i.plotArea.chart;rt.update(r),this.emit("statechange",t,n,this)},n}(t.utils.EventEmitter),Pd=function(n){function i(t){var i=n.call(this,t)||this;return i.gf=null,i.Nn=t,i.gt=t&&t.points||[],i.mf=0,i.wf=NaN,i}return _(i,n),i.prototype.getSizeDefault=function(){return 10},i.prototype.getOffsetDefault=function(){return 0},i.prototype.bind=function(t,i){var r=this.gf;if(!r){r=this.gf=this.newLineOfAny();var e=this.Nn;this.initLine(r,e,t,i)}r.attach(t.plotArea.container,i),this.wf=NaN,n.prototype.bind.call(this,t,i)},i.prototype.initLine=function(t,n,i,r){var e=i.newFill(r,null==n?void 0:n.fill);this.A=e,t.fill.copy(e);var u=i.newStroke(r,null==n?void 0:n.stroke);this.Wh=u,t.stroke.copy(u);var s=this.getSizeDefault(),h=i.newSize(r,null==n?void 0:n.size,s,s);this.I=h,t.points.size.set(h.x,h.y);var o=this.getOffsetDefault(),a=i.newOffset(r,n&&n.offset,o,o);this.Jt=a,t.points.offset.set(a.x,a.y)},i.prototype.unbind=function(){var t=this.gf;t&&t.detach(),n.prototype.unbind.call(this)},Object.defineProperty(i.prototype,"shape",{get:function(){return this.gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},set:function(t){this.gt=t,this.mf+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){this.mf+=1},i.prototype.update=function(){var t=this.gf;if(t){var n=this.$c,i=n.x,r=n.y;if(i&&r){var e=this.mf,u=e!==this.wf,s=n.isDirty(i,r),h=n.isTransformDirty(i,r);(u||s||h)&&(this.wf=e,this.updateLine(t,i,r))}}},i.prototype.updateLine=function(t,n,r){for(var e=t.points.values,u=e.length,s=0,h=this.gt,o=NaN,a=NaN,c=NaN,f=NaN,l=0,v=h.length;l<v;l+=2){var b=h[l],d=h[l+1];null!=b&&null!=d&&(s<u?(e[s]=b,e[s+1]=d):e.push(b,d),s+=2,o!=o?(o=b,a=b,c=d,f=d):(o=Math.min(o,b),a=Math.max(a,b),c=Math.min(c,d),f=Math.max(f,d)))}e.length!==s&&(e.length=s),n.mapAll(e,0,s,2,0),r.mapAll(e,0,s,2,1),n.transform.mapAll(e,0,s,2,0),r.transform.mapAll(e,0,s,2,1),o!=o&&(o=0,a=0,c=0,f=0);var g=i.WORK_REGION||{xmin:0,xmax:0,ymin:0,ymax:0};i.WORK_REGION=g,this.adjustLineRegion(o,a,c,f,g),o=n.transform.map(n.map(g.xmin)),a=n.transform.map(n.map(g.xmax)),c=r.transform.map(r.map(g.ymin)),f=r.transform.map(r.map(g.ymax));var m=Math.abs(a-o),w=Math.abs(f-c),p=.5*(o+a),O=.5*(c+f);for(l=0,v=e.length;l<v;l+=2)e[l+0]-=p,e[l+1]-=O;t.disallowUploadedUpdate(),this.applyLine(t,n,r,m,w,p,O,e),t.allowUploadedUpdate(),rt.update(t)},i.prototype.adjustLineRegion=function(t,n,i,r,e){return e.xmin=t,e.xmax=n,e.ymin=i,e.ymax=r,e},i.prototype.applyLine=function(t,n,i,r,e,u,s,h){t.points.set(h),t.size.set(r,e),t.transform.position.set(u,s)},i.prototype.updateRegion=function(){var t=this.mf;if(this.df!==t){this.df=t;var n=this.gt,i=this.Hc,r=this.Vc;i.clear(),r.clear(),this.calcRegion(n,i,r)}},i.prototype.calcRegion=function(t,n,i){for(var r=0,e=t.length;r<e;r+=2){var u=t[r];null!=u&&n.add(u,u);var s=t[r+1];null!=s&&i.add(s,s)}},i.prototype.destroy=function(){var t=this.gf;t&&(this.gf=null,t.detach(),t.destroy()),this.gt.length=0,this.mf=0,this.wf=NaN,n.prototype.destroy.call(this)},i.prototype.hitTest=function(t,n){var r=this.gf;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.gf;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,null,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.calcHitPointTestRange=function(t,n,i,r,e,u,s,h,o){for(var a=Vl(h,t+i+e,2,0),c=0,f=a-1,l=f<<1;0<=f;f-=1,l-=2)if(h[l]<=t-i){c=f;break}return o[0]=c,o[1]=c!==a?a:Math.min(h.length<<1,a+1),o},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o,a,c,f,l,v){var b=v.shape;if(b.containsPointAbs(t,n,i,r,e,u,s,h,o,a,c)){var d=b.transform,g=d.position,m=d.scale;v.x=v.p0x=v.p1x=g.x+m.x*s,v.y=v.p0y=v.p1y=g.y+m.y*h,v.t=l,v.index=f;var w=t-(s+e),p=n-(h+u);return v.distance=Math.sqrt(w*w+p*p),!0}return!1},i.WORK=new t.Point,i}(_d),Fd=function(t){function n(n){var i=t.call(this,n)||this;return i.pf=-1,i.Of=-1,i.Df=-1,i.Ef=-1,i.Mf=!1!==(n&&n.size&&n.size.auto),i}return _(n,t),n.prototype.bind=function(n,i){this.pf=-1,this.Of=-1,this.Df=-1,this.Ef=-1,t.prototype.bind.call(this,n,i)},n.prototype.initLine=function(n,i,r,e){t.prototype.initLine.call(this,n,i,r,e),this.Bn=r.newPadding(e,i&&i.padding)},n.prototype.newLineOfAny=function(){return new Ic},n.prototype.getSizeDefault=function(){return 1},n.prototype.adjustLineRegion=function(n,i,r,e,u){return t.prototype.adjustLineRegion.call(this,n,i,Math.min(0,r),Math.max(0,e),u)},n.prototype.updateBarCountAndIndex=function(){if(this.Of<0||this.pf<0){var t=0,i=0,r=this.tc;if(r)for(var e=0,u=r.size();e<u;++e){var s=r.get(e);s===this&&(t=i),s instanceof n&&(i+=1)}return i=Math.max(1,i),this.pf=i,this.Of=t,!0}return!1},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=n.points,c=a.offset,f=a.size,l=this.I,v=this.Jt,b=this.Bn;if(l&&v&&b){var d=i.id,g=i.transform.id;if(this.updateBarCountAndIndex()||this.Df!==d||this.Ef!==g){var m=this.pf,w=this.Of;this.Df=d,this.Ef=g;var p=i.transform.map(i.map(0)),O=i.transform.map(i.map(l.x)),D=Math.abs(p-O)*(1-b.outer);if(m<=1)c.x=v.x,f.x=D;else{var E=D*(1-b.inner),M=E/m,S=M*(w+.5)+w*((D-E)/(m-1));c.x=v.x+S-.5*D,f.x=M}}}var T=f.y;Wt(T)||(T=[]);var j=T.length,N=c.y;Wt(N)||(N=[]);for(var I=N.length,C=0,A=r.transform.map(r.map(0))-h,R=0,y=o.length;R<y;R+=2,C+=1){var k=o[R+1]-A,L=Math.abs(k);C<j?T[C]=L:T.push(L);var x=-.5*k;C<I?N[C]=x:N.push(x)}T.length!==C&&(T.length=C),N.length!==C&&(N.length=C),c.y=N,f.y=T,t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n.prototype.calcSizeX=function(t){var n=this.gt;if(2<n.length)for(var i=n.length,r=n[i-2],e=i-4;0<=e;e-=2){var u=n[e];if(null!=r&&null!=u)return Math.abs(r-u);r=u}return t},n.prototype.calcRegion=function(n,i,r){t.prototype.calcRegion.call(this,n,i,r);var e=this.I;if(e){var u=e.x;this.Mf&&(u=this.calcSizeX(u),e.x=u);var s=.5*u;i.set(i.from-s,i.to+s)}r.add(0,0)},n}(Pd),Ud=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new wc},n}(Pd),Gd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Mc},n}(Pd),zd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Ic},n}(Pd),Hd=function(t){function n(n){var i=t.call(this,n)||this;return i.Sf=0,i}return _(n,t),n.prototype.newLineOfAny=function(){return new Zc},n.prototype.applyLine=function(n,i,r,e,u,s,h,o){var a=this.I,c=this.Jt;a&&c&&this.Sf!==a.y&&(this.Sf=a.y,n.points.offset.y=c.y-.2*a.y),t.prototype.applyLine.call(this,n,i,r,e,u,s,h,o)},n}(Pd),Vd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newLineOfAny=function(){return new Vc},n}(Hd),Wd=function(n){function i(t){var i,r=n.call(this,t)||this;return r.gf=null,r.Nn=t,r.gt=null!==(i=null==t?void 0:t.points)&&void 0!==i?i:[],r.mf=0,r.wf=NaN,r.Tf=0,r.jf=0,r}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.gf;if(!e){var u=t.newStroke(i,null===(r=this.Nn)||void 0===r?void 0:r.stroke);this.Wh=u,(e=new Ya).stroke.copy(u),this.gf=e}e.attach(t.plotArea.container,i),this.wf=NaN,n.prototype.bind.call(this,t,i)},i.prototype.unbind=function(){var t=this.gf;t&&t.detach(),n.prototype.unbind.call(this)},Object.defineProperty(i.prototype,"shape",{get:function(){return this.gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"points",{get:function(){return this.gt},set:function(t){this.gt=t,this.mf+=1},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){this.mf+=1},i.prototype.update=function(){var t=this.gf;if(t){var n=this.$c,i=n.x,r=n.y;if(i&&r){var e=this.mf,u=e!==this.wf,s=n.isDirty(i,r),h=n.isTransformDirty(i,r);(u||s||h)&&(this.wf=e,this.updateLine(t,i,r,u||s))}}},i.prototype.updateLine=function(t,n,i,r){if(t.disallowUploadedUpdate(),r){for(var e=t.points.values,u=t.points.segments,s=e.length,h=u.length,o=0,a=0,c=this.gt,f=NaN,l=NaN,v=NaN,b=NaN,d=0,g=c.length;d<g;d+=2){var m=c[d],w=c[d+1];if(null!=m&&null!=w)o<s?(e[o]=m,e[o+1]=w):e.push(m,w),o+=2,f!=f?(f=m,l=m,v=w,b=w):(f=Math.min(f,m),l=Math.max(l,m),v=Math.min(v,w),b=Math.max(b,w));else{var p=(d>>1)-a;a<h?u[a]=p:u.push(p),a+=1}}e.length!==o&&(e.length=o),u.length!==a&&(u.length=a),n.mapAll(e,0,o,2,0),i.mapAll(e,0,o,2,1),f!=f&&(f=0,l=0,v=0,b=0),f=n.map(f),l=n.map(l),v=i.map(v),b=i.map(b);var O=Math.abs(l-f),D=Math.abs(b-v),E=.5*(f+l),M=.5*(v+b);for(d=0,g=e.length;d<g;d+=2)e[d+0]-=E,e[d+1]-=M;t.size.set(O,D),t.points.set(e,u),this.Tf=E,this.jf=M}t.transform.position.set(n.transform.map(this.Tf),i.transform.map(this.jf)),t.transform.scale.set(n.transform.scale,i.transform.scale),t.allowUploadedUpdate(),rt.update(t)},i.prototype.updateRegion=function(){var t=this.mf;if(this.df!==t){this.df=t;var n=this.gt,i=this.Hc,r=this.Vc;if(i.clear(),r.clear(),null!=n)for(var e=0,u=n.length;e<u;e+=2){var s=n[e];null!=s&&i.add(s,s);var h=n[e+1];null!=h&&r.add(h,h)}}},i.prototype.destroy=function(){var t=this.gf;t&&(this.gf=null,t.detach(),t.destroy()),this.gt.length=0,this.mf=0,this.wf=NaN,n.prototype.destroy.call(this)},i.prototype.hitTest=function(t,n){var r=this.gf;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.gf;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,this.calcHitPointTestRange,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointTestRange=function(t,n,i,r,e){var u=Vl(r,t,2,0);return e[0]=Math.max(0,u-1),e[1]=u,e},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=g+p*f,o.y=m+O*l,o.p0x=g+p*i,o.p0y=m+O*r,o.p1x=g+p*e,o.p1y=m+O*u,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(_d),Xd=function(){function t(t,n,i,r){this.k=0,this.Nf=NaN,this._a=t,this._b=n,this._x0=i,this._y0=r}return Object.defineProperty(t.prototype,"a",{get:function(){return this._a},set:function(t){this._a!==t&&(this.k+=1,this._a=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"b",{get:function(){return this._b},set:function(t){this._b!==t&&(this.k+=1,this._b=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"x0",{get:function(){return this._x0},set:function(t){this._x0!==t&&(this.k+=1,this._x0=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"y0",{get:function(){return this._y0},set:function(t){this._y0!==t&&(this.k+=1,this._y0=t)},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.k+=1},t.prototype.isDirty=function(){return this.k!==this.Nf},t.prototype.toClean=function(){this.Nf=this.k},t.from=function(n){var i,r,e,u;return new t(null!==(i=null==n?void 0:n.a)&&void 0!==i?i:1,null!==(r=null==n?void 0:n.b)&&void 0!==r?r:1,null!==(e=null==n?void 0:n.x0)&&void 0!==e?e:0,null!==(u=null==n?void 0:n.y0)&&void 0!==u?u:0)},t}(),Kd=function(n){function i(t){var i=n.call(this,t)||this;return i.gf=null,i.Nn=t,i.If=NaN,i.Cf=NaN,i.Af=Xd.from(t),i}return _(i,n),i.prototype.bind=function(t,i){var r,e=this.gf;if(!e){var u=t.newStroke(i,null===(r=this.Nn)||void 0===r?void 0:r.stroke);this.Wh=u,(e=new Ya).stroke.copy(u),this.gf=e}e.attach(t.plotArea.container,i),this.Af.toDirty(),this.If=NaN,this.Cf=NaN,n.prototype.bind.call(this,t,i)},i.prototype.unbind=function(){var t=this.gf;t&&t.detach(),n.prototype.unbind.call(this)},Object.defineProperty(i.prototype,"shape",{get:function(){return this.gf},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"parameters",{get:function(){return this.Af},enumerable:!1,configurable:!0}),i.prototype.toDirty=function(){this.Af.toDirty()},i.prototype.update=function(){var t=this.gf,n=this.tc;if(t&&n){var i=n.plotArea,r=this.$c,e=r.x,u=r.y;if(e&&u){var s=i.width,h=i.height,o=this.Af,a=o.isDirty(),c=r.isDirty(e,u),f=r.isTransformDirty(e,u),l=s!==this.If||h!==this.Cf;(a||c||f||l)&&(o.toClean(),this.If=s,this.Cf=h,this.updateLine(t,e,u,s,h))}}},i.prototype.updateLine=function(t,n,i,r,e){var u=t.points.values,s=t.points.segments,h=this.Af,o=h.a,a=h.b,c=h.x0,f=h.y0,l=Math.abs(o),v=Math.abs(a),b=NaN,d=NaN,g=NaN,m=NaN,w=1e-5;if(v<=l){var p=n.unmap(n.transform.unmap(0)),O=n.unmap(n.transform.unmap(r));if(b=Math.min(p,O),g=Math.max(p,O),w<l){var D=a*(i.unmap(i.transform.unmap(0))-f)/o+c,E=a*(i.unmap(i.transform.unmap(e))-f)/o+c,M=Math.min(D,E),S=Math.max(D,E);b<M&&(b=M),S<g&&(g=S)}d=o*(b-c)+a*f,m=o*(g-c)+a*f}else{var T=i.unmap(i.transform.unmap(0)),j=i.unmap(i.transform.unmap(e));if(d=Math.min(T,j),m=Math.max(T,j),w<v){var N=o*(n.unmap(n.transform.unmap(0))-c)/a+f,I=o*(n.unmap(n.transform.unmap(r))-c)/a+f,C=Math.min(N,I),A=Math.max(N,I);d<C&&(d=C),A<m&&(m=A)}b=a*(d-f)+o*c,g=a*(m-f)+o*c}b=n.transform.map(n.map(b)),d=i.transform.map(i.map(d));var R=.5*(b+(g=n.transform.map(n.map(g)))),y=.5*(d+(m=i.transform.map(i.map(m)))),k=Math.abs(g-b),L=Math.abs(m-d);b-=R,d-=y,g-=R,m-=y,4!==u.length?(u.length=0,u.push(b,d,g,m)):(u[0]=b,u[1]=d,u[2]=g,u[3]=m),0<s.length&&(s.length=0),t.disallowUploadedUpdate(),t.points.set(u,s),t.size.set(k,L),t.transform.position.set(R,y),t.allowUploadedUpdate(),rt.update(t)},i.prototype.updateRegion=function(){},i.prototype.destroy=function(){var t=this.gf;t&&(this.gf=null,t.detach(),t.destroy()),n.prototype.destroy.call(this)},i.prototype.hitTest=function(t,n){var r=this.gf;if(r){var e=i.WORK;return e.set(t,n),r.toLocal(e,void 0,e),null!=r.contains(e.x,e.y)}return!1},i.prototype.calcHitPoint=function(t,n,r){var e=this.gf;if(e){var u=i.WORK;return u.set(t,n),e.toLocal(u,void 0,u),r.shape=e,e.calcHitPoint(u.x,u.y,this.toThreshold,null,this.calcHitPointHitTester,r)}return!1},i.prototype.toThreshold=function(t,n){return 1/0},i.prototype.calcHitPointHitTester=function(t,n,i,r,e,u,s,h,o){if(i<=t&&t<e){var a=e-i;if(1e-4<Math.abs(a)){var c=(t-i)/a,f=t,l=r+c*(u-r),v=Math.abs(l-n);if(v<h){var b=o.shape.transform,d=b.position,g=d.x,m=d.y,w=b.scale,p=w.x,O=w.y;return o.x=o.p0x=o.p1x=g+p*f,o.y=o.p0y=o.p1y=m+O*l,o.t=c,o.index=s,o.distance=v,!0}}}return!1},i.WORK=new t.Point,i}(_d),Yd=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n);var r=this.plotArea;this.addChild(r),(null!==(i=null==n?void 0:n.mask)&&void 0!==i?i:this.theme.isOverflowMaskEnabled())&&(r.axis.container.mask=this.getOverflowMask())},n.prototype.getOverflowMask=function(){return null==this.Zi&&(this.Zi=new Yi(this),this.reflowable.add(this.Zi),this.toDirty()),this.Zi},Object.defineProperty(n.prototype,"plotArea",{get:function(){var t=this._c;return null==t&&(t=this.newPlotArea(),this._c=t),t},enumerable:!1,configurable:!0}),n.prototype.newPlotArea=function(){var t;return new jd(this,null===(t=this.Nn)||void 0===t?void 0:t.plotArea)},n.prototype.getType=function(){return"DChart"},n.prototype.destroy=function(){var n;this._destroyed||(null===(n=this._c)||void 0===n||n.destroy(),t.prototype.destroy.call(this))},n}(Ki),Jd=function(){function t(){}return t.prototype.redo=function(){throw new Error("Method not implemented.")},t.prototype.undo=function(){throw new Error("Method not implemented.")},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE|ov.CLEAR},t}(),Zd=function(){function t(){}return t.prototype.execute=function(){return dv.getDocumentController().delete()},t.prototype.redo=function(){throw new Error("Method not implemented.")},t.prototype.undo=function(){throw new Error("Method not implemented.")},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE|ov.CLEAR},t}(),qd=function(){function t(t){this.kh=t}return t.prototype.execute=function(){return dv.getDocumentController().saveAs(this.kh)},t.prototype.redo=function(){return!0},t.prototype.undo=function(){return!0},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE},t}(),$d=function(){function t(){}return t.prototype.execute=function(){return dv.getDocumentController().save()},t.prototype.redo=function(){return!0},t.prototype.undo=function(){return!0},t.prototype.destroy=function(){},t.prototype.getFlag=function(){return ov.UNSTORABLE},t}(),Qd=function(t){function n(n,i){var r=t.call(this)||this;r.O=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),n.prototype.createAsUrl=function(t){return null==t||Xt(t)?this.create({size:t,extractor:function(t){return Jl.base64({target:t})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(t){return Jl.base64({target:t})}})},n.prototype.createAsFile=function(t,n){at(t)?this.create({extractor:function(n){Jl.file({target:n,filename:t})}}):null===t||Xt(t)?this.create({size:t,extractor:function(t){Jl.file({target:t,filename:n})}}):this.create({size:t.size,cleanup:t.cleanup,extractor:function(n){Jl.file({target:n,filename:t.filename})}})},n.prototype.toScale=function(t,n){return null==t?1:t/rt.getResolution(n)/Math.max(n.width,n.height)},n.prototype.toCleanupSnap=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.snap},n.prototype.toCleanupBackground=function(t){if(null==t)return!1;var n=t.cleanup;return null!=n&&!1!==n&&(!0===n||!0===n.background)},n.prototype.toCleanupRefit=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.refit},n.prototype.toCleanupReflow=function(t){if(null==t)return!0;var n=t.cleanup;return null==n||!0===n||!1!==n&&!1!==n.reflow},n.prototype.create=function(t){var n=this.O,i=n.canvas;if(i){var r=n.view,e=r.position,u=r.scale,s=e.x,h=e.y,o=u.x,a=u.y,c=this.toScale(t.size,i);r.transform(0,0,c,c,0);var f=void 0;if(this.toCleanupSnap(t)&&"snap"in i){var l=i.snap;null!=l&&((f=l.container).renderable?f.renderable=!1:f=void 0)}var v=void 0;this.toCleanupBackground(t)&&((v=i.snippet).renderable?v.renderable=!1:v=void 0);var b=this.toCleanupRefit(t),d=this.toCleanupReflow(t);if(b||d){var g=rt.getLayer(i);g&&(b&&g.refit(),d&&g.reflow())}this.emit("taking",i,this);var m=t.extractor(i);return this.emit("took",i,null,this),v&&(v.renderable=!0),null!=f&&(f.renderable=!0),r.transform(s,h,o,a,0),m}},n}(t.utils.EventEmitter),tg=function(t){function n(n){var i,r=t.call(this,n)||this;return r.Rf=null,r.yf=null==n?void 0:n.tile,r.kf=null==n?void 0:n.controller,r.Lf=null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:r.theme.isAmbient(),r.xf=new Qd(r,null==n?void 0:n.snapshot),r}return _(n,t),Object.defineProperty(n.prototype,"snapshot",{get:function(){return this.xf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"controller",{get:function(){return this.kf||null},enumerable:!1,configurable:!0}),n.prototype.set=function(t){var n=this.Rf;n!==t&&(n&&(this.Rf=null,this.onUnset()),this.Rf=t,t&&this.onSet(t))},n.prototype.onSet=function(t){var n=this,i=this.newCanvas(t),r=t.pieces,e=this.isEditMode();ua.toPieceData(this.kf,r,e).then((function(u){n.newLayer(t,i,e,r,u)})),this.canvas=i},n.prototype.newLayer=function(t,n,i,r,e){var u=this,s=n.layer,h=new Fo(t,r,e,i);if(ua.newLayer(t,s,h).then((function(t){s.init(),u.initialize(t),n.initialize(t),rt.update(u),u.emit("ready",u)})),this.Lf){var o=this.toCanvasBaseBackgroundOptions(t,this.theme,!1);this.background.color=o.color,this.background.alpha=o.alpha}},n.prototype.toCanvasBaseOptions=function(t){var n,i=this.theme,r=this.Lf;return{name:t.name,width:t.width,height:t.height,background:this.toCanvasBaseBackgroundOptions(t,i,r),border:r?{color:null}:void 0,outline:r?{color:null}:void 0,shadow:r?null:i.getCanvasShadow(),tile:{factory:this.yf,mapping:null===(n=t.tile)||void 0===n?void 0:n.mapping},ambient:r}},n.prototype.toCanvasBaseBackgroundOptions=function(t,n,i){var r,e;if(i)return{color:null};var u=t.background;return{color:null!==(r=null==u?void 0:u.color)&&void 0!==r?r:n.getCanvasBackgroundColor(),alpha:null!==(e=null==u?void 0:u.alpha)&&void 0!==e?e:n.getCanvasBackgroundAlpha()}},n.prototype.openByName=function(t){var n=this,i=this.kf;i&&i.getByName(t).then((function(t){n.set(ua.toSerialized(t))}))},n.prototype.initialize=function(t){},n.prototype.onUnset=function(){this.canvas&&(this.canvas=null)},n.prototype.get=function(){return this.Rf},Object.defineProperty(n.prototype,"layer",{get:function(){var t=this.canvas;return t?t.layer.active:null},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DDiagramBase"},n}(hr),ng=function(){function t(t,n){this.zn=t,this.Rh=n}return t.prototype.getTheme=function(){return this.zn.getTheme()},t.prototype.setTheme=function(t){this.zn.setTheme(t)},t.prototype.getBaseColor=function(){return this.Rh},t.prototype.setBaseColor=function(t){this.Rh=t},t.prototype.getColor=function(t){var n=this.zn,i=this.Rh,r=n.getColor(t);return null!=i?null!=r?wt.blend(i,r,n.getAlpha(t)):i:r},Object.defineProperty(t.prototype,"color",{get:function(){return this.zn.color},set:function(t){this.zn.color=t},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(t){return null!=this.Rh?1:this.zn.getAlpha(t)},Object.defineProperty(t.prototype,"alpha",{get:function(){return this.zn.alpha},set:function(t){this.zn.alpha=t},enumerable:!1,configurable:!0}),t}(),ig=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),Object.defineProperty(n.prototype,"lon",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lat",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!0}),n.prototype.toObject=function(){return{lon:this.x,lat:this.y}},n}(t.ObservablePoint),rg=function(){function t(t,n,i,r,e,u){if(this.Bf=t,!0===n||!1===n)this.S=n,this.Nt=new ig(t,null,i,r),this.It=new ig(t,null,e,u);else if(null!=n){this.S=n.enable;var s=n.from,h=n.to;this.Nt=new ig(t,null,s.lon,s.lat),this.It=new ig(t,null,h.lon,h.lat)}else this.S=!1,this.Nt=new ig(t,null,-180,85.05112877980659),this.It=new ig(t,null,180,-85.05112877980659)}return Object.defineProperty(t.prototype,"enable",{get:function(){return this.S},set:function(t){this.S!==t&&(this.S=t,this.Bf())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"from",{get:function(){return this.Nt},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"to",{get:function(){return this.It},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{enable:this.S,from:this.Nt.toObject(),to:this.It.toObject()}},t}(),eg=function(){function t(t,n){var i=this;this.Yi=t,this._f=null==n?void 0:n.factory,this.Io=new rg((function(){i.onMappingChange()}),null==n?void 0:n.mapping)}return t.prototype.init=function(){this.onMappingChange()},t.prototype.onMappingChange=function(){var t=this._f;if(t){var n,i=this.Io;i.enable?(n=this.Pf)?n.mapping=i:this.Pf=t(this.Yi).fit():(n=this.Pf)&&(this.Pf=void 0,n.destroy())}},Object.defineProperty(t.prototype,"pyramid",{get:function(){return this.Pf},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"factory",{get:function(){return this._f},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapping",{get:function(){return this.Io},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return{mapping:this.Io.serialize()}},t.prototype.destroy=function(){var t=this.Pf;null!=t&&(this.Pf=void 0,t.destroy())},t}(),ug=function(t){function n(n){var i=t.call(this)||this;i.name=n,i.interactive=!1,i.reference=0;var r=i.newShape();return r.parent=i,i.me=r,i.interactives=[],i}return _(n,t),Object.defineProperty(n.prototype,"width",{get:function(){return this.me.size.x},set:function(t){this.me.size.x=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"height",{get:function(){return this.me.size.y},set:function(t){this.me.size.y=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"background",{get:function(){return this.me.fill},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"state",{get:function(){return this.me.state},enumerable:!1,configurable:!0}),n.prototype.newShape=function(){var t=new vf;return t.fill.set(!1,16777215,1),t.stroke.set(!1),t.state.add(zo.INTERACTIVE),t},n.prototype.initialize=function(t,n,i){var r=this.interactives,e=this.me,u=e.state.is(zo.INTERACTIVE),s=e.state.is(zo.DRAGGABLE),h=e.state.is(zo.PINCHABLE);if(s||h){var o=new Jt(e);e.runtime=o;var a=(s?xr.DRAG:xr.NONE)|(h?xr.PINCH:xr.NONE);o.actions.push(new oe("",a).toRuntime()),i.push(e),o.initialize(e)}(u||s||h)&&(e.interactive=!0,r.push(e)),this.doInitialize(this.children,t,r,i,n)},n.prototype.doInitialize=function(t,n,i,r,e){for(var u=function(u,h){for(var o=t[u],a=o.data,c=0,f=a.size();c<f;++c){var l=a.get(c);if(l){var v=l.id;if(0<v.length){var b=n[v];null==b&&(b=[],n[v]=b),b.push(l)}}}var d=o.id;if(0<d.length){var g=e[d];null==g?e[d]=[o]:g.push(o)}var m=o.runtime;if(m){(o.interactive||0<o.cursor.length||m.interactive)&&i.push(o),m.isActionable()&&r.push(o);var w=o.shortcut;null!=w&&Kt.on(o,w,(function(t){m.onClick(o,t)})),m.initialize(o)}var p=o.children;0<p.length&&s.doInitialize(p,n,i,r,e)},s=this,h=0,o=t.length;h<o;++h)u(h)},n.prototype.hitTestInteractives=function(t){for(var n=this.je,i=this.interactives,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible&&(e.toLocal(t,void 0,n),null!=e.contains(n.x,n.y)))return e}return null},n.prototype.addUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].addUuid(t)},n.prototype.updateUuid=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i)n[i].updateUuid(t)},n.prototype.destroy=function(){if(!this._destroyed){for(var n=this.children,i=n.length-1;0<=i;--i)n[i].destroy();n.length=0,t.prototype.destroy.call(this)}},n.prototype.serialize=function(t,n,i){for(var r=this.children,e=0,u=r.length;e<u;++e){var s=r[e].serialize(n);s[16]=t,i.push(s)}var h=this.me,o=n.addResource(this.name||""),a=(this.visible?1:0)|(h.state.is(zo.INVISIBLE)?0:2),c=this.position,f=h.size,l=h.fill.serialize(n),v=h.state.is(zo.INTERACTIVE)?1:0,b=h.state.is(zo.DRAGGABLE)?2:0,d=h.state.is(zo.PINCHABLE)?4:0;return[o,a,c.x,c.y,f.x,f.y,l,v|b|d]},n.deserialize=function(t,i,r,e){var u,s,h,o=new n(this.deserializeName(t[0],i)),a=o.me,c=t[1];null!=c&&(!i.isEditMode||1&c||(o.visible=!1),2&c||(a.state.add(zo.INVISIBLE),i.isEditMode||(o.visible=!1)));var f=t[2],l=t[3];o.position.set(f,l);var v=null!==(u=t[4])&&void 0!==u?u:r,b=null!==(s=t[5])&&void 0!==s?s:e;a.size.set(v,b);var d=t[6];null!=d&&a.fill.deserialize(d,i);var g=null!==(h=t[7])&&void 0!==h?h:1;return a.state.set(zo.INTERACTIVE,!!(1&g)),a.state.set(zo.DRAGGABLE,!!(2&g)),a.state.set(zo.PINCHABLE,!!(4&g)),o},n.deserializeName=function(t,n){if(at(t))return t;var i=n.resources;return 0<=t&&t<=i.length?i[t]:""},n}(ee),sg=function(t){function n(n,i){var r=t.call(this)||this;return r.Fu=null,r.Mt=n,r.nn=i,r.interactive=!1,r.interactiveChildren=!1,r}return _(n,t),n.prototype.init=function(){if(null==this.Fu){var t=this.children,n=t.length;0<n&&(this.Fu=t[n-1])}},Object.defineProperty(n.prototype,"active",{get:function(){return this.Fu},set:function(t){this.Fu!==t&&(null==t||0<=this.children.indexOf(t))&&(this.Fu=t,this.onLayerChange())},enumerable:!1,configurable:!0}),n.prototype.create=function(t,n){var i=new ug(t);return this.attach(i,n),i},n.prototype.attach=function(t,n){this.addChild(t),!0===n&&(this.Fu=t),this.onLayerChange(),rt.update(this)},n.prototype.attachAt=function(t,n,i){this.addChildAt(t,n),!0===i&&(this.Fu=t),this.onLayerChange(),rt.update(this)},n.prototype.detach=function(t,n){var i=this.children,r=i.indexOf(t);0<=r&&(this.Fu=n,i.splice(r,1),t.parent=void 0,this.onLayerChange(),rt.update(this))},n.prototype.delete=function(t,n){var i=this.children,r=i.indexOf(t);return 0<=r&&(i.splice(r,1),t.parent=void 0,this.Fu===t&&(!0===n?r<i.length?this.Fu=i[r]:0<i.length?this.Fu=i[r-1]:this.Fu=null:this.Fu=null),this.onLayerChange(),rt.update(this)),r},n.prototype.get=function(t){var n=this.children[t];return null!=n?n:null},n.prototype.clear=function(){var t=this.children;if(0<t.length){for(var n=t.length-1;0<=n;--n){var i=t[n];i.parent=null,i.destroy()}t.length=0,this.onLayerChange(),rt.update(this)}},n.prototype.destroy=function(){this._destroyed||(this.clear(),t.prototype.destroy.call(this))},n.prototype.size=function(){return this.children.length},n.prototype.onLayerChange=function(){this.emit("change",this)},n.prototype.serialize=function(t,n){for(var i=[],r=this.children,e=0,u=r.length;e<u;++e)r[e].addUuid(t);for(e=0,u=r.length;e<u;++e)r[e].updateUuid(t);for(e=0,u=r.length;e<u;++e)i.push(r[e].serialize(e,t,n));return i},n.prototype.deserialize=function(t,n){var i=t.length;if(0<i){for(var r=this.Mt,e=this.nn,u=0;u<i;++u)this.addChild(ug.deserialize(t[u],n,r,e));this.onLayerChange(),rt.update(this)}},n}(t.Container),hg=function(t){function n(n){var i=t.call(this,n)||this,r=i.theme;i.isAmbient(r,n)||(i.gn=new ng(i.gn,i.toBackgroundBase(r,n)));var e=new sg(i.width,i.height);i.gu=e,i.addChild(e);var u=new eg(i,null==n?void 0:n.tile);return i.Ff=u,u.init(),i}return _(n,t),n.prototype.isAmbient=function(t,n){var i;return null!==(i=null==n?void 0:n.ambient)&&void 0!==i?i:t.isAmbient()},n.prototype.toBackgroundBase=function(t,n){var i,r;return null!==(r=null===(i=null==n?void 0:n.background)||void 0===i?void 0:i.base)&&void 0!==r?r:t.getBackgroundBase()},Object.defineProperty(n.prototype,"tile",{get:function(){return this.Ff},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"layer",{get:function(){return this.gu},enumerable:!1,configurable:!0}),n.prototype.initialize=function(t){},n.prototype.destroy=function(){this._destroyed||(this.Ff.destroy(),this.gu.destroy(),t.prototype.destroy.call(this))},n.prototype.hitTest=function(t,n){for(var i=this.gu.children,r=i.length-1;0<=r;--r){var e=i[r];if(e.visible){var u=e.hitTest(t,n);if(null!=u)return u}}return null},n.prototype.getType=function(){return"DDiagramCanvasBase"},n}(Hb),og=function(){function t(t,n,i){var r=this;this.O=t;var e=i.controller;this.kf=e;var u=function(){r.onChange()};e.grid.on("change",u),e.target.on("change",u);var s=new ee;s.visible=!1,this.tc=s,t.addChildAt(s,t.children.length-1),this.Uf=this.toGrid(n,i.grid),this.zn=this.toTarget(n,i.target)}return t.prototype.toGrid=function(t,n){var i;return{major:this.toGridMajor(t,null==n?void 0:n.major),minor:this.toGridMinor(t,null==n?void 0:n.minor),size:null!==(i=null==n?void 0:n.size)&&void 0!==i?i:t.getSnapGridSize()}},t.prototype.toGridMajor=function(t,n){var i,r,e,u,s;return{interval:null!==(i=null==n?void 0:n.interval)&&void 0!==i?i:t.getSnapGridMajorInterval(),color:null!==(r=null==n?void 0:n.color)&&void 0!==r?r:t.getSnapGridMajorColor(),alpha:null!==(e=null==n?void 0:n.alpha)&&void 0!==e?e:t.getSnapGridMajorAlpha(),width:null!==(u=null==n?void 0:n.width)&&void 0!==u?u:t.getSnapGridMajorWidth(),style:null!==(s=null==n?void 0:n.style)&&void 0!==s?s:t.getSnapGridMajorStyle()}},t.prototype.toGridMinor=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapGridMinorColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapGridMinorAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapGridMinorWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapGridMinorStyle()}},t.prototype.toTarget=function(t,n){var i,r,e,u;return{color:null!==(i=null==n?void 0:n.color)&&void 0!==i?i:t.getSnapTargetColor(),alpha:null!==(r=null==n?void 0:n.alpha)&&void 0!==r?r:t.getSnapTargetAlpha(),width:null!==(e=null==n?void 0:n.width)&&void 0!==e?e:t.getSnapTargetWidth(),style:null!==(u=null==n?void 0:n.style)&&void 0!==u?u:t.getSnapTargetStyle()}},t.prototype.onChange=function(){var t=this.O;t.toDirty(),rt.update(t)},Object.defineProperty(t.prototype,"container",{get:function(){return this.tc},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){return this.kf.serialize()},t.prototype.onReflow=function(){var t=this.O,n=this.tc,i=this.kf,r=i.grid.visible,e=i.target.visible;if(r||e){var u=t.width,s=t.height,h=.5*u,o=.5*s,a=Q.TOP,c=Q.LEFT,f=n.children,l=0;if(r){for(var v=this.Uf,b=v.major,d=v.minor,g=b.interval,m=v.size(i.grid.size,u,s),w=m,p=1;w<u;w+=m,p+=1,l+=1){var O=p%g==0?b:d;this.update(n,f,l,w,o,a,u,s,O)}for(var D=m,E=1;D<s;D+=m,E+=1,l+=1)O=E%g==0?b:d,this.update(n,f,l,h,D,c,u,s,O)}if(e)for(var M=i.target.values,S=this.zn,T=0,j=M.length;T<j;T+=1,l+=1){var N=M[T],I=N.position;N.type===Cl.VERTICAL?this.update(n,f,l,I,o,a,u,s,S):this.update(n,f,l,h,I,c,u,s,S)}for(T=l,j=f.length;T<j;++T)f[T].visible=!1;n.visible=!0}else n.visible=!1},t.prototype.update=function(t,n,i,r,e,u,s,h,o){var a=null;i<n.length?((a=n[i]).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate()):((a=new Gt).disallowUploadedUpdate(),a.points.position=u,a.transform.position.set(r,e),a.stroke.set(!0,o.color,o.alpha,o.width,void 0,void 0,o.style),a.size.set(s,h),a.visible=!0,a.allowUploadedUpdate(),a.attach(t))},t}(),ag=function(t){function n(n){var i=t.call(this,n)||this;return i.Gf=i.toSnap(i.theme,n.snap),i}return _(n,t),n.prototype.toSnap=function(t,n){return n?new og(this,t,n):null},Object.defineProperty(n.prototype,"snap",{get:function(){return this.Gf},enumerable:!1,configurable:!0}),n.prototype.serialize=function(t,n){var i,r=new jl,e=[],u=this.gn,s=u.color,h=u.alpha;return{version:1,id:t,name:this.name,width:this.width,height:this.height,background:{color:Xt(s)?s:16777215,alpha:Xt(h)?h:0},tile:this.Ff.serialize(),resources:r.resources,data:r.data,pieces:r.pieces,layers:this.gu.serialize(r,e),items:e,snap:null===(i=this.Gf)||void 0===i?void 0:i.serialize(),thumbnail:null==n?void 0:n.serialize()}},n.prototype.onReflow=function(){var n;t.prototype.onReflow.call(this),null===(n=this.Gf)||void 0===n||n.onReflow()},n.prototype.getType=function(){return"DDiagramCanvasEditor"},n}(hg),cg=function(n){function i(t){var i=n.call(this,t)||this,r={};return i.data=r,i.tags=r,i.actionables=[],i.ids={},i.zf=new Set,i}return _(i,n),i.prototype.initialize=function(){for(var t=Date.now(),n=this.data,i=this.actionables,r=this.ids,e=this.gu.children,u=0,s=e.length;u<s;++u)e[u].initialize(n,r,i);for(u=0,s=e.length;u<s;++u)for(var h=e[u].children,o=0,a=h.length;o<a;++o)h[o].update(t)},i.prototype.hitTestInteractives=function(t){for(var n=this.gu.children,i=n.length-1;0<=i;--i){var r=n[i];if(r.visible){var e=r.hitTestInteractives(t);if(null!=e)return e}}return null},i.prototype.onShapeMove=function(t){var n=this.hitTestInteractives(t.data.global),i=rt.getLayer(this);if(i){var r=i.view,e=this.toShapeCursor(n),u=r.style;u.cursor!==e&&(u.cursor=e);var s=this.toShapeTitle(n);r.title!==s&&(r.title=s)}var h=this.Hf;if(this.Hf=n,n===h){if(null!=n){var o=n.runtime;o&&o.onMove(n,t)}}else this.onShapeOut(t,h,n),this.onShapeOver(t,n);return null!=n},i.prototype.toShapeCursor=function(t){if(null!=t){var n=t.cursor;if(0<n.length)return n}return"auto"},i.prototype.toShapeTitle=function(t){return null!=t&&t.title||""},i.prototype.onShapeOut=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Dt;){var r=n.runtime;r&&r.onOut(n,t),n=n.parent}},i.prototype.onShapeOver=function(t,n,i){for(;null!=n&&n!==i&&n instanceof Dt;){var r=n.runtime;r&&r.onOver(n,t),n=n.parent}},i.prototype.onShapeDown=function(t){var n=this.hitTestInteractives(t.data.global);if(this.Vf=n,n){this.zf.add(n);for(var i=n;;){var r=i.runtime;r&&r.onDown(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}return!0}return!1},i.prototype.onShapeUp=function(t){var n=this.zf,i=this.hitTestInteractives(t.data.global);if(i){n.delete(i);for(var r=i;;){var e=r.runtime;e&&e.onUp(r,t);var u=r.parent;if(!(u instanceof Dt))break;r=u}}return this.onShapeCancel(t),null!=i},i.prototype.onShapeCancel=function(t){var n=this.zf;return 0<n.size&&(n.forEach((function(n){for(var i=n;;){var r=i.runtime;r&&r.onUpOutside(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}})),n.clear(),!0)},i.prototype.onShapeClick=function(t){var n=this.hitTestInteractives(t.data.global);if(n&&this.Vf===n){for(var i=n;;){var r=i.runtime;r&&r.onClick(i,t);var e=i.parent;if(!(e instanceof Dt))break;i=e}return!0}return!1},i.prototype.onShapeDblClick=function(n,r){var e,u=null!==(e=i.WORK_DBLCLICK)&&void 0!==e?e:i.WORK_DBLCLICK=new t.Point;zi.toGlobal(n,r,u);var s=this.hitTestInteractives(u);if(s){for(var h=s;;){var o=h.runtime;o&&o.onDblClick(h,n,r);var a=h.parent;if(!(a instanceof Dt))break;h=a}return!0}return!1},i.prototype.getType=function(){return"DDiagramCanvas"},i}(hg),fg=function(){function t(t){this.kf=t&&t.controller}return t.prototype.set=function(t,n,i){var r=this.kf;r&&r.write(t,n)},t}(),lg=function(){function t(t,n){this.Wf=t,this.Xf=n&&n.mapper||null,this.Kf=new fg(n&&n.remote)}return t.prototype.update=function(){},Object.defineProperty(t.prototype,"mapper",{get:function(){return this.Xf},set:function(t){this.Xf=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"remote",{get:function(){return this.Kf},enumerable:!1,configurable:!0}),t.prototype.getIds=function(){var t=this.Wf.canvas;return null!=t?Object.keys(t.data):[]},t.prototype.each=function(t){var n=this.Wf.canvas;if(null!=n){var i=n.data;for(var r in i)if(!1===t(r))return r}return null},t.prototype.set=function(t,n,i,r,e){var u=this.Wf.canvas;if(null!=u){var s=u.data[t];if(null!=s)for(var h=0,o=s.length;h<o;++h){var a=s[h];a.range.set(r,e),void 0!==i&&(a.time=i),a.value=n}}},t.prototype.clear=function(t){var n=this.Wf.canvas;if(null!=n){var i=n.data[t];if(null!=i)for(var r=0,e=i.length;r<e;++r)i[r].clear()}},t.prototype.setAll=function(t,n,i,r,e){var u=this.Wf.canvas;if(null!=u){var s=u.data[t];if(null!=s)for(var h=0,o=s.length;h<o;++h){var a=s[h];a.range.set(r,e),void 0!==i&&(a.times=i),a.values=n}}},t.prototype.setValue=function(t,n,i){var r=this.Wf.canvas;if(null!=r){var e=r.data[t];if(null!=e)for(var u=0,s=e.length;u<s;++u){var h=e[u];void 0!==i&&(h.time=i),h.value=n}}},t.prototype.setValues=function(t,n,i){var r=this.Wf.canvas;if(null!=r){var e=r.data[t];if(null!=e)for(var u=0,s=e.length;u<s;++u){var h=e[u];void 0!==i&&(h.times=i),h.values=n}}},t.prototype.setTime=function(t,n){var i=this.Wf.canvas;if(null!=i){var r=i.data[t];if(null!=r)for(var e=0,u=r.length;e<u;++e)r[e].time=n}},t.prototype.setTimes=function(t,n){var i=this.Wf.canvas;if(null!=i){var r=i.data[t];if(null!=r)for(var e=0,u=r.length;e<u;++e)r[e].times=n}},t.prototype.setRange=function(t,n,i){var r=this.Wf.canvas;if(null!=r){var e=r.data[t];if(null!=e)for(var u=0,s=e.length;u<s;++u){var h=e[u].range;void 0!==n&&(null!==n?(h.type|=St.FROM,h.from=n):h.type&=~St.FROM),void 0!==i&&(null!==i?(h.type|=St.TO,h.to=i):h.type&=~St.TO)}}},t}(),vg=function(){function t(t,n,i){this.xf=t,this.Gu=this.toIsEnabled(n,i),this.Nn=this.toCreateAsUrlOptions(n,i)}return t.prototype.toIsEnabled=function(t,n){var i;return null!==(i=null==n?void 0:n.enable)&&void 0!==i?i:t.isThumbnailEnabled()},t.prototype.toSize=function(t,n){return void 0!==n?n:t.getThumbnailSize()},t.prototype.toCleanup=function(t,n){var i,r;return null==n||!0===n?{snap:!0,background:!0}:!1===n?{snap:!1,background:!1}:{snap:null===(i=n.snap)||void 0===i||i,background:null===(r=n.background)||void 0===r||r}},t.prototype.toCreateAsUrlOptions=function(t,n){return{size:this.toSize(t,null==n?void 0:n.size),cleanup:this.toCleanup(t,null==n?void 0:n.cleanup)}},Object.defineProperty(t.prototype,"enable",{get:function(){return this.Gu},set:function(t){this.Gu=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"size",{get:function(){return this.Nn.size},set:function(t){this.Nn.size=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cleanup",{get:function(){return this.Nn.cleanup},enumerable:!1,configurable:!0}),t.prototype.serialize=function(){if(this.Gu)return this.xf.createAsUrl(this.Nn)},t}(),bg=function(t){function n(n){var i=t.call(this,n)||this;return i.xt=!1,i.xt=!1,dv.getCommandController().on("dirty",(function(){!0!==i.xt&&(i.xt=!0,i.emit("change",i))})),i.Yf=new Ll(i),i.Jf=new vg(i.xf,i.theme,null==n?void 0:n.thumbnail),i}return _(n,t),Object.defineProperty(n.prototype,"thumbnail",{get:function(){return this.Jf},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"snapper",{get:function(){return this.Yf},enumerable:!1,configurable:!0}),n.prototype.isEditMode=function(){return!0},n.prototype.newCanvas=function(t){return new ag(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){var n=this.toCanvasBaseOptions(t),i=this.Yf,r=n.snap;return null==r?n.snap={controller:i}:null==r.controller&&(r.controller=i),n},n.prototype.serialize=function(){var t=this.canvas,n=this.Rf;if(null!=t&&null!=n){this.emit("serializing",t,this);try{var i=t.serialize(n.id,this.Jf);return this.emit("serialized",t,null,this),i}catch(n){return this.emit("serialized",t,"exception",this),null}}return null},n.prototype.save=function(){var t=this,n=this.serialize();if(null!=n){var i=this.kf;if(i){var r=ua.toSimple(n);return this.emit("saving",r,this),i.save(r).then((function(i){t.xt=!1,n.id=i,t.Rf=n,t.emit("change",t),t.emit("saved",null,t)}),(function(n){t.emit("saved",n,t)}))}return this.emit("saved","no-controller",this),Promise.reject()}return this.emit("saved",null,this),Promise.resolve()},n.prototype.saveAs=function(t){var n=this,i=this.serialize();if(null!=i){var r=this.kf;if(r){i.id=void 0,i.name=t;var e=ua.toSimple(i);return this.emit("saving",e,this),r.save(e).then((function(r){n.xt=!1,i.id=r,n.Rf=i;var e=n.canvas;null!=e&&(e.name=t),n.emit("change",n),n.emit("saved",null,n)}),(function(t){n.emit("saved",t,n)}))}return this.emit("saved","no-controller",this),Promise.reject("no-controller")}return this.emit("saved",null,this),Promise.resolve()},n.prototype.delete=function(){var t=this,n=this.Rf;if(n&&null!=n.id){var i=this.kf;return i?(this.emit("deleting",this),i.delete(n.id).then((function(){t.set(null),t.emit("deleted",t)}),(function(n){t.emit("deleted",n,t)}))):(this.emit("deleted","no-controller",this),Promise.reject("no-controller"))}return this.set(null),this.emit("deleted",null,this),Promise.resolve()},n.prototype.create=function(t,n,i){this.set({version:1,id:void 0,name:t,width:n,height:i,resources:[],data:[],layers:[["Default layer"]],items:[],snap:void 0})},n.prototype.onSet=function(n){t.prototype.onSet.call(this,n);var i=n.snap,r=this.Yf;null!=i?r.deserialize(i):r.reset(),this.Lf&&(r.target.visible=!1,r.grid.visible=!1),this.xt=!1,this.emit("change",this)},n.prototype.onUnset=function(){t.prototype.onUnset.call(this),this.xt=!1,this.emit("change",this)},n.prototype.open=function(t){var n=this,i=this.kf;return i?(this.emit("opening",this),i.get(t).then((function(t){n.set(ua.toSerialized(t)),n.emit("opened",null,n)}),(function(t){n.emit("opened",t,n)}))):(this.emit("opened","no-controller",this),Promise.reject("no-controller"))},n.prototype.close=function(){this.set(null)},n.prototype.isChanged=function(){return this.xt||this.isNew()},n.prototype.isNew=function(){var t=this.Rf;return null!=t&&null==t.id},n.prototype.getName=function(){var t=this.Rf;return null!=t?t.name:null},n.prototype.getType=function(){return"DDiagramEditor"},n}(tg),dg=function(t){function n(n){var i=t.call(this)||this;return i.Wf=n,i.ko=function(){rt.update(n)},i}return _(n,t),n.prototype.update=function(){var t=this.Wf.canvas;if(t){var n=t.actionables;if(0<n.length){for(var i=-1,r=Date.now(),e=0,u=n.length;e<u;++e){var s=n[e];s.update(r);var h=s.runtime;if(h&&r<h.effect){var o=h.effect;r<o&&(i=i<0?o:Math.min(i,o))}}0<=i&&setTimeout(this.ko,i-Date.now())}}},n.prototype.onRender=function(t){var n=this.Wf.canvas;if(n){var i=n.actionables;if(0<i.length){for(var r=-1,e=Date.now(),u=0,s=i.length;u<s;++u){var h=i[u];h.onRender(e,t);var o=h.runtime;if(o&&e<o.effect){var a=o.effect;e<a&&(r=r<0?a:Math.min(r,a))}}0<=r&&setTimeout(this.ko,r-Date.now())}}},n.prototype.get=function(t){var n,i=null===(n=this.Wf.canvas)||void 0===n?void 0:n.ids[t];return i&&0<i.length?i[0]:null},n.prototype.getAll=function(t){var n;return(null===(n=this.Wf.canvas)||void 0===n?void 0:n.ids[t])||[]},n.prototype.each=function(t,n){void 0===n&&(n=!1);var i=this.Wf.canvas;if(null!=i){var r=i.layer.children;if(n){for(e=r.length-1;0<=e;--e)for(h=(s=r[e].children).length-1;0<=h;--h)if(!1===t(a=s[h]))return a}else for(var e=0,u=r.length;e<u;++e)for(var s,h=0,o=(s=r[e].children).length;h<o;++h){var a;if(!1===t(a=s[h]))return a}}return null},n}(t.utils.EventEmitter),gg=function(t){function n(n){var i=t.call(this,n)||this;i.on(zi.move,(function(t){var n=i.canvas;n&&n.onShapeMove(t)})),i.on(zi.up,(function(t){var n=i.canvas;n&&n.onShapeUp(t)})),i.on(zi.upoutside,(function(t){var n=i.canvas;n&&n.onShapeCancel(t)})),i.on(zi.cancel,(function(t){var n=i.canvas;n&&n.onShapeCancel(t)})),zi.onClick(i,(function(t){var n=i.canvas;n&&n.onShapeClick(t)}));var r=new lg(i,n&&(n.data||n.tag));return i.data=r,i.tag=r,i.shape=new dg(i),i}return _(n,t),n.prototype.initialize=function(t){this.initializeShapes(t,null,this.data.mapper)},n.prototype.initializeShapes=function(t,n,i){for(var r={},e={},u=new Map,s=0,h=t.length;s<h;++s){for(var o=t[s],a=Rs[o.type]||Jt,c=o.runtime=new a(o),f=o.data,l=0,v=f.size();l<v;++l){var b=f.get(l);if(b){i&&i(b,n||o);var d=b.format,g=b.initial;if(d in r)b.formatter=r[d];else if(0<d.length)try{var m=Function("value","try {return ("+d+");} catch( e1 ) {try {return ("+(0<g.length?g:0)+");} catch( e2 ) {return 0;}}");r[d]=m,b.formatter=m}catch(t){}if(g in e)b.value=e[g];else if(0<g.length)try{b.value=e[g]=Function("try {return ("+g+");} catch( e ) {return 0;}")()}catch(t){}}}var w=o.action.values,p=c.actions;for(l=0,v=w.length;l<v;++l){var O=w[l],D=u.get(O);null==D?null!=(D=O.toRuntime())&&(D instanceof nu&&o.cursor.length<=0&&(o.cursor="pointer"),u.set(O,D),p.push(D),c.reset|=D.reset):(p.push(D),c.reset|=D.reset)}var E=o.children;0<E.length&&this.initializeShapes(E,this.toDataShape(n,o),i)}},n.prototype.toDataShape=function(t,n){return null!=t?t:n.type===r.EMBEDDED?n:null},n.prototype.isEditMode=function(){return!1},n.prototype.newCanvas=function(t){return new cg(this.toCanvasOptions(t))},n.prototype.toCanvasOptions=function(t){return this.toCanvasBaseOptions(t)},n.prototype.onDown=function(n){var i;t.prototype.onDown.call(this,n,null===(i=this.canvas)||void 0===i?void 0:i.onShapeDown(n))},n.prototype.onDblClick=function(n,i){var r;return t.prototype.onDblClick.call(this,n,i,null===(r=this.canvas)||void 0===r?void 0:r.onShapeDblClick(n,i))},n.prototype.render=function(n){this.shape.onRender(n),t.prototype.render.call(this,n)},n.prototype.getType=function(){return"DDiagram"},n}(tg),mg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmMessage"},n}(pf),wg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onInit=function(n,i){t.prototype.onInit.call(this,n,i),n.addChild(this.message)},n.prototype.toMessage=function(t,n){var i=null==n?void 0:n.message;return null!=i?at(i)||ot(i)?this.newMessage(this.toMessageOptions(i)):i instanceof Ki?i:this.newMessage(this.toMessageOptionsMerged(i,t.getMessage())):this.newMessage(this.toMessageOptions(t.getMessage()))},n.prototype.toMessageOptionsMerged=function(t,n){var i=t.text;return null==i&&(i={},t.text=i),void 0===i.value&&(i.value=n),t},n.prototype.toMessageOptions=function(t){return{text:{value:t}}},n.prototype.newMessage=function(t){return new mg(t)},Object.defineProperty(n.prototype,"message",{get:function(){var t=this.Zf;return null==t&&(t=this.toMessage(this.theme,this.Nn),this.Zf=t),t},enumerable:!1,configurable:!0}),n.prototype.getResolvedValue=function(){},n.prototype.getType=function(){return"DDialogConfirm"},n}(Ke),pg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDelete"},n}(wg),Og=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogConfirmDiscard"},n}(wg),Dg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogMessage"},n}(wg),Eg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDialogProcessingMessage"},n}(mg),Mg=function(t){function n(n){var i,r=t.call(this,n)||this;r.qf=!0,r.Hn=0;var e=null==n?void 0:n.delay;r.$f=null!==(i=null==e?void 0:e.done)&&void 0!==i?i:r.theme.getDoneDelay();var u=null==e?void 0:e.close;return r.Qf=void 0!==u?u:r.theme.getCloseDelay(),r.tl=r.message.text,r}return _(n,t),n.prototype.newMessage=function(t){return new Eg(t)},n.prototype.onOpen=function(){this.qf=!1,this.Hn=Date.now();var n=this.nl;null!=n&&clearTimeout(n);var i=this.il;null!=i&&clearTimeout(i);var r=this.message;r.text=this.tl,r.state.removeAll(ht.SUCCEEDED,ht.FAILED);var e=this.ku;null!=e&&e.hide(),t.prototype.onOpen.call(this)},n.prototype.onDone=function(t){var n=this;null!=t?this.il=window.setTimeout((function(){n.close()}),t):this.close()},n.prototype.onResolved=function(t){null!=t&&(this.message.text=t),this.message.state.set(ht.SUCCEEDED,ht.FAILED);var n=this.Qf;if(null!=n)this.onDone(n);else{var i=this.ku;null!=i?i.show():this.close()}},n.prototype.onRejected=function(t){null!=t&&(this.message.text=t),this.message.state.set(ht.FAILED,ht.SUCCEEDED);var n=this.ku;null!=n?n.show():this.onDone(this.Qf)},n.prototype.resolve=function(t){var n=this;if(!this.qf){this.qf=!0;var i=Date.now()-this.Hn,r=this.$f-i;0<r?this.nl=window.setTimeout((function(){n.nl=void 0,n.onResolved(t)}),r):this.onResolved(t)}},n.prototype.reject=function(t){var n=this;if(!this.qf){this.qf=!0;var i=Date.now()-this.Hn,r=this.$f-i;0<r?this.nl=window.setTimeout((function(){n.nl=void 0,n.onRejected(t)}),r):this.onRejected(t)}},n.prototype.onCloseOn=function(){this.qf&&t.prototype.onCloseOn.call(this)},n.prototype.getType=function(){return"DDialogProcessing"},n}(wg),Sg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onOpen=function(){var n=dv.getDocumentController().getName();null!=n&&(this.input.value=n),t.prototype.onOpen.call(this)},n.prototype.onOk=function(n){t.prototype.onOk.call(this,n);var i=dv.getCommandController();at(n)?i.push(new qd(n)):n.then((function(t){i.push(new qd(t))}))},n.prototype.getType=function(){return"DDialogSaveAs"},n}(du),Tg=function(){function t(t){this.Au=t,this.rl=[]}return t.prototype.indexOf=function(t){return this.rl.indexOf(t)},t.prototype.close=function(t){for(var n=this.rl,i=Math.max(0,t),r=n.length-1;i<=r;--r)n[r].close()},t.prototype.add=function(t){this.rl.push(t)},t.prototype.trim=function(t){this.close(this.indexOf(t)+1)},t.prototype.remove=function(t){var n=this.indexOf(t);0<=n&&(this.close(n+1),this.rl.splice(n,1))},t}(),jg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r,e,u=this;t.prototype.init.call(this,n),this.pu=function(){u.onPrerender()},this.St=di(null!==(i=null==n?void 0:n.align)&&void 0!==i?i:ke.BOTTOM,ke),this.el=null!==(r=null==n?void 0:n.fit)&&void 0!==r&&r,this.Mu=null!==(e=null==n?void 0:n.sticky)&&void 0!==e&&e,this.ul=!1,this.Au=null,this.vo=null,this.visible=!1,Pe.apply(this,(function(){u.close()})),this.on("select",(function(){u.close()}));var s=null==n?void 0:n.items;s&&jf.newItems(this,s,this.Mu),this.Tu=new Fe(n)},n.prototype.findItem=function(t){for(var n=this.children,i=0,r=n.length;i<r;++i){var e=n[i];if(e instanceof Df&&e.value===t)return e}return null},n.prototype.getType=function(){return"DMenu"},n.prototype.getContext=function(){return this.vo},n.prototype.getCloseable=function(){return this},n.prototype.open=function(n,i,r){if(this.isHidden()){var e=this.Tu.pick(this);this.Au=n;for(var u=this.children,s=0,h=u.length;s<h;++s){var o=u[s];o instanceof Ki&&o.state.removeAll(ht.FOCUSED,ht.HOVERED)}var a=e.renderer,c=this.pu;if(this.Mu?a.on("prerender",c):a.once("prerender",c),this.el){var f=n.getBounds();null!=f&&(this.width=f.width)}this.ul=null!=r,r=r||new Tg(n),null!=i&&r.trim(i),r.add(this),this.vo=r,e.stage.addChild(this),this.ju=e.getFocusController().get(),this.focus(),t.prototype.show.call(this),this.emit("open",this)}return this},n.prototype.onPrerender=function(){var t=this.Au;if(t){var n=t.getBounds();if(n){this.el&&(this.width=n.width);var i=this.Tu.picked;if(i){var r=this.theme;Le.attach(this,n,r.getOffsetX(),r.getOffsetY(),i.width,i.height,this.St)}}}},n.prototype.close=function(){if(this.isShown()){var n=this.vo;n&&n.remove(this);var i=this.Tu.picked;i&&i.renderer.off("prerender",this.pu),this.Au=null;var r=this.ju;if(null!=r)if(this.ju=null,i){var e=rt.getLayer(r);null!=e&&i!==e&&e.view.focus(),i.getFocusController().focus(r)}else this.blur(!0);else this.blur(!0);t.prototype.hide.call(this);var u=this.parent;u&&u.removeChild(this),this.emit("close",this)}return this},n.prototype.onKeyDown=function(n){return Kt.moveFocusVertically(n,this,this.Tu),this.state.isActionable&&(Kt.isArrowLeftKey(n)||Kt.isCancelKey(n))&&this.close(),t.prototype.onKeyDown.call(this,n)},n.prototype.containsGlobalPoint=function(t){return!this.ul},n}(Xe);jf.setMenuCreator((function(t){return new jg(t)}));var Ng=function(t){function n(n){return t.call(this,n)||this}return _(n,t),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this)},n.prototype.onMenuClose=function(t){if(t){var n=this.sl;n&&t.off("select",n);var i=this.hl;i&&t.off("close",i)}},n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof jg?i:new jg(this.toMenuOptions(t,i))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!0),n):{fit:!0}},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this.Jh;return null==t&&(t=this.toMenu(this.theme,this.Nn),this.Jh=t),t},set:function(t){var n=this.Jh;n!=t&&(this.Jh=t,this.onMenuReplaced(t,n))},enumerable:!1,configurable:!0}),n.prototype.onMenuReplaced=function(t,n){null!=n&&this.onMenuClose(n)},n.prototype.getType=function(){return"DDropdownBase"},n.prototype.onKeyDown=function(n){return Kt.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onClick(t),0))},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.start()},n.prototype.start=function(){var t=this,n=this.menu;if(n.isHidden()){var i=this.sl;null==i&&(i=function(n,i,r){t.onMenuSelect(n,i,r)},this.sl=i);var r=this.hl;null==r&&(r=function(){t.onMenuClose(t.Jh)}),n.on("select",i),n.on("close",r),n.open(this)}},n.prototype.close=function(){this.menu.close()},n}(Ce),Ig=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DDropdown"},n}(Ng),Cg=function(t){function n(n){var i=t.call(this,n)||this;return i.on(zi.down,(function(t){i.state.isActionable&&i.onSelect(t)})),i}return _(n,t),n.prototype.onSelect=function(t){this.emit("select",this)},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onKeyDownActivate(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onSelect(t),0))},n.prototype.getType=function(){return"DExpandableHeader"},n}(pf),Ag=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){var i=this;n.prototype.init.call(this,t);var r=this.theme,e=this.toHeader(r,t);this.Qh=e,e.on("select",(function(){i.toggle()})),this.addChild(e);var u=this.toBody(r,t);this.no=u,this.addChild(u),this.state.isActive?this.onActivated():this.onDeactivated()},i.prototype.toHeader=function(n,i){return i&&i.header?i.header instanceof t.DisplayObject?i.header:this.newHeader(n,i.header):this.newHeader(n)},i.prototype.newHeader=function(t,n){return new Cg(n)},i.prototype.toBody=function(t,n){return n.body},i.prototype.open=function(){this.state.isActive=!0},i.prototype.close=function(){this.state.isActive=!1},i.prototype.toggle=function(){this.state.isActive=!this.state.isActive},i.prototype.onActivated=function(){var t=this.no;t instanceof Ki?t.show():t.visible=!0},i.prototype.onDeactivated=function(){var t=this.no;t instanceof Ki?t.hide():t.visible=!1},i.prototype.onStateChange=function(t,i){n.prototype.onStateChange.call(this,t,i),t.isActive?i.isActive||this.onActivated():i.isActive&&this.onDeactivated()},i.prototype.getType=function(){return"DExpandable"},i}(Xe),Rg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.createInput=function(t){return new ou(t)},n}(Nv),yg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.newUtil=function(){return new Ql(this,this.newOperation(),this.theme,this.Nn)},n.prototype.getType=function(){return"DInputTextArea"},n}(uu),kg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DListItemAmbient"},n}(ib),Lg=function(){function t(t){void 0===t&&(t=256),this.ol=t}return t.prototype.getTileSize=function(){return this.ol},t.prototype.lonLatToMeters=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x*r/180,i.y=Math.log(Math.tan((90+n.y)*Math.PI/360))*r/Math.PI,i},t.prototype.metersToLonLat=function(n,i){var r=t.CIRCUMFERENCE_HALF;return i.x=n.x/r*180,i.y=360*Math.atan(Math.exp(n.y*Math.PI/r))/Math.PI-90,i},t.prototype.pixelsToMeters=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=n.x*u-s,e.y=s-n.y*u,e},t.prototype.metersToPixels=function(n,i,r,e){var u=this.toResolution(i,r),s=t.CIRCUMFERENCE_HALF;return e.x=(n.x+s)/u,e.y=(s-n.y)/u,e},t.prototype.pixelsToTile=function(t,n,i){return i.x=Math.ceil(t.x/n)-1,i.y=Math.ceil(t.y/n)-1,i},t.prototype.metersToTile=function(n,i,r){var e=t.CIRCUMFERENCE_HALF,u=1<<i;return r.x=Math.ceil(.5*(n.x/e+1)*u)-1,r.y=Math.ceil(.5*(1-n.y/e)*u)-1,r},t.prototype.lonLatToTile=function(t,n,i){return this.metersToTile(this.lonLatToMeters(t,i),n,i)},t.prototype.lonLatToPixels=function(t,n,i,r){return this.metersToPixels(this.lonLatToMeters(t,r),n,i,r)},t.prototype.pixelsToLonLat=function(t,n,i,r){return this.metersToLonLat(this.pixelsToMeters(t,n,i,r),r)},t.prototype.tileToPixels=function(t,n,i){return i.x=t.x*n,i.y=t.y*n,i},t.prototype.tileToMeters=function(n,i,r){var e=this.toResolutionMeter(i),u=t.CIRCUMFERENCE_HALF;return r.x=n.x*e+u,r.y=u-n.y*e,r},t.prototype.toResolutionMeter=function(n){return 2*t.CIRCUMFERENCE_HALF/(1<<n)},t.prototype.toResolution=function(n,i){return 2*t.CIRCUMFERENCE_HALF/(i<<n)},t.prototype.toTileCount=function(t){return 1<<t},t.prototype.toTileCode=function(t,n,i){return(n<<t)+i},t.CIRCUMFERENCE_HALF=6378137*Math.PI,t}(),xg=function(){function t(){}return Object.defineProperty(t,"DEFAULT",{get:function(){return null==this.th&&(this.th=new Lg),this.th},enumerable:!1,configurable:!0}),t}(),Bg=function(){function n(n,i,r,e,u,s){this.tx=i,this.ty=r;var h=new t.Sprite(t.Texture.EMPTY);h.parent=n,h.position.set(e,u),h.scale.set(s,s),this.al=h}return n.prototype.load=function(n,i){var r=t.Texture.from(n,{resolution:1});this.al.texture=r,r.valid?i():r.on("update",i)},n.prototype.transform=function(t,n,i){var r=this.al;r.position.set(t,n),r.scale.set(i,i)},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.al.texture.valid},enumerable:!1,configurable:!0}),n.prototype.render=function(t){var n=this.al;n.updateTransform(),n.render(t)},n.prototype.destroy=function(){var n=this.al,i=n.texture,r=i.baseTexture.resource,e=null;r instanceof t.resources.BaseImageResource&&r.source instanceof HTMLImageElement&&(e=r.source),i.destroy(!0),n.destroy(),e&&(e.src="")},n}(),_g=function(){function n(t,n,i,r,e,u){var s=this;this.O=t,this.he=n,this.cl=u,this.fl=!1,this.ll=!0,this.vl=function(){s.onLoaded()},this.bl=i,this._lon0=NaN,this._lat0=NaN,this._lon1=NaN,this._lat1=NaN,this.dl=new Map,this.ml=function(t){s.renderTile(t)},this.wl=NaN,this.pl=NaN,this.Ol=NaN,this.Dl=NaN,this.El=function(t,n,i){s.deleteTile(t,n,i)},this.Ml=function(t){s.destroyTile(t)},this.Sl=function(t){t.loaded||(s.Tl=!1)},this.jl=e.toTileCount(i),this.Nl=1/this.jl,this.Il=r.scale*this.Nl,this.ol=e.getTileSize()*r.scale,this.Io=r,this.$c=e,this.Tl=!0}return n.prototype.newTile=function(t,n,i,r,e){return new Bg(this.O,t,n,i,r,e)},n.prototype.renderTile=function(t){t.render(this.se)},Object.defineProperty(n.prototype,"tz",{get:function(){return this.bl},enumerable:!1,configurable:!0}),n.prototype.render=function(t){this.se=t,this.dl.forEach(this.ml)},n.prototype.move=function(t,i,r,e){var u=this._lon0,s=this._lat0,h=this._lon1,o=this._lat1;if(u!==t||s!==i||h!==r||o!==e){this._lon0=t,this._lat0=i,this._lon1=r,this._lat1=e;var a=this.bl,c=this.$c,f=n.WORK;f.set(t,i),c.lonLatToTile(f,a,f);var l=f.x,v=f.y;f.set(r,e),c.lonLatToTile(f,a,f);var b=f.x,d=f.y,g=this.jl,m=Math.max(0,l),w=Math.min(g-1,b),p=Math.max(0,v),O=Math.min(g-1,d),D=m-this.wl,E=w-this.pl,M=p-this.Ol,S=O-this.Dl,T=D!=D||D<0||1<D,j=E!=E||0<E||E<-1,N=M!=M||M<0||1<M,I=S!=S||0<S||S<-1;if(T||j||N||I){T?this.wl=m:m=this.wl,j?this.pl=w:w=this.pl,N?this.Ol=p:p=this.Ol,I?this.Dl=O:O=this.Dl,this.dl.forEach(this.El);var C=m+w>>1,A=p+O>>1,R=Math.max(C-m,w-C),y=Math.max(A-p,O-A),k=Math.max(R,y);this.toOffset(f);var L=f.x,x=f.y;this.fl=!1,this.ll=!1,this.loadTile(a,C,A,L,x,f);for(var B=1;B<=k;++B){var _=C-B;m<=_&&this.loadTilesY(a,_,A,B,p,O,L,x,f);var P=C+B;P<=w&&this.loadTilesY(a,P,A,B,p,O,L,x,f);var F=A-B;p<=F&&this.loadTilesX(a,C,B-1,m,w,F,L,x,f);var U=A+B;U<=O&&this.loadTilesX(a,C,B-1,m,w,U,L,x,f)}this.ll=!0,this.fl&&this.onLoaded()}}},n.prototype.loadTilesX=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,u,s,h,o);for(var a=1;a<=i;++a){var c=n-a;r<=c&&this.loadTile(t,c,u,s,h,o);var f=n+a;f<=e&&this.loadTile(t,f,u,s,h,o)}},n.prototype.loadTilesY=function(t,n,i,r,e,u,s,h,o){this.loadTile(t,n,i,s,h,o);for(var a=1;a<=r;++a){var c=i-a;e<=c&&this.loadTile(t,n,c,s,h,o);var f=i+a;f<=u&&this.loadTile(t,n,f,s,h,o)}},n.prototype.loadTile=function(t,n,i,r,e,u){var s=this.$c.toTileCode(t,n,i),h=this.dl,o=h.get(s);null==o&&(this.toTilePosition(n,i,r,e,u),o=this.newTile(n,i,u.x,u.y,this.Il),h.set(s,o),o.load(this.he(t,n,i),this.vl),this.Tl=!1)},n.prototype.toTilePosition=function(t,n,i,r,e){var u=this.ol,s=this.Nl;return e.set(t,n),this.$c.tileToPixels(e,u,e),e.set(e.x*s+i,e.y*s+r),e},n.prototype.toOffset=function(t){var n=this.O,i=this.Io,r=this.ol;return t.set(-i.x*r+.5*n.width,-i.y*r+.5*n.height),t},n.prototype.deleteTile=function(t,n,i){var r=t.tx,e=t.ty;(r<this.wl||this.pl<r||e<this.Ol||this.Dl<e)&&(i.delete(n),t.destroy())},n.prototype.destroy=function(){var t=this.dl;t.forEach(this.Ml),t.clear()},n.prototype.destroyTile=function(t){t.destroy()},n.prototype.updateLoadingState=function(){this.Tl=!0,this.dl.forEach(this.Sl)},n.prototype.onLoaded=function(){this.ll?this.cl():this.fl=!0},Object.defineProperty(n.prototype,"loaded",{get:function(){return this.Tl||this.updateLoadingState(),this.Tl},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"mapping",{get:function(){return this.Io},set:function(t){var i=this,r=this.$c,e=t.scale*this.Nl,u=r.getTileSize()*t.scale;this.Il=e,this.ol=u,this.Io=t;var s=n.WORK;this.toOffset(s);var h=s.x,o=s.y;this.dl.forEach((function(t){i.toTilePosition(t.tx,t.ty,h,o,s),t.transform(s.x,s.y,e)}))},enumerable:!1,configurable:!0}),n.WORK=new t.Point,n}(),Pg=function(n){function i(t){var i=n.call(this)||this,r=t.canvas;i.Yi=r,i.he=t.builder;var e=t.mapping;i.Io=e;var u=t.coordinate;i.$c=u,i.Cl=i.toMapping(r,e,u),i._z=NaN,i.bl=NaN,i.Al=t.plane.min,i.Rl=t.plane.max,i.yl=[],i.vl=function(){i.onLoaded()},i.kl=function(){i.Ll=void 0,i.fit()},i.xl=t.plane.throttle;var s=function(){i.fitThrottled()};return i.Bl=s,r.on("scale",s),r.on("move",s),r.snippet.add(i,!0),i}return _(i,n),Object.defineProperty(i.prototype,"coordinate",{get:function(){return this.$c},enumerable:!1,configurable:!0}),i.prototype.fitThrottled=function(){null==this.Ll&&(this.Ll=window.setTimeout(this.kl,this.xl))},i.prototype.toMapping=function(t,n,r){var e=i.WORK_LONLAT,u=r.getTileSize();e.set(n.from.lon,n.from.lat),r.lonLatToPixels(e,0,u,e);var s=e.x,h=e.y;e.set(n.to.lon,n.to.lat),r.lonLatToPixels(e,0,u,e);var o=e.x,a=e.y,c=Math.abs(o-s),f=Math.abs(a-h),l=1e-7,v=1;return l<c?v=l<f?Math.max(t.width/c,t.height/f):t.width/c:l<f&&(v=t.height/f),{scale:v,x:.5*(o+s)/u,y:.5*(a+h)/u}},Object.defineProperty(i.prototype,"mapping",{get:function(){return this.Io},set:function(t){var n=this.Cl,i=this.toMapping(this.Yi,t,this.$c),r=1e-7;if(r<Math.abs(n.scale-i.scale)||r<Math.abs(n.x-i.x)||r<Math.abs(n.y-i.y)){this.Cl=i;for(var e=this.yl,u=0,s=e.length;u<s;++u){var h=e[u];h&&(h.mapping=i)}rt.update(this.Yi),this.Bl()}},enumerable:!1,configurable:!0}),i.prototype.newPlane=function(t){return new _g(this.Yi,this.he,t,this.Cl,this.$c,this.vl)},i.prototype.render=function(t){for(var n=this.bl,i=this.yl,r=0;r<n;++r)null!=(e=i[r])&&e.render(t);for(r=i.length-1;n<r;--r){var e;null!=(e=i[r])&&e.render(t)}var u=i[n];null!=u&&u.render(t)},i.prototype.toTileZ=function(t){return Math.min(this.Rl,Math.max(this.Al,Math.floor(t)))},i.prototype.updateTransform=function(){},i.prototype.toZ=function(t){return Math.log(this.Cl.scale*t)/Math.log(2)},i.prototype.move=function(t,n,i,r,e){var u=this.yl,s=this.toZ(t);if(this._z!==s){this._z=s;var h=this.toTileZ(s);if(this.bl!==h){this.bl=h;var o=u[h];null==o&&(o=this.newPlane(h),u[h]=o)}}var a=u[this.bl];return null!=a&&a.move(n,i,r,e),this},i.prototype.fit=function(){var t=this.Yi;if(null!=t){var n=t.parent;if(null!=n){var r=t.scale,e=r.x,u=r.y,s=t.x,h=t.y,o=this.$c,a=this.Cl,c=o.getTileSize()*a.scale,f=a.x*c-(s/e+.5*t.width),l=f+n.width/e,v=a.y*c-(h/u+.5*t.height),b=v+n.height/u,d=i.WORK_LONLAT;d.set(f,v),o.pixelsToLonLat(d,0,c,d);var g=d.x,m=d.y;d.set(l,b),o.pixelsToLonLat(d,0,c,d);var w=d.x,p=d.y;this.move(e,g,m,w,p)}}return this},i.prototype.destroyPlanesBefore=function(t,n){for(var i=0;i<t;++i){var r=n[i];r&&(r.destroy(),n[i]=void 0)}},i.prototype.destroyPlanesAfter=function(t,n){for(var i=t+1,r=n.length;i<r;++i){var e=n[i];e&&(e.destroy(),n[i]=void 0)}},i.prototype.cleanup=function(){var t=this.bl,n=this.yl,i=n[t];if(i&&i.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(t,n);for(var r=t+1,e=n.length;r<e;++r)if((u=n[r])&&u.loaded)return this.destroyPlanesBefore(t,n),void this.destroyPlanesAfter(r,n);for(r=t-1;0<=r;--r){var u;if((u=n[r])&&u.loaded)return void this.destroyPlanesBefore(r,n)}},i.prototype.onLoaded=function(){this.cleanup(),rt.update(this.Yi)},i.prototype.destroy=function(){for(var t=this.yl,n=0,i=t.length;n<i;++n){var r=t[n];r&&(r.destroy(),t[n]=void 0)}var e=this.Yi,u=this.Bl;return e.off("scale",u),e.off("move",u),e.snippet.remove(this,!0),this},i.WORK_LONLAT=new t.Point,i}(t.utils.EventEmitter),Fg=function(t,n,i){return"https://j.tile.openstreetmap.jp/"+t+"/"+n+"/"+i+".png"},Ug=function(){function t(){}return t.toPlaneOptions=function(t){var n,i,r,e=t.plane;return{min:null!==(n=null==e?void 0:e.min)&&void 0!==n?n:this.MIN,max:null!==(i=null==e?void 0:e.max)&&void 0!==i?i:this.MAX,throttle:null!==(r=null==e?void 0:e.throttle)&&void 0!==r?r:this.THROTTLE}},t.from=function(t){return new Pg({canvas:t.canvas,builder:t.builder||Fg,mapping:t.canvas.tile.mapping,coordinate:t.coordinate||xg.DEFAULT,plane:this.toPlaneOptions(t)})},t.MIN=0,t.MAX=18,t.THROTTLE=333,t}(),Gg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMenu=function(t,n){var i=null==n?void 0:n.menu;return i instanceof jg?i:new jg(this.toMenuOptions(t,i))},n.prototype.newMenu=function(t,n){return new jg(this.toMenuOptions(t,n))},n.prototype.toMenuOptions=function(t,n){return n?(null==n.fit&&(n.fit=!1),n):{fit:!1}},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.open()},n.prototype.open=function(){this.menu.open(this)},n.prototype.close=function(){this.menu.close()},Object.defineProperty(n.prototype,"menu",{get:function(){var t=this,n=this.Jh;return null==n&&((n=this.toMenu(this.theme,this.Nn)).on("select",(function(n,i,r){t.onMenuSelect(n,i,r)})),this.Jh=n),n},enumerable:!1,configurable:!0}),n.prototype.onMenuSelect=function(t,n,i){this.emit("select",t,n,this);var r=this.parent;r&&r.emit("select",t,n,r)},n.prototype.onKeyDown=function(n){return Kt.isArrowDownKey(n)&&this.onKeyDownArrowDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowDown=function(t){return!(!this.state.isActionable||!this.state.isFocused||(this.onActivate(t),0))},n.prototype.getType=function(){return"DMenuBarItem"},n}(Ae),zg=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){n.prototype.init.call(this,t);var i=null==t?void 0:t.items;if(i)for(var r=0,e=i.length;r<e;++r){var u=this.toItem(i[r]);u&&this.addChild(u)}},i.prototype.toItem=function(n){return null==n?null:n instanceof t.DisplayObject?n:"space"in n?new ze(n):new Gg(n)},i.prototype.onKeyDown=function(t){return Kt.moveFocusHorizontally(t,this),n.prototype.onKeyDown.call(this,t)},i.prototype.getType=function(){return"DMenuBar"},i}(We),Hg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.initReflowable=function(){},n.prototype.getType=function(){return"DMenuSidedContent"},n}(We),Vg={NONE:0,SINGLE:1,SINGLE_ONCE:2},Wg=function(){return!0},Xg=function(n){function i(t,i){var r,e,u,s=n.call(this)||this;s.Qa=t,s.sc=null,s.un=!0,s.jt=di(null!==(e=null!==(r=null==i?void 0:i.mode)&&void 0!==r?r:null==i?void 0:i.type)&&void 0!==e?e:Vg.SINGLE_ONCE,Vg),s._l=null!==(u=null==i?void 0:i.filter)&&void 0!==u?u:s.getFilterDefault();var h=null==i?void 0:i.on;if(h)for(var o in h){var a=h[o];a&&s.on(o,a)}return s}return _(i,n),i.prototype.first=function(){return this.sc},i.prototype.toDirty=function(){this.un=!0},i.prototype.update=function(){this.un&&(this.un=!1,this.Ze(this.Qa))},i.prototype.hasMenu=function(t){return t&&t.menu instanceof jg},i.prototype.Ze=function(n){for(var i=n.children,r=0,e=i.length;r<e;++r){var u=i[r];u instanceof Of&&u.state.isActive&&this.Pl(u,!1),u instanceof t.Container&&this.Ze(u),this.hasMenu(u)&&this.Ze(u.menu)}},i.prototype.add=function(t){this.update(),this.Pl(t,!0)},i.prototype.set=function(t){this.update(),this.Pl(t,!0)},i.prototype.get=function(t){return this.update(),this.sc},i.prototype.getIndex=function(t){return null},i.prototype.size=function(){return this.sc?1:0},i.prototype.isEmpty=function(){return null==this.sc},i.prototype.remove=function(t){this.update(),this.sc===t&&this.Pl(null,!0)},i.prototype.clear=function(){this.update(),this.Pl(null,!0)},i.prototype.getFilterDefault=function(){return Wg},i.prototype.Pl=function(t,n){var i=this.sc,r=this.jt;r!==Vg.NONE&&this._l(t)&&i!==t&&(this.setState(i,r,!1),this.sc=t,this.setState(t,r,!0),n&&this.emit("change",this))},i.prototype.setState=function(t,n,i){t&&(n===Vg.SINGLE?t.state.isActive=i:i?t.state.addAll(ht.ACTIVE,ht.READ_ONLY):t.state.removeAll(ht.ACTIVE,ht.READ_ONLY))},i}(t.utils.EventEmitter),Kg=function(t){function n(n){var i,r=t.call(this,n)||this,e=new Tg(r);r.vo=e,e.add(r);var u=null==n?void 0:n.items;if(null!=u){var s=null!==(i=null==n?void 0:n.sticky)&&void 0!==i&&i;r.newItems(u,s)}var h=null==n?void 0:n.selection;return r.hc=h instanceof Xg?h:r.newSelection(h),r}return _(n,t),n.prototype.newSelection=function(t){return new Xg(this.content,t)},n.prototype.onChildrenDirty=function(){var n=this.hc;null!=n&&n.toDirty(),t.prototype.onChildrenDirty.call(this)},n.prototype.newItems=function(t,n){al.newItems(this.content,t,n)},n.prototype.newContent=function(t){return new Hg(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),n.prototype.getContext=function(){return this.vo},n.prototype.getCloseable=function(){return this},n.prototype.open=function(){},n.prototype.close=function(){},n.prototype.onKeyDown=function(n){return Kt.moveFocusVertically(n,this),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DMenuSided"},n}(jb),Yg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteError"},n}(Rb),Jg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteNoItemsFound"},n}(Rb),Zg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DNoteSearching"},n}(Rb),qg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Ki),$g=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationDotsButton"},n}(Du),Qg=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){t.prototype.init.call(this,n),this.Fl=new $g({width:n.button.width,visible:!!n.button.dotsLeft}),this.Ul=new $g({width:n.button.width,visible:!!n.button.dotsRight}),this.addChild(this.Fl),this.addChild(this.Ul)},n.prototype.update=function(t){var n=this;if(null!=t.start&&null!=t.end){var i=t.end-t.start+1>0?t.end-t.start+1:0,r=this.children.slice(1,this.children.length-1);if(r.length<i){for(var e=r.length;e<i;e++){var u=new Ae({width:t.button.width});this.addChildAt(u,this.children.length-1),u.on("active",(function(t){n.emit("active",t)}))}r=this.children.slice(1,this.children.length-1)}else if(r.length>i)for(e=i;e<r.length;e++)r[e].hide();for(e=0;e<i;e++)(u=r[e]).text=t.start+e+1,u.state.isActive=t.start+e===t.selected,u.isHidden()&&u.show();t.button.dotsLeft?this.Fl.show():this.Fl.hide(),t.button.dotsRight?this.Ul.show():this.Ul.hide()}},n.prototype.getType=function(){return"DPaginationDynamicButtons"},n}(We),tm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DPaginationNavigationButton"},n}(Du),nm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i,r=this;t.prototype.init.call(this,n),this.DEFAULT_SELECTED=0,this.Gl=n.total,this.na=null!==(i=n.selected)&&void 0!==i?i:this.DEFAULT_SELECTED;var e=n.button;this.zl={first:!!(null==e?void 0:e.first),last:!!(null==e?void 0:e.last),width:null==e?void 0:e.width},this.initButtons(this.getButtonWidth()),this.listenButtonClicked(),this.on("resize",(function(){r.Hl=r.toNumberVisible(),r.update()}))},Object.defineProperty(n.prototype,"selected",{get:function(){return this.na},set:function(t){(t<0||t>=this.Gl||!Number.isInteger(t))&&(t=this.DEFAULT_SELECTED),this.na=t,this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"total",{get:function(){return this.Gl},set:function(t){t>=0&&Number.isInteger(t)&&(this.Gl=t,this.Hl=this.toNumberVisible(),this.selected=this.na,this.Vl.text=this.Gl,this.update())},enumerable:!1,configurable:!0}),n.prototype.initButtons=function(t){this.Wl=new tm({width:t,image:{source:K.getInstance().getAtlas().mappings.pagination_navigation_button_previous}}),this.Xl=new tm({width:t,image:{source:K.getInstance().getAtlas().mappings.pagination_navigation_button_next}}),this.Kl=new tm({width:t,image:{source:K.getInstance().getAtlas().mappings.pagination_navigation_button_go_first},visible:this.zl.first}),this.Yl=new tm({width:t,image:{source:K.getInstance().getAtlas().mappings.pagination_navigation_button_go_last},visible:this.zl.last}),this.Jl=new Qg({button:{width:t}}),this.Zl=new Ae({width:t,text:{value:1}}),this.Vl=new Ae({width:t,text:{value:this.Gl}}),this.addChild(this.Kl),this.addChild(this.Wl),this.addChild(this.Zl),this.addChild(this.Jl),this.addChild(this.Vl),this.addChild(this.Xl),this.addChild(this.Yl)},n.prototype.listenButtonClicked=function(){var t=this;this.Zl.on("active",(function(n){t.onClickPageButton(n)})),this.Vl.on("active",(function(n){t.onClickPageButton(n)})),this.Jl.on("active",(function(n){t.onClickPageButton(n)})),this.Kl.on("active",(function(n){t.selected=t.DEFAULT_SELECTED})),this.Yl.on("active",(function(n){t.selected=t.Gl-1})),this.Xl.on("active",(function(n){t.selected!==t.Gl+1&&(t.selected=t.na+1)})),this.Wl.on("active",(function(n){0!==t.na&&(t.selected=t.na-1)}))},n.prototype.update=function(){var t,n,i,r,e=0,u=0;this.updateStaticButtons();var s=Math.ceil(.5*(this.Hl-1)),h=Math.floor(.5*(this.Hl-1));this.na<s?(e=this.na,u=this.Hl-e-1):this.na+h>this.Gl-1?(u=this.Gl-1-this.selected,e=this.Hl-u-1):(e=s,u=h),this.na<=e?(t=1,i=!1):(t=this.na-e+2,i=!0),this.na+u>=this.Gl-1?(n=this.Gl-2,r=!1):(n=this.na+u-2,r=!0),this.Jl.update({start:t,end:n,selected:this.na,button:{width:this.getButtonWidth(),dotsLeft:i,dotsRight:r}})},n.prototype.updateStaticButtons=function(){this.Gl>0?this.Zl.show():this.Zl.hide(),this.Gl>1?this.Vl.show():this.Vl.hide();var t=this.na===this.DEFAULT_SELECTED,n=this.na===this.Gl-1||0===this.Gl;this.Zl.state.isActive=t,this.Vl.state.isActive=n,this.Kl.state.isDisabled=t,this.Wl.state.isDisabled=t,this.Xl.state.isDisabled=n,this.Yl.state.isDisabled=n},n.prototype.getButtonWidth=function(){return this.zl.width?this.zl.width:this.theme.getButtonWidth()},n.prototype.toNumberVisible=function(){var t=2;this.zl.first&&t++,this.zl.last&&t++;var n=t*(this.getButtonWidth()+2*this.Re.horizontal),i=this.width-n,r=Math.floor(i/(this.getButtonWidth()+2*this.Re.horizontal));return Math.min(this.Gl,Math.max(r,5))},n.prototype.onClickPageButton=function(t){var n=Number(t.text)-1;this.na!==n&&(this.na=n,this.update())},n.prototype.getType=function(){return"DPagination"},n}(We),im=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Ki),rm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n}(Ki),em=function(t){function n(n){var i=t.call(this,n)||this;i.L=[];var r=null==n?void 0:n.values;return r&&(i.values=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){if(t.prototype.onMenuSelect.call(this,n,i,r),i instanceof Mf){var e=this.L,u=[],s=[];i.state.isActive?this.updateMenuItems(r,e,n,void 0,u,s):this.updateMenuItems(r,e,void 0,n,u,s),this.L=u,this.text=s,this.onValueChange(u,e,s)}},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.L,e=[],u=[];this.updateMenuItems(n,r,void 0,void 0,e,u),this.L=e,this.text=u},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.start=function(){this.updateMenuItems(this.menu,this.L),t.prototype.start.call(this)},Object.defineProperty(n.prototype,"values",{get:function(){return this.L},set:function(t){var n=this.L;if(!this.isSameValues(t,n)){var i=[],r=[];this.updateMenuItems(this.menu,t,void 0,void 0,i,r),this.L=i,this.text=r}},enumerable:!1,configurable:!0}),n.prototype.isSameValues=function(t,n){if(t.length===n.length)for(var i=0,r=t.length;i<r;++i)if(n.indexOf(t[i])<0)return!1;return!1},n.prototype.updateMenuItems=function(t,n,i,r,e,u){for(var s=t.children,h=0,o=s.length;h<o;++h){var a=s[h];if(a instanceof _f)this.updateMenuItems(a.menu,n,i,r,e,u);else if(a instanceof Mf){var c=a.value;void 0!==r&&r===c?a.state.isActive=!1:void 0!==i&&a.value===i||0<=n.indexOf(a.value)?(e&&e.push(a.value),u&&u.push(a),a.state.isActive=!0):a.state.isActive=!1}}},n.prototype.getType=function(){return"DSelectMultiple"},n}(Ng),um=function(t){function n(n){var i=t.call(this,n)||this;i.At=null;var r=null==n?void 0:n.value;return null!=r&&(i.value=r),i}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){t.prototype.onMenuSelect.call(this,n,i,r);var e=this.At;e!==n&&(this.At=n,this.text=i,this.onValueChange(n,e,i))},n.prototype.onMenuReplaced=function(n,i){t.prototype.onMenuReplaced.call(this,n,i);var r=this.At;if(null!=r){var e=this.findMenuItem(n,r);null!=e?(this.At=r,this.text=e):(this.At=null,this.text=null)}else this.At=null,this.text=null},n.prototype.onValueChange=function(t,n,i){this.emit("change",t,n,i,this)},n.prototype.findMenuItem=function(t,n){for(var i=t.children,r=0,e=i.length;r<e;++r){var u=i[r];if(u instanceof _f){var s=this.findMenuItem(u.menu,n);if(null!=s)return s}else if(u instanceof Df&&u.value===n)return u}return null},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},set:function(t){if(this.At!==t){var n=this.findMenuItem(this.menu,t);null!=n?(this.At=t,this.text=n):(this.At=null,this.text=null)}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSelect"},n}(Ng),sm=function(t){function n(n,i,r,e,u){var s=t.call(this,n,i,r,i,r)||this;return s.ql=e,s.$l=u,s.mu=.5*i,s.wu=.5*r,s.interactive=!1,s.interactiveChildren=!1,n.on("update",(function(){s.onTextureUpdate()})),s}return _(n,t),n.prototype.onTextureUpdate=function(){this.emit("update",this)},n.prototype.onReflow=function(t,n,i){var r=this.mu,e=this.wu;this.x=-r+this.ql,this.y=-e+this.$l,this.width=r+n+r,this.height=e+i+e},n}(t.NineSlicePlane),hm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n),this.At=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},set:function(t){this.At=t},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderLabel"},n}(Ne),om=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderThumb"},n}(Ae),am=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i;t.prototype.init.call(this,n),this.At=null!==(i=null==n?void 0:n.value)&&void 0!==i?i:0,this.Ql=this.toRounder(n)},n.prototype.toRounder=function(t){var n,i=null==t?void 0:t.rounder;if(i)return i;var r=null!==(n=null==t?void 0:t.precision)&&void 0!==n?n:this.theme.getPrecision();return function(t){var n=Math.pow(10,r);return Math.round(t*n)/n}},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},set:function(t){this.At=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rounder",{get:function(){return this.Ql},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSliderValue"},n}(Ne),cm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.init=function(n){var i=this;t.prototype.init.call(this,n),this.tv=0,this.nv=this.newTrack(n),this.addChild(this.nv),this.iv=this.newTrackSelected(n),this.iv.state.isActive=!0,this.addChild(this.iv),this.mc=this.newThumb(n),this.addChild(this.mc),this.jr=this.newLabelMin(n),this.addChild(this.jr),this.Nr=this.newLabelMax(n),this.addChild(this.Nr),this.At=this.newValue(n),this.addChild(this.At),this.nv.on(zi.down,(function(t){i.At.visible=i.state.inEnabled,i.onTrackDown(t.data.global)})),this.iv.on(zi.down,(function(t){i.At.visible=i.state.inEnabled,i.onTrackSelectedDown(t.data.global)})),this.rv=function(t){i.onTrackUpBound(t),i.At.visible=!1},this.ev=function(t){i.onTrackSelectedUpBound(t),i.At.visible=!1},this.mc.on(zi.down,(function(t){i.At.visible=!0,i.onThumbDown(t)})),this.uv=function(t){i.onThumbMove(t)},this.sv=function(t){i.onThumbUp(t),i.At.visible=!1},this.onValuesChange()},n.prototype.newThumb=function(t){return new om(null==t?void 0:t.thumb)},n.prototype.newValue=function(t){return new am(this.toValueOptions(null==t?void 0:t.value))},n.prototype.toValueOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value=t.value),null==t.visible&&(t.visible=!1),t},n.prototype.newLabelMin=function(t){return new hm(this.toLabelMinOptions(null==t?void 0:t.min))},n.prototype.toLabelMinOptions=function(t){null==(t=t||{}).value&&(t.value=0);var n=t.text||{};return t.text=n,null==n.value&&(n.value=""+t.value),t},n.prototype.newLabelMax=function(t){return new hm(this.toLabelMaxOptions(null==t?void 0:t.max))},n.prototype.toLabelMaxOptions=function(t){null==(t=t||{}).value&&(t.value=1);var n=t.text||{};return t.text=n,null==n.value&&(n.value=""+t.value),t},n.prototype.getValueMargin=function(){return 14},n.prototype.onTrackDown=function(t){if(!this.state.inDisabled){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.hv=i;var r=this.rv;i.on(zi.up,r),i.on(zi.upoutside,r),i.on(zi.cancel,r)}this.onPick(t)}},n.prototype.onTrackSelectedDown=function(t){if(!this.state.inDisabled){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.hv=i;var r=this.ev;i.on(zi.up,r),i.on(zi.upoutside,r),i.on(zi.cancel,r)}this.onPick(t)}},n.prototype.onTrackUpBound=function(t){var n=this.hv;if(n){this.hv=void 0;var i=this.rv;n.off(zi.up,i),n.off(zi.upoutside,i),n.off(zi.cancel,i)}},n.prototype.onTrackSelectedUpBound=function(t){var n=this.hv;if(n){this.hv=void 0;var i=this.ev;n.off(zi.up,i),n.off(zi.upoutside,i),n.off(zi.cancel,i)}},n.prototype.onThumbMove=function(t){this.state.inDisabled||this.onPick(t.data.global)},n.prototype.onThumbDown=function(t){var n=rt.getLayer(this);if(n){var i=n.renderer.plugins.interaction;this.hv=i;var r=this.uv;i.on(zi.move,r);var e=this.sv;i.on(zi.up,e),i.on(zi.upoutside,e),i.on(zi.cancel,e)}},n.prototype.onThumbUp=function(t){var n=this.hv;if(n){this.hv=void 0;var i=this.uv;n.off(zi.move,i);var r=this.sv;n.off(zi.up,r),n.off(zi.upoutside,r),n.off(zi.cancel,r)}},n.prototype.updateValue=function(){var t=this.jr.value,n=this.Nr.value,i=this.At,r=i.rounder(t+this.tv*(n-t)),e=i.value;r!==e&&(i.value=r,i.text=i.value,this.emit("change",r,e,this))},n.prototype.onResize=function(n,i,r,e){t.prototype.onResize.call(this,n,i,r,e),this.onValuesChange()},Object.defineProperty(n.prototype,"value",{get:function(){return this.At.value},set:function(t){t=Math.max(this.jr.value,Math.min(this.Nr.value,t)),this.At.value!==t&&(this.At.value=t,this.onValuesChange())},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"min",{get:function(){return this.jr.value},set:function(t){var n=this.jr;if(t=Math.min(this.Nr.value,t),n.value!==t){var i=this.At;n.text=n.value=t,i.value=Math.max(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"max",{get:function(){return this.Nr.value},set:function(t){var n=this.Nr;if(t=Math.max(this.jr.value,t),n.value!==t){var i=this.At;n.text=n.value=t,i.value=Math.min(t,i.value),this.onValuesChange()}},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DSlider"},n}(Ki),fm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrack"},n}(Ae),lm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackHorizontal"},n}(fm),vm=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new lm(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new lm(null==t?void 0:t.track)},i.prototype.toValueOptions=function(t){var i=this;return null==(t=n.prototype.toValueOptions.call(this,t)).y&&(t.y=function(t,n){return.5*t-n-i.getValueMargin()}),t},i.prototype.toLabelMinOptions=function(t){return null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return.5*-n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.toLabelMaxOptions=function(t){return null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return t-.5*n}),null==t.y&&(t.y=function(t,n){return-n}),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=Math.max(0,Math.min(this.nv.width,i.x));this.tv=r/this.nv.width,this.moveThumbPosition(r)},i.prototype.onValuesChange=function(){var t=this.jr.value,n=this.Nr.value,i=this.At.value;this.tv=(i-t)/(n-t);var r=this.tv*this.nv.width;this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.mc;n.x=t-.5*n.width,this.iv.width=t;var i=this.At;i.x=t-.5*i.width,this.updateValue()},i.prototype.toThumbCoordinate=function(t){return t-.5*this.mc.width},i.prototype.getType=function(){return"DSliderHorizontal"},i}(cm),bm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DSliderTrackVertical"},n}(fm),dm=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.newTrack=function(t){return new bm(null==t?void 0:t.track)},i.prototype.newTrackSelected=function(t){return new bm(null==t?void 0:t.track)},i.prototype.toLabelMinOptions=function(t){null==(t=n.prototype.toLabelMinOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return t-.5*n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=le.RIGHT),t},i.prototype.toLabelMaxOptions=function(t){null==(t=n.prototype.toLabelMaxOptions.call(this,t)).x&&(t.x=function(t,n){return-n}),null==t.y&&(t.y=function(t,n){return.5*-n});var i=t.text||{};t.text=i;var r=i.align||{};return i.align=r,null==r.horizontal&&(r.horizontal=le.RIGHT),t},i.prototype.onPick=function(n){var i=new t.Point(0,0);this.toLocal(n,void 0,i);var r=this.height,e=Math.max(0,Math.min(r,i.y));this.tv=(r-e)/r,this.moveThumbPosition(e)},i.prototype.onValuesChange=function(){var t=this.jr.value,n=this.Nr.value,i=this.At.value;this.tv=(i-t)/(n-t);var r=this.height*(1-this.tv);this.moveThumbPosition(r)},i.prototype.moveThumbPosition=function(t){var n=this.mc;n.y=t-.5*n.height;var i=this.iv;i.y=t,i.height=this.height-t;var r=this.At;r.y=t-r.height-this.getValueMargin(),this.updateValue()},i.prototype.getType=function(){return"DSliderVertical"},i}(cm),gm=function(){function t(){}return t.setReadOnly=function(t,n,i,r){t.state.isReadOnly=this.toReadOnly(n,i,r)},t.setRenderable=function(t,n,i,r){var e=this.toRenderable(n,i,r);t.renderable=e,t.state.isDisabled=!e},t.toReadOnly=function(t,n,i){var r=i.editing.enable;return!0!==r&&(!1===r||!r(t,n))},t.toRenderable=function(t,n,i){var r=i.renderable;return!0===r||!1!==r&&r(t,n)},t}(),mm=function(t){function n(n,i,r,e){var u,s=t.call(this,e)||this;return s.ov=-1,s.av=n,s.cv=i,s.q=r,s.fv=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i,r=this;t.prototype.onActivate.call(this,n);var e=this.cv.selecting,u=e.dialog;if(u){var s=null!==(i=this.nu)&&void 0!==i?i:null;e.setter(u,s),u.open().then((function(){var t=e.getter(u);r.fv?t!==s&&(r.text=t,r.onValueChange(t,s)):r.onValueChange(t,null)}))}},n.prototype.onValueChange=function(t,n){var i=this.lv;if(void 0!==i){var r=this.ov,e=this.av;this.cv.setter(i,e,t),this.emit("change",t,n,this),this.q(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.nu;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,u?(this.tu=t,this.nu=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellSelectDialog"},n}(Ae),wm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionDialog"},n}(mm),pm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onMenuSelect=function(n,i,r){var e=this.lv;if(void 0!==e){var u=this.ov,s=this.av;this.cv.setter(e,s,n),t.prototype.onMenuSelect.call(this,n,i,r),this.q(n,null,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellActionMenu"},n}(Ig),Om=function(t){function n(n,i,r,e){var u,s=t.call(this,e)||this;return s.ov=-1,s.av=n,s.cv=i,s.q=r,s.fv=null!==(u=null==e?void 0:e.sync)&&void 0!==u?u:s.theme.isSyncEnabled(),s}return _(n,t),n.prototype.onActivate=function(n){var i=this;t.prototype.onActivate.call(this,n);var r=this.cv.selecting.promise;r&&r().then((function(t){var n;if(i.fv){var r=null!==(n=i.nu)&&void 0!==n?n:null;t!==r&&(i.text=t,i.onValueChange(t,r))}else i.onValueChange(t,null)}))},n.prototype.onValueChange=function(t,n){var i=this.lv;if(void 0!==i){var r=this.ov,e=this.av;this.cv.setter(i,e,t),this.emit("change",t,n,this),this.q(t,n,i,r,e,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){var t=this.nu;return void 0!==t?t:null},set:function(t){this.text=t},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,u?(this.tu=t,this.nu=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellSelectPromise"},n}(Ae),Dm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellActionPromise"},n}(Om),Em=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellText"},n}(Ie),Mm=function(t){function n(n,i,r,e){var u,s=t.call(this,n,i,r,e)||this,h=di(null!==(u=null==e?void 0:e.when)&&void 0!==u?u:fe.CLICKED,fe);return s.cu=h,s.initOnClick(h,s.theme,e),s}return _(n,t),n.prototype.initOnClick=function(t,n,i){var r=this;zi.onClick(this,(function(n){t===fe.CLICKED&&r.onClick(n)}))},n.prototype.onClick=function(t){this.state.isActionable&&this.onActivate(t)},n.prototype.onDblClick=function(n,i){return this.cu===fe.DOUBLE_CLICKED&&this.onClick(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.onActivate=function(t){this.emit("active",this);var n=this.lv;if(void 0!==n){var i=this.ov,r=this.av;this.emit("change",null,null,this),this.q(null,null,n,i,r,this)}},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTableBodyCellButton"},n}(Em),Sm={INDEX:0,TEXT:1,INTEGER:2,REAL:3,CHECK:4,CHECK_SINGLE:5,COLOR:6,BUTTON:7,SELECT:8,DATE:9,DATETIME:10,TIME:11,ACTION:12,LINK:13,TREE:14},Tm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.onValueChange(!0,!1)},n.prototype.onInactivate=function(n){t.prototype.onInactivate.call(this,n),this.onValueChange(!1,!0)},n.prototype.onValueChange=function(t,n){var i=this.lv;if(void 0!==i){var r=this.ov,e=this.av,u=this.cv;u.setter(i,e,t),this.emit("change",t,n,this);var s=this.q;s(t,n,i,r,e,this),t&&u.type===Sm.CHECK_SINGLE&&this.onChangeSingle(r,e,u,s)}},n.prototype.onChangeSingle=function(t,n,i,r){var e=this,u=this.parent;if(u){var s=u.parent;if(s){var h=!1,o=i.getter,a=i.setter;s.data.each((function(i,u){return t===u||!o(i,n)||(a(i,n,!1),h=!0,r(!1,!0,i,u,n,e),!1)})),h&&s.update(!0)}}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.state.isActive=!!t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellCheck"},n}(Dv),jm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.lv;if(void 0!==r){var e=this.ov,u=this.av;this.cv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.q(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r;var s=this.At;if(Xt(t))s.color=t,s.alpha=1;else if(at(t)){var h=Number(t);s.color=h==h?h:16777215,s.alpha=1}else if(null!=t){var o=t.color,a=t.alpha;s.color=Xt(o)?o:16777215,s.alpha=Xt(a)?a:1}else s.color=16777215,s.alpha=1;var c=this.cv;gm.setReadOnly(this,n,e,c),gm.setRenderable(this,n,e,c)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellColor"},n}(Uv),Nm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime());var i=e.lv;if(void 0!==i){var r=e.ov,u=e.av;e.cv.setter(i,u,t),e.emit("change",t,n,e),e.q(t,n,i,r,u,e)}}))},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Vu(i):zv.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.lv=n,this.ov=r,t instanceof Date)u?(this.tu=t,this.nu=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(Xt(t)){var s=this.nu;void 0===s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}var h=this.cv;gm.setReadOnly(this,n,e,h),gm.setRenderable(this,n,e,h)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellDate"},n}(Ae),Im=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.page=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime());var i=e.lv;if(void 0!==i){var r=e.ov,u=e.av;e.cv.setter(i,u,t),e.emit("change",t,n,e),e.q(t,n,i,r,u,e)}}))},n.prototype.getDatetimeMask=function(){var t,n,i=this.Ha;return null==i&&(i=Kv.toMask(null===(n=null===(t=this.Nn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Ha=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Pu(i):Vv.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.lv=n,this.ov=r,t instanceof Date)u?(this.tu=t,this.nu=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(Xt(t)){var s=this.nu;void 0===s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}var h=this.cv;gm.setReadOnly(this,n,e,h),gm.setRenderable(this,n,e,h)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellDatetime"},n}(Ae),Cm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=r;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellIndex"},n}(Ie),Am=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.lv;if(void 0!==r){var e=this.ov,u=this.av;this.cv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.q(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=Number(t);var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellInputInteger"},n}(ou),Rm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.lv;if(void 0!==r){var e=this.ov,u=this.av;this.cv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.q(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=Number(t);var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellInputReal"},n}(fu),ym=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i){var r=this.lv;if(void 0!==r){var e=this.ov,u=this.av;this.cv.setter(r,u,n),t.prototype.onValueChange.call(this,n,i),this.q(n,i,r,e,u,this)}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=String(t);var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellInputText"},n}(bu),km=function(t){function n(n){var i=t.call(this,n)||this;return i.Bn=new pv(i.Bn),i}return _(n,t),Object.defineProperty(n.prototype,"padding",{get:function(){return this.Bn},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellInputTreeInput"},n}(bu),Lm=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableBodyCellInputTreeMarker"},n}(Ce),xm={START:"START",END:"END",FROZEN:"FROZEN",FROZEN_END:"FROZEN_END",SORTABLE:"SORTABLE",SORTED_ASCENDING:"SORTED_ASCENDING",SORTED_DESCENDING:"SORTED_DESCENDING",HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED",CHECKABLE:"CHECKABLE",SELECTABLE:"SELECTABLE"},Bm=function(t){function n(n,i,r,e){var u=t.call(this,function(t){if(null!=t)return{weight:t.weight,width:t.width}}(e))||this;u.ov=-1,u.av=n,u.cv=i,u.q=r;var s=u.newInput(e);u._u=s,u.addChild(s);var h=u.newMarker(e);return u.R=h,u.addChild(h),u}return _(n,t),n.prototype.newInput=function(t){return new km(this.toInputOptions(t))},n.prototype.toInputOptions=function(t){var n=this;return{weight:1,text:null==t?void 0:t.text,editing:null==t?void 0:t.editing,when:null==t?void 0:t.when,cursor:null==t?void 0:t.cursor,on:{change:function(t,i){n.onInputChange(t,i)}}}},n.prototype.onInputChange=function(t,n){var i=this.lv;if(void 0!==i){var r=this.ov,e=this.av;this.cv.setter(i,e,t),this.emit("change",t,n,this),this.q(t,n,i,r,e,this)}},n.prototype.newMarker=function(t){var n=this;return new Lm({visible:!1,on:{active:function(){n.onMarkerActive()}}})},n.prototype.onMarkerActive=function(){if(this.R.state.is(xm.HAS_CHILDREN)){var t=this.parent;if(t){var n=t.parent;if(n){var i=n.data;i&&i.toggle&&(i.toggle(this.lv),this.emit("cellchange",null,null,this.lv,this.ov,this.av,this))}}}},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this._u.padding.getLeft()},n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r;var s=this._u;s.visible=!0,s.text=String(t);var h=this.R;if(Xt(i)){var o=!!(1&i),a=!!(2&i),c=i>>2,f=h.state;f.lock(),f.set(xm.HAS_CHILDREN,a),f.set(ht.DISABLED,!a),f.set(xm.OPENED,o),f.unlock();var l=this.theme.getLevelPadding(c);h.width=l,a?h.show():h.hide(),s.padding.adjLeft(l)}else h.state.removeAll(xm.OPENED,xm.HAS_CHILDREN),h.hide(),s.padding.adjLeft(0);var v=this.cv;gm.setReadOnly(this._u,n,e,v),gm.setRenderable(this,n,e,v)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1,this._u.visible=!1,this.R.hide()},n.prototype.getType=function(){return"DTableBodyCellInputTree"},n}(Ki),_m=function(t,n){if(n)return{url:Pm(t,n.url),target:n.target,checker:Fm(t,n.checker),menu:n.menu}},Pm=function(t,n){return at(n)||null==n?n:function(){var i=t.row;return void 0!==i?n(i,t.rowIndex,t.columnIndex,t):null}},Fm=function(t,n){if(null!=n)return function(){var i=t.row;return void 0!==i&&n(i,t.rowIndex,t.columnIndex,t)}},Um=function(t){function n(n,i,r,e){var u;return t.call(this,n,i,r,Lf.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this}return _(n,t),n.prototype.initOnClick=function(t,n,i){var r=this;this.link.add(this,(function(n){t===fe.CLICKED&&r.onClick(n)}))},Object.defineProperty(n.prototype,"link",{get:function(){var t,n=this.$h;return null==n&&(n=new kf(_m(this,null===(t=this.Nn)||void 0===t?void 0:t.link)),this.$h=n),n},enumerable:!1,configurable:!0}),n.prototype.getType=function(){return"DTableBodyCellLink"},n.prototype.onActivate=function(n){t.prototype.onActivate.call(this,n),this.link.open(n)},n.prototype.open=function(t){this.link.open(t)},n}(Mm),Gm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.lv;if(void 0!==e){var u=this.ov,s=this.av;this.cv.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.q(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.value=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMenu"},n}(um),zm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onValueChange=function(n,i,r){var e=this.lv;if(void 0!==e){var u=this.ov,s=this.av;this.cv.setter(e,s,n),t.prototype.onValueChange.call(this,n,i,r),this.q(n,i,e,u,s,this)}},n.prototype.onKeyDownArrowDown=function(t){return!1},Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.values=t;var s=this.cv;gm.setReadOnly(this,n,e,s),gm.setRenderable(this,n,e,s)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellSelectMultiple"},n}(em),Hm=function(t){function n(n,i,r,e){var u=t.call(this,e)||this;return u.ov=-1,u.av=n,u.cv=i,u.q=r,u}return _(n,t),n.prototype.onActivate=function(n){var i,r,e=this;t.prototype.onActivate.call(this,n);var u=null!==(r=null===(i=this.nu)||void 0===i?void 0:i.getTime())&&void 0!==r?r:Date.now(),s=this.dialog;s.current=new Date(u),s.new=new Date(u),s.open().then((function(){var t=s.new,n=s.current;e.text=new Date(t.getTime());var i=e.lv;if(void 0!==i){var r=e.ov,u=e.av;e.cv.setter(i,u,t),e.emit("change",t,n,e),e.q(t,n,i,r,u,e)}}))},n.prototype.getDatetimeMask=function(){var t,n,i=this.Ha;return null==i&&(i=Xv.toMask(null===(n=null===(t=this.Nn)||void 0===t?void 0:t.dialog)||void 0===n?void 0:n.picker),this.Ha=i),i},Object.defineProperty(n.prototype,"dialog",{get:function(){var t,n=this.za;if(null==n){var i=null===(t=this.Nn)||void 0===t?void 0:t.dialog;n=i?new Uu(i):Ub.getInstance(),this.za=n}return n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"row",{get:function(){return this.lv},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rowIndex",{get:function(){return this.ov},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),n.prototype.set=function(t,n,i,r,e,u){if(this.lv=n,this.ov=r,t instanceof Date)u?(this.tu=t,this.nu=t,this.onTextChange(),this.createOrUpdateText()):this.text=t;else if(Xt(t)){var s=this.nu;null==s?this.text=new Date(t):s.getTime()!==t&&(s.setTime(t),this.onTextChange(),this.createOrUpdateText())}var h=this.cv;gm.setReadOnly(this,n,e,h),gm.setRenderable(this,n,e,h)},n.prototype.unset=function(){this.lv=void 0,this.ov=-1},n.prototype.getType=function(){return"DTableBodyCellTime"},n}(Ae),Vm=function(t){function n(n,i,r,e){var u,s=t.call(this,n,i,r,Lf.toStateOptions(null===(u=null==e?void 0:e.link)||void 0===u?void 0:u.target,e))||this;return s.Bn=new pv(s.Bn),s}return _(n,t),n.prototype.initOnClick=function(n,i,r){var e=this,u=this.link;u?u.add(this,(function(t){n===fe.CLICKED&&e.onClick(t)})):t.prototype.initOnClick.call(this,n,i,r)},Object.defineProperty(n.prototype,"link",{get:function(){var t=this.$h;return void 0===t&&(t=this.newLink(),this.$h=t),t},enumerable:!1,configurable:!0}),n.prototype.newLink=function(){var t,n=null===(t=this.Nn)||void 0===t?void 0:t.link;return n?new kf(_m(this,n)):null},n.prototype.onActivate=function(n){var i;t.prototype.onActivate.call(this,n),this.state.is(xm.HAS_CHILDREN)?this.toggle():null===(i=this.link)||void 0===i||i.open(n)},n.prototype.toggle=function(){var t=this.lv;if(void 0!==t){var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=i.data;r&&r.toggle&&r.toggle(t)}}}},n.prototype.onRowSelect=function(t,n){return n.x<=this.position.x+this.padding.getLeft()&&(this.toggle(),!0)},n.prototype.set=function(t,n,i,r,e,u){this.lv=n,this.ov=r,this.text=t;var s=this.cv;gm.setRenderable(this,n,e,s);var h=this.link,o=this.Bn;if(Xt(i)){var a=!!(1&i),c=!!(2&i),f=i>>2,l=this.state;l.lock(),l.set(xm.HAS_CHILDREN,c),l.set(xm.OPENED,a),l.unlock(),o.adjLeft(this.theme.getLevelPadding(f)),h&&(h.menu.enable=!c)}else this.state.removeAll(xm.OPENED,xm.HAS_CHILDREN),o.adjLeft(0),h&&(h.menu.enable=!1)},n.prototype.getType=function(){return"DTableBodyCellTree"},n}(Mm),Wm={NONE:0,SINGLE:1,MULTIPLE:2},Xm=function(t){function n(n){var i,r,e=t.call(this,n)||this;return e.Xn=!0,e.vv=null!==(i=n.frozen)&&void 0!==i?i:0,e.bv=null!==(r=n.columns)&&void 0!==r?r:[],e}return _(n,t),n.prototype.initCells=function(t,n,i){for(var r=this.toIndexEnd(n),e=n.length-1;0<=e;--e){var u=this.newCell(e,n[e],n,t),s=u.state;s.lock(!1),0===e&&s.add(xm.START),e===r&&s.add(xm.END),e<i&&s.add(xm.FROZEN),e===i-1&&s.add(xm.FROZEN_END),s.unlock(),this.addChild(u)}},n.prototype.toIndexEnd=function(t){for(var n=t.length,i=0;i<n;++i)if(void 0!==t[i].weight)return n-1;return n},n.prototype.onRefit=function(){t.prototype.onRefit.call(this),this.resetFrozenCellPosition()},n.prototype.updateFrozenCellPosition=function(t){for(var n=this.bv,i=this.children,r=i.length,e=this.vv,u=0;u<e;++u){var s=n[u];i[r-1-u].position.x=-t+s.offset}},n.prototype.resetFrozenCellPosition=function(){for(var t=this.bv,n=this.children,i=n.length,r=this.vv,e=this.getContentPositionX(),u=0;u<r;++u){var s=t[u],h=n[i-1-u];s.offset=h.position.x,h.position.x=-e+s.offset}},n.prototype.getClippingRect=function(n,i){t.prototype.getClippingRect.call(this,n,i);var r=this.vv;if(0<r){var e=n;if(e&&e.parent===this){var u=this.children,s=u.indexOf(e);if(0<=s&&r<=u.length-1-s){var h=u[s+1],o=h.position.x+h.width;i.x+=o,i.width-=o}}}},n.prototype.getType=function(){return"DTableRow"},n}(We),Km=function(t){function n(n,i,r){var e=t.call(this,r)||this;return e.ae=-1,e.dv=function(t,i,r,u,s){e.emit("change",t,i,r,u,s,e),n(t,i,r,u,s,e)},e.state.isAlternated=!i,e.initCells(r,e.bv,e.vv),e}return _(n,t),n.prototype.newCell=function(t,n,i,r){var e=this.dv,u=this.toCellOptions(t,n,r);if(!1!==n.editing.enable)return this.newCellEditable(t,n,e,u);var s=this.newCellUnediable(t,n,e,u);return n.type!==Sm.TREE&&(s.state.isReadOnly=!0),s},n.prototype.newCellEditable=function(t,n,i,r){switch(n.type){case Sm.INDEX:return new Cm(t,n,i,r);case Sm.TEXT:return new ym(t,n,i,r);case Sm.TREE:return new Bm(t,n,i,r);case Sm.INTEGER:return new Am(t,n,i,r);case Sm.REAL:return new Rm(t,n,i,r);case Sm.CHECK:case Sm.CHECK_SINGLE:return new Tm(t,n,i,r);case Sm.COLOR:return new jm(t,n,i,r);case Sm.BUTTON:return new Mm(t,n,i,r);case Sm.LINK:return new Um(t,n,i,r);case Sm.SELECT:return this.newCellSelect(t,n,i,r);case Sm.ACTION:return this.newCellAction(t,n,i,r);case Sm.DATE:return new Nm(t,n,i,r);case Sm.DATETIME:return new Im(t,n,i,r);case Sm.TIME:return new Hm(t,n,i,r);default:return new Em(t,n,i,r)}},n.prototype.newCellUnediable=function(t,n,i,r){switch(n.type){case Sm.INDEX:return new Cm(t,n,i,r);case Sm.TEXT:return new Em(t,n,i,r);case Sm.TREE:return new Vm(t,n,i,r);case Sm.INTEGER:case Sm.REAL:return new Em(t,n,i,r);case Sm.CHECK:case Sm.CHECK_SINGLE:return new Tm(t,n,i,r);case Sm.COLOR:return new jm(t,n,i,r);case Sm.BUTTON:return new Mm(t,n,i,r);case Sm.LINK:return new Um(t,n,i,r);case Sm.SELECT:return this.newCellSelect(t,n,i,r);case Sm.ACTION:return this.newCellAction(t,n,i,r);case Sm.DATE:return new Nm(t,n,i,r);case Sm.DATETIME:return new Im(t,n,i,r);case Sm.TIME:return new Hm(t,n,i,r);default:return new Em(t,n,i,r)}},n.prototype.newCellSelect=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new Gm(t,n,i,r):null!=e.multiple?new zm(t,n,i,r):null!=e.dialog?new mm(t,n,i,r):null!=e.promise?new Om(t,n,i,r):new Em(t,n,i,r)},n.prototype.newCellAction=function(t,n,i,r){var e=n.selecting;return null!=e.menu?new pm(t,n,i,r):null!=e.dialog?new wm(t,n,i,r):null!=e.promise?new Dm(t,n,i,r):new Em(t,n,i,r)},n.prototype.toCellOptions=function(t,n,i){var r,e,u=n.body||i.cell,s=n.weight,h=n.width,o=n.formatter,a=n.align,c=n.selecting,f=c.menu||c.multiple;if(null!=u){u.weight=s,u.width=h;var l=u.text||{};u.text=l,l.formatter||(l.formatter=o);var v=l.align||{};l.align=v,v.horizontal=a,u.menu||(u.menu=f)}else u={weight:s,width:h,text:{formatter:o,align:{horizontal:a}},menu:f};var b=n.editing;if(!1!==b.enable){var d=u.editing||{};u.editing=d,d.formatter||(d.formatter=b.formatter),d.unformatter||(d.unformatter=b.unformatter),d.validator||(d.validator=b.validator)}var g=n.link;return g&&(u.link=g),(null!==(e=null===(r=null==i?void 0:i.selection)||void 0===r?void 0:r.type)&&void 0!==e?e:Wm.NONE)!==Wm.NONE&&(u.when="DOUBLE_CLICKED",u.cursor=function(t){if(t.in(xm.SELECTABLE))return"pointer"}),u},n.prototype.getType=function(){return"DTableBodyRow"},Object.defineProperty(n.prototype,"value",{get:function(){return this.At},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.ae},enumerable:!1,configurable:!0}),n.prototype.isCell=function(t){return null!=t&&"set"in t},n.prototype.set=function(t,n,i,r){if(r||this.At!==t||this.ae!==i){this.At=t,this.ae=i;for(var e=this.children,u=e.length,s=this.bv,h=s.length,o=0;o<u;++o){var a=e[o],c=h-1-o,f=s[c];this.isCell(a)&&a.set(f.getter(t,c),t,n,i,c,r)}this.onSet(t,i)}},n.prototype.onSet=function(t,n){this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.At){this.At=void 0,this.ae=-1;for(var t=this.children,n=t.length,i=0;i<n;++i){var r=t[i];this.isCell(r)&&r.unset()}this.onUnset()}},n.prototype.onUnset=function(){this.emit("unset",this)},n.prototype.getContentPositionX=function(){var t=this.parent;if(t){var n=t.parent;if(n)return n.position.x}return 0},n}(Xm),Ym=function(t){function n(n){var i=t.call(this)||this;return i.k=0,i.Nf=-1,i.gv=!1,i.mv=-1,i.O=n,i._l=null,i.wv=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.gv=!0,this.k+=1,this.O.update()},n.prototype.unapply=function(){this.gv&&(this.gv=!1,this.k+=1,this.O.update())},n.prototype.isApplied=function(){return this.gv},n.prototype.newFiltered=function(){var t=this._l;if(null!=t){var n,i=[],r=this.O,e=r.sorter,u=r.rows;if(ot(t))if(n=e.indices)for(var s=0,h=n.length;s<h;++s)t(u[o=n[s]],o)&&i.push(s);else for(s=0,h=u.length;s<h;++s)t(u[s],s)&&i.push(s);else if(n=e.indices)for(s=0,h=n.length;s<h;++s){var o=n[s];t.test(u[o],o)&&i.push(s)}else for(s=0,h=u.length;s<h;++s)t.test(u[s],s)&&i.push(s);return i}return null},n.prototype.get=function(){return this._l},n.prototype.set=function(t){this._l!==t&&(this._l=t)},n.prototype.toDirty=function(){this.k+=1},n.prototype.update=function(){this.k===this.Nf&&this.O.sorter.id===this.mv||(this.Nf=this.k,this.mv=this.O.sorter.id,this.gv?(this.wv=this.newFiltered(),this.emit("change",this)):null!=this.wv&&(this.wv=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.wv},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),Jm=function(){function t(t){this.O=t}return t.prototype.map=function(t){var n=this.O,i=n.sorter.map(t);return null!=i?n.filter.map(i):null},t.prototype.unmap=function(t){var n=this.O;return n.sorter.unmap(n.filter.unmap(t))},t.prototype.size=function(){var t=this.O,n=t.filter.indices;return null!=n?n.length:t.size()},t.prototype.get=function(t){return this.O.get(this.unmap(t))},t.prototype.each=function(t,n,i){var r=this.O,e=r.rows,u=r.supplimentals,s=r.filter.indices,h=r.sorter.indices;if(n=null!=n?Math.max(0,n):0,s){var o=s.length;if(i=null!=i?Math.min(o,i):o,h)for(var a=n;a<i&&!1!==t(e[c=h[s[a]]],u?u[c]:null,a,c);++a);else for(a=n;a<i&&!1!==t(e[c=s[a]],u?u[c]:null,a,c);++a);}else if(o=e.length,i=null!=i?Math.min(o,i):o,h)for(a=n;a<i;++a){var c;if(!1===t(e[c=h[a]],u?u[c]:null,a,c))break}else for(a=n;a<i&&!1!==t(e[a],u?u[a]:null,a,a);++a);},t}(),Zm=function(t,n){return t[0]-n[0]},qm=function(t){function n(n,i){var r,e=t.call(this)||this;return e.O=n,e.jt=di(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:Wm.NONE,Wm),e.ln=new Set,e}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.ln;n.has(t)?n.delete(t):n.add(t),this.onChange()},n.prototype.add=function(t){var n=this.ln,i=n.size;n.add(t),i!==n.size&&this.onChange()},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.ln;if(0<t.size){var n=NaN;return t.forEach((function(t){n!=n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.ln;if(0<t.size){var n=0;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.ln,u=e.size;if(t<i)for(var s=i+(r?1:0),h=t+(n?0:1);h<s;++h)e.add(h);else for(s=t+(n?1:0),h=i+(r?0:1);h<s;++h)e.add(h);u!==e.size&&this.onChange()},n.prototype.addAll=function(t){for(var n=this.ln,i=n.size,r=0,e=t.length;r<e;++r)n.add(t[r]);i!==n.size&&this.onChange()},n.prototype.contains=function(t){return this.ln.has(t)},n.prototype.remove=function(t){this.ln.delete(t)&&this.onChange()},n.prototype.clear=function(){var t=this.ln;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.ln;n.has(t)&&1===n.size||(n.clear(),n.add(t),this.onChange())},n.prototype.clearAndAddAll=function(t){var n=this.ln;if(0<n.size||0<t.length){n.clear();for(var i=0,r=t.length;i<r;++i)n.add(t[i]);this.onChange()}},n.prototype.shift=function(t,n){var i=[],r=this.ln;if(r.forEach((function(n){t<=n&&i.push(n)})),0<i.length){for(var e=0,u=i.length;e<u;++e)r.delete(i[e]);for(e=0,u=i.length;e<u;++e)r.add(i[e]+n);this.onChange()}},n.prototype.size=function(){return this.ln.size},n.prototype.isEmpty=function(){return 0===this.ln.size},Object.defineProperty(n.prototype,"indices",{get:function(){var t=[];return this.ln.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[],n=this.O;return this.ln.forEach((function(i){t.push(n.get(i))})),t},enumerable:!1,configurable:!0}),n.prototype.toArray=function(){var t=[],n=this.O;return this.ln.forEach((function(i){t.push([i,n.get(i)])})),t},n.prototype.toSortedArray=function(){return this.toArray().sort(Zm)},n.prototype.toObject=function(){var t={},n=this.O;return this.ln.forEach((function(i){t[i]=n.get(i)})),t},n.prototype.toMap=function(){var t=new Map,n=this.O;return this.ln.forEach((function(i){t.set(i,n.get(i))})),t},n}(t.utils.EventEmitter),$m={ASCENDING:0,DESCENDING:1},Qm=function(t){function n(n){var i=t.call(this)||this;return i.k=0,i.Nf=-1,i.gv=!1,i.O=n,i.pv=null,i.Ov=null,i.kt=$m.ASCENDING,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return this.kt},set:function(t){this.kt=t},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.gv=!0,this.k+=1,this.O.update()},n.prototype.unapply=function(){this.gv&&(this.gv=!1,this.k+=1,this.O.update())},n.prototype.isApplied=function(){return this.gv},n.prototype.newSorted=function(){var t=this.pv;if(null!=t){for(var n=[],i=this.O.rows,r=0,e=i.length;r<e;++r)n.push(r);return n.sort(this.toComparator(i,t)),n}return null},n.prototype.toComparator=function(t,n){var i=this.kt;return ot(n)?i===$m.ASCENDING?function(i,r){return n(t[i],t[r],i,r)}:function(i,r){return n(t[r],t[i],r,i)}:i===$m.ASCENDING?function(i,r){return n.compare(t[i],t[r],i,r)}:function(i,r){return n.compare(t[r],t[i],r,i)}},n.prototype.get=function(){return this.pv},n.prototype.set=function(t){this.pv!==t&&(this.pv=t)},n.prototype.toDirty=function(){this.k+=1},n.prototype.update=function(){this.k!==this.Nf&&(this.Nf=this.k,this.gv?(this.Ov=this.newSorted(),this.emit("change",this)):null!=this.Ov&&(this.Ov=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.Ov},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),tw=function(n){function i(t){var i=n.call(this)||this;if(i.O=null,i.Dv=i.toRows(null==t?void 0:t.rows),i.oc=new Jm(i),i.hc=i.toSelection(null==t?void 0:t.selection),i._l=new Ym(i),i.Ev=new Qm(i),t){var r=t.filter;r&&i._l.set(r);var e=t.comparator;e&&i.Ev.set(e);var u=t.on;if(u)for(var s in u){var h=u[s];h&&i.on(s,h)}}return i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:ot(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new qm(this,t)},i.prototype.bind=function(t){this.O=t},i.prototype.toRows=function(t){var n=[];if(null!=t)for(var i=0,r=t.length;i<r;++i)n.push(t[i]);return n},Object.defineProperty(i.prototype,"rows",{get:function(){return this.Dv},enumerable:!1,configurable:!0}),i.prototype.update=function(){var t=this.O;t&&t.update()},i.prototype.lock=function(){var t=this.O;t&&t.lock()},i.prototype.unlock=function(){var t=this.O;t&&(t.unlock(!1),t.update())},i.prototype.size=function(){return this.Dv.length},i.prototype.clear=function(){var t=this.Dv;0<t.length&&(t.length=0,this.lock(),this.hc.clear(),this.Ev.toDirty(),this._l.toDirty(),this.unlock())},i.prototype.clearAndAdd=function(t){var n=this.Dv;n.length=0,n.push(t),this.lock(),this.hc.clear(),this.Ev.toDirty(),this._l.toDirty(),this.unlock()},i.prototype.clearAndAddAll=function(t){var n=this.Dv;n.length=0;for(var i=0,r=t.length;i<r;++i)n.push(t[i]);this.lock(),this.hc.clear(),this.Ev.toDirty(),this._l.toDirty(),this.unlock()},i.prototype.add=function(t,n){var i=this.Dv,r=this.hc,e=this.Ev,u=this._l;null==n?(i.push(t),this.lock(),e.toDirty(),u.toDirty(),this.unlock()):0<=n&&n<i.length&&(i.splice(n,0,t),this.lock(),r.shift(n,1),e.toDirty(),u.toDirty(),this.unlock())},i.prototype.addAll=function(t,n){var i=this.Dv,r=i.length,e=this.hc,u=this.Ev,s=this._l;if(null==n){for(var h=0,o=a=t.length;h<o;++h)i.push(t[h]);this.lock(),u.toDirty(),s.toDirty(),this.unlock()}else if(0<=n&&n<r){var a=t.length;for(h=0;h<a;++h)i.splice(n+h,0,t[h]);this.lock(),e.shift(n,a),u.toDirty(),s.toDirty(),this.unlock()}},i.prototype.get=function(t){var n=this.Dv;return 0<=t&&t<n.length?n[t]:null},i.prototype.set=function(t,n){var i=this.Dv;if(0<=t&&t<i.length){var r=i[t];return i[t]=n,this.lock(),this.Ev.toDirty(),this._l.toDirty(),this.unlock(),r}return null},i.prototype.remove=function(t){var n=this.Dv;if(0<=t&&t<n.length){var i=n.splice(t,1)[0];return this.lock(),this.hc.remove(t),this.Ev.toDirty(),this._l.toDirty(),this.unlock(),i}return null},i.prototype.each=function(t,n,i){var r=this.Dv;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this._l},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.Ev},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.oc},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),nw=function(n){function i(t){var i,r=n.call(this,t)||this;r.transform.position.y=null!==(i=t.offset)&&void 0!==i?i:0;var e=r.toData(t.data);r.$i=e,e.bind(r);var u=r.theme,s=function(t,n,i){var r=n.columns||[],e=n.row;return null!=e?(null==e.height&&(e.height=t.getRowHeight()),void 0===e.columns&&(e.columns=r),null==e.frozen&&(e.frozen=n.frozen),void 0===e.selection?e.selection={type:i}:void 0===e.selection.type&&(e.selection.type=i)):e={columns:r,height:t.getRowHeight(),frozen:n.frozen,selection:{type:i}},e}(u,t,e.selection.type);return r.Mv=s,r.Sv=null!=s.height?s.height:u.getRowHeight(),r.bv=s.columns||[],r.Tv=0,r.jv=0,r.Nv=0,r.Iv=!1,r.Cv=!1,r.Av=[],r.Rv=function(t,n,i,r,u){e.emit("change",t,n,i,r,u,e)},r.$i.emit("init",r.$i),r}return _(i,n),i.prototype.toData=function(t){return this.isData(t)?t:new tw(t)},i.prototype.isData=function(t){return null!=t&&"mapped"in t},i.prototype.onResize=function(t,i,r,e){n.prototype.onResize.call(this,t,i,r,e),this.update()},Object.defineProperty(i.prototype,"selection",{get:function(){return this.$i.selection},enumerable:!1,configurable:!0}),i.prototype.lock=function(){this.Nv+=1,1===this.Nv&&(this.Iv=!1,this.Cv=!1)},i.prototype.unlock=function(t){this.Nv-=1,0===this.Nv&&(t&&this.Iv&&this.update(this.Cv),this.Iv=!1,this.Cv=!1)},i.prototype.update=function(t){if(0<this.Nv)return this.Iv=!0,void(t&&(this.Cv=!0));var n=this.parent;if(null!=n){var i=n.parent;if(null!=i){var r=this.children,e=i.height,u=this.Sv,s=this.$i,h=s.mapped.size(),o=this.Tv,a=this.jv,c=a-o,f=this.transform.position.y,l=f+h*u,v=Math.max(e,l),b=Math.max(e-v,n.position.y),d=Math.floor((0-(b+f))/u),g=Math.floor((e-(b+f))/u),m=d-(d%2==0?2:1),w=g+((g-m+1)%2==0?3:2),p=w-m;if(p<c&&c-2<=p&&(w=m+(p=c)),c<p){for(var O=c;O<p;++O){var D=o+O,E=this.newRow(D%2==0);this.addChild(E)}a=o+(c=p)}else if(p<c){for(O=c-1;p<=O;--O)this.removeChild(r[O]);a=o+(c=p)}this.Tv=m,this.jv=w;var M=m-o,S=Math.abs(M),T=r.length;if(0<S&&S<T){var j=this.Av;if(0<M){for(O=0;O<S;++O)j.push(this.resetRow(r[O]));for(O=S;O<T;++O)r[O-S]=r[O];for(O=0;O<S;++O)r[T-S+O]=j[O]}else{for(O=0;O<S;++O)j.push(this.resetRow(r[T-S+O]));for(O=T-S-1;0<=O;--O)r[O+S]=r[O];for(O=0;O<S;++O)r[O]=j[O]}j.length=0}var N=s.selection,I=N.type!==Wm.NONE;for(s.mapped.each((function(n,i,e,s){var h=r[e-m];h.position.y=e*u;var o=h.state;o.lock(),o.set(xm.SELECTABLE,I),o.set(ht.ACTIVE,N.contains(s)),o.remove(ht.DISABLED),o.unlock(),h.set(n,i,s,t)}),m,m+T),O=0;m+O<0&&O<T;++O)(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ht.DISABLED),A.removeAll(xm.SELECTABLE,ht.ACTIVE),A.unlock(),C.unset();for(O=T-1;h<=m+O&&0<=O;--O){var C,A;(C=r[O]).position.y=(m+O)*u,(A=C.state).lock(),A.add(ht.DISABLED),A.removeAll(xm.SELECTABLE,ht.ACTIVE),A.unlock(),C.unset()}this.lock(),n.position.y=b,n.height=v,this.height=l,this.unlock(!1)}}},i.prototype.resetRow=function(t){t.blur(!0);for(var n=t.children,i=0,r=n.length;i<r;++i){var e=n[i];e instanceof Ki&&(e.state.isPressed=!1)}return t},i.prototype.newRow=function(t){return new Km(this.Rv,t,this.Mv)},i.prototype.onParentMove=function(t,i,r,e){n.prototype.onParentMove.call(this,t,i,r,e),this.updateFrozenCellPosition(t)},i.prototype.updateFrozenCellPosition=function(t){var n=this.Mv.frozen;if(null!=n&&0<n)for(var i=this.children,r=0,e=i.length;r<e;++r)i[r].updateFrozenCellPosition(t)},i.prototype.getClippingRect=function(t,i){n.prototype.getClippingRect.call(this,t,i);var r=this.parent;if(r){var e=-r.transform.position.y;i.y+=e,i.height-=e}},i.prototype.toRowIndexMapped=function(t){return 0<=this.parent.position.y+t.y?Math.floor(t.y/this.Sv):-1},i.prototype.toRow=function(t){var n=t-this.Tv,i=this.children;return 0<=n&&n<i.length?i[n]:null},i.prototype.toCell=function(t,n){for(var i=t.children,r=i.length,e=this.bv.length,u=0,s=Math.min(r,e);u<s;++u){var h=i[r-u-1],o=n.x-h.position.x;if(0<=o&&o<=h.width)return h}return null},i.prototype.onRowClick=function(t){if(this.state.isActionable){var n=i.WORK_ON_CLICK;n.copyFrom(t.data.global),this.toLocal(n,void 0,n,!1);var r=this.toRowIndexMapped(n);if(0<=r&&r<this.$i.mapped.size()){var e=this.toRow(r);if(e){var u=this.toCell(e,n);if(u&&u.onRowSelect&&u.onRowSelect(t,n))return}this.onRowSelect(t,r)}}},i.prototype.onRowSelect=function(t,n){var i=this.$i,r=i.selection,e=r.type===Wm.SINGLE,u=!e,s=i.mapped.unmap(n),h=t.data.originalEvent,o=h.ctrlKey,a=h.shiftKey;if(e||r.isEmpty()||!u||!o&&!a)r.clearAndAdd(s);else if(o)r.toggle(s);else if(a){var c=r.last;if(null!=c){var f=i.sorter,l=i.filter,v=f.map(s),b=f.map(c);if(null!=v&&null!=b){var d=b+1,g=v+1;if(v<b&&(d=v,g=b),d<g){var m=[],w=l.indices,p=f.indices;if(w)if(p)for(var O=0,D=w.length;O<D;++O)d<=(E=w[O])&&E<g&&m.push(p[E]);else for(O=0,D=w.length;O<D;++O){var E;d<=(E=w[O])&&E<g&&m.push(E)}else if(p)for(O=d;O<g;++O)m.push(p[O]);else for(O=d;O<g;++O)m.push(O);r.addAll(m)}}}}},i.prototype.getType=function(){return"DTableBody"},Object.defineProperty(i.prototype,"data",{get:function(){return this.$i},enumerable:!1,configurable:!0}),i.WORK_ON_CLICK=new t.Point,i}(Ki),iw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getType=function(){return"DTableCategoryCell"},n}(pf),rw=function(t){function n(n){var i,r=t.call(this,n)||this,e=null!==(i=n.offset)&&void 0!==i?i:0;return r.Jt=e,r.transform.position.y=e,r.initCells(n,r.bv,r.vv),r}return _(n,t),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.Jt,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new iw(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=i.cell;if(r){r.weight=n.weight,r.width=n.width;var e=r.text||{};return r.text=e,e.value=e.value||n.label,r}return{weight:n.weight,width:n.width,text:{value:n.label}}},n.prototype.getType=function(){return"DTableCategory"},n}(Xm),ew=function(t){function n(n){var i=t.call(this)||this;return i.k=0,i.Nf=-1,i.gv=!1,i.O=n,i._l=null,i.wv=null,i}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return this.k},enumerable:!1,configurable:!0}),n.prototype.apply=function(){this.gv=!0,this.k+=1,this.O.update()},n.prototype.unapply=function(){this.gv&&(this.gv=!1,this.k+=1,this.O.update())},n.prototype.isApplied=function(){return this.gv},n.prototype.isFiltered=function(t,n,i){return ot(i)?i(t,n):i.test(t,n)},n.prototype.hasFiltered=function(t,n,i){for(var r=this.O.accessor.toChildren,e=0,u=n.length;e<u;++e){var s=n[e];if(this.isFiltered(s,-1,i))return!0;var h=r(s);if(null!=h&&0<h.length&&this.hasFiltered(t,h,i))return!0}return!1},n.prototype.addAllToFiltered=function(t,n,i,r){for(var e=this.O.accessor.toChildren,u=0,s=n.length;u<s;++u){var h=n[u];i.push(r[0]),r[0]+=1;var o=e(h);null!=o&&0<o.length&&t.isOpened(h)&&this.addAllToFiltered(t,o,i,r)}},n.prototype.newFilteredSub=function(t,n,i,r,e){for(var u=!1,s=this.O.accessor.toChildren,h=0,o=n.length;h<o;++h){var a=n[h],c=e[0];e[0]+=1;var f=this.isFiltered(a,c,i),l=s(a);if(null!=l&&0<l.length)if(t.isOpened(a))if(f)r.push(c),u=!0,this.addAllToFiltered(t,l,r,e);else{var v=r.length;this.newFilteredSub(t,l,i,r,e)&&(r.splice(v,0,c),u=!0)}else(f||this.hasFiltered(t,l,i))&&(r.push(c),u=!0);else f&&(r.push(c),u=!0)}return u},n.prototype.newFiltered=function(){var t=this._l;if(null!=t){var n=[],i=this.O,r=i.nodes;return r&&this.newFilteredSub(i,r,t,n,[0]),n}return null},n.prototype.get=function(){return this._l},n.prototype.set=function(t){this._l!==t&&(this._l=t)},n.prototype.toDirty=function(){this.k+=1},n.prototype.update=function(){this.k!==this.Nf&&(this.Nf=this.k,this.gv?(this.wv=this.newFiltered(),this.emit("change",this)):null!=this.wv&&(this.wv=null,this.emit("change",this)))},Object.defineProperty(n.prototype,"indices",{get:function(){return this.update(),this.wv},enumerable:!1,configurable:!0}),n.prototype.map=function(t){var n=t,i=this.indices;if(i){var r=i.indexOf(n);if(!(0<=r))return null;n=r}return n},n.prototype.unmap=function(t){var n=t,i=this.indices;return i&&(n=i[n]),n},n}(t.utils.EventEmitter),uw=function(t){return t.parent},sw=function(t){return t.children},hw=function(t){var n,i;this.toParent=null!==(n=null==t?void 0:t.toParent)&&void 0!==n?n:uw,this.toChildren=null!==(i=null==t?void 0:t.toChildren)&&void 0!==i?i:sw},ow=function(t,n){return t[0]-n[0]},aw=function(t){function n(n,i){var r,e=t.call(this)||this;return e.O=n,e.jt=di(null!==(r=null==i?void 0:i.type)&&void 0!==r?r:Wm.NONE,Wm),e.Dv=new Set,e}return _(n,t),n.prototype.onNodeChange=function(t){if(null!=t){var n=this.O.accessor.toChildren,i=this.Dv,r=this.newRows(t,n,i,new Set);i.size!==r.size&&(this.Dv=r,this.onChange())}else{var e=this.Dv;0<e.size&&(e.clear(),this.onChange())}},n.prototype.newRows=function(t,n,i,r){for(var e=0,u=t.length;e<u;++e){var s=t[e];i.has(s)&&r.add(s);var h=n(s);null!=h&&this.newRows(h,n,i,r)}return r},Object.defineProperty(n.prototype,"indices",{get:function(){var t=this.Dv,n=[];return this.O.each((function(i,r){t.has(i)&&n.push(r)})),n},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"rows",{get:function(){var t=[];return this.Dv.forEach((function(n){t.push(n)})),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"type",{get:function(){return this.jt},enumerable:!1,configurable:!0}),n.prototype.getFirst=function(){var t=this.Dv;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},n.prototype.getLast=function(){var t=this.Dv;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},n.prototype.toIndex=function(t){var n=null;return this.O.each((function(i,r){return t!==i||(n=r,!1)})),n},Object.defineProperty(n.prototype,"first",{get:function(){var t=this.getFirst();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.getLast();return t?this.toIndex(t):null},enumerable:!1,configurable:!0}),n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.toggle=function(t){var n=this.O.get(t);if(n){var i=this.Dv;i.has(n)?i.delete(n):i.add(n),this.onChange()}},n.prototype.add=function(t){var n=this.O.get(t);if(n){var i=this.Dv;i.has(n)||(i.add(n),this.onChange())}},n.prototype.addTo=function(t){var n=this.last;null!=n&&this.addRange(n,!1,t,!0)},n.prototype.addRange=function(t,n,i,r){var e=this.Dv,u=e.size,s=this.O;t<i?s.each((function(t){e.add(t)}),t+(n?0:1),i+(r?1:0)):s.each((function(t){e.add(t)}),i+(r?0:1),t+(n?1:0)),u!==e.size&&this.onChange()},n.prototype.addAll=function(t){if(0<t.length){for(var n=this.Dv,i=this.O,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.contains=function(t){var n=this.O.get(t);return!!n&&this.Dv.has(n)},n.prototype.remove=function(t){var n=this.O.get(t);if(n){var i=this.Dv;i.has(n)&&(i.delete(n),this.onChange())}},n.prototype.clear=function(){var t=this.Dv;0<t.size&&(t.clear(),this.onChange())},n.prototype.clearAndAdd=function(t){var n=this.O.get(t);if(n){var i=this.Dv;i.has(n)?1<i.size&&(i.clear(),i.add(n),this.onChange()):(i.clear(),i.add(n),this.onChange())}},n.prototype.clearAndAddAll=function(t){var n=this.Dv;if(0<n.size||0<t.length){n.clear();for(var i=this.O,r=0,e=t.length;r<e;++r){var u=i.get(t[r]);u&&n.add(u)}this.onChange()}},n.prototype.shift=function(t,n){},n.prototype.size=function(){return this.Dv.size},n.prototype.isEmpty=function(){return this.Dv.size<=0},n.prototype.toArray=function(){var t=this.Dv,n=[];return this.O.each((function(i,r){t.has(i)&&n.push([r,i])})),n},n.prototype.toSortedArray=function(){return this.toArray().sort(ow)},n.prototype.toObject=function(){var t=this.Dv,n={};return this.O.each((function(i,r){t.has(i)&&(n[r]=i)})),n},n.prototype.toMap=function(){var t=this.Dv,n=new Map;return this.O.each((function(i,r){t.has(i)&&n.set(r,i)})),n},n}(t.utils.EventEmitter),cw=function(t){function n(){return t.call(this)||this}return _(n,t),Object.defineProperty(n.prototype,"id",{get:function(){return 0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"order",{get:function(){return $m.ASCENDING},set:function(t){},enumerable:!1,configurable:!0}),n.prototype.apply=function(){},n.prototype.unapply=function(){},n.prototype.isApplied=function(){return!1},n.prototype.get=function(){return null},n.prototype.set=function(t){},n.prototype.toDirty=function(){},n.prototype.update=function(){},Object.defineProperty(n.prototype,"indices",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.map=function(t){return t},n.prototype.unmap=function(t){return t},n}(t.utils.EventEmitter),fw=function(n){function i(t){var i=n.call(this)||this;if(i.O=null,i.ec=i.toAccessor(t),i.oc=new Jm(i),i.Dv=[],i.yv=!1,i.kv=[],i.Lv=new WeakMap,i.Xn=!!(null==t?void 0:t.reverse),i.hc=i.toSelection(null==t?void 0:t.selection),i._l=new ew(i),i.Ev=new cw,t){var r=t.filter;r&&i._l.set(r);var e=t.on;if(e)for(var u in e){var s=e[u];s&&i.on(u,s)}}return i.nodes=null==t?void 0:t.nodes,i}return _(i,n),i.prototype.toSelection=function(n){return n instanceof t.utils.EventEmitter?n:ot(n)?n(this):this.newSelection(n)},i.prototype.newSelection=function(t){return new aw(this,t)},i.prototype.toAccessor=function(t){return new hw(t)},i.prototype.bind=function(t){this.O=t},Object.defineProperty(i.prototype,"nodes",{get:function(){return this.xv},set:function(t){this.xv=t,this.yv=!0,this.hc.onNodeChange(t),this._l.toDirty(),this.update(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"rows",{get:function(){return this.yv&&(this.yv=!1,this.updateRows(this.xv)),this.Dv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"supplimentals",{get:function(){return this.kv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"accessor",{get:function(){return this.ec},enumerable:!1,configurable:!0}),i.prototype.updateRows=function(t){var n=this.Dv,i=this.kv,r=this.Lv;if(null!=t){var e=this.newRows(t,0,0,n,i,r,this.Xn,this.ec.toChildren);e!==n.length&&(n.length=e,i.length=e)}else n.length=0,i.length=0},i.prototype.toSupplimental=function(t,n,i){return t<<2|(n?2:0)|(i?1:0)},i.prototype.newRows=function(t,n,i,r,e,u,s,h){for(var o=t.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=t[c],l=h(f),v=u.has(f),b=this.toSupplimental(i,!!(l&&0<l.length),v);n<r.length?(r[n]=f,e[n]=b):(r.push(f),e.push(b)),n+=1,v&&l&&(n=this.newRows(l,n,i+1,r,e,u,s,h))}return n},i.prototype.update=function(t){var n=this.O;n&&n.update(t)},i.prototype.size=function(){return this.rows.length},i.prototype.get=function(t){var n=this.rows;return 0<=t&&t<n.length?n[t]:null},i.prototype.open=function(t){var n=this.Lv;n.has(t)||(n.set(t,1),this.yv=!0,this._l.toDirty(),this.update(!0))},i.prototype.close=function(t){var n=this.Lv;n.has(t)&&(n.delete(t),this.yv=!0,this._l.toDirty(),this.update(!0))},i.prototype.isOpened=function(t){return this.Lv.has(t)},i.prototype.toggle=function(t){var n=this.Lv;n.has(t)?n.delete(t):n.set(t,1),this.yv=!0,this._l.toDirty(),this.update(!0)},i.prototype.each=function(t,n,i){var r=this.rows;n=null!=n?Math.max(0,n):0,i=null!=i?Math.min(r.length,i):r.length;for(var e=n;e<i&&!1!==t(r[e],e);++e);},Object.defineProperty(i.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"filter",{get:function(){return this._l},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"sorter",{get:function(){return this.Ev},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"mapped",{get:function(){return this.oc},enumerable:!1,configurable:!0}),i}(t.utils.EventEmitter),lw=function(){function t(t,n){var i,r,e;this.O=t,this.Gu=null!==(i=null==n?void 0:n.enable)&&void 0!==i&&i,this.Bv=null===(r=null==n?void 0:n.filterable)||void 0===r||r,this._v=null===(e=null==n?void 0:n.emittable)||void 0===e||e}return Object.defineProperty(t.prototype,"isEnabled",{get:function(){return this.Gu},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isFilterable",{get:function(){return this.Bv},set:function(t){this.Bv=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isEmittable",{get:function(){return this._v},set:function(t){this._v=t},enumerable:!1,configurable:!0}),t.prototype.newIteratee=function(t,n){var i=this.O,r=i.column,e=i.columnIndex;if(null!=r&&null!=e){var u=r.getter,s=r.setter;if(this._v){var h=t.data;return function(t,i){return u(t,e)!==n&&(s(t,e,n),h.emit("change",n,!n,t,i,e,h),!0)}}return function(t){return u(t,e)!==n&&(s(t,e,n),!0)}}return null},t.prototype.execute=function(t){var n,i=null===(n=this.O.header)||void 0===n?void 0:n.table;if(i){var r=this.newIteratee(i,t);if(r){var e=!1;this.Bv?i.data.mapped.each((function(t,n,i,u){r(t,u)&&(e=!0)})):i.data.each((function(t,n){r(t,n)&&(e=!0)})),e&&i.body.update(!0)}}},t}(),vw=function(n){function i(){return null!==n&&n.apply(this,arguments)||this}return _(i,n),i.prototype.init=function(t){null!=t?(this.Qh=t.header,this.cv=t.column,this.av=t.columnIndex,this.Pv=new lw(this,t.check)):this.Pv=new lw(this),n.prototype.init.call(this,t),this.initOnClick(t)},Object.defineProperty(i.prototype,"column",{get:function(){return this.cv},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"columnIndex",{get:function(){return this.av},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"header",{get:function(){return this.Qh},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"check",{get:function(){return this.Pv},enumerable:!1,configurable:!0}),i.prototype.initOnClick=function(t){var n=this,i=this.cv;if(i){var r=i.sorting.enable,e=this.Pv.isEnabled;if(e||r){zi.onClick(this,(function(t){n.onClick(t)}));var u=this.state;u.lock(),u.set(xm.SORTABLE,r),u.set(xm.CHECKABLE,e),u.unlock()}}},Object.defineProperty(i.prototype,"sorter",{get:function(){var t=this,n=this.Ev;if(null==n){var i=this.Qh;if(!i)return null;var r=i.table;if(!r)return null;n=r.data.sorter,this.Ev=n,this.Fv=this.Fv||function(){t.onSorterChange()},n.on("change",this.Fv)}return n},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"comparator",{get:function(){var t=this.cv;return t&&t.sorting.comparator||null},enumerable:!1,configurable:!0}),i.prototype.onSorterChange=function(){var t=this.comparator;if(t){var n=this.Ev;if(n){var i=xm.SORTED_ASCENDING,r=xm.SORTED_DESCENDING;n.isApplied()&&n.get()===t?n.order===$m.ASCENDING?this.state.set(i,r):this.state.set(r,i):this.state.removeAll(i,r)}}},i.prototype.toClickPosition=function(n){var i=this.Uv||new t.Point;return this.Uv=i,n.data.getLocalPosition(this,i).x},i.prototype.isCheckClicked=function(t){if(this.Pv.isEnabled){if(!this.isSortable)return!0;var n=this.ou[1];if(n&&null!=n.image){var i=this.toClickPosition(t),r=n.bound,e=n.margin.horizontal;return r.left-e<=i&&i<=r.right+e}}return!1},i.prototype.onClick=function(t){this.state.isActionable&&(this.isCheckClicked(t)?(this.onToggleStart(),this.onToggleEnd()):this.onActivate(t))},i.prototype.onActivate=function(t){this.doSort(t),this.emit("active",this)},i.prototype.doSort=function(t){if(this.isSortable){var n=this.comparator;if(n){var i=this.sorter;i&&(i.get()===n?i.order===$m.ASCENDING?(i.order=$m.DESCENDING,i.apply()):(i.set(null),i.apply()):(i.set(n),i.order=$m.ASCENDING,i.apply()))}}},Object.defineProperty(i.prototype,"isSortable",{get:function(){var t=this.cv;return!!t&&t.sorting.enable},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isToggle",{get:function(){return this.Pv.isEnabled},enumerable:!1,configurable:!0}),i.prototype.toggle=function(){this.state.isActionable&&this.isToggle&&(this.onToggleStart(),this.onToggleEnd())},i.prototype.onToggleStart=function(){this.state.isActive=!this.state.isActive},i.prototype.onToggleEnd=function(){this.state.isActive?(this.Pv.execute(!0),this.emit("active",this)):(this.Pv.execute(!1),this.emit("inactive",this))},i.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.isToggle?this.onToggleStart():this.state.isPressed=!0)},i.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.isToggle?this.onToggleEnd():(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1))},i.prototype.onKeyDown=function(t){return Kt.isActivateKey(t)&&this.onActivateKeyDown(t),n.prototype.onKeyDown.call(this,t)},i.prototype.onKeyUp=function(t){return Kt.isActivateKey(t)&&this.onActivateKeyUp(t),n.prototype.onKeyUp.call(this,t)},i.prototype.getType=function(){return"DTableHeaderCell"},i.prototype.destroy=function(){var t=this.Ev,i=this.Fv;t&&i&&t.off("change",i),this.Ev=void 0,this.Fv=void 0,n.prototype.destroy.call(this)},i}(pf),bw=function(t){function n(n){var i,r,e=t.call(this,n)||this;e.Gv=null!==(i=n.table)&&void 0!==i?i:null;var u=null!==(r=n.offset)&&void 0!==r?r:0;return e.Jt=u,e.transform.position.y=u,e.initCells(n,e.bv,e.vv),e}return _(n,t),Object.defineProperty(n.prototype,"table",{get:function(){return this.Gv},enumerable:!1,configurable:!0}),n.prototype.onParentMove=function(n,i,r,e){t.prototype.onParentMove.call(this,n,i,r,e),this.transform.position.y=-i+this.Jt,this.updateFrozenCellPosition(n)},n.prototype.getContentPositionX=function(){var t=this.parent;return t?t.position.x:0},n.prototype.newCell=function(t,n,i,r){return new vw(this.toCellOptions(t,n,r))},n.prototype.toCellOptions=function(t,n,i){var r=n.header||i.cell;return null!=r?(void 0===r.weight&&(r.weight=n.weight),void 0===r.width&&(r.width=n.width),void 0===r.text?r.text={value:n.label}:void 0===r.text.value&&(r.text.value=n.label),void 0===r.header&&(r.header=this),void 0===r.column&&(r.column=n),void 0===r.columnIndex&&(r.columnIndex=t),r):{weight:n.weight,width:n.width,text:{value:n.label},header:this,column:n,columnIndex:t}},n.prototype.getType=function(){return"DTableHeader"},n}(Xm),dw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.getOffsetVerticalStart=function(t){return.5*t+this.O.body.position.y},n}(Tb),gw=function(t,n){return t[n]},mw=function(t,n,i){t[n]=i},ww=function(){return""},pw=function(){},Ow=function(t){if(null!=t){var n=t.length;if(n<=1){var i=t[0];return function(t){return i in t}}return function(i){for(var r=0;r<n;++r){var e=t[r];if(!(e in i))return!1;i=i[e]}return!0}}return function(t,n){return n<t.length}},Dw=function(t,n){return at(t)?Ow(n):null!=t&&t},Ew=function(t,n){var i,r=t.editing,e=t.editable;return r?{enable:Dw(null!==(i=r.enable)&&void 0!==i?i:e,n),formatter:r.formatter,unformatter:r.unformatter,validator:r.validator}:{enable:Dw(e,n)}},Mw=function(t,n){return function(i,r){var e=t(i,n),u=t(r,n);return e<u?-1:u<e?1:0}},Sw=function(t,n,i){var r=i.sorting,e=i.sortable;return r?r.enable||e?{enable:!0,comparator:r.comparator||Mw(t,n)}:{enable:!1}:e?{enable:!0,comparator:Mw(t,n)}:{enable:!1}},Tw=function(t){return null==t?void 0:t instanceof jg?t:new jg(t)},jw=function(t){return null==t?void 0:"open"in t?t:new Bb(t)},Nw=function(t){return t.value},Iw=function(){},Cw=function(t){return t?{getter:t.getter||Nw,setter:t.setter||Iw,menu:Tw(t.menu),multiple:Tw(t.multiple),dialog:jw(t.dialog),promise:t.promise}:{getter:Nw,setter:Iw}},Aw=function(t,n){var i=t.renderable;return at(i)?Ow(n):null==i||i},Rw=function(t,n){var i,r=n.weight,e=n.width;null!=r?null!=e&&(e=void 0):null==e&&(r=1);var u=di(null!==(i=n.type)&&void 0!==i?i:Sm.TEXT,Sm),s=function(t,n){var i=t.align;if(null!=i)return at(i)?le[i]:i;switch(n){case Sm.TEXT:return le.LEFT;case Sm.REAL:case Sm.INTEGER:return le.RIGHT;case Sm.BUTTON:case Sm.INDEX:case Sm.SELECT:case Sm.ACTION:case Sm.LINK:return le.CENTER;default:return le.LEFT}}(n,u),h=n.label||"",o=function(t){return null!=t.path?t.path.split("."):null}(n),a=function(t,n,i){var r=t.getter;if(r)return r;switch(n){case Sm.ACTION:case Sm.LINK:return ww;default:return null==i?gw:function(t,n){if(t.length<=1){var i=t[0];return void 0===n?function(t){return t[i]}:function(t){return i in t?t[i]:n}}return void 0===n?function(n){for(var i=0,r=t.length-1;i<r;++i)n=n[t[i]];return n[t[t.length-1]]}:function(i){for(var r=0,e=t.length-1;r<e;++r)i=i[t[r]];var u=t[t.length-1];return u in i?i[u]:n}}(i,t.default)}}(n,u,o);return{weight:r,width:e,type:u,label:h,getter:a,setter:function(t,n,i){var r=t.setter;if(r)return r;switch(n){case Sm.BUTTON:case Sm.ACTION:case Sm.LINK:return pw;default:return null==i?mw:function(t){if(t.length<=1){var n=t[0];return function(t,i,r){t[n]=r}}return function(n,i,r){for(var e=0,u=t.length-1;e<u;++e)n=n[t[e]]||{};n[t[t.length-1]]=r}}(i)}}(n,u,o),formatter:n.formatter,renderable:Aw(n,o),align:s,editing:Ew(n,o),sorting:Sw(a,t,n),header:n.header,body:n.body,selecting:Cw(n.selecting),category:n.category,frozen:n.frozen,offset:0,link:n.link}},yw=function(t){function n(n){var i=t.call(this,n)||this,r=i.content;r.setWidth(i.toContentWidth(n));var e=i.body;r.addChild(e),e.data.selection.type!==Wm.NONE&&zi.onClick(i,(function(t){e.onRowClick(t)}));var u=i.header;u&&r.addChild(u);for(var s=i.categories,h=s.length-1;0<=h;--h)r.addChild(s[h]);return e.update(),i}return _(n,t),Object.defineProperty(n.prototype,"columns",{get:function(){var t=this.bv;if(null==t){var n=this.Nn;t=n?function(t){for(var n=[],i=0,r=t.length;i<r;++i)n.push(Rw(i,t[i]));return n}(n.columns):[],this.bv=t}return t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"frozen",{get:function(){var t=this.vv;return null==t&&(t=function(t){for(var n=t.length-1;0<=n;--n)if(!0===t[n].frozen)return n+1;return 0}(this.columns),this.vv=t),t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"categories",{get:function(){var t=this.zv;return null==t&&(t=this.newCategories(this.Nn,this.columns,this.frozen),this.zv=t),t},enumerable:!1,configurable:!0}),n.prototype.initContent=function(n){t.prototype.initContent.call(this,n),n.state.isFocusReverse=!0},n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.body.update()},n.prototype.onResize=function(n,i,r,e){var u=this.scrollbar;u.lock();var s=this.body;s.lock(),t.prototype.onResize.call(this,n,i,r,e),s.update(),s.unlock(!0),u.unlock(!0)},n.prototype.getCategoryCount=function(t){for(var n=0,i=0,r=t.length;i<r;++i){var e=t[i].category;if(null!=e){var u=at(e)?1:e.length;n=Math.max(n,u)}}return n},n.prototype.toCategoryLabel=function(t,n){if(n)if(at(n)){if(0===t)return n}else if(t<n.length)return n[t]},n.prototype.isSameCategory=function(t,n,i){if(null!=n){if(null!=i){if(at(n))return at(i)?0<t||n===i:0<t?i.length<=t:1===i.length&&n===i[0];if(at(i))return 0<t?n.length<=t:1===n.length&&n[0]===i;if(n.length<=t&&i.length<=t)return!0;if(i.length===n.length){for(var r=t,e=n.length;r<e;++r)if(n[r]!==i[r])return!1;return!0}return!1}return at(n)?0<t:n.length<=t}return null==i||(at(i)?0<t:i.length<=t)},n.prototype.toCategoryColumns=function(t,n,i){for(var r=[],e=null,u=null,s=0,h=n.length;s<h;++s){var o=n[s];s!==i&&u&&e&&this.isSameCategory(t,e.category,o.category)?null!=u.weight&&null!=o.weight?u.weight+=o.weight:null!=u.width&&null!=o.width?u.width+=o.width:(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u)):(e=o,u={label:this.toCategoryLabel(t,o.category),weight:o.weight,width:o.width,offset:0},r.push(u))}return r},n.prototype.toCategoryOptions=function(t,n,i,r,e){return n?(void 0===n.columns&&(n.columns=this.toCategoryColumns(t,i,r)),null==n.frozen&&(n.frozen=r),null==n.offset&&(n.offset=e),n):{columns:this.toCategoryColumns(t,i,r),frozen:r,offset:e}},n.prototype.newCategories=function(t,n,i){for(var r=[],e=0,u=this.getCategoryCount(n)-1;0<=u;--u){var s=new rw(this.toCategoryOptions(u,null==t?void 0:t.category,n,i,e));r.push(s),e+=s.height}return r},n.prototype.onDblClick=function(n,i){var r=this.body.onDblClick(n,i);return t.prototype.onDblClick.call(this,n,i)||r},n.prototype.newScrollBar=function(t){var n=this;return new dw(this,t,(function(t){n.onScrollBarUpdate(t)}))},n.prototype.toContentWidth=function(t){var n=0,i=null==t?void 0:t.columns;if(i)for(var r=0,e=i.length;r<e;++r){var u=i[r].width;null!=u&&(n+=u)}return 0<n?function(t){return Math.max(t,n)}:"100%"},Object.defineProperty(n.prototype,"headerOffset",{get:function(){var t=this.Hv;return null==t&&(t=this.newHeaderOffset(),this.Hv=t),t},enumerable:!1,configurable:!0}),n.prototype.newHeaderOffset=function(){for(var t=0,n=this.categories,i=0,r=n.length;i<r;++i)t+=n[i].height;return t},Object.defineProperty(n.prototype,"header",{get:function(){var t=this.Qh;return void 0===t&&(t=this.newHeader(this.Nn,this.columns,this.frozen,this.headerOffset),this.Qh=t),t},enumerable:!1,configurable:!0}),n.prototype.hasHeader=function(t){if(t)for(var n=t.columns,i=0,r=n.length;i<r;++i)if(null!=n[i].label)return!0;return!1},n.prototype.newHeader=function(t,n,i,r){return this.hasHeader(t)?new bw(this.toHeaderOptions(null==t?void 0:t.header,n,i,r)):null},n.prototype.toHeaderOptions=function(t,n,i,r){return t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.table&&(t.table=this),t):{columns:n,frozen:i,offset:r,table:this}},Object.defineProperty(n.prototype,"bodyOffset",{get:function(){var t=this.Vv;return null==t&&(t=this.newBodyOffset(),this.Vv=t),t},enumerable:!1,configurable:!0}),n.prototype.newBodyOffset=function(){var t,n;return this.headerOffset+(null!==(n=null===(t=this.header)||void 0===t?void 0:t.height)&&void 0!==n?n:0)},Object.defineProperty(n.prototype,"body",{get:function(){var t=this.no;return null==t&&(t=this.newBody(this.Nn,this.columns,this.frozen,this.bodyOffset),this.no=t),t},enumerable:!1,configurable:!0}),n.prototype.newBody=function(t,n,i,r){return new nw(this.toBodyOptions(null==t?void 0:t.body,n,i,r,null==t?void 0:t.data))},n.prototype.toBodyOptions=function(t,n,i,r,e){return null!=t?(void 0===t.columns&&(t.columns=n),null==t.frozen&&(t.frozen=i),void 0===t.offset&&(t.offset=r),void 0===t.data&&void 0!==e&&(Wt(e)?t.data={rows:e}:t.data=e),void 0===t.height&&void 0===t.weight&&(t.weight=1),t):Wt(e)?{columns:n,frozen:i,offset:r,data:{rows:e},weight:1}:{columns:n,frozen:i,offset:r,data:e,weight:1}},Object.defineProperty(n.prototype,"data",{get:function(){return this.body.data},enumerable:!1,configurable:!0}),n.prototype.getFocusedChildClippingRect=function(n,i,r,e,u,s,h,o){t.prototype.getFocusedChildClippingRect.call(this,n,i,r,e,u,s,h,o);var a=this.toCell(n);if(a){var c=i+this.toFrozenCellX(a)-o.x;if(0<c&&(o.x+=c,o.width-=c),a.parent.parent===this.body){var f=this.bodyOffset;o.y+=f,o.height-=f}}return o},n.prototype.toFrozenCellX=function(t){var n=this.frozen;if(0<n){var i=t.parent.children,r=i.indexOf(t);if(0<=r){var e=i.length;if(n<=e-1-r){var u=i[e-n];return u.position.x+u.width}}}return 0},n.prototype.onKeyDown=function(n){Kt.moveFocusHorizontally(n,this);var i=Kt.isArrowUpKey(n),r=Kt.isArrowDownKey(n);return(i||r)&&this.onKeyDownArrowUpOrDown(n,r),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownArrowUpOrDown=function(t,n){var i=rt.getLayer(this);if(null==i)return!1;var r=i.getFocusController(),e=r.get();if(null==e)return!1;var u=this.toCell(e);if(null==u)return!1;var s=u.parent;if(null==s)return!1;var h=r.find(s,!1,!1,n,this);if(null==h)return!1;var o=this.toCell(h);if(null==o)return!1;var a=o.parent;if(null==a)return!1;var c=s.children.indexOf(u);if(c<0)return!1;var f=a.children[c];if(null==f||f===u||!("state"in f))return!1;var l=r.find(f,!0,!0,n,this);return null!=l&&(r.focus(l),!0)},n.prototype.toCell=function(t){for(var n=t;null!=n;){var i=n.parent;if(i instanceof Xm)return n instanceof Ki?n:null;n=i}return null},n.prototype.getType=function(){return"DTable"},n}(jb),kw=function(t){var n=t.text;if(at(n))return n;var i=t.label;if(at(i))return i;var r=t.name;return at(r)?r:void 0},Lw=function(t){var n=t.title;if(at(n))return n},xw=function(t){return t.image},Bw=function(t){return t.children},_w=function(t){return t.children=[]},Pw=function(t){var n,i,r,e,u;this.toLabel=null!==(n=null==t?void 0:t.toLabel)&&void 0!==n?n:kw,this.toTitle=null!==(i=null==t?void 0:t.toTitle)&&void 0!==i?i:Lw,this.toImage=null!==(r=null==t?void 0:t.toImage)&&void 0!==r?r:xw,this.toChildren=null!==(e=null==t?void 0:t.toChildren)&&void 0!==e?e:Bw,this.newChildren=null!==(u=null==t?void 0:t.newChildren)&&void 0!==u?u:_w},Fw={NONE:0,SINGLE:1,MULTIPLE:2},Uw=function(){function t(t,n){this.O=t,this.xv=[],this.Wv=[],this.Xn=n,this.un=!1}return Object.defineProperty(t.prototype,"nodes",{get:function(){return this.update(),this.xv},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"levels",{get:function(){return this.update(),this.Wv},enumerable:!1,configurable:!0}),t.prototype.toDirty=function(){this.un=!0},t.prototype.size=function(){return this.update(),this.xv.length},t.prototype.each=function(t,n,i){this.update();for(var r=this.xv,e=null!=n?Math.max(0,n):0,u=null!=i?Math.min(r.length,i):r.length,s=e;s<u&&!1!==t(r[s],s);++s);},t.prototype.update=function(){if(this.un){this.un=!1;var t=this.O,n=t.nodes,i=t.accessor.toChildren,r=this.xv,e=this.Wv,u=this.newNodes(t,n,0,0,r,e,this.Xn,i);r.length!==u&&(r.length=u,e.length=u)}},t.prototype.newNodes=function(t,n,i,r,e,u,s,h){for(var o=n.length,a=s?-1:1,c=s?o-1:0;0<=c&&c<o;c+=a){var f=n[c];i<e.length?(e[i]=f,u[i]=r):(e.push(f),u.push(r)),i+=1;var l=h(f);l&&t.isExpanded(f)&&(i=this.newNodes(t,l,i,r+1,e,u,s,h))}return i},t}(),Gw=function(t){function n(n,i){var r=t.call(this)||this;r.O=n,r.xv=new Set;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return Fw.MULTIPLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){var t=this.xv;if(0<t.size){var n=null;return t.forEach((function(t){null==n&&(n=t)})),n}return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){var t=this.xv;if(0<t.size){var n=null;return t.forEach((function(t){n=t})),n}return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){var n=this.xv;if(0<=t&&t<n.size){var i=0,r=null;return n.forEach((function(n){i===t&&(r=n),i+=1})),r}return null},n.prototype.add=function(t){var n=this.xv;return!n.has(t)&&(n.add(t),this.onChange(),!0)},n.prototype.remove=function(t){var n=this.xv;return!!n.has(t)&&(n.delete(t),this.onChange(),!0)},n.prototype.toggle=function(t){var n=this.xv;return n.has(t)?n.delete(t):n.add(t),this.onChange(),!0},n.prototype.clear=function(){var t=this.xv;return 0<t.size&&(t.clear(),this.onChange(),!0)},n.prototype.clearAndAdd=function(t){var n=this.xv;return 1===n.size?!n.has(t)&&(n.clear(),n.add(t),this.onChange(),!0):(n.clear(),n.add(t),this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){for(var n=!1,i=new Set,r=this.xv,e=0,u=t.length;e<u;++e){var s=t[e];r.has(s)||(n=!0),i.add(s)}return n||r.forEach((function(t){i.has(t)||(n=!0)})),n&&(this.xv=i,this.onChange()),n},n.prototype.contains=function(t){return this.xv.has(t)},n.prototype.size=function(){return this.xv.size},n.prototype.isEmpty=function(){return this.xv.size<=0},n.prototype.each=function(t){var n=!1;this.xv.forEach((function(i){n||!1===t(i)&&(n=!0)}))},n.prototype.toArray=function(){var t=[];return this.xv.forEach((function(n){t.push(n)})),t},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.xv,i=this.newNodes(t,n,new Set);n.size!==i.size&&(this.xv=i,this.onChange())},n.prototype.newNodes=function(t,n,i){for(var r=this.O.accessor.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];n.has(s)&&i.add(s);var h=r(s);h&&this.newNodes(h,n,i)}return i},n}(t.utils.EventEmitter),zw=function(t){function n(n,i){var r=t.call(this)||this;r.O=n,r.pn=null;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return Fw.SINGLE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return this.pn},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return 0===t?this.pn:null},n.prototype.add=function(t){return this.pn!==t&&(this.pn=t,this.onChange(),!0)},n.prototype.remove=function(t){return this.pn===t&&(this.pn=null,this.onChange(),!0)},n.prototype.toggle=function(t){return this.pn===t?this.pn=null:this.pn=t,this.onChange(),!0},n.prototype.clear=function(){return null!=this.pn&&(this.pn=null,this.onChange(),!0)},n.prototype.clearAndAdd=function(t){return this.pn!==t&&(this.pn=t,this.onChange(),!0)},n.prototype.clearAndAddAll=function(t){if(0<t.length){var n=t[t.length-1];return this.clearAndAdd(n)}return this.clear()},n.prototype.contains=function(t){return this.pn===t},n.prototype.size=function(){return null!=this.pn?1:0},n.prototype.isEmpty=function(){return null==this.pn},n.prototype.each=function(t){var n=this.pn;null!=n&&t(n)},n.prototype.toArray=function(){var t=this.pn;return null!=t?[t]:[]},n.prototype.onChange=function(){this.O.update(),this.emit("change",this)},n.prototype.onNodeChange=function(t){var n=this.pn,i=this.newNode(t,n);n!==i&&(this.pn=i,this.onChange())},n.prototype.newNode=function(t,n){for(var i=this.O.accessor.toChildren,r=0,e=t.length;r<e;++r){var u=t[r];if(n===u)return u;var s=i(u);if(s){var h=this.newNode(s,n);if(null!=h)return h}}return null},n}(t.utils.EventEmitter),Hw=function(t){function n(n,i){var r=t.call(this)||this;r.O=n;var e=null==i?void 0:i.on;if(e)for(var u in e){var s=e[u];s&&r.on(u,s)}return r}return _(n,t),Object.defineProperty(n.prototype,"type",{get:function(){return Fw.NONE},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"first",{get:function(){return null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"last",{get:function(){return null},enumerable:!1,configurable:!0}),n.prototype.get=function(t){return null},n.prototype.add=function(t){return!1},n.prototype.remove=function(t){return!1},n.prototype.toggle=function(t){return!1},n.prototype.clear=function(){return!1},n.prototype.clearAndAdd=function(t){return!1},n.prototype.clearAndAddAll=function(t){return!1},n.prototype.contains=function(t){return!1},n.prototype.size=function(){return 0},n.prototype.isEmpty=function(){return!0},n.prototype.each=function(t){},n.prototype.toArray=function(){return[]},n.prototype.onNodeChange=function(t){},n}(t.utils.EventEmitter),Vw=function(){function t(t,n){this.O=t,this.Xv=new WeakMap,this.hc=this.toSelection(n),this.ec=new Pw(n);var i=new Uw(this,!!(null==n?void 0:n.reverse));this.oc=i;var r=null==n?void 0:n.nodes;null!=r?(this.xv=r,i.toDirty()):this.xv=[]}return t.prototype.toSelection=function(t){var n=null==t?void 0:t.selection;switch(null==n?void 0:n.type){case Fw.NONE:case"NONE":return new Hw(this,n);case Fw.MULTIPLE:case"MULTIPLE":return new Gw(this,n);default:return new zw(this,n)}},Object.defineProperty(t.prototype,"nodes",{get:function(){return this.xv},set:function(t){this.xv=t,this.oc.toDirty(),this.hc.onNodeChange(t),this.update()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"mapped",{get:function(){return this.oc},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"accessor",{get:function(){return this.ec},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"selection",{get:function(){return this.hc},enumerable:!1,configurable:!0}),t.prototype.update=function(){this.O.update()},t.prototype.toggle=function(t){var n=this.Xv;return n.has(t)?n.delete(t):n.set(t,1),this.oc.toDirty(),this.update(),!0},t.prototype.expand=function(t){var n=this.Xv;return!n.has(t)&&(n.set(t,1),this.oc.toDirty(),this.update(),!0)},t.prototype.collapse=function(t){var n=this.Xv;return!!n.has(t)&&(n.delete(t),this.oc.toDirty(),this.update(),!0)},t.prototype.expandAll=function(){var t=!1,n=this.Xv;return this.each((function(i){n.has(i)||(n.set(i,1),t=!0)})),!!t&&(this.oc.toDirty(),this.update(),!0)},t.prototype.collapseAll=function(){var t=!1,n=this.Xv;return this.each((function(i){n.has(i)&&(n.delete(i),t=!0)})),!!t&&(this.oc.toDirty(),this.update(),!0)},t.prototype.isCollapsed=function(t){return!this.isExpanded(t)},t.prototype.isExpanded=function(t){return this.Xv.has(t)},t.prototype.clear=function(){var t=this.xv;return 0<t.length&&(t.length=0,this.oc.toDirty(),this.hc.clear(),this.update(),!0)},t.prototype.remove=function(t){var n=!1;return this.each((function(i,r,e){return i!==t||(e.splice(r,1),n=!0,!1)})),!!n&&(this.oc.toDirty(),this.hc.remove(t),this.update(),!0)},t.prototype.add=function(t,n){var i=!1;if(n){var r=this.ec,e=r.toChildren(n);if(e)e.push(t),i=!0;else{var u=r.newChildren(n);u&&(u.push(t),i=!0)}}else{var s=this.xv;s?s.push(t):this.xv=[t],i=!0}return i&&(this.oc.toDirty(),this.update()),!0},t.prototype.addBefore=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e,0,t),i=!0,!1)})),i&&(this.oc.toDirty(),this.update()),i},t.prototype.addAfter=function(t,n){var i=!1;return this.each((function(r,e,u){return r!==n||(u.splice(e+1,0,t),i=!0,!1)})),i&&(this.oc.toDirty(),this.update()),i},t.prototype.each=function(t){var n=this.xv;n&&this.rc(n,null,t)},t.prototype.rc=function(t,n,i){for(var r=this.ec.toChildren,e=0,u=t.length;e<u;++e){var s=t[e];if(!1===i(s,e,t,n))return;var h=r(s);h&&this.rc(h,s,i)}},t}(),Ww={HAS_CHILDREN:"HAS_CHILDREN",OPENED:"OPENED"},Xw=function(t){function n(n,i){var r=t.call(this,i)||this;return r.Bn=new pv(r.Bn),r.$i=n,r}return _(n,t),Object.defineProperty(n.prototype,"node",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.pn},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"index",{get:function(){return this.ae},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"data",{get:function(){return this.$i},enumerable:!1,configurable:!0}),n.prototype.toggle=function(){var t=this.pn;void 0!==t&&this.$i.toggle(t)},n.prototype.set=function(t,n,i){var r,e=this.$i,u=i||this.pn!==t;if(u){this.pn=t,this.ae=n;var s=e.accessor;this.text=s.toLabel(t),this.title=null!==(r=s.toTitle(t))&&void 0!==r?r:"",this.image=s.toImage(t)}var h=e.mapped.levels[n];this.Bn.adjLeft(this.theme.getLevelPadding(h));var o=e.accessor.toChildren(t),a=!!(o&&0<o.length),c=this.state;c.lock(),c.set(ht.ACTIVE,e.selection.contains(t)),c.remove(ht.DISABLED),c.set(Ww.HAS_CHILDREN,a),c.set(Ww.OPENED,e.isExpanded(t)),c.unlock(),u&&this.emit("set",t,n,this)},n.prototype.unset=function(){if(void 0!==this.pn){this.pn=void 0,this.ae=void 0,this.text=void 0,this.title="",this.image=void 0;var t=this.state;t.lock(),t.add(ht.DISABLED),t.remove(ht.ACTIVE),t.unlock(),this.emit("unset",this)}},n.prototype.onSelect=function(t,n){var i=this.$i,r=i.selection;if(r.type!==Fw.MULTIPLE)r.clearAndAdd(n);else{var e=t&&"data"in t?t.data.originalEvent:t;if(null==e?void 0:e.ctrlKey)r.toggle(n);else if(null==e?void 0:e.shiftKey){var u=i.mapped,s=r.last;if(n===s)r.clearAndAdd(n);else{var h=!1,o=!1,a=[];u.each((function(t){if(h){if(o){if(a.unshift(t),t===n)return!1}else if(a.push(t),t===s)return!1}else t===n?(h=!0,o=!1,a.push(t)):t===s&&(h=!0,o=!0,a.push(t))})),r.clearAndAddAll(a)}}else r.clearAndAdd(n)}},n.prototype.onKeyDown=function(n){var i;return Kt.isActivateKey(n)&&this.onKeyDownActivate(n),Kt.isArrowRightKey(n)&&void 0!==(i=this.pn)&&this.state.is(Ww.HAS_CHILDREN)&&this.$i.expand(i),Kt.isArrowLeftKey(n)&&void 0!==(i=this.pn)&&this.state.is(Ww.HAS_CHILDREN)&&this.$i.collapse(i),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyDownActivate=function(t){if(this.state.isActionable&&this.state.isFocused){var n=this.pn;return void 0!==n&&this.onSelect(t,n),!0}return!1},n.prototype.getType=function(){return"DTreeItemText"},n}(Ie),Kw=function(t){function n(n,i){var r,e=t.call(this,n,i)||this,u=di(null!==(r=null==i?void 0:i.when)&&void 0!==r?r:fe.CLICKED,fe);return e.cu=u,e.initOnClick(u,e.theme,i),e}return _(n,t),n.prototype.initOnClick=function(t,n,i){var r=this;zi.onClick(this,(function(n){t===fe.CLICKED&&r.onClick(n)}))},n.prototype.onClick=function(t){this.state.isActionable&&this.onActivate(t)},n.prototype.onDblClick=function(n,i){return this.cu===fe.DOUBLE_CLICKED&&this.onClick(n),t.prototype.onDblClick.call(this,n,i)},n.prototype.onActivate=function(t){this.emit("active",this)},n.prototype.onActivateKeyDown=function(t){this.state.isActionable&&(this.state.isPressed=!0)},n.prototype.onActivateKeyUp=function(t){this.state.isActionable&&(this.state.isPressed&&this.onActivate(t),this.state.isPressed=!1)},n.prototype.onKeyDown=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyDown(n),t.prototype.onKeyDown.call(this,n)},n.prototype.onKeyUp=function(n){return Kt.isActivateKey(n)&&this.onActivateKeyUp(n),t.prototype.onKeyUp.call(this,n)},n.prototype.getType=function(){return"DTreeItemButton"},n}(Xw),Yw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.onActivate=function(i){t.prototype.onActivate.call(this,i);var r=this.pn;void 0!==r&&(this.state.is(Ww.HAS_CHILDREN)?i&&"data"in i&&(this.toLocal(i.data.global,void 0,n.WORK_CONTAINS_POINT).x<=this.padding.getLeft()?this.toggle():this.onSelect(i,r)):this.onSelect(i,r))},n.prototype.getType=function(){return"DTreeItemNonEditable"},n}(Kw),Jw=function(t){function n(){return null!==t&&t.apply(this,arguments)||this}return _(n,t),n.prototype.toMapped=function(t){return t.mapped},n.prototype.newItem=function(t){return new Yw(t)},n}(eb),Zw=function(t){function n(n){var i=t.call(this,n)||this;return i.update(),i}return _(n,t),n.prototype.onContentChange=function(){t.prototype.onContentChange.call(this),this.update()},n.prototype.onResize=function(n,i,r,e){var u=this.updater;u.lock(),t.prototype.onResize.call(this,n,i,r,e),u.update(),u.unlock(!0)},Object.defineProperty(n.prototype,"updater",{get:function(){var t=this.Mc;return null==t&&(t=this.newUpdater(this.data,this.content,this.Nn),this.Mc=t),t},enumerable:!1,configurable:!0}),n.prototype.newUpdater=function(t,n,i){return new Jw(t,n,n,null==i?void 0:i.updater)},Object.defineProperty(n.prototype,"data",{get:function(){var t=this.$i;return null==t&&(t=this.toData(this.Nn),this.$i=t),t},enumerable:!1,configurable:!0}),n.prototype.toData=function(t){var n=t&&(t.data||t.nodes||t.value)||[];return Wt(n)?new Vw(this,{nodes:n}):"add"in n?n:new Vw(this,n)},n.prototype.update=function(t){this.updater.update(t)},n.prototype.lock=function(){this.updater.lock()},n.prototype.unlock=function(t){this.updater.unlock(t)},Object.defineProperty(n.prototype,"selection",{get:function(){return this.data.selection},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"value",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nodes",{get:function(){return this.data.nodes},set:function(t){this.data.nodes=t},enumerable:!1,configurable:!0}),n.prototype.toggle=function(t){return this.data.toggle(t)},n.prototype.expand=function(t){return this.data.expand(t)},n.prototype.collapse=function(t){return this.data.collapse(t)},n.prototype.expandAll=function(){return this.data.expandAll()},n.prototype.collapseAll=function(){return this.data.collapseAll()},n.prototype.isCollapsed=function(t){return this.data.isCollapsed(t)},n.prototype.isExpanded=function(t){return this.data.isExpanded(t)},n.prototype.clear=function(){return this.data.clear()},n.prototype.remove=function(t){return this.data.remove(t)},n.prototype.add=function(t,n){return this.data.add(t,n)},n.prototype.addBefore=function(t,n){return this.data.addBefore(t,n)},n.prototype.addAfter=function(t,n){return this.data.addAfter(t,n)},n.prototype.each=function(t){return this.data.each(t)},n.prototype.onKeyDown=function(n){return this.updater.moveFocus(n,this,!0,!1),t.prototype.onKeyDown.call(this,n)},n.prototype.getType=function(){return"DTree"},n}(jb),qw={__proto__:null,loadAll:El,loadMenuItemAll:Dl,loadMenuItemExpandable:il,loadMenuItem:Wf,loadMenuSidedItemExpandable:Ol,loadMenuSidedItem:cl,EShapeActionBases:Zt,EShapeActionExpressions:qt,EShapeActionRuntimeBlinkBrighten:nn,EShapeActionRuntimeBlinkColorFill:rn,EShapeActionRuntimeBlinkColorStroke:en,EShapeActionRuntimeBlinkDarken:un,EShapeActionRuntimeBlinkOpacity:sn,EShapeActionRuntimeBlinkVisibility:hn,EShapeActionRuntimeBlink:tn,EShapeActionRuntimeChangeColorBrightness:En,EShapeActionRuntimeChangeColorCode:Sn,EShapeActionRuntimeChangeColor:mn,EShapeActionRuntimeChangeCursor:jn,EShapeActionRuntimeChangeTextNumber:ai,EShapeActionRuntimeChangeTextText:ci,EShapeActionRuntimeConditional:Qt,EShapeActionRuntimeEmitEvent:ar,EShapeActionRuntimeMiscGesture:_r,EShapeActionRuntimeMiscEmitEvent:fr,EShapeActionRuntimeMiscHtmlElement:mr,EShapeActionRuntimeMiscInputInput:Sr,EShapeActionRuntimeMiscInputInteger:jr,EShapeActionRuntimeMiscInputNumber:Tr,EShapeActionRuntimeMiscInputReal:Nr,EShapeActionRuntimeMiscInputText:Cr,EShapeActionRuntimeMiscInput:Mr,EShapeActionRuntimeMiscLayerGesture:he,EShapeActionRuntimeMiscLayerShowHide:ae,EShapeActionRuntimeMiscWriteBoth:Rr,EShapeActionRuntimeMiscWriteLocal:yr,EShapeActionRuntimeMiscWriteRemote:kr,EShapeActionRuntimeMiscWrite:Ar,EShapeActionRuntimeOpenDiagram:mu,EShapeActionRuntimeOpenDialogBoolean:ru,EShapeActionRuntimeOpenDialogInteger:cu,EShapeActionRuntimeOpenDialogReal:vu,EShapeActionRuntimeOpenDialogText:gu,EShapeActionRuntimeOpenDialog:iu,EShapeActionRuntimeOpenPageInplace:pu,EShapeActionRuntimeOpenPage:wu,EShapeActionRuntimeOpen:nu,EShapeActionRuntimeShowHide:Yu,EShapeActionRuntimeTransformMoveAbsoluteX:qu,EShapeActionRuntimeTransformMoveAbsoluteY:$u,EShapeActionRuntimeTransformMoveForwardOrBackward:Qu,EShapeActionRuntimeTransformMoveLeftOrRight:ts,EShapeActionRuntimeTransformMoveRelativeX:ns,EShapeActionRuntimeTransformMoveRelativeY:is,EShapeActionRuntimeTransformMove:Zu,EShapeActionRuntimeTransformResizeHeightAbsolute:cs,EShapeActionRuntimeTransformResizeHeightRelative:fs,EShapeActionRuntimeTransformResizeSizeAbsolute:ls,EShapeActionRuntimeTransformResizeSizeRelative:vs,EShapeActionRuntimeTransformResizeWidthAbsolute:bs,EShapeActionRuntimeTransformResizeWidthRelative:ds,EShapeActionRuntimeTransformResize:as,EShapeActionRuntimeTransformRotateAbsolute:ws,EShapeActionRuntimeTransformRotateRelative:ps,EShapeActionRuntimeTransformRotate:ms,EShapeActionRuntime:$t,EShapeActionRuntimes:or,EShapeActionValueBase:an,EShapeActionValueBlinkType:on,EShapeActionValueBlink:vn,EShapeActionValueChangeColorBrightness:Mn,EShapeActionValueChangeColorCode:Tn,EShapeActionValueChangeColorTarget:gn,EShapeActionValueChangeColorTypeLegacy:pn,EShapeActionValueChangeColorType:wn,EShapeActionValueChangeColorTypes:On,EShapeActionValueChangeColor:Dn,EShapeActionValueChangeCursor:Nn,EShapeActionValueChangeTextType:fi,EShapeActionValueChangeText:li,EShapeActionValueDeserializer:Es,EShapeActionValueEmitEvent:cr,EShapeActionValueMiscEmitEvent:Ys,EShapeActionValueMiscGestureType:xr,EShapeActionValueMiscGesture:Pr,EShapeActionValueMiscHtmlElement:Js,EShapeActionValueMiscInput:Zs,EShapeActionValueMiscLayerGesture:oe,EShapeActionValueMiscLayerShowHide:ce,EShapeActionValueMiscType:gr,EShapeActionValueMiscWrite:qs,EShapeActionValueMisc:Lr,EShapeActionValueOnInputAction:Dr,EShapeActionValueOnInputActions:Er,EShapeActionValueOpenType:Ou,EShapeActionValueOpen:Xu,EShapeActionValueOpetyped:rs,EShapeActionValueShowHideType:Ku,EShapeActionValueShowHide:Ju,EShapeActionValueSubtyped:cn,EShapeActionValueTransformMoveType:es,EShapeActionValueTransformMove:ss,EShapeActionValueTransformResizeType:os,EShapeActionValueTransformResize:gs,EShapeActionValueTransformRotateType:Os,EShapeActionValueTransformRotate:Ds,EShapeActionValueTransformType:us,EShapeActionValueType:fn,EShapeActionValues:ln,EShapeAction:et,loadShapeAll:wf,loadShapeBar:Is,loadShapeButton:nh,loadShapeCircle:vh,loadShapeConnectorLine:xo,loadShapeEmbedded:da,loadShapeGroupShadowed:Ta,loadShapeGroup:Da,loadShapeImage:Ra,loadShapeLabel:Ka,loadShapeLineOfCircles:Oc,loadShapeLineOfRectangleRoundeds:Tc,loadShapeLineOfRectangles:Ac,loadShapeLineOfTriangleRoundeds:Xc,loadShapeLineOfTriangles:$c,loadShapeLine:Za,loadShapeNull:nf,loadShapeRectangleRounded:df,loadShapeRectangle:ef,loadShapeTriangleRounded:mf,loadShapeTriangle:gf,BAR_VERTEX_COUNT:4,BAR_INDEX_COUNT:2,buildBarClipping:c,buildBarIndex:f,buildBarVertexStepAndColorFill:l,buildBarUv:v,CIRCLE_VERTEX_COUNT:9,CIRCLE_INDEX_COUNT:8,CIRCLE_WORLD_SIZE:ih,buildCircleClipping:eh,buildCircleIndex:uh,buildCircleVertex:sh,buildCircleStep:hh,buildCircleUv:oh,buildColor:G,IMAGE_SDF_VERTEX_COUNT:9,IMAGE_SDF_INDEX_COUNT:8,IMAGE_SDF_WORLD_SIZE:ya,buildImageSdfClipping:La,buildImageSdfIndex:xa,buildImageSdfStep:Ba,buildImageSdfVertex:_a,buildImageSdfUv:Pa,toLineOfAnyPointCount:nc,buildLineOfAnyColor:ic,toPointsCount:dh,toLinePointCount:gh,toLineVertexCount:mh,toLineIndexCount:wh,buildLineClipping:ph,buildLineIndex:Oh,buildLineUv:Dh,buildLineVertexStepAndColorFill:Eh,buildNullClipping:qa,buildNullIndex:function(t,n,i,r){for(var e=3*i,u=3*(i+r);e<u;e+=3)t[e+0]=n,t[e+1]=n,t[e+2]=n},buildNullVertex:$a,buildNullStep:Qa,buildNullUv:tc,RECTANGLE_ROUNDED_VERTEX_COUNT:ys,RECTANGLE_ROUNDED_INDEX_COUNT:24,RECTANGLE_ROUNDED_WORLD_SIZE:ks,buildRectangleRoundedIndex:xs,buildRectangleRoundedVertex:Bs,buildRectangleRoundedClipping:_s,buildRectangleRoundedStep:Ps,buildRectangleRoundedUv:Fs,RECTANGLE_VERTEX_COUNT:ho,RECTANGLE_INDEX_COUNT:oo,RECTANGLE_WORLD_SIZE:ao,buildRectangleClipping:fo,buildRectangleIndex:lo,buildRectangleVertex:vo,buildRectangleStep:bo,buildRectangleUv:mo,TEXT_VERTEX_COUNT:4,TEXT_INDEX_COUNT:2,toTextBufferCount:M,buildTextClipping:S,buildTextIndex:T,buildTextStep:j,buildTextVertex:C,TRIANGLE_ROUNDED_VERTEX_COUNT:Rc,TRIANGLE_ROUNDED_INDEX_COUNT:15,TRIANGLE_ROUNDED_WORLD_SIZE:yc,buildTriangleRoundedIndex:Lc,buildTriangleRoundedVertex:xc,buildTriangleRoundedClipping:Bc,buildTriangleRoundedStep:_c,buildTriangleRoundedUv:Pc,TRIANGLE_VERTEX_COUNT:7,TRIANGLE_INDEX_COUNT:3,TRIANGLE_WORLD_SIZE:Ch,buildTriangleClipping:Rh,buildTriangleIndex:yh,buildTriangleVertex:kh,buildTriangleStep:Lh,buildTriangleUv:xh,BuilderBar:zt,BuilderBase:z,BuilderCircle:ah,BuilderImageSdf:Fa,BuilderLabel:Ha,BuilderLineOfAny:rc,BuilderLineOfCircles:dc,BuilderLineOfRectangleRoundeds:Dc,BuilderLineOfRectangles:jc,BuilderLineOfTriangleRoundeds:Fc,BuilderLineOfTriangles:Kc,BuilderLine:Ih,BuilderMarkerCircleHead:Gh,BuilderMarkerCircleTail:zh,BuilderMarkerCircle:Uh,BuilderMarkerRectangleHead:Oo,BuilderMarkerRectangleTail:po,BuilderMarkerRectangle:wo,BuilderMarkerTriangleHead:Ph,BuilderMarkerTriangleTail:Fh,BuilderMarkerTriangle:_h,BuilderNull:Hh,BuilderRectanglePivoted:Bo,BuilderRectangleRounded:Us,BuilderRectangle:ja,BuilderText:Ht,BuilderTriangleRounded:uf,BuilderTriangle:sf,toTransformLocalId:H,toTexture:V,toTextureTransformId:W,toTextureUvs:X,copyClipping:ec,copyIndex:uc,copyStep:sc,copyUvs:hc,copyVertex:oc,createBarUploaded:Vt,createButtonUploaded:zs,createCircle:ch,createRectanglePivotedUploaded:_o,createGroupUploaded:Po,createImageSdfUploaded:Ua,createImageSdf:hf,createImage:function(t){return Ms.toImageElement(t).then((function(t){return new Ca(t)}))},createLabelUploaded:Va,createLineOfAnyUploaded:gc,createLineOfCirclesUploaded:mc,createLineOfRectangleRoundedsUploaded:Ec,createLineOfRectanglesUploaded:Nc,createLineOfTriangleRoundedsUploaded:Uc,createLineOfTrianglesUploaded:Yc,createLineUploaded:To,createLine:function(t,n,i,r){for(var e=no(t,[0,0,0,0]),u=.5*(e[2]+e[0]),s=.5*(e[3]+e[1]),h=e[2]-e[0],o=e[3]-e[1],a=[],c=0,f=t.length;c<f;c+=2)a.push(t[c]-u,t[c+1]-s);var l=new Ya;return l.stroke.set(!0,void 0,void 0,i),l.transform.position.set(u,s),l.size.set(h,o),l.points.set(a,n,r),l},createNullUploaded:Qc,createRectangleRoundedUploaded:Gs,createRectangleUploaded:Na,createTriangleRoundedUploaded:of,createTriangleUploaded:af,deserializeBar:Ns,deserializeButton:Ks,deserializeCircle:lh,deserializeConnectorLine:ko,onConnectorLineDeserialized:Lo,deserializeEmbedded:ba,deserializeGroupShadowed:Sa,deserializeGroup:Oa,deserializeImageSdf:za,deserializeImage:Aa,deserializeLabel:Xa,deserializeLineOfCircles:pc,deserializeLineOfRectangleRoundeds:Sc,deserializeLineOfRectangles:Cc,deserializeLineOfTriangleRoundeds:Wc,deserializeLineOfTriangles:qc,deserializeLine:Ja,deserializeNull:tf,deserializeRectangleRounded:cf,deserializeRectangle:rf,deserializeTriangleRounded:ff,deserializeTriangle:lf,EShapeBarPoints:tt,EShapeBarPosition:Q,EShapeBar:Gt,EShapeBaseHitTestData:dt,EShapeBase:Dt,EShapeButtonRuntimeActionToggle:Qs,EShapeButtonRuntimeAction:$s,EShapeButtonRuntime:th,EShapeButton:Xs,EShapeCircle:fh,EShapeConnectorLine:yo,EShapeDataImpl:It,EShapeDataValueImpl:Nt,EShapeDataValueRangeImpl:Tt,EShapeEmbeddedDatum:Uo,EShapeEmbeddedLayerContainer:ea,EShapeEmbeddedLayer:ra,EShapeEmbedded:la,EShapeEmbeddeds:va,EShapeFillImpl:Z,EShapeGradients:pt,EShapeGroupFillEditor:ga,EShapeGroupFillViewer:Ho,EShapeGroupPoints:ma,EShapeGroupShadowed:Ma,EShapeGroupSizeEditor:Ko,EShapeGroupSizeLayout:Xo,EShapeGroupSizeShadowed:Ea,EShapeGroupSizeViewer:Yo,EShapeGroupStrokeEditor:wa,EShapeGroupStrokeViewer:Jo,EShapeGroupTextAlignEditor:sa,EShapeGroupTextAlignViewer:Zo,EShapeGroupTextEditor:fa,EShapeGroupTextOffsetEditor:ha,EShapeGroupTextOffsetViewer:qo,EShapeGroupTextOutlineEditor:oa,EShapeGroupTextOutlineViewer:$o,EShapeGroupTextPaddingEditor:aa,EShapeGroupTextPaddingViewer:Qo,EShapeGroupTextSpacingEditor:ca,EShapeGroupTextSpacingViewer:ta,EShapeGroupTextViewer:na,EShapeGroupViewer:ia,EShapeGroup:pa,EShapeImageSdf:Ga,EShapeImage:Ca,EShapeLabel:Wa,EShapeLineBaseHitPart:nt,EShapeLineBase:Ut,EShapeLineOfAnyPointsFillImpl:fc,EShapeLineOfAnyPointsImpl:bc,EShapeLineOfAnyPointsPointImpl:lc,EShapeLineOfAnyPointsStrokeImpl:vc,EShapeLineOfCircles:wc,EShapeLineOfRectangleRoundeds:Mc,EShapeLineOfRectangles:Ic,EShapeLineOfTriangleRoundeds:Vc,EShapeLineOfTriangles:Zc,EShapeLinePoints:so,EShapeLine:Ya,EShapeNull:Ts,EShapePrimitive:kt,EShapeRectanglePivoted:vf,EShapeRectangleRounded:Ws,EShapeRectangle:Ia,EShapeStrokeImpl:Et,EShapeTextAlignImpl:Ct,EShapeTextImpl:yt,EShapeTextOffsetImpl:At,EShapeTextOutlineImpl:Rt,EShapeTriangleRounded:Hc,EShapeTriangle:Jc,hitTestBBox:Ot,hitTestCircle:Lt,hitTestRectangleRounded:Vs,hitTestRectangle:Bt,hitTestTriangleRounded:zc,hitTestTriangleFilled:_t,hitTestTriangle:Pt,isStatic:ac,toComputed:cc,toDash:h,toThresholdDefault:Ft,toLength:O,toScaleInvariant:o,EShapeAcceptorImpl:jo,EShapeAcceptorType:No,EShapeAcceptors:Io,EShapeBufferUnitBuilder:$r,EShapeBufferUnit:qr,EShapeBuffer:Qr,EShapeCapabilities:As,EShapeCapability:Cs,EShapeConnectorContainerImpl:ut,EShapeConnectorEdgeAcceptorImpl:Co,EShapeConnectorEdgeContainerImpl:Ro,EShapeConnectorEdgeImpl:Ao,EShapeConnectors:Go,EShapeContainer:ee,EShapeCopyPart:st,EShapeCorner:it,EShapeDataValueRangeType:St,EShapeDataValueOrder:Mt,EShapeDefaults:Y,EShapeDeleter:Sl,EShapeDeserializer:js,EShapeDeserializers:n,EShapeOnDeserialized:i,EShapeEditor:Vo,EShapeImageElements:Ms,EShapeLayerState:zo,toPointsBoundary:no,eShapePointsFormatterCurve:to,EShapePointsMarkerBase:io,EShapePointsMarkerContainerImplNoop:$,EShapePointsMarkerContainerImpl:uo,EShapePointsMarkerHead:ro,EShapePointsMarkerNoop:q,EShapePointsMarkerTail:eo,EShapePointsMarkerType:J,EShapePointsStyle:U,EShapePointsStyles:Tl,EShapeRendererIteratorDatum:ne,EShapeRendererIterator:ie,EShapeRenderer:re,EShapeResourceManagerDeserialization:Fo,EShapeResourceManagerSerialization:jl,EShapeRuntimeReset:Yt,EShapeRuntime:Jt,EShapeRuntimes:Rs,EShapeSearch:Ml,EShapeSizes:hs,EShapeStateSetImplObservable:vt,EShapeState:lt,EShapeStrokeSide:xt,EShapeStrokeStyle:s,EShapeTextAlignHorizontal:m,EShapeTextAlignVertical:w,EShapeTextDirection:p,EShapeTextWeight:d,EShapeTextStyle:g,EShapeTransformImpl:bt,EShapeTransforms:Wo,EShapeType:r,EShapeUploadedImpl:u,EShapeUploadeds:e,EShapeUuidMappingImpl:Ss,ESnapperGrid:Nl,ESnapperResultScale:function(){this.distance=NaN,this.scale=new t.Point},ESnapperResult:Il,ESnapperTargetValueType:Cl,ESnapperTargetValue:Al,ESnapperTarget:Rl,ESnapperModifierAnchor:kl,ESnapper:Ll,DThemes:K,DynamicAtlasItemEmpty:Ur,DynamicAtlasItemFontAtlas:Hr,DynamicAtlasItemImage:Zr,DynamicAtlasItemText:xl,DynamicAtlasItemWhite:Gr,DynamicAtlasItem:Fr,DynamicAtlas:zr,DynamicFontAtlasCharacterOrigin:Wr,DynamicFontAtlasCharacter:Xr,DynamicFontAtlasFont:Bl,DynamicFontAtlas:_l,DynamicFontAtlases:zl,DynamicSDFFontAtlas:Yr,DynamicSDFFontAtlases:Jr,DynamicSDFFontGenerator:Kr,isArray:Wt,isFunction:ot,isNaN:Gu,isNumber:Xt,isString:at,Lazy:Hl,NumberFormatterImpl:hi,NumberFormatters:oi,toCeilingIndex:Vl,toEnum:di,toIndexOf:Vh,toLabel:Wl,toPadded:mt,toString:function(t){return null!=t?String(t):""},toSvgTexture:function(n,i){return t.Texture.from(gt(n),{resolution:i})},toSvgUrl:gt,UtilAlpha:bn,UtilSvgAtlasBuilder:Xl,UtilAttachAlign:ke,UtilAttach:Le,UtilClickOutside:Pe,UtilClipboard:Rf,UtilGestureData:$i,UtilGestureEasingHistory:nr,UtilGestureEasing:ir,UtilGestureMode:qi,UtilGestureModifier:Ji,UtilGestureModifiers:Zi,UtilGesture:rr,UtilExtract:Jl,UtilExtractor:Kl,UtilFileDownloader:Yl,UtilFileAs:Zl,UtilFileOpener:ql,UtilHsv:$l,UtilHtmlElementWhen:vr,UtilHtmlElement:br,UtilInputInput:pr,UtilInputNumber:Or,UtilInputTextArea:Ql,UtilInputText:Ir,UtilInput:wr,UtilKeyboardEvent:Kt,UtilName:tv,UtilOverlay:Fe,UtilPointerEvent:zi,UtilRgb:wt,UtilRgba:nv,UtilStateBlinker:iv,UtilTransition:rv,UtilWheelEvent:ev,DAlignHorizontal:le,DAlignVertical:ve,DAlignWith:be,DAnimationBase:tr,DAnimationEmpty:uv,DAnimationFadeIn:ye,DAnimationTimings:Qi,DApplicationLayerOptions:hv,DApplicationLayer:gv,DApplicationPadding:sv,DApplication:wv,DApplications:rt,DBaseAutoSet:Vi,DBaseAuto:Hi,DBaseBackgroundMeshGeometry:Si,DBaseBackgroundMesh:Ti,DBaseBackgroundSnippet:ji,DBaseBackground:vi,DBaseBorderMeshGeometry:Ni,DBaseBorderMesh:Ii,DBaseBorderSnippet:Ci,DBaseBorder:gi,DBaseCorner:wi,DBaseInteractive:pi,DBaseMeshGeometry:Mi,DBaseOutlineSnippet:Ai,DBaseOutline:Oi,DBaseOverflowMaskSimple:we,DBaseOverflowMask:Yi,DBasePaddingAdjustable:pv,DBasePadding:Di,DBasePoint:Ei,DBaseReflowableContainer:Xi,DBaseReflowableImpl:Ri,DBaseSnippetContainer:Wi,DBaseStateSetImplObservable:ft,DBaseStateSetImpl:ct,DBaseState:ht,DBase:Ki,DBoard:Ov,DBorderMask:bi,DButtonAmbient:Du,DButtonBaseWhen:fe,DButtonBase:Ce,DButtonCheckRight:Ev,DButtonCheck:Dv,DButtonColorGradient:Pv,DButtonColor:Uv,DButtonDanger:Gv,DButtonDate:Hv,DButtonDatetime:Yv,DButtonFileAs:Zl,DButtonFile:Jv,DButtonGroup:Ze,DButtonLink:Zv,DButtonPrimary:Re,DButtonRadioRight:$v,DButtonRadio:qv,DButtonRedo:Qv,DButtonSecondary:tb,DButtonSelect:Fb,DButtonTime:Gb,DButtonUndo:zb,DButton:Ae,DCanvasContainer:hr,DCanvas:Hb,DChartAxisBaseOptionParser:Xb,DChartAxisBase:Kb,DChartAxisContainerImpl:Yb,DChartAxisPosition:Vb,DChartAxisTickPosition:Wb,DChartAxisXDatetime:Zb,DChartAxisX:Jb,DChartAxisY:qb,DChartColorSet1:function(t){return $b[t%$b.length]},DChartColorSet2:td,DChartCoordinateContainerImpl:rd,DChartCoordinateContainerSubImpl:id,DChartCoordinateLinearTick:ed,DChartCoordinateLinear:od,DChartCoordinateLogTick:ad,DChartCoordinateLog:cd,DChartCoordinateTransformImpl:ud,DChartCoordinateTransformMarkImpl:sd,DChartCoordinateDirection:nd,DChartLegendItem:fd,DChartLegend:ld,DChartOverview:vd,DChartPlotAreaContainer:bd,DChartPlotAreaImpl:jd,DChartRegionImplObservable:Nd,DChartRegionImpl:hd,DChartSelectionGridlineContainerImpl:Rd,DChartSelectionGridlineX:Cd,DChartSelectionGridlineY:Ad,DChartSelectionMarker:yd,DChartSelectionShapeBase:Id,DChartSelectionSimple:xd,DChartSelectionSubImpl:Ld,DChartSelectionPoint:kd,DChartSeriesBar:Fd,DChartSeriesBaseCoordinateContainer:Bd,DChartSeriesBase:_d,DChartSeriesContainerImpl:Td,DChartSeriesFillComputedImpl:gd,DChartSeriesFillImpl:wd,DChartSeriesLineOfAny:Pd,DChartSeriesLineOfCircles:Ud,DChartSeriesLineOfRectangleRoundeds:Gd,DChartSeriesLineOfRectangles:zd,DChartSeriesLineOfTriangleRoundeds:Vd,DChartSeriesLineOfTriangles:Hd,DChartSeriesLine:Wd,DChartSeriesExpressionParametersImpl:Xd,DChartSeriesLinear:Kd,DChartSeriesPaddingComputedImpl:pd,DChartSeriesPaddingImpl:Od,DChartSeriesPointComputedImpl:Dd,DChartSeriesPointImpl:Ed,DChartSeriesScalars:md,DChartSeriesStrokeComputedImpl:Md,DChartSeriesStrokeImpl:Sd,DChartSeriesHitResult:dd,DChart:Yd,DColorGradientObservable:Tv,DColorGradientPointObservable:Mv,DCommandClear:av,DCommandCreate:Jd,DCommandDelete:Zd,DCommandFlag:ov,DCommandRedo:cv,DCommandSaveAs:qd,DCommandSave:$d,DCommandUndo:fv,DContent:gb,DControllerDefaultCommand:vv,DControllerDefaultFocus:mv,DControllerKeyboard:bv,DControllers:dv,DCornerMask:mi,DDiagramBase:tg,DDiagramCanvasBase:hg,DDiagramCanvasEditorBackground:ng,DDiagramCanvasEditorSnap:og,DDiagramCanvasEditor:ag,DDiagramCanvasTileMappingImpl:rg,DDiagramCanvasTileMappingPointImpl:ig,DDiagramCanvasTile:eg,DDiagramCanvas:cg,DDiagramDataRemote:fg,DDiagramData:lg,DDiagramEditorThumbnail:vg,DDiagramEditor:bg,DDiagramLayerContainer:sg,DDiagramLayer:ug,DDiagramLayers:ue,DDiagramSerializedVersion:1,DDiagramShape:dg,DDiagramSnapshot:Qd,DDiagram:gg,DDiagrams:ua,DDialogAlign:ke,DDialogCloseOn:xe,DDialogColorGradient:_v,DDialogColor:Fv,DDialogCommand:Ke,DDialogConfirmDelete:pg,DDialogConfirmDiscard:Og,DDialogConfirmMessage:mg,DDialogConfirm:wg,DDialogDate:Vu,DDialogDates:zv,DDialogDatetime:Pu,DDialogDatetimes:Vv,DDialogInputBoolean:tu,DDialogInputInteger:au,DDialogInputReal:lu,DDialogInputText:du,DDialogInput:Je,DDialogMessage:Dg,DDialogMode:Be,DDialogProcessingMessage:Eg,DDialogProcessing:Mg,DDialogSaveAs:Sg,DDialogSelectListItem:rb,DDialogSelectList:Ib,DDialogSelectSearh:Cb,DDialogSelect:Bb,DDialogState:_e,DDialogTime:Uu,DDialogTimes:Ub,DDialog:Ue,DDropdownBase:Ng,DDropdown:Ig,DDynamicTextGeometry:Se,DDynamicTextMeasureResultCharacter:pe,DDynamicTextMeasureResult:Oe,DDynamicTextMeasure:Me,DDynamicTextStyleWordWrap:De,DDynamicTextStyle:Te,DDynamicText:je,DExpandableHeader:Cg,DExpandable:Ag,DHtmlElementState:lr,DHtmlElement:eu,DImageBaseThemeWrapperSecondary:de,DImageBaseThemeWrapperTertiary:ge,DImageBase:Ie,DImagePiece:me,DImage:pf,DInputAndLabel:Nv,DInputBooleanButtonOff:qe,DInputBooleanButtonOn:$e,DInputBoolean:Qe,DInputInput:su,DInputIntegerAndLabel:Rg,DInputInteger:ou,DInputLabel:jv,DInputNumber:hu,DInputRealAndLabel:Iv,DInputReal:fu,DInputSearch:Ab,DInputTextAndLabel:Cv,DInputTextArea:yg,DInputText:bu,DInput:uu,DItemUpdater:eb,DLayoutClearType:yi,DLayoutDirection:Ge,DLayoutHorizontal:We,DLayoutSpace:ze,DLayoutVertical:Xe,DLayout:Ve,DLinkMenuItemId:Tf,DLinkMenu:Nf,DLinkTarget:If,DLink:kf,DLinks:Lf,DListDataImpl:db,DListDataMappedImpl:hb,DListDataSelectionMultiple:ob,DListDataSelectionNone:ab,DListDataSelectionSingle:cb,DListDataSelectionType:nb,DListItemAccessorImpl:bb,DListItemAmbient:kg,DListItemUpdater:ub,DListItem:ib,DList:Nb,DMapCoordinateEPSG3857:Lg,DMapCoordinates:xg,DMapTilePlane:_g,DMapTilePyramidImpl:Pg,DMapTileUrlBuilderKokudo:function(t,n,i){return 5<=t?"https://cyberjapandata.gsi.go.jp/xyz/pale/"+t+"/"+n+"/"+i+".png":2<=t?"https://cyberjapandata.gsi.go.jp/xyz/std/"+t+"/"+n+"/"+i+".png":"https://cyberjapandata.gsi.go.jp/xyz/earthhillshade/"+t+"/"+n+"/"+i+".png"},DMapTileUrlBuilderOsm:function(t,n,i){return"https://"+"abc"[(n+i)%3]+".tile.openstreetmap.org/"+t+"/"+n+"/"+i+".png"},DMapTileUrlBuilderOsmfj:Fg,DMapTilePyramids:Ug,DMapTile:Bg,DMenuAlign:ke,DMenuBarItem:Gg,DMenuBar:zg,DMenuContext:Tg,DMenuItemBase:Of,DMenuItemCheckIsCompatible:Sf,DMenuItemCheck:Mf,DMenuItemExpandableBody:Xf,DMenuItemExpandableHeader:Kf,DMenuItemExpandableIsCompatible:Zf,DMenuItemExpandableItemCheck:qf,DMenuItemExpandableItemLink:$f,DMenuItemExpandableItemMenu:dl,DMenuItemExpandableItemSeparator:Qf,DMenuItemExpandableItemSpace:tl,DMenuItemExpandableItemText:nl,DMenuItemExpandable:Jf,DMenuItemExpandables:Yf,DMenuItemLinkIsCompatible:Bf,DMenuItemLink:xf,DMenuItemMenuIsCompatible:Pf,DMenuItemMenuToSubMenuOptions:Ff,DMenuItemMenu:_f,DMenuItemSeparatorReflowable:Uf,DMenuItemSeparatorIsCompatible:Gf,DMenuItemSeparator:zf,DMenuItemSpaceIsCompatible:Vf,DMenuItemSpace:Hf,DMenuItemText:Ef,DMenuItem:Df,DMenuSidedContent:Hg,DMenuSidedItemCheck:rl,DMenuSidedItemExpandableItemCheck:vl,DMenuSidedItemExpandableItemLink:bl,DMenuSidedItemExpandableItemMenu:gl,DMenuSidedItemExpandableItemSeparator:ml,DMenuSidedItemExpandableItemSpace:wl,DMenuSidedItemExpandableItemText:pl,DMenuSidedItemExpandable:ll,DMenuSidedItemExpandables:fl,DMenuSidedItemLink:el,DMenuSidedItemMenu:ul,DMenuSidedItemSeparator:sl,DMenuSidedItemSpace:hl,DMenuSidedItemText:ol,DMenuSidedSelectionType:Vg,DMenuSidedSelection:Xg,DMenuSided:Kg,DMenuSideds:al,DMenu:jg,DMenus:jf,DNoteError:Yg,DNoteNoItemsFound:Jg,DNoteSearching:Zg,DNoteSmallError:kb,DNoteSmallNoItemsFound:Lb,DNoteSmallSearching:xb,DNoteSmall:yb,DNote:Rb,DNotification:qg,DPaginationDotsButton:$g,DPaginationDynamicButtons:Qg,DPaginationNavigationButton:tm,DPagination:nm,DPane:jb,DPickerColorAndAlpha:Av,DPickerColorGradientRecent:Lv,DPickerColorGradientView:xv,DPickerColorGradient:Bv,DPickerColorRecent:Rv,DPickerColor:yv,DPickerDate:Hu,DPickerDates:Wv,DPickerDatetimeButtonBack:Eu,DPickerDatetimeButtonDate:Mu,DPickerDatetimeButtonNext:Su,DPickerDatetimeLabelDate:ju,DPickerDatetimeLabel:Tu,DPickerDatetimeMask:Iu,DPickerDatetimeMasks:Cu,DPickerDatetimeRange:im,DPickerDatetimeSpace:Nu,DPickerDatetime:_u,DPickerDatetimes:Kv,DPickerTimeBoundHours:Ru,DPickerTimeBoundMinutes:yu,DPickerTimeBoundSeconds:ku,DPickerTimeBound:Au,DPickerTimeBounds:Lu,DPickerTimeRange:rm,DPickerTime:Bu,DPickerTimes:Xv,DScalarExpression:Bi,DScalarFunctions:Gi,DScrollBarHorizontal:Db,DScrollBarThumbHorizontal:Ob,DScrollBarThumbReflowableHorizontal:pb,DScrollBarThumbReflowableVertical:Eb,DScrollBarThumbVertical:Mb,DScrollBarThumb:wb,DScrollBarVertical:Sb,DScrollBar:mb,DSelectMultiple:em,DSelect:um,DShadowImpl:sm,DSliderHorizontal:vm,DSliderLabel:hm,DSliderThumb:om,DSliderTrackHorizontal:lm,DSliderTrackVertical:bm,DSliderTrack:fm,DSliderValue:am,DSliderVertical:dm,DSlider:cm,DTableBodyCellActionDialog:wm,DTableBodyCellActionMenu:pm,DTableBodyCellActionPromise:Dm,DTableBodyCellButton:Mm,DTableBodyCellCheck:Tm,DTableBodyCellColor:jm,DTableBodyCellDate:Nm,DTableBodyCellDatetime:Im,DTableBodyCellIndex:Cm,DTableBodyCellInputInteger:Am,DTableBodyCellInputReal:Rm,DTableBodyCellInputText:ym,DTableBodyCellInputTreeInput:km,DTableBodyCellInputTreeMarker:Lm,DTableBodyCellInputTree:Bm,toLinkOptions:_m,toUrl:Pm,toChecker:Fm,DTableBodyCellLink:Um,DTableBodyCellSelectDialog:mm,DTableBodyCellSelectMenu:Gm,DTableBodyCellSelectMultiple:zm,DTableBodyCellSelectPromise:Om,DTableBodyCellText:Em,DTableBodyCellTime:Hm,DTableBodyCellTree:Vm,DTableBodyCells:gm,DTableBodyRow:Km,DTableBody:nw,DTableCategoryCell:iw,DTableCategory:rw,DTableColumnType:Sm,DTableDataListFilter:Ym,DTableDataListMapped:Jm,DTableDataListSelection:qm,DTableDataListSorter:Qm,DTableDataList:tw,DTableDataSelectionType:Wm,DTableDataOrder:$m,DTableDataTreeFilter:ew,DTableDataTreeItemAccessor:hw,DTableDataTreeSelectionImpl:aw,DTableDataTreeSorter:cw,DTableDataTree:fw,DTableHeaderCellCheck:lw,DTableHeaderCell:vw,DTableHeader:bw,DTableRow:Xm,DTableState:xm,DTable:yw,DTextBase:Ne,DText:Ye,DTreeDataImpl:Vw,DTreeDataMappedImpl:Uw,DTreeDataSelectionMultiple:Gw,DTreeDataSelectionNone:Hw,DTreeDataSelectionSingle:zw,DTreeDataSelectionType:Fw,DTreeItemButton:Kw,DTreeItemNonEditable:Yw,DTreeItemState:Ww,DTreeItemText:Xw,DTreeItemUpdater:Jw,DTreeNodeAccessorImpl:Pw,DTree:Zw,DViewGestureImpl:er,DViewImpl:sr,DViewTransformImpl:ur};El();var $w=window;$w.wcardinal=$w.wcardinal||{},$w.wcardinal.ui=qw}(PIXI);
10
10
  //# sourceMappingURL=wcardinal-ui.min.js.map