@leafer/core 1.0.0-rc.20 → 1.0.0-rc.22
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/lib/core.cjs +25 -6
- package/lib/core.esm.js +25 -6
- package/lib/core.esm.min.js +1 -1
- package/lib/core.min.cjs +1 -1
- package/package.json +18 -18
package/lib/core.cjs
CHANGED
|
@@ -1208,11 +1208,19 @@ const AroundHelper = {
|
|
|
1208
1208
|
directionData,
|
|
1209
1209
|
tempPoint: {},
|
|
1210
1210
|
get,
|
|
1211
|
-
toPoint(around, bounds, to, onlySize) {
|
|
1211
|
+
toPoint(around, bounds, to, onlySize, pointBounds) {
|
|
1212
1212
|
to || (to = {});
|
|
1213
1213
|
const point = get(around);
|
|
1214
1214
|
to.x = point.x * bounds.width;
|
|
1215
1215
|
to.y = point.y * bounds.height;
|
|
1216
|
+
if (pointBounds) {
|
|
1217
|
+
to.x -= pointBounds.x;
|
|
1218
|
+
to.y -= pointBounds.y;
|
|
1219
|
+
if (point.x)
|
|
1220
|
+
to.x -= (point.x === 1) ? pointBounds.width : (point.x === 0.5 ? point.x * pointBounds.width : 0);
|
|
1221
|
+
if (point.y)
|
|
1222
|
+
to.y -= (point.y === 1) ? pointBounds.height : (point.y === 0.5 ? point.y * pointBounds.height : 0);
|
|
1223
|
+
}
|
|
1216
1224
|
if (!onlySize) {
|
|
1217
1225
|
to.x += bounds.x;
|
|
1218
1226
|
to.y += bounds.y;
|
|
@@ -1267,7 +1275,8 @@ class Debug {
|
|
|
1267
1275
|
this.warn(...messages);
|
|
1268
1276
|
}
|
|
1269
1277
|
warn(...messages) {
|
|
1270
|
-
|
|
1278
|
+
if (D$4.showWarn)
|
|
1279
|
+
console.warn(this.name, ...messages);
|
|
1271
1280
|
}
|
|
1272
1281
|
repeat(name, ...messages) {
|
|
1273
1282
|
if (!this.repeatMap[name]) {
|
|
@@ -1286,6 +1295,7 @@ class Debug {
|
|
|
1286
1295
|
}
|
|
1287
1296
|
Debug.filterList = [];
|
|
1288
1297
|
Debug.excludeList = [];
|
|
1298
|
+
Debug.showWarn = true;
|
|
1289
1299
|
function getNameList(name) {
|
|
1290
1300
|
if (!name)
|
|
1291
1301
|
name = [];
|
|
@@ -3956,15 +3966,21 @@ const LeafHelper = {
|
|
|
3956
3966
|
}
|
|
3957
3967
|
return true;
|
|
3958
3968
|
},
|
|
3959
|
-
moveWorld(t, x, y) {
|
|
3960
|
-
const local = { x, y };
|
|
3969
|
+
moveWorld(t, x, y = 0) {
|
|
3970
|
+
const local = typeof x === 'object' ? Object.assign({}, x) : { x, y };
|
|
3961
3971
|
if (t.parent)
|
|
3962
3972
|
toInnerPoint$1(t.parent.worldTransform, local, local, true);
|
|
3963
3973
|
L.moveLocal(t, local.x, local.y);
|
|
3964
3974
|
},
|
|
3965
3975
|
moveLocal(t, x, y = 0) {
|
|
3966
|
-
|
|
3967
|
-
|
|
3976
|
+
if (typeof x === 'object') {
|
|
3977
|
+
t.x += x.x;
|
|
3978
|
+
t.y += x.y;
|
|
3979
|
+
}
|
|
3980
|
+
else {
|
|
3981
|
+
t.x += x;
|
|
3982
|
+
t.y += y;
|
|
3983
|
+
}
|
|
3968
3984
|
},
|
|
3969
3985
|
zoomOfWorld(t, origin, scaleX, scaleY, resize) {
|
|
3970
3986
|
L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize);
|
|
@@ -4526,12 +4542,15 @@ const LeafEventer = {
|
|
|
4526
4542
|
break;
|
|
4527
4543
|
}
|
|
4528
4544
|
}
|
|
4545
|
+
this.syncEventer && this.syncEventer.emitEvent(event, capture);
|
|
4529
4546
|
},
|
|
4530
4547
|
emitEvent(event, capture) {
|
|
4531
4548
|
event.current = this;
|
|
4532
4549
|
this.emit(event.type, event, capture);
|
|
4533
4550
|
},
|
|
4534
4551
|
hasEvent(type, capture) {
|
|
4552
|
+
if (this.syncEventer && this.syncEventer.hasEvent(type, capture))
|
|
4553
|
+
return true;
|
|
4535
4554
|
const { __bubbleMap: b, __captureMap: c } = this;
|
|
4536
4555
|
const hasB = b && b[type], hasC = c && c[type];
|
|
4537
4556
|
return !!(capture === undefined ? (hasB || hasC) : (capture ? hasC : hasB));
|
package/lib/core.esm.js
CHANGED
|
@@ -1206,11 +1206,19 @@ const AroundHelper = {
|
|
|
1206
1206
|
directionData,
|
|
1207
1207
|
tempPoint: {},
|
|
1208
1208
|
get,
|
|
1209
|
-
toPoint(around, bounds, to, onlySize) {
|
|
1209
|
+
toPoint(around, bounds, to, onlySize, pointBounds) {
|
|
1210
1210
|
to || (to = {});
|
|
1211
1211
|
const point = get(around);
|
|
1212
1212
|
to.x = point.x * bounds.width;
|
|
1213
1213
|
to.y = point.y * bounds.height;
|
|
1214
|
+
if (pointBounds) {
|
|
1215
|
+
to.x -= pointBounds.x;
|
|
1216
|
+
to.y -= pointBounds.y;
|
|
1217
|
+
if (point.x)
|
|
1218
|
+
to.x -= (point.x === 1) ? pointBounds.width : (point.x === 0.5 ? point.x * pointBounds.width : 0);
|
|
1219
|
+
if (point.y)
|
|
1220
|
+
to.y -= (point.y === 1) ? pointBounds.height : (point.y === 0.5 ? point.y * pointBounds.height : 0);
|
|
1221
|
+
}
|
|
1214
1222
|
if (!onlySize) {
|
|
1215
1223
|
to.x += bounds.x;
|
|
1216
1224
|
to.y += bounds.y;
|
|
@@ -1265,7 +1273,8 @@ class Debug {
|
|
|
1265
1273
|
this.warn(...messages);
|
|
1266
1274
|
}
|
|
1267
1275
|
warn(...messages) {
|
|
1268
|
-
|
|
1276
|
+
if (D$4.showWarn)
|
|
1277
|
+
console.warn(this.name, ...messages);
|
|
1269
1278
|
}
|
|
1270
1279
|
repeat(name, ...messages) {
|
|
1271
1280
|
if (!this.repeatMap[name]) {
|
|
@@ -1284,6 +1293,7 @@ class Debug {
|
|
|
1284
1293
|
}
|
|
1285
1294
|
Debug.filterList = [];
|
|
1286
1295
|
Debug.excludeList = [];
|
|
1296
|
+
Debug.showWarn = true;
|
|
1287
1297
|
function getNameList(name) {
|
|
1288
1298
|
if (!name)
|
|
1289
1299
|
name = [];
|
|
@@ -3954,15 +3964,21 @@ const LeafHelper = {
|
|
|
3954
3964
|
}
|
|
3955
3965
|
return true;
|
|
3956
3966
|
},
|
|
3957
|
-
moveWorld(t, x, y) {
|
|
3958
|
-
const local = { x, y };
|
|
3967
|
+
moveWorld(t, x, y = 0) {
|
|
3968
|
+
const local = typeof x === 'object' ? Object.assign({}, x) : { x, y };
|
|
3959
3969
|
if (t.parent)
|
|
3960
3970
|
toInnerPoint$1(t.parent.worldTransform, local, local, true);
|
|
3961
3971
|
L.moveLocal(t, local.x, local.y);
|
|
3962
3972
|
},
|
|
3963
3973
|
moveLocal(t, x, y = 0) {
|
|
3964
|
-
|
|
3965
|
-
|
|
3974
|
+
if (typeof x === 'object') {
|
|
3975
|
+
t.x += x.x;
|
|
3976
|
+
t.y += x.y;
|
|
3977
|
+
}
|
|
3978
|
+
else {
|
|
3979
|
+
t.x += x;
|
|
3980
|
+
t.y += y;
|
|
3981
|
+
}
|
|
3966
3982
|
},
|
|
3967
3983
|
zoomOfWorld(t, origin, scaleX, scaleY, resize) {
|
|
3968
3984
|
L.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize);
|
|
@@ -4524,12 +4540,15 @@ const LeafEventer = {
|
|
|
4524
4540
|
break;
|
|
4525
4541
|
}
|
|
4526
4542
|
}
|
|
4543
|
+
this.syncEventer && this.syncEventer.emitEvent(event, capture);
|
|
4527
4544
|
},
|
|
4528
4545
|
emitEvent(event, capture) {
|
|
4529
4546
|
event.current = this;
|
|
4530
4547
|
this.emit(event.type, event, capture);
|
|
4531
4548
|
},
|
|
4532
4549
|
hasEvent(type, capture) {
|
|
4550
|
+
if (this.syncEventer && this.syncEventer.hasEvent(type, capture))
|
|
4551
|
+
return true;
|
|
4533
4552
|
const { __bubbleMap: b, __captureMap: c } = this;
|
|
4534
4553
|
const hasB = b && b[type], hasC = c && c[type];
|
|
4535
4554
|
return !!(capture === undefined ? (hasB || hasC) : (capture ? hasC : hasB));
|
package/lib/core.esm.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t={image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,suffix:"leaf",crossOrigin:"anonymous"}},e={},s={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=r;return e[t]?e[t]++:(e[t]=1,0)}},r=s,{round:i,pow:o,PI:n}=Math,a={within:(t,e,s)=>(t<e&&(t=e),t>s&&(t=s),t),minus(t,e){if(t instanceof Array){e&&(t=a.fourNumber(t,0));for(let e=0;e<t.length;e++)t[e]=-t[e]}else t=-t;return 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 r=t+s;if(e>1){const t=Math.abs(r%e);(t<1||t>e-1)&&(r=Math.round(r/e)*e)}return r-s},float(t,e){const s=e?o(10,e):1e12;return-0===(t=i(t*s)/s)?0:t}},h=n/180,l=2*n,d=n/2;function u(){return{x:0,y:0}}function c(){return{x:0,y:0,width:0,height:0}}function _(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:p,cos:f,acos:g,sqrt:y}=Math,{float:m}=a,x={};function w(){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:w(),tempMatrix:{},set(t,e=1,s=0,r=0,i=1,o=0,n=0){t.a=e,t.b=s,t.c=r,t.d=i,t.e=o,t.f=n},get:_,getWorld:w,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){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},scaleOfOuter(t,e,s,r){B.toInnerPoint(t,e,x),B.scaleOfInner(t,x,s,r)},scaleOfInner(t,e,s,r=s){B.translateInner(t,e.x,e.y),B.scale(t,s,r),B.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:r,c:i,d:o}=t,n=f(e*=h),a=p(e);t.a=s*n-r*a,t.b=s*a+r*n,t.c=i*n-o*a,t.d=i*a+o*n},rotateOfOuter(t,e,s){B.toInnerPoint(t,e,x),B.rotateOfInner(t,x,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:r,b:i,c:o,d:n}=t;s&&(s*=h,t.a=r+o*s,t.b=i+n*s),e&&(e*=h,t.c=o+r*e,t.d=n+i*e)},skewOfOuter(t,e,s,r){B.toInnerPoint(t,e,x),B.skewOfInner(t,x,s,r)},skewOfInner(t,e,s,r=0){B.translateInner(t,e.x,e.y),B.skew(t,s,r),B.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:r,c:i,d:o,e:n,f:a}=t;t.a=e.a*s+e.b*i,t.b=e.a*r+e.b*o,t.c=e.c*s+e.d*i,t.d=e.c*r+e.d*o,t.e=e.e*s+e.f*i+n,t.f=e.e*r+e.f*o+a},multiplyParent(t,e,s,r,i){const{e:o,f:n}=t;if(s||(s=t),void 0===r&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:r,b:o,c:n,d:a}=t;s.a=r*e.a+o*e.c,s.b=r*e.b+o*e.d,s.c=n*e.a+a*e.c,s.d=n*e.b+a*e.d,i&&(s.scaleX=e.scaleX*i.scaleX,s.scaleY=e.scaleY*i.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,i&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=o*e.a+n*e.c+e.e,s.f=o*e.b+n*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:r,d:i,e:o,f:n}=t;if(s||r){const a=1/(e*i-s*r);t.a=i*a,t.b=-s*a,t.c=-r*a,t.d=e*a,t.e=-(o*i-n*r)*a,t.f=-(n*e-o*s)*a}else if(1===e&&1===i)t.e=-o,t.f=-n;else{const s=1/(e*i);t.a=i*s,t.d=e*s,t.e=-o*i*s,t.f=-n*e*s}},toOuterPoint(t,e,s,r){const{x:i,y:o}=e;s||(s=e),s.x=i*t.a+o*t.c,s.y=i*t.b+o*t.d,r||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,r){const{a:i,b:o,c:n,d:a}=t,h=1/(i*a-o*n),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*n)*h,s.y=(d*i-l*o)*h,!r){const{e:e,f:r}=t;s.x-=(e*a-r*n)*h,s.y-=(r*i-e*o)*h}},setLayout(t,e,s,r){const{x:i,y:o,scaleX:n,scaleY:a}=e;if(void 0===r&&(r=e.rotation||e.skewX||e.skewY),r){const{rotation:s,skewX:r,skewY:i}=e,o=s*h,l=f(o),d=p(o);if(r||i){const e=r*h,s=i*h;t.a=(l+s*-d)*n,t.b=(d+s*l)*n,t.c=(e*l-d)*a,t.d=(l+e*d)*a}else t.a=l*n,t.b=d*n,t.c=-d*a,t.d=l*a}else t.a=n,t.b=0,t.c=0,t.d=a;t.e=i,t.f=o,s&&B.translateInner(t,-s.x,-s.y)},getLayout(t,e,s){const{a:r,b:i,c:o,d:n,e:a,f:l}=t;let u,c,_,x,w,b=a,B=l;if(i||o){const t=r*n-i*o;if(o&&!s){u=y(r*r+i*i),c=t/u;const e=r/u;_=i>0?g(e):-g(e)}else{c=y(o*o+n*n),u=t/c;const e=o/c;_=d-(n>0?g(-e):-g(e))}const e=m(f(_)),a=p(_);u=m(u),c=m(c),x=e?m((o/c+a)/e/h,9):0,w=e?m((i/u-a)/e/h,9):0,_=m(_/h)}else u=r,c=n,_=x=w=0;return e&&(b+=e.x*r+e.y*o,B+=e.x*i+e.y*n),{x:b,y:B,scaleX:u,scaleY:c,rotation:_,skewX:x,skewY:w}},withScale(t,e,s=e){const r=t;if(!e||!s){const{a:r,b:i,c:o,d:n}=t;i||o?s=(r*n-i*o)/(e=y(r*r+i*i)):(e=r,s=n)}return r.scaleX=e,r.scaleY=s,r},reset(t){B.set(t)}},B=b,{toInnerPoint:v,toOuterPoint:k}=b,{sin:C,cos:O,abs:T,sqrt:P,atan2:R,min:S,PI:L}=Math,I={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},move(t,e,s){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,r=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(r-1)},rotate(t,e,s){s||(s=A.defaultPoint);const r=O(e*=h),i=C(e),o=t.x-s.x,n=t.y-s.y;t.x=s.x+o*r-n*i,t.y=s.y+o*i+n*r},tempToInnerOf(t,e){const{tempPoint:s}=A;return W(s,t),v(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=A;return W(s,t),k(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=A;return W(s,t),A.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),v(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){v(e,t,s)},toOuterOf(t,e,s){k(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,r){const i=T(s-t),o=T(r-e);return P(i*i+o*o)},getMinDistanceFrom:(t,e,s,r,i,o)=>S(M(t,e,s,r),M(s,r,i,o)),getAngle:(t,e)=>E(t,e)/h,getRotation:(t,e,s,r)=>(r||(r=e),A.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,r.x,r.y)/h),getRadianFrom(t,e,s,r,i,o,n,a){void 0===n&&(n=s,a=r);let h=R(e-r,t-s);const d=R(o-a,i-n)-h;return d<-L?d+l:d},getAtan2:(t,e)=>R(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,r){const i=E(t,e);return(e=r?e:{}).x=t.x+O(i)*s,e.y=t.y+C(i)*s,e},reset(t){A.reset(t)}},A=I,{getDistanceFrom:M,copy:W,getAtan2:E}=A;class N{constructor(t,e){this.set(t,e)}set(t,e){return"object"==typeof t?I.copy(this,t):I.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new N(this)}move(t,e){return I.move(this,t,e),this}scale(t,e){return I.scale(this,t,e),this}scaleOf(t,e,s){return I.scaleOf(this,t,e,s),this}rotate(t,e){return I.rotate(this,t,e),this}rotateOf(t,e){return I.rotate(this,e,t),this}getRotation(t,e,s){return I.getRotation(this,t,e,s)}toInnerOf(t,e){return I.toInnerOf(this,t,e),this}toOuterOf(t,e){return I.toOuterOf(this,t,e),this}getCenter(t){return new N(I.getCenter(this,t))}getDistance(t){return I.getDistance(this,t)}getDistancePoint(t,e,s){return new N(I.getDistancePoint(this,t,e,s))}getAngle(t){return I.getAngle(this,t)}getAtan2(t){return I.getAtan2(this,t)}reset(){return I.reset(this),this}}const Y=new N;class X{constructor(t,e,s,r,i,o){this.set(t,e,s,r,i,o)}set(t,e,s,r,i,o){return"object"==typeof t?b.copy(this,t):b.set(this,t,e,s,r,i,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:r,e:i,f:o}=this;return{a:t,b:e,c:s,d:r,e:i,f:o}}clone(){return new X(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){return b.setLayout(this,t,e),this}getLayout(t,e){return b.getLayout(this,t,e)}withScale(t,e){return b.withScale(this,t,e)}reset(){b.reset(this)}}const D=new X,z={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,r,i){F(t,e,s),F(t,e+r,s+i)},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:F}=z,{tempPointBounds:j,setPoint:G,addPoint:q,toBounds:U}=z,{toOuterPoint:H}=b,{float:V,fourNumber:Q}=a,{floor:J,ceil:Z}=Math;let $,K,tt,et;const st={},rt={},it={tempBounds:{},set(t,e=0,s=0,r=0,i=0){t.x=e,t.y=s,t.width=r,t.height=i},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,r){if(s instanceof Array){const r=Q(s);ot.set(t,e.x-r[3],e.y-r[0],e.width+r[1]+r[3],e.height+r[2]+r[0])}else r||(r=s),ot.set(t,e.x-s,e.y-r,e.width+2*s,e.height+2*r)},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),ot.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?at(e,t):e=t,s?(e.offsetX=-(ot.maxX(s)-t.x),e.offsetY=-(ot.maxY(s)-t.y)):(e.offsetX=t.x+t.width,e.offsetY=t.y+t.height),ot.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e){I.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,r=s){I.scaleOf(t,e,s,r),t.width*=s,t.height*=r},tempToOuterOf:(t,e)=>(ot.copy(ot.tempBounds,t),ot.toOuterOf(ot.tempBounds,e),ot.tempBounds),getOuterOf:(t,e)=>(t=Object.assign({},t),ot.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:r,d:i}=e;r>0?(s.width=t.width*r,s.x=e.e+t.x*r):(s.width=t.width*-r,s.x=e.e+t.x*r-s.width),i>0?(s.height=t.height*i,s.y=e.f+t.y*i):(s.height=t.height*-i,s.y=e.f+t.y*i-s.height)}else st.x=t.x,st.y=t.y,H(e,st,rt),G(j,rt.x,rt.y),st.x=t.x+t.width,H(e,st,rt),q(j,rt.x,rt.y),st.y=t.y+t.height,H(e,st,rt),q(j,rt.x,rt.y),st.x=t.x,H(e,st,rt),q(j,rt.x,rt.y),U(j,s)},toInnerOf(t,e,s){s||(s=t),ot.move(s,-e.e,-e.f),ot.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const r=Math.min(s,Math.min(t.width/e.width,t.height/e.height));return new X(r,0,0,r,-e.x*r,-e.y*r)},getSpread(t,e,s){const r={};return ot.copyAndSpread(r,t,e,s),r},spread(t,e,s=e){ot.copyAndSpread(t,t,e,s)},ceil(t){const{x:e,y:s}=t;t.x=J(t.x),t.y=J(t.y),t.width=e>t.x?Z(t.width+e-t.x):Z(t.width),t.height=s>t.y?Z(t.height+s-t.y):Z(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=V(t.x,e),t.y=V(t.y,e),t.width=V(t.width,e),t.height=V(t.height,e)},add(t,e,s){$=t.x+t.width,K=t.y+t.height,tt=e.x,et=e.y,s||(tt+=e.width,et+=e.height),$=$>tt?$:tt,K=K>et?K:et,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=$-t.x,t.height=K-t.y},addList(t,e){ot.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){ot.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){ot.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,r=!1){let i,o=!0;for(let n=0,a=e.length;n<a;n++)i=s?s(e[n]):e[n],i&&(i.width||i.height)&&(o?(o=!1,r||at(t,i)):nt(t,i));o&&ot.reset(t)},setPoints(t,e){e.forEach(((t,e)=>0===e?G(j,t.x,t.y):q(j,t.x,t.y))),U(j,t)},addPoint(t,e){nt(t,e,!0)},getPoints(t){const{x:e,y:s,width:r,height:i}=t;return[{x:e,y:s},{x:e+r,y:s},{x:e+r,y:s+i},{x:e,y:s+i}]},hitRadiusPoint:(t,e,s)=>(s&&(e=I.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=I.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=ot.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=ot.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=ot.tempToOuterOf(e,s)),!ot.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:r,y:i,width:o,height:n}=e;return $=r+o,K=i+n,tt=t.x+t.width,et=t.y+t.height,r=r>t.x?r:t.x,i=i>t.y?i:t.y,$=$<tt?$:tt,K=K<et?K:et,o=$-r,n=K-i,{x:r,y:i,width:o,height:n}},intersect(t,e,s){ot.copy(t,ot.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){ot.set(t)}},ot=it,{add:nt,copy:at}=ot;class ht{get minX(){return it.minX(this)}get minY(){return it.minY(this)}get maxX(){return it.maxX(this)}get maxY(){return it.maxY(this)}constructor(t,e,s,r){this.set(t,e,s,r)}set(t,e,s,r){return"object"==typeof t?it.copy(this,t):it.set(this,t,e,s,r),this}get(){const{x:t,y:e,width:s,height:r}=this;return{x:t,y:e,width:s,height:r}}clone(){return new ht(this)}move(t,e){return it.move(this,t,e),this}scale(t,e){return it.scale(this,t,e),this}scaleOf(t,e,s){return it.scaleOf(this,t,e,s),this}toOuterOf(t,e){return it.toOuterOf(this,t,e),this}toInnerOf(t,e){return it.toInnerOf(this,t,e),this}getFitMatrix(t,e){return it.getFitMatrix(this,t,e)}spread(t,e){return it.spread(this,t,e),this}shrink(t){return it.spread(this,a.minus(t,!0)),this}ceil(){return it.ceil(this),this}unsign(){return it.unsign(this),this}float(t){return it.float(this,t),this}add(t){return it.add(this,t),this}addList(t){return it.setList(this,t,!0),this}setList(t){return it.setList(this,t),this}addListWithFn(t,e){return it.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return it.setListWithFn(this,t,e),this}setPoints(t){return it.setPoints(this,t),this}addPoint(t){return it.addPoint(this,t),this}getPoints(){return it.getPoints(this)}hitPoint(t,e){return it.hitPoint(this,t,e)}hitRadiusPoint(t,e){return it.hitRadiusPoint(this,t,e)}hit(t,e){return it.hit(this,t,e)}includes(t,e){return it.includes(this,t,e)}intersect(t,e){return it.intersect(this,t,e),this}getIntersect(t,e){return new ht(it.getIntersectData(this,t,e))}isSame(t){return it.isSame(this,t)}isEmpty(){return it.isEmpty(this)}reset(){it.reset(this)}}const lt=new ht;class dt{constructor(t,e,s,r,i,o){"object"==typeof t?this.copy(t):this.set(t,e,s,r,i,o)}set(t=0,e=0,s=0,r=0,i=0,o=0){this.top=t,this.right=e,this.bottom=s,this.left=r,this.width=i,this.height=o}copy(t){const{top:e,right:s,bottom:r,left:i,width:o,height:n}=t;this.set(e,s,r,i,o,n)}getBoundsFrom(t){const{top:e,right:s,bottom:r,left:i,width:o,height:n}=this;return new ht(i,e,o||t.width-i-s,n||t.height-e-r)}}var ut,ct;!function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"}(ut||(ut={})),function(t){t[t.topLeft=0]="topLeft",t[t.top=1]="top",t[t.topRight=2]="topRight",t[t.right=3]="right",t[t.bottomRight=4]="bottomRight",t[t.bottom=5]="bottom",t[t.bottomLeft=6]="bottomLeft",t[t.left=7]="left",t[t.center=8]="center"}(ct||(ct={}));const _t=[{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}],pt={directionData:_t,tempPoint:{},get:ft,toPoint(t,e,s,r){s||(s={});const i=ft(t);s.x=i.x*e.width,s.y=i.y*e.height,r||(s.x+=e.x,s.y+=e.y)}};function ft(t){return"string"==typeof t?_t[ct[t]]:t}const gt={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};class yt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new yt(t)}static set filter(t){this.filterList=mt(t)}static set exclude(t){this.excludeList=mt(t)}log(...t){if(xt.enable){if(xt.filterList.length&&xt.filterList.every((t=>t!==this.name)))return;if(xt.excludeList.length&&xt.excludeList.some((t=>t===this.name)))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){xt.enable&&this.warn(...t)}warn(...t){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 mt(t){return t?"string"==typeof t&&(t=[t]):t=[],t}yt.filterList=[],yt.excludeList=[];const xt=yt,wt=yt.get("RunTime"),bt={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const r=s.create(s.RUNTIME);return Bt.currentId=Bt.idMap[r]=e?performance.now():Date.now(),Bt.currentName=Bt.nameMap[r]=t,Bt.nameToIdMap[t]=r,r},end(t,e){const s=Bt.idMap[t],r=Bt.nameMap[t],i=e?(performance.now()-s)/1e3:Date.now()-s;Bt.idMap[t]=Bt.nameMap[t]=Bt.nameToIdMap[r]=void 0,wt.log(r,i,"ms")},endOfName(t,e){const s=Bt.nameToIdMap[t];void 0!==s&&Bt.end(s,e)}},Bt=bt,vt=yt.get("UICreator"),kt={list:{},register(t){const{__tag:e}=t.prototype;Ct[e]?vt.repeat(e):Ct[e]=t},get(t,e,s,r,i,o){const n=new Ct[t](e);return void 0!==s&&(n.x=s,r&&(n.y=r),i&&(n.width=i),o&&(n.height=o)),n}},{list:Ct}=kt,Ot=yt.get("EventCreator"),Tt={nameList:{},register(t){let e;Object.keys(t).forEach((s=>{e=t[s],"string"==typeof e&&(Pt[e]?Ot.repeat(e):Pt[e]=t)}))},changeName(t,e){const s=Pt[t];if(s){const r=Object.keys(s).find((e=>s[e]===t));r&&(s[r]=e,Pt[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new Pt[t](...e)},{nameList:Pt}=Tt;class Rt{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let s;const{list:r}=this;for(let e=0,i=r.length;e<i;e++)if(s=r[e],s.recycled&&s.isSameSize(t))return s.recycled=!1,s.manager||(s.manager=this),s;const i=e.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,r=this.list.length;s<r;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 St={default:(t,e)=>(Lt(e,t),Lt(t,e),t),assign(t,e){let s;Object.keys(e).forEach((r=>{var i;s=e[r],(null==s?void 0:s.constructor)===Object&&(null===(i=t[r])||void 0===i?void 0:i.constructor)===Object?Lt(t[r],e[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))},{assign:Lt}=St;class It{get __blendMode(){if(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 r in this)"_"!==r[0]&&(s=e?e[r]:void 0,t[r]=void 0===s?this[r]: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){const e={};if(t)if(t instanceof Array)for(let s of t)e[s]=this.__getInput(s);else for(let s in t)e[s]=this.__getInput(s);else{let t,s,{__input:r}=this;e.tag=this.__leaf.tag;for(let i in this)if("_"!==i[0]&&(t=this["_"+i],void 0!==t)){if("path"===i&&!this.__pathInputed)continue;s=r?r[i]:void 0,e[i]=void 0===s?t:s}}return e}__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||e.__hasEraser||t.eraser?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 At;!function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(At||(At={}));const Mt={};function Wt(t,e,s,r){var i,o=arguments.length,n=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(n=(o<3?i(n):o>3?i(e,s,n):i(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n}function Et(t,e,s,r){return new(s||(s=Promise))((function(i,o){function n(t){try{h(r.next(t))}catch(t){o(t)}}function a(t){try{h(r.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(n,a)}h((r=r.apply(t,e||[])).next())}))}function Nt(t){return(e,s)=>{t||(t=s),Object.defineProperty(e,s,{get(){return this.context[t]},set(e){this.context[t]=e}})}}"function"==typeof SuppressedError&&SuppressedError;const Yt=[];function Xt(){return(t,e)=>{Yt.push(e)}}const Dt=[];class zt{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||Dt)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;Yt.forEach((e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))})),this.textBaseline="alphabetic"}setTransform(t,e,s,r,i,o){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,r,i,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,r,i,o)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,r){}strokeRect(t,e,s,r){}clearRect(t,e,s,r){}drawImage(t,e,s,r,i,o,n,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/r*a;r+=e,e=0,o+=t,a-=t}if(s<0){const t=-s/i*h;i+=s,s=0,n+=t,h-=t}this.context.drawImage(t,e,s,r,i,o,n,a,h);break;case 5:this.context.drawImage(t,e,s,r,i);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,r,i,o){}quadraticCurveTo(t,e,s,r){}closePath(){}arc(t,e,s,r,i,o){}arcTo(t,e,s,r,i){}ellipse(t,e,s,r,i,o,n,a){}rect(t,e,s,r){}roundRect(t,e,s,r,i){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,r){}createPattern(t,e){}createRadialGradient(t,e,s,r,i,o){}fillText(t,e,s,r){}measureText(t){}strokeText(t,e,s,r){}destroy(){this.context=null}}Wt([Nt("imageSmoothingEnabled")],zt.prototype,"smooth",void 0),Wt([Nt("imageSmoothingQuality")],zt.prototype,"smoothLevel",void 0),Wt([Nt("globalAlpha")],zt.prototype,"opacity",void 0),Wt([Nt()],zt.prototype,"fillStyle",void 0),Wt([Nt()],zt.prototype,"strokeStyle",void 0),Wt([Nt("lineWidth")],zt.prototype,"strokeWidth",void 0),Wt([Nt("lineCap")],zt.prototype,"strokeCap",void 0),Wt([Nt("lineJoin")],zt.prototype,"strokeJoin",void 0),Wt([Nt("lineDashOffset")],zt.prototype,"dashOffset",void 0),Wt([Nt()],zt.prototype,"miterLimit",void 0),Wt([Nt()],zt.prototype,"shadowBlur",void 0),Wt([Nt()],zt.prototype,"shadowColor",void 0),Wt([Nt()],zt.prototype,"shadowOffsetX",void 0),Wt([Nt()],zt.prototype,"shadowOffsetY",void 0),Wt([Nt()],zt.prototype,"filter",void 0),Wt([Nt()],zt.prototype,"font",void 0),Wt([Nt()],zt.prototype,"fontKerning",void 0),Wt([Nt()],zt.prototype,"fontStretch",void 0),Wt([Nt()],zt.prototype,"fontVariantCaps",void 0),Wt([Nt()],zt.prototype,"textAlign",void 0),Wt([Nt()],zt.prototype,"textBaseline",void 0),Wt([Nt()],zt.prototype,"textRendering",void 0),Wt([Nt()],zt.prototype,"wordSpacing",void 0),Wt([Nt()],zt.prototype,"letterSpacing",void 0),Wt([Nt()],zt.prototype,"direction",void 0),Wt([Xt()],zt.prototype,"setTransform",null),Wt([Xt()],zt.prototype,"resetTransform",null),Wt([Xt()],zt.prototype,"getTransform",null),Wt([Xt()],zt.prototype,"save",null),Wt([Xt()],zt.prototype,"restore",null),Wt([Xt()],zt.prototype,"translate",null),Wt([Xt()],zt.prototype,"scale",null),Wt([Xt()],zt.prototype,"rotate",null),Wt([Xt()],zt.prototype,"fill",null),Wt([Xt()],zt.prototype,"stroke",null),Wt([Xt()],zt.prototype,"clip",null),Wt([Xt()],zt.prototype,"fillRect",null),Wt([Xt()],zt.prototype,"strokeRect",null),Wt([Xt()],zt.prototype,"clearRect",null),Wt([Xt()],zt.prototype,"beginPath",null),Wt([Xt()],zt.prototype,"moveTo",null),Wt([Xt()],zt.prototype,"lineTo",null),Wt([Xt()],zt.prototype,"bezierCurveTo",null),Wt([Xt()],zt.prototype,"quadraticCurveTo",null),Wt([Xt()],zt.prototype,"closePath",null),Wt([Xt()],zt.prototype,"arc",null),Wt([Xt()],zt.prototype,"arcTo",null),Wt([Xt()],zt.prototype,"ellipse",null),Wt([Xt()],zt.prototype,"rect",null),Wt([Xt()],zt.prototype,"roundRect",null),Wt([Xt()],zt.prototype,"createConicGradient",null),Wt([Xt()],zt.prototype,"createLinearGradient",null),Wt([Xt()],zt.prototype,"createPattern",null),Wt([Xt()],zt.prototype,"createRadialGradient",null),Wt([Xt()],zt.prototype,"fillText",null),Wt([Xt()],zt.prototype,"measureText",null),Wt([Xt()],zt.prototype,"strokeText",null);const{copy:Ft}=b,jt={width:1,height:1,pixelRatio:1},Gt=["width","height","pixelRatio"];class qt extends zt{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}get pixelHeight(){return this.height*this.pixelRatio}get allowBackgroundColor(){return this.view&&this.parentView}constructor(e,r){super(),this.size={},this.worldTransform={},e||(e=jt),e.pixelRatio||(e.pixelRatio=t.devicePixelRatio),this.manager=r,this.innerId=s.create(s.CNAVAS);const{width:i,height:o,pixelRatio:n}=e;this.autoLayout=!i||!o,this.size.pixelRatio=n,this.config=e,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){if(this.isSameSize(t))return;let e;this.context&&!this.unreal&&this.width&&(e=this.getSameCanvas(),e.copyWorld(this)),St.copyAttrs(this.size,t,Gt),this.size.pixelRatio||(this.size.pixelRatio=1),this.bounds=new ht(0,0,this.width,this.height),this.unreal||(this.updateViewSize(),this.smooth=this.config.smooth),this.updateClientBounds(),this.context&&!this.unreal&&e&&(this.clearWorld(e.bounds),this.copyWorld(e),e.recycle())}updateViewSize(){}updateClientBounds(){}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s}=this,r=this.worldTransform;if(e){const{a:i,b:o,c:n,d:a,e:h,f:l}=e;this.setTransform(r.a=(t.a*i+t.b*n)*s,r.b=(t.a*o+t.b*a)*s,r.c=(t.c*i+t.d*n)*s,r.d=(t.c*o+t.d*a)*s,r.e=(t.e*i+t.f*n+h)*s,r.f=(t.e*o+t.f*a+l)*s)}else this.setTransform(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)}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){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s)}setStrokeOptions(t){this.strokeCap="none"===t.strokeCap?"butt":t.strokeCap,this.strokeJoin=t.strokeJoin,this.dashPattern=t.dashPattern,this.dashOffset=t.dashOffset,this.miterLimit=t.miterLimit}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,r){const{pixelRatio:i}=this;this.shadowOffsetX=t*i,this.shadowOffsetY=e*i,this.shadowBlur=s*i,this.shadowColor=r||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,r){if(r&&(this.blendMode=r),e){const{pixelRatio:r}=this;s||(s=e),this.drawImage(t.view,e.x*r,e.y*r,e.width*r,e.height*r,s.x*r,s.y*r,s.width*r,s.height*r)}else this.drawImage(t.view,0,0);r&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,r){if(r&&(this.blendMode=r),e.b||e.c)this.save(),this.resetTransform(),this.copyWorld(t,e,it.tempToOuterOf(s,e)),this.restore();else{const{pixelRatio:r}=this;this.drawImage(t.view,e.x*r,e.y*r,e.width*r,e.height*r,s.x,s.y,s.width,s.height)}r&&(this.blendMode="source-over")}copyWorldByReset(t,e,s,r,i){this.resetTransform(),this.copyWorld(t,e,s,r),i||this.useWorldTransform()}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,lt.set(t).scale(this.pixelRatio),this.fillRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s){s&&(this.blendMode=s),this.strokeStyle=e,lt.set(t).scale(this.pixelRatio),this.strokeRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}clearWorld(t,e){lt.set(t).scale(this.pixelRatio),e&<.ceil(),this.clearRect(lt.x,lt.y,lt.width,lt.height)}clipWorld(t,e){this.beginPath(),lt.set(t).scale(this.pixelRatio),e&<.ceil(),this.rect(lt.x,lt.y,lt.width,lt.height),this.clip()}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t,this.height*t)}isSameSize(t){return this.width===t.width&&this.height===t.height&&this.pixelRatio===t.pixelRatio}getSameCanvas(t,s){const r=this.manager?this.manager.get(this.size):e.canvas(Object.assign({},this.size));return r.save(),t&&(Ft(r.worldTransform,this.worldTransform),r.useWorldTransform()),s&&(r.smooth=this.smooth),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t,!0):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}}const Ut={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Ht={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Vt=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},Ht),Qt={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},Jt={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},Zt=Object.assign(Object.assign({},Jt),Ht),$t=Vt,Kt={};for(let t in $t)Kt[$t[t]]=t;const te={};for(let t in $t)te[$t[t]]=Qt[t];const ee={drawRoundRect(t,e,s,r,i,o){const n=a.fourNumber(o,Math.min(r/2,i/2)),h=e+r,l=s+i;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:se,cos:re,atan2:ie,ceil:oe,abs:ne,PI:ae,sqrt:he,pow:le}=Math,{setPoint:de,addPoint:ue}=z,{set:ce}=I,{M:_e,L:pe,C:fe,Q:ge,Z:ye}=Vt,me={},xe={points(t,e,s,r){if(t.push(_e,e[0],e[1]),s&&e.length>5){let i,o,n,a,h,l,d,u,c,_,p,f,g,y=e.length;const m=!0===s?.5:s;r&&(y=(e=[e[y-2],e[y-1],...e,e[0],e[1],e[2],e[3]]).length);for(let s=2;s<y-2;s+=2)i=e[s-2],o=e[s-1],n=e[s],a=e[s+1],h=e[s+2],l=e[s+3],p=he(le(n-i,2)+le(a-o,2)),f=he(le(h-n,2)+le(l-a,2)),g=p+f,p=m*p/g,f=m*f/g,h-=i,l-=o,d=n-p*h,u=a-p*l,2===s?r||t.push(ge,d,u,n,a):t.push(fe,c,_,d,u,n,a),c=n+f*h,_=a+f*l;r||t.push(ge,c,_,e[y-2],e[y-1])}else for(let s=2,r=e.length;s<r;s+=2)t.push(pe,e[s],e[s+1]);r&&t.push(ye)},rect(t,e,s,r,i){Ut.creator.path=t,Ut.creator.moveTo(e,s).lineTo(e+r,s).lineTo(e+r,s+i).lineTo(e,s+i).lineTo(e,s)},roundRect(t,e,s,r,i,o){Ut.creator.path=[],ee.drawRoundRect(Ut.creator,e,s,r,i,o),t.push(...Ut.convertToCanvasData(Ut.creator.path,!0))},arcTo(t,e,s,r,i,o,n,a,u,c,_){const p=r-e,f=i-s,g=o-r,y=n-i;let m=ie(f,p),x=ie(y,g),w=x-m;if(w<0&&(w+=l),w===ae||ne(p+f)<1e-12||ne(g+y)<1e-12)return t&&t.push(pe,r,i),u&&(de(u,e,s),ue(u,r,i)),_&&ce(_,e,s),void(c&&ce(c,r,i));const b=p*y-g*f<0,B=b?-1:1,v=a/re(w/2),k=r+v*re(m+w/2+d*B),C=i+v*se(m+w/2+d*B);return m-=d*B,x-=d*B,Be(t,k,C,a,a,0,m/h,x/h,b,u,c,_)},arc:(t,e,s,r,i,o,n,a,h,l)=>Be(t,e,s,r,r,0,i,o,n,a,h,l),ellipse(t,e,s,r,i,o,n,a,u,c,_,p){const f=o*h,g=se(f),y=re(f);let m=n*h,x=a*h;m>ae&&(m-=l),x<0&&(x+=l);let w=x-m;w<0?w+=l:w>l&&(w-=l),u&&(w-=l);const b=oe(ne(w/d)),B=w/b,v=se(B/4),k=8/3*v*v/se(B/2);x=m+B;let C,O,T,P,R,S,L,I,A=re(m),M=se(m),W=T=y*r*A-g*i*M,E=P=g*r*A+y*i*M,N=e+T,Y=s+P;t&&t.push(pe,N,Y),c&&de(c,N,Y),p&&ce(p,N,Y);for(let o=0;o<b;o++)C=re(x),O=se(x),T=y*r*C-g*i*O,P=g*r*C+y*i*O,R=e+W-k*(y*r*M+g*i*A),S=s+E-k*(g*r*M-y*i*A),L=e+T+k*(y*r*O+g*i*C),I=s+P+k*(g*r*O-y*i*C),t&&t.push(fe,R,S,L,I,e+T,s+P),c&&be(e+W,s+E,R,S,L,I,e+T,s+P,c,!0),W=T,E=P,A=C,M=O,m=x,x+=B;_&&ce(_,e+T,s+P)},quadraticCurveTo(t,e,s,r,i,o,n){t.push(fe,(e+2*r)/3,(s+2*i)/3,(o+2*r)/3,(n+2*i)/3,o,n)},toTwoPointBoundsByQuadraticCurve(t,e,s,r,i,o,n,a){be(t,e,(t+2*s)/3,(e+2*r)/3,(i+2*s)/3,(o+2*r)/3,i,o,n,a)},toTwoPointBounds(t,e,s,r,i,o,n,a,h,l){const d=[];let u,c,_,p,f,g,y,m,x=t,w=s,b=i,B=n;for(let t=0;t<2;++t)if(1==t&&(x=e,w=r,b=o,B=a),u=-3*x+9*w-9*b+3*B,c=6*x-12*w+6*b,_=3*w-3*x,Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;p=-_/c,0<p&&p<1&&d.push(p)}else y=c*c-4*_*u,m=Math.sqrt(y),y<0||(f=(-c+m)/(2*u),0<f&&f<1&&d.push(f),g=(-c-m)/(2*u),0<g&&g<1&&d.push(g));l?ue(h,t,e):de(h,t,e),ue(h,n,a);for(let l=0,u=d.length;l<u;l++)we(d[l],t,e,s,r,i,o,n,a,me),ue(h,me.x,me.y)},getPointAndSet(t,e,s,r,i,o,n,a,h,l){const d=1-t,u=d*d*d,c=3*d*d*t,_=3*d*t*t,p=t*t*t;l.x=u*e+c*r+_*o+p*a,l.y=u*s+c*i+_*n+p*h},getPoint(t,e,s,r,i,o,n,a,h){const l={};return we(t,e,s,r,i,o,n,a,h,l),l}},{getPointAndSet:we,toTwoPointBounds:be,ellipse:Be}=xe,{sin:ve,cos:ke,sqrt:Ce,atan2:Oe}=Math,{ellipse:Te}=xe,Pe={ellipticalArc(e,s,r,i,o,n,a,d,u,c,_){const p=(u-s)/2,f=(c-r)/2,g=n*h,y=ve(g),m=ke(g),x=-m*p-y*f,w=-m*f+y*p,b=i*i,B=o*o,v=w*w,k=x*x,C=b*B-b*v-B*k;let O=0;if(C<0){const t=Ce(1-C/(b*B));i*=t,o*=t}else O=(a===d?-1:1)*Ce(C/(b*v+B*k));const T=O*i*w/o,P=-O*o*x/i,R=Oe((w-P)/o,(x-T)/i),S=Oe((-w-P)/o,(-x-T)/i);let L=S-R;0===d&&L>0?L-=l:1===d&&L<0&&(L+=l);const I=s+p+m*T-y*P,A=r+f+y*T+m*P,M=L<0?1:0;_||t.ellipseToCurve?Te(e,I,A,i,o,n,R/h,S/h,M):i!==o||n?e.push(Vt.G,I,A,i,o,n,R/h,S/h,M):e.push(Vt.O,I,A,i,R/h,S/h,M)}},{M:Re,m:Se,L:Le,l:Ie,H:Ae,h:Me,V:We,v:Ee,C:Ne,c:Ye,S:Xe,s:De,Q:ze,q:Fe,T:je,t:Ge,A:qe,a:Ue,Z:He,z:Ve,N:Qe,D:Je,X:Ze,G:$e,F:Ke,O:ts,P:es,U:ss}=Vt,{rect:rs,roundRect:is,arcTo:os,arc:ns,ellipse:as,quadraticCurveTo:hs}=xe,{ellipticalArc:ls}=Pe,ds=yt.get("PathConvert"),us={},cs={current:{dot:0},stringify(t,e){let s,r,i,o=0,n=t.length,h="";for(;o<n;){r=t[o],s=te[r],h+=r===i?" ":Kt[r];for(let r=1;r<s;r++)h+=a.float(t[o+r],e),r===s-1||(h+=" ");i=r,o+=s}return h},parse(t,e){let s,r,i,o="";const n=[],a=e?Zt:Jt;for(let e=0,h=t.length;e<h;e++)r=t[e],gt[r]?("."===r&&(_s.dot++,_s.dot>1&&(ps(n,o),o="")),o+=r):Vt[r]?(o&&(ps(n,o),o=""),_s.name=Vt[r],_s.length=Qt[r],_s.index=0,ps(n,_s.name),!s&&a[r]&&(s=!0)):"-"===r||"+"===r?"e"===i||"E"===i?o+=r:(o&&ps(n,o),o=r):o&&(ps(n,o),o=""),i=r;return o&&ps(n,o),s?cs.toCanvasData(n,e):n},toCanvasData(t,e){let s,r,i,o,n,a=0,h=0,l=0,d=0,u=0,c=t.length;const _=[];for(;u<c;){switch(i=t[u],i){case Se:t[u+1]+=a,t[u+2]+=h;case Re:a=t[u+1],h=t[u+2],_.push(Re,a,h),u+=3;break;case Me:t[u+1]+=a;case Ae:a=t[u+1],_.push(Le,a,h),u+=2;break;case Ee:t[u+1]+=h;case We:h=t[u+1],_.push(Le,a,h),u+=2;break;case Ie:t[u+1]+=a,t[u+2]+=h;case Le:a=t[u+1],h=t[u+2],_.push(Le,a,h),u+=3;break;case De:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=Xe;case Xe:n=o===Ne||o===Xe,l=n?2*a-s:t[u+1],d=n?2*h-r:t[u+2],s=t[u+1],r=t[u+2],a=t[u+3],h=t[u+4],_.push(Ne,l,d,s,r,a,h),u+=5;break;case Ye:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,t[u+5]+=a,t[u+6]+=h,i=Ne;case Ne:s=t[u+3],r=t[u+4],a=t[u+5],h=t[u+6],_.push(Ne,t[u+1],t[u+2],s,r,a,h),u+=7;break;case Ge:t[u+1]+=a,t[u+2]+=h,i=je;case je:n=o===ze||o===je,s=n?2*a-s:t[u+1],r=n?2*h-r:t[u+2],e?hs(_,a,h,s,r,t[u+1],t[u+2]):_.push(ze,s,r,t[u+1],t[u+2]),a=t[u+1],h=t[u+2],u+=3;break;case Fe:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=ze;case ze:s=t[u+1],r=t[u+2],e?hs(_,a,h,s,r,t[u+3],t[u+4]):_.push(ze,s,r,t[u+3],t[u+4]),a=t[u+3],h=t[u+4],u+=5;break;case Ue:t[u+6]+=a,t[u+7]+=h;case qe:ls(_,a,h,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],e),a=t[u+6],h=t[u+7],u+=8;break;case Ve:case He:_.push(He),u++;break;case Qe:a=t[u+1],h=t[u+2],e?rs(_,a,h,t[u+3],t[u+4]):fs(_,t,u,5),u+=5;break;case Je:a=t[u+1],h=t[u+2],e?is(_,a,h,t[u+3],t[u+4],[t[u+5],t[u+6],t[u+7],t[u+8]]):fs(_,t,u,9),u+=9;break;case Ze:a=t[u+1],h=t[u+2],e?is(_,a,h,t[u+3],t[u+4],t[u+5]):fs(_,t,u,6),u+=6;break;case $e:as(e?_:fs(_,t,u,9),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],t[u+8],null,us),a=us.x,h=us.y,u+=9;break;case Ke:e?as(_,t[u+1],t[u+2],t[u+3],t[u+4],0,0,360,!1):fs(_,t,u,5),a=t[u+1]+t[u+3],h=t[u+2],u+=5;break;case ts:ns(e?_:fs(_,t,u,7),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],null,us),a=us.x,h=us.y,u+=7;break;case es:e?ns(_,t[u+1],t[u+2],t[u+3],0,360,!1):fs(_,t,u,4),a=t[u+1]+t[u+3],h=t[u+2],u+=4;break;case ss:os(e?_:fs(_,t,u,6),a,h,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],null,us),a=us.x,h=us.y,u+=6;break;default:return ds.error(`command: ${i} [index:${u}]`,t),_}o=i}return _},copyData(t,e,s,r){for(let i=s,o=s+r;i<o;i++)t.push(e[i])},pushData(t,e){_s.index===_s.length&&(_s.index=1,t.push(_s.name)),t.push(Number(e)),_s.index++,_s.dot=0}},{current:_s,pushData:ps,copyData:fs}=cs,{M:gs,L:ys,C:ms,Q:xs,Z:ws,N:bs,D:Bs,X:vs,G:ks,F:Cs,O:Os,P:Ts,U:Ps}=Vt,{getMinDistanceFrom:Rs,getRadianFrom:Ss}=I,{tan:Ls,min:Is,abs:As}=Math,Ms={},Ws={beginPath(t){t.length=0},moveTo(t,e,s){t.push(gs,e,s)},lineTo(t,e,s){t.push(ys,e,s)},bezierCurveTo(t,e,s,r,i,o,n){t.push(ms,e,s,r,i,o,n)},quadraticCurveTo(t,e,s,r,i){t.push(xs,e,s,r,i)},closePath(t){t.push(ws)},rect(t,e,s,r,i){t.push(bs,e,s,r,i)},roundRect(t,e,s,r,i,o){if("number"==typeof o)t.push(vs,e,s,r,i,o);else{const n=a.fourNumber(o);n?t.push(Bs,e,s,r,i,...n):t.push(bs,e,s,r,i)}},ellipse(t,e,s,r,i,o,n,a,h){void 0===o?t.push(Cs,e,s,r,i):(void 0===n&&(n=0),void 0===a&&(a=360),t.push(ks,e,s,r,i,o,n,a,h?1:0))},arc(t,e,s,r,i,o,n){void 0===i?t.push(Ts,e,s,r):(void 0===o&&(o=360),t.push(Os,e,s,r,i,o,n?1:0))},arcTo(t,e,s,r,i,o,n,a){if(void 0!==n){const h=Ls(Ss(n,a,e,s,r,i)/2)*(Rs(n,a,e,s,r,i)/2);t.push(Ps,e,s,r,i,Is(o,As(h)))}else t.push(Ps,e,s,r,i,o)},drawEllipse(t,e,s,r,i,o,n,a,h){xe.ellipse(null,e,s,r,i,void 0===o?0:o,void 0===n?0:n,void 0===a?360:a,h,null,null,Ms),t.push(gs,Ms.x,Ms.y),Es(t,e,s,r,i,o,n,a,h)},drawArc(t,e,s,r,i,o,n){xe.arc(null,e,s,r,void 0===i?0:i,void 0===o?360:o,n,null,null,Ms),t.push(gs,Ms.x,Ms.y),Ns(t,e,s,r,i,o,n)},drawPoints(t,e,s,r){xe.points(t,e,s,r)}},{ellipse:Es,arc:Ns}=Ws,{moveTo:Ys,lineTo:Xs,quadraticCurveTo:Ds,bezierCurveTo:zs,closePath:Fs,beginPath:js,rect:Gs,roundRect:qs,ellipse:Us,arc:Hs,arcTo:Vs,drawEllipse:Qs,drawArc:Js,drawPoints:Zs}=Ws;class $s{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.clearPath=this.beginPath,this.set(t)}set(t){return this.__path=t?"string"==typeof t?Ut.parse(t):t:[],this}beginPath(){return js(this.__path),this}moveTo(t,e){return Ys(this.__path,t,e),this}lineTo(t,e){return Xs(this.__path,t,e),this}bezierCurveTo(t,e,s,r,i,o){return zs(this.__path,t,e,s,r,i,o),this}quadraticCurveTo(t,e,s,r){return Ds(this.__path,t,e,s,r),this}closePath(){return Fs(this.__path),this}rect(t,e,s,r){return Gs(this.__path,t,e,s,r),this}roundRect(t,e,s,r,i){return qs(this.__path,t,e,s,r,i),this}ellipse(t,e,s,r,i,o,n,a){return Us(this.__path,t,e,s,r,i,o,n,a),this}arc(t,e,s,r,i,o){return Hs(this.__path,t,e,s,r,i,o),this}arcTo(t,e,s,r,i){return Vs(this.__path,t,e,s,r,i),this}drawEllipse(t,e,s,r,i,o,n,a){return Qs(this.__path,t,e,s,r,i,o,n,a),this}drawArc(t,e,s,r,i,o){return Js(this.__path,t,e,s,r,i,o),this}drawPoints(t,e,s){return Zs(this.__path,t,e,s),this}}const{M:Ks,L:tr,C:er,Q:sr,Z:rr,N:ir,D:or,X:nr,G:ar,F:hr,O:lr,P:dr,U:ur}=Vt,cr=yt.get("PathDrawer"),_r={drawPathByData(t,e){if(!e)return;let s,r=0,i=e.length;for(;r<i;)switch(s=e[r],s){case Ks:t.moveTo(e[r+1],e[r+2]),r+=3;break;case tr:t.lineTo(e[r+1],e[r+2]),r+=3;break;case er:t.bezierCurveTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5],e[r+6]),r+=7;break;case sr:t.quadraticCurveTo(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case rr:t.closePath(),r+=1;break;case ir:t.rect(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case or:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],[e[r+5],e[r+6],e[r+7],e[r+8]]),r+=9;break;case nr:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;case ar:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]*h,e[r+6]*h,e[r+7]*h,e[r+8]),r+=9;break;case hr:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],0,0,l,!1),r+=5;break;case lr:t.arc(e[r+1],e[r+2],e[r+3],e[r+4]*h,e[r+5]*h,e[r+6]),r+=7;break;case dr:t.arc(e[r+1],e[r+2],e[r+3],0,l,!1),r+=4;break;case ur:t.arcTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;default:return void cr.error(`command: ${s} [index:${r}]`,e)}}},{M:pr,L:fr,C:gr,Q:yr,Z:mr,N:xr,D:wr,X:br,G:Br,F:vr,O:kr,P:Cr,U:Or}=Vt,{toTwoPointBounds:Tr,toTwoPointBoundsByQuadraticCurve:Pr,arcTo:Rr,arc:Sr,ellipse:Lr}=xe,{addPointBounds:Ir,copy:Ar,addPoint:Mr,setPoint:Wr,addBounds:Er,toBounds:Nr}=z,Yr=yt.get("PathBounds");let Xr,Dr,zr;const Fr={},jr={},Gr={},qr={toBounds(t,e){qr.toTwoPointBounds(t,jr),Nr(jr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Wr(e,0,0);let s,r,i,o,n,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(s=t[a],0===a&&(s===mr||s===gr||s===yr?Wr(e,h,l):Wr(e,t[a+1],t[a+2])),s){case pr:case fr:h=t[a+1],l=t[a+2],Mr(e,h,l),a+=3;break;case gr:o=t[a+5],n=t[a+6],Tr(h,l,t[a+1],t[a+2],t[a+3],t[a+4],o,n,Fr),Ir(e,Fr),h=o,l=n,a+=7;break;case yr:r=t[a+1],i=t[a+2],o=t[a+3],n=t[a+4],Pr(h,l,r,i,o,n,Fr),Ir(e,Fr),h=o,l=n,a+=5;break;case mr:a+=1;break;case xr:h=t[a+1],l=t[a+2],Er(e,h,l,t[a+3],t[a+4]),a+=5;break;case wr:case br:h=t[a+1],l=t[a+2],Er(e,h,l,t[a+3],t[a+4]),a+=s===wr?9:6;break;case Br:Lr(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],Fr,Gr),0===a?Ar(e,Fr):Ir(e,Fr),h=Gr.x,l=Gr.y,a+=9;break;case vr:h=t[a+1],l=t[a+2],Dr=t[a+3],zr=t[a+4],Er(e,h-Dr,l-zr,2*Dr,2*zr),h+=Dr,a+=5;break;case kr:Sr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Fr,Gr),0===a?Ar(e,Fr):Ir(e,Fr),h=Gr.x,l=Gr.y,a+=7;break;case Cr:h=t[a+1],l=t[a+2],Xr=t[a+3],Er(e,h-Xr,l-Xr,2*Xr,2*Xr),h+=Xr,a+=4;break;case Or:Rr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Fr,Gr),0===a?Ar(e,Fr):Ir(e,Fr),h=Gr.x,l=Gr.y,a+=6;break;default:return void Yr.error(`command: ${s} [index:${a}]`,t)}}},{M:Ur,L:Hr,C:Vr,Z:Qr}=Vt,{getCenterX:Jr,getCenterY:Zr}=I,{arcTo:$r}=Ws,Kr={smooth(t,e,s){let r,i=0,o=0,n=0,a=0,h=0,l=0,d=0,u=0,c=0;const _=t.length,p=[];for(;i<_;)switch(r=t[i],r){case Ur:a=u=t[i+1],h=c=t[i+2],i+=3,t[i]===Hr?(l=t[i+1],d=t[i+2],p.push(Ur,Jr(a,l),Zr(h,d))):p.push(Ur,a,h);break;case Hr:switch(o=t[i+1],n=t[i+2],i+=3,t[i]){case Hr:$r(p,o,n,t[i+1],t[i+2],e,u,c);break;case Qr:$r(p,o,n,a,h,e,u,c);break;default:p.push(Hr,o,n)}u=o,c=n;break;case Vr:p.push(Vr,t[i+1],t[i+2],t[i+3],t[i+4],t[i+5],t[i+6]),i+=7;break;case Qr:$r(p,a,h,l,d,e,u,c),p.push(Qr),i+=1}return r!==Qr&&(p[1]=a,p[2]=h),p}};Ut.creator=new $s,Ut.parse=cs.parse,Ut.convertToCanvasData=cs.toCanvasData;const ti=new $s,{drawRoundRect:ei}=ee;function si(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,r,i){ei(this,t,e,s,r,i)})}(t)}const ri={opacityTypes:["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=ii.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{}}}},ii=ri;ii.opacityTypes.forEach((t=>ii.upperCaseTypeMap[t]=t.toUpperCase()));const oi=yt.get("TaskProcessor");class ni{constructor(t){this.parallel=!0,this.time=1,this.id=s.create(s.TASK),this.task=t}run(){return Et(this,void 0,void 0,(function*(){try{this.task&&!this.isComplete&&this.parent.running&&(yield this.task())}catch(t){oi.error(t)}}))}complete(){this.isComplete=!0,this.parent=null,this.task=null}cancel(){this.isCancel=!0,this.complete()}}class ai{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 r=0;r<t;r++)r<=this.finishedIndex?(s+=this.list[r].time,r===this.finishedIndex&&(e=s)):e+=this.list[r].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&&St.assign(this.config,t),this.empty()}add(t,e){let s,r,i,o;const n=new ni(t);return n.parent=this,"number"==typeof e?o=e:e&&(r=e.parallel,s=e.start,i=e.time,o=e.delay),i&&(n.time=i),!1===r&&(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,r=this.finishedIndex+s;if(e.length){if(!this.running)return;r<this.total&&(t=this.list[r],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 hi={map:{},recycledList:[],tasker:new ai,patternTasker:new ai,get isComplete(){return li.tasker.isComplete},get(t){let s=li.map[t.url];return s||(s=e.image(t),li.map[t.url]=s),s.use++,s},recycle(t){t.use--,setTimeout((()=>{t.use||li.recycledList.push(t)}))},clearRecycled(){const t=li.recycledList;t.length>100&&(t.forEach((t=>{!t.use&&t.url&&(delete li.map[t.url],t.destroy())})),t.length=0)},hasOpacityPixel:t=>ri.opacityTypes.some((e=>li.isFormat(e,t))),isFormat(t,e){if(e.format===t)return!0;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+ri.mineType(t)))return!0}else if(s.includes("."+t)||s.includes("."+ri.upperCaseTypeMap[t]))return!0;return!1},destroy(){li.map={},li.recycledList=[]}},li=hi,{IMAGE:di,create:ui}=s;class ci{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){this.use=0,this.waitComplete=[],this.innerId=ui(di),this.config=t||{url:""},this.isSVG=hi.isFormat("svg",t),this.hasOpacityPixel=hi.hasOpacityPixel(t)}load(e,s){return this.loading||(this.loading=!0,hi.tasker.add((()=>Et(this,void 0,void 0,(function*(){return yield t.origin.loadImage(this.url).then((t=>{this.ready=!0,this.width=t.naturalWidth||t.width,this.height=t.naturalHeight||t.height,this.view=t,this.onComplete(!0)})).catch((t=>{this.error=t,this.onComplete(!1)}))}))))),this.waitComplete.push(e,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}onComplete(t){let e;this.waitComplete.forEach(((s,r)=>{e=r%2,s&&(t?e||s(this):e&&s(this.error))})),this.waitComplete.length=0,this.loading=!1}getCanvas(e,s,r,i){if(e||(e=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=t.origin.createCanvas(e,s),n=o.getContext("2d");return r&&(n.globalAlpha=r),n.drawImage(this.view,0,0,e,s),this.cache=this.use>1?{data:o,params:arguments}:null,o}getPattern(e,s,r,i){const o=t.canvas.createPattern(e,s);try{r&&o.setTransform&&(o.setTransform(r),r=null)}catch(t){}return i&&(i.transform=r),o}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}}function _i(t,e,s){Object.defineProperty(t,e,s)}function pi(t,e){return Object.getOwnPropertyDescriptor(t,e)}function fi(t,e){return(s,r)=>yi(s,r,t,e&&e(r))}function gi(t){return t}function yi(t,e,s,r){const i={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)},configurable:!0,enumerable:!0};_i(t,e,Object.assign(i,r||{})),zi(t,e,s)}function mi(t){return fi(t)}function xi(t,e){return fi(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.matrixChanged||this.__layout.matrixChange()}})))}function wi(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.matrixChanged||this.__layout.matrixChange(),this.__hasAutoLayout=!!e,this.__local||this.__layout.createLocal()}})))}function bi(t,e){return fi(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.scaleChanged||this.__layout.scaleChange()}})))}function Bi(t,e){return fi(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.rotationChanged||this.__layout.rotationChange()}})))}function vi(t,e){return fi(t,(t=>({set(s){this.__setAttr(t,s,e)&&Ci(this)}})))}function ki(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),Ci(this),this.__.__removeNaturalSize()}})))}function Ci(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function Oi(t){return fi(t,(t=>({set(e){2!==this.__.__pathInputed&&(this.__.__pathInputed=e?1:0),this.__setAttr(t,e),Ci(this)}})))}const Ti=vi;function Pi(t){return fi(t,(t=>({set(e){this.__setAttr(t,e)&&Ri(this)}})))}function Ri(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&Ci(t)}const Si=Pi;function Li(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}})))}function Ii(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.surfaceChanged||this.__layout.surfaceChange()}})))}function Ai(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.opacityChanged||this.__layout.opacityChange()}})))}function Mi(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.surfaceChanged||this.__layout.surfaceChange(),this.waitParent((()=>{this.parent.__layout.childrenSortChange()}))}})))}function Wi(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent((()=>{this.parent.__updateMask(e)}))}})))}function Ei(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.waitParent((()=>{this.parent.__updateEraser(e)}))}})))}function Ni(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),yt.showHitView&&(this.__layout.surfaceChanged||this.__layout.surfaceChange()),this.leafer&&this.leafer.updateCursor()}})))}function Yi(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}})))}function Xi(t){return(e,s)=>{_i(e,"__DataProcessor",{get:()=>t})}}function Di(t){return(e,s)=>{_i(e,"__LayoutProcessor",{get:()=>t})}}function zi(t,e,s){const r=t.__DataProcessor.prototype,i="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),n={get(){const t=this[i];return void 0===t?s:t},set(t){this[i]=t},configurable:!0,enumerable:!0};void 0===s?n.get=function(){return this[i]}:"width"===e?n.get=function(){const t=this[i];return void 0===t?this.__naturalWidth||s:t}:"height"===e&&(n.get=function(){const t=this[i];return void 0===t?this.__naturalHeight||s:t});let a,h=r;for(;!a&&h;)a=pi(h,e),h=h.__proto__;a&&a.set&&(n.set=a.set),r[o]&&(n.set=r[o],delete r[o]),Object.defineProperty(r,e,n)}const Fi=new yt("rewrite"),ji=[],Gi=["destroy","constructor"];function qi(t){return(e,s)=>{ji.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function Ui(){return t=>{Hi()}}function Hi(t){ji.length&&(ji.forEach((e=>{t&&Fi.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()})),ji.length=0)}function Vi(t,e){return s=>{var r;(t.prototype?(r=t.prototype,Object.getOwnPropertyNames(r)):Object.keys(t)).forEach((r=>{if(!(Gi.includes(r)||e&&e.includes(r)))if(t.prototype){pi(t.prototype,r).writable&&(s.prototype[r]=t.prototype[r])}else s.prototype[r]=t[r]}))}}function Qi(){return t=>{kt.register(t)}}function Ji(){return t=>{Tt.register(t)}}setTimeout((()=>Hi(!0)));const{copy:Zi,toInnerPoint:$i,scaleOfOuter:Ki,rotateOfOuter:to,skewOfOuter:eo,multiplyParent:so,divideParent:ro,getLayout:io}=b,oo={},no={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),lo(t,e,s),t.isBranch){const{children:r}=t;for(let t=0,i=r.length;t<i;t++)ho(r[t],e,s)}},updateMatrix(t,e,s){const r=t.__layout;e?s&&(r.waitAutoLayout=!0,t.__hasAutoLayout&&(r.matrixChanged=!1)):r.waitAutoLayout&&(r.waitAutoLayout=!1),r.matrixChanged&&t.__updateLocalMatrix(),r.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++)uo(e[t])}},updateAllChange(t){if(uo(t),t.__updateChange(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)co(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},moveWorld(t,e,s){const r={x:e,y:s};t.parent&&$i(t.parent.worldTransform,r,r,!0),ao.moveLocal(t,r.x,r.y)},moveLocal(t,e,s=0){t.x+=e,t.y+=s},zoomOfWorld(t,e,s,r,i){ao.zoomOfLocal(t,po(t,e),s,r,i)},zoomOfLocal(t,e,s,r=s,i){Zi(oo,t.__localMatrix),Ki(oo,e,s,r),_o(t,oo),t.scaleResize(s,r,!0!==i)},rotateOfWorld(t,e,s){ao.rotateOfLocal(t,po(t,e),s)},rotateOfLocal(t,e,s){Zi(oo,t.__localMatrix),to(oo,e,s),_o(t,oo),t.rotation=a.formatRotation(t.rotation+s)},skewOfWorld(t,e,s,r,i){ao.skewOfLocal(t,po(t,e),s,r,i)},skewOfLocal(t,e,s,r=0,i){Zi(oo,t.__localMatrix),eo(oo,e,s,r),ao.setTransform(t,oo,i)},transformWorld(t,e,s){Zi(oo,t.worldTransform),so(oo,e),t.parent&&ro(oo,t.parent.worldTransform),ao.setTransform(t,oo,s)},transform(t,e,s){Zi(oo,t.localTransform),so(oo,e),ao.setTransform(t,oo,s)},setTransform(t,e,s){const r=io(e);s&&(t.scaleResize(r.scaleX/t.scaleX,r.scaleY/t.scaleY,!0!==s),delete r.scaleX,delete r.scaleY),t.set(r)},getRelativeWorld:(t,e,s)=>(Zi(oo,t.worldTransform),ro(oo,e.worldTransform),s?oo:Object.assign({},oo)),drop(t,e,s,r){t.setTransform(ao.getRelativeWorld(t,e,!0),r),e.add(t,s)},hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},hasParentAutoLayout(t){for(;t.parent;)if((t=t.parent).__hasAutoLayout)return!0}},ao=no,{updateAllMatrix:ho,updateMatrix:lo,updateAllWorldOpacity:uo,updateAllChange:co}=ao;function _o(t,e){const{e:s,f:r}=t.__localMatrix;t.x+=e.e-s,t.y+=e.f-r}function po(t,e){return t.__layout.update(),t.parent?I.tempToInnerOf(e,t.parent.__world):e}const fo={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser?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:go}=no,yo={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 r=0,i=s.length;r<i;r++)(t=s[r]).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:r}=t;for(let t=0,s=r.length;t<s;t++)r[t].isBranch&&e.push(r[t]);for(let t=s,r=e.length;t<r;t++)xo(e[t],e)},updateBounds(t,e){const s=[t];xo(t,s),wo(s,e)},updateBoundsByBranchStack(t,e){let s,r;for(let i=t.length-1;i>-1;i--){s=t[i],r=s.children;for(let t=0,e=r.length;t<e;t++)go(r[t]);e&&e===s||go(s)}}},{pushAllChildBranch:mo,pushAllBranchStack:xo,updateBoundsByBranchStack:wo}=yo,bo={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:Bo}=no,{toOuterOf:vo,getPoints:ko,copy:Co}=it;class Oo{get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}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.boxBounds={x:0,y:0,width:0,height:0},this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),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{leafer:e}=this.leaf;if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=this.leaf;for(;e.parent&&!e.parent.leafer;)e=e.parent;t.layout(e)}}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 Bo(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 ht(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"margin":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"margin":case"content":case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"content":if(this.contentBounds)return this.getWorldContentBounds();case"margin":case"box":return this.getWorldBoxBounds();case"margin":case"stroke":return this.getWorldStrokeBounds()}}getLayoutBounds(t,e="world",s){const{leaf:r}=this;let i,o,n=this.getInnerBounds(t);switch(e){case"world":i=r.getWorldPoint(n),o=r.__world;break;case"local":i=r.getLocalPointByInner(n),o=r.__localMatrix;break;case"inner":i=n,o=b.defaultMatrix;break;case"page":e=r.zoomLayer;default:i=r.getWorldPoint(n,e),o=Bo(r,e,!0)}const a=b.getLayout(o);if(Co(a,n),I.copy(a,i),s){const{scaleX:t,scaleY:e}=a,s=Math.abs(t),r=Math.abs(e);1===s&&1===r||(a.scaleX/=s,a.scaleY/=r,a.width*=s,a.height*=r)}return a}getLayoutPoints(t,e="world"){const{leaf:s}=this,r=ko(this.getInnerBounds(t));let i;switch(e){case"world":i=null;break;case"local":i=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:i=e}return void 0!==i&&r.forEach((t=>s.innerToWorld(t,null,!1,i))),r}getWorldContentBounds(){return this._worldContentBounds||(this._worldContentBounds={}),vo(this.contentBounds,this.leaf.__world,this._worldContentBounds),this._worldContentBounds}getWorldBoxBounds(){return this._worldBoxBounds||(this._worldBoxBounds={}),vo(this.boxBounds,this.leaf.__world,this._worldBoxBounds),this._worldBoxBounds}getWorldStrokeBounds(){return this._worldStrokeBounds||(this._worldStrokeBounds={}),vo(this.strokeBounds,this.leaf.__world,this._worldStrokeBounds),this._worldStrokeBounds}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}spreadStroke(){const{x:t,y:e,width:s,height:r}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:r},this._localStrokeBounds={x:t,y:e,width:s,height:r},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:r}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:r},this._localRenderBounds={x:t,y:e,width:s,height:r}}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=!0,this.leaf.forceUpdate("surface"))}destroy(){}}const To={},Po={on(t,e,s){let r,i,o;s&&("boolean"==typeof s?r=s:(r=s.capture,i=s.once));const n=Ro(this,r,!0),a="string"==typeof t?t.split(" "):t,h=i?{listener:e,once:i}:{listener:e};a.forEach((t=>{t&&(o=n[t],o?-1===o.findIndex((t=>t.listener===e))&&o.push(h):n[t]=[h])}))},off(t,e,s){let r,i,o;s&&(r="boolean"==typeof s?s:s.capture);const n=Ro(this,r);("string"==typeof t?t.split(" "):t).forEach((t=>{t&&(i=n[t],i&&(o=i.findIndex((t=>t.listener===e)),o>-1&&i.splice(o,1),i.length||delete n[t]))}))},on_(t,e,s,r){return s&&(e=e.bind(s)),this.on(t,e,r),{type:t,current:this,listener:e,options:r}},off_(t){if(!t)return;const e=t instanceof Array?t:[t];e.forEach((t=>t.current.off(t.type,t.listener,t.options))),e.length=0},once(t,e,s){this.on(t,e,{once:!0,capture:s})},emit(t,e,s){!e&&Tt.has(t)&&(e=Tt.get(t,{type:t,target:this,current:this}));const r=Ro(this,s)[t];if(r){let i;for(let o=0,n=r.length;o<n&&(i=r[o],i.listener(e),i.once&&(this.off(t,i.listener,s),o--,n--),!e||!e.isStopNow);o++);}},emitEvent(t,e){t.current=this,this.emit(t.type,t,e)},hasEvent(t,e){const{__bubbleMap:s,__captureMap:r}=this,i=s&&s[t],o=r&&r[t];return!!(void 0===e?i||o:e?o:i)}};function Ro(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:To)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:To)}}class So{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&t.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&t.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&t.event.stop(this.origin)}}class Lo extends So{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}Lo.ADD="child.add",Lo.REMOVE="child.remove",Lo.DESTROY="child.destroy";class Io extends So{constructor(t,e,s,r,i){super(t,e),this.attrName=s,this.oldValue=r,this.newValue=i}}Io.CHANGE="property.change",Io.LEAFER_CHANGE="property.leafer_change";class Ao extends So{constructor(t,e){super(t),Object.assign(this,e)}}Ao.LOAD="image.load",Ao.LOADED="image.loaded",Ao.ERROR="image.error";class Mo extends So{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(Mo.RESIZE),Object.assign(this,t)):super(t),this.old=e}}Mo.RESIZE="resize";class Wo extends So{constructor(t,e){super(t),this.data=e}}Wo.REQUEST="watch.request",Wo.DATA="watch.data";class Eo extends So{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}Eo.CHECK_UPDATE="layout.check_update",Eo.REQUEST="layout.request",Eo.START="layout.start",Eo.BEFORE="layout.before",Eo.LAYOUT="layout",Eo.AFTER="layout.after",Eo.AGAIN="layout.again",Eo.END="layout.end";class No extends So{}No.FRAME="animate.frame";class Yo extends So{constructor(t,e,s,r){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=r)}}Yo.REQUEST="render.request",Yo.START="render.start",Yo.BEFORE="render.before",Yo.RENDER="render",Yo.AFTER="render.after",Yo.AGAIN="render.again",Yo.END="render.end",Yo.NEXT="render.next";class Xo extends So{}Xo.START="leafer.start",Xo.BEFORE_READY="leafer.before_ready",Xo.READY="leafer.ready",Xo.AFTER_READY="leafer.after_ready",Xo.VIEW_READY="leafer.view_ready",Xo.VIEW_COMPLETED="leafer.view_completed",Xo.STOP="leafer.stop",Xo.RESTART="leafer.restart",Xo.END="leafer.end";const{isFinite:Do}=Number,zo=yt.get("setAttr"),Fo={__setAttr(t,e,s){if(this.leafer&&this.leafer.created){const r=this.__.__getInput(t);if(s&&!Do(e)&&void 0!==e&&(zo.warn(this.innerName,t,e),e=void 0),"object"==typeof e||r!==e){this.__[t]=e,this.__proxyData&&this.setProxyAttr(t,e);const{CHANGE:s}=Io,i=new Io(s,this,t,r,e);return this.isLeafer?this.emitEvent(new Io(Io.LEAFER_CHANGE,this,t,r,e)):this.hasEvent(s)&&this.emitEvent(i),this.leafer.emitEvent(i),!0}return!1}return this.__[t]=e,this.__proxyData&&this.setProxyAttr(t,e),!0},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:jo,multiplyParent:Go,translateInner:qo,defaultWorld:Uo}=b,{toPoint:Ho,tempPoint:Vo}=pt,Qo={__updateWorldMatrix(){Go(this.__local||this.__layout,this.parent?this.parent.__world:Uo,this.__world,!!this.__layout.affectScaleOrRotation,this.__)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged||t.rotationChanged)&&(jo(e,s,null,t.affectRotation),t.scaleChanged=t.rotationChanged=!1),e.e=s.x,e.f=s.y,s.around&&(Ho(s.around,t.boxBounds,Vo),qo(e,-Vo.x,-Vo.y))}this.__layout.matrixChanged=!1}},{updateMatrix:Jo,updateAllMatrix:Zo,hasParentAutoLayout:$o}=no,{updateBounds:Ko}=yo,{toOuterOf:tn,copyAndSpread:en,copy:sn}=it,{toBounds:rn}=qr,on={__updateWorldBounds(){tn(this.__layout.renderBounds,this.__world,this.__world),this.__layout.resized&&(this.__onUpdateSize(),this.__layout.resized=!1)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.boxChanged=!1,t.resized=!0),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=!1,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=!1,t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized=!0),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=!1,this.parent&&this.parent.__layout.renderChange()),t.boundsChanged=!1},__updateLocalBoxBounds(){this.__hasAutoLayout&&this.__updateAutoLayout(),tn(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){tn(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){tn(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(){const t=this.__layout.boxBounds,e=this.__;e.__pathInputed?rn(e.__pathForRender,t):(t.x=0,t.y=0,t.width=e.width,t.height=e.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.leafer&&this.leafer.layouter.addExtra(this),$o(this)?Jo(this):(Zo(this),Ko(this,this))):Jo(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(){en(this.__layout.strokeBounds,this.__layout.boxBounds,this.__layout.strokeSpread)},__updateRenderBounds(){const{renderSpread:t,strokeBounds:e,renderBounds:s}=this.__layout;t>0?en(s,e,t):sn(s,e)}},nn={__render(t,e){if(this.__worldOpacity)if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=this.__.opacity,this.__.__single){const s=t.getSameCanvas(!0,!0);this.__draw(s,e),this.__worldFlipped?t.copyWorldByReset(s,this.__nowWorld,null,this.__.__blendMode,!0):t.copyWorldToInner(s,this.__nowWorld,this.__layout.renderBounds,this.__.__blendMode),s.recycle(this.__nowWorld)}else this.__draw(t,e)},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),this.__.windingRule?t.clip(this.__.windingRule):t.clip())},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:an}=fo,hn={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__worldOpacity)if(this.__.__single){const s=t.getSameCanvas(!1,!0);this.__renderBranch(s,e);const r=this.__getNowWorld(e);t.opacity=this.__.opacity,t.copyWorldByReset(s,r,r,this.__.__blendMode,!0),s.recycle(r)}else this.__renderBranch(t,e)},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let r=0,i=s.length;r<i;r++)an(s[r],e)||s[r].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let r=0,i=s.length;r<i;r++)an(s[r],e)||s[r].__clip(t,e)}}},{LEAF:ln,create:dn}=s,{toInnerPoint:un,toOuterPoint:cn,multiplyParent:_n}=b,{toOuterOf:pn}=it,{tempToOuterOf:fn,copy:gn}=I,{moveLocal:yn,zoomOfLocal:mn,rotateOfLocal:xn,skewOfLocal:wn,moveWorld:bn,zoomOfWorld:Bn,rotateOfWorld:vn,skewOfWorld:kn,transform:Cn,transformWorld:On,setTransform:Tn,getRelativeWorld:Pn,drop:Rn}=no;let Sn=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 It}get __LayoutProcessor(){return Oo}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 pathInputed(){return!!this.__.__pathInputed}constructor(t){this.innerId=dn(ln),this.reset(t)}reset(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.__parentWait?this.__parentWait.push(t):this.__parentWait=[t]}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.__leaferWait?this.__leaferWait.push(t):this.__leaferWait=[t]}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.__leaferWait&&bo.run(this.__leaferWait)),this.isBranch){const{children:e}=this;for(let s=0,r=e.length;s<r;s++)e[s].__bindLeafer(t)}}set(t){}get(t){}toJSON(){return this.__.__getInputData()}toString(){return JSON.stringify(this.toJSON())}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findOne(t,e){}focus(t){}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}updateLayout(){this.__layout.update()}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(){}__updateStrokeBounds(){}__updateRenderBounds(){}__updateAutoLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some((t=>t.__.eraser))}__updateMask(t){this.__hasMask=!!t||this.children.some((t=>t.__.mask))}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld;return _n(this.__world,t.matrix,e,void 0,this.__world),pn(this.__layout.renderBounds,e,e),e}return this.__world}getWorld(t){return this.__layout.update(),"x"===t?this.__world.e:"y"===t?this.__world.f:this.getLayoutBounds()[t]}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 r=e?Pn(this,e):this.worldTransform,i=s?t:{};return pn(t,r,i),i}worldToLocal(t,e,s,r){this.parent?this.parent.worldToInner(t,e,s,r):e&&gn(e,t)}localToWorld(t,e,s,r){this.parent?this.parent.innerToWorld(t,e,s,r):e&&gn(e,t)}worldToInner(t,e,s,r){r&&(r.innerToWorld(t,e,s),t=e||t),un(this.worldTransform,t,e,s)}innerToWorld(t,e,s,r){cn(this.worldTransform,t,e,s),r&&r.worldToInner(e||t,null,s)}getInnerPoint(t,e,s,r){const i=r?t:{};return this.worldToInner(t,i,s,e),i}getInnerPointByLocal(t,e,s,r){return this.getInnerPoint(t,this.parent,s,r)}getLocalPoint(t,e,s,r){const i=r?t:{};return this.worldToLocal(t,i,s,e),i}getLocalPointByInner(t,e,s,r){return this.getWorldPoint(t,this.parent,s,r)}getWorldPoint(t,e,s,r){const i=r?t:{};return this.innerToWorld(t,i,s,e),i}getWorldPointByLocal(t,e,s,r){const i=r?t:{};return this.localToWorld(t,i,s,e),i}getPagePoint(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,r)}getWorldPointByPage(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,r)}setTransform(t,e){Tn(this,t,e)}transform(t,e){Cn(this,t,e)}move(t,e){yn(this,t,e)}scaleOf(t,e,s,r){mn(this,fn(t,this.localTransform),e,s,r)}rotateOf(t,e){xn(this,fn(t,this.localTransform),e)}skewOf(t,e,s,r){wn(this,fn(t,this.localTransform),e,s,r)}transformWorld(t,e){On(this,t,e)}moveWorld(t,e){bn(this,t,e)}scaleOfWorld(t,e,s,r){Bn(this,t,e,s,r)}rotateOfWorld(t,e){vn(this,t,e)}skewOfWorld(t,e,s,r){kn(this,t,e,s,r)}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}__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){}__clip(t,e){}__renderShape(t,e,s,r){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){Rn(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,r){}off_(t){}once(t,e,s){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e){zi(this.prototype,t,e)}static addAttr(t,e,s){s||(s=vi),s(e)(this.prototype,t)}destroy(){if(!this.destroyed){const{parent:t}=this;t&&this.remove(),this.children&&this.removeAll(!0),this.hasEvent(Lo.DESTROY)&&this.emitEvent(new Lo(Lo.DESTROY,this,t)),this.__.destroy(),this.__layout.destroy(),this.__captureMap=this.__bubbleMap=this.__parentWait=this.__leaferWait=null,this.destroyed=!0}}};Sn=Wt([Vi(Fo),Vi(Qo),Vi(on),Vi(Po),Vi(nn)],Sn);const{setListWithFn:Ln}=it,{sort:In}=yo,{localBoxBounds:An,localStrokeBounds:Mn,localRenderBounds:Wn,maskLocalBoxBounds:En,maskLocalStrokeBounds:Nn,maskLocalRenderBounds:Yn}=fo;let Xn=class extends Sn{__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(){Ln(this.__layout.boxBounds,this.children,this.__hasMask?En:An)}__updateStrokeBounds(){Ln(this.__layout.strokeBounds,this.children,this.__hasMask?Nn:Mn)}__updateRenderBounds(){Ln(this.__layout.renderBounds,this.children,this.__hasMask?Yn:Wn)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,r=e.length;s<r;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(In),this.__layout.affectChildrenSort=t}}add(t,e){t!==this&&(t.parent&&t.parent.remove(t),t.parent=this,void 0===e?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1),t.__layout.boxChanged||t.__layout.boxChange(),t.__layout.matrixChanged||t.__layout.matrixChange(),t.__parentWait&&bo.run(t.__parentWait),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Lo.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange())}addMany(...t){t.forEach((t=>this.add(t)))}remove(t,e){if(t){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())}else 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)}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Lo.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new Lo(t,e,this);e.hasEvent(t)&&e.emitEvent(s),this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}};Xn=Wt([Vi(hn)],Xn);class Dn{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:r}=this;for(let t=e,i=r.length;t<i;t++)s[r[t].innerId]++;0===e?r.unshift(t):(e>r.length&&(e=r.length),r.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 r=0,i=e.length;r<i;r++)void 0!==s?this.keys[e[r].innerId]=r-1:e[r].innerId===t.innerId&&(s=r,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 Dn;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,r=t.length;s<r;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class zn{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,r=e.length;s<r;s++)t(e[s])}))}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}export{No as AnimateEvent,At as Answer,pt as AroundHelper,dt as AutoBounds,xe as BezierHelper,ht as Bounds,it as BoundsHelper,Xn as Branch,yo as BranchHelper,hn as BranchRender,Rt as CanvasManager,Lo as ChildEvent,e as Creator,St as DataHelper,yt as Debug,ut as Direction4,ct as Direction9,Pe as EllipseHelper,So as Event,Tt as EventCreator,ri as FileHelper,Ao as ImageEvent,hi as ImageManager,s as IncrementId,Eo as LayoutEvent,Sn as Leaf,on as LeafBounds,fo as LeafBoundsHelper,It as LeafData,Fo as LeafDataProxy,Po as LeafEventer,no as LeafHelper,Oo as LeafLayout,zn as LeafLevelList,Dn as LeafList,Qo as LeafMatrix,nn as LeafRender,qt as LeaferCanvasBase,Xo as LeaferEvent,ci as LeaferImage,a as MathHelper,X as Matrix,b as MatrixHelper,Jt as NeedConvertToCanvasCommandMap,h as OneRadian,l as PI2,d as PI_2,qr as PathBounds,Ws as PathCommandDataHelper,Vt as PathCommandMap,cs as PathConvert,Kr as PathCorner,$s as PathCreator,_r as PathDrawer,Ut as PathHelper,te as PathNumberCommandLengthMap,Kt as PathNumberCommandMap,t as Platform,N as Point,I as PointHelper,Io as PropertyEvent,ee as RectHelper,Yo as RenderEvent,Mo as ResizeEvent,bt as Run,gt as StringNumberMap,ni as TaskItem,ai as TaskProcessor,z as TwoPointBoundsHelper,kt as UICreator,bo as WaitHelper,Wo as WatchEvent,Li as affectRenderBoundsType,Pi as affectStrokeBoundsType,gi as attr,wi as autoLayoutType,vi as boundsType,si as canvasPatch,Gt as canvasSizeAttrs,Yi as cursorType,Xi as dataProcessor,mi as dataType,fi as decorateLeafAttr,zi as defineDataProcessor,_i as defineKey,yi as defineLeafAttr,Ci as doBoundsType,Ri as doStrokeType,Mt as emptyData,Ei as eraserType,c as getBoundsData,pi as getDescriptor,_ as getMatrixData,u as getPointData,Ni as hitType,Di as layoutProcessor,Wi as maskType,ki as naturalBoundsType,Ai as opacityType,Oi as pathInputType,Ti as pathType,ti as pen,xi as positionType,Qi as registerUI,Ji as registerUIEvent,qi as rewrite,Ui as rewriteAble,Bi as rotationType,bi as scaleType,Mi as sortType,Si as strokeType,Ii as surfaceType,lt as tempBounds,D as tempMatrix,Y as tempPoint,Vi as useModule};
|
|
1
|
+
const t={image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,suffix:"leaf",crossOrigin:"anonymous"}},e={},s={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=r;return e[t]?e[t]++:(e[t]=1,0)}},r=s,{round:i,pow:o,PI:n}=Math,a={within:(t,e,s)=>(t<e&&(t=e),t>s&&(t=s),t),minus(t,e){if(t instanceof Array){e&&(t=a.fourNumber(t,0));for(let e=0;e<t.length;e++)t[e]=-t[e]}else t=-t;return 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 r=t+s;if(e>1){const t=Math.abs(r%e);(t<1||t>e-1)&&(r=Math.round(r/e)*e)}return r-s},float(t,e){const s=e?o(10,e):1e12;return-0===(t=i(t*s)/s)?0:t}},h=n/180,l=2*n,d=n/2;function u(){return{x:0,y:0}}function c(){return{x:0,y:0,width:0,height:0}}function _(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:p,cos:f,acos:g,sqrt:y}=Math,{float:m}=a,x={};function w(){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:w(),tempMatrix:{},set(t,e=1,s=0,r=0,i=1,o=0,n=0){t.a=e,t.b=s,t.c=r,t.d=i,t.e=o,t.f=n},get:_,getWorld:w,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){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},scaleOfOuter(t,e,s,r){v.toInnerPoint(t,e,x),v.scaleOfInner(t,x,s,r)},scaleOfInner(t,e,s,r=s){v.translateInner(t,e.x,e.y),v.scale(t,s,r),v.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:r,c:i,d:o}=t,n=f(e*=h),a=p(e);t.a=s*n-r*a,t.b=s*a+r*n,t.c=i*n-o*a,t.d=i*a+o*n},rotateOfOuter(t,e,s){v.toInnerPoint(t,e,x),v.rotateOfInner(t,x,s)},rotateOfInner(t,e,s){v.translateInner(t,e.x,e.y),v.rotate(t,s),v.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:r,b:i,c:o,d:n}=t;s&&(s*=h,t.a=r+o*s,t.b=i+n*s),e&&(e*=h,t.c=o+r*e,t.d=n+i*e)},skewOfOuter(t,e,s,r){v.toInnerPoint(t,e,x),v.skewOfInner(t,x,s,r)},skewOfInner(t,e,s,r=0){v.translateInner(t,e.x,e.y),v.skew(t,s,r),v.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:r,c:i,d:o,e:n,f:a}=t;t.a=e.a*s+e.b*i,t.b=e.a*r+e.b*o,t.c=e.c*s+e.d*i,t.d=e.c*r+e.d*o,t.e=e.e*s+e.f*i+n,t.f=e.e*r+e.f*o+a},multiplyParent(t,e,s,r,i){const{e:o,f:n}=t;if(s||(s=t),void 0===r&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:r,b:o,c:n,d:a}=t;s.a=r*e.a+o*e.c,s.b=r*e.b+o*e.d,s.c=n*e.a+a*e.c,s.d=n*e.b+a*e.d,i&&(s.scaleX=e.scaleX*i.scaleX,s.scaleY=e.scaleY*i.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,i&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=o*e.a+n*e.c+e.e,s.f=o*e.b+n*e.d+e.f},divide(t,e){v.multiply(t,v.tempInvert(e))},divideParent(t,e){v.multiplyParent(t,v.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=v;return v.copy(e,t),v.invert(e),e},invert(t){const{a:e,b:s,c:r,d:i,e:o,f:n}=t;if(s||r){const a=1/(e*i-s*r);t.a=i*a,t.b=-s*a,t.c=-r*a,t.d=e*a,t.e=-(o*i-n*r)*a,t.f=-(n*e-o*s)*a}else if(1===e&&1===i)t.e=-o,t.f=-n;else{const s=1/(e*i);t.a=i*s,t.d=e*s,t.e=-o*i*s,t.f=-n*e*s}},toOuterPoint(t,e,s,r){const{x:i,y:o}=e;s||(s=e),s.x=i*t.a+o*t.c,s.y=i*t.b+o*t.d,r||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,r){const{a:i,b:o,c:n,d:a}=t,h=1/(i*a-o*n),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*n)*h,s.y=(d*i-l*o)*h,!r){const{e:e,f:r}=t;s.x-=(e*a-r*n)*h,s.y-=(r*i-e*o)*h}},setLayout(t,e,s,r){const{x:i,y:o,scaleX:n,scaleY:a}=e;if(void 0===r&&(r=e.rotation||e.skewX||e.skewY),r){const{rotation:s,skewX:r,skewY:i}=e,o=s*h,l=f(o),d=p(o);if(r||i){const e=r*h,s=i*h;t.a=(l+s*-d)*n,t.b=(d+s*l)*n,t.c=(e*l-d)*a,t.d=(l+e*d)*a}else t.a=l*n,t.b=d*n,t.c=-d*a,t.d=l*a}else t.a=n,t.b=0,t.c=0,t.d=a;t.e=i,t.f=o,s&&v.translateInner(t,-s.x,-s.y)},getLayout(t,e,s){const{a:r,b:i,c:o,d:n,e:a,f:l}=t;let u,c,_,x,w,b=a,v=l;if(i||o){const t=r*n-i*o;if(o&&!s){u=y(r*r+i*i),c=t/u;const e=r/u;_=i>0?g(e):-g(e)}else{c=y(o*o+n*n),u=t/c;const e=o/c;_=d-(n>0?g(-e):-g(e))}const e=m(f(_)),a=p(_);u=m(u),c=m(c),x=e?m((o/c+a)/e/h,9):0,w=e?m((i/u-a)/e/h,9):0,_=m(_/h)}else u=r,c=n,_=x=w=0;return e&&(b+=e.x*r+e.y*o,v+=e.x*i+e.y*n),{x:b,y:v,scaleX:u,scaleY:c,rotation:_,skewX:x,skewY:w}},withScale(t,e,s=e){const r=t;if(!e||!s){const{a:r,b:i,c:o,d:n}=t;i||o?s=(r*n-i*o)/(e=y(r*r+i*i)):(e=r,s=n)}return r.scaleX=e,r.scaleY=s,r},reset(t){v.set(t)}},v=b,{toInnerPoint:B,toOuterPoint:k}=b,{sin:C,cos:O,abs:T,sqrt:P,atan2:R,min:S,PI:L}=Math,I={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},move(t,e,s){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,r=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(r-1)},rotate(t,e,s){s||(s=A.defaultPoint);const r=O(e*=h),i=C(e),o=t.x-s.x,n=t.y-s.y;t.x=s.x+o*r-n*i,t.y=s.y+o*i+n*r},tempToInnerOf(t,e){const{tempPoint:s}=A;return E(s,t),B(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=A;return E(s,t),k(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=A;return E(s,t),A.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),B(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){B(e,t,s)},toOuterOf(t,e,s){k(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,r){const i=T(s-t),o=T(r-e);return P(i*i+o*o)},getMinDistanceFrom:(t,e,s,r,i,o)=>S(M(t,e,s,r),M(s,r,i,o)),getAngle:(t,e)=>W(t,e)/h,getRotation:(t,e,s,r)=>(r||(r=e),A.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,r.x,r.y)/h),getRadianFrom(t,e,s,r,i,o,n,a){void 0===n&&(n=s,a=r);let h=R(e-r,t-s);const d=R(o-a,i-n)-h;return d<-L?d+l:d},getAtan2:(t,e)=>R(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,r){const i=W(t,e);return(e=r?e:{}).x=t.x+O(i)*s,e.y=t.y+C(i)*s,e},reset(t){A.reset(t)}},A=I,{getDistanceFrom:M,copy:E,getAtan2:W}=A;class N{constructor(t,e){this.set(t,e)}set(t,e){return"object"==typeof t?I.copy(this,t):I.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new N(this)}move(t,e){return I.move(this,t,e),this}scale(t,e){return I.scale(this,t,e),this}scaleOf(t,e,s){return I.scaleOf(this,t,e,s),this}rotate(t,e){return I.rotate(this,t,e),this}rotateOf(t,e){return I.rotate(this,e,t),this}getRotation(t,e,s){return I.getRotation(this,t,e,s)}toInnerOf(t,e){return I.toInnerOf(this,t,e),this}toOuterOf(t,e){return I.toOuterOf(this,t,e),this}getCenter(t){return new N(I.getCenter(this,t))}getDistance(t){return I.getDistance(this,t)}getDistancePoint(t,e,s){return new N(I.getDistancePoint(this,t,e,s))}getAngle(t){return I.getAngle(this,t)}getAtan2(t){return I.getAtan2(this,t)}reset(){return I.reset(this),this}}const Y=new N;class X{constructor(t,e,s,r,i,o){this.set(t,e,s,r,i,o)}set(t,e,s,r,i,o){return"object"==typeof t?b.copy(this,t):b.set(this,t,e,s,r,i,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:r,e:i,f:o}=this;return{a:t,b:e,c:s,d:r,e:i,f:o}}clone(){return new X(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){return b.setLayout(this,t,e),this}getLayout(t,e){return b.getLayout(this,t,e)}withScale(t,e){return b.withScale(this,t,e)}reset(){b.reset(this)}}const D=new X,z={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,r,i){F(t,e,s),F(t,e+r,s+i)},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:F}=z,{tempPointBounds:j,setPoint:G,addPoint:q,toBounds:U}=z,{toOuterPoint:H}=b,{float:V,fourNumber:Q}=a,{floor:J,ceil:Z}=Math;let $,K,tt,et;const st={},rt={},it={tempBounds:{},set(t,e=0,s=0,r=0,i=0){t.x=e,t.y=s,t.width=r,t.height=i},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,r){if(s instanceof Array){const r=Q(s);ot.set(t,e.x-r[3],e.y-r[0],e.width+r[1]+r[3],e.height+r[2]+r[0])}else r||(r=s),ot.set(t,e.x-s,e.y-r,e.width+2*s,e.height+2*r)},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),ot.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?at(e,t):e=t,s?(e.offsetX=-(ot.maxX(s)-t.x),e.offsetY=-(ot.maxY(s)-t.y)):(e.offsetX=t.x+t.width,e.offsetY=t.y+t.height),ot.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e){I.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,r=s){I.scaleOf(t,e,s,r),t.width*=s,t.height*=r},tempToOuterOf:(t,e)=>(ot.copy(ot.tempBounds,t),ot.toOuterOf(ot.tempBounds,e),ot.tempBounds),getOuterOf:(t,e)=>(t=Object.assign({},t),ot.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:r,d:i}=e;r>0?(s.width=t.width*r,s.x=e.e+t.x*r):(s.width=t.width*-r,s.x=e.e+t.x*r-s.width),i>0?(s.height=t.height*i,s.y=e.f+t.y*i):(s.height=t.height*-i,s.y=e.f+t.y*i-s.height)}else st.x=t.x,st.y=t.y,H(e,st,rt),G(j,rt.x,rt.y),st.x=t.x+t.width,H(e,st,rt),q(j,rt.x,rt.y),st.y=t.y+t.height,H(e,st,rt),q(j,rt.x,rt.y),st.x=t.x,H(e,st,rt),q(j,rt.x,rt.y),U(j,s)},toInnerOf(t,e,s){s||(s=t),ot.move(s,-e.e,-e.f),ot.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const r=Math.min(s,Math.min(t.width/e.width,t.height/e.height));return new X(r,0,0,r,-e.x*r,-e.y*r)},getSpread(t,e,s){const r={};return ot.copyAndSpread(r,t,e,s),r},spread(t,e,s=e){ot.copyAndSpread(t,t,e,s)},ceil(t){const{x:e,y:s}=t;t.x=J(t.x),t.y=J(t.y),t.width=e>t.x?Z(t.width+e-t.x):Z(t.width),t.height=s>t.y?Z(t.height+s-t.y):Z(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=V(t.x,e),t.y=V(t.y,e),t.width=V(t.width,e),t.height=V(t.height,e)},add(t,e,s){$=t.x+t.width,K=t.y+t.height,tt=e.x,et=e.y,s||(tt+=e.width,et+=e.height),$=$>tt?$:tt,K=K>et?K:et,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=$-t.x,t.height=K-t.y},addList(t,e){ot.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){ot.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){ot.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,r=!1){let i,o=!0;for(let n=0,a=e.length;n<a;n++)i=s?s(e[n]):e[n],i&&(i.width||i.height)&&(o?(o=!1,r||at(t,i)):nt(t,i));o&&ot.reset(t)},setPoints(t,e){e.forEach(((t,e)=>0===e?G(j,t.x,t.y):q(j,t.x,t.y))),U(j,t)},addPoint(t,e){nt(t,e,!0)},getPoints(t){const{x:e,y:s,width:r,height:i}=t;return[{x:e,y:s},{x:e+r,y:s},{x:e+r,y:s+i},{x:e,y:s+i}]},hitRadiusPoint:(t,e,s)=>(s&&(e=I.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=I.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=ot.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=ot.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=ot.tempToOuterOf(e,s)),!ot.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:r,y:i,width:o,height:n}=e;return $=r+o,K=i+n,tt=t.x+t.width,et=t.y+t.height,r=r>t.x?r:t.x,i=i>t.y?i:t.y,$=$<tt?$:tt,K=K<et?K:et,o=$-r,n=K-i,{x:r,y:i,width:o,height:n}},intersect(t,e,s){ot.copy(t,ot.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){ot.set(t)}},ot=it,{add:nt,copy:at}=ot;class ht{get minX(){return it.minX(this)}get minY(){return it.minY(this)}get maxX(){return it.maxX(this)}get maxY(){return it.maxY(this)}constructor(t,e,s,r){this.set(t,e,s,r)}set(t,e,s,r){return"object"==typeof t?it.copy(this,t):it.set(this,t,e,s,r),this}get(){const{x:t,y:e,width:s,height:r}=this;return{x:t,y:e,width:s,height:r}}clone(){return new ht(this)}move(t,e){return it.move(this,t,e),this}scale(t,e){return it.scale(this,t,e),this}scaleOf(t,e,s){return it.scaleOf(this,t,e,s),this}toOuterOf(t,e){return it.toOuterOf(this,t,e),this}toInnerOf(t,e){return it.toInnerOf(this,t,e),this}getFitMatrix(t,e){return it.getFitMatrix(this,t,e)}spread(t,e){return it.spread(this,t,e),this}shrink(t){return it.spread(this,a.minus(t,!0)),this}ceil(){return it.ceil(this),this}unsign(){return it.unsign(this),this}float(t){return it.float(this,t),this}add(t){return it.add(this,t),this}addList(t){return it.setList(this,t,!0),this}setList(t){return it.setList(this,t),this}addListWithFn(t,e){return it.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return it.setListWithFn(this,t,e),this}setPoints(t){return it.setPoints(this,t),this}addPoint(t){return it.addPoint(this,t),this}getPoints(){return it.getPoints(this)}hitPoint(t,e){return it.hitPoint(this,t,e)}hitRadiusPoint(t,e){return it.hitRadiusPoint(this,t,e)}hit(t,e){return it.hit(this,t,e)}includes(t,e){return it.includes(this,t,e)}intersect(t,e){return it.intersect(this,t,e),this}getIntersect(t,e){return new ht(it.getIntersectData(this,t,e))}isSame(t){return it.isSame(this,t)}isEmpty(){return it.isEmpty(this)}reset(){it.reset(this)}}const lt=new ht;class dt{constructor(t,e,s,r,i,o){"object"==typeof t?this.copy(t):this.set(t,e,s,r,i,o)}set(t=0,e=0,s=0,r=0,i=0,o=0){this.top=t,this.right=e,this.bottom=s,this.left=r,this.width=i,this.height=o}copy(t){const{top:e,right:s,bottom:r,left:i,width:o,height:n}=t;this.set(e,s,r,i,o,n)}getBoundsFrom(t){const{top:e,right:s,bottom:r,left:i,width:o,height:n}=this;return new ht(i,e,o||t.width-i-s,n||t.height-e-r)}}var ut,ct;!function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"}(ut||(ut={})),function(t){t[t.topLeft=0]="topLeft",t[t.top=1]="top",t[t.topRight=2]="topRight",t[t.right=3]="right",t[t.bottomRight=4]="bottomRight",t[t.bottom=5]="bottom",t[t.bottomLeft=6]="bottomLeft",t[t.left=7]="left",t[t.center=8]="center"}(ct||(ct={}));const _t=[{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}],pt={directionData:_t,tempPoint:{},get:ft,toPoint(t,e,s,r,i){s||(s={});const o=ft(t);s.x=o.x*e.width,s.y=o.y*e.height,i&&(s.x-=i.x,s.y-=i.y,o.x&&(s.x-=1===o.x?i.width:.5===o.x?o.x*i.width:0),o.y&&(s.y-=1===o.y?i.height:.5===o.y?o.y*i.height:0)),r||(s.x+=e.x,s.y+=e.y)}};function ft(t){return"string"==typeof t?_t[ct[t]]:t}const gt={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};class yt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new yt(t)}static set filter(t){this.filterList=mt(t)}static set exclude(t){this.excludeList=mt(t)}log(...t){if(xt.enable){if(xt.filterList.length&&xt.filterList.every((t=>t!==this.name)))return;if(xt.excludeList.length&&xt.excludeList.some((t=>t===this.name)))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){xt.enable&&this.warn(...t)}warn(...t){xt.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 mt(t){return t?"string"==typeof t&&(t=[t]):t=[],t}yt.filterList=[],yt.excludeList=[],yt.showWarn=!0;const xt=yt,wt=yt.get("RunTime"),bt={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const r=s.create(s.RUNTIME);return vt.currentId=vt.idMap[r]=e?performance.now():Date.now(),vt.currentName=vt.nameMap[r]=t,vt.nameToIdMap[t]=r,r},end(t,e){const s=vt.idMap[t],r=vt.nameMap[t],i=e?(performance.now()-s)/1e3:Date.now()-s;vt.idMap[t]=vt.nameMap[t]=vt.nameToIdMap[r]=void 0,wt.log(r,i,"ms")},endOfName(t,e){const s=vt.nameToIdMap[t];void 0!==s&&vt.end(s,e)}},vt=bt,Bt=yt.get("UICreator"),kt={list:{},register(t){const{__tag:e}=t.prototype;Ct[e]?Bt.repeat(e):Ct[e]=t},get(t,e,s,r,i,o){const n=new Ct[t](e);return void 0!==s&&(n.x=s,r&&(n.y=r),i&&(n.width=i),o&&(n.height=o)),n}},{list:Ct}=kt,Ot=yt.get("EventCreator"),Tt={nameList:{},register(t){let e;Object.keys(t).forEach((s=>{e=t[s],"string"==typeof e&&(Pt[e]?Ot.repeat(e):Pt[e]=t)}))},changeName(t,e){const s=Pt[t];if(s){const r=Object.keys(s).find((e=>s[e]===t));r&&(s[r]=e,Pt[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new Pt[t](...e)},{nameList:Pt}=Tt;class Rt{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let s;const{list:r}=this;for(let e=0,i=r.length;e<i;e++)if(s=r[e],s.recycled&&s.isSameSize(t))return s.recycled=!1,s.manager||(s.manager=this),s;const i=e.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,r=this.list.length;s<r;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 St={default:(t,e)=>(Lt(e,t),Lt(t,e),t),assign(t,e){let s;Object.keys(e).forEach((r=>{var i;s=e[r],(null==s?void 0:s.constructor)===Object&&(null===(i=t[r])||void 0===i?void 0:i.constructor)===Object?Lt(t[r],e[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))},{assign:Lt}=St;class It{get __blendMode(){if(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 r in this)"_"!==r[0]&&(s=e?e[r]:void 0,t[r]=void 0===s?this[r]: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){const e={};if(t)if(t instanceof Array)for(let s of t)e[s]=this.__getInput(s);else for(let s in t)e[s]=this.__getInput(s);else{let t,s,{__input:r}=this;e.tag=this.__leaf.tag;for(let i in this)if("_"!==i[0]&&(t=this["_"+i],void 0!==t)){if("path"===i&&!this.__pathInputed)continue;s=r?r[i]:void 0,e[i]=void 0===s?t:s}}return e}__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||e.__hasEraser||t.eraser?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 At;!function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(At||(At={}));const Mt={};function Et(t,e,s,r){var i,o=arguments.length,n=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(n=(o<3?i(n):o>3?i(e,s,n):i(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n}function Wt(t,e,s,r){return new(s||(s=Promise))((function(i,o){function n(t){try{h(r.next(t))}catch(t){o(t)}}function a(t){try{h(r.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(n,a)}h((r=r.apply(t,e||[])).next())}))}function Nt(t){return(e,s)=>{t||(t=s),Object.defineProperty(e,s,{get(){return this.context[t]},set(e){this.context[t]=e}})}}"function"==typeof SuppressedError&&SuppressedError;const Yt=[];function Xt(){return(t,e)=>{Yt.push(e)}}const Dt=[];class zt{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||Dt)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;Yt.forEach((e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))})),this.textBaseline="alphabetic"}setTransform(t,e,s,r,i,o){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,r,i,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,r,i,o)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,r){}strokeRect(t,e,s,r){}clearRect(t,e,s,r){}drawImage(t,e,s,r,i,o,n,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/r*a;r+=e,e=0,o+=t,a-=t}if(s<0){const t=-s/i*h;i+=s,s=0,n+=t,h-=t}this.context.drawImage(t,e,s,r,i,o,n,a,h);break;case 5:this.context.drawImage(t,e,s,r,i);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,r,i,o){}quadraticCurveTo(t,e,s,r){}closePath(){}arc(t,e,s,r,i,o){}arcTo(t,e,s,r,i){}ellipse(t,e,s,r,i,o,n,a){}rect(t,e,s,r){}roundRect(t,e,s,r,i){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,r){}createPattern(t,e){}createRadialGradient(t,e,s,r,i,o){}fillText(t,e,s,r){}measureText(t){}strokeText(t,e,s,r){}destroy(){this.context=null}}Et([Nt("imageSmoothingEnabled")],zt.prototype,"smooth",void 0),Et([Nt("imageSmoothingQuality")],zt.prototype,"smoothLevel",void 0),Et([Nt("globalAlpha")],zt.prototype,"opacity",void 0),Et([Nt()],zt.prototype,"fillStyle",void 0),Et([Nt()],zt.prototype,"strokeStyle",void 0),Et([Nt("lineWidth")],zt.prototype,"strokeWidth",void 0),Et([Nt("lineCap")],zt.prototype,"strokeCap",void 0),Et([Nt("lineJoin")],zt.prototype,"strokeJoin",void 0),Et([Nt("lineDashOffset")],zt.prototype,"dashOffset",void 0),Et([Nt()],zt.prototype,"miterLimit",void 0),Et([Nt()],zt.prototype,"shadowBlur",void 0),Et([Nt()],zt.prototype,"shadowColor",void 0),Et([Nt()],zt.prototype,"shadowOffsetX",void 0),Et([Nt()],zt.prototype,"shadowOffsetY",void 0),Et([Nt()],zt.prototype,"filter",void 0),Et([Nt()],zt.prototype,"font",void 0),Et([Nt()],zt.prototype,"fontKerning",void 0),Et([Nt()],zt.prototype,"fontStretch",void 0),Et([Nt()],zt.prototype,"fontVariantCaps",void 0),Et([Nt()],zt.prototype,"textAlign",void 0),Et([Nt()],zt.prototype,"textBaseline",void 0),Et([Nt()],zt.prototype,"textRendering",void 0),Et([Nt()],zt.prototype,"wordSpacing",void 0),Et([Nt()],zt.prototype,"letterSpacing",void 0),Et([Nt()],zt.prototype,"direction",void 0),Et([Xt()],zt.prototype,"setTransform",null),Et([Xt()],zt.prototype,"resetTransform",null),Et([Xt()],zt.prototype,"getTransform",null),Et([Xt()],zt.prototype,"save",null),Et([Xt()],zt.prototype,"restore",null),Et([Xt()],zt.prototype,"translate",null),Et([Xt()],zt.prototype,"scale",null),Et([Xt()],zt.prototype,"rotate",null),Et([Xt()],zt.prototype,"fill",null),Et([Xt()],zt.prototype,"stroke",null),Et([Xt()],zt.prototype,"clip",null),Et([Xt()],zt.prototype,"fillRect",null),Et([Xt()],zt.prototype,"strokeRect",null),Et([Xt()],zt.prototype,"clearRect",null),Et([Xt()],zt.prototype,"beginPath",null),Et([Xt()],zt.prototype,"moveTo",null),Et([Xt()],zt.prototype,"lineTo",null),Et([Xt()],zt.prototype,"bezierCurveTo",null),Et([Xt()],zt.prototype,"quadraticCurveTo",null),Et([Xt()],zt.prototype,"closePath",null),Et([Xt()],zt.prototype,"arc",null),Et([Xt()],zt.prototype,"arcTo",null),Et([Xt()],zt.prototype,"ellipse",null),Et([Xt()],zt.prototype,"rect",null),Et([Xt()],zt.prototype,"roundRect",null),Et([Xt()],zt.prototype,"createConicGradient",null),Et([Xt()],zt.prototype,"createLinearGradient",null),Et([Xt()],zt.prototype,"createPattern",null),Et([Xt()],zt.prototype,"createRadialGradient",null),Et([Xt()],zt.prototype,"fillText",null),Et([Xt()],zt.prototype,"measureText",null),Et([Xt()],zt.prototype,"strokeText",null);const{copy:Ft}=b,jt={width:1,height:1,pixelRatio:1},Gt=["width","height","pixelRatio"];class qt extends zt{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}get pixelHeight(){return this.height*this.pixelRatio}get allowBackgroundColor(){return this.view&&this.parentView}constructor(e,r){super(),this.size={},this.worldTransform={},e||(e=jt),e.pixelRatio||(e.pixelRatio=t.devicePixelRatio),this.manager=r,this.innerId=s.create(s.CNAVAS);const{width:i,height:o,pixelRatio:n}=e;this.autoLayout=!i||!o,this.size.pixelRatio=n,this.config=e,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){if(this.isSameSize(t))return;let e;this.context&&!this.unreal&&this.width&&(e=this.getSameCanvas(),e.copyWorld(this)),St.copyAttrs(this.size,t,Gt),this.size.pixelRatio||(this.size.pixelRatio=1),this.bounds=new ht(0,0,this.width,this.height),this.unreal||(this.updateViewSize(),this.smooth=this.config.smooth),this.updateClientBounds(),this.context&&!this.unreal&&e&&(this.clearWorld(e.bounds),this.copyWorld(e),e.recycle())}updateViewSize(){}updateClientBounds(){}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s}=this,r=this.worldTransform;if(e){const{a:i,b:o,c:n,d:a,e:h,f:l}=e;this.setTransform(r.a=(t.a*i+t.b*n)*s,r.b=(t.a*o+t.b*a)*s,r.c=(t.c*i+t.d*n)*s,r.d=(t.c*o+t.d*a)*s,r.e=(t.e*i+t.f*n+h)*s,r.f=(t.e*o+t.f*a+l)*s)}else this.setTransform(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)}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){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s)}setStrokeOptions(t){this.strokeCap="none"===t.strokeCap?"butt":t.strokeCap,this.strokeJoin=t.strokeJoin,this.dashPattern=t.dashPattern,this.dashOffset=t.dashOffset,this.miterLimit=t.miterLimit}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,r){const{pixelRatio:i}=this;this.shadowOffsetX=t*i,this.shadowOffsetY=e*i,this.shadowBlur=s*i,this.shadowColor=r||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,r){if(r&&(this.blendMode=r),e){const{pixelRatio:r}=this;s||(s=e),this.drawImage(t.view,e.x*r,e.y*r,e.width*r,e.height*r,s.x*r,s.y*r,s.width*r,s.height*r)}else this.drawImage(t.view,0,0);r&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,r){if(r&&(this.blendMode=r),e.b||e.c)this.save(),this.resetTransform(),this.copyWorld(t,e,it.tempToOuterOf(s,e)),this.restore();else{const{pixelRatio:r}=this;this.drawImage(t.view,e.x*r,e.y*r,e.width*r,e.height*r,s.x,s.y,s.width,s.height)}r&&(this.blendMode="source-over")}copyWorldByReset(t,e,s,r,i){this.resetTransform(),this.copyWorld(t,e,s,r),i||this.useWorldTransform()}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,lt.set(t).scale(this.pixelRatio),this.fillRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s){s&&(this.blendMode=s),this.strokeStyle=e,lt.set(t).scale(this.pixelRatio),this.strokeRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}clearWorld(t,e){lt.set(t).scale(this.pixelRatio),e&<.ceil(),this.clearRect(lt.x,lt.y,lt.width,lt.height)}clipWorld(t,e){this.beginPath(),lt.set(t).scale(this.pixelRatio),e&<.ceil(),this.rect(lt.x,lt.y,lt.width,lt.height),this.clip()}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t,this.height*t)}isSameSize(t){return this.width===t.width&&this.height===t.height&&this.pixelRatio===t.pixelRatio}getSameCanvas(t,s){const r=this.manager?this.manager.get(this.size):e.canvas(Object.assign({},this.size));return r.save(),t&&(Ft(r.worldTransform,this.worldTransform),r.useWorldTransform()),s&&(r.smooth=this.smooth),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t,!0):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}}const Ut={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Ht={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Vt=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},Ht),Qt={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},Jt={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},Zt=Object.assign(Object.assign({},Jt),Ht),$t=Vt,Kt={};for(let t in $t)Kt[$t[t]]=t;const te={};for(let t in $t)te[$t[t]]=Qt[t];const ee={drawRoundRect(t,e,s,r,i,o){const n=a.fourNumber(o,Math.min(r/2,i/2)),h=e+r,l=s+i;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:se,cos:re,atan2:ie,ceil:oe,abs:ne,PI:ae,sqrt:he,pow:le}=Math,{setPoint:de,addPoint:ue}=z,{set:ce}=I,{M:_e,L:pe,C:fe,Q:ge,Z:ye}=Vt,me={},xe={points(t,e,s,r){if(t.push(_e,e[0],e[1]),s&&e.length>5){let i,o,n,a,h,l,d,u,c,_,p,f,g,y=e.length;const m=!0===s?.5:s;r&&(y=(e=[e[y-2],e[y-1],...e,e[0],e[1],e[2],e[3]]).length);for(let s=2;s<y-2;s+=2)i=e[s-2],o=e[s-1],n=e[s],a=e[s+1],h=e[s+2],l=e[s+3],p=he(le(n-i,2)+le(a-o,2)),f=he(le(h-n,2)+le(l-a,2)),g=p+f,p=m*p/g,f=m*f/g,h-=i,l-=o,d=n-p*h,u=a-p*l,2===s?r||t.push(ge,d,u,n,a):t.push(fe,c,_,d,u,n,a),c=n+f*h,_=a+f*l;r||t.push(ge,c,_,e[y-2],e[y-1])}else for(let s=2,r=e.length;s<r;s+=2)t.push(pe,e[s],e[s+1]);r&&t.push(ye)},rect(t,e,s,r,i){Ut.creator.path=t,Ut.creator.moveTo(e,s).lineTo(e+r,s).lineTo(e+r,s+i).lineTo(e,s+i).lineTo(e,s)},roundRect(t,e,s,r,i,o){Ut.creator.path=[],ee.drawRoundRect(Ut.creator,e,s,r,i,o),t.push(...Ut.convertToCanvasData(Ut.creator.path,!0))},arcTo(t,e,s,r,i,o,n,a,u,c,_){const p=r-e,f=i-s,g=o-r,y=n-i;let m=ie(f,p),x=ie(y,g),w=x-m;if(w<0&&(w+=l),w===ae||ne(p+f)<1e-12||ne(g+y)<1e-12)return t&&t.push(pe,r,i),u&&(de(u,e,s),ue(u,r,i)),_&&ce(_,e,s),void(c&&ce(c,r,i));const b=p*y-g*f<0,v=b?-1:1,B=a/re(w/2),k=r+B*re(m+w/2+d*v),C=i+B*se(m+w/2+d*v);return m-=d*v,x-=d*v,ve(t,k,C,a,a,0,m/h,x/h,b,u,c,_)},arc:(t,e,s,r,i,o,n,a,h,l)=>ve(t,e,s,r,r,0,i,o,n,a,h,l),ellipse(t,e,s,r,i,o,n,a,u,c,_,p){const f=o*h,g=se(f),y=re(f);let m=n*h,x=a*h;m>ae&&(m-=l),x<0&&(x+=l);let w=x-m;w<0?w+=l:w>l&&(w-=l),u&&(w-=l);const b=oe(ne(w/d)),v=w/b,B=se(v/4),k=8/3*B*B/se(v/2);x=m+v;let C,O,T,P,R,S,L,I,A=re(m),M=se(m),E=T=y*r*A-g*i*M,W=P=g*r*A+y*i*M,N=e+T,Y=s+P;t&&t.push(pe,N,Y),c&&de(c,N,Y),p&&ce(p,N,Y);for(let o=0;o<b;o++)C=re(x),O=se(x),T=y*r*C-g*i*O,P=g*r*C+y*i*O,R=e+E-k*(y*r*M+g*i*A),S=s+W-k*(g*r*M-y*i*A),L=e+T+k*(y*r*O+g*i*C),I=s+P+k*(g*r*O-y*i*C),t&&t.push(fe,R,S,L,I,e+T,s+P),c&&be(e+E,s+W,R,S,L,I,e+T,s+P,c,!0),E=T,W=P,A=C,M=O,m=x,x+=v;_&&ce(_,e+T,s+P)},quadraticCurveTo(t,e,s,r,i,o,n){t.push(fe,(e+2*r)/3,(s+2*i)/3,(o+2*r)/3,(n+2*i)/3,o,n)},toTwoPointBoundsByQuadraticCurve(t,e,s,r,i,o,n,a){be(t,e,(t+2*s)/3,(e+2*r)/3,(i+2*s)/3,(o+2*r)/3,i,o,n,a)},toTwoPointBounds(t,e,s,r,i,o,n,a,h,l){const d=[];let u,c,_,p,f,g,y,m,x=t,w=s,b=i,v=n;for(let t=0;t<2;++t)if(1==t&&(x=e,w=r,b=o,v=a),u=-3*x+9*w-9*b+3*v,c=6*x-12*w+6*b,_=3*w-3*x,Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;p=-_/c,0<p&&p<1&&d.push(p)}else y=c*c-4*_*u,m=Math.sqrt(y),y<0||(f=(-c+m)/(2*u),0<f&&f<1&&d.push(f),g=(-c-m)/(2*u),0<g&&g<1&&d.push(g));l?ue(h,t,e):de(h,t,e),ue(h,n,a);for(let l=0,u=d.length;l<u;l++)we(d[l],t,e,s,r,i,o,n,a,me),ue(h,me.x,me.y)},getPointAndSet(t,e,s,r,i,o,n,a,h,l){const d=1-t,u=d*d*d,c=3*d*d*t,_=3*d*t*t,p=t*t*t;l.x=u*e+c*r+_*o+p*a,l.y=u*s+c*i+_*n+p*h},getPoint(t,e,s,r,i,o,n,a,h){const l={};return we(t,e,s,r,i,o,n,a,h,l),l}},{getPointAndSet:we,toTwoPointBounds:be,ellipse:ve}=xe,{sin:Be,cos:ke,sqrt:Ce,atan2:Oe}=Math,{ellipse:Te}=xe,Pe={ellipticalArc(e,s,r,i,o,n,a,d,u,c,_){const p=(u-s)/2,f=(c-r)/2,g=n*h,y=Be(g),m=ke(g),x=-m*p-y*f,w=-m*f+y*p,b=i*i,v=o*o,B=w*w,k=x*x,C=b*v-b*B-v*k;let O=0;if(C<0){const t=Ce(1-C/(b*v));i*=t,o*=t}else O=(a===d?-1:1)*Ce(C/(b*B+v*k));const T=O*i*w/o,P=-O*o*x/i,R=Oe((w-P)/o,(x-T)/i),S=Oe((-w-P)/o,(-x-T)/i);let L=S-R;0===d&&L>0?L-=l:1===d&&L<0&&(L+=l);const I=s+p+m*T-y*P,A=r+f+y*T+m*P,M=L<0?1:0;_||t.ellipseToCurve?Te(e,I,A,i,o,n,R/h,S/h,M):i!==o||n?e.push(Vt.G,I,A,i,o,n,R/h,S/h,M):e.push(Vt.O,I,A,i,R/h,S/h,M)}},{M:Re,m:Se,L:Le,l:Ie,H:Ae,h:Me,V:Ee,v:We,C:Ne,c:Ye,S:Xe,s:De,Q:ze,q:Fe,T:je,t:Ge,A:qe,a:Ue,Z:He,z:Ve,N:Qe,D:Je,X:Ze,G:$e,F:Ke,O:ts,P:es,U:ss}=Vt,{rect:rs,roundRect:is,arcTo:os,arc:ns,ellipse:as,quadraticCurveTo:hs}=xe,{ellipticalArc:ls}=Pe,ds=yt.get("PathConvert"),us={},cs={current:{dot:0},stringify(t,e){let s,r,i,o=0,n=t.length,h="";for(;o<n;){r=t[o],s=te[r],h+=r===i?" ":Kt[r];for(let r=1;r<s;r++)h+=a.float(t[o+r],e),r===s-1||(h+=" ");i=r,o+=s}return h},parse(t,e){let s,r,i,o="";const n=[],a=e?Zt:Jt;for(let e=0,h=t.length;e<h;e++)r=t[e],gt[r]?("."===r&&(_s.dot++,_s.dot>1&&(ps(n,o),o="")),o+=r):Vt[r]?(o&&(ps(n,o),o=""),_s.name=Vt[r],_s.length=Qt[r],_s.index=0,ps(n,_s.name),!s&&a[r]&&(s=!0)):"-"===r||"+"===r?"e"===i||"E"===i?o+=r:(o&&ps(n,o),o=r):o&&(ps(n,o),o=""),i=r;return o&&ps(n,o),s?cs.toCanvasData(n,e):n},toCanvasData(t,e){let s,r,i,o,n,a=0,h=0,l=0,d=0,u=0,c=t.length;const _=[];for(;u<c;){switch(i=t[u],i){case Se:t[u+1]+=a,t[u+2]+=h;case Re:a=t[u+1],h=t[u+2],_.push(Re,a,h),u+=3;break;case Me:t[u+1]+=a;case Ae:a=t[u+1],_.push(Le,a,h),u+=2;break;case We:t[u+1]+=h;case Ee:h=t[u+1],_.push(Le,a,h),u+=2;break;case Ie:t[u+1]+=a,t[u+2]+=h;case Le:a=t[u+1],h=t[u+2],_.push(Le,a,h),u+=3;break;case De:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=Xe;case Xe:n=o===Ne||o===Xe,l=n?2*a-s:t[u+1],d=n?2*h-r:t[u+2],s=t[u+1],r=t[u+2],a=t[u+3],h=t[u+4],_.push(Ne,l,d,s,r,a,h),u+=5;break;case Ye:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,t[u+5]+=a,t[u+6]+=h,i=Ne;case Ne:s=t[u+3],r=t[u+4],a=t[u+5],h=t[u+6],_.push(Ne,t[u+1],t[u+2],s,r,a,h),u+=7;break;case Ge:t[u+1]+=a,t[u+2]+=h,i=je;case je:n=o===ze||o===je,s=n?2*a-s:t[u+1],r=n?2*h-r:t[u+2],e?hs(_,a,h,s,r,t[u+1],t[u+2]):_.push(ze,s,r,t[u+1],t[u+2]),a=t[u+1],h=t[u+2],u+=3;break;case Fe:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=ze;case ze:s=t[u+1],r=t[u+2],e?hs(_,a,h,s,r,t[u+3],t[u+4]):_.push(ze,s,r,t[u+3],t[u+4]),a=t[u+3],h=t[u+4],u+=5;break;case Ue:t[u+6]+=a,t[u+7]+=h;case qe:ls(_,a,h,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],e),a=t[u+6],h=t[u+7],u+=8;break;case Ve:case He:_.push(He),u++;break;case Qe:a=t[u+1],h=t[u+2],e?rs(_,a,h,t[u+3],t[u+4]):fs(_,t,u,5),u+=5;break;case Je:a=t[u+1],h=t[u+2],e?is(_,a,h,t[u+3],t[u+4],[t[u+5],t[u+6],t[u+7],t[u+8]]):fs(_,t,u,9),u+=9;break;case Ze:a=t[u+1],h=t[u+2],e?is(_,a,h,t[u+3],t[u+4],t[u+5]):fs(_,t,u,6),u+=6;break;case $e:as(e?_:fs(_,t,u,9),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],t[u+8],null,us),a=us.x,h=us.y,u+=9;break;case Ke:e?as(_,t[u+1],t[u+2],t[u+3],t[u+4],0,0,360,!1):fs(_,t,u,5),a=t[u+1]+t[u+3],h=t[u+2],u+=5;break;case ts:ns(e?_:fs(_,t,u,7),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],null,us),a=us.x,h=us.y,u+=7;break;case es:e?ns(_,t[u+1],t[u+2],t[u+3],0,360,!1):fs(_,t,u,4),a=t[u+1]+t[u+3],h=t[u+2],u+=4;break;case ss:os(e?_:fs(_,t,u,6),a,h,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],null,us),a=us.x,h=us.y,u+=6;break;default:return ds.error(`command: ${i} [index:${u}]`,t),_}o=i}return _},copyData(t,e,s,r){for(let i=s,o=s+r;i<o;i++)t.push(e[i])},pushData(t,e){_s.index===_s.length&&(_s.index=1,t.push(_s.name)),t.push(Number(e)),_s.index++,_s.dot=0}},{current:_s,pushData:ps,copyData:fs}=cs,{M:gs,L:ys,C:ms,Q:xs,Z:ws,N:bs,D:vs,X:Bs,G:ks,F:Cs,O:Os,P:Ts,U:Ps}=Vt,{getMinDistanceFrom:Rs,getRadianFrom:Ss}=I,{tan:Ls,min:Is,abs:As}=Math,Ms={},Es={beginPath(t){t.length=0},moveTo(t,e,s){t.push(gs,e,s)},lineTo(t,e,s){t.push(ys,e,s)},bezierCurveTo(t,e,s,r,i,o,n){t.push(ms,e,s,r,i,o,n)},quadraticCurveTo(t,e,s,r,i){t.push(xs,e,s,r,i)},closePath(t){t.push(ws)},rect(t,e,s,r,i){t.push(bs,e,s,r,i)},roundRect(t,e,s,r,i,o){if("number"==typeof o)t.push(Bs,e,s,r,i,o);else{const n=a.fourNumber(o);n?t.push(vs,e,s,r,i,...n):t.push(bs,e,s,r,i)}},ellipse(t,e,s,r,i,o,n,a,h){void 0===o?t.push(Cs,e,s,r,i):(void 0===n&&(n=0),void 0===a&&(a=360),t.push(ks,e,s,r,i,o,n,a,h?1:0))},arc(t,e,s,r,i,o,n){void 0===i?t.push(Ts,e,s,r):(void 0===o&&(o=360),t.push(Os,e,s,r,i,o,n?1:0))},arcTo(t,e,s,r,i,o,n,a){if(void 0!==n){const h=Ls(Ss(n,a,e,s,r,i)/2)*(Rs(n,a,e,s,r,i)/2);t.push(Ps,e,s,r,i,Is(o,As(h)))}else t.push(Ps,e,s,r,i,o)},drawEllipse(t,e,s,r,i,o,n,a,h){xe.ellipse(null,e,s,r,i,void 0===o?0:o,void 0===n?0:n,void 0===a?360:a,h,null,null,Ms),t.push(gs,Ms.x,Ms.y),Ws(t,e,s,r,i,o,n,a,h)},drawArc(t,e,s,r,i,o,n){xe.arc(null,e,s,r,void 0===i?0:i,void 0===o?360:o,n,null,null,Ms),t.push(gs,Ms.x,Ms.y),Ns(t,e,s,r,i,o,n)},drawPoints(t,e,s,r){xe.points(t,e,s,r)}},{ellipse:Ws,arc:Ns}=Es,{moveTo:Ys,lineTo:Xs,quadraticCurveTo:Ds,bezierCurveTo:zs,closePath:Fs,beginPath:js,rect:Gs,roundRect:qs,ellipse:Us,arc:Hs,arcTo:Vs,drawEllipse:Qs,drawArc:Js,drawPoints:Zs}=Es;class $s{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.clearPath=this.beginPath,this.set(t)}set(t){return this.__path=t?"string"==typeof t?Ut.parse(t):t:[],this}beginPath(){return js(this.__path),this}moveTo(t,e){return Ys(this.__path,t,e),this}lineTo(t,e){return Xs(this.__path,t,e),this}bezierCurveTo(t,e,s,r,i,o){return zs(this.__path,t,e,s,r,i,o),this}quadraticCurveTo(t,e,s,r){return Ds(this.__path,t,e,s,r),this}closePath(){return Fs(this.__path),this}rect(t,e,s,r){return Gs(this.__path,t,e,s,r),this}roundRect(t,e,s,r,i){return qs(this.__path,t,e,s,r,i),this}ellipse(t,e,s,r,i,o,n,a){return Us(this.__path,t,e,s,r,i,o,n,a),this}arc(t,e,s,r,i,o){return Hs(this.__path,t,e,s,r,i,o),this}arcTo(t,e,s,r,i){return Vs(this.__path,t,e,s,r,i),this}drawEllipse(t,e,s,r,i,o,n,a){return Qs(this.__path,t,e,s,r,i,o,n,a),this}drawArc(t,e,s,r,i,o){return Js(this.__path,t,e,s,r,i,o),this}drawPoints(t,e,s){return Zs(this.__path,t,e,s),this}}const{M:Ks,L:tr,C:er,Q:sr,Z:rr,N:ir,D:or,X:nr,G:ar,F:hr,O:lr,P:dr,U:ur}=Vt,cr=yt.get("PathDrawer"),_r={drawPathByData(t,e){if(!e)return;let s,r=0,i=e.length;for(;r<i;)switch(s=e[r],s){case Ks:t.moveTo(e[r+1],e[r+2]),r+=3;break;case tr:t.lineTo(e[r+1],e[r+2]),r+=3;break;case er:t.bezierCurveTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5],e[r+6]),r+=7;break;case sr:t.quadraticCurveTo(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case rr:t.closePath(),r+=1;break;case ir:t.rect(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case or:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],[e[r+5],e[r+6],e[r+7],e[r+8]]),r+=9;break;case nr:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;case ar:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]*h,e[r+6]*h,e[r+7]*h,e[r+8]),r+=9;break;case hr:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],0,0,l,!1),r+=5;break;case lr:t.arc(e[r+1],e[r+2],e[r+3],e[r+4]*h,e[r+5]*h,e[r+6]),r+=7;break;case dr:t.arc(e[r+1],e[r+2],e[r+3],0,l,!1),r+=4;break;case ur:t.arcTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;default:return void cr.error(`command: ${s} [index:${r}]`,e)}}},{M:pr,L:fr,C:gr,Q:yr,Z:mr,N:xr,D:wr,X:br,G:vr,F:Br,O:kr,P:Cr,U:Or}=Vt,{toTwoPointBounds:Tr,toTwoPointBoundsByQuadraticCurve:Pr,arcTo:Rr,arc:Sr,ellipse:Lr}=xe,{addPointBounds:Ir,copy:Ar,addPoint:Mr,setPoint:Er,addBounds:Wr,toBounds:Nr}=z,Yr=yt.get("PathBounds");let Xr,Dr,zr;const Fr={},jr={},Gr={},qr={toBounds(t,e){qr.toTwoPointBounds(t,jr),Nr(jr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Er(e,0,0);let s,r,i,o,n,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(s=t[a],0===a&&(s===mr||s===gr||s===yr?Er(e,h,l):Er(e,t[a+1],t[a+2])),s){case pr:case fr:h=t[a+1],l=t[a+2],Mr(e,h,l),a+=3;break;case gr:o=t[a+5],n=t[a+6],Tr(h,l,t[a+1],t[a+2],t[a+3],t[a+4],o,n,Fr),Ir(e,Fr),h=o,l=n,a+=7;break;case yr:r=t[a+1],i=t[a+2],o=t[a+3],n=t[a+4],Pr(h,l,r,i,o,n,Fr),Ir(e,Fr),h=o,l=n,a+=5;break;case mr:a+=1;break;case xr:h=t[a+1],l=t[a+2],Wr(e,h,l,t[a+3],t[a+4]),a+=5;break;case wr:case br:h=t[a+1],l=t[a+2],Wr(e,h,l,t[a+3],t[a+4]),a+=s===wr?9:6;break;case vr:Lr(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],Fr,Gr),0===a?Ar(e,Fr):Ir(e,Fr),h=Gr.x,l=Gr.y,a+=9;break;case Br:h=t[a+1],l=t[a+2],Dr=t[a+3],zr=t[a+4],Wr(e,h-Dr,l-zr,2*Dr,2*zr),h+=Dr,a+=5;break;case kr:Sr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Fr,Gr),0===a?Ar(e,Fr):Ir(e,Fr),h=Gr.x,l=Gr.y,a+=7;break;case Cr:h=t[a+1],l=t[a+2],Xr=t[a+3],Wr(e,h-Xr,l-Xr,2*Xr,2*Xr),h+=Xr,a+=4;break;case Or:Rr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Fr,Gr),0===a?Ar(e,Fr):Ir(e,Fr),h=Gr.x,l=Gr.y,a+=6;break;default:return void Yr.error(`command: ${s} [index:${a}]`,t)}}},{M:Ur,L:Hr,C:Vr,Z:Qr}=Vt,{getCenterX:Jr,getCenterY:Zr}=I,{arcTo:$r}=Es,Kr={smooth(t,e,s){let r,i=0,o=0,n=0,a=0,h=0,l=0,d=0,u=0,c=0;const _=t.length,p=[];for(;i<_;)switch(r=t[i],r){case Ur:a=u=t[i+1],h=c=t[i+2],i+=3,t[i]===Hr?(l=t[i+1],d=t[i+2],p.push(Ur,Jr(a,l),Zr(h,d))):p.push(Ur,a,h);break;case Hr:switch(o=t[i+1],n=t[i+2],i+=3,t[i]){case Hr:$r(p,o,n,t[i+1],t[i+2],e,u,c);break;case Qr:$r(p,o,n,a,h,e,u,c);break;default:p.push(Hr,o,n)}u=o,c=n;break;case Vr:p.push(Vr,t[i+1],t[i+2],t[i+3],t[i+4],t[i+5],t[i+6]),i+=7;break;case Qr:$r(p,a,h,l,d,e,u,c),p.push(Qr),i+=1}return r!==Qr&&(p[1]=a,p[2]=h),p}};Ut.creator=new $s,Ut.parse=cs.parse,Ut.convertToCanvasData=cs.toCanvasData;const ti=new $s,{drawRoundRect:ei}=ee;function si(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,r,i){ei(this,t,e,s,r,i)})}(t)}const ri={opacityTypes:["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=ii.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{}}}},ii=ri;ii.opacityTypes.forEach((t=>ii.upperCaseTypeMap[t]=t.toUpperCase()));const oi=yt.get("TaskProcessor");class ni{constructor(t){this.parallel=!0,this.time=1,this.id=s.create(s.TASK),this.task=t}run(){return Wt(this,void 0,void 0,(function*(){try{this.task&&!this.isComplete&&this.parent.running&&(yield this.task())}catch(t){oi.error(t)}}))}complete(){this.isComplete=!0,this.parent=null,this.task=null}cancel(){this.isCancel=!0,this.complete()}}class ai{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 r=0;r<t;r++)r<=this.finishedIndex?(s+=this.list[r].time,r===this.finishedIndex&&(e=s)):e+=this.list[r].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&&St.assign(this.config,t),this.empty()}add(t,e){let s,r,i,o;const n=new ni(t);return n.parent=this,"number"==typeof e?o=e:e&&(r=e.parallel,s=e.start,i=e.time,o=e.delay),i&&(n.time=i),!1===r&&(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,r=this.finishedIndex+s;if(e.length){if(!this.running)return;r<this.total&&(t=this.list[r],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 hi={map:{},recycledList:[],tasker:new ai,patternTasker:new ai,get isComplete(){return li.tasker.isComplete},get(t){let s=li.map[t.url];return s||(s=e.image(t),li.map[t.url]=s),s.use++,s},recycle(t){t.use--,setTimeout((()=>{t.use||li.recycledList.push(t)}))},clearRecycled(){const t=li.recycledList;t.length>100&&(t.forEach((t=>{!t.use&&t.url&&(delete li.map[t.url],t.destroy())})),t.length=0)},hasOpacityPixel:t=>ri.opacityTypes.some((e=>li.isFormat(e,t))),isFormat(t,e){if(e.format===t)return!0;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+ri.mineType(t)))return!0}else if(s.includes("."+t)||s.includes("."+ri.upperCaseTypeMap[t]))return!0;return!1},destroy(){li.map={},li.recycledList=[]}},li=hi,{IMAGE:di,create:ui}=s;class ci{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){this.use=0,this.waitComplete=[],this.innerId=ui(di),this.config=t||{url:""},this.isSVG=hi.isFormat("svg",t),this.hasOpacityPixel=hi.hasOpacityPixel(t)}load(e,s){return this.loading||(this.loading=!0,hi.tasker.add((()=>Wt(this,void 0,void 0,(function*(){return yield t.origin.loadImage(this.url).then((t=>{this.ready=!0,this.width=t.naturalWidth||t.width,this.height=t.naturalHeight||t.height,this.view=t,this.onComplete(!0)})).catch((t=>{this.error=t,this.onComplete(!1)}))}))))),this.waitComplete.push(e,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}onComplete(t){let e;this.waitComplete.forEach(((s,r)=>{e=r%2,s&&(t?e||s(this):e&&s(this.error))})),this.waitComplete.length=0,this.loading=!1}getCanvas(e,s,r,i){if(e||(e=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=t.origin.createCanvas(e,s),n=o.getContext("2d");return r&&(n.globalAlpha=r),n.drawImage(this.view,0,0,e,s),this.cache=this.use>1?{data:o,params:arguments}:null,o}getPattern(e,s,r,i){const o=t.canvas.createPattern(e,s);try{r&&o.setTransform&&(o.setTransform(r),r=null)}catch(t){}return i&&(i.transform=r),o}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}}function _i(t,e,s){Object.defineProperty(t,e,s)}function pi(t,e){return Object.getOwnPropertyDescriptor(t,e)}function fi(t,e){return(s,r)=>yi(s,r,t,e&&e(r))}function gi(t){return t}function yi(t,e,s,r){const i={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)},configurable:!0,enumerable:!0};_i(t,e,Object.assign(i,r||{})),zi(t,e,s)}function mi(t){return fi(t)}function xi(t,e){return fi(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.matrixChanged||this.__layout.matrixChange()}})))}function wi(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.matrixChanged||this.__layout.matrixChange(),this.__hasAutoLayout=!!e,this.__local||this.__layout.createLocal()}})))}function bi(t,e){return fi(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.scaleChanged||this.__layout.scaleChange()}})))}function vi(t,e){return fi(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.rotationChanged||this.__layout.rotationChange()}})))}function Bi(t,e){return fi(t,(t=>({set(s){this.__setAttr(t,s,e)&&Ci(this)}})))}function ki(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),Ci(this),this.__.__removeNaturalSize()}})))}function Ci(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function Oi(t){return fi(t,(t=>({set(e){2!==this.__.__pathInputed&&(this.__.__pathInputed=e?1:0),this.__setAttr(t,e),Ci(this)}})))}const Ti=Bi;function Pi(t){return fi(t,(t=>({set(e){this.__setAttr(t,e)&&Ri(this)}})))}function Ri(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&Ci(t)}const Si=Pi;function Li(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}})))}function Ii(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.surfaceChanged||this.__layout.surfaceChange()}})))}function Ai(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.opacityChanged||this.__layout.opacityChange()}})))}function Mi(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.surfaceChanged||this.__layout.surfaceChange(),this.waitParent((()=>{this.parent.__layout.childrenSortChange()}))}})))}function Ei(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent((()=>{this.parent.__updateMask(e)}))}})))}function Wi(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.waitParent((()=>{this.parent.__updateEraser(e)}))}})))}function Ni(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),yt.showHitView&&(this.__layout.surfaceChanged||this.__layout.surfaceChange()),this.leafer&&this.leafer.updateCursor()}})))}function Yi(t){return fi(t,(t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}})))}function Xi(t){return(e,s)=>{_i(e,"__DataProcessor",{get:()=>t})}}function Di(t){return(e,s)=>{_i(e,"__LayoutProcessor",{get:()=>t})}}function zi(t,e,s){const r=t.__DataProcessor.prototype,i="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),n={get(){const t=this[i];return void 0===t?s:t},set(t){this[i]=t},configurable:!0,enumerable:!0};void 0===s?n.get=function(){return this[i]}:"width"===e?n.get=function(){const t=this[i];return void 0===t?this.__naturalWidth||s:t}:"height"===e&&(n.get=function(){const t=this[i];return void 0===t?this.__naturalHeight||s:t});let a,h=r;for(;!a&&h;)a=pi(h,e),h=h.__proto__;a&&a.set&&(n.set=a.set),r[o]&&(n.set=r[o],delete r[o]),Object.defineProperty(r,e,n)}const Fi=new yt("rewrite"),ji=[],Gi=["destroy","constructor"];function qi(t){return(e,s)=>{ji.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function Ui(){return t=>{Hi()}}function Hi(t){ji.length&&(ji.forEach((e=>{t&&Fi.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()})),ji.length=0)}function Vi(t,e){return s=>{var r;(t.prototype?(r=t.prototype,Object.getOwnPropertyNames(r)):Object.keys(t)).forEach((r=>{if(!(Gi.includes(r)||e&&e.includes(r)))if(t.prototype){pi(t.prototype,r).writable&&(s.prototype[r]=t.prototype[r])}else s.prototype[r]=t[r]}))}}function Qi(){return t=>{kt.register(t)}}function Ji(){return t=>{Tt.register(t)}}setTimeout((()=>Hi(!0)));const{copy:Zi,toInnerPoint:$i,scaleOfOuter:Ki,rotateOfOuter:to,skewOfOuter:eo,multiplyParent:so,divideParent:ro,getLayout:io}=b,oo={},no={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),lo(t,e,s),t.isBranch){const{children:r}=t;for(let t=0,i=r.length;t<i;t++)ho(r[t],e,s)}},updateMatrix(t,e,s){const r=t.__layout;e?s&&(r.waitAutoLayout=!0,t.__hasAutoLayout&&(r.matrixChanged=!1)):r.waitAutoLayout&&(r.waitAutoLayout=!1),r.matrixChanged&&t.__updateLocalMatrix(),r.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++)uo(e[t])}},updateAllChange(t){if(uo(t),t.__updateChange(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)co(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},moveWorld(t,e,s=0){const r="object"==typeof e?Object.assign({},e):{x:e,y:s};t.parent&&$i(t.parent.worldTransform,r,r,!0),ao.moveLocal(t,r.x,r.y)},moveLocal(t,e,s=0){"object"==typeof e?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=s)},zoomOfWorld(t,e,s,r,i){ao.zoomOfLocal(t,po(t,e),s,r,i)},zoomOfLocal(t,e,s,r=s,i){Zi(oo,t.__localMatrix),Ki(oo,e,s,r),_o(t,oo),t.scaleResize(s,r,!0!==i)},rotateOfWorld(t,e,s){ao.rotateOfLocal(t,po(t,e),s)},rotateOfLocal(t,e,s){Zi(oo,t.__localMatrix),to(oo,e,s),_o(t,oo),t.rotation=a.formatRotation(t.rotation+s)},skewOfWorld(t,e,s,r,i){ao.skewOfLocal(t,po(t,e),s,r,i)},skewOfLocal(t,e,s,r=0,i){Zi(oo,t.__localMatrix),eo(oo,e,s,r),ao.setTransform(t,oo,i)},transformWorld(t,e,s){Zi(oo,t.worldTransform),so(oo,e),t.parent&&ro(oo,t.parent.worldTransform),ao.setTransform(t,oo,s)},transform(t,e,s){Zi(oo,t.localTransform),so(oo,e),ao.setTransform(t,oo,s)},setTransform(t,e,s){const r=io(e);s&&(t.scaleResize(r.scaleX/t.scaleX,r.scaleY/t.scaleY,!0!==s),delete r.scaleX,delete r.scaleY),t.set(r)},getRelativeWorld:(t,e,s)=>(Zi(oo,t.worldTransform),ro(oo,e.worldTransform),s?oo:Object.assign({},oo)),drop(t,e,s,r){t.setTransform(ao.getRelativeWorld(t,e,!0),r),e.add(t,s)},hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},hasParentAutoLayout(t){for(;t.parent;)if((t=t.parent).__hasAutoLayout)return!0}},ao=no,{updateAllMatrix:ho,updateMatrix:lo,updateAllWorldOpacity:uo,updateAllChange:co}=ao;function _o(t,e){const{e:s,f:r}=t.__localMatrix;t.x+=e.e-s,t.y+=e.f-r}function po(t,e){return t.__layout.update(),t.parent?I.tempToInnerOf(e,t.parent.__world):e}const fo={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser?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:go}=no,yo={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 r=0,i=s.length;r<i;r++)(t=s[r]).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:r}=t;for(let t=0,s=r.length;t<s;t++)r[t].isBranch&&e.push(r[t]);for(let t=s,r=e.length;t<r;t++)xo(e[t],e)},updateBounds(t,e){const s=[t];xo(t,s),wo(s,e)},updateBoundsByBranchStack(t,e){let s,r;for(let i=t.length-1;i>-1;i--){s=t[i],r=s.children;for(let t=0,e=r.length;t<e;t++)go(r[t]);e&&e===s||go(s)}}},{pushAllChildBranch:mo,pushAllBranchStack:xo,updateBoundsByBranchStack:wo}=yo,bo={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:vo}=no,{toOuterOf:Bo,getPoints:ko,copy:Co}=it;class Oo{get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}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.boxBounds={x:0,y:0,width:0,height:0},this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),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{leafer:e}=this.leaf;if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=this.leaf;for(;e.parent&&!e.parent.leafer;)e=e.parent;t.layout(e)}}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 vo(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 ht(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"margin":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"margin":case"content":case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"content":if(this.contentBounds)return this.getWorldContentBounds();case"margin":case"box":return this.getWorldBoxBounds();case"margin":case"stroke":return this.getWorldStrokeBounds()}}getLayoutBounds(t,e="world",s){const{leaf:r}=this;let i,o,n=this.getInnerBounds(t);switch(e){case"world":i=r.getWorldPoint(n),o=r.__world;break;case"local":i=r.getLocalPointByInner(n),o=r.__localMatrix;break;case"inner":i=n,o=b.defaultMatrix;break;case"page":e=r.zoomLayer;default:i=r.getWorldPoint(n,e),o=vo(r,e,!0)}const a=b.getLayout(o);if(Co(a,n),I.copy(a,i),s){const{scaleX:t,scaleY:e}=a,s=Math.abs(t),r=Math.abs(e);1===s&&1===r||(a.scaleX/=s,a.scaleY/=r,a.width*=s,a.height*=r)}return a}getLayoutPoints(t,e="world"){const{leaf:s}=this,r=ko(this.getInnerBounds(t));let i;switch(e){case"world":i=null;break;case"local":i=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:i=e}return void 0!==i&&r.forEach((t=>s.innerToWorld(t,null,!1,i))),r}getWorldContentBounds(){return this._worldContentBounds||(this._worldContentBounds={}),Bo(this.contentBounds,this.leaf.__world,this._worldContentBounds),this._worldContentBounds}getWorldBoxBounds(){return this._worldBoxBounds||(this._worldBoxBounds={}),Bo(this.boxBounds,this.leaf.__world,this._worldBoxBounds),this._worldBoxBounds}getWorldStrokeBounds(){return this._worldStrokeBounds||(this._worldStrokeBounds={}),Bo(this.strokeBounds,this.leaf.__world,this._worldStrokeBounds),this._worldStrokeBounds}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}spreadStroke(){const{x:t,y:e,width:s,height:r}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:r},this._localStrokeBounds={x:t,y:e,width:s,height:r},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:r}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:r},this._localRenderBounds={x:t,y:e,width:s,height:r}}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=!0,this.leaf.forceUpdate("surface"))}destroy(){}}const To={},Po={on(t,e,s){let r,i,o;s&&("boolean"==typeof s?r=s:(r=s.capture,i=s.once));const n=Ro(this,r,!0),a="string"==typeof t?t.split(" "):t,h=i?{listener:e,once:i}:{listener:e};a.forEach((t=>{t&&(o=n[t],o?-1===o.findIndex((t=>t.listener===e))&&o.push(h):n[t]=[h])}))},off(t,e,s){let r,i,o;s&&(r="boolean"==typeof s?s:s.capture);const n=Ro(this,r);("string"==typeof t?t.split(" "):t).forEach((t=>{t&&(i=n[t],i&&(o=i.findIndex((t=>t.listener===e)),o>-1&&i.splice(o,1),i.length||delete n[t]))}))},on_(t,e,s,r){return s&&(e=e.bind(s)),this.on(t,e,r),{type:t,current:this,listener:e,options:r}},off_(t){if(!t)return;const e=t instanceof Array?t:[t];e.forEach((t=>t.current.off(t.type,t.listener,t.options))),e.length=0},once(t,e,s){this.on(t,e,{once:!0,capture:s})},emit(t,e,s){!e&&Tt.has(t)&&(e=Tt.get(t,{type:t,target:this,current:this}));const r=Ro(this,s)[t];if(r){let i;for(let o=0,n=r.length;o<n&&(i=r[o],i.listener(e),i.once&&(this.off(t,i.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:r}=this,i=s&&s[t],o=r&&r[t];return!!(void 0===e?i||o:e?o:i)}};function Ro(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:To)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:To)}}class So{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&t.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&t.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&t.event.stop(this.origin)}}class Lo extends So{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}Lo.ADD="child.add",Lo.REMOVE="child.remove",Lo.DESTROY="child.destroy";class Io extends So{constructor(t,e,s,r,i){super(t,e),this.attrName=s,this.oldValue=r,this.newValue=i}}Io.CHANGE="property.change",Io.LEAFER_CHANGE="property.leafer_change";class Ao extends So{constructor(t,e){super(t),Object.assign(this,e)}}Ao.LOAD="image.load",Ao.LOADED="image.loaded",Ao.ERROR="image.error";class Mo extends So{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(Mo.RESIZE),Object.assign(this,t)):super(t),this.old=e}}Mo.RESIZE="resize";class Eo extends So{constructor(t,e){super(t),this.data=e}}Eo.REQUEST="watch.request",Eo.DATA="watch.data";class Wo extends So{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}Wo.CHECK_UPDATE="layout.check_update",Wo.REQUEST="layout.request",Wo.START="layout.start",Wo.BEFORE="layout.before",Wo.LAYOUT="layout",Wo.AFTER="layout.after",Wo.AGAIN="layout.again",Wo.END="layout.end";class No extends So{}No.FRAME="animate.frame";class Yo extends So{constructor(t,e,s,r){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=r)}}Yo.REQUEST="render.request",Yo.START="render.start",Yo.BEFORE="render.before",Yo.RENDER="render",Yo.AFTER="render.after",Yo.AGAIN="render.again",Yo.END="render.end",Yo.NEXT="render.next";class Xo extends So{}Xo.START="leafer.start",Xo.BEFORE_READY="leafer.before_ready",Xo.READY="leafer.ready",Xo.AFTER_READY="leafer.after_ready",Xo.VIEW_READY="leafer.view_ready",Xo.VIEW_COMPLETED="leafer.view_completed",Xo.STOP="leafer.stop",Xo.RESTART="leafer.restart",Xo.END="leafer.end";const{isFinite:Do}=Number,zo=yt.get("setAttr"),Fo={__setAttr(t,e,s){if(this.leafer&&this.leafer.created){const r=this.__.__getInput(t);if(s&&!Do(e)&&void 0!==e&&(zo.warn(this.innerName,t,e),e=void 0),"object"==typeof e||r!==e){this.__[t]=e,this.__proxyData&&this.setProxyAttr(t,e);const{CHANGE:s}=Io,i=new Io(s,this,t,r,e);return this.isLeafer?this.emitEvent(new Io(Io.LEAFER_CHANGE,this,t,r,e)):this.hasEvent(s)&&this.emitEvent(i),this.leafer.emitEvent(i),!0}return!1}return this.__[t]=e,this.__proxyData&&this.setProxyAttr(t,e),!0},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:jo,multiplyParent:Go,translateInner:qo,defaultWorld:Uo}=b,{toPoint:Ho,tempPoint:Vo}=pt,Qo={__updateWorldMatrix(){Go(this.__local||this.__layout,this.parent?this.parent.__world:Uo,this.__world,!!this.__layout.affectScaleOrRotation,this.__)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged||t.rotationChanged)&&(jo(e,s,null,t.affectRotation),t.scaleChanged=t.rotationChanged=!1),e.e=s.x,e.f=s.y,s.around&&(Ho(s.around,t.boxBounds,Vo),qo(e,-Vo.x,-Vo.y))}this.__layout.matrixChanged=!1}},{updateMatrix:Jo,updateAllMatrix:Zo,hasParentAutoLayout:$o}=no,{updateBounds:Ko}=yo,{toOuterOf:tn,copyAndSpread:en,copy:sn}=it,{toBounds:rn}=qr,on={__updateWorldBounds(){tn(this.__layout.renderBounds,this.__world,this.__world),this.__layout.resized&&(this.__onUpdateSize(),this.__layout.resized=!1)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.boxChanged=!1,t.resized=!0),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=!1,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=!1,t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized=!0),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=!1,this.parent&&this.parent.__layout.renderChange()),t.boundsChanged=!1},__updateLocalBoxBounds(){this.__hasAutoLayout&&this.__updateAutoLayout(),tn(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){tn(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){tn(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(){const t=this.__layout.boxBounds,e=this.__;e.__pathInputed?rn(e.__pathForRender,t):(t.x=0,t.y=0,t.width=e.width,t.height=e.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.leafer&&this.leafer.layouter.addExtra(this),$o(this)?Jo(this):(Zo(this),Ko(this,this))):Jo(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(){en(this.__layout.strokeBounds,this.__layout.boxBounds,this.__layout.strokeSpread)},__updateRenderBounds(){const{renderSpread:t,strokeBounds:e,renderBounds:s}=this.__layout;t>0?en(s,e,t):sn(s,e)}},nn={__render(t,e){if(this.__worldOpacity)if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=this.__.opacity,this.__.__single){const s=t.getSameCanvas(!0,!0);this.__draw(s,e),this.__worldFlipped?t.copyWorldByReset(s,this.__nowWorld,null,this.__.__blendMode,!0):t.copyWorldToInner(s,this.__nowWorld,this.__layout.renderBounds,this.__.__blendMode),s.recycle(this.__nowWorld)}else this.__draw(t,e)},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),this.__.windingRule?t.clip(this.__.windingRule):t.clip())},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:an}=fo,hn={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__worldOpacity)if(this.__.__single){const s=t.getSameCanvas(!1,!0);this.__renderBranch(s,e);const r=this.__getNowWorld(e);t.opacity=this.__.opacity,t.copyWorldByReset(s,r,r,this.__.__blendMode,!0),s.recycle(r)}else this.__renderBranch(t,e)},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let r=0,i=s.length;r<i;r++)an(s[r],e)||s[r].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let r=0,i=s.length;r<i;r++)an(s[r],e)||s[r].__clip(t,e)}}},{LEAF:ln,create:dn}=s,{toInnerPoint:un,toOuterPoint:cn,multiplyParent:_n}=b,{toOuterOf:pn}=it,{tempToOuterOf:fn,copy:gn}=I,{moveLocal:yn,zoomOfLocal:mn,rotateOfLocal:xn,skewOfLocal:wn,moveWorld:bn,zoomOfWorld:vn,rotateOfWorld:Bn,skewOfWorld:kn,transform:Cn,transformWorld:On,setTransform:Tn,getRelativeWorld:Pn,drop:Rn}=no;let Sn=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 It}get __LayoutProcessor(){return Oo}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 pathInputed(){return!!this.__.__pathInputed}constructor(t){this.innerId=dn(ln),this.reset(t)}reset(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.__parentWait?this.__parentWait.push(t):this.__parentWait=[t]}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.__leaferWait?this.__leaferWait.push(t):this.__leaferWait=[t]}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.__leaferWait&&bo.run(this.__leaferWait)),this.isBranch){const{children:e}=this;for(let s=0,r=e.length;s<r;s++)e[s].__bindLeafer(t)}}set(t){}get(t){}toJSON(){return this.__.__getInputData()}toString(){return JSON.stringify(this.toJSON())}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findOne(t,e){}focus(t){}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}updateLayout(){this.__layout.update()}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(){}__updateStrokeBounds(){}__updateRenderBounds(){}__updateAutoLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some((t=>t.__.eraser))}__updateMask(t){this.__hasMask=!!t||this.children.some((t=>t.__.mask))}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld;return _n(this.__world,t.matrix,e,void 0,this.__world),pn(this.__layout.renderBounds,e,e),e}return this.__world}getWorld(t){return this.__layout.update(),"x"===t?this.__world.e:"y"===t?this.__world.f:this.getLayoutBounds()[t]}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 r=e?Pn(this,e):this.worldTransform,i=s?t:{};return pn(t,r,i),i}worldToLocal(t,e,s,r){this.parent?this.parent.worldToInner(t,e,s,r):e&&gn(e,t)}localToWorld(t,e,s,r){this.parent?this.parent.innerToWorld(t,e,s,r):e&&gn(e,t)}worldToInner(t,e,s,r){r&&(r.innerToWorld(t,e,s),t=e||t),un(this.worldTransform,t,e,s)}innerToWorld(t,e,s,r){cn(this.worldTransform,t,e,s),r&&r.worldToInner(e||t,null,s)}getInnerPoint(t,e,s,r){const i=r?t:{};return this.worldToInner(t,i,s,e),i}getInnerPointByLocal(t,e,s,r){return this.getInnerPoint(t,this.parent,s,r)}getLocalPoint(t,e,s,r){const i=r?t:{};return this.worldToLocal(t,i,s,e),i}getLocalPointByInner(t,e,s,r){return this.getWorldPoint(t,this.parent,s,r)}getWorldPoint(t,e,s,r){const i=r?t:{};return this.innerToWorld(t,i,s,e),i}getWorldPointByLocal(t,e,s,r){const i=r?t:{};return this.localToWorld(t,i,s,e),i}getPagePoint(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,r)}getWorldPointByPage(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,r)}setTransform(t,e){Tn(this,t,e)}transform(t,e){Cn(this,t,e)}move(t,e){yn(this,t,e)}scaleOf(t,e,s,r){mn(this,fn(t,this.localTransform),e,s,r)}rotateOf(t,e){xn(this,fn(t,this.localTransform),e)}skewOf(t,e,s,r){wn(this,fn(t,this.localTransform),e,s,r)}transformWorld(t,e){On(this,t,e)}moveWorld(t,e){bn(this,t,e)}scaleOfWorld(t,e,s,r){vn(this,t,e,s,r)}rotateOfWorld(t,e){Bn(this,t,e)}skewOfWorld(t,e,s,r){kn(this,t,e,s,r)}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}__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){}__clip(t,e){}__renderShape(t,e,s,r){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){Rn(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,r){}off_(t){}once(t,e,s){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e){zi(this.prototype,t,e)}static addAttr(t,e,s){s||(s=Bi),s(e)(this.prototype,t)}destroy(){if(!this.destroyed){const{parent:t}=this;t&&this.remove(),this.children&&this.removeAll(!0),this.hasEvent(Lo.DESTROY)&&this.emitEvent(new Lo(Lo.DESTROY,this,t)),this.__.destroy(),this.__layout.destroy(),this.__captureMap=this.__bubbleMap=this.__parentWait=this.__leaferWait=null,this.destroyed=!0}}};Sn=Et([Vi(Fo),Vi(Qo),Vi(on),Vi(Po),Vi(nn)],Sn);const{setListWithFn:Ln}=it,{sort:In}=yo,{localBoxBounds:An,localStrokeBounds:Mn,localRenderBounds:En,maskLocalBoxBounds:Wn,maskLocalStrokeBounds:Nn,maskLocalRenderBounds:Yn}=fo;let Xn=class extends Sn{__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(){Ln(this.__layout.boxBounds,this.children,this.__hasMask?Wn:An)}__updateStrokeBounds(){Ln(this.__layout.strokeBounds,this.children,this.__hasMask?Nn:Mn)}__updateRenderBounds(){Ln(this.__layout.renderBounds,this.children,this.__hasMask?Yn:En)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,r=e.length;s<r;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(In),this.__layout.affectChildrenSort=t}}add(t,e){t!==this&&(t.parent&&t.parent.remove(t),t.parent=this,void 0===e?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1),t.__layout.boxChanged||t.__layout.boxChange(),t.__layout.matrixChanged||t.__layout.matrixChange(),t.__parentWait&&bo.run(t.__parentWait),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Lo.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange())}addMany(...t){t.forEach((t=>this.add(t)))}remove(t,e){if(t){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())}else 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)}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Lo.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new Lo(t,e,this);e.hasEvent(t)&&e.emitEvent(s),this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}};Xn=Et([Vi(hn)],Xn);class Dn{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:r}=this;for(let t=e,i=r.length;t<i;t++)s[r[t].innerId]++;0===e?r.unshift(t):(e>r.length&&(e=r.length),r.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 r=0,i=e.length;r<i;r++)void 0!==s?this.keys[e[r].innerId]=r-1:e[r].innerId===t.innerId&&(s=r,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 Dn;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,r=t.length;s<r;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class zn{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,r=e.length;s<r;s++)t(e[s])}))}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}export{No as AnimateEvent,At as Answer,pt as AroundHelper,dt as AutoBounds,xe as BezierHelper,ht as Bounds,it as BoundsHelper,Xn as Branch,yo as BranchHelper,hn as BranchRender,Rt as CanvasManager,Lo as ChildEvent,e as Creator,St as DataHelper,yt as Debug,ut as Direction4,ct as Direction9,Pe as EllipseHelper,So as Event,Tt as EventCreator,ri as FileHelper,Ao as ImageEvent,hi as ImageManager,s as IncrementId,Wo as LayoutEvent,Sn as Leaf,on as LeafBounds,fo as LeafBoundsHelper,It as LeafData,Fo as LeafDataProxy,Po as LeafEventer,no as LeafHelper,Oo as LeafLayout,zn as LeafLevelList,Dn as LeafList,Qo as LeafMatrix,nn as LeafRender,qt as LeaferCanvasBase,Xo as LeaferEvent,ci as LeaferImage,a as MathHelper,X as Matrix,b as MatrixHelper,Jt as NeedConvertToCanvasCommandMap,h as OneRadian,l as PI2,d as PI_2,qr as PathBounds,Es as PathCommandDataHelper,Vt as PathCommandMap,cs as PathConvert,Kr as PathCorner,$s as PathCreator,_r as PathDrawer,Ut as PathHelper,te as PathNumberCommandLengthMap,Kt as PathNumberCommandMap,t as Platform,N as Point,I as PointHelper,Io as PropertyEvent,ee as RectHelper,Yo as RenderEvent,Mo as ResizeEvent,bt as Run,gt as StringNumberMap,ni as TaskItem,ai as TaskProcessor,z as TwoPointBoundsHelper,kt as UICreator,bo as WaitHelper,Eo as WatchEvent,Li as affectRenderBoundsType,Pi as affectStrokeBoundsType,gi as attr,wi as autoLayoutType,Bi as boundsType,si as canvasPatch,Gt as canvasSizeAttrs,Yi as cursorType,Xi as dataProcessor,mi as dataType,fi as decorateLeafAttr,zi as defineDataProcessor,_i as defineKey,yi as defineLeafAttr,Ci as doBoundsType,Ri as doStrokeType,Mt as emptyData,Wi as eraserType,c as getBoundsData,pi as getDescriptor,_ as getMatrixData,u as getPointData,Ni as hitType,Di as layoutProcessor,Ei as maskType,ki as naturalBoundsType,Ai as opacityType,Oi as pathInputType,Ti as pathType,ti as pen,xi as positionType,Qi as registerUI,Ji as registerUIEvent,qi as rewrite,Ui as rewriteAble,vi as rotationType,bi as scaleType,Mi as sortType,Si as strokeType,Ii as surfaceType,lt as tempBounds,D as tempMatrix,Y as tempPoint,Vi as useModule};
|
package/lib/core.min.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t={image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,suffix:"leaf",crossOrigin:"anonymous"}},e={},s={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=r;return e[t]?e[t]++:(e[t]=1,0)}},r=s,{round:i,pow:o,PI:n}=Math,a={within:(t,e,s)=>(t<e&&(t=e),t>s&&(t=s),t),minus(t,e){if(t instanceof Array){e&&(t=a.fourNumber(t,0));for(let e=0;e<t.length;e++)t[e]=-t[e]}else t=-t;return 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 r=t+s;if(e>1){const t=Math.abs(r%e);(t<1||t>e-1)&&(r=Math.round(r/e)*e)}return r-s},float(t,e){const s=e?o(10,e):1e12;return-0===(t=i(t*s)/s)?0:t}},h=n/180,l=2*n,d=n/2;function u(){return{x:0,y:0}}function c(){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:_,cos:f,acos:g,sqrt:y}=Math,{float:x}=a,m={};function w(){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:w(),tempMatrix:{},set(t,e=1,s=0,r=0,i=1,o=0,n=0){t.a=e,t.b=s,t.c=r,t.d=i,t.e=o,t.f=n},get:p,getWorld:w,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){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},scaleOfOuter(t,e,s,r){v.toInnerPoint(t,e,m),v.scaleOfInner(t,m,s,r)},scaleOfInner(t,e,s,r=s){v.translateInner(t,e.x,e.y),v.scale(t,s,r),v.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:r,c:i,d:o}=t,n=f(e*=h),a=_(e);t.a=s*n-r*a,t.b=s*a+r*n,t.c=i*n-o*a,t.d=i*a+o*n},rotateOfOuter(t,e,s){v.toInnerPoint(t,e,m),v.rotateOfInner(t,m,s)},rotateOfInner(t,e,s){v.translateInner(t,e.x,e.y),v.rotate(t,s),v.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:r,b:i,c:o,d:n}=t;s&&(s*=h,t.a=r+o*s,t.b=i+n*s),e&&(e*=h,t.c=o+r*e,t.d=n+i*e)},skewOfOuter(t,e,s,r){v.toInnerPoint(t,e,m),v.skewOfInner(t,m,s,r)},skewOfInner(t,e,s,r=0){v.translateInner(t,e.x,e.y),v.skew(t,s,r),v.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:r,c:i,d:o,e:n,f:a}=t;t.a=e.a*s+e.b*i,t.b=e.a*r+e.b*o,t.c=e.c*s+e.d*i,t.d=e.c*r+e.d*o,t.e=e.e*s+e.f*i+n,t.f=e.e*r+e.f*o+a},multiplyParent(t,e,s,r,i){const{e:o,f:n}=t;if(s||(s=t),void 0===r&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:r,b:o,c:n,d:a}=t;s.a=r*e.a+o*e.c,s.b=r*e.b+o*e.d,s.c=n*e.a+a*e.c,s.d=n*e.b+a*e.d,i&&(s.scaleX=e.scaleX*i.scaleX,s.scaleY=e.scaleY*i.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,i&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=o*e.a+n*e.c+e.e,s.f=o*e.b+n*e.d+e.f},divide(t,e){v.multiply(t,v.tempInvert(e))},divideParent(t,e){v.multiplyParent(t,v.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=v;return v.copy(e,t),v.invert(e),e},invert(t){const{a:e,b:s,c:r,d:i,e:o,f:n}=t;if(s||r){const a=1/(e*i-s*r);t.a=i*a,t.b=-s*a,t.c=-r*a,t.d=e*a,t.e=-(o*i-n*r)*a,t.f=-(n*e-o*s)*a}else if(1===e&&1===i)t.e=-o,t.f=-n;else{const s=1/(e*i);t.a=i*s,t.d=e*s,t.e=-o*i*s,t.f=-n*e*s}},toOuterPoint(t,e,s,r){const{x:i,y:o}=e;s||(s=e),s.x=i*t.a+o*t.c,s.y=i*t.b+o*t.d,r||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,r){const{a:i,b:o,c:n,d:a}=t,h=1/(i*a-o*n),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*n)*h,s.y=(d*i-l*o)*h,!r){const{e:e,f:r}=t;s.x-=(e*a-r*n)*h,s.y-=(r*i-e*o)*h}},setLayout(t,e,s,r){const{x:i,y:o,scaleX:n,scaleY:a}=e;if(void 0===r&&(r=e.rotation||e.skewX||e.skewY),r){const{rotation:s,skewX:r,skewY:i}=e,o=s*h,l=f(o),d=_(o);if(r||i){const e=r*h,s=i*h;t.a=(l+s*-d)*n,t.b=(d+s*l)*n,t.c=(e*l-d)*a,t.d=(l+e*d)*a}else t.a=l*n,t.b=d*n,t.c=-d*a,t.d=l*a}else t.a=n,t.b=0,t.c=0,t.d=a;t.e=i,t.f=o,s&&v.translateInner(t,-s.x,-s.y)},getLayout(t,e,s){const{a:r,b:i,c:o,d:n,e:a,f:l}=t;let u,c,p,m,w,b=a,v=l;if(i||o){const t=r*n-i*o;if(o&&!s){u=y(r*r+i*i),c=t/u;const e=r/u;p=i>0?g(e):-g(e)}else{c=y(o*o+n*n),u=t/c;const e=o/c;p=d-(n>0?g(-e):-g(e))}const e=x(f(p)),a=_(p);u=x(u),c=x(c),m=e?x((o/c+a)/e/h,9):0,w=e?x((i/u-a)/e/h,9):0,p=x(p/h)}else u=r,c=n,p=m=w=0;return e&&(b+=e.x*r+e.y*o,v+=e.x*i+e.y*n),{x:b,y:v,scaleX:u,scaleY:c,rotation:p,skewX:m,skewY:w}},withScale(t,e,s=e){const r=t;if(!e||!s){const{a:r,b:i,c:o,d:n}=t;i||o?s=(r*n-i*o)/(e=y(r*r+i*i)):(e=r,s=n)}return r.scaleX=e,r.scaleY=s,r},reset(t){v.set(t)}},v=b,{toInnerPoint:B,toOuterPoint:k}=b,{sin:C,cos:T,abs:O,sqrt:P,atan2:R,min:L,PI:S}=Math,I={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},move(t,e,s){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,r=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(r-1)},rotate(t,e,s){s||(s=A.defaultPoint);const r=T(e*=h),i=C(e),o=t.x-s.x,n=t.y-s.y;t.x=s.x+o*r-n*i,t.y=s.y+o*i+n*r},tempToInnerOf(t,e){const{tempPoint:s}=A;return E(s,t),B(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=A;return E(s,t),k(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=A;return E(s,t),A.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),B(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){B(e,t,s)},toOuterOf(t,e,s){k(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,r){const i=O(s-t),o=O(r-e);return P(i*i+o*o)},getMinDistanceFrom:(t,e,s,r,i,o)=>L(M(t,e,s,r),M(s,r,i,o)),getAngle:(t,e)=>W(t,e)/h,getRotation:(t,e,s,r)=>(r||(r=e),A.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,r.x,r.y)/h),getRadianFrom(t,e,s,r,i,o,n,a){void 0===n&&(n=s,a=r);let h=R(e-r,t-s);const d=R(o-a,i-n)-h;return d<-S?d+l:d},getAtan2:(t,e)=>R(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,r){const i=W(t,e);return(e=r?e:{}).x=t.x+T(i)*s,e.y=t.y+C(i)*s,e},reset(t){A.reset(t)}},A=I,{getDistanceFrom:M,copy:E,getAtan2:W}=A;class D{constructor(t,e){this.set(t,e)}set(t,e){return"object"==typeof t?I.copy(this,t):I.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new D(this)}move(t,e){return I.move(this,t,e),this}scale(t,e){return I.scale(this,t,e),this}scaleOf(t,e,s){return I.scaleOf(this,t,e,s),this}rotate(t,e){return I.rotate(this,t,e),this}rotateOf(t,e){return I.rotate(this,e,t),this}getRotation(t,e,s){return I.getRotation(this,t,e,s)}toInnerOf(t,e){return I.toInnerOf(this,t,e),this}toOuterOf(t,e){return I.toOuterOf(this,t,e),this}getCenter(t){return new D(I.getCenter(this,t))}getDistance(t){return I.getDistance(this,t)}getDistancePoint(t,e,s){return new D(I.getDistancePoint(this,t,e,s))}getAngle(t){return I.getAngle(this,t)}getAtan2(t){return I.getAtan2(this,t)}reset(){return I.reset(this),this}}const N=new D;class Y{constructor(t,e,s,r,i,o){this.set(t,e,s,r,i,o)}set(t,e,s,r,i,o){return"object"==typeof t?b.copy(this,t):b.set(this,t,e,s,r,i,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:r,e:i,f:o}=this;return{a:t,b:e,c:s,d:r,e:i,f:o}}clone(){return new Y(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){return b.setLayout(this,t,e),this}getLayout(t,e){return b.getLayout(this,t,e)}withScale(t,e){return b.withScale(this,t,e)}reset(){b.reset(this)}}const X=new Y,z={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,r,i){F(t,e,s),F(t,e+r,s+i)},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:F}=z,{tempPointBounds:j,setPoint:H,addPoint:U,toBounds:G}=z,{toOuterPoint:q}=b,{float:V,fourNumber:Q}=a,{floor:J,ceil:Z}=Math;let $,K,tt,et;const st={},rt={},it={tempBounds:{},set(t,e=0,s=0,r=0,i=0){t.x=e,t.y=s,t.width=r,t.height=i},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,r){if(s instanceof Array){const r=Q(s);ot.set(t,e.x-r[3],e.y-r[0],e.width+r[1]+r[3],e.height+r[2]+r[0])}else r||(r=s),ot.set(t,e.x-s,e.y-r,e.width+2*s,e.height+2*r)},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),ot.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?at(e,t):e=t,s?(e.offsetX=-(ot.maxX(s)-t.x),e.offsetY=-(ot.maxY(s)-t.y)):(e.offsetX=t.x+t.width,e.offsetY=t.y+t.height),ot.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e){I.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,r=s){I.scaleOf(t,e,s,r),t.width*=s,t.height*=r},tempToOuterOf:(t,e)=>(ot.copy(ot.tempBounds,t),ot.toOuterOf(ot.tempBounds,e),ot.tempBounds),getOuterOf:(t,e)=>(t=Object.assign({},t),ot.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:r,d:i}=e;r>0?(s.width=t.width*r,s.x=e.e+t.x*r):(s.width=t.width*-r,s.x=e.e+t.x*r-s.width),i>0?(s.height=t.height*i,s.y=e.f+t.y*i):(s.height=t.height*-i,s.y=e.f+t.y*i-s.height)}else st.x=t.x,st.y=t.y,q(e,st,rt),H(j,rt.x,rt.y),st.x=t.x+t.width,q(e,st,rt),U(j,rt.x,rt.y),st.y=t.y+t.height,q(e,st,rt),U(j,rt.x,rt.y),st.x=t.x,q(e,st,rt),U(j,rt.x,rt.y),G(j,s)},toInnerOf(t,e,s){s||(s=t),ot.move(s,-e.e,-e.f),ot.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const r=Math.min(s,Math.min(t.width/e.width,t.height/e.height));return new Y(r,0,0,r,-e.x*r,-e.y*r)},getSpread(t,e,s){const r={};return ot.copyAndSpread(r,t,e,s),r},spread(t,e,s=e){ot.copyAndSpread(t,t,e,s)},ceil(t){const{x:e,y:s}=t;t.x=J(t.x),t.y=J(t.y),t.width=e>t.x?Z(t.width+e-t.x):Z(t.width),t.height=s>t.y?Z(t.height+s-t.y):Z(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=V(t.x,e),t.y=V(t.y,e),t.width=V(t.width,e),t.height=V(t.height,e)},add(t,e,s){$=t.x+t.width,K=t.y+t.height,tt=e.x,et=e.y,s||(tt+=e.width,et+=e.height),$=$>tt?$:tt,K=K>et?K:et,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=$-t.x,t.height=K-t.y},addList(t,e){ot.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){ot.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){ot.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,r=!1){let i,o=!0;for(let n=0,a=e.length;n<a;n++)i=s?s(e[n]):e[n],i&&(i.width||i.height)&&(o?(o=!1,r||at(t,i)):nt(t,i));o&&ot.reset(t)},setPoints(t,e){e.forEach(((t,e)=>0===e?H(j,t.x,t.y):U(j,t.x,t.y))),G(j,t)},addPoint(t,e){nt(t,e,!0)},getPoints(t){const{x:e,y:s,width:r,height:i}=t;return[{x:e,y:s},{x:e+r,y:s},{x:e+r,y:s+i},{x:e,y:s+i}]},hitRadiusPoint:(t,e,s)=>(s&&(e=I.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=I.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=ot.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=ot.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=ot.tempToOuterOf(e,s)),!ot.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:r,y:i,width:o,height:n}=e;return $=r+o,K=i+n,tt=t.x+t.width,et=t.y+t.height,r=r>t.x?r:t.x,i=i>t.y?i:t.y,$=$<tt?$:tt,K=K<et?K:et,o=$-r,n=K-i,{x:r,y:i,width:o,height:n}},intersect(t,e,s){ot.copy(t,ot.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){ot.set(t)}},ot=it,{add:nt,copy:at}=ot;class ht{get minX(){return it.minX(this)}get minY(){return it.minY(this)}get maxX(){return it.maxX(this)}get maxY(){return it.maxY(this)}constructor(t,e,s,r){this.set(t,e,s,r)}set(t,e,s,r){return"object"==typeof t?it.copy(this,t):it.set(this,t,e,s,r),this}get(){const{x:t,y:e,width:s,height:r}=this;return{x:t,y:e,width:s,height:r}}clone(){return new ht(this)}move(t,e){return it.move(this,t,e),this}scale(t,e){return it.scale(this,t,e),this}scaleOf(t,e,s){return it.scaleOf(this,t,e,s),this}toOuterOf(t,e){return it.toOuterOf(this,t,e),this}toInnerOf(t,e){return it.toInnerOf(this,t,e),this}getFitMatrix(t,e){return it.getFitMatrix(this,t,e)}spread(t,e){return it.spread(this,t,e),this}shrink(t){return it.spread(this,a.minus(t,!0)),this}ceil(){return it.ceil(this),this}unsign(){return it.unsign(this),this}float(t){return it.float(this,t),this}add(t){return it.add(this,t),this}addList(t){return it.setList(this,t,!0),this}setList(t){return it.setList(this,t),this}addListWithFn(t,e){return it.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return it.setListWithFn(this,t,e),this}setPoints(t){return it.setPoints(this,t),this}addPoint(t){return it.addPoint(this,t),this}getPoints(){return it.getPoints(this)}hitPoint(t,e){return it.hitPoint(this,t,e)}hitRadiusPoint(t,e){return it.hitRadiusPoint(this,t,e)}hit(t,e){return it.hit(this,t,e)}includes(t,e){return it.includes(this,t,e)}intersect(t,e){return it.intersect(this,t,e),this}getIntersect(t,e){return new ht(it.getIntersectData(this,t,e))}isSame(t){return it.isSame(this,t)}isEmpty(){return it.isEmpty(this)}reset(){it.reset(this)}}const lt=new ht;var dt,ut;exports.Direction4=void 0,(dt=exports.Direction4||(exports.Direction4={}))[dt.top=0]="top",dt[dt.right=1]="right",dt[dt.bottom=2]="bottom",dt[dt.left=3]="left",exports.Direction9=void 0,(ut=exports.Direction9||(exports.Direction9={}))[ut.topLeft=0]="topLeft",ut[ut.top=1]="top",ut[ut.topRight=2]="topRight",ut[ut.right=3]="right",ut[ut.bottomRight=4]="bottomRight",ut[ut.bottom=5]="bottom",ut[ut.bottomLeft=6]="bottomLeft",ut[ut.left=7]="left",ut[ut.center=8]="center";const ct=[{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}],pt={directionData:ct,tempPoint:{},get:_t,toPoint(t,e,s,r){s||(s={});const i=_t(t);s.x=i.x*e.width,s.y=i.y*e.height,r||(s.x+=e.x,s.y+=e.y)}};function _t(t){return"string"==typeof t?ct[exports.Direction9[t]]:t}const ft={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};class gt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new gt(t)}static set filter(t){this.filterList=yt(t)}static set exclude(t){this.excludeList=yt(t)}log(...t){if(xt.enable){if(xt.filterList.length&&xt.filterList.every((t=>t!==this.name)))return;if(xt.excludeList.length&&xt.excludeList.some((t=>t===this.name)))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){xt.enable&&this.warn(...t)}warn(...t){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 yt(t){return t?"string"==typeof t&&(t=[t]):t=[],t}gt.filterList=[],gt.excludeList=[];const xt=gt,mt=gt.get("RunTime"),wt={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const r=s.create(s.RUNTIME);return bt.currentId=bt.idMap[r]=e?performance.now():Date.now(),bt.currentName=bt.nameMap[r]=t,bt.nameToIdMap[t]=r,r},end(t,e){const s=bt.idMap[t],r=bt.nameMap[t],i=e?(performance.now()-s)/1e3:Date.now()-s;bt.idMap[t]=bt.nameMap[t]=bt.nameToIdMap[r]=void 0,mt.log(r,i,"ms")},endOfName(t,e){const s=bt.nameToIdMap[t];void 0!==s&&bt.end(s,e)}},bt=wt,vt=gt.get("UICreator"),Bt={list:{},register(t){const{__tag:e}=t.prototype;kt[e]?vt.repeat(e):kt[e]=t},get(t,e,s,r,i,o){const n=new kt[t](e);return void 0!==s&&(n.x=s,r&&(n.y=r),i&&(n.width=i),o&&(n.height=o)),n}},{list:kt}=Bt,Ct=gt.get("EventCreator"),Tt={nameList:{},register(t){let e;Object.keys(t).forEach((s=>{e=t[s],"string"==typeof e&&(Ot[e]?Ct.repeat(e):Ot[e]=t)}))},changeName(t,e){const s=Ot[t];if(s){const r=Object.keys(s).find((e=>s[e]===t));r&&(s[r]=e,Ot[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new Ot[t](...e)},{nameList:Ot}=Tt;const Pt={default:(t,e)=>(Rt(e,t),Rt(t,e),t),assign(t,e){let s;Object.keys(e).forEach((r=>{var i;s=e[r],(null==s?void 0:s.constructor)===Object&&(null===(i=t[r])||void 0===i?void 0:i.constructor)===Object?Rt(t[r],e[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))},{assign:Rt}=Pt;class Lt{get __blendMode(){if(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 r in this)"_"!==r[0]&&(s=e?e[r]:void 0,t[r]=void 0===s?this[r]: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){const e={};if(t)if(t instanceof Array)for(let s of t)e[s]=this.__getInput(s);else for(let s in t)e[s]=this.__getInput(s);else{let t,s,{__input:r}=this;e.tag=this.__leaf.tag;for(let i in this)if("_"!==i[0]&&(t=this["_"+i],void 0!==t)){if("path"===i&&!this.__pathInputed)continue;s=r?r[i]:void 0,e[i]=void 0===s?t:s}}return e}__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||e.__hasEraser||t.eraser?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 St;exports.Answer=void 0,(St=exports.Answer||(exports.Answer={}))[St.No=0]="No",St[St.Yes=1]="Yes",St[St.NoAndSkip=2]="NoAndSkip",St[St.YesAndSkip=3]="YesAndSkip";function It(t,e,s,r){var i,o=arguments.length,n=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(n=(o<3?i(n):o>3?i(e,s,n):i(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n}function At(t,e,s,r){return new(s||(s=Promise))((function(i,o){function n(t){try{h(r.next(t))}catch(t){o(t)}}function a(t){try{h(r.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(n,a)}h((r=r.apply(t,e||[])).next())}))}function Mt(t){return(e,s)=>{t||(t=s),Object.defineProperty(e,s,{get(){return this.context[t]},set(e){this.context[t]=e}})}}"function"==typeof SuppressedError&&SuppressedError;const Et=[];function Wt(){return(t,e)=>{Et.push(e)}}const Dt=[];class Nt{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||Dt)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;Et.forEach((e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))})),this.textBaseline="alphabetic"}setTransform(t,e,s,r,i,o){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,r,i,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,r,i,o)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,r){}strokeRect(t,e,s,r){}clearRect(t,e,s,r){}drawImage(t,e,s,r,i,o,n,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/r*a;r+=e,e=0,o+=t,a-=t}if(s<0){const t=-s/i*h;i+=s,s=0,n+=t,h-=t}this.context.drawImage(t,e,s,r,i,o,n,a,h);break;case 5:this.context.drawImage(t,e,s,r,i);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,r,i,o){}quadraticCurveTo(t,e,s,r){}closePath(){}arc(t,e,s,r,i,o){}arcTo(t,e,s,r,i){}ellipse(t,e,s,r,i,o,n,a){}rect(t,e,s,r){}roundRect(t,e,s,r,i){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,r){}createPattern(t,e){}createRadialGradient(t,e,s,r,i,o){}fillText(t,e,s,r){}measureText(t){}strokeText(t,e,s,r){}destroy(){this.context=null}}It([Mt("imageSmoothingEnabled")],Nt.prototype,"smooth",void 0),It([Mt("imageSmoothingQuality")],Nt.prototype,"smoothLevel",void 0),It([Mt("globalAlpha")],Nt.prototype,"opacity",void 0),It([Mt()],Nt.prototype,"fillStyle",void 0),It([Mt()],Nt.prototype,"strokeStyle",void 0),It([Mt("lineWidth")],Nt.prototype,"strokeWidth",void 0),It([Mt("lineCap")],Nt.prototype,"strokeCap",void 0),It([Mt("lineJoin")],Nt.prototype,"strokeJoin",void 0),It([Mt("lineDashOffset")],Nt.prototype,"dashOffset",void 0),It([Mt()],Nt.prototype,"miterLimit",void 0),It([Mt()],Nt.prototype,"shadowBlur",void 0),It([Mt()],Nt.prototype,"shadowColor",void 0),It([Mt()],Nt.prototype,"shadowOffsetX",void 0),It([Mt()],Nt.prototype,"shadowOffsetY",void 0),It([Mt()],Nt.prototype,"filter",void 0),It([Mt()],Nt.prototype,"font",void 0),It([Mt()],Nt.prototype,"fontKerning",void 0),It([Mt()],Nt.prototype,"fontStretch",void 0),It([Mt()],Nt.prototype,"fontVariantCaps",void 0),It([Mt()],Nt.prototype,"textAlign",void 0),It([Mt()],Nt.prototype,"textBaseline",void 0),It([Mt()],Nt.prototype,"textRendering",void 0),It([Mt()],Nt.prototype,"wordSpacing",void 0),It([Mt()],Nt.prototype,"letterSpacing",void 0),It([Mt()],Nt.prototype,"direction",void 0),It([Wt()],Nt.prototype,"setTransform",null),It([Wt()],Nt.prototype,"resetTransform",null),It([Wt()],Nt.prototype,"getTransform",null),It([Wt()],Nt.prototype,"save",null),It([Wt()],Nt.prototype,"restore",null),It([Wt()],Nt.prototype,"translate",null),It([Wt()],Nt.prototype,"scale",null),It([Wt()],Nt.prototype,"rotate",null),It([Wt()],Nt.prototype,"fill",null),It([Wt()],Nt.prototype,"stroke",null),It([Wt()],Nt.prototype,"clip",null),It([Wt()],Nt.prototype,"fillRect",null),It([Wt()],Nt.prototype,"strokeRect",null),It([Wt()],Nt.prototype,"clearRect",null),It([Wt()],Nt.prototype,"beginPath",null),It([Wt()],Nt.prototype,"moveTo",null),It([Wt()],Nt.prototype,"lineTo",null),It([Wt()],Nt.prototype,"bezierCurveTo",null),It([Wt()],Nt.prototype,"quadraticCurveTo",null),It([Wt()],Nt.prototype,"closePath",null),It([Wt()],Nt.prototype,"arc",null),It([Wt()],Nt.prototype,"arcTo",null),It([Wt()],Nt.prototype,"ellipse",null),It([Wt()],Nt.prototype,"rect",null),It([Wt()],Nt.prototype,"roundRect",null),It([Wt()],Nt.prototype,"createConicGradient",null),It([Wt()],Nt.prototype,"createLinearGradient",null),It([Wt()],Nt.prototype,"createPattern",null),It([Wt()],Nt.prototype,"createRadialGradient",null),It([Wt()],Nt.prototype,"fillText",null),It([Wt()],Nt.prototype,"measureText",null),It([Wt()],Nt.prototype,"strokeText",null);const{copy:Yt}=b,Xt={width:1,height:1,pixelRatio:1},zt=["width","height","pixelRatio"];const Ft={creator:{},parse(t,e){},convertToCanvasData(t,e){}},jt={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Ht=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},jt),Ut={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},Gt={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},qt=Object.assign(Object.assign({},Gt),jt),Vt=Ht,Qt={};for(let t in Vt)Qt[Vt[t]]=t;const Jt={};for(let t in Vt)Jt[Vt[t]]=Ut[t];const Zt={drawRoundRect(t,e,s,r,i,o){const n=a.fourNumber(o,Math.min(r/2,i/2)),h=e+r,l=s+i;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:$t,cos:Kt,atan2:te,ceil:ee,abs:se,PI:re,sqrt:ie,pow:oe}=Math,{setPoint:ne,addPoint:ae}=z,{set:he}=I,{M:le,L:de,C:ue,Q:ce,Z:pe}=Ht,_e={},fe={points(t,e,s,r){if(t.push(le,e[0],e[1]),s&&e.length>5){let i,o,n,a,h,l,d,u,c,p,_,f,g,y=e.length;const x=!0===s?.5:s;r&&(y=(e=[e[y-2],e[y-1],...e,e[0],e[1],e[2],e[3]]).length);for(let s=2;s<y-2;s+=2)i=e[s-2],o=e[s-1],n=e[s],a=e[s+1],h=e[s+2],l=e[s+3],_=ie(oe(n-i,2)+oe(a-o,2)),f=ie(oe(h-n,2)+oe(l-a,2)),g=_+f,_=x*_/g,f=x*f/g,h-=i,l-=o,d=n-_*h,u=a-_*l,2===s?r||t.push(ce,d,u,n,a):t.push(ue,c,p,d,u,n,a),c=n+f*h,p=a+f*l;r||t.push(ce,c,p,e[y-2],e[y-1])}else for(let s=2,r=e.length;s<r;s+=2)t.push(de,e[s],e[s+1]);r&&t.push(pe)},rect(t,e,s,r,i){Ft.creator.path=t,Ft.creator.moveTo(e,s).lineTo(e+r,s).lineTo(e+r,s+i).lineTo(e,s+i).lineTo(e,s)},roundRect(t,e,s,r,i,o){Ft.creator.path=[],Zt.drawRoundRect(Ft.creator,e,s,r,i,o),t.push(...Ft.convertToCanvasData(Ft.creator.path,!0))},arcTo(t,e,s,r,i,o,n,a,u,c,p){const _=r-e,f=i-s,g=o-r,y=n-i;let x=te(f,_),m=te(y,g),w=m-x;if(w<0&&(w+=l),w===re||se(_+f)<1e-12||se(g+y)<1e-12)return t&&t.push(de,r,i),u&&(ne(u,e,s),ae(u,r,i)),p&&he(p,e,s),void(c&&he(c,r,i));const b=_*y-g*f<0,v=b?-1:1,B=a/Kt(w/2),k=r+B*Kt(x+w/2+d*v),C=i+B*$t(x+w/2+d*v);return x-=d*v,m-=d*v,xe(t,k,C,a,a,0,x/h,m/h,b,u,c,p)},arc:(t,e,s,r,i,o,n,a,h,l)=>xe(t,e,s,r,r,0,i,o,n,a,h,l),ellipse(t,e,s,r,i,o,n,a,u,c,p,_){const f=o*h,g=$t(f),y=Kt(f);let x=n*h,m=a*h;x>re&&(x-=l),m<0&&(m+=l);let w=m-x;w<0?w+=l:w>l&&(w-=l),u&&(w-=l);const b=ee(se(w/d)),v=w/b,B=$t(v/4),k=8/3*B*B/$t(v/2);m=x+v;let C,T,O,P,R,L,S,I,A=Kt(x),M=$t(x),E=O=y*r*A-g*i*M,W=P=g*r*A+y*i*M,D=e+O,N=s+P;t&&t.push(de,D,N),c&&ne(c,D,N),_&&he(_,D,N);for(let o=0;o<b;o++)C=Kt(m),T=$t(m),O=y*r*C-g*i*T,P=g*r*C+y*i*T,R=e+E-k*(y*r*M+g*i*A),L=s+W-k*(g*r*M-y*i*A),S=e+O+k*(y*r*T+g*i*C),I=s+P+k*(g*r*T-y*i*C),t&&t.push(ue,R,L,S,I,e+O,s+P),c&&ye(e+E,s+W,R,L,S,I,e+O,s+P,c,!0),E=O,W=P,A=C,M=T,x=m,m+=v;p&&he(p,e+O,s+P)},quadraticCurveTo(t,e,s,r,i,o,n){t.push(ue,(e+2*r)/3,(s+2*i)/3,(o+2*r)/3,(n+2*i)/3,o,n)},toTwoPointBoundsByQuadraticCurve(t,e,s,r,i,o,n,a){ye(t,e,(t+2*s)/3,(e+2*r)/3,(i+2*s)/3,(o+2*r)/3,i,o,n,a)},toTwoPointBounds(t,e,s,r,i,o,n,a,h,l){const d=[];let u,c,p,_,f,g,y,x,m=t,w=s,b=i,v=n;for(let t=0;t<2;++t)if(1==t&&(m=e,w=r,b=o,v=a),u=-3*m+9*w-9*b+3*v,c=6*m-12*w+6*b,p=3*w-3*m,Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;_=-p/c,0<_&&_<1&&d.push(_)}else y=c*c-4*p*u,x=Math.sqrt(y),y<0||(f=(-c+x)/(2*u),0<f&&f<1&&d.push(f),g=(-c-x)/(2*u),0<g&&g<1&&d.push(g));l?ae(h,t,e):ne(h,t,e),ae(h,n,a);for(let l=0,u=d.length;l<u;l++)ge(d[l],t,e,s,r,i,o,n,a,_e),ae(h,_e.x,_e.y)},getPointAndSet(t,e,s,r,i,o,n,a,h,l){const d=1-t,u=d*d*d,c=3*d*d*t,p=3*d*t*t,_=t*t*t;l.x=u*e+c*r+p*o+_*a,l.y=u*s+c*i+p*n+_*h},getPoint(t,e,s,r,i,o,n,a,h){const l={};return ge(t,e,s,r,i,o,n,a,h,l),l}},{getPointAndSet:ge,toTwoPointBounds:ye,ellipse:xe}=fe,{sin:me,cos:we,sqrt:be,atan2:ve}=Math,{ellipse:Be}=fe,ke={ellipticalArc(e,s,r,i,o,n,a,d,u,c,p){const _=(u-s)/2,f=(c-r)/2,g=n*h,y=me(g),x=we(g),m=-x*_-y*f,w=-x*f+y*_,b=i*i,v=o*o,B=w*w,k=m*m,C=b*v-b*B-v*k;let T=0;if(C<0){const t=be(1-C/(b*v));i*=t,o*=t}else T=(a===d?-1:1)*be(C/(b*B+v*k));const O=T*i*w/o,P=-T*o*m/i,R=ve((w-P)/o,(m-O)/i),L=ve((-w-P)/o,(-m-O)/i);let S=L-R;0===d&&S>0?S-=l:1===d&&S<0&&(S+=l);const I=s+_+x*O-y*P,A=r+f+y*O+x*P,M=S<0?1:0;p||t.ellipseToCurve?Be(e,I,A,i,o,n,R/h,L/h,M):i!==o||n?e.push(Ht.G,I,A,i,o,n,R/h,L/h,M):e.push(Ht.O,I,A,i,R/h,L/h,M)}},{M:Ce,m:Te,L:Oe,l:Pe,H:Re,h:Le,V:Se,v:Ie,C:Ae,c:Me,S:Ee,s:We,Q:De,q:Ne,T:Ye,t:Xe,A:ze,a:Fe,Z:je,z:He,N:Ue,D:Ge,X:qe,G:Ve,F:Qe,O:Je,P:Ze,U:$e}=Ht,{rect:Ke,roundRect:ts,arcTo:es,arc:ss,ellipse:rs,quadraticCurveTo:is}=fe,{ellipticalArc:os}=ke,ns=gt.get("PathConvert"),as={},hs={current:{dot:0},stringify(t,e){let s,r,i,o=0,n=t.length,h="";for(;o<n;){r=t[o],s=Jt[r],h+=r===i?" ":Qt[r];for(let r=1;r<s;r++)h+=a.float(t[o+r],e),r===s-1||(h+=" ");i=r,o+=s}return h},parse(t,e){let s,r,i,o="";const n=[],a=e?qt:Gt;for(let e=0,h=t.length;e<h;e++)r=t[e],ft[r]?("."===r&&(ls.dot++,ls.dot>1&&(ds(n,o),o="")),o+=r):Ht[r]?(o&&(ds(n,o),o=""),ls.name=Ht[r],ls.length=Ut[r],ls.index=0,ds(n,ls.name),!s&&a[r]&&(s=!0)):"-"===r||"+"===r?"e"===i||"E"===i?o+=r:(o&&ds(n,o),o=r):o&&(ds(n,o),o=""),i=r;return o&&ds(n,o),s?hs.toCanvasData(n,e):n},toCanvasData(t,e){let s,r,i,o,n,a=0,h=0,l=0,d=0,u=0,c=t.length;const p=[];for(;u<c;){switch(i=t[u],i){case Te:t[u+1]+=a,t[u+2]+=h;case Ce:a=t[u+1],h=t[u+2],p.push(Ce,a,h),u+=3;break;case Le:t[u+1]+=a;case Re:a=t[u+1],p.push(Oe,a,h),u+=2;break;case Ie:t[u+1]+=h;case Se:h=t[u+1],p.push(Oe,a,h),u+=2;break;case Pe:t[u+1]+=a,t[u+2]+=h;case Oe:a=t[u+1],h=t[u+2],p.push(Oe,a,h),u+=3;break;case We:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=Ee;case Ee:n=o===Ae||o===Ee,l=n?2*a-s:t[u+1],d=n?2*h-r:t[u+2],s=t[u+1],r=t[u+2],a=t[u+3],h=t[u+4],p.push(Ae,l,d,s,r,a,h),u+=5;break;case Me:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,t[u+5]+=a,t[u+6]+=h,i=Ae;case Ae:s=t[u+3],r=t[u+4],a=t[u+5],h=t[u+6],p.push(Ae,t[u+1],t[u+2],s,r,a,h),u+=7;break;case Xe:t[u+1]+=a,t[u+2]+=h,i=Ye;case Ye:n=o===De||o===Ye,s=n?2*a-s:t[u+1],r=n?2*h-r:t[u+2],e?is(p,a,h,s,r,t[u+1],t[u+2]):p.push(De,s,r,t[u+1],t[u+2]),a=t[u+1],h=t[u+2],u+=3;break;case Ne:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=De;case De:s=t[u+1],r=t[u+2],e?is(p,a,h,s,r,t[u+3],t[u+4]):p.push(De,s,r,t[u+3],t[u+4]),a=t[u+3],h=t[u+4],u+=5;break;case Fe:t[u+6]+=a,t[u+7]+=h;case ze:os(p,a,h,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],e),a=t[u+6],h=t[u+7],u+=8;break;case He:case je:p.push(je),u++;break;case Ue:a=t[u+1],h=t[u+2],e?Ke(p,a,h,t[u+3],t[u+4]):us(p,t,u,5),u+=5;break;case Ge:a=t[u+1],h=t[u+2],e?ts(p,a,h,t[u+3],t[u+4],[t[u+5],t[u+6],t[u+7],t[u+8]]):us(p,t,u,9),u+=9;break;case qe:a=t[u+1],h=t[u+2],e?ts(p,a,h,t[u+3],t[u+4],t[u+5]):us(p,t,u,6),u+=6;break;case Ve:rs(e?p:us(p,t,u,9),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],t[u+8],null,as),a=as.x,h=as.y,u+=9;break;case Qe:e?rs(p,t[u+1],t[u+2],t[u+3],t[u+4],0,0,360,!1):us(p,t,u,5),a=t[u+1]+t[u+3],h=t[u+2],u+=5;break;case Je:ss(e?p:us(p,t,u,7),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],null,as),a=as.x,h=as.y,u+=7;break;case Ze:e?ss(p,t[u+1],t[u+2],t[u+3],0,360,!1):us(p,t,u,4),a=t[u+1]+t[u+3],h=t[u+2],u+=4;break;case $e:es(e?p:us(p,t,u,6),a,h,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],null,as),a=as.x,h=as.y,u+=6;break;default:return ns.error(`command: ${i} [index:${u}]`,t),p}o=i}return p},copyData(t,e,s,r){for(let i=s,o=s+r;i<o;i++)t.push(e[i])},pushData(t,e){ls.index===ls.length&&(ls.index=1,t.push(ls.name)),t.push(Number(e)),ls.index++,ls.dot=0}},{current:ls,pushData:ds,copyData:us}=hs,{M:cs,L:ps,C:_s,Q:fs,Z:gs,N:ys,D:xs,X:ms,G:ws,F:bs,O:vs,P:Bs,U:ks}=Ht,{getMinDistanceFrom:Cs,getRadianFrom:Ts}=I,{tan:Os,min:Ps,abs:Rs}=Math,Ls={},Ss={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,r,i,o,n){t.push(_s,e,s,r,i,o,n)},quadraticCurveTo(t,e,s,r,i){t.push(fs,e,s,r,i)},closePath(t){t.push(gs)},rect(t,e,s,r,i){t.push(ys,e,s,r,i)},roundRect(t,e,s,r,i,o){if("number"==typeof o)t.push(ms,e,s,r,i,o);else{const n=a.fourNumber(o);n?t.push(xs,e,s,r,i,...n):t.push(ys,e,s,r,i)}},ellipse(t,e,s,r,i,o,n,a,h){void 0===o?t.push(bs,e,s,r,i):(void 0===n&&(n=0),void 0===a&&(a=360),t.push(ws,e,s,r,i,o,n,a,h?1:0))},arc(t,e,s,r,i,o,n){void 0===i?t.push(Bs,e,s,r):(void 0===o&&(o=360),t.push(vs,e,s,r,i,o,n?1:0))},arcTo(t,e,s,r,i,o,n,a){if(void 0!==n){const h=Os(Ts(n,a,e,s,r,i)/2)*(Cs(n,a,e,s,r,i)/2);t.push(ks,e,s,r,i,Ps(o,Rs(h)))}else t.push(ks,e,s,r,i,o)},drawEllipse(t,e,s,r,i,o,n,a,h){fe.ellipse(null,e,s,r,i,void 0===o?0:o,void 0===n?0:n,void 0===a?360:a,h,null,null,Ls),t.push(cs,Ls.x,Ls.y),Is(t,e,s,r,i,o,n,a,h)},drawArc(t,e,s,r,i,o,n){fe.arc(null,e,s,r,void 0===i?0:i,void 0===o?360:o,n,null,null,Ls),t.push(cs,Ls.x,Ls.y),As(t,e,s,r,i,o,n)},drawPoints(t,e,s,r){fe.points(t,e,s,r)}},{ellipse:Is,arc:As}=Ss,{moveTo:Ms,lineTo:Es,quadraticCurveTo:Ws,bezierCurveTo:Ds,closePath:Ns,beginPath:Ys,rect:Xs,roundRect:zs,ellipse:Fs,arc:js,arcTo:Hs,drawEllipse:Us,drawArc:Gs,drawPoints:qs}=Ss;class Vs{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.clearPath=this.beginPath,this.set(t)}set(t){return this.__path=t?"string"==typeof t?Ft.parse(t):t:[],this}beginPath(){return Ys(this.__path),this}moveTo(t,e){return Ms(this.__path,t,e),this}lineTo(t,e){return Es(this.__path,t,e),this}bezierCurveTo(t,e,s,r,i,o){return Ds(this.__path,t,e,s,r,i,o),this}quadraticCurveTo(t,e,s,r){return Ws(this.__path,t,e,s,r),this}closePath(){return Ns(this.__path),this}rect(t,e,s,r){return Xs(this.__path,t,e,s,r),this}roundRect(t,e,s,r,i){return zs(this.__path,t,e,s,r,i),this}ellipse(t,e,s,r,i,o,n,a){return Fs(this.__path,t,e,s,r,i,o,n,a),this}arc(t,e,s,r,i,o){return js(this.__path,t,e,s,r,i,o),this}arcTo(t,e,s,r,i){return Hs(this.__path,t,e,s,r,i),this}drawEllipse(t,e,s,r,i,o,n,a){return Us(this.__path,t,e,s,r,i,o,n,a),this}drawArc(t,e,s,r,i,o){return Gs(this.__path,t,e,s,r,i,o),this}drawPoints(t,e,s){return qs(this.__path,t,e,s),this}}const{M:Qs,L:Js,C:Zs,Q:$s,Z:Ks,N:tr,D:er,X:sr,G:rr,F:ir,O:or,P:nr,U:ar}=Ht,hr=gt.get("PathDrawer"),lr={drawPathByData(t,e){if(!e)return;let s,r=0,i=e.length;for(;r<i;)switch(s=e[r],s){case Qs:t.moveTo(e[r+1],e[r+2]),r+=3;break;case Js:t.lineTo(e[r+1],e[r+2]),r+=3;break;case Zs:t.bezierCurveTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5],e[r+6]),r+=7;break;case $s:t.quadraticCurveTo(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case Ks:t.closePath(),r+=1;break;case tr:t.rect(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case er:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],[e[r+5],e[r+6],e[r+7],e[r+8]]),r+=9;break;case sr:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;case rr:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]*h,e[r+6]*h,e[r+7]*h,e[r+8]),r+=9;break;case ir:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],0,0,l,!1),r+=5;break;case or:t.arc(e[r+1],e[r+2],e[r+3],e[r+4]*h,e[r+5]*h,e[r+6]),r+=7;break;case nr:t.arc(e[r+1],e[r+2],e[r+3],0,l,!1),r+=4;break;case ar:t.arcTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;default:return void hr.error(`command: ${s} [index:${r}]`,e)}}},{M:dr,L:ur,C:cr,Q:pr,Z:_r,N:fr,D:gr,X:yr,G:xr,F:mr,O:wr,P:br,U:vr}=Ht,{toTwoPointBounds:Br,toTwoPointBoundsByQuadraticCurve:kr,arcTo:Cr,arc:Tr,ellipse:Or}=fe,{addPointBounds:Pr,copy:Rr,addPoint:Lr,setPoint:Sr,addBounds:Ir,toBounds:Ar}=z,Mr=gt.get("PathBounds");let Er,Wr,Dr;const Nr={},Yr={},Xr={},zr={toBounds(t,e){zr.toTwoPointBounds(t,Yr),Ar(Yr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Sr(e,0,0);let s,r,i,o,n,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(s=t[a],0===a&&(s===_r||s===cr||s===pr?Sr(e,h,l):Sr(e,t[a+1],t[a+2])),s){case dr:case ur:h=t[a+1],l=t[a+2],Lr(e,h,l),a+=3;break;case cr:o=t[a+5],n=t[a+6],Br(h,l,t[a+1],t[a+2],t[a+3],t[a+4],o,n,Nr),Pr(e,Nr),h=o,l=n,a+=7;break;case pr:r=t[a+1],i=t[a+2],o=t[a+3],n=t[a+4],kr(h,l,r,i,o,n,Nr),Pr(e,Nr),h=o,l=n,a+=5;break;case _r:a+=1;break;case fr:h=t[a+1],l=t[a+2],Ir(e,h,l,t[a+3],t[a+4]),a+=5;break;case gr:case yr:h=t[a+1],l=t[a+2],Ir(e,h,l,t[a+3],t[a+4]),a+=s===gr?9:6;break;case xr:Or(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],Nr,Xr),0===a?Rr(e,Nr):Pr(e,Nr),h=Xr.x,l=Xr.y,a+=9;break;case mr:h=t[a+1],l=t[a+2],Wr=t[a+3],Dr=t[a+4],Ir(e,h-Wr,l-Dr,2*Wr,2*Dr),h+=Wr,a+=5;break;case wr:Tr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Nr,Xr),0===a?Rr(e,Nr):Pr(e,Nr),h=Xr.x,l=Xr.y,a+=7;break;case br:h=t[a+1],l=t[a+2],Er=t[a+3],Ir(e,h-Er,l-Er,2*Er,2*Er),h+=Er,a+=4;break;case vr:Cr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Nr,Xr),0===a?Rr(e,Nr):Pr(e,Nr),h=Xr.x,l=Xr.y,a+=6;break;default:return void Mr.error(`command: ${s} [index:${a}]`,t)}}},{M:Fr,L:jr,C:Hr,Z:Ur}=Ht,{getCenterX:Gr,getCenterY:qr}=I,{arcTo:Vr}=Ss,Qr={smooth(t,e,s){let r,i=0,o=0,n=0,a=0,h=0,l=0,d=0,u=0,c=0;const p=t.length,_=[];for(;i<p;)switch(r=t[i],r){case Fr:a=u=t[i+1],h=c=t[i+2],i+=3,t[i]===jr?(l=t[i+1],d=t[i+2],_.push(Fr,Gr(a,l),qr(h,d))):_.push(Fr,a,h);break;case jr:switch(o=t[i+1],n=t[i+2],i+=3,t[i]){case jr:Vr(_,o,n,t[i+1],t[i+2],e,u,c);break;case Ur:Vr(_,o,n,a,h,e,u,c);break;default:_.push(jr,o,n)}u=o,c=n;break;case Hr:_.push(Hr,t[i+1],t[i+2],t[i+3],t[i+4],t[i+5],t[i+6]),i+=7;break;case Ur:Vr(_,a,h,l,d,e,u,c),_.push(Ur),i+=1}return r!==Ur&&(_[1]=a,_[2]=h),_}};Ft.creator=new Vs,Ft.parse=hs.parse,Ft.convertToCanvasData=hs.toCanvasData;const Jr=new Vs,{drawRoundRect:Zr}=Zt;const $r={opacityTypes:["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=Kr.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{}}}},Kr=$r;Kr.opacityTypes.forEach((t=>Kr.upperCaseTypeMap[t]=t.toUpperCase()));const ti=gt.get("TaskProcessor");class ei{constructor(t){this.parallel=!0,this.time=1,this.id=s.create(s.TASK),this.task=t}run(){return At(this,void 0,void 0,(function*(){try{this.task&&!this.isComplete&&this.parent.running&&(yield this.task())}catch(t){ti.error(t)}}))}complete(){this.isComplete=!0,this.parent=null,this.task=null}cancel(){this.isCancel=!0,this.complete()}}class si{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 r=0;r<t;r++)r<=this.finishedIndex?(s+=this.list[r].time,r===this.finishedIndex&&(e=s)):e+=this.list[r].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&&Pt.assign(this.config,t),this.empty()}add(t,e){let s,r,i,o;const n=new ei(t);return n.parent=this,"number"==typeof e?o=e:e&&(r=e.parallel,s=e.start,i=e.time,o=e.delay),i&&(n.time=i),!1===r&&(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,r=this.finishedIndex+s;if(e.length){if(!this.running)return;r<this.total&&(t=this.list[r],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 ri={map:{},recycledList:[],tasker:new si,patternTasker:new si,get isComplete(){return ii.tasker.isComplete},get(t){let s=ii.map[t.url];return s||(s=e.image(t),ii.map[t.url]=s),s.use++,s},recycle(t){t.use--,setTimeout((()=>{t.use||ii.recycledList.push(t)}))},clearRecycled(){const t=ii.recycledList;t.length>100&&(t.forEach((t=>{!t.use&&t.url&&(delete ii.map[t.url],t.destroy())})),t.length=0)},hasOpacityPixel:t=>$r.opacityTypes.some((e=>ii.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;return!1},destroy(){ii.map={},ii.recycledList=[]}},ii=ri,{IMAGE:oi,create:ni}=s;function ai(t,e,s){Object.defineProperty(t,e,s)}function hi(t,e){return Object.getOwnPropertyDescriptor(t,e)}function li(t,e){return(s,r)=>ui(s,r,t,e&&e(r))}function di(t){return t}function ui(t,e,s,r){const i={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)},configurable:!0,enumerable:!0};ai(t,e,Object.assign(i,r||{})),xi(t,e,s)}function ci(t,e){return li(t,(t=>({set(s){this.__setAttr(t,s,e)&&pi(this)}})))}function pi(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}const _i=ci;function fi(t){return li(t,(t=>({set(e){this.__setAttr(t,e)&&gi(this)}})))}function gi(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&pi(t)}const yi=fi;function xi(t,e,s){const r=t.__DataProcessor.prototype,i="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),n={get(){const t=this[i];return void 0===t?s:t},set(t){this[i]=t},configurable:!0,enumerable:!0};void 0===s?n.get=function(){return this[i]}:"width"===e?n.get=function(){const t=this[i];return void 0===t?this.__naturalWidth||s:t}:"height"===e&&(n.get=function(){const t=this[i];return void 0===t?this.__naturalHeight||s:t});let a,h=r;for(;!a&&h;)a=hi(h,e),h=h.__proto__;a&&a.set&&(n.set=a.set),r[o]&&(n.set=r[o],delete r[o]),Object.defineProperty(r,e,n)}const mi=new gt("rewrite"),wi=[],bi=["destroy","constructor"];function vi(t){wi.length&&(wi.forEach((e=>{t&&mi.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()})),wi.length=0)}function Bi(t,e){return s=>{var r;(t.prototype?(r=t.prototype,Object.getOwnPropertyNames(r)):Object.keys(t)).forEach((r=>{if(!(bi.includes(r)||e&&e.includes(r)))if(t.prototype){hi(t.prototype,r).writable&&(s.prototype[r]=t.prototype[r])}else s.prototype[r]=t[r]}))}}setTimeout((()=>vi(!0)));const{copy:ki,toInnerPoint:Ci,scaleOfOuter:Ti,rotateOfOuter:Oi,skewOfOuter:Pi,multiplyParent:Ri,divideParent:Li,getLayout:Si}=b,Ii={},Ai={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),Wi(t,e,s),t.isBranch){const{children:r}=t;for(let t=0,i=r.length;t<i;t++)Ei(r[t],e,s)}},updateMatrix(t,e,s){const r=t.__layout;e?s&&(r.waitAutoLayout=!0,t.__hasAutoLayout&&(r.matrixChanged=!1)):r.waitAutoLayout&&(r.waitAutoLayout=!1),r.matrixChanged&&t.__updateLocalMatrix(),r.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++)Di(e[t])}},updateAllChange(t){if(Di(t),t.__updateChange(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)Ni(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},moveWorld(t,e,s){const r={x:e,y:s};t.parent&&Ci(t.parent.worldTransform,r,r,!0),Mi.moveLocal(t,r.x,r.y)},moveLocal(t,e,s=0){t.x+=e,t.y+=s},zoomOfWorld(t,e,s,r,i){Mi.zoomOfLocal(t,Xi(t,e),s,r,i)},zoomOfLocal(t,e,s,r=s,i){ki(Ii,t.__localMatrix),Ti(Ii,e,s,r),Yi(t,Ii),t.scaleResize(s,r,!0!==i)},rotateOfWorld(t,e,s){Mi.rotateOfLocal(t,Xi(t,e),s)},rotateOfLocal(t,e,s){ki(Ii,t.__localMatrix),Oi(Ii,e,s),Yi(t,Ii),t.rotation=a.formatRotation(t.rotation+s)},skewOfWorld(t,e,s,r,i){Mi.skewOfLocal(t,Xi(t,e),s,r,i)},skewOfLocal(t,e,s,r=0,i){ki(Ii,t.__localMatrix),Pi(Ii,e,s,r),Mi.setTransform(t,Ii,i)},transformWorld(t,e,s){ki(Ii,t.worldTransform),Ri(Ii,e),t.parent&&Li(Ii,t.parent.worldTransform),Mi.setTransform(t,Ii,s)},transform(t,e,s){ki(Ii,t.localTransform),Ri(Ii,e),Mi.setTransform(t,Ii,s)},setTransform(t,e,s){const r=Si(e);s&&(t.scaleResize(r.scaleX/t.scaleX,r.scaleY/t.scaleY,!0!==s),delete r.scaleX,delete r.scaleY),t.set(r)},getRelativeWorld:(t,e,s)=>(ki(Ii,t.worldTransform),Li(Ii,e.worldTransform),s?Ii:Object.assign({},Ii)),drop(t,e,s,r){t.setTransform(Mi.getRelativeWorld(t,e,!0),r),e.add(t,s)},hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},hasParentAutoLayout(t){for(;t.parent;)if((t=t.parent).__hasAutoLayout)return!0}},Mi=Ai,{updateAllMatrix:Ei,updateMatrix:Wi,updateAllWorldOpacity:Di,updateAllChange:Ni}=Mi;function Yi(t,e){const{e:s,f:r}=t.__localMatrix;t.x+=e.e-s,t.y+=e.f-r}function Xi(t,e){return t.__layout.update(),t.parent?I.tempToInnerOf(e,t.parent.__world):e}const zi={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser?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:Fi}=Ai,ji={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 r=0,i=s.length;r<i;r++)(t=s[r]).isBranch&&(t.__tempNumber=1,e.add(t),Hi(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:r}=t;for(let t=0,s=r.length;t<s;t++)r[t].isBranch&&e.push(r[t]);for(let t=s,r=e.length;t<r;t++)Ui(e[t],e)},updateBounds(t,e){const s=[t];Ui(t,s),Gi(s,e)},updateBoundsByBranchStack(t,e){let s,r;for(let i=t.length-1;i>-1;i--){s=t[i],r=s.children;for(let t=0,e=r.length;t<e;t++)Fi(r[t]);e&&e===s||Fi(s)}}},{pushAllChildBranch:Hi,pushAllBranchStack:Ui,updateBoundsByBranchStack:Gi}=ji,qi={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:Vi}=Ai,{toOuterOf:Qi,getPoints:Ji,copy:Zi}=it;class $i{get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}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.boxBounds={x:0,y:0,width:0,height:0},this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),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{leafer:e}=this.leaf;if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=this.leaf;for(;e.parent&&!e.parent.leafer;)e=e.parent;t.layout(e)}}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 Vi(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 ht(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"margin":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"margin":case"content":case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"content":if(this.contentBounds)return this.getWorldContentBounds();case"margin":case"box":return this.getWorldBoxBounds();case"margin":case"stroke":return this.getWorldStrokeBounds()}}getLayoutBounds(t,e="world",s){const{leaf:r}=this;let i,o,n=this.getInnerBounds(t);switch(e){case"world":i=r.getWorldPoint(n),o=r.__world;break;case"local":i=r.getLocalPointByInner(n),o=r.__localMatrix;break;case"inner":i=n,o=b.defaultMatrix;break;case"page":e=r.zoomLayer;default:i=r.getWorldPoint(n,e),o=Vi(r,e,!0)}const a=b.getLayout(o);if(Zi(a,n),I.copy(a,i),s){const{scaleX:t,scaleY:e}=a,s=Math.abs(t),r=Math.abs(e);1===s&&1===r||(a.scaleX/=s,a.scaleY/=r,a.width*=s,a.height*=r)}return a}getLayoutPoints(t,e="world"){const{leaf:s}=this,r=Ji(this.getInnerBounds(t));let i;switch(e){case"world":i=null;break;case"local":i=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:i=e}return void 0!==i&&r.forEach((t=>s.innerToWorld(t,null,!1,i))),r}getWorldContentBounds(){return this._worldContentBounds||(this._worldContentBounds={}),Qi(this.contentBounds,this.leaf.__world,this._worldContentBounds),this._worldContentBounds}getWorldBoxBounds(){return this._worldBoxBounds||(this._worldBoxBounds={}),Qi(this.boxBounds,this.leaf.__world,this._worldBoxBounds),this._worldBoxBounds}getWorldStrokeBounds(){return this._worldStrokeBounds||(this._worldStrokeBounds={}),Qi(this.strokeBounds,this.leaf.__world,this._worldStrokeBounds),this._worldStrokeBounds}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}spreadStroke(){const{x:t,y:e,width:s,height:r}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:r},this._localStrokeBounds={x:t,y:e,width:s,height:r},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:r}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:r},this._localRenderBounds={x:t,y:e,width:s,height:r}}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=!0,this.leaf.forceUpdate("surface"))}destroy(){}}const Ki={},to={on(t,e,s){let r,i,o;s&&("boolean"==typeof s?r=s:(r=s.capture,i=s.once));const n=eo(this,r,!0),a="string"==typeof t?t.split(" "):t,h=i?{listener:e,once:i}:{listener:e};a.forEach((t=>{t&&(o=n[t],o?-1===o.findIndex((t=>t.listener===e))&&o.push(h):n[t]=[h])}))},off(t,e,s){let r,i,o;s&&(r="boolean"==typeof s?s:s.capture);const n=eo(this,r);("string"==typeof t?t.split(" "):t).forEach((t=>{t&&(i=n[t],i&&(o=i.findIndex((t=>t.listener===e)),o>-1&&i.splice(o,1),i.length||delete n[t]))}))},on_(t,e,s,r){return s&&(e=e.bind(s)),this.on(t,e,r),{type:t,current:this,listener:e,options:r}},off_(t){if(!t)return;const e=t instanceof Array?t:[t];e.forEach((t=>t.current.off(t.type,t.listener,t.options))),e.length=0},once(t,e,s){this.on(t,e,{once:!0,capture:s})},emit(t,e,s){!e&&Tt.has(t)&&(e=Tt.get(t,{type:t,target:this,current:this}));const r=eo(this,s)[t];if(r){let i;for(let o=0,n=r.length;o<n&&(i=r[o],i.listener(e),i.once&&(this.off(t,i.listener,s),o--,n--),!e||!e.isStopNow);o++);}},emitEvent(t,e){t.current=this,this.emit(t.type,t,e)},hasEvent(t,e){const{__bubbleMap:s,__captureMap:r}=this,i=s&&s[t],o=r&&r[t];return!!(void 0===e?i||o:e?o:i)}};function eo(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:Ki)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:Ki)}}class so{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&t.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&t.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&t.event.stop(this.origin)}}class ro extends so{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}ro.ADD="child.add",ro.REMOVE="child.remove",ro.DESTROY="child.destroy";class io extends so{constructor(t,e,s,r,i){super(t,e),this.attrName=s,this.oldValue=r,this.newValue=i}}io.CHANGE="property.change",io.LEAFER_CHANGE="property.leafer_change";class oo extends so{constructor(t,e){super(t),Object.assign(this,e)}}oo.LOAD="image.load",oo.LOADED="image.loaded",oo.ERROR="image.error";class no extends so{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(no.RESIZE),Object.assign(this,t)):super(t),this.old=e}}no.RESIZE="resize";class ao extends so{constructor(t,e){super(t),this.data=e}}ao.REQUEST="watch.request",ao.DATA="watch.data";class ho extends so{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}ho.CHECK_UPDATE="layout.check_update",ho.REQUEST="layout.request",ho.START="layout.start",ho.BEFORE="layout.before",ho.LAYOUT="layout",ho.AFTER="layout.after",ho.AGAIN="layout.again",ho.END="layout.end";class lo extends so{}lo.FRAME="animate.frame";class uo extends so{constructor(t,e,s,r){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=r)}}uo.REQUEST="render.request",uo.START="render.start",uo.BEFORE="render.before",uo.RENDER="render",uo.AFTER="render.after",uo.AGAIN="render.again",uo.END="render.end",uo.NEXT="render.next";class co extends so{}co.START="leafer.start",co.BEFORE_READY="leafer.before_ready",co.READY="leafer.ready",co.AFTER_READY="leafer.after_ready",co.VIEW_READY="leafer.view_ready",co.VIEW_COMPLETED="leafer.view_completed",co.STOP="leafer.stop",co.RESTART="leafer.restart",co.END="leafer.end";const{isFinite:po}=Number,_o=gt.get("setAttr"),fo={__setAttr(t,e,s){if(this.leafer&&this.leafer.created){const r=this.__.__getInput(t);if(s&&!po(e)&&void 0!==e&&(_o.warn(this.innerName,t,e),e=void 0),"object"==typeof e||r!==e){this.__[t]=e,this.__proxyData&&this.setProxyAttr(t,e);const{CHANGE:s}=io,i=new io(s,this,t,r,e);return this.isLeafer?this.emitEvent(new io(io.LEAFER_CHANGE,this,t,r,e)):this.hasEvent(s)&&this.emitEvent(i),this.leafer.emitEvent(i),!0}return!1}return this.__[t]=e,this.__proxyData&&this.setProxyAttr(t,e),!0},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:go,multiplyParent:yo,translateInner:xo,defaultWorld:mo}=b,{toPoint:wo,tempPoint:bo}=pt,vo={__updateWorldMatrix(){yo(this.__local||this.__layout,this.parent?this.parent.__world:mo,this.__world,!!this.__layout.affectScaleOrRotation,this.__)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged||t.rotationChanged)&&(go(e,s,null,t.affectRotation),t.scaleChanged=t.rotationChanged=!1),e.e=s.x,e.f=s.y,s.around&&(wo(s.around,t.boxBounds,bo),xo(e,-bo.x,-bo.y))}this.__layout.matrixChanged=!1}},{updateMatrix:Bo,updateAllMatrix:ko,hasParentAutoLayout:Co}=Ai,{updateBounds:To}=ji,{toOuterOf:Oo,copyAndSpread:Po,copy:Ro}=it,{toBounds:Lo}=zr,So={__updateWorldBounds(){Oo(this.__layout.renderBounds,this.__world,this.__world),this.__layout.resized&&(this.__onUpdateSize(),this.__layout.resized=!1)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.boxChanged=!1,t.resized=!0),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=!1,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=!1,t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized=!0),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=!1,this.parent&&this.parent.__layout.renderChange()),t.boundsChanged=!1},__updateLocalBoxBounds(){this.__hasAutoLayout&&this.__updateAutoLayout(),Oo(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Oo(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Oo(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(){const t=this.__layout.boxBounds,e=this.__;e.__pathInputed?Lo(e.__pathForRender,t):(t.x=0,t.y=0,t.width=e.width,t.height=e.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.leafer&&this.leafer.layouter.addExtra(this),Co(this)?Bo(this):(ko(this),To(this,this))):Bo(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(){Po(this.__layout.strokeBounds,this.__layout.boxBounds,this.__layout.strokeSpread)},__updateRenderBounds(){const{renderSpread:t,strokeBounds:e,renderBounds:s}=this.__layout;t>0?Po(s,e,t):Ro(s,e)}},Io={__render(t,e){if(this.__worldOpacity)if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=this.__.opacity,this.__.__single){const s=t.getSameCanvas(!0,!0);this.__draw(s,e),this.__worldFlipped?t.copyWorldByReset(s,this.__nowWorld,null,this.__.__blendMode,!0):t.copyWorldToInner(s,this.__nowWorld,this.__layout.renderBounds,this.__.__blendMode),s.recycle(this.__nowWorld)}else this.__draw(t,e)},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),this.__.windingRule?t.clip(this.__.windingRule):t.clip())},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:Ao}=zi,Mo={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__worldOpacity)if(this.__.__single){const s=t.getSameCanvas(!1,!0);this.__renderBranch(s,e);const r=this.__getNowWorld(e);t.opacity=this.__.opacity,t.copyWorldByReset(s,r,r,this.__.__blendMode,!0),s.recycle(r)}else this.__renderBranch(t,e)},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let r=0,i=s.length;r<i;r++)Ao(s[r],e)||s[r].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let r=0,i=s.length;r<i;r++)Ao(s[r],e)||s[r].__clip(t,e)}}},{LEAF:Eo,create:Wo}=s,{toInnerPoint:Do,toOuterPoint:No,multiplyParent:Yo}=b,{toOuterOf:Xo}=it,{tempToOuterOf:zo,copy:Fo}=I,{moveLocal:jo,zoomOfLocal:Ho,rotateOfLocal:Uo,skewOfLocal:Go,moveWorld:qo,zoomOfWorld:Vo,rotateOfWorld:Qo,skewOfWorld:Jo,transform:Zo,transformWorld:$o,setTransform:Ko,getRelativeWorld:tn,drop:en}=Ai;exports.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 Lt}get __LayoutProcessor(){return $i}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 pathInputed(){return!!this.__.__pathInputed}constructor(t){this.innerId=Wo(Eo),this.reset(t)}reset(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.__parentWait?this.__parentWait.push(t):this.__parentWait=[t]}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.__leaferWait?this.__leaferWait.push(t):this.__leaferWait=[t]}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.__leaferWait&&qi.run(this.__leaferWait)),this.isBranch){const{children:e}=this;for(let s=0,r=e.length;s<r;s++)e[s].__bindLeafer(t)}}set(t){}get(t){}toJSON(){return this.__.__getInputData()}toString(){return JSON.stringify(this.toJSON())}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findOne(t,e){}focus(t){}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}updateLayout(){this.__layout.update()}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(){}__updateStrokeBounds(){}__updateRenderBounds(){}__updateAutoLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some((t=>t.__.eraser))}__updateMask(t){this.__hasMask=!!t||this.children.some((t=>t.__.mask))}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld;return Yo(this.__world,t.matrix,e,void 0,this.__world),Xo(this.__layout.renderBounds,e,e),e}return this.__world}getWorld(t){return this.__layout.update(),"x"===t?this.__world.e:"y"===t?this.__world.f:this.getLayoutBounds()[t]}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 r=e?tn(this,e):this.worldTransform,i=s?t:{};return Xo(t,r,i),i}worldToLocal(t,e,s,r){this.parent?this.parent.worldToInner(t,e,s,r):e&&Fo(e,t)}localToWorld(t,e,s,r){this.parent?this.parent.innerToWorld(t,e,s,r):e&&Fo(e,t)}worldToInner(t,e,s,r){r&&(r.innerToWorld(t,e,s),t=e||t),Do(this.worldTransform,t,e,s)}innerToWorld(t,e,s,r){No(this.worldTransform,t,e,s),r&&r.worldToInner(e||t,null,s)}getInnerPoint(t,e,s,r){const i=r?t:{};return this.worldToInner(t,i,s,e),i}getInnerPointByLocal(t,e,s,r){return this.getInnerPoint(t,this.parent,s,r)}getLocalPoint(t,e,s,r){const i=r?t:{};return this.worldToLocal(t,i,s,e),i}getLocalPointByInner(t,e,s,r){return this.getWorldPoint(t,this.parent,s,r)}getWorldPoint(t,e,s,r){const i=r?t:{};return this.innerToWorld(t,i,s,e),i}getWorldPointByLocal(t,e,s,r){const i=r?t:{};return this.localToWorld(t,i,s,e),i}getPagePoint(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,r)}getWorldPointByPage(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,r)}setTransform(t,e){Ko(this,t,e)}transform(t,e){Zo(this,t,e)}move(t,e){jo(this,t,e)}scaleOf(t,e,s,r){Ho(this,zo(t,this.localTransform),e,s,r)}rotateOf(t,e){Uo(this,zo(t,this.localTransform),e)}skewOf(t,e,s,r){Go(this,zo(t,this.localTransform),e,s,r)}transformWorld(t,e){$o(this,t,e)}moveWorld(t,e){qo(this,t,e)}scaleOfWorld(t,e,s,r){Vo(this,t,e,s,r)}rotateOfWorld(t,e){Qo(this,t,e)}skewOfWorld(t,e,s,r){Jo(this,t,e,s,r)}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}__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){}__clip(t,e){}__renderShape(t,e,s,r){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){en(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,r){}off_(t){}once(t,e,s){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e){xi(this.prototype,t,e)}static addAttr(t,e,s){s||(s=ci),s(e)(this.prototype,t)}destroy(){if(!this.destroyed){const{parent:t}=this;t&&this.remove(),this.children&&this.removeAll(!0),this.hasEvent(ro.DESTROY)&&this.emitEvent(new ro(ro.DESTROY,this,t)),this.__.destroy(),this.__layout.destroy(),this.__captureMap=this.__bubbleMap=this.__parentWait=this.__leaferWait=null,this.destroyed=!0}}},exports.Leaf=It([Bi(fo),Bi(vo),Bi(So),Bi(to),Bi(Io)],exports.Leaf);const{setListWithFn:sn}=it,{sort:rn}=ji,{localBoxBounds:on,localStrokeBounds:nn,localRenderBounds:an,maskLocalBoxBounds:hn,maskLocalStrokeBounds:ln,maskLocalRenderBounds:dn}=zi;exports.Branch=class extends exports.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(){sn(this.__layout.boxBounds,this.children,this.__hasMask?hn:on)}__updateStrokeBounds(){sn(this.__layout.strokeBounds,this.children,this.__hasMask?ln:nn)}__updateRenderBounds(){sn(this.__layout.renderBounds,this.children,this.__hasMask?dn:an)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,r=e.length;s<r;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(rn),this.__layout.affectChildrenSort=t}}add(t,e){t!==this&&(t.parent&&t.parent.remove(t),t.parent=this,void 0===e?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1),t.__layout.boxChanged||t.__layout.boxChange(),t.__layout.matrixChanged||t.__layout.matrixChange(),t.__parentWait&&qi.run(t.__parentWait),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(ro.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange())}addMany(...t){t.forEach((t=>this.add(t)))}remove(t,e){if(t){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())}else 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)}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(ro.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new ro(t,e,this);e.hasEvent(t)&&e.emitEvent(s),this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}},exports.Branch=It([Bi(Mo)],exports.Branch);class un{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:r}=this;for(let t=e,i=r.length;t<i;t++)s[r[t].innerId]++;0===e?r.unshift(t):(e>r.length&&(e=r.length),r.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 r=0,i=e.length;r<i;r++)void 0!==s?this.keys[e[r].innerId]=r-1:e[r].innerId===t.innerId&&(s=r,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 un;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,r=t.length;s<r;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}exports.AnimateEvent=lo,exports.AroundHelper=pt,exports.AutoBounds=class{constructor(t,e,s,r,i,o){"object"==typeof t?this.copy(t):this.set(t,e,s,r,i,o)}set(t=0,e=0,s=0,r=0,i=0,o=0){this.top=t,this.right=e,this.bottom=s,this.left=r,this.width=i,this.height=o}copy(t){const{top:e,right:s,bottom:r,left:i,width:o,height:n}=t;this.set(e,s,r,i,o,n)}getBoundsFrom(t){const{top:e,right:s,bottom:r,left:i,width:o,height:n}=this;return new ht(i,e,o||t.width-i-s,n||t.height-e-r)}},exports.BezierHelper=fe,exports.Bounds=ht,exports.BoundsHelper=it,exports.BranchHelper=ji,exports.BranchRender=Mo,exports.CanvasManager=class{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let s;const{list:r}=this;for(let e=0,i=r.length;e<i;e++)if(s=r[e],s.recycled&&s.isSameSize(t))return s.recycled=!1,s.manager||(s.manager=this),s;const i=e.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,r=this.list.length;s<r;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()}},exports.ChildEvent=ro,exports.Creator=e,exports.DataHelper=Pt,exports.Debug=gt,exports.EllipseHelper=ke,exports.Event=so,exports.EventCreator=Tt,exports.FileHelper=$r,exports.ImageEvent=oo,exports.ImageManager=ri,exports.IncrementId=s,exports.LayoutEvent=ho,exports.LeafBounds=So,exports.LeafBoundsHelper=zi,exports.LeafData=Lt,exports.LeafDataProxy=fo,exports.LeafEventer=to,exports.LeafHelper=Ai,exports.LeafLayout=$i,exports.LeafLevelList=class{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,r=e.length;s<r;s++)t(e[s])}))}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}},exports.LeafList=un,exports.LeafMatrix=vo,exports.LeafRender=Io,exports.LeaferCanvasBase=class extends Nt{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}get pixelHeight(){return this.height*this.pixelRatio}get allowBackgroundColor(){return this.view&&this.parentView}constructor(e,r){super(),this.size={},this.worldTransform={},e||(e=Xt),e.pixelRatio||(e.pixelRatio=t.devicePixelRatio),this.manager=r,this.innerId=s.create(s.CNAVAS);const{width:i,height:o,pixelRatio:n}=e;this.autoLayout=!i||!o,this.size.pixelRatio=n,this.config=e,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){if(this.isSameSize(t))return;let e;this.context&&!this.unreal&&this.width&&(e=this.getSameCanvas(),e.copyWorld(this)),Pt.copyAttrs(this.size,t,zt),this.size.pixelRatio||(this.size.pixelRatio=1),this.bounds=new ht(0,0,this.width,this.height),this.unreal||(this.updateViewSize(),this.smooth=this.config.smooth),this.updateClientBounds(),this.context&&!this.unreal&&e&&(this.clearWorld(e.bounds),this.copyWorld(e),e.recycle())}updateViewSize(){}updateClientBounds(){}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s}=this,r=this.worldTransform;if(e){const{a:i,b:o,c:n,d:a,e:h,f:l}=e;this.setTransform(r.a=(t.a*i+t.b*n)*s,r.b=(t.a*o+t.b*a)*s,r.c=(t.c*i+t.d*n)*s,r.d=(t.c*o+t.d*a)*s,r.e=(t.e*i+t.f*n+h)*s,r.f=(t.e*o+t.f*a+l)*s)}else this.setTransform(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)}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){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s)}setStrokeOptions(t){this.strokeCap="none"===t.strokeCap?"butt":t.strokeCap,this.strokeJoin=t.strokeJoin,this.dashPattern=t.dashPattern,this.dashOffset=t.dashOffset,this.miterLimit=t.miterLimit}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,r){const{pixelRatio:i}=this;this.shadowOffsetX=t*i,this.shadowOffsetY=e*i,this.shadowBlur=s*i,this.shadowColor=r||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,r){if(r&&(this.blendMode=r),e){const{pixelRatio:r}=this;s||(s=e),this.drawImage(t.view,e.x*r,e.y*r,e.width*r,e.height*r,s.x*r,s.y*r,s.width*r,s.height*r)}else this.drawImage(t.view,0,0);r&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,r){if(r&&(this.blendMode=r),e.b||e.c)this.save(),this.resetTransform(),this.copyWorld(t,e,it.tempToOuterOf(s,e)),this.restore();else{const{pixelRatio:r}=this;this.drawImage(t.view,e.x*r,e.y*r,e.width*r,e.height*r,s.x,s.y,s.width,s.height)}r&&(this.blendMode="source-over")}copyWorldByReset(t,e,s,r,i){this.resetTransform(),this.copyWorld(t,e,s,r),i||this.useWorldTransform()}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,lt.set(t).scale(this.pixelRatio),this.fillRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s){s&&(this.blendMode=s),this.strokeStyle=e,lt.set(t).scale(this.pixelRatio),this.strokeRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}clearWorld(t,e){lt.set(t).scale(this.pixelRatio),e&<.ceil(),this.clearRect(lt.x,lt.y,lt.width,lt.height)}clipWorld(t,e){this.beginPath(),lt.set(t).scale(this.pixelRatio),e&<.ceil(),this.rect(lt.x,lt.y,lt.width,lt.height),this.clip()}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t,this.height*t)}isSameSize(t){return this.width===t.width&&this.height===t.height&&this.pixelRatio===t.pixelRatio}getSameCanvas(t,s){const r=this.manager?this.manager.get(this.size):e.canvas(Object.assign({},this.size));return r.save(),t&&(Yt(r.worldTransform,this.worldTransform),r.useWorldTransform()),s&&(r.smooth=this.smooth),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t,!0):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}},exports.LeaferEvent=co,exports.LeaferImage=class{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){this.use=0,this.waitComplete=[],this.innerId=ni(oi),this.config=t||{url:""},this.isSVG=ri.isFormat("svg",t),this.hasOpacityPixel=ri.hasOpacityPixel(t)}load(e,s){return this.loading||(this.loading=!0,ri.tasker.add((()=>At(this,void 0,void 0,(function*(){return yield t.origin.loadImage(this.url).then((t=>{this.ready=!0,this.width=t.naturalWidth||t.width,this.height=t.naturalHeight||t.height,this.view=t,this.onComplete(!0)})).catch((t=>{this.error=t,this.onComplete(!1)}))}))))),this.waitComplete.push(e,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}onComplete(t){let e;this.waitComplete.forEach(((s,r)=>{e=r%2,s&&(t?e||s(this):e&&s(this.error))})),this.waitComplete.length=0,this.loading=!1}getCanvas(e,s,r,i){if(e||(e=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=t.origin.createCanvas(e,s),n=o.getContext("2d");return r&&(n.globalAlpha=r),n.drawImage(this.view,0,0,e,s),this.cache=this.use>1?{data:o,params:arguments}:null,o}getPattern(e,s,r,i){const o=t.canvas.createPattern(e,s);try{r&&o.setTransform&&(o.setTransform(r),r=null)}catch(t){}return i&&(i.transform=r),o}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}},exports.MathHelper=a,exports.Matrix=Y,exports.MatrixHelper=b,exports.NeedConvertToCanvasCommandMap=Gt,exports.OneRadian=h,exports.PI2=l,exports.PI_2=d,exports.PathBounds=zr,exports.PathCommandDataHelper=Ss,exports.PathCommandMap=Ht,exports.PathConvert=hs,exports.PathCorner=Qr,exports.PathCreator=Vs,exports.PathDrawer=lr,exports.PathHelper=Ft,exports.PathNumberCommandLengthMap=Jt,exports.PathNumberCommandMap=Qt,exports.Platform=t,exports.Point=D,exports.PointHelper=I,exports.PropertyEvent=io,exports.RectHelper=Zt,exports.RenderEvent=uo,exports.ResizeEvent=no,exports.Run=wt,exports.StringNumberMap=ft,exports.TaskItem=ei,exports.TaskProcessor=si,exports.TwoPointBoundsHelper=z,exports.UICreator=Bt,exports.WaitHelper=qi,exports.WatchEvent=ao,exports.affectRenderBoundsType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}})))},exports.affectStrokeBoundsType=fi,exports.attr=di,exports.autoLayoutType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.matrixChanged||this.__layout.matrixChange(),this.__hasAutoLayout=!!e,this.__local||this.__layout.createLocal()}})))},exports.boundsType=ci,exports.canvasPatch=function(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,r,i){Zr(this,t,e,s,r,i)})}(t)},exports.canvasSizeAttrs=zt,exports.cursorType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}})))},exports.dataProcessor=function(t){return(e,s)=>{ai(e,"__DataProcessor",{get:()=>t})}},exports.dataType=function(t){return li(t)},exports.decorateLeafAttr=li,exports.defineDataProcessor=xi,exports.defineKey=ai,exports.defineLeafAttr=ui,exports.doBoundsType=pi,exports.doStrokeType=gi,exports.emptyData={},exports.eraserType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.waitParent((()=>{this.parent.__updateEraser(e)}))}})))},exports.getBoundsData=c,exports.getDescriptor=hi,exports.getMatrixData=p,exports.getPointData=u,exports.hitType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),gt.showHitView&&(this.__layout.surfaceChanged||this.__layout.surfaceChange()),this.leafer&&this.leafer.updateCursor()}})))},exports.layoutProcessor=function(t){return(e,s)=>{ai(e,"__LayoutProcessor",{get:()=>t})}},exports.maskType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent((()=>{this.parent.__updateMask(e)}))}})))},exports.naturalBoundsType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),pi(this),this.__.__removeNaturalSize()}})))},exports.opacityType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.opacityChanged||this.__layout.opacityChange()}})))},exports.pathInputType=function(t){return li(t,(t=>({set(e){2!==this.__.__pathInputed&&(this.__.__pathInputed=e?1:0),this.__setAttr(t,e),pi(this)}})))},exports.pathType=_i,exports.pen=Jr,exports.positionType=function(t,e){return li(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.matrixChanged||this.__layout.matrixChange()}})))},exports.registerUI=function(){return t=>{Bt.register(t)}},exports.registerUIEvent=function(){return t=>{Tt.register(t)}},exports.rewrite=function(t){return(e,s)=>{wi.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}},exports.rewriteAble=function(){return t=>{vi()}},exports.rotationType=function(t,e){return li(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.rotationChanged||this.__layout.rotationChange()}})))},exports.scaleType=function(t,e){return li(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.scaleChanged||this.__layout.scaleChange()}})))},exports.sortType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.surfaceChanged||this.__layout.surfaceChange(),this.waitParent((()=>{this.parent.__layout.childrenSortChange()}))}})))},exports.strokeType=yi,exports.surfaceType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.surfaceChanged||this.__layout.surfaceChange()}})))},exports.tempBounds=lt,exports.tempMatrix=X,exports.tempPoint=N,exports.useModule=Bi;
|
|
1
|
+
"use strict";const t={image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,suffix:"leaf",crossOrigin:"anonymous"}},e={},s={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=r;return e[t]?e[t]++:(e[t]=1,0)}},r=s,{round:i,pow:o,PI:n}=Math,a={within:(t,e,s)=>(t<e&&(t=e),t>s&&(t=s),t),minus(t,e){if(t instanceof Array){e&&(t=a.fourNumber(t,0));for(let e=0;e<t.length;e++)t[e]=-t[e]}else t=-t;return 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 r=t+s;if(e>1){const t=Math.abs(r%e);(t<1||t>e-1)&&(r=Math.round(r/e)*e)}return r-s},float(t,e){const s=e?o(10,e):1e12;return-0===(t=i(t*s)/s)?0:t}},h=n/180,l=2*n,d=n/2;function u(){return{x:0,y:0}}function c(){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:_,cos:f,acos:g,sqrt:y}=Math,{float:x}=a,m={};function w(){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:w(),tempMatrix:{},set(t,e=1,s=0,r=0,i=1,o=0,n=0){t.a=e,t.b=s,t.c=r,t.d=i,t.e=o,t.f=n},get:p,getWorld:w,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){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},scaleOfOuter(t,e,s,r){v.toInnerPoint(t,e,m),v.scaleOfInner(t,m,s,r)},scaleOfInner(t,e,s,r=s){v.translateInner(t,e.x,e.y),v.scale(t,s,r),v.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:r,c:i,d:o}=t,n=f(e*=h),a=_(e);t.a=s*n-r*a,t.b=s*a+r*n,t.c=i*n-o*a,t.d=i*a+o*n},rotateOfOuter(t,e,s){v.toInnerPoint(t,e,m),v.rotateOfInner(t,m,s)},rotateOfInner(t,e,s){v.translateInner(t,e.x,e.y),v.rotate(t,s),v.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:r,b:i,c:o,d:n}=t;s&&(s*=h,t.a=r+o*s,t.b=i+n*s),e&&(e*=h,t.c=o+r*e,t.d=n+i*e)},skewOfOuter(t,e,s,r){v.toInnerPoint(t,e,m),v.skewOfInner(t,m,s,r)},skewOfInner(t,e,s,r=0){v.translateInner(t,e.x,e.y),v.skew(t,s,r),v.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:r,c:i,d:o,e:n,f:a}=t;t.a=e.a*s+e.b*i,t.b=e.a*r+e.b*o,t.c=e.c*s+e.d*i,t.d=e.c*r+e.d*o,t.e=e.e*s+e.f*i+n,t.f=e.e*r+e.f*o+a},multiplyParent(t,e,s,r,i){const{e:o,f:n}=t;if(s||(s=t),void 0===r&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:r,b:o,c:n,d:a}=t;s.a=r*e.a+o*e.c,s.b=r*e.b+o*e.d,s.c=n*e.a+a*e.c,s.d=n*e.b+a*e.d,i&&(s.scaleX=e.scaleX*i.scaleX,s.scaleY=e.scaleY*i.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,i&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=o*e.a+n*e.c+e.e,s.f=o*e.b+n*e.d+e.f},divide(t,e){v.multiply(t,v.tempInvert(e))},divideParent(t,e){v.multiplyParent(t,v.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=v;return v.copy(e,t),v.invert(e),e},invert(t){const{a:e,b:s,c:r,d:i,e:o,f:n}=t;if(s||r){const a=1/(e*i-s*r);t.a=i*a,t.b=-s*a,t.c=-r*a,t.d=e*a,t.e=-(o*i-n*r)*a,t.f=-(n*e-o*s)*a}else if(1===e&&1===i)t.e=-o,t.f=-n;else{const s=1/(e*i);t.a=i*s,t.d=e*s,t.e=-o*i*s,t.f=-n*e*s}},toOuterPoint(t,e,s,r){const{x:i,y:o}=e;s||(s=e),s.x=i*t.a+o*t.c,s.y=i*t.b+o*t.d,r||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,r){const{a:i,b:o,c:n,d:a}=t,h=1/(i*a-o*n),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*n)*h,s.y=(d*i-l*o)*h,!r){const{e:e,f:r}=t;s.x-=(e*a-r*n)*h,s.y-=(r*i-e*o)*h}},setLayout(t,e,s,r){const{x:i,y:o,scaleX:n,scaleY:a}=e;if(void 0===r&&(r=e.rotation||e.skewX||e.skewY),r){const{rotation:s,skewX:r,skewY:i}=e,o=s*h,l=f(o),d=_(o);if(r||i){const e=r*h,s=i*h;t.a=(l+s*-d)*n,t.b=(d+s*l)*n,t.c=(e*l-d)*a,t.d=(l+e*d)*a}else t.a=l*n,t.b=d*n,t.c=-d*a,t.d=l*a}else t.a=n,t.b=0,t.c=0,t.d=a;t.e=i,t.f=o,s&&v.translateInner(t,-s.x,-s.y)},getLayout(t,e,s){const{a:r,b:i,c:o,d:n,e:a,f:l}=t;let u,c,p,m,w,b=a,v=l;if(i||o){const t=r*n-i*o;if(o&&!s){u=y(r*r+i*i),c=t/u;const e=r/u;p=i>0?g(e):-g(e)}else{c=y(o*o+n*n),u=t/c;const e=o/c;p=d-(n>0?g(-e):-g(e))}const e=x(f(p)),a=_(p);u=x(u),c=x(c),m=e?x((o/c+a)/e/h,9):0,w=e?x((i/u-a)/e/h,9):0,p=x(p/h)}else u=r,c=n,p=m=w=0;return e&&(b+=e.x*r+e.y*o,v+=e.x*i+e.y*n),{x:b,y:v,scaleX:u,scaleY:c,rotation:p,skewX:m,skewY:w}},withScale(t,e,s=e){const r=t;if(!e||!s){const{a:r,b:i,c:o,d:n}=t;i||o?s=(r*n-i*o)/(e=y(r*r+i*i)):(e=r,s=n)}return r.scaleX=e,r.scaleY=s,r},reset(t){v.set(t)}},v=b,{toInnerPoint:B,toOuterPoint:k}=b,{sin:C,cos:T,abs:O,sqrt:P,atan2:R,min:L,PI:S}=Math,I={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},move(t,e,s){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,r=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(r-1)},rotate(t,e,s){s||(s=A.defaultPoint);const r=T(e*=h),i=C(e),o=t.x-s.x,n=t.y-s.y;t.x=s.x+o*r-n*i,t.y=s.y+o*i+n*r},tempToInnerOf(t,e){const{tempPoint:s}=A;return E(s,t),B(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=A;return E(s,t),k(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=A;return E(s,t),A.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),B(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){B(e,t,s)},toOuterOf(t,e,s){k(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,r){const i=O(s-t),o=O(r-e);return P(i*i+o*o)},getMinDistanceFrom:(t,e,s,r,i,o)=>L(M(t,e,s,r),M(s,r,i,o)),getAngle:(t,e)=>W(t,e)/h,getRotation:(t,e,s,r)=>(r||(r=e),A.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,r.x,r.y)/h),getRadianFrom(t,e,s,r,i,o,n,a){void 0===n&&(n=s,a=r);let h=R(e-r,t-s);const d=R(o-a,i-n)-h;return d<-S?d+l:d},getAtan2:(t,e)=>R(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,r){const i=W(t,e);return(e=r?e:{}).x=t.x+T(i)*s,e.y=t.y+C(i)*s,e},reset(t){A.reset(t)}},A=I,{getDistanceFrom:M,copy:E,getAtan2:W}=A;class D{constructor(t,e){this.set(t,e)}set(t,e){return"object"==typeof t?I.copy(this,t):I.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new D(this)}move(t,e){return I.move(this,t,e),this}scale(t,e){return I.scale(this,t,e),this}scaleOf(t,e,s){return I.scaleOf(this,t,e,s),this}rotate(t,e){return I.rotate(this,t,e),this}rotateOf(t,e){return I.rotate(this,e,t),this}getRotation(t,e,s){return I.getRotation(this,t,e,s)}toInnerOf(t,e){return I.toInnerOf(this,t,e),this}toOuterOf(t,e){return I.toOuterOf(this,t,e),this}getCenter(t){return new D(I.getCenter(this,t))}getDistance(t){return I.getDistance(this,t)}getDistancePoint(t,e,s){return new D(I.getDistancePoint(this,t,e,s))}getAngle(t){return I.getAngle(this,t)}getAtan2(t){return I.getAtan2(this,t)}reset(){return I.reset(this),this}}const N=new D;class Y{constructor(t,e,s,r,i,o){this.set(t,e,s,r,i,o)}set(t,e,s,r,i,o){return"object"==typeof t?b.copy(this,t):b.set(this,t,e,s,r,i,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:r,e:i,f:o}=this;return{a:t,b:e,c:s,d:r,e:i,f:o}}clone(){return new Y(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){return b.setLayout(this,t,e),this}getLayout(t,e){return b.getLayout(this,t,e)}withScale(t,e){return b.withScale(this,t,e)}reset(){b.reset(this)}}const X=new Y,z={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,r,i){F(t,e,s),F(t,e+r,s+i)},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:F}=z,{tempPointBounds:j,setPoint:H,addPoint:U,toBounds:G}=z,{toOuterPoint:q}=b,{float:V,fourNumber:Q}=a,{floor:J,ceil:Z}=Math;let $,K,tt,et;const st={},rt={},it={tempBounds:{},set(t,e=0,s=0,r=0,i=0){t.x=e,t.y=s,t.width=r,t.height=i},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,r){if(s instanceof Array){const r=Q(s);ot.set(t,e.x-r[3],e.y-r[0],e.width+r[1]+r[3],e.height+r[2]+r[0])}else r||(r=s),ot.set(t,e.x-s,e.y-r,e.width+2*s,e.height+2*r)},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),ot.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?at(e,t):e=t,s?(e.offsetX=-(ot.maxX(s)-t.x),e.offsetY=-(ot.maxY(s)-t.y)):(e.offsetX=t.x+t.width,e.offsetY=t.y+t.height),ot.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e){I.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,r=s){I.scaleOf(t,e,s,r),t.width*=s,t.height*=r},tempToOuterOf:(t,e)=>(ot.copy(ot.tempBounds,t),ot.toOuterOf(ot.tempBounds,e),ot.tempBounds),getOuterOf:(t,e)=>(t=Object.assign({},t),ot.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:r,d:i}=e;r>0?(s.width=t.width*r,s.x=e.e+t.x*r):(s.width=t.width*-r,s.x=e.e+t.x*r-s.width),i>0?(s.height=t.height*i,s.y=e.f+t.y*i):(s.height=t.height*-i,s.y=e.f+t.y*i-s.height)}else st.x=t.x,st.y=t.y,q(e,st,rt),H(j,rt.x,rt.y),st.x=t.x+t.width,q(e,st,rt),U(j,rt.x,rt.y),st.y=t.y+t.height,q(e,st,rt),U(j,rt.x,rt.y),st.x=t.x,q(e,st,rt),U(j,rt.x,rt.y),G(j,s)},toInnerOf(t,e,s){s||(s=t),ot.move(s,-e.e,-e.f),ot.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const r=Math.min(s,Math.min(t.width/e.width,t.height/e.height));return new Y(r,0,0,r,-e.x*r,-e.y*r)},getSpread(t,e,s){const r={};return ot.copyAndSpread(r,t,e,s),r},spread(t,e,s=e){ot.copyAndSpread(t,t,e,s)},ceil(t){const{x:e,y:s}=t;t.x=J(t.x),t.y=J(t.y),t.width=e>t.x?Z(t.width+e-t.x):Z(t.width),t.height=s>t.y?Z(t.height+s-t.y):Z(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=V(t.x,e),t.y=V(t.y,e),t.width=V(t.width,e),t.height=V(t.height,e)},add(t,e,s){$=t.x+t.width,K=t.y+t.height,tt=e.x,et=e.y,s||(tt+=e.width,et+=e.height),$=$>tt?$:tt,K=K>et?K:et,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=$-t.x,t.height=K-t.y},addList(t,e){ot.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){ot.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){ot.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,r=!1){let i,o=!0;for(let n=0,a=e.length;n<a;n++)i=s?s(e[n]):e[n],i&&(i.width||i.height)&&(o?(o=!1,r||at(t,i)):nt(t,i));o&&ot.reset(t)},setPoints(t,e){e.forEach(((t,e)=>0===e?H(j,t.x,t.y):U(j,t.x,t.y))),G(j,t)},addPoint(t,e){nt(t,e,!0)},getPoints(t){const{x:e,y:s,width:r,height:i}=t;return[{x:e,y:s},{x:e+r,y:s},{x:e+r,y:s+i},{x:e,y:s+i}]},hitRadiusPoint:(t,e,s)=>(s&&(e=I.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=I.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=ot.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=ot.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=ot.tempToOuterOf(e,s)),!ot.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:r,y:i,width:o,height:n}=e;return $=r+o,K=i+n,tt=t.x+t.width,et=t.y+t.height,r=r>t.x?r:t.x,i=i>t.y?i:t.y,$=$<tt?$:tt,K=K<et?K:et,o=$-r,n=K-i,{x:r,y:i,width:o,height:n}},intersect(t,e,s){ot.copy(t,ot.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){ot.set(t)}},ot=it,{add:nt,copy:at}=ot;class ht{get minX(){return it.minX(this)}get minY(){return it.minY(this)}get maxX(){return it.maxX(this)}get maxY(){return it.maxY(this)}constructor(t,e,s,r){this.set(t,e,s,r)}set(t,e,s,r){return"object"==typeof t?it.copy(this,t):it.set(this,t,e,s,r),this}get(){const{x:t,y:e,width:s,height:r}=this;return{x:t,y:e,width:s,height:r}}clone(){return new ht(this)}move(t,e){return it.move(this,t,e),this}scale(t,e){return it.scale(this,t,e),this}scaleOf(t,e,s){return it.scaleOf(this,t,e,s),this}toOuterOf(t,e){return it.toOuterOf(this,t,e),this}toInnerOf(t,e){return it.toInnerOf(this,t,e),this}getFitMatrix(t,e){return it.getFitMatrix(this,t,e)}spread(t,e){return it.spread(this,t,e),this}shrink(t){return it.spread(this,a.minus(t,!0)),this}ceil(){return it.ceil(this),this}unsign(){return it.unsign(this),this}float(t){return it.float(this,t),this}add(t){return it.add(this,t),this}addList(t){return it.setList(this,t,!0),this}setList(t){return it.setList(this,t),this}addListWithFn(t,e){return it.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return it.setListWithFn(this,t,e),this}setPoints(t){return it.setPoints(this,t),this}addPoint(t){return it.addPoint(this,t),this}getPoints(){return it.getPoints(this)}hitPoint(t,e){return it.hitPoint(this,t,e)}hitRadiusPoint(t,e){return it.hitRadiusPoint(this,t,e)}hit(t,e){return it.hit(this,t,e)}includes(t,e){return it.includes(this,t,e)}intersect(t,e){return it.intersect(this,t,e),this}getIntersect(t,e){return new ht(it.getIntersectData(this,t,e))}isSame(t){return it.isSame(this,t)}isEmpty(){return it.isEmpty(this)}reset(){it.reset(this)}}const lt=new ht;var dt,ut;exports.Direction4=void 0,(dt=exports.Direction4||(exports.Direction4={}))[dt.top=0]="top",dt[dt.right=1]="right",dt[dt.bottom=2]="bottom",dt[dt.left=3]="left",exports.Direction9=void 0,(ut=exports.Direction9||(exports.Direction9={}))[ut.topLeft=0]="topLeft",ut[ut.top=1]="top",ut[ut.topRight=2]="topRight",ut[ut.right=3]="right",ut[ut.bottomRight=4]="bottomRight",ut[ut.bottom=5]="bottom",ut[ut.bottomLeft=6]="bottomLeft",ut[ut.left=7]="left",ut[ut.center=8]="center";const ct=[{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}],pt={directionData:ct,tempPoint:{},get:_t,toPoint(t,e,s,r,i){s||(s={});const o=_t(t);s.x=o.x*e.width,s.y=o.y*e.height,i&&(s.x-=i.x,s.y-=i.y,o.x&&(s.x-=1===o.x?i.width:.5===o.x?o.x*i.width:0),o.y&&(s.y-=1===o.y?i.height:.5===o.y?o.y*i.height:0)),r||(s.x+=e.x,s.y+=e.y)}};function _t(t){return"string"==typeof t?ct[exports.Direction9[t]]:t}const ft={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};class gt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new gt(t)}static set filter(t){this.filterList=yt(t)}static set exclude(t){this.excludeList=yt(t)}log(...t){if(xt.enable){if(xt.filterList.length&&xt.filterList.every((t=>t!==this.name)))return;if(xt.excludeList.length&&xt.excludeList.some((t=>t===this.name)))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){xt.enable&&this.warn(...t)}warn(...t){xt.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 yt(t){return t?"string"==typeof t&&(t=[t]):t=[],t}gt.filterList=[],gt.excludeList=[],gt.showWarn=!0;const xt=gt,mt=gt.get("RunTime"),wt={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const r=s.create(s.RUNTIME);return bt.currentId=bt.idMap[r]=e?performance.now():Date.now(),bt.currentName=bt.nameMap[r]=t,bt.nameToIdMap[t]=r,r},end(t,e){const s=bt.idMap[t],r=bt.nameMap[t],i=e?(performance.now()-s)/1e3:Date.now()-s;bt.idMap[t]=bt.nameMap[t]=bt.nameToIdMap[r]=void 0,mt.log(r,i,"ms")},endOfName(t,e){const s=bt.nameToIdMap[t];void 0!==s&&bt.end(s,e)}},bt=wt,vt=gt.get("UICreator"),Bt={list:{},register(t){const{__tag:e}=t.prototype;kt[e]?vt.repeat(e):kt[e]=t},get(t,e,s,r,i,o){const n=new kt[t](e);return void 0!==s&&(n.x=s,r&&(n.y=r),i&&(n.width=i),o&&(n.height=o)),n}},{list:kt}=Bt,Ct=gt.get("EventCreator"),Tt={nameList:{},register(t){let e;Object.keys(t).forEach((s=>{e=t[s],"string"==typeof e&&(Ot[e]?Ct.repeat(e):Ot[e]=t)}))},changeName(t,e){const s=Ot[t];if(s){const r=Object.keys(s).find((e=>s[e]===t));r&&(s[r]=e,Ot[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new Ot[t](...e)},{nameList:Ot}=Tt;const Pt={default:(t,e)=>(Rt(e,t),Rt(t,e),t),assign(t,e){let s;Object.keys(e).forEach((r=>{var i;s=e[r],(null==s?void 0:s.constructor)===Object&&(null===(i=t[r])||void 0===i?void 0:i.constructor)===Object?Rt(t[r],e[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))},{assign:Rt}=Pt;class Lt{get __blendMode(){if(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 r in this)"_"!==r[0]&&(s=e?e[r]:void 0,t[r]=void 0===s?this[r]: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){const e={};if(t)if(t instanceof Array)for(let s of t)e[s]=this.__getInput(s);else for(let s in t)e[s]=this.__getInput(s);else{let t,s,{__input:r}=this;e.tag=this.__leaf.tag;for(let i in this)if("_"!==i[0]&&(t=this["_"+i],void 0!==t)){if("path"===i&&!this.__pathInputed)continue;s=r?r[i]:void 0,e[i]=void 0===s?t:s}}return e}__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||e.__hasEraser||t.eraser?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 St;exports.Answer=void 0,(St=exports.Answer||(exports.Answer={}))[St.No=0]="No",St[St.Yes=1]="Yes",St[St.NoAndSkip=2]="NoAndSkip",St[St.YesAndSkip=3]="YesAndSkip";function It(t,e,s,r){var i,o=arguments.length,n=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,s):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,r);else for(var a=t.length-1;a>=0;a--)(i=t[a])&&(n=(o<3?i(n):o>3?i(e,s,n):i(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n}function At(t,e,s,r){return new(s||(s=Promise))((function(i,o){function n(t){try{h(r.next(t))}catch(t){o(t)}}function a(t){try{h(r.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?i(t.value):(e=t.value,e instanceof s?e:new s((function(t){t(e)}))).then(n,a)}h((r=r.apply(t,e||[])).next())}))}function Mt(t){return(e,s)=>{t||(t=s),Object.defineProperty(e,s,{get(){return this.context[t]},set(e){this.context[t]=e}})}}"function"==typeof SuppressedError&&SuppressedError;const Et=[];function Wt(){return(t,e)=>{Et.push(e)}}const Dt=[];class Nt{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||Dt)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;Et.forEach((e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))})),this.textBaseline="alphabetic"}setTransform(t,e,s,r,i,o){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,r,i,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,r,i,o)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,r){}strokeRect(t,e,s,r){}clearRect(t,e,s,r){}drawImage(t,e,s,r,i,o,n,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/r*a;r+=e,e=0,o+=t,a-=t}if(s<0){const t=-s/i*h;i+=s,s=0,n+=t,h-=t}this.context.drawImage(t,e,s,r,i,o,n,a,h);break;case 5:this.context.drawImage(t,e,s,r,i);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,r,i,o){}quadraticCurveTo(t,e,s,r){}closePath(){}arc(t,e,s,r,i,o){}arcTo(t,e,s,r,i){}ellipse(t,e,s,r,i,o,n,a){}rect(t,e,s,r){}roundRect(t,e,s,r,i){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,r){}createPattern(t,e){}createRadialGradient(t,e,s,r,i,o){}fillText(t,e,s,r){}measureText(t){}strokeText(t,e,s,r){}destroy(){this.context=null}}It([Mt("imageSmoothingEnabled")],Nt.prototype,"smooth",void 0),It([Mt("imageSmoothingQuality")],Nt.prototype,"smoothLevel",void 0),It([Mt("globalAlpha")],Nt.prototype,"opacity",void 0),It([Mt()],Nt.prototype,"fillStyle",void 0),It([Mt()],Nt.prototype,"strokeStyle",void 0),It([Mt("lineWidth")],Nt.prototype,"strokeWidth",void 0),It([Mt("lineCap")],Nt.prototype,"strokeCap",void 0),It([Mt("lineJoin")],Nt.prototype,"strokeJoin",void 0),It([Mt("lineDashOffset")],Nt.prototype,"dashOffset",void 0),It([Mt()],Nt.prototype,"miterLimit",void 0),It([Mt()],Nt.prototype,"shadowBlur",void 0),It([Mt()],Nt.prototype,"shadowColor",void 0),It([Mt()],Nt.prototype,"shadowOffsetX",void 0),It([Mt()],Nt.prototype,"shadowOffsetY",void 0),It([Mt()],Nt.prototype,"filter",void 0),It([Mt()],Nt.prototype,"font",void 0),It([Mt()],Nt.prototype,"fontKerning",void 0),It([Mt()],Nt.prototype,"fontStretch",void 0),It([Mt()],Nt.prototype,"fontVariantCaps",void 0),It([Mt()],Nt.prototype,"textAlign",void 0),It([Mt()],Nt.prototype,"textBaseline",void 0),It([Mt()],Nt.prototype,"textRendering",void 0),It([Mt()],Nt.prototype,"wordSpacing",void 0),It([Mt()],Nt.prototype,"letterSpacing",void 0),It([Mt()],Nt.prototype,"direction",void 0),It([Wt()],Nt.prototype,"setTransform",null),It([Wt()],Nt.prototype,"resetTransform",null),It([Wt()],Nt.prototype,"getTransform",null),It([Wt()],Nt.prototype,"save",null),It([Wt()],Nt.prototype,"restore",null),It([Wt()],Nt.prototype,"translate",null),It([Wt()],Nt.prototype,"scale",null),It([Wt()],Nt.prototype,"rotate",null),It([Wt()],Nt.prototype,"fill",null),It([Wt()],Nt.prototype,"stroke",null),It([Wt()],Nt.prototype,"clip",null),It([Wt()],Nt.prototype,"fillRect",null),It([Wt()],Nt.prototype,"strokeRect",null),It([Wt()],Nt.prototype,"clearRect",null),It([Wt()],Nt.prototype,"beginPath",null),It([Wt()],Nt.prototype,"moveTo",null),It([Wt()],Nt.prototype,"lineTo",null),It([Wt()],Nt.prototype,"bezierCurveTo",null),It([Wt()],Nt.prototype,"quadraticCurveTo",null),It([Wt()],Nt.prototype,"closePath",null),It([Wt()],Nt.prototype,"arc",null),It([Wt()],Nt.prototype,"arcTo",null),It([Wt()],Nt.prototype,"ellipse",null),It([Wt()],Nt.prototype,"rect",null),It([Wt()],Nt.prototype,"roundRect",null),It([Wt()],Nt.prototype,"createConicGradient",null),It([Wt()],Nt.prototype,"createLinearGradient",null),It([Wt()],Nt.prototype,"createPattern",null),It([Wt()],Nt.prototype,"createRadialGradient",null),It([Wt()],Nt.prototype,"fillText",null),It([Wt()],Nt.prototype,"measureText",null),It([Wt()],Nt.prototype,"strokeText",null);const{copy:Yt}=b,Xt={width:1,height:1,pixelRatio:1},zt=["width","height","pixelRatio"];const Ft={creator:{},parse(t,e){},convertToCanvasData(t,e){}},jt={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Ht=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},jt),Ut={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},Gt={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},qt=Object.assign(Object.assign({},Gt),jt),Vt=Ht,Qt={};for(let t in Vt)Qt[Vt[t]]=t;const Jt={};for(let t in Vt)Jt[Vt[t]]=Ut[t];const Zt={drawRoundRect(t,e,s,r,i,o){const n=a.fourNumber(o,Math.min(r/2,i/2)),h=e+r,l=s+i;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:$t,cos:Kt,atan2:te,ceil:ee,abs:se,PI:re,sqrt:ie,pow:oe}=Math,{setPoint:ne,addPoint:ae}=z,{set:he}=I,{M:le,L:de,C:ue,Q:ce,Z:pe}=Ht,_e={},fe={points(t,e,s,r){if(t.push(le,e[0],e[1]),s&&e.length>5){let i,o,n,a,h,l,d,u,c,p,_,f,g,y=e.length;const x=!0===s?.5:s;r&&(y=(e=[e[y-2],e[y-1],...e,e[0],e[1],e[2],e[3]]).length);for(let s=2;s<y-2;s+=2)i=e[s-2],o=e[s-1],n=e[s],a=e[s+1],h=e[s+2],l=e[s+3],_=ie(oe(n-i,2)+oe(a-o,2)),f=ie(oe(h-n,2)+oe(l-a,2)),g=_+f,_=x*_/g,f=x*f/g,h-=i,l-=o,d=n-_*h,u=a-_*l,2===s?r||t.push(ce,d,u,n,a):t.push(ue,c,p,d,u,n,a),c=n+f*h,p=a+f*l;r||t.push(ce,c,p,e[y-2],e[y-1])}else for(let s=2,r=e.length;s<r;s+=2)t.push(de,e[s],e[s+1]);r&&t.push(pe)},rect(t,e,s,r,i){Ft.creator.path=t,Ft.creator.moveTo(e,s).lineTo(e+r,s).lineTo(e+r,s+i).lineTo(e,s+i).lineTo(e,s)},roundRect(t,e,s,r,i,o){Ft.creator.path=[],Zt.drawRoundRect(Ft.creator,e,s,r,i,o),t.push(...Ft.convertToCanvasData(Ft.creator.path,!0))},arcTo(t,e,s,r,i,o,n,a,u,c,p){const _=r-e,f=i-s,g=o-r,y=n-i;let x=te(f,_),m=te(y,g),w=m-x;if(w<0&&(w+=l),w===re||se(_+f)<1e-12||se(g+y)<1e-12)return t&&t.push(de,r,i),u&&(ne(u,e,s),ae(u,r,i)),p&&he(p,e,s),void(c&&he(c,r,i));const b=_*y-g*f<0,v=b?-1:1,B=a/Kt(w/2),k=r+B*Kt(x+w/2+d*v),C=i+B*$t(x+w/2+d*v);return x-=d*v,m-=d*v,xe(t,k,C,a,a,0,x/h,m/h,b,u,c,p)},arc:(t,e,s,r,i,o,n,a,h,l)=>xe(t,e,s,r,r,0,i,o,n,a,h,l),ellipse(t,e,s,r,i,o,n,a,u,c,p,_){const f=o*h,g=$t(f),y=Kt(f);let x=n*h,m=a*h;x>re&&(x-=l),m<0&&(m+=l);let w=m-x;w<0?w+=l:w>l&&(w-=l),u&&(w-=l);const b=ee(se(w/d)),v=w/b,B=$t(v/4),k=8/3*B*B/$t(v/2);m=x+v;let C,T,O,P,R,L,S,I,A=Kt(x),M=$t(x),E=O=y*r*A-g*i*M,W=P=g*r*A+y*i*M,D=e+O,N=s+P;t&&t.push(de,D,N),c&&ne(c,D,N),_&&he(_,D,N);for(let o=0;o<b;o++)C=Kt(m),T=$t(m),O=y*r*C-g*i*T,P=g*r*C+y*i*T,R=e+E-k*(y*r*M+g*i*A),L=s+W-k*(g*r*M-y*i*A),S=e+O+k*(y*r*T+g*i*C),I=s+P+k*(g*r*T-y*i*C),t&&t.push(ue,R,L,S,I,e+O,s+P),c&&ye(e+E,s+W,R,L,S,I,e+O,s+P,c,!0),E=O,W=P,A=C,M=T,x=m,m+=v;p&&he(p,e+O,s+P)},quadraticCurveTo(t,e,s,r,i,o,n){t.push(ue,(e+2*r)/3,(s+2*i)/3,(o+2*r)/3,(n+2*i)/3,o,n)},toTwoPointBoundsByQuadraticCurve(t,e,s,r,i,o,n,a){ye(t,e,(t+2*s)/3,(e+2*r)/3,(i+2*s)/3,(o+2*r)/3,i,o,n,a)},toTwoPointBounds(t,e,s,r,i,o,n,a,h,l){const d=[];let u,c,p,_,f,g,y,x,m=t,w=s,b=i,v=n;for(let t=0;t<2;++t)if(1==t&&(m=e,w=r,b=o,v=a),u=-3*m+9*w-9*b+3*v,c=6*m-12*w+6*b,p=3*w-3*m,Math.abs(u)<1e-12){if(Math.abs(c)<1e-12)continue;_=-p/c,0<_&&_<1&&d.push(_)}else y=c*c-4*p*u,x=Math.sqrt(y),y<0||(f=(-c+x)/(2*u),0<f&&f<1&&d.push(f),g=(-c-x)/(2*u),0<g&&g<1&&d.push(g));l?ae(h,t,e):ne(h,t,e),ae(h,n,a);for(let l=0,u=d.length;l<u;l++)ge(d[l],t,e,s,r,i,o,n,a,_e),ae(h,_e.x,_e.y)},getPointAndSet(t,e,s,r,i,o,n,a,h,l){const d=1-t,u=d*d*d,c=3*d*d*t,p=3*d*t*t,_=t*t*t;l.x=u*e+c*r+p*o+_*a,l.y=u*s+c*i+p*n+_*h},getPoint(t,e,s,r,i,o,n,a,h){const l={};return ge(t,e,s,r,i,o,n,a,h,l),l}},{getPointAndSet:ge,toTwoPointBounds:ye,ellipse:xe}=fe,{sin:me,cos:we,sqrt:be,atan2:ve}=Math,{ellipse:Be}=fe,ke={ellipticalArc(e,s,r,i,o,n,a,d,u,c,p){const _=(u-s)/2,f=(c-r)/2,g=n*h,y=me(g),x=we(g),m=-x*_-y*f,w=-x*f+y*_,b=i*i,v=o*o,B=w*w,k=m*m,C=b*v-b*B-v*k;let T=0;if(C<0){const t=be(1-C/(b*v));i*=t,o*=t}else T=(a===d?-1:1)*be(C/(b*B+v*k));const O=T*i*w/o,P=-T*o*m/i,R=ve((w-P)/o,(m-O)/i),L=ve((-w-P)/o,(-m-O)/i);let S=L-R;0===d&&S>0?S-=l:1===d&&S<0&&(S+=l);const I=s+_+x*O-y*P,A=r+f+y*O+x*P,M=S<0?1:0;p||t.ellipseToCurve?Be(e,I,A,i,o,n,R/h,L/h,M):i!==o||n?e.push(Ht.G,I,A,i,o,n,R/h,L/h,M):e.push(Ht.O,I,A,i,R/h,L/h,M)}},{M:Ce,m:Te,L:Oe,l:Pe,H:Re,h:Le,V:Se,v:Ie,C:Ae,c:Me,S:Ee,s:We,Q:De,q:Ne,T:Ye,t:Xe,A:ze,a:Fe,Z:je,z:He,N:Ue,D:Ge,X:qe,G:Ve,F:Qe,O:Je,P:Ze,U:$e}=Ht,{rect:Ke,roundRect:ts,arcTo:es,arc:ss,ellipse:rs,quadraticCurveTo:is}=fe,{ellipticalArc:os}=ke,ns=gt.get("PathConvert"),as={},hs={current:{dot:0},stringify(t,e){let s,r,i,o=0,n=t.length,h="";for(;o<n;){r=t[o],s=Jt[r],h+=r===i?" ":Qt[r];for(let r=1;r<s;r++)h+=a.float(t[o+r],e),r===s-1||(h+=" ");i=r,o+=s}return h},parse(t,e){let s,r,i,o="";const n=[],a=e?qt:Gt;for(let e=0,h=t.length;e<h;e++)r=t[e],ft[r]?("."===r&&(ls.dot++,ls.dot>1&&(ds(n,o),o="")),o+=r):Ht[r]?(o&&(ds(n,o),o=""),ls.name=Ht[r],ls.length=Ut[r],ls.index=0,ds(n,ls.name),!s&&a[r]&&(s=!0)):"-"===r||"+"===r?"e"===i||"E"===i?o+=r:(o&&ds(n,o),o=r):o&&(ds(n,o),o=""),i=r;return o&&ds(n,o),s?hs.toCanvasData(n,e):n},toCanvasData(t,e){let s,r,i,o,n,a=0,h=0,l=0,d=0,u=0,c=t.length;const p=[];for(;u<c;){switch(i=t[u],i){case Te:t[u+1]+=a,t[u+2]+=h;case Ce:a=t[u+1],h=t[u+2],p.push(Ce,a,h),u+=3;break;case Le:t[u+1]+=a;case Re:a=t[u+1],p.push(Oe,a,h),u+=2;break;case Ie:t[u+1]+=h;case Se:h=t[u+1],p.push(Oe,a,h),u+=2;break;case Pe:t[u+1]+=a,t[u+2]+=h;case Oe:a=t[u+1],h=t[u+2],p.push(Oe,a,h),u+=3;break;case We:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=Ee;case Ee:n=o===Ae||o===Ee,l=n?2*a-s:t[u+1],d=n?2*h-r:t[u+2],s=t[u+1],r=t[u+2],a=t[u+3],h=t[u+4],p.push(Ae,l,d,s,r,a,h),u+=5;break;case Me:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,t[u+5]+=a,t[u+6]+=h,i=Ae;case Ae:s=t[u+3],r=t[u+4],a=t[u+5],h=t[u+6],p.push(Ae,t[u+1],t[u+2],s,r,a,h),u+=7;break;case Xe:t[u+1]+=a,t[u+2]+=h,i=Ye;case Ye:n=o===De||o===Ye,s=n?2*a-s:t[u+1],r=n?2*h-r:t[u+2],e?is(p,a,h,s,r,t[u+1],t[u+2]):p.push(De,s,r,t[u+1],t[u+2]),a=t[u+1],h=t[u+2],u+=3;break;case Ne:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=De;case De:s=t[u+1],r=t[u+2],e?is(p,a,h,s,r,t[u+3],t[u+4]):p.push(De,s,r,t[u+3],t[u+4]),a=t[u+3],h=t[u+4],u+=5;break;case Fe:t[u+6]+=a,t[u+7]+=h;case ze:os(p,a,h,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],e),a=t[u+6],h=t[u+7],u+=8;break;case He:case je:p.push(je),u++;break;case Ue:a=t[u+1],h=t[u+2],e?Ke(p,a,h,t[u+3],t[u+4]):us(p,t,u,5),u+=5;break;case Ge:a=t[u+1],h=t[u+2],e?ts(p,a,h,t[u+3],t[u+4],[t[u+5],t[u+6],t[u+7],t[u+8]]):us(p,t,u,9),u+=9;break;case qe:a=t[u+1],h=t[u+2],e?ts(p,a,h,t[u+3],t[u+4],t[u+5]):us(p,t,u,6),u+=6;break;case Ve:rs(e?p:us(p,t,u,9),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],t[u+7],t[u+8],null,as),a=as.x,h=as.y,u+=9;break;case Qe:e?rs(p,t[u+1],t[u+2],t[u+3],t[u+4],0,0,360,!1):us(p,t,u,5),a=t[u+1]+t[u+3],h=t[u+2],u+=5;break;case Je:ss(e?p:us(p,t,u,7),t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],t[u+6],null,as),a=as.x,h=as.y,u+=7;break;case Ze:e?ss(p,t[u+1],t[u+2],t[u+3],0,360,!1):us(p,t,u,4),a=t[u+1]+t[u+3],h=t[u+2],u+=4;break;case $e:es(e?p:us(p,t,u,6),a,h,t[u+1],t[u+2],t[u+3],t[u+4],t[u+5],null,as),a=as.x,h=as.y,u+=6;break;default:return ns.error(`command: ${i} [index:${u}]`,t),p}o=i}return p},copyData(t,e,s,r){for(let i=s,o=s+r;i<o;i++)t.push(e[i])},pushData(t,e){ls.index===ls.length&&(ls.index=1,t.push(ls.name)),t.push(Number(e)),ls.index++,ls.dot=0}},{current:ls,pushData:ds,copyData:us}=hs,{M:cs,L:ps,C:_s,Q:fs,Z:gs,N:ys,D:xs,X:ms,G:ws,F:bs,O:vs,P:Bs,U:ks}=Ht,{getMinDistanceFrom:Cs,getRadianFrom:Ts}=I,{tan:Os,min:Ps,abs:Rs}=Math,Ls={},Ss={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,r,i,o,n){t.push(_s,e,s,r,i,o,n)},quadraticCurveTo(t,e,s,r,i){t.push(fs,e,s,r,i)},closePath(t){t.push(gs)},rect(t,e,s,r,i){t.push(ys,e,s,r,i)},roundRect(t,e,s,r,i,o){if("number"==typeof o)t.push(ms,e,s,r,i,o);else{const n=a.fourNumber(o);n?t.push(xs,e,s,r,i,...n):t.push(ys,e,s,r,i)}},ellipse(t,e,s,r,i,o,n,a,h){void 0===o?t.push(bs,e,s,r,i):(void 0===n&&(n=0),void 0===a&&(a=360),t.push(ws,e,s,r,i,o,n,a,h?1:0))},arc(t,e,s,r,i,o,n){void 0===i?t.push(Bs,e,s,r):(void 0===o&&(o=360),t.push(vs,e,s,r,i,o,n?1:0))},arcTo(t,e,s,r,i,o,n,a){if(void 0!==n){const h=Os(Ts(n,a,e,s,r,i)/2)*(Cs(n,a,e,s,r,i)/2);t.push(ks,e,s,r,i,Ps(o,Rs(h)))}else t.push(ks,e,s,r,i,o)},drawEllipse(t,e,s,r,i,o,n,a,h){fe.ellipse(null,e,s,r,i,void 0===o?0:o,void 0===n?0:n,void 0===a?360:a,h,null,null,Ls),t.push(cs,Ls.x,Ls.y),Is(t,e,s,r,i,o,n,a,h)},drawArc(t,e,s,r,i,o,n){fe.arc(null,e,s,r,void 0===i?0:i,void 0===o?360:o,n,null,null,Ls),t.push(cs,Ls.x,Ls.y),As(t,e,s,r,i,o,n)},drawPoints(t,e,s,r){fe.points(t,e,s,r)}},{ellipse:Is,arc:As}=Ss,{moveTo:Ms,lineTo:Es,quadraticCurveTo:Ws,bezierCurveTo:Ds,closePath:Ns,beginPath:Ys,rect:Xs,roundRect:zs,ellipse:Fs,arc:js,arcTo:Hs,drawEllipse:Us,drawArc:Gs,drawPoints:qs}=Ss;class Vs{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.clearPath=this.beginPath,this.set(t)}set(t){return this.__path=t?"string"==typeof t?Ft.parse(t):t:[],this}beginPath(){return Ys(this.__path),this}moveTo(t,e){return Ms(this.__path,t,e),this}lineTo(t,e){return Es(this.__path,t,e),this}bezierCurveTo(t,e,s,r,i,o){return Ds(this.__path,t,e,s,r,i,o),this}quadraticCurveTo(t,e,s,r){return Ws(this.__path,t,e,s,r),this}closePath(){return Ns(this.__path),this}rect(t,e,s,r){return Xs(this.__path,t,e,s,r),this}roundRect(t,e,s,r,i){return zs(this.__path,t,e,s,r,i),this}ellipse(t,e,s,r,i,o,n,a){return Fs(this.__path,t,e,s,r,i,o,n,a),this}arc(t,e,s,r,i,o){return js(this.__path,t,e,s,r,i,o),this}arcTo(t,e,s,r,i){return Hs(this.__path,t,e,s,r,i),this}drawEllipse(t,e,s,r,i,o,n,a){return Us(this.__path,t,e,s,r,i,o,n,a),this}drawArc(t,e,s,r,i,o){return Gs(this.__path,t,e,s,r,i,o),this}drawPoints(t,e,s){return qs(this.__path,t,e,s),this}}const{M:Qs,L:Js,C:Zs,Q:$s,Z:Ks,N:tr,D:er,X:sr,G:rr,F:ir,O:or,P:nr,U:ar}=Ht,hr=gt.get("PathDrawer"),lr={drawPathByData(t,e){if(!e)return;let s,r=0,i=e.length;for(;r<i;)switch(s=e[r],s){case Qs:t.moveTo(e[r+1],e[r+2]),r+=3;break;case Js:t.lineTo(e[r+1],e[r+2]),r+=3;break;case Zs:t.bezierCurveTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5],e[r+6]),r+=7;break;case $s:t.quadraticCurveTo(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case Ks:t.closePath(),r+=1;break;case tr:t.rect(e[r+1],e[r+2],e[r+3],e[r+4]),r+=5;break;case er:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],[e[r+5],e[r+6],e[r+7],e[r+8]]),r+=9;break;case sr:t.roundRect(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;case rr:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]*h,e[r+6]*h,e[r+7]*h,e[r+8]),r+=9;break;case ir:t.ellipse(e[r+1],e[r+2],e[r+3],e[r+4],0,0,l,!1),r+=5;break;case or:t.arc(e[r+1],e[r+2],e[r+3],e[r+4]*h,e[r+5]*h,e[r+6]),r+=7;break;case nr:t.arc(e[r+1],e[r+2],e[r+3],0,l,!1),r+=4;break;case ar:t.arcTo(e[r+1],e[r+2],e[r+3],e[r+4],e[r+5]),r+=6;break;default:return void hr.error(`command: ${s} [index:${r}]`,e)}}},{M:dr,L:ur,C:cr,Q:pr,Z:_r,N:fr,D:gr,X:yr,G:xr,F:mr,O:wr,P:br,U:vr}=Ht,{toTwoPointBounds:Br,toTwoPointBoundsByQuadraticCurve:kr,arcTo:Cr,arc:Tr,ellipse:Or}=fe,{addPointBounds:Pr,copy:Rr,addPoint:Lr,setPoint:Sr,addBounds:Ir,toBounds:Ar}=z,Mr=gt.get("PathBounds");let Er,Wr,Dr;const Nr={},Yr={},Xr={},zr={toBounds(t,e){zr.toTwoPointBounds(t,Yr),Ar(Yr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Sr(e,0,0);let s,r,i,o,n,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(s=t[a],0===a&&(s===_r||s===cr||s===pr?Sr(e,h,l):Sr(e,t[a+1],t[a+2])),s){case dr:case ur:h=t[a+1],l=t[a+2],Lr(e,h,l),a+=3;break;case cr:o=t[a+5],n=t[a+6],Br(h,l,t[a+1],t[a+2],t[a+3],t[a+4],o,n,Nr),Pr(e,Nr),h=o,l=n,a+=7;break;case pr:r=t[a+1],i=t[a+2],o=t[a+3],n=t[a+4],kr(h,l,r,i,o,n,Nr),Pr(e,Nr),h=o,l=n,a+=5;break;case _r:a+=1;break;case fr:h=t[a+1],l=t[a+2],Ir(e,h,l,t[a+3],t[a+4]),a+=5;break;case gr:case yr:h=t[a+1],l=t[a+2],Ir(e,h,l,t[a+3],t[a+4]),a+=s===gr?9:6;break;case xr:Or(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],Nr,Xr),0===a?Rr(e,Nr):Pr(e,Nr),h=Xr.x,l=Xr.y,a+=9;break;case mr:h=t[a+1],l=t[a+2],Wr=t[a+3],Dr=t[a+4],Ir(e,h-Wr,l-Dr,2*Wr,2*Dr),h+=Wr,a+=5;break;case wr:Tr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Nr,Xr),0===a?Rr(e,Nr):Pr(e,Nr),h=Xr.x,l=Xr.y,a+=7;break;case br:h=t[a+1],l=t[a+2],Er=t[a+3],Ir(e,h-Er,l-Er,2*Er,2*Er),h+=Er,a+=4;break;case vr:Cr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Nr,Xr),0===a?Rr(e,Nr):Pr(e,Nr),h=Xr.x,l=Xr.y,a+=6;break;default:return void Mr.error(`command: ${s} [index:${a}]`,t)}}},{M:Fr,L:jr,C:Hr,Z:Ur}=Ht,{getCenterX:Gr,getCenterY:qr}=I,{arcTo:Vr}=Ss,Qr={smooth(t,e,s){let r,i=0,o=0,n=0,a=0,h=0,l=0,d=0,u=0,c=0;const p=t.length,_=[];for(;i<p;)switch(r=t[i],r){case Fr:a=u=t[i+1],h=c=t[i+2],i+=3,t[i]===jr?(l=t[i+1],d=t[i+2],_.push(Fr,Gr(a,l),qr(h,d))):_.push(Fr,a,h);break;case jr:switch(o=t[i+1],n=t[i+2],i+=3,t[i]){case jr:Vr(_,o,n,t[i+1],t[i+2],e,u,c);break;case Ur:Vr(_,o,n,a,h,e,u,c);break;default:_.push(jr,o,n)}u=o,c=n;break;case Hr:_.push(Hr,t[i+1],t[i+2],t[i+3],t[i+4],t[i+5],t[i+6]),i+=7;break;case Ur:Vr(_,a,h,l,d,e,u,c),_.push(Ur),i+=1}return r!==Ur&&(_[1]=a,_[2]=h),_}};Ft.creator=new Vs,Ft.parse=hs.parse,Ft.convertToCanvasData=hs.toCanvasData;const Jr=new Vs,{drawRoundRect:Zr}=Zt;const $r={opacityTypes:["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=Kr.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{}}}},Kr=$r;Kr.opacityTypes.forEach((t=>Kr.upperCaseTypeMap[t]=t.toUpperCase()));const ti=gt.get("TaskProcessor");class ei{constructor(t){this.parallel=!0,this.time=1,this.id=s.create(s.TASK),this.task=t}run(){return At(this,void 0,void 0,(function*(){try{this.task&&!this.isComplete&&this.parent.running&&(yield this.task())}catch(t){ti.error(t)}}))}complete(){this.isComplete=!0,this.parent=null,this.task=null}cancel(){this.isCancel=!0,this.complete()}}class si{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 r=0;r<t;r++)r<=this.finishedIndex?(s+=this.list[r].time,r===this.finishedIndex&&(e=s)):e+=this.list[r].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&&Pt.assign(this.config,t),this.empty()}add(t,e){let s,r,i,o;const n=new ei(t);return n.parent=this,"number"==typeof e?o=e:e&&(r=e.parallel,s=e.start,i=e.time,o=e.delay),i&&(n.time=i),!1===r&&(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,r=this.finishedIndex+s;if(e.length){if(!this.running)return;r<this.total&&(t=this.list[r],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 ri={map:{},recycledList:[],tasker:new si,patternTasker:new si,get isComplete(){return ii.tasker.isComplete},get(t){let s=ii.map[t.url];return s||(s=e.image(t),ii.map[t.url]=s),s.use++,s},recycle(t){t.use--,setTimeout((()=>{t.use||ii.recycledList.push(t)}))},clearRecycled(){const t=ii.recycledList;t.length>100&&(t.forEach((t=>{!t.use&&t.url&&(delete ii.map[t.url],t.destroy())})),t.length=0)},hasOpacityPixel:t=>$r.opacityTypes.some((e=>ii.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;return!1},destroy(){ii.map={},ii.recycledList=[]}},ii=ri,{IMAGE:oi,create:ni}=s;function ai(t,e,s){Object.defineProperty(t,e,s)}function hi(t,e){return Object.getOwnPropertyDescriptor(t,e)}function li(t,e){return(s,r)=>ui(s,r,t,e&&e(r))}function di(t){return t}function ui(t,e,s,r){const i={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)},configurable:!0,enumerable:!0};ai(t,e,Object.assign(i,r||{})),xi(t,e,s)}function ci(t,e){return li(t,(t=>({set(s){this.__setAttr(t,s,e)&&pi(this)}})))}function pi(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}const _i=ci;function fi(t){return li(t,(t=>({set(e){this.__setAttr(t,e)&&gi(this)}})))}function gi(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&pi(t)}const yi=fi;function xi(t,e,s){const r=t.__DataProcessor.prototype,i="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),n={get(){const t=this[i];return void 0===t?s:t},set(t){this[i]=t},configurable:!0,enumerable:!0};void 0===s?n.get=function(){return this[i]}:"width"===e?n.get=function(){const t=this[i];return void 0===t?this.__naturalWidth||s:t}:"height"===e&&(n.get=function(){const t=this[i];return void 0===t?this.__naturalHeight||s:t});let a,h=r;for(;!a&&h;)a=hi(h,e),h=h.__proto__;a&&a.set&&(n.set=a.set),r[o]&&(n.set=r[o],delete r[o]),Object.defineProperty(r,e,n)}const mi=new gt("rewrite"),wi=[],bi=["destroy","constructor"];function vi(t){wi.length&&(wi.forEach((e=>{t&&mi.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()})),wi.length=0)}function Bi(t,e){return s=>{var r;(t.prototype?(r=t.prototype,Object.getOwnPropertyNames(r)):Object.keys(t)).forEach((r=>{if(!(bi.includes(r)||e&&e.includes(r)))if(t.prototype){hi(t.prototype,r).writable&&(s.prototype[r]=t.prototype[r])}else s.prototype[r]=t[r]}))}}setTimeout((()=>vi(!0)));const{copy:ki,toInnerPoint:Ci,scaleOfOuter:Ti,rotateOfOuter:Oi,skewOfOuter:Pi,multiplyParent:Ri,divideParent:Li,getLayout:Si}=b,Ii={},Ai={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),Wi(t,e,s),t.isBranch){const{children:r}=t;for(let t=0,i=r.length;t<i;t++)Ei(r[t],e,s)}},updateMatrix(t,e,s){const r=t.__layout;e?s&&(r.waitAutoLayout=!0,t.__hasAutoLayout&&(r.matrixChanged=!1)):r.waitAutoLayout&&(r.waitAutoLayout=!1),r.matrixChanged&&t.__updateLocalMatrix(),r.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++)Di(e[t])}},updateAllChange(t){if(Di(t),t.__updateChange(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)Ni(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},moveWorld(t,e,s=0){const r="object"==typeof e?Object.assign({},e):{x:e,y:s};t.parent&&Ci(t.parent.worldTransform,r,r,!0),Mi.moveLocal(t,r.x,r.y)},moveLocal(t,e,s=0){"object"==typeof e?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=s)},zoomOfWorld(t,e,s,r,i){Mi.zoomOfLocal(t,Xi(t,e),s,r,i)},zoomOfLocal(t,e,s,r=s,i){ki(Ii,t.__localMatrix),Ti(Ii,e,s,r),Yi(t,Ii),t.scaleResize(s,r,!0!==i)},rotateOfWorld(t,e,s){Mi.rotateOfLocal(t,Xi(t,e),s)},rotateOfLocal(t,e,s){ki(Ii,t.__localMatrix),Oi(Ii,e,s),Yi(t,Ii),t.rotation=a.formatRotation(t.rotation+s)},skewOfWorld(t,e,s,r,i){Mi.skewOfLocal(t,Xi(t,e),s,r,i)},skewOfLocal(t,e,s,r=0,i){ki(Ii,t.__localMatrix),Pi(Ii,e,s,r),Mi.setTransform(t,Ii,i)},transformWorld(t,e,s){ki(Ii,t.worldTransform),Ri(Ii,e),t.parent&&Li(Ii,t.parent.worldTransform),Mi.setTransform(t,Ii,s)},transform(t,e,s){ki(Ii,t.localTransform),Ri(Ii,e),Mi.setTransform(t,Ii,s)},setTransform(t,e,s){const r=Si(e);s&&(t.scaleResize(r.scaleX/t.scaleX,r.scaleY/t.scaleY,!0!==s),delete r.scaleX,delete r.scaleY),t.set(r)},getRelativeWorld:(t,e,s)=>(ki(Ii,t.worldTransform),Li(Ii,e.worldTransform),s?Ii:Object.assign({},Ii)),drop(t,e,s,r){t.setTransform(Mi.getRelativeWorld(t,e,!0),r),e.add(t,s)},hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},hasParentAutoLayout(t){for(;t.parent;)if((t=t.parent).__hasAutoLayout)return!0}},Mi=Ai,{updateAllMatrix:Ei,updateMatrix:Wi,updateAllWorldOpacity:Di,updateAllChange:Ni}=Mi;function Yi(t,e){const{e:s,f:r}=t.__localMatrix;t.x+=e.e-s,t.y+=e.f-r}function Xi(t,e){return t.__layout.update(),t.parent?I.tempToInnerOf(e,t.parent.__world):e}const zi={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser?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:Fi}=Ai,ji={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 r=0,i=s.length;r<i;r++)(t=s[r]).isBranch&&(t.__tempNumber=1,e.add(t),Hi(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:r}=t;for(let t=0,s=r.length;t<s;t++)r[t].isBranch&&e.push(r[t]);for(let t=s,r=e.length;t<r;t++)Ui(e[t],e)},updateBounds(t,e){const s=[t];Ui(t,s),Gi(s,e)},updateBoundsByBranchStack(t,e){let s,r;for(let i=t.length-1;i>-1;i--){s=t[i],r=s.children;for(let t=0,e=r.length;t<e;t++)Fi(r[t]);e&&e===s||Fi(s)}}},{pushAllChildBranch:Hi,pushAllBranchStack:Ui,updateBoundsByBranchStack:Gi}=ji,qi={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:Vi}=Ai,{toOuterOf:Qi,getPoints:Ji,copy:Zi}=it;class $i{get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}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.boxBounds={x:0,y:0,width:0,height:0},this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),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{leafer:e}=this.leaf;if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=this.leaf;for(;e.parent&&!e.parent.leafer;)e=e.parent;t.layout(e)}}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 Vi(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 ht(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"margin":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"margin":case"content":case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"content":if(this.contentBounds)return this.getWorldContentBounds();case"margin":case"box":return this.getWorldBoxBounds();case"margin":case"stroke":return this.getWorldStrokeBounds()}}getLayoutBounds(t,e="world",s){const{leaf:r}=this;let i,o,n=this.getInnerBounds(t);switch(e){case"world":i=r.getWorldPoint(n),o=r.__world;break;case"local":i=r.getLocalPointByInner(n),o=r.__localMatrix;break;case"inner":i=n,o=b.defaultMatrix;break;case"page":e=r.zoomLayer;default:i=r.getWorldPoint(n,e),o=Vi(r,e,!0)}const a=b.getLayout(o);if(Zi(a,n),I.copy(a,i),s){const{scaleX:t,scaleY:e}=a,s=Math.abs(t),r=Math.abs(e);1===s&&1===r||(a.scaleX/=s,a.scaleY/=r,a.width*=s,a.height*=r)}return a}getLayoutPoints(t,e="world"){const{leaf:s}=this,r=Ji(this.getInnerBounds(t));let i;switch(e){case"world":i=null;break;case"local":i=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:i=e}return void 0!==i&&r.forEach((t=>s.innerToWorld(t,null,!1,i))),r}getWorldContentBounds(){return this._worldContentBounds||(this._worldContentBounds={}),Qi(this.contentBounds,this.leaf.__world,this._worldContentBounds),this._worldContentBounds}getWorldBoxBounds(){return this._worldBoxBounds||(this._worldBoxBounds={}),Qi(this.boxBounds,this.leaf.__world,this._worldBoxBounds),this._worldBoxBounds}getWorldStrokeBounds(){return this._worldStrokeBounds||(this._worldStrokeBounds={}),Qi(this.strokeBounds,this.leaf.__world,this._worldStrokeBounds),this._worldStrokeBounds}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}spreadStroke(){const{x:t,y:e,width:s,height:r}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:r},this._localStrokeBounds={x:t,y:e,width:s,height:r},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:r}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:r},this._localRenderBounds={x:t,y:e,width:s,height:r}}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=!0,this.leaf.forceUpdate("surface"))}destroy(){}}const Ki={},to={on(t,e,s){let r,i,o;s&&("boolean"==typeof s?r=s:(r=s.capture,i=s.once));const n=eo(this,r,!0),a="string"==typeof t?t.split(" "):t,h=i?{listener:e,once:i}:{listener:e};a.forEach((t=>{t&&(o=n[t],o?-1===o.findIndex((t=>t.listener===e))&&o.push(h):n[t]=[h])}))},off(t,e,s){let r,i,o;s&&(r="boolean"==typeof s?s:s.capture);const n=eo(this,r);("string"==typeof t?t.split(" "):t).forEach((t=>{t&&(i=n[t],i&&(o=i.findIndex((t=>t.listener===e)),o>-1&&i.splice(o,1),i.length||delete n[t]))}))},on_(t,e,s,r){return s&&(e=e.bind(s)),this.on(t,e,r),{type:t,current:this,listener:e,options:r}},off_(t){if(!t)return;const e=t instanceof Array?t:[t];e.forEach((t=>t.current.off(t.type,t.listener,t.options))),e.length=0},once(t,e,s){this.on(t,e,{once:!0,capture:s})},emit(t,e,s){!e&&Tt.has(t)&&(e=Tt.get(t,{type:t,target:this,current:this}));const r=eo(this,s)[t];if(r){let i;for(let o=0,n=r.length;o<n&&(i=r[o],i.listener(e),i.once&&(this.off(t,i.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:r}=this,i=s&&s[t],o=r&&r[t];return!!(void 0===e?i||o:e?o:i)}};function eo(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:Ki)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:Ki)}}class so{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&t.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&t.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&t.event.stop(this.origin)}}class ro extends so{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}ro.ADD="child.add",ro.REMOVE="child.remove",ro.DESTROY="child.destroy";class io extends so{constructor(t,e,s,r,i){super(t,e),this.attrName=s,this.oldValue=r,this.newValue=i}}io.CHANGE="property.change",io.LEAFER_CHANGE="property.leafer_change";class oo extends so{constructor(t,e){super(t),Object.assign(this,e)}}oo.LOAD="image.load",oo.LOADED="image.loaded",oo.ERROR="image.error";class no extends so{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(no.RESIZE),Object.assign(this,t)):super(t),this.old=e}}no.RESIZE="resize";class ao extends so{constructor(t,e){super(t),this.data=e}}ao.REQUEST="watch.request",ao.DATA="watch.data";class ho extends so{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}ho.CHECK_UPDATE="layout.check_update",ho.REQUEST="layout.request",ho.START="layout.start",ho.BEFORE="layout.before",ho.LAYOUT="layout",ho.AFTER="layout.after",ho.AGAIN="layout.again",ho.END="layout.end";class lo extends so{}lo.FRAME="animate.frame";class uo extends so{constructor(t,e,s,r){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=r)}}uo.REQUEST="render.request",uo.START="render.start",uo.BEFORE="render.before",uo.RENDER="render",uo.AFTER="render.after",uo.AGAIN="render.again",uo.END="render.end",uo.NEXT="render.next";class co extends so{}co.START="leafer.start",co.BEFORE_READY="leafer.before_ready",co.READY="leafer.ready",co.AFTER_READY="leafer.after_ready",co.VIEW_READY="leafer.view_ready",co.VIEW_COMPLETED="leafer.view_completed",co.STOP="leafer.stop",co.RESTART="leafer.restart",co.END="leafer.end";const{isFinite:po}=Number,_o=gt.get("setAttr"),fo={__setAttr(t,e,s){if(this.leafer&&this.leafer.created){const r=this.__.__getInput(t);if(s&&!po(e)&&void 0!==e&&(_o.warn(this.innerName,t,e),e=void 0),"object"==typeof e||r!==e){this.__[t]=e,this.__proxyData&&this.setProxyAttr(t,e);const{CHANGE:s}=io,i=new io(s,this,t,r,e);return this.isLeafer?this.emitEvent(new io(io.LEAFER_CHANGE,this,t,r,e)):this.hasEvent(s)&&this.emitEvent(i),this.leafer.emitEvent(i),!0}return!1}return this.__[t]=e,this.__proxyData&&this.setProxyAttr(t,e),!0},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:go,multiplyParent:yo,translateInner:xo,defaultWorld:mo}=b,{toPoint:wo,tempPoint:bo}=pt,vo={__updateWorldMatrix(){yo(this.__local||this.__layout,this.parent?this.parent.__world:mo,this.__world,!!this.__layout.affectScaleOrRotation,this.__)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged||t.rotationChanged)&&(go(e,s,null,t.affectRotation),t.scaleChanged=t.rotationChanged=!1),e.e=s.x,e.f=s.y,s.around&&(wo(s.around,t.boxBounds,bo),xo(e,-bo.x,-bo.y))}this.__layout.matrixChanged=!1}},{updateMatrix:Bo,updateAllMatrix:ko,hasParentAutoLayout:Co}=Ai,{updateBounds:To}=ji,{toOuterOf:Oo,copyAndSpread:Po,copy:Ro}=it,{toBounds:Lo}=zr,So={__updateWorldBounds(){Oo(this.__layout.renderBounds,this.__world,this.__world),this.__layout.resized&&(this.__onUpdateSize(),this.__layout.resized=!1)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.boxChanged=!1,t.resized=!0),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=!1,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=!1,t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized=!0),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=!1,this.parent&&this.parent.__layout.renderChange()),t.boundsChanged=!1},__updateLocalBoxBounds(){this.__hasAutoLayout&&this.__updateAutoLayout(),Oo(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Oo(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Oo(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(){const t=this.__layout.boxBounds,e=this.__;e.__pathInputed?Lo(e.__pathForRender,t):(t.x=0,t.y=0,t.width=e.width,t.height=e.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.leafer&&this.leafer.layouter.addExtra(this),Co(this)?Bo(this):(ko(this),To(this,this))):Bo(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(){Po(this.__layout.strokeBounds,this.__layout.boxBounds,this.__layout.strokeSpread)},__updateRenderBounds(){const{renderSpread:t,strokeBounds:e,renderBounds:s}=this.__layout;t>0?Po(s,e,t):Ro(s,e)}},Io={__render(t,e){if(this.__worldOpacity)if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=this.__.opacity,this.__.__single){const s=t.getSameCanvas(!0,!0);this.__draw(s,e),this.__worldFlipped?t.copyWorldByReset(s,this.__nowWorld,null,this.__.__blendMode,!0):t.copyWorldToInner(s,this.__nowWorld,this.__layout.renderBounds,this.__.__blendMode),s.recycle(this.__nowWorld)}else this.__draw(t,e)},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),this.__.windingRule?t.clip(this.__.windingRule):t.clip())},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:Ao}=zi,Mo={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__worldOpacity)if(this.__.__single){const s=t.getSameCanvas(!1,!0);this.__renderBranch(s,e);const r=this.__getNowWorld(e);t.opacity=this.__.opacity,t.copyWorldByReset(s,r,r,this.__.__blendMode,!0),s.recycle(r)}else this.__renderBranch(t,e)},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let r=0,i=s.length;r<i;r++)Ao(s[r],e)||s[r].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let r=0,i=s.length;r<i;r++)Ao(s[r],e)||s[r].__clip(t,e)}}},{LEAF:Eo,create:Wo}=s,{toInnerPoint:Do,toOuterPoint:No,multiplyParent:Yo}=b,{toOuterOf:Xo}=it,{tempToOuterOf:zo,copy:Fo}=I,{moveLocal:jo,zoomOfLocal:Ho,rotateOfLocal:Uo,skewOfLocal:Go,moveWorld:qo,zoomOfWorld:Vo,rotateOfWorld:Qo,skewOfWorld:Jo,transform:Zo,transformWorld:$o,setTransform:Ko,getRelativeWorld:tn,drop:en}=Ai;exports.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 Lt}get __LayoutProcessor(){return $i}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 pathInputed(){return!!this.__.__pathInputed}constructor(t){this.innerId=Wo(Eo),this.reset(t)}reset(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.__parentWait?this.__parentWait.push(t):this.__parentWait=[t]}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.__leaferWait?this.__leaferWait.push(t):this.__leaferWait=[t]}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.__leaferWait&&qi.run(this.__leaferWait)),this.isBranch){const{children:e}=this;for(let s=0,r=e.length;s<r;s++)e[s].__bindLeafer(t)}}set(t){}get(t){}toJSON(){return this.__.__getInputData()}toString(){return JSON.stringify(this.toJSON())}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findOne(t,e){}focus(t){}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}updateLayout(){this.__layout.update()}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(){}__updateStrokeBounds(){}__updateRenderBounds(){}__updateAutoLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some((t=>t.__.eraser))}__updateMask(t){this.__hasMask=!!t||this.children.some((t=>t.__.mask))}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld;return Yo(this.__world,t.matrix,e,void 0,this.__world),Xo(this.__layout.renderBounds,e,e),e}return this.__world}getWorld(t){return this.__layout.update(),"x"===t?this.__world.e:"y"===t?this.__world.f:this.getLayoutBounds()[t]}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 r=e?tn(this,e):this.worldTransform,i=s?t:{};return Xo(t,r,i),i}worldToLocal(t,e,s,r){this.parent?this.parent.worldToInner(t,e,s,r):e&&Fo(e,t)}localToWorld(t,e,s,r){this.parent?this.parent.innerToWorld(t,e,s,r):e&&Fo(e,t)}worldToInner(t,e,s,r){r&&(r.innerToWorld(t,e,s),t=e||t),Do(this.worldTransform,t,e,s)}innerToWorld(t,e,s,r){No(this.worldTransform,t,e,s),r&&r.worldToInner(e||t,null,s)}getInnerPoint(t,e,s,r){const i=r?t:{};return this.worldToInner(t,i,s,e),i}getInnerPointByLocal(t,e,s,r){return this.getInnerPoint(t,this.parent,s,r)}getLocalPoint(t,e,s,r){const i=r?t:{};return this.worldToLocal(t,i,s,e),i}getLocalPointByInner(t,e,s,r){return this.getWorldPoint(t,this.parent,s,r)}getWorldPoint(t,e,s,r){const i=r?t:{};return this.innerToWorld(t,i,s,e),i}getWorldPointByLocal(t,e,s,r){const i=r?t:{};return this.localToWorld(t,i,s,e),i}getPagePoint(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,r)}getWorldPointByPage(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,r)}setTransform(t,e){Ko(this,t,e)}transform(t,e){Zo(this,t,e)}move(t,e){jo(this,t,e)}scaleOf(t,e,s,r){Ho(this,zo(t,this.localTransform),e,s,r)}rotateOf(t,e){Uo(this,zo(t,this.localTransform),e)}skewOf(t,e,s,r){Go(this,zo(t,this.localTransform),e,s,r)}transformWorld(t,e){$o(this,t,e)}moveWorld(t,e){qo(this,t,e)}scaleOfWorld(t,e,s,r){Vo(this,t,e,s,r)}rotateOfWorld(t,e){Qo(this,t,e)}skewOfWorld(t,e,s,r){Jo(this,t,e,s,r)}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}__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){}__clip(t,e){}__renderShape(t,e,s,r){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){en(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,r){}off_(t){}once(t,e,s){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e){xi(this.prototype,t,e)}static addAttr(t,e,s){s||(s=ci),s(e)(this.prototype,t)}destroy(){if(!this.destroyed){const{parent:t}=this;t&&this.remove(),this.children&&this.removeAll(!0),this.hasEvent(ro.DESTROY)&&this.emitEvent(new ro(ro.DESTROY,this,t)),this.__.destroy(),this.__layout.destroy(),this.__captureMap=this.__bubbleMap=this.__parentWait=this.__leaferWait=null,this.destroyed=!0}}},exports.Leaf=It([Bi(fo),Bi(vo),Bi(So),Bi(to),Bi(Io)],exports.Leaf);const{setListWithFn:sn}=it,{sort:rn}=ji,{localBoxBounds:on,localStrokeBounds:nn,localRenderBounds:an,maskLocalBoxBounds:hn,maskLocalStrokeBounds:ln,maskLocalRenderBounds:dn}=zi;exports.Branch=class extends exports.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(){sn(this.__layout.boxBounds,this.children,this.__hasMask?hn:on)}__updateStrokeBounds(){sn(this.__layout.strokeBounds,this.children,this.__hasMask?ln:nn)}__updateRenderBounds(){sn(this.__layout.renderBounds,this.children,this.__hasMask?dn:an)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,r=e.length;s<r;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(rn),this.__layout.affectChildrenSort=t}}add(t,e){t!==this&&(t.parent&&t.parent.remove(t),t.parent=this,void 0===e?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1),t.__layout.boxChanged||t.__layout.boxChange(),t.__layout.matrixChanged||t.__layout.matrixChange(),t.__parentWait&&qi.run(t.__parentWait),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(ro.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange())}addMany(...t){t.forEach((t=>this.add(t)))}remove(t,e){if(t){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())}else 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)}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(ro.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new ro(t,e,this);e.hasEvent(t)&&e.emitEvent(s),this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}},exports.Branch=It([Bi(Mo)],exports.Branch);class un{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:r}=this;for(let t=e,i=r.length;t<i;t++)s[r[t].innerId]++;0===e?r.unshift(t):(e>r.length&&(e=r.length),r.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 r=0,i=e.length;r<i;r++)void 0!==s?this.keys[e[r].innerId]=r-1:e[r].innerId===t.innerId&&(s=r,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 un;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,r=t.length;s<r;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}exports.AnimateEvent=lo,exports.AroundHelper=pt,exports.AutoBounds=class{constructor(t,e,s,r,i,o){"object"==typeof t?this.copy(t):this.set(t,e,s,r,i,o)}set(t=0,e=0,s=0,r=0,i=0,o=0){this.top=t,this.right=e,this.bottom=s,this.left=r,this.width=i,this.height=o}copy(t){const{top:e,right:s,bottom:r,left:i,width:o,height:n}=t;this.set(e,s,r,i,o,n)}getBoundsFrom(t){const{top:e,right:s,bottom:r,left:i,width:o,height:n}=this;return new ht(i,e,o||t.width-i-s,n||t.height-e-r)}},exports.BezierHelper=fe,exports.Bounds=ht,exports.BoundsHelper=it,exports.BranchHelper=ji,exports.BranchRender=Mo,exports.CanvasManager=class{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let s;const{list:r}=this;for(let e=0,i=r.length;e<i;e++)if(s=r[e],s.recycled&&s.isSameSize(t))return s.recycled=!1,s.manager||(s.manager=this),s;const i=e.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,r=this.list.length;s<r;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()}},exports.ChildEvent=ro,exports.Creator=e,exports.DataHelper=Pt,exports.Debug=gt,exports.EllipseHelper=ke,exports.Event=so,exports.EventCreator=Tt,exports.FileHelper=$r,exports.ImageEvent=oo,exports.ImageManager=ri,exports.IncrementId=s,exports.LayoutEvent=ho,exports.LeafBounds=So,exports.LeafBoundsHelper=zi,exports.LeafData=Lt,exports.LeafDataProxy=fo,exports.LeafEventer=to,exports.LeafHelper=Ai,exports.LeafLayout=$i,exports.LeafLevelList=class{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,r=e.length;s<r;s++)t(e[s])}))}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}},exports.LeafList=un,exports.LeafMatrix=vo,exports.LeafRender=Io,exports.LeaferCanvasBase=class extends Nt{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}get pixelHeight(){return this.height*this.pixelRatio}get allowBackgroundColor(){return this.view&&this.parentView}constructor(e,r){super(),this.size={},this.worldTransform={},e||(e=Xt),e.pixelRatio||(e.pixelRatio=t.devicePixelRatio),this.manager=r,this.innerId=s.create(s.CNAVAS);const{width:i,height:o,pixelRatio:n}=e;this.autoLayout=!i||!o,this.size.pixelRatio=n,this.config=e,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){if(this.isSameSize(t))return;let e;this.context&&!this.unreal&&this.width&&(e=this.getSameCanvas(),e.copyWorld(this)),Pt.copyAttrs(this.size,t,zt),this.size.pixelRatio||(this.size.pixelRatio=1),this.bounds=new ht(0,0,this.width,this.height),this.unreal||(this.updateViewSize(),this.smooth=this.config.smooth),this.updateClientBounds(),this.context&&!this.unreal&&e&&(this.clearWorld(e.bounds),this.copyWorld(e),e.recycle())}updateViewSize(){}updateClientBounds(){}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s}=this,r=this.worldTransform;if(e){const{a:i,b:o,c:n,d:a,e:h,f:l}=e;this.setTransform(r.a=(t.a*i+t.b*n)*s,r.b=(t.a*o+t.b*a)*s,r.c=(t.c*i+t.d*n)*s,r.d=(t.c*o+t.d*a)*s,r.e=(t.e*i+t.f*n+h)*s,r.f=(t.e*o+t.f*a+l)*s)}else this.setTransform(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)}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){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s)}setStrokeOptions(t){this.strokeCap="none"===t.strokeCap?"butt":t.strokeCap,this.strokeJoin=t.strokeJoin,this.dashPattern=t.dashPattern,this.dashOffset=t.dashOffset,this.miterLimit=t.miterLimit}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,r){const{pixelRatio:i}=this;this.shadowOffsetX=t*i,this.shadowOffsetY=e*i,this.shadowBlur=s*i,this.shadowColor=r||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,r){if(r&&(this.blendMode=r),e){const{pixelRatio:r}=this;s||(s=e),this.drawImage(t.view,e.x*r,e.y*r,e.width*r,e.height*r,s.x*r,s.y*r,s.width*r,s.height*r)}else this.drawImage(t.view,0,0);r&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,r){if(r&&(this.blendMode=r),e.b||e.c)this.save(),this.resetTransform(),this.copyWorld(t,e,it.tempToOuterOf(s,e)),this.restore();else{const{pixelRatio:r}=this;this.drawImage(t.view,e.x*r,e.y*r,e.width*r,e.height*r,s.x,s.y,s.width,s.height)}r&&(this.blendMode="source-over")}copyWorldByReset(t,e,s,r,i){this.resetTransform(),this.copyWorld(t,e,s,r),i||this.useWorldTransform()}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,lt.set(t).scale(this.pixelRatio),this.fillRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s){s&&(this.blendMode=s),this.strokeStyle=e,lt.set(t).scale(this.pixelRatio),this.strokeRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}clearWorld(t,e){lt.set(t).scale(this.pixelRatio),e&<.ceil(),this.clearRect(lt.x,lt.y,lt.width,lt.height)}clipWorld(t,e){this.beginPath(),lt.set(t).scale(this.pixelRatio),e&<.ceil(),this.rect(lt.x,lt.y,lt.width,lt.height),this.clip()}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t,this.height*t)}isSameSize(t){return this.width===t.width&&this.height===t.height&&this.pixelRatio===t.pixelRatio}getSameCanvas(t,s){const r=this.manager?this.manager.get(this.size):e.canvas(Object.assign({},this.size));return r.save(),t&&(Yt(r.worldTransform,this.worldTransform),r.useWorldTransform()),s&&(r.smooth=this.smooth),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t,!0):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}},exports.LeaferEvent=co,exports.LeaferImage=class{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){this.use=0,this.waitComplete=[],this.innerId=ni(oi),this.config=t||{url:""},this.isSVG=ri.isFormat("svg",t),this.hasOpacityPixel=ri.hasOpacityPixel(t)}load(e,s){return this.loading||(this.loading=!0,ri.tasker.add((()=>At(this,void 0,void 0,(function*(){return yield t.origin.loadImage(this.url).then((t=>{this.ready=!0,this.width=t.naturalWidth||t.width,this.height=t.naturalHeight||t.height,this.view=t,this.onComplete(!0)})).catch((t=>{this.error=t,this.onComplete(!1)}))}))))),this.waitComplete.push(e,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}onComplete(t){let e;this.waitComplete.forEach(((s,r)=>{e=r%2,s&&(t?e||s(this):e&&s(this.error))})),this.waitComplete.length=0,this.loading=!1}getCanvas(e,s,r,i){if(e||(e=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=t.origin.createCanvas(e,s),n=o.getContext("2d");return r&&(n.globalAlpha=r),n.drawImage(this.view,0,0,e,s),this.cache=this.use>1?{data:o,params:arguments}:null,o}getPattern(e,s,r,i){const o=t.canvas.createPattern(e,s);try{r&&o.setTransform&&(o.setTransform(r),r=null)}catch(t){}return i&&(i.transform=r),o}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}},exports.MathHelper=a,exports.Matrix=Y,exports.MatrixHelper=b,exports.NeedConvertToCanvasCommandMap=Gt,exports.OneRadian=h,exports.PI2=l,exports.PI_2=d,exports.PathBounds=zr,exports.PathCommandDataHelper=Ss,exports.PathCommandMap=Ht,exports.PathConvert=hs,exports.PathCorner=Qr,exports.PathCreator=Vs,exports.PathDrawer=lr,exports.PathHelper=Ft,exports.PathNumberCommandLengthMap=Jt,exports.PathNumberCommandMap=Qt,exports.Platform=t,exports.Point=D,exports.PointHelper=I,exports.PropertyEvent=io,exports.RectHelper=Zt,exports.RenderEvent=uo,exports.ResizeEvent=no,exports.Run=wt,exports.StringNumberMap=ft,exports.TaskItem=ei,exports.TaskProcessor=si,exports.TwoPointBoundsHelper=z,exports.UICreator=Bt,exports.WaitHelper=qi,exports.WatchEvent=ao,exports.affectRenderBoundsType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}})))},exports.affectStrokeBoundsType=fi,exports.attr=di,exports.autoLayoutType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.matrixChanged||this.__layout.matrixChange(),this.__hasAutoLayout=!!e,this.__local||this.__layout.createLocal()}})))},exports.boundsType=ci,exports.canvasPatch=function(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,r,i){Zr(this,t,e,s,r,i)})}(t)},exports.canvasSizeAttrs=zt,exports.cursorType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}})))},exports.dataProcessor=function(t){return(e,s)=>{ai(e,"__DataProcessor",{get:()=>t})}},exports.dataType=function(t){return li(t)},exports.decorateLeafAttr=li,exports.defineDataProcessor=xi,exports.defineKey=ai,exports.defineLeafAttr=ui,exports.doBoundsType=pi,exports.doStrokeType=gi,exports.emptyData={},exports.eraserType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.waitParent((()=>{this.parent.__updateEraser(e)}))}})))},exports.getBoundsData=c,exports.getDescriptor=hi,exports.getMatrixData=p,exports.getPointData=u,exports.hitType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),gt.showHitView&&(this.__layout.surfaceChanged||this.__layout.surfaceChange()),this.leafer&&this.leafer.updateCursor()}})))},exports.layoutProcessor=function(t){return(e,s)=>{ai(e,"__LayoutProcessor",{get:()=>t})}},exports.maskType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent((()=>{this.parent.__updateMask(e)}))}})))},exports.naturalBoundsType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),pi(this),this.__.__removeNaturalSize()}})))},exports.opacityType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.opacityChanged||this.__layout.opacityChange()}})))},exports.pathInputType=function(t){return li(t,(t=>({set(e){2!==this.__.__pathInputed&&(this.__.__pathInputed=e?1:0),this.__setAttr(t,e),pi(this)}})))},exports.pathType=_i,exports.pen=Jr,exports.positionType=function(t,e){return li(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.matrixChanged||this.__layout.matrixChange()}})))},exports.registerUI=function(){return t=>{Bt.register(t)}},exports.registerUIEvent=function(){return t=>{Tt.register(t)}},exports.rewrite=function(t){return(e,s)=>{wi.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}},exports.rewriteAble=function(){return t=>{vi()}},exports.rotationType=function(t,e){return li(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.rotationChanged||this.__layout.rotationChange()}})))},exports.scaleType=function(t,e){return li(t,(t=>({set(s){this.__setAttr(t,s,e),this.__layout.scaleChanged||this.__layout.scaleChange()}})))},exports.sortType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.surfaceChanged||this.__layout.surfaceChange(),this.waitParent((()=>{this.parent.__layout.childrenSortChange()}))}})))},exports.strokeType=yi,exports.surfaceType=function(t){return li(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.surfaceChanged||this.__layout.surfaceChange()}})))},exports.tempBounds=lt,exports.tempMatrix=X,exports.tempPoint=N,exports.useModule=Bi;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/core",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.22",
|
|
4
4
|
"description": "@leafer/core",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,22 +29,22 @@
|
|
|
29
29
|
"leaferjs"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@leafer/canvas": "1.0.0-rc.
|
|
33
|
-
"@leafer/image": "1.0.0-rc.
|
|
34
|
-
"@leafer/data": "1.0.0-rc.
|
|
35
|
-
"@leafer/debug": "1.0.0-rc.
|
|
36
|
-
"@leafer/decorator": "1.0.0-rc.
|
|
37
|
-
"@leafer/display": "1.0.0-rc.
|
|
38
|
-
"@leafer/display-module": "1.0.0-rc.
|
|
39
|
-
"@leafer/event": "1.0.0-rc.
|
|
40
|
-
"@leafer/file": "1.0.0-rc.
|
|
41
|
-
"@leafer/helper": "1.0.0-rc.
|
|
42
|
-
"@leafer/layout": "1.0.0-rc.
|
|
43
|
-
"@leafer/list": "1.0.0-rc.
|
|
44
|
-
"@leafer/math": "1.0.0-rc.
|
|
45
|
-
"@leafer/path": "1.0.0-rc.
|
|
46
|
-
"@leafer/platform": "1.0.0-rc.
|
|
47
|
-
"@leafer/task": "1.0.0-rc.
|
|
48
|
-
"@leafer/interface": "1.0.0-rc.
|
|
32
|
+
"@leafer/canvas": "1.0.0-rc.22",
|
|
33
|
+
"@leafer/image": "1.0.0-rc.22",
|
|
34
|
+
"@leafer/data": "1.0.0-rc.22",
|
|
35
|
+
"@leafer/debug": "1.0.0-rc.22",
|
|
36
|
+
"@leafer/decorator": "1.0.0-rc.22",
|
|
37
|
+
"@leafer/display": "1.0.0-rc.22",
|
|
38
|
+
"@leafer/display-module": "1.0.0-rc.22",
|
|
39
|
+
"@leafer/event": "1.0.0-rc.22",
|
|
40
|
+
"@leafer/file": "1.0.0-rc.22",
|
|
41
|
+
"@leafer/helper": "1.0.0-rc.22",
|
|
42
|
+
"@leafer/layout": "1.0.0-rc.22",
|
|
43
|
+
"@leafer/list": "1.0.0-rc.22",
|
|
44
|
+
"@leafer/math": "1.0.0-rc.22",
|
|
45
|
+
"@leafer/path": "1.0.0-rc.22",
|
|
46
|
+
"@leafer/platform": "1.0.0-rc.22",
|
|
47
|
+
"@leafer/task": "1.0.0-rc.22",
|
|
48
|
+
"@leafer/interface": "1.0.0-rc.22"
|
|
49
49
|
}
|
|
50
50
|
}
|