leafer-draw 1.8.0 → 1.9.1

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.
package/dist/web.min.js CHANGED
@@ -1,2 +1,2 @@
1
- var LeaferUI=function(t){"use strict";const e={toURL(t,e){let s=encodeURIComponent(t);return"text"===e?s="data:text/plain;charset=utf-8,"+s:"svg"===e&&(s="data:image/svg+xml,"+s),s},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",getRealURL(t){const{prefix:s,suffix:i}=e.image;return!i||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+i),s&&"/"===t[0]&&(t=s+t),t}}},s={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=i;return e[t]?e[t]++:(e[t]=1,0)}},i=s,{round:r,pow:o,PI:n}=Math,a={within:(t,e,s)=>("object"==typeof e&&(s=e.max,e=e.min),void 0!==e&&t<e&&(t=e),void 0!==s&&t>s&&(t=s),t),fourNumber(t,e){let s;if(t instanceof Array)switch(t.length){case 4:s=void 0===e?t:[...t];break;case 2:s=[t[0],t[1],t[0],t[1]];break;case 3:s=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(s||(s=[t,t,t,t]),e)for(let t=0;t<4;t++)s[t]>e&&(s[t]=e);return s},formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),a.float(t)),getGapRotation(t,e,s=0){let i=t+s;if(e>1){const t=Math.abs(i%e);(t<1||t>e-1)&&(i=Math.round(i/e)*e)}return i-s},float(t,e){const s=void 0!==e?o(10,e):1e12;return-0===(t=r(t*s)/s)?0:t},getScaleData(t,e,s,i){if(i||(i={}),e){const t=("number"==typeof e?e:e.width||0)/s.width,r=("number"==typeof e?e:e.height||0)/s.height;i.scaleX=t||r||1,i.scaleY=r||t||1}else t&&a.assignScale(i,t);return i},assignScale(t,e){"number"==typeof e?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},randInt:h,randColor:t=>`rgba(${h(255)},${h(255)},${h(255)},${t||1})`};function h(t){return Math.round(Math.random()*t)}const l=n/180,d=2*n,c=n/2;function u(){return{x:0,y:0}}function _(){return{x:0,y:0,width:0,height:0}}function p(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:f,cos:g,acos:y,sqrt:m}=Math,{float:x}=a,w={};function v(){return Object.assign(Object.assign(Object.assign({},{a:1,b:0,c:0,d:1,e:0,f:0}),{x:0,y:0,width:0,height:0}),{scaleX:1,scaleY:1,rotation:0,skewX:0,skewY:0})}const b={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:v(),tempMatrix:{},set(t,e=1,s=0,i=0,r=1,o=0,n=0){t.a=e,t.b=s,t.c=i,t.d=r,t.e=o,t.f=n},get:p,getWorld:v,copy(t,e){t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f},translate(t,e,s){t.e+=e,t.f+=s},translateInner(t,e,s,i){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,i&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},scaleOfOuter(t,e,s,i){B.toInnerPoint(t,e,w),B.scaleOfInner(t,w,s,i)},scaleOfInner(t,e,s,i=s){B.translateInner(t,e.x,e.y),B.scale(t,s,i),B.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:i,c:r,d:o}=t,n=g(e*=l),a=f(e);t.a=s*n-i*a,t.b=s*a+i*n,t.c=r*n-o*a,t.d=r*a+o*n},rotateOfOuter(t,e,s){B.toInnerPoint(t,e,w),B.rotateOfInner(t,w,s)},rotateOfInner(t,e,s){B.translateInner(t,e.x,e.y),B.rotate(t,s),B.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:i,b:r,c:o,d:n}=t;s&&(s*=l,t.a=i+o*s,t.b=r+n*s),e&&(e*=l,t.c=o+i*e,t.d=n+r*e)},skewOfOuter(t,e,s,i){B.toInnerPoint(t,e,w),B.skewOfInner(t,w,s,i)},skewOfInner(t,e,s,i=0){B.translateInner(t,e.x,e.y),B.skew(t,s,i),B.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:i,c:r,d:o,e:n,f:a}=t;t.a=e.a*s+e.b*r,t.b=e.a*i+e.b*o,t.c=e.c*s+e.d*r,t.d=e.c*i+e.d*o,t.e=e.e*s+e.f*r+n,t.f=e.e*i+e.f*o+a},multiplyParent(t,e,s,i,r,o){let{e:n,f:a}=t;if(o&&(n+=o.scrollX,a+=o.scrollY),s||(s=t),void 0===i&&(i=1!==t.a||t.b||t.c||1!==t.d),i){const{a:i,b:o,c:n,d:a}=t;s.a=i*e.a+o*e.c,s.b=i*e.b+o*e.d,s.c=n*e.a+a*e.c,s.d=n*e.b+a*e.d,r&&(s.scaleX=e.scaleX*r.scaleX,s.scaleY=e.scaleY*r.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,r&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=n*e.a+a*e.c+e.e,s.f=n*e.b+a*e.d+e.f},divide(t,e){B.multiply(t,B.tempInvert(e))},divideParent(t,e){B.multiplyParent(t,B.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=B;return B.copy(e,t),B.invert(e),e},invert(t){const{a:e,b:s,c:i,d:r,e:o,f:n}=t;if(s||i){const a=1/(e*r-s*i);t.a=r*a,t.b=-s*a,t.c=-i*a,t.d=e*a,t.e=-(o*r-n*i)*a,t.f=-(n*e-o*s)*a}else if(1===e&&1===r)t.e=-o,t.f=-n;else{const s=1/(e*r);t.a=r*s,t.d=e*s,t.e=-o*r*s,t.f=-n*e*s}},toOuterPoint(t,e,s,i){const{x:r,y:o}=e;s||(s=e),s.x=r*t.a+o*t.c,s.y=r*t.b+o*t.d,i||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,i){const{a:r,b:o,c:n,d:a}=t,h=1/(r*a-o*n),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*n)*h,s.y=(d*r-l*o)*h,!i){const{e:e,f:i}=t;s.x-=(e*a-i*n)*h,s.y-=(i*r-e*o)*h}},setLayout(t,e,s,i,r){const{x:o,y:n,scaleX:a,scaleY:h}=e;if(void 0===r&&(r=e.rotation||e.skewX||e.skewY),r){const{rotation:s,skewX:i,skewY:r}=e,o=s*l,n=g(o),d=f(o);if(i||r){const e=i*l,s=r*l;t.a=(n+s*-d)*a,t.b=(d+s*n)*a,t.c=(e*n-d)*h,t.d=(n+e*d)*h}else t.a=n*a,t.b=d*a,t.c=-d*h,t.d=n*h}else t.a=a,t.b=0,t.c=0,t.d=h;t.e=o,t.f=n,(s=s||i)&&B.translateInner(t,-s.x,-s.y,!i)},getLayout(t,e,s,i){const{a:r,b:o,c:n,d:a,e:h,f:d}=t;let u,_,p,w,v,b=h,B=d;if(o||n){const t=r*a-o*n;if(n&&!i){u=m(r*r+o*o),_=t/u;const e=r/u;p=o>0?y(e):-y(e)}else{_=m(n*n+a*a),u=t/_;const e=n/_;p=c-(a>0?y(-e):-y(e))}const e=x(g(p)),s=f(p);u=x(u),_=x(_),w=e?x((n/_+s)/e/l,9):0,v=e?x((o/u-s)/e/l,9):0,p=x(p/l)}else u=r,_=a,p=w=v=0;return(e=s||e)&&(b+=e.x*r+e.y*n,B+=e.x*o+e.y*a,s||(b-=e.x,B-=e.y)),{x:b,y:B,scaleX:u,scaleY:_,rotation:p,skewX:w,skewY:v}},withScale(t,e,s=e){const i=t;if(!e||!s){const{a:i,b:r,c:o,d:n}=t;r||o?s=(i*n-r*o)/(e=m(i*i+r*r)):(e=i,s=n)}return i.scaleX=e,i.scaleY=s,i},reset(t){B.set(t)}},B=b,{toInnerPoint:k,toOuterPoint:S}=b,{sin:R,cos:C,abs:P,sqrt:T,atan2:L,min:I,round:E}=Math,A={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,s){t.radiusX=e,t.radiusY=void 0===s?e:s},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,s){t.x=e,t.y=s},round(t,e){t.x=e?E(t.x-.5)+.5:E(t.x),t.y=e?E(t.y-.5)+.5:E(t.y)},move(t,e,s){"object"==typeof e?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=s)},scale(t,e,s=e){t.x&&(t.x*=e),t.y&&(t.y*=s)},scaleOf(t,e,s,i=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(i-1)},rotate(t,e,s){s||(s=O.defaultPoint);const i=C(e*=l),r=R(e),o=t.x-s.x,n=t.y-s.y;t.x=s.x+o*i-n*r,t.y=s.y+o*r+n*i},tempToInnerOf(t,e){const{tempPoint:s}=O;return W(s,t),k(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=O;return W(s,t),S(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=O;return W(s,t),O.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),k(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){k(e,t,s)},toOuterOf(t,e,s){S(e,t,s)},getCenter:(t,e)=>({x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}),getCenterX:(t,e)=>t+(e-t)/2,getCenterY:(t,e)=>t+(e-t)/2,getDistance:(t,e)=>M(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,s,i){const r=P(s-t),o=P(i-e);return T(r*r+o*o)},getMinDistanceFrom:(t,e,s,i,r,o)=>I(M(t,e,s,i),M(s,i,r,o)),getAngle:(t,e)=>D(t,e)/l,getRotation:(t,e,s,i)=>(i||(i=e),O.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,i.x,i.y)/l),getRadianFrom(t,e,s,i,r,o,n,a){void 0===n&&(n=s,a=i);const h=t-s,l=e-i,d=r-n,c=o-a;return Math.atan2(h*c-l*d,h*d+l*c)},getAtan2:(t,e)=>L(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,i){const r=D(t,e);return(e=i?e:{}).x=t.x+C(r)*s,e.y=t.y+R(r)*s,e},toNumberPoints(t){let e=t;return"object"==typeof t[0]&&(e=[],t.forEach((t=>e.push(t.x,t.y)))),e},reset(t){O.reset(t)}},O=A,{getDistanceFrom:M,copy:W,getAtan2:D}=O;class F{constructor(t,e){this.set(t,e)}set(t,e){return"object"==typeof t?A.copy(this,t):A.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new F(this)}move(t,e){return A.move(this,t,e),this}scale(t,e){return A.scale(this,t,e),this}scaleOf(t,e,s){return A.scaleOf(this,t,e,s),this}rotate(t,e){return A.rotate(this,t,e),this}rotateOf(t,e){return A.rotate(this,e,t),this}getRotation(t,e,s){return A.getRotation(this,t,e,s)}toInnerOf(t,e){return A.toInnerOf(this,t,e),this}toOuterOf(t,e){return A.toOuterOf(this,t,e),this}getCenter(t){return new F(A.getCenter(this,t))}getDistance(t){return A.getDistance(this,t)}getDistancePoint(t,e,s){return new F(A.getDistancePoint(this,t,e,s))}getAngle(t){return A.getAngle(this,t)}getAtan2(t){return A.getAtan2(this,t)}reset(){return A.reset(this),this}}const z=new F;class U{constructor(t,e,s,i,r,o){this.set(t,e,s,i,r,o)}set(t,e,s,i,r,o){return"object"==typeof t?b.copy(this,t):b.set(this,t,e,s,i,r,o),this}setWith(t){return b.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:s,d:i,e:r,f:o}=this;return{a:t,b:e,c:s,d:i,e:r,f:o}}clone(){return new U(this)}translate(t,e){return b.translate(this,t,e),this}translateInner(t,e){return b.translateInner(this,t,e),this}scale(t,e){return b.scale(this,t,e),this}scaleWith(t,e){return b.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}scaleOfOuter(t,e,s){return b.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return b.scaleOfInner(this,t,e,s),this}rotate(t){return b.rotate(this,t),this}rotateOfOuter(t,e){return b.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return b.rotateOfInner(this,t,e),this}skew(t,e){return b.skew(this,t,e),this}skewOfOuter(t,e,s){return b.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return b.skewOfInner(this,t,e,s),this}multiply(t){return b.multiply(this,t),this}multiplyParent(t){return b.multiplyParent(this,t),this}divide(t){return b.divide(this,t),this}divideParent(t){return b.divideParent(this,t),this}invert(){return b.invert(this),this}invertWith(){return b.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){b.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){b.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return b.setLayout(this,t,e,s),this}getLayout(t,e,s){return b.getLayout(this,t,e,s)}withScale(t,e){return b.withScale(this,t,e)}reset(){b.reset(this)}}const N=new U,Y={tempPointBounds:{},setPoint(t,e,s){t.minX=t.maxX=e,t.minY=t.maxY=s},addPoint(t,e,s){t.minX=e<t.minX?e:t.minX,t.minY=s<t.minY?s:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=s>t.maxY?s:t.maxY},addBounds(t,e,s,i,r){X(t,e,s),X(t,e+i,s+r)},copy(t,e){t.minX=e.minX,t.minY=e.minY,t.maxX=e.maxX,t.maxY=e.maxY},addPointBounds(t,e){t.minX=e.minX<t.minX?e.minX:t.minX,t.minY=e.minY<t.minY?e.minY:t.minY,t.maxX=e.maxX>t.maxX?e.maxX:t.maxX,t.maxY=e.maxY>t.maxY?e.maxY:t.maxY},toBounds(t,e){e.x=t.minX,e.y=t.minY,e.width=t.maxX-t.minX,e.height=t.maxY-t.minY}},{addPoint:X}=Y;var j,H;t.Direction4=void 0,(j=t.Direction4||(t.Direction4={}))[j.top=0]="top",j[j.right=1]="right",j[j.bottom=2]="bottom",j[j.left=3]="left",t.Direction9=void 0,(H=t.Direction9||(t.Direction9={}))[H.topLeft=0]="topLeft",H[H.top=1]="top",H[H.topRight=2]="topRight",H[H.right=3]="right",H[H.bottomRight=4]="bottomRight",H[H.bottom=5]="bottom",H[H.bottomLeft=6]="bottomLeft",H[H.left=7]="left",H[H.center=8]="center",H[H["top-left"]=0]="top-left",H[H["top-right"]=2]="top-right",H[H["bottom-right"]=4]="bottom-right",H[H["bottom-left"]=6]="bottom-left";const G=[{x:0,y:0},{x:.5,y:0},{x:1,y:0},{x:1,y:.5},{x:1,y:1},{x:.5,y:1},{x:0,y:1},{x:0,y:.5},{x:.5,y:.5}];G.forEach((t=>t.type="percent"));const V={directionData:G,tempPoint:{},get:q,toPoint(t,e,s,i,r,o){const n=q(t);s.x=n.x,s.y=n.y,"percent"===n.type&&(s.x*=e.width,s.y*=e.height,r&&(o||(s.x-=r.x,s.y-=r.y),n.x&&(s.x-=1===n.x?r.width:.5===n.x?n.x*r.width:0),n.y&&(s.y-=1===n.y?r.height:.5===n.y?n.y*r.height:0))),i||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s)=>(s||(s={}),V.toPoint(t,e,s,!0),s)};function q(e){return"string"==typeof e?G[t.Direction9[e]]:e}const{toPoint:Q}=V,J={toPoint(t,e,s,i,r,o){Q(t,s,i,r,e,o)}},{tempPointBounds:$,setPoint:Z,addPoint:K,toBounds:tt}=Y,{toOuterPoint:et}=b,{float:st,fourNumber:it}=a,{floor:rt,ceil:ot}=Math;let nt,at,ht,lt;const dt={},ct={},ut={},_t={tempBounds:ut,set(t,e=0,s=0,i=0,r=0){t.x=e,t.y=s,t.width=i,t.height=r},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,i,r){const{x:o,y:n,width:a,height:h}=e;if(s instanceof Array){const e=it(s);i?pt.set(t,o+e[3],n+e[0],a-e[1]-e[3],h-e[2]-e[0]):pt.set(t,o-e[3],n-e[0],a+e[1]+e[3],h+e[2]+e[0])}else i&&(s=-s),pt.set(t,o-s,n-s,a+2*s,h+2*s);r&&("width"===r?(t.y=n,t.height=h):(t.x=o,t.width=a))},minX:t=>t.width>0?t.x:t.x+t.width,minY:t=>t.height>0?t.y:t.y+t.height,maxX:t=>t.width>0?t.x+t.width:t.x,maxY:t=>t.height>0?t.y+t.height:t.y,move(t,e,s){t.x+=e,t.y+=s},getByMove:(t,e,s)=>(t=Object.assign({},t),pt.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?gt(e,t):e=t,s?(e.offsetX=-(pt.maxX(s)-t.x),e.offsetY=-(pt.maxY(s)-t.y)):(e.offsetX=t.x+t.width,e.offsetY=t.y+t.height),pt.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e,i){i||A.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,i=s){A.scaleOf(t,e,s,i),t.width*=s,t.height*=i},tempToOuterOf:(t,e)=>(pt.copy(ut,t),pt.toOuterOf(ut,e),ut),getOuterOf:(t,e)=>(t=Object.assign({},t),pt.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:i,d:r}=e;i>0?(s.width=t.width*i,s.x=e.e+t.x*i):(s.width=t.width*-i,s.x=e.e+t.x*i-s.width),r>0?(s.height=t.height*r,s.y=e.f+t.y*r):(s.height=t.height*-r,s.y=e.f+t.y*r-s.height)}else dt.x=t.x,dt.y=t.y,et(e,dt,ct),Z($,ct.x,ct.y),dt.x=t.x+t.width,et(e,dt,ct),K($,ct.x,ct.y),dt.y=t.y+t.height,et(e,dt,ct),K($,ct.x,ct.y),dt.x=t.x,et(e,dt,ct),K($,ct.x,ct.y),tt($,s)},toInnerOf(t,e,s){s||(s=t),pt.move(s,-e.e,-e.f),pt.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const i=Math.min(s,pt.getFitScale(t,e));return new U(i,0,0,i,-e.x*i,-e.y*i)},getFitScale(t,e,s){const i=t.width/e.width,r=t.height/e.height;return s?Math.max(i,r):Math.min(i,r)},put(t,e,s="center",i=1,r=!0,o){o||(o=e),"string"==typeof i&&(i=pt.getFitScale(t,e,"cover"===i)),ut.width=r?e.width*=i:e.width*i,ut.height=r?e.height*=i:e.height*i,J.toPoint(s,ut,t,o,!0,!0)},getSpread(t,e,s){const i={};return pt.copyAndSpread(i,t,e,!1,s),i},spread(t,e,s){pt.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){pt.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=rt(t.x),t.y=rt(t.y),t.width=e>t.x?ot(t.width+e-t.x):ot(t.width),t.height=s>t.y?ot(t.height+s-t.y):ot(t.height)},unsign(t){t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height)},float(t,e){t.x=st(t.x,e),t.y=st(t.y,e),t.width=st(t.width,e),t.height=st(t.height,e)},add(t,e,s){nt=t.x+t.width,at=t.y+t.height,ht=e.x,lt=e.y,s||(ht+=e.width,lt+=e.height),nt=nt>ht?nt:ht,at=at>lt?at:lt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=nt-t.x,t.height=at-t.y},addList(t,e){pt.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){pt.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){pt.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,i=!1){let r,o=!0;for(let n=0,a=e.length;n<a;n++)r=s?s(e[n]):e[n],r&&(r.width||r.height)&&(o?(o=!1,i||gt(t,r)):ft(t,r));o&&pt.reset(t)},setPoints(t,e){e.forEach(((t,e)=>0===e?Z($,t.x,t.y):K($,t.x,t.y))),tt($,t)},setPoint(t,e){pt.set(t,e.x,e.y)},addPoint(t,e){ft(t,e,!0)},getPoints(t){const{x:e,y:s,width:i,height:r}=t;return[{x:e,y:s},{x:e+i,y:s},{x:e+i,y:s+r},{x:e,y:s+r}]},hitRadiusPoint:(t,e,s)=>(s&&(e=A.tempToInnerRadiusPointOf(e,s)),e.x>=t.x-e.radiusX&&e.x<=t.x+t.width+e.radiusX&&e.y>=t.y-e.radiusY&&e.y<=t.y+t.height+e.radiusY),hitPoint:(t,e,s)=>(s&&(e=A.tempToInnerOf(e,s)),e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height),hit:(t,e,s)=>(s&&(e=pt.tempToOuterOf(e,s)),!(t.y+t.height<e.y||e.y+e.height<t.y||t.x+t.width<e.x||e.x+e.width<t.x)),includes:(t,e,s)=>(s&&(e=pt.tempToOuterOf(e,s)),t.x<=e.x&&t.y<=e.y&&t.x+t.width>=e.x+e.width&&t.y+t.height>=e.y+e.height),getIntersectData(t,e,s){if(s&&(e=pt.tempToOuterOf(e,s)),!pt.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:i,y:r,width:o,height:n}=e;return nt=i+o,at=r+n,ht=t.x+t.width,lt=t.y+t.height,i=i>t.x?i:t.x,r=r>t.y?r:t.y,nt=nt<ht?nt:ht,at=at<lt?at:lt,o=nt-i,n=at-r,{x:i,y:r,width:o,height:n}},intersect(t,e,s){pt.copy(t,pt.getIntersectData(t,e,s))},isSame:(t,e)=>t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEmpty:t=>0===t.x&&0===t.y&&0===t.width&&0===t.height,reset(t){pt.set(t)}},pt=_t,{add:ft,copy:gt}=pt;class yt{get minX(){return _t.minX(this)}get minY(){return _t.minY(this)}get maxX(){return _t.maxX(this)}get maxY(){return _t.maxY(this)}constructor(t,e,s,i){this.set(t,e,s,i)}set(t,e,s,i){return"object"==typeof t?_t.copy(this,t):_t.set(this,t,e,s,i),this}get(){const{x:t,y:e,width:s,height:i}=this;return{x:t,y:e,width:s,height:i}}clone(){return new yt(this)}move(t,e){return _t.move(this,t,e),this}scale(t,e,s){return _t.scale(this,t,e,s),this}scaleOf(t,e,s){return _t.scaleOf(this,t,e,s),this}toOuterOf(t,e){return _t.toOuterOf(this,t,e),this}toInnerOf(t,e){return _t.toInnerOf(this,t,e),this}getFitMatrix(t,e){return _t.getFitMatrix(this,t,e)}put(t,e,s){_t.put(this,t,e,s)}spread(t,e){return _t.spread(this,t,e),this}shrink(t,e){return _t.shrink(this,t,e),this}ceil(){return _t.ceil(this),this}unsign(){return _t.unsign(this),this}float(t){return _t.float(this,t),this}add(t){return _t.add(this,t),this}addList(t){return _t.setList(this,t,!0),this}setList(t){return _t.setList(this,t),this}addListWithFn(t,e){return _t.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return _t.setListWithFn(this,t,e),this}setPoint(t){return _t.setPoint(this,t),this}setPoints(t){return _t.setPoints(this,t),this}addPoint(t){return _t.addPoint(this,t),this}getPoints(){return _t.getPoints(this)}hitPoint(t,e){return _t.hitPoint(this,t,e)}hitRadiusPoint(t,e){return _t.hitRadiusPoint(this,t,e)}hit(t,e){return _t.hit(this,t,e)}includes(t,e){return _t.includes(this,t,e)}intersect(t,e){return _t.intersect(this,t,e),this}getIntersect(t,e){return new yt(_t.getIntersectData(this,t,e))}isSame(t){return _t.isSame(this,t)}isEmpty(){return _t.isEmpty(this)}reset(){_t.reset(this)}}const mt=new yt;class xt{constructor(t,e,s,i,r,o){"object"==typeof t?this.copy(t):this.set(t,e,s,i,r,o)}set(t=0,e=0,s=0,i=0,r=0,o=0){this.top=t,this.right=e,this.bottom=s,this.left=i,this.width=r,this.height=o}copy(t){const{top:e,right:s,bottom:i,left:r,width:o,height:n}=t;this.set(e,s,i,r,o,n)}getBoundsFrom(t){const{top:e,right:s,bottom:i,left:r,width:o,height:n}=this;return new yt(r,e,o||t.width-r-s,n||t.height-e-i)}}const wt={0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,".":1,e:1,E:1},{randColor:vt}=a;class bt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new bt(t)}static set filter(t){this.filterList=Bt(t)}static set exclude(t){this.excludeList=Bt(t)}static drawRepaint(t,e){const s=vt();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const i="hit"===bt.showBounds,r=t.__nowWorld,o=vt();i&&(e.setWorld(r),t.__drawHitPath(e),e.fillStyle=o.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(o,2),i?e.stroke():e.strokeWorld(r,o)}log(...t){if(kt.enable){if(kt.filterList.length&&kt.filterList.every((t=>t!==this.name)))return;if(kt.excludeList.length&&kt.excludeList.some((t=>t===this.name)))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){kt.enable&&this.warn(...t)}warn(...t){kt.showWarn&&console.warn(this.name,...t)}repeat(t,...e){this.repeatMap[t]||(this.warn("repeat:"+t,...e),this.repeatMap[t]=!0)}error(...t){try{throw new Error}catch(e){console.error(this.name,...t,e)}}}function Bt(t){return t?"string"==typeof t&&(t=[t]):t=[],t}bt.filterList=[],bt.excludeList=[],bt.showWarn=!0;const kt=bt,St=bt.get("RunTime"),Rt={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const i=s.create(s.RUNTIME);return Ct.currentId=Ct.idMap[i]=e?performance.now():Date.now(),Ct.currentName=Ct.nameMap[i]=t,Ct.nameToIdMap[t]=i,i},end(t,e){const s=Ct.idMap[t],i=Ct.nameMap[t],r=e?(performance.now()-s)/1e3:Date.now()-s;Ct.idMap[t]=Ct.nameMap[t]=Ct.nameToIdMap[i]=void 0,St.log(i,r,"ms")},endOfName(t,e){const s=Ct.nameToIdMap[t];void 0!==s&&Ct.end(s,e)}},Ct=Rt,Pt=[],Tt={list:{},add(t,...e){this.list[t]=!0,Pt.push(...e)},has(t,e){const s=this.list[t];return!s&&e&&this.need(t),s},need(t){console.error("please install and import plugin: "+(t.includes("-x")?"":"@leafer-in/")+t)}};setTimeout((()=>Pt.forEach((t=>Tt.has(t,!0)))));const Lt={editor:t=>Tt.need("editor")},It=bt.get("UICreator"),Et={list:{},register(t){const{__tag:e}=t.prototype;At[e]&&It.repeat(e),At[e]=t},get(t,e,s,i,r,o){At[t]||It.error("not register "+t);const n=new At[t](e);return void 0!==s&&(n.x=s,i&&(n.y=i),r&&(n.width=r),o&&(n.height=o)),n}},{list:At}=Et,Ot=bt.get("EventCreator"),Mt={nameList:{},register(t){let e;Object.keys(t).forEach((s=>{e=t[s],"string"==typeof e&&(Wt[e]&&Ot.repeat(e),Wt[e]=t)}))},changeName(t,e){const s=Wt[t];if(s){const i=Object.keys(s).find((e=>s[e]===t));i&&(s[i]=e,Wt[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new Wt[t](...e)},{nameList:Wt}=Mt;class Dt{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:s}=this;for(let i=0,r=s.length;i<r;i++)if(e=s[i],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const i=Lt.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,i=this.list.length;s<i;s++)t=this.list[s],t.recycled?t.destroy():e.push(t);this.list=e}clear(){this.list.forEach((t=>{t.destroy()})),this.list.length=0}destroy(){this.clear()}}const Ft={default:(t,e)=>(zt(e,t),zt(t,e),t),assign(t,e,s){let i;Object.keys(e).forEach((r=>{var o,n;if(i=e[r],(null==i?void 0:i.constructor)===Object&&(null===(o=t[r])||void 0===o?void 0:o.constructor)===Object)return zt(t[r],e[r],s&&s[r]);s&&r in s?(null===(n=s[r])||void 0===n?void 0:n.constructor)===Object&&zt(t[r]={},e[r],s[r]):t[r]=e[r]}))},copyAttrs:(t,e,s)=>(s.forEach((s=>{void 0!==e[s]&&(t[s]=e[s])})),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,i=t.length;s<i;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:zt}=Ft;class Ut{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __blendMode(){if(this.eraser&&"path"!==this.eraser)return"destination-out";const{blendMode:t}=this;return"pass-through"===t?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const e=this.__input[t];if(void 0!==e)return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let s;for(let i in this)"_"!==i[0]&&(s=e?e[i]:void 0,t[i]=void 0===s?this[i]:s);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(void 0!==e)return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&void 0!==this.__input[t]&&(this.__input[t]=void 0)}__getInputData(t,e){const s={};if(t)if(t instanceof Array)for(let e of t)s[e]=this.__getInput(e);else for(let e in t)s[e]=this.__getInput(e);else{let t,e,{__input:i}=this;s.tag=this.__leaf.tag;for(let r in this)if("_"!==r[0]&&(t=this["_"+r],void 0!==t)){if("path"===r&&!this.__pathInputed)continue;e=i?i[r]:void 0,s[r]=void 0===e?t:e}}if(e&&e.matrix){const{a:t,b:e,c:i,d:r,e:o,f:n}=this.__leaf.__localMatrix;s.matrix={a:t,b:e,c:i,d:r,e:o,f:n}}return s}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null}}var Nt;t.Answer=void 0,(Nt=t.Answer||(t.Answer={}))[Nt.No=0]="No",Nt[Nt.Yes=1]="Yes",Nt[Nt.NoAndSkip=2]="NoAndSkip",Nt[Nt.YesAndSkip=3]="YesAndSkip";function Yt(t){return"{}"===JSON.stringify(t)}function Xt(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n}function jt(t,e,s,i){return new(s||(s=Promise))((function(r,o){function n(t){try{h(i.next(t))}catch(t){o(t)}}function a(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(n,a)}h((i=i.apply(t,e||[])).next())}))}function Ht(t){return(e,s)=>{t||(t=s);const i={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===s&&(i.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,s,i)}}"function"==typeof SuppressedError&&SuppressedError;const Gt=[];function Vt(){return(t,e)=>{Gt.push(e)}}const qt=[];class Qt{set blendMode(t){"normal"===t&&(t="source-over"),this.context.globalCompositeOperation=t}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(t){this.context.setLineDash(t||qt)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;Gt.forEach((e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))})),this.textBaseline="alphabetic"}setTransform(t,e,s,i,r,o){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,i,r,o){"object"==typeof t?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,i,r,o)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,i){}strokeRect(t,e,s,i){}clearRect(t,e,s,i){}drawImage(t,e,s,i,r,o,n,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/i*a;i+=e,e=0,o+=t,a-=t}if(s<0){const t=-s/r*h;r+=s,s=0,n+=t,h-=t}this.context.drawImage(t,e,s,i,r,o,n,a,h);break;case 5:this.context.drawImage(t,e,s,i,r);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,i,r,o){}quadraticCurveTo(t,e,s,i){}closePath(){}arc(t,e,s,i,r,o){}arcTo(t,e,s,i,r){}ellipse(t,e,s,i,r,o,n,a){}rect(t,e,s,i){}roundRect(t,e,s,i,r){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,i){}createPattern(t,e){}createRadialGradient(t,e,s,i,r,o){}fillText(t,e,s,i){}measureText(t){}strokeText(t,e,s,i){}destroy(){this.context=null}}Xt([Ht("imageSmoothingEnabled")],Qt.prototype,"smooth",void 0),Xt([Ht("imageSmoothingQuality")],Qt.prototype,"smoothLevel",void 0),Xt([Ht("globalAlpha")],Qt.prototype,"opacity",void 0),Xt([Ht()],Qt.prototype,"fillStyle",void 0),Xt([Ht()],Qt.prototype,"strokeStyle",void 0),Xt([Ht("lineWidth")],Qt.prototype,"strokeWidth",void 0),Xt([Ht("lineCap")],Qt.prototype,"strokeCap",void 0),Xt([Ht("lineJoin")],Qt.prototype,"strokeJoin",void 0),Xt([Ht("lineDashOffset")],Qt.prototype,"dashOffset",void 0),Xt([Ht()],Qt.prototype,"miterLimit",void 0),Xt([Ht()],Qt.prototype,"shadowBlur",void 0),Xt([Ht()],Qt.prototype,"shadowColor",void 0),Xt([Ht()],Qt.prototype,"shadowOffsetX",void 0),Xt([Ht()],Qt.prototype,"shadowOffsetY",void 0),Xt([Ht()],Qt.prototype,"filter",void 0),Xt([Ht()],Qt.prototype,"font",void 0),Xt([Ht()],Qt.prototype,"fontKerning",void 0),Xt([Ht()],Qt.prototype,"fontStretch",void 0),Xt([Ht()],Qt.prototype,"fontVariantCaps",void 0),Xt([Ht()],Qt.prototype,"textAlign",void 0),Xt([Ht()],Qt.prototype,"textBaseline",void 0),Xt([Ht()],Qt.prototype,"textRendering",void 0),Xt([Ht()],Qt.prototype,"wordSpacing",void 0),Xt([Ht()],Qt.prototype,"letterSpacing",void 0),Xt([Ht()],Qt.prototype,"direction",void 0),Xt([Vt()],Qt.prototype,"setTransform",null),Xt([Vt()],Qt.prototype,"resetTransform",null),Xt([Vt()],Qt.prototype,"getTransform",null),Xt([Vt()],Qt.prototype,"save",null),Xt([Vt()],Qt.prototype,"restore",null),Xt([Vt()],Qt.prototype,"translate",null),Xt([Vt()],Qt.prototype,"scale",null),Xt([Vt()],Qt.prototype,"rotate",null),Xt([Vt()],Qt.prototype,"fill",null),Xt([Vt()],Qt.prototype,"stroke",null),Xt([Vt()],Qt.prototype,"clip",null),Xt([Vt()],Qt.prototype,"fillRect",null),Xt([Vt()],Qt.prototype,"strokeRect",null),Xt([Vt()],Qt.prototype,"clearRect",null),Xt([Vt()],Qt.prototype,"beginPath",null),Xt([Vt()],Qt.prototype,"moveTo",null),Xt([Vt()],Qt.prototype,"lineTo",null),Xt([Vt()],Qt.prototype,"bezierCurveTo",null),Xt([Vt()],Qt.prototype,"quadraticCurveTo",null),Xt([Vt()],Qt.prototype,"closePath",null),Xt([Vt()],Qt.prototype,"arc",null),Xt([Vt()],Qt.prototype,"arcTo",null),Xt([Vt()],Qt.prototype,"ellipse",null),Xt([Vt()],Qt.prototype,"rect",null),Xt([Vt()],Qt.prototype,"roundRect",null),Xt([Vt()],Qt.prototype,"createConicGradient",null),Xt([Vt()],Qt.prototype,"createLinearGradient",null),Xt([Vt()],Qt.prototype,"createPattern",null),Xt([Vt()],Qt.prototype,"createRadialGradient",null),Xt([Vt()],Qt.prototype,"fillText",null),Xt([Vt()],Qt.prototype,"measureText",null),Xt([Vt()],Qt.prototype,"strokeText",null);const{copy:Jt,multiplyParent:$t}=b,{round:Zt}=Math,Kt={width:1,height:1,pixelRatio:1},te=["width","height","pixelRatio"];class ee extends Qt{get width(){return this.size.width}get height(){return this.size.height}get pixelRatio(){return this.size.pixelRatio}get pixelWidth(){return this.width*this.pixelRatio||0}get pixelHeight(){return this.height*this.pixelRatio||0}get pixelSnap(){return this.config.pixelSnap}set pixelSnap(t){this.config.pixelSnap=t}get allowBackgroundColor(){return this.view&&this.parentView}constructor(t,i){super(),this.size={},this.worldTransform={},t||(t=Kt),this.manager=i,this.innerId=s.create(s.CNAVAS);const{width:r,height:o,pixelRatio:n}=t;this.autoLayout=!r||!o,this.size.pixelRatio=n|e.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let s;this.context&&!this.unreal&&e&&this.width&&(s=this.getSameCanvas(),s.copyWorld(this));const i=this.size;Ft.copyAttrs(i,t,te),te.forEach((t=>i[t]||(i[t]=1))),this.bounds=new yt(0,0,this.width,this.height),this.context&&!this.unreal&&(this.updateViewSize(),this.smooth=this.config.smooth),this.updateClientBounds(),this.context&&!this.unreal&&s&&(this.clearWorld(s.bounds),this.copyWorld(s),s.recycle())}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s,pixelSnap:i}=this,r=this.worldTransform;e&&$t(t,e,r),r.a=t.a*s,r.b=t.b*s,r.c=t.c*s,r.d=t.d*s,r.e=t.e*s,r.f=t.f*s,i&&(t.half&&t.half*s%2?(r.e=Zt(r.e-.5)+.5,r.f=Zt(r.f-.5)+.5):(r.e=Zt(r.e),r.f=Zt(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,s,i){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,i)}setStrokeOptions(t,e){let{strokeCap:s,strokeJoin:i,dashPattern:r,dashOffset:o,miterLimit:n}=t;e&&(e.strokeCap&&(s=e.strokeCap),e.strokeJoin&&(i=e.strokeJoin),void 0!==e.dashPattern&&(r=e.dashPattern),void 0!==e.dashOffset&&(o=e.dashOffset),e.miterLimit&&(n=e.miterLimit)),this.strokeCap=s,this.strokeJoin=i,this.dashPattern=r,this.dashOffset=o,this.miterLimit=n}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,e){return!0}hitStroke(t,e){return!0}hitPixel(t,e,s=1){return!0}setWorldShadow(t,e,s,i){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=e*r,this.shadowBlur=s*r,this.shadowColor=i||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,i){if(i&&(this.blendMode=i),e){const{pixelRatio:i}=this;s||(s=e),this.drawImage(t.view,e.x*i,e.y*i,e.width*i,e.height*i,s.x*i,s.y*i,s.width*i,s.height*i)}else this.drawImage(t.view,0,0);i&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,i){if(i&&(this.blendMode=i),e.b||e.c)this.save(),this.resetTransform(),this.copyWorld(t,e,_t.tempToOuterOf(s,e)),this.restore();else{const{pixelRatio:i}=this;this.drawImage(t.view,e.x*i,e.y*i,e.width*i,e.height*i,s.x,s.y,s.width,s.height)}i&&(this.blendMode="source-over")}copyWorldByReset(t,e,s,i,r){this.resetTransform(),this.copyWorld(t,e,s,i),r||this.useWorldTransform()}useGrayscaleAlpha(t){let e,s;this.setTempBounds(t,!0,!0);const{context:i}=this,r=i.getImageData(mt.x,mt.y,mt.width,mt.height),{data:o}=r;for(let t=0,i=o.length;t<i;t+=4)s=.299*o[t]+.587*o[t+1]+.114*o[t+2],(e=o[t+3])&&(o[t+3]=255===e?s:e*(s/255));i.putImageData(r,mt.x,mt.y)}useMask(t,e,s){this.copyWorld(t,e,s,"destination-in")}useEraser(t,e,s){this.copyWorld(t,e,s,"destination-out")}fillWorld(t,e,s){s&&(this.blendMode=s),this.fillStyle=e,this.setTempBounds(t),this.fillRect(mt.x,mt.y,mt.width,mt.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempBounds(t),this.strokeRect(mt.x,mt.y,mt.width,mt.height),s&&(this.blendMode="source-over")}clipWorld(t,e){this.beginPath(),this.setTempBounds(t,e),this.rect(mt.x,mt.y,mt.width,mt.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e){this.setTempBounds(t,e),this.clearRect(mt.x,mt.y,mt.width,mt.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempBounds(t,e,s){mt.set(t),s&&mt.intersect(this.bounds),mt.scale(this.pixelRatio),e&&mt.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:s,pixelSnap:i}=this,r=this.manager?this.manager.get(s):Lt.canvas(Object.assign({},s));return r.save(),t&&(Jt(r.worldTransform,this.worldTransform),r.useWorldTransform()),e&&(r.smooth=this.smooth),r.pixelSnap!==i&&(r.pixelSnap=i),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t,!0):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}}const se={creator:{},parse(t,e){},convertToCanvasData(t,e){}},ie={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},re=Object.assign({M:1,m:10,L:2,l:20,H:3,h:30,V:4,v:40,C:5,c:50,S:6,s:60,Q:7,q:70,T:8,t:80,A:9,a:90,Z:11,z:11,R:12},ie),oe={M:3,m:3,L:3,l:3,H:2,h:2,V:2,v:2,C:7,c:7,S:5,s:5,Q:5,q:5,T:3,t:3,A:8,a:8,Z:1,z:1,N:5,D:9,X:6,G:9,F:5,O:7,P:4,U:6},ne={m:10,l:20,H:3,h:30,V:4,v:40,c:50,S:6,s:60,q:70,T:8,t:80,A:9,a:90},ae=Object.assign(Object.assign({},ne),ie),he=re,le={};for(let t in he)le[he[t]]=t;const de={};for(let t in he)de[he[t]]=oe[t];const ce={drawRoundRect(t,e,s,i,r,o){const n=a.fourNumber(o,Math.min(i/2,r/2)),h=e+i,l=s+r;n[0]?t.moveTo(e+n[0],s):t.moveTo(e,s),n[1]?t.arcTo(h,s,h,l,n[1]):t.lineTo(h,s),n[2]?t.arcTo(h,l,e,l,n[2]):t.lineTo(h,l),n[3]?t.arcTo(e,l,e,s,n[3]):t.lineTo(e,l),n[0]?t.arcTo(e,s,h,s,n[0]):t.lineTo(e,s)}},{sin:ue,cos:_e,atan2:pe,ceil:fe,abs:ge,PI:ye,sqrt:me,pow:xe}=Math,{setPoint:we,addPoint:ve}=Y,{set:be,toNumberPoints:Be}=A,{M:ke,L:Se,C:Re,Q:Ce,Z:Pe}=re,Te={},Le={points(t,e,s,i){let r=Be(e);if(t.push(ke,r[0],r[1]),s&&r.length>5){let e,o,n,a,h,l,d,c,u,_,p,f,g,y=r.length;const m=!0===s?.5:s;i&&(r=[r[y-2],r[y-1],...r,r[0],r[1],r[2],r[3]],y=r.length);for(let s=2;s<y-2;s+=2)e=r[s-2],o=r[s-1],n=r[s],a=r[s+1],h=r[s+2],l=r[s+3],p=me(xe(n-e,2)+xe(a-o,2)),f=me(xe(h-n,2)+xe(l-a,2)),(p||f)&&(g=p+f,p=m*p/g,f=m*f/g,h-=e,l-=o,d=n-p*h,c=a-p*l,2===s?i||t.push(Ce,d,c,n,a):t.push(Re,u,_,d,c,n,a),u=n+f*h,_=a+f*l);i||t.push(Ce,u,_,r[y-2],r[y-1])}else for(let e=2,s=r.length;e<s;e+=2)t.push(Se,r[e],r[e+1]);i&&t.push(Pe)},rect(t,e,s,i,r){se.creator.path=t,se.creator.moveTo(e,s).lineTo(e+i,s).lineTo(e+i,s+r).lineTo(e,s+r).lineTo(e,s)},roundRect(t,e,s,i,r,o){se.creator.path=[],ce.drawRoundRect(se.creator,e,s,i,r,o),t.push(...se.convertToCanvasData(se.creator.path,!0))},arcTo(t,e,s,i,r,o,n,a,h,u,_){const p=i-e,f=r-s,g=o-i,y=n-r;let m=pe(f,p),x=pe(y,g),w=x-m;if(w<0&&(w+=d),w===ye||ge(p+f)<1e-12||ge(g+y)<1e-12)return t&&t.push(Se,i,r),h&&(we(h,e,s),ve(h,i,r)),_&&be(_,e,s),void(u&&be(u,i,r));const v=p*y-g*f<0,b=v?-1:1,B=a/_e(w/2),k=i+B*_e(m+w/2+c*b),S=r+B*ue(m+w/2+c*b);return m-=c*b,x-=c*b,Ae(t,k,S,a,a,0,m/l,x/l,v,h,u,_)},arc:(t,e,s,i,r,o,n,a,h,l)=>Ae(t,e,s,i,i,0,r,o,n,a,h,l),ellipse(t,e,s,i,r,o,n,a,h,u,_,p){const f=o*l,g=ue(f),y=_e(f);let m=n*l,x=a*l;m>ye&&(m-=d),x<0&&(x+=d);let w=x-m;w<0?w+=d:w>d&&(w-=d),h&&(w-=d);const v=fe(ge(w/c)),b=w/v,B=ue(b/4),k=8/3*B*B/ue(b/2);x=m+b;let S,R,C,P,T,L,I,E,A=_e(m),O=ue(m),M=C=y*i*A-g*r*O,W=P=g*i*A+y*r*O,D=e+C,F=s+P;t&&t.push(t.length?Se:ke,D,F),u&&we(u,D,F),p&&be(p,D,F);for(let o=0;o<v;o++)S=_e(x),R=ue(x),C=y*i*S-g*r*R,P=g*i*S+y*r*R,T=e+M-k*(y*i*O+g*r*A),L=s+W-k*(g*i*O-y*r*A),I=e+C+k*(y*i*R+g*r*S),E=s+P+k*(g*i*R-y*r*S),t&&t.push(Re,T,L,I,E,e+C,s+P),u&&Ee(e+M,s+W,T,L,I,E,e+C,s+P,u,!0),M=C,W=P,A=S,O=R,m=x,x+=b;_&&be(_,e+C,s+P)},quadraticCurveTo(t,e,s,i,r,o,n){t.push(Re,(e+2*i)/3,(s+2*r)/3,(o+2*i)/3,(n+2*r)/3,o,n)},toTwoPointBoundsByQuadraticCurve(t,e,s,i,r,o,n,a){Ee(t,e,(t+2*s)/3,(e+2*i)/3,(r+2*s)/3,(o+2*i)/3,r,o,n,a)},toTwoPointBounds(t,e,s,i,r,o,n,a,h,l){const d=[];let c,u,_,p,f,g,y,m,x=t,w=s,v=r,b=n;for(let t=0;t<2;++t)if(1==t&&(x=e,w=i,v=o,b=a),c=-3*x+9*w-9*v+3*b,u=6*x-12*w+6*v,_=3*w-3*x,Math.abs(c)<1e-12){if(Math.abs(u)<1e-12)continue;p=-_/u,0<p&&p<1&&d.push(p)}else y=u*u-4*_*c,m=Math.sqrt(y),y<0||(f=(-u+m)/(2*c),0<f&&f<1&&d.push(f),g=(-u-m)/(2*c),0<g&&g<1&&d.push(g));l?ve(h,t,e):we(h,t,e),ve(h,n,a);for(let l=0,c=d.length;l<c;l++)Ie(d[l],t,e,s,i,r,o,n,a,Te),ve(h,Te.x,Te.y)},getPointAndSet(t,e,s,i,r,o,n,a,h,l){const d=1-t,c=d*d*d,u=3*d*d*t,_=3*d*t*t,p=t*t*t;l.x=c*e+u*i+_*o+p*a,l.y=c*s+u*r+_*n+p*h},getPoint(t,e,s,i,r,o,n,a,h){const l={};return Ie(t,e,s,i,r,o,n,a,h,l),l},getDerivative(t,e,s,i,r){const o=1-t;return 3*o*o*(s-e)+6*o*t*(i-s)+3*t*t*(r-i)}},{getPointAndSet:Ie,toTwoPointBounds:Ee,ellipse:Ae}=Le,{sin:Oe,cos:Me,sqrt:We,atan2:De}=Math,{ellipse:Fe}=Le,ze={ellipticalArc(t,s,i,r,o,n,a,h,c,u,_){const p=(c-s)/2,f=(u-i)/2,g=n*l,y=Oe(g),m=Me(g),x=-m*p-y*f,w=-m*f+y*p,v=r*r,b=o*o,B=w*w,k=x*x,S=v*b-v*B-b*k;let R=0;if(S<0){const t=We(1-S/(v*b));r*=t,o*=t}else R=(a===h?-1:1)*We(S/(v*B+b*k));const C=R*r*w/o,P=-R*o*x/r,T=De((w-P)/o,(x-C)/r),L=De((-w-P)/o,(-x-C)/r);let I=L-T;0===h&&I>0?I-=d:1===h&&I<0&&(I+=d);const E=s+p+m*C-y*P,A=i+f+y*C+m*P,O=I<0?1:0;_||e.ellipseToCurve?Fe(t,E,A,r,o,n,T/l,L/l,O):r!==o||n?t.push(re.G,E,A,r,o,n,T/l,L/l,O):t.push(re.O,E,A,r,T/l,L/l,O)}},{M:Ue,m:Ne,L:Ye,l:Xe,H:je,h:He,V:Ge,v:Ve,C:qe,c:Qe,S:Je,s:$e,Q:Ze,q:Ke,T:ts,t:es,A:ss,a:is,Z:rs,z:os,N:ns,D:as,X:hs,G:ls,F:ds,O:cs,P:us,U:_s}=re,{rect:ps,roundRect:fs,arcTo:gs,arc:ys,ellipse:ms,quadraticCurveTo:xs}=Le,{ellipticalArc:ws}=ze,vs=bt.get("PathConvert"),bs={},Bs={current:{dot:0},stringify(t,e){let s,i,r,o=0,n=t.length,h="";for(;o<n;){i=t[o],s=de[i],h+=i===r?" ":le[i];for(let i=1;i<s;i++)h+=a.float(t[o+i],e),i===s-1||(h+=" ");r=i,o+=s}return h},parse(t,e){let s,i,r,o="";const n=[],a=e?ae:ne;for(let e=0,h=t.length;e<h;e++)i=t[e],wt[i]?("."===i&&(ks.dot&&(Ss(n,o),o=""),ks.dot++),"0"===o&&"."!==i&&(Ss(n,o),o=""),o+=i):re[i]?(o&&(Ss(n,o),o=""),ks.name=re[i],ks.length=oe[i],ks.index=0,Ss(n,ks.name),!s&&a[i]&&(s=!0)):"-"===i||"+"===i?"e"===r||"E"===r?o+=i:(o&&Ss(n,o),o=i):o&&(Ss(n,o),o=""),r=i;return o&&Ss(n,o),s?Bs.toCanvasData(n,e):n},toCanvasData(t,e){let s,i,r,o,n,a=0,h=0,l=0,d=0,c=0,u=t.length;const _=[];for(;c<u;){switch(r=t[c],r){case Ne:t[c+1]+=a,t[c+2]+=h;case Ue:a=t[c+1],h=t[c+2],_.push(Ue,a,h),c+=3;break;case He:t[c+1]+=a;case je:a=t[c+1],_.push(Ye,a,h),c+=2;break;case Ve:t[c+1]+=h;case Ge:h=t[c+1],_.push(Ye,a,h),c+=2;break;case Xe:t[c+1]+=a,t[c+2]+=h;case Ye:a=t[c+1],h=t[c+2],_.push(Ye,a,h),c+=3;break;case $e:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Je;case Je:n=o===qe||o===Je,l=n?2*a-s:t[c+1],d=n?2*h-i:t[c+2],s=t[c+1],i=t[c+2],a=t[c+3],h=t[c+4],_.push(qe,l,d,s,i,a,h),c+=5;break;case Qe:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,t[c+5]+=a,t[c+6]+=h,r=qe;case qe:s=t[c+3],i=t[c+4],a=t[c+5],h=t[c+6],_.push(qe,t[c+1],t[c+2],s,i,a,h),c+=7;break;case es:t[c+1]+=a,t[c+2]+=h,r=ts;case ts:n=o===Ze||o===ts,s=n?2*a-s:t[c+1],i=n?2*h-i:t[c+2],e?xs(_,a,h,s,i,t[c+1],t[c+2]):_.push(Ze,s,i,t[c+1],t[c+2]),a=t[c+1],h=t[c+2],c+=3;break;case Ke:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Ze;case Ze:s=t[c+1],i=t[c+2],e?xs(_,a,h,s,i,t[c+3],t[c+4]):_.push(Ze,s,i,t[c+3],t[c+4]),a=t[c+3],h=t[c+4],c+=5;break;case is:t[c+6]+=a,t[c+7]+=h;case ss:ws(_,a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],e),a=t[c+6],h=t[c+7],c+=8;break;case os:case rs:_.push(rs),c++;break;case ns:a=t[c+1],h=t[c+2],e?ps(_,a,h,t[c+3],t[c+4]):Rs(_,t,c,5),c+=5;break;case as:a=t[c+1],h=t[c+2],e?fs(_,a,h,t[c+3],t[c+4],[t[c+5],t[c+6],t[c+7],t[c+8]]):Rs(_,t,c,9),c+=9;break;case hs:a=t[c+1],h=t[c+2],e?fs(_,a,h,t[c+3],t[c+4],t[c+5]):Rs(_,t,c,6),c+=6;break;case ls:ms(e?_:Rs(_,t,c,9),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],t[c+8],null,bs),a=bs.x,h=bs.y,c+=9;break;case ds:e?ms(_,t[c+1],t[c+2],t[c+3],t[c+4],0,0,360,!1):Rs(_,t,c,5),a=t[c+1]+t[c+3],h=t[c+2],c+=5;break;case cs:ys(e?_:Rs(_,t,c,7),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],null,bs),a=bs.x,h=bs.y,c+=7;break;case us:e?ys(_,t[c+1],t[c+2],t[c+3],0,360,!1):Rs(_,t,c,4),a=t[c+1]+t[c+3],h=t[c+2],c+=4;break;case _s:gs(e?_:Rs(_,t,c,6),a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],null,bs),a=bs.x,h=bs.y,c+=6;break;default:return vs.error(`command: ${r} [index:${c}]`,t),_}o=r}return _},objectToCanvasData(t){const e=[];return t.forEach((t=>{switch(t.name){case"M":e.push(Ue,t.x,t.y);break;case"L":e.push(Ye,t.x,t.y);break;case"C":e.push(qe,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Ze,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(rs)}})),e},copyData(t,e,s,i){for(let r=s,o=s+i;r<o;r++)t.push(e[r])},pushData(t,e){ks.index===ks.length&&(ks.index=1,t.push(ks.name)),t.push(Number(e)),ks.index++,ks.dot=0}},{current:ks,pushData:Ss,copyData:Rs}=Bs,{M:Cs,L:Ps,C:Ts,Q:Ls,Z:Is,N:Es,D:As,X:Os,G:Ms,F:Ws,O:Ds,P:Fs,U:zs}=re,{getMinDistanceFrom:Us,getRadianFrom:Ns}=A,{tan:Ys,min:Xs,abs:js}=Math,Hs={},Gs={beginPath(t){t.length=0},moveTo(t,e,s){t.push(Cs,e,s)},lineTo(t,e,s){t.push(Ps,e,s)},bezierCurveTo(t,e,s,i,r,o,n){t.push(Ts,e,s,i,r,o,n)},quadraticCurveTo(t,e,s,i,r){t.push(Ls,e,s,i,r)},closePath(t){t.push(Is)},rect(t,e,s,i,r){t.push(Es,e,s,i,r)},roundRect(t,e,s,i,r,o){if("number"==typeof o)t.push(Os,e,s,i,r,o);else{const n=a.fourNumber(o);n?t.push(As,e,s,i,r,...n):t.push(Es,e,s,i,r)}},ellipse(t,e,s,i,r,o,n,a,h){void 0===o?t.push(Ws,e,s,i,r):(void 0===n&&(n=0),void 0===a&&(a=360),t.push(Ms,e,s,i,r,o,n,a,h?1:0))},arc(t,e,s,i,r,o,n){void 0===r?t.push(Fs,e,s,i):(void 0===o&&(o=360),t.push(Ds,e,s,i,r,o,n?1:0))},arcTo(t,e,s,i,r,o,n,a){if(void 0!==n){const t=Us(n,a,e,s,i,r);o=Xs(o,Xs(t/2,t/2*js(Ys(Ns(n,a,e,s,i,r)/2))))}t.push(zs,e,s,i,r,o)},drawEllipse(t,e,s,i,r,o,n,a,h){Le.ellipse(null,e,s,i,r,void 0===o?0:o,void 0===n?0:n,void 0===a?360:a,h,null,null,Hs),t.push(Cs,Hs.x,Hs.y),Vs(t,e,s,i,r,o,n,a,h)},drawArc(t,e,s,i,r,o,n){Le.arc(null,e,s,i,void 0===r?0:r,void 0===o?360:o,n,null,null,Hs),t.push(Cs,Hs.x,Hs.y),qs(t,e,s,i,r,o,n)},drawPoints(t,e,s,i){Le.points(t,e,s,i)}},{ellipse:Vs,arc:qs}=Gs,{moveTo:Qs,lineTo:Js,quadraticCurveTo:$s,bezierCurveTo:Zs,closePath:Ks,beginPath:ti,rect:ei,roundRect:si,ellipse:ii,arc:ri,arcTo:oi,drawEllipse:ni,drawArc:ai,drawPoints:hi}=Gs;class li{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?"string"==typeof t?se.parse(t):t:[],this}beginPath(){return ti(this.__path),this.paint(),this}moveTo(t,e){return Qs(this.__path,t,e),this.paint(),this}lineTo(t,e){return Js(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,i,r,o){return Zs(this.__path,t,e,s,i,r,o),this.paint(),this}quadraticCurveTo(t,e,s,i){return $s(this.__path,t,e,s,i),this.paint(),this}closePath(){return Ks(this.__path),this.paint(),this}rect(t,e,s,i){return ei(this.__path,t,e,s,i),this.paint(),this}roundRect(t,e,s,i,r){return si(this.__path,t,e,s,i,r),this.paint(),this}ellipse(t,e,s,i,r,o,n,a){return ii(this.__path,t,e,s,i,r,o,n,a),this.paint(),this}arc(t,e,s,i,r,o){return ri(this.__path,t,e,s,i,r,o),this.paint(),this}arcTo(t,e,s,i,r){return oi(this.__path,t,e,s,i,r),this.paint(),this}drawEllipse(t,e,s,i,r,o,n,a){return ni(this.__path,t,e,s,i,r,o,n,a),this.paint(),this}drawArc(t,e,s,i,r,o){return ai(this.__path,t,e,s,i,r,o),this.paint(),this}drawPoints(t,e,s){return hi(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:di,L:ci,C:ui,Q:_i,Z:pi,N:fi,D:gi,X:yi,G:mi,F:xi,O:wi,P:vi,U:bi}=re,Bi=bt.get("PathDrawer"),ki={drawPathByData(t,e){if(!e)return;let s,i=0,r=e.length;for(;i<r;)switch(s=e[i],s){case di:t.moveTo(e[i+1],e[i+2]),i+=3;break;case ci:t.lineTo(e[i+1],e[i+2]),i+=3;break;case ui:t.bezierCurveTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5],e[i+6]),i+=7;break;case _i:t.quadraticCurveTo(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case pi:t.closePath(),i+=1;break;case fi:t.rect(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case gi:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],[e[i+5],e[i+6],e[i+7],e[i+8]]),i+=9;break;case yi:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;case mi:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]*l,e[i+6]*l,e[i+7]*l,e[i+8]),i+=9;break;case xi:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],0,0,d,!1),i+=5;break;case wi:t.arc(e[i+1],e[i+2],e[i+3],e[i+4]*l,e[i+5]*l,e[i+6]),i+=7;break;case vi:t.arc(e[i+1],e[i+2],e[i+3],0,d,!1),i+=4;break;case bi:t.arcTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;default:return void Bi.error(`command: ${s} [index:${i}]`,e)}}},{M:Si,L:Ri,C:Ci,Q:Pi,Z:Ti,N:Li,D:Ii,X:Ei,G:Ai,F:Oi,O:Mi,P:Wi,U:Di}=re,{toTwoPointBounds:Fi,toTwoPointBoundsByQuadraticCurve:zi,arcTo:Ui,arc:Ni,ellipse:Yi}=Le,{addPointBounds:Xi,copy:ji,addPoint:Hi,setPoint:Gi,addBounds:Vi,toBounds:qi}=Y,Qi=bt.get("PathBounds");let Ji,$i,Zi;const Ki={},tr={},er={},sr={toBounds(t,e){sr.toTwoPointBounds(t,tr),qi(tr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Gi(e,0,0);let s,i,r,o,n,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(n=t[a],0===a&&(n===Ti||n===Ci||n===Pi?Gi(e,h,l):Gi(e,t[a+1],t[a+2])),n){case Si:case Ri:h=t[a+1],l=t[a+2],Hi(e,h,l),a+=3;break;case Ci:r=t[a+5],o=t[a+6],Fi(h,l,t[a+1],t[a+2],t[a+3],t[a+4],r,o,Ki),Xi(e,Ki),h=r,l=o,a+=7;break;case Pi:s=t[a+1],i=t[a+2],r=t[a+3],o=t[a+4],zi(h,l,s,i,r,o,Ki),Xi(e,Ki),h=r,l=o,a+=5;break;case Ti:a+=1;break;case Li:h=t[a+1],l=t[a+2],Vi(e,h,l,t[a+3],t[a+4]),a+=5;break;case Ii:case Ei:h=t[a+1],l=t[a+2],Vi(e,h,l,t[a+3],t[a+4]),a+=n===Ii?9:6;break;case Ai:Yi(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],Ki,er),0===a?ji(e,Ki):Xi(e,Ki),h=er.x,l=er.y,a+=9;break;case Oi:h=t[a+1],l=t[a+2],$i=t[a+3],Zi=t[a+4],Vi(e,h-$i,l-Zi,2*$i,2*Zi),h+=$i,a+=5;break;case Mi:Ni(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Ki,er),0===a?ji(e,Ki):Xi(e,Ki),h=er.x,l=er.y,a+=7;break;case Wi:h=t[a+1],l=t[a+2],Ji=t[a+3],Vi(e,h-Ji,l-Ji,2*Ji,2*Ji),h+=Ji,a+=4;break;case Di:Ui(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Ki,er),0===a?ji(e,Ki):Xi(e,Ki),h=er.x,l=er.y,a+=6;break;default:return void Qi.error(`command: ${n} [index:${a}]`,t)}}},{M:ir,L:rr,Z:or}=re,{getCenterX:nr,getCenterY:ar}=A,{arcTo:hr}=Gs,lr={smooth(t,e,s){let i,r,o,n=0,a=0,h=0,l=0,d=0,c=0,u=0,_=0,p=0;const f=t.length,g=[];for(;n<f;){switch(i=t[n],i){case ir:l=_=t[n+1],d=p=t[n+2],n+=3,t[n]===rr?(c=t[n+1],u=t[n+2],g.push(ir,nr(l,c),ar(d,u))):g.push(ir,l,d);break;case rr:switch(a=t[n+1],h=t[n+2],n+=3,t[n]){case rr:hr(g,a,h,t[n+1],t[n+2],e,_,p);break;case or:hr(g,a,h,l,d,e,_,p);break;default:g.push(rr,a,h)}_=a,p=h;break;case or:r!==or&&(hr(g,l,d,c,u,e,_,p),g.push(or)),n+=1;break;default:o=de[i];for(let e=0;e<o;e++)g.push(t[n+e]);n+=o}r=i}return i!==or&&(g[1]=l,g[2]=d),g}};se.creator=new li,se.parse=Bs.parse,se.convertToCanvasData=Bs.toCanvasData;const dr=new li,{drawRoundRect:cr}=ce;function ur(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,i,r){cr(this,t,e,s,i,r)})}(t)}const _r={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mineType:t=>!t||t.startsWith("image")?t:("jpg"===t&&(t="jpeg"),"image/"+t),fileType(t){const e=t.split(".");return e[e.length-1]},isOpaqueImage(t){const e=pr.fileType(t);return["jpg","jpeg"].some((t=>t===e))},getExportOptions(t){switch(typeof t){case"object":return t;case"number":return{quality:t};case"boolean":return{blob:t};default:return{}}}},pr=_r;pr.alphaPixelTypes.forEach((t=>pr.upperCaseTypeMap[t]=t.toUpperCase()));const fr=bt.get("TaskProcessor");class gr{constructor(t){this.parallel=!0,this.time=1,this.id=s.create(s.TASK),this.task=t}run(){return jt(this,void 0,void 0,(function*(){try{this.task&&!this.isComplete&&this.parent.running&&(yield this.task())}catch(t){fr.error(t)}}))}complete(){this.isComplete=!0,this.parent=null,this.task=null}cancel(){this.isCancel=!0,this.complete()}}class yr{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,s=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(s+=this.list[i].time,i===this.finishedIndex&&(e=s)):e+=this.list[i].time;return this.isComplete?1:s/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&Ft.assign(this.config,t),this.empty()}add(t,e){let s,i,r,o;const n=new gr(t);return n.parent=this,"number"==typeof e?o=e:e&&(i=e.parallel,s=e.start,r=e.time,o=e.delay),r&&(n.time=r),!1===i&&(n.parallel=!1),void 0===o?this.push(n,s):(this.delayNumber++,setTimeout((()=>{this.delayNumber&&(this.delayNumber--,this.push(n,s))}),o)),this.isComplete=!1,n}push(t,e){this.list.push(t),!1===e||this.timer||(this.timer=setTimeout((()=>this.start())))}empty(){this.index=0,this.parallelSuccessNumber=0,this.list=[],this.parallelList=[],this.delayNumber=0}start(){this.running||(this.running=!0,this.isComplete=!1,this.run())}pause(){clearTimeout(this.timer),this.timer=null,this.running=!1}resume(){this.start()}skip(){this.index++,this.resume()}stop(){this.isComplete=!0,this.list.forEach((t=>{t.isComplete||t.cancel()})),this.pause(),this.empty()}run(){this.running&&(this.setParallelList(),this.parallelList.length>1?this.runParallelTasks():this.remain?this.runTask():this.onComplete())}runTask(){const t=this.list[this.index];t?t.run().then((()=>{this.onTask(t),this.index++,this.nextTask()})).catch((t=>{this.onError(t)})):this.nextTask()}runParallelTasks(){this.parallelList.forEach((t=>this.runParallelTask(t)))}runParallelTask(t){t.run().then((()=>{this.onTask(t),this.fillParallelTask()})).catch((t=>{this.onParallelError(t)}))}nextTask(){this.total===this.finishedIndex?this.onComplete():this.timer=setTimeout((()=>this.run()))}setParallelList(){let t;this.parallelList=[],this.parallelSuccessNumber=0;let e=this.index+this.config.parallel;e>this.list.length&&(e=this.list.length);for(let s=this.index;s<e&&(t=this.list[s],t.parallel);s++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const s=e.length,i=this.finishedIndex+s;if(e.length){if(!this.running)return;i<this.total&&(t=this.list[i],t&&t.parallel&&(e.push(t),this.runParallelTask(t)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(t){t.complete(),this.config.onTask&&this.config.onTask()}onParallelError(t){this.parallelList.forEach((t=>{t.parallel=!1})),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(t)}onError(t){this.pause(),this.config.onError&&this.config.onError(t)}destroy(){this.stop()}}const mr=bt.get("Resource"),xr={tasker:new yr,map:{},get isComplete(){return wr.tasker.isComplete},set(t,e){wr.map[t]&&mr.repeat(t),wr.map[t]=e},get:t=>wr.map[t],remove(t){const e=wr.map[t];e&&(e.destroy&&e.destroy(),delete wr.map[t])},loadImage(t,e){return new Promise(((s,i)=>{const r=this.setImage(t,t,e);r.load((()=>s(r)),(t=>i(t)))}))},setImage(t,e,s){let i;return"string"==typeof e?i={url:e}:e.url||(i={url:t,view:e}),i&&(s&&(i.format=s),e=Lt.image(i)),wr.set(t,e),e},destroy(){wr.map={}}},wr=xr,vr={maxRecycled:10,recycledList:[],patternTasker:new yr,get(t){let e=xr.get(t.url);return e||xr.set(t.url,e=Lt.image(t)),e.use++,e},recycle(t){t.use--,setTimeout((()=>{t.use||br.recycledList.push(t)}))},clearRecycled(){const t=br.recycledList;t.length>br.maxRecycled&&(t.forEach((t=>!t.use&&t.url&&xr.remove(t.url))),t.length=0)},hasAlphaPixel:t=>_r.alphaPixelTypes.some((e=>br.isFormat(e,t))),isFormat(t,e){if(e.format===t)return!0;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+_r.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+_r.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){br.recycledList=[]}},br=vr,{IMAGE:Br,create:kr}=s;class Sr{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=kr(Br),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}vr.isFormat("svg",t)&&(this.isSVG=!0),vr.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,s){if(!this.loading){this.loading=!0;let{loadImage:t,loadImageWithProgress:s}=e.origin,i=this.config.showProgress&&s&&this.onProgress.bind(this);i&&(t=s),xr.tasker.add((()=>jt(this,void 0,void 0,(function*(){return yield t(this.url,i).then((t=>this.setView(t))).catch((t=>{this.error=t,this.onComplete(!1)}))}))))}return this.waitComplete.push(t,s),this.waitComplete.length-2}unload(t,e){const s=this.waitComplete;if(e){const e=s[t+1];e&&e({type:"stop"})}s[t]=s[t+1]=void 0}setView(t){this.ready=!0,this.width=t.naturalWidth||t.width,this.height=t.naturalHeight||t.height,this.view=t,this.onComplete(!0)}onProgress(t){this.progress=t}onComplete(t){let e;this.waitComplete.forEach(((s,i)=>{e=i%2,s&&(t?e||s(this):e&&s(this.error))})),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,s,i,r){if(t||(t=this.width),s||(s=this.height),this.cache){let{params:t,data:e}=this.cache;for(let s in t)if(t[s]!==arguments[s]){e=null;break}if(e)return e}const o=e.origin.createCanvas(t,s),n=o.getContext("2d");return i&&(n.globalAlpha=i),n.drawImage(this.view,0,0,t,s),this.cache=this.use>1?{data:o,params:arguments}:null,o}getPattern(t,s,i,r){const o=e.canvas.createPattern(t,s);try{i&&o.setTransform&&(o.setTransform(i),i=void 0)}catch(t){}return r&&Ft.stintSet(r,"transform",i),o}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}}function Rr(t,e,s,i){i||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function Cr(t,e){return Object.getOwnPropertyDescriptor(t,e)}function Pr(t,e){const s="_"+t;return{get(){const t=this[s];return void 0===t?e:t},set(t){this[s]=t}}}function Tr(t,e){return(s,i)=>Ir(s,i,t,e&&e(i))}function Lr(t){return t}function Ir(t,e,s,i){const r={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};Rr(t,e,Object.assign(r,i||{})),io(t,e,s)}function Er(t){return Tr(t)}function Ar(t,e){return Tr(t,(t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}})))}function Or(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),zr(this))}})))}function Mr(t,e){return Tr(t,(t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}})))}function Wr(t,e){return Tr(t,(t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}})))}function Dr(t,e){return Tr(t,(t=>({set(s){this.__setAttr(t,s,e)&&zr(this)}})))}function Fr(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e)&&(zr(this),this.__.__removeNaturalSize())}})))}function zr(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function Ur(t){return Tr(t,(t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),zr(this)}})))}const Nr=Dr;function Yr(t,e){return Tr(t,(t=>({set(s){this.__setAttr(t,s)&&(Xr(this),e&&(this.__.__useStroke=!0))}})))}function Xr(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&zr(t)}const jr=Yr;function Hr(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}})))}function Gr(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}})))}function Vr(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&Qr(this)}})))}function qr(t){return Tr(t,(t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",(()=>Jr(this,t,e,s)))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");Jr(this,t,e,s),this.mask&&Qr(this)}})))}function Qr(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function Jr(t,e,s,i){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==i&&0!==s||zr(t))}function $r(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange(),this.waitParent((()=>{this.parent.__layout.childrenSortChange()})))}})))}function Zr(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent((()=>{this.parent.__updateMask(e)})))}})))}function Kr(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e)&&this.waitParent((()=>{this.parent.__updateEraser(e)}))}})))}function to(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,"hit"===bt.showBounds&&(this.__layout.surfaceChanged||this.__layout.surfaceChange()),this.leafer&&this.leafer.updateCursor())}})))}function eo(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}})))}function so(t){return(e,s)=>{Rr(e,"__DataProcessor",{get:()=>t})}}function io(t,e,s){const i=t.__DataProcessor.prototype,r="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),n=Pr(e,s);if(void 0===s)n.get=function(){return this[r]};else if("function"==typeof s)n.get=function(){let t=this[r];return void 0===t?s(this.__leaf):t};else if("object"==typeof s){const t=Yt(s);n.get=function(){let e=this[r];return void 0===e?this[r]=t?{}:Ft.clone(s):e}}const a=t.isBranchLeaf;"width"===e?n.get=function(){const t=this[r];if(void 0===t){const t=this,e=t.__naturalWidth,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:a&&i.children.length?i.boxBounds.width:s}return t}:"height"===e&&(n.get=function(){const t=this[r];if(void 0===t){const t=this,e=t.__naturalHeight,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:a&&i.children.length?i.boxBounds.height:s}return t});let h,l=i;for(;!h&&l;)h=Cr(l,e),l=l.__proto__;h&&h.set&&(n.set=h.set),i[o]&&(n.set=i[o],delete i[o]),Rr(i,e,n)}const ro=new bt("rewrite"),oo=[],no=["destroy","constructor"];function ao(t){return(e,s)=>{oo.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function ho(){return t=>{lo()}}function lo(t){oo.length&&(oo.forEach((e=>{t&&ro.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()})),oo.length=0)}function co(t,e){return s=>{var i;(t.prototype?(i=t.prototype,Object.getOwnPropertyNames(i)):Object.keys(t)).forEach((i=>{if(!(no.includes(i)||e&&e.includes(i)))if(t.prototype){Cr(t.prototype,i).writable&&(s.prototype[i]=t.prototype[i])}else s.prototype[i]=t[i]}))}}function uo(){return t=>{Et.register(t)}}setTimeout((()=>lo(!0)));const{copy:_o,toInnerPoint:po,toOuterPoint:fo,scaleOfOuter:go,rotateOfOuter:yo,skewOfOuter:mo,multiplyParent:xo,divideParent:wo,getLayout:vo}=b,bo={},{round:Bo}=Math,ko={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),Co(t,e,s),t.isBranch){const{children:i}=t;for(let t=0,r=i.length;t<r;t++)Ro(i[t],e,s)}},updateMatrix(t,e,s){const i=t.__layout;e?s&&(i.waitAutoLayout=!0,t.__hasAutoLayout&&(i.matrixChanged=!1)):i.waitAutoLayout&&(i.waitAutoLayout=!1),i.matrixChanged&&t.__updateLocalMatrix(),i.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)Po(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&Po(t),t.__updateChange()},updateAllChange(t){if(Lo(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)To(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},copyCanvasByWorld(t,s,i,r,o,n){r||(r=t.__nowWorld),t.__worldFlipped||e.fullImageShadow?s.copyWorldByReset(i,r,t.__nowWorld,o,n):s.copyWorldToInner(i,r,t.__layout.renderBounds,o)},moveWorld(t,e,s=0,i,r){const o="object"==typeof e?Object.assign({},e):{x:e,y:s};i?fo(t.localTransform,o,o,!0):t.parent&&po(t.parent.worldTransform,o,o,!0),So.moveLocal(t,o.x,o.y,r)},moveLocal(t,e,s=0,i){"object"==typeof e&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=Bo(e),s=Bo(s)),i?t.animate({x:e,y:s},i):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,i,r,o){So.zoomOfLocal(t,Io(t,e),s,i,r,o)},zoomOfLocal(t,e,s,i=s,r,o){const n=t.__localMatrix;if("number"!=typeof i&&(i&&(o=i),i=s),_o(bo,n),go(bo,e,s,i),t.origin||t.around)So.setTransform(t,bo,r,o);else{const e=t.x+bo.e-n.e,a=t.y+bo.f-n.f;o&&!r?t.animate({x:e,y:a,scaleX:t.scaleX*s,scaleY:t.scaleY*i},o):(t.x=e,t.y=a,t.scaleResize(s,i,!0!==r))}},rotateOfWorld(t,e,s,i){So.rotateOfLocal(t,Io(t,e),s,i)},rotateOfLocal(t,e,s,i){const r=t.__localMatrix;_o(bo,r),yo(bo,e,s),t.origin||t.around?So.setTransform(t,bo,!1,i):t.set({x:t.x+bo.e-r.e,y:t.y+bo.f-r.f,rotation:a.formatRotation(t.rotation+s)},i)},skewOfWorld(t,e,s,i,r,o){So.skewOfLocal(t,Io(t,e),s,i,r,o)},skewOfLocal(t,e,s,i=0,r,o){_o(bo,t.__localMatrix),mo(bo,e,s,i),So.setTransform(t,bo,r,o)},transformWorld(t,e,s,i){_o(bo,t.worldTransform),xo(bo,e),t.parent&&wo(bo,t.parent.worldTransform),So.setTransform(t,bo,s,i)},transform(t,e,s,i){_o(bo,t.localTransform),xo(bo,e),So.setTransform(t,bo,s,i)},setTransform(t,e,s,i){const r=t.__,o=r.origin&&So.getInnerOrigin(t,r.origin),n=vo(e,o,r.around&&So.getInnerOrigin(t,r.around));if(s){const e=n.scaleX/t.scaleX,s=n.scaleY/t.scaleY;if(delete n.scaleX,delete n.scaleY,o){_t.scale(t.boxBounds,Math.abs(e),Math.abs(s));const i=So.getInnerOrigin(t,r.origin);A.move(n,o.x-i.x,o.y-i.y)}t.set(n),t.scaleResize(e,s,!1)}else t.set(n,i)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},i="x"===e?1:-1;return go(s,So.getLocalOrigin(t,"center"),-1*i,1*i),s},getLocalOrigin:(t,e)=>A.tempToOuterOf(So.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return V.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(_o(bo,t.worldTransform),wo(bo,e.worldTransform),s?bo:Object.assign({},bo)),drop(t,e,s,i){t.setTransform(So.getRelativeWorld(t,e,!0),i),e.add(t,s)},hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}}},So=ko,{updateAllMatrix:Ro,updateMatrix:Co,updateAllWorldOpacity:Po,updateAllChange:To,updateChange:Lo}=So;function Io(t,e){return t.__layout.update(),t.parent?A.tempToInnerOf(e,t.parent.__world):e}const Eo={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localRenderBounds,maskLocalBoxBounds:t=>t.__.mask?t.__localBoxBounds:null,maskLocalStrokeBounds:t=>t.__.mask?t.__layout.localStrokeBounds:null,maskLocalRenderBounds:t=>t.__.mask?t.__layout.localRenderBounds:null,excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))},{updateBounds:Ao}=ko,Oo={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:s}=t;for(let i=0,r=s.length;i<r;i++)(t=s[i]).isBranch&&(t.__tempNumber=1,e.add(t),Mo(t,e))}},pushAllParent(t,e){const{keys:s}=e;if(s)for(;t.parent&&void 0===s[t.parent.innerId];)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let s=e.length;const{children:i}=t;for(let t=0,s=i.length;t<s;t++)i[t].isBranch&&e.push(i[t]);for(let t=s,i=e.length;t<i;t++)Wo(e[t],e)},updateBounds(t,e){const s=[t];Wo(t,s),Do(s,e)},updateBoundsByBranchStack(t,e){let s,i;for(let r=t.length-1;r>-1;r--){s=t[r],i=s.children;for(let t=0,e=i.length;t<e;t++)Ao(i[t]);e&&e===s||Ao(s)}}},{pushAllChildBranch:Mo,pushAllBranchStack:Wo,updateBoundsByBranchStack:Do}=Oo,Fo={run(t){if(t&&t.length){const e=t.length;for(let s=0;s<e;s++)t[s]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:zo,updateBounds:Uo}=ko,{toOuterOf:No,getPoints:Yo,copy:Xo}=_t,jo="_localContentBounds",Ho="_worldContentBounds",Go="_worldBoxBounds",Vo="_worldStrokeBounds";class qo{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(t){this._renderBounds=t}get localContentBounds(){return No(this.contentBounds,this.leaf.__localMatrix,this[jo]||(this[jo]={})),this[jo]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return No(this.contentBounds,this.leaf.__world,this[Ho]||(this[Ho]={})),this[Ho]}get worldBoxBounds(){return No(this.boxBounds,this.leaf.__world,this[Go]||(this[Go]={})),this[Go]}get worldStrokeBounds(){return No(this.strokeBounds,this.leaf.__world,this[Vo]||(this[Vo]={})),this[Vo]}get a(){return 1}get b(){return 0}get c(){return 0}get d(){return 1}get e(){return this.leaf.__.x}get f(){return this.leaf.__.y}get x(){return this.e+this.boxBounds.x}get y(){return this.f+this.boxBounds.y}get width(){return this.boxBounds.width}get height(){return this.boxBounds.height}constructor(t){this.leaf=t,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),t.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){const t=this.leaf.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0};this._localStrokeBounds||(this._localStrokeBounds=t),this._localRenderBounds||(this._localRenderBounds=t)}update(){const{leaf:t}=this,{leafer:s}=t;if(t.isApp)return Uo(t);if(s)s.ready?s.watcher.changed&&s.layouter.layout():s.start();else{let s=t;for(;s.parent&&!s.parent.leafer;)s=s.parent;const i=s;if(i.__fullLayouting)return;i.__fullLayouting=!0,e.layout(i),delete i.__fullLayouting}}getTransform(t="world"){this.update();const{leaf:e}=this;switch(t){case"world":return e.__world;case"local":return e.__localMatrix;case"inner":return b.defaultMatrix;case"page":t=e.zoomLayer;default:return zo(e,t)}}getBounds(t,e="world"){switch(this.update(),e){case"world":return this.getWorldBounds(t);case"local":return this.getLocalBounds(t);case"inner":return this.getInnerBounds(t);case"page":e=this.leaf.zoomLayer;default:return new yt(this.getInnerBounds(t)).toOuterOf(this.getTransform(e))}}getInnerBounds(t="box"){switch(t){case"render":return this.renderBounds;case"content":if(this.contentBounds)return this.contentBounds;case"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",s){const{leaf:i}=this;let r,o,n,a=this.getInnerBounds(t);switch(e){case"world":r=i.getWorldPoint(a),o=i.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=i.__;n={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},r=i.getLocalPointByInner(a);break;case"inner":r=a,o=b.defaultMatrix;break;case"page":e=i.zoomLayer;default:r=i.getWorldPoint(a,e),o=zo(i,e,!0)}if(n||(n=b.getLayout(o)),Xo(n,a),A.copy(n,r),s){const{scaleX:t,scaleY:e}=n,s=Math.abs(t),i=Math.abs(e);1===s&&1===i||(n.scaleX/=s,n.scaleY/=i,n.width*=s,n.height*=i)}return n}getLayoutPoints(t,e="world"){const{leaf:s}=this,i=Yo(this.getInnerBounds(t));let r;switch(e){case"world":r=null;break;case"local":r=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:r=e}return void 0!==r&&i.forEach((t=>s.innerToWorld(t,null,!1,r))),i}shrinkContent(){const{x:t,y:e,width:s,height:i}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:i}}spreadStroke(){const{x:t,y:e,width:s,height:i}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:i},this._localStrokeBounds={x:t,y:e,width:s,height:i},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:i}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:i},this._localRenderBounds={x:t,y:e,width:s,height:i}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged||this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||(this.strokeSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,this.renderSpread||(this.renderSpread=1),this.boundsChanged=!0}scaleChange(){this.scaleChanged=!0,this._scaleOrRotationChange()}rotationChange(){this.rotationChanged=!0,this.affectRotation=!0,this._scaleOrRotationChange()}_scaleOrRotationChange(){this.affectScaleOrRotation=!0,this.matrixChange(),this.leaf.__local||this.createLocal()}matrixChange(){this.matrixChanged=!0,this.localBoxChanged||this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0,this.surfaceChanged||this.surfaceChange()}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}}class Qo{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&e.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&e.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&e.event.stop(this.origin)}}class Jo extends Qo{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}Jo.ADD="child.add",Jo.REMOVE="child.remove",Jo.CREATED="created",Jo.MOUNTED="mounted",Jo.UNMOUNTED="unmounted",Jo.DESTROY="destroy";class $o extends Qo{constructor(t,e,s,i,r){super(t,e),this.attrName=s,this.oldValue=i,this.newValue=r}}$o.CHANGE="property.change",$o.LEAFER_CHANGE="property.leafer_change";class Zo extends Qo{constructor(t,e){super(t),Object.assign(this,e)}}Zo.LOAD="image.load",Zo.LOADED="image.loaded",Zo.ERROR="image.error";class Ko extends Qo{static checkHas(t,e,s){"on"===s?e===rn?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(tn)||t.hasEvent(en)||t.hasEvent(sn),t.__hasWorldEvent=t.hasEvent(rn))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(tn,t),"inner"===e&&t.emit(en,t)),t.emit(sn,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(rn,this)}}Ko.RESIZE="bounds.resize",Ko.INNER="bounds.inner",Ko.LOCAL="bounds.local",Ko.WORLD="bounds.world";const{RESIZE:tn,INNER:en,LOCAL:sn,WORLD:rn}=Ko,on={};[tn,en,sn,rn].forEach((t=>on[t]=1));class nn extends Qo{get bigger(){if(!this.old)return!0;const{width:t,height:e}=this.old;return this.width>=t&&this.height>=e}get smaller(){return!this.bigger}get samePixelRatio(){return!this.old||this.pixelRatio===this.old.pixelRatio}constructor(t,e){"object"==typeof t?(super(nn.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&void 0!==this.resizingKeys[t.innerId]}}nn.RESIZE="resize";class an extends Qo{constructor(t,e){super(t),this.data=e}}an.REQUEST="watch.request",an.DATA="watch.data";class hn extends Qo{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}hn.REQUEST="layout.request",hn.START="layout.start",hn.BEFORE="layout.before",hn.LAYOUT="layout",hn.AFTER="layout.after",hn.AGAIN="layout.again",hn.END="layout.end";class ln extends Qo{constructor(t,e,s,i){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=i)}}ln.REQUEST="render.request",ln.CHILD_START="render.child_start",ln.CHILD_END="render.child_end",ln.START="render.start",ln.BEFORE="render.before",ln.RENDER="render",ln.AFTER="render.after",ln.AGAIN="render.again",ln.END="render.end",ln.NEXT="render.next";class dn extends Qo{}dn.START="leafer.start",dn.BEFORE_READY="leafer.before_ready",dn.READY="leafer.ready",dn.AFTER_READY="leafer.after_ready",dn.VIEW_READY="leafer.view_ready",dn.VIEW_COMPLETED="leafer.view_completed",dn.STOP="leafer.stop",dn.RESTART="leafer.restart",dn.END="leafer.end";const cn={};class un{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(t instanceof Array)t.forEach((t=>this.on(t[0],t[1],t[2])));else for(let s in t)(e=t[s])instanceof Array?this.on(s,e[0],e[1]):this.on(s,e);return}let i,r,o;s&&("once"===s?r=!0:"boolean"==typeof s?i=s:(i=s.capture,r=s.once));const n=_n(this,i,!0),a="string"==typeof t?t.split(" "):t,h=r?{listener:e,once:r}:{listener:e};a.forEach((t=>{t&&(o=n[t],o?-1===o.findIndex((t=>t.listener===e))&&o.push(h):n[t]=[h],on[t]&&Ko.checkHas(this,t,"on"))}))}off(t,e,s){if(t){const i="string"==typeof t?t.split(" "):t;if(e){let t,r,o;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const n=_n(this,t);i.forEach((t=>{t&&(r=n[t],r&&(o=r.findIndex((t=>t.listener===e)),o>-1&&r.splice(o,1),r.length||delete n[t],on[t]&&Ko.checkHas(this,t,"off")))}))}else{const{__bubbleMap:t,__captureMap:e}=this;i.forEach((s=>{t&&delete t[s],e&&delete e[s]}))}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,s,i){return e?this.on(t,s?e=e.bind(s):e,i):t instanceof Array&&t.forEach((t=>this.on(t[0],t[2]?t[1]=t[1].bind(t[2]):t[1],t[3]))),{type:t,current:this,listener:e,options:i}}off_(t){if(!t)return;const e=t instanceof Array?t:[t];e.forEach((t=>{t.listener?t.current.off(t.type,t.listener,t.options):t.type instanceof Array&&t.type.forEach((e=>t.current.off(e[0],e[1],e[3])))})),e.length=0}once(t,e,s,i){if(!e)return t instanceof Array&&t.forEach((t=>this.once(t[0],t[1],t[2],t[3])));"object"==typeof s?e=e.bind(s):i=s,this.on(t,e,{once:!0,capture:i})}emit(t,e,s){!e&&Mt.has(t)&&(e=Mt.get(t,{type:t,target:this,current:this}));const i=_n(this,s)[t];if(i){let r;for(let o=0,n=i.length;o<n&&!((r=i[o])&&(r.listener(e),r.once&&(this.off(t,r.listener,s),o--,n--),e&&e.isStopNow));o++);}this.syncEventer&&this.syncEventer.emitEvent(e,s)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:s,__captureMap:i}=this,r=s&&s[t],o=i&&i[t];return!!(void 0===e?r||o:e?o:r)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function _n(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:cn)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:cn)}}const{on:pn,on_:fn,off:gn,off_:yn,once:mn,emit:xn,emitEvent:wn,hasEvent:vn,destroy:bn}=un.prototype,Bn={on:pn,on_:fn,off:gn,off_:yn,once:mn,emit:xn,emitEvent:wn,hasEvent:vn,destroyEventer:bn},{isFinite:kn}=Number,Sn=bt.get("setAttr"),Rn={__setAttr(t,e,s){if(this.leaferIsCreated){const i=this.__.__getInput(t);if(s&&!kn(e)&&void 0!==e&&(Sn.warn(this.innerName,t,e),e=void 0),"object"==typeof e||i!==e){this.__realSetAttr(t,e);const{CHANGE:s}=$o,r=new $o(s,this,t,i,e);return this.isLeafer?this.emitEvent(new $o($o.LEAFER_CHANGE,this,t,i,e)):this.hasEvent(s)&&this.emitEvent(r),this.leafer.emitEvent(r),!0}return!1}return this.__realSetAttr(t,e),!0},__realSetAttr(t,e){const s=this.__;s[t]=e,this.__proxyData&&this.setProxyAttr(t,e),s.normalStyle&&(this.lockNormalStyle||void 0===s.normalStyle[t]||(s.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:Cn,multiplyParent:Pn,translateInner:Tn,defaultWorld:Ln}=b,{toPoint:In,tempPoint:En}=V,An={__updateWorldMatrix(){const{parent:t,__layout:e}=this;Pn(this.__local||e,t?t.__world:Ln,this.__world,!!e.affectScaleOrRotation,this.__,t&&(t.scrollY||t.scrollX)&&t.__)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(Cn(e,s,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=s.x+s.offsetX,e.f=s.y+s.offsetY,(s.around||s.origin)&&(In(s.around||s.origin,t.boxBounds,En),Tn(e,-En.x,-En.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:On,updateAllMatrix:Mn}=ko,{updateBounds:Wn}=Oo,{toOuterOf:Dn,copyAndSpread:Fn,copy:zn}=_t,{toBounds:Un}=sr,Nn={__updateWorldBounds(){const t=this.__layout;Dn(t.renderBounds,this.__world,this.__world),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&Ko.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&Ko.emitWorld(this)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=void 0,(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized="inner"),t.renderChanged&&(t.renderSpread=this.__updateRenderSpread(),t.renderSpread?(t.renderBounds!==t.boxBounds&&t.renderBounds!==t.strokeBounds||t.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):t.spreadRenderCancel(),t.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),Dn(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Dn(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Dn(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(){const t=this.__layout.boxBounds,e=this.__;e.__pathInputed?Un(e.path,t):(t.x=0,t.y=0,t.width=e.width,t.height=e.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),Mn(this),Wn(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(Mn(this),Wn(this,this))):On(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(){const t=this.__layout;Fn(t.strokeBounds,t.boxBounds,t.strokeBoxSpread)},__updateRenderBounds(){const t=this.__layout;t.renderSpread>0?Fn(t.renderBounds,t.boxBounds,t.renderSpread):zn(t.renderBounds,t.strokeBounds)}},Yn={__render(t,e){if(e.shape)return this.__renderShape(t,e);if(this.__worldOpacity){const s=this.__;if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.dimOpacity&&!s.dimskip?s.opacity*e.dimOpacity:s.opacity,this.__.__single){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!0,!0);this.__draw(i,e,t),ko.copyCanvasByWorld(this,t,i,this.__nowWorld,s.__blendMode,!0),i.recycle(this.__nowWorld)}else this.__draw(t,e);bt.showBounds&&bt.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),t.clipUI(this))},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:Xn}=Eo,jn={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__nowWorld=this.__getNowWorld(e),this.__worldOpacity){const s=this.__;if(s.dim?e.dimOpacity=!0===s.dim?.2:s.dim:s.dimskip&&e.dimOpacity&&(e.dimOpacity=0),s.__single&&!this.isBranchLeaf){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!1,!0);this.__renderBranch(i,e);const r=this.__nowWorld;t.opacity=e.dimOpacity?s.opacity*e.dimOpacity:s.opacity,t.copyWorldByReset(i,r,r,s.__blendMode,!0),i.recycle(r)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Xn(s[i],e)||s[i].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Xn(s[i],e)||s[i].__clip(t,e)}}},Hn={},{LEAF:Gn,create:Vn}=s,{toInnerPoint:qn,toOuterPoint:Qn,multiplyParent:Jn}=b,{toOuterOf:$n}=_t,{copy:Zn,move:Kn}=A,{moveLocal:ta,zoomOfLocal:ea,rotateOfLocal:sa,skewOfLocal:ia,moveWorld:ra,zoomOfWorld:oa,rotateOfWorld:na,skewOfWorld:aa,transform:ha,transformWorld:la,setTransform:da,getFlipTransform:ca,getLocalOrigin:ua,getRelativeWorld:_a,drop:pa}=ko;t.Leaf=class{get tag(){return this.__tag}set tag(t){}get __tag(){return"Leaf"}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return Ut}get __LayoutProcessor(){return qo}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){return!1}get isBranch(){return!1}get isBranchLeaf(){return!1}get __localMatrix(){return this.__local||this.__layout}get __localBoxBounds(){return this.__local||this.__layout}get worldTransform(){return this.__layout.getTransform("world")}get localTransform(){return this.__layout.getTransform("local")}get boxBounds(){return this.getBounds("box","inner")}get renderBounds(){return this.getBounds("render","inner")}get worldBoxBounds(){return this.getBounds("box")}get worldStrokeBounds(){return this.getBounds("stroke")}get worldRenderBounds(){return this.getBounds("render")}get worldOpacity(){return this.__layout.update(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){return this.leaferIsCreated&&this.leafer.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=Vn(Gn),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(Jo.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),0!==t&&(this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0})),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(Jo.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(Jo.MOUNTED,t,"once")}nextRender(t,e,s){this.leafer?this.leafer.nextRender(t,e,s):this.waitLeafer((()=>this.leafer.nextRender(t,e,s)))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(Jo.MOUNTED)):this.__emitLifeEvent(Jo.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,i=e.length;s<i;s++)e[s].__bindLeafer(t)}}set(t,e){}get(t){}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){void 0===t?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=void 0===e?null:void 0,this[t]=e}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(){}__updateContentBounds(){}__updateStrokeBounds(){}__updateRenderBounds(){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some((t=>t.__.eraser))}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:s}=this.__layout;t.clearRect(s.x,s.y,s.width,s.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some((t=>t.__.mask&&t.__.visible&&t.__.opacity))}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,s=this.__world;return Jn(s,t.matrix,e,void 0,s),$n(this.__layout.renderBounds,e,e),e.half!==s.half&&(e.half=s.half),e}return this.__world}getClampRenderScale(){let{scaleX:t}=this.__nowWorld||this.__world;return t<0&&(t=-t),t>1?t:1}getRenderScaleData(t,e){const{scaleX:s,scaleY:i}=vr.patternLocked?this.__world:this.__nowWorld;return e?Hn.scaleX=Hn.scaleY=1:t?(Hn.scaleX=s<0?-s:s,Hn.scaleY=i<0?-i:i):(Hn.scaleX=s,Hn.scaleY=i),Hn}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,s){return this.__layout.getLayoutBounds(t,e,s)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,s){const i=e?_a(this,e):this.worldTransform,r=s?t:{};return $n(t,i,r),r}worldToLocal(t,e,s,i){this.parent?this.parent.worldToInner(t,e,s,i):e&&Zn(e,t)}localToWorld(t,e,s,i){this.parent?this.parent.innerToWorld(t,e,s,i):e&&Zn(e,t)}worldToInner(t,e,s,i){i&&(i.innerToWorld(t,e,s),t=e||t),qn(this.worldTransform,t,e,s)}innerToWorld(t,e,s,i){Qn(this.worldTransform,t,e,s),i&&i.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,i){return this.getBoxPointByInner(this.getInnerPoint(t,e,s,i),null,null,!0)}getBoxPointByInner(t,e,s,i){const r=i?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return Kn(r,-o,-n),r}getInnerPoint(t,e,s,i){const r=i?t:{};return this.worldToInner(t,r,s,e),r}getInnerPointByBox(t,e,s,i){const r=i?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return Kn(r,o,n),r}getInnerPointByLocal(t,e,s,i){return this.getInnerPoint(t,this.parent,s,i)}getLocalPoint(t,e,s,i){const r=i?t:{};return this.worldToLocal(t,r,s,e),r}getLocalPointByInner(t,e,s,i){return this.getWorldPoint(t,this.parent,s,i)}getPagePoint(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,i)}getWorldPoint(t,e,s,i){const r=i?t:{};return this.innerToWorld(t,r,s,e),r}getWorldPointByBox(t,e,s,i){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,i),e,s,!0)}getWorldPointByLocal(t,e,s,i){const r=i?t:{};return this.localToWorld(t,r,s,e),r}getWorldPointByPage(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,i)}setTransform(t,e,s){da(this,t,e,s)}transform(t,e,s){ha(this,t,e,s)}move(t,e,s){ta(this,t,e,s)}moveInner(t,e,s){ra(this,t,e,!0,s)}scaleOf(t,e,s,i,r){ea(this,ua(this,t),e,s,i,r)}rotateOf(t,e,s){sa(this,ua(this,t),e,s)}skewOf(t,e,s,i,r){ia(this,ua(this,t),e,s,i,r)}transformWorld(t,e,s){la(this,t,e,s)}moveWorld(t,e,s){ra(this,t,e,!1,s)}scaleOfWorld(t,e,s,i,r){oa(this,t,e,s,i,r)}rotateOfWorld(t,e){na(this,t,e)}skewOfWorld(t,e,s,i,r){aa(this,t,e,s,i,r)}flip(t,e){ha(this,ca(this,t),!1,e)}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}__hitWorld(t){return!0}__hit(t){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e,s){}__clip(t,e){}__renderShape(t,e){}__drawShape(t,e){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}getMotionPathData(){return Tt.need("path")}getMotionPoint(t){return Tt.need("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){pa(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,i){}off_(t){}once(t,e,s,i){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,s){s?this.addAttr(t,e,s):io(this.prototype,t,e)}static addAttr(t,e,s,i){s||(s=Dr),s(e,i)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new Jo(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(Jo.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}},t.Leaf=Xt([co(Rn),co(An),co(Nn),co(Bn),co(Yn)],t.Leaf);const{setListWithFn:fa}=_t,{sort:ga}=Oo,{localBoxBounds:ya,localStrokeBounds:ma,localRenderBounds:xa,maskLocalBoxBounds:wa,maskLocalStrokeBounds:va,maskLocalRenderBounds:ba}=Eo,Ba=new bt("Branch");t.Branch=class extends t.Leaf{__updateStrokeSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.renderSpread)return 1;return 0}__updateBoxBounds(){fa(this.__layout.boxBounds,this.children,this.__hasMask?wa:ya)}__updateStrokeBounds(){fa(this.__layout.strokeBounds,this.children,this.__hasMask?va:ma)}__updateRenderBounds(){fa(this.__layout.renderBounds,this.children,this.__hasMask?ba:xa)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,i=e.length;s<i;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(ga),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return Ba.warn("add self or destroyed");const s=void 0===e;if(!t.__){if(t instanceof Array)return t.forEach((t=>{this.add(t,e),s||e++}));t=Et.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,s?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const i=t.__layout;i.boxChanged||i.boxChange(),i.matrixChanged||i.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(Jo.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Jo.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",(()=>this.__remove(t,e))):this.__remove(t,e):this.find(t).forEach((t=>this.remove(t,e))):void 0===t&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach((e=>{this.__realRemoveChild(e),t&&e.destroy()})))}clear(){this.removeAll(!0)}__remove(t,e){const s=this.children.indexOf(t);s>-1&&(this.children.splice(s,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(Jo.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Jo.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new Jo(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}},t.Branch=Xt([co(jn)],t.Branch);class ka{get length(){return this.list.length}constructor(t){this.reset(),t&&(t instanceof Array?this.addList(t):this.add(t))}has(t){return t&&void 0!==this.keys[t.innerId]}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return void 0===e?-1:e}add(t){const{list:e,keys:s}=this;void 0===s[t.innerId]&&(e.push(t),s[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:s}=this;if(void 0===s[t.innerId]){const{list:i}=this;for(let t=e,r=i.length;t<r;t++)s[i[t].innerId]++;0===e?i.unshift(t):(e>i.length&&(e=i.length),i.splice(e,0,t)),s[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let s;for(let i=0,r=e.length;i<r;i++)void 0!==s?this.keys[e[i].innerId]=i-1:e[i].innerId===t.innerId&&(s=i,delete this.keys[t.innerId]);void 0!==s&&e.splice(s,1)}sort(t){const{list:e}=this;t?e.sort(((t,e)=>e.__level-t.__level)):e.sort(((t,e)=>t.__level-e.__level))}forEach(t){this.list.forEach(t)}clone(){const t=new ka;return t.list=[...this.list],t.keys=Object.assign({},this.keys),t}update(){this.keys={};const{list:t,keys:e}=this;for(let s=0,i=t.length;s<i;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class Sa{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(t instanceof Array?this.addList(t):this.add(t))}has(t){return void 0!==this.keys[t.innerId]}without(t){return void 0===this.keys[t.innerId]}sort(t){const{levels:e}=this;t?e.sort(((t,e)=>e-t)):e.sort(((t,e)=>t-e))}addList(t){t.forEach((t=>{this.add(t)}))}add(t){const{keys:e,levelMap:s}=this;e[t.innerId]||(e[t.innerId]=1,s[t.__level]?s[t.__level].push(t):(s[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach((s=>{e=this.levelMap[s];for(let s=0,i=e.length;s<i;s++)t(e[s])}))}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const Ra=bt.get("LeaferCanvas");class Ca extends ee{set zIndex(t){const{style:e}=this.view;e.zIndex=t,this.setAbsolute(this.view)}set childIndex(t){const{view:e,parentView:s}=this;if(e&&s){const i=s.children[t];i?(this.setAbsolute(i),s.insertBefore(e,i)):s.appendChild(i)}}init(){const{config:t}=this,s=t.view||t.canvas;s?this.__createViewFrom(s):this.__createView();const{style:i}=this.view;if(i.display||(i.display="block"),this.parentView=this.view.parentElement,this.parentView){const t=this.parentView.style;t.webkitUserSelect=t.userSelect="none"}e.syncDomFont&&!this.parentView&&(i.display="none",document.body.appendChild(this.view)),this.__createContext(),this.autoLayout||this.resize(t)}set backgroundColor(t){this.view.style.backgroundColor=t}get backgroundColor(){return this.view.style.backgroundColor}set hittable(t){this.view.style.pointerEvents=t?"auto":"none"}get hittable(){return"none"!==this.view.style.pointerEvents}__createView(){this.view=document.createElement("canvas")}__createViewFrom(t){let e="string"==typeof t?document.getElementById(t):t;if(e)if(e instanceof HTMLCanvasElement)this.view=e;else{let t=e;if(e===window||e===document){const e=document.createElement("div"),{style:s}=e;s.position="absolute",s.top=s.bottom=s.left=s.right="0px",document.body.appendChild(e),t=e}this.__createView();const s=this.view;t.hasChildNodes()&&(this.setAbsolute(s),t.style.position||(t.style.position="relative")),t.appendChild(s)}else Ra.error(`no id: ${t}`),this.__createView()}setAbsolute(t){const{style:e}=t;e.position="absolute",e.top=e.left="0px"}updateViewSize(){const{width:t,height:e,pixelRatio:s}=this,{style:i}=this.view;i.width=t+"px",i.height=e+"px",this.view.width=Math.ceil(t*s),this.view.height=Math.ceil(e*s)}updateClientBounds(){this.view.parentElement&&(this.clientBounds=this.view.getBoundingClientRect())}startAutoLayout(t,s){if(this.resizeListener=s,t){this.autoBounds=t;try{this.resizeObserver=new ResizeObserver((t=>{this.updateClientBounds();for(const e of t)this.checkAutoBounds(e.contentRect)}));const t=this.parentView;t?(this.resizeObserver.observe(t),this.checkAutoBounds(t.getBoundingClientRect())):(this.checkAutoBounds(this.view),Ra.warn("no parent"))}catch(t){this.imitateResizeObserver()}}else window.addEventListener("resize",this.windowListener=()=>{const t=e.devicePixelRatio;if(!this.config.pixelRatio&&this.pixelRatio!==t){const{width:e,height:s}=this;this.emitResize({width:e,height:s,pixelRatio:t})}})}imitateResizeObserver(){this.autoLayout&&(this.parentView&&this.checkAutoBounds(this.parentView.getBoundingClientRect()),e.requestRender(this.imitateResizeObserver.bind(this)))}checkAutoBounds(t){const s=this.view,{x:i,y:r,width:o,height:n}=this.autoBounds.getBoundsFrom(t),a={width:o,height:n,pixelRatio:this.config.pixelRatio?this.pixelRatio:e.devicePixelRatio};if(!this.isSameSize(a)){const{style:t}=s;t.marginLeft=i+"px",t.marginTop=r+"px",this.emitResize(a)}}stopAutoLayout(){this.autoLayout=!1,this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeListener=this.resizeObserver=null}emitResize(t){const e={};Ft.copyAttrs(e,this,te),this.resize(t),this.resizeListener&&void 0!==this.width&&this.resizeListener(new nn(t,e))}unrealCanvas(){if(!this.unreal&&this.parentView){const t=this.view;t&&t.remove(),this.view=this.parentView,this.unreal=!0}}destroy(){if(this.view){if(this.stopAutoLayout(),this.windowListener&&(window.removeEventListener("resize",this.windowListener),this.windowListener=null),!this.unreal){const t=this.view;t.parentElement&&t.remove()}super.destroy()}}}ur(CanvasRenderingContext2D.prototype),ur(Path2D.prototype);const{mineType:Pa,fileType:Ta}=_r;function La(t,s){e.origin={createCanvas(t,e){const s=document.createElement("canvas");return s.width=t,s.height=e,s},canvasToDataURL:(t,e,s)=>{const i=Pa(e),r=t.toDataURL(i,s);return"image/bmp"===i?r.replace("image/png;","image/bmp;"):r},canvasToBolb:(t,e,s)=>new Promise((i=>t.toBlob(i,Pa(e),s))),canvasSaveAs:(t,s,i)=>{const r=t.toDataURL(Pa(Ta(s)),i);return e.origin.download(r,s)},download:(t,e)=>new Promise((s=>{let i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),s()})),loadImage:t=>new Promise(((s,i)=>{const r=new e.origin.Image,{crossOrigin:o}=e.image;o&&(r.setAttribute("crossOrigin",o),r.crossOrigin=o),r.onload=()=>{s(r)},r.onerror=t=>{i(t)},r.src=e.image.getRealURL(t)})),Image:Image,PointerEvent:PointerEvent,DragEvent:DragEvent},e.event={stopDefault(t){t.preventDefault()},stopNow(t){t.stopImmediatePropagation()},stop(t){t.stopPropagation()}},e.canvas=Lt.canvas(),e.conicGradientSupport=!!e.canvas.context.createConicGradient}Object.assign(Lt,{canvas:(t,e)=>new Ca(t,e),image:t=>new Sr(t)}),e.name="web",e.isMobile="ontouchstart"in window,e.requestRender=function(t){window.requestAnimationFrame(t)},Rr(e,"devicePixelRatio",{get:()=>devicePixelRatio});const{userAgent:Ia}=navigator;Ia.indexOf("Firefox")>-1?(e.conicGradientRotate90=!0,e.intWheelDeltaY=!0,e.syncDomFont=!0):Ia.indexOf("AppleWebKit")>-1&&(e.fullImageShadow=!0),Ia.indexOf("Windows")>-1?(e.os="Windows",e.intWheelDeltaY=!0):Ia.indexOf("Mac")>-1?e.os="Mac":Ia.indexOf("Linux")>-1&&(e.os="Linux");class Ea{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove){const t=new ka;return this.__updatedList.list.forEach((e=>{e.leafer&&t.add(e)})),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new ka,this.target=t,e&&(this.config=Ft.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(ln.REQUEST)}__onAttrChange(t){this.__updatedList.add(t.target),this.update()}__onChildEvent(t){t.type===Jo.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent)),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new an(an.DATA,{updatedList:this.updatedList})),this.__updatedList=new ka,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[$o.CHANGE,this.__onAttrChange,this],[[Jo.ADD,Jo.REMOVE],this.__onChildEvent,this],[an.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:Aa,updateBounds:Oa,updateChange:Ma}=ko,{pushAllChildBranch:Wa,pushAllParent:Da}=Oo;const{worldBounds:Fa}=Eo;class za{constructor(t){this.updatedBounds=new yt,this.beforeBounds=new yt,this.afterBounds=new yt,t instanceof Array&&(t=new ka(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,Fa)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,Fa),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}}const{updateAllMatrix:Ua,updateAllChange:Na}=ko,Ya=bt.get("Layouter");class Xa{constructor(t,e){this.totalTimes=0,this.config={},this.__levelList=new Sa,this.target=t,e&&(this.config=Ft.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(hn.START),this.layoutOnce(),t.emitEvent(new hn(hn.END,this.layoutedBlocks,this.times))}catch(t){Ya.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?Ya.warn("layouting"):this.times>3?Ya.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(an.REQUEST),this.totalTimes>1?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=Rt.start("PartLayout"),{target:s,__updatedList:i}=this,{BEFORE:r,LAYOUT:o,AFTER:n}=hn,a=this.getBlocks(i);a.forEach((t=>t.setBefore())),s.emitEvent(new hn(r,a,this.times)),this.extraBlock=null,i.sort(),function(t,e){let s;t.list.forEach((t=>{s=t.__layout,e.without(t)&&!s.proxyZoom&&(s.matrixChanged?(Aa(t,!0),e.add(t),t.isBranch&&Wa(t,e),Da(t,e)):s.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),Da(t,e)))}))}(i,this.__levelList),function(t){let e,s,i;t.sort(!0),t.levels.forEach((r=>{e=t.levelMap[r];for(let t=0,r=e.length;t<r;t++){if(s=e[t],s.isBranch&&s.__tempNumber){i=s.children;for(let t=0,e=i.length;t<e;t++)i[t].isBranch||Oa(i[t])}Oa(s)}}))}(this.__levelList),function(t){t.list.forEach(Ma)}(i),this.extraBlock&&a.push(this.extraBlock),a.forEach((t=>t.setAfter())),s.emitEvent(new hn(o,a,this.times)),s.emitEvent(new hn(n,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,Rt.end(e)}fullLayout(){const t=Rt.start("FullLayout"),{target:e}=this,{BEFORE:s,LAYOUT:i,AFTER:r}=hn,o=this.getBlocks(new ka(e));e.emitEvent(new hn(s,o,this.times)),Xa.fullLayout(e),o.forEach((t=>{t.setAfter()})),e.emitEvent(new hn(i,o,this.times)),e.emitEvent(new hn(r,o,this.times)),this.addBlocks(o),Rt.end(t)}static fullLayout(t){Ua(t,!0),t.isBranch?Oo.updateBounds(t):ko.updateBounds(t),Na(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:s}=this.extraBlock||(this.extraBlock=new za([]));e.length?s.add(t.__world):s.set(t.__world),e.add(t)}}createBlock(t){return new za(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){this.__eventIds=[this.target.on_([[hn.REQUEST,this.layout,this],[hn.AGAIN,this.layoutAgain,this],[an.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const ja=bt.get("Renderer");class Ha{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,s){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,maxFPS:60},this.target=t,this.canvas=e,s&&(this.config=Ft.default(s,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.__requestRender()}requestLayout(){this.target.emit(hn.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(ln.CHILD_START,t),t.children.forEach((t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()})),t.emit(ln.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(ln.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new yt,ja.log(e.innerName,"---\x3e");try{this.emitRender(ln.START),this.renderOnce(t),this.emitRender(ln.END,this.totalBounds),vr.clearRecycled()}catch(t){this.rendering=!1,ja.error(t)}ja.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return ja.warn("rendering");if(this.times>3)return ja.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new yt,this.renderOptions={},t)this.emitRender(ln.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(ln.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(ln.RENDER,this.renderBounds,this.renderOptions),this.emitRender(ln.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach((e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)})))}clipRender(t){const e=Rt.start("PartRender"),{canvas:s}=this,i=t.getIntersect(s.bounds),r=new yt(i);s.save(),i.spread(Ha.clipSpread).ceil(),s.clearWorld(i,!0),s.clipWorld(i,!0),this.__render(i,r),s.restore(),Rt.end(e)}fullRender(){const t=Rt.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),Rt.end(t)}__render(t,e){const{canvas:s}=this,i=t.includes(this.target.__world),r=i?{includes:i}:{bounds:t,includes:i};this.needFill&&s.fillWorld(t,this.config.fill),bt.showRepaint&&bt.drawRepaint(s,t),this.target.__render(s,r),this.renderBounds=e=e||t,this.renderOptions=r,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),s.updateRender(e)}addBlock(t){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new yt;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=this.target;if(this.requestTime||!t)return;if(t.parentApp)return t.parentApp.requestRender(!1);const s=this.requestTime=Date.now();e.requestRender((()=>{this.FPS=Math.min(60,Math.ceil(1e3/(Date.now()-s))),this.requestTime=0,this.checkRender()}))}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:s}=t.old;if(!new yt(0,0,e,s).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new yt(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map((t=>{let e;t.updatedList&&t.updatedList.list.some((t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||ja.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e))),this.addBlock(e?this.canvas.bounds:t.updatedBounds)}))}emitRender(t,e,s){this.target.emitEvent(new ln(t,this.times,e,s))}__listenEvents(){this.__eventIds=[this.target.on_([[ln.REQUEST,this.update,this],[hn.END,this.__onLayoutEnd,this],[ln.AGAIN,this.renderAgain,this],[nn.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.canvas=this.config=null)}}function Ga(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}})))}function Va(t){return Tr(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}})))}function qa(){return(t,e)=>{const s="_"+e;Rr(t,e,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}Ha.clipSpread=10,Object.assign(Lt,{watcher:(t,e)=>new Ea(t,e),layouter:(t,e)=>new Xa(t,e),renderer:(t,e,s)=>new Ha(t,e,s),selector:(t,e)=>{},interaction:(t,e,s,i)=>{}}),e.layout=Xa.fullLayout;const Qa={},Ja={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},$a={number:(t,e)=>"object"==typeof t?"percent"===t.type?t.value*e:t.value:t},Za={},Ka={},th={},eh={},sh={},ih={apply(){Tt.need("filter")}},rh={},oh={setStyleName:()=>Tt.need("state"),set:()=>Tt.need("state")},nh={list:{},register(t,e){nh.list[t]=e},get:t=>nh.list[t]},{parse:ah,objectToCanvasData:hh}=Bs,{stintSet:lh}=Ft,{hasTransparent:dh}=Ja,ch={},uh=bt.get("UIData");class _h extends Ut{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,uh.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,uh.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),"string"!=typeof t&&t?"object"==typeof t&&this.__setPaint("fill",t):(lh(this,"__isTransparentFill",dh(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t)}setStroke(t){"string"!=typeof t&&t?"object"==typeof t&&this.__setPaint("stroke",t):(lh(this,"__isTransparentStroke",dh(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t)}setPath(t){const e="string"==typeof t;e||t&&"object"==typeof t[0]?(this.__setInput("path",t),this._path=e?ah(t):hh(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){ph(this,"shadow",t)}setInnerShadow(t){ph(this,"innerShadow",t)}setFilter(t){ph(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&Ka.compute("fill",this.__leaf),e&&Ka.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:s}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),void 0!==t.strokeWidthFixed&&(s=t.strokeWidthFixed)),s){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const s=this.__leaf.__layout;s.boxChanged||s.boxChange(),e instanceof Array&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=ch)):(this.__isStrokes=!0,this._stroke||(this._stroke=ch))}__removePaint(t,e){e&&this.__removeInput(t),th.recycleImage(t,this),"fill"===t?(lh(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(lh(this,"__isAlphaPixelStroke",void 0),lh(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function ph(t,e,s){t.__setInput(e,s),s instanceof Array?(s.some((t=>!1===t.visible))&&(s=s.filter((t=>!1!==t.visible))),s.length||(s=void 0)):s=s&&!1!==s.visible?[s]:void 0,t["_"+e]=s}class fh extends _h{}class gh extends fh{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"hide"===t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class yh extends fh{__getInputData(t,e){const s=super.__getInputData(t,e);return te.forEach((t=>delete s[t])),s}}class mh extends gh{}class xh extends _h{}class wh extends _h{get __boxStroke(){return!this.__pathInputed}}class vh extends _h{get __boxStroke(){return!this.__pathInputed}}class bh extends _h{}class Bh extends _h{}class kh extends _h{get __pathInputed(){return 2}}class Sh extends fh{}const Rh={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class Ch extends _h{get __useNaturalRatio(){return!1}setFontWeight(t){"string"==typeof t?(this.__setInput("fontWeight",t),t=Rh[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,s=e.__box;if(t){const{boxStyle:i}=this;if(s)for(let t in i)s[t]=void 0;else s=e.__box=Et.get("Rect",0);const r=e.__layout,o=s.__layout;i||(s.parent=e,s.__world=e.__world,o.boxBounds=r.boxBounds),s.set(t),o.strokeChanged&&r.strokeChange(),o.renderChanged&&r.renderChange(),s.__updateChange()}else s&&(e.__box=s.parent=null,s.destroy());this._boxStyle=t}}class Ph extends wh{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:"image",mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return delete t.fill,t}__getInputData(t,e){const s=super.__getInputData(t,e);return delete s.fill,s}}class Th extends wh{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url=this.__leaf.canvas.toDataURL("image/png"),s}}const Lh={__updateStrokeSpread(){let t=0,e=0;const s=this.__,{strokeAlign:i,__maxStrokeWidth:r}=s,o=this.__box;if((s.stroke||"all"===s.hitStroke)&&r&&"inside"!==i&&(e=t="center"===i?r/2:r,!s.__boxStroke)){const e=s.__isLinePath?0:10*t,i="none"===s.strokeCap?0:r;t+=Math.max(e,i)}return s.__useArrow&&(t+=5*r),o&&(t=Math.max(o.__layout.strokeSpread=o.__updateStrokeSpread(),t),e=o.__layout.strokeBoxSpread),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:i,backgroundBlur:r,filter:o,renderSpread:n}=this.__;e&&e.forEach((e=>t=Math.max(t,Math.max(Math.abs(e.y),Math.abs(e.x))+(e.spread>0?e.spread:0)+1.5*e.blur))),i&&(t=Math.max(t,i)),o&&(t+=ih.getSpread(o)),n&&(t+=n);let a=t=Math.ceil(t);return s&&s.forEach((t=>a=Math.max(a,Math.max(Math.abs(t.y),Math.abs(t.x))+(t.spread<0?-t.spread:0)+1.5*t.blur))),r&&(a=Math.max(a,r)),this.__layout.renderShapeSpread=a,t+=this.__layout.strokeSpread||0,this.__box?Math.max(this.__box.__updateRenderSpread(),t):t}},{stintSet:Ih}=Ft,Eh={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);Ih(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),Ih(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:s,stroke:i}=t,r=t.innerShadow||t.blur||t.backgroundBlur||t.filter;Ih(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&s&&!t.__isTransparentFill&&!(s instanceof Array&&s.length>1)&&(this.useFastShadow||!i||i&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),Ih(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){Ah(this,t,e)},__draw(t,e,s){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:r,stroke:o,__drawAfterFill:n,__fillAfterStroke:a,__isFastShadow:h}=i;if(this.__drawRenderPath(t),i.__useEffect&&!h){const h=Ka.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=i;l&&sh.shadow(this,t,h),a&&(i.__isStrokes?Ka.strokes(o,this,t):Ka.stroke(o,this,t)),r&&(i.__isFills?Ka.fills(r,this,t):Ka.fill(r,this,t)),n&&this.__drawAfterFill(t,e),d&&sh.innerShadow(this,t,h),o&&!a&&(i.__isStrokes?Ka.strokes(o,this,t):Ka.stroke(o,this,t)),c&&ih.apply(c,this,this.__nowWorld,t,s,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(i.__isStrokes?Ka.strokes(o,this,t):Ka.stroke(o,this,t)),h){const e=i.shadow[0],{scaleX:s,scaleY:r}=this.__nowWorld;t.save(),t.setWorldShadow(e.x*s,e.y*r,e.blur*s,Ja.string(e.color))}r&&(i.__isFills?Ka.fills(r,this,t):Ka.fill(r,this,t)),h&&t.restore(),n&&this.__drawAfterFill(t,e),o&&!a&&(i.__isStrokes?Ka.strokes(o,this,t):Ka.stroke(o,this,t))}}else i.__pathInputed?Ah(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const s=this.__,{fill:i,stroke:r}=s;i&&!e.ignoreFill&&(s.__isAlphaPixelFill?Ka.fills(i,this,t):Ka.fill("#000000",this,t)),s.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(s.__isAlphaPixelStroke?Ka.strokes(r,this,t):Ka.stroke("#000000",this,t))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function Ah(t,e,s){const{fill:i,stroke:r,__drawAfterFill:o,__fillAfterStroke:n}=t.__;t.__drawRenderPath(e),n&&Ka.stroke(r,t,e),i&&Ka.fill(i,t,e),o&&t.__drawAfterFill(e,s),r&&!n&&Ka.stroke(r,t,e)}const Oh={__drawFast(t,e){let{x:s,y:i,width:r,height:o}=this.__layout.boxBounds;const{fill:n,stroke:a,__drawAfterFill:h}=this.__;if(n&&(t.fillStyle=n,t.fillRect(s,i,r,o)),h&&this.__drawAfterFill(t,e),a){const{strokeAlign:n,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(a,h,this.__);const l=h/2;switch(n){case"center":t.strokeRect(0,0,r,o);break;case"inside":r-=h,o-=h,r<0||o<0?(t.save(),this.__clip(t,e),t.strokeRect(s+l,i+l,r,o),t.restore()):t.strokeRect(s+l,i+l,r,o);break;case"outside":t.strokeRect(s-l,i-l,r+h,o+h)}}}};var Mh,Wh;t.UI=Mh=class extends t.Leaf{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){a.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return dr.set(this.path=t||[]),t||this.__drawPathByBox(dr),dr}constructor(t){super(t)}reset(t){}set(t,e){t&&(e?"temp"===e?(this.lockNormalStyle=!0,Object.assign(this,t),this.lockNormalStyle=!1):this.animate(t,e):Object.assign(this,t))}get(t){return"string"==typeof t?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return Tt.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return Tt.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let s=e?this.__.__pathForRender:this.__.path;return s||(dr.set(s=[]),this.__drawPathByBox(dr)),t?Bs.toCanvasData(s,!0):s}getPathString(t,e,s){return Bs.stringify(this.getPath(t,e),s)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||rh.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?lr.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&Za.addArrows(this,!t.cornerRadius)):t.__pathForRender&&(t.__pathForRender=void 0)}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?ki.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:s,width:i,height:r}=this.__layout.boxBounds;if(this.__.cornerRadius){const{cornerRadius:o}=this.__;t.roundRect(e,s,i,r,"number"==typeof o?[o]:o)}else t.rect(e,s,i,r)}drawImagePlaceholder(t,e){Ka.fill(this.__.placeholderColor,this,t)}animate(t,e,s,i){return Tt.need("animate")}killAnimate(t,e){}export(t,e){return Tt.need("export")}syncExport(t,e){return Tt.need("export")}clone(t){const e=Ft.clone(this.toJSON());return t&&Object.assign(e,t),Mh.one(e)}static one(t,e,s,i,r){return Et.get(t.tag||this.prototype.__tag,t,e,s,i,r)}static registerUI(){uo()(this)}static registerData(t){so(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}},Xt([so(_h)],t.UI.prototype,"__",void 0),Xt([qa()],t.UI.prototype,"zoomLayer",void 0),Xt([Er("")],t.UI.prototype,"id",void 0),Xt([Er("")],t.UI.prototype,"name",void 0),Xt([Er("")],t.UI.prototype,"className",void 0),Xt([Gr("pass-through")],t.UI.prototype,"blendMode",void 0),Xt([Vr(1)],t.UI.prototype,"opacity",void 0),Xt([qr(!0)],t.UI.prototype,"visible",void 0),Xt([Gr(!1)],t.UI.prototype,"locked",void 0),Xt([Gr(!1)],t.UI.prototype,"dim",void 0),Xt([Gr(!1)],t.UI.prototype,"dimskip",void 0),Xt([$r(0)],t.UI.prototype,"zIndex",void 0),Xt([Zr(!1)],t.UI.prototype,"mask",void 0),Xt([Kr(!1)],t.UI.prototype,"eraser",void 0),Xt([Ar(0,!0)],t.UI.prototype,"x",void 0),Xt([Ar(0,!0)],t.UI.prototype,"y",void 0),Xt([Dr(100,!0)],t.UI.prototype,"width",void 0),Xt([Dr(100,!0)],t.UI.prototype,"height",void 0),Xt([Mr(1,!0)],t.UI.prototype,"scaleX",void 0),Xt([Mr(1,!0)],t.UI.prototype,"scaleY",void 0),Xt([Wr(0,!0)],t.UI.prototype,"rotation",void 0),Xt([Wr(0,!0)],t.UI.prototype,"skewX",void 0),Xt([Wr(0,!0)],t.UI.prototype,"skewY",void 0),Xt([Ar(0,!0)],t.UI.prototype,"offsetX",void 0),Xt([Ar(0,!0)],t.UI.prototype,"offsetY",void 0),Xt([Ar(0,!0)],t.UI.prototype,"scrollX",void 0),Xt([Ar(0,!0)],t.UI.prototype,"scrollY",void 0),Xt([Or()],t.UI.prototype,"origin",void 0),Xt([Or()],t.UI.prototype,"around",void 0),Xt([Er(!1)],t.UI.prototype,"lazy",void 0),Xt([Fr(1)],t.UI.prototype,"pixelRatio",void 0),Xt([Hr(0)],t.UI.prototype,"renderSpread",void 0),Xt([Ur()],t.UI.prototype,"path",void 0),Xt([Nr()],t.UI.prototype,"windingRule",void 0),Xt([Nr(!0)],t.UI.prototype,"closed",void 0),Xt([Dr(0)],t.UI.prototype,"padding",void 0),Xt([Dr(!1)],t.UI.prototype,"lockRatio",void 0),Xt([Dr()],t.UI.prototype,"widthRange",void 0),Xt([Dr()],t.UI.prototype,"heightRange",void 0),Xt([Er(!1)],t.UI.prototype,"draggable",void 0),Xt([Er()],t.UI.prototype,"dragBounds",void 0),Xt([Er(!1)],t.UI.prototype,"editable",void 0),Xt([to(!0)],t.UI.prototype,"hittable",void 0),Xt([to("path")],t.UI.prototype,"hitFill",void 0),Xt([jr("path")],t.UI.prototype,"hitStroke",void 0),Xt([to(!1)],t.UI.prototype,"hitBox",void 0),Xt([to(!0)],t.UI.prototype,"hitChildren",void 0),Xt([to(!0)],t.UI.prototype,"hitSelf",void 0),Xt([to()],t.UI.prototype,"hitRadius",void 0),Xt([eo("")],t.UI.prototype,"cursor",void 0),Xt([Gr()],t.UI.prototype,"fill",void 0),Xt([jr(void 0,!0)],t.UI.prototype,"stroke",void 0),Xt([jr("inside")],t.UI.prototype,"strokeAlign",void 0),Xt([jr(1,!0)],t.UI.prototype,"strokeWidth",void 0),Xt([jr(!1)],t.UI.prototype,"strokeWidthFixed",void 0),Xt([jr("none")],t.UI.prototype,"strokeCap",void 0),Xt([jr("miter")],t.UI.prototype,"strokeJoin",void 0),Xt([jr()],t.UI.prototype,"dashPattern",void 0),Xt([jr(0)],t.UI.prototype,"dashOffset",void 0),Xt([jr(10)],t.UI.prototype,"miterLimit",void 0),Xt([Nr(0)],t.UI.prototype,"cornerRadius",void 0),Xt([Nr()],t.UI.prototype,"cornerSmoothing",void 0),Xt([Ga()],t.UI.prototype,"shadow",void 0),Xt([Ga()],t.UI.prototype,"innerShadow",void 0),Xt([Ga()],t.UI.prototype,"blur",void 0),Xt([Ga()],t.UI.prototype,"backgroundBlur",void 0),Xt([Ga()],t.UI.prototype,"grayscale",void 0),Xt([Ga()],t.UI.prototype,"filter",void 0),Xt([Gr()],t.UI.prototype,"placeholderColor",void 0),Xt([Er(100)],t.UI.prototype,"placeholderDelay",void 0),Xt([Er({})],t.UI.prototype,"data",void 0),Xt([ao(t.Leaf.prototype.reset)],t.UI.prototype,"reset",null),t.UI=Mh=Xt([co(Lh),co(Eh),ho()],t.UI),t.Group=class extends t.UI{get __tag(){return"Group"}get isBranch(){return!0}constructor(t){super(t)}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:s}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),s.forEach((t=>this.add(t))),t.children=s}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);return this.childlessJSON||(e.children=this.children.map((e=>e.toJSON(t)))),e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}},Xt([so(fh)],t.Group.prototype,"__",void 0),Xt([Dr(0)],t.Group.prototype,"width",void 0),Xt([Dr(0)],t.Group.prototype,"height",void 0),t.Group=Xt([co(t.Branch),uo()],t.Group);const Dh=bt.get("Leafer");t.Leafer=Wh=class extends t.Group{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&xr.isComplete}get layoutLocked(){return!this.layouter.running}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||{x:0,y:0,width:0,height:0}}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),Wh.list.add(this)}init(t,e){if(this.canvas)return;let s;const{config:i}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),s=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,Ft.assign(i,t));const r=this.canvas=Lt.canvas(i);this.__controllers.push(this.renderer=Lt.renderer(this,r,i),this.watcher=Lt.watcher(this,i),this.layouter=Lt.layouter(this,i)),this.isApp&&this.__setApp(),this.__checkAutoLayout(i,e),this.view=r.view,e||(this.selector=Lt.selector(this),this.interaction=Lt.interaction(this,r,this.selector,i),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=Lt.hitCanvasManager()),this.canvasManager=new Dt,s=i.start),this.hittable=i.hittable,this.fill=i.fill,this.canvasManager.add(r),this.__listenEvents(),s&&(this.__startTimer=setTimeout(this.start.bind(this))),Fo.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit((()=>{super.set(t,e)}))}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(dn.RESTART):this.emitLeafer(dn.START),this.__controllers.forEach((t=>t.start())),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach((t=>t.stop())),this.running=!1,this.emitLeafer(dn.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=Ft.copyAttrs({},t,te);Object.keys(e).forEach((t=>this[t]=e[t]))}forceRender(t,e){const{renderer:s}=this;s&&(s.addBlock(t?new yt(t):this.canvas.bounds),this.viewReady&&(e?s.render():s.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const s=Ft.copyAttrs({},this.canvas,te);e.resize(t),this.updateLazyBounds(),this.__onResize(new nn(t,s))}__onResize(t){this.emitEvent(t),Ft.copyAttrs(this.__,t,te),setTimeout((()=>{this.canvasManager&&this.canvasManager.clearRecycled()}),0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(t,e){e||(t.width&&t.height||(this.autoLayout=new xt(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(te.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t&&(this.canvas.zIndex=e,setTimeout((()=>this.parent&&this.parent.__updateSortChildren())))),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&te.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const s=Ft.copyAttrs({},this.canvas,te);s[t]=this.config[t]=e,e&&this.canvas.stopAutoLayout(),this.__doResize(s)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(dn.BEFORE_READY),this.emitLeafer(dn.READY),this.emitLeafer(dn.AFTER_READY),Fo.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(dn.VIEW_READY),Fo.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:s}=this.config;if(t){let{width:i,height:r,pixelRatio:o}=this;const n="box"===t?this.worldBoxBounds:this.__world;e||(i=Math.max(1,n.x+n.width)),s||(r=Math.max(1,n.y+n.height)),this.__doResize({width:i,height:r,pixelRatio:o})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){Fo.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender((()=>{this.imageReady&&(t&&this.emitLeafer(dn.VIEW_COMPLETED),Fo.run(this.__viewCompletedWait),this.viewCompleted=!0)}))}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender((()=>this.interaction.updateCursor()))}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,s){e&&(t=t.bind(e));const i=this.__nextRenderWait;if(s){for(let e=0;e<i.length;e++)if(i[e]===t){i.splice(e,1);break}}else i.push(t);this.requestRender()}zoom(t,e,s,i){return Tt.need("view")}getValidMove(t,e){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:s}=this.clientBounds;return{x:e+t.x,y:s+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new dn(t,this))}__listenEvents(){const t=Rt.start("FirstCreate "+this.innerName);this.once([[dn.START,()=>Rt.end(t)],[hn.START,this.updateLazyBounds,this],[ln.START,this.__onCreated,this],[ln.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[an.DATA,this.__onWatchData,this],[hn.END,this.__onLayoutEnd,this],[ln.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){Wh.list.remove(this);try{this.stop(),this.emitLeafer(dn.END),this.__removeListenEvents(),this.__controllers.forEach((t=>!(this.parent&&t===this.interaction)&&t.destroy())),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager.destroy()),this.canvas.destroy(),this.config.view=this.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout((()=>{vr.clearRecycled()}),100)}catch(t){Dh.error(t)}}};t?e():setTimeout(e)}},t.Leafer.list=new ka,Xt([so(yh)],t.Leafer.prototype,"__",void 0),Xt([Dr()],t.Leafer.prototype,"pixelRatio",void 0),t.Leafer=Wh=Xt([uo()],t.Leafer),t.Rect=class extends t.UI{get __tag(){return"Rect"}constructor(t){super(t)}},Xt([so(wh)],t.Rect.prototype,"__",void 0),t.Rect=Xt([co(Oh),ho(),uo()],t.Rect);const{copy:Fh,add:zh,includes:Uh}=_t,Nh=t.Rect.prototype,Yh=t.Group.prototype,Xh={};t.Box=class extends t.Group{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.pathInputed){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t;if(this.children.length){const e=this.__,{renderBounds:s,boxBounds:i}=this.__layout;super.__updateRenderBounds(),Fh(Xh,s),this.__updateRectRenderBounds(),(e.scrollY||e.scrollX)&&(Xh.x+=e.scrollX,Xh.y+=e.scrollY),t=!Uh(i,Xh),t&&"hide"!==e.overflow&&zh(s,Xh)}else this.__updateRectRenderBounds();Ft.stintSet(this,"isOverflow",t),this.__updateScrollBar()}__updateRectRenderBounds(){}__updateScrollBar(){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.scrollBar&&this.scrollBar.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}},Xt([so(gh)],t.Box.prototype,"__",void 0),Xt([Dr(100)],t.Box.prototype,"width",void 0),Xt([Dr(100)],t.Box.prototype,"height",void 0),Xt([Er(!1)],t.Box.prototype,"resizeChildren",void 0),Xt([Hr("show")],t.Box.prototype,"overflow",void 0),Xt([ao(Nh.__updateStrokeSpread)],t.Box.prototype,"__updateStrokeSpread",null),Xt([ao(Nh.__updateRenderSpread)],t.Box.prototype,"__updateRectRenderSpread",null),Xt([ao(Nh.__updateBoxBounds)],t.Box.prototype,"__updateRectBoxBounds",null),Xt([ao(Nh.__updateStrokeBounds)],t.Box.prototype,"__updateStrokeBounds",null),Xt([ao(Nh.__updateRenderBounds)],t.Box.prototype,"__updateRectRenderBounds",null),Xt([ao(Nh.__updateChange)],t.Box.prototype,"__updateRectChange",null),Xt([ao(Nh.__render)],t.Box.prototype,"__renderRect",null),Xt([ao(Yh.__render)],t.Box.prototype,"__renderGroup",null),t.Box=Xt([ho(),uo()],t.Box),t.Frame=class extends t.Box{get __tag(){return"Frame"}get isFrame(){return!0}constructor(t){super(t)}},Xt([so(mh)],t.Frame.prototype,"__",void 0),Xt([Gr("#FFFFFF")],t.Frame.prototype,"fill",void 0),Xt([Hr("hide")],t.Frame.prototype,"overflow",void 0),t.Frame=Xt([uo()],t.Frame);const{moveTo:jh,closePath:Hh,ellipse:Gh}=Gs;t.Ellipse=class extends t.UI{get __tag(){return"Ellipse"}constructor(t){super(t)}__updatePath(){const{width:t,height:s,innerRadius:i,startAngle:r,endAngle:o}=this.__,n=t/2,a=s/2,h=this.__.path=[];i?(r||o?(i<1&&Gh(h,n,a,n*i,a*i,0,r,o,!1),Gh(h,n,a,n,a,0,o,r,!0),i<1&&Hh(h)):(i<1&&(Gh(h,n,a,n*i,a*i),jh(h,t,a)),Gh(h,n,a,n,a,0,360,0,!0)),e.ellipseToCurve&&(this.__.path=this.getPath(!0))):r||o?(jh(h,n,a),Gh(h,n,a,n,a,0,r,o,!1),Hh(h)):Gh(h,n,a,n,a)}},Xt([so(vh)],t.Ellipse.prototype,"__",void 0),Xt([Nr(0)],t.Ellipse.prototype,"innerRadius",void 0),Xt([Nr(0)],t.Ellipse.prototype,"startAngle",void 0),Xt([Nr(0)],t.Ellipse.prototype,"endAngle",void 0),t.Ellipse=Xt([uo()],t.Ellipse);const{moveTo:Vh,lineTo:qh,drawPoints:Qh}=Gs,{rotate:Jh,getAngle:$h,getDistance:Zh,defaultPoint:Kh}=A,{toBounds:tl}=sr;t.Line=class extends t.UI{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,s={x:0,y:0};return t&&(s.x=t),e&&Jh(s,e),s}set toPoint(t){this.width=Zh(Kh,t),this.rotation=$h(Kh,t),this.height&&(this.height=0)}constructor(t){super(t)}__updatePath(){const t=this.__,e=t.path=[];t.points?Qh(e,t.points,!1,t.closed):(Vh(e,0,0),qh(e,this.width,0))}__updateRenderPath(){const t=this.__;!this.pathInputed&&t.points&&t.curve?(Qh(t.__pathForRender=[],t.points,t.curve,t.closed),t.__useArrow&&Za.addArrows(this,!1)):super.__updateRenderPath()}__updateBoxBounds(){this.points?tl(this.__.__pathForRender,this.__layout.boxBounds):super.__updateBoxBounds()}},Xt([so(xh)],t.Line.prototype,"__",void 0),Xt([Yr("center")],t.Line.prototype,"strokeAlign",void 0),Xt([Dr(0)],t.Line.prototype,"height",void 0),Xt([Nr()],t.Line.prototype,"points",void 0),Xt([Nr(0)],t.Line.prototype,"curve",void 0),Xt([Nr(!1)],t.Line.prototype,"closed",void 0),t.Line=Xt([uo()],t.Line);const{sin:el,cos:sl,PI:il}=Math,{moveTo:rl,lineTo:ol,closePath:nl,drawPoints:al}=Gs,hl=t.Line.prototype;t.Polygon=class extends t.UI{get __tag(){return"Polygon"}constructor(t){super(t)}__updatePath(){const t=this.__.path=[];if(this.__.points)al(t,this.__.points,!1,!0);else{const{width:e,height:s,sides:i}=this.__,r=e/2,o=s/2;rl(t,r,0);for(let e=1;e<i;e++)ol(t,r+r*el(2*e*il/i),o-o*sl(2*e*il/i));nl(t)}}__updateRenderPath(){}__updateBoxBounds(){}},Xt([so(bh)],t.Polygon.prototype,"__",void 0),Xt([Nr(3)],t.Polygon.prototype,"sides",void 0),Xt([Nr()],t.Polygon.prototype,"points",void 0),Xt([Nr(0)],t.Polygon.prototype,"curve",void 0),Xt([ao(hl.__updateRenderPath)],t.Polygon.prototype,"__updateRenderPath",null),Xt([ao(hl.__updateBoxBounds)],t.Polygon.prototype,"__updateBoxBounds",null),t.Polygon=Xt([ho(),uo()],t.Polygon);const{sin:ll,cos:dl,PI:cl}=Math,{moveTo:ul,lineTo:_l,closePath:pl}=Gs;t.Star=class extends t.UI{get __tag(){return"Star"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,corners:s,innerRadius:i}=this.__,r=t/2,o=e/2,n=this.__.path=[];ul(n,r,0);for(let t=1;t<2*s;t++)_l(n,r+(t%2==0?r:r*i)*ll(t*cl/s),o-(t%2==0?o:o*i)*dl(t*cl/s));pl(n)}},Xt([so(Bh)],t.Star.prototype,"__",void 0),Xt([Nr(5)],t.Star.prototype,"corners",void 0),Xt([Nr(.382)],t.Star.prototype,"innerRadius",void 0),t.Star=Xt([uo()],t.Star),t.Image=class extends t.Rect{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return t instanceof Array&&t[0].image}constructor(t){super(t)}},Xt([so(Ph)],t.Image.prototype,"__",void 0),Xt([Dr("")],t.Image.prototype,"url",void 0),t.Image=Xt([uo()],t.Image);const fl=t.Image;t.Canvas=class extends t.Rect{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=Lt.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new Sr({url:t}).load((t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new Zo(Zo.LOADED,{image:t}))}))}draw(t,e,s,i){const r=new U(t.worldTransform).invert(),o=new U;e&&o.translate(e.x,e.y),s&&("number"==typeof s?o.scale(s):o.scale(s.x,s.y)),i&&o.rotate(i),r.multiplyParent(o),t.__render(this.canvas,{matrix:r.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:s,height:i}=this.__,{view:r}=this.canvas;t.drawImage(r,0,0,r.width,r.height,0,0,s,i)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:s}=this.__;t.resize(this.__,s),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}},Xt([so(Th)],t.Canvas.prototype,"__",void 0),Xt([Va(100)],t.Canvas.prototype,"width",void 0),Xt([Va(100)],t.Canvas.prototype,"height",void 0),Xt([Va(1)],t.Canvas.prototype,"pixelRatio",void 0),Xt([Va(!0)],t.Canvas.prototype,"smooth",void 0),Xt([Er(!1)],t.Canvas.prototype,"safeResize",void 0),Xt([Va()],t.Canvas.prototype,"contextSettings",void 0),t.Canvas=Xt([uo()],t.Canvas);const{copyAndSpread:gl,includes:yl,spread:ml,setList:xl}=_t;function wl(t,e){const s=t.__,{rows:i,decorationY:r}=s.__textDrawData;let o;s.__isPlacehold&&s.placeholderColor&&(e.fillStyle=s.placeholderColor);for(let t=0,s=i.length;t<s;t++)o=i[t],o.text?e.fillText(o.text,o.x,o.y):o.data&&o.data.forEach((t=>{e.fillText(t.char,t.x,o.y)}));if(r){const{decorationColor:t,decorationHeight:o}=s.__textDrawData;t&&(e.fillStyle=t),i.forEach((t=>r.forEach((s=>e.fillRect(t.x,t.y+s,t.width,o)))))}}function vl(t,e){t.__.__font?wl(t,e):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function bl(t,e,s){switch(e.__.strokeAlign){case"center":Bl(t,1,e,s);break;case"inside":kl(t,"inside",e,s);break;case"outside":e.__.__fillAfterStroke?Bl(t,2,e,s):kl(t,"outside",e,s)}}function Bl(t,e,s,i){const r=s.__;"object"==typeof t?Rl(t,e,!0,s,i):(i.setStroke(t,r.__strokeWidth*e,r),Sl(s,i))}function kl(t,e,s,i){const r=i.getSameCanvas(!0,!0);r.font=s.__.__font,Bl(t,2,s,r),r.blendMode="outside"===e?"destination-out":"destination-in",wl(s,r),r.blendMode="normal",ko.copyCanvasByWorld(s,i,r),r.recycle(s.__nowWorld)}function Sl(t,e){let s,i=t.__.__textDrawData;const{rows:r,decorationY:o}=i;for(let t=0,i=r.length;t<i;t++)s=r[t],s.text?e.strokeText(s.text,s.x,s.y):s.data&&s.data.forEach((t=>{e.strokeText(t.char,t.x,s.y)}));if(o){const{decorationHeight:t}=i;r.forEach((s=>o.forEach((i=>e.strokeRect(s.x,s.y+i,s.width,t)))))}}function Rl(t,e,s,i,r){let o;const n=i.__,{__hasMultiStrokeStyle:a}=n;a||r.setStroke(void 0,n.__strokeWidth*e,n);for(let h=0,l=t.length;h<l;h++)if(o=t[h],(!o.image||!th.checkImage(i,r,o,!1))&&o.style){if(a){const{strokeStyle:t}=o;t?r.setStroke(o.style,n.__getRealStrokeWidth(t)*e,n,t):r.setStroke(o.style,n.__strokeWidth*e,n)}else r.strokeStyle=o.style;o.blendMode?(r.saveBlendMode(o.blendMode),s?Sl(i,r):r.stroke(),r.restoreBlendMode()):s?Sl(i,r):r.stroke()}}function Cl(t,e,s){const i=e.__;if(i.__strokeWidth)if(i.__font)bl(t,e,s);else switch(i.strokeAlign){case"center":Pl(t,1,e,s);break;case"inside":!function(t,e,s){s.save(),s.clipUI(e),Pl(t,2,e,s),s.restore()}(t,e,s);break;case"outside":!function(t,e,s){const i=e.__;if(i.__fillAfterStroke)Pl(t,2,e,s);else{const{renderBounds:r}=e.__layout,o=s.getSameCanvas(!0,!0);e.__drawRenderPath(o),Pl(t,2,e,o),o.clipUI(i),o.clearWorld(r),ko.copyCanvasByWorld(e,s,o),o.recycle(e.__nowWorld)}}(t,e,s)}}function Pl(t,e,s,i){const r=s.__;"object"==typeof t?Rl(t,e,!1,s,i):(i.setStroke(t,r.__strokeWidth*e,r),i.stroke()),r.__useArrow&&Ka.strokeArrow(t,s,i)}t.Text=class extends t.UI{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}constructor(t){super(t)}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:s,fontFamily:i,fontSize:r,fontWeight:o,italic:n,textCase:h,textOverflow:l,padding:d}=t;t.__lineHeight=$a.number(e,r),t.__letterSpacing=$a.number(s,r),t.__padding=d?a.fourNumber(d):void 0,t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${n?"italic ":""}${"small-caps"===h?"small-caps ":""}${"normal"!==o?o+" ":""}${r}px ${i}`,t.__clipText="show"!==l&&!t.__autoSize,t.__textDrawData=Qa.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:s,italic:i,padding:r,__autoWidth:o,__autoHeight:n}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<s&&ml(a,s/2),o||n){if(h.x=o?a.x:0,h.y=n?a.y:0,h.width=o?a.width:t.width,h.height=n?a.height:t.height,r){const[e,s,i,r]=t.__padding;o&&(h.x-=r,h.width+=s+r),n&&(h.y-=e,h.height+=i+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();i&&(h.width+=.16*s),Ft.stintSet(this,"isOverflow",!yl(h,a)),this.isOverflow?(xl(t.__textBoxBounds={},[h,a]),e.renderChanged=!0):t.__textBoxBounds=h}__onUpdateSize(){this.__box&&this.__box.__onUpdateSize(),super.__onUpdateSize()}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;gl(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,s){const i=this.__box;i&&(i.__nowWorld=this.__nowWorld,i.__draw(t,e,s)),this.textEditing&&!e.exporting||super.__draw(t,e,s)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}},Xt([so(Ch)],t.Text.prototype,"__",void 0),Xt([Dr(0)],t.Text.prototype,"width",void 0),Xt([Dr(0)],t.Text.prototype,"height",void 0),Xt([Gr()],t.Text.prototype,"boxStyle",void 0),Xt([Er(!1)],t.Text.prototype,"resizeFontSize",void 0),Xt([Gr("#000000")],t.Text.prototype,"fill",void 0),Xt([Yr("outside")],t.Text.prototype,"strokeAlign",void 0),Xt([to("all")],t.Text.prototype,"hitFill",void 0),Xt([Dr("")],t.Text.prototype,"text",void 0),Xt([Dr("")],t.Text.prototype,"placeholder",void 0),Xt([Dr("caption")],t.Text.prototype,"fontFamily",void 0),Xt([Dr(12)],t.Text.prototype,"fontSize",void 0),Xt([Dr("normal")],t.Text.prototype,"fontWeight",void 0),Xt([Dr(!1)],t.Text.prototype,"italic",void 0),Xt([Dr("none")],t.Text.prototype,"textCase",void 0),Xt([Dr("none")],t.Text.prototype,"textDecoration",void 0),Xt([Dr(0)],t.Text.prototype,"letterSpacing",void 0),Xt([Dr({type:"percent",value:1.5})],t.Text.prototype,"lineHeight",void 0),Xt([Dr(0)],t.Text.prototype,"paraIndent",void 0),Xt([Dr(0)],t.Text.prototype,"paraSpacing",void 0),Xt([Dr("x")],t.Text.prototype,"writingMode",void 0),Xt([Dr("left")],t.Text.prototype,"textAlign",void 0),Xt([Dr("top")],t.Text.prototype,"verticalAlign",void 0),Xt([Dr(!0)],t.Text.prototype,"autoSizeAlign",void 0),Xt([Dr("normal")],t.Text.prototype,"textWrap",void 0),Xt([Dr("show")],t.Text.prototype,"textOverflow",void 0),Xt([Gr(!1)],t.Text.prototype,"textEditing",void 0),t.Text=Xt([uo()],t.Text),t.Path=class extends t.UI{get __tag(){return"Path"}constructor(t){super(t)}},Xt([so(kh)],t.Path.prototype,"__",void 0),Xt([Yr("center")],t.Path.prototype,"strokeAlign",void 0),t.Path=Xt([uo()],t.Path),t.Pen=class extends t.Group{get __tag(){return"Pen"}constructor(t){super(t)}setStyle(e){const s=this.pathElement=new t.Path(e);return this.pathStyle=e,this.__path=s.path||(s.path=[]),this.add(s),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,s,i,r,o){return this}quadraticCurveTo(t,e,s,i){return this}closePath(){return this}rect(t,e,s,i){return this}roundRect(t,e,s,i,r){return this}ellipse(t,e,s,i,r,o,n,a){return this}arc(t,e,s,i,r,o){return this}arcTo(t,e,s,i,r){return this}drawEllipse(t,e,s,i,r,o,n,a){return this}drawArc(t,e,s,i,r,o){return this}drawPoints(t,e,s){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}},Xt([so(Sh)],t.Pen.prototype,"__",void 0),Xt([(t,e)=>{Rr(t,e,{get(){return this.__path}})}],t.Pen.prototype,"path",void 0),t.Pen=Xt([co(li,["set","path","paint"]),uo()],t.Pen);const{getSpread:Tl,getOuterOf:Ll,getByMove:Il,getIntersectData:El}=_t;let Al;const{stintSet:Ol}=Ft,{hasTransparent:Ml}=Ja;function Wl(t,e,s){if("object"!=typeof e||!1===e.visible||0===e.opacity)return;let i;const{boxBounds:r}=s.__layout;switch(e.type){case"image":i=th.image(s,t,e,r,!Al||!Al[e.url]);break;case"linear":i=eh.linearGradient(e,r);break;case"radial":i=eh.radialGradient(e,r);break;case"angular":i=eh.conicGradient(e,r);break;case"solid":const{type:o,color:n,opacity:a}=e;i={type:o,style:Ja.string(n,a)};break;default:void 0!==e.r&&(i={type:"solid",style:Ja.string(e)})}if(i){if("string"==typeof i.style&&Ml(i.style)&&(i.isTransparent=!0),e.style){if(0===e.style.strokeWidth)return;i.strokeStyle=e.style}e.blendMode&&(i.blendMode=e.blendMode)}return i}const Dl={compute:function(t,e){const s=e.__,i=[];let r,o,n,a=s.__input[t];a instanceof Array||(a=[a]),Al=th.recycleImage(t,s);for(let s,r=0,o=a.length;r<o;r++)(s=Wl(t,a[r],e))&&(i.push(s),s.strokeStyle&&(n||(n=1),s.strokeStyle.strokeWidth&&(n=Math.max(n,s.strokeStyle.strokeWidth))));s["_"+t]=i.length?i:void 0,i.length&&i.every((t=>t.isTransparent))&&(i.some((t=>t.image))&&(r=!0),o=!0),"fill"===t?(Ol(s,"__isAlphaPixelFill",r),Ol(s,"__isTransparentFill",o)):(Ol(s,"__isAlphaPixelStroke",r),Ol(s,"__isTransparentStroke",o),Ol(s,"__hasMultiStrokeStyle",n))},fill:function(t,e,s){s.fillStyle=t,vl(e,s)},fills:function(t,e,s){let i;for(let r=0,o=t.length;r<o;r++){if(i=t[r],i.image){if(th.checkImage(e,s,i,!e.__.__font))continue;if(!i.style){!r&&i.image.isPlacehold&&e.drawImagePlaceholder(s,i.image);continue}}if(s.fillStyle=i.style,i.transform||i.scaleFixed){if(s.save(),i.transform&&s.transform(i.transform),i.scaleFixed){const{scaleX:t,scaleY:i}=e.getRenderScaleData(!0);s.scale(1/t,1/i)}i.blendMode&&(s.blendMode=i.blendMode),vl(e,s),s.restore()}else i.blendMode?(s.saveBlendMode(i.blendMode),vl(e,s),s.restoreBlendMode()):vl(e,s)}},fillPathOrText:vl,fillText:wl,stroke:Cl,strokes:function(t,e,s){Cl(t,e,s)},strokeText:bl,drawTextStroke:Sl,shape:function(t,e,s){const i=e.getSameCanvas(),r=t.__nowWorld;let o,n,a,h,{scaleX:l,scaleY:d}=r;if(l<0&&(l=-l),d<0&&(d=-d),e.bounds.includes(r))h=i,o=a=r;else{const{renderShapeSpread:i}=t.__layout,c=El(i?Tl(e.bounds,l===d?i*l:[i*d,i*l]):e.bounds,r);n=e.bounds.getFitMatrix(c);let{a:u,d:_}=n;if(n.a<1&&(h=e.getSameCanvas(),t.__renderShape(h,s),l*=u,d*=_),a=Ll(r,n),o=Il(a,-n.e,-n.f),s.matrix){const{matrix:t}=s;n.multiply(t),u*=t.scaleX,_*=t.scaleY}s=Object.assign(Object.assign({},s),{matrix:n.withScale(u,_)})}return t.__renderShape(i,s),{canvas:i,matrix:n,bounds:o,worldCanvas:h,shapeBounds:a,scaleX:l,scaleY:d}}};let Fl={},zl={a:1,b:0,c:0,d:1,e:0,f:0};const{get:Ul,rotateOfOuter:Nl,translate:Yl,scaleOfOuter:Xl,multiplyParent:jl,scale:Hl,rotate:Gl,skew:Vl}=b;function ql(t,e,s,i,r,o,n){const a=Ul();Yl(a,e.x+s,e.y+i),Hl(a,r,o),n&&Nl(a,{x:e.x+e.width/2,y:e.y+e.height/2},n),t.transform=a}function Ql(t,e,s,i,r,o,n,a,h){const l=Ul();n&&Gl(l,n),a&&Vl(l,a.x,a.y),r&&Hl(l,r,o),Yl(l,e.x+s,e.y+i),h&&(zl.a=e.width/h.width,zl.d=e.height/h.height,jl(l,zl)),t.transform=l}function Jl(t,e,s,i,r,o,n,a,h,l){const d=Ul();if(h)if("center"===l)Nl(d,{x:s/2,y:i/2},h);else switch(Gl(d,h),h){case 90:Yl(d,i,0);break;case 180:Yl(d,s,i);break;case 270:Yl(d,0,s)}Fl.x=e.x+r,Fl.y=e.y+o,Yl(d,Fl.x,Fl.y),n&&Xl(d,Fl,n,a),t.transform=d}const{get:$l,translate:Zl}=b,Kl=new yt,td={},ed={};function sd(t,e,s,i){const{changeful:r,sync:o,editing:n,scaleFixed:a}=s;r&&(t.changeful=r),o&&(t.sync=o),n&&(t.editing=n),a&&(t.scaleFixed=a),t.data=id(s,i,e)}function id(t,e,s){t.padding&&(e=Kl.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");let{width:i,height:r}=s;const{opacity:o,mode:n,align:h,offset:l,scale:d,size:c,rotation:u,skew:_,clipSize:p,repeat:f,filters:g}=t,y=e.width===i&&e.height===r,m={mode:n},x="center"!==h&&(u||0)%180==90;let w,v;switch(_t.set(ed,0,0,x?r:i,x?i:r),n&&"cover"!==n&&"fit"!==n?((d||c)&&(a.getScaleData(d,c,s,td),w=td.scaleX,v=td.scaleY),h&&(w&&_t.scale(ed,w,v,!0),J.toPoint(h,ed,e,ed,!0,!0))):y&&!u||(w=v=_t.getFitScale(e,ed,"fit"!==n),_t.put(e,s,h,w,!1,ed),_t.scale(ed,w,v,!0)),l&&A.move(ed,l),n){case"stretch":y||(i=e.width,r=e.height);break;case"normal":case"clip":(ed.x||ed.y||w||p||u||_)&&Ql(m,e,ed.x,ed.y,w,v,u,_,t.clipSize);break;case"repeat":(!y||w||u)&&Jl(m,e,i,r,ed.x,ed.y,w,v,u,h),f||(m.repeat="repeat");break;default:w&&ql(m,e,ed.x,ed.y,w,v,u)}return m.transform||(e.x||e.y)&&(m.transform=$l(),Zl(m.transform,e.x,e.y)),w&&"stretch"!==n&&(m.scaleX=w,m.scaleY=v),m.width=i,m.height=r,o&&(m.opacity=o),g&&(m.filters=g),f&&(m.repeat="string"==typeof f?"x"===f?"repeat-x":"repeat-y":"repeat"),m}let rd,od=new yt;const{isSame:nd}=_t;function ad(t,e,s,i,r,o){if("fill"===e&&!t.__.__naturalWidth){const e=t.__;if(e.__naturalWidth=i.width/e.pixelRatio,e.__naturalHeight=i.height/e.pixelRatio,e.__autoSide)return t.forceUpdate("width"),t.__proxyData&&(t.setProxyAttr("width",e.width),t.setProxyAttr("height",e.height)),!1}return r.data||sd(r,i,s,o),!0}function hd(t,e){cd(t,Zo.LOAD,e)}function ld(t,e){cd(t,Zo.LOADED,e)}function dd(t,e,s){e.error=s,t.forceUpdate("surface"),cd(t,Zo.ERROR,e)}function cd(t,e,s){t.hasEvent(e)&&t.emitEvent(new Zo(e,s))}function ud(t,e){const{leafer:s}=t;s&&s.viewReady&&(s.renderer.ignore=e)}const{get:_d,scale:pd,copy:fd}=b,{ceil:gd,abs:yd}=Math;function md(t,s,i){let{scaleX:r,scaleY:o}=t.getRenderScaleData(!0,s.scaleFixed);const n=r+"-"+o+"-"+i;if(s.patternId===n||t.destroyed)return!1;{const{image:t,data:a}=s;let h,l,{width:d,height:c,scaleX:u,scaleY:_,transform:p,repeat:f}=a;u&&(u=yd(u),_=yd(_),l=_d(),fd(l,p),pd(l,1/u,1/_),r*=u,o*=_),r*=i,o*=i,d*=r,c*=o;const g=d*c;if(!f&&g>e.image.maxCacheSize)return!1;let y=e.image.maxPatternSize;if(!t.isSVG){const e=t.width*t.height;y>e&&(y=e)}g>y&&(h=Math.sqrt(g/y)),h&&(r/=h,o/=h,d/=h,c/=h),u&&(r/=u,o/=_),(p||1!==r||1!==o)&&(l||(l=_d(),p&&fd(l,p)),pd(l,1/r,1/o));const m=t.getCanvas(gd(d)||1,gd(c)||1,a.opacity,a.filters),x=t.getPattern(m,f||e.origin.noRepeat||"no-repeat",l,s);return s.style=x,s.patternId=n,!0}}const xd={image:function(t,e,s,i,r){let o,n;const a=vr.get(s);return rd&&s===rd.paint&&nd(i,rd.boxBounds)?o=rd.leafPaint:(o={type:s.type,image:a},a.hasAlphaPixel&&(o.isTransparent=!0),rd=a.use>1?{leafPaint:o,paint:s,boxBounds:od.set(i)}:null),(r||a.loading)&&(n={image:a,attrName:e,attrValue:s}),a.ready?(ad(t,e,s,a,o,i),r&&(hd(t,n),ld(t,n))):a.error?r&&dd(t,n,a.error):(r&&(ud(t,!0),hd(t,n)),o.loadId=a.load((()=>{ud(t,!1),t.destroyed||(ad(t,e,s,a,o,i)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),ld(t,n)),o.loadId=void 0}),(e=>{ud(t,!1),dd(t,n,e),o.loadId=void 0})),t.placeholderColor&&(t.placeholderDelay?setTimeout((()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))}),t.placeholderDelay):a.isPlacehold=!0)),o},checkImage:function(t,s,i,r){const{scaleX:o,scaleY:n}=t.getRenderScaleData(!0,i.scaleFixed),{pixelRatio:a}=s,{data:h}=i;if(!h||i.patternId===o+"-"+n+"-"+a&&!rh.running)return!1;if(r)if(h.repeat)r=!1;else if(!(i.changeful||nn.isResizing(t)||rh.running)){let{width:t,height:s}=h;t*=o*a,s*=n*a,h.scaleX&&(t*=h.scaleX,s*=h.scaleY),r=t*s>e.image.maxCacheSize}return r?(t.__.__isFastShadow&&(s.fillStyle=i.style||"#000",s.fill()),function(t,e,s,i){e.save(),e.clipUI(t),s.blendMode&&(e.blendMode=s.blendMode);i.opacity&&(e.opacity*=i.opacity);i.transform&&e.transform(i.transform);e.drawImage(s.image.getFull(i.filters),0,0,i.width,i.height),e.restore()}(t,s,i,h),!0):(!i.style||i.sync||rh.running?md(t,i,a):i.patternTask||(i.patternTask=vr.patternTasker.add((()=>jt(this,void 0,void 0,(function*(){i.patternTask=null,s.bounds.hit(t.__nowWorld)&&md(t,i,a),t.forceUpdate("surface")}))),300)),!1)},createPattern:md,recycleImage:function(t,e){const s=e["_"+t];if(s instanceof Array){let i,r,o,n,a;for(let h=0,l=s.length;h<l;h++)i=s[h],r=i.image,a=r&&r.url,a&&(o||(o={}),o[a]=!0,vr.recycle(r),r.loading&&(n||(n=e.__input&&e.__input[t]||[],n instanceof Array||(n=[n])),r.unload(s[h].loadId,!n.some((t=>t.url===a)))));return o}return null},createData:sd,getPatternData:id,fillOrFitMode:ql,clipMode:Ql,repeatMode:Jl},{toPoint:wd}=V,{hasTransparent:vd}=Ja,bd={},Bd={};function kd(t,e,s,i){if(s){let r,o,n,a;for(let t=0,h=s.length;t<h;t++)r=s[t],"string"==typeof r?(n=t/(h-1),o=Ja.string(r,i)):(n=r.offset,o=Ja.string(r.color,i)),e.addColorStop(n,o),!a&&vd(o)&&(a=!0);a&&(t.isTransparent=!0)}}const{getAngle:Sd,getDistance:Rd}=A,{get:Cd,rotateOfOuter:Pd,scaleOfOuter:Td}=b,{toPoint:Ld}=V,Id={},Ed={};function Ad(t,e,s,i,r){let o;const{width:n,height:a}=t;if(n!==a||i){const t=Sd(e,s);o=Cd(),r?(Td(o,e,n/a*(i||1),1),Pd(o,e,t+90)):(Td(o,e,1,n/a*(i||1)),Pd(o,e,t))}return o}const{getDistance:Od}=A,{toPoint:Md}=V,Wd={},Dd={};const Fd={linearGradient:function(t,s){let{from:i,to:r,type:o,opacity:n}=t;wd(i||"top",s,bd),wd(r||"bottom",s,Bd);const a=e.canvas.createLinearGradient(bd.x,bd.y,Bd.x,Bd.y),h={type:o,style:a};return kd(h,a,t.stops,n),h},radialGradient:function(t,s){let{from:i,to:r,type:o,opacity:n,stretch:a}=t;Ld(i||"center",s,Id),Ld(r||"bottom",s,Ed);const h=e.canvas.createRadialGradient(Id.x,Id.y,0,Id.x,Id.y,Rd(Id,Ed)),l={type:o,style:h};kd(l,h,t.stops,n);const d=Ad(s,Id,Ed,a,!0);return d&&(l.transform=d),l},conicGradient:function(t,s){let{from:i,to:r,type:o,opacity:n,stretch:a}=t;Md(i||"center",s,Wd),Md(r||"bottom",s,Dd);const h=e.conicGradientSupport?e.canvas.createConicGradient(0,Wd.x,Wd.y):e.canvas.createRadialGradient(Wd.x,Wd.y,0,Wd.x,Wd.y,Od(Wd,Dd)),l={type:o,style:h};kd(l,h,t.stops,n);const d=Ad(s,Wd,Dd,a||1,e.conicGradientRotate90);return d&&(l.transform=d),l},getTransform:Ad},{copy:zd,toOffsetOutBounds:Ud}=_t,Nd={},Yd={};function Xd(t,s,i,r){const{bounds:o,shapeBounds:n}=r;if(e.fullImageShadow){if(zd(Nd,t.bounds),Nd.x+=s.x-n.x,Nd.y+=s.y-n.y,i){const{matrix:t}=r;Nd.x-=(o.x+(t?t.e:0)+o.width/2)*(i-1),Nd.y-=(o.y+(t?t.f:0)+o.height/2)*(i-1),Nd.width*=i,Nd.height*=i}t.copyWorld(r.canvas,t.bounds,Nd)}else i&&(zd(Nd,s),Nd.x-=s.width/2*(i-1),Nd.y-=s.height/2*(i-1),Nd.width*=i,Nd.height*=i),t.copyWorld(r.canvas,n,i?Nd:s)}const{toOffsetOutBounds:jd}=_t,Hd={};const Gd={shadow:function(t,e,s){let i,r;const{__nowWorld:o,__layout:n}=t,{shadow:a}=t.__,{worldCanvas:h,bounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=a.length-1;Ud(l,Yd),a.forEach(((a,f)=>{_.setWorldShadow(Yd.offsetX+a.x*c,Yd.offsetY+a.y*u,a.blur*c,Ja.string(a.color)),r=a.spread?1+2*a.spread/(n.boxBounds.width+2*(n.strokeBoxSpread||0)):0,Xd(_,Yd,r,s),i=l,a.box&&(_.restore(),_.save(),h&&(_.copyWorld(_,l,o,"copy"),i=o),h?_.copyWorld(h,o,o,"destination-out"):_.copyWorld(s.canvas,d,l,"destination-out")),ko.copyCanvasByWorld(t,e,_,i,a.blendMode),p&&f<p&&_.clearWorld(i,!0)})),_.recycle(i)},innerShadow:function(t,e,s){let i,r;const{__nowWorld:o,__layout:n}=t,{innerShadow:a}=t.__,{worldCanvas:h,bounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=a.length-1;jd(l,Hd),a.forEach(((a,f)=>{_.save(),_.setWorldShadow(Hd.offsetX+a.x*c,Hd.offsetY+a.y*u,a.blur*c),r=a.spread?1-2*a.spread/(n.boxBounds.width+2*(n.strokeBoxSpread||0)):0,Xd(_,Hd,r,s),_.restore(),h?(_.copyWorld(_,l,o,"copy"),_.copyWorld(h,o,o,"source-out"),i=o):(_.copyWorld(s.canvas,d,l,"source-out"),i=l),_.fillWorld(i,Ja.string(a.color),"source-in"),ko.copyCanvasByWorld(t,e,_,i,a.blendMode),p&&f<p&&_.clearWorld(i,!0)})),_.recycle(i)},blur:function(t,e,s){const{blur:i}=t.__;s.setWorldBlur(i*t.__nowWorld.a),s.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),s.filter="none"},backgroundBlur:function(t,e,s){}},{excludeRenderBounds:Vd}=Eo;function qd(t,e,s,i,r,o){switch(e){case"grayscale":r.useGrayscaleAlpha(t.__nowWorld);case"alpha":!function(t,e,s,i){const r=t.__nowWorld;s.resetTransform(),s.opacity=1,s.useMask(i,r),i.recycle(r),Jd(t,e,s,1)}(t,s,i,r);break;case"opacity-path":Jd(t,s,i,o);break;case"path":s.restore()}}function Qd(t){return t.getSameCanvas(!1,!0)}function Jd(t,e,s,i){const r=t.__nowWorld;e.resetTransform(),e.opacity=i,e.copyWorld(s,r),s.recycle(r)}t.Group.prototype.__renderMask=function(t,e){let s,i,r,o,n,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++)s=h[l],a=s.__.mask,a?(n&&(qd(this,n,t,r,i,o),i=r=null),"path"===a||"clipping-path"===a?(s.opacity<1?(n="opacity-path",o=s.opacity,r||(r=Qd(t))):(n="path",t.save()),s.__clip(r||t,e)):(n="grayscale"===a?"grayscale":"alpha",i||(i=Qd(t)),r||(r=Qd(t)),s.__render(i,e)),"clipping"!==a&&"clipping-path"!==a||Vd(s,e)||s.__render(t,e)):Vd(s,e)||s.__render(r||t,e);qd(this,n,t,r,i,o)};const $d=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",Zd=$d+"_#~&*+\\=|≮≯≈≠=…",Kd=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map((([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`)).join("|"));function tc(t){const e={};return t.split("").forEach((t=>e[t]=!0)),e}const ec=tc("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),sc=tc("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),ic=tc($d),rc=tc(Zd),oc=tc("- —/~|┆·");var nc;!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(nc||(nc={}));const{Letter:ac,Single:hc,Before:lc,After:dc,Symbol:cc,Break:uc}=nc;function _c(t){return ec[t]?ac:oc[t]?uc:sc[t]?lc:ic[t]?dc:rc[t]?cc:Kd.test(t)?hc:ac}const pc={trimRight(t){const{words:e}=t;let s,i=0,r=e.length;for(let o=r-1;o>-1&&(s=e[o].data[0]," "===s.char);o--)i++,t.width-=s.width;i&&e.splice(r-i,i)}};function fc(t,e,s){switch(e){case"title":return s?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:gc}=pc,{Letter:yc,Single:mc,Before:xc,After:wc,Symbol:vc,Break:bc}=nc;let Bc,kc,Sc,Rc,Cc,Pc,Tc,Lc,Ic,Ec,Ac,Oc,Mc,Wc,Dc,Fc,zc,Uc=[];function Nc(t,e){Ic&&!Lc&&(Lc=Ic),Bc.data.push({char:t,width:e}),Sc+=e}function Yc(){Rc+=Sc,Bc.width=Sc,kc.words.push(Bc),Bc={data:[]},Sc=0}function Xc(){Wc&&(Dc.paraNumber++,kc.paraStart=!0,Wc=!1),Ic&&(kc.startCharSize=Lc,kc.endCharSize=Ic,Lc=0),kc.width=Rc,Fc.width?gc(kc):zc&&jc(),Uc.push(kc),kc={words:[]},Rc=0}function jc(){Rc>(Dc.maxWidth||0)&&(Dc.maxWidth=Rc)}const{top:Hc,right:Gc,bottom:Vc,left:qc}=t.Direction4;function Qc(t,e,s){const{bounds:i,rows:r}=t;i[e]+=s;for(let t=0;t<r.length;t++)r[t][e]+=s}const Jc={getDrawData:function(t,s){"string"!=typeof t&&(t=String(t));let i=0,r=0,o=s.__getInput("width")||0,n=s.__getInput("height")||0;const{textDecoration:a,__font:h,__padding:l}=s;l&&(o?(i=l[qc],o-=l[Gc]+l[qc]):s.autoSizeAlign||(i=l[qc]),n?(r=l[Hc],n-=l[Hc]+l[Vc]):s.autoSizeAlign||(r=l[Hc]));const d={bounds:{x:i,y:r,width:o,height:n},rows:[],paraNumber:0,font:e.canvas.font=h};return function(t,s,i){Dc=t,Uc=t.rows,Fc=t.bounds,zc=!Fc.width&&!i.autoSizeAlign;const{__letterSpacing:r,paraIndent:o,textCase:n}=i,{canvas:a}=e,{width:h,height:l}=Fc;if(h||l||r||"none"!==n){const t="none"!==i.textWrap,e="break"===i.textWrap;Wc=!0,Ac=null,Lc=Tc=Ic=Sc=Rc=0,Bc={data:[]},kc={words:[]},r&&(s=[...s]);for(let i=0,l=s.length;i<l;i++)Pc=s[i],"\n"===Pc?(Sc&&Yc(),kc.paraEnd=!0,Xc(),Wc=!0):(Ec=_c(Pc),Ec===yc&&"none"!==n&&(Pc=fc(Pc,n,!Sc)),Tc=a.measureText(Pc).width,r&&(r<0&&(Ic=Tc),Tc+=r),Oc=Ec===mc&&(Ac===mc||Ac===yc)||Ac===mc&&Ec!==wc,Mc=!(Ec!==xc&&Ec!==mc||Ac!==vc&&Ac!==wc),Cc=Wc&&o?h-o:h,t&&h&&Rc+Sc+Tc>Cc&&(e?(Sc&&Yc(),Rc&&Xc()):(Mc||(Mc=Ec===yc&&Ac==wc),Oc||Mc||Ec===bc||Ec===xc||Ec===mc||Sc+Tc>Cc?(Sc&&Yc(),Rc&&Xc()):Rc&&Xc()))," "===Pc&&!0!==Wc&&Rc+Sc===0||(Ec===bc?(" "===Pc&&Sc&&Yc(),Nc(Pc,Tc),Yc()):Oc||Mc?(Sc&&Yc(),Nc(Pc,Tc)):Nc(Pc,Tc)),Ac=Ec);Sc&&Yc(),Rc&&Xc(),Uc.length>0&&(Uc[Uc.length-1].paraEnd=!0)}else s.split("\n").forEach((t=>{Dc.paraNumber++,Rc=a.measureText(t).width,Uc.push({x:o||0,text:t,width:Rc,paraStart:!0}),zc&&jc()}))}(d,t,s),l&&function(t,e,s,i,r){if(!i&&s.autoSizeAlign)switch(s.textAlign){case"left":Qc(e,"x",t[qc]);break;case"right":Qc(e,"x",-t[Gc])}if(!r&&s.autoSizeAlign)switch(s.verticalAlign){case"top":Qc(e,"y",t[Hc]);break;case"bottom":Qc(e,"y",-t[Vc])}}(l,d,s,o,n),function(t,e){const{rows:s,bounds:i}=t,r=s.length,{__lineHeight:o,__baseLine:n,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:f,height:g}=i,y=o*r+(c?c*(t.paraNumber-1):0),m=n;if(h&&y>g)y=Math.max(g,o),r>1&&(t.overflow=r);else if(g||u)switch(d){case"middle":p+=(g-y)/2;break;case"bottom":p+=g-y}m+=p;let x,w,v,b=f||u?f:t.maxWidth;for(let n=0,d=r;n<d;n++){if(x=s[n],x.x=_,x.width<f||x.width>f&&!h)switch(l){case"center":x.x+=(b-x.width)/2;break;case"right":x.x+=b-x.width}x.paraStart&&c&&n>0&&(m+=c),x.y=m,m+=o,t.overflow>n&&m>y&&(x.isOverflow=!0,t.overflow=n+1),w=x.x,v=x.width,a<0&&(x.width<0?(v=-x.width+e.fontSize+a,w-=v,v+=e.fontSize):v-=a),w<i.x&&(i.x=w),v>i.width&&(i.width=v),h&&f&&f<v&&(x.isOverflow=!0,t.overflow||(t.overflow=s.length))}i.y=p,i.height=y}(d,s),function(t,e,s){const{rows:i}=t,{textAlign:r,paraIndent:o,letterSpacing:n}=e;let a,h,l,d,c,u;i.forEach((t=>{t.words&&(l=o&&t.paraStart?o:0,u=t.words.length,h=s&&("justify"===r||"both"===r)&&u>1?(s-t.width-l)/(u-1):0,d=n||t.isOverflow?0:h>.01?1:2,t.isOverflow&&!n&&(t.textMode=!0),2===d?(t.x+=l,function(t){t.text="",t.words.forEach((e=>{e.data.forEach((e=>{t.text+=e.char}))}))}(t)):(t.x+=l,a=t.x,t.data=[],t.words.forEach(((e,s)=>{1===d?(c={char:"",x:a},a=function(t,e,s){return t.forEach((t=>{s.char+=t.char,e+=t.width})),e}(e.data,a,c),(t.isOverflow||" "!==c.char)&&t.data.push(c)):a=function(t,e,s,i){return t.forEach((t=>{(i||" "!==t.char)&&(t.x=e,s.push(t)),e+=t.width})),e}(e.data,a,t.data,t.isOverflow),!h||t.paraEnd&&"both"!==r||s===u-1||(a+=h,t.width+=h)}))),t.words=null)}))}(d,s,o),d.overflow&&function(t,s,i,r){if(!r)return;const{rows:o,overflow:n}=t;let{textOverflow:a}=s;if(o.splice(n),a&&"show"!==a){let t,h;"hide"===a?a="":"ellipsis"===a&&(a="...");const l=a?e.canvas.measureText(a).width:0,d=i+r-l;("none"===s.textWrap?o:[o[n-1]]).forEach((e=>{if(e.isOverflow&&e.data){let s=e.data.length-1;for(let i=s;i>-1&&(t=e.data[i],h=t.x+t.width,!(i===s&&h<d));i--){if(h<d&&" "!==t.char||!i){e.data.splice(i+1),e.width-=t.width;break}e.width-=t.width}e.width+=l,e.data.push({char:a,x:h}),e.textMode&&function(t){t.text="",t.data.forEach((e=>{t.text+=e.char})),t.data=null}(e)}}))}}(d,s,i,o),"none"!==a&&function(t,e){let s;const{fontSize:i,textDecoration:r}=e;switch(t.decorationHeight=i/11,"object"==typeof r?(s=r.type,r.color&&(t.decorationColor=Ja.string(r.color))):s=r,s){case"under":t.decorationY=[.15*i];break;case"delete":t.decorationY=[.35*-i];break;case"under-delete":t.decorationY=[.15*i,.35*-i]}}(d,s),d}};const $c={string:function(t,e){const s="number"==typeof e&&1!==e;if("string"==typeof t){if(!s||!Ja.object)return t;t=Ja.object(t)}let i=void 0===t.a?1:t.a;s&&(i*=e);const r=t.r+","+t.g+","+t.b;return 1===i?"rgb("+r+")":"rgba("+r+","+i+")"}};return Object.assign(Qa,Jc),Object.assign(Ja,$c),Object.assign(Ka,Dl),Object.assign(th,xd),Object.assign(eh,Fd),Object.assign(sh,Gd),La(),t.AlignHelper=J,t.AroundHelper=V,t.AutoBounds=xt,t.BezierHelper=Le,t.Bounds=yt,t.BoundsEvent=Ko,t.BoundsHelper=_t,t.BoxData=gh,t.BranchHelper=Oo,t.BranchRender=jn,t.CanvasData=Th,t.CanvasManager=Dt,t.ChildEvent=Jo,t.ColorConvert=Ja,t.Creator=Lt,t.DataHelper=Ft,t.Debug=bt,t.Effect=sh,t.EllipseData=vh,t.EllipseHelper=ze,t.Event=Qo,t.EventCreator=Mt,t.Eventer=un,t.Export=rh,t.FileHelper=_r,t.Filter=ih,t.FrameData=mh,t.GroupData=fh,t.ImageData=Ph,t.ImageEvent=Zo,t.ImageManager=vr,t.IncrementId=s,t.LayoutEvent=hn,t.Layouter=Xa,t.LeafBounds=Nn,t.LeafBoundsHelper=Eo,t.LeafData=Ut,t.LeafDataProxy=Rn,t.LeafEventer=Bn,t.LeafHelper=ko,t.LeafLayout=qo,t.LeafLevelList=Sa,t.LeafList=ka,t.LeafMatrix=An,t.LeafRender=Yn,t.LeaferCanvas=Ca,t.LeaferCanvasBase=ee,t.LeaferData=yh,t.LeaferEvent=dn,t.LeaferImage=Sr,t.LineData=xh,t.MathHelper=a,t.Matrix=U,t.MatrixHelper=b,t.MyImage=fl,t.NeedConvertToCanvasCommandMap=ne,t.OneRadian=l,t.PI2=d,t.PI_2=c,t.Paint=Ka,t.PaintGradient=eh,t.PaintImage=th,t.PathArrow=Za,t.PathBounds=sr,t.PathCommandDataHelper=Gs,t.PathCommandMap=re,t.PathConvert=Bs,t.PathCorner=lr,t.PathCreator=li,t.PathData=kh,t.PathDrawer=ki,t.PathHelper=se,t.PathNumberCommandLengthMap=de,t.PathNumberCommandMap=le,t.PenData=Sh,t.Platform=e,t.Plugin=Tt,t.Point=F,t.PointHelper=A,t.PolygonData=bh,t.PropertyEvent=$o,t.RectData=wh,t.RectHelper=ce,t.RectRender=Oh,t.RenderEvent=ln,t.Renderer=Ha,t.ResizeEvent=nn,t.Resource=xr,t.Run=Rt,t.StarData=Bh,t.State=oh,t.StringNumberMap=wt,t.TaskItem=gr,t.TaskProcessor=yr,t.TextConvert=Qa,t.TextData=Ch,t.Transition=nh,t.TwoPointBoundsHelper=Y,t.UIBounds=Lh,t.UICreator=Et,t.UIData=_h,t.UIRender=Eh,t.UnitConvert=$a,t.WaitHelper=Fo,t.WatchEvent=an,t.Watcher=Ea,t.affectRenderBoundsType=Hr,t.affectStrokeBoundsType=Yr,t.attr=Lr,t.autoLayoutType=Or,t.boundsType=Dr,t.canvasPatch=ur,t.canvasSizeAttrs=te,t.createAttr=function(t){return(e,s)=>{Rr(e,s,Pr(s,t))}},t.createDescriptor=Pr,t.cursorType=eo,t.dataProcessor=so,t.dataType=Er,t.decorateLeafAttr=Tr,t.defineDataProcessor=io,t.defineKey=Rr,t.defineLeafAttr=Ir,t.doBoundsType=zr,t.doStrokeType=Xr,t.effectType=Ga,t.emptyData={},t.eraserType=Kr,t.getBoundsData=_,t.getDescriptor=Cr,t.getMatrixData=p,t.getPointData=u,t.hitType=to,t.isEmptyData=Yt,t.isNull=function(t){return null==t},t.layoutProcessor=function(t){return(e,s)=>{Rr(e,"__LayoutProcessor",{get:()=>t})}},t.maskType=Zr,t.naturalBoundsType=Fr,t.opacityType=Vr,t.pathInputType=Ur,t.pathType=Nr,t.pen=dr,t.positionType=Ar,t.registerUI=uo,t.registerUIEvent=function(){return t=>{Mt.register(t)}},t.resizeType=Va,t.rewrite=ao,t.rewriteAble=ho,t.rotationType=Wr,t.scaleType=Mr,t.sortType=$r,t.strokeType=jr,t.surfaceType=Gr,t.tempBounds=mt,t.tempMatrix=N,t.tempPoint=z,t.useCanvas=La,t.useModule=co,t.version="1.8.0",t.visibleType=qr,t.zoomLayerType=qa,t}({});function Leafer(t){return new LeaferUI.Leafer(t)}Object.setPrototypeOf(Leafer,LeaferUI),Leafer.prototype=LeaferUI.Leafer.prototype;
1
+ var LeaferUI=function(t){"use strict";const e={toURL(t,e){let s=encodeURIComponent(t);return"text"===e?s="data:text/plain;charset=utf-8,"+s:"svg"===e&&(s="data:image/svg+xml,"+s),s},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",getRealURL(t){const{prefix:s,suffix:i}=e.image;return!i||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+i),s&&"/"===t[0]&&(t=s+t),t}}},s={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=i;return e[t]?e[t]++:(e[t]=1,0)}},i=s;var r;t.Answer=void 0,(r=t.Answer||(t.Answer={}))[r.No=0]="No",r[r.Yes=1]="Yes",r[r.NoAndSkip=2]="NoAndSkip",r[r.YesAndSkip=3]="YesAndSkip";function o(t){return void 0===t}function n(t){return null==t}function a(t){return"string"==typeof t}const{isFinite:h}=Number;function l(t){return"number"==typeof t}const d=/^-?\d+(?:\.\d+)?$/;const{isArray:c}=Array;function u(t){return t&&"object"==typeof t}function _(t){return"{}"===JSON.stringify(t)}const p={default:(t,e)=>(f(e,t),f(t,e),t),assign(t,e,s){let i;Object.keys(e).forEach(r=>{var o,n;if(i=e[r],(null==i?void 0:i.constructor)===Object&&(null===(o=t[r])||void 0===o?void 0:o.constructor)===Object)return f(t[r],e[r],s&&s[r]);s&&r in s?(null===(n=s[r])||void 0===n?void 0:n.constructor)===Object&&f(t[r]={},e[r],s[r]):t[r]=e[r]})},copyAttrs:(t,e,s)=>(s.forEach(s=>{o(e[s])||(t[s]=e[s])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,i=t.length;s<i;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:f}=p;class g{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __blendMode(){if(this.eraser&&"path"!==this.eraser)return"destination-out";const{blendMode:t}=this;return"pass-through"===t?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const e=this.__input[t];if(!o(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let s;for(let i in this)"_"!==i[0]&&(s=e?e[i]:void 0,t[i]=o(s)?this[i]:s);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!o(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!o(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const s={};if(t)if(c(t))for(let e of t)s[e]=this.__getInput(e);else for(let e in t)s[e]=this.__getInput(e);else{let t,e,{__input:i}=this;s.tag=this.__leaf.tag;for(let r in this)if("_"!==r[0]&&(t=this["_"+r],!o(t))){if("path"===r&&!this.__pathInputed)continue;e=i?i[r]:void 0,s[r]=o(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:i,d:r,e:o,f:n}=this.__leaf.__localMatrix;s.matrix={a:t,b:e,c:i,d:r,e:o,f:n}}return s}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null}}const{round:y,pow:m,PI:x}=Math,w={within:(t,e,s)=>(u(e)&&(s=e.max,e=e.min),!o(e)&&t<e&&(t=e),!o(s)&&t>s&&(t=s),t),fourNumber(t,e){let s;if(c(t))switch(t.length){case 4:s=o(e)?t:[...t];break;case 2:s=[t[0],t[1],t[0],t[1]];break;case 3:s=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(s||(s=[t,t,t,t]),e)for(let t=0;t<4;t++)s[t]>e&&(s[t]=e);return s},formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),w.float(t)),getGapRotation(t,e,s=0){let i=t+s;if(e>1){const t=Math.abs(i%e);(t<1||t>e-1)&&(i=Math.round(i/e)*e)}return i-s},float(t,e){const s=o(e)?1e12:m(10,e);return-0===(t=y(t*s)/s)?0:t},getScaleData(t,e,s,i){if(i||(i={}),e){const t=(l(e)?e:e.width||0)/s.width,r=(l(e)?e:e.height||0)/s.height;i.scaleX=t||r||1,i.scaleY=r||t||1}else t&&w.assignScale(i,t);return i},assignScale(t,e){l(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},randInt:v,randColor:t=>`rgba(${v(255)},${v(255)},${v(255)},${t||1})`};function v(t){return Math.round(Math.random()*t)}const b=x/180,B=2*x,k=x/2;function S(){return{x:0,y:0}}function R(){return{x:0,y:0,width:0,height:0}}function C(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:T,cos:P,acos:L,sqrt:I}=Math,{float:E}=w,A={};function O(){return Object.assign(Object.assign(Object.assign({},{a:1,b:0,c:0,d:1,e:0,f:0}),{x:0,y:0,width:0,height:0}),{scaleX:1,scaleY:1,rotation:0,skewX:0,skewY:0})}const M={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:O(),tempMatrix:{},set(t,e=1,s=0,i=0,r=1,o=0,n=0){t.a=e,t.b=s,t.c=i,t.d=r,t.e=o,t.f=n},get:C,getWorld:O,copy(t,e){t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f},translate(t,e,s){t.e+=e,t.f+=s},translateInner(t,e,s,i){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,i&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},scaleOfOuter(t,e,s,i){W.toInnerPoint(t,e,A),W.scaleOfInner(t,A,s,i)},scaleOfInner(t,e,s,i=s){W.translateInner(t,e.x,e.y),W.scale(t,s,i),W.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:i,c:r,d:o}=t,n=P(e*=b),a=T(e);t.a=s*n-i*a,t.b=s*a+i*n,t.c=r*n-o*a,t.d=r*a+o*n},rotateOfOuter(t,e,s){W.toInnerPoint(t,e,A),W.rotateOfInner(t,A,s)},rotateOfInner(t,e,s){W.translateInner(t,e.x,e.y),W.rotate(t,s),W.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:i,b:r,c:o,d:n}=t;s&&(s*=b,t.a=i+o*s,t.b=r+n*s),e&&(e*=b,t.c=o+i*e,t.d=n+r*e)},skewOfOuter(t,e,s,i){W.toInnerPoint(t,e,A),W.skewOfInner(t,A,s,i)},skewOfInner(t,e,s,i=0){W.translateInner(t,e.x,e.y),W.skew(t,s,i),W.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:i,c:r,d:o,e:n,f:a}=t;t.a=e.a*s+e.b*r,t.b=e.a*i+e.b*o,t.c=e.c*s+e.d*r,t.d=e.c*i+e.d*o,t.e=e.e*s+e.f*r+n,t.f=e.e*i+e.f*o+a},multiplyParent(t,e,s,i,r,n){let{e:a,f:h}=t;if(n&&(a+=n.scrollX,h+=n.scrollY),s||(s=t),o(i)&&(i=1!==t.a||t.b||t.c||1!==t.d),i){const{a:i,b:o,c:n,d:a}=t;s.a=i*e.a+o*e.c,s.b=i*e.b+o*e.d,s.c=n*e.a+a*e.c,s.d=n*e.b+a*e.d,r&&(s.scaleX=e.scaleX*r.scaleX,s.scaleY=e.scaleY*r.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,r&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=a*e.a+h*e.c+e.e,s.f=a*e.b+h*e.d+e.f},divide(t,e){W.multiply(t,W.tempInvert(e))},divideParent(t,e){W.multiplyParent(t,W.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=W;return W.copy(e,t),W.invert(e),e},invert(t){const{a:e,b:s,c:i,d:r,e:o,f:n}=t;if(s||i){const a=1/(e*r-s*i);t.a=r*a,t.b=-s*a,t.c=-i*a,t.d=e*a,t.e=-(o*r-n*i)*a,t.f=-(n*e-o*s)*a}else if(1===e&&1===r)t.e=-o,t.f=-n;else{const s=1/(e*r);t.a=r*s,t.d=e*s,t.e=-o*r*s,t.f=-n*e*s}},toOuterPoint(t,e,s,i){const{x:r,y:o}=e;s||(s=e),s.x=r*t.a+o*t.c,s.y=r*t.b+o*t.d,i||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,i){const{a:r,b:o,c:n,d:a}=t,h=1/(r*a-o*n),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*n)*h,s.y=(d*r-l*o)*h,!i){const{e:e,f:i}=t;s.x-=(e*a-i*n)*h,s.y-=(i*r-e*o)*h}},setLayout(t,e,s,i,r){const{x:n,y:a,scaleX:h,scaleY:l}=e;if(o(r)&&(r=e.rotation||e.skewX||e.skewY),r){const{rotation:s,skewX:i,skewY:r}=e,o=s*b,n=P(o),a=T(o);if(i||r){const e=i*b,s=r*b;t.a=(n+s*-a)*h,t.b=(a+s*n)*h,t.c=(e*n-a)*l,t.d=(n+e*a)*l}else t.a=n*h,t.b=a*h,t.c=-a*l,t.d=n*l}else t.a=h,t.b=0,t.c=0,t.d=l;t.e=n,t.f=a,(s=s||i)&&W.translateInner(t,-s.x,-s.y,!i)},getLayout(t,e,s,i){const{a:r,b:o,c:n,d:a,e:h,f:l}=t;let d,c,u,_,p,f=h,g=l;if(o||n){const t=r*a-o*n;if(n&&!i){d=I(r*r+o*o),c=t/d;const e=r/d;u=o>0?L(e):-L(e)}else{c=I(n*n+a*a),d=t/c;const e=n/c;u=k-(a>0?L(-e):-L(e))}const e=E(P(u)),s=T(u);d=E(d),c=E(c),_=e?E((n/c+s)/e/b,9):0,p=e?E((o/d-s)/e/b,9):0,u=E(u/b)}else d=r,c=a,u=_=p=0;return(e=s||e)&&(f+=e.x*r+e.y*n,g+=e.x*o+e.y*a,s||(f-=e.x,g-=e.y)),{x:f,y:g,scaleX:d,scaleY:c,rotation:u,skewX:_,skewY:p}},withScale(t,e,s=e){const i=t;if(!e||!s){const{a:i,b:r,c:o,d:n}=t;r||o?s=(i*n-r*o)/(e=I(i*i+r*r)):(e=i,s=n)}return i.scaleX=e,i.scaleY=s,i},reset(t){W.set(t)}},W=M,{toInnerPoint:D,toOuterPoint:F}=M,{sin:z,cos:U,abs:N,sqrt:Y,atan2:X,min:H,round:G}=Math,V={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,s){t.radiusX=e,t.radiusY=o(s)?e:s},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,s){t.x=e,t.y=s},round(t,e){t.x=e?G(t.x-.5)+.5:G(t.x),t.y=e?G(t.y-.5)+.5:G(t.y)},move(t,e,s){u(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=s)},scale(t,e,s=e){t.x&&(t.x*=e),t.y&&(t.y*=s)},scaleOf(t,e,s,i=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(i-1)},rotate(t,e,s){s||(s=j.defaultPoint);const i=U(e*=b),r=z(e),o=t.x-s.x,n=t.y-s.y;t.x=s.x+o*i-n*r,t.y=s.y+o*r+n*i},tempToInnerOf(t,e){const{tempPoint:s}=j;return Q(s,t),D(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=j;return Q(s,t),F(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=j;return Q(s,t),j.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),D(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){D(e,t,s)},toOuterOf(t,e,s){F(e,t,s)},getCenter:(t,e)=>({x:t.x+(e.x-t.x)/2,y:t.y+(e.y-t.y)/2}),getCenterX:(t,e)=>t+(e-t)/2,getCenterY:(t,e)=>t+(e-t)/2,getDistance:(t,e)=>q(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,s,i){const r=N(s-t),o=N(i-e);return Y(r*r+o*o)},getMinDistanceFrom:(t,e,s,i,r,o)=>H(q(t,e,s,i),q(s,i,r,o)),getAngle:(t,e)=>J(t,e)/b,getRotation:(t,e,s,i)=>(i||(i=e),j.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,i.x,i.y)/b),getRadianFrom(t,e,s,i,r,n,a,h){o(a)&&(a=s,h=i);const l=t-s,d=e-i,c=r-a,u=n-h;return Math.atan2(l*u-d*c,l*c+d*u)},getAtan2:(t,e)=>X(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,i){const r=J(t,e);return(e=i?e:{}).x=t.x+U(r)*s,e.y=t.y+z(r)*s,e},toNumberPoints(t){let e=t;return u(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},reset(t){j.reset(t)}},j=V,{getDistanceFrom:q,copy:Q,getAtan2:J}=j;class ${constructor(t,e){this.set(t,e)}set(t,e){return u(t)?V.copy(this,t):V.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new $(this)}move(t,e){return V.move(this,t,e),this}scale(t,e){return V.scale(this,t,e),this}scaleOf(t,e,s){return V.scaleOf(this,t,e,s),this}rotate(t,e){return V.rotate(this,t,e),this}rotateOf(t,e){return V.rotate(this,e,t),this}getRotation(t,e,s){return V.getRotation(this,t,e,s)}toInnerOf(t,e){return V.toInnerOf(this,t,e),this}toOuterOf(t,e){return V.toOuterOf(this,t,e),this}getCenter(t){return new $(V.getCenter(this,t))}getDistance(t){return V.getDistance(this,t)}getDistancePoint(t,e,s){return new $(V.getDistancePoint(this,t,e,s))}getAngle(t){return V.getAngle(this,t)}getAtan2(t){return V.getAtan2(this,t)}reset(){return V.reset(this),this}}const Z=new $;class K{constructor(t,e,s,i,r,o){this.set(t,e,s,i,r,o)}set(t,e,s,i,r,o){return u(t)?M.copy(this,t):M.set(this,t,e,s,i,r,o),this}setWith(t){return M.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:s,d:i,e:r,f:o}=this;return{a:t,b:e,c:s,d:i,e:r,f:o}}clone(){return new K(this)}translate(t,e){return M.translate(this,t,e),this}translateInner(t,e){return M.translateInner(this,t,e),this}scale(t,e){return M.scale(this,t,e),this}scaleWith(t,e){return M.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}scaleOfOuter(t,e,s){return M.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return M.scaleOfInner(this,t,e,s),this}rotate(t){return M.rotate(this,t),this}rotateOfOuter(t,e){return M.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return M.rotateOfInner(this,t,e),this}skew(t,e){return M.skew(this,t,e),this}skewOfOuter(t,e,s){return M.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return M.skewOfInner(this,t,e,s),this}multiply(t){return M.multiply(this,t),this}multiplyParent(t){return M.multiplyParent(this,t),this}divide(t){return M.divide(this,t),this}divideParent(t){return M.divideParent(this,t),this}invert(){return M.invert(this),this}invertWith(){return M.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){M.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){M.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return M.setLayout(this,t,e,s),this}getLayout(t,e,s){return M.getLayout(this,t,e,s)}withScale(t,e){return M.withScale(this,t,e)}reset(){M.reset(this)}}const tt=new K,et={tempPointBounds:{},setPoint(t,e,s){t.minX=t.maxX=e,t.minY=t.maxY=s},addPoint(t,e,s){t.minX=e<t.minX?e:t.minX,t.minY=s<t.minY?s:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=s>t.maxY?s:t.maxY},addBounds(t,e,s,i,r){st(t,e,s),st(t,e+i,s+r)},copy(t,e){t.minX=e.minX,t.minY=e.minY,t.maxX=e.maxX,t.maxY=e.maxY},addPointBounds(t,e){t.minX=e.minX<t.minX?e.minX:t.minX,t.minY=e.minY<t.minY?e.minY:t.minY,t.maxX=e.maxX>t.maxX?e.maxX:t.maxX,t.maxY=e.maxY>t.maxY?e.maxY:t.maxY},toBounds(t,e){e.x=t.minX,e.y=t.minY,e.width=t.maxX-t.minX,e.height=t.maxY-t.minY}},{addPoint:st}=et;var it,rt;t.Direction4=void 0,(it=t.Direction4||(t.Direction4={}))[it.top=0]="top",it[it.right=1]="right",it[it.bottom=2]="bottom",it[it.left=3]="left",t.Direction9=void 0,(rt=t.Direction9||(t.Direction9={}))[rt.topLeft=0]="topLeft",rt[rt.top=1]="top",rt[rt.topRight=2]="topRight",rt[rt.right=3]="right",rt[rt.bottomRight=4]="bottomRight",rt[rt.bottom=5]="bottom",rt[rt.bottomLeft=6]="bottomLeft",rt[rt.left=7]="left",rt[rt.center=8]="center",rt[rt["top-left"]=0]="top-left",rt[rt["top-right"]=2]="top-right",rt[rt["bottom-right"]=4]="bottom-right",rt[rt["bottom-left"]=6]="bottom-left";const ot=[{x:0,y:0},{x:.5,y:0},{x:1,y:0},{x:1,y:.5},{x:1,y:1},{x:.5,y:1},{x:0,y:1},{x:0,y:.5},{x:.5,y:.5}];ot.forEach(t=>t.type="percent");const nt={directionData:ot,tempPoint:{},get:at,toPoint(t,e,s,i,r,o){const n=at(t);s.x=n.x,s.y=n.y,"percent"===n.type&&(s.x*=e.width,s.y*=e.height,r&&(o||(s.x-=r.x,s.y-=r.y),n.x&&(s.x-=1===n.x?r.width:.5===n.x?n.x*r.width:0),n.y&&(s.y-=1===n.y?r.height:.5===n.y?n.y*r.height:0))),i||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s)=>(s||(s={}),nt.toPoint(t,e,s,!0),s)};function at(e){return a(e)?ot[t.Direction9[e]]:e}const{toPoint:ht}=nt,lt={toPoint(t,e,s,i,r,o){ht(t,s,i,r,e,o)}},{tempPointBounds:dt,setPoint:ct,addPoint:ut,toBounds:_t}=et,{toOuterPoint:pt}=M,{float:ft,fourNumber:gt}=w,{floor:yt,ceil:mt}=Math;let xt,wt,vt,bt;const Bt={},kt={},St={},Rt={tempBounds:St,set(t,e=0,s=0,i=0,r=0){t.x=e,t.y=s,t.width=i,t.height=r},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,i,r){const{x:o,y:n,width:a,height:h}=e;if(c(s)){const e=gt(s);i?Ct.set(t,o+e[3],n+e[0],a-e[1]-e[3],h-e[2]-e[0]):Ct.set(t,o-e[3],n-e[0],a+e[1]+e[3],h+e[2]+e[0])}else i&&(s=-s),Ct.set(t,o-s,n-s,a+2*s,h+2*s);r&&("width"===r?(t.y=n,t.height=h):(t.x=o,t.width=a))},minX:t=>t.width>0?t.x:t.x+t.width,minY:t=>t.height>0?t.y:t.y+t.height,maxX:t=>t.width>0?t.x+t.width:t.x,maxY:t=>t.height>0?t.y+t.height:t.y,move(t,e,s){t.x+=e,t.y+=s},getByMove:(t,e,s)=>(t=Object.assign({},t),Ct.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?Pt(e,t):e=t,s?(e.offsetX=-(Ct.maxX(s)-t.x),e.offsetY=-(Ct.maxY(s)-t.y)):(e.offsetX=t.x+t.width,e.offsetY=t.y+t.height),Ct.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e,i){i||V.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,i=s){V.scaleOf(t,e,s,i),t.width*=s,t.height*=i},tempToOuterOf:(t,e)=>(Ct.copy(St,t),Ct.toOuterOf(St,e),St),getOuterOf:(t,e)=>(t=Object.assign({},t),Ct.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:i,d:r}=e;i>0?(s.width=t.width*i,s.x=e.e+t.x*i):(s.width=t.width*-i,s.x=e.e+t.x*i-s.width),r>0?(s.height=t.height*r,s.y=e.f+t.y*r):(s.height=t.height*-r,s.y=e.f+t.y*r-s.height)}else Bt.x=t.x,Bt.y=t.y,pt(e,Bt,kt),ct(dt,kt.x,kt.y),Bt.x=t.x+t.width,pt(e,Bt,kt),ut(dt,kt.x,kt.y),Bt.y=t.y+t.height,pt(e,Bt,kt),ut(dt,kt.x,kt.y),Bt.x=t.x,pt(e,Bt,kt),ut(dt,kt.x,kt.y),_t(dt,s)},toInnerOf(t,e,s){s||(s=t),Ct.move(s,-e.e,-e.f),Ct.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const i=Math.min(s,Ct.getFitScale(t,e));return new K(i,0,0,i,-e.x*i,-e.y*i)},getFitScale(t,e,s){const i=t.width/e.width,r=t.height/e.height;return s?Math.max(i,r):Math.min(i,r)},put(t,e,s="center",i=1,r=!0,o){o||(o=e),a(i)&&(i=Ct.getFitScale(t,e,"cover"===i)),St.width=r?e.width*=i:e.width*i,St.height=r?e.height*=i:e.height*i,lt.toPoint(s,St,t,o,!0,!0)},getSpread(t,e,s){const i={};return Ct.copyAndSpread(i,t,e,!1,s),i},spread(t,e,s){Ct.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){Ct.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=yt(t.x),t.y=yt(t.y),t.width=e>t.x?mt(t.width+e-t.x):mt(t.width),t.height=s>t.y?mt(t.height+s-t.y):mt(t.height)},unsign(t){t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height)},float(t,e){t.x=ft(t.x,e),t.y=ft(t.y,e),t.width=ft(t.width,e),t.height=ft(t.height,e)},add(t,e,s){xt=t.x+t.width,wt=t.y+t.height,vt=e.x,bt=e.y,s||(vt+=e.width,bt+=e.height),xt=xt>vt?xt:vt,wt=wt>bt?wt:bt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=xt-t.x,t.height=wt-t.y},addList(t,e){Ct.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){Ct.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){Ct.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,i=!1){let r,o=!0;for(let n=0,a=e.length;n<a;n++)r=s?s(e[n],n):e[n],r&&(r.width||r.height)&&(o?(o=!1,i||Pt(t,r)):Tt(t,r));o&&Ct.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?ct(dt,t.x,t.y):ut(dt,t.x,t.y)),_t(dt,t)},setPoint(t,e){Ct.set(t,e.x,e.y)},addPoint(t,e){Tt(t,e,!0)},getPoints(t){const{x:e,y:s,width:i,height:r}=t;return[{x:e,y:s},{x:e+i,y:s},{x:e+i,y:s+r},{x:e,y:s+r}]},hitRadiusPoint:(t,e,s)=>(s&&(e=V.tempToInnerRadiusPointOf(e,s)),e.x>=t.x-e.radiusX&&e.x<=t.x+t.width+e.radiusX&&e.y>=t.y-e.radiusY&&e.y<=t.y+t.height+e.radiusY),hitPoint:(t,e,s)=>(s&&(e=V.tempToInnerOf(e,s)),e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height),hit:(t,e,s)=>(s&&(e=Ct.tempToOuterOf(e,s)),!(t.y+t.height<e.y||e.y+e.height<t.y||t.x+t.width<e.x||e.x+e.width<t.x)),includes:(t,e,s)=>(s&&(e=Ct.tempToOuterOf(e,s)),t.x<=e.x&&t.y<=e.y&&t.x+t.width>=e.x+e.width&&t.y+t.height>=e.y+e.height),getIntersectData(t,e,s){if(s&&(e=Ct.tempToOuterOf(e,s)),!Ct.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:i,y:r,width:o,height:n}=e;return xt=i+o,wt=r+n,vt=t.x+t.width,bt=t.y+t.height,i=i>t.x?i:t.x,r=r>t.y?r:t.y,xt=xt<vt?xt:vt,wt=wt<bt?wt:bt,o=xt-i,n=wt-r,{x:i,y:r,width:o,height:n}},intersect(t,e,s){Ct.copy(t,Ct.getIntersectData(t,e,s))},isSame:(t,e)=>t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height,isEmpty:t=>0===t.x&&0===t.y&&0===t.width&&0===t.height,reset(t){Ct.set(t)}},Ct=Rt,{add:Tt,copy:Pt}=Ct;class Lt{get minX(){return Rt.minX(this)}get minY(){return Rt.minY(this)}get maxX(){return Rt.maxX(this)}get maxY(){return Rt.maxY(this)}constructor(t,e,s,i){this.set(t,e,s,i)}set(t,e,s,i){return u(t)?Rt.copy(this,t):Rt.set(this,t,e,s,i),this}get(){const{x:t,y:e,width:s,height:i}=this;return{x:t,y:e,width:s,height:i}}clone(){return new Lt(this)}move(t,e){return Rt.move(this,t,e),this}scale(t,e,s){return Rt.scale(this,t,e,s),this}scaleOf(t,e,s){return Rt.scaleOf(this,t,e,s),this}toOuterOf(t,e){return Rt.toOuterOf(this,t,e),this}toInnerOf(t,e){return Rt.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Rt.getFitMatrix(this,t,e)}put(t,e,s){Rt.put(this,t,e,s)}spread(t,e){return Rt.spread(this,t,e),this}shrink(t,e){return Rt.shrink(this,t,e),this}ceil(){return Rt.ceil(this),this}unsign(){return Rt.unsign(this),this}float(t){return Rt.float(this,t),this}add(t){return Rt.add(this,t),this}addList(t){return Rt.setList(this,t,!0),this}setList(t){return Rt.setList(this,t),this}addListWithFn(t,e){return Rt.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Rt.setListWithFn(this,t,e),this}setPoint(t){return Rt.setPoint(this,t),this}setPoints(t){return Rt.setPoints(this,t),this}addPoint(t){return Rt.addPoint(this,t),this}getPoints(){return Rt.getPoints(this)}hitPoint(t,e){return Rt.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Rt.hitRadiusPoint(this,t,e)}hit(t,e){return Rt.hit(this,t,e)}includes(t,e){return Rt.includes(this,t,e)}intersect(t,e){return Rt.intersect(this,t,e),this}getIntersect(t,e){return new Lt(Rt.getIntersectData(this,t,e))}isSame(t){return Rt.isSame(this,t)}isEmpty(){return Rt.isEmpty(this)}reset(){Rt.reset(this)}}const It=new Lt;class Et{constructor(t,e,s,i,r,o){u(t)?this.copy(t):this.set(t,e,s,i,r,o)}set(t=0,e=0,s=0,i=0,r=0,o=0){this.top=t,this.right=e,this.bottom=s,this.left=i,this.width=r,this.height=o}copy(t){const{top:e,right:s,bottom:i,left:r,width:o,height:n}=t;this.set(e,s,i,r,o,n)}getBoundsFrom(t){const{top:e,right:s,bottom:i,left:r,width:o,height:n}=this;return new Lt(r,e,o||t.width-r-s,n||t.height-e-i)}}const At={0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,".":1,e:1,E:1},{randColor:Ot}=w;class Mt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new Mt(t)}static set filter(t){this.filterList=Wt(t)}static set exclude(t){this.excludeList=Wt(t)}static drawRepaint(t,e){const s=Ot();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const i="hit"===Mt.showBounds,r=t.__nowWorld,o=Ot();i&&(e.setWorld(r),t.__drawHitPath(e),e.fillStyle=o.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(o,2),i?e.stroke():e.strokeWorld(r,o)}log(...t){if(Dt.enable){if(Dt.filterList.length&&Dt.filterList.every(t=>t!==this.name))return;if(Dt.excludeList.length&&Dt.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){Dt.enable&&this.warn(...t)}warn(...t){Dt.showWarn&&console.warn(this.name,...t)}repeat(t,...e){this.repeatMap[t]||(this.warn("repeat:"+t,...e),this.repeatMap[t]=!0)}error(...t){try{throw new Error}catch(e){console.error(this.name,...t,e)}}}function Wt(t){return t?a(t)&&(t=[t]):t=[],t}Mt.filterList=[],Mt.excludeList=[],Mt.showWarn=!0;const Dt=Mt,Ft=Mt.get("RunTime"),zt={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const i=s.create(s.RUNTIME);return Ut.currentId=Ut.idMap[i]=e?performance.now():Date.now(),Ut.currentName=Ut.nameMap[i]=t,Ut.nameToIdMap[t]=i,i},end(t,e){const s=Ut.idMap[t],i=Ut.nameMap[t],r=e?(performance.now()-s)/1e3:Date.now()-s;Ut.idMap[t]=Ut.nameMap[t]=Ut.nameToIdMap[i]=void 0,Ft.log(i,r,"ms")},endOfName(t,e){const s=Ut.nameToIdMap[t];o(s)||Ut.end(s,e)}},Ut=zt,Nt=[],Yt={list:{},add(t,...e){this.list[t]=!0,Nt.push(...e)},has(t,e){const s=this.list[t];return!s&&e&&this.need(t),s},need(t){console.error("please install and import plugin: "+(t.includes("-x")?"":"@leafer-in/")+t)}};setTimeout(()=>Nt.forEach(t=>Yt.has(t,!0)));const Xt={editor:t=>Yt.need("editor")},Ht=Mt.get("UICreator"),Gt={list:{},register(t){const{__tag:e}=t.prototype;Vt[e]&&Ht.repeat(e),Vt[e]=t},get(t,e,s,i,r,n){Vt[t]||Ht.error("not register "+t);const a=new Vt[t](e);return o(s)||(a.x=s,i&&(a.y=i),r&&(a.width=r),n&&(a.height=n)),a}},{list:Vt}=Gt,jt=Mt.get("EventCreator"),qt={nameList:{},register(t){let e;Object.keys(t).forEach(s=>{e=t[s],a(e)&&(Qt[e]&&jt.repeat(e),Qt[e]=t)})},changeName(t,e){const s=Qt[t];if(s){const i=Object.keys(s).find(e=>s[e]===t);i&&(s[i]=e,Qt[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new Qt[t](...e)},{nameList:Qt}=qt;class Jt{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:s}=this;for(let i=0,r=s.length;i<r;i++)if(e=s[i],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const i=Xt.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,i=this.list.length;s<i;s++)t=this.list[s],t.recycled?t.destroy():e.push(t);this.list=e}clear(){this.list.forEach(t=>{t.destroy()}),this.list.length=0}destroy(){this.clear()}}function $t(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n}function Zt(t,e,s,i){return new(s||(s=Promise))(function(r,o){function n(t){try{h(i.next(t))}catch(t){o(t)}}function a(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(n,a)}h((i=i.apply(t,e||[])).next())})}function Kt(t){return(e,s)=>{t||(t=s);const i={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===s&&(i.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,s,i)}}"function"==typeof SuppressedError&&SuppressedError;const te=[];function ee(){return(t,e)=>{te.push(e)}}const se=[];class ie{set blendMode(t){"normal"===t&&(t="source-over"),this.context.globalCompositeOperation=t}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(t){this.context.setLineDash(t||se)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;te.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,s,i,r,o){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,i,r,o){u(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,i,r,o)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,i){}strokeRect(t,e,s,i){}clearRect(t,e,s,i){}drawImage(t,e,s,i,r,o,n,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/i*a;i+=e,e=0,o+=t,a-=t}if(s<0){const t=-s/r*h;r+=s,s=0,n+=t,h-=t}this.context.drawImage(t,e,s,i,r,o,n,a,h);break;case 5:this.context.drawImage(t,e,s,i,r);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,i,r,o){}quadraticCurveTo(t,e,s,i){}closePath(){}arc(t,e,s,i,r,o){}arcTo(t,e,s,i,r){}ellipse(t,e,s,i,r,o,n,a){}rect(t,e,s,i){}roundRect(t,e,s,i,r){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,i){}createPattern(t,e){}createRadialGradient(t,e,s,i,r,o){}fillText(t,e,s,i){}measureText(t){}strokeText(t,e,s,i){}destroy(){this.context=null}}$t([Kt("imageSmoothingEnabled")],ie.prototype,"smooth",void 0),$t([Kt("imageSmoothingQuality")],ie.prototype,"smoothLevel",void 0),$t([Kt("globalAlpha")],ie.prototype,"opacity",void 0),$t([Kt()],ie.prototype,"fillStyle",void 0),$t([Kt()],ie.prototype,"strokeStyle",void 0),$t([Kt("lineWidth")],ie.prototype,"strokeWidth",void 0),$t([Kt("lineCap")],ie.prototype,"strokeCap",void 0),$t([Kt("lineJoin")],ie.prototype,"strokeJoin",void 0),$t([Kt("lineDashOffset")],ie.prototype,"dashOffset",void 0),$t([Kt()],ie.prototype,"miterLimit",void 0),$t([Kt()],ie.prototype,"shadowBlur",void 0),$t([Kt()],ie.prototype,"shadowColor",void 0),$t([Kt()],ie.prototype,"shadowOffsetX",void 0),$t([Kt()],ie.prototype,"shadowOffsetY",void 0),$t([Kt()],ie.prototype,"filter",void 0),$t([Kt()],ie.prototype,"font",void 0),$t([Kt()],ie.prototype,"fontKerning",void 0),$t([Kt()],ie.prototype,"fontStretch",void 0),$t([Kt()],ie.prototype,"fontVariantCaps",void 0),$t([Kt()],ie.prototype,"textAlign",void 0),$t([Kt()],ie.prototype,"textBaseline",void 0),$t([Kt()],ie.prototype,"textRendering",void 0),$t([Kt()],ie.prototype,"wordSpacing",void 0),$t([Kt()],ie.prototype,"letterSpacing",void 0),$t([Kt()],ie.prototype,"direction",void 0),$t([ee()],ie.prototype,"setTransform",null),$t([ee()],ie.prototype,"resetTransform",null),$t([ee()],ie.prototype,"getTransform",null),$t([ee()],ie.prototype,"save",null),$t([ee()],ie.prototype,"restore",null),$t([ee()],ie.prototype,"translate",null),$t([ee()],ie.prototype,"scale",null),$t([ee()],ie.prototype,"rotate",null),$t([ee()],ie.prototype,"fill",null),$t([ee()],ie.prototype,"stroke",null),$t([ee()],ie.prototype,"clip",null),$t([ee()],ie.prototype,"fillRect",null),$t([ee()],ie.prototype,"strokeRect",null),$t([ee()],ie.prototype,"clearRect",null),$t([ee()],ie.prototype,"beginPath",null),$t([ee()],ie.prototype,"moveTo",null),$t([ee()],ie.prototype,"lineTo",null),$t([ee()],ie.prototype,"bezierCurveTo",null),$t([ee()],ie.prototype,"quadraticCurveTo",null),$t([ee()],ie.prototype,"closePath",null),$t([ee()],ie.prototype,"arc",null),$t([ee()],ie.prototype,"arcTo",null),$t([ee()],ie.prototype,"ellipse",null),$t([ee()],ie.prototype,"rect",null),$t([ee()],ie.prototype,"roundRect",null),$t([ee()],ie.prototype,"createConicGradient",null),$t([ee()],ie.prototype,"createLinearGradient",null),$t([ee()],ie.prototype,"createPattern",null),$t([ee()],ie.prototype,"createRadialGradient",null),$t([ee()],ie.prototype,"fillText",null),$t([ee()],ie.prototype,"measureText",null),$t([ee()],ie.prototype,"strokeText",null);const{copy:re,multiplyParent:oe}=M,{round:ne}=Math,ae={width:1,height:1,pixelRatio:1},he=["width","height","pixelRatio"];class le extends ie{get width(){return this.size.width}get height(){return this.size.height}get pixelRatio(){return this.size.pixelRatio}get pixelWidth(){return this.width*this.pixelRatio||0}get pixelHeight(){return this.height*this.pixelRatio||0}get pixelSnap(){return this.config.pixelSnap}set pixelSnap(t){this.config.pixelSnap=t}get allowBackgroundColor(){return this.view&&this.parentView}constructor(t,i){super(),this.size={},this.worldTransform={},t||(t=ae),this.manager=i,this.innerId=s.create(s.CNAVAS);const{width:r,height:o,pixelRatio:n}=t;this.autoLayout=!r||!o,this.size.pixelRatio=n||e.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let s;this.context&&!this.unreal&&e&&this.width&&(s=this.getSameCanvas(),s.copyWorld(this));const i=this.size;p.copyAttrs(i,t,he),he.forEach(t=>i[t]||(i[t]=1)),this.bounds=new Lt(0,0,this.width,this.height),this.context&&!this.unreal&&(this.updateViewSize(),this.smooth=this.config.smooth),this.updateClientBounds(),this.context&&!this.unreal&&s&&(this.clearWorld(s.bounds),this.copyWorld(s),s.recycle())}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s,pixelSnap:i}=this,r=this.worldTransform;e&&oe(t,e,r),r.a=t.a*s,r.b=t.b*s,r.c=t.c*s,r.d=t.d*s,r.e=t.e*s,r.f=t.f*s,i&&(t.half&&t.half*s%2?(r.e=ne(r.e-.5)+.5,r.f=ne(r.f-.5)+.5):(r.e=ne(r.e),r.f=ne(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,s,i){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,i)}setStrokeOptions(t,e){let{strokeCap:s,strokeJoin:i,dashPattern:r,dashOffset:n,miterLimit:a}=t;e&&(e.strokeCap&&(s=e.strokeCap),e.strokeJoin&&(i=e.strokeJoin),o(e.dashPattern)||(r=e.dashPattern),o(e.dashOffset)||(n=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=s,this.strokeJoin=i,this.dashPattern=r,this.dashOffset=n,this.miterLimit=a}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,e){return!0}hitStroke(t,e){return!0}hitPixel(t,e,s=1){return!0}setWorldShadow(t,e,s,i){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=e*r,this.shadowBlur=s*r,this.shadowColor=i||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,i){if(i&&(this.blendMode=i),e){const{pixelRatio:i}=this;s||(s=e),this.drawImage(t.view,e.x*i,e.y*i,e.width*i,e.height*i,s.x*i,s.y*i,s.width*i,s.height*i)}else this.drawImage(t.view,0,0);i&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,i){if(i&&(this.blendMode=i),e.b||e.c)this.save(),this.resetTransform(),this.copyWorld(t,e,Rt.tempToOuterOf(s,e)),this.restore();else{const{pixelRatio:i}=this;this.drawImage(t.view,e.x*i,e.y*i,e.width*i,e.height*i,s.x,s.y,s.width,s.height)}i&&(this.blendMode="source-over")}copyWorldByReset(t,e,s,i,r){this.resetTransform(),this.copyWorld(t,e,s,i),r||this.useWorldTransform()}useGrayscaleAlpha(t){let e,s;this.setTempBounds(t,!0,!0);const{context:i}=this,r=i.getImageData(It.x,It.y,It.width,It.height),{data:o}=r;for(let t=0,i=o.length;t<i;t+=4)s=.299*o[t]+.587*o[t+1]+.114*o[t+2],(e=o[t+3])&&(o[t+3]=255===e?s:e*(s/255));i.putImageData(r,It.x,It.y)}useMask(t,e,s){this.copyWorld(t,e,s,"destination-in")}useEraser(t,e,s){this.copyWorld(t,e,s,"destination-out")}fillWorld(t,e,s){s&&(this.blendMode=s),this.fillStyle=e,this.setTempBounds(t),this.fillRect(It.x,It.y,It.width,It.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempBounds(t),this.strokeRect(It.x,It.y,It.width,It.height),s&&(this.blendMode="source-over")}clipWorld(t,e){this.beginPath(),this.setTempBounds(t,e),this.rect(It.x,It.y,It.width,It.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e){this.setTempBounds(t,e),this.clearRect(It.x,It.y,It.width,It.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempBounds(t,e,s){It.set(t),s&&It.intersect(this.bounds),It.scale(this.pixelRatio),e&&It.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:s,pixelSnap:i}=this,r=this.manager?this.manager.get(s):Xt.canvas(Object.assign({},s));return r.save(),t&&(re(r.worldTransform,this.worldTransform),r.useWorldTransform()),e&&(r.smooth=this.smooth),r.pixelSnap!==i&&(r.pixelSnap=i),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t,!0):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}}const de={creator:{},parse(t,e){},convertToCanvasData(t,e){}},ce={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},ue=Object.assign({M:1,m:10,L:2,l:20,H:3,h:30,V:4,v:40,C:5,c:50,S:6,s:60,Q:7,q:70,T:8,t:80,A:9,a:90,Z:11,z:11,R:12},ce),_e={M:3,m:3,L:3,l:3,H:2,h:2,V:2,v:2,C:7,c:7,S:5,s:5,Q:5,q:5,T:3,t:3,A:8,a:8,Z:1,z:1,N:5,D:9,X:6,G:9,F:5,O:7,P:4,U:6},pe={m:10,l:20,H:3,h:30,V:4,v:40,c:50,S:6,s:60,q:70,T:8,t:80,A:9,a:90},fe=Object.assign(Object.assign({},pe),ce),ge=ue,ye={};for(let t in ge)ye[ge[t]]=t;const me={};for(let t in ge)me[ge[t]]=_e[t];const xe={drawRoundRect(t,e,s,i,r,o){const n=w.fourNumber(o,Math.min(i/2,r/2)),a=e+i,h=s+r;n[0]?t.moveTo(e+n[0],s):t.moveTo(e,s),n[1]?t.arcTo(a,s,a,h,n[1]):t.lineTo(a,s),n[2]?t.arcTo(a,h,e,h,n[2]):t.lineTo(a,h),n[3]?t.arcTo(e,h,e,s,n[3]):t.lineTo(e,h),n[0]?t.arcTo(e,s,a,s,n[0]):t.lineTo(e,s)}},{sin:we,cos:ve,atan2:be,ceil:Be,abs:ke,PI:Se,sqrt:Re,pow:Ce}=Math,{setPoint:Te,addPoint:Pe}=et,{set:Le,toNumberPoints:Ie}=V,{M:Ee,L:Ae,C:Oe,Q:Me,Z:We}=ue,De={},Fe={points(t,e,s,i){let r=Ie(e);if(t.push(Ee,r[0],r[1]),s&&r.length>5){let e,o,n,a,h,l,d,c,u,_,p,f,g,y=r.length;const m=!0===s?.5:s;i&&(r=[r[y-2],r[y-1],...r,r[0],r[1],r[2],r[3]],y=r.length);for(let s=2;s<y-2;s+=2)e=r[s-2],o=r[s-1],n=r[s],a=r[s+1],h=r[s+2],l=r[s+3],p=Re(Ce(n-e,2)+Ce(a-o,2)),f=Re(Ce(h-n,2)+Ce(l-a,2)),(p||f)&&(g=p+f,p=m*p/g,f=m*f/g,h-=e,l-=o,d=n-p*h,c=a-p*l,2===s?i||t.push(Me,d,c,n,a):t.push(Oe,u,_,d,c,n,a),u=n+f*h,_=a+f*l);i||t.push(Me,u,_,r[y-2],r[y-1])}else for(let e=2,s=r.length;e<s;e+=2)t.push(Ae,r[e],r[e+1]);i&&t.push(We)},rect(t,e,s,i,r){de.creator.path=t,de.creator.moveTo(e,s).lineTo(e+i,s).lineTo(e+i,s+r).lineTo(e,s+r).lineTo(e,s)},roundRect(t,e,s,i,r,o){de.creator.path=[],xe.drawRoundRect(de.creator,e,s,i,r,o),t.push(...de.convertToCanvasData(de.creator.path,!0))},arcTo(t,e,s,i,r,o,n,a,h,l,d){const c=i-e,u=r-s,_=o-i,p=n-r;let f=be(u,c),g=be(p,_),y=g-f;if(y<0&&(y+=B),y===Se||ke(c+u)<1e-12||ke(_+p)<1e-12)return t&&t.push(Ae,i,r),h&&(Te(h,e,s),Pe(h,i,r)),d&&Le(d,e,s),void(l&&Le(l,i,r));const m=c*p-_*u<0,x=m?-1:1,w=a/ve(y/2),v=i+w*ve(f+y/2+k*x),S=r+w*we(f+y/2+k*x);return f-=k*x,g-=k*x,Ne(t,v,S,a,a,0,f/b,g/b,m,h,l,d)},arc:(t,e,s,i,r,o,n,a,h,l)=>Ne(t,e,s,i,i,0,r,o,n,a,h,l),ellipse(t,e,s,i,r,o,n,a,h,l,d,c){const u=o*b,_=we(u),p=ve(u);let f=n*b,g=a*b;f>Se&&(f-=B),g<0&&(g+=B);let y=g-f;y<0?y+=B:y>B&&(y-=B),h&&(y-=B);const m=Be(ke(y/k)),x=y/m,w=we(x/4),v=8/3*w*w/we(x/2);g=f+x;let S,R,C,T,P,L,I,E,A=ve(f),O=we(f),M=C=p*i*A-_*r*O,W=T=_*i*A+p*r*O,D=e+C,F=s+T;t&&t.push(t.length?Ae:Ee,D,F),l&&Te(l,D,F),c&&Le(c,D,F);for(let o=0;o<m;o++)S=ve(g),R=we(g),C=p*i*S-_*r*R,T=_*i*S+p*r*R,P=e+M-v*(p*i*O+_*r*A),L=s+W-v*(_*i*O-p*r*A),I=e+C+v*(p*i*R+_*r*S),E=s+T+v*(_*i*R-p*r*S),t&&t.push(Oe,P,L,I,E,e+C,s+T),l&&Ue(e+M,s+W,P,L,I,E,e+C,s+T,l,!0),M=C,W=T,A=S,O=R,f=g,g+=x;d&&Le(d,e+C,s+T)},quadraticCurveTo(t,e,s,i,r,o,n){t.push(Oe,(e+2*i)/3,(s+2*r)/3,(o+2*i)/3,(n+2*r)/3,o,n)},toTwoPointBoundsByQuadraticCurve(t,e,s,i,r,o,n,a){Ue(t,e,(t+2*s)/3,(e+2*i)/3,(r+2*s)/3,(o+2*i)/3,r,o,n,a)},toTwoPointBounds(t,e,s,i,r,o,n,a,h,l){const d=[];let c,u,_,p,f,g,y,m,x=t,w=s,v=r,b=n;for(let t=0;t<2;++t)if(1==t&&(x=e,w=i,v=o,b=a),c=-3*x+9*w-9*v+3*b,u=6*x-12*w+6*v,_=3*w-3*x,Math.abs(c)<1e-12){if(Math.abs(u)<1e-12)continue;p=-_/u,0<p&&p<1&&d.push(p)}else y=u*u-4*_*c,m=Math.sqrt(y),y<0||(f=(-u+m)/(2*c),0<f&&f<1&&d.push(f),g=(-u-m)/(2*c),0<g&&g<1&&d.push(g));l?Pe(h,t,e):Te(h,t,e),Pe(h,n,a);for(let l=0,c=d.length;l<c;l++)ze(d[l],t,e,s,i,r,o,n,a,De),Pe(h,De.x,De.y)},getPointAndSet(t,e,s,i,r,o,n,a,h,l){const d=1-t,c=d*d*d,u=3*d*d*t,_=3*d*t*t,p=t*t*t;l.x=c*e+u*i+_*o+p*a,l.y=c*s+u*r+_*n+p*h},getPoint(t,e,s,i,r,o,n,a,h){const l={};return ze(t,e,s,i,r,o,n,a,h,l),l},getDerivative(t,e,s,i,r){const o=1-t;return 3*o*o*(s-e)+6*o*t*(i-s)+3*t*t*(r-i)}},{getPointAndSet:ze,toTwoPointBounds:Ue,ellipse:Ne}=Fe,{sin:Ye,cos:Xe,sqrt:He,atan2:Ge}=Math,{ellipse:Ve}=Fe,je={ellipticalArc(t,s,i,r,o,n,a,h,l,d,c){const u=(l-s)/2,_=(d-i)/2,p=n*b,f=Ye(p),g=Xe(p),y=-g*u-f*_,m=-g*_+f*u,x=r*r,w=o*o,v=m*m,k=y*y,S=x*w-x*v-w*k;let R=0;if(S<0){const t=He(1-S/(x*w));r*=t,o*=t}else R=(a===h?-1:1)*He(S/(x*v+w*k));const C=R*r*m/o,T=-R*o*y/r,P=Ge((m-T)/o,(y-C)/r),L=Ge((-m-T)/o,(-y-C)/r);let I=L-P;0===h&&I>0?I-=B:1===h&&I<0&&(I+=B);const E=s+u+g*C-f*T,A=i+_+f*C+g*T,O=I<0?1:0;c||e.ellipseToCurve?Ve(t,E,A,r,o,n,P/b,L/b,O):r!==o||n?t.push(ue.G,E,A,r,o,n,P/b,L/b,O):t.push(ue.O,E,A,r,P/b,L/b,O)}},{M:qe,m:Qe,L:Je,l:$e,H:Ze,h:Ke,V:ts,v:es,C:ss,c:is,S:rs,s:os,Q:ns,q:as,T:hs,t:ls,A:ds,a:cs,Z:us,z:_s,N:ps,D:fs,X:gs,G:ys,F:ms,O:xs,P:ws,U:vs}=ue,{rect:bs,roundRect:Bs,arcTo:ks,arc:Ss,ellipse:Rs,quadraticCurveTo:Cs}=Fe,{ellipticalArc:Ts}=je,Ps=Mt.get("PathConvert"),Ls={},Is={current:{dot:0},stringify(t,e){let s,i,r,o=0,n=t.length,a="";for(;o<n;){i=t[o],s=me[i],a+=i===r?" ":ye[i];for(let i=1;i<s;i++)a+=w.float(t[o+i],e),i===s-1||(a+=" ");r=i,o+=s}return a},parse(t,e){let s,i,r,o="";const n=[],a=e?fe:pe;for(let e=0,h=t.length;e<h;e++)i=t[e],At[i]?("."===i&&(Es.dot&&(As(n,o),o=""),Es.dot++),"0"===o&&"."!==i&&(As(n,o),o=""),o+=i):ue[i]?(o&&(As(n,o),o=""),Es.name=ue[i],Es.length=_e[i],Es.index=0,As(n,Es.name),!s&&a[i]&&(s=!0)):"-"===i||"+"===i?"e"===r||"E"===r?o+=i:(o&&As(n,o),o=i):o&&(As(n,o),o=""),r=i;return o&&As(n,o),s?Is.toCanvasData(n,e):n},toCanvasData(t,e){let s,i,r,o,n,a=0,h=0,l=0,d=0,c=0,u=t.length;const _=[];for(;c<u;){switch(r=t[c],r){case Qe:t[c+1]+=a,t[c+2]+=h;case qe:a=t[c+1],h=t[c+2],_.push(qe,a,h),c+=3;break;case Ke:t[c+1]+=a;case Ze:a=t[c+1],_.push(Je,a,h),c+=2;break;case es:t[c+1]+=h;case ts:h=t[c+1],_.push(Je,a,h),c+=2;break;case $e:t[c+1]+=a,t[c+2]+=h;case Je:a=t[c+1],h=t[c+2],_.push(Je,a,h),c+=3;break;case os:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=rs;case rs:n=o===ss||o===rs,l=n?2*a-s:t[c+1],d=n?2*h-i:t[c+2],s=t[c+1],i=t[c+2],a=t[c+3],h=t[c+4],_.push(ss,l,d,s,i,a,h),c+=5;break;case is:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,t[c+5]+=a,t[c+6]+=h,r=ss;case ss:s=t[c+3],i=t[c+4],a=t[c+5],h=t[c+6],_.push(ss,t[c+1],t[c+2],s,i,a,h),c+=7;break;case ls:t[c+1]+=a,t[c+2]+=h,r=hs;case hs:n=o===ns||o===hs,s=n?2*a-s:t[c+1],i=n?2*h-i:t[c+2],e?Cs(_,a,h,s,i,t[c+1],t[c+2]):_.push(ns,s,i,t[c+1],t[c+2]),a=t[c+1],h=t[c+2],c+=3;break;case as:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=ns;case ns:s=t[c+1],i=t[c+2],e?Cs(_,a,h,s,i,t[c+3],t[c+4]):_.push(ns,s,i,t[c+3],t[c+4]),a=t[c+3],h=t[c+4],c+=5;break;case cs:t[c+6]+=a,t[c+7]+=h;case ds:Ts(_,a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],e),a=t[c+6],h=t[c+7],c+=8;break;case _s:case us:_.push(us),c++;break;case ps:a=t[c+1],h=t[c+2],e?bs(_,a,h,t[c+3],t[c+4]):Os(_,t,c,5),c+=5;break;case fs:a=t[c+1],h=t[c+2],e?Bs(_,a,h,t[c+3],t[c+4],[t[c+5],t[c+6],t[c+7],t[c+8]]):Os(_,t,c,9),c+=9;break;case gs:a=t[c+1],h=t[c+2],e?Bs(_,a,h,t[c+3],t[c+4],t[c+5]):Os(_,t,c,6),c+=6;break;case ys:Rs(e?_:Os(_,t,c,9),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],t[c+8],null,Ls),a=Ls.x,h=Ls.y,c+=9;break;case ms:e?Rs(_,t[c+1],t[c+2],t[c+3],t[c+4],0,0,360,!1):Os(_,t,c,5),a=t[c+1]+t[c+3],h=t[c+2],c+=5;break;case xs:Ss(e?_:Os(_,t,c,7),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],null,Ls),a=Ls.x,h=Ls.y,c+=7;break;case ws:e?Ss(_,t[c+1],t[c+2],t[c+3],0,360,!1):Os(_,t,c,4),a=t[c+1]+t[c+3],h=t[c+2],c+=4;break;case vs:ks(e?_:Os(_,t,c,6),a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],null,Ls),a=Ls.x,h=Ls.y,c+=6;break;default:return Ps.error(`command: ${r} [index:${c}]`,t),_}o=r}return _},objectToCanvasData(t){const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(qe,t.x,t.y);break;case"L":e.push(Je,t.x,t.y);break;case"C":e.push(ss,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(ns,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(us)}}),e},copyData(t,e,s,i){for(let r=s,o=s+i;r<o;r++)t.push(e[r])},pushData(t,e){Es.index===Es.length&&(Es.index=1,t.push(Es.name)),t.push(Number(e)),Es.index++,Es.dot=0}},{current:Es,pushData:As,copyData:Os}=Is,{M:Ms,L:Ws,C:Ds,Q:Fs,Z:zs,N:Us,D:Ns,X:Ys,G:Xs,F:Hs,O:Gs,P:Vs,U:js}=ue,{getMinDistanceFrom:qs,getRadianFrom:Qs}=V,{tan:Js,min:$s,abs:Zs}=Math,Ks={},ti={beginPath(t){t.length=0},moveTo(t,e,s){t.push(Ms,e,s)},lineTo(t,e,s){t.push(Ws,e,s)},bezierCurveTo(t,e,s,i,r,o,n){t.push(Ds,e,s,i,r,o,n)},quadraticCurveTo(t,e,s,i,r){t.push(Fs,e,s,i,r)},closePath(t){t.push(zs)},rect(t,e,s,i,r){t.push(Us,e,s,i,r)},roundRect(t,e,s,i,r,o){if(l(o))t.push(Ys,e,s,i,r,o);else{const n=w.fourNumber(o);n?t.push(Ns,e,s,i,r,...n):t.push(Us,e,s,i,r)}},ellipse(t,e,s,i,r,o,a,h,l){n(o)?t.push(Hs,e,s,i,r):(n(a)&&(a=0),n(h)&&(h=360),t.push(Xs,e,s,i,r,o,a,h,l?1:0))},arc(t,e,s,i,r,o,a){n(r)?t.push(Vs,e,s,i):(n(o)&&(o=360),t.push(Gs,e,s,i,r,o,a?1:0))},arcTo(t,e,s,i,r,n,a,h){if(!o(a)){const t=qs(a,h,e,s,i,r);n=$s(n,$s(t/2,t/2*Zs(Js(Qs(a,h,e,s,i,r)/2))))}t.push(js,e,s,i,r,n)},drawEllipse(t,e,s,i,r,o,a,h,l){Fe.ellipse(null,e,s,i,r,n(o)?0:o,n(a)?0:a,n(h)?360:h,l,null,null,Ks),t.push(Ms,Ks.x,Ks.y),ei(t,e,s,i,r,o,a,h,l)},drawArc(t,e,s,i,r,o,a){Fe.arc(null,e,s,i,n(r)?0:r,n(o)?360:o,a,null,null,Ks),t.push(Ms,Ks.x,Ks.y),si(t,e,s,i,r,o,a)},drawPoints(t,e,s,i){Fe.points(t,e,s,i)}},{ellipse:ei,arc:si}=ti,{moveTo:ii,lineTo:ri,quadraticCurveTo:oi,bezierCurveTo:ni,closePath:ai,beginPath:hi,rect:li,roundRect:di,ellipse:ci,arc:ui,arcTo:_i,drawEllipse:pi,drawArc:fi,drawPoints:gi}=ti;class yi{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?a(t)?de.parse(t):t:[],this}beginPath(){return hi(this.__path),this.paint(),this}moveTo(t,e){return ii(this.__path,t,e),this.paint(),this}lineTo(t,e){return ri(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,i,r,o){return ni(this.__path,t,e,s,i,r,o),this.paint(),this}quadraticCurveTo(t,e,s,i){return oi(this.__path,t,e,s,i),this.paint(),this}closePath(){return ai(this.__path),this.paint(),this}rect(t,e,s,i){return li(this.__path,t,e,s,i),this.paint(),this}roundRect(t,e,s,i,r){return di(this.__path,t,e,s,i,r),this.paint(),this}ellipse(t,e,s,i,r,o,n,a){return ci(this.__path,t,e,s,i,r,o,n,a),this.paint(),this}arc(t,e,s,i,r,o){return ui(this.__path,t,e,s,i,r,o),this.paint(),this}arcTo(t,e,s,i,r){return _i(this.__path,t,e,s,i,r),this.paint(),this}drawEllipse(t,e,s,i,r,o,n,a){return pi(this.__path,t,e,s,i,r,o,n,a),this.paint(),this}drawArc(t,e,s,i,r,o){return fi(this.__path,t,e,s,i,r,o),this.paint(),this}drawPoints(t,e,s){return gi(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:mi,L:xi,C:wi,Q:vi,Z:bi,N:Bi,D:ki,X:Si,G:Ri,F:Ci,O:Ti,P:Pi,U:Li}=ue,Ii=Mt.get("PathDrawer"),Ei={drawPathByData(t,e){if(!e)return;let s,i=0,r=e.length;for(;i<r;)switch(s=e[i],s){case mi:t.moveTo(e[i+1],e[i+2]),i+=3;break;case xi:t.lineTo(e[i+1],e[i+2]),i+=3;break;case wi:t.bezierCurveTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5],e[i+6]),i+=7;break;case vi:t.quadraticCurveTo(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case bi:t.closePath(),i+=1;break;case Bi:t.rect(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case ki:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],[e[i+5],e[i+6],e[i+7],e[i+8]]),i+=9;break;case Si:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;case Ri:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]*b,e[i+6]*b,e[i+7]*b,e[i+8]),i+=9;break;case Ci:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],0,0,B,!1),i+=5;break;case Ti:t.arc(e[i+1],e[i+2],e[i+3],e[i+4]*b,e[i+5]*b,e[i+6]),i+=7;break;case Pi:t.arc(e[i+1],e[i+2],e[i+3],0,B,!1),i+=4;break;case Li:t.arcTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;default:return void Ii.error(`command: ${s} [index:${i}]`,e)}}},{M:Ai,L:Oi,C:Mi,Q:Wi,Z:Di,N:Fi,D:zi,X:Ui,G:Ni,F:Yi,O:Xi,P:Hi,U:Gi}=ue,{toTwoPointBounds:Vi,toTwoPointBoundsByQuadraticCurve:ji,arcTo:qi,arc:Qi,ellipse:Ji}=Fe,{addPointBounds:$i,copy:Zi,addPoint:Ki,setPoint:tr,addBounds:er,toBounds:sr}=et,ir=Mt.get("PathBounds");let rr,or,nr;const ar={},hr={},lr={},dr={toBounds(t,e){dr.toTwoPointBounds(t,hr),sr(hr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return tr(e,0,0);let s,i,r,o,n,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(n=t[a],0===a&&(n===Di||n===Mi||n===Wi?tr(e,h,l):tr(e,t[a+1],t[a+2])),n){case Ai:case Oi:h=t[a+1],l=t[a+2],Ki(e,h,l),a+=3;break;case Mi:r=t[a+5],o=t[a+6],Vi(h,l,t[a+1],t[a+2],t[a+3],t[a+4],r,o,ar),$i(e,ar),h=r,l=o,a+=7;break;case Wi:s=t[a+1],i=t[a+2],r=t[a+3],o=t[a+4],ji(h,l,s,i,r,o,ar),$i(e,ar),h=r,l=o,a+=5;break;case Di:a+=1;break;case Fi:h=t[a+1],l=t[a+2],er(e,h,l,t[a+3],t[a+4]),a+=5;break;case zi:case Ui:h=t[a+1],l=t[a+2],er(e,h,l,t[a+3],t[a+4]),a+=n===zi?9:6;break;case Ni:Ji(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],ar,lr),0===a?Zi(e,ar):$i(e,ar),h=lr.x,l=lr.y,a+=9;break;case Yi:h=t[a+1],l=t[a+2],or=t[a+3],nr=t[a+4],er(e,h-or,l-nr,2*or,2*nr),h+=or,a+=5;break;case Xi:Qi(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],ar,lr),0===a?Zi(e,ar):$i(e,ar),h=lr.x,l=lr.y,a+=7;break;case Hi:h=t[a+1],l=t[a+2],rr=t[a+3],er(e,h-rr,l-rr,2*rr,2*rr),h+=rr,a+=4;break;case Gi:qi(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],ar,lr),0===a?Zi(e,ar):$i(e,ar),h=lr.x,l=lr.y,a+=6;break;default:return void ir.error(`command: ${n} [index:${a}]`,t)}}},{M:cr,L:ur,Z:_r}=ue,{getCenterX:pr,getCenterY:fr}=V,{arcTo:gr}=ti,yr={smooth(t,e,s){let i,r,o,n=0,a=0,h=0,l=0,d=0,c=0,u=0,_=0,p=0;const f=t.length,g=[];for(;n<f;){switch(i=t[n],i){case cr:l=_=t[n+1],d=p=t[n+2],n+=3,t[n]===ur?(c=t[n+1],u=t[n+2],g.push(cr,pr(l,c),fr(d,u))):g.push(cr,l,d);break;case ur:switch(a=t[n+1],h=t[n+2],n+=3,t[n]){case ur:gr(g,a,h,t[n+1],t[n+2],e,_,p);break;case _r:gr(g,a,h,l,d,e,_,p);break;default:g.push(ur,a,h)}_=a,p=h;break;case _r:r!==_r&&(gr(g,l,d,c,u,e,_,p),g.push(_r)),n+=1;break;default:o=me[i];for(let e=0;e<o;e++)g.push(t[n+e]);n+=o}r=i}return i!==_r&&(g[1]=l,g[2]=d),g}};de.creator=new yi,de.parse=Is.parse,de.convertToCanvasData=Is.toCanvasData;const mr=new yi,{drawRoundRect:xr}=xe;function wr(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,i,r){xr(this,t,e,s,i,r)})}(t)}const vr={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mineType:t=>!t||t.startsWith("image")?t:("jpg"===t&&(t="jpeg"),"image/"+t),fileType(t){const e=t.split(".");return e[e.length-1]},isOpaqueImage(t){const e=br.fileType(t);return["jpg","jpeg"].some(t=>t===e)},getExportOptions(t){switch(typeof t){case"object":return t;case"number":return{quality:t};case"boolean":return{blob:t};default:return{}}}},br=vr;br.alphaPixelTypes.forEach(t=>br.upperCaseTypeMap[t]=t.toUpperCase());const Br=Mt.get("TaskProcessor");class kr{constructor(t){this.parallel=!0,this.time=1,this.id=s.create(s.TASK),this.task=t}run(){return Zt(this,void 0,void 0,function*(){try{this.task&&!this.isComplete&&this.parent.running&&(yield this.task())}catch(t){Br.error(t)}})}complete(){this.isComplete=!0,this.parent=null,this.task=null}cancel(){this.isCancel=!0,this.complete()}}class Sr{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,s=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(s+=this.list[i].time,i===this.finishedIndex&&(e=s)):e+=this.list[i].time;return this.isComplete?1:s/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&p.assign(this.config,t),this.empty()}add(t,e){let s,i,r,n;const a=new kr(t);return a.parent=this,l(e)?n=e:e&&(i=e.parallel,s=e.start,r=e.time,n=e.delay),r&&(a.time=r),!1===i&&(a.parallel=!1),o(n)?this.push(a,s):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(a,s))},n)),this.isComplete=!1,a}push(t,e){this.list.push(t),!1===e||this.timer||(this.timer=setTimeout(()=>this.start()))}empty(){this.index=0,this.parallelSuccessNumber=0,this.list=[],this.parallelList=[],this.delayNumber=0}start(){this.running||(this.running=!0,this.isComplete=!1,this.run())}pause(){clearTimeout(this.timer),this.timer=null,this.running=!1}resume(){this.start()}skip(){this.index++,this.resume()}stop(){this.isComplete=!0,this.list.forEach(t=>{t.isComplete||t.cancel()}),this.pause(),this.empty()}run(){this.running&&(this.setParallelList(),this.parallelList.length>1?this.runParallelTasks():this.remain?this.runTask():this.onComplete())}runTask(){const t=this.list[this.index];t?t.run().then(()=>{this.onTask(t),this.index++,this.nextTask()}).catch(t=>{this.onError(t)}):this.nextTask()}runParallelTasks(){this.parallelList.forEach(t=>this.runParallelTask(t))}runParallelTask(t){t.run().then(()=>{this.onTask(t),this.fillParallelTask()}).catch(t=>{this.onParallelError(t)})}nextTask(){this.total===this.finishedIndex?this.onComplete():this.timer=setTimeout(()=>this.run())}setParallelList(){let t;this.parallelList=[],this.parallelSuccessNumber=0;let e=this.index+this.config.parallel;e>this.list.length&&(e=this.list.length);for(let s=this.index;s<e&&(t=this.list[s],t.parallel);s++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const s=e.length,i=this.finishedIndex+s;if(e.length){if(!this.running)return;i<this.total&&(t=this.list[i],t&&t.parallel&&(e.push(t),this.runParallelTask(t)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(t){t.complete(),this.config.onTask&&this.config.onTask()}onParallelError(t){this.parallelList.forEach(t=>{t.parallel=!1}),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(t)}onError(t){this.pause(),this.config.onError&&this.config.onError(t)}destroy(){this.stop()}}const Rr=Mt.get("Resource"),Cr={tasker:new Sr,map:{},get isComplete(){return Tr.tasker.isComplete},set(t,e){Tr.map[t]&&Rr.repeat(t),Tr.map[t]=e},get:t=>Tr.map[t],remove(t){const e=Tr.map[t];e&&(e.destroy&&e.destroy(),delete Tr.map[t])},loadImage(t,e){return new Promise((s,i)=>{const r=this.setImage(t,t,e);r.load(()=>s(r),t=>i(t))})},setImage(t,e,s){let i;return a(e)?i={url:e}:e.url||(i={url:t,view:e}),i&&(s&&(i.format=s),e=Xt.image(i)),Tr.set(t,e),e},destroy(){Tr.map={}}},Tr=Cr,Pr={maxRecycled:10,recycledList:[],patternTasker:new Sr,get(t){let e=Cr.get(t.url);return e||Cr.set(t.url,e=Xt.image(t)),e.use++,e},recycle(t){t.use--,setTimeout(()=>{t.use||Lr.recycledList.push(t)})},clearRecycled(){const t=Lr.recycledList;t.length>Lr.maxRecycled&&(t.forEach(t=>!t.use&&t.url&&Cr.remove(t.url)),t.length=0)},hasAlphaPixel:t=>vr.alphaPixelTypes.some(e=>Lr.isFormat(e,t)),isFormat(t,e){if(e.format===t)return!0;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+vr.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+vr.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){Lr.recycledList=[]}},Lr=Pr,{IMAGE:Ir,create:Er}=s,{floor:Ar,max:Or}=Math;class Mr{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=Er(Ir),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}Pr.isFormat("svg",t)&&(this.isSVG=!0),Pr.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,s){if(!this.loading){this.loading=!0;let{loadImage:t,loadImageWithProgress:s}=e.origin,i=this.config.showProgress&&s&&this.onProgress.bind(this);i&&(t=s),Cr.tasker.add(()=>Zt(this,void 0,void 0,function*(){return yield t(this.url,i).then(t=>this.setView(t)).catch(t=>{this.error=t,this.onComplete(!1)})}))}return this.waitComplete.push(t,s),this.waitComplete.length-2}unload(t,e){const s=this.waitComplete;if(e){const e=s[t+1];e&&e({type:"stop"})}s[t]=s[t+1]=void 0}setView(t){this.ready=!0,this.width=t.naturalWidth||t.width,this.height=t.naturalHeight||t.height,this.view=t,this.onComplete(!0)}onProgress(t){this.progress=t}onComplete(t){let e;this.waitComplete.forEach((s,i)=>{e=i%2,s&&(t?e||s(this):e&&s(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,s,i,r,o,n){if(t||(t=this.width),s||(s=this.height),this.cache){let{params:t,data:e}=this.cache;for(let s in t)if(t[s]!==arguments[s]){e=null;break}if(e)return e}const a=e.origin.createCanvas(Or(Ar(t+(o||0)),1),Or(Ar(s+(n||0)),1)),h=a.getContext("2d");return i&&(h.globalAlpha=i),h.drawImage(this.view,0,0,t,s),this.cache=this.use>1?{data:a,params:arguments}:null,a}getPattern(t,s,i,r){const o=e.canvas.createPattern(t,s);try{i&&o.setTransform&&(o.setTransform(i),i=void 0)}catch(t){}return r&&p.stintSet(r,"transform",i),o}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}}function Wr(t,e,s,i){i||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function Dr(t,e){return Object.getOwnPropertyDescriptor(t,e)}function Fr(t,e){const s="_"+t;return{get(){const t=this[s];return o(t)?e:t},set(t){this[s]=t}}}function zr(t,e){return(s,i)=>Nr(s,i,t,e&&e(i))}function Ur(t){return t}function Nr(t,e,s,i){const r={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};Wr(t,e,Object.assign(r,i||{})),po(t,e,s)}function Yr(t){return zr(t)}function Xr(t,e){return zr(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function Hr(t){return zr(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),Qr(this))}}))}function Gr(t,e){return zr(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function Vr(t,e){return zr(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function jr(t,e){return zr(t,t=>({set(s){this.__setAttr(t,s,e)&&Qr(this)}}))}function qr(t){return zr(t,t=>({set(e){this.__setAttr(t,e)&&(Qr(this),this.__.__removeNaturalSize())}}))}function Qr(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function Jr(t){return zr(t,t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),Qr(this)}}))}const $r=jr;function Zr(t,e){return zr(t,t=>({set(s){this.__setAttr(t,s)&&(Kr(this),e&&(this.__.__useStroke=!0))}}))}function Kr(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&Qr(t)}const to=Zr;function eo(t){return zr(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function so(t){return zr(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function io(t){return zr(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&oo(this)}}))}function ro(t){return zr(t,t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>no(this,t,e,s))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");no(this,t,e,s),this.mask&&oo(this)}}))}function oo(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function no(t,e,s,i){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==i&&0!==s||Qr(t))}function ao(t){return zr(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange(),this.waitParent(()=>{this.parent.__layout.childrenSortChange()}))}}))}function ho(t){return zr(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}function lo(t){return zr(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}function co(t){return zr(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,"hit"===Mt.showBounds&&(this.__layout.surfaceChanged||this.__layout.surfaceChange()),this.leafer&&this.leafer.updateCursor())}}))}function uo(t){return zr(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function _o(t){return(e,s)=>{Wr(e,"__DataProcessor",{get:()=>t})}}function po(t,e,s){const i=t.__DataProcessor.prototype,r="_"+e,n=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=Fr(e,s);if(o(s))a.get=function(){return this[r]};else if("function"==typeof s)a.get=function(){let t=this[r];return void 0===t?s(this.__leaf):t};else if(u(s)){const t=_(s);a.get=function(){let e=this[r];return void 0===e?this[r]=t?{}:p.clone(s):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[r];if(void 0===t){const t=this,e=t.__naturalWidth,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&i.children.length?i.boxBounds.width:s}return t}:"height"===e&&(a.get=function(){const t=this[r];if(void 0===t){const t=this,e=t.__naturalHeight,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&i.children.length?i.boxBounds.height:s}return t});let l,d=i;for(;!l&&d;)l=Dr(d,e),d=d.__proto__;l&&l.set&&(a.set=l.set),i[n]&&(a.set=i[n],delete i[n]),Wr(i,e,a)}const fo=new Mt("rewrite"),go=[],yo=["destroy","constructor"];function mo(t){return(e,s)=>{go.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function xo(){return t=>{wo()}}function wo(t){go.length&&(go.forEach(e=>{t&&fo.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),go.length=0)}function vo(t,e){return s=>{var i;(t.prototype?(i=t.prototype,Object.getOwnPropertyNames(i)):Object.keys(t)).forEach(i=>{if(!(yo.includes(i)||e&&e.includes(i)))if(t.prototype){Dr(t.prototype,i).writable&&(s.prototype[i]=t.prototype[i])}else s.prototype[i]=t[i]})}}function bo(){return t=>{Gt.register(t)}}setTimeout(()=>wo(!0));const{copy:Bo,toInnerPoint:ko,toOuterPoint:So,scaleOfOuter:Ro,rotateOfOuter:Co,skewOfOuter:To,multiplyParent:Po,divideParent:Lo,getLayout:Io}=M,Eo={},{round:Ao}=Math,Oo={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),Do(t,e,s),t.isBranch){const{children:i}=t;for(let t=0,r=i.length;t<r;t++)Wo(i[t],e,s)}},updateMatrix(t,e,s){const i=t.__layout;e?s&&(i.waitAutoLayout=!0,t.__hasAutoLayout&&(i.matrixChanged=!1)):i.waitAutoLayout&&(i.waitAutoLayout=!1),i.matrixChanged&&t.__updateLocalMatrix(),i.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)Fo(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&Fo(t),t.__updateChange()},updateAllChange(t){if(Uo(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)zo(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},draggable:t=>(t.draggable||t.editable)&&t.hitSelf&&!t.locked,copyCanvasByWorld(t,s,i,r,o,n){r||(r=t.__nowWorld),t.__worldFlipped||e.fullImageShadow?s.copyWorldByReset(i,r,t.__nowWorld,o,n):s.copyWorldToInner(i,r,t.__layout.renderBounds,o)},moveWorld(t,e,s=0,i,r){const o=u(e)?Object.assign({},e):{x:e,y:s};i?So(t.localTransform,o,o,!0):t.parent&&ko(t.parent.worldTransform,o,o,!0),Mo.moveLocal(t,o.x,o.y,r)},moveLocal(t,e,s=0,i){u(e)&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=Ao(e),s=Ao(s)),i?t.animate({x:e,y:s},i):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,i,r,o){Mo.zoomOfLocal(t,No(t,e),s,i,r,o)},zoomOfLocal(t,e,s,i=s,r,o){const n=t.__localMatrix;if(l(i)||(i&&(o=i),i=s),Bo(Eo,n),Ro(Eo,e,s,i),t.origin||t.around)Mo.setTransform(t,Eo,r,o);else{const e=t.x+Eo.e-n.e,a=t.y+Eo.f-n.f;o&&!r?t.animate({x:e,y:a,scaleX:t.scaleX*s,scaleY:t.scaleY*i},o):(t.x=e,t.y=a,t.scaleResize(s,i,!0!==r))}},rotateOfWorld(t,e,s,i){Mo.rotateOfLocal(t,No(t,e),s,i)},rotateOfLocal(t,e,s,i){const r=t.__localMatrix;Bo(Eo,r),Co(Eo,e,s),t.origin||t.around?Mo.setTransform(t,Eo,!1,i):t.set({x:t.x+Eo.e-r.e,y:t.y+Eo.f-r.f,rotation:w.formatRotation(t.rotation+s)},i)},skewOfWorld(t,e,s,i,r,o){Mo.skewOfLocal(t,No(t,e),s,i,r,o)},skewOfLocal(t,e,s,i=0,r,o){Bo(Eo,t.__localMatrix),To(Eo,e,s,i),Mo.setTransform(t,Eo,r,o)},transformWorld(t,e,s,i){Bo(Eo,t.worldTransform),Po(Eo,e),t.parent&&Lo(Eo,t.parent.worldTransform),Mo.setTransform(t,Eo,s,i)},transform(t,e,s,i){Bo(Eo,t.localTransform),Po(Eo,e),Mo.setTransform(t,Eo,s,i)},setTransform(t,e,s,i){const r=t.__,o=r.origin&&Mo.getInnerOrigin(t,r.origin),n=Io(e,o,r.around&&Mo.getInnerOrigin(t,r.around));if(s){const e=n.scaleX/t.scaleX,s=n.scaleY/t.scaleY;if(delete n.scaleX,delete n.scaleY,o){Rt.scale(t.boxBounds,Math.abs(e),Math.abs(s));const i=Mo.getInnerOrigin(t,r.origin);V.move(n,o.x-i.x,o.y-i.y)}t.set(n),t.scaleResize(e,s,!1)}else t.set(n,i)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},i="x"===e?1:-1;return Ro(s,Mo.getLocalOrigin(t,"center"),-1*i,1*i),s},getLocalOrigin:(t,e)=>V.tempToOuterOf(Mo.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return nt.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(Bo(Eo,t.worldTransform),Lo(Eo,e.worldTransform),s?Eo:Object.assign({},Eo)),drop(t,e,s,i){t.setTransform(Mo.getRelativeWorld(t,e,!0),i),e.add(t,s)},hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},animateMove(t,s,i=.3){if(s.x||s.y)if(Math.abs(s.x)<1&&Math.abs(s.y)<1)t.move(s);else{const r=s.x*i,o=s.y*i;s.x-=r,s.y-=o,t.move(r,o),e.requestRender(()=>Mo.animateMove(t,s,i))}}},Mo=Oo,{updateAllMatrix:Wo,updateMatrix:Do,updateAllWorldOpacity:Fo,updateAllChange:zo,updateChange:Uo}=Mo;function No(t,e){return t.__layout.update(),t.parent?V.tempToInnerOf(e,t.parent.__world):e}const Yo={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localRenderBounds,maskLocalBoxBounds:(t,e)=>Ho(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>Ho(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds:(t,e)=>Ho(t,e)&&t.__layout.localRenderBounds,excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};let Xo;function Ho(t,e){return e||(Xo=0),t.__.mask&&(Xo=1),Xo<0?null:(Xo&&(Xo=-1),!0)}const{updateBounds:Go}=Oo,Vo={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:s}=t;for(let i=0,r=s.length;i<r;i++)(t=s[i]).isBranch&&(t.__tempNumber=1,e.add(t),jo(t,e))}},pushAllParent(t,e){const{keys:s}=e;if(s)for(;t.parent&&o(s[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let s=e.length;const{children:i}=t;for(let t=0,s=i.length;t<s;t++)i[t].isBranch&&e.push(i[t]);for(let t=s,i=e.length;t<i;t++)qo(e[t],e)},updateBounds(t,e){const s=[t];qo(t,s),Qo(s,e)},updateBoundsByBranchStack(t,e){let s,i;for(let r=t.length-1;r>-1;r--){s=t[r],i=s.children;for(let t=0,e=i.length;t<e;t++)Go(i[t]);e&&e===s||Go(s)}}},{pushAllChildBranch:jo,pushAllBranchStack:qo,updateBoundsByBranchStack:Qo}=Vo,Jo={run(t){if(t&&t.length){const e=t.length;for(let s=0;s<e;s++)t[s]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:$o,updateBounds:Zo}=Oo,{toOuterOf:Ko,getPoints:tn,copy:en}=Rt,sn="_localContentBounds",rn="_worldContentBounds",on="_worldBoxBounds",nn="_worldStrokeBounds";class an{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(t){this._renderBounds=t}get localContentBounds(){return Ko(this.contentBounds,this.leaf.__localMatrix,this[sn]||(this[sn]={})),this[sn]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return Ko(this.contentBounds,this.leaf.__world,this[rn]||(this[rn]={})),this[rn]}get worldBoxBounds(){return Ko(this.boxBounds,this.leaf.__world,this[on]||(this[on]={})),this[on]}get worldStrokeBounds(){return Ko(this.strokeBounds,this.leaf.__world,this[nn]||(this[nn]={})),this[nn]}get a(){return 1}get b(){return 0}get c(){return 0}get d(){return 1}get e(){return this.leaf.__.x}get f(){return this.leaf.__.y}get x(){return this.e+this.boxBounds.x}get y(){return this.f+this.boxBounds.y}get width(){return this.boxBounds.width}get height(){return this.boxBounds.height}constructor(t){this.leaf=t,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),t.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){const t=this.leaf.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0};this._localStrokeBounds||(this._localStrokeBounds=t),this._localRenderBounds||(this._localRenderBounds=t)}update(){const{leaf:t}=this,{leafer:s}=t;if(t.isApp)return Zo(t);if(s)s.ready?s.watcher.changed&&s.layouter.layout():s.start();else{let s=t;for(;s.parent&&!s.parent.leafer;)s=s.parent;const i=s;if(i.__fullLayouting)return;i.__fullLayouting=!0,e.layout(i),delete i.__fullLayouting}}getTransform(t="world"){this.update();const{leaf:e}=this;switch(t){case"world":return e.__world;case"local":return e.__localMatrix;case"inner":return M.defaultMatrix;case"page":t=e.zoomLayer;default:return $o(e,t)}}getBounds(t,e="world"){switch(this.update(),e){case"world":return this.getWorldBounds(t);case"local":return this.getLocalBounds(t);case"inner":return this.getInnerBounds(t);case"page":e=this.leaf.zoomLayer;default:return new Lt(this.getInnerBounds(t)).toOuterOf(this.getTransform(e))}}getInnerBounds(t="box"){switch(t){case"render":return this.renderBounds;case"content":if(this.contentBounds)return this.contentBounds;case"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",s){const{leaf:i}=this;let r,o,n,a=this.getInnerBounds(t);switch(e){case"world":r=i.getWorldPoint(a),o=i.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=i.__;n={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},r=i.getLocalPointByInner(a);break;case"inner":r=a,o=M.defaultMatrix;break;case"page":e=i.zoomLayer;default:r=i.getWorldPoint(a,e),o=$o(i,e,!0)}if(n||(n=M.getLayout(o)),en(n,a),V.copy(n,r),s){const{scaleX:t,scaleY:e}=n,s=Math.abs(t),i=Math.abs(e);1===s&&1===i||(n.scaleX/=s,n.scaleY/=i,n.width*=s,n.height*=i)}return n}getLayoutPoints(t,e="world"){const{leaf:s}=this,i=tn(this.getInnerBounds(t));let r;switch(e){case"world":r=null;break;case"local":r=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:r=e}return o(r)||i.forEach(t=>s.innerToWorld(t,null,!1,r)),i}shrinkContent(){const{x:t,y:e,width:s,height:i}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:i}}spreadStroke(){const{x:t,y:e,width:s,height:i}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:i},this._localStrokeBounds={x:t,y:e,width:s,height:i},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:i}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:i},this._localRenderBounds={x:t,y:e,width:s,height:i}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged||this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||(this.strokeSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,this.renderSpread||(this.renderSpread=1),this.boundsChanged=!0}scaleChange(){this.scaleChanged=!0,this._scaleOrRotationChange()}rotationChange(){this.rotationChanged=!0,this.affectRotation=!0,this._scaleOrRotationChange()}_scaleOrRotationChange(){this.affectScaleOrRotation=!0,this.matrixChange(),this.leaf.__local||this.createLocal()}matrixChange(){this.matrixChanged=!0,this.localBoxChanged||this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0,this.surfaceChanged||this.surfaceChange()}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}}class hn{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&e.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&e.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&e.event.stop(this.origin)}}class ln extends hn{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}ln.ADD="child.add",ln.REMOVE="child.remove",ln.CREATED="created",ln.MOUNTED="mounted",ln.UNMOUNTED="unmounted",ln.DESTROY="destroy";class dn extends hn{constructor(t,e,s,i,r){super(t,e),this.attrName=s,this.oldValue=i,this.newValue=r}}dn.CHANGE="property.change",dn.LEAFER_CHANGE="property.leafer_change";class cn extends hn{constructor(t,e){super(t),Object.assign(this,e)}}cn.LOAD="image.load",cn.LOADED="image.loaded",cn.ERROR="image.error";class un extends hn{static checkHas(t,e,s){"on"===s?e===gn?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(_n)||t.hasEvent(pn)||t.hasEvent(fn),t.__hasWorldEvent=t.hasEvent(gn))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(_n,t),"inner"===e&&t.emit(pn,t)),t.emit(fn,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(gn,this)}}un.RESIZE="bounds.resize",un.INNER="bounds.inner",un.LOCAL="bounds.local",un.WORLD="bounds.world";const{RESIZE:_n,INNER:pn,LOCAL:fn,WORLD:gn}=un,yn={};[_n,pn,fn,gn].forEach(t=>yn[t]=1);class mn extends hn{get bigger(){if(!this.old)return!0;const{width:t,height:e}=this.old;return this.width>=t&&this.height>=e}get smaller(){return!this.bigger}get samePixelRatio(){return!this.old||this.pixelRatio===this.old.pixelRatio}constructor(t,e){u(t)?(super(mn.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!o(this.resizingKeys[t.innerId])}}mn.RESIZE="resize";class xn extends hn{constructor(t,e){super(t),this.data=e}}xn.REQUEST="watch.request",xn.DATA="watch.data";class wn extends hn{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}wn.REQUEST="layout.request",wn.START="layout.start",wn.BEFORE="layout.before",wn.LAYOUT="layout",wn.AFTER="layout.after",wn.AGAIN="layout.again",wn.END="layout.end";class vn extends hn{constructor(t,e,s,i){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=i)}}vn.REQUEST="render.request",vn.CHILD_START="render.child_start",vn.CHILD_END="render.child_end",vn.START="render.start",vn.BEFORE="render.before",vn.RENDER="render",vn.AFTER="render.after",vn.AGAIN="render.again",vn.END="render.end",vn.NEXT="render.next";class bn extends hn{}bn.START="leafer.start",bn.BEFORE_READY="leafer.before_ready",bn.READY="leafer.ready",bn.AFTER_READY="leafer.after_ready",bn.VIEW_READY="leafer.view_ready",bn.VIEW_COMPLETED="leafer.view_completed",bn.STOP="leafer.stop",bn.RESTART="leafer.restart",bn.END="leafer.end",bn.TRANSFORM="leafer.transform",bn.MOVE="leafer.move",bn.SCALE="leafer.scale",bn.ROTATE="leafer.rotate",bn.SKEW="leafer.skew";const{MOVE:Bn,SCALE:kn,ROTATE:Sn,SKEW:Rn}=bn,Cn={x:Bn,y:Bn,scaleX:kn,scaleY:kn,rotation:Sn,skewX:Rn,skewY:Rn},Tn={};class Pn{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(c(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let s in t)c(e=t[s])?this.on(s,e[0],e[1]):this.on(s,e);return}let i,r,o;s&&("once"===s?r=!0:"boolean"==typeof s?i=s:(i=s.capture,r=s.once));const n=Ln(this,i,!0),h=a(t)?t.split(" "):t,l=r?{listener:e,once:r}:{listener:e};h.forEach(t=>{t&&(o=n[t],o?-1===o.findIndex(t=>t.listener===e)&&o.push(l):n[t]=[l],yn[t]&&un.checkHas(this,t,"on"))})}off(t,e,s){if(t){const i=a(t)?t.split(" "):t;if(e){let t,r,o;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const n=Ln(this,t);i.forEach(t=>{t&&(r=n[t],r&&(o=r.findIndex(t=>t.listener===e),o>-1&&r.splice(o,1),r.length||delete n[t],yn[t]&&un.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;i.forEach(s=>{t&&delete t[s],e&&delete e[s]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,s,i){return e?this.on(t,s?e=e.bind(s):e,i):c(t)&&t.forEach(t=>this.on(t[0],t[2]?t[1]=t[1].bind(t[2]):t[1],t[3])),{type:t,current:this,listener:e,options:i}}off_(t){if(!t)return;const e=c(t)?t:[t];e.forEach(t=>{t.listener?t.current.off(t.type,t.listener,t.options):c(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3]))}),e.length=0}once(t,e,s,i){if(!e)return c(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));u(s)?e=e.bind(s):i=s,this.on(t,e,{once:!0,capture:i})}emit(t,e,s){!e&&qt.has(t)&&(e=qt.get(t,{type:t,target:this,current:this}));const i=Ln(this,s)[t];if(i){let r;for(let o=0,n=i.length;o<n&&!((r=i[o])&&(r.listener(e),r.once&&(this.off(t,r.listener,s),o--,n--),e&&e.isStopNow));o++);}this.syncEventer&&this.syncEventer.emitEvent(e,s)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:s,__captureMap:i}=this,r=s&&s[t],n=i&&i[t];return!!(o(e)?r||n:e?n:r)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function Ln(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:Tn)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:Tn)}}const{on:In,on_:En,off:An,off_:On,once:Mn,emit:Wn,emitEvent:Dn,hasEvent:Fn,destroy:zn}=Pn.prototype,Un={on:In,on_:En,off:An,off_:On,once:Mn,emit:Wn,emitEvent:Dn,hasEvent:Fn,destroyEventer:zn},Nn=Mt.get("setAttr"),Yn={__setAttr(t,e,s){if(this.leaferIsCreated){const i=this.__.__getInput(t);if(!s||h(e)||o(e)||(Nn.warn(this.innerName,t,e),e=void 0),u(e)||i!==e){this.__realSetAttr(t,e);const{CHANGE:s}=dn,r=new dn(s,this,t,i,e);if(this.isLeafer){this.emitEvent(new dn(dn.LEAFER_CHANGE,this,t,i,e));const s=Cn[t];s&&(this.emitEvent(new bn(s,this)),this.emitEvent(new bn(bn.TRANSFORM,this)))}else this.hasEvent(s)&&this.emitEvent(r);return this.leafer.emitEvent(r),!0}return!1}return this.__realSetAttr(t,e),!0},__realSetAttr(t,e){const s=this.__;s[t]=e,this.__proxyData&&this.setProxyAttr(t,e),s.normalStyle&&(this.lockNormalStyle||o(s.normalStyle[t])||(s.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:Xn,multiplyParent:Hn,translateInner:Gn,defaultWorld:Vn}=M,{toPoint:jn,tempPoint:qn}=nt,Qn={__updateWorldMatrix(){const{parent:t,__layout:e}=this;Hn(this.__local||e,t?t.__world:Vn,this.__world,!!e.affectScaleOrRotation,this.__,t&&(t.scrollY||t.scrollX)&&t.__)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(Xn(e,s,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=s.x+s.offsetX,e.f=s.y+s.offsetY,(s.around||s.origin)&&(jn(s.around||s.origin,t.boxBounds,qn),Gn(e,-qn.x,-qn.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:Jn,updateAllMatrix:$n}=Oo,{updateBounds:Zn}=Vo,{toOuterOf:Kn,copyAndSpread:ta,copy:ea}=Rt,{toBounds:sa}=dr,ia={__updateWorldBounds(){const t=this.__layout;Kn(t.renderBounds,this.__world,this.__world),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&un.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&un.emitWorld(this)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=void 0,(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized="inner"),t.renderChanged&&(t.renderSpread=this.__updateRenderSpread(),t.renderSpread?(t.renderBounds!==t.boxBounds&&t.renderBounds!==t.strokeBounds||t.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):t.spreadRenderCancel(),t.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),Kn(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Kn(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Kn(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(){const t=this.__layout.boxBounds,e=this.__;e.__pathInputed?sa(e.path,t):(t.x=0,t.y=0,t.width=e.width,t.height=e.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),$n(this),Zn(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):($n(this),Zn(this,this))):Jn(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(){const t=this.__layout;ta(t.strokeBounds,t.boxBounds,t.strokeBoxSpread)},__updateRenderBounds(){const t=this.__layout;t.renderSpread>0?ta(t.renderBounds,t.boxBounds,t.renderSpread):ea(t.renderBounds,t.strokeBounds)}},ra={__render(t,e){if(e.shape)return this.__renderShape(t,e);if(this.__worldOpacity){const s=this.__;if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.dimOpacity&&!s.dimskip?s.opacity*e.dimOpacity:s.opacity,this.__.__single){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!0,!0);this.__draw(i,e,t),Oo.copyCanvasByWorld(this,t,i,this.__nowWorld,s.__blendMode,!0),i.recycle(this.__nowWorld)}else this.__draw(t,e);Mt.showBounds&&Mt.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),t.clipUI(this))},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:oa}=Yo,na={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__nowWorld=this.__getNowWorld(e),this.__worldOpacity){const s=this.__;if(s.dim?e.dimOpacity=!0===s.dim?.2:s.dim:s.dimskip&&e.dimOpacity&&(e.dimOpacity=0),s.__single&&!this.isBranchLeaf){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!1,!0);this.__renderBranch(i,e);const r=this.__nowWorld;t.opacity=e.dimOpacity?s.opacity*e.dimOpacity:s.opacity,t.copyWorldByReset(i,r,r,s.__blendMode,!0),i.recycle(r)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let i=0,r=s.length;i<r;i++)oa(s[i],e)||s[i].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let i=0,r=s.length;i<r;i++)oa(s[i],e)||s[i].__clip(t,e)}}},aa={},{LEAF:ha,create:la}=s,{toInnerPoint:da,toOuterPoint:ca,multiplyParent:ua}=M,{toOuterOf:_a}=Rt,{copy:pa,move:fa}=V,{moveLocal:ga,zoomOfLocal:ya,rotateOfLocal:ma,skewOfLocal:xa,moveWorld:wa,zoomOfWorld:va,rotateOfWorld:ba,skewOfWorld:Ba,transform:ka,transformWorld:Sa,setTransform:Ra,getFlipTransform:Ca,getLocalOrigin:Ta,getRelativeWorld:Pa,drop:La}=Oo;t.Leaf=class{get tag(){return this.__tag}set tag(t){}get __tag(){return"Leaf"}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return g}get __LayoutProcessor(){return an}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){return!1}get isBranch(){return!1}get isBranchLeaf(){return!1}get __localMatrix(){return this.__local||this.__layout}get __localBoxBounds(){return this.__local||this.__layout}get worldTransform(){return this.__layout.getTransform("world")}get localTransform(){return this.__layout.getTransform("local")}get boxBounds(){return this.getBounds("box","inner")}get renderBounds(){return this.getBounds("render","inner")}get worldBoxBounds(){return this.getBounds("box")}get worldStrokeBounds(){return this.getBounds("stroke")}get worldRenderBounds(){return this.getBounds("render")}get worldOpacity(){return this.__layout.update(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){return this.leaferIsCreated&&this.leafer.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=la(ha),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(ln.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),0!==t&&(this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0})),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(ln.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(ln.MOUNTED,t,"once")}nextRender(t,e,s){this.leafer?this.leafer.nextRender(t,e,s):this.waitLeafer(()=>this.leafer.nextRender(t,e,s))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(ln.MOUNTED)):this.__emitLifeEvent(ln.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,i=e.length;s<i;s++)e[s].__bindLeafer(t)}}set(t,e){}get(t){}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){o(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=o(e)?null:void 0,this[t]=e}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(){}__updateContentBounds(){}__updateStrokeBounds(){}__updateRenderBounds(){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:s}=this.__layout;t.clearRect(s.x,s.y,s.width,s.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity)}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,s=this.__world;return ua(s,t.matrix,e,void 0,s),_a(this.__layout.renderBounds,e,e),e.half!==s.half&&(e.half=s.half),e}return this.__world}getClampRenderScale(){let{scaleX:t}=this.__nowWorld||this.__world;return t<0&&(t=-t),t>1?t:1}getRenderScaleData(t,e){let{scaleX:s,scaleY:i}=Pr.patternLocked?this.__world:this.__nowWorld;return t&&(s<0&&(s=-s),i<0&&(i=-i)),(!0===e||"zoom-in"===e&&s>1&&i>1)&&(s=i=1),aa.scaleX=s,aa.scaleY=i,aa}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,s){return this.__layout.getLayoutBounds(t,e,s)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,s){const i=e?Pa(this,e):this.worldTransform,r=s?t:{};return _a(t,i,r),r}worldToLocal(t,e,s,i){this.parent?this.parent.worldToInner(t,e,s,i):e&&pa(e,t)}localToWorld(t,e,s,i){this.parent?this.parent.innerToWorld(t,e,s,i):e&&pa(e,t)}worldToInner(t,e,s,i){i&&(i.innerToWorld(t,e,s),t=e||t),da(this.worldTransform,t,e,s)}innerToWorld(t,e,s,i){ca(this.worldTransform,t,e,s),i&&i.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,i){return this.getBoxPointByInner(this.getInnerPoint(t,e,s,i),null,null,!0)}getBoxPointByInner(t,e,s,i){const r=i?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return fa(r,-o,-n),r}getInnerPoint(t,e,s,i){const r=i?t:{};return this.worldToInner(t,r,s,e),r}getInnerPointByBox(t,e,s,i){const r=i?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return fa(r,o,n),r}getInnerPointByLocal(t,e,s,i){return this.getInnerPoint(t,this.parent,s,i)}getLocalPoint(t,e,s,i){const r=i?t:{};return this.worldToLocal(t,r,s,e),r}getLocalPointByInner(t,e,s,i){return this.getWorldPoint(t,this.parent,s,i)}getPagePoint(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,i)}getWorldPoint(t,e,s,i){const r=i?t:{};return this.innerToWorld(t,r,s,e),r}getWorldPointByBox(t,e,s,i){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,i),e,s,!0)}getWorldPointByLocal(t,e,s,i){const r=i?t:{};return this.localToWorld(t,r,s,e),r}getWorldPointByPage(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,i)}setTransform(t,e,s){Ra(this,t,e,s)}transform(t,e,s){ka(this,t,e,s)}move(t,e,s){ga(this,t,e,s)}moveInner(t,e,s){wa(this,t,e,!0,s)}scaleOf(t,e,s,i,r){ya(this,Ta(this,t),e,s,i,r)}rotateOf(t,e,s){ma(this,Ta(this,t),e,s)}skewOf(t,e,s,i,r){xa(this,Ta(this,t),e,s,i,r)}transformWorld(t,e,s){Sa(this,t,e,s)}moveWorld(t,e,s){wa(this,t,e,!1,s)}scaleOfWorld(t,e,s,i,r){va(this,t,e,s,i,r)}rotateOfWorld(t,e){ba(this,t,e)}skewOfWorld(t,e,s,i,r){Ba(this,t,e,s,i,r)}flip(t,e){ka(this,Ca(this,t),!1,e)}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}hit(t,e){return!0}__hitWorld(t){return!0}__hit(t){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e,s){}__clip(t,e){}__renderShape(t,e){}__drawShape(t,e){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}getMotionPathData(){return Yt.need("path")}getMotionPoint(t){return Yt.need("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){La(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,i){}off_(t){}once(t,e,s,i){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,s){s?this.addAttr(t,e,s):po(this.prototype,t,e)}static addAttr(t,e,s,i){s||(s=jr),s(e,i)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new ln(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(ln.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}},t.Leaf=$t([vo(Yn),vo(Qn),vo(ia),vo(Un),vo(ra)],t.Leaf);const{setListWithFn:Ia}=Rt,{sort:Ea}=Vo,{localBoxBounds:Aa,localStrokeBounds:Oa,localRenderBounds:Ma,maskLocalBoxBounds:Wa,maskLocalStrokeBounds:Da,maskLocalRenderBounds:Fa}=Yo,za=new Mt("Branch");t.Branch=class extends t.Leaf{__updateStrokeSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.renderSpread)return 1;return 0}__updateBoxBounds(){Ia(this.__layout.boxBounds,this.children,this.__hasMask?Wa:Aa)}__updateStrokeBounds(){Ia(this.__layout.strokeBounds,this.children,this.__hasMask?Da:Oa)}__updateRenderBounds(){Ia(this.__layout.renderBounds,this.children,this.__hasMask?Fa:Ma)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,i=e.length;s<i;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(Ea),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return za.warn("add self or destroyed");const s=o(e);if(!t.__){if(c(t))return t.forEach(t=>{this.add(t,e),s||e++});t=Gt.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,s?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const i=t.__layout;i.boxChanged||i.boxChange(),i.matrixChanged||i.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(ln.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(ln.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",()=>this.__remove(t,e)):this.__remove(t,e):this.find(t).forEach(t=>this.remove(t,e)):o(t)&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach(e=>{this.__realRemoveChild(e),t&&e.destroy()}))}clear(){this.removeAll(!0)}__remove(t,e){const s=this.children.indexOf(t);s>-1&&(this.children.splice(s,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(ln.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(ln.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new ln(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}},t.Branch=$t([vo(na)],t.Branch);class Ua{get length(){return this.list.length}constructor(t){this.reset(),t&&(c(t)?this.addList(t):this.add(t))}has(t){return t&&!o(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return o(e)?-1:e}add(t){const{list:e,keys:s}=this;o(s[t.innerId])&&(e.push(t),s[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:s}=this;if(o(s[t.innerId])){const{list:i}=this;for(let t=e,r=i.length;t<r;t++)s[i[t].innerId]++;0===e?i.unshift(t):(e>i.length&&(e=i.length),i.splice(e,0,t)),s[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let s;for(let i=0,r=e.length;i<r;i++)o(s)?e[i].innerId===t.innerId&&(s=i,delete this.keys[t.innerId]):this.keys[e[i].innerId]=i-1;o(s)||e.splice(s,1)}sort(t){const{list:e}=this;t?e.sort((t,e)=>e.__level-t.__level):e.sort((t,e)=>t.__level-e.__level)}forEach(t){this.list.forEach(t)}clone(){const t=new Ua;return t.list=[...this.list],t.keys=Object.assign({},this.keys),t}update(){this.keys={};const{list:t,keys:e}=this;for(let s=0,i=t.length;s<i;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class Na{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(c(t)?this.addList(t):this.add(t))}has(t){return!o(this.keys[t.innerId])}without(t){return o(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:s}=this;e[t.innerId]||(e[t.innerId]=1,s[t.__level]?s[t.__level].push(t):(s[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(s=>{e=this.levelMap[s];for(let s=0,i=e.length;s<i;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const Ya=Mt.get("LeaferCanvas");class Xa extends le{set zIndex(t){const{style:e}=this.view;e.zIndex=t,this.setAbsolute(this.view)}set childIndex(t){const{view:e,parentView:s}=this;if(e&&s){const i=s.children[t];i?(this.setAbsolute(i),s.insertBefore(e,i)):s.appendChild(i)}}init(){const{config:t}=this,s=t.view||t.canvas;s?this.__createViewFrom(s):this.__createView();const{style:i}=this.view;if(i.display||(i.display="block"),this.parentView=this.view.parentElement,this.parentView){const t=this.parentView.style;t.webkitUserSelect=t.userSelect="none"}e.syncDomFont&&!this.parentView&&(i.display="none",document.body.appendChild(this.view)),this.__createContext(),this.autoLayout||this.resize(t)}set backgroundColor(t){this.view.style.backgroundColor=t}get backgroundColor(){return this.view.style.backgroundColor}set hittable(t){this.view.style.pointerEvents=t?"auto":"none"}get hittable(){return"none"!==this.view.style.pointerEvents}__createView(){this.view=document.createElement("canvas")}__createViewFrom(t){let e=a(t)?document.getElementById(t):t;if(e)if(e instanceof HTMLCanvasElement)this.view=e;else{let t=e;if(e===window||e===document){const e=document.createElement("div"),{style:s}=e;s.position="absolute",s.top=s.bottom=s.left=s.right="0px",document.body.appendChild(e),t=e}this.__createView();const s=this.view;t.hasChildNodes()&&(this.setAbsolute(s),t.style.position||(t.style.position="relative")),t.appendChild(s)}else Ya.error(`no id: ${t}`),this.__createView()}setAbsolute(t){const{style:e}=t;e.position="absolute",e.top=e.left="0px"}updateViewSize(){const{width:t,height:e,pixelRatio:s}=this,{style:i}=this.view;i.width=t+"px",i.height=e+"px",this.view.width=Math.ceil(t*s),this.view.height=Math.ceil(e*s)}updateClientBounds(){this.view.parentElement&&(this.clientBounds=this.view.getBoundingClientRect())}startAutoLayout(t,s){if(this.resizeListener=s,t){this.autoBounds=t;try{this.resizeObserver=new ResizeObserver(t=>{this.updateClientBounds();for(const e of t)this.checkAutoBounds(e.contentRect)});const t=this.parentView;t?(this.resizeObserver.observe(t),this.checkAutoBounds(t.getBoundingClientRect())):(this.checkAutoBounds(this.view),Ya.warn("no parent"))}catch(t){this.imitateResizeObserver()}}else window.addEventListener("resize",this.windowListener=()=>{const t=e.devicePixelRatio;if(!this.config.pixelRatio&&this.pixelRatio!==t){const{width:e,height:s}=this;this.emitResize({width:e,height:s,pixelRatio:t})}})}imitateResizeObserver(){this.autoLayout&&(this.parentView&&this.checkAutoBounds(this.parentView.getBoundingClientRect()),e.requestRender(this.imitateResizeObserver.bind(this)))}checkAutoBounds(t){const s=this.view,{x:i,y:r,width:o,height:n}=this.autoBounds.getBoundsFrom(t),a={width:o,height:n,pixelRatio:this.config.pixelRatio?this.pixelRatio:e.devicePixelRatio};if(!this.isSameSize(a)){const{style:t}=s;t.marginLeft=i+"px",t.marginTop=r+"px",this.emitResize(a)}}stopAutoLayout(){this.autoLayout=!1,this.resizeObserver&&this.resizeObserver.disconnect(),this.resizeListener=this.resizeObserver=null}emitResize(t){const e={};p.copyAttrs(e,this,he),this.resize(t),this.resizeListener&&!o(this.width)&&this.resizeListener(new mn(t,e))}unrealCanvas(){if(!this.unreal&&this.parentView){const t=this.view;t&&t.remove(),this.view=this.parentView,this.unreal=!0}}destroy(){if(this.view){if(this.stopAutoLayout(),this.windowListener&&(window.removeEventListener("resize",this.windowListener),this.windowListener=null),!this.unreal){const t=this.view;t.parentElement&&t.remove()}super.destroy()}}}wr(CanvasRenderingContext2D.prototype),wr(Path2D.prototype);const{mineType:Ha,fileType:Ga}=vr;function Va(t,s){e.origin={createCanvas(t,e){const s=document.createElement("canvas");return s.width=t,s.height=e,s},canvasToDataURL:(t,e,s)=>{const i=Ha(e),r=t.toDataURL(i,s);return"image/bmp"===i?r.replace("image/png;","image/bmp;"):r},canvasToBolb:(t,e,s)=>new Promise(i=>t.toBlob(i,Ha(e),s)),canvasSaveAs:(t,s,i)=>{const r=t.toDataURL(Ha(Ga(s)),i);return e.origin.download(r,s)},download:(t,e)=>new Promise(s=>{let i=document.createElement("a");i.href=t,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),s()}),loadImage:t=>new Promise((s,i)=>{const r=new e.origin.Image,{crossOrigin:o}=e.image;o&&(r.setAttribute("crossOrigin",o),r.crossOrigin=o),r.onload=()=>{s(r)},r.onerror=t=>{i(t)},r.src=e.image.getRealURL(t)}),Image:Image,PointerEvent:PointerEvent,DragEvent:DragEvent},e.event={stopDefault(t){t.preventDefault()},stopNow(t){t.stopImmediatePropagation()},stop(t){t.stopPropagation()}},e.canvas=Xt.canvas(),e.conicGradientSupport=!!e.canvas.context.createConicGradient}Object.assign(Xt,{canvas:(t,e)=>new Xa(t,e),image:t=>new Mr(t)}),e.name="web",e.isMobile="ontouchstart"in window,e.requestRender=function(t){window.requestAnimationFrame(t)},Wr(e,"devicePixelRatio",{get:()=>devicePixelRatio});const{userAgent:ja}=navigator;ja.indexOf("Firefox")>-1?(e.conicGradientRotate90=!0,e.intWheelDeltaY=!0,e.syncDomFont=!0):(/iPhone|iPad|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent))&&(e.fullImageShadow=!0),ja.indexOf("Windows")>-1?(e.os="Windows",e.intWheelDeltaY=!0):ja.indexOf("Mac")>-1?e.os="Mac":ja.indexOf("Linux")>-1&&(e.os="Linux");class qa{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove){const t=new Ua;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new Ua,this.target=t,e&&(this.config=p.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(vn.REQUEST)}__onAttrChange(t){this.__updatedList.add(t.target),this.update()}__onChildEvent(t){t.type===ln.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent)),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new xn(xn.DATA,{updatedList:this.updatedList})),this.__updatedList=new Ua,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[dn.CHANGE,this.__onAttrChange,this],[[ln.ADD,ln.REMOVE],this.__onChildEvent,this],[xn.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:Qa,updateBounds:Ja,updateChange:$a}=Oo,{pushAllChildBranch:Za,pushAllParent:Ka}=Vo;const{worldBounds:th}=Yo;class eh{constructor(t){this.updatedBounds=new Lt,this.beforeBounds=new Lt,this.afterBounds=new Lt,c(t)&&(t=new Ua(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,th)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,th),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}}const{updateAllMatrix:sh,updateAllChange:ih}=Oo,rh=Mt.get("Layouter");class oh{constructor(t,e){this.totalTimes=0,this.config={},this.__levelList=new Na,this.target=t,e&&(this.config=p.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(wn.START),this.layoutOnce(),t.emitEvent(new wn(wn.END,this.layoutedBlocks,this.times))}catch(t){rh.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?rh.warn("layouting"):this.times>3?rh.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(xn.REQUEST),this.totalTimes>1?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=zt.start("PartLayout"),{target:s,__updatedList:i}=this,{BEFORE:r,LAYOUT:o,AFTER:n}=wn,a=this.getBlocks(i);a.forEach(t=>t.setBefore()),s.emitEvent(new wn(r,a,this.times)),this.extraBlock=null,i.sort(),function(t,e){let s;t.list.forEach(t=>{s=t.__layout,e.without(t)&&!s.proxyZoom&&(s.matrixChanged?(Qa(t,!0),e.add(t),t.isBranch&&Za(t,e),Ka(t,e)):s.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),Ka(t,e)))})}(i,this.__levelList),function(t){let e,s,i;t.sort(!0),t.levels.forEach(r=>{e=t.levelMap[r];for(let t=0,r=e.length;t<r;t++){if(s=e[t],s.isBranch&&s.__tempNumber){i=s.children;for(let t=0,e=i.length;t<e;t++)i[t].isBranch||Ja(i[t])}Ja(s)}})}(this.__levelList),function(t){t.list.forEach($a)}(i),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),s.emitEvent(new wn(o,a,this.times)),s.emitEvent(new wn(n,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,zt.end(e)}fullLayout(){const t=zt.start("FullLayout"),{target:e}=this,{BEFORE:s,LAYOUT:i,AFTER:r}=wn,o=this.getBlocks(new Ua(e));e.emitEvent(new wn(s,o,this.times)),oh.fullLayout(e),o.forEach(t=>{t.setAfter()}),e.emitEvent(new wn(i,o,this.times)),e.emitEvent(new wn(r,o,this.times)),this.addBlocks(o),zt.end(t)}static fullLayout(t){sh(t,!0),t.isBranch?Vo.updateBounds(t):Oo.updateBounds(t),ih(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:s}=this.extraBlock||(this.extraBlock=new eh([]));e.length?s.add(t.__world):s.set(t.__world),e.add(t)}}createBlock(t){return new eh(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){this.__eventIds=[this.target.on_([[wn.REQUEST,this.layout,this],[wn.AGAIN,this.layoutAgain,this],[xn.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const nh=Mt.get("Renderer");class ah{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,s){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,maxFPS:60},this.target=t,this.canvas=e,s&&(this.config=p.default(s,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.__requestRender()}requestLayout(){this.target.emit(wn.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(vn.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(vn.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(vn.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Lt,nh.log(e.innerName,"---\x3e");try{this.emitRender(vn.START),this.renderOnce(t),this.emitRender(vn.END,this.totalBounds),Pr.clearRecycled()}catch(t){this.rendering=!1,nh.error(t)}nh.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return nh.warn("rendering");if(this.times>3)return nh.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Lt,this.renderOptions={},t)this.emitRender(vn.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(vn.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(vn.RENDER,this.renderBounds,this.renderOptions),this.emitRender(vn.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach(e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(t){const e=zt.start("PartRender"),{canvas:s}=this,i=t.getIntersect(s.bounds),r=new Lt(i);s.save(),i.spread(ah.clipSpread).ceil(),s.clearWorld(i,!0),s.clipWorld(i,!0),this.__render(i,r),s.restore(),zt.end(e)}fullRender(){const t=zt.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),zt.end(t)}__render(t,e){const{canvas:s}=this,i=t.includes(this.target.__world),r=i?{includes:i}:{bounds:t,includes:i};this.needFill&&s.fillWorld(t,this.config.fill),Mt.showRepaint&&Mt.drawRepaint(s,t),this.target.__render(s,r),this.renderBounds=e=e||t,this.renderOptions=r,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),s.updateRender(e)}addBlock(t){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Lt;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=this.target;if(this.requestTime||!t)return;if(t.parentApp)return t.parentApp.requestRender(!1);const s=this.requestTime=Date.now();e.requestRender(()=>{this.FPS=Math.min(60,Math.ceil(1e3/(Date.now()-s))),this.requestTime=0,this.checkRender()})}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:s}=t.old;if(!new Lt(0,0,e,s).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new Lt(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;t.updatedList&&t.updatedList.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||nh.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds)})}emitRender(t,e,s){this.target.emitEvent(new vn(t,this.times,e,s))}__listenEvents(){this.__eventIds=[this.target.on_([[vn.REQUEST,this.update,this],[wn.END,this.__onLayoutEnd,this],[vn.AGAIN,this.renderAgain,this],[mn.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.canvas=this.config=null)}}function hh(t){return zr(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function lh(t){return zr(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function dh(){return(t,e)=>{const s="_"+e;Wr(t,e,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}ah.clipSpread=10,Object.assign(Xt,{watcher:(t,e)=>new qa(t,e),layouter:(t,e)=>new oh(t,e),renderer:(t,e,s)=>new ah(t,e,s),selector:(t,e)=>{},interaction:(t,e,s,i)=>{}}),e.layout=oh.fullLayout;const ch={},uh={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},_h={number:(t,e)=>u(t)?"percent"===t.type?t.value*e:t.value:t},ph={},fh={},gh={},yh={},mh={},xh={apply(){Yt.need("filter")}},wh={},vh={setStyleName:()=>Yt.need("state"),set:()=>Yt.need("state")},bh={list:{},register(t,e){bh.list[t]=e},get:t=>bh.list[t]},{parse:Bh,objectToCanvasData:kh}=Is,{stintSet:Sh}=p,{hasTransparent:Rh}=uh,Ch={},Th=Mt.get("UIData");class Ph extends g{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,Th.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,Th.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),a(t)||!t?(Sh(this,"__isTransparentFill",Rh(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):u(t)&&this.__setPaint("fill",t)}setStroke(t){a(t)||!t?(Sh(this,"__isTransparentStroke",Rh(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):u(t)&&this.__setPaint("stroke",t)}setPath(t){const e=a(t);e||t&&u(t[0])?(this.__setInput("path",t),this._path=e?Bh(t):kh(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Lh(this,"shadow",t)}setInnerShadow(t){Lh(this,"innerShadow",t)}setFilter(t){Lh(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&fh.compute("fill",this.__leaf),e&&fh.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:s}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),o(t.strokeWidthFixed)||(s=t.strokeWidthFixed)),s){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const s=this.__leaf.__layout;s.boxChanged||s.boxChange(),c(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=Ch)):(this.__isStrokes=!0,this._stroke||(this._stroke=Ch))}__removePaint(t,e){e&&this.__removeInput(t),gh.recycleImage(t,this),"fill"===t?(Sh(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(Sh(this,"__isAlphaPixelStroke",void 0),Sh(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function Lh(t,e,s){t.__setInput(e,s),c(s)?(s.some(t=>!1===t.visible)&&(s=s.filter(t=>!1!==t.visible)),s.length||(s=void 0)):s=s&&!1!==s.visible?[s]:void 0,t["_"+e]=s}class Ih extends Ph{}class Eh extends Ih{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"hide"===t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class Ah extends Ih{__getInputData(t,e){const s=super.__getInputData(t,e);return he.forEach(t=>delete s[t]),s}}class Oh extends Eh{}class Mh extends Ph{}class Wh extends Ph{get __boxStroke(){return!this.__pathInputed}}class Dh extends Ph{get __boxStroke(){return!this.__pathInputed}}class Fh extends Ph{}class zh extends Ph{}class Uh extends Ph{get __pathInputed(){return 2}}class Nh extends Ih{}const Yh={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class Xh extends Ph{get __useNaturalRatio(){return!1}setFontWeight(t){a(t)?(this.__setInput("fontWeight",t),t=Yh[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,s=e.__box;if(t){const{boxStyle:i}=this;if(s)for(let t in i)s[t]=void 0;else s=e.__box=Gt.get("Rect",0);const r=e.__layout,o=s.__layout;i||(s.parent=e,s.__world=e.__world,o.boxBounds=r.boxBounds),s.set(t),o.strokeChanged&&r.strokeChange(),o.renderChanged&&r.renderChange(),s.__updateChange()}else s&&(e.__box=s.parent=null,s.destroy());this._boxStyle=t}}class Hh extends Wh{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:"image",mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return delete t.fill,t}__getInputData(t,e){const s=super.__getInputData(t,e);return delete s.fill,s}}class Gh extends Wh{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url=this.__leaf.canvas.toDataURL("image/png"),s}}const Vh={__updateStrokeSpread(){let t=0,e=0;const s=this.__,{strokeAlign:i,__maxStrokeWidth:r}=s,o=this.__box;if((s.stroke||"all"===s.hitStroke)&&r&&"inside"!==i&&(e=t="center"===i?r/2:r,!s.__boxStroke)){const e=s.__isLinePath?0:10*t,i="none"===s.strokeCap?0:r;t+=Math.max(e,i)}return s.__useArrow&&(t+=5*r),o&&(t=Math.max(o.__layout.strokeSpread=o.__updateStrokeSpread(),t),e=o.__layout.strokeBoxSpread),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:i,backgroundBlur:r,filter:o,renderSpread:n}=this.__;e&&e.forEach(e=>t=Math.max(t,Math.max(Math.abs(e.y),Math.abs(e.x))+(e.spread>0?e.spread:0)+1.5*e.blur)),i&&(t=Math.max(t,i)),o&&(t+=xh.getSpread(o)),n&&(t+=n);let a=t=Math.ceil(t);return s&&s.forEach(t=>a=Math.max(a,Math.max(Math.abs(t.y),Math.abs(t.x))+(t.spread<0?-t.spread:0)+1.5*t.blur)),r&&(a=Math.max(a,r)),this.__layout.renderShapeSpread=a,t+=this.__layout.strokeSpread||0,this.__box?Math.max(this.__box.__updateRenderSpread(),t):t}},{stintSet:jh}=p,qh={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);jh(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),jh(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:s,stroke:i}=t,r=t.innerShadow||t.blur||t.backgroundBlur||t.filter;jh(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&s&&!t.__isTransparentFill&&!(c(s)&&s.length>1)&&(this.useFastShadow||!i||i&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),jh(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){Qh(this,t,e)},__draw(t,e,s){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:r,stroke:o,__drawAfterFill:n,__fillAfterStroke:a,__isFastShadow:h}=i;if(this.__drawRenderPath(t),i.__useEffect&&!h){const h=fh.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=i;l&&mh.shadow(this,t,h),a&&(i.__isStrokes?fh.strokes(o,this,t):fh.stroke(o,this,t)),r&&(i.__isFills?fh.fills(r,this,t):fh.fill(r,this,t)),n&&this.__drawAfterFill(t,e),d&&mh.innerShadow(this,t,h),o&&!a&&(i.__isStrokes?fh.strokes(o,this,t):fh.stroke(o,this,t)),c&&xh.apply(c,this,this.__nowWorld,t,s,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(i.__isStrokes?fh.strokes(o,this,t):fh.stroke(o,this,t)),h){const e=i.shadow[0],{scaleX:s,scaleY:r}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*s,e.y*r,e.blur*s,uh.string(e.color))}r&&(i.__isFills?fh.fills(r,this,t):fh.fill(r,this,t)),h&&t.restore(),n&&this.__drawAfterFill(t,e),o&&!a&&(i.__isStrokes?fh.strokes(o,this,t):fh.stroke(o,this,t))}}else i.__pathInputed?Qh(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const s=this.__,{fill:i,stroke:r}=s;i&&!e.ignoreFill&&(s.__isAlphaPixelFill?fh.fills(i,this,t):fh.fill("#000000",this,t)),s.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(s.__isAlphaPixelStroke?fh.strokes(r,this,t):fh.stroke("#000000",this,t))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function Qh(t,e,s){const{fill:i,stroke:r,__drawAfterFill:o,__fillAfterStroke:n}=t.__;t.__drawRenderPath(e),n&&fh.stroke(r,t,e),i&&fh.fill(i,t,e),o&&t.__drawAfterFill(e,s),r&&!n&&fh.stroke(r,t,e)}const Jh={__drawFast(t,e){let{x:s,y:i,width:r,height:o}=this.__layout.boxBounds;const{fill:n,stroke:a,__drawAfterFill:h}=this.__;if(n&&(t.fillStyle=n,t.fillRect(s,i,r,o)),h&&this.__drawAfterFill(t,e),a){const{strokeAlign:n,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(a,h,this.__);const l=h/2;switch(n){case"center":t.strokeRect(0,0,r,o);break;case"inside":r-=h,o-=h,r<0||o<0?(t.save(),this.__clip(t,e),t.strokeRect(s+l,i+l,r,o),t.restore()):t.strokeRect(s+l,i+l,r,o);break;case"outside":t.strokeRect(s-l,i-l,r+h,o+h)}}}};var $h,Zh;t.UI=$h=class extends t.Leaf{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){w.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return mr.set(this.path=t||[]),t||this.__drawPathByBox(mr),mr}constructor(t){super(t)}reset(t){}set(t,e){t&&(e?"temp"===e?(this.lockNormalStyle=!0,Object.assign(this,t),this.lockNormalStyle=!1):this.animate(t,e):Object.assign(this,t))}get(t){return a(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return Yt.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return Yt.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let s=e?this.__.__pathForRender:this.__.path;return s||(mr.set(s=[]),this.__drawPathByBox(mr)),t?Is.toCanvasData(s,!0):s}getPathString(t,e,s){return Is.stringify(this.getPath(t,e),s)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||wh.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?yr.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&ph.addArrows(this,!t.cornerRadius)):t.__pathForRender&&(t.__pathForRender=void 0)}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?Ei.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:s,width:i,height:r}=this.__layout.boxBounds;if(this.__.cornerRadius){const{cornerRadius:o}=this.__;t.roundRect(e,s,i,r,l(o)?[o]:o)}else t.rect(e,s,i,r)}drawImagePlaceholder(t,e){fh.fill(this.__.placeholderColor,this,t)}animate(t,e,s,i){return Yt.need("animate")}killAnimate(t,e){}export(t,e){return Yt.need("export")}syncExport(t,e){return Yt.need("export")}clone(t){const e=p.clone(this.toJSON());return t&&Object.assign(e,t),$h.one(e)}static one(t,e,s,i,r){return Gt.get(t.tag||this.prototype.__tag,t,e,s,i,r)}static registerUI(){bo()(this)}static registerData(t){_o(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}},$t([_o(Ph)],t.UI.prototype,"__",void 0),$t([dh()],t.UI.prototype,"zoomLayer",void 0),$t([Yr("")],t.UI.prototype,"id",void 0),$t([Yr("")],t.UI.prototype,"name",void 0),$t([Yr("")],t.UI.prototype,"className",void 0),$t([so("pass-through")],t.UI.prototype,"blendMode",void 0),$t([io(1)],t.UI.prototype,"opacity",void 0),$t([ro(!0)],t.UI.prototype,"visible",void 0),$t([so(!1)],t.UI.prototype,"locked",void 0),$t([so(!1)],t.UI.prototype,"dim",void 0),$t([so(!1)],t.UI.prototype,"dimskip",void 0),$t([ao(0)],t.UI.prototype,"zIndex",void 0),$t([ho(!1)],t.UI.prototype,"mask",void 0),$t([lo(!1)],t.UI.prototype,"eraser",void 0),$t([Xr(0,!0)],t.UI.prototype,"x",void 0),$t([Xr(0,!0)],t.UI.prototype,"y",void 0),$t([jr(100,!0)],t.UI.prototype,"width",void 0),$t([jr(100,!0)],t.UI.prototype,"height",void 0),$t([Gr(1,!0)],t.UI.prototype,"scaleX",void 0),$t([Gr(1,!0)],t.UI.prototype,"scaleY",void 0),$t([Vr(0,!0)],t.UI.prototype,"rotation",void 0),$t([Vr(0,!0)],t.UI.prototype,"skewX",void 0),$t([Vr(0,!0)],t.UI.prototype,"skewY",void 0),$t([Xr(0,!0)],t.UI.prototype,"offsetX",void 0),$t([Xr(0,!0)],t.UI.prototype,"offsetY",void 0),$t([Xr(0,!0)],t.UI.prototype,"scrollX",void 0),$t([Xr(0,!0)],t.UI.prototype,"scrollY",void 0),$t([Hr()],t.UI.prototype,"origin",void 0),$t([Hr()],t.UI.prototype,"around",void 0),$t([Yr(!1)],t.UI.prototype,"lazy",void 0),$t([qr(1)],t.UI.prototype,"pixelRatio",void 0),$t([eo(0)],t.UI.prototype,"renderSpread",void 0),$t([Jr()],t.UI.prototype,"path",void 0),$t([$r()],t.UI.prototype,"windingRule",void 0),$t([$r(!0)],t.UI.prototype,"closed",void 0),$t([jr(0)],t.UI.prototype,"padding",void 0),$t([jr(!1)],t.UI.prototype,"lockRatio",void 0),$t([jr()],t.UI.prototype,"widthRange",void 0),$t([jr()],t.UI.prototype,"heightRange",void 0),$t([Yr(!1)],t.UI.prototype,"draggable",void 0),$t([Yr()],t.UI.prototype,"dragBounds",void 0),$t([Yr(!1)],t.UI.prototype,"editable",void 0),$t([co(!0)],t.UI.prototype,"hittable",void 0),$t([co("path")],t.UI.prototype,"hitFill",void 0),$t([to("path")],t.UI.prototype,"hitStroke",void 0),$t([co(!1)],t.UI.prototype,"hitBox",void 0),$t([co(!0)],t.UI.prototype,"hitChildren",void 0),$t([co(!0)],t.UI.prototype,"hitSelf",void 0),$t([co()],t.UI.prototype,"hitRadius",void 0),$t([uo("")],t.UI.prototype,"cursor",void 0),$t([so()],t.UI.prototype,"fill",void 0),$t([to(void 0,!0)],t.UI.prototype,"stroke",void 0),$t([to("inside")],t.UI.prototype,"strokeAlign",void 0),$t([to(1,!0)],t.UI.prototype,"strokeWidth",void 0),$t([to(!1)],t.UI.prototype,"strokeWidthFixed",void 0),$t([to("none")],t.UI.prototype,"strokeCap",void 0),$t([to("miter")],t.UI.prototype,"strokeJoin",void 0),$t([to()],t.UI.prototype,"dashPattern",void 0),$t([to(0)],t.UI.prototype,"dashOffset",void 0),$t([to(10)],t.UI.prototype,"miterLimit",void 0),$t([$r(0)],t.UI.prototype,"cornerRadius",void 0),$t([$r()],t.UI.prototype,"cornerSmoothing",void 0),$t([hh()],t.UI.prototype,"shadow",void 0),$t([hh()],t.UI.prototype,"innerShadow",void 0),$t([hh()],t.UI.prototype,"blur",void 0),$t([hh()],t.UI.prototype,"backgroundBlur",void 0),$t([hh()],t.UI.prototype,"grayscale",void 0),$t([hh()],t.UI.prototype,"filter",void 0),$t([so()],t.UI.prototype,"placeholderColor",void 0),$t([Yr(100)],t.UI.prototype,"placeholderDelay",void 0),$t([Yr({})],t.UI.prototype,"data",void 0),$t([mo(t.Leaf.prototype.reset)],t.UI.prototype,"reset",null),t.UI=$h=$t([vo(Vh),vo(qh),xo()],t.UI),t.Group=class extends t.UI{get __tag(){return"Group"}get isBranch(){return!0}constructor(t){super(t)}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:s}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),s.forEach(t=>this.add(t)),t.children=s}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);return this.childlessJSON||(e.children=this.children.map(e=>e.toJSON(t))),e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}},$t([_o(Ih)],t.Group.prototype,"__",void 0),$t([jr(0)],t.Group.prototype,"width",void 0),$t([jr(0)],t.Group.prototype,"height",void 0),t.Group=$t([vo(t.Branch),bo()],t.Group);const Kh=Mt.get("Leafer");t.Leafer=Zh=class extends t.Group{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&Cr.isComplete}get layoutLocked(){return!this.layouter.running}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||{x:0,y:0,width:0,height:0}}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),Zh.list.add(this)}init(t,e){if(this.canvas)return;let s;const{config:i}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),s=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,p.assign(i,t));const r=this.canvas=Xt.canvas(i);this.__controllers.push(this.renderer=Xt.renderer(this,r,i),this.watcher=Xt.watcher(this,i),this.layouter=Xt.layouter(this,i)),this.isApp&&this.__setApp(),this.__checkAutoLayout(i,e),this.view=r.view,e||(this.selector=Xt.selector(this),this.interaction=Xt.interaction(this,r,this.selector,i),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=Xt.hitCanvasManager()),this.canvasManager=new Jt,s=i.start),this.hittable=i.hittable,this.fill=i.fill,this.canvasManager.add(r),this.__listenEvents(),s&&(this.__startTimer=setTimeout(this.start.bind(this))),Jo.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(bn.RESTART):this.emitLeafer(bn.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(bn.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=p.copyAttrs({},t,he);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:s}=this;s&&(s.addBlock(t?new Lt(t):this.canvas.bounds),this.viewReady&&(e?s.render():s.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const s=p.copyAttrs({},this.canvas,he);e.resize(t),this.updateLazyBounds(),this.__onResize(new mn(t,s))}__onResize(t){this.emitEvent(t),p.copyAttrs(this.__,t,he),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(t,e){e||(t.width&&t.height||(this.autoLayout=new Et(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(he.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t&&(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren()))),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&he.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const s=p.copyAttrs({},this.canvas,he);s[t]=this.config[t]=e,e&&this.canvas.stopAutoLayout(),this.__doResize(s)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(bn.BEFORE_READY),this.emitLeafer(bn.READY),this.emitLeafer(bn.AFTER_READY),Jo.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(bn.VIEW_READY),Jo.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:s}=this.config;if(t){let{width:i,height:r,pixelRatio:o}=this;const n="box"===t?this.worldBoxBounds:this.__world;e||(i=Math.max(1,n.x+n.width)),s||(r=Math.max(1,n.y+n.height)),this.__doResize({width:i,height:r,pixelRatio:o})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){Jo.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(bn.VIEW_COMPLETED),Jo.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,s){e&&(t=t.bind(e));const i=this.__nextRenderWait;if(s){for(let e=0;e<i.length;e++)if(i[e]===t){i.splice(e,1);break}}else i.push(t);this.requestRender()}zoom(t,e,s,i){return Yt.need("view")}getValidMove(t,e){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:s}=this.clientBounds;return{x:e+t.x,y:s+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new bn(t,this))}__listenEvents(){const t=zt.start("FirstCreate "+this.innerName);this.once([[bn.START,()=>zt.end(t)],[wn.START,this.updateLazyBounds,this],[vn.START,this.__onCreated,this],[vn.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[xn.DATA,this.__onWatchData,this],[wn.END,this.__onLayoutEnd,this],[vn.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){Zh.list.remove(this);try{this.stop(),this.emitLeafer(bn.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager.destroy()),this.canvas.destroy(),this.config.view=this.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{Pr.clearRecycled()},100)}catch(t){Kh.error(t)}}};t?e():setTimeout(e)}},t.Leafer.list=new Ua,$t([_o(Ah)],t.Leafer.prototype,"__",void 0),$t([jr()],t.Leafer.prototype,"pixelRatio",void 0),t.Leafer=Zh=$t([bo()],t.Leafer),t.Rect=class extends t.UI{get __tag(){return"Rect"}constructor(t){super(t)}},$t([_o(Wh)],t.Rect.prototype,"__",void 0),t.Rect=$t([vo(Jh),xo(),bo()],t.Rect);const{copy:tl,add:el,includes:sl}=Rt,il=t.Rect.prototype,rl=t.Group.prototype,ol={};t.Box=class extends t.Group{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.pathInputed){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t;if(this.children.length){const e=this.__,{renderBounds:s,boxBounds:i}=this.__layout;super.__updateRenderBounds(),tl(ol,s),this.__updateRectRenderBounds(),(e.scrollY||e.scrollX)&&(ol.x+=e.scrollX,ol.y+=e.scrollY),t=!sl(i,ol),t&&"hide"!==e.overflow&&el(s,ol)}else this.__updateRectRenderBounds();p.stintSet(this,"isOverflow",t),this.__updateScrollBar()}__updateRectRenderBounds(){}__updateScrollBar(){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.scrollBar&&this.scrollBar.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}},$t([_o(Eh)],t.Box.prototype,"__",void 0),$t([jr(100)],t.Box.prototype,"width",void 0),$t([jr(100)],t.Box.prototype,"height",void 0),$t([Yr(!1)],t.Box.prototype,"resizeChildren",void 0),$t([eo("show")],t.Box.prototype,"overflow",void 0),$t([mo(il.__updateStrokeSpread)],t.Box.prototype,"__updateStrokeSpread",null),$t([mo(il.__updateRenderSpread)],t.Box.prototype,"__updateRectRenderSpread",null),$t([mo(il.__updateBoxBounds)],t.Box.prototype,"__updateRectBoxBounds",null),$t([mo(il.__updateStrokeBounds)],t.Box.prototype,"__updateStrokeBounds",null),$t([mo(il.__updateRenderBounds)],t.Box.prototype,"__updateRectRenderBounds",null),$t([mo(il.__updateChange)],t.Box.prototype,"__updateRectChange",null),$t([mo(il.__render)],t.Box.prototype,"__renderRect",null),$t([mo(rl.__render)],t.Box.prototype,"__renderGroup",null),t.Box=$t([xo(),bo()],t.Box),t.Frame=class extends t.Box{get __tag(){return"Frame"}get isFrame(){return!0}constructor(t){super(t)}},$t([_o(Oh)],t.Frame.prototype,"__",void 0),$t([so("#FFFFFF")],t.Frame.prototype,"fill",void 0),$t([eo("hide")],t.Frame.prototype,"overflow",void 0),t.Frame=$t([bo()],t.Frame);const{moveTo:nl,closePath:al,ellipse:hl}=ti;t.Ellipse=class extends t.UI{get __tag(){return"Ellipse"}constructor(t){super(t)}__updatePath(){const{width:t,height:s,innerRadius:i,startAngle:r,endAngle:o}=this.__,n=t/2,a=s/2,h=this.__.path=[];i?(r||o?(i<1&&hl(h,n,a,n*i,a*i,0,r,o,!1),hl(h,n,a,n,a,0,o,r,!0),i<1&&al(h)):(i<1&&(hl(h,n,a,n*i,a*i),nl(h,t,a)),hl(h,n,a,n,a,0,360,0,!0)),e.ellipseToCurve&&(this.__.path=this.getPath(!0))):r||o?(nl(h,n,a),hl(h,n,a,n,a,0,r,o,!1),al(h)):hl(h,n,a,n,a)}},$t([_o(Dh)],t.Ellipse.prototype,"__",void 0),$t([$r(0)],t.Ellipse.prototype,"innerRadius",void 0),$t([$r(0)],t.Ellipse.prototype,"startAngle",void 0),$t([$r(0)],t.Ellipse.prototype,"endAngle",void 0),t.Ellipse=$t([bo()],t.Ellipse);const{moveTo:ll,lineTo:dl,drawPoints:cl}=ti,{rotate:ul,getAngle:_l,getDistance:pl,defaultPoint:fl}=V,{toBounds:gl}=dr;t.Line=class extends t.UI{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,s={x:0,y:0};return t&&(s.x=t),e&&ul(s,e),s}set toPoint(t){this.width=pl(fl,t),this.rotation=_l(fl,t),this.height&&(this.height=0)}constructor(t){super(t)}__updatePath(){const t=this.__,e=t.path=[];t.points?cl(e,t.points,!1,t.closed):(ll(e,0,0),dl(e,this.width,0))}__updateRenderPath(){const t=this.__;!this.pathInputed&&t.points&&t.curve?(cl(t.__pathForRender=[],t.points,t.curve,t.closed),t.__useArrow&&ph.addArrows(this,!1)):super.__updateRenderPath()}__updateBoxBounds(){this.points?gl(this.__.__pathForRender,this.__layout.boxBounds):super.__updateBoxBounds()}},$t([_o(Mh)],t.Line.prototype,"__",void 0),$t([Zr("center")],t.Line.prototype,"strokeAlign",void 0),$t([jr(0)],t.Line.prototype,"height",void 0),$t([$r()],t.Line.prototype,"points",void 0),$t([$r(0)],t.Line.prototype,"curve",void 0),$t([$r(!1)],t.Line.prototype,"closed",void 0),t.Line=$t([bo()],t.Line);const{sin:yl,cos:ml,PI:xl}=Math,{moveTo:wl,lineTo:vl,closePath:bl,drawPoints:Bl}=ti,kl=t.Line.prototype;t.Polygon=class extends t.UI{get __tag(){return"Polygon"}constructor(t){super(t)}__updatePath(){const t=this.__.path=[];if(this.__.points)Bl(t,this.__.points,!1,!0);else{const{width:e,height:s,sides:i}=this.__,r=e/2,o=s/2;wl(t,r,0);for(let e=1;e<i;e++)vl(t,r+r*yl(2*e*xl/i),o-o*ml(2*e*xl/i));bl(t)}}__updateRenderPath(){}__updateBoxBounds(){}},$t([_o(Fh)],t.Polygon.prototype,"__",void 0),$t([$r(3)],t.Polygon.prototype,"sides",void 0),$t([$r()],t.Polygon.prototype,"points",void 0),$t([$r(0)],t.Polygon.prototype,"curve",void 0),$t([mo(kl.__updateRenderPath)],t.Polygon.prototype,"__updateRenderPath",null),$t([mo(kl.__updateBoxBounds)],t.Polygon.prototype,"__updateBoxBounds",null),t.Polygon=$t([xo(),bo()],t.Polygon);const{sin:Sl,cos:Rl,PI:Cl}=Math,{moveTo:Tl,lineTo:Pl,closePath:Ll}=ti;t.Star=class extends t.UI{get __tag(){return"Star"}constructor(t){super(t)}__updatePath(){const{width:t,height:e,corners:s,innerRadius:i}=this.__,r=t/2,o=e/2,n=this.__.path=[];Tl(n,r,0);for(let t=1;t<2*s;t++)Pl(n,r+(t%2==0?r:r*i)*Sl(t*Cl/s),o-(t%2==0?o:o*i)*Rl(t*Cl/s));Ll(n)}},$t([_o(zh)],t.Star.prototype,"__",void 0),$t([$r(5)],t.Star.prototype,"corners",void 0),$t([$r(.382)],t.Star.prototype,"innerRadius",void 0),t.Star=$t([bo()],t.Star),t.Image=class extends t.Rect{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return c(t)&&t[0].image}constructor(t){super(t)}},$t([_o(Hh)],t.Image.prototype,"__",void 0),$t([jr("")],t.Image.prototype,"url",void 0),t.Image=$t([bo()],t.Image);const Il=t.Image;t.Canvas=class extends t.Rect{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=Xt.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new Mr({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new cn(cn.LOADED,{image:t}))})}draw(t,e,s,i){const r=new K(t.worldTransform).invert(),o=new K;e&&o.translate(e.x,e.y),s&&(l(s)?o.scale(s):o.scale(s.x,s.y)),i&&o.rotate(i),r.multiplyParent(o),t.__render(this.canvas,{matrix:r.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:s,height:i}=this.__,{view:r}=this.canvas;t.drawImage(r,0,0,r.width,r.height,0,0,s,i)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:s}=this.__;t.resize(this.__,s),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}},$t([_o(Gh)],t.Canvas.prototype,"__",void 0),$t([lh(100)],t.Canvas.prototype,"width",void 0),$t([lh(100)],t.Canvas.prototype,"height",void 0),$t([lh(1)],t.Canvas.prototype,"pixelRatio",void 0),$t([lh(!0)],t.Canvas.prototype,"smooth",void 0),$t([Yr(!1)],t.Canvas.prototype,"safeResize",void 0),$t([lh()],t.Canvas.prototype,"contextSettings",void 0),t.Canvas=$t([bo()],t.Canvas);const{copyAndSpread:El,includes:Al,spread:Ol,setList:Ml}=Rt;function Wl(t,e){const s=t.__,{rows:i,decorationY:r}=s.__textDrawData;let o;s.__isPlacehold&&s.placeholderColor&&(e.fillStyle=s.placeholderColor);for(let t=0,s=i.length;t<s;t++)o=i[t],o.text?e.fillText(o.text,o.x,o.y):o.data&&o.data.forEach(t=>{e.fillText(t.char,t.x,o.y)});if(r){const{decorationColor:t,decorationHeight:o}=s.__textDrawData;t&&(e.fillStyle=t),i.forEach(t=>r.forEach(s=>e.fillRect(t.x,t.y+s,t.width,o)))}}function Dl(t,e){t.__.__font?Wl(t,e):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function Fl(t,e,s){switch(e.__.strokeAlign){case"center":zl(t,1,e,s);break;case"inside":Ul(t,"inside",e,s);break;case"outside":e.__.__fillAfterStroke?zl(t,2,e,s):Ul(t,"outside",e,s)}}function zl(t,e,s,i){const r=s.__;u(t)?Yl(t,e,!0,s,i):(i.setStroke(t,r.__strokeWidth*e,r),Nl(s,i))}function Ul(t,e,s,i){const r=i.getSameCanvas(!0,!0);r.font=s.__.__font,zl(t,2,s,r),r.blendMode="outside"===e?"destination-out":"destination-in",Wl(s,r),r.blendMode="normal",Oo.copyCanvasByWorld(s,i,r),r.recycle(s.__nowWorld)}function Nl(t,e){let s,i=t.__.__textDrawData;const{rows:r,decorationY:o}=i;for(let t=0,i=r.length;t<i;t++)s=r[t],s.text?e.strokeText(s.text,s.x,s.y):s.data&&s.data.forEach(t=>{e.strokeText(t.char,t.x,s.y)});if(o){const{decorationHeight:t}=i;r.forEach(s=>o.forEach(i=>e.strokeRect(s.x,s.y+i,s.width,t)))}}function Yl(t,e,s,i,r){let o;const n=i.__,{__hasMultiStrokeStyle:a}=n;a||r.setStroke(void 0,n.__strokeWidth*e,n);for(let h=0,l=t.length;h<l;h++)if(o=t[h],(!o.image||!gh.checkImage(i,r,o,!1))&&o.style){if(a){const{strokeStyle:t}=o;t?r.setStroke(o.style,n.__getRealStrokeWidth(t)*e,n,t):r.setStroke(o.style,n.__strokeWidth*e,n)}else r.strokeStyle=o.style;o.blendMode?(r.saveBlendMode(o.blendMode),s?Nl(i,r):r.stroke(),r.restoreBlendMode()):s?Nl(i,r):r.stroke()}}function Xl(t,e,s){const i=e.__;if(i.__strokeWidth)if(i.__font)Fl(t,e,s);else switch(i.strokeAlign){case"center":Hl(t,1,e,s);break;case"inside":!function(t,e,s){s.save(),s.clipUI(e),Hl(t,2,e,s),s.restore()}(t,e,s);break;case"outside":!function(t,e,s){const i=e.__;if(i.__fillAfterStroke)Hl(t,2,e,s);else{const{renderBounds:r}=e.__layout,o=s.getSameCanvas(!0,!0);e.__drawRenderPath(o),Hl(t,2,e,o),o.clipUI(i),o.clearWorld(r),Oo.copyCanvasByWorld(e,s,o),o.recycle(e.__nowWorld)}}(t,e,s)}}function Hl(t,e,s,i){const r=s.__;u(t)?Yl(t,e,!1,s,i):(i.setStroke(t,r.__strokeWidth*e,r),i.stroke()),r.__useArrow&&fh.strokeArrow(t,s,i)}t.Text=class extends t.UI{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}constructor(t){super(t)}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:s,fontFamily:i,fontSize:r,fontWeight:o,italic:n,textCase:a,textOverflow:h,padding:l}=t;t.__lineHeight=_h.number(e,r),t.__letterSpacing=_h.number(s,r),t.__padding=l?w.fourNumber(l):void 0,t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${n?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==o?o+" ":""}${r||12}px ${i||"caption"}`,t.__clipText="show"!==h&&!t.__autoSize,t.__textDrawData=ch.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:s,italic:i,padding:r,__autoWidth:o,__autoHeight:n}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<s&&Ol(a,s/2),o||n){if(h.x=o?a.x:0,h.y=n?a.y:0,h.width=o?a.width:t.width,h.height=n?a.height:t.height,r){const[e,s,i,r]=t.__padding;o&&(h.x-=r,h.width+=s+r),n&&(h.y-=e,h.height+=i+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();i&&(h.width+=.16*s),p.stintSet(this,"isOverflow",!Al(h,a)),this.isOverflow?(Ml(t.__textBoxBounds={},[h,a]),e.renderChanged=!0):t.__textBoxBounds=h}__onUpdateSize(){this.__box&&this.__box.__onUpdateSize(),super.__onUpdateSize()}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;El(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,s){const i=this.__box;i&&(i.__nowWorld=this.__nowWorld,i.__draw(t,e,s)),this.textEditing&&!e.exporting||super.__draw(t,e,s)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}},$t([_o(Xh)],t.Text.prototype,"__",void 0),$t([jr(0)],t.Text.prototype,"width",void 0),$t([jr(0)],t.Text.prototype,"height",void 0),$t([so()],t.Text.prototype,"boxStyle",void 0),$t([Yr(!1)],t.Text.prototype,"resizeFontSize",void 0),$t([so("#000000")],t.Text.prototype,"fill",void 0),$t([Zr("outside")],t.Text.prototype,"strokeAlign",void 0),$t([co("all")],t.Text.prototype,"hitFill",void 0),$t([jr("")],t.Text.prototype,"text",void 0),$t([jr("")],t.Text.prototype,"placeholder",void 0),$t([jr("caption")],t.Text.prototype,"fontFamily",void 0),$t([jr(12)],t.Text.prototype,"fontSize",void 0),$t([jr("normal")],t.Text.prototype,"fontWeight",void 0),$t([jr(!1)],t.Text.prototype,"italic",void 0),$t([jr("none")],t.Text.prototype,"textCase",void 0),$t([jr("none")],t.Text.prototype,"textDecoration",void 0),$t([jr(0)],t.Text.prototype,"letterSpacing",void 0),$t([jr({type:"percent",value:1.5})],t.Text.prototype,"lineHeight",void 0),$t([jr(0)],t.Text.prototype,"paraIndent",void 0),$t([jr(0)],t.Text.prototype,"paraSpacing",void 0),$t([jr("x")],t.Text.prototype,"writingMode",void 0),$t([jr("left")],t.Text.prototype,"textAlign",void 0),$t([jr("top")],t.Text.prototype,"verticalAlign",void 0),$t([jr(!0)],t.Text.prototype,"autoSizeAlign",void 0),$t([jr("normal")],t.Text.prototype,"textWrap",void 0),$t([jr("show")],t.Text.prototype,"textOverflow",void 0),$t([so(!1)],t.Text.prototype,"textEditing",void 0),t.Text=$t([bo()],t.Text),t.Path=class extends t.UI{get __tag(){return"Path"}constructor(t){super(t)}},$t([_o(Uh)],t.Path.prototype,"__",void 0),$t([Zr("center")],t.Path.prototype,"strokeAlign",void 0),t.Path=$t([bo()],t.Path),t.Pen=class extends t.Group{get __tag(){return"Pen"}constructor(t){super(t)}setStyle(e){const s=this.pathElement=new t.Path(e);return this.pathStyle=e,this.__path=s.path||(s.path=[]),this.add(s),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,s,i,r,o){return this}quadraticCurveTo(t,e,s,i){return this}closePath(){return this}rect(t,e,s,i){return this}roundRect(t,e,s,i,r){return this}ellipse(t,e,s,i,r,o,n,a){return this}arc(t,e,s,i,r,o){return this}arcTo(t,e,s,i,r){return this}drawEllipse(t,e,s,i,r,o,n,a){return this}drawArc(t,e,s,i,r,o){return this}drawPoints(t,e,s){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}},$t([_o(Nh)],t.Pen.prototype,"__",void 0),$t([(t,e)=>{Wr(t,e,{get(){return this.__path}})}],t.Pen.prototype,"path",void 0),t.Pen=$t([vo(yi,["set","path","paint"]),bo()],t.Pen);const{getSpread:Gl,getOuterOf:Vl,getByMove:jl,getIntersectData:ql}=Rt;let Ql;const{stintSet:Jl}=p,{hasTransparent:$l}=uh;function Zl(t,e,s){if(!u(e)||!1===e.visible||0===e.opacity)return;let i;const{boxBounds:r}=s.__layout;switch(e.type){case"image":i=gh.image(s,t,e,r,!Ql||!Ql[e.url]);break;case"linear":i=yh.linearGradient(e,r);break;case"radial":i=yh.radialGradient(e,r);break;case"angular":i=yh.conicGradient(e,r);break;case"solid":const{type:n,color:a,opacity:h}=e;i={type:n,style:uh.string(a,h)};break;default:o(e.r)||(i={type:"solid",style:uh.string(e)})}if(i){if(a(i.style)&&$l(i.style)&&(i.isTransparent=!0),e.style){if(0===e.style.strokeWidth)return;i.strokeStyle=e.style}e.editing&&(i.editing=e.editing),e.blendMode&&(i.blendMode=e.blendMode)}return i}const Kl={compute:function(t,e){const s=e.__,i=[];let r,o,n,a=s.__input[t];c(a)||(a=[a]),Ql=gh.recycleImage(t,s);for(let s,r=0,o=a.length;r<o;r++)(s=Zl(t,a[r],e))&&(i.push(s),s.strokeStyle&&(n||(n=1),s.strokeStyle.strokeWidth&&(n=Math.max(n,s.strokeStyle.strokeWidth))));s["_"+t]=i.length?i:void 0,i.length&&i.every(t=>t.isTransparent)&&(i.some(t=>t.image)&&(r=!0),o=!0),"fill"===t?(Jl(s,"__isAlphaPixelFill",r),Jl(s,"__isTransparentFill",o)):(Jl(s,"__isAlphaPixelStroke",r),Jl(s,"__isTransparentStroke",o),Jl(s,"__hasMultiStrokeStyle",n))},fill:function(t,e,s){s.fillStyle=t,Dl(e,s)},fills:function(t,e,s){let i;for(let r=0,o=t.length;r<o;r++){if(i=t[r],i.image){if(gh.checkImage(e,s,i,!e.__.__font))continue;if(!i.style){!r&&i.image.isPlacehold&&e.drawImagePlaceholder(s,i.image);continue}}if(s.fillStyle=i.style,i.transform||i.scaleFixed){if(s.save(),i.transform&&s.transform(i.transform),i.scaleFixed){const{scaleX:t,scaleY:r}=e.getRenderScaleData(!0);(!0===i.scaleFixed||"zoom-in"===i.scaleFixed&&t>1&&r>1)&&s.scale(1/t,1/r)}i.blendMode&&(s.blendMode=i.blendMode),Dl(e,s),s.restore()}else i.blendMode?(s.saveBlendMode(i.blendMode),Dl(e,s),s.restoreBlendMode()):Dl(e,s)}},fillPathOrText:Dl,fillText:Wl,stroke:Xl,strokes:function(t,e,s){Xl(t,e,s)},strokeText:Fl,drawTextStroke:Nl,shape:function(t,s,i){const r=s.getSameCanvas(),o=t.__nowWorld,n=s.bounds;let a,h,l,d,c,{scaleX:u,scaleY:_}=t.getRenderScaleData(!0);if(n.includes(o))c=r,a=d=o;else{const{renderShapeSpread:r}=t.__layout;let p;if(e.fullImageShadow)p=o;else{const t=r?Gl(n,u===_?r*u:[r*_,r*u]):n;p=ql(t,o)}l=n.getFitMatrix(p);let{a:f,d:g}=l;l.a<1&&(c=s.getSameCanvas(),t.__renderShape(c,i),u*=f,_*=g),d=Vl(o,l),a=jl(d,-l.e,-l.f);const y=i.matrix;y?(h=new K(l),h.multiply(y),f*=y.scaleX,g*=y.scaleY):h=l,h.withScale(f,g),i=Object.assign(Object.assign({},i),{matrix:h})}return t.__renderShape(r,i),{canvas:r,matrix:h,fitMatrix:l,bounds:a,worldCanvas:c,shapeBounds:d,scaleX:u,scaleY:_}}};let td={},ed={a:1,b:0,c:0,d:1,e:0,f:0};const{get:sd,rotateOfOuter:id,translate:rd,scaleOfOuter:od,multiplyParent:nd,scale:ad,rotate:hd,skew:ld}=M;function dd(t,e,s,i,r,o,n){const a=sd();rd(a,e.x+s,e.y+i),ad(a,r,o),n&&id(a,{x:e.x+e.width/2,y:e.y+e.height/2},n),t.transform=a}function cd(t,e,s,i,r,o,n,a,h){const l=sd();_d(l,e,s,i,r,o,n,a),h&&(ed.a=e.width/h.width,ed.d=e.height/h.height,nd(l,ed)),t.transform=l}function ud(t,e,s,i,r,o,n,a,h,l,d,c){const u=sd();if(c)_d(u,e,r,o,n,a,h,l);else{if(h)if("center"===d)id(u,{x:s/2,y:i/2},h);else switch(hd(u,h),h){case 90:rd(u,i,0);break;case 180:rd(u,s,i);break;case 270:rd(u,0,s)}td.x=e.x+r,td.y=e.y+o,rd(u,td.x,td.y),n&&od(u,td,n,a)}t.transform=u}function _d(t,e,s,i,r,o,n,a){n&&hd(t,n),a&&ld(t,a.x,a.y),r&&ad(t,r,o),rd(t,e.x+s,e.y+i)}const{get:pd,translate:fd}=M,gd=new Lt,yd={},md={};function xd(t,e,s,i){const{changeful:r,sync:o,scaleFixed:n}=s;r&&(t.changeful=r),o&&(t.sync=o),n&&(t.scaleFixed=n),t.data=wd(s,i,e)}function wd(t,e,s){t.padding&&(e=gd.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");let{width:i,height:r}=s;const{opacity:o,mode:n,align:h,offset:l,scale:d,size:c,rotation:_,skew:p,clipSize:f,repeat:g,gap:y,filters:m}=t,x=e.width===i&&e.height===r,v={mode:n},b="center"!==h&&(_||0)%180==90;let B,k;switch(Rt.set(md,0,0,b?r:i,b?i:r),n&&"cover"!==n&&"fit"!==n?((d||c)&&(w.getScaleData(d,c,s,yd),B=yd.scaleX,k=yd.scaleY),(h||y||g)&&(B&&Rt.scale(md,B,k,!0),h&&lt.toPoint(h,md,e,md,!0,!0))):x&&!_||(B=k=Rt.getFitScale(e,md,"fit"!==n),Rt.put(e,s,h,B,!1,md),Rt.scale(md,B,k,!0)),l&&V.move(md,l),n){case"stretch":x||(i=e.width,r=e.height);break;case"normal":case"clip":(md.x||md.y||B||f||_||p)&&cd(v,e,md.x,md.y,B,k,_,p,t.clipSize);break;case"repeat":(!x||B||_||p)&&ud(v,e,i,r,md.x,md.y,B,k,_,p,h,t.freeTransform),g||(v.repeat="repeat");const s=u(g);(y||s)&&(v.gap=function(t,e,s,i,r){let o,n;u(t)?(o=t.x,n=t.y):o=n=t;return{x:vd(o,s,r.width,e&&e.x),y:vd(n,i,r.height,e&&e.y)}}(y,s&&g,md.width,md.height,e));break;default:B&&dd(v,e,md.x,md.y,B,k,_)}return v.transform||(e.x||e.y)&&(v.transform=pd(),fd(v.transform,e.x,e.y)),B&&"stretch"!==n&&(v.scaleX=B,v.scaleY=k),v.width=i,v.height=r,o&&(v.opacity=o),m&&(v.filters=m),g&&(v.repeat=a(g)?"x"===g?"repeat-x":"repeat-y":"repeat"),v}function vd(t,e,s,i){const r=a(t)||i?(i?s-i*e:s%e)/((i||Math.floor(s/e))-1):t;return"auto"===t&&r<0?0:r}let bd,Bd=new Lt;const{isSame:kd}=Rt;function Sd(t,e,s,i,r,o){if("fill"===e&&!t.__.__naturalWidth){const e=t.__;if(e.__naturalWidth=i.width/e.pixelRatio,e.__naturalHeight=i.height/e.pixelRatio,e.__autoSide)return t.forceUpdate("width"),t.__proxyData&&(t.setProxyAttr("width",e.width),t.setProxyAttr("height",e.height)),!1}return r.data||xd(r,i,s,o),!0}function Rd(t,e){Pd(t,cn.LOAD,e)}function Cd(t,e){Pd(t,cn.LOADED,e)}function Td(t,e,s){e.error=s,t.forceUpdate("surface"),Pd(t,cn.ERROR,e)}function Pd(t,e,s){t.hasEvent(e)&&t.emitEvent(new cn(e,s))}function Ld(t,e){const{leafer:s}=t;s&&s.viewReady&&(s.renderer.ignore=e)}const{get:Id,scale:Ed,copy:Ad}=M,{floor:Od,max:Md,abs:Wd}=Math;function Dd(t,s,i){let{scaleX:r,scaleY:o}=t.getRenderScaleData(!0,s.scaleFixed);const n=r+"-"+o+"-"+i;if(s.patternId===n||t.destroyed)return!1;{const{image:t,data:a}=s;let h,l,{width:d,height:c,scaleX:u,scaleY:_,transform:p,repeat:f,gap:g}=a;r*=i,o*=i;const y=g&&g.x*r,m=g&&g.y*o;u&&(u=Wd(u),_=Wd(_),l=Id(),Ad(l,p),Ed(l,1/u,1/_),r*=u,o*=_),d*=r,c*=o;const x=d*c;if(!f&&x>e.image.maxCacheSize)return!1;let w=e.image.maxPatternSize;if(!t.isSVG){const e=t.width*t.height;w>e&&(w=e)}if(x>w&&(h=Math.sqrt(x/w)),h&&(r/=h,o/=h,d/=h,c/=h),u&&(r/=u,o/=_),(p||1!==r||1!==o)&&(l||(l=Id(),p&&Ad(l,p)),Ed(l,1/r,1/o)),l){const t=d+(y||0),e=c+(m||0);Ed(l,t/Md(Od(t),1),e/Md(Od(e),1))}const v=t.getCanvas(d,c,a.opacity,a.filters,y,m),b=t.getPattern(v,f||e.origin.noRepeat||"no-repeat",l,s);return s.style=b,s.patternId=n,!0}}const Fd={image:function(t,e,s,i,r){let o,n;const a=Pr.get(s);return bd&&s===bd.paint&&kd(i,bd.boxBounds)?o=bd.leafPaint:(o={type:s.type,image:a},a.hasAlphaPixel&&(o.isTransparent=!0),bd=a.use>1?{leafPaint:o,paint:s,boxBounds:Bd.set(i)}:null),(r||a.loading)&&(n={image:a,attrName:e,attrValue:s}),a.ready?(Sd(t,e,s,a,o,i),r&&(Rd(t,n),Cd(t,n))):a.error?r&&Td(t,n,a.error):(r&&(Ld(t,!0),Rd(t,n)),o.loadId=a.load(()=>{Ld(t,!1),t.destroyed||(Sd(t,e,s,a,o,i)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),Cd(t,n)),o.loadId=void 0},e=>{Ld(t,!1),Td(t,n,e),o.loadId=void 0}),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),o},checkImage:function(t,s,i,r){const{scaleX:o,scaleY:n}=t.getRenderScaleData(!0,i.scaleFixed),{pixelRatio:a}=s,{data:h}=i;if(!h||i.patternId===o+"-"+n+"-"+a&&!wh.running)return!1;if(r)if(h.repeat)r=!1;else if(!(i.changeful||"miniapp"===e.name&&mn.isResizing(t)||wh.running)){let{width:t,height:s}=h;t*=o*a,s*=n*a,h.scaleX&&(t*=h.scaleX,s*=h.scaleY),r=t*s>e.image.maxCacheSize}return r?(t.__.__isFastShadow&&(s.fillStyle=i.style||"#000",s.fill()),function(t,e,s,i){e.save(),e.clipUI(t),s.blendMode&&(e.blendMode=s.blendMode);i.opacity&&(e.opacity*=i.opacity);i.transform&&e.transform(i.transform);e.drawImage(s.image.getFull(i.filters),0,0,i.width,i.height),e.restore()}(t,s,i,h),!0):(!i.style||i.sync||wh.running?Dd(t,i,a):i.patternTask||(i.patternTask=Pr.patternTasker.add(()=>Zt(this,void 0,void 0,function*(){i.patternTask=null,s.bounds.hit(t.__nowWorld)&&Dd(t,i,a),t.forceUpdate("surface")}),300)),!1)},createPattern:Dd,recycleImage:function(t,e){const s=e["_"+t];if(c(s)){let i,r,o,n,a;for(let h=0,l=s.length;h<l;h++)i=s[h],r=i.image,a=r&&r.url,a&&(o||(o={}),o[a]=!0,Pr.recycle(r),r.loading&&(n||(n=e.__input&&e.__input[t]||[],c(n)||(n=[n])),r.unload(s[h].loadId,!n.some(t=>t.url===a))));return o}return null},createData:xd,getPatternData:wd,fillOrFitMode:dd,clipMode:cd,repeatMode:ud},{toPoint:zd}=nt,{hasTransparent:Ud}=uh,Nd={},Yd={};function Xd(t,e,s,i){if(s){let r,o,n,h;for(let t=0,l=s.length;t<l;t++)r=s[t],a(r)?(n=t/(l-1),o=uh.string(r,i)):(n=r.offset,o=uh.string(r.color,i)),e.addColorStop(n,o),!h&&Ud(o)&&(h=!0);h&&(t.isTransparent=!0)}}const{getAngle:Hd,getDistance:Gd}=V,{get:Vd,rotateOfOuter:jd,scaleOfOuter:qd}=M,{toPoint:Qd}=nt,Jd={},$d={};function Zd(t,e,s,i,r){let o;const{width:n,height:a}=t;if(n!==a||i){const t=Hd(e,s);o=Vd(),r?(qd(o,e,n/a*(i||1),1),jd(o,e,t+90)):(qd(o,e,1,n/a*(i||1)),jd(o,e,t))}return o}const{getDistance:Kd}=V,{toPoint:tc}=nt,ec={},sc={};const ic={linearGradient:function(t,s){let{from:i,to:r,type:o,opacity:n}=t;zd(i||"top",s,Nd),zd(r||"bottom",s,Yd);const a=e.canvas.createLinearGradient(Nd.x,Nd.y,Yd.x,Yd.y),h={type:o,style:a};return Xd(h,a,t.stops,n),h},radialGradient:function(t,s){let{from:i,to:r,type:o,opacity:n,stretch:a}=t;Qd(i||"center",s,Jd),Qd(r||"bottom",s,$d);const h=e.canvas.createRadialGradient(Jd.x,Jd.y,0,Jd.x,Jd.y,Gd(Jd,$d)),l={type:o,style:h};Xd(l,h,t.stops,n);const d=Zd(s,Jd,$d,a,!0);return d&&(l.transform=d),l},conicGradient:function(t,s){let{from:i,to:r,type:o,opacity:n,stretch:a}=t;tc(i||"center",s,ec),tc(r||"bottom",s,sc);const h=e.conicGradientSupport?e.canvas.createConicGradient(0,ec.x,ec.y):e.canvas.createRadialGradient(ec.x,ec.y,0,ec.x,ec.y,Kd(ec,sc)),l={type:o,style:h};Xd(l,h,t.stops,n);const d=Zd(s,ec,sc,a||1,e.conicGradientRotate90);return d&&(l.transform=d),l},getTransform:Zd},{copy:rc,toOffsetOutBounds:oc}=Rt,nc={},ac={};function hc(t,s,i,r){const{bounds:o,shapeBounds:n}=r;if(e.fullImageShadow){if(rc(nc,t.bounds),nc.x+=s.x-n.x,nc.y+=s.y-n.y,i){const{fitMatrix:t}=r;nc.x-=(o.x+(t?t.e:0)+o.width/2)*(i-1),nc.y-=(o.y+(t?t.f:0)+o.height/2)*(i-1),nc.width*=i,nc.height*=i}t.copyWorld(r.canvas,t.bounds,nc)}else i&&(rc(nc,s),nc.x-=s.width/2*(i-1),nc.y-=s.height/2*(i-1),nc.width*=i,nc.height*=i),t.copyWorld(r.canvas,n,i?nc:s)}const{toOffsetOutBounds:lc}=Rt,dc={};const cc={shadow:function(t,e,s){let i,r;const{__nowWorld:o,__layout:n}=t,{shadow:a}=t.__,{worldCanvas:h,bounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=a.length-1;oc(l,ac),a.forEach((a,f)=>{let g=1;if(a.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(g=1/t)}_.setWorldShadow(ac.offsetX+a.x*c*g,ac.offsetY+a.y*u*g,a.blur*c*g,uh.string(a.color)),r=a.spread?1+2*a.spread/(n.boxBounds.width+2*(n.strokeBoxSpread||0))*g:0,hc(_,ac,r,s),i=l,a.box&&(_.restore(),_.save(),h&&(_.copyWorld(_,l,o,"copy"),i=o),h?_.copyWorld(h,o,o,"destination-out"):_.copyWorld(s.canvas,d,l,"destination-out")),Oo.copyCanvasByWorld(t,e,_,i,a.blendMode),p&&f<p&&_.clearWorld(i,!0)}),_.recycle(i)},innerShadow:function(t,e,s){let i,r;const{__nowWorld:o,__layout:n}=t,{innerShadow:a}=t.__,{worldCanvas:h,bounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=a.length-1;lc(l,dc),a.forEach((a,f)=>{let g=1;if(a.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(g=1/t)}_.save(),_.setWorldShadow(dc.offsetX+a.x*c*g,dc.offsetY+a.y*u*g,a.blur*c*g),r=a.spread?1-2*a.spread/(n.boxBounds.width+2*(n.strokeBoxSpread||0))*g:0,hc(_,dc,r,s),_.restore(),h?(_.copyWorld(_,l,o,"copy"),_.copyWorld(h,o,o,"source-out"),i=o):(_.copyWorld(s.canvas,d,l,"source-out"),i=l),_.fillWorld(i,uh.string(a.color),"source-in"),Oo.copyCanvasByWorld(t,e,_,i,a.blendMode),p&&f<p&&_.clearWorld(i,!0)}),_.recycle(i)},blur:function(t,e,s){const{blur:i}=t.__;s.setWorldBlur(i*t.__nowWorld.a),s.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),s.filter="none"},backgroundBlur:function(t,e,s){}},{excludeRenderBounds:uc}=Yo;let _c;function pc(t,e,s,i,r,o,n,a){switch(e){case"grayscale":_c||(_c=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,s,i,r,o){const n=t.__nowWorld;s.resetTransform(),s.opacity=1,s.useMask(i,n),o&&i.recycle(n);gc(t,e,s,1,r,o)}(t,s,i,r,n,a);break;case"opacity-path":gc(t,s,i,o,n,a);break;case"path":a&&s.restore()}}function fc(t){return t.getSameCanvas(!1,!0)}function gc(t,e,s,i,r,o){const n=t.__nowWorld;e.resetTransform(),e.opacity=i,e.copyWorld(s,n,void 0,r),o?s.recycle(n):s.clearWorld(n,!0)}t.Group.prototype.__renderMask=function(t,e){let s,i,r,o,n,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++){if(s=h[l],a=s.__.mask,a){n&&(pc(this,n,t,r,i,o,void 0,!0),i=r=null),o=s.__.opacity,_c=!1,"path"===a||"clipping-path"===a?(o<1?(n="opacity-path",r||(r=fc(t))):(n="path",t.save()),s.__clip(r||t,e)):(n="grayscale"===a?"grayscale":"alpha",i||(i=fc(t)),r||(r=fc(t)),s.__render(i,e)),"clipping"!==a&&"clipping-path"!==a||uc(s,e)||s.__render(t,e);continue}const d=1===o&&s.__.__blendMode;d&&pc(this,n,t,r,i,o,void 0,!1),uc(s,e)||s.__render(r||t,e),d&&pc(this,n,t,r,i,o,d,!1)}pc(this,n,t,r,i,o,void 0,!0)};const yc=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",mc=yc+"_#~&*+\\=|≮≯≈≠=…",xc=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map(([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`).join("|"));function wc(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}const vc=wc("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),bc=wc("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),Bc=wc(yc),kc=wc(mc),Sc=wc("- —/~|┆·");var Rc;!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(Rc||(Rc={}));const{Letter:Cc,Single:Tc,Before:Pc,After:Lc,Symbol:Ic,Break:Ec}=Rc;function Ac(t){return vc[t]?Cc:Sc[t]?Ec:bc[t]?Pc:Bc[t]?Lc:kc[t]?Ic:xc.test(t)?Tc:Cc}const Oc={trimRight(t){const{words:e}=t;let s,i=0,r=e.length;for(let o=r-1;o>-1&&(s=e[o].data[0]," "===s.char);o--)i++,t.width-=s.width;i&&e.splice(r-i,i)}};function Mc(t,e,s){switch(e){case"title":return s?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:Wc}=Oc,{Letter:Dc,Single:Fc,Before:zc,After:Uc,Symbol:Nc,Break:Yc}=Rc;let Xc,Hc,Gc,Vc,jc,qc,Qc,Jc,$c,Zc,Kc,tu,eu,su,iu,ru,ou,nu=[];function au(t,e){$c&&!Jc&&(Jc=$c),Xc.data.push({char:t,width:e}),Gc+=e}function hu(){Vc+=Gc,Xc.width=Gc,Hc.words.push(Xc),Xc={data:[]},Gc=0}function lu(){su&&(iu.paraNumber++,Hc.paraStart=!0,su=!1),$c&&(Hc.startCharSize=Jc,Hc.endCharSize=$c,Jc=0),Hc.width=Vc,ru.width?Wc(Hc):ou&&du(),nu.push(Hc),Hc={words:[]},Vc=0}function du(){Vc>(iu.maxWidth||0)&&(iu.maxWidth=Vc)}const{top:cu,right:uu,bottom:_u,left:pu}=t.Direction4;function fu(t,e,s){const{bounds:i,rows:r}=t;i[e]+=s;for(let t=0;t<r.length;t++)r[t][e]+=s}const gu={getDrawData:function(t,s){a(t)||(t=String(t));let i=0,r=0,o=s.__getInput("width")||0,n=s.__getInput("height")||0;const{textDecoration:h,__font:l,__padding:d}=s;d&&(o?(i=d[pu],o-=d[uu]+d[pu]):s.autoSizeAlign||(i=d[pu]),n?(r=d[cu],n-=d[cu]+d[_u]):s.autoSizeAlign||(r=d[cu]));const c={bounds:{x:i,y:r,width:o,height:n},rows:[],paraNumber:0,font:e.canvas.font=l};return function(t,s,i){iu=t,nu=t.rows,ru=t.bounds,ou=!ru.width&&!i.autoSizeAlign;const{__letterSpacing:r,paraIndent:o,textCase:n}=i,{canvas:a}=e,{width:h,height:l}=ru;if(h||l||r||"none"!==n){const t="none"!==i.textWrap,e="break"===i.textWrap;su=!0,Kc=null,Jc=Qc=$c=Gc=Vc=0,Xc={data:[]},Hc={words:[]},r&&(s=[...s]);for(let i=0,l=s.length;i<l;i++)qc=s[i],"\n"===qc?(Gc&&hu(),Hc.paraEnd=!0,lu(),su=!0):(Zc=Ac(qc),Zc===Dc&&"none"!==n&&(qc=Mc(qc,n,!Gc)),Qc=a.measureText(qc).width,r&&(r<0&&($c=Qc),Qc+=r),tu=Zc===Fc&&(Kc===Fc||Kc===Dc)||Kc===Fc&&Zc!==Uc,eu=!(Zc!==zc&&Zc!==Fc||Kc!==Nc&&Kc!==Uc),jc=su&&o?h-o:h,t&&h&&Vc+Gc+Qc>jc&&(e?(Gc&&hu(),Vc&&lu()):(eu||(eu=Zc===Dc&&Kc==Uc),tu||eu||Zc===Yc||Zc===zc||Zc===Fc||Gc+Qc>jc?(Gc&&hu(),Vc&&lu()):Vc&&lu()))," "===qc&&!0!==su&&Vc+Gc===0||(Zc===Yc?(" "===qc&&Gc&&hu(),au(qc,Qc),hu()):tu||eu?(Gc&&hu(),au(qc,Qc)):au(qc,Qc)),Kc=Zc);Gc&&hu(),Vc&&lu(),nu.length>0&&(nu[nu.length-1].paraEnd=!0)}else s.split("\n").forEach(t=>{iu.paraNumber++,Vc=a.measureText(t).width,nu.push({x:o||0,text:t,width:Vc,paraStart:!0}),ou&&du()})}(c,t,s),d&&function(t,e,s,i,r){if(!i&&s.autoSizeAlign)switch(s.textAlign){case"left":fu(e,"x",t[pu]);break;case"right":fu(e,"x",-t[uu])}if(!r&&s.autoSizeAlign)switch(s.verticalAlign){case"top":fu(e,"y",t[cu]);break;case"bottom":fu(e,"y",-t[_u])}}(d,c,s,o,n),function(t,e){const{rows:s,bounds:i}=t,r=s.length,{__lineHeight:o,__baseLine:n,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:f,height:g}=i,y=o*r+(c?c*(t.paraNumber-1):0),m=n;if(h&&y>g)y=Math.max(g,o),r>1&&(t.overflow=r);else if(g||u)switch(d){case"middle":p+=(g-y)/2;break;case"bottom":p+=g-y}m+=p;let x,w,v,b=f||u?f:t.maxWidth;for(let n=0,d=r;n<d;n++){if(x=s[n],x.x=_,x.width<f||x.width>f&&!h)switch(l){case"center":x.x+=(b-x.width)/2;break;case"right":x.x+=b-x.width}x.paraStart&&c&&n>0&&(m+=c),x.y=m,m+=o,t.overflow>n&&m>y&&(x.isOverflow=!0,t.overflow=n+1),w=x.x,v=x.width,a<0&&(x.width<0?(v=-x.width+e.fontSize+a,w-=v,v+=e.fontSize):v-=a),w<i.x&&(i.x=w),v>i.width&&(i.width=v),h&&f&&f<v&&(x.isOverflow=!0,t.overflow||(t.overflow=s.length))}i.y=p,i.height=y}(c,s),function(t,e,s){const{rows:i}=t,{textAlign:r,paraIndent:o,letterSpacing:n}=e;let a,h,l,d,c,u;i.forEach(t=>{t.words&&(l=o&&t.paraStart?o:0,u=t.words.length,h=s&&("justify"===r||"both"===r)&&u>1?(s-t.width-l)/(u-1):0,d=n||t.isOverflow?0:h>.01?1:2,t.isOverflow&&!n&&(t.textMode=!0),2===d?(t.x+=l,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=l,a=t.x,t.data=[],t.words.forEach((e,s)=>{1===d?(c={char:"",x:a},a=function(t,e,s){return t.forEach(t=>{s.char+=t.char,e+=t.width}),e}(e.data,a,c),(t.isOverflow||" "!==c.char)&&t.data.push(c)):a=function(t,e,s,i){return t.forEach(t=>{(i||" "!==t.char)&&(t.x=e,s.push(t)),e+=t.width}),e}(e.data,a,t.data,t.isOverflow),!h||t.paraEnd&&"both"!==r||s===u-1||(a+=h,t.width+=h)})),t.words=null)})}(c,s,o),c.overflow&&function(t,s,i,r){if(!r)return;const{rows:o,overflow:n}=t;let{textOverflow:a}=s;if(o.splice(n),a&&"show"!==a){let t,h;"hide"===a?a="":"ellipsis"===a&&(a="...");const l=a?e.canvas.measureText(a).width:0,d=i+r-l;("none"===s.textWrap?o:[o[n-1]]).forEach(e=>{if(e.isOverflow&&e.data){let s=e.data.length-1;for(let i=s;i>-1&&(t=e.data[i],h=t.x+t.width,!(i===s&&h<d));i--){if(h<d&&" "!==t.char||!i){e.data.splice(i+1),e.width-=t.width;break}e.width-=t.width}e.width+=l,e.data.push({char:a,x:h}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(c,s,i,o),"none"!==h&&function(t,e){let s;const{fontSize:i,textDecoration:r}=e;switch(t.decorationHeight=i/11,u(r)?(s=r.type,r.color&&(t.decorationColor=uh.string(r.color))):s=r,s){case"under":t.decorationY=[.15*i];break;case"delete":t.decorationY=[.35*-i];break;case"under-delete":t.decorationY=[.15*i,.35*-i]}}(c,s),c}};const yu={string:function(t,e){const s=l(e)&&e<1;if(a(t)){if(!s||!uh.object)return t;t=uh.object(t)}let i=o(t.a)?1:t.a;s&&(i*=e);const r=t.r+","+t.g+","+t.b;return 1===i?"rgb("+r+")":"rgba("+r+","+i+")"}};return Object.assign(ch,gu),Object.assign(uh,yu),Object.assign(fh,Kl),Object.assign(gh,Fd),Object.assign(yh,ic),Object.assign(mh,cc),Va(),t.AlignHelper=lt,t.AroundHelper=nt,t.AutoBounds=Et,t.BezierHelper=Fe,t.Bounds=Lt,t.BoundsEvent=un,t.BoundsHelper=Rt,t.BoxData=Eh,t.BranchHelper=Vo,t.BranchRender=na,t.CanvasData=Gh,t.CanvasManager=Jt,t.ChildEvent=ln,t.ColorConvert=uh,t.Creator=Xt,t.DataHelper=p,t.Debug=Mt,t.Effect=mh,t.EllipseData=Dh,t.EllipseHelper=je,t.Event=hn,t.EventCreator=qt,t.Eventer=Pn,t.Export=wh,t.FileHelper=vr,t.Filter=xh,t.FrameData=Oh,t.GroupData=Ih,t.ImageData=Hh,t.ImageEvent=cn,t.ImageManager=Pr,t.IncrementId=s,t.LayoutEvent=wn,t.Layouter=oh,t.LeafBounds=ia,t.LeafBoundsHelper=Yo,t.LeafData=g,t.LeafDataProxy=Yn,t.LeafEventer=Un,t.LeafHelper=Oo,t.LeafLayout=an,t.LeafLevelList=Na,t.LeafList=Ua,t.LeafMatrix=Qn,t.LeafRender=ra,t.LeaferCanvas=Xa,t.LeaferCanvasBase=le,t.LeaferData=Ah,t.LeaferEvent=bn,t.LeaferImage=Mr,t.LineData=Mh,t.MathHelper=w,t.Matrix=K,t.MatrixHelper=M,t.MyImage=Il,t.NeedConvertToCanvasCommandMap=pe,t.OneRadian=b,t.PI2=B,t.PI_2=k,t.Paint=fh,t.PaintGradient=yh,t.PaintImage=gh,t.PathArrow=ph,t.PathBounds=dr,t.PathCommandDataHelper=ti,t.PathCommandMap=ue,t.PathConvert=Is,t.PathCorner=yr,t.PathCreator=yi,t.PathData=Uh,t.PathDrawer=Ei,t.PathHelper=de,t.PathNumberCommandLengthMap=me,t.PathNumberCommandMap=ye,t.PenData=Nh,t.Platform=e,t.Plugin=Yt,t.Point=$,t.PointHelper=V,t.PolygonData=Fh,t.PropertyEvent=dn,t.RectData=Wh,t.RectHelper=xe,t.RectRender=Jh,t.RenderEvent=vn,t.Renderer=ah,t.ResizeEvent=mn,t.Resource=Cr,t.Run=zt,t.StarData=zh,t.State=vh,t.StringNumberMap=At,t.TaskItem=kr,t.TaskProcessor=Sr,t.TextConvert=ch,t.TextData=Xh,t.Transition=bh,t.TwoPointBoundsHelper=et,t.UIBounds=Vh,t.UICreator=Gt,t.UIData=Ph,t.UIRender=qh,t.UnitConvert=_h,t.WaitHelper=Jo,t.WatchEvent=xn,t.Watcher=qa,t.affectRenderBoundsType=eo,t.affectStrokeBoundsType=Zr,t.attr=Ur,t.autoLayoutType=Hr,t.boundsType=jr,t.canvasPatch=wr,t.canvasSizeAttrs=he,t.createAttr=function(t){return(e,s)=>{Wr(e,s,Fr(s,t))}},t.createDescriptor=Fr,t.cursorType=uo,t.dataProcessor=_o,t.dataType=Yr,t.decorateLeafAttr=zr,t.defineDataProcessor=po,t.defineKey=Wr,t.defineLeafAttr=Nr,t.doBoundsType=Qr,t.doStrokeType=Kr,t.effectType=hh,t.emptyData={},t.eraserType=lo,t.getBoundsData=R,t.getDescriptor=Dr,t.getMatrixData=C,t.getPointData=S,t.hitType=co,t.isArray=c,t.isData=function(t){return u(t)&&!c(t)},t.isEmptyData=_,t.isFinite=h,t.isNull=n,t.isNumber=l,t.isObject=u,t.isString=a,t.isUndefined=o,t.layoutProcessor=function(t){return(e,s)=>{Wr(e,"__LayoutProcessor",{get:()=>t})}},t.leaferTransformAttrMap=Cn,t.maskType=ho,t.naturalBoundsType=qr,t.opacityType=io,t.pathInputType=Jr,t.pathType=$r,t.pen=mr,t.positionType=Xr,t.registerUI=bo,t.registerUIEvent=function(){return t=>{qt.register(t)}},t.resizeType=lh,t.rewrite=mo,t.rewriteAble=xo,t.rotationType=Vr,t.scaleType=Gr,t.sortType=ao,t.strokeType=to,t.surfaceType=so,t.tempBounds=It,t.tempMatrix=tt,t.tempPoint=Z,t.tryToNumber=function(t){return"string"==typeof t&&d.test(t)?+t:t},t.useCanvas=Va,t.useModule=vo,t.version="1.9.1",t.visibleType=ro,t.zoomLayerType=dh,t}({});function Leafer(t){return new LeaferUI.Leafer(t)}Object.setPrototypeOf(Leafer,LeaferUI),Leafer.prototype=LeaferUI.Leafer.prototype;
2
2
  //# sourceMappingURL=web.min.js.map