@leafer/core 1.1.0 → 1.1.2
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 +50 -33
- package/lib/core.esm.js +50 -33
- package/lib/core.esm.min.js +1 -1
- package/lib/core.min.cjs +1 -1
- package/package.json +17 -17
- package/src/index.ts +1 -1
- package/types/index.d.ts +1 -1
package/lib/core.min.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t={toURL(t,e){let s=encodeURIComponent(t);return"text"===e?s="data:text/plain;charset=utf-8,"+s:"svg"===e&&(s="data:image/svg+xml,"+s),s},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",getRealURL(e){const{prefix:s,suffix:r}=t.image;return!r||e.startsWith("data:")||e.startsWith("blob:")||(e+=(e.includes("?")?"&":"?")+r),s&&"/"===e[0]&&(e=s+e),e}}},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)=>("object"==typeof e&&(s=e.max,e=e.min),void 0!==e&&t<e&&(t=e),void 0!==s&&t>s&&(t=s),t),fourNumber(t,e){let s;if(t instanceof Array)switch(t.length){case 4:s=void 0===e?t:[...t];break;case 2:s=[t[0],t[1],t[0],t[1]];break;case 3:s=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(s||(s=[t,t,t,t]),e)for(let t=0;t<4;t++)s[t]>e&&(s[t]=e);return s},formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),a.float(t)),getGapRotation(t,e,s=0){let 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=void 0!==e?o(10,e):1e12;return-0===(t=i(t*s)/s)?0:t},getScaleData:(t,e,s,r)=>(r||(r={}),e?(r.scaleX=("number"==typeof e?e:e.width)/s.width,r.scaleY=("number"==typeof e?e:e.height)/s.height):t&&a.assignScale(r,t),r),assignScale(t,e){"number"==typeof e?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)}},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,r){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,r&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},scaleOfOuter(t,e,s,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,o){let{e:n,f:a}=t;if(o&&(n+=o.scrollX,a+=o.scrollY),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=n*e.a+a*e.c+e.e,s.f=n*e.b+a*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,i){const{x:o,y:n,scaleX:a,scaleY:l}=e;if(void 0===i&&(i=e.rotation||e.skewX||e.skewY),i){const{rotation:s,skewX:r,skewY:i}=e,o=s*h,n=f(o),d=_(o);if(r||i){const e=r*h,s=i*h;t.a=(n+s*-d)*a,t.b=(d+s*n)*a,t.c=(e*n-d)*l,t.d=(n+e*d)*l}else t.a=n*a,t.b=d*a,t.c=-d*l,t.d=n*l}else t.a=a,t.b=0,t.c=0,t.d=l;t.e=o,t.f=n,(s=s||r)&&v.translateInner(t,-s.x,-s.y,!r)},getLayout(t,e,s,r){const{a:i,b:o,c:n,d:a,e:l,f:u}=t;let c,p,m,w,b,v=l,B=u;if(o||n){const t=i*a-o*n;if(n&&!r){c=y(i*i+o*o),p=t/c;const e=i/c;m=o>0?g(e):-g(e)}else{p=y(n*n+a*a),c=t/p;const e=n/p;m=d-(a>0?g(-e):-g(e))}const e=x(f(m)),s=_(m);c=x(c),p=x(p),w=e?x((n/p+s)/e/h,9):0,b=e?x((o/c-s)/e/h,9):0,m=x(m/h)}else c=i,p=a,m=w=b=0;return(e=s||e)&&(v+=e.x*i+e.y*n,B+=e.x*o+e.y*a,s||(v-=e.x,B-=e.y)),{x:v,y:B,scaleX:c,scaleY:p,rotation:m,skewX:w,skewY:b}},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:C}=b,{sin:k,cos:T,abs:P,sqrt:O,atan2:L,min:R,PI:S}=Math,E={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=I.defaultPoint);const r=T(e*=h),i=k(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}=I;return A(s,t),B(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=I;return A(s,t),C(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=I;return A(s,t),I.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){C(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=P(s-t),o=P(r-e);return O(i*i+o*o)},getMinDistanceFrom:(t,e,s,r,i,o)=>R(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),I.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=L(e-r,t-s);const d=L(o-a,i-n)-h;return d<-S?d+l:d},getAtan2:(t,e)=>L(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+k(i)*s,e},toNumberPoints(t){let e=t;return"object"==typeof t[0]&&(e=[],t.forEach((t=>e.push(t.x,t.y)))),e},reset(t){I.reset(t)}},I=E,{getDistanceFrom:M,copy:A,getAtan2:W}=I;class D{constructor(t,e){this.set(t,e)}set(t,e){return"object"==typeof t?E.copy(this,t):E.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 E.move(this,t,e),this}scale(t,e){return E.scale(this,t,e),this}scaleOf(t,e,s){return E.scaleOf(this,t,e,s),this}rotate(t,e){return E.rotate(this,t,e),this}rotateOf(t,e){return E.rotate(this,e,t),this}getRotation(t,e,s){return E.getRotation(this,t,e,s)}toInnerOf(t,e){return E.toInnerOf(this,t,e),this}toOuterOf(t,e){return E.toOuterOf(this,t,e),this}getCenter(t){return new D(E.getCenter(this,t))}getDistance(t){return E.getDistance(this,t)}getDistancePoint(t,e,s){return new D(E.getDistancePoint(this,t,e,s))}getAngle(t){return E.getAngle(this,t)}getAtan2(t){return E.getAtan2(this,t)}reset(){return E.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,s){return b.setLayout(this,t,e,s),this}getLayout(t,e,s){return b.getLayout(this,t,e,s)}withScale(t,e){return b.withScale(this,t,e)}reset(){b.reset(this)}}const 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:Z,ceil:J}=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,i){const{x:o,y:n,width:a,height:h}=e;if(s instanceof Array){const e=Q(s);r?ot.set(t,o+e[3],n+e[0],a-e[1]-e[3],h-e[2]-e[0]):ot.set(t,o-e[3],n-e[0],a+e[1]+e[3],h+e[2]+e[0])}else r&&(s=-s),ot.set(t,o-s,n-s,a+2*s,h+2*s);i&&("width"===i?(t.y=n,t.height=h):(t.x=o,t.width=a))},minX:t=>t.width>0?t.x:t.x+t.width,minY:t=>t.height>0?t.y:t.y+t.height,maxX:t=>t.width>0?t.x+t.width:t.x,maxY:t=>t.height>0?t.y+t.height:t.y,move(t,e,s){t.x+=e,t.y+=s},getByMove:(t,e,s)=>(t=Object.assign({},t),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){E.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,r=s){E.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,!1,s),r},spread(t,e,s){ot.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){ot.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=Z(t.x),t.y=Z(t.y),t.width=e>t.x?J(t.width+e-t.x):J(t.width),t.height=s>t.y?J(t.height+s-t.y):J(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)},setPoint(t,e){ot.set(t,e.x,e.y)},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=E.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=E.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,e){return it.shrink(this,t,e),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}setPoint(t){return it.setPoint(this,t),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",ut[ut["top-left"]=0]="top-left",ut[ut["top-right"]=2]="top-right",ut[ut["bottom-right"]=4]="bottom-right",ut[ut["bottom-left"]=6]="bottom-left";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}];ct.forEach((t=>t.type="percent"));const pt={directionData:ct,tempPoint:{},get:_t,toPoint(t,e,s,r,i){const o=_t(t);s.x=o.x,s.y=o.y,"percent"===o.type&&(s.x*=e.width,s.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{toPoint:ft}=pt,gt={toPoint(t,e,s,r,i){ft(t,s,r,i,e)}},yt={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 xt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new xt(t)}static set filter(t){this.filterList=mt(t)}static set exclude(t){this.excludeList=mt(t)}log(...t){if(wt.enable){if(wt.filterList.length&&wt.filterList.every((t=>t!==this.name)))return;if(wt.excludeList.length&&wt.excludeList.some((t=>t===this.name)))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){wt.enable&&this.warn(...t)}warn(...t){wt.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}xt.filterList=[],xt.excludeList=[],xt.showWarn=!0;const wt=xt,bt=xt.get("RunTime"),vt={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,bt.log(r,i,"ms")},endOfName(t,e){const s=Bt.nameToIdMap[t];void 0!==s&&Bt.end(s,e)}},Bt=vt;function Ct(t){console.error("need plugin: @leafer-in/"+t)}const kt=xt.get("UICreator"),Tt={list:{},register(t){const{__tag:e}=t.prototype;Pt[e]&&kt.repeat(e),Pt[e]=t},get(t,e,s,r,i,o){Pt[t]||kt.error("not register "+t);const n=new Pt[t](e);return void 0!==s&&(n.x=s,r&&(n.y=r),i&&(n.width=i),o&&(n.height=o)),n}},{list:Pt}=Tt,Ot=xt.get("EventCreator"),Lt={nameList:{},register(t){let e;Object.keys(t).forEach((s=>{e=t[s],"string"==typeof e&&(Rt[e]&&Ot.repeat(e),Rt[e]=t)}))},changeName(t,e){const s=Rt[t];if(s){const r=Object.keys(s).find((e=>s[e]===t));r&&(s[r]=e,Rt[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new Rt[t](...e)},{nameList:Rt}=Lt;const St={default:(t,e)=>(Et(e,t),Et(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?Et(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)),toMap(t){const e={};for(let s=0,r=t.length;s<r;s++)e[t[s]]=!0;return e}},{assign:Et}=St;class It{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __blendMode(){if(this.eraser&&"path"!==this.eraser)return"destination-out";const{blendMode:t}=this;return"pass-through"===t?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const e=this.__input[t];if(void 0!==e)return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let s;for(let 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,e){const s={};if(t)if(t instanceof Array)for(let e of t)s[e]=this.__getInput(e);else for(let e in t)s[e]=this.__getInput(e);else{let t,e,{__input:r}=this;s.tag=this.__leaf.tag;for(let i in this)if("_"!==i[0]&&(t=this["_"+i],void 0!==t)){if("path"===i&&!this.__pathInputed)continue;e=r?r[i]:void 0,s[i]=void 0===e?t:e}}if(e&&e.matrix){const{a:t,b:e,c:r,d:i,e:o,f:n}=this.__leaf.__localMatrix;s.matrix={a:t,b:e,c:r,d:i,e:o,f:n}}return s}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser?t.__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 Mt;exports.Answer=void 0,(Mt=exports.Answer||(exports.Answer={}))[Mt.No=0]="No",Mt[Mt.Yes=1]="Yes",Mt[Mt.NoAndSkip=2]="NoAndSkip",Mt[Mt.YesAndSkip=3]="YesAndSkip";function At(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 Dt(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 Nt=[];function Yt(){return(t,e)=>{Nt.push(e)}}const Xt=[];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||Xt)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;Nt.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}}At([Dt("imageSmoothingEnabled")],zt.prototype,"smooth",void 0),At([Dt("imageSmoothingQuality")],zt.prototype,"smoothLevel",void 0),At([Dt("globalAlpha")],zt.prototype,"opacity",void 0),At([Dt()],zt.prototype,"fillStyle",void 0),At([Dt()],zt.prototype,"strokeStyle",void 0),At([Dt("lineWidth")],zt.prototype,"strokeWidth",void 0),At([Dt("lineCap")],zt.prototype,"strokeCap",void 0),At([Dt("lineJoin")],zt.prototype,"strokeJoin",void 0),At([Dt("lineDashOffset")],zt.prototype,"dashOffset",void 0),At([Dt()],zt.prototype,"miterLimit",void 0),At([Dt()],zt.prototype,"shadowBlur",void 0),At([Dt()],zt.prototype,"shadowColor",void 0),At([Dt()],zt.prototype,"shadowOffsetX",void 0),At([Dt()],zt.prototype,"shadowOffsetY",void 0),At([Dt()],zt.prototype,"filter",void 0),At([Dt()],zt.prototype,"font",void 0),At([Dt()],zt.prototype,"fontKerning",void 0),At([Dt()],zt.prototype,"fontStretch",void 0),At([Dt()],zt.prototype,"fontVariantCaps",void 0),At([Dt()],zt.prototype,"textAlign",void 0),At([Dt()],zt.prototype,"textBaseline",void 0),At([Dt()],zt.prototype,"textRendering",void 0),At([Dt()],zt.prototype,"wordSpacing",void 0),At([Dt()],zt.prototype,"letterSpacing",void 0),At([Dt()],zt.prototype,"direction",void 0),At([Yt()],zt.prototype,"setTransform",null),At([Yt()],zt.prototype,"resetTransform",null),At([Yt()],zt.prototype,"getTransform",null),At([Yt()],zt.prototype,"save",null),At([Yt()],zt.prototype,"restore",null),At([Yt()],zt.prototype,"translate",null),At([Yt()],zt.prototype,"scale",null),At([Yt()],zt.prototype,"rotate",null),At([Yt()],zt.prototype,"fill",null),At([Yt()],zt.prototype,"stroke",null),At([Yt()],zt.prototype,"clip",null),At([Yt()],zt.prototype,"fillRect",null),At([Yt()],zt.prototype,"strokeRect",null),At([Yt()],zt.prototype,"clearRect",null),At([Yt()],zt.prototype,"beginPath",null),At([Yt()],zt.prototype,"moveTo",null),At([Yt()],zt.prototype,"lineTo",null),At([Yt()],zt.prototype,"bezierCurveTo",null),At([Yt()],zt.prototype,"quadraticCurveTo",null),At([Yt()],zt.prototype,"closePath",null),At([Yt()],zt.prototype,"arc",null),At([Yt()],zt.prototype,"arcTo",null),At([Yt()],zt.prototype,"ellipse",null),At([Yt()],zt.prototype,"rect",null),At([Yt()],zt.prototype,"roundRect",null),At([Yt()],zt.prototype,"createConicGradient",null),At([Yt()],zt.prototype,"createLinearGradient",null),At([Yt()],zt.prototype,"createPattern",null),At([Yt()],zt.prototype,"createRadialGradient",null),At([Yt()],zt.prototype,"fillText",null),At([Yt()],zt.prototype,"measureText",null),At([Yt()],zt.prototype,"strokeText",null);const{copy:Ft}=b,jt={width:1,height:1,pixelRatio:1},Ht=["width","height","pixelRatio"];const Ut={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Gt={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},qt=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},Gt),Vt={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},Qt={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({},Qt),Gt),Jt=qt,$t={};for(let t in Jt)$t[Jt[t]]=t;const Kt={};for(let t in Jt)Kt[Jt[t]]=Vt[t];const te={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:ee,cos:se,atan2:re,ceil:ie,abs:oe,PI:ne,sqrt:ae,pow:he}=Math,{setPoint:le,addPoint:de}=z,{set:ue,toNumberPoints:ce}=E,{M:pe,L:_e,C:fe,Q:ge,Z:ye}=qt,xe={},me={points(t,e,s,r){let i=ce(e);if(t.push(pe,i[0],i[1]),s&&i.length>5){let e,o,n,a,h,l,d,u,c,p,_,f,g,y=i.length;const x=!0===s?.5:s;r&&(i=[i[y-2],i[y-1],...i,i[0],i[1],i[2],i[3]],y=i.length);for(let s=2;s<y-2;s+=2)e=i[s-2],o=i[s-1],n=i[s],a=i[s+1],h=i[s+2],l=i[s+3],_=ae(he(n-e,2)+he(a-o,2)),f=ae(he(h-n,2)+he(l-a,2)),g=_+f,_=x*_/g,f=x*f/g,h-=e,l-=o,d=n-_*h,u=a-_*l,2===s?r||t.push(ge,d,u,n,a):t.push(fe,c,p,d,u,n,a),c=n+f*h,p=a+f*l;r||t.push(ge,c,p,i[y-2],i[y-1])}else for(let e=2,s=i.length;e<s;e+=2)t.push(_e,i[e],i[e+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=[],te.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,p){const _=r-e,f=i-s,g=o-r,y=n-i;let x=re(f,_),m=re(y,g),w=m-x;if(w<0&&(w+=l),w===ne||oe(_+f)<1e-12||oe(g+y)<1e-12)return t&&t.push(_e,r,i),u&&(le(u,e,s),de(u,r,i)),p&&ue(p,e,s),void(c&&ue(c,r,i));const b=_*y-g*f<0,v=b?-1:1,B=a/se(w/2),C=r+B*se(x+w/2+d*v),k=i+B*ee(x+w/2+d*v);return x-=d*v,m-=d*v,ve(t,C,k,a,a,0,x/h,m/h,b,u,c,p)},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=ee(f),y=se(f);let x=n*h,m=a*h;x>ne&&(x-=l),m<0&&(m+=l);let w=m-x;w<0?w+=l:w>l&&(w-=l),u&&(w-=l);const b=ie(oe(w/d)),v=w/b,B=ee(v/4),C=8/3*B*B/ee(v/2);m=x+v;let k,T,P,O,L,R,S,E,I=se(x),M=ee(x),A=P=y*r*I-g*i*M,W=O=g*r*I+y*i*M,D=e+P,N=s+O;t&&t.push(t.length?_e:pe,D,N),c&&le(c,D,N),_&&ue(_,D,N);for(let o=0;o<b;o++)k=se(m),T=ee(m),P=y*r*k-g*i*T,O=g*r*k+y*i*T,L=e+A-C*(y*r*M+g*i*I),R=s+W-C*(g*r*M-y*i*I),S=e+P+C*(y*r*T+g*i*k),E=s+O+C*(g*r*T-y*i*k),t&&t.push(fe,L,R,S,E,e+P,s+O),c&&be(e+A,s+W,L,R,S,E,e+P,s+O,c,!0),A=P,W=O,I=k,M=T,x=m,m+=v;p&&ue(p,e+P,s+O)},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,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?de(h,t,e):le(h,t,e),de(h,n,a);for(let l=0,u=d.length;l<u;l++)we(d[l],t,e,s,r,i,o,n,a,xe),de(h,xe.x,xe.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 we(t,e,s,r,i,o,n,a,h,l),l}},{getPointAndSet:we,toTwoPointBounds:be,ellipse:ve}=me,{sin:Be,cos:Ce,sqrt:ke,atan2:Te}=Math,{ellipse:Pe}=me,Oe={ellipticalArc(e,s,r,i,o,n,a,d,u,c,p){const _=(u-s)/2,f=(c-r)/2,g=n*h,y=Be(g),x=Ce(g),m=-x*_-y*f,w=-x*f+y*_,b=i*i,v=o*o,B=w*w,C=m*m,k=b*v-b*B-v*C;let T=0;if(k<0){const t=ke(1-k/(b*v));i*=t,o*=t}else T=(a===d?-1:1)*ke(k/(b*B+v*C));const P=T*i*w/o,O=-T*o*m/i,L=Te((w-O)/o,(m-P)/i),R=Te((-w-O)/o,(-m-P)/i);let S=R-L;0===d&&S>0?S-=l:1===d&&S<0&&(S+=l);const E=s+_+x*P-y*O,I=r+f+y*P+x*O,M=S<0?1:0;p||t.ellipseToCurve?Pe(e,E,I,i,o,n,L/h,R/h,M):i!==o||n?e.push(qt.G,E,I,i,o,n,L/h,R/h,M):e.push(qt.O,E,I,i,L/h,R/h,M)}},{M:Le,m:Re,L:Se,l:Ee,H:Ie,h:Me,V:Ae,v:We,C:De,c:Ne,S:Ye,s:Xe,Q:ze,q:Fe,T:je,t:He,A:Ue,a:Ge,Z:qe,z:Ve,N:Qe,D:Ze,X:Je,G:$e,F:Ke,O:ts,P:es,U:ss}=qt,{rect:rs,roundRect:is,arcTo:os,arc:ns,ellipse:as,quadraticCurveTo:hs}=me,{ellipticalArc:ls}=Oe,ds=xt.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=Kt[r],h+=r===i?" ":$t[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:Qt;for(let e=0,h=t.length;e<h;e++)r=t[e],yt[r]?("."===r&&(ps.dot&&(_s(n,o),o=""),ps.dot++),"0"===o&&"."!==r&&(_s(n,o),o=""),o+=r):qt[r]?(o&&(_s(n,o),o=""),ps.name=qt[r],ps.length=Vt[r],ps.index=0,_s(n,ps.name),!s&&a[r]&&(s=!0)):"-"===r||"+"===r?"e"===i||"E"===i?o+=r:(o&&_s(n,o),o=r):o&&(_s(n,o),o=""),i=r;return o&&_s(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 p=[];for(;u<c;){switch(i=t[u],i){case Re:t[u+1]+=a,t[u+2]+=h;case Le:a=t[u+1],h=t[u+2],p.push(Le,a,h),u+=3;break;case Me:t[u+1]+=a;case Ie:a=t[u+1],p.push(Se,a,h),u+=2;break;case We:t[u+1]+=h;case Ae:h=t[u+1],p.push(Se,a,h),u+=2;break;case Ee:t[u+1]+=a,t[u+2]+=h;case Se:a=t[u+1],h=t[u+2],p.push(Se,a,h),u+=3;break;case Xe:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=Ye;case Ye:n=o===De||o===Ye,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(De,l,d,s,r,a,h),u+=5;break;case Ne: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=De;case De:s=t[u+3],r=t[u+4],a=t[u+5],h=t[u+6],p.push(De,t[u+1],t[u+2],s,r,a,h),u+=7;break;case He: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(p,a,h,s,r,t[u+1],t[u+2]):p.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(p,a,h,s,r,t[u+3],t[u+4]):p.push(ze,s,r,t[u+3],t[u+4]),a=t[u+3],h=t[u+4],u+=5;break;case Ge:t[u+6]+=a,t[u+7]+=h;case Ue:ls(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 Ve:case qe:p.push(qe),u++;break;case Qe:a=t[u+1],h=t[u+2],e?rs(p,a,h,t[u+3],t[u+4]):fs(p,t,u,5),u+=5;break;case Ze:a=t[u+1],h=t[u+2],e?is(p,a,h,t[u+3],t[u+4],[t[u+5],t[u+6],t[u+7],t[u+8]]):fs(p,t,u,9),u+=9;break;case Je:a=t[u+1],h=t[u+2],e?is(p,a,h,t[u+3],t[u+4],t[u+5]):fs(p,t,u,6),u+=6;break;case $e:as(e?p:fs(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,us),a=us.x,h=us.y,u+=9;break;case Ke:e?as(p,t[u+1],t[u+2],t[u+3],t[u+4],0,0,360,!1):fs(p,t,u,5),a=t[u+1]+t[u+3],h=t[u+2],u+=5;break;case ts:ns(e?p:fs(p,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(p,t[u+1],t[u+2],t[u+3],0,360,!1):fs(p,t,u,4),a=t[u+1]+t[u+3],h=t[u+2],u+=4;break;case ss:os(e?p:fs(p,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),p}o=i}return p},objectToCanvasData(t){const e=[];return t.forEach((t=>{switch(t.name){case"M":e.push(Le,t.x,t.y);break;case"L":e.push(Se,t.x,t.y);break;case"C":e.push(De,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(ze,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(qe)}})),e},copyData(t,e,s,r){for(let i=s,o=s+r;i<o;i++)t.push(e[i])},pushData(t,e){ps.index===ps.length&&(ps.index=1,t.push(ps.name)),t.push(Number(e)),ps.index++,ps.dot=0}},{current:ps,pushData:_s,copyData:fs}=cs,{M:gs,L:ys,C:xs,Q:ms,Z:ws,N:bs,D:vs,X:Bs,G:Cs,F:ks,O:Ts,P:Ps,U:Os}=qt,{getMinDistanceFrom:Ls,getRadianFrom:Rs}=E,{tan:Ss,min:Es,abs:Is}=Math,Ms={},As={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(xs,e,s,r,i,o,n)},quadraticCurveTo(t,e,s,r,i){t.push(ms,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(ks,e,s,r,i):(void 0===n&&(n=0),void 0===a&&(a=360),t.push(Cs,e,s,r,i,o,n,a,h?1:0))},arc(t,e,s,r,i,o,n){void 0===i?t.push(Ps,e,s,r):(void 0===o&&(o=360),t.push(Ts,e,s,r,i,o,n?1:0))},arcTo(t,e,s,r,i,o,n,a){if(void 0!==n){const h=Ss(Rs(n,a,e,s,r,i)/2)*(Ls(n,a,e,s,r,i)/2);t.push(Os,e,s,r,i,Es(o,Is(h)))}else t.push(Os,e,s,r,i,o)},drawEllipse(t,e,s,r,i,o,n,a,h){me.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){me.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),Ds(t,e,s,r,i,o,n)},drawPoints(t,e,s,r){me.points(t,e,s,r)}},{ellipse:Ws,arc:Ds}=As,{moveTo:Ns,lineTo:Ys,quadraticCurveTo:Xs,bezierCurveTo:zs,closePath:Fs,beginPath:js,rect:Hs,roundRect:Us,ellipse:Gs,arc:qs,arcTo:Vs,drawEllipse:Qs,drawArc:Zs,drawPoints:Js}=As;class $s{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?"string"==typeof t?Ut.parse(t):t:[],this}beginPath(){return js(this.__path),this.paint(),this}moveTo(t,e){return Ns(this.__path,t,e),this.paint(),this}lineTo(t,e){return Ys(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,r,i,o){return zs(this.__path,t,e,s,r,i,o),this.paint(),this}quadraticCurveTo(t,e,s,r){return Xs(this.__path,t,e,s,r),this.paint(),this}closePath(){return Fs(this.__path),this.paint(),this}rect(t,e,s,r){return Hs(this.__path,t,e,s,r),this.paint(),this}roundRect(t,e,s,r,i){return Us(this.__path,t,e,s,r,i),this.paint(),this}ellipse(t,e,s,r,i,o,n,a){return Gs(this.__path,t,e,s,r,i,o,n,a),this.paint(),this}arc(t,e,s,r,i,o){return qs(this.__path,t,e,s,r,i,o),this.paint(),this}arcTo(t,e,s,r,i){return Vs(this.__path,t,e,s,r,i),this.paint(),this}drawEllipse(t,e,s,r,i,o,n,a){return Qs(this.__path,t,e,s,r,i,o,n,a),this.paint(),this}drawArc(t,e,s,r,i,o){return Zs(this.__path,t,e,s,r,i,o),this.paint(),this}drawPoints(t,e,s){return Js(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}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}=qt,cr=xt.get("PathDrawer"),pr={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:_r,L:fr,C:gr,Q:yr,Z:xr,N:mr,D:wr,X:br,G:vr,F:Br,O:Cr,P:kr,U:Tr}=qt,{toTwoPointBounds:Pr,toTwoPointBoundsByQuadraticCurve:Or,arcTo:Lr,arc:Rr,ellipse:Sr}=me,{addPointBounds:Er,copy:Ir,addPoint:Mr,setPoint:Ar,addBounds:Wr,toBounds:Dr}=z,Nr=xt.get("PathBounds");let Yr,Xr,zr;const Fr={},jr={},Hr={},Ur={toBounds(t,e){Ur.toTwoPointBounds(t,jr),Dr(jr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Ar(e,0,0);let s,r,i,o,n,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(n=t[a],0===a&&(n===xr||n===gr||n===yr?Ar(e,h,l):Ar(e,t[a+1],t[a+2])),n){case _r:case fr:h=t[a+1],l=t[a+2],Mr(e,h,l),a+=3;break;case gr:i=t[a+5],o=t[a+6],Pr(h,l,t[a+1],t[a+2],t[a+3],t[a+4],i,o,Fr),Er(e,Fr),h=i,l=o,a+=7;break;case yr:s=t[a+1],r=t[a+2],i=t[a+3],o=t[a+4],Or(h,l,s,r,i,o,Fr),Er(e,Fr),h=i,l=o,a+=5;break;case xr:a+=1;break;case mr: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+=n===wr?9:6;break;case vr:Sr(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,Hr),0===a?Ir(e,Fr):Er(e,Fr),h=Hr.x,l=Hr.y,a+=9;break;case Br:h=t[a+1],l=t[a+2],Xr=t[a+3],zr=t[a+4],Wr(e,h-Xr,l-zr,2*Xr,2*zr),h+=Xr,a+=5;break;case Cr:Rr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Fr,Hr),0===a?Ir(e,Fr):Er(e,Fr),h=Hr.x,l=Hr.y,a+=7;break;case kr:h=t[a+1],l=t[a+2],Yr=t[a+3],Wr(e,h-Yr,l-Yr,2*Yr,2*Yr),h+=Yr,a+=4;break;case Tr:Lr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Fr,Hr),0===a?Ir(e,Fr):Er(e,Fr),h=Hr.x,l=Hr.y,a+=6;break;default:return void Nr.error(`command: ${n} [index:${a}]`,t)}}},{M:Gr,L:qr,C:Vr,Z:Qr}=qt,{getCenterX:Zr,getCenterY:Jr}=E,{arcTo:$r}=As,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 p=t.length,_=[];for(;i<p;)switch(r=t[i],r){case Gr:a=u=t[i+1],h=c=t[i+2],i+=3,t[i]===qr?(l=t[i+1],d=t[i+2],_.push(Gr,Zr(a,l),Jr(h,d))):_.push(Gr,a,h);break;case qr:switch(o=t[i+1],n=t[i+2],i+=3,t[i]){case qr:$r(_,o,n,t[i+1],t[i+2],e,u,c);break;case Qr:$r(_,o,n,a,h,e,u,c);break;default:_.push(qr,o,n)}u=o,c=n;break;case Vr:_.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(_,a,h,l,d,e,u,c),_.push(Qr),i+=1}return r!==Qr&&(_[1]=a,_[2]=h),_}};Ut.creator=new $s,Ut.parse=cs.parse,Ut.convertToCanvasData=cs.toCanvasData;const ti=new $s,{drawRoundRect:ei}=te;const si={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=ri.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{}}}},ri=si;ri.opacityTypes.forEach((t=>ri.upperCaseTypeMap[t]=t.toUpperCase()));const ii=xt.get("TaskProcessor");class oi{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){ii.error(t)}}))}complete(){this.isComplete=!0,this.parent=null,this.task=null}cancel(){this.isCancel=!0,this.complete()}}class ni{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 oi(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 ai={map:{},recycledList:[],tasker:new ni,patternTasker:new ni,get isComplete(){return hi.tasker.isComplete},get(t){let s=hi.map[t.url];return s||(s=e.image(t),hi.map[t.url]=s),s.use++,s},recycle(t){t.use--,setTimeout((()=>{t.use||hi.recycledList.push(t)}))},clearRecycled(){const t=hi.recycledList;t.length>100&&(t.forEach((t=>{!t.use&&t.url&&(delete hi.map[t.url],t.destroy())})),t.length=0)},hasOpacityPixel:t=>si.opacityTypes.some((e=>hi.isFormat(e,t))),isFormat(t,e){if(e.format===t)return!0;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+si.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+si.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){hi.map={},hi.recycledList=[]}},hi=ai,{IMAGE:li,create:di}=s;function ui(t,e,s,r){r||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function ci(t,e){return Object.getOwnPropertyDescriptor(t,e)}function pi(t,e){return(s,r)=>fi(s,r,t,e&&e(r))}function _i(t){return t}function fi(t,e,s,r){const i={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};ui(t,e,Object.assign(i,r||{})),Bi(t,e,s)}function gi(t,e){return pi(t,(t=>({set(s){this.__setAttr(t,s,e)&&yi(this)}})))}function yi(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}const xi=gi;function mi(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&wi(this)}})))}function wi(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&yi(t)}const bi=mi;function vi(t,e,s,r){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==r&&0!==s||yi(t))}function Bi(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}};if(void 0===s)n.get=function(){return this[i]};else if("object"==typeof s){const{clone:t}=St;n.get=function(){let e=this[i];return void 0===e&&(this[i]=e=t(s)),e}}"width"===e?n.get=function(){const t=this[i];if(void 0===t){const t=this;return t._height&&t.__naturalWidth&&t.__useNaturalRatio?t._height*t.__naturalWidth/t.__naturalHeight:t.__naturalWidth||s}return t}:"height"===e&&(n.get=function(){const t=this[i];if(void 0===t){const t=this;return t._width&&t.__naturalHeight&&t.__useNaturalRatio?t._width*t.__naturalHeight/t.__naturalWidth:t.__naturalHeight||s}return t});let a,h=r;for(;!a&&h;)a=ci(h,e),h=h.__proto__;a&&a.set&&(n.set=a.set),r[o]&&(n.set=r[o],delete r[o]),ui(r,e,n)}const Ci=new xt("rewrite"),ki=[],Ti=["destroy","constructor"];function Pi(t){ki.length&&(ki.forEach((e=>{t&&Ci.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()})),ki.length=0)}function Oi(t,e){return s=>{var r;(t.prototype?(r=t.prototype,Object.getOwnPropertyNames(r)):Object.keys(t)).forEach((r=>{if(!(Ti.includes(r)||e&&e.includes(r)))if(t.prototype){ci(t.prototype,r).writable&&(s.prototype[r]=t.prototype[r])}else s.prototype[r]=t[r]}))}}setTimeout((()=>Pi(!0)));const{copy:Li,toInnerPoint:Ri,toOuterPoint:Si,scaleOfOuter:Ei,rotateOfOuter:Ii,skewOfOuter:Mi,multiplyParent:Ai,divideParent:Wi,getLayout:Di}=b,Ni={},Yi={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),Fi(t,e,s),t.isBranch){const{children:r}=t;for(let t=0,i=r.length;t<i;t++)zi(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++)ji(e[t])}},updateAllChange(t){if(ji(t),t.__updateChange(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)Hi(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},moveWorld(t,e,s=0,r,i){const o="object"==typeof e?Object.assign({},e):{x:e,y:s};r?Si(t.localTransform,o,o,!0):t.parent&&Ri(t.parent.worldTransform,o,o,!0),Xi.moveLocal(t,o.x,o.y,i)},moveLocal(t,e,s=0,r){"object"==typeof e&&(s=e.y,e=e.x),e+=t.x,s+=t.y,r?t.animate({x:e,y:s},r):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,r,i){Xi.zoomOfLocal(t,Gi(t,e),s,r,i)},zoomOfLocal(t,e,s,r=s,i){Li(Ni,t.__localMatrix),Ei(Ni,e,s,r),t.origin||t.around?Xi.setTransform(t,Ni,i):(Ui(t,Ni),t.scaleResize(s,r,!0!==i))},rotateOfWorld(t,e,s){Xi.rotateOfLocal(t,Gi(t,e),s)},rotateOfLocal(t,e,s){Li(Ni,t.__localMatrix),Ii(Ni,e,s),t.origin||t.around?Xi.setTransform(t,Ni):(Ui(t,Ni),t.rotation=a.formatRotation(t.rotation+s))},skewOfWorld(t,e,s,r,i){Xi.skewOfLocal(t,Gi(t,e),s,r,i)},skewOfLocal(t,e,s,r=0,i){Li(Ni,t.__localMatrix),Mi(Ni,e,s,r),Xi.setTransform(t,Ni,i)},transformWorld(t,e,s){Li(Ni,t.worldTransform),Ai(Ni,e),t.parent&&Wi(Ni,t.parent.worldTransform),Xi.setTransform(t,Ni,s)},transform(t,e,s){Li(Ni,t.localTransform),Ai(Ni,e),Xi.setTransform(t,Ni,s)},setTransform(t,e,s){const r=Di(e,t.origin&&Xi.getInnerOrigin(t,t.origin),t.around&&Xi.getInnerOrigin(t,t.around));if(s){const e=r.scaleX/t.scaleX,i=r.scaleY/t.scaleY;delete r.scaleX,delete r.scaleY,t.set(r),t.scaleResize(e,i,!0!==s)}else t.set(r)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},r="x"===e?1:-1;return Ei(s,Xi.getLocalOrigin(t,"center"),-1*r,1*r),s},getLocalOrigin:(t,e)=>E.tempToOuterOf(Xi.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return pt.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(Li(Ni,t.worldTransform),Wi(Ni,e.worldTransform),s?Ni:Object.assign({},Ni)),drop(t,e,s,r){t.setTransform(Xi.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}}},Xi=Yi,{updateAllMatrix:zi,updateMatrix:Fi,updateAllWorldOpacity:ji,updateAllChange:Hi}=Xi;function Ui(t,e){const{e:s,f:r}=t.__localMatrix;t.x+=e.e-s,t.y+=e.f-r}function Gi(t,e){return t.__layout.update(),t.parent?E.tempToInnerOf(e,t.parent.__world):e}const qi={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localRenderBounds,maskLocalBoxBounds:t=>t.__.mask?t.__localBoxBounds:null,maskLocalStrokeBounds:t=>t.__.mask?t.__layout.localStrokeBounds:null,maskLocalRenderBounds:t=>t.__.mask?t.__layout.localRenderBounds:null,excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))},{updateBounds:Vi}=Yi,Qi={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),Zi(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++)Ji(e[t],e)},updateBounds(t,e){const s=[t];Ji(t,s),$i(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++)Vi(r[t]);e&&e===s||Vi(s)}}},{pushAllChildBranch:Zi,pushAllBranchStack:Ji,updateBoundsByBranchStack:$i}=Qi,Ki={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:to}=Yi,{toOuterOf:eo,getPoints:so,copy:ro}=it,io="_localContentBounds",oo="_worldContentBounds",no="_worldBoxBounds",ao="_worldStrokeBounds";class ho{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}get localContentBounds(){return eo(this.contentBounds,this.leaf.__localMatrix,this[io]||(this[io]={})),this[io]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return eo(this.contentBounds,this.leaf.__world,this[oo]||(this[oo]={})),this[oo]}get worldBoxBounds(){return eo(this.boxBounds,this.leaf.__world,this[no]||(this[no]={})),this[no]}get worldStrokeBounds(){return eo(this.strokeBounds,this.leaf.__world,this[ao]||(this[ao]={})),this[ao]}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 to(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"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",s){const{leaf:r}=this;let i,o,n,a=this.getInnerBounds(t);switch(e){case"world":i=r.getWorldPoint(a),o=r.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=r.__;n={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},i=r.getLocalPointByInner(a);break;case"inner":i=a,o=b.defaultMatrix;break;case"page":e=r.zoomLayer;default:i=r.getWorldPoint(a,e),o=to(r,e,!0)}if(n||(n=b.getLayout(o)),ro(n,a),E.copy(n,i),s){const{scaleX:t,scaleY:e}=n,s=Math.abs(t),r=Math.abs(e);1===s&&1===r||(n.scaleX/=s,n.scaleY/=r,n.width*=s,n.height*=r)}return n}getLayoutPoints(t,e="world"){const{leaf:s}=this,r=so(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}shrinkContent(){const{x:t,y:e,width:s,height:r}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:r}}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}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged||this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||(this.strokeSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,this.renderSpread||(this.renderSpread=1),this.boundsChanged=!0}scaleChange(){this.scaleChanged=!0,this._scaleOrRotationChange()}rotationChange(){this.rotationChanged=!0,this.affectRotation=!0,this._scaleOrRotationChange()}_scaleOrRotationChange(){this.affectScaleOrRotation=!0,this.matrixChange(),this.leaf.__local||this.createLocal()}matrixChange(){this.matrixChanged=!0,this.localBoxChanged||this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0,this.surfaceChanged||this.surfaceChange()}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=!0,this.leaf.forceUpdate("surface"))}destroy(){}}class lo{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 uo extends lo{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}uo.ADD="child.add",uo.REMOVE="child.remove",uo.CREATED="created",uo.MOUNTED="mounted",uo.UNMOUNTED="unmounted",uo.DESTROY="destroy";class co extends lo{constructor(t,e,s,r,i){super(t,e),this.attrName=s,this.oldValue=r,this.newValue=i}}co.CHANGE="property.change",co.LEAFER_CHANGE="property.leafer_change";class po extends lo{constructor(t,e){super(t),Object.assign(this,e)}}po.LOAD="image.load",po.LOADED="image.loaded",po.ERROR="image.error";class _o extends lo{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(_o.RESIZE),Object.assign(this,t)):super(t),this.old=e}}_o.RESIZE="resize";class fo extends lo{constructor(t,e){super(t),this.data=e}}fo.REQUEST="watch.request",fo.DATA="watch.data";class go extends lo{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}go.CHECK_UPDATE="layout.check_update",go.REQUEST="layout.request",go.START="layout.start",go.BEFORE="layout.before",go.LAYOUT="layout",go.AFTER="layout.after",go.AGAIN="layout.again",go.END="layout.end";class yo extends lo{constructor(t,e,s,r){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=r)}}yo.REQUEST="render.request",yo.CHILD_START="render.child_start",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 lo{}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 mo={};class wo{set event(t){this.on(t)}on(t,e,s){if(!e){let e,s=t;for(let t in s)e=s[t],e instanceof Array?this.on(t,e[0],e[1]):this.on(t,e);return}let r,i,o;s&&("once"===s?i=!0:"boolean"==typeof s?r=s:(r=s.capture,i=s.once));const n=bo(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){if(t){const r="string"==typeof t?t.split(" "):t;if(e){let t,i,o;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const n=bo(this,t);r.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]))}))}else{const{__bubbleMap:t,__captureMap:e}=this;r.forEach((s=>{t&&delete t[s],e&&delete e[s]}))}}else this.__bubbleMap=this.__captureMap=void 0}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&&Lt.has(t)&&(e=Lt.get(t,{type:t,target:this,current:this}));const r=bo(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)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function bo(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:mo)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:mo)}}const{on:vo,on_:Bo,off:Co,off_:ko,once:To,emit:Po,emitEvent:Oo,hasEvent:Lo,destroy:Ro}=wo.prototype,So={on:vo,on_:Bo,off:Co,off_:ko,once:To,emit:Po,emitEvent:Oo,hasEvent:Lo,destroyEventer:Ro},{isFinite:Eo}=Number,Io=xt.get("setAttr"),Mo={__setAttr(t,e,s){if(this.leaferIsCreated){const r=this.__.__getInput(t);if(s&&!Eo(e)&&void 0!==e&&(Io.warn(this.innerName,t,e),e=void 0),"object"==typeof e||r!==e){this.__realSetAttr(t,e);const{CHANGE:s}=co,i=new co(s,this,t,r,e);return this.isLeafer?this.emitEvent(new co(co.LEAFER_CHANGE,this,t,r,e)):this.hasEvent(s)&&this.emitEvent(i),this.leafer.emitEvent(i),!0}return!1}return this.__realSetAttr(t,e),!0},__realSetAttr(t,e){const s=this.__;s[t]=e,this.__proxyData&&this.setProxyAttr(t,e),s.normalStyle&&(this.lockNormalStyle||void 0===s.normalStyle[t]||(s.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:Ao,multiplyParent:Wo,translateInner:Do,defaultWorld:No}=b,{toPoint:Yo,tempPoint:Xo}=pt,zo={__updateWorldMatrix(){Wo(this.__local||this.__layout,this.parent?this.parent.__world:No,this.__world,!!this.__layout.affectScaleOrRotation,this.__,this.parent&&this.parent.__)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged||t.rotationChanged)&&(Ao(e,s,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=!1),e.e=s.x+s.offsetX,e.f=s.y+s.offsetY,(s.around||s.origin)&&(Yo(s.around||s.origin,t.boxBounds,Xo),Do(e,-Xo.x,-Xo.y,!s.around))}this.__layout.matrixChanged=!1}},{updateMatrix:Fo,updateAllMatrix:jo}=Yi,{updateBounds:Ho}=Qi,{toOuterOf:Uo,copyAndSpread:Go,copy:qo}=it,{toBounds:Vo}=Ur,Qo={__updateWorldBounds(){Uo(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.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.boxChanged=!1,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.strokeSpread!==t.strokeBoxSpread)&&(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.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),Uo(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Uo(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Uo(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(){const t=this.__layout.boxBounds,e=this.__;e.__pathInputed?Vo(e.path,t):(t.x=0,t.y=0,t.width=e.width,t.height=e.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.leaferIsReady&&this.leafer.layouter.addExtra(this),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),jo(this),Ho(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(jo(this),Ho(this,this))):Fo(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(){const t=this.__layout;Go(t.strokeBounds,t.boxBounds,t.strokeBoxSpread)},__updateRenderBounds(){const t=this.__layout;t.renderSpread>0?Go(t.renderBounds,t.boxBounds,t.renderSpread):qo(t.renderBounds,t.strokeBounds)}},Zo={__render(t,e){if(this.__worldOpacity)if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=this.__.opacity,this.__.__single){if("path"===this.__.eraser)return this.__renderEraser(t,e);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:Jo}=qi,$o={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__nowWorld=this.__getNowWorld(e),this.__worldOpacity)if(this.__.__single){if("path"===this.__.eraser)return this.__renderEraser(t,e);const s=t.getSameCanvas(!1,!0);this.__renderBranch(s,e);const r=this.__nowWorld;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++)Jo(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++)Jo(s[r],e)||s[r].__clip(t,e)}}},{LEAF:Ko,create:tn}=s,{toInnerPoint:en,toOuterPoint:sn,multiplyParent:rn}=b,{toOuterOf:on}=it,{copy:nn,move:an}=E,{moveLocal:hn,zoomOfLocal:ln,rotateOfLocal:dn,skewOfLocal:un,moveWorld:cn,zoomOfWorld:pn,rotateOfWorld:_n,skewOfWorld:fn,transform:gn,transformWorld:yn,setTransform:xn,getFlipTransform:mn,getLocalOrigin:wn,getRelativeWorld:bn,drop:vn}=Yi;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 It}get __LayoutProcessor(){return ho}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){return!1}get isBranch(){return!1}get isBranchLeaf(){return!1}get __localMatrix(){return this.__local||this.__layout}get __localBoxBounds(){return this.__local||this.__layout}get worldTransform(){return this.__layout.getTransform("world")}get localTransform(){return this.__layout.getTransform("local")}get boxBounds(){return this.getBounds("box","inner")}get renderBounds(){return this.getBounds("render","inner")}get worldBoxBounds(){return this.getBounds("box")}get worldStrokeBounds(){return this.getBounds("stroke")}get worldRenderBounds(){return this.getBounds("render")}get worldOpacity(){return this.__layout.update(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){const{leafer:t}=this;return t&&t.created&&t.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=tn(Ko),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(uo.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0}),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(uo.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(uo.MOUNTED,t,"once")}nextRender(t,e,s){this.leafer?this.leafer.nextRender(t,e,s):this.waitLeafer((()=>this.leafer.nextRender(t,e,s)))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(uo.MOUNTED)):this.__emitLifeEvent(uo.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,r=e.length;s<r;s++)e[s].__bindLeafer(t)}}set(t,e){}get(t){}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){void 0===t?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=void 0===e?null:void 0,this[t]=e}forceRender(t){this.forceUpdate("surface")}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(){}__updateContentBounds(){}__updateStrokeBounds(){}__updateRenderBounds(){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some((t=>t.__.eraser))}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:s}=this.__layout;t.clearRect(s.x,s.y,s.width,s.height),t.restore()}__updateMask(t){this.__hasMask=!!t||this.children.some((t=>t.__.mask))}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld;return rn(this.__world,t.matrix,e,void 0,this.__world),on(this.__layout.renderBounds,e,e),e}return this.__world}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?bn(this,e):this.worldTransform,i=s?t:{};return on(t,r,i),i}worldToLocal(t,e,s,r){this.parent?this.parent.worldToInner(t,e,s,r):e&&nn(e,t)}localToWorld(t,e,s,r){this.parent?this.parent.innerToWorld(t,e,s,r):e&&nn(e,t)}worldToInner(t,e,s,r){r&&(r.innerToWorld(t,e,s),t=e||t),en(this.worldTransform,t,e,s)}innerToWorld(t,e,s,r){sn(this.worldTransform,t,e,s),r&&r.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,r){return this.getBoxPointByInner(this.getInnerPoint(t,e,s,r),null,null,!0)}getBoxPointByInner(t,e,s,r){const i=r?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return an(i,-o,-n),i}getInnerPoint(t,e,s,r){const i=r?t:{};return this.worldToInner(t,i,s,e),i}getInnerPointByBox(t,e,s,r){const i=r?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return an(i,o,n),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)}getPagePoint(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,r)}getWorldPoint(t,e,s,r){const i=r?t:{};return this.innerToWorld(t,i,s,e),i}getWorldPointByBox(t,e,s,r){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,r),e,s,!0)}getWorldPointByLocal(t,e,s,r){const i=r?t:{};return this.localToWorld(t,i,s,e),i}getWorldPointByPage(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,r)}setTransform(t,e){xn(this,t,e)}transform(t,e){gn(this,t,e)}move(t,e,s){hn(this,t,e,s)}moveInner(t,e,s){cn(this,t,e,!0,s)}scaleOf(t,e,s,r){ln(this,wn(this,t),e,s,r)}rotateOf(t,e){dn(this,wn(this,t),e)}skewOf(t,e,s,r){un(this,wn(this,t),e,s,r)}transformWorld(t,e){yn(this,t,e)}moveWorld(t,e,s){cn(this,t,e,!1,s)}scaleOfWorld(t,e,s,r){pn(this,t,e,s,r)}rotateOfWorld(t,e){_n(this,t,e)}skewOfWorld(t,e,s,r){fn(this,t,e,s,r)}flip(t){gn(this,mn(this,t))}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}__hitWorld(t){return!0}__hit(t){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e){}__clip(t,e){}__renderShape(t,e,s,r){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}getMotionPathData(){return Ct("path")}getMotionPoint(t){return Ct("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){vn(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,s){s?this.addAttr(t,e,s):Bi(this.prototype,t,e)}static addAttr(t,e,s){s||(s=gi),s(e)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new uo(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(uo.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}},exports.Leaf=At([Oi(Mo),Oi(zo),Oi(Qo),Oi(So),Oi(Zo)],exports.Leaf);const{setListWithFn:Bn}=it,{sort:Cn}=Qi,{localBoxBounds:kn,localStrokeBounds:Tn,localRenderBounds:Pn,maskLocalBoxBounds:On,maskLocalStrokeBounds:Ln,maskLocalRenderBounds:Rn}=qi;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(){Bn(this.__layout.boxBounds,this.children,this.__hasMask?On:kn)}__updateStrokeBounds(){Bn(this.__layout.strokeBounds,this.children,this.__hasMask?Ln:Tn)}__updateRenderBounds(){Bn(this.__layout.renderBounds,this.children,this.__hasMask?Rn:Pn)}__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(Cn),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this)return;const s=void 0===e;if(!t.__){if(t instanceof Array)return t.forEach((t=>{this.add(t,e),s||e++}));t=Tt.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,s?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1),t.__layout.boxChanged||t.__layout.boxChange(),t.__layout.matrixChanged||t.__layout.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(uo.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(uo.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",(()=>this.__remove(t,e))):this.__remove(t,e):this.find(t).forEach((t=>this.remove(t,e))):void 0===t&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach((e=>{this.__realRemoveChild(e),t&&e.destroy()})))}clear(){this.removeAll(!0)}__remove(t,e){const s=this.children.indexOf(t);s>-1&&(this.children.splice(s,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(uo.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(uo.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new uo(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}},exports.Branch=At([Oi($o)],exports.Branch);class Sn{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 Sn;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.AlignHelper=gt,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=me,exports.Bounds=ht,exports.BoundsHelper=it,exports.BranchHelper=Qi,exports.BranchRender=$o,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=uo,exports.Creator=e,exports.DataHelper=St,exports.Debug=xt,exports.EllipseHelper=Oe,exports.Event=lo,exports.EventCreator=Lt,exports.Eventer=wo,exports.FileHelper=si,exports.ImageEvent=po,exports.ImageManager=ai,exports.IncrementId=s,exports.LayoutEvent=go,exports.LeafBounds=Qo,exports.LeafBoundsHelper=qi,exports.LeafData=It,exports.LeafDataProxy=Mo,exports.LeafEventer=So,exports.LeafHelper=Yi,exports.LeafLayout=ho,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=Sn,exports.LeafMatrix=zo,exports.LeafRender=Zo,exports.LeaferCanvasBase=class 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));const s=this.size;St.copyAttrs(s,t,Ht),Ht.forEach((t=>s[t]||(s[t]=1))),this.bounds=new ht(0,0,this.width,this.height),this.context&&!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(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}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()}useGrayscaleAlpha(t){let e,s;this.setTempBounds(t,!0,!0);const{context:r}=this,i=r.getImageData(lt.x,lt.y,lt.width,lt.height),{data:o}=i;for(let t=0,r=o.length;t<r;t+=4)s=.299*o[t]+.587*o[t+1]+.114*o[t+2],(e=o[t+3])&&(o[t+3]=255===e?s:e*(s/255));r.putImageData(i,lt.x,lt.y)}useMask(t,e,s){this.copyWorld(t,e,s,"destination-in")}useEraser(t,e,s){this.copyWorld(t,e,s,"destination-out")}fillWorld(t,e,s){s&&(this.blendMode=s),this.fillStyle=e,this.setTempBounds(t),this.fillRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempBounds(t),this.strokeRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}clearWorld(t,e){this.setTempBounds(t,e),this.clearRect(lt.x,lt.y,lt.width,lt.height)}clipWorld(t,e){this.beginPath(),this.setTempBounds(t,e),this.rect(lt.x,lt.y,lt.width,lt.height),this.clip()}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempBounds(t,e,s){lt.set(t),s&<.intersect(this.bounds),lt.scale(this.pixelRatio),e&<.ceil()}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(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}},exports.LeaferEvent=xo,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=di(li),this.config=t||{url:""},this.isSVG=ai.isFormat("svg",t),this.hasOpacityPixel=ai.hasOpacityPixel(t)}load(e,s){return this.loading||(this.loading=!0,ai.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}},exports.MathHelper=a,exports.Matrix=Y,exports.MatrixHelper=b,exports.NeedConvertToCanvasCommandMap=Qt,exports.OneRadian=h,exports.PI2=l,exports.PI_2=d,exports.PathBounds=Ur,exports.PathCommandDataHelper=As,exports.PathCommandMap=qt,exports.PathConvert=cs,exports.PathCorner=Kr,exports.PathCreator=$s,exports.PathDrawer=pr,exports.PathHelper=Ut,exports.PathNumberCommandLengthMap=Kt,exports.PathNumberCommandMap=$t,exports.Platform=t,exports.Point=D,exports.PointHelper=E,exports.PropertyEvent=co,exports.RectHelper=te,exports.RenderEvent=yo,exports.ResizeEvent=_o,exports.Run=vt,exports.StringNumberMap=yt,exports.TaskItem=oi,exports.TaskProcessor=ni,exports.TwoPointBoundsHelper=z,exports.UICreator=Tt,exports.WaitHelper=Ki,exports.WatchEvent=fo,exports.affectRenderBoundsType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}})))},exports.affectStrokeBoundsType=mi,exports.attr=_i,exports.autoLayoutType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal())}})))},exports.boundsType=gi,exports.canvasPatch=function(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,r,i){ei(this,t,e,s,r,i)})}(t)},exports.canvasSizeAttrs=Ht,exports.cursorType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}})))},exports.dataProcessor=function(t){return(e,s)=>{ui(e,"__DataProcessor",{get:()=>t})}},exports.dataType=function(t){return pi(t)},exports.decorateLeafAttr=pi,exports.defineDataProcessor=Bi,exports.defineKey=ui,exports.defineLeafAttr=fi,exports.doBoundsType=yi,exports.doStrokeType=wi,exports.emptyData={},exports.eraserType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&this.waitParent((()=>{this.parent.__updateEraser(e)}))}})))},exports.getBoundsData=c,exports.getDescriptor=ci,exports.getMatrixData=p,exports.getPointData=u,exports.hitType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,xt.showHitView&&(this.__layout.surfaceChanged||this.__layout.surfaceChange()),this.leafer&&this.leafer.updateCursor())}})))},exports.isNull=function(t){return null==t},exports.layoutProcessor=function(t){return(e,s)=>{ui(e,"__LayoutProcessor",{get:()=>t})}},exports.maskType=function(t){return pi(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 pi(t,(t=>({set(e){this.__setAttr(t,e)&&(yi(this),this.__.__removeNaturalSize())}})))},exports.needPlugin=Ct,exports.opacityType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange())}})))},exports.pathInputType=function(t){return pi(t,(t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),yi(this)}})))},exports.pathType=xi,exports.pen=ti,exports.positionType=function(t,e){return pi(t,(t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}})))},exports.registerUI=function(){return t=>{Tt.register(t)}},exports.registerUIEvent=function(){return t=>{Lt.register(t)}},exports.rewrite=function(t){return(e,s)=>{ki.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}},exports.rewriteAble=function(){return t=>{Pi()}},exports.rotationType=function(t,e){return pi(t,(t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}})))},exports.scaleType=function(t,e){return pi(t,(t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}})))},exports.sortType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange(),this.waitParent((()=>{this.parent.__layout.childrenSortChange()})))}})))},exports.strokeType=bi,exports.surfaceType=function(t){return pi(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=Oi,exports.version="1.1.0",exports.visibleType=function(t){return pi(t,(t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",(()=>vi(this,t,e,s)))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");vi(this,t,e,s)}})))};
|
|
1
|
+
"use strict";const t={toURL(t,e){let s=encodeURIComponent(t);return"text"===e?s="data:text/plain;charset=utf-8,"+s:"svg"===e&&(s="data:image/svg+xml,"+s),s},image:{hitCanvasSize:100,maxCacheSize:4096e3,maxPatternSize:8847360,crossOrigin:"anonymous",getRealURL(e){const{prefix:s,suffix:r}=t.image;return!r||e.startsWith("data:")||e.startsWith("blob:")||(e+=(e.includes("?")?"&":"?")+r),s&&"/"===e[0]&&(e=s+e),e}}},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)=>("object"==typeof e&&(s=e.max,e=e.min),void 0!==e&&t<e&&(t=e),void 0!==s&&t>s&&(t=s),t),fourNumber(t,e){let s;if(t instanceof Array)switch(t.length){case 4:s=void 0===e?t:[...t];break;case 2:s=[t[0],t[1],t[0],t[1]];break;case 3:s=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(s||(s=[t,t,t,t]),e)for(let t=0;t<4;t++)s[t]>e&&(s[t]=e);return s},formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),a.float(t)),getGapRotation(t,e,s=0){let 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=void 0!==e?o(10,e):1e12;return-0===(t=i(t*s)/s)?0:t},getScaleData:(t,e,s,r)=>(r||(r={}),e?(r.scaleX=("number"==typeof e?e:e.width)/s.width,r.scaleY=("number"==typeof e?e:e.height)/s.height):t&&a.assignScale(r,t),r),assignScale(t,e){"number"==typeof e?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)}},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,r){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,r&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},scaleOfOuter(t,e,s,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,o){let{e:n,f:a}=t;if(o&&(n+=o.scrollX,a+=o.scrollY),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=n*e.a+a*e.c+e.e,s.f=n*e.b+a*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,i){const{x:o,y:n,scaleX:a,scaleY:l}=e;if(void 0===i&&(i=e.rotation||e.skewX||e.skewY),i){const{rotation:s,skewX:r,skewY:i}=e,o=s*h,n=f(o),d=_(o);if(r||i){const e=r*h,s=i*h;t.a=(n+s*-d)*a,t.b=(d+s*n)*a,t.c=(e*n-d)*l,t.d=(n+e*d)*l}else t.a=n*a,t.b=d*a,t.c=-d*l,t.d=n*l}else t.a=a,t.b=0,t.c=0,t.d=l;t.e=o,t.f=n,(s=s||r)&&v.translateInner(t,-s.x,-s.y,!r)},getLayout(t,e,s,r){const{a:i,b:o,c:n,d:a,e:l,f:u}=t;let c,p,m,w,b,v=l,B=u;if(o||n){const t=i*a-o*n;if(n&&!r){c=y(i*i+o*o),p=t/c;const e=i/c;m=o>0?g(e):-g(e)}else{p=y(n*n+a*a),c=t/p;const e=n/p;m=d-(a>0?g(-e):-g(e))}const e=x(f(m)),s=_(m);c=x(c),p=x(p),w=e?x((n/p+s)/e/h,9):0,b=e?x((o/c-s)/e/h,9):0,m=x(m/h)}else c=i,p=a,m=w=b=0;return(e=s||e)&&(v+=e.x*i+e.y*n,B+=e.x*o+e.y*a,s||(v-=e.x,B-=e.y)),{x:v,y:B,scaleX:c,scaleY:p,rotation:m,skewX:w,skewY:b}},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:L,min:R,PI:S}=Math,E={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=M.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}=M;return A(s,t),B(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=M;return A(s,t),k(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=M;return A(s,t),M.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)=>I(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)=>R(I(t,e,s,r),I(s,r,i,o)),getAngle:(t,e)=>W(t,e)/h,getRotation:(t,e,s,r)=>(r||(r=e),M.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=L(e-r,t-s);const d=L(o-a,i-n)-h;return d<-S?d+l:d},getAtan2:(t,e)=>L(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},toNumberPoints(t){let e=t;return"object"==typeof t[0]&&(e=[],t.forEach((t=>e.push(t.x,t.y)))),e},reset(t){M.reset(t)}},M=E,{getDistanceFrom:I,copy:A,getAtan2:W}=M;class D{constructor(t,e){this.set(t,e)}set(t,e){return"object"==typeof t?E.copy(this,t):E.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 E.move(this,t,e),this}scale(t,e){return E.scale(this,t,e),this}scaleOf(t,e,s){return E.scaleOf(this,t,e,s),this}rotate(t,e){return E.rotate(this,t,e),this}rotateOf(t,e){return E.rotate(this,e,t),this}getRotation(t,e,s){return E.getRotation(this,t,e,s)}toInnerOf(t,e){return E.toInnerOf(this,t,e),this}toOuterOf(t,e){return E.toOuterOf(this,t,e),this}getCenter(t){return new D(E.getCenter(this,t))}getDistance(t){return E.getDistance(this,t)}getDistancePoint(t,e,s){return new D(E.getDistancePoint(this,t,e,s))}getAngle(t){return E.getAngle(this,t)}getAtan2(t){return E.getAtan2(this,t)}reset(){return E.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,s){return b.setLayout(this,t,e,s),this}getLayout(t,e,s){return b.getLayout(this,t,e,s)}withScale(t,e){return b.withScale(this,t,e)}reset(){b.reset(this)}}const 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:Z,ceil:J}=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,i){const{x:o,y:n,width:a,height:h}=e;if(s instanceof Array){const e=Q(s);r?ot.set(t,o+e[3],n+e[0],a-e[1]-e[3],h-e[2]-e[0]):ot.set(t,o-e[3],n-e[0],a+e[1]+e[3],h+e[2]+e[0])}else r&&(s=-s),ot.set(t,o-s,n-s,a+2*s,h+2*s);i&&("width"===i?(t.y=n,t.height=h):(t.x=o,t.width=a))},minX:t=>t.width>0?t.x:t.x+t.width,minY:t=>t.height>0?t.y:t.y+t.height,maxX:t=>t.width>0?t.x+t.width:t.x,maxY:t=>t.height>0?t.y+t.height:t.y,move(t,e,s){t.x+=e,t.y+=s},getByMove:(t,e,s)=>(t=Object.assign({},t),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){E.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,r=s){E.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,!1,s),r},spread(t,e,s){ot.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){ot.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=Z(t.x),t.y=Z(t.y),t.width=e>t.x?J(t.width+e-t.x):J(t.width),t.height=s>t.y?J(t.height+s-t.y):J(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)},setPoint(t,e){ot.set(t,e.x,e.y)},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=E.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=E.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,e){return it.shrink(this,t,e),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}setPoint(t){return it.setPoint(this,t),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",ut[ut["top-left"]=0]="top-left",ut[ut["top-right"]=2]="top-right",ut[ut["bottom-right"]=4]="bottom-right",ut[ut["bottom-left"]=6]="bottom-left";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}];ct.forEach((t=>t.type="percent"));const pt={directionData:ct,tempPoint:{},get:_t,toPoint(t,e,s,r,i){const o=_t(t);s.x=o.x,s.y=o.y,"percent"===o.type&&(s.x*=e.width,s.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{toPoint:ft}=pt,gt={toPoint(t,e,s,r,i){ft(t,s,r,i,e)}},yt={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 xt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new xt(t)}static set filter(t){this.filterList=mt(t)}static set exclude(t){this.excludeList=mt(t)}log(...t){if(wt.enable){if(wt.filterList.length&&wt.filterList.every((t=>t!==this.name)))return;if(wt.excludeList.length&&wt.excludeList.some((t=>t===this.name)))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){wt.enable&&this.warn(...t)}warn(...t){wt.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}xt.filterList=[],xt.excludeList=[],xt.showWarn=!0;const wt=xt,bt=xt.get("RunTime"),vt={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,bt.log(r,i,"ms")},endOfName(t,e){const s=Bt.nameToIdMap[t];void 0!==s&&Bt.end(s,e)}},Bt=vt;function kt(t){console.error("need plugin: @leafer-in/"+t)}const Ct=xt.get("UICreator"),Tt={list:{},register(t){const{__tag:e}=t.prototype;Ot[e]&&Ct.repeat(e),Ot[e]=t},get(t,e,s,r,i,o){Ot[t]||Ct.error("not register "+t);const n=new Ot[t](e);return void 0!==s&&(n.x=s,r&&(n.y=r),i&&(n.width=i),o&&(n.height=o)),n}},{list:Ot}=Tt,Pt=xt.get("EventCreator"),Lt={nameList:{},register(t){let e;Object.keys(t).forEach((s=>{e=t[s],"string"==typeof e&&(Rt[e]&&Pt.repeat(e),Rt[e]=t)}))},changeName(t,e){const s=Rt[t];if(s){const r=Object.keys(s).find((e=>s[e]===t));r&&(s[r]=e,Rt[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new Rt[t](...e)},{nameList:Rt}=Lt;const St={default:(t,e)=>(Et(e,t),Et(t,e),t),assign(t,e,s){let r;Object.keys(e).forEach((i=>{var o,n;if(r=e[i],(null==r?void 0:r.constructor)===Object&&(null===(o=t[i])||void 0===o?void 0:o.constructor)===Object)return Et(t[i],e[i],s&&s[i]);s&&i in s?(null===(n=s[i])||void 0===n?void 0:n.constructor)===Object&&Et(t[i]={},e[i],s[i]):t[i]=e[i]}))},copyAttrs:(t,e,s)=>(s.forEach((s=>{void 0!==e[s]&&(t[s]=e[s])})),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,r=t.length;s<r;s++)e[t[s]]=!0;return e}},{assign:Et}=St;class Mt{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __blendMode(){if(this.eraser&&"path"!==this.eraser)return"destination-out";const{blendMode:t}=this;return"pass-through"===t?null:t}constructor(t){this.__leaf=t}__get(t){if(this.__input){const e=this.__input[t];if(void 0!==e)return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let s;for(let 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,e){const s={};if(t)if(t instanceof Array)for(let e of t)s[e]=this.__getInput(e);else for(let e in t)s[e]=this.__getInput(e);else{let t,e,{__input:r}=this;s.tag=this.__leaf.tag;for(let i in this)if("_"!==i[0]&&(t=this["_"+i],void 0!==t)){if("path"===i&&!this.__pathInputed)continue;e=r?r[i]:void 0,s[i]=void 0===e?t:e}}if(e&&e.matrix){const{a:t,b:e,c:r,d:i,e:o,f:n}=this.__leaf.__localMatrix;s.matrix={a:t,b:e,c:r,d:i,e:o,f:n}}return s}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser?t.__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 It;exports.Answer=void 0,(It=exports.Answer||(exports.Answer={}))[It.No=0]="No",It[It.Yes=1]="Yes",It[It.NoAndSkip=2]="NoAndSkip",It[It.YesAndSkip=3]="YesAndSkip";function At(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 Dt(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 Nt=[];function Yt(){return(t,e)=>{Nt.push(e)}}const Xt=[];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||Xt)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;Nt.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}}At([Dt("imageSmoothingEnabled")],zt.prototype,"smooth",void 0),At([Dt("imageSmoothingQuality")],zt.prototype,"smoothLevel",void 0),At([Dt("globalAlpha")],zt.prototype,"opacity",void 0),At([Dt()],zt.prototype,"fillStyle",void 0),At([Dt()],zt.prototype,"strokeStyle",void 0),At([Dt("lineWidth")],zt.prototype,"strokeWidth",void 0),At([Dt("lineCap")],zt.prototype,"strokeCap",void 0),At([Dt("lineJoin")],zt.prototype,"strokeJoin",void 0),At([Dt("lineDashOffset")],zt.prototype,"dashOffset",void 0),At([Dt()],zt.prototype,"miterLimit",void 0),At([Dt()],zt.prototype,"shadowBlur",void 0),At([Dt()],zt.prototype,"shadowColor",void 0),At([Dt()],zt.prototype,"shadowOffsetX",void 0),At([Dt()],zt.prototype,"shadowOffsetY",void 0),At([Dt()],zt.prototype,"filter",void 0),At([Dt()],zt.prototype,"font",void 0),At([Dt()],zt.prototype,"fontKerning",void 0),At([Dt()],zt.prototype,"fontStretch",void 0),At([Dt()],zt.prototype,"fontVariantCaps",void 0),At([Dt()],zt.prototype,"textAlign",void 0),At([Dt()],zt.prototype,"textBaseline",void 0),At([Dt()],zt.prototype,"textRendering",void 0),At([Dt()],zt.prototype,"wordSpacing",void 0),At([Dt()],zt.prototype,"letterSpacing",void 0),At([Dt()],zt.prototype,"direction",void 0),At([Yt()],zt.prototype,"setTransform",null),At([Yt()],zt.prototype,"resetTransform",null),At([Yt()],zt.prototype,"getTransform",null),At([Yt()],zt.prototype,"save",null),At([Yt()],zt.prototype,"restore",null),At([Yt()],zt.prototype,"translate",null),At([Yt()],zt.prototype,"scale",null),At([Yt()],zt.prototype,"rotate",null),At([Yt()],zt.prototype,"fill",null),At([Yt()],zt.prototype,"stroke",null),At([Yt()],zt.prototype,"clip",null),At([Yt()],zt.prototype,"fillRect",null),At([Yt()],zt.prototype,"strokeRect",null),At([Yt()],zt.prototype,"clearRect",null),At([Yt()],zt.prototype,"beginPath",null),At([Yt()],zt.prototype,"moveTo",null),At([Yt()],zt.prototype,"lineTo",null),At([Yt()],zt.prototype,"bezierCurveTo",null),At([Yt()],zt.prototype,"quadraticCurveTo",null),At([Yt()],zt.prototype,"closePath",null),At([Yt()],zt.prototype,"arc",null),At([Yt()],zt.prototype,"arcTo",null),At([Yt()],zt.prototype,"ellipse",null),At([Yt()],zt.prototype,"rect",null),At([Yt()],zt.prototype,"roundRect",null),At([Yt()],zt.prototype,"createConicGradient",null),At([Yt()],zt.prototype,"createLinearGradient",null),At([Yt()],zt.prototype,"createPattern",null),At([Yt()],zt.prototype,"createRadialGradient",null),At([Yt()],zt.prototype,"fillText",null),At([Yt()],zt.prototype,"measureText",null),At([Yt()],zt.prototype,"strokeText",null);const{copy:Ft}=b,jt={width:1,height:1,pixelRatio:1},Ht=["width","height","pixelRatio"];const Ut={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Gt={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},qt=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},Gt),Vt={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},Qt={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({},Qt),Gt),Jt=qt,$t={};for(let t in Jt)$t[Jt[t]]=t;const Kt={};for(let t in Jt)Kt[Jt[t]]=Vt[t];const te={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:ee,cos:se,atan2:re,ceil:ie,abs:oe,PI:ne,sqrt:ae,pow:he}=Math,{setPoint:le,addPoint:de}=z,{set:ue,toNumberPoints:ce}=E,{M:pe,L:_e,C:fe,Q:ge,Z:ye}=qt,xe={},me={points(t,e,s,r){let i=ce(e);if(t.push(pe,i[0],i[1]),s&&i.length>5){let e,o,n,a,h,l,d,u,c,p,_,f,g,y=i.length;const x=!0===s?.5:s;r&&(i=[i[y-2],i[y-1],...i,i[0],i[1],i[2],i[3]],y=i.length);for(let s=2;s<y-2;s+=2)e=i[s-2],o=i[s-1],n=i[s],a=i[s+1],h=i[s+2],l=i[s+3],_=ae(he(n-e,2)+he(a-o,2)),f=ae(he(h-n,2)+he(l-a,2)),g=_+f,_=x*_/g,f=x*f/g,h-=e,l-=o,d=n-_*h,u=a-_*l,2===s?r||t.push(ge,d,u,n,a):t.push(fe,c,p,d,u,n,a),c=n+f*h,p=a+f*l;r||t.push(ge,c,p,i[y-2],i[y-1])}else for(let e=2,s=i.length;e<s;e+=2)t.push(_e,i[e],i[e+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=[],te.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,p){const _=r-e,f=i-s,g=o-r,y=n-i;let x=re(f,_),m=re(y,g),w=m-x;if(w<0&&(w+=l),w===ne||oe(_+f)<1e-12||oe(g+y)<1e-12)return t&&t.push(_e,r,i),u&&(le(u,e,s),de(u,r,i)),p&&ue(p,e,s),void(c&&ue(c,r,i));const b=_*y-g*f<0,v=b?-1:1,B=a/se(w/2),k=r+B*se(x+w/2+d*v),C=i+B*ee(x+w/2+d*v);return x-=d*v,m-=d*v,ve(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)=>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=ee(f),y=se(f);let x=n*h,m=a*h;x>ne&&(x-=l),m<0&&(m+=l);let w=m-x;w<0?w+=l:w>l&&(w-=l),u&&(w-=l);const b=ie(oe(w/d)),v=w/b,B=ee(v/4),k=8/3*B*B/ee(v/2);m=x+v;let C,T,O,P,L,R,S,E,M=se(x),I=ee(x),A=O=y*r*M-g*i*I,W=P=g*r*M+y*i*I,D=e+O,N=s+P;t&&t.push(t.length?_e:pe,D,N),c&&le(c,D,N),_&&ue(_,D,N);for(let o=0;o<b;o++)C=se(m),T=ee(m),O=y*r*C-g*i*T,P=g*r*C+y*i*T,L=e+A-k*(y*r*I+g*i*M),R=s+W-k*(g*r*I-y*i*M),S=e+O+k*(y*r*T+g*i*C),E=s+P+k*(g*r*T-y*i*C),t&&t.push(fe,L,R,S,E,e+O,s+P),c&&be(e+A,s+W,L,R,S,E,e+O,s+P,c,!0),A=O,W=P,M=C,I=T,x=m,m+=v;p&&ue(p,e+O,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,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?de(h,t,e):le(h,t,e),de(h,n,a);for(let l=0,u=d.length;l<u;l++)we(d[l],t,e,s,r,i,o,n,a,xe),de(h,xe.x,xe.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 we(t,e,s,r,i,o,n,a,h,l),l}},{getPointAndSet:we,toTwoPointBounds:be,ellipse:ve}=me,{sin:Be,cos:ke,sqrt:Ce,atan2:Te}=Math,{ellipse:Oe}=me,Pe={ellipticalArc(e,s,r,i,o,n,a,d,u,c,p){const _=(u-s)/2,f=(c-r)/2,g=n*h,y=Be(g),x=ke(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=Ce(1-C/(b*v));i*=t,o*=t}else T=(a===d?-1:1)*Ce(C/(b*B+v*k));const O=T*i*w/o,P=-T*o*m/i,L=Te((w-P)/o,(m-O)/i),R=Te((-w-P)/o,(-m-O)/i);let S=R-L;0===d&&S>0?S-=l:1===d&&S<0&&(S+=l);const E=s+_+x*O-y*P,M=r+f+y*O+x*P,I=S<0?1:0;p||t.ellipseToCurve?Oe(e,E,M,i,o,n,L/h,R/h,I):i!==o||n?e.push(qt.G,E,M,i,o,n,L/h,R/h,I):e.push(qt.O,E,M,i,L/h,R/h,I)}},{M:Le,m:Re,L:Se,l:Ee,H:Me,h:Ie,V:Ae,v:We,C:De,c:Ne,S:Ye,s:Xe,Q:ze,q:Fe,T:je,t:He,A:Ue,a:Ge,Z:qe,z:Ve,N:Qe,D:Ze,X:Je,G:$e,F:Ke,O:ts,P:es,U:ss}=qt,{rect:rs,roundRect:is,arcTo:os,arc:ns,ellipse:as,quadraticCurveTo:hs}=me,{ellipticalArc:ls}=Pe,ds=xt.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=Kt[r],h+=r===i?" ":$t[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:Qt;for(let e=0,h=t.length;e<h;e++)r=t[e],yt[r]?("."===r&&(ps.dot&&(_s(n,o),o=""),ps.dot++),"0"===o&&"."!==r&&(_s(n,o),o=""),o+=r):qt[r]?(o&&(_s(n,o),o=""),ps.name=qt[r],ps.length=Vt[r],ps.index=0,_s(n,ps.name),!s&&a[r]&&(s=!0)):"-"===r||"+"===r?"e"===i||"E"===i?o+=r:(o&&_s(n,o),o=r):o&&(_s(n,o),o=""),i=r;return o&&_s(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 p=[];for(;u<c;){switch(i=t[u],i){case Re:t[u+1]+=a,t[u+2]+=h;case Le:a=t[u+1],h=t[u+2],p.push(Le,a,h),u+=3;break;case Ie:t[u+1]+=a;case Me:a=t[u+1],p.push(Se,a,h),u+=2;break;case We:t[u+1]+=h;case Ae:h=t[u+1],p.push(Se,a,h),u+=2;break;case Ee:t[u+1]+=a,t[u+2]+=h;case Se:a=t[u+1],h=t[u+2],p.push(Se,a,h),u+=3;break;case Xe:t[u+1]+=a,t[u+2]+=h,t[u+3]+=a,t[u+4]+=h,i=Ye;case Ye:n=o===De||o===Ye,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(De,l,d,s,r,a,h),u+=5;break;case Ne: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=De;case De:s=t[u+3],r=t[u+4],a=t[u+5],h=t[u+6],p.push(De,t[u+1],t[u+2],s,r,a,h),u+=7;break;case He: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(p,a,h,s,r,t[u+1],t[u+2]):p.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(p,a,h,s,r,t[u+3],t[u+4]):p.push(ze,s,r,t[u+3],t[u+4]),a=t[u+3],h=t[u+4],u+=5;break;case Ge:t[u+6]+=a,t[u+7]+=h;case Ue:ls(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 Ve:case qe:p.push(qe),u++;break;case Qe:a=t[u+1],h=t[u+2],e?rs(p,a,h,t[u+3],t[u+4]):fs(p,t,u,5),u+=5;break;case Ze:a=t[u+1],h=t[u+2],e?is(p,a,h,t[u+3],t[u+4],[t[u+5],t[u+6],t[u+7],t[u+8]]):fs(p,t,u,9),u+=9;break;case Je:a=t[u+1],h=t[u+2],e?is(p,a,h,t[u+3],t[u+4],t[u+5]):fs(p,t,u,6),u+=6;break;case $e:as(e?p:fs(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,us),a=us.x,h=us.y,u+=9;break;case Ke:e?as(p,t[u+1],t[u+2],t[u+3],t[u+4],0,0,360,!1):fs(p,t,u,5),a=t[u+1]+t[u+3],h=t[u+2],u+=5;break;case ts:ns(e?p:fs(p,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(p,t[u+1],t[u+2],t[u+3],0,360,!1):fs(p,t,u,4),a=t[u+1]+t[u+3],h=t[u+2],u+=4;break;case ss:os(e?p:fs(p,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),p}o=i}return p},objectToCanvasData(t){const e=[];return t.forEach((t=>{switch(t.name){case"M":e.push(Le,t.x,t.y);break;case"L":e.push(Se,t.x,t.y);break;case"C":e.push(De,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(ze,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(qe)}})),e},copyData(t,e,s,r){for(let i=s,o=s+r;i<o;i++)t.push(e[i])},pushData(t,e){ps.index===ps.length&&(ps.index=1,t.push(ps.name)),t.push(Number(e)),ps.index++,ps.dot=0}},{current:ps,pushData:_s,copyData:fs}=cs,{M:gs,L:ys,C:xs,Q:ms,Z:ws,N:bs,D:vs,X:Bs,G:ks,F:Cs,O:Ts,P:Os,U:Ps}=qt,{getMinDistanceFrom:Ls,getRadianFrom:Rs}=E,{tan:Ss,min:Es,abs:Ms}=Math,Is={},As={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(xs,e,s,r,i,o,n)},quadraticCurveTo(t,e,s,r,i){t.push(ms,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(Os,e,s,r):(void 0===o&&(o=360),t.push(Ts,e,s,r,i,o,n?1:0))},arcTo(t,e,s,r,i,o,n,a){if(void 0!==n){const h=Ss(Rs(n,a,e,s,r,i)/2)*(Ls(n,a,e,s,r,i)/2);t.push(Ps,e,s,r,i,Es(o,Ms(h)))}else t.push(Ps,e,s,r,i,o)},drawEllipse(t,e,s,r,i,o,n,a,h){me.ellipse(null,e,s,r,i,void 0===o?0:o,void 0===n?0:n,void 0===a?360:a,h,null,null,Is),t.push(gs,Is.x,Is.y),Ws(t,e,s,r,i,o,n,a,h)},drawArc(t,e,s,r,i,o,n){me.arc(null,e,s,r,void 0===i?0:i,void 0===o?360:o,n,null,null,Is),t.push(gs,Is.x,Is.y),Ds(t,e,s,r,i,o,n)},drawPoints(t,e,s,r){me.points(t,e,s,r)}},{ellipse:Ws,arc:Ds}=As,{moveTo:Ns,lineTo:Ys,quadraticCurveTo:Xs,bezierCurveTo:zs,closePath:Fs,beginPath:js,rect:Hs,roundRect:Us,ellipse:Gs,arc:qs,arcTo:Vs,drawEllipse:Qs,drawArc:Zs,drawPoints:Js}=As;class $s{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?"string"==typeof t?Ut.parse(t):t:[],this}beginPath(){return js(this.__path),this.paint(),this}moveTo(t,e){return Ns(this.__path,t,e),this.paint(),this}lineTo(t,e){return Ys(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,r,i,o){return zs(this.__path,t,e,s,r,i,o),this.paint(),this}quadraticCurveTo(t,e,s,r){return Xs(this.__path,t,e,s,r),this.paint(),this}closePath(){return Fs(this.__path),this.paint(),this}rect(t,e,s,r){return Hs(this.__path,t,e,s,r),this.paint(),this}roundRect(t,e,s,r,i){return Us(this.__path,t,e,s,r,i),this.paint(),this}ellipse(t,e,s,r,i,o,n,a){return Gs(this.__path,t,e,s,r,i,o,n,a),this.paint(),this}arc(t,e,s,r,i,o){return qs(this.__path,t,e,s,r,i,o),this.paint(),this}arcTo(t,e,s,r,i){return Vs(this.__path,t,e,s,r,i),this.paint(),this}drawEllipse(t,e,s,r,i,o,n,a){return Qs(this.__path,t,e,s,r,i,o,n,a),this.paint(),this}drawArc(t,e,s,r,i,o){return Zs(this.__path,t,e,s,r,i,o),this.paint(),this}drawPoints(t,e,s){return Js(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}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}=qt,cr=xt.get("PathDrawer"),pr={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:_r,L:fr,C:gr,Q:yr,Z:xr,N:mr,D:wr,X:br,G:vr,F:Br,O:kr,P:Cr,U:Tr}=qt,{toTwoPointBounds:Or,toTwoPointBoundsByQuadraticCurve:Pr,arcTo:Lr,arc:Rr,ellipse:Sr}=me,{addPointBounds:Er,copy:Mr,addPoint:Ir,setPoint:Ar,addBounds:Wr,toBounds:Dr}=z,Nr=xt.get("PathBounds");let Yr,Xr,zr;const Fr={},jr={},Hr={},Ur={toBounds(t,e){Ur.toTwoPointBounds(t,jr),Dr(jr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Ar(e,0,0);let s,r,i,o,n,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(n=t[a],0===a&&(n===xr||n===gr||n===yr?Ar(e,h,l):Ar(e,t[a+1],t[a+2])),n){case _r:case fr:h=t[a+1],l=t[a+2],Ir(e,h,l),a+=3;break;case gr:i=t[a+5],o=t[a+6],Or(h,l,t[a+1],t[a+2],t[a+3],t[a+4],i,o,Fr),Er(e,Fr),h=i,l=o,a+=7;break;case yr:s=t[a+1],r=t[a+2],i=t[a+3],o=t[a+4],Pr(h,l,s,r,i,o,Fr),Er(e,Fr),h=i,l=o,a+=5;break;case xr:a+=1;break;case mr: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+=n===wr?9:6;break;case vr:Sr(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,Hr),0===a?Mr(e,Fr):Er(e,Fr),h=Hr.x,l=Hr.y,a+=9;break;case Br:h=t[a+1],l=t[a+2],Xr=t[a+3],zr=t[a+4],Wr(e,h-Xr,l-zr,2*Xr,2*zr),h+=Xr,a+=5;break;case kr:Rr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Fr,Hr),0===a?Mr(e,Fr):Er(e,Fr),h=Hr.x,l=Hr.y,a+=7;break;case Cr:h=t[a+1],l=t[a+2],Yr=t[a+3],Wr(e,h-Yr,l-Yr,2*Yr,2*Yr),h+=Yr,a+=4;break;case Tr:Lr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Fr,Hr),0===a?Mr(e,Fr):Er(e,Fr),h=Hr.x,l=Hr.y,a+=6;break;default:return void Nr.error(`command: ${n} [index:${a}]`,t)}}},{M:Gr,L:qr,C:Vr,Z:Qr}=qt,{getCenterX:Zr,getCenterY:Jr}=E,{arcTo:$r}=As,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 p=t.length,_=[];for(;i<p;)switch(r=t[i],r){case Gr:a=u=t[i+1],h=c=t[i+2],i+=3,t[i]===qr?(l=t[i+1],d=t[i+2],_.push(Gr,Zr(a,l),Jr(h,d))):_.push(Gr,a,h);break;case qr:switch(o=t[i+1],n=t[i+2],i+=3,t[i]){case qr:$r(_,o,n,t[i+1],t[i+2],e,u,c);break;case Qr:$r(_,o,n,a,h,e,u,c);break;default:_.push(qr,o,n)}u=o,c=n;break;case Vr:_.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(_,a,h,l,d,e,u,c),_.push(Qr),i+=1}return r!==Qr&&(_[1]=a,_[2]=h),_}};Ut.creator=new $s,Ut.parse=cs.parse,Ut.convertToCanvasData=cs.toCanvasData;const ti=new $s,{drawRoundRect:ei}=te;const si={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=ri.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{}}}},ri=si;ri.opacityTypes.forEach((t=>ri.upperCaseTypeMap[t]=t.toUpperCase()));const ii=xt.get("TaskProcessor");class oi{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){ii.error(t)}}))}complete(){this.isComplete=!0,this.parent=null,this.task=null}cancel(){this.isCancel=!0,this.complete()}}class ni{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 oi(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 ai={map:{},recycledList:[],tasker:new ni,patternTasker:new ni,get isComplete(){return hi.tasker.isComplete},get(t){let s=hi.map[t.url];return s||(s=e.image(t),hi.map[t.url]=s),s.use++,s},recycle(t){t.use--,setTimeout((()=>{t.use||hi.recycledList.push(t)}))},clearRecycled(){const t=hi.recycledList;t.length>100&&(t.forEach((t=>{!t.use&&t.url&&(delete hi.map[t.url],t.destroy())})),t.length=0)},hasOpacityPixel:t=>si.opacityTypes.some((e=>hi.isFormat(e,t))),isFormat(t,e){if(e.format===t)return!0;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+si.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+si.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){hi.map={},hi.recycledList=[]}},hi=ai,{IMAGE:li,create:di}=s;function ui(t,e,s,r){r||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function ci(t,e){return Object.getOwnPropertyDescriptor(t,e)}function pi(t,e){return(s,r)=>fi(s,r,t,e&&e(r))}function _i(t){return t}function fi(t,e,s,r){const i={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};ui(t,e,Object.assign(i,r||{})),ki(t,e,s)}function gi(t,e){return pi(t,(t=>({set(s){this.__setAttr(t,s,e)&&yi(this)}})))}function yi(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}const xi=gi;function mi(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&wi(this)}})))}function wi(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&yi(t)}const bi=mi;function vi(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function Bi(t,e,s,r){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==r&&0!==s||yi(t))}function ki(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}};if(void 0===s)n.get=function(){return this[i]};else if("object"==typeof s){const{clone:t}=St;n.get=function(){let e=this[i];return void 0===e&&(this[i]=e=t(s)),e}}"width"===e?n.get=function(){const t=this[i];if(void 0===t){const t=this;return t._height&&t.__naturalWidth&&t.__useNaturalRatio?t._height*t.__naturalWidth/t.__naturalHeight:t.__naturalWidth||s}return t}:"height"===e&&(n.get=function(){const t=this[i];if(void 0===t){const t=this;return t._width&&t.__naturalHeight&&t.__useNaturalRatio?t._width*t.__naturalHeight/t.__naturalWidth:t.__naturalHeight||s}return t});let a,h=r;for(;!a&&h;)a=ci(h,e),h=h.__proto__;a&&a.set&&(n.set=a.set),r[o]&&(n.set=r[o],delete r[o]),ui(r,e,n)}const Ci=new xt("rewrite"),Ti=[],Oi=["destroy","constructor"];function Pi(t){Ti.length&&(Ti.forEach((e=>{t&&Ci.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()})),Ti.length=0)}function Li(t,e){return s=>{var r;(t.prototype?(r=t.prototype,Object.getOwnPropertyNames(r)):Object.keys(t)).forEach((r=>{if(!(Oi.includes(r)||e&&e.includes(r)))if(t.prototype){ci(t.prototype,r).writable&&(s.prototype[r]=t.prototype[r])}else s.prototype[r]=t[r]}))}}setTimeout((()=>Pi(!0)));const{copy:Ri,toInnerPoint:Si,toOuterPoint:Ei,scaleOfOuter:Mi,rotateOfOuter:Ii,skewOfOuter:Ai,multiplyParent:Wi,divideParent:Di,getLayout:Ni}=b,Yi={},Xi={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),ji(t,e,s),t.isBranch){const{children:r}=t;for(let t=0,i=r.length;t<i;t++)Fi(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++)Hi(e[t])}},updateAllChange(t){if(Hi(t),t.__updateChange(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)Ui(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},moveWorld(t,e,s=0,r,i){const o="object"==typeof e?Object.assign({},e):{x:e,y:s};r?Ei(t.localTransform,o,o,!0):t.parent&&Si(t.parent.worldTransform,o,o,!0),zi.moveLocal(t,o.x,o.y,i)},moveLocal(t,e,s=0,r){"object"==typeof e&&(s=e.y,e=e.x),e+=t.x,s+=t.y,r?t.animate({x:e,y:s},r):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,r,i){zi.zoomOfLocal(t,qi(t,e),s,r,i)},zoomOfLocal(t,e,s,r=s,i){Ri(Yi,t.__localMatrix),Mi(Yi,e,s,r),t.origin||t.around?zi.setTransform(t,Yi,i):(Gi(t,Yi),t.scaleResize(s,r,!0!==i))},rotateOfWorld(t,e,s){zi.rotateOfLocal(t,qi(t,e),s)},rotateOfLocal(t,e,s){Ri(Yi,t.__localMatrix),Ii(Yi,e,s),t.origin||t.around?zi.setTransform(t,Yi):(Gi(t,Yi),t.rotation=a.formatRotation(t.rotation+s))},skewOfWorld(t,e,s,r,i){zi.skewOfLocal(t,qi(t,e),s,r,i)},skewOfLocal(t,e,s,r=0,i){Ri(Yi,t.__localMatrix),Ai(Yi,e,s,r),zi.setTransform(t,Yi,i)},transformWorld(t,e,s){Ri(Yi,t.worldTransform),Wi(Yi,e),t.parent&&Di(Yi,t.parent.worldTransform),zi.setTransform(t,Yi,s)},transform(t,e,s){Ri(Yi,t.localTransform),Wi(Yi,e),zi.setTransform(t,Yi,s)},setTransform(t,e,s){const r=Ni(e,t.origin&&zi.getInnerOrigin(t,t.origin),t.around&&zi.getInnerOrigin(t,t.around));if(s){const e=r.scaleX/t.scaleX,i=r.scaleY/t.scaleY;delete r.scaleX,delete r.scaleY,t.set(r),t.scaleResize(e,i,!0!==s)}else t.set(r)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},r="x"===e?1:-1;return Mi(s,zi.getLocalOrigin(t,"center"),-1*r,1*r),s},getLocalOrigin:(t,e)=>E.tempToOuterOf(zi.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return pt.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(Ri(Yi,t.worldTransform),Di(Yi,e.worldTransform),s?Yi:Object.assign({},Yi)),drop(t,e,s,r){t.setTransform(zi.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}}},zi=Xi,{updateAllMatrix:Fi,updateMatrix:ji,updateAllWorldOpacity:Hi,updateAllChange:Ui}=zi;function Gi(t,e){const{e:s,f:r}=t.__localMatrix;t.x+=e.e-s,t.y+=e.f-r}function qi(t,e){return t.__layout.update(),t.parent?E.tempToInnerOf(e,t.parent.__world):e}const Vi={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localRenderBounds,maskLocalBoxBounds:t=>t.__.mask?t.__localBoxBounds:null,maskLocalStrokeBounds:t=>t.__.mask?t.__layout.localStrokeBounds:null,maskLocalRenderBounds:t=>t.__.mask?t.__layout.localRenderBounds:null,excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))},{updateBounds:Qi}=Xi,Zi={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),Ji(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++)$i(e[t],e)},updateBounds(t,e){const s=[t];$i(t,s),Ki(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++)Qi(r[t]);e&&e===s||Qi(s)}}},{pushAllChildBranch:Ji,pushAllBranchStack:$i,updateBoundsByBranchStack:Ki}=Zi,to={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:eo}=Xi,{toOuterOf:so,getPoints:ro,copy:io}=it,oo="_localContentBounds",no="_worldContentBounds",ao="_worldBoxBounds",ho="_worldStrokeBounds";class lo{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}get localContentBounds(){return so(this.contentBounds,this.leaf.__localMatrix,this[oo]||(this[oo]={})),this[oo]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return so(this.contentBounds,this.leaf.__world,this[no]||(this[no]={})),this[no]}get worldBoxBounds(){return so(this.boxBounds,this.leaf.__world,this[ao]||(this[ao]={})),this[ao]}get worldStrokeBounds(){return so(this.strokeBounds,this.leaf.__world,this[ho]||(this[ho]={})),this[ho]}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 eo(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"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",s){const{leaf:r}=this;let i,o,n,a=this.getInnerBounds(t);switch(e){case"world":i=r.getWorldPoint(a),o=r.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=r.__;n={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},i=r.getLocalPointByInner(a);break;case"inner":i=a,o=b.defaultMatrix;break;case"page":e=r.zoomLayer;default:i=r.getWorldPoint(a,e),o=eo(r,e,!0)}if(n||(n=b.getLayout(o)),io(n,a),E.copy(n,i),s){const{scaleX:t,scaleY:e}=n,s=Math.abs(t),r=Math.abs(e);1===s&&1===r||(n.scaleX/=s,n.scaleY/=r,n.width*=s,n.height*=r)}return n}getLayoutPoints(t,e="world"){const{leaf:s}=this,r=ro(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}shrinkContent(){const{x:t,y:e,width:s,height:r}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:r}}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}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged||this.localBoxChange(),this.hitCanvasChanged=!0}localBoxChange(){this.localBoxChanged=!0,this.boundsChanged=!0}strokeChange(){this.strokeChanged=!0,this.strokeSpread||(this.strokeSpread=1),this.boundsChanged=!0,this.hitCanvasChanged=!0}renderChange(){this.renderChanged=!0,this.renderSpread||(this.renderSpread=1),this.boundsChanged=!0}scaleChange(){this.scaleChanged=!0,this._scaleOrRotationChange()}rotationChange(){this.rotationChanged=!0,this.affectRotation=!0,this._scaleOrRotationChange()}_scaleOrRotationChange(){this.affectScaleOrRotation=!0,this.matrixChange(),this.leaf.__local||this.createLocal()}matrixChange(){this.matrixChanged=!0,this.localBoxChanged||this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0,this.surfaceChanged||this.surfaceChange()}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=!0,this.leaf.forceUpdate("surface"))}destroy(){}}class uo{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 co extends uo{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}co.ADD="child.add",co.REMOVE="child.remove",co.CREATED="created",co.MOUNTED="mounted",co.UNMOUNTED="unmounted",co.DESTROY="destroy";class po extends uo{constructor(t,e,s,r,i){super(t,e),this.attrName=s,this.oldValue=r,this.newValue=i}}po.CHANGE="property.change",po.LEAFER_CHANGE="property.leafer_change";class _o extends uo{constructor(t,e){super(t),Object.assign(this,e)}}_o.LOAD="image.load",_o.LOADED="image.loaded",_o.ERROR="image.error";class fo extends uo{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(fo.RESIZE),Object.assign(this,t)):super(t),this.old=e}}fo.RESIZE="resize";class go extends uo{constructor(t,e){super(t),this.data=e}}go.REQUEST="watch.request",go.DATA="watch.data";class yo extends uo{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}yo.CHECK_UPDATE="layout.check_update",yo.REQUEST="layout.request",yo.START="layout.start",yo.BEFORE="layout.before",yo.LAYOUT="layout",yo.AFTER="layout.after",yo.AGAIN="layout.again",yo.END="layout.end";class xo extends uo{constructor(t,e,s,r){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=r)}}xo.REQUEST="render.request",xo.CHILD_START="render.child_start",xo.START="render.start",xo.BEFORE="render.before",xo.RENDER="render",xo.AFTER="render.after",xo.AGAIN="render.again",xo.END="render.end",xo.NEXT="render.next";class mo extends uo{}mo.START="leafer.start",mo.BEFORE_READY="leafer.before_ready",mo.READY="leafer.ready",mo.AFTER_READY="leafer.after_ready",mo.VIEW_READY="leafer.view_ready",mo.VIEW_COMPLETED="leafer.view_completed",mo.STOP="leafer.stop",mo.RESTART="leafer.restart",mo.END="leafer.end";const wo={};class bo{set event(t){this.on(t)}on(t,e,s){if(!e){let e,s=t;for(let t in s)e=s[t],e instanceof Array?this.on(t,e[0],e[1]):this.on(t,e);return}let r,i,o;s&&("once"===s?i=!0:"boolean"==typeof s?r=s:(r=s.capture,i=s.once));const n=vo(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){if(t){const r="string"==typeof t?t.split(" "):t;if(e){let t,i,o;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const n=vo(this,t);r.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]))}))}else{const{__bubbleMap:t,__captureMap:e}=this;r.forEach((s=>{t&&delete t[s],e&&delete e[s]}))}}else this.__bubbleMap=this.__captureMap=void 0}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&&Lt.has(t)&&(e=Lt.get(t,{type:t,target:this,current:this}));const r=vo(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)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function vo(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:wo)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:wo)}}const{on:Bo,on_:ko,off:Co,off_:To,once:Oo,emit:Po,emitEvent:Lo,hasEvent:Ro,destroy:So}=bo.prototype,Eo={on:Bo,on_:ko,off:Co,off_:To,once:Oo,emit:Po,emitEvent:Lo,hasEvent:Ro,destroyEventer:So},{isFinite:Mo}=Number,Io=xt.get("setAttr"),Ao={__setAttr(t,e,s){if(this.leaferIsCreated){const r=this.__.__getInput(t);if(s&&!Mo(e)&&void 0!==e&&(Io.warn(this.innerName,t,e),e=void 0),"object"==typeof e||r!==e){this.__realSetAttr(t,e);const{CHANGE:s}=po,i=new po(s,this,t,r,e);return this.isLeafer?this.emitEvent(new po(po.LEAFER_CHANGE,this,t,r,e)):this.hasEvent(s)&&this.emitEvent(i),this.leafer.emitEvent(i),!0}return!1}return this.__realSetAttr(t,e),!0},__realSetAttr(t,e){const s=this.__;s[t]=e,this.__proxyData&&this.setProxyAttr(t,e),s.normalStyle&&(this.lockNormalStyle||void 0===s.normalStyle[t]||(s.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:Wo,multiplyParent:Do,translateInner:No,defaultWorld:Yo}=b,{toPoint:Xo,tempPoint:zo}=pt,Fo={__updateWorldMatrix(){Do(this.__local||this.__layout,this.parent?this.parent.__world:Yo,this.__world,!!this.__layout.affectScaleOrRotation,this.__,this.parent&&this.parent.__)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged||t.rotationChanged)&&(Wo(e,s,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=!1),e.e=s.x+s.offsetX,e.f=s.y+s.offsetY,(s.around||s.origin)&&(Xo(s.around||s.origin,t.boxBounds,zo),No(e,-zo.x,-zo.y,!s.around))}this.__layout.matrixChanged=!1}},{updateMatrix:jo,updateAllMatrix:Ho}=Xi,{updateBounds:Uo}=Zi,{toOuterOf:Go,copyAndSpread:qo,copy:Vo}=it,{toBounds:Qo}=Ur,Zo={__updateWorldBounds(){Go(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.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.boxChanged=!1,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.strokeSpread!==t.strokeBoxSpread)&&(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.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),Go(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Go(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Go(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(){const t=this.__layout.boxBounds,e=this.__;e.__pathInputed?Qo(e.path,t):(t.x=0,t.y=0,t.width=e.width,t.height=e.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.leaferIsReady&&this.leafer.layouter.addExtra(this),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),Ho(this),Uo(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(Ho(this),Uo(this,this))):jo(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(){const t=this.__layout;qo(t.strokeBounds,t.boxBounds,t.strokeBoxSpread)},__updateRenderBounds(){const t=this.__layout;t.renderSpread>0?qo(t.renderBounds,t.boxBounds,t.renderSpread):Vo(t.renderBounds,t.strokeBounds)}},Jo={__render(t,e){if(this.__worldOpacity)if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=this.__.opacity,this.__.__single){if("path"===this.__.eraser)return this.__renderEraser(t,e);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:$o}=Vi,Ko={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__nowWorld=this.__getNowWorld(e),this.__worldOpacity)if(this.__.__single){if("path"===this.__.eraser)return this.__renderEraser(t,e);const s=t.getSameCanvas(!1,!0);this.__renderBranch(s,e);const r=this.__nowWorld;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++)$o(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++)$o(s[r],e)||s[r].__clip(t,e)}}},{LEAF:tn,create:en}=s,{toInnerPoint:sn,toOuterPoint:rn,multiplyParent:on}=b,{toOuterOf:nn}=it,{copy:an,move:hn}=E,{moveLocal:ln,zoomOfLocal:dn,rotateOfLocal:un,skewOfLocal:cn,moveWorld:pn,zoomOfWorld:_n,rotateOfWorld:fn,skewOfWorld:gn,transform:yn,transformWorld:xn,setTransform:mn,getFlipTransform:wn,getLocalOrigin:bn,getRelativeWorld:vn,drop:Bn}=Xi;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 Mt}get __LayoutProcessor(){return lo}get leaferIsCreated(){return this.leafer&&this.leafer.created}get leaferIsReady(){return this.leafer&&this.leafer.ready}get isLeafer(){return!1}get isBranch(){return!1}get isBranchLeaf(){return!1}get __localMatrix(){return this.__local||this.__layout}get __localBoxBounds(){return this.__local||this.__layout}get worldTransform(){return this.__layout.getTransform("world")}get localTransform(){return this.__layout.getTransform("local")}get boxBounds(){return this.getBounds("box","inner")}get renderBounds(){return this.getBounds("render","inner")}get worldBoxBounds(){return this.getBounds("box")}get worldStrokeBounds(){return this.getBounds("stroke")}get worldRenderBounds(){return this.getBounds("render")}get worldOpacity(){return this.__layout.update(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){const{leafer:t}=this;return t&&t.created&&t.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=en(tn),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(co.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0}),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(co.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(co.MOUNTED,t,"once")}nextRender(t,e,s){this.leafer?this.leafer.nextRender(t,e,s):this.waitLeafer((()=>this.leafer.nextRender(t,e,s)))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(co.MOUNTED)):this.__emitLifeEvent(co.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,r=e.length;s<r;s++)e[s].__bindLeafer(t)}}set(t,e){}get(t){}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){void 0===t?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=void 0===e?null:void 0,this[t]=e}forceRender(t){this.forceUpdate("surface")}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(){}__updateContentBounds(){}__updateStrokeBounds(){}__updateRenderBounds(){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some((t=>t.__.eraser))}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:s}=this.__layout;t.clearRect(s.x,s.y,s.width,s.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some((t=>t.__.mask&&t.__.visible&&t.__.opacity))}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld;return on(this.__world,t.matrix,e,void 0,this.__world),nn(this.__layout.renderBounds,e,e),e}return this.__world}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?vn(this,e):this.worldTransform,i=s?t:{};return nn(t,r,i),i}worldToLocal(t,e,s,r){this.parent?this.parent.worldToInner(t,e,s,r):e&&an(e,t)}localToWorld(t,e,s,r){this.parent?this.parent.innerToWorld(t,e,s,r):e&&an(e,t)}worldToInner(t,e,s,r){r&&(r.innerToWorld(t,e,s),t=e||t),sn(this.worldTransform,t,e,s)}innerToWorld(t,e,s,r){rn(this.worldTransform,t,e,s),r&&r.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,r){return this.getBoxPointByInner(this.getInnerPoint(t,e,s,r),null,null,!0)}getBoxPointByInner(t,e,s,r){const i=r?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return hn(i,-o,-n),i}getInnerPoint(t,e,s,r){const i=r?t:{};return this.worldToInner(t,i,s,e),i}getInnerPointByBox(t,e,s,r){const i=r?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return hn(i,o,n),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)}getPagePoint(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,r)}getWorldPoint(t,e,s,r){const i=r?t:{};return this.innerToWorld(t,i,s,e),i}getWorldPointByBox(t,e,s,r){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,r),e,s,!0)}getWorldPointByLocal(t,e,s,r){const i=r?t:{};return this.localToWorld(t,i,s,e),i}getWorldPointByPage(t,e,s,r){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,r)}setTransform(t,e){mn(this,t,e)}transform(t,e){yn(this,t,e)}move(t,e,s){ln(this,t,e,s)}moveInner(t,e,s){pn(this,t,e,!0,s)}scaleOf(t,e,s,r){dn(this,bn(this,t),e,s,r)}rotateOf(t,e){un(this,bn(this,t),e)}skewOf(t,e,s,r){cn(this,bn(this,t),e,s,r)}transformWorld(t,e){xn(this,t,e)}moveWorld(t,e,s){pn(this,t,e,!1,s)}scaleOfWorld(t,e,s,r){_n(this,t,e,s,r)}rotateOfWorld(t,e){fn(this,t,e)}skewOfWorld(t,e,s,r){gn(this,t,e,s,r)}flip(t){yn(this,wn(this,t))}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}__hitWorld(t){return!0}__hit(t){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e){}__clip(t,e){}__renderShape(t,e,s,r){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}getMotionPathData(){return kt("path")}getMotionPoint(t){return kt("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){Bn(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,s){s?this.addAttr(t,e,s):ki(this.prototype,t,e)}static addAttr(t,e,s){s||(s=gi),s(e)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new co(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(co.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}},exports.Leaf=At([Li(Ao),Li(Fo),Li(Zo),Li(Eo),Li(Jo)],exports.Leaf);const{setListWithFn:kn}=it,{sort:Cn}=Zi,{localBoxBounds:Tn,localStrokeBounds:On,localRenderBounds:Pn,maskLocalBoxBounds:Ln,maskLocalStrokeBounds:Rn,maskLocalRenderBounds:Sn}=Vi,En=new xt("Branch");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(){kn(this.__layout.boxBounds,this.children,this.__hasMask?Ln:Tn)}__updateStrokeBounds(){kn(this.__layout.strokeBounds,this.children,this.__hasMask?Rn:On)}__updateRenderBounds(){kn(this.__layout.renderBounds,this.children,this.__hasMask?Sn:Pn)}__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(Cn),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return En.warn("add self or destroyed");const s=void 0===e;if(!t.__){if(t instanceof Array)return t.forEach((t=>{this.add(t,e),s||e++}));t=Tt.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,s?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const r=t.__layout;r.boxChanged||r.boxChange(),r.matrixChanged||r.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(co.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(co.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",(()=>this.__remove(t,e))):this.__remove(t,e):this.find(t).forEach((t=>this.remove(t,e))):void 0===t&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach((e=>{this.__realRemoveChild(e),t&&e.destroy()})))}clear(){this.removeAll(!0)}__remove(t,e){const s=this.children.indexOf(t);s>-1&&(this.children.splice(s,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(co.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(co.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new co(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}},exports.Branch=At([Li(Ko)],exports.Branch);class Mn{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 Mn;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.AlignHelper=gt,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=me,exports.Bounds=ht,exports.BoundsHelper=it,exports.BranchHelper=Zi,exports.BranchRender=Ko,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=co,exports.Creator=e,exports.DataHelper=St,exports.Debug=xt,exports.EllipseHelper=Pe,exports.Event=uo,exports.EventCreator=Lt,exports.Eventer=bo,exports.FileHelper=si,exports.ImageEvent=_o,exports.ImageManager=ai,exports.IncrementId=s,exports.LayoutEvent=yo,exports.LeafBounds=Zo,exports.LeafBoundsHelper=Vi,exports.LeafData=Mt,exports.LeafDataProxy=Ao,exports.LeafEventer=Eo,exports.LeafHelper=Xi,exports.LeafLayout=lo,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=Mn,exports.LeafMatrix=Fo,exports.LeafRender=Jo,exports.LeaferCanvasBase=class 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));const s=this.size;St.copyAttrs(s,t,Ht),Ht.forEach((t=>s[t]||(s[t]=1))),this.bounds=new ht(0,0,this.width,this.height),this.context&&!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(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}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()}useGrayscaleAlpha(t){let e,s;this.setTempBounds(t,!0,!0);const{context:r}=this,i=r.getImageData(lt.x,lt.y,lt.width,lt.height),{data:o}=i;for(let t=0,r=o.length;t<r;t+=4)s=.299*o[t]+.587*o[t+1]+.114*o[t+2],(e=o[t+3])&&(o[t+3]=255===e?s:e*(s/255));r.putImageData(i,lt.x,lt.y)}useMask(t,e,s){this.copyWorld(t,e,s,"destination-in")}useEraser(t,e,s){this.copyWorld(t,e,s,"destination-out")}fillWorld(t,e,s){s&&(this.blendMode=s),this.fillStyle=e,this.setTempBounds(t),this.fillRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempBounds(t),this.strokeRect(lt.x,lt.y,lt.width,lt.height),s&&(this.blendMode="source-over")}clearWorld(t,e){this.setTempBounds(t,e),this.clearRect(lt.x,lt.y,lt.width,lt.height)}clipWorld(t,e){this.beginPath(),this.setTempBounds(t,e),this.rect(lt.x,lt.y,lt.width,lt.height),this.clip()}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempBounds(t,e,s){lt.set(t),s&<.intersect(this.bounds),lt.scale(this.pixelRatio),e&<.ceil()}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(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}},exports.LeaferEvent=mo,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=di(li),this.config=t||{url:""},this.isSVG=ai.isFormat("svg",t),this.hasOpacityPixel=ai.hasOpacityPixel(t)}load(e,s){return this.loading||(this.loading=!0,ai.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}},exports.MathHelper=a,exports.Matrix=Y,exports.MatrixHelper=b,exports.NeedConvertToCanvasCommandMap=Qt,exports.OneRadian=h,exports.PI2=l,exports.PI_2=d,exports.PathBounds=Ur,exports.PathCommandDataHelper=As,exports.PathCommandMap=qt,exports.PathConvert=cs,exports.PathCorner=Kr,exports.PathCreator=$s,exports.PathDrawer=pr,exports.PathHelper=Ut,exports.PathNumberCommandLengthMap=Kt,exports.PathNumberCommandMap=$t,exports.Platform=t,exports.Point=D,exports.PointHelper=E,exports.PropertyEvent=po,exports.RectHelper=te,exports.RenderEvent=xo,exports.ResizeEvent=fo,exports.Run=vt,exports.StringNumberMap=yt,exports.TaskItem=oi,exports.TaskProcessor=ni,exports.TwoPointBoundsHelper=z,exports.UICreator=Tt,exports.WaitHelper=to,exports.WatchEvent=go,exports.affectRenderBoundsType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}})))},exports.affectStrokeBoundsType=mi,exports.attr=_i,exports.autoLayoutType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal())}})))},exports.boundsType=gi,exports.canvasPatch=function(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,r,i){ei(this,t,e,s,r,i)})}(t)},exports.canvasSizeAttrs=Ht,exports.cursorType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}})))},exports.dataProcessor=function(t){return(e,s)=>{ui(e,"__DataProcessor",{get:()=>t})}},exports.dataType=function(t){return pi(t)},exports.decorateLeafAttr=pi,exports.defineDataProcessor=ki,exports.defineKey=ui,exports.defineLeafAttr=fi,exports.doBoundsType=yi,exports.doStrokeType=wi,exports.emptyData={},exports.eraserType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&this.waitParent((()=>{this.parent.__updateEraser(e)}))}})))},exports.getBoundsData=c,exports.getDescriptor=ci,exports.getMatrixData=p,exports.getPointData=u,exports.hitType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,xt.showHitView&&(this.__layout.surfaceChanged||this.__layout.surfaceChange()),this.leafer&&this.leafer.updateCursor())}})))},exports.isNull=function(t){return null==t},exports.layoutProcessor=function(t){return(e,s)=>{ui(e,"__LayoutProcessor",{get:()=>t})}},exports.maskType=function(t){return pi(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 pi(t,(t=>({set(e){this.__setAttr(t,e)&&(yi(this),this.__.__removeNaturalSize())}})))},exports.needPlugin=kt,exports.opacityType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&vi(this)}})))},exports.pathInputType=function(t){return pi(t,(t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),yi(this)}})))},exports.pathType=xi,exports.pen=ti,exports.positionType=function(t,e){return pi(t,(t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}})))},exports.registerUI=function(){return t=>{Tt.register(t)}},exports.registerUIEvent=function(){return t=>{Lt.register(t)}},exports.rewrite=function(t){return(e,s)=>{Ti.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}},exports.rewriteAble=function(){return t=>{Pi()}},exports.rotationType=function(t,e){return pi(t,(t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}})))},exports.scaleType=function(t,e){return pi(t,(t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}})))},exports.sortType=function(t){return pi(t,(t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange(),this.waitParent((()=>{this.parent.__layout.childrenSortChange()})))}})))},exports.strokeType=bi,exports.surfaceType=function(t){return pi(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=Li,exports.version="1.1.1",exports.visibleType=function(t){return pi(t,(t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",(()=>Bi(this,t,e,s)))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");Bi(this,t,e,s),this.mask&&vi(this)}})))};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer/core",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "@leafer/core",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,21 +29,21 @@
|
|
|
29
29
|
"leaferjs"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@leafer/canvas": "1.1.
|
|
33
|
-
"@leafer/image": "1.1.
|
|
34
|
-
"@leafer/data": "1.1.
|
|
35
|
-
"@leafer/debug": "1.1.
|
|
36
|
-
"@leafer/decorator": "1.1.
|
|
37
|
-
"@leafer/display": "1.1.
|
|
38
|
-
"@leafer/display-module": "1.1.
|
|
39
|
-
"@leafer/event": "1.1.
|
|
40
|
-
"@leafer/file": "1.1.
|
|
41
|
-
"@leafer/helper": "1.1.
|
|
42
|
-
"@leafer/layout": "1.1.
|
|
43
|
-
"@leafer/list": "1.1.
|
|
44
|
-
"@leafer/math": "1.1.
|
|
45
|
-
"@leafer/path": "1.1.
|
|
46
|
-
"@leafer/platform": "1.1.
|
|
47
|
-
"@leafer/task": "1.1.
|
|
32
|
+
"@leafer/canvas": "1.1.2",
|
|
33
|
+
"@leafer/image": "1.1.2",
|
|
34
|
+
"@leafer/data": "1.1.2",
|
|
35
|
+
"@leafer/debug": "1.1.2",
|
|
36
|
+
"@leafer/decorator": "1.1.2",
|
|
37
|
+
"@leafer/display": "1.1.2",
|
|
38
|
+
"@leafer/display-module": "1.1.2",
|
|
39
|
+
"@leafer/event": "1.1.2",
|
|
40
|
+
"@leafer/file": "1.1.2",
|
|
41
|
+
"@leafer/helper": "1.1.2",
|
|
42
|
+
"@leafer/layout": "1.1.2",
|
|
43
|
+
"@leafer/list": "1.1.2",
|
|
44
|
+
"@leafer/math": "1.1.2",
|
|
45
|
+
"@leafer/path": "1.1.2",
|
|
46
|
+
"@leafer/platform": "1.1.2",
|
|
47
|
+
"@leafer/task": "1.1.2"
|
|
48
48
|
}
|
|
49
49
|
}
|
package/src/index.ts
CHANGED