@leafer-draw/worker 1.10.1 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/worker.js +49 -27
- package/dist/worker.min.js +1 -1
- package/dist/worker.min.js.map +1 -1
- package/dist/worker.module.js +50 -28
- package/dist/worker.module.min.js +1 -1
- package/dist/worker.module.min.js.map +1 -1
- package/package.json +9 -9
package/dist/worker.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var LeaferUI=function(t){"use strict";var e;t.Answer=void 0,(e=t.Answer||(t.Answer={}))[e.No=0]="No",e[e.Yes=1]="Yes",e[e.NoAndSkip=2]="NoAndSkip",e[e.YesAndSkip=3]="YesAndSkip";function s(t){return void 0===t}function i(t){return null==t}function r(t){return"string"==typeof t}const{isFinite:o}=Number;function n(t){return"number"==typeof t}const a=/^-?\d+(?:\.\d+)?$/;const{isArray:h}=Array;function l(t){return t&&"object"==typeof t}function d(t){return"{}"===JSON.stringify(t)}const c={default:(t,e)=>(u(e,t),u(t,e),t),assign(t,e,s){let i;Object.keys(e).forEach(r=>{var o,n;if(i=e[r],(null==i?void 0:i.constructor)===Object&&(null===(o=t[r])||void 0===o?void 0:o.constructor)===Object)return u(t[r],e[r],s&&s[r]);s&&r in s?(null===(n=s[r])||void 0===n?void 0:n.constructor)===Object&&u(t[r]={},e[r],s[r]):t[r]=e[r]})},copyAttrs:(t,e,i)=>(i.forEach(i=>{s(e[i])||(t[i]=e[i])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,i=t.length;s<i;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:u}=c;class _{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __usePathBox(){return this.__pathInputed}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(!s(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let i;for(let r in this)"_"!==r[0]&&(i=e?e[r]:void 0,t[r]=s(i)?this[r]:i);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!s(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!s(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const i={};if(t)if(h(t))for(let e of t)i[e]=this.__getInput(e);else for(let e in t)i[e]=this.__getInput(e);else{let t,e,{__input:r}=this;i.tag=this.__leaf.tag;for(let o in this)if("_"!==o[0]&&(t=this["_"+o],!s(t))){if("path"===o&&!this.__pathInputed)continue;e=r?r[o]:void 0,i[o]=s(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:s,d:r,e:o,f:n}=this.__leaf.__localMatrix;i.matrix={a:t,b:e,c:s,d:r,e:o,f:n}}return i}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null}}const{floor:p,max:f}=Math,g={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",isLarge:(t,e,s,i)=>t.width*t.height*(e?e*s:1)>(i||y.maxCacheSize),isSuperLarge:(t,e,s)=>y.isLarge(t,e,s,y.maxPatternSize),getRealURL(t){const{prefix:e,suffix:s}=g.image;return!s||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+s),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,s,i,r,o,n,a,h){const l=g.origin.createCanvas(f(p(e+(i||0)),1),f(p(s+(r||0)),1)),d=l.getContext("2d");if(a&&(d.globalAlpha=a),d.imageSmoothingEnabled=!1!==n,o){const i=e/o.width,r=s/o.height;d.setTransform(i,0,0,r,-o.x*i,-o.y*r),d.drawImage(t,0,0,t.width,t.height)}else d.drawImage(t,0,0,e,s);return l},setPatternTransform(t,e,s){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}s&&c.stintSet(s,"transform",e)}}},{image:y}=g,m={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=x;return e[t]?e[t]++:(e[t]=1,0)}},x=m;let w,v,b;const{max:B}=Math,k=[0,0,0,0],S={zero:[...k],tempFour:k,set:(t,e,s,i,r)=>(void 0===s&&(s=i=r=e),t[0]=e,t[1]=s,t[2]=i,t[3]=r,t),setTemp:(t,e,s,i)=>R(k,t,e,s,i),toTempAB(t,e,s){b=s?n(t)?e:t:[],n(t)?(w=T(t),v=e):n(e)?(w=t,v=T(e)):(w=t,v=e),4!==w.length&&(w=C(w)),4!==v.length&&(v=C(v))},get(t,e){let i;if(!n(t))switch(t.length){case 4:i=s(e)?t:[...t];break;case 2:i=[t[0],t[1],t[0],t[1]];break;case 3:i=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(i||(i=[t,t,t,t]),!s(e))for(let t=0;t<4;t++)i[t]>e&&(i[t]=e);return i},max:(t,e,s)=>n(t)&&n(e)?B(t,e):(P(t,e,s),R(b,B(w[0],v[0]),B(w[1],v[1]),B(w[2],v[2]),B(w[3],v[3]))),add:(t,e,s)=>n(t)&&n(e)?t+e:(P(t,e,s),R(b,w[0]+v[0],w[1]+v[1],w[2]+v[2],w[3]+v[3])),swapAndScale(t,e,s,i){if(n(t))return e===s?t*e:[t*s,t*e];const r=i?t:[],[o,a,h,l]=4===t.length?t:C(t);return R(r,h*s,l*e,o*s,a*e)}},{set:R,get:C,setTemp:T,toTempAB:P}=S,{round:L,pow:I,max:E,floor:O,PI:A}=Math,M={within:(t,e,i)=>(l(e)&&(i=e.max,e=e.min),!s(e)&&t<e&&(t=e),!s(i)&&t>i&&(t=i),t),fourNumber:S.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),M.float(t)),getGapRotation(t,e,s=0){let i=t+s;if(e>1){const t=Math.abs(i%e);(t<1||t>e-1)&&(i=Math.round(i/e)*e)}return i-s},float(t,e){const i=s(e)?1e12:I(10,e);return-0===(t=L(t*i)/i)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,s,i){if(i||(i={}),e){const t=(n(e)?e:e.width||0)/s.width,r=(n(e)?e:e.height||0)/s.height;i.scaleX=t||r||1,i.scaleY=r||t||1}else t&&M.assignScale(i,t);return i},assignScale(t,e){n(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>E(O(t),e)/t,randInt:W,randColor:t=>`rgba(${W(255)},${W(255)},${W(255)},${t||1})`};function W(t){return Math.round(Math.random()*t)}const D=A/180,F=2*A,U=A/2;function N(){return{x:0,y:0}}function z(){return{x:0,y:0,width:0,height:0}}function Y(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:X,cos:H,acos:G,sqrt:j}=Math,{float:V}=M,q={};function Q(){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 J={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:Q(),tempMatrix:{},set(t,e=1,s=0,i=0,r=1,o=0,n=0){t.a=e,t.b=s,t.c=i,t.d=r,t.e=o,t.f=n},get:Y,getWorld:Q,copy(t,e){t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f},translate(t,e,s){t.e+=e,t.f+=s},translateInner(t,e,s,i){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,i&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},pixelScale(t,e,s){s||(s=t),s.a=t.a*e,s.b=t.b*e,s.c=t.c*e,s.d=t.d*e,s.e=t.e*e,s.f=t.f*e},scaleOfOuter(t,e,s,i){$.toInnerPoint(t,e,q),$.scaleOfInner(t,q,s,i)},scaleOfInner(t,e,s,i=s){$.translateInner(t,e.x,e.y),$.scale(t,s,i),$.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:i,c:r,d:o}=t,n=H(e*=D),a=X(e);t.a=s*n-i*a,t.b=s*a+i*n,t.c=r*n-o*a,t.d=r*a+o*n},rotateOfOuter(t,e,s){$.toInnerPoint(t,e,q),$.rotateOfInner(t,q,s)},rotateOfInner(t,e,s){$.translateInner(t,e.x,e.y),$.rotate(t,s),$.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:i,b:r,c:o,d:n}=t;s&&(s*=D,t.a=i+o*s,t.b=r+n*s),e&&(e*=D,t.c=o+i*e,t.d=n+r*e)},skewOfOuter(t,e,s,i){$.toInnerPoint(t,e,q),$.skewOfInner(t,q,s,i)},skewOfInner(t,e,s,i=0){$.translateInner(t,e.x,e.y),$.skew(t,s,i),$.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:i,c:r,d:o,e:n,f:a}=t;t.a=e.a*s+e.b*r,t.b=e.a*i+e.b*o,t.c=e.c*s+e.d*r,t.d=e.c*i+e.d*o,t.e=e.e*s+e.f*r+n,t.f=e.e*i+e.f*o+a},multiplyParent(t,e,i,r,o){const{e:n,f:a}=t;if(i||(i=t),s(r)&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:s,b:r,c:n,d:a}=t;i.a=s*e.a+r*e.c,i.b=s*e.b+r*e.d,i.c=n*e.a+a*e.c,i.d=n*e.b+a*e.d,o&&(i.scaleX=e.scaleX*o.scaleX,i.scaleY=e.scaleY*o.scaleY)}else i.a=e.a,i.b=e.b,i.c=e.c,i.d=e.d,o&&(i.scaleX=e.scaleX,i.scaleY=e.scaleY);i.e=n*e.a+a*e.c+e.e,i.f=n*e.b+a*e.d+e.f},divide(t,e){$.multiply(t,$.tempInvert(e))},divideParent(t,e){$.multiplyParent(t,$.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=$;return $.copy(e,t),$.invert(e),e},invert(t){const{a:e,b:s,c:i,d:r,e:o,f:n}=t;if(s||i){const a=1/(e*r-s*i);t.a=r*a,t.b=-s*a,t.c=-i*a,t.d=e*a,t.e=-(o*r-n*i)*a,t.f=-(n*e-o*s)*a}else if(1===e&&1===r)t.e=-o,t.f=-n;else{const s=1/(e*r);t.a=r*s,t.d=e*s,t.e=-o*r*s,t.f=-n*e*s}},toOuterPoint(t,e,s,i){const{x:r,y:o}=e;s||(s=e),s.x=r*t.a+o*t.c,s.y=r*t.b+o*t.d,i||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,i){const{a:r,b:o,c:n,d:a}=t,h=1/(r*a-o*n),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*n)*h,s.y=(d*r-l*o)*h,!i){const{e:e,f:i}=t;s.x-=(e*a-i*n)*h,s.y-=(i*r-e*o)*h}},setLayout(t,e,i,r,o){const{x:n,y:a,scaleX:h,scaleY:l}=e;if(s(o)&&(o=e.rotation||e.skewX||e.skewY),o){const{rotation:s,skewX:i,skewY:r}=e,o=s*D,n=H(o),a=X(o);if(i||r){const e=i*D,s=r*D;t.a=(n+s*-a)*h,t.b=(a+s*n)*h,t.c=(e*n-a)*l,t.d=(n+e*a)*l}else t.a=n*h,t.b=a*h,t.c=-a*l,t.d=n*l}else t.a=h,t.b=0,t.c=0,t.d=l;t.e=n,t.f=a,(i=i||r)&&$.translateInner(t,-i.x,-i.y,!r)},getLayout(t,e,s,i){const{a:r,b:o,c:n,d:a,e:h,f:l}=t;let d,c,u,_,p,f=h,g=l;if(o||n){const t=r*a-o*n;if(n&&!i){d=j(r*r+o*o),c=t/d;const e=r/d;u=o>0?G(e):-G(e)}else{c=j(n*n+a*a),d=t/c;const e=n/c;u=U-(a>0?G(-e):-G(e))}const e=V(H(u)),s=X(u);d=V(d),c=V(c),_=e?V((n/c+s)/e/D,9):0,p=e?V((o/d-s)/e/D,9):0,u=V(u/D)}else d=r,c=a,u=_=p=0;return(e=s||e)&&(f+=e.x*r+e.y*n,g+=e.x*o+e.y*a,s||(f-=e.x,g-=e.y)),{x:f,y:g,scaleX:d,scaleY:c,rotation:u,skewX:_,skewY:p}},withScale(t,e,s=e){const i=t;if(!e||!s){const{a:i,b:r,c:o,d:n}=t;r||o?s=(i*n-r*o)/(e=j(i*i+r*r)):(e=i,s=n)}return i.scaleX=e,i.scaleY=s,i},reset(t){$.set(t)}},$=J,{toInnerPoint:Z,toOuterPoint:K}=J,{sin:tt,cos:et,abs:st,sqrt:it,atan2:rt,min:ot,round:nt}=Math,at={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,i){t.radiusX=e,t.radiusY=s(i)?e:i},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,s){t.x=e,t.y=s},round(t,e){t.x=e?nt(t.x-.5)+.5:nt(t.x),t.y=e?nt(t.y-.5)+.5:nt(t.y)},move(t,e,s){l(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=s)},scale(t,e,s=e){t.x&&(t.x*=e),t.y&&(t.y*=s)},scaleOf(t,e,s,i=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(i-1)},rotate(t,e,s){s||(s=ht.defaultPoint);const i=et(e*=D),r=tt(e),o=t.x-s.x,n=t.y-s.y;t.x=s.x+o*i-n*r,t.y=s.y+o*r+n*i},tempToInnerOf(t,e){const{tempPoint:s}=ht;return dt(s,t),Z(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=ht;return dt(s,t),K(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=ht;return dt(s,t),ht.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),Z(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){Z(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)=>lt(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,s,i){const r=st(s-t),o=st(i-e);return it(r*r+o*o)},getMinDistanceFrom:(t,e,s,i,r,o)=>ot(lt(t,e,s,i),lt(s,i,r,o)),getAngle:(t,e)=>ct(t,e)/D,getRotation:(t,e,s,i)=>(i||(i=e),ht.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,i.x,i.y)/D),getRadianFrom(t,e,i,r,o,n,a,h){s(a)&&(a=i,h=r);const l=t-i,d=e-r,c=o-a,u=n-h;return Math.atan2(l*u-d*c,l*c+d*u)},getAtan2:(t,e)=>rt(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,i){const r=ct(t,e);return(e=i?e:{}).x=t.x+et(r)*s,e.y=t.y+tt(r)*s,e},toNumberPoints(t){let e=t;return l(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},reset(t){ht.reset(t)}},ht=at,{getDistanceFrom:lt,copy:dt,getAtan2:ct}=ht;class ut{constructor(t,e){this.set(t,e)}set(t,e){return l(t)?at.copy(this,t):at.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new ut(this)}move(t,e){return at.move(this,t,e),this}scale(t,e){return at.scale(this,t,e),this}scaleOf(t,e,s){return at.scaleOf(this,t,e,s),this}rotate(t,e){return at.rotate(this,t,e),this}rotateOf(t,e){return at.rotate(this,e,t),this}getRotation(t,e,s){return at.getRotation(this,t,e,s)}toInnerOf(t,e){return at.toInnerOf(this,t,e),this}toOuterOf(t,e){return at.toOuterOf(this,t,e),this}getCenter(t){return new ut(at.getCenter(this,t))}getDistance(t){return at.getDistance(this,t)}getDistancePoint(t,e,s){return new ut(at.getDistancePoint(this,t,e,s))}getAngle(t){return at.getAngle(this,t)}getAtan2(t){return at.getAtan2(this,t)}reset(){return at.reset(this),this}}const _t=new ut;class pt{constructor(t,e,s,i,r,o){this.set(t,e,s,i,r,o)}set(t,e,s,i,r,o){return l(t)?J.copy(this,t):J.set(this,t,e,s,i,r,o),this}setWith(t){return J.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:s,d:i,e:r,f:o}=this;return{a:t,b:e,c:s,d:i,e:r,f:o}}clone(){return new pt(this)}translate(t,e){return J.translate(this,t,e),this}translateInner(t,e){return J.translateInner(this,t,e),this}scale(t,e){return J.scale(this,t,e),this}scaleWith(t,e){return J.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return J.pixelScale(this,t),this}scaleOfOuter(t,e,s){return J.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return J.scaleOfInner(this,t,e,s),this}rotate(t){return J.rotate(this,t),this}rotateOfOuter(t,e){return J.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return J.rotateOfInner(this,t,e),this}skew(t,e){return J.skew(this,t,e),this}skewOfOuter(t,e,s){return J.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return J.skewOfInner(this,t,e,s),this}multiply(t){return J.multiply(this,t),this}multiplyParent(t){return J.multiplyParent(this,t),this}divide(t){return J.divide(this,t),this}divideParent(t){return J.divideParent(this,t),this}invert(){return J.invert(this),this}invertWith(){return J.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){J.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){J.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return J.setLayout(this,t,e,s),this}getLayout(t,e,s){return J.getLayout(this,t,e,s)}withScale(t,e){return J.withScale(this,t,e)}reset(){J.reset(this)}}const ft=new pt,gt={tempPointBounds:{},setPoint(t,e,s){t.minX=t.maxX=e,t.minY=t.maxY=s},addPoint(t,e,s){t.minX=e<t.minX?e:t.minX,t.minY=s<t.minY?s:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=s>t.maxY?s:t.maxY},addBounds(t,e,s,i,r){yt(t,e,s),yt(t,e+i,s+r)},copy(t,e){t.minX=e.minX,t.minY=e.minY,t.maxX=e.maxX,t.maxY=e.maxY},addPointBounds(t,e){t.minX=e.minX<t.minX?e.minX:t.minX,t.minY=e.minY<t.minY?e.minY:t.minY,t.maxX=e.maxX>t.maxX?e.maxX:t.maxX,t.maxY=e.maxY>t.maxY?e.maxY:t.maxY},toBounds(t,e){e.x=t.minX,e.y=t.minY,e.width=t.maxX-t.minX,e.height=t.maxY-t.minY}},{addPoint:yt}=gt;var mt,xt;t.Direction4=void 0,(mt=t.Direction4||(t.Direction4={}))[mt.top=0]="top",mt[mt.right=1]="right",mt[mt.bottom=2]="bottom",mt[mt.left=3]="left",t.Direction9=void 0,(xt=t.Direction9||(t.Direction9={}))[xt.topLeft=0]="topLeft",xt[xt.top=1]="top",xt[xt.topRight=2]="topRight",xt[xt.right=3]="right",xt[xt.bottomRight=4]="bottomRight",xt[xt.bottom=5]="bottom",xt[xt.bottomLeft=6]="bottomLeft",xt[xt.left=7]="left",xt[xt.center=8]="center",xt[xt["top-left"]=0]="top-left",xt[xt["top-right"]=2]="top-right",xt[xt["bottom-right"]=4]="bottom-right",xt[xt["bottom-left"]=6]="bottom-left";const wt=[{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}];wt.forEach(t=>t.type="percent");const vt={directionData:wt,tempPoint:{},get:bt,toPoint(t,e,s,i,r,o){const n=bt(t);s.x=n.x,s.y=n.y,"percent"===n.type&&(s.x*=e.width,s.y*=e.height,r&&(o||(s.x-=r.x,s.y-=r.y),n.x&&(s.x-=1===n.x?r.width:.5===n.x?n.x*r.width:0),n.y&&(s.y-=1===n.y?r.height:.5===n.y?n.y*r.height:0))),i||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s)=>(s||(s={}),vt.toPoint(t,e,s,!0),s)};function bt(e){return r(e)?wt[t.Direction9[e]]:e}const{toPoint:Bt}=vt,kt={toPoint(t,e,s,i,r,o){Bt(t,s,i,r,e,o)}},{tempPointBounds:St,setPoint:Rt,addPoint:Ct,toBounds:Tt}=gt,{toOuterPoint:Pt}=J,{float:Lt,fourNumber:It}=M,{floor:Et,ceil:Ot}=Math;let At,Mt,Wt,Dt;const Ft={},Ut={},Nt={},zt={tempBounds:Nt,set(t,e=0,s=0,i=0,r=0){t.x=e,t.y=s,t.width=i,t.height=r},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,i,r){const{x:o,y:n,width:a,height:l}=e;if(h(s)){const e=It(s);i?Yt.set(t,o+e[3],n+e[0],a-e[1]-e[3],l-e[2]-e[0]):Yt.set(t,o-e[3],n-e[0],a+e[1]+e[3],l+e[2]+e[0])}else i&&(s=-s),Yt.set(t,o-s,n-s,a+2*s,l+2*s);r&&("width"===r?(t.y=n,t.height=l):(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},scroll(t,e){t.x+=e.scrollX,t.y+=e.scrollY},getByMove:(t,e,s)=>(t=Object.assign({},t),Yt.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?Ht(e,t):e=t,s||(s=t),e.offsetX=Yt.maxX(s),e.offsetY=Yt.maxY(s),Yt.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e,i){i||at.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,i=s){at.scaleOf(t,e,s,i),t.width*=s,t.height*=i},tempToOuterOf:(t,e)=>(Yt.copy(Nt,t),Yt.toOuterOf(Nt,e),Nt),getOuterOf:(t,e)=>(t=Object.assign({},t),Yt.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:i,d:r,e:o,f:n}=e;i>0?(s.width=t.width*i,s.x=o+t.x*i):(s.width=t.width*-i,s.x=o+t.x*i-s.width),r>0?(s.height=t.height*r,s.y=n+t.y*r):(s.height=t.height*-r,s.y=n+t.y*r-s.height)}else Ft.x=t.x,Ft.y=t.y,Pt(e,Ft,Ut),Rt(St,Ut.x,Ut.y),Ft.x=t.x+t.width,Pt(e,Ft,Ut),Ct(St,Ut.x,Ut.y),Ft.y=t.y+t.height,Pt(e,Ft,Ut),Ct(St,Ut.x,Ut.y),Ft.x=t.x,Pt(e,Ft,Ut),Ct(St,Ut.x,Ut.y),Tt(St,s)},toInnerOf(t,e,s){s||(s=t),Yt.move(s,-e.e,-e.f),Yt.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const i=Math.min(s,Yt.getFitScale(t,e));return new pt(i,0,0,i,-e.x*i,-e.y*i)},getFitScale(t,e,s){const i=t.width/e.width,r=t.height/e.height;return s?Math.max(i,r):Math.min(i,r)},put(t,e,s="center",i=1,o=!0,n){n||(n=e),r(i)&&(i=Yt.getFitScale(t,e,"cover"===i)),Nt.width=o?e.width*=i:e.width*i,Nt.height=o?e.height*=i:e.height*i,kt.toPoint(s,Nt,t,n,!0,!0)},getSpread(t,e,s){const i={};return Yt.copyAndSpread(i,t,e,!1,s),i},spread(t,e,s){Yt.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){Yt.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=Et(t.x),t.y=Et(t.y),t.width=e>t.x?Ot(t.width+e-t.x):Ot(t.width),t.height=s>t.y?Ot(t.height+s-t.y):Ot(t.height)},unsign(t){t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height)},float(t,e){t.x=Lt(t.x,e),t.y=Lt(t.y,e),t.width=Lt(t.width,e),t.height=Lt(t.height,e)},add(t,e,s){At=t.x+t.width,Mt=t.y+t.height,Wt=e.x,Dt=e.y,s||(Wt+=e.width,Dt+=e.height),At=At>Wt?At:Wt,Mt=Mt>Dt?Mt:Dt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=At-t.x,t.height=Mt-t.y},addList(t,e){Yt.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){Yt.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){Yt.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,i=!1){let r,o=!0;for(let n=0,a=e.length;n<a;n++)r=s?s(e[n],n):e[n],r&&(r.width||r.height)&&(o?(o=!1,i||Ht(t,r)):Xt(t,r));o&&Yt.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Rt(St,t.x,t.y):Ct(St,t.x,t.y)),Tt(St,t)},setPoint(t,e){Yt.set(t,e.x,e.y)},addPoint(t,e){Xt(t,e,!0)},getPoints(t){const{x:e,y:s,width:i,height:r}=t;return[{x:e,y:s},{x:e+i,y:s},{x:e+i,y:s+r},{x:e,y:s+r}]},hitRadiusPoint:(t,e,s)=>(s&&(e=at.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=at.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=Yt.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=Yt.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=Yt.tempToOuterOf(e,s)),!Yt.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:i,y:r,width:o,height:n}=e;return At=i+o,Mt=r+n,Wt=t.x+t.width,Dt=t.y+t.height,i=i>t.x?i:t.x,r=r>t.y?r:t.y,At=At<Wt?At:Wt,Mt=Mt<Dt?Mt:Dt,o=At-i,n=Mt-r,{x:i,y:r,width:o,height:n}},intersect(t,e,s){Yt.copy(t,Yt.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){Yt.set(t)}},Yt=zt,{add:Xt,copy:Ht}=Yt;class Gt{get minX(){return zt.minX(this)}get minY(){return zt.minY(this)}get maxX(){return zt.maxX(this)}get maxY(){return zt.maxY(this)}constructor(t,e,s,i){this.set(t,e,s,i)}set(t,e,s,i){return l(t)?zt.copy(this,t):zt.set(this,t,e,s,i),this}get(){const{x:t,y:e,width:s,height:i}=this;return{x:t,y:e,width:s,height:i}}clone(){return new Gt(this)}move(t,e){return zt.move(this,t,e),this}scale(t,e,s){return zt.scale(this,t,e,s),this}scaleOf(t,e,s){return zt.scaleOf(this,t,e,s),this}toOuterOf(t,e){return zt.toOuterOf(this,t,e),this}toInnerOf(t,e){return zt.toInnerOf(this,t,e),this}getFitMatrix(t,e){return zt.getFitMatrix(this,t,e)}put(t,e,s){zt.put(this,t,e,s)}spread(t,e){return zt.spread(this,t,e),this}shrink(t,e){return zt.shrink(this,t,e),this}ceil(){return zt.ceil(this),this}unsign(){return zt.unsign(this),this}float(t){return zt.float(this,t),this}add(t){return zt.add(this,t),this}addList(t){return zt.setList(this,t,!0),this}setList(t){return zt.setList(this,t),this}addListWithFn(t,e){return zt.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return zt.setListWithFn(this,t,e),this}setPoint(t){return zt.setPoint(this,t),this}setPoints(t){return zt.setPoints(this,t),this}addPoint(t){return zt.addPoint(this,t),this}getPoints(){return zt.getPoints(this)}hitPoint(t,e){return zt.hitPoint(this,t,e)}hitRadiusPoint(t,e){return zt.hitRadiusPoint(this,t,e)}hit(t,e){return zt.hit(this,t,e)}includes(t,e){return zt.includes(this,t,e)}intersect(t,e){return zt.intersect(this,t,e),this}getIntersect(t,e){return new Gt(zt.getIntersectData(this,t,e))}isSame(t){return zt.isSame(this,t)}isEmpty(){return zt.isEmpty(this)}reset(){zt.reset(this)}}const jt=new Gt;class Vt{constructor(t,e,s,i,r,o){l(t)?this.copy(t):this.set(t,e,s,i,r,o)}set(t=0,e=0,s=0,i=0,r=0,o=0){this.top=t,this.right=e,this.bottom=s,this.left=i,this.width=r,this.height=o}copy(t){const{top:e,right:s,bottom:i,left:r,width:o,height:n}=t;this.set(e,s,i,r,o,n)}getBoundsFrom(t){const{top:e,right:s,bottom:i,left:r,width:o,height:n}=this;return new Gt(r,e,o||t.width-r-s,n||t.height-e-i)}}const qt={0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,".":1,e:1,E:1},{randColor:Qt}=M;class Jt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new Jt(t)}static set filter(t){this.filterList=$t(t)}static set exclude(t){this.excludeList=$t(t)}static drawRepaint(t,e){const s=Qt();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const i="hit"===Jt.showBounds,r=t.__nowWorld,o=Qt();i&&(e.setWorld(r),t.__drawHitPath(e),e.fillStyle=o.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(o,2),i?e.stroke():e.strokeWorld(r,o)}log(...t){if(Zt.enable){if(Zt.filterList.length&&Zt.filterList.every(t=>t!==this.name))return;if(Zt.excludeList.length&&Zt.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){Zt.enable&&this.warn(...t)}warn(...t){Zt.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 $t(t){return t?r(t)&&(t=[t]):t=[],t}Jt.filterList=[],Jt.excludeList=[],Jt.showWarn=!0;const Zt=Jt,Kt=Jt.get("RunTime"),te={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const s=m.create(m.RUNTIME);return ee.currentId=ee.idMap[s]=e?performance.now():Date.now(),ee.currentName=ee.nameMap[s]=t,ee.nameToIdMap[t]=s,s},end(t,e){const s=ee.idMap[t],i=ee.nameMap[t],r=e?(performance.now()-s)/1e3:Date.now()-s;ee.idMap[t]=ee.nameMap[t]=ee.nameToIdMap[i]=void 0,Kt.log(i,r,"ms")},endOfName(t,e){const i=ee.nameToIdMap[t];s(i)||ee.end(i,e)}},ee=te,se=[],ie={list:{},add(t,...e){this.list[t]=!0,se.push(...e)},has(t,e){const s=this.list[t];return!s&&e&&this.need(t),s},need(t){console.error("please install and import plugin: "+(t.includes("-x")?"":"@leafer-in/")+t)}};setTimeout(()=>se.forEach(t=>ie.has(t,!0)));const re={editor:t=>ie.need("editor")},oe=Jt.get("UICreator"),ne={list:{},register(t){const{__tag:e}=t.prototype;ae[e]&&oe.repeat(e),ae[e]=t},get(t,e,i,r,o,n){ae[t]||oe.error("not register "+t);const a=new ae[t](e);return s(i)||(a.x=i,r&&(a.y=r),o&&(a.width=o),n&&(a.height=n)),a}},{list:ae}=ne,he=Jt.get("EventCreator"),le={nameList:{},register(t){let e;Object.keys(t).forEach(s=>{e=t[s],r(e)&&(de[e]&&he.repeat(e),de[e]=t)})},changeName(t,e){const s=de[t];if(s){const i=Object.keys(s).find(e=>s[e]===t);i&&(s[i]=e,de[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new de[t](...e)},{nameList:de}=le;class ce{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:s}=this;for(let i=0,r=s.length;i<r;i++)if(e=s[i],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const i=re.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,i=this.list.length;s<i;s++)t=this.list[s],t.recycled?t.destroy():e.push(t);this.list=e}clear(){this.list.forEach(t=>{t.destroy()}),this.list.length=0}destroy(){this.clear()}}function ue(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n}function _e(t,e,s,i){return new(s||(s=Promise))(function(r,o){function n(t){try{h(i.next(t))}catch(t){o(t)}}function a(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(n,a)}h((i=i.apply(t,e||[])).next())})}function pe(t){return(e,s)=>{t||(t=s);const i={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===s&&(i.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,s,i)}}"function"==typeof SuppressedError&&SuppressedError;const fe=[];function ge(){return(t,e)=>{fe.push(e)}}const ye=[];class me{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||ye)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;fe.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,s,i,r,o){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,i,r,o){l(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,i,r,o)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,i){}strokeRect(t,e,s,i){}clearRect(t,e,s,i){}drawImage(t,e,s,i,r,o,n,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/i*a;i+=e,e=0,o+=t,a-=t}if(s<0){const t=-s/r*h;r+=s,s=0,n+=t,h-=t}this.context.drawImage(t,e,s,i,r,o,n,a,h);break;case 5:this.context.drawImage(t,e,s,i,r);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,i,r,o){}quadraticCurveTo(t,e,s,i){}closePath(){}arc(t,e,s,i,r,o){}arcTo(t,e,s,i,r){}ellipse(t,e,s,i,r,o,n,a){}rect(t,e,s,i){}roundRect(t,e,s,i,r){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,i){}createPattern(t,e){}createRadialGradient(t,e,s,i,r,o){}fillText(t,e,s,i){}measureText(t){}strokeText(t,e,s,i){}destroy(){this.context=null}}ue([pe("imageSmoothingEnabled")],me.prototype,"smooth",void 0),ue([pe("imageSmoothingQuality")],me.prototype,"smoothLevel",void 0),ue([pe("globalAlpha")],me.prototype,"opacity",void 0),ue([pe()],me.prototype,"fillStyle",void 0),ue([pe()],me.prototype,"strokeStyle",void 0),ue([pe("lineWidth")],me.prototype,"strokeWidth",void 0),ue([pe("lineCap")],me.prototype,"strokeCap",void 0),ue([pe("lineJoin")],me.prototype,"strokeJoin",void 0),ue([pe("lineDashOffset")],me.prototype,"dashOffset",void 0),ue([pe()],me.prototype,"miterLimit",void 0),ue([pe()],me.prototype,"shadowBlur",void 0),ue([pe()],me.prototype,"shadowColor",void 0),ue([pe()],me.prototype,"shadowOffsetX",void 0),ue([pe()],me.prototype,"shadowOffsetY",void 0),ue([pe()],me.prototype,"filter",void 0),ue([pe()],me.prototype,"font",void 0),ue([pe()],me.prototype,"fontKerning",void 0),ue([pe()],me.prototype,"fontStretch",void 0),ue([pe()],me.prototype,"fontVariantCaps",void 0),ue([pe()],me.prototype,"textAlign",void 0),ue([pe()],me.prototype,"textBaseline",void 0),ue([pe()],me.prototype,"textRendering",void 0),ue([pe()],me.prototype,"wordSpacing",void 0),ue([pe()],me.prototype,"letterSpacing",void 0),ue([pe()],me.prototype,"direction",void 0),ue([ge()],me.prototype,"setTransform",null),ue([ge()],me.prototype,"resetTransform",null),ue([ge()],me.prototype,"getTransform",null),ue([ge()],me.prototype,"save",null),ue([ge()],me.prototype,"restore",null),ue([ge()],me.prototype,"translate",null),ue([ge()],me.prototype,"scale",null),ue([ge()],me.prototype,"rotate",null),ue([ge()],me.prototype,"fill",null),ue([ge()],me.prototype,"stroke",null),ue([ge()],me.prototype,"clip",null),ue([ge()],me.prototype,"fillRect",null),ue([ge()],me.prototype,"strokeRect",null),ue([ge()],me.prototype,"clearRect",null),ue([ge()],me.prototype,"beginPath",null),ue([ge()],me.prototype,"moveTo",null),ue([ge()],me.prototype,"lineTo",null),ue([ge()],me.prototype,"bezierCurveTo",null),ue([ge()],me.prototype,"quadraticCurveTo",null),ue([ge()],me.prototype,"closePath",null),ue([ge()],me.prototype,"arc",null),ue([ge()],me.prototype,"arcTo",null),ue([ge()],me.prototype,"ellipse",null),ue([ge()],me.prototype,"rect",null),ue([ge()],me.prototype,"roundRect",null),ue([ge()],me.prototype,"createConicGradient",null),ue([ge()],me.prototype,"createLinearGradient",null),ue([ge()],me.prototype,"createPattern",null),ue([ge()],me.prototype,"createRadialGradient",null),ue([ge()],me.prototype,"fillText",null),ue([ge()],me.prototype,"measureText",null),ue([ge()],me.prototype,"strokeText",null);const{copy:xe,multiplyParent:we,pixelScale:ve}=J,{round:be}=Math,Be=new Gt,ke=new Gt,Se={width:1,height:1,pixelRatio:1},Re=["width","height","pixelRatio"];class Ce extends me{get width(){return this.size.width}get height(){return this.size.height}get pixelRatio(){return this.size.pixelRatio}get pixelWidth(){return this.width*this.pixelRatio||0}get pixelHeight(){return this.height*this.pixelRatio||0}get pixelSnap(){return this.config.pixelSnap}set pixelSnap(t){this.config.pixelSnap=t}get allowBackgroundColor(){return this.view&&this.parentView}constructor(t,e){super(),this.size={},this.worldTransform={},t||(t=Se),this.manager=e,this.innerId=m.create(m.CNAVAS);const{width:s,height:i,pixelRatio:r}=t;this.autoLayout=!s||!i,this.size.pixelRatio=r||g.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let s;this.context&&!this.unreal&&e&&this.width&&(s=this.getSameCanvas(),s.copyWorld(this));const i=this.size;c.copyAttrs(i,t,Re),Re.forEach(t=>i[t]||(i[t]=1)),this.bounds=new Gt(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&s&&(this.clearWorld(s.bounds),this.copyWorld(s),s.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s,pixelSnap:i}=this,r=this.worldTransform;e&&we(t,e,r),ve(t,s,r),i&&!t.ignorePixelSnap&&(t.half&&t.half*s%2?(r.e=be(r.e-.5)+.5,r.f=be(r.f-.5)+.5):(r.e=be(r.e),r.f=be(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,s,i){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,i)}setStrokeOptions(t,e){let{strokeCap:i,strokeJoin:r,dashPattern:o,dashOffset:n,miterLimit:a}=t;e&&(e.strokeCap&&(i=e.strokeCap),e.strokeJoin&&(r=e.strokeJoin),s(e.dashPattern)||(o=e.dashPattern),s(e.dashOffset)||(n=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=i,this.strokeJoin=r,this.dashPattern=o,this.dashOffset=n,this.miterLimit=a}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,e){return!0}hitStroke(t,e){return!0}hitPixel(t,e,s=1){return!0}setWorldShadow(t,e,s,i){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=e*r,this.shadowBlur=s*r,this.shadowColor=i||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,i,r=!0){i&&(this.blendMode=i),e?(this.setTempPixelBounds(e,r),s?(this.setTempPixelBounds2(s,r),s=ke):s=Be,this.drawImage(t.view,Be.x,Be.y,Be.width,Be.height,s.x,s.y,s.width,s.height)):this.drawImage(t.view,0,0),i&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,i,r=!0){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,zt.tempToOuterOf(s,e),i,r),this.restore()):(i&&(this.blendMode=i),this.setTempPixelBounds(e,r),this.drawImage(t.view,Be.x,Be.y,Be.width,Be.height,s.x,s.y,s.width,s.height),i&&(this.blendMode="source-over"))}copyWorldByReset(t,e,s,i,r,o=!0){this.resetTransform(),this.copyWorld(t,e,s,i,o),r||this.useWorldTransform()}useGrayscaleAlpha(t){let e,s;this.setTempPixelBounds(t,!0,!0);const{context:i}=this,r=i.getImageData(Be.x,Be.y,Be.width,Be.height),{data:o}=r;for(let t=0,i=o.length;t<i;t+=4)s=.299*o[t]+.587*o[t+1]+.114*o[t+2],(e=o[t+3])&&(o[t+3]=255===e?s:e*(s/255));i.putImageData(r,Be.x,Be.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,i){s&&(this.blendMode=s),this.fillStyle=e,this.setTempPixelBounds(t,i),this.fillRect(Be.x,Be.y,Be.width,Be.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s,i){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempPixelBounds(t,i),this.strokeRect(Be.x,Be.y,Be.width,Be.height),s&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Be.x,Be.y,Be.width,Be.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Be.x,Be.y,Be.width,Be.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,s){this.copyToPixelBounds(Be,t,e,s)}setTempPixelBounds2(t,e,s){this.copyToPixelBounds(ke,t,e,s)}copyToPixelBounds(t,e,s,i){t.set(e),i&&t.intersect(this.bounds),t.scale(this.pixelRatio),s&&t.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:s,pixelSnap:i}=this,r=this.manager?this.manager.get(s):re.canvas(Object.assign({},s));return r.save(),t&&(xe(r.worldTransform,this.worldTransform),r.useWorldTransform()),e&&(r.smooth=this.smooth),r.pixelSnap!==i&&(r.pixelSnap=i),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}}const Te={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Pe={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Le=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},Pe),Ie={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},Ee={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},Oe=Object.assign(Object.assign({},Ee),Pe),Ae=Le,Me={};for(let t in Ae)Me[Ae[t]]=t;const We={};for(let t in Ae)We[Ae[t]]=Ie[t];const De={drawRoundRect(t,e,s,i,r,o){const n=M.fourNumber(o,Math.min(i/2,r/2)),a=e+i,h=s+r;n[0]?t.moveTo(e+n[0],s):t.moveTo(e,s),n[1]?t.arcTo(a,s,a,h,n[1]):t.lineTo(a,s),n[2]?t.arcTo(a,h,e,h,n[2]):t.lineTo(a,h),n[3]?t.arcTo(e,h,e,s,n[3]):t.lineTo(e,h),n[0]?t.arcTo(e,s,a,s,n[0]):t.lineTo(e,s)}},{sin:Fe,cos:Ue,hypot:Ne,atan2:ze,ceil:Ye,abs:Xe,PI:He,sqrt:Ge,pow:je}=Math,{setPoint:Ve,addPoint:qe}=gt,{set:Qe,toNumberPoints:Je}=at,{M:$e,L:Ze,C:Ke,Q:ts,Z:es}=Le,ss={},is={points(t,e,s,i){let r=Je(e);if(t.push($e,r[0],r[1]),s&&r.length>5){let e,o,n,a,h,l,d,c,u,_,p,f,g,y=r.length;const m=!0===s?.5:s;i&&(r=[r[y-2],r[y-1],...r,r[0],r[1],r[2],r[3]],y=r.length);for(let s=2;s<y-2;s+=2)e=r[s-2],o=r[s-1],n=r[s],a=r[s+1],h=r[s+2],l=r[s+3],p=Ge(je(n-e,2)+je(a-o,2)),f=Ge(je(h-n,2)+je(l-a,2)),(p||f)&&(g=p+f,p=m*p/g,f=m*f/g,h-=e,l-=o,d=n-p*h,c=a-p*l,2===s?i||t.push(ts,d,c,n,a):t.push(Ke,u,_,d,c,n,a),u=n+f*h,_=a+f*l);i||t.push(ts,u,_,r[y-2],r[y-1])}else for(let e=2,s=r.length;e<s;e+=2)t.push(Ze,r[e],r[e+1]);i&&t.push(es)},rect(t,e,s,i,r){Te.creator.path=t,Te.creator.moveTo(e,s).lineTo(e+i,s).lineTo(e+i,s+r).lineTo(e,s+r).lineTo(e,s)},roundRect(t,e,s,i,r,o){Te.creator.path=[],De.drawRoundRect(Te.creator,e,s,i,r,o),t.push(...Te.convertToCanvasData(Te.creator.path,!0))},arcTo(t,e,s,i,r,o,n,a,h,l,d){const c=i-e,u=r-s,_=o-i,p=n-r;let f=ze(u,c),g=ze(p,_);const y=Ne(c,u),m=Ne(_,p);let x=g-f;if(x<0&&(x+=F),y<1e-12||m<1e-12||x<1e-12||Xe(x-He)<1e-12)return t&&t.push(Ze,i,r),h&&(Ve(h,e,s),qe(h,i,r)),d&&Qe(d,e,s),void(l&&Qe(l,i,r));const w=c*p-_*u<0,v=w?-1:1,b=a/Ue(x/2),B=i+b*Ue(f+x/2+U*v),k=r+b*Fe(f+x/2+U*v);return f-=U*v,g-=U*v,ns(t,B,k,a,a,0,f/D,g/D,w,h,l,d)},arc:(t,e,s,i,r,o,n,a,h,l)=>ns(t,e,s,i,i,0,r,o,n,a,h,l),ellipse(t,e,s,i,r,o,n,a,h,l,d,c){const u=o*D,_=Fe(u),p=Ue(u);let f=n*D,g=a*D;f>He&&(f-=F),g<0&&(g+=F);let y=g-f;y<0?y+=F:y>F&&(y-=F),h&&(y-=F);const m=Ye(Xe(y/U)),x=y/m,w=Fe(x/4),v=8/3*w*w/Fe(x/2);g=f+x;let b,B,k,S,R,C,T,P,L=Ue(f),I=Fe(f),E=k=p*i*L-_*r*I,O=S=_*i*L+p*r*I,A=e+k,M=s+S;t&&t.push(t.length?Ze:$e,A,M),l&&Ve(l,A,M),c&&Qe(c,A,M);for(let o=0;o<m;o++)b=Ue(g),B=Fe(g),k=p*i*b-_*r*B,S=_*i*b+p*r*B,R=e+E-v*(p*i*I+_*r*L),C=s+O-v*(_*i*I-p*r*L),T=e+k+v*(p*i*B+_*r*b),P=s+S+v*(_*i*B-p*r*b),t&&t.push(Ke,R,C,T,P,e+k,s+S),l&&os(e+E,s+O,R,C,T,P,e+k,s+S,l,!0),E=k,O=S,L=b,I=B,f=g,g+=x;d&&Qe(d,e+k,s+S)},quadraticCurveTo(t,e,s,i,r,o,n){t.push(Ke,(e+2*i)/3,(s+2*r)/3,(o+2*i)/3,(n+2*r)/3,o,n)},toTwoPointBoundsByQuadraticCurve(t,e,s,i,r,o,n,a){os(t,e,(t+2*s)/3,(e+2*i)/3,(r+2*s)/3,(o+2*i)/3,r,o,n,a)},toTwoPointBounds(t,e,s,i,r,o,n,a,h,l){const d=[];let c,u,_,p,f,g,y,m,x=t,w=s,v=r,b=n;for(let t=0;t<2;++t)if(1==t&&(x=e,w=i,v=o,b=a),c=-3*x+9*w-9*v+3*b,u=6*x-12*w+6*v,_=3*w-3*x,Math.abs(c)<1e-12){if(Math.abs(u)<1e-12)continue;p=-_/u,0<p&&p<1&&d.push(p)}else y=u*u-4*_*c,m=Math.sqrt(y),y<0||(f=(-u+m)/(2*c),0<f&&f<1&&d.push(f),g=(-u-m)/(2*c),0<g&&g<1&&d.push(g));l?qe(h,t,e):Ve(h,t,e),qe(h,n,a);for(let l=0,c=d.length;l<c;l++)rs(d[l],t,e,s,i,r,o,n,a,ss),qe(h,ss.x,ss.y)},getPointAndSet(t,e,s,i,r,o,n,a,h,l){const d=1-t,c=d*d*d,u=3*d*d*t,_=3*d*t*t,p=t*t*t;l.x=c*e+u*i+_*o+p*a,l.y=c*s+u*r+_*n+p*h},getPoint(t,e,s,i,r,o,n,a,h){const l={};return rs(t,e,s,i,r,o,n,a,h,l),l},getDerivative(t,e,s,i,r){const o=1-t;return 3*o*o*(s-e)+6*o*t*(i-s)+3*t*t*(r-i)}},{getPointAndSet:rs,toTwoPointBounds:os,ellipse:ns}=is,{sin:as,cos:hs,sqrt:ls,atan2:ds}=Math,{ellipse:cs}=is,us={ellipticalArc(t,e,s,i,r,o,n,a,h,l,d){const c=(h-e)/2,u=(l-s)/2,_=o*D,p=as(_),f=hs(_),y=-f*c-p*u,m=-f*u+p*c,x=i*i,w=r*r,v=m*m,b=y*y,B=x*w-x*v-w*b;let k=0;if(B<0){const t=ls(1-B/(x*w));i*=t,r*=t}else k=(n===a?-1:1)*ls(B/(x*v+w*b));const S=k*i*m/r,R=-k*r*y/i,C=ds((m-R)/r,(y-S)/i),T=ds((-m-R)/r,(-y-S)/i);let P=T-C;0===a&&P>0?P-=F:1===a&&P<0&&(P+=F);const L=e+c+f*S-p*R,I=s+u+p*S+f*R,E=P<0?1:0;d||g.ellipseToCurve?cs(t,L,I,i,r,o,C/D,T/D,E):i!==r||o?t.push(Le.G,L,I,i,r,o,C/D,T/D,E):t.push(Le.O,L,I,i,C/D,T/D,E)}},{M:_s,m:ps,L:fs,l:gs,H:ys,h:ms,V:xs,v:ws,C:vs,c:bs,S:Bs,s:ks,Q:Ss,q:Rs,T:Cs,t:Ts,A:Ps,a:Ls,Z:Is,z:Es,N:Os,D:As,X:Ms,G:Ws,F:Ds,O:Fs,P:Us,U:Ns}=Le,{rect:zs,roundRect:Ys,arcTo:Xs,arc:Hs,ellipse:Gs,quadraticCurveTo:js}=is,{ellipticalArc:Vs}=us,qs=Jt.get("PathConvert"),Qs={},Js={current:{dot:0},stringify(t,e){let s,i,r,o=0,n=t.length,a="";for(;o<n;){i=t[o],s=We[i],a+=i===r?" ":Me[i];for(let i=1;i<s;i++)a+=M.float(t[o+i],e),i===s-1||(a+=" ");r=i,o+=s}return a},parse(t,e){let s,i,r,o="";const n=[],a=e?Oe:Ee;for(let e=0,h=t.length;e<h;e++)i=t[e],qt[i]?("."===i&&($s.dot&&(Zs(n,o),o=""),$s.dot++),"0"===o&&"."!==i&&(Zs(n,o),o=""),o+=i):Le[i]?(o&&(Zs(n,o),o=""),$s.name=Le[i],$s.length=Ie[i],$s.index=0,Zs(n,$s.name),!s&&a[i]&&(s=!0)):"-"===i||"+"===i?"e"===r||"E"===r?o+=i:(o&&Zs(n,o),o=i):o&&(Zs(n,o),o=""),r=i;return o&&Zs(n,o),s?Js.toCanvasData(n,e):n},toCanvasData(t,e){let s,i,r,o,n,a=0,h=0,l=0,d=0,c=0,u=t.length;const _=[];for(;c<u;){switch(r=t[c],r){case ps:t[c+1]+=a,t[c+2]+=h;case _s:a=t[c+1],h=t[c+2],_.push(_s,a,h),c+=3;break;case ms:t[c+1]+=a;case ys:a=t[c+1],_.push(fs,a,h),c+=2;break;case ws:t[c+1]+=h;case xs:h=t[c+1],_.push(fs,a,h),c+=2;break;case gs:t[c+1]+=a,t[c+2]+=h;case fs:a=t[c+1],h=t[c+2],_.push(fs,a,h),c+=3;break;case ks:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Bs;case Bs:n=o===vs||o===Bs,l=n?2*a-s:t[c+1],d=n?2*h-i:t[c+2],s=t[c+1],i=t[c+2],a=t[c+3],h=t[c+4],_.push(vs,l,d,s,i,a,h),c+=5;break;case bs:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,t[c+5]+=a,t[c+6]+=h,r=vs;case vs:s=t[c+3],i=t[c+4],a=t[c+5],h=t[c+6],_.push(vs,t[c+1],t[c+2],s,i,a,h),c+=7;break;case Ts:t[c+1]+=a,t[c+2]+=h,r=Cs;case Cs:n=o===Ss||o===Cs,s=n?2*a-s:t[c+1],i=n?2*h-i:t[c+2],e?js(_,a,h,s,i,t[c+1],t[c+2]):_.push(Ss,s,i,t[c+1],t[c+2]),a=t[c+1],h=t[c+2],c+=3;break;case Rs:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Ss;case Ss:s=t[c+1],i=t[c+2],e?js(_,a,h,s,i,t[c+3],t[c+4]):_.push(Ss,s,i,t[c+3],t[c+4]),a=t[c+3],h=t[c+4],c+=5;break;case Ls:t[c+6]+=a,t[c+7]+=h;case Ps:Vs(_,a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],e),a=t[c+6],h=t[c+7],c+=8;break;case Es:case Is:_.push(Is),c++;break;case Os:a=t[c+1],h=t[c+2],e?zs(_,a,h,t[c+3],t[c+4]):Ks(_,t,c,5),c+=5;break;case As:a=t[c+1],h=t[c+2],e?Ys(_,a,h,t[c+3],t[c+4],[t[c+5],t[c+6],t[c+7],t[c+8]]):Ks(_,t,c,9),c+=9;break;case Ms:a=t[c+1],h=t[c+2],e?Ys(_,a,h,t[c+3],t[c+4],t[c+5]):Ks(_,t,c,6),c+=6;break;case Ws:Gs(e?_:Ks(_,t,c,9),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],t[c+8],null,Qs),a=Qs.x,h=Qs.y,c+=9;break;case Ds:e?Gs(_,t[c+1],t[c+2],t[c+3],t[c+4],0,0,360,!1):Ks(_,t,c,5),a=t[c+1]+t[c+3],h=t[c+2],c+=5;break;case Fs:Hs(e?_:Ks(_,t,c,7),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],null,Qs),a=Qs.x,h=Qs.y,c+=7;break;case Us:e?Hs(_,t[c+1],t[c+2],t[c+3],0,360,!1):Ks(_,t,c,4),a=t[c+1]+t[c+3],h=t[c+2],c+=4;break;case Ns:Xs(e?_:Ks(_,t,c,6),a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],null,Qs),a=Qs.x,h=Qs.y,c+=6;break;default:return qs.error(`command: ${r} [index:${c}]`,t),_}o=r}return _},objectToCanvasData(t){const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(_s,t.x,t.y);break;case"L":e.push(fs,t.x,t.y);break;case"C":e.push(vs,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Ss,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(Is)}}),e},copyData(t,e,s,i){for(let r=s,o=s+i;r<o;r++)t.push(e[r])},pushData(t,e){$s.index===$s.length&&($s.index=1,t.push($s.name)),t.push(Number(e)),$s.index++,$s.dot=0}},{current:$s,pushData:Zs,copyData:Ks}=Js,{M:ti,L:ei,C:si,Q:ii,Z:ri,N:oi,D:ni,X:ai,G:hi,F:li,O:di,P:ci,U:ui}=Le,{getMinDistanceFrom:_i,getRadianFrom:pi}=at,{tan:fi,min:gi,abs:yi}=Math,mi={},xi={beginPath(t){t.length=0},moveTo(t,e,s){t.push(ti,e,s)},lineTo(t,e,s){t.push(ei,e,s)},bezierCurveTo(t,e,s,i,r,o,n){t.push(si,e,s,i,r,o,n)},quadraticCurveTo(t,e,s,i,r){t.push(ii,e,s,i,r)},closePath(t){t.push(ri)},rect(t,e,s,i,r){t.push(oi,e,s,i,r)},roundRect(t,e,s,i,r,o){if(n(o))t.push(ai,e,s,i,r,o);else{const n=M.fourNumber(o);n?t.push(ni,e,s,i,r,...n):t.push(oi,e,s,i,r)}},ellipse(t,e,s,r,o,n,a,h,l){i(n)?t.push(li,e,s,r,o):(i(a)&&(a=0),i(h)&&(h=360),t.push(hi,e,s,r,o,n,a,h,l?1:0))},arc(t,e,s,r,o,n,a){i(o)?t.push(ci,e,s,r):(i(n)&&(n=360),t.push(di,e,s,r,o,n,a?1:0))},arcTo(t,e,i,r,o,n,a,h){if(!s(a)){const t=_i(a,h,e,i,r,o);n=gi(n,gi(t/2,t/2*yi(fi(pi(a,h,e,i,r,o)/2))))}t.push(ui,e,i,r,o,n)},drawEllipse(t,e,s,r,o,n,a,h,l){is.ellipse(null,e,s,r,o,i(n)?0:n,i(a)?0:a,i(h)?360:h,l,null,null,mi),t.push(ti,mi.x,mi.y),wi(t,e,s,r,o,n,a,h,l)},drawArc(t,e,s,r,o,n,a){is.arc(null,e,s,r,i(o)?0:o,i(n)?360:n,a,null,null,mi),t.push(ti,mi.x,mi.y),vi(t,e,s,r,o,n,a)},drawPoints(t,e,s,i){is.points(t,e,s,i)}},{ellipse:wi,arc:vi}=xi,{moveTo:bi,lineTo:Bi,quadraticCurveTo:ki,bezierCurveTo:Si,closePath:Ri,beginPath:Ci,rect:Ti,roundRect:Pi,ellipse:Li,arc:Ii,arcTo:Ei,drawEllipse:Oi,drawArc:Ai,drawPoints:Mi}=xi;class Wi{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?r(t)?Te.parse(t):t:[],this}beginPath(){return Ci(this.__path),this.paint(),this}moveTo(t,e){return bi(this.__path,t,e),this.paint(),this}lineTo(t,e){return Bi(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,i,r,o){return Si(this.__path,t,e,s,i,r,o),this.paint(),this}quadraticCurveTo(t,e,s,i){return ki(this.__path,t,e,s,i),this.paint(),this}closePath(){return Ri(this.__path),this.paint(),this}rect(t,e,s,i){return Ti(this.__path,t,e,s,i),this.paint(),this}roundRect(t,e,s,i,r){return Pi(this.__path,t,e,s,i,r),this.paint(),this}ellipse(t,e,s,i,r,o,n,a){return Li(this.__path,t,e,s,i,r,o,n,a),this.paint(),this}arc(t,e,s,i,r,o){return Ii(this.__path,t,e,s,i,r,o),this.paint(),this}arcTo(t,e,s,i,r){return Ei(this.__path,t,e,s,i,r),this.paint(),this}drawEllipse(t,e,s,i,r,o,n,a){return Oi(this.__path,t,e,s,i,r,o,n,a),this.paint(),this}drawArc(t,e,s,i,r,o){return Ai(this.__path,t,e,s,i,r,o),this.paint(),this}drawPoints(t,e,s){return Mi(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:Di,L:Fi,C:Ui,Q:Ni,Z:zi,N:Yi,D:Xi,X:Hi,G:Gi,F:ji,O:Vi,P:qi,U:Qi}=Le,Ji=Jt.get("PathDrawer"),$i={drawPathByData(t,e){if(!e)return;let s,i=0,r=e.length;for(;i<r;)switch(s=e[i],s){case Di:t.moveTo(e[i+1],e[i+2]),i+=3;break;case Fi:t.lineTo(e[i+1],e[i+2]),i+=3;break;case Ui:t.bezierCurveTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5],e[i+6]),i+=7;break;case Ni:t.quadraticCurveTo(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case zi:t.closePath(),i+=1;break;case Yi:t.rect(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Xi:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],[e[i+5],e[i+6],e[i+7],e[i+8]]),i+=9;break;case Hi:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;case Gi:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]*D,e[i+6]*D,e[i+7]*D,e[i+8]),i+=9;break;case ji:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],0,0,F,!1),i+=5;break;case Vi:t.arc(e[i+1],e[i+2],e[i+3],e[i+4]*D,e[i+5]*D,e[i+6]),i+=7;break;case qi:t.arc(e[i+1],e[i+2],e[i+3],0,F,!1),i+=4;break;case Qi:t.arcTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;default:return void Ji.error(`command: ${s} [index:${i}]`,e)}}},{M:Zi,L:Ki,C:tr,Q:er,Z:sr,N:ir,D:rr,X:or,G:nr,F:ar,O:hr,P:lr,U:dr}=Le,{toTwoPointBounds:cr,toTwoPointBoundsByQuadraticCurve:ur,arcTo:_r,arc:pr,ellipse:fr}=is,{addPointBounds:gr,copy:yr,addPoint:mr,setPoint:xr,addBounds:wr,toBounds:vr}=gt,br=Jt.get("PathBounds");let Br,kr,Sr;const Rr={},Cr={},Tr={},Pr={toBounds(t,e){Pr.toTwoPointBounds(t,Cr),vr(Cr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return xr(e,0,0);let s,i,r,o,n,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(n=t[a],0===a&&(n===sr||n===tr||n===er?xr(e,h,l):xr(e,t[a+1],t[a+2])),n){case Zi:case Ki:h=t[a+1],l=t[a+2],mr(e,h,l),a+=3;break;case tr:r=t[a+5],o=t[a+6],cr(h,l,t[a+1],t[a+2],t[a+3],t[a+4],r,o,Rr),gr(e,Rr),h=r,l=o,a+=7;break;case er:s=t[a+1],i=t[a+2],r=t[a+3],o=t[a+4],ur(h,l,s,i,r,o,Rr),gr(e,Rr),h=r,l=o,a+=5;break;case sr:a+=1;break;case ir:h=t[a+1],l=t[a+2],wr(e,h,l,t[a+3],t[a+4]),a+=5;break;case rr:case or:h=t[a+1],l=t[a+2],wr(e,h,l,t[a+3],t[a+4]),a+=n===rr?9:6;break;case nr:fr(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],Rr,Tr),0===a?yr(e,Rr):gr(e,Rr),h=Tr.x,l=Tr.y,a+=9;break;case ar:h=t[a+1],l=t[a+2],kr=t[a+3],Sr=t[a+4],wr(e,h-kr,l-Sr,2*kr,2*Sr),h+=kr,a+=5;break;case hr:pr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Rr,Tr),0===a?yr(e,Rr):gr(e,Rr),h=Tr.x,l=Tr.y,a+=7;break;case lr:h=t[a+1],l=t[a+2],Br=t[a+3],wr(e,h-Br,l-Br,2*Br,2*Br),h+=Br,a+=4;break;case dr:_r(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Rr,Tr),0===a?yr(e,Rr):gr(e,Rr),h=Tr.x,l=Tr.y,a+=6;break;default:return void br.error(`command: ${n} [index:${a}]`,t)}}},{M:Lr,L:Ir,Z:Er}=Le,{getCenterX:Or,getCenterY:Ar}=at,{arcTo:Mr}=xi,Wr={smooth(t,e,s){let i,r,o,n=0,a=0,h=0,l=0,d=0,c=0,u=0,_=0,p=0;const f=t.length,g=[];for(;n<f;){switch(i=t[n],i){case Lr:l=_=t[n+1],d=p=t[n+2],n+=3,t[n]===Ir?(c=t[n+1],u=t[n+2],g.push(Lr,Or(l,c),Ar(d,u))):g.push(Lr,l,d);break;case Ir:switch(a=t[n+1],h=t[n+2],n+=3,t[n]){case Ir:Mr(g,a,h,t[n+1],t[n+2],e,_,p);break;case Er:Mr(g,a,h,l,d,e,_,p);break;default:g.push(Ir,a,h)}_=a,p=h;break;case Er:r!==Er&&(Mr(g,l,d,c,u,e,_,p),g.push(Er)),n+=1;break;default:o=We[i];for(let e=0;e<o;e++)g.push(t[n+e]);n+=o}r=i}return i!==Er&&(g[1]=l,g[2]=d),g}};function Dr(t){return new Wi(t)}const Fr=Dr();Te.creator=Dr(),Te.parse=Js.parse,Te.convertToCanvasData=Js.toCanvasData;const{drawRoundRect:Ur}=De;function Nr(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,i,r){Ur(this,t,e,s,i,r)})}(t)}const zr={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mineType:t=>!t||t.startsWith("image")?t:("jpg"===t&&(t="jpeg"),"image/"+t),fileType(t){const e=t.split(".");return e[e.length-1]},isOpaqueImage(t){const e=Yr.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{}}}},Yr=zr;Yr.alphaPixelTypes.forEach(t=>Yr.upperCaseTypeMap[t]=t.toUpperCase());const Xr=Jt.get("TaskProcessor");class Hr{constructor(t){this.parallel=!0,this.time=1,this.id=m.create(m.TASK),this.task=t}run(){return _e(this,void 0,void 0,function*(){try{if(this.isComplete)return;if(this.canUse&&!this.canUse())return this.cancel();this.task&&this.parent.running&&(yield this.task())}catch(t){Xr.error(t)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}}class Gr{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,s=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(s+=this.list[i].time,i===this.finishedIndex&&(e=s)):e+=this.list[i].time;return this.isComplete?1:s/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&c.assign(this.config,t),this.empty()}add(t,e,i){let r,o,a,h;const l=new Hr(t);return l.parent=this,n(e)?h=e:e&&(o=e.parallel,r=e.start,a=e.time,h=e.delay,i||(i=e.canUse)),a&&(l.time=a),!1===o&&(l.parallel=!1),i&&(l.canUse=i),s(h)?this.push(l,r):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(l,r))},h)),this.isComplete=!1,l}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++,t.isCancel?this.runTask():this.nextTask()}).catch(t=>{this.onError(t)}):this.timer=setTimeout(()=>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;const{config:e,list:s,index:i}=this;this.parallelList=[],this.parallelSuccessNumber=0;let r=i+e.parallel;if(r>s.length&&(r=s.length),e.parallel>1)for(let e=i;e<r&&(t=s[e],t.parallel);e++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const s=e.length,i=this.finishedIndex+s;if(e.length){if(!this.running)return;i<this.total&&(t=this.list[i],t&&t.parallel&&(e.push(t),this.runParallelTask(t)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(t){t.complete(),this.config.onTask&&this.config.onTask()}onParallelError(t){this.parallelList.forEach(t=>{t.parallel=!1}),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(t)}onError(t){this.pause(),this.config.onError&&this.config.onError(t)}destroy(){this.stop()}}const jr=Jt.get("Resource"),Vr={tasker:new Gr,map:{},get isComplete(){return qr.tasker.isComplete},set(t,e){qr.map[t]&&jr.repeat(t),qr.map[t]=e},get:t=>qr.map[t],remove(t){const e=qr.map[t];e&&(e.destroy&&e.destroy(),delete qr.map[t])},loadImage(t,e){return new Promise((s,i)=>{const r=this.setImage(t,t,e);r.load(()=>s(r),t=>i(t))})},setImage(t,e,s){let i;return r(e)?i={url:e}:e.url||(i={url:t,view:e}),i&&(s&&(i.format=s),e=re.image(i)),qr.set(t,e),e},destroy(){qr.map={}}},qr=Vr,Qr={maxRecycled:10,recycledList:[],patternTasker:new Gr,get(t){let e=Vr.get(t.url);return e||Vr.set(t.url,e=re.image(t)),e.use++,e},recycle(t){t.use--,setTimeout(()=>{t.use||Jr.recycledList.push(t)})},clearRecycled(){const t=Jr.recycledList;t.length>Jr.maxRecycled&&(t.forEach(t=>!t.use&&t.url&&Vr.remove(t.url)),t.length=0)},hasAlphaPixel:t=>zr.alphaPixelTypes.some(e=>Jr.isFormat(e,t)),isFormat(t,e){if(e.format)return e.format===t;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+zr.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+zr.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){Jr.recycledList=[]}},Jr=Qr,{IMAGE:$r,create:Zr}=m;class Kr{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=Zr($r),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}Qr.isFormat("svg",t)&&(this.isSVG=!0),Qr.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e){if(!this.loading){this.loading=!0;const{crossOrigin:t}=this.config;Vr.tasker.add(()=>_e(this,void 0,void 0,function*(){return yield g.origin.loadImage(this.url,s(t)?g.image.crossOrigin:t,this).then(t=>this.setView(t)).catch(t=>{this.error=t,this.onComplete(!1)})}))}return this.waitComplete.push(t,e),this.waitComplete.length-2}unload(t,e){const s=this.waitComplete;if(e){const e=s[t+1];e&&e({type:"stop"})}s[t]=s[t+1]=void 0}setView(t){this.ready=!0,this.width=t.naturalWidth||t.width,this.height=t.naturalHeight||t.height,this.view=t,this.onComplete(!0)}onComplete(t){let e;this.waitComplete.forEach((s,i)=>{e=i%2,s&&(t?e||s(this):e&&s(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,e,s,i,r,o,n){if(t||(t=this.width),e||(e=this.height),this.cache){let{params:t,data:e}=this.cache;for(let s in t)if(t[s]!==arguments[s]){e=null;break}if(e)return e}const a=g.image.resize(this.view,t,e,r,o,void 0,n,s,i);return this.cache=this.use>1?{data:a,params:arguments}:null,a}getPattern(t,e,s,i){const r=g.canvas.createPattern(t,e);return g.image.setPatternTransform(r,s,i),r}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}}function to(t,e,s,i){i||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function eo(t,e){return Object.getOwnPropertyDescriptor(t,e)}function so(t,e){const s="_"+t;return{get(){const t=this[s];return null==t?e:t},set(t){this[s]=t}}}function io(t,e){return(s,i)=>oo(s,i,t,e&&e(i))}function ro(t){return t}function oo(t,e,s,i){const r={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};to(t,e,Object.assign(r,i||{})),Ao(t,e,s)}function no(t){return io(t)}function ao(t,e){return io(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function ho(t,e){return io(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function lo(t){return io(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),fo(this))}}))}function co(t,e){return io(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function uo(t,e){return io(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function _o(t,e){return io(t,t=>({set(s){this.__setAttr(t,s,e)&&fo(this)}}))}function po(t){return io(t,t=>({set(e){this.__setAttr(t,e)&&(fo(this),this.__.__removeNaturalSize())}}))}function fo(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function go(t){return io(t,t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),fo(this)}}))}const yo=_o;function mo(t,e){return io(t,t=>({set(s){this.__setAttr(t,s)&&(xo(this),e&&(this.__.__useStroke=!0))}}))}function xo(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&fo(t)}const wo=mo;function vo(t){return io(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function bo(t){return io(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function Bo(t){return io(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;c.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip),this.__layout.surfaceChange()}}}))}function ko(t){return io(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&Ro(this)}}))}function So(t){return io(t,t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>Co(this,t,e,s))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");Co(this,t,e,s),this.mask&&Ro(this)}}))}function Ro(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function Co(t,e,s,i){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==i&&0!==s||fo(t))}function To(t){return io(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChange(),this.waitParent(()=>{this.parent.__layout.childrenSortChange()}))}}))}function Po(t){return io(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}function Lo(t){return io(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}function Io(t){return io(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,"hit"===Jt.showBounds&&this.__layout.surfaceChange(),this.leafer&&this.leafer.updateCursor())}}))}function Eo(t){return io(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function Oo(t){return(e,s)=>{to(e,"__DataProcessor",{get:()=>t})}}function Ao(t,e,i){const r=t.__DataProcessor.prototype,o="_"+e,n=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=so(e,i);if(s(i))a.get=function(){return this[o]};else if("function"==typeof i)a.get=function(){const t=this[o];return null==t?i(this.__leaf):t};else if(l(i)){const t=d(i);a.get=function(){const e=this[o];return null==e?this[o]=t?{}:c.clone(i):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[o];if(null==t){const t=this,e=t.__naturalWidth,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&s.children.length?s.boxBounds.width:i}return t}:"height"===e&&(a.get=function(){const t=this[o];if(null==t){const t=this,e=t.__naturalHeight,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&s.children.length?s.boxBounds.height:i}return t});let u,_=r;for(;!u&&_;)u=eo(_,e),_=_.__proto__;u&&u.set&&(a.set=u.set),r[n]&&(a.set=r[n],delete r[n]),to(r,e,a)}const Mo=new Jt("rewrite"),Wo=[],Do=["destroy","constructor"];function Fo(t){return(e,s)=>{Wo.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function Uo(){return t=>{No()}}function No(t){Wo.length&&(Wo.forEach(e=>{t&&Mo.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),Wo.length=0)}function zo(t,e){return s=>{var i;(t.prototype?(i=t.prototype,Object.getOwnPropertyNames(i)):Object.keys(t)).forEach(i=>{if(!(Do.includes(i)||e&&e.includes(i)))if(t.prototype){eo(t.prototype,i).writable&&(s.prototype[i]=t.prototype[i])}else s.prototype[i]=t[i]})}}function Yo(){return t=>{ne.register(t)}}setTimeout(()=>No(!0));const{copy:Xo,toInnerPoint:Ho,toOuterPoint:Go,scaleOfOuter:jo,rotateOfOuter:Vo,skewOfOuter:qo,multiplyParent:Qo,divideParent:Jo,getLayout:$o}=J,Zo={},{round:Ko}=Math,tn={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),rn(t,e,s),t.isBranch){const{children:i}=t;for(let t=0,r=i.length;t<r;t++)sn(i[t],e,s)}},updateMatrix(t,e,s){const i=t.__layout;e?s&&(i.waitAutoLayout=!0,t.__hasAutoLayout&&(i.matrixChanged=!1)):i.waitAutoLayout&&(i.waitAutoLayout=!1),i.matrixChanged&&t.__updateLocalMatrix(),i.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)on(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&on(t),t.__updateChange()},updateAllChange(t){if(an(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)nn(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},draggable:t=>(t.draggable||t.editable)&&t.hitSelf&&!t.locked,copyCanvasByWorld(t,e,s,i,r,o){i||(i=t.__nowWorld),t.__worldFlipped||g.fullImageShadow?e.copyWorldByReset(s,i,t.__nowWorld,r,o):e.copyWorldToInner(s,i,t.__layout.renderBounds,r)},moveWorld(t,e,s=0,i,r){const o=l(e)?Object.assign({},e):{x:e,y:s};i?Go(t.localTransform,o,o,!0):t.parent&&Ho(t.parent.scrollWorldTransform,o,o,!0),en.moveLocal(t,o.x,o.y,r)},moveLocal(t,e,s=0,i){l(e)&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=Ko(e),s=Ko(s)),i?t.animate({x:e,y:s},i):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,i,r,o){en.zoomOfLocal(t,hn(t,e),s,i,r,o)},zoomOfLocal(t,e,s,i=s,r,o){const a=t.__localMatrix;if(n(i)||(i&&(o=i),i=s),Xo(Zo,a),jo(Zo,e,s,i),en.hasHighPosition(t))en.setTransform(t,Zo,r,o);else{const e=t.x+Zo.e-a.e,n=t.y+Zo.f-a.f;o&&!r?t.animate({x:e,y:n,scaleX:t.scaleX*s,scaleY:t.scaleY*i},o):(t.x=e,t.y=n,t.scaleResize(s,i,!0!==r))}},rotateOfWorld(t,e,s,i){en.rotateOfLocal(t,hn(t,e),s,i)},rotateOfLocal(t,e,s,i){const r=t.__localMatrix;Xo(Zo,r),Vo(Zo,e,s),en.hasHighPosition(t)?en.setTransform(t,Zo,!1,i):t.set({x:t.x+Zo.e-r.e,y:t.y+Zo.f-r.f,rotation:M.formatRotation(t.rotation+s)},i)},skewOfWorld(t,e,s,i,r,o){en.skewOfLocal(t,hn(t,e),s,i,r,o)},skewOfLocal(t,e,s,i=0,r,o){Xo(Zo,t.__localMatrix),qo(Zo,e,s,i),en.setTransform(t,Zo,r,o)},transformWorld(t,e,s,i){Xo(Zo,t.worldTransform),Qo(Zo,e),t.parent&&Jo(Zo,t.parent.scrollWorldTransform),en.setTransform(t,Zo,s,i)},transform(t,e,s,i){Xo(Zo,t.localTransform),Qo(Zo,e),en.setTransform(t,Zo,s,i)},setTransform(t,e,s,i){const r=t.__,o=r.origin&&en.getInnerOrigin(t,r.origin),n=$o(e,o,r.around&&en.getInnerOrigin(t,r.around));if(en.hasOffset(t)&&(n.x-=r.offsetX,n.y-=r.offsetY),s){const e=n.scaleX/t.scaleX,s=n.scaleY/t.scaleY;if(delete n.scaleX,delete n.scaleY,o){zt.scale(t.boxBounds,Math.abs(e),Math.abs(s));const i=en.getInnerOrigin(t,r.origin);at.move(n,o.x-i.x,o.y-i.y)}t.set(n),t.scaleResize(e,s,!1)}else t.set(n,i)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},i="x"===e?1:-1;return jo(s,en.getLocalOrigin(t,"center"),-1*i,1*i),s},getLocalOrigin:(t,e)=>at.tempToOuterOf(en.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return vt.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(Xo(Zo,t.worldTransform),Jo(Zo,e.scrollWorldTransform),s?Zo:Object.assign({},Zo)),drop(t,e,s,i){t.setTransform(en.getRelativeWorld(t,e,!0),i),e.add(t,s)},hasHighPosition:t=>t.origin||t.around||en.hasOffset(t),hasOffset:t=>t.offsetX||t.offsetY,hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},animateMove(t,e,s=.3){if(e.x||e.y)if(Math.abs(e.x)<1&&Math.abs(e.y)<1)t.move(e);else{const i=e.x*s,r=e.y*s;e.x-=i,e.y-=r,t.move(i,r),g.requestRender(()=>en.animateMove(t,e,s))}}},en=tn,{updateAllMatrix:sn,updateMatrix:rn,updateAllWorldOpacity:on,updateAllChange:nn,updateChange:an}=en;function hn(t,e){return t.updateLayout(),t.parent?at.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const ln={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localRenderBounds,maskLocalBoxBounds:(t,e)=>cn(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>cn(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds:(t,e)=>cn(t,e)&&t.__layout.localRenderBounds,excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};let dn;function cn(t,e){return e||(dn=0),t.__.mask&&(dn=1),dn<0?null:(dn&&(dn=-1),!0)}const{updateBounds:un}=tn,_n={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:s}=t;for(let i=0,r=s.length;i<r;i++)(t=s[i]).isBranch&&(t.__tempNumber=1,e.add(t),pn(t,e))}},pushAllParent(t,e){const{keys:i}=e;if(i)for(;t.parent&&s(i[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let s=e.length;const{children:i}=t;for(let t=0,s=i.length;t<s;t++)i[t].isBranch&&e.push(i[t]);for(let t=s,i=e.length;t<i;t++)fn(e[t],e)},updateBounds(t,e){const s=[t];fn(t,s),gn(s,e)},updateBoundsByBranchStack(t,e){let s,i;for(let r=t.length-1;r>-1;r--){s=t[r],i=s.children;for(let t=0,e=i.length;t<e;t++)un(i[t]);e&&e===s||un(s)}}},{pushAllChildBranch:pn,pushAllBranchStack:fn,updateBoundsByBranchStack:gn}=_n,yn={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:mn,updateBounds:xn}=tn,{toOuterOf:wn,getPoints:vn,copy:bn}=zt,Bn="_localContentBounds",kn="_worldContentBounds",Sn="_worldBoxBounds",Rn="_worldStrokeBounds";class Cn{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(t){this._renderBounds=t}get localContentBounds(){return wn(this.contentBounds,this.leaf.__localMatrix,this[Bn]||(this[Bn]={})),this[Bn]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return wn(this.contentBounds,this.leaf.__world,this[kn]||(this[kn]={})),this[kn]}get worldBoxBounds(){return wn(this.boxBounds,this.leaf.__world,this[Sn]||(this[Sn]={})),this[Sn]}get worldStrokeBounds(){return wn(this.strokeBounds,this.leaf.__world,this[Rn]||(this[Rn]={})),this[Rn]}get a(){return 1}get b(){return 0}get c(){return 0}get d(){return 1}get e(){return this.leaf.__.x}get f(){return this.leaf.__.y}get x(){return this.e+this.boxBounds.x}get y(){return this.f+this.boxBounds.y}get width(){return this.boxBounds.width}get height(){return this.boxBounds.height}constructor(t){this.leaf=t,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),t.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){const t=this.leaf.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0};this._localStrokeBounds||(this._localStrokeBounds=t),this._localRenderBounds||(this._localRenderBounds=t)}update(){const{leaf:t}=this,{leafer:e}=t;if(t.isApp)return xn(t);if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=t;for(;e.parent&&!e.parent.leafer;)e=e.parent;const s=e;if(s.__fullLayouting)return;s.__fullLayouting=!0,g.layout(s),delete s.__fullLayouting}}getTransform(t="world"){this.update();const{leaf:e}=this;switch(t){case"world":return e.__world;case"local":return e.__localMatrix;case"inner":return J.defaultMatrix;case"page":t=e.zoomLayer;default:return mn(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 Gt(this.getInnerBounds(t)).toOuterOf(this.getTransform(e))}}getInnerBounds(t="box"){switch(t){case"render":return this.renderBounds;case"content":if(this.contentBounds)return this.contentBounds;case"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",s){const{leaf:i}=this;let r,o,n,a=this.getInnerBounds(t);switch(e){case"world":r=i.getWorldPoint(a),o=i.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=i.__;n={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},r=i.getLocalPointByInner(a);break;case"inner":r=a,o=J.defaultMatrix;break;case"page":e=i.zoomLayer;default:r=i.getWorldPoint(a,e),o=mn(i,e,!0)}if(n||(n=J.getLayout(o)),bn(n,a),at.copy(n,r),s){const{scaleX:t,scaleY:e}=n,s=Math.abs(t),i=Math.abs(e);1===s&&1===i||(n.scaleX/=s,n.scaleY/=i,n.width*=s,n.height*=i)}return n}getLayoutPoints(t,e="world"){const{leaf:i}=this,r=vn(this.getInnerBounds(t));let o;switch(e){case"world":o=null;break;case"local":o=i.parent;break;case"inner":break;case"page":e=i.zoomLayer;default:o=e}return s(o)||r.forEach(t=>i.innerToWorld(t,null,!1,o)),r}shrinkContent(){const{x:t,y:e,width:s,height:i}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:i}}spreadStroke(){const{x:t,y:e,width:s,height:i}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:i},this._localStrokeBounds={x:t,y:e,width:s,height:i},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:i}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:i},this._localRenderBounds={x:t,y:e,width:s,height:i}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):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.boundsChanged||(this.boundsChanged=!0):this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0,this.surfaceChanged||this.surfaceChange()}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}}class Tn{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&g.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&g.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&g.event.stop(this.origin)}}class Pn extends Tn{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}Pn.ADD="child.add",Pn.REMOVE="child.remove",Pn.CREATED="created",Pn.MOUNTED="mounted",Pn.UNMOUNTED="unmounted",Pn.DESTROY="destroy";const Ln="property.scroll";class In extends Tn{constructor(t,e,s,i,r){super(t,e),this.attrName=s,this.oldValue=i,this.newValue=r}}In.CHANGE="property.change",In.LEAFER_CHANGE="property.leafer_change",In.SCROLL=Ln;const En={scrollX:Ln,scrollY:Ln};class On extends Tn{constructor(t,e){super(t),Object.assign(this,e)}}On.LOAD="image.load",On.LOADED="image.loaded",On.ERROR="image.error";class An extends Tn{static checkHas(t,e,s){"on"===s?e===Fn?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Mn)||t.hasEvent(Wn)||t.hasEvent(Dn),t.__hasWorldEvent=t.hasEvent(Fn))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Mn,t),"inner"===e&&t.emit(Wn,t)),t.emit(Dn,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Fn,this)}}An.RESIZE="bounds.resize",An.INNER="bounds.inner",An.LOCAL="bounds.local",An.WORLD="bounds.world";const{RESIZE:Mn,INNER:Wn,LOCAL:Dn,WORLD:Fn}=An,Un={};[Mn,Wn,Dn,Fn].forEach(t=>Un[t]=1);class Nn extends Tn{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){l(t)?(super(Nn.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!s(this.resizingKeys[t.innerId])}}Nn.RESIZE="resize";class zn extends Tn{constructor(t,e){super(t),this.data=e}}zn.REQUEST="watch.request",zn.DATA="watch.data";class Yn extends Tn{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}Yn.REQUEST="layout.request",Yn.START="layout.start",Yn.BEFORE="layout.before",Yn.LAYOUT="layout",Yn.AFTER="layout.after",Yn.AGAIN="layout.again",Yn.END="layout.end";class Xn extends Tn{constructor(t,e,s,i){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=i)}}Xn.REQUEST="render.request",Xn.CHILD_START="render.child_start",Xn.CHILD_END="render.child_end",Xn.START="render.start",Xn.BEFORE="render.before",Xn.RENDER="render",Xn.AFTER="render.after",Xn.AGAIN="render.again",Xn.END="render.end",Xn.NEXT="render.next";class Hn extends Tn{}Hn.START="leafer.start",Hn.BEFORE_READY="leafer.before_ready",Hn.READY="leafer.ready",Hn.AFTER_READY="leafer.after_ready",Hn.VIEW_READY="leafer.view_ready",Hn.VIEW_COMPLETED="leafer.view_completed",Hn.STOP="leafer.stop",Hn.RESTART="leafer.restart",Hn.END="leafer.end",Hn.UPDATE_MODE="leafer.update_mode",Hn.TRANSFORM="leafer.transform",Hn.MOVE="leafer.move",Hn.SCALE="leafer.scale",Hn.ROTATE="leafer.rotate",Hn.SKEW="leafer.skew";const{MOVE:Gn,SCALE:jn,ROTATE:Vn,SKEW:qn}=Hn,Qn={x:Gn,y:Gn,scaleX:jn,scaleY:jn,rotation:Vn,skewX:qn,skewY:qn},Jn={};class $n{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(h(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let s in t)h(e=t[s])?this.on(s,e[0],e[1]):this.on(s,e);return}let i,o,n;s&&("once"===s?o=!0:"boolean"==typeof s?i=s:(i=s.capture,o=s.once));const a=Zn(this,i,!0),l=r(t)?t.split(" "):t,d=o?{listener:e,once:o}:{listener:e};l.forEach(t=>{t&&(n=a[t],n?-1===n.findIndex(t=>t.listener===e)&&n.push(d):a[t]=[d],Un[t]&&An.checkHas(this,t,"on"))})}off(t,e,s){if(t){const i=r(t)?t.split(" "):t;if(e){let t,r,o;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const n=Zn(this,t);i.forEach(t=>{t&&(r=n[t],r&&(o=r.findIndex(t=>t.listener===e),o>-1&&r.splice(o,1),r.length||delete n[t],Un[t]&&An.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;i.forEach(s=>{t&&delete t[s],e&&delete e[s]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,s,i){return e?this.on(t,s?e=e.bind(s):e,i):h(t)&&t.forEach(t=>this.on(t[0],t[2]?t[1]=t[1].bind(t[2]):t[1],t[3])),{type:t,current:this,listener:e,options:i}}off_(t){if(!t)return;const e=h(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):h(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,s,i){if(!e)return h(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));l(s)?e=e.bind(s):i=s,this.on(t,e,{once:!0,capture:i})}emit(t,e,s){!e&&le.has(t)&&(e=le.get(t,{type:t,target:this,current:this}));const i=Zn(this,s)[t];if(i){let r;for(let o=0,n=i.length;o<n&&!((r=i[o])&&(r.listener(e),r.once&&(this.off(t,r.listener,s),o--,n--),e&&e.isStopNow));o++);}this.syncEventer&&this.syncEventer.emitEvent(e,s)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:i,__captureMap:r}=this,o=i&&i[t],n=r&&r[t];return!!(s(e)?o||n:e?n:o)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function Zn(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:Jn)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:Jn)}}const{on:Kn,on_:ta,off:ea,off_:sa,once:ia,emit:ra,emitEvent:oa,hasEvent:na,destroy:aa}=$n.prototype,ha={on:Kn,on_:ta,off:ea,off_:sa,once:ia,emit:ra,emitEvent:oa,hasEvent:na,destroyEventer:aa},la=Jt.get("setAttr"),da={__setAttr(t,e,i){if(this.leaferIsCreated){const r=this.__.__getInput(t);if(!i||o(e)||s(e)||(la.warn(this.innerName,t,e),e=void 0),l(e)||r!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new In(In.LEAFER_CHANGE,this,t,r,e));const s=Qn[t];s&&(this.emitEvent(new Hn(s,this)),this.emitEvent(new Hn(Hn.TRANSFORM,this)))}this.emitPropertyEvent(In.CHANGE,t,r,e);const s=En[t];return s&&this.emitPropertyEvent(s,t,r,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,s,i){const r=new In(t,this,e,s,i);this.isLeafer||this.hasEvent(t)&&this.emitEvent(r),this.leafer.emitEvent(r)},__realSetAttr(t,e){const i=this.__;i[t]=e,this.__proxyData&&this.setProxyAttr(t,e),i.normalStyle&&(this.lockNormalStyle||s(i.normalStyle[t])||(i.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:ca,multiplyParent:ua,translateInner:_a,defaultWorld:pa}=J,{toPoint:fa,tempPoint:ga}=vt,ya={__updateWorldMatrix(){const{parent:t,__layout:e,__world:s,__scrollWorld:i,__:r}=this;ua(this.__local||e,t?t.__scrollWorld||t.__world:pa,s,!!e.affectScaleOrRotation,r),i&&_a(Object.assign(i,s),r.scrollX,r.scrollY)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(ca(e,s,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=s.x+s.offsetX,e.f=s.y+s.offsetY,(s.around||s.origin)&&(fa(s.around||s.origin,t.boxBounds,ga),_a(e,-ga.x,-ga.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:ma,updateAllMatrix:xa}=tn,{updateBounds:wa}=_n,{toOuterOf:va,copyAndSpread:ba,copy:Ba}=zt,{toBounds:ka}=Pr,Sa={__updateWorldBounds(){const{__layout:t,__world:e}=this;va(t.renderBounds,e,e),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&An.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&An.emitWorld(this)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=void 0,(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized="inner"),t.renderChanged&&(t.renderSpread=this.__updateRenderSpread(),t.renderSpread?(t.renderBounds!==t.boxBounds&&t.renderBounds!==t.strokeBounds||t.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):t.spreadRenderCancel(),t.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),va(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){va(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){va(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const s=this.__layout.boxBounds,i=this.__;i.__usePathBox?ka(i.path,s):(s.x=0,s.y=0,s.width=i.width,s.height=i.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),xa(this),wa(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(xa(this),wa(this,this))):ma(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;ba(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:s}=e;n(s)&&s<=0?Ba(e.renderBounds,e.strokeBounds):ba(e.renderBounds,e.boxBounds,s)}},Ra={__render(t,e){if(e.shape)return this.__renderShape(t,e);if(this.__worldOpacity){const s=this.__;if(s.bright&&!e.topRendering)return e.topList.add(this);if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.dimOpacity&&!s.dimskip?s.opacity*e.dimOpacity:s.opacity,this.__.__single){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!0,!0);this.__draw(i,e,t),tn.copyCanvasByWorld(this,t,i,this.__nowWorld,s.__blendMode,!0),i.recycle(this.__nowWorld)}else this.__draw(t,e);Jt.showBounds&&Jt.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),t.clipUI(this))},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:Ca}=ln,Ta={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__nowWorld=this.__getNowWorld(e),this.__worldOpacity){const s=this.__;if(s.__useDim)if(s.dim)e.dimOpacity=!0===s.dim?.2:s.dim;else{if(s.bright&&!e.topRendering)return e.topList.add(this);s.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(s.__single&&!this.isBranchLeaf){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!1,!0);this.__renderBranch(i,e);const r=this.__nowWorld;t.opacity=e.dimOpacity?s.opacity*e.dimOpacity:s.opacity,t.copyWorldByReset(i,r,r,s.__blendMode,!0),i.recycle(r)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Ca(s[i],e)||s[i].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Ca(s[i],e)||s[i].__clip(t,e)}}},Pa={},{LEAF:La,create:Ia}=m,{stintSet:Ea}=c,{toInnerPoint:Oa,toOuterPoint:Aa,multiplyParent:Ma}=J,{toOuterOf:Wa}=zt,{copy:Da,move:Fa}=at,{moveLocal:Ua,zoomOfLocal:Na,rotateOfLocal:za,skewOfLocal:Ya,moveWorld:Xa,zoomOfWorld:Ha,rotateOfWorld:Ga,skewOfWorld:ja,transform:Va,transformWorld:qa,setTransform:Qa,getFlipTransform:Ja,getLocalOrigin:$a,getRelativeWorld:Za,drop:Ka}=tn;t.Leaf=class{get tag(){return this.__tag}set tag(t){}get __tag(){return"Leaf"}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return _}get __LayoutProcessor(){return Cn}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 scrollWorldTransform(){return this.updateLayout(),this.__scrollWorld||this.__world}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.updateLayout(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){return this.leaferIsCreated&&this.leafer.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=Ia(La),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(Pn.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),0!==t&&(this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0})),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(Pn.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(Pn.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(Pn.MOUNTED)):this.__emitLifeEvent(Pn.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,i=e.length;s<i;s++)e[s].__bindLeafer(t)}}set(t,e){}get(t){}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){s(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=s(e)?null:void 0,this[t]=e}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(t,e){}__updateContentBounds(){}__updateStrokeBounds(t){}__updateRenderBounds(t){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:s}=this.__layout;t.clearRect(s.x,s.y,s.width,s.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity)}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,s=this.__world;return Ma(s,t.matrix,e,void 0,s),Wa(this.__layout.renderBounds,e,e),Ea(e,"half",s.half),Ea(e,"ignorePixelSnap",s.ignorePixelSnap),e}return this.__world}getClampRenderScale(){let{scaleX:t}=this.__nowWorld||this.__world;return t<0&&(t=-t),t>1?t:1}getRenderScaleData(t,e){let{scaleX:s,scaleY:i}=Qr.patternLocked?this.__world:this.__nowWorld;return t&&(s<0&&(s=-s),i<0&&(i=-i)),(!0===e||"zoom-in"===e&&s>1&&i>1)&&(s=i=1),Pa.scaleX=s,Pa.scaleY=i,Pa}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,s){return this.__layout.getLayoutBounds(t,e,s)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,s){const i=e?Za(this,e):this.worldTransform,r=s?t:{};return Wa(t,i,r),r}worldToLocal(t,e,s,i){this.parent?this.parent.worldToInner(t,e,s,i):e&&Da(e,t)}localToWorld(t,e,s,i){this.parent?this.parent.innerToWorld(t,e,s,i):e&&Da(e,t)}worldToInner(t,e,s,i){i&&(i.innerToWorld(t,e,s),t=e||t),Oa(this.scrollWorldTransform,t,e,s)}innerToWorld(t,e,s,i){Aa(this.scrollWorldTransform,t,e,s),i&&i.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,i){return this.getBoxPointByInner(this.getInnerPoint(t,e,s,i),null,null,!0)}getBoxPointByInner(t,e,s,i){const r=i?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return Fa(r,-o,-n),r}getInnerPoint(t,e,s,i){const r=i?t:{};return this.worldToInner(t,r,s,e),r}getInnerPointByBox(t,e,s,i){const r=i?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return Fa(r,o,n),r}getInnerPointByLocal(t,e,s,i){return this.getInnerPoint(t,this.parent,s,i)}getLocalPoint(t,e,s,i){const r=i?t:{};return this.worldToLocal(t,r,s,e),r}getLocalPointByInner(t,e,s,i){return this.getWorldPoint(t,this.parent,s,i)}getPagePoint(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,i)}getWorldPoint(t,e,s,i){const r=i?t:{};return this.innerToWorld(t,r,s,e),r}getWorldPointByBox(t,e,s,i){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,i),e,s,!0)}getWorldPointByLocal(t,e,s,i){const r=i?t:{};return this.localToWorld(t,r,s,e),r}getWorldPointByPage(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,i)}setTransform(t,e,s){Qa(this,t,e,s)}transform(t,e,s){Va(this,t,e,s)}move(t,e,s){Ua(this,t,e,s)}moveInner(t,e,s){Xa(this,t,e,!0,s)}scaleOf(t,e,s,i,r){Na(this,$a(this,t),e,s,i,r)}rotateOf(t,e,s){za(this,$a(this,t),e,s)}skewOf(t,e,s,i,r){Ya(this,$a(this,t),e,s,i,r)}transformWorld(t,e,s){qa(this,t,e,s)}moveWorld(t,e,s){Xa(this,t,e,!1,s)}scaleOfWorld(t,e,s,i,r){Ha(this,t,e,s,i,r)}rotateOfWorld(t,e){Ga(this,t,e)}skewOfWorld(t,e,s,i,r){ja(this,t,e,s,i,r)}flip(t,e){Va(this,Ja(this,t),!1,e)}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}hit(t,e){return!0}__hitWorld(t){return!0}__hit(t){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e,s){}__clip(t,e){}__renderShape(t,e){}__drawShape(t,e){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}getMotionPathData(){return ie.need("path")}getMotionPoint(t){return ie.need("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){Ka(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,i){}off_(t){}once(t,e,s,i){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,s){s?this.addAttr(t,e,s):Ao(this.prototype,t,e)}static addAttr(t,e,s,i){s||(s=_o),s(e,i)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new Pn(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(Pn.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}},t.Leaf=ue([zo(da),zo(ya),zo(Sa),zo(ha),zo(Ra)],t.Leaf);const{setListWithFn:th}=zt,{sort:eh}=_n,{localBoxBounds:sh,localStrokeBounds:ih,localRenderBounds:rh,maskLocalBoxBounds:oh,maskLocalStrokeBounds:nh,maskLocalRenderBounds:ah}=ln,hh=new Jt("Branch");t.Branch=class extends t.Leaf{__updateStrokeSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.renderSpread)return 1;return 0}__updateBoxBounds(t,e){th(e||this.__layout.boxBounds,this.children,this.__hasMask?oh:sh)}__updateStrokeBounds(t){th(t||this.__layout.strokeBounds,this.children,this.__hasMask?nh:ih)}__updateRenderBounds(t){th(t||this.__layout.renderBounds,this.children,this.__hasMask?ah:rh)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,i=e.length;s<i;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(eh),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return hh.warn("add self or destroyed");const i=s(e);if(!t.__){if(h(t))return t.forEach(t=>{this.add(t,e),i||e++});t=ne.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,i?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(Pn.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Pn.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)):s(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(Pn.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Pn.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new Pn(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}},t.Branch=ue([zo(Ta)],t.Branch);class lh{get length(){return this.list.length}constructor(t){this.reset(),t&&(h(t)?this.addList(t):this.add(t))}has(t){return t&&!s(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return s(e)?-1:e}add(t){const{list:e,keys:i}=this;s(i[t.innerId])&&(e.push(t),i[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:i}=this;if(s(i[t.innerId])){const{list:s}=this;for(let t=e,r=s.length;t<r;t++)i[s[t].innerId]++;0===e?s.unshift(t):(e>s.length&&(e=s.length),s.splice(e,0,t)),i[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let i;for(let r=0,o=e.length;r<o;r++)s(i)?e[r].innerId===t.innerId&&(i=r,delete this.keys[t.innerId]):this.keys[e[r].innerId]=r-1;s(i)||e.splice(i,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 lh;return t.list=[...this.list],t.keys=Object.assign({},this.keys),t}update(){this.keys={};const{list:t,keys:e}=this;for(let s=0,i=t.length;s<i;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class dh{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(h(t)?this.addList(t):this.add(t))}has(t){return!s(this.keys[t.innerId])}without(t){return s(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:s}=this;e[t.innerId]||(e[t.innerId]=1,s[t.__level]?s[t.__level].push(t):(s[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(s=>{e=this.levelMap[s];for(let s=0,i=e.length;s<i;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}class ch extends Ce{get allowBackgroundColor(){return!0}init(){this.__createView(),this.__createContext(),this.resize(this.config)}__createView(){this.view=g.origin.createCanvas(1,1)}updateViewSize(){const{width:t,height:e,pixelRatio:s}=this;this.view.width=Math.ceil(t*s),this.view.height=Math.ceil(e*s),this.clientBounds=this.bounds}}Nr(OffscreenCanvasRenderingContext2D.prototype),Nr(Path2D.prototype);const{mineType:uh}=zr;function _h(t,e){g.origin={createCanvas:(t,e)=>new OffscreenCanvas(t,e),canvasToDataURL:(t,e,s)=>new Promise((i,r)=>{t.convertToBlob({type:uh(e),quality:s}).then(t=>{var e=new FileReader;e.onload=t=>i(t.target.result),e.onerror=t=>r(t),e.readAsDataURL(t)}).catch(t=>{r(t)})}),canvasToBolb:(t,e,s)=>t.convertToBlob({type:uh(e),quality:s}),canvasSaveAs:(t,e,s)=>new Promise(t=>t()),download(t,e){},loadImage:t=>new Promise((e,s)=>{let i=new XMLHttpRequest;i.open("GET",g.image.getRealURL(t),!0),i.responseType="blob",i.onload=()=>{createImageBitmap(i.response).then(t=>{e(t)}).catch(t=>{s(t)})},i.onerror=t=>s(t),i.send()})},g.canvas=re.canvas(),g.conicGradientSupport=!!g.canvas.context.createConicGradient}Object.assign(re,{canvas:(t,e)=>new ch(t,e),image:t=>new Kr(t)}),g.name="web",g.isWorker=!0,g.backgrounder=!0,g.requestRender=function(t){requestAnimationFrame(t)},to(g,"devicePixelRatio",{get:()=>1});const{userAgent:ph}=navigator;ph.indexOf("Firefox")>-1?(g.conicGradientRotate90=!0,g.intWheelDeltaY=!0):(/iPhone|iPad|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent))&&(g.fullImageShadow=!0),ph.indexOf("Windows")>-1?(g.os="Windows",g.intWheelDeltaY=!0):ph.indexOf("Mac")>-1?g.os="Mac":ph.indexOf("Linux")>-1&&(g.os="Linux");class fh{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove){const t=new lh;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new lh,this.target=t,e&&(this.config=c.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(Xn.REQUEST)}__onAttrChange(t){this.__updatedList.add(t.target),this.update()}__onChildEvent(t){t.type===Pn.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent)),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new zn(zn.DATA,{updatedList:this.updatedList})),this.__updatedList=new lh,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[In.CHANGE,this.__onAttrChange,this],[[Pn.ADD,Pn.REMOVE],this.__onChildEvent,this],[zn.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:gh,updateBounds:yh,updateChange:mh}=tn,{pushAllChildBranch:xh,pushAllParent:wh}=_n;const{worldBounds:vh}=ln;class bh{constructor(t){this.updatedBounds=new Gt,this.beforeBounds=new Gt,this.afterBounds=new Gt,h(t)&&(t=new lh(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,vh)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,vh),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}}const{updateAllMatrix:Bh,updateAllChange:kh}=tn,Sh=Jt.get("Layouter");class Rh{constructor(t,e){this.totalTimes=0,this.config={},this.__levelList=new dh,this.target=t,e&&(this.config=c.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(Yn.START),this.layoutOnce(),t.emitEvent(new Yn(Yn.END,this.layoutedBlocks,this.times))}catch(t){Sh.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?Sh.warn("layouting"):this.times>3?Sh.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(zn.REQUEST),this.totalTimes>1?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=te.start("PartLayout"),{target:s,__updatedList:i}=this,{BEFORE:r,LAYOUT:o,AFTER:n}=Yn,a=this.getBlocks(i);a.forEach(t=>t.setBefore()),s.emitEvent(new Yn(r,a,this.times)),this.extraBlock=null,i.sort(),function(t,e){let s;t.list.forEach(t=>{s=t.__layout,e.without(t)&&!s.proxyZoom&&(s.matrixChanged?(gh(t,!0),e.add(t),t.isBranch&&xh(t,e),wh(t,e)):s.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),wh(t,e)))})}(i,this.__levelList),function(t){let e,s,i;t.sort(!0),t.levels.forEach(r=>{e=t.levelMap[r];for(let t=0,r=e.length;t<r;t++){if(s=e[t],s.isBranch&&s.__tempNumber){i=s.children;for(let t=0,e=i.length;t<e;t++)i[t].isBranch||yh(i[t])}yh(s)}})}(this.__levelList),function(t){t.list.forEach(mh)}(i),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),s.emitEvent(new Yn(o,a,this.times)),s.emitEvent(new Yn(n,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,te.end(e)}fullLayout(){const t=te.start("FullLayout"),{target:e}=this,{BEFORE:s,LAYOUT:i,AFTER:r}=Yn,o=this.getBlocks(new lh(e));e.emitEvent(new Yn(s,o,this.times)),Rh.fullLayout(e),o.forEach(t=>{t.setAfter()}),e.emitEvent(new Yn(i,o,this.times)),e.emitEvent(new Yn(r,o,this.times)),this.addBlocks(o),te.end(t)}static fullLayout(t){Bh(t,!0),t.isBranch?_n.updateBounds(t):tn.updateBounds(t),kh(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:s}=this.extraBlock||(this.extraBlock=new bh([]));e.length?s.add(t.__world):s.set(t.__world),e.add(t)}}createBlock(t){return new bh(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){this.__eventIds=[this.target.on_([[Yn.REQUEST,this.layout,this],[Yn.AGAIN,this.layoutAgain,this],[zn.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const Ch=Jt.get("Renderer");class Th{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,s){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,maxFPS:120},this.frames=[],this.target=t,this.canvas=e,s&&(this.config=c.default(s,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.__requestRender()}requestLayout(){this.target.emit(Yn.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(Xn.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(Xn.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(Xn.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Gt,Ch.log(e.innerName,"---\x3e");try{this.emitRender(Xn.START),this.renderOnce(t),this.emitRender(Xn.END,this.totalBounds),Qr.clearRecycled()}catch(t){this.rendering=!1,Ch.error(t)}Ch.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return Ch.warn("rendering");if(this.times>3)return Ch.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Gt,this.renderOptions={},t)this.emitRender(Xn.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(Xn.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(Xn.RENDER,this.renderBounds,this.renderOptions),this.emitRender(Xn.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach(e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(t){const e=te.start("PartRender"),{canvas:s}=this,i=t.getIntersect(s.bounds),r=new Gt(i);s.save(),i.spread(Th.clipSpread).ceil(),s.clearWorld(i),s.clipWorld(i),this.__render(i,r),s.restore(),te.end(e)}fullRender(){const t=te.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),te.end(t)}__render(t,e){const{canvas:s}=this,i=t.includes(this.target.__world),r=i?{includes:i}:{bounds:t,includes:i};this.needFill&&s.fillWorld(t,this.config.fill),Jt.showRepaint&&Jt.drawRepaint(s,t),g.render(this.target,s,r),this.renderBounds=e=e||t,this.renderOptions=r,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),s.updateRender(e)}addBlock(t){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Gt;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=this.target;if(this.requestTime||!t)return;if(t.parentApp)return t.parentApp.requestRender(!1);this.requestTime=this.frameTime||Date.now();const e=()=>{const t=1e3/((this.frameTime=Date.now())-this.requestTime),{maxFPS:s}=this.config;if(s&&t>s)return g.requestRender(e);const{frames:i}=this;i.length>30&&i.shift(),i.push(t),this.FPS=Math.round(i.reduce((t,e)=>t+e,0)/i.length),this.requestTime=0,this.checkRender()};g.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:s}=t.old;if(!new Gt(0,0,e,s).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new Gt(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;t.updatedList&&t.updatedList.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||Ch.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds)})}emitRender(t,e,s){this.target.emitEvent(new Xn(t,this.times,e,s))}__listenEvents(){this.__eventIds=[this.target.on_([[Xn.REQUEST,this.update,this],[Yn.END,this.__onLayoutEnd,this],[Xn.AGAIN,this.renderAgain,this],[Nn.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}}function Ph(t){return io(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Lh(t){return io(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function Ih(){return(t,e)=>{const s="_"+e;to(t,e,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}Th.clipSpread=10,Object.assign(re,{watcher:(t,e)=>new fh(t,e),layouter:(t,e)=>new Rh(t,e),renderer:(t,e,s)=>new Th(t,e,s),selector:(t,e)=>{},interaction:(t,e,s,i)=>{}}),g.layout=Rh.fullLayout,g.render=function(t,e,s){const i=Object.assign(Object.assign({},s),{topRendering:!0});s.topList=new lh,t.__render(e,s),s.topList.length&&s.topList.forEach(t=>t.__render(e,i))};const Eh={},Oh={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},Ah={number:(t,e)=>l(t)?"percent"===t.type?t.value*e:t.value:t},Mh={},Wh={},Dh={},Fh={},Uh={},Nh={apply(){ie.need("filter")}},zh={},Yh={setStyleName:()=>ie.need("state"),set:()=>ie.need("state")},Xh={list:{},register(t,e){Xh.list[t]=e},get:t=>Xh.list[t]},{parse:Hh,objectToCanvasData:Gh}=Js,{stintSet:jh}=c,{hasTransparent:Vh}=Oh,qh={},Qh=Jt.get("UIData");class Jh extends _{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,Qh.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,Qh.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),r(t)||!t?(jh(this,"__isTransparentFill",Vh(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):l(t)&&this.__setPaint("fill",t)}setStroke(t){r(t)||!t?(jh(this,"__isTransparentStroke",Vh(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):l(t)&&this.__setPaint("stroke",t)}setPath(t){const e=r(t);e||t&&l(t[0])?(this.__setInput("path",t),this._path=e?Hh(t):Gh(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){$h(this,"shadow",t)}setInnerShadow(t){$h(this,"innerShadow",t)}setFilter(t){$h(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&Wh.compute("fill",this.__leaf),e&&Wh.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),s(t.strokeWidthFixed)||(i=t.strokeWidthFixed)),i){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const s=this.__leaf.__layout;s.boxChanged||s.boxChange(),h(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=qh)):(this.__isStrokes=!0,this._stroke||(this._stroke=qh))}__removePaint(t,e){e&&this.__removeInput(t),Dh.recycleImage(t,this),"fill"===t?(jh(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(jh(this,"__isAlphaPixelStroke",void 0),jh(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function $h(t,e,s){t.__setInput(e,s),h(s)?(s.some(t=>!1===t.visible)&&(s=s.filter(t=>!1!==t.visible)),s.length||(s=void 0)):s=s&&!1!==s.visible?[s]:void 0,t["_"+e]=s}class Zh extends Jh{}class Kh extends Zh{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"show"!==t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class tl extends Zh{__getInputData(t,e){const s=super.__getInputData(t,e);return Re.forEach(t=>delete s[t]),s}}class el extends Kh{}class sl extends Jh{get __usePathBox(){return this.points||this.__pathInputed}}class il extends Jh{get __boxStroke(){return!this.__pathInputed}}class rl extends Jh{get __boxStroke(){return!this.__pathInputed}}class ol extends sl{}class nl extends Jh{}class al extends Jh{get __pathInputed(){return 2}}class hl extends Zh{}const ll={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class dl extends Jh{get __useNaturalRatio(){return!1}setFontWeight(t){r(t)?(this.__setInput("fontWeight",t),t=ll[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,s=e.__box;if(t){const{boxStyle:i}=this;if(s)for(let t in i)s[t]=void 0;else s=e.__box=ne.get("Rect",0);const r=e.__layout,o=s.__layout;i||(s.parent=e,s.__world=e.__world,o.boxBounds=r.boxBounds),s.set(t),o.strokeChanged&&r.strokeChange()}else s&&(e.__box=s.parent=null,s.destroy());this._boxStyle=t}}class cl extends il{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:"image",mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return t.url&&delete t.fill,t}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url&&delete s.fill,s}}class ul extends il{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url=this.__leaf.canvas.toDataURL("image/png"),s}}const{max:_l,add:pl}=S,fl={__updateStrokeSpread(){let t=0,e=0;const s=this.__,{strokeAlign:i,__maxStrokeWidth:r}=s,o=this.__box;if((s.stroke||"all"===s.hitStroke)&&r&&"inside"!==i&&(e=t="center"===i?r/2:r,!s.__boxStroke)){const e=s.__isLinePath?0:10*t,i="none"===s.strokeCap?0:r;t+=Math.max(e,i)}return s.__useArrow&&(t+=5*r),o&&(t=_l(t,o.__layout.strokeSpread=o.__updateStrokeSpread()),e=Math.max(e,o.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:i,backgroundBlur:r,filter:o,renderSpread:n}=this.__,{strokeSpread:a}=this.__layout,h=this.__box;e&&(t=Uh.getShadowRenderSpread(this,e)),i&&(t=_l(t,i)),o&&(t=pl(t,Nh.getSpread(o))),n&&(t=pl(t,n)),a&&(t=pl(t,a));let l=t;return s&&(l=_l(l,Uh.getInnerShadowSpread(this,s))),r&&(l=_l(l,r)),this.__layout.renderShapeSpread=l,h?_l(h.__updateRenderSpread(),t):t}},{stintSet:gl}=c,yl={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);gl(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),gl(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:s,stroke:i}=t,r=t.innerShadow||t.blur||t.backgroundBlur||t.filter;gl(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&!Uh.isTransformShadow(e[0])&&s&&!t.__isTransparentFill&&!(h(s)&&s.length>1)&&(this.useFastShadow||!i||i&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),gl(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){ml(this,t,e)},__draw(t,e,s){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:r,stroke:o,__drawAfterFill:n,__fillAfterStroke:a,__isFastShadow:h}=i;if(this.__drawRenderPath(t),i.__useEffect&&!h){const h=Wh.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=i;l&&Uh.shadow(this,t,h),a&&(i.__isStrokes?Wh.strokes(o,this,t,e):Wh.stroke(o,this,t,e)),r&&(i.__isFills?Wh.fills(r,this,t,e):Wh.fill(r,this,t,e)),n&&this.__drawAfterFill(t,e),d&&Uh.innerShadow(this,t,h),o&&!a&&(i.__isStrokes?Wh.strokes(o,this,t,e):Wh.stroke(o,this,t,e)),c&&Nh.apply(c,this,this.__nowWorld,t,s,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(i.__isStrokes?Wh.strokes(o,this,t,e):Wh.stroke(o,this,t,e)),h){const e=i.shadow[0],{scaleX:s,scaleY:r}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*s,e.y*r,e.blur*s,Oh.string(e.color))}r&&(i.__isFills?Wh.fills(r,this,t,e):Wh.fill(r,this,t,e)),h&&t.restore(),n&&this.__drawAfterFill(t,e),o&&!a&&(i.__isStrokes?Wh.strokes(o,this,t,e):Wh.stroke(o,this,t,e))}}else i.__pathInputed?ml(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const s=this.__,{fill:i,stroke:r}=s;i&&!e.ignoreFill&&(s.__isAlphaPixelFill?Wh.fills(i,this,t,e):Wh.fill("#000000",this,t,e)),s.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(s.__isAlphaPixelStroke?Wh.strokes(r,this,t,e):Wh.stroke("#000000",this,t,e))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function ml(t,e,s){const{fill:i,stroke:r,__drawAfterFill:o,__fillAfterStroke:n}=t.__;t.__drawRenderPath(e),n&&Wh.stroke(r,t,e,s),i&&Wh.fill(i,t,e,s),o&&t.__drawAfterFill(e,s),r&&!n&&Wh.stroke(r,t,e,s)}const xl={__drawFast(t,e){let{x:s,y:i,width:r,height:o}=this.__layout.boxBounds;const{fill:n,stroke:a,__drawAfterFill:h}=this.__;if(n&&(t.fillStyle=n,t.fillRect(s,i,r,o)),h&&this.__drawAfterFill(t,e),a){const{strokeAlign:n,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(a,h,this.__);const l=h/2;switch(n){case"center":t.strokeRect(0,0,r,o);break;case"inside":r-=h,o-=h,r<0||o<0?(t.save(),this.__clip(t,e),t.strokeRect(s+l,i+l,r,o),t.restore()):t.strokeRect(s+l,i+l,r,o);break;case"outside":t.strokeRect(s-l,i-l,r+h,o+h)}}}};var wl,vl;t.UI=wl=class extends t.Leaf{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){M.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return Fr.set(this.path=t||[]),t||this.__drawPathByBox(Fr),Fr}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return r(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return ie.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return ie.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let s=e?this.__.__pathForRender:this.__.path;return s||(Fr.set(s=[]),this.__drawPathByBox(Fr)),t?Js.toCanvasData(s,!0):s}getPathString(t,e,s){return Js.stringify(this.getPath(t,e),s)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||zh.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?Wr.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&Mh.addArrows(this)):t.__pathForRender&&(t.__pathForRender=void 0)}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?$i.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:s,width:i,height:r}=this.__layout.boxBounds;if(this.__.cornerRadius){const{cornerRadius:o}=this.__;t.roundRect(e,s,i,r,n(o)?[o]:o)}else t.rect(e,s,i,r)}drawImagePlaceholder(t,e,s){Wh.fill(this.__.placeholderColor,this,e,s)}animate(t,e,s,i){return this.set(t),ie.need("animate")}killAnimate(t,e){}export(t,e){return ie.need("export")}syncExport(t,e){return ie.need("export")}clone(t){const e=c.clone(this.toJSON());return t&&Object.assign(e,t),wl.one(e)}static one(t,e,s,i,r){return ne.get(t.tag||this.prototype.__tag,t,e,s,i,r)}static registerUI(){Yo()(this)}static registerData(t){Oo(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}},ue([Oo(Jh)],t.UI.prototype,"__",void 0),ue([Ih()],t.UI.prototype,"zoomLayer",void 0),ue([no("")],t.UI.prototype,"id",void 0),ue([no("")],t.UI.prototype,"name",void 0),ue([no("")],t.UI.prototype,"className",void 0),ue([bo("pass-through")],t.UI.prototype,"blendMode",void 0),ue([ko(1)],t.UI.prototype,"opacity",void 0),ue([So(!0)],t.UI.prototype,"visible",void 0),ue([bo(!1)],t.UI.prototype,"locked",void 0),ue([Bo(!1)],t.UI.prototype,"dim",void 0),ue([Bo(!1)],t.UI.prototype,"dimskip",void 0),ue([To(0)],t.UI.prototype,"zIndex",void 0),ue([Po(!1)],t.UI.prototype,"mask",void 0),ue([Lo(!1)],t.UI.prototype,"eraser",void 0),ue([ao(0,!0)],t.UI.prototype,"x",void 0),ue([ao(0,!0)],t.UI.prototype,"y",void 0),ue([_o(100,!0)],t.UI.prototype,"width",void 0),ue([_o(100,!0)],t.UI.prototype,"height",void 0),ue([co(1,!0)],t.UI.prototype,"scaleX",void 0),ue([co(1,!0)],t.UI.prototype,"scaleY",void 0),ue([uo(0,!0)],t.UI.prototype,"rotation",void 0),ue([uo(0,!0)],t.UI.prototype,"skewX",void 0),ue([uo(0,!0)],t.UI.prototype,"skewY",void 0),ue([ao(0,!0)],t.UI.prototype,"offsetX",void 0),ue([ao(0,!0)],t.UI.prototype,"offsetY",void 0),ue([ho(0,!0)],t.UI.prototype,"scrollX",void 0),ue([ho(0,!0)],t.UI.prototype,"scrollY",void 0),ue([lo()],t.UI.prototype,"origin",void 0),ue([lo()],t.UI.prototype,"around",void 0),ue([no(!1)],t.UI.prototype,"lazy",void 0),ue([po(1)],t.UI.prototype,"pixelRatio",void 0),ue([vo(0)],t.UI.prototype,"renderSpread",void 0),ue([go()],t.UI.prototype,"path",void 0),ue([yo()],t.UI.prototype,"windingRule",void 0),ue([yo(!0)],t.UI.prototype,"closed",void 0),ue([_o(0)],t.UI.prototype,"padding",void 0),ue([_o(!1)],t.UI.prototype,"lockRatio",void 0),ue([_o()],t.UI.prototype,"widthRange",void 0),ue([_o()],t.UI.prototype,"heightRange",void 0),ue([no(!1)],t.UI.prototype,"draggable",void 0),ue([no()],t.UI.prototype,"dragBounds",void 0),ue([no("auto")],t.UI.prototype,"dragBoundsType",void 0),ue([no(!1)],t.UI.prototype,"editable",void 0),ue([Io(!0)],t.UI.prototype,"hittable",void 0),ue([Io("path")],t.UI.prototype,"hitFill",void 0),ue([wo("path")],t.UI.prototype,"hitStroke",void 0),ue([Io(!1)],t.UI.prototype,"hitBox",void 0),ue([Io(!0)],t.UI.prototype,"hitChildren",void 0),ue([Io(!0)],t.UI.prototype,"hitSelf",void 0),ue([Io()],t.UI.prototype,"hitRadius",void 0),ue([Eo("")],t.UI.prototype,"cursor",void 0),ue([bo()],t.UI.prototype,"fill",void 0),ue([wo(void 0,!0)],t.UI.prototype,"stroke",void 0),ue([wo("inside")],t.UI.prototype,"strokeAlign",void 0),ue([wo(1,!0)],t.UI.prototype,"strokeWidth",void 0),ue([wo(!1)],t.UI.prototype,"strokeWidthFixed",void 0),ue([wo("none")],t.UI.prototype,"strokeCap",void 0),ue([wo("miter")],t.UI.prototype,"strokeJoin",void 0),ue([wo()],t.UI.prototype,"dashPattern",void 0),ue([wo(0)],t.UI.prototype,"dashOffset",void 0),ue([wo(10)],t.UI.prototype,"miterLimit",void 0),ue([yo(0)],t.UI.prototype,"cornerRadius",void 0),ue([yo()],t.UI.prototype,"cornerSmoothing",void 0),ue([Ph()],t.UI.prototype,"shadow",void 0),ue([Ph()],t.UI.prototype,"innerShadow",void 0),ue([Ph()],t.UI.prototype,"blur",void 0),ue([Ph()],t.UI.prototype,"backgroundBlur",void 0),ue([Ph()],t.UI.prototype,"grayscale",void 0),ue([Ph()],t.UI.prototype,"filter",void 0),ue([bo()],t.UI.prototype,"placeholderColor",void 0),ue([no(100)],t.UI.prototype,"placeholderDelay",void 0),ue([no({})],t.UI.prototype,"data",void 0),ue([Fo(t.Leaf.prototype.reset)],t.UI.prototype,"reset",null),t.UI=wl=ue([zo(fl),zo(yl),Uo()],t.UI),t.Group=class extends t.UI{get __tag(){return"Group"}get isBranch(){return!0}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:s}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),s.forEach(t=>this.add(t)),t.children=s}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);return this.childlessJSON||(e.children=this.children.map(e=>e.toJSON(t))),e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}},ue([Oo(Zh)],t.Group.prototype,"__",void 0),ue([_o(0)],t.Group.prototype,"width",void 0),ue([_o(0)],t.Group.prototype,"height",void 0),t.Group=ue([zo(t.Branch),Yo()],t.Group);const bl=Jt.get("Leafer");t.Leafer=vl=class extends t.Group{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&Vr.isComplete}get layoutLocked(){return!this.layouter.running}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||{x:0,y:0,width:0,height:0}}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),vl.list.add(this)}init(t,e){if(this.canvas)return;let s;const{config:i}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),s=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,c.assign(i,t));const r=this.canvas=re.canvas(i);this.__controllers.push(this.renderer=re.renderer(this,r,i),this.watcher=re.watcher(this,i),this.layouter=re.layouter(this,i)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),this.view=r.view,e||(this.selector=re.selector(this),this.interaction=re.interaction(this,r,this.selector,i),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=re.hitCanvasManager()),this.canvasManager=new ce,s=i.start),this.hittable=i.hittable,this.fill=i.fill,this.canvasManager.add(r),this.__listenEvents(),s&&(this.__startTimer=setTimeout(this.start.bind(this))),yn.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(Hn.RESTART):this.emitLeafer(Hn.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(Hn.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=c.copyAttrs({},t,Re);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:s}=this;s&&(s.addBlock(t?new Gt(t):this.canvas.bounds),this.viewReady&&(e?s.render():s.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const s=c.copyAttrs({},this.canvas,Re);e.resize(t),this.updateLazyBounds(),this.__onResize(new Nn(t,s))}__onResize(t){this.emitEvent(t),c.copyAttrs(this.__,t,Re),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(){const{config:t,parentApp:e}=this;e||(t.width&&t.height||(this.autoLayout=new Vt(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Re.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t?(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren())):"mode"===t&&this.emit(Hn.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Re.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:s,canvas:i}=this,r=c.copyAttrs({},i,Re);r[t]=s[t]=e,s.width&&s.height?i.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(r)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(Hn.BEFORE_READY),this.emitLeafer(Hn.READY),this.emitLeafer(Hn.AFTER_READY),yn.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(Hn.VIEW_READY),yn.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:s}=this.config;if(t){let{width:i,height:r,pixelRatio:o}=this;const n="box"===t?this.worldBoxBounds:this.__world;e||(i=Math.max(1,n.x+n.width)),s||(r=Math.max(1,n.y+n.height)),this.__doResize({width:i,height:r,pixelRatio:o})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){yn.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(Hn.VIEW_COMPLETED),yn.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,s){e&&(t=t.bind(e));const i=this.__nextRenderWait;if(s){for(let e=0;e<i.length;e++)if(i[e]===t){i.splice(e,1);break}}else i.push(t);this.requestRender()}zoom(t,e,s,i){return ie.need("view")}getValidMove(t,e,s){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:s}=this.clientBounds;return{x:e+t.x,y:s+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new Hn(t,this))}__listenEvents(){const t=te.start("FirstCreate "+this.innerName);this.once([[Hn.START,()=>te.end(t)],[Yn.START,this.updateLazyBounds,this],[Xn.START,this.__onCreated,this],[Xn.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[zn.DATA,this.__onWatchData,this],[Yn.END,this.__onLayoutEnd,this],[Xn.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){vl.list.remove(this);try{this.stop(),this.emitLeafer(Hn.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager&&this.canvasManager.destroy()),this.canvas&&this.canvas.destroy(),this.config.view=this.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{Qr.clearRecycled()},100)}catch(t){bl.error(t)}}};t?e():setTimeout(e)}},t.Leafer.list=new lh,ue([Oo(tl)],t.Leafer.prototype,"__",void 0),ue([_o()],t.Leafer.prototype,"pixelRatio",void 0),ue([no("normal")],t.Leafer.prototype,"mode",void 0),t.Leafer=vl=ue([Yo()],t.Leafer),t.Rect=class extends t.UI{get __tag(){return"Rect"}},ue([Oo(il)],t.Rect.prototype,"__",void 0),t.Rect=ue([zo(xl),Uo(),Yo()],t.Rect);const{add:Bl,includes:kl,scroll:Sl}=zt,Rl=t.Rect.prototype,Cl=t.Group.prototype;t.Box=class extends t.Group{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.pathInputed){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t,e;if(this.children.length){const s=this.__,i=this.__layout,{renderBounds:r,boxBounds:o}=i,{overflow:n}=s,a=i.childrenRenderBounds||(i.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=n.includes("scroll"))&&(Bl(a,o),Sl(a,s)),this.__updateRectRenderBounds(),t=!kl(o,a),t&&"show"===n&&Bl(r,a)}else this.__updateRectRenderBounds();c.stintSet(this,"isOverflow",t),this.__checkScroll(e)}__updateRectRenderBounds(){}__checkScroll(t){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.hasScroller&&this.scroller.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}},ue([Oo(Kh)],t.Box.prototype,"__",void 0),ue([_o(100)],t.Box.prototype,"width",void 0),ue([_o(100)],t.Box.prototype,"height",void 0),ue([no(!1)],t.Box.prototype,"resizeChildren",void 0),ue([vo("show")],t.Box.prototype,"overflow",void 0),ue([Fo(Rl.__updateStrokeSpread)],t.Box.prototype,"__updateStrokeSpread",null),ue([Fo(Rl.__updateRenderSpread)],t.Box.prototype,"__updateRectRenderSpread",null),ue([Fo(Rl.__updateBoxBounds)],t.Box.prototype,"__updateRectBoxBounds",null),ue([Fo(Rl.__updateStrokeBounds)],t.Box.prototype,"__updateStrokeBounds",null),ue([Fo(Rl.__updateRenderBounds)],t.Box.prototype,"__updateRectRenderBounds",null),ue([Fo(Rl.__updateChange)],t.Box.prototype,"__updateRectChange",null),ue([Fo(Rl.__render)],t.Box.prototype,"__renderRect",null),ue([Fo(Cl.__render)],t.Box.prototype,"__renderGroup",null),t.Box=ue([Uo(),Yo()],t.Box),t.Frame=class extends t.Box{get __tag(){return"Frame"}get isFrame(){return!0}},ue([Oo(el)],t.Frame.prototype,"__",void 0),ue([bo("#FFFFFF")],t.Frame.prototype,"fill",void 0),ue([vo("hide")],t.Frame.prototype,"overflow",void 0),t.Frame=ue([Yo()],t.Frame);const{moveTo:Tl,closePath:Pl,ellipse:Ll}=xi;t.Ellipse=class extends t.UI{get __tag(){return"Ellipse"}__updatePath(){const{width:t,height:e,innerRadius:s,startAngle:i,endAngle:r}=this.__,o=t/2,n=e/2,a=this.__.path=[];s?(i||r?(s<1&&Ll(a,o,n,o*s,n*s,0,i,r,!1),Ll(a,o,n,o,n,0,r,i,!0),s<1&&Pl(a)):(s<1&&(Ll(a,o,n,o*s,n*s),Tl(a,t,n)),Ll(a,o,n,o,n,0,360,0,!0)),g.ellipseToCurve&&(this.__.path=this.getPath(!0))):i||r?(Tl(a,o,n),Ll(a,o,n,o,n,0,i,r,!1),Pl(a)):Ll(a,o,n,o,n)}},ue([Oo(rl)],t.Ellipse.prototype,"__",void 0),ue([yo(0)],t.Ellipse.prototype,"innerRadius",void 0),ue([yo(0)],t.Ellipse.prototype,"startAngle",void 0),ue([yo(0)],t.Ellipse.prototype,"endAngle",void 0),t.Ellipse=ue([Yo()],t.Ellipse);const{sin:Il,cos:El,PI:Ol}=Math,{moveTo:Al,lineTo:Ml,closePath:Wl,drawPoints:Dl}=xi;t.Polygon=class extends t.UI{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)Dl(e,t.points,t.curve,!0);else{const{width:s,height:i,sides:r}=t,o=s/2,n=i/2;Al(e,o,0);for(let t=1;t<r;t++)Ml(e,o+o*Il(2*t*Ol/r),n-n*El(2*t*Ol/r));Wl(e)}}},ue([Oo(ol)],t.Polygon.prototype,"__",void 0),ue([yo(3)],t.Polygon.prototype,"sides",void 0),ue([yo()],t.Polygon.prototype,"points",void 0),ue([yo(0)],t.Polygon.prototype,"curve",void 0),t.Polygon=ue([Uo(),Yo()],t.Polygon);const{sin:Fl,cos:Ul,PI:Nl}=Math,{moveTo:zl,lineTo:Yl,closePath:Xl}=xi;t.Star=class extends t.UI{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:s,innerRadius:i}=this.__,r=t/2,o=e/2,n=this.__.path=[];zl(n,r,0);for(let t=1;t<2*s;t++)Yl(n,r+(t%2==0?r:r*i)*Fl(t*Nl/s),o-(t%2==0?o:o*i)*Ul(t*Nl/s));Xl(n)}},ue([Oo(nl)],t.Star.prototype,"__",void 0),ue([yo(5)],t.Star.prototype,"corners",void 0),ue([yo(.382)],t.Star.prototype,"innerRadius",void 0),t.Star=ue([Yo()],t.Star);const{moveTo:Hl,lineTo:Gl,drawPoints:jl}=xi,{rotate:Vl,getAngle:ql,getDistance:Ql,defaultPoint:Jl}=at;t.Line=class extends t.UI{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,s={x:0,y:0};return t&&(s.x=t),e&&Vl(s,e),s}set toPoint(t){this.width=Ql(Jl,t),this.rotation=ql(Jl,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?jl(e,t.points,t.curve,t.closed):(Hl(e,0,0),Gl(e,this.width,0))}},ue([Oo(sl)],t.Line.prototype,"__",void 0),ue([mo("center")],t.Line.prototype,"strokeAlign",void 0),ue([_o(0)],t.Line.prototype,"height",void 0),ue([yo()],t.Line.prototype,"points",void 0),ue([yo(0)],t.Line.prototype,"curve",void 0),ue([yo(!1)],t.Line.prototype,"closed",void 0),t.Line=ue([Yo()],t.Line),t.Image=class extends t.Rect{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return h(t)&&t[0].image}},ue([Oo(cl)],t.Image.prototype,"__",void 0),ue([_o("")],t.Image.prototype,"url",void 0),t.Image=ue([Yo()],t.Image);const $l=t.Image;t.Canvas=class extends t.Rect{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=re.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new Kr({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new On(On.LOADED,{image:t}))})}draw(t,e,s,i){const r=new pt(t.worldTransform).invert(),o=new pt;e&&o.translate(e.x,e.y),s&&(n(s)?o.scale(s):o.scale(s.x,s.y)),i&&o.rotate(i),r.multiplyParent(o),t.__render(this.canvas,{matrix:r.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:s,height:i}=this.__,{view:r}=this.canvas;t.drawImage(r,0,0,r.width,r.height,0,0,s,i)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:s}=this.__;t.resize(this.__,s),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}},ue([Oo(ul)],t.Canvas.prototype,"__",void 0),ue([Lh(100)],t.Canvas.prototype,"width",void 0),ue([Lh(100)],t.Canvas.prototype,"height",void 0),ue([Lh(1)],t.Canvas.prototype,"pixelRatio",void 0),ue([Lh(!0)],t.Canvas.prototype,"smooth",void 0),ue([no(!1)],t.Canvas.prototype,"safeResize",void 0),ue([Lh()],t.Canvas.prototype,"contextSettings",void 0),t.Canvas=ue([Yo()],t.Canvas);const{copyAndSpread:Zl,includes:Kl,spread:td,setList:ed}=zt,{stintSet:sd}=c;function id(t,e,s){t.__.__font?Wh.fillText(t,e,s):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function rd(t,e,s,i,r){const o=s.__;l(t)?Wh.drawStrokesStyle(t,e,!1,s,i,r):(i.setStroke(t,o.__strokeWidth*e,o),i.stroke()),o.__useArrow&&Wh.strokeArrow(t,s,i,r)}function od(t,e,s,i,r){const o=s.__;l(t)?Wh.drawStrokesStyle(t,e,!0,s,i,r):(i.setStroke(t,o.__strokeWidth*e,o),Wh.drawTextStroke(s,i,r))}function nd(t,e,s,i,r){const o=i.getSameCanvas(!0,!0);o.font=s.__.__font,od(t,2,s,o,r),o.blendMode="outside"===e?"destination-out":"destination-in",Wh.fillText(s,o,r),o.blendMode="normal",tn.copyCanvasByWorld(s,i,o),o.recycle(s.__nowWorld)}t.Text=class extends t.UI{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:s,fontFamily:i,fontSize:r,fontWeight:o,italic:n,textCase:a,textOverflow:h,padding:l,width:d,height:c}=t;t.__lineHeight=Ah.number(e,r),t.__letterSpacing=Ah.number(s,r),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${n?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==o?o+" ":""}${r||12}px ${i||"caption"}`,sd(t,"__padding",l&&M.fourNumber(l)),sd(t,"__clipText","show"!==h&&!t.__autoSize),sd(t,"__isCharMode",d||c||t.__letterSpacing||"none"!==a),t.__textDrawData=Eh.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:s,italic:i,padding:r,__autoWidth:o,__autoHeight:n}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<s&&td(a,s/2),o||n){if(h.x=o?a.x:0,h.y=n?a.y:0,h.width=o?a.width:t.width,h.height=n?a.height:t.height,r){const[e,s,i,r]=t.__padding;o&&(h.x-=r,h.width+=s+r),n&&(h.y-=e,h.height+=i+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();i&&(h.width+=.16*s),c.stintSet(this,"isOverflow",!Kl(h,a)),this.isOverflow?(ed(t.__textBoxBounds={},[h,a]),e.renderChanged=!0):t.__textBoxBounds=h}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;Zl(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__updateChange(){super.__updateChange();const t=this.__box;t&&(t.__onUpdateSize(),t.__updateChange())}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,s){const i=this.__box;i&&(i.__nowWorld=this.__nowWorld,i.__draw(t,e,s)),this.textEditing&&!e.exporting||super.__draw(t,e,s)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}},ue([Oo(dl)],t.Text.prototype,"__",void 0),ue([_o(0)],t.Text.prototype,"width",void 0),ue([_o(0)],t.Text.prototype,"height",void 0),ue([bo()],t.Text.prototype,"boxStyle",void 0),ue([no(!1)],t.Text.prototype,"resizeFontSize",void 0),ue([bo("#000000")],t.Text.prototype,"fill",void 0),ue([mo("outside")],t.Text.prototype,"strokeAlign",void 0),ue([Io("all")],t.Text.prototype,"hitFill",void 0),ue([_o("")],t.Text.prototype,"text",void 0),ue([_o("")],t.Text.prototype,"placeholder",void 0),ue([_o("caption")],t.Text.prototype,"fontFamily",void 0),ue([_o(12)],t.Text.prototype,"fontSize",void 0),ue([_o("normal")],t.Text.prototype,"fontWeight",void 0),ue([_o(!1)],t.Text.prototype,"italic",void 0),ue([_o("none")],t.Text.prototype,"textCase",void 0),ue([_o("none")],t.Text.prototype,"textDecoration",void 0),ue([_o(0)],t.Text.prototype,"letterSpacing",void 0),ue([_o({type:"percent",value:1.5})],t.Text.prototype,"lineHeight",void 0),ue([_o(0)],t.Text.prototype,"paraIndent",void 0),ue([_o(0)],t.Text.prototype,"paraSpacing",void 0),ue([_o("x")],t.Text.prototype,"writingMode",void 0),ue([_o("left")],t.Text.prototype,"textAlign",void 0),ue([_o("top")],t.Text.prototype,"verticalAlign",void 0),ue([_o(!0)],t.Text.prototype,"autoSizeAlign",void 0),ue([_o("normal")],t.Text.prototype,"textWrap",void 0),ue([_o("show")],t.Text.prototype,"textOverflow",void 0),ue([bo(!1)],t.Text.prototype,"textEditing",void 0),t.Text=ue([Yo()],t.Text),t.Path=class extends t.UI{get __tag(){return"Path"}},ue([Oo(al)],t.Path.prototype,"__",void 0),ue([mo("center")],t.Path.prototype,"strokeAlign",void 0),t.Path=ue([Yo()],t.Path),t.Pen=class extends t.Group{get __tag(){return"Pen"}setStyle(e){const s=this.pathElement=new t.Path(e);return this.pathStyle=e,this.__path=s.path||(s.path=[]),this.add(s),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,s,i,r,o){return this}quadraticCurveTo(t,e,s,i){return this}closePath(){return this}rect(t,e,s,i){return this}roundRect(t,e,s,i,r){return this}ellipse(t,e,s,i,r,o,n,a){return this}arc(t,e,s,i,r,o){return this}arcTo(t,e,s,i,r){return this}drawEllipse(t,e,s,i,r,o,n,a){return this}drawArc(t,e,s,i,r,o){return this}drawPoints(t,e,s){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}},ue([Oo(hl)],t.Pen.prototype,"__",void 0),ue([(t,e)=>{to(t,e,{get(){return this.__path}})}],t.Pen.prototype,"path",void 0),t.Pen=ue([zo(Wi,["set","path","paint"]),Yo()],t.Pen);const{getSpread:ad,copyAndSpread:hd,toOuterOf:ld,getOuterOf:dd,getByMove:cd,move:ud,getIntersectData:_d}=zt,pd={};let fd;const{stintSet:gd}=c,{hasTransparent:yd}=Oh;function md(t,e,i){if(!l(e)||!1===e.visible||0===e.opacity)return;let o;const{boxBounds:n}=i.__layout;switch(e.type){case"image":o=Dh.image(i,t,e,n,!fd||!fd[e.url]);break;case"linear":o=Fh.linearGradient(e,n);break;case"radial":o=Fh.radialGradient(e,n);break;case"angular":o=Fh.conicGradient(e,n);break;case"solid":const{type:r,color:a,opacity:h}=e;o={type:r,style:Oh.string(a,h)};break;default:s(e.r)||(o={type:"solid",style:Oh.string(e)})}if(o&&(o.originPaint=e,r(o.style)&&yd(o.style)&&(o.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;o.strokeStyle=e.style}return o}const xd={compute:function(t,e){const s=e.__,i=[];let r,o,n,a=s.__input[t];h(a)||(a=[a]),fd=Dh.recycleImage(t,s);for(let s,r=0,o=a.length;r<o;r++)(s=md(t,a[r],e))&&(i.push(s),s.strokeStyle&&(n||(n=1),s.strokeStyle.strokeWidth&&(n=Math.max(n,s.strokeStyle.strokeWidth))));s["_"+t]=i.length?i:void 0,i.length?(i.every(t=>t.isTransparent)&&(i.some(t=>t.image)&&(r=!0),o=!0),"fill"===t?(gd(s,"__isAlphaPixelFill",r),gd(s,"__isTransparentFill",o)):(gd(s,"__isAlphaPixelStroke",r),gd(s,"__isTransparentStroke",o),gd(s,"__hasMultiStrokeStyle",n))):s.__removePaint(t,!1)},fill:function(t,e,s,i){s.fillStyle=t,id(e,s,i)},fills:function(t,e,s,i){let r,o,n;for(let a=0,h=t.length;a<h;a++){if(r=t[a],o=r.originPaint,r.image){if(n?n++:n=1,Dh.checkImage(r,!e.__.__font,e,s,i))continue;if(!r.style){1===n&&r.image.isPlacehold&&e.drawImagePlaceholder(r,s,i);continue}}if(s.fillStyle=r.style,r.transform||o.scaleFixed){if(s.save(),r.transform&&s.transform(r.transform),o.scaleFixed){const{scaleX:t,scaleY:i}=e.getRenderScaleData(!0);(!0===o.scaleFixed||"zoom-in"===o.scaleFixed&&t>1&&i>1)&&s.scale(1/t,1/i)}o.blendMode&&(s.blendMode=o.blendMode),id(e,s,i),s.restore()}else o.blendMode?(s.saveBlendMode(o.blendMode),id(e,s,i),s.restoreBlendMode()):id(e,s,i)}},fillPathOrText:id,fillText:function(t,e,s){const i=t.__,{rows:r,decorationY:o}=i.__textDrawData;let n;i.__isPlacehold&&i.placeholderColor&&(e.fillStyle=i.placeholderColor);for(let t=0,s=r.length;t<s;t++)n=r[t],n.text?e.fillText(n.text,n.x,n.y):n.data&&n.data.forEach(t=>{e.fillText(t.char,t.x,n.y)});if(o){const{decorationColor:t,decorationHeight:s}=i.__textDrawData;t&&(e.fillStyle=t),r.forEach(t=>o.forEach(i=>e.fillRect(t.x,t.y+i,t.width,s)))}},stroke:function(t,e,s,i){const r=e.__;if(r.__strokeWidth)if(r.__font)Wh.strokeText(t,e,s,i);else switch(r.strokeAlign){case"center":rd(t,1,e,s,i);break;case"inside":!function(t,e,s,i){s.save(),s.clipUI(e),rd(t,2,e,s,i),s.restore()}(t,e,s,i);break;case"outside":!function(t,e,s,i){const r=e.__;if(r.__fillAfterStroke)rd(t,2,e,s,i);else{const{renderBounds:o}=e.__layout,n=s.getSameCanvas(!0,!0);e.__drawRenderPath(n),rd(t,2,e,n,i),n.clipUI(r),n.clearWorld(o),tn.copyCanvasByWorld(e,s,n),n.recycle(e.__nowWorld)}}(t,e,s,i)}},strokes:function(t,e,s,i){Wh.stroke(t,e,s,i)},strokeText:function(t,e,s,i){switch(e.__.strokeAlign){case"center":od(t,1,e,s,i);break;case"inside":nd(t,"inside",e,s,i);break;case"outside":e.__.__fillAfterStroke?od(t,2,e,s,i):nd(t,"outside",e,s,i)}},drawTextStroke:function(t,e,s){let i,r=t.__.__textDrawData;const{rows:o,decorationY:n}=r;for(let t=0,s=o.length;t<s;t++)i=o[t],i.text?e.strokeText(i.text,i.x,i.y):i.data&&i.data.forEach(t=>{e.strokeText(t.char,t.x,i.y)});if(n){const{decorationHeight:t}=r;o.forEach(s=>n.forEach(i=>e.strokeRect(s.x,s.y+i,s.width,t)))}},drawStrokesStyle:function(t,e,s,i,r,o){let n;const a=i.__,{__hasMultiStrokeStyle:h}=a;h||r.setStroke(void 0,a.__strokeWidth*e,a);for(let l=0,d=t.length;l<d;l++)if(n=t[l],(!n.image||!Dh.checkImage(n,!1,i,r,o))&&n.style){if(h){const{strokeStyle:t}=n;t?r.setStroke(n.style,a.__getRealStrokeWidth(t)*e,a,t):r.setStroke(n.style,a.__strokeWidth*e,a)}else r.strokeStyle=n.style;n.originPaint.blendMode?(r.saveBlendMode(n.originPaint.blendMode),s?Wh.drawTextStroke(i,r,o):r.stroke(),r.restoreBlendMode()):s?Wh.drawTextStroke(i,r,o):r.stroke()}},shape:function(t,e,s){const i=e.getSameCanvas(),r=e.bounds,o=t.__nowWorld,n=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let h,l,d,c,u,_;ld(n.strokeSpread?(hd(pd,n.boxBounds,n.strokeSpread),pd):n.boxBounds,o,a);let{scaleX:p,scaleY:f}=t.getRenderScaleData(!0);if(r.includes(a))_=i,h=u=a,l=o;else{let i;if(g.fullImageShadow)i=a;else{const t=n.renderShapeSpread?ad(r,S.swapAndScale(n.renderShapeSpread,p,f)):r;i=_d(t,a)}c=r.getFitMatrix(i);let{a:y,d:m}=c;c.a<1&&(_=e.getSameCanvas(),t.__renderShape(_,s),p*=y,f*=m),u=dd(a,c),h=cd(u,-c.e,-c.f),l=dd(o,c),ud(l,-c.e,-c.f);const x=s.matrix;x?(d=new pt(c),d.multiply(x),y*=x.scaleX,m*=x.scaleY):d=c,d.withScale(y,m),s=Object.assign(Object.assign({},s),{matrix:d})}return t.__renderShape(i,s),{canvas:i,matrix:d,fitMatrix:c,bounds:h,renderBounds:l,worldCanvas:_,shapeBounds:u,scaleX:p,scaleY:f}}};let wd,vd=new Gt;const{isSame:bd}=zt;function Bd(t,e,s,i,r,o){if("fill"===e&&!t.__.__naturalWidth){const e=t.__;if(e.__naturalWidth=i.width/e.pixelRatio,e.__naturalHeight=i.height/e.pixelRatio,e.__autoSide)return t.forceUpdate("width"),t.__proxyData&&(t.setProxyAttr("width",e.width),t.setProxyAttr("height",e.height)),!1}return r.data||Dh.createData(r,i,s,o),!0}function kd(t,e){Cd(t,On.LOAD,e)}function Sd(t,e){Cd(t,On.LOADED,e)}function Rd(t,e,s){e.error=s,t.forceUpdate("surface"),Cd(t,On.ERROR,e)}function Cd(t,e,s){t.hasEvent(e)&&t.emitEvent(new On(e,s))}function Td(t,e){const{leafer:s}=t;s&&s.viewReady&&(s.renderer.ignore=e)}const{get:Pd,translate:Ld}=J,Id=new Gt,Ed={},Od={};function Ad(t,e,s,i){const o=r(t)||i?(i?s-i*e:s%e)/((i||Math.floor(s/e))-1):t;return"auto"===t&&o<0?0:o}let Md={},Wd={a:1,b:0,c:0,d:1,e:0,f:0};const{get:Dd,set:Fd,rotateOfOuter:Ud,translate:Nd,scaleOfOuter:zd,multiplyParent:Yd,scale:Xd,rotate:Hd,skew:Gd}=J;function jd(t,e,s,i,r,o,n,a){n&&Hd(t,n),a&&Gd(t,a.x,a.y),r&&Xd(t,r,o),Nd(t,e.x+s,e.y+i)}const{get:Vd,scale:qd,copy:Qd}=J,{getFloorScale:Jd}=M,{abs:$d}=Math;const Zd={image:function(t,e,s,i,r){let o,n;const a=Qr.get(s);return wd&&s===wd.paint&&bd(i,wd.boxBounds)?o=wd.leafPaint:(o={type:s.type,image:a},a.hasAlphaPixel&&(o.isTransparent=!0),wd=a.use>1?{leafPaint:o,paint:s,boxBounds:vd.set(i)}:null),(r||a.loading)&&(n={image:a,attrName:e,attrValue:s}),a.ready?(Bd(t,e,s,a,o,i),r&&(kd(t,n),Sd(t,n))):a.error?r&&Rd(t,n,a.error):(r&&(Td(t,!0),kd(t,n)),o.loadId=a.load(()=>{Td(t,!1),t.destroyed||(Bd(t,e,s,a,o,i)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),Sd(t,n)),o.loadId=void 0},e=>{Td(t,!1),Rd(t,n,e),o.loadId=void 0}),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),o},checkImage:function(t,e,s,i,r){const{scaleX:o,scaleY:n}=Dh.getImageRenderScaleData(t,s,i,r),{image:a,data:h,originPaint:l}=t,{exporting:d}=r;return!(!h||t.patternId===o+"-"+n&&!d)&&(e&&(h.repeat?e=!1:l.changeful||"miniapp"===g.name&&Nn.isResizing(s)||d||(e=g.image.isLarge(a,o,n))),e?(s.__.__isFastShadow&&(i.fillStyle=t.style||"#000",i.fill()),Dh.drawImage(t,o,n,s,i,r),!0):(!t.style||l.sync||d?Dh.createPattern(t,s,i,r):Dh.createPatternTask(t,s,i,r),!1))},drawImage:function(t,e,s,i,r,o){const{data:n,image:a}=t,{blendMode:h}=t.originPaint,{opacity:l,transform:d}=n,c=a.getFull(n.filters),u=i.__;let _,{width:p,height:f}=a;(_=d&&!d.onlyScale||u.path||u.cornerRadius)||l||h?(r.save(),_&&r.clipUI(i),h&&(r.blendMode=h),l&&(r.opacity*=l),d&&r.transform(d),r.drawImage(c,0,0,p,f),r.restore()):(n.scaleX&&(p*=n.scaleX,f*=n.scaleY),r.drawImage(c,0,0,p,f))},getImageRenderScaleData:function(t,e,s,i){const r=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:o}=t;if(s){const{pixelRatio:t}=s;r.scaleX*=t,r.scaleY*=t}return o&&o.scaleX&&(r.scaleX*=Math.abs(o.scaleX),r.scaleY*=Math.abs(o.scaleY)),r},recycleImage:function(t,e){const s=e["_"+t];if(h(s)){let i,r,o,n,a;for(let l=0,d=s.length;l<d;l++)i=s[l],r=i.image,a=r&&r.url,a&&(o||(o={}),o[a]=!0,Qr.recycle(r),r.loading&&(n||(n=e.__input&&e.__input[t]||[],h(n)||(n=[n])),r.unload(s[l].loadId,!n.some(t=>t.url===a))));return o}return null},createPatternTask:function(t,e,s,i){t.patternTask||(t.patternTask=Qr.patternTasker.add(()=>_e(this,void 0,void 0,function*(){t.patternTask=null,s.bounds.hit(e.__nowWorld)&&Dh.createPattern(t,e,s,i),e.forceUpdate("surface")}),300))},createPattern:function(t,e,s,i){let{scaleX:r,scaleY:o}=Dh.getImageRenderScaleData(t,e,s,i),n=r+"-"+o;if(t.patternId!==n&&!e.destroyed&&(!g.image.isLarge(t.image,r,o)||t.data.repeat)){const{image:s,data:i}=t,{transform:a,gap:h}=i,l=Dh.getPatternFixScale(t,r,o);let d,c,u,{width:_,height:p}=s;l&&(r*=l,o*=l),_*=r,p*=o,h&&(c=h.x*r/$d(i.scaleX||1),u=h.y*o/$d(i.scaleY||1)),(a||1!==r||1!==o)&&(r*=Jd(_+(c||0)),o*=Jd(p+(u||0)),d=Vd(),a&&Qd(d,a),qd(d,1/r,1/o));const f=s.getCanvas(_,p,i.opacity,i.filters,c,u,e.leafer&&e.leafer.config.smooth),y=s.getPattern(f,i.repeat||g.origin.noRepeat||"no-repeat",d,t);t.style=y,t.patternId=n}},getPatternFixScale:function(t,e,s){const{image:i}=t;let r,o=g.image.maxPatternSize,n=i.width*i.height;return i.isSVG?e>1&&(r=Math.ceil(e)/e):o>n&&(o=n),(n*=e*s)>o&&(r=Math.sqrt(o/n)),r},createData:function(t,e,s,i){t.data=Dh.getPatternData(s,i,e)},getPatternData:function(t,e,s){t.padding&&(e=Id.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:i,height:o}=s,{opacity:n,mode:a,align:h,offset:d,scale:c,size:u,rotation:_,skew:p,clipSize:f,repeat:g,gap:y,filters:m}=t,x=e.width===i&&e.height===o,w={mode:a},v="center"!==h&&(_||0)%180==90;let b,B;switch(zt.set(Od,0,0,v?o:i,v?i:o),a&&"cover"!==a&&"fit"!==a?((c||u)&&(M.getScaleData(c,u,s,Ed),b=Ed.scaleX,B=Ed.scaleY),(h||y||g)&&(b&&zt.scale(Od,b,B,!0),h&&kt.toPoint(h,Od,e,Od,!0,!0))):x&&!_||(b=B=zt.getFitScale(e,Od,"fit"!==a),zt.put(e,s,h,b,!1,Od),zt.scale(Od,b,B,!0)),d&&at.move(Od,d),a){case"stretch":x?b&&(b=B=void 0):(b=e.width/i,B=e.height/o,Dh.stretchMode(w,e,b,B));break;case"normal":case"clip":if(Od.x||Od.y||b||f||_||p){let t,s;f&&(t=e.width/f.width,s=e.height/f.height),Dh.clipMode(w,e,Od.x,Od.y,b,B,_,p,t,s),t&&(b=b?b*t:t,B=B?B*s:s)}break;case"repeat":(!x||b||_||p)&&Dh.repeatMode(w,e,i,o,Od.x,Od.y,b,B,_,p,h,t.freeTransform),g||(w.repeat="repeat");const s=l(g);(y||s)&&(w.gap=function(t,e,s,i,r){let o,n;l(t)?(o=t.x,n=t.y):o=n=t;return{x:Ad(o,s,r.width,e&&e.x),y:Ad(n,i,r.height,e&&e.y)}}(y,s&&g,Od.width,Od.height,e));break;default:b&&Dh.fillOrFitMode(w,e,Od.x,Od.y,b,B,_)}return w.transform||(e.x||e.y)&&Ld(w.transform=Pd(),e.x,e.y),b&&(w.scaleX=b,w.scaleY=B),n&&n<1&&(w.opacity=n),m&&(w.filters=m),g&&(w.repeat=r(g)?"x"===g?"repeat-x":"repeat-y":"repeat"),w},stretchMode:function(t,e,s,i){const r=Dd(),{x:o,y:n}=e;o||n?Nd(r,o,n):r.onlyScale=!0,Xd(r,s,i),t.transform=r},fillOrFitMode:function(t,e,s,i,r,o,n){const a=Dd();Nd(a,e.x+s,e.y+i),Xd(a,r,o),n&&Ud(a,{x:e.x+e.width/2,y:e.y+e.height/2},n),t.transform=a},clipMode:function(t,e,s,i,r,o,n,a,h,l){const d=Dd();jd(d,e,s,i,r,o,n,a),h&&(n||a?(Fd(Wd),zd(Wd,e,h,l),Yd(d,Wd)):zd(d,e,h,l)),t.transform=d},repeatMode:function(t,e,s,i,r,o,n,a,h,l,d,c){const u=Dd();if(c)jd(u,e,r,o,n,a,h,l);else{if(h)if("center"===d)Ud(u,{x:s/2,y:i/2},h);else switch(Hd(u,h),h){case 90:Nd(u,i,0);break;case 180:Nd(u,s,i);break;case 270:Nd(u,0,s)}Md.x=e.x+r,Md.y=e.y+o,Nd(u,Md.x,Md.y),n&&zd(u,Md,n,a)}t.transform=u}},{toPoint:Kd}=vt,{hasTransparent:tc}=Oh,ec={},sc={};function ic(t,e,s,i){if(s){let o,n,a,h;for(let t=0,l=s.length;t<l;t++)o=s[t],r(o)?(a=t/(l-1),n=Oh.string(o,i)):(a=o.offset,n=Oh.string(o.color,i)),e.addColorStop(a,n),!h&&tc(n)&&(h=!0);h&&(t.isTransparent=!0)}}const{getAngle:rc,getDistance:oc}=at,{get:nc,rotateOfOuter:ac,scaleOfOuter:hc}=J,{toPoint:lc}=vt,dc={},cc={};function uc(t,e,s,i,r){let o;const{width:n,height:a}=t;if(n!==a||i){const t=rc(e,s);o=nc(),r?(hc(o,e,n/a*(i||1),1),ac(o,e,t+90)):(hc(o,e,1,n/a*(i||1)),ac(o,e,t))}return o}const{getDistance:_c}=at,{toPoint:pc}=vt,fc={},gc={};const yc={linearGradient:function(t,e){let{from:s,to:i,type:r,opacity:o}=t;Kd(s||"top",e,ec),Kd(i||"bottom",e,sc);const n=g.canvas.createLinearGradient(ec.x,ec.y,sc.x,sc.y),a={type:r,style:n};return ic(a,n,t.stops,o),a},radialGradient:function(t,e){let{from:s,to:i,type:r,opacity:o,stretch:n}=t;lc(s||"center",e,dc),lc(i||"bottom",e,cc);const a=g.canvas.createRadialGradient(dc.x,dc.y,0,dc.x,dc.y,oc(dc,cc)),h={type:r,style:a};ic(h,a,t.stops,o);const l=uc(e,dc,cc,n,!0);return l&&(h.transform=l),h},conicGradient:function(t,e){let{from:s,to:i,type:r,opacity:o,stretch:n}=t;pc(s||"center",e,fc),pc(i||"bottom",e,gc);const a=g.conicGradientSupport?g.canvas.createConicGradient(0,fc.x,fc.y):g.canvas.createRadialGradient(fc.x,fc.y,0,fc.x,fc.y,_c(fc,gc)),h={type:r,style:a};ic(h,a,t.stops,o);const l=uc(e,fc,gc,n||1,g.conicGradientRotate90);return l&&(h.transform=l),h},getTransform:uc},{copy:mc,move:xc,toOffsetOutBounds:wc}=zt,{max:vc,abs:bc}=Math,Bc={},kc=new pt,Sc={};function Rc(t,e){let s,i,r,o,n=0,a=0,h=0,l=0;return e.forEach(t=>{s=t.x||0,i=t.y||0,o=1.5*(t.blur||0),r=bc(t.spread||0),n=vc(n,r+o-i),a=vc(a,r+o+s),h=vc(h,r+o+i),l=vc(l,r+o-s)}),n===a&&a===h&&h===l?n:[n,a,h,l]}function Cc(t,e,s){const{shapeBounds:i}=s;let r,o;g.fullImageShadow?(mc(Bc,t.bounds),xc(Bc,e.x-i.x,e.y-i.y),r=t.bounds,o=Bc):(r=i,o=e),t.copyWorld(s.canvas,r,o)}const{toOffsetOutBounds:Tc}=zt,Pc={};const Lc=Rc;const Ic={shadow:function(t,e,s){let i,r;const{__nowWorld:o}=t,{shadow:n}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=n.length-1;wc(h,Sc,l),n.forEach((n,f)=>{let g=1;if(n.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(g=1/t)}_.setWorldShadow(Sc.offsetX+(n.x||0)*c*g,Sc.offsetY+(n.y||0)*u*g,(n.blur||0)*c*g,Oh.string(n.color)),r=Uh.getShadowTransform(t,_,s,n,Sc,g),r&&_.setTransform(r),Cc(_,Sc,s),r&&_.resetTransform(),i=l,n.box&&(_.restore(),_.save(),a&&(_.copyWorld(_,l,o,"copy"),i=o),a?_.copyWorld(a,o,o,"destination-out"):_.copyWorld(s.canvas,d,h,"destination-out")),tn.copyCanvasByWorld(t,e,_,i,n.blendMode),p&&f<p&&_.clearWorld(i)}),_.recycle(i)},innerShadow:function(t,e,s){let i,r;const{__nowWorld:o}=t,{innerShadow:n}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=n.length-1;Tc(h,Pc,l),n.forEach((n,f)=>{let g=1;if(n.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(g=1/t)}_.save(),_.setWorldShadow(Pc.offsetX+(n.x||0)*c*g,Pc.offsetY+(n.y||0)*u*g,(n.blur||0)*c*g),r=Uh.getShadowTransform(t,_,s,n,Pc,g,!0),r&&_.setTransform(r),Cc(_,Pc,s),_.restore(),a?(_.copyWorld(_,l,o,"copy"),_.copyWorld(a,o,o,"source-out"),i=o):(_.copyWorld(s.canvas,d,h,"source-out"),i=l),_.fillWorld(i,Oh.string(n.color),"source-in"),tn.copyCanvasByWorld(t,e,_,i,n.blendMode),p&&f<p&&_.clearWorld(i)}),_.recycle(i)},blur:function(t,e,s){const{blur:i}=t.__;s.setWorldBlur(i*t.__nowWorld.a),s.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),s.filter="none"},backgroundBlur:function(t,e,s){},getShadowRenderSpread:Rc,getShadowTransform:function(t,e,s,i,r,o,n){if(i.spread){const s=2*i.spread*o*(n?-1:1),{width:a,height:h}=t.__layout.strokeBounds;return kc.set().scaleOfOuter({x:(r.x+r.width/2)*e.pixelRatio,y:(r.y+r.height/2)*e.pixelRatio},1+s/a,1+s/h),kc}},isTransformShadow(t){},getInnerShadowSpread:Lc},{excludeRenderBounds:Ec}=ln;let Oc;function Ac(t,e,s,i,r,o,n,a){switch(e){case"grayscale":Oc||(Oc=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,s,i,r,o){const n=t.__nowWorld;s.resetTransform(),s.opacity=1,s.useMask(i,n),o&&i.recycle(n);Wc(t,e,s,1,r,o)}(t,s,i,r,n,a);break;case"opacity-path":Wc(t,s,i,o,n,a);break;case"path":a&&s.restore()}}function Mc(t){return t.getSameCanvas(!1,!0)}function Wc(t,e,s,i,r,o){const n=t.__nowWorld;e.resetTransform(),e.opacity=i,e.copyWorld(s,n,void 0,r),o?s.recycle(n):s.clearWorld(n)}t.Group.prototype.__renderMask=function(t,e){let s,i,r,o,n,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++){if(s=h[l],a=s.__.mask,a){n&&(Ac(this,n,t,r,i,o,void 0,!0),i=r=null),"clipping"!==a&&"clipping-path"!==a||Ec(s,e)||s.__render(t,e),o=s.__.opacity,Oc=!1,"path"===a||"clipping-path"===a?(o<1?(n="opacity-path",r||(r=Mc(t))):(n="path",t.save()),s.__clip(r||t,e)):(n="grayscale"===a?"grayscale":"alpha",i||(i=Mc(t)),r||(r=Mc(t)),s.__render(i,e));continue}const d=1===o&&s.__.__blendMode;d&&Ac(this,n,t,r,i,o,void 0,!1),Ec(s,e)||s.__render(r||t,e),d&&Ac(this,n,t,r,i,o,d,!1)}Ac(this,n,t,r,i,o,void 0,!0)};const Dc=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",Fc=Dc+"_#~&*+\\=|≮≯≈≠=…",Uc=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map(([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`).join("|"));function Nc(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}const zc=Nc("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),Yc=Nc("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),Xc=Nc(Dc),Hc=Nc(Fc),Gc=Nc("- —/~|┆·");var jc;!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(jc||(jc={}));const{Letter:Vc,Single:qc,Before:Qc,After:Jc,Symbol:$c,Break:Zc}=jc;function Kc(t){return zc[t]?Vc:Gc[t]?Zc:Yc[t]?Qc:Xc[t]?Jc:Hc[t]?$c:Uc.test(t)?qc:Vc}const tu={trimRight(t){const{words:e}=t;let s,i=0,r=e.length;for(let o=r-1;o>-1&&(s=e[o].data[0]," "===s.char);o--)i++,t.width-=s.width;i&&e.splice(r-i,i)}};function eu(t,e,s){switch(e){case"title":return s?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:su}=tu,{Letter:iu,Single:ru,Before:ou,After:nu,Symbol:au,Break:hu}=jc;let lu,du,cu,uu,_u,pu,fu,gu,yu,mu,xu,wu,vu,bu,Bu,ku,Su,Ru=[];function Cu(t,e){yu&&!gu&&(gu=yu),lu.data.push({char:t,width:e}),cu+=e}function Tu(){uu+=cu,lu.width=cu,du.words.push(lu),lu={data:[]},cu=0}function Pu(){bu&&(Bu.paraNumber++,du.paraStart=!0,bu=!1),yu&&(du.startCharSize=gu,du.endCharSize=yu,gu=0),du.width=uu,ku.width?su(du):Su&&Lu(),Ru.push(du),du={words:[]},uu=0}function Lu(){uu>(Bu.maxWidth||0)&&(Bu.maxWidth=uu)}const{top:Iu,right:Eu,bottom:Ou,left:Au}=t.Direction4;function Mu(t,e,s){const{bounds:i,rows:r}=t;i[e]+=s;for(let t=0;t<r.length;t++)r[t][e]+=s}const Wu={getDrawData:function(t,e){r(t)||(t=String(t));let s=0,i=0,o=e.__getInput("width")||0,n=e.__getInput("height")||0;const{__padding:a}=e;a&&(o?(s=a[Au],o-=a[Eu]+a[Au],!o&&(o=.01)):e.autoSizeAlign||(s=a[Au]),n?(i=a[Iu],n-=a[Iu]+a[Ou],!n&&(n=.01)):e.autoSizeAlign||(i=a[Iu]));const h={bounds:{x:s,y:i,width:o,height:n},rows:[],paraNumber:0,font:g.canvas.font=e.__font};return function(t,e,s){Bu=t,Ru=t.rows,ku=t.bounds,Su=!ku.width&&!s.autoSizeAlign;const{__letterSpacing:i,paraIndent:r,textCase:o}=s,{canvas:n}=g,{width:a}=ku;if(s.__isCharMode){const t="none"!==s.textWrap,h="break"===s.textWrap;bu=!0,xu=null,gu=fu=yu=cu=uu=0,lu={data:[]},du={words:[]},i&&(e=[...e]);for(let s=0,l=e.length;s<l;s++)pu=e[s],"\n"===pu?(cu&&Tu(),du.paraEnd=!0,Pu(),bu=!0):(mu=Kc(pu),mu===iu&&"none"!==o&&(pu=eu(pu,o,!cu)),fu=n.measureText(pu).width,i&&(i<0&&(yu=fu),fu+=i),wu=mu===ru&&(xu===ru||xu===iu)||xu===ru&&mu!==nu,vu=!(mu!==ou&&mu!==ru||xu!==au&&xu!==nu),_u=bu&&r?a-r:a,t&&a&&uu+cu+fu>_u&&(h?(cu&&Tu(),uu&&Pu()):(vu||(vu=mu===iu&&xu==nu),wu||vu||mu===hu||mu===ou||mu===ru||cu+fu>_u?(cu&&Tu(),uu&&Pu()):uu&&Pu()))," "===pu&&!0!==bu&&uu+cu===0||(mu===hu?(" "===pu&&cu&&Tu(),Cu(pu,fu),Tu()):wu||vu?(cu&&Tu(),Cu(pu,fu)):Cu(pu,fu)),xu=mu);cu&&Tu(),uu&&Pu(),Ru.length>0&&(Ru[Ru.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{Bu.paraNumber++,uu=n.measureText(t).width,Ru.push({x:r||0,text:t,width:uu,paraStart:!0}),Su&&Lu()})}(h,t,e),a&&function(t,e,s,i,r){if(!i&&s.autoSizeAlign)switch(s.textAlign){case"left":Mu(e,"x",t[Au]);break;case"right":Mu(e,"x",-t[Eu])}if(!r&&s.autoSizeAlign)switch(s.verticalAlign){case"top":Mu(e,"y",t[Iu]);break;case"bottom":Mu(e,"y",-t[Ou])}}(a,h,e,o,n),function(t,e){const{rows:s,bounds:i}=t,r=s.length,{__lineHeight:o,__baseLine:n,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:f,height:g}=i,y=o*r+(c?c*(t.paraNumber-1):0),m=n;if(h&&y>g)y=Math.max(g,o),r>1&&(t.overflow=r);else if(g||u)switch(d){case"middle":p+=(g-y)/2;break;case"bottom":p+=g-y}m+=p;let x,w,v,b=f||u?f:t.maxWidth;for(let n=0,d=r;n<d;n++){if(x=s[n],x.x=_,x.width<f||x.width>f&&!h)switch(l){case"center":x.x+=(b-x.width)/2;break;case"right":x.x+=b-x.width}x.paraStart&&c&&n>0&&(m+=c),x.y=m,m+=o,t.overflow>n&&m>y&&(x.isOverflow=!0,t.overflow=n+1),w=x.x,v=x.width,a<0&&(x.width<0?(v=-x.width+e.fontSize+a,w-=v,v+=e.fontSize):v-=a),w<i.x&&(i.x=w),v>i.width&&(i.width=v),h&&f&&f<v&&(x.isOverflow=!0,t.overflow||(t.overflow=s.length))}i.y=p,i.height=y}(h,e),e.__isCharMode&&function(t,e,s){const{rows:i}=t,{textAlign:r,paraIndent:o,letterSpacing:n}=e,a=s&&r.includes("both"),h=a||s&&r.includes("justify"),l=h&&r.includes("letter");let d,c,u,_,p,f,g,y,m,x;i.forEach(t=>{t.words&&(p=o&&t.paraStart?o:0,y=t.words.length,h&&(x=!t.paraEnd||a,c=s-t.width-p,l?_=c/(t.words.reduce((t,e)=>t+e.data.length,0)-1):u=y>1?c/(y-1):0),f=n||t.isOverflow||l?0:u?1:2,t.isOverflow&&!n&&(t.textMode=!0),2===f?(t.x+=p,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=p,d=t.x,t.data=[],t.words.forEach((e,s)=>{1===f?(g={char:"",x:d},d=function(t,e,s){return t.forEach(t=>{s.char+=t.char,e+=t.width}),e}(e.data,d,g),(t.isOverflow||" "!==g.char)&&t.data.push(g)):d=function(t,e,s,i,r){return t.forEach(t=>{(i||" "!==t.char)&&(t.x=e,s.push(t)),e+=t.width,r&&(e+=r)}),e}(e.data,d,t.data,t.isOverflow,x&&_),x&&(m=s===y-1,u?m||(d+=u,t.width+=u):_&&(t.width+=_*(e.data.length-(m?1:0))))})),t.words=null)})}(h,e,o),h.overflow&&function(t,e,s,i){if(!i)return;const{rows:r,overflow:o}=t;let{textOverflow:n}=e;if(r.splice(o),n&&"show"!==n){let t,a;"hide"===n?n="":"ellipsis"===n&&(n="...");const h=n?g.canvas.measureText(n).width:0,l=s+i-h;("none"===e.textWrap?r:[r[o-1]]).forEach(e=>{if(e.isOverflow&&e.data){let s=e.data.length-1;for(let i=s;i>-1&&(t=e.data[i],a=t.x+t.width,!(i===s&&a<l));i--){if(a<l&&" "!==t.char||!i){e.data.splice(i+1),e.width-=t.width;break}e.width-=t.width}e.width+=h,e.data.push({char:n,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(h,e,s,o),"none"!==e.textDecoration&&function(t,e){let s,i=0;const{fontSize:r,textDecoration:o}=e;switch(t.decorationHeight=r/11,l(o)?(s=o.type,o.color&&(t.decorationColor=Oh.string(o.color)),o.offset&&(i=Math.min(.3*r,Math.max(o.offset,.15*-r)))):s=o,s){case"under":t.decorationY=[.15*r+i];break;case"delete":t.decorationY=[.35*-r];break;case"under-delete":t.decorationY=[.15*r+i,.35*-r]}}(h,e),h}};const Du={string:function(t,e){if(!t)return"#000";const i=n(e)&&e<1;if(r(t)){if(!i||!Oh.object)return t;t=Oh.object(t)}let o=s(t.a)?1:t.a;i&&(o*=e);const a=t.r+","+t.g+","+t.b;return 1===o?"rgb("+a+")":"rgba("+a+","+o+")"}};return Object.assign(Eh,Wu),Object.assign(Oh,Du),Object.assign(Wh,xd),Object.assign(Dh,Zd),Object.assign(Fh,yc),Object.assign(Uh,Ic),_h(),t.AlignHelper=kt,t.AroundHelper=vt,t.AutoBounds=Vt,t.BezierHelper=is,t.Bounds=Gt,t.BoundsEvent=An,t.BoundsHelper=zt,t.BoxData=Kh,t.BranchHelper=_n,t.BranchRender=Ta,t.CanvasData=ul,t.CanvasManager=ce,t.ChildEvent=Pn,t.ColorConvert=Oh,t.Creator=re,t.DataHelper=c,t.Debug=Jt,t.Effect=Uh,t.EllipseData=rl,t.EllipseHelper=us,t.Event=Tn,t.EventCreator=le,t.Eventer=$n,t.Export=zh,t.FileHelper=zr,t.Filter=Nh,t.FourNumberHelper=S,t.FrameData=el,t.GroupData=Zh,t.ImageData=cl,t.ImageEvent=On,t.ImageManager=Qr,t.IncrementId=m,t.LayoutEvent=Yn,t.Layouter=Rh,t.LeafBounds=Sa,t.LeafBoundsHelper=ln,t.LeafData=_,t.LeafDataProxy=da,t.LeafEventer=ha,t.LeafHelper=tn,t.LeafLayout=Cn,t.LeafLevelList=dh,t.LeafList=lh,t.LeafMatrix=ya,t.LeafRender=Ra,t.LeaferCanvas=ch,t.LeaferCanvasBase=Ce,t.LeaferData=tl,t.LeaferEvent=Hn,t.LeaferImage=Kr,t.LineData=sl,t.MathHelper=M,t.Matrix=pt,t.MatrixHelper=J,t.MyImage=$l,t.NeedConvertToCanvasCommandMap=Ee,t.OneRadian=D,t.PI2=F,t.PI_2=U,t.Paint=Wh,t.PaintGradient=Fh,t.PaintImage=Dh,t.PathArrow=Mh,t.PathBounds=Pr,t.PathCommandDataHelper=xi,t.PathCommandMap=Le,t.PathConvert=Js,t.PathCorner=Wr,t.PathCreator=Wi,t.PathData=al,t.PathDrawer=$i,t.PathHelper=Te,t.PathNumberCommandLengthMap=We,t.PathNumberCommandMap=Me,t.PenData=hl,t.Platform=g,t.Plugin=ie,t.Point=ut,t.PointHelper=at,t.PolygonData=ol,t.PropertyEvent=In,t.RectData=il,t.RectHelper=De,t.RectRender=xl,t.RenderEvent=Xn,t.Renderer=Th,t.ResizeEvent=Nn,t.Resource=Vr,t.Run=te,t.StarData=nl,t.State=Yh,t.StringNumberMap=qt,t.TaskItem=Hr,t.TaskProcessor=Gr,t.TextConvert=Eh,t.TextData=dl,t.Transition=Xh,t.TwoPointBoundsHelper=gt,t.UIBounds=fl,t.UICreator=ne,t.UIData=Jh,t.UIRender=yl,t.UnitConvert=Ah,t.WaitHelper=yn,t.WatchEvent=zn,t.Watcher=fh,t.affectRenderBoundsType=vo,t.affectStrokeBoundsType=mo,t.attr=ro,t.autoLayoutType=lo,t.boundsType=_o,t.canvasPatch=Nr,t.canvasSizeAttrs=Re,t.createAttr=function(t){return(e,s)=>{to(e,s,so(s,t))}},t.createDescriptor=so,t.cursorType=Eo,t.dataProcessor=Oo,t.dataType=no,t.decorateLeafAttr=io,t.defineDataProcessor=Ao,t.defineKey=to,t.defineLeafAttr=oo,t.dimType=Bo,t.doBoundsType=fo,t.doStrokeType=xo,t.effectType=Ph,t.emptyData={},t.eraserType=Lo,t.extraPropertyEventMap=En,t.getBoundsData=z,t.getDescriptor=eo,t.getMatrixData=Y,t.getPointData=N,t.hitType=Io,t.isArray=h,t.isData=function(t){return l(t)&&!h(t)},t.isEmptyData=d,t.isFinite=o,t.isNull=i,t.isNumber=n,t.isObject=l,t.isString=r,t.isUndefined=s,t.layoutProcessor=function(t){return(e,s)=>{to(e,"__LayoutProcessor",{get:()=>t})}},t.leaferTransformAttrMap=Qn,t.maskType=Po,t.naturalBoundsType=po,t.opacityType=ko,t.path=Dr,t.pathInputType=go,t.pathType=yo,t.pen=Fr,t.positionType=ao,t.registerUI=Yo,t.registerUIEvent=function(){return t=>{le.register(t)}},t.resizeType=Lh,t.rewrite=Fo,t.rewriteAble=Uo,t.rotationType=uo,t.scaleType=co,t.scrollType=ho,t.sortType=To,t.strokeType=wo,t.surfaceType=bo,t.tempBounds=jt,t.tempMatrix=ft,t.tempPoint=_t,t.tryToNumber=function(t){return"string"==typeof t&&a.test(t)?+t:t},t.useCanvas=_h,t.useModule=zo,t.version="1.10.1",t.visibleType=So,t.zoomLayerType=Ih,t}({});function Leafer(t){return new LeaferUI.Leafer(t)}Object.setPrototypeOf(Leafer,LeaferUI),Leafer.prototype=LeaferUI.Leafer.prototype;
|
|
1
|
+
var LeaferUI=function(t){"use strict";var e;t.Answer=void 0,(e=t.Answer||(t.Answer={}))[e.No=0]="No",e[e.Yes=1]="Yes",e[e.NoAndSkip=2]="NoAndSkip",e[e.YesAndSkip=3]="YesAndSkip";function s(t){return void 0===t}function i(t){return null==t}function r(t){return"string"==typeof t}const{isFinite:o}=Number;function n(t){return"number"==typeof t}const a=/^-?\d+(?:\.\d+)?$/;const{isArray:h}=Array;function l(t){return t&&"object"==typeof t}function d(t){return"{}"===JSON.stringify(t)}const c={default:(t,e)=>(u(e,t),u(t,e),t),assign(t,e,s){let i;Object.keys(e).forEach(r=>{var o,n;if(i=e[r],(null==i?void 0:i.constructor)===Object&&(null===(o=t[r])||void 0===o?void 0:o.constructor)===Object)return u(t[r],e[r],s&&s[r]);s&&r in s?(null===(n=s[r])||void 0===n?void 0:n.constructor)===Object&&u(t[r]={},e[r],s[r]):t[r]=e[r]})},copyAttrs:(t,e,i)=>(i.forEach(i=>{s(e[i])||(t[i]=e[i])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,i=t.length;s<i;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:u}=c;class _{get __useNaturalRatio(){return!0}get __isLinePath(){const{path:t}=this;return t&&6===t.length&&1===t[0]}get __usePathBox(){return this.__pathInputed}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(!s(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let i;for(let r in this)"_"!==r[0]&&(i=e?e[r]:void 0,t[r]=s(i)?this[r]:i);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!s(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!s(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const i={};if(t)if(h(t))for(let e of t)i[e]=this.__getInput(e);else for(let e in t)i[e]=this.__getInput(e);else{let t,e,{__input:r}=this;i.tag=this.__leaf.tag;for(let o in this)if("_"!==o[0]&&(t=this["_"+o],!s(t))){if("path"===o&&!this.__pathInputed)continue;e=r?r[o]:void 0,i[o]=s(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:s,d:r,e:o,f:n}=this.__leaf.__localMatrix;i.matrix={a:t,b:e,c:s,d:r,e:o,f:n}}return i}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null}}const{floor:p,max:f}=Math,g={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",isLarge:(t,e,s,i)=>t.width*t.height*(e?e*s:1)>(i||y.maxCacheSize),isSuperLarge:(t,e,s)=>y.isLarge(t,e,s,y.maxPatternSize),getRealURL(t){const{prefix:e,suffix:s}=g.image;return!s||t.startsWith("data:")||t.startsWith("blob:")||(t+=(t.includes("?")?"&":"?")+s),e&&"/"===t[0]&&(t=e+t),t},resize(t,e,s,i,r,o,n,a,h){const l=g.origin.createCanvas(f(p(e+(i||0)),1),f(p(s+(r||0)),1)),d=l.getContext("2d");if(a&&(d.globalAlpha=a),d.imageSmoothingEnabled=!1!==n,o){const i=e/o.width,r=s/o.height;d.setTransform(i,0,0,r,-o.x*i,-o.y*r),d.drawImage(t,0,0,t.width,t.height)}else d.drawImage(t,0,0,e,s);return l},setPatternTransform(t,e,s){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}s&&c.stintSet(s,"transform",e)}}},{image:y}=g,m={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=x;return e[t]?e[t]++:(e[t]=1,0)}},x=m;let w,v,b;const{max:B}=Math,k=[0,0,0,0],S={zero:[...k],tempFour:k,set:(t,e,s,i,r)=>(void 0===s&&(s=i=r=e),t[0]=e,t[1]=s,t[2]=i,t[3]=r,t),setTemp:(t,e,s,i)=>R(k,t,e,s,i),toTempAB(t,e,s){b=s?n(t)?e:t:[],n(t)?(w=T(t),v=e):n(e)?(w=t,v=T(e)):(w=t,v=e),4!==w.length&&(w=C(w)),4!==v.length&&(v=C(v))},get(t,e){let i;if(!n(t))switch(t.length){case 4:i=s(e)?t:[...t];break;case 2:i=[t[0],t[1],t[0],t[1]];break;case 3:i=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(i||(i=[t,t,t,t]),!s(e))for(let t=0;t<4;t++)i[t]>e&&(i[t]=e);return i},max:(t,e,s)=>n(t)&&n(e)?B(t,e):(P(t,e,s),R(b,B(w[0],v[0]),B(w[1],v[1]),B(w[2],v[2]),B(w[3],v[3]))),add:(t,e,s)=>n(t)&&n(e)?t+e:(P(t,e,s),R(b,w[0]+v[0],w[1]+v[1],w[2]+v[2],w[3]+v[3])),swapAndScale(t,e,s,i){if(n(t))return e===s?t*e:[t*s,t*e];const r=i?t:[],[o,a,h,l]=4===t.length?t:C(t);return R(r,h*s,l*e,o*s,a*e)}},{set:R,get:C,setTemp:T,toTempAB:P}=S,{round:L,pow:I,max:E,floor:O,PI:A}=Math,M={within:(t,e,i)=>(l(e)&&(i=e.max,e=e.min),!s(e)&&t<e&&(t=e),!s(i)&&t>i&&(t=i),t),fourNumber:S.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),M.float(t)),getGapRotation(t,e,s=0){let i=t+s;if(e>1){const t=Math.abs(i%e);(t<1||t>e-1)&&(i=Math.round(i/e)*e)}return i-s},float(t,e){const i=s(e)?1e12:I(10,e);return-0===(t=L(t*i)/i)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,s,i){if(i||(i={}),e){const t=(n(e)?e:e.width||0)/s.width,r=(n(e)?e:e.height||0)/s.height;i.scaleX=t||r||1,i.scaleY=r||t||1}else t&&M.assignScale(i,t);return i},assignScale(t,e){n(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>E(O(t),e)/t,randInt:W,randColor:t=>`rgba(${W(255)},${W(255)},${W(255)},${t||1})`};function W(t){return Math.round(Math.random()*t)}const D=A/180,F=2*A,U=A/2;function N(){return{x:0,y:0}}function z(){return{x:0,y:0,width:0,height:0}}function Y(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:X,cos:H,acos:G,sqrt:j}=Math,{float:V}=M,q={};function Q(){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 J={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:Q(),tempMatrix:{},set(t,e=1,s=0,i=0,r=1,o=0,n=0){t.a=e,t.b=s,t.c=i,t.d=r,t.e=o,t.f=n},get:Y,getWorld:Q,copy(t,e){t.a=e.a,t.b=e.b,t.c=e.c,t.d=e.d,t.e=e.e,t.f=e.f},translate(t,e,s){t.e+=e,t.f+=s},translateInner(t,e,s,i){t.e+=t.a*e+t.c*s,t.f+=t.b*e+t.d*s,i&&(t.e-=e,t.f-=s)},scale(t,e,s=e){t.a*=e,t.b*=e,t.c*=s,t.d*=s},pixelScale(t,e,s){s||(s=t),s.a=t.a*e,s.b=t.b*e,s.c=t.c*e,s.d=t.d*e,s.e=t.e*e,s.f=t.f*e},scaleOfOuter(t,e,s,i){$.toInnerPoint(t,e,q),$.scaleOfInner(t,q,s,i)},scaleOfInner(t,e,s,i=s){$.translateInner(t,e.x,e.y),$.scale(t,s,i),$.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:i,c:r,d:o}=t,n=H(e*=D),a=X(e);t.a=s*n-i*a,t.b=s*a+i*n,t.c=r*n-o*a,t.d=r*a+o*n},rotateOfOuter(t,e,s){$.toInnerPoint(t,e,q),$.rotateOfInner(t,q,s)},rotateOfInner(t,e,s){$.translateInner(t,e.x,e.y),$.rotate(t,s),$.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:i,b:r,c:o,d:n}=t;s&&(s*=D,t.a=i+o*s,t.b=r+n*s),e&&(e*=D,t.c=o+i*e,t.d=n+r*e)},skewOfOuter(t,e,s,i){$.toInnerPoint(t,e,q),$.skewOfInner(t,q,s,i)},skewOfInner(t,e,s,i=0){$.translateInner(t,e.x,e.y),$.skew(t,s,i),$.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:i,c:r,d:o,e:n,f:a}=t;t.a=e.a*s+e.b*r,t.b=e.a*i+e.b*o,t.c=e.c*s+e.d*r,t.d=e.c*i+e.d*o,t.e=e.e*s+e.f*r+n,t.f=e.e*i+e.f*o+a},multiplyParent(t,e,i,r,o){const{e:n,f:a}=t;if(i||(i=t),s(r)&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:s,b:r,c:n,d:a}=t;i.a=s*e.a+r*e.c,i.b=s*e.b+r*e.d,i.c=n*e.a+a*e.c,i.d=n*e.b+a*e.d,o&&(i.scaleX=e.scaleX*o.scaleX,i.scaleY=e.scaleY*o.scaleY)}else i.a=e.a,i.b=e.b,i.c=e.c,i.d=e.d,o&&(i.scaleX=e.scaleX,i.scaleY=e.scaleY);i.e=n*e.a+a*e.c+e.e,i.f=n*e.b+a*e.d+e.f},divide(t,e){$.multiply(t,$.tempInvert(e))},divideParent(t,e){$.multiplyParent(t,$.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=$;return $.copy(e,t),$.invert(e),e},invert(t){const{a:e,b:s,c:i,d:r,e:o,f:n}=t;if(s||i){const a=1/(e*r-s*i);t.a=r*a,t.b=-s*a,t.c=-i*a,t.d=e*a,t.e=-(o*r-n*i)*a,t.f=-(n*e-o*s)*a}else if(1===e&&1===r)t.e=-o,t.f=-n;else{const s=1/(e*r);t.a=r*s,t.d=e*s,t.e=-o*r*s,t.f=-n*e*s}},toOuterPoint(t,e,s,i){const{x:r,y:o}=e;s||(s=e),s.x=r*t.a+o*t.c,s.y=r*t.b+o*t.d,i||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,i){const{a:r,b:o,c:n,d:a}=t,h=1/(r*a-o*n),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*n)*h,s.y=(d*r-l*o)*h,!i){const{e:e,f:i}=t;s.x-=(e*a-i*n)*h,s.y-=(i*r-e*o)*h}},setLayout(t,e,i,r,o){const{x:n,y:a,scaleX:h,scaleY:l}=e;if(s(o)&&(o=e.rotation||e.skewX||e.skewY),o){const{rotation:s,skewX:i,skewY:r}=e,o=s*D,n=H(o),a=X(o);if(i||r){const e=i*D,s=r*D;t.a=(n+s*-a)*h,t.b=(a+s*n)*h,t.c=(e*n-a)*l,t.d=(n+e*a)*l}else t.a=n*h,t.b=a*h,t.c=-a*l,t.d=n*l}else t.a=h,t.b=0,t.c=0,t.d=l;t.e=n,t.f=a,(i=i||r)&&$.translateInner(t,-i.x,-i.y,!r)},getLayout(t,e,s,i){const{a:r,b:o,c:n,d:a,e:h,f:l}=t;let d,c,u,_,p,f=h,g=l;if(o||n){const t=r*a-o*n;if(n&&!i){d=j(r*r+o*o),c=t/d;const e=r/d;u=o>0?G(e):-G(e)}else{c=j(n*n+a*a),d=t/c;const e=n/c;u=U-(a>0?G(-e):-G(e))}const e=V(H(u)),s=X(u);d=V(d),c=V(c),_=e?V((n/c+s)/e/D,9):0,p=e?V((o/d-s)/e/D,9):0,u=V(u/D)}else d=r,c=a,u=_=p=0;return(e=s||e)&&(f+=e.x*r+e.y*n,g+=e.x*o+e.y*a,s||(f-=e.x,g-=e.y)),{x:f,y:g,scaleX:d,scaleY:c,rotation:u,skewX:_,skewY:p}},withScale(t,e,s=e){const i=t;if(!e||!s){const{a:i,b:r,c:o,d:n}=t;r||o?s=(i*n-r*o)/(e=j(i*i+r*r)):(e=i,s=n)}return i.scaleX=e,i.scaleY=s,i},reset(t){$.set(t)}},$=J,{toInnerPoint:Z,toOuterPoint:K}=J,{sin:tt,cos:et,abs:st,sqrt:it,atan2:rt,min:ot,round:nt}=Math,at={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,i){t.radiusX=e,t.radiusY=s(i)?e:i},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,s){t.x=e,t.y=s},round(t,e){t.x=e?nt(t.x-.5)+.5:nt(t.x),t.y=e?nt(t.y-.5)+.5:nt(t.y)},move(t,e,s){l(e)?(t.x+=e.x,t.y+=e.y):(t.x+=e,t.y+=s)},scale(t,e,s=e){t.x&&(t.x*=e),t.y&&(t.y*=s)},scaleOf(t,e,s,i=s){t.x+=(t.x-e.x)*(s-1),t.y+=(t.y-e.y)*(i-1)},rotate(t,e,s){s||(s=ht.defaultPoint);const i=et(e*=D),r=tt(e),o=t.x-s.x,n=t.y-s.y;t.x=s.x+o*i-n*r,t.y=s.y+o*r+n*i},tempToInnerOf(t,e){const{tempPoint:s}=ht;return dt(s,t),Z(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=ht;return dt(s,t),K(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=ht;return dt(s,t),ht.toInnerRadiusPointOf(t,e,s),s},toInnerRadiusPointOf(t,e,s){s||(s=t),Z(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){Z(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)=>lt(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,s,i){const r=st(s-t),o=st(i-e);return it(r*r+o*o)},getMinDistanceFrom:(t,e,s,i,r,o)=>ot(lt(t,e,s,i),lt(s,i,r,o)),getAngle:(t,e)=>ct(t,e)/D,getRotation:(t,e,s,i)=>(i||(i=e),ht.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,i.x,i.y)/D),getRadianFrom(t,e,i,r,o,n,a,h){s(a)&&(a=i,h=r);const l=t-i,d=e-r,c=o-a,u=n-h;return Math.atan2(l*u-d*c,l*c+d*u)},getAtan2:(t,e)=>rt(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,i,r){const o=ct(t,e);return r&&(t=e),i||(e={}),e.x=t.x+et(o)*s,e.y=t.y+tt(o)*s,e},toNumberPoints(t){let e=t;return l(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},isSame:(t,e)=>t.x===e.x&&t.y===e.y,reset(t){ht.reset(t)}},ht=at,{getDistanceFrom:lt,copy:dt,getAtan2:ct}=ht;class ut{constructor(t,e){this.set(t,e)}set(t,e){return l(t)?at.copy(this,t):at.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new ut(this)}move(t,e){return at.move(this,t,e),this}scale(t,e){return at.scale(this,t,e),this}scaleOf(t,e,s){return at.scaleOf(this,t,e,s),this}rotate(t,e){return at.rotate(this,t,e),this}rotateOf(t,e){return at.rotate(this,e,t),this}getRotation(t,e,s){return at.getRotation(this,t,e,s)}toInnerOf(t,e){return at.toInnerOf(this,t,e),this}toOuterOf(t,e){return at.toOuterOf(this,t,e),this}getCenter(t){return new ut(at.getCenter(this,t))}getDistance(t){return at.getDistance(this,t)}getDistancePoint(t,e,s,i){return new ut(at.getDistancePoint(this,t,e,s,i))}getAngle(t){return at.getAngle(this,t)}getAtan2(t){return at.getAtan2(this,t)}isSame(t){return at.isSame(this,t)}reset(){return at.reset(this),this}}const _t=new ut;class pt{constructor(t,e,s,i,r,o){this.set(t,e,s,i,r,o)}set(t,e,s,i,r,o){return l(t)?J.copy(this,t):J.set(this,t,e,s,i,r,o),this}setWith(t){return J.copy(this,t),this.scaleX=t.scaleX,this.scaleY=t.scaleY,this}get(){const{a:t,b:e,c:s,d:i,e:r,f:o}=this;return{a:t,b:e,c:s,d:i,e:r,f:o}}clone(){return new pt(this)}translate(t,e){return J.translate(this,t,e),this}translateInner(t,e){return J.translateInner(this,t,e),this}scale(t,e){return J.scale(this,t,e),this}scaleWith(t,e){return J.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return J.pixelScale(this,t),this}scaleOfOuter(t,e,s){return J.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return J.scaleOfInner(this,t,e,s),this}rotate(t){return J.rotate(this,t),this}rotateOfOuter(t,e){return J.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return J.rotateOfInner(this,t,e),this}skew(t,e){return J.skew(this,t,e),this}skewOfOuter(t,e,s){return J.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return J.skewOfInner(this,t,e,s),this}multiply(t){return J.multiply(this,t),this}multiplyParent(t){return J.multiplyParent(this,t),this}divide(t){return J.divide(this,t),this}divideParent(t){return J.divideParent(this,t),this}invert(){return J.invert(this),this}invertWith(){return J.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){J.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){J.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return J.setLayout(this,t,e,s),this}getLayout(t,e,s){return J.getLayout(this,t,e,s)}withScale(t,e){return J.withScale(this,t,e)}reset(){J.reset(this)}}const ft=new pt,gt={tempPointBounds:{},setPoint(t,e,s){t.minX=t.maxX=e,t.minY=t.maxY=s},addPoint(t,e,s){t.minX=e<t.minX?e:t.minX,t.minY=s<t.minY?s:t.minY,t.maxX=e>t.maxX?e:t.maxX,t.maxY=s>t.maxY?s:t.maxY},addBounds(t,e,s,i,r){yt(t,e,s),yt(t,e+i,s+r)},copy(t,e){t.minX=e.minX,t.minY=e.minY,t.maxX=e.maxX,t.maxY=e.maxY},addPointBounds(t,e){t.minX=e.minX<t.minX?e.minX:t.minX,t.minY=e.minY<t.minY?e.minY:t.minY,t.maxX=e.maxX>t.maxX?e.maxX:t.maxX,t.maxY=e.maxY>t.maxY?e.maxY:t.maxY},toBounds(t,e){e.x=t.minX,e.y=t.minY,e.width=t.maxX-t.minX,e.height=t.maxY-t.minY}},{addPoint:yt}=gt;var mt,xt;t.Direction4=void 0,(mt=t.Direction4||(t.Direction4={}))[mt.top=0]="top",mt[mt.right=1]="right",mt[mt.bottom=2]="bottom",mt[mt.left=3]="left",t.Direction9=void 0,(xt=t.Direction9||(t.Direction9={}))[xt.topLeft=0]="topLeft",xt[xt.top=1]="top",xt[xt.topRight=2]="topRight",xt[xt.right=3]="right",xt[xt.bottomRight=4]="bottomRight",xt[xt.bottom=5]="bottom",xt[xt.bottomLeft=6]="bottomLeft",xt[xt.left=7]="left",xt[xt.center=8]="center",xt[xt["top-left"]=0]="top-left",xt[xt["top-right"]=2]="top-right",xt[xt["bottom-right"]=4]="bottom-right",xt[xt["bottom-left"]=6]="bottom-left";const wt=[{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}];wt.forEach(t=>t.type="percent");const vt={directionData:wt,tempPoint:{},get:bt,toPoint(t,e,s,i,r,o){const n=bt(t);s.x=n.x,s.y=n.y,"percent"===n.type&&(s.x*=e.width,s.y*=e.height,r&&(o||(s.x-=r.x,s.y-=r.y),n.x&&(s.x-=1===n.x?r.width:.5===n.x?n.x*r.width:0),n.y&&(s.y-=1===n.y?r.height:.5===n.y?n.y*r.height:0))),i||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s)=>(s||(s={}),vt.toPoint(t,e,s,!0),s)};function bt(e){return r(e)?wt[t.Direction9[e]]:e}const{toPoint:Bt}=vt,kt={toPoint(t,e,s,i,r,o){Bt(t,s,i,r,e,o)}},{tempPointBounds:St,setPoint:Rt,addPoint:Ct,toBounds:Tt}=gt,{toOuterPoint:Pt}=J,{float:Lt,fourNumber:It}=M,{floor:Et,ceil:Ot}=Math;let At,Mt,Wt,Dt;const Ft={},Ut={},Nt={},zt={tempBounds:Nt,set(t,e=0,s=0,i=0,r=0){t.x=e,t.y=s,t.width=i,t.height=r},copy(t,e){t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height},copyAndSpread(t,e,s,i,r){const{x:o,y:n,width:a,height:l}=e;if(h(s)){const e=It(s);i?Yt.set(t,o+e[3],n+e[0],a-e[1]-e[3],l-e[2]-e[0]):Yt.set(t,o-e[3],n-e[0],a+e[1]+e[3],l+e[2]+e[0])}else i&&(s=-s),Yt.set(t,o-s,n-s,a+2*s,l+2*s);r&&("width"===r?(t.y=n,t.height=l):(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},scroll(t,e){t.x+=e.scrollX,t.y+=e.scrollY},getByMove:(t,e,s)=>(t=Object.assign({},t),Yt.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?Ht(e,t):e=t,s||(s=t),e.offsetX=Yt.maxX(s),e.offsetY=Yt.maxY(s),Yt.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e,i){i||at.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,i=s){at.scaleOf(t,e,s,i),t.width*=s,t.height*=i},tempToOuterOf:(t,e)=>(Yt.copy(Nt,t),Yt.toOuterOf(Nt,e),Nt),getOuterOf:(t,e)=>(t=Object.assign({},t),Yt.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:i,d:r,e:o,f:n}=e;i>0?(s.width=t.width*i,s.x=o+t.x*i):(s.width=t.width*-i,s.x=o+t.x*i-s.width),r>0?(s.height=t.height*r,s.y=n+t.y*r):(s.height=t.height*-r,s.y=n+t.y*r-s.height)}else Ft.x=t.x,Ft.y=t.y,Pt(e,Ft,Ut),Rt(St,Ut.x,Ut.y),Ft.x=t.x+t.width,Pt(e,Ft,Ut),Ct(St,Ut.x,Ut.y),Ft.y=t.y+t.height,Pt(e,Ft,Ut),Ct(St,Ut.x,Ut.y),Ft.x=t.x,Pt(e,Ft,Ut),Ct(St,Ut.x,Ut.y),Tt(St,s)},toInnerOf(t,e,s){s||(s=t),Yt.move(s,-e.e,-e.f),Yt.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const i=Math.min(s,Yt.getFitScale(t,e));return new pt(i,0,0,i,-e.x*i,-e.y*i)},getFitScale(t,e,s){const i=t.width/e.width,r=t.height/e.height;return s?Math.max(i,r):Math.min(i,r)},put(t,e,s="center",i=1,o=!0,n){n||(n=e),r(i)&&(i=Yt.getFitScale(t,e,"cover"===i)),Nt.width=o?e.width*=i:e.width*i,Nt.height=o?e.height*=i:e.height*i,kt.toPoint(s,Nt,t,n,!0,!0)},getSpread(t,e,s){const i={};return Yt.copyAndSpread(i,t,e,!1,s),i},spread(t,e,s){Yt.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){Yt.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=Et(t.x),t.y=Et(t.y),t.width=e>t.x?Ot(t.width+e-t.x):Ot(t.width),t.height=s>t.y?Ot(t.height+s-t.y):Ot(t.height)},unsign(t){t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height)},float(t,e){t.x=Lt(t.x,e),t.y=Lt(t.y,e),t.width=Lt(t.width,e),t.height=Lt(t.height,e)},add(t,e,s){At=t.x+t.width,Mt=t.y+t.height,Wt=e.x,Dt=e.y,s||(Wt+=e.width,Dt+=e.height),At=At>Wt?At:Wt,Mt=Mt>Dt?Mt:Dt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=At-t.x,t.height=Mt-t.y},addList(t,e){Yt.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){Yt.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){Yt.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,i=!1){let r,o=!0;for(let n=0,a=e.length;n<a;n++)r=s?s(e[n],n):e[n],r&&(r.width||r.height)&&(o?(o=!1,i||Ht(t,r)):Xt(t,r));o&&Yt.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Rt(St,t.x,t.y):Ct(St,t.x,t.y)),Tt(St,t)},setPoint(t,e){Yt.set(t,e.x,e.y)},addPoint(t,e){Xt(t,e,!0)},getPoints(t){const{x:e,y:s,width:i,height:r}=t;return[{x:e,y:s},{x:e+i,y:s},{x:e+i,y:s+r},{x:e,y:s+r}]},hitRadiusPoint:(t,e,s)=>(s&&(e=at.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=at.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=Yt.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=Yt.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=Yt.tempToOuterOf(e,s)),!Yt.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:i,y:r,width:o,height:n}=e;return At=i+o,Mt=r+n,Wt=t.x+t.width,Dt=t.y+t.height,i=i>t.x?i:t.x,r=r>t.y?r:t.y,At=At<Wt?At:Wt,Mt=Mt<Dt?Mt:Dt,o=At-i,n=Mt-r,{x:i,y:r,width:o,height:n}},intersect(t,e,s){Yt.copy(t,Yt.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){Yt.set(t)}},Yt=zt,{add:Xt,copy:Ht}=Yt;class Gt{get minX(){return zt.minX(this)}get minY(){return zt.minY(this)}get maxX(){return zt.maxX(this)}get maxY(){return zt.maxY(this)}constructor(t,e,s,i){this.set(t,e,s,i)}set(t,e,s,i){return l(t)?zt.copy(this,t):zt.set(this,t,e,s,i),this}get(){const{x:t,y:e,width:s,height:i}=this;return{x:t,y:e,width:s,height:i}}clone(){return new Gt(this)}move(t,e){return zt.move(this,t,e),this}scale(t,e,s){return zt.scale(this,t,e,s),this}scaleOf(t,e,s){return zt.scaleOf(this,t,e,s),this}toOuterOf(t,e){return zt.toOuterOf(this,t,e),this}toInnerOf(t,e){return zt.toInnerOf(this,t,e),this}getFitMatrix(t,e){return zt.getFitMatrix(this,t,e)}put(t,e,s){zt.put(this,t,e,s)}spread(t,e){return zt.spread(this,t,e),this}shrink(t,e){return zt.shrink(this,t,e),this}ceil(){return zt.ceil(this),this}unsign(){return zt.unsign(this),this}float(t){return zt.float(this,t),this}add(t){return zt.add(this,t),this}addList(t){return zt.setList(this,t,!0),this}setList(t){return zt.setList(this,t),this}addListWithFn(t,e){return zt.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return zt.setListWithFn(this,t,e),this}setPoint(t){return zt.setPoint(this,t),this}setPoints(t){return zt.setPoints(this,t),this}addPoint(t){return zt.addPoint(this,t),this}getPoints(){return zt.getPoints(this)}hitPoint(t,e){return zt.hitPoint(this,t,e)}hitRadiusPoint(t,e){return zt.hitRadiusPoint(this,t,e)}hit(t,e){return zt.hit(this,t,e)}includes(t,e){return zt.includes(this,t,e)}intersect(t,e){return zt.intersect(this,t,e),this}getIntersect(t,e){return new Gt(zt.getIntersectData(this,t,e))}isSame(t){return zt.isSame(this,t)}isEmpty(){return zt.isEmpty(this)}reset(){zt.reset(this)}}const jt=new Gt;class Vt{constructor(t,e,s,i,r,o){l(t)?this.copy(t):this.set(t,e,s,i,r,o)}set(t=0,e=0,s=0,i=0,r=0,o=0){this.top=t,this.right=e,this.bottom=s,this.left=i,this.width=r,this.height=o}copy(t){const{top:e,right:s,bottom:i,left:r,width:o,height:n}=t;this.set(e,s,i,r,o,n)}getBoundsFrom(t){const{top:e,right:s,bottom:i,left:r,width:o,height:n}=this;return new Gt(r,e,o||t.width-r-s,n||t.height-e-i)}}const qt={0:1,1:1,2:1,3:1,4:1,5:1,6:1,7:1,8:1,9:1,".":1,e:1,E:1},{randColor:Qt}=M;class Jt{constructor(t){this.repeatMap={},this.name=t}static get(t){return new Jt(t)}static set filter(t){this.filterList=$t(t)}static set exclude(t){this.excludeList=$t(t)}static drawRepaint(t,e){const s=Qt();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const i="hit"===Jt.showBounds,r=t.__nowWorld,o=Qt();i&&(e.setWorld(r),t.__drawHitPath(e),e.fillStyle=o.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(o,2),i?e.stroke():e.strokeWorld(r,o)}log(...t){if(Zt.enable){if(Zt.filterList.length&&Zt.filterList.every(t=>t!==this.name))return;if(Zt.excludeList.length&&Zt.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){Zt.enable&&this.warn(...t)}warn(...t){Zt.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 $t(t){return t?r(t)&&(t=[t]):t=[],t}Jt.filterList=[],Jt.excludeList=[],Jt.showWarn=!0;const Zt=Jt,Kt=Jt.get("RunTime"),te={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const s=m.create(m.RUNTIME);return ee.currentId=ee.idMap[s]=e?performance.now():Date.now(),ee.currentName=ee.nameMap[s]=t,ee.nameToIdMap[t]=s,s},end(t,e){const s=ee.idMap[t],i=ee.nameMap[t],r=e?(performance.now()-s)/1e3:Date.now()-s;ee.idMap[t]=ee.nameMap[t]=ee.nameToIdMap[i]=void 0,Kt.log(i,r,"ms")},endOfName(t,e){const i=ee.nameToIdMap[t];s(i)||ee.end(i,e)}},ee=te,se=[],ie={list:{},add(t,...e){this.list[t]=!0,se.push(...e)},has(t,e){const s=this.list[t];return!s&&e&&this.need(t),s},need(t){console.error("please install and import plugin: "+(t.includes("-x")?"":"@leafer-in/")+t)}};setTimeout(()=>se.forEach(t=>ie.has(t,!0)));const re={editor:t=>ie.need("editor")},oe=Jt.get("UICreator"),ne={list:{},register(t){const{__tag:e}=t.prototype;ae[e]&&oe.repeat(e),ae[e]=t},get(t,e,i,r,o,n){ae[t]||oe.error("not register "+t);const a=new ae[t](e);return s(i)||(a.x=i,r&&(a.y=r),o&&(a.width=o),n&&(a.height=n)),a}},{list:ae}=ne,he=Jt.get("EventCreator"),le={nameList:{},register(t){let e;Object.keys(t).forEach(s=>{e=t[s],r(e)&&(de[e]&&he.repeat(e),de[e]=t)})},changeName(t,e){const s=de[t];if(s){const i=Object.keys(s).find(e=>s[e]===t);i&&(s[i]=e,de[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new de[t](...e)},{nameList:de}=le;class ce{constructor(){this.list=[]}add(t){t.manager=this,this.list.push(t)}get(t){let e;const{list:s}=this;for(let i=0,r=s.length;i<r;i++)if(e=s[i],e.recycled&&e.isSameSize(t))return e.recycled=!1,e.manager||(e.manager=this),e;const i=re.canvas(t);return this.add(i),i}recycle(t){t.recycled=!0}clearRecycled(){let t;const e=[];for(let s=0,i=this.list.length;s<i;s++)t=this.list[s],t.recycled?t.destroy():e.push(t);this.list=e}clear(){this.list.forEach(t=>{t.destroy()}),this.list.length=0}destroy(){this.clear()}}function ue(t,e,s,i){var r,o=arguments.length,n=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(n=(o<3?r(n):o>3?r(e,s,n):r(e,s))||n);return o>3&&n&&Object.defineProperty(e,s,n),n}function _e(t,e,s,i){return new(s||(s=Promise))(function(r,o){function n(t){try{h(i.next(t))}catch(t){o(t)}}function a(t){try{h(i.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof s?e:new s(function(t){t(e)})).then(n,a)}h((i=i.apply(t,e||[])).next())})}function pe(t){return(e,s)=>{t||(t=s);const i={get(){return this.context[t]},set(e){this.context[t]=e}};"strokeCap"===s&&(i.set=function(e){this.context[t]="none"===e?"butt":e}),Object.defineProperty(e,s,i)}}"function"==typeof SuppressedError&&SuppressedError;const fe=[];function ge(){return(t,e)=>{fe.push(e)}}const ye=[];class me{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||ye)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;fe.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,s,i,r,o){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,i,r,o){l(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,i,r,o)}translate(t,e){}scale(t,e){}rotate(t){}fill(t,e){}stroke(t){}clip(t,e){}fillRect(t,e,s,i){}strokeRect(t,e,s,i){}clearRect(t,e,s,i){}drawImage(t,e,s,i,r,o,n,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/i*a;i+=e,e=0,o+=t,a-=t}if(s<0){const t=-s/r*h;r+=s,s=0,n+=t,h-=t}this.context.drawImage(t,e,s,i,r,o,n,a,h);break;case 5:this.context.drawImage(t,e,s,i,r);break;case 3:this.context.drawImage(t,e,s)}}beginPath(){}moveTo(t,e){}lineTo(t,e){}bezierCurveTo(t,e,s,i,r,o){}quadraticCurveTo(t,e,s,i){}closePath(){}arc(t,e,s,i,r,o){}arcTo(t,e,s,i,r){}ellipse(t,e,s,i,r,o,n,a){}rect(t,e,s,i){}roundRect(t,e,s,i,r){}createConicGradient(t,e,s){}createLinearGradient(t,e,s,i){}createPattern(t,e){}createRadialGradient(t,e,s,i,r,o){}fillText(t,e,s,i){}measureText(t){}strokeText(t,e,s,i){}destroy(){this.context=null}}ue([pe("imageSmoothingEnabled")],me.prototype,"smooth",void 0),ue([pe("imageSmoothingQuality")],me.prototype,"smoothLevel",void 0),ue([pe("globalAlpha")],me.prototype,"opacity",void 0),ue([pe()],me.prototype,"fillStyle",void 0),ue([pe()],me.prototype,"strokeStyle",void 0),ue([pe("lineWidth")],me.prototype,"strokeWidth",void 0),ue([pe("lineCap")],me.prototype,"strokeCap",void 0),ue([pe("lineJoin")],me.prototype,"strokeJoin",void 0),ue([pe("lineDashOffset")],me.prototype,"dashOffset",void 0),ue([pe()],me.prototype,"miterLimit",void 0),ue([pe()],me.prototype,"shadowBlur",void 0),ue([pe()],me.prototype,"shadowColor",void 0),ue([pe()],me.prototype,"shadowOffsetX",void 0),ue([pe()],me.prototype,"shadowOffsetY",void 0),ue([pe()],me.prototype,"filter",void 0),ue([pe()],me.prototype,"font",void 0),ue([pe()],me.prototype,"fontKerning",void 0),ue([pe()],me.prototype,"fontStretch",void 0),ue([pe()],me.prototype,"fontVariantCaps",void 0),ue([pe()],me.prototype,"textAlign",void 0),ue([pe()],me.prototype,"textBaseline",void 0),ue([pe()],me.prototype,"textRendering",void 0),ue([pe()],me.prototype,"wordSpacing",void 0),ue([pe()],me.prototype,"letterSpacing",void 0),ue([pe()],me.prototype,"direction",void 0),ue([ge()],me.prototype,"setTransform",null),ue([ge()],me.prototype,"resetTransform",null),ue([ge()],me.prototype,"getTransform",null),ue([ge()],me.prototype,"save",null),ue([ge()],me.prototype,"restore",null),ue([ge()],me.prototype,"translate",null),ue([ge()],me.prototype,"scale",null),ue([ge()],me.prototype,"rotate",null),ue([ge()],me.prototype,"fill",null),ue([ge()],me.prototype,"stroke",null),ue([ge()],me.prototype,"clip",null),ue([ge()],me.prototype,"fillRect",null),ue([ge()],me.prototype,"strokeRect",null),ue([ge()],me.prototype,"clearRect",null),ue([ge()],me.prototype,"beginPath",null),ue([ge()],me.prototype,"moveTo",null),ue([ge()],me.prototype,"lineTo",null),ue([ge()],me.prototype,"bezierCurveTo",null),ue([ge()],me.prototype,"quadraticCurveTo",null),ue([ge()],me.prototype,"closePath",null),ue([ge()],me.prototype,"arc",null),ue([ge()],me.prototype,"arcTo",null),ue([ge()],me.prototype,"ellipse",null),ue([ge()],me.prototype,"rect",null),ue([ge()],me.prototype,"roundRect",null),ue([ge()],me.prototype,"createConicGradient",null),ue([ge()],me.prototype,"createLinearGradient",null),ue([ge()],me.prototype,"createPattern",null),ue([ge()],me.prototype,"createRadialGradient",null),ue([ge()],me.prototype,"fillText",null),ue([ge()],me.prototype,"measureText",null),ue([ge()],me.prototype,"strokeText",null);const{copy:xe,multiplyParent:we,pixelScale:ve}=J,{round:be}=Math,Be=new Gt,ke=new Gt,Se={width:1,height:1,pixelRatio:1},Re=["width","height","pixelRatio"];class Ce extends me{get width(){return this.size.width}get height(){return this.size.height}get pixelRatio(){return this.size.pixelRatio}get pixelWidth(){return this.width*this.pixelRatio||0}get pixelHeight(){return this.height*this.pixelRatio||0}get pixelSnap(){return this.config.pixelSnap}set pixelSnap(t){this.config.pixelSnap=t}get allowBackgroundColor(){return this.view&&this.parentView}constructor(t,e){super(),this.size={},this.worldTransform={},t||(t=Se),this.manager=e,this.innerId=m.create(m.CNAVAS);const{width:s,height:i,pixelRatio:r}=t;this.autoLayout=!s||!i,this.size.pixelRatio=r||g.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let s;this.context&&!this.unreal&&e&&this.width&&(s=this.getSameCanvas(),s.copyWorld(this));const i=this.size;c.copyAttrs(i,t,Re),Re.forEach(t=>i[t]||(i[t]=1)),this.bounds=new Gt(0,0,this.width,this.height),this.updateViewSize(),this.updateClientBounds(),this.context&&(this.smooth=this.config.smooth,!this.unreal&&s&&(this.clearWorld(s.bounds),this.copyWorld(s),s.recycle()))}updateViewSize(){}updateClientBounds(){}getClientBounds(t){return t&&this.updateClientBounds(),this.clientBounds||this.bounds}startAutoLayout(t,e){}stopAutoLayout(){}setCursor(t){}setWorld(t,e){const{pixelRatio:s,pixelSnap:i}=this,r=this.worldTransform;e&&we(t,e,r),ve(t,s,r),i&&!t.ignorePixelSnap&&(t.half&&t.half*s%2?(r.e=be(r.e-.5)+.5,r.f=be(r.f-.5)+.5):(r.e=be(r.e),r.f=be(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,s,i){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,i)}setStrokeOptions(t,e){let{strokeCap:i,strokeJoin:r,dashPattern:o,dashOffset:n,miterLimit:a}=t;e&&(e.strokeCap&&(i=e.strokeCap),e.strokeJoin&&(r=e.strokeJoin),s(e.dashPattern)||(o=e.dashPattern),s(e.dashOffset)||(n=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=i,this.strokeJoin=r,this.dashPattern=o,this.dashOffset=n,this.miterLimit=a}saveBlendMode(t){this.savedBlendMode=this.blendMode,this.blendMode=t}restoreBlendMode(){this.blendMode=this.savedBlendMode}hitFill(t,e){return!0}hitStroke(t,e){return!0}hitPixel(t,e,s=1){return!0}setWorldShadow(t,e,s,i){const{pixelRatio:r}=this;this.shadowOffsetX=t*r,this.shadowOffsetY=e*r,this.shadowBlur=s*r,this.shadowColor=i||"black"}setWorldBlur(t){const{pixelRatio:e}=this;this.filter=`blur(${t*e}px)`}copyWorld(t,e,s,i,r=!0){i&&(this.blendMode=i),e?(this.setTempPixelBounds(e,r),s?(this.setTempPixelBounds2(s,r),s=ke):s=Be,this.drawImage(t.view,Be.x,Be.y,Be.width,Be.height,s.x,s.y,s.width,s.height)):this.drawImage(t.view,0,0),i&&(this.blendMode="source-over")}copyWorldToInner(t,e,s,i,r=!0){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,zt.tempToOuterOf(s,e),i,r),this.restore()):(i&&(this.blendMode=i),this.setTempPixelBounds(e,r),this.drawImage(t.view,Be.x,Be.y,Be.width,Be.height,s.x,s.y,s.width,s.height),i&&(this.blendMode="source-over"))}copyWorldByReset(t,e,s,i,r,o=!0){this.resetTransform(),this.copyWorld(t,e,s,i,o),r||this.useWorldTransform()}useGrayscaleAlpha(t){let e,s;this.setTempPixelBounds(t,!0,!0);const{context:i}=this,r=i.getImageData(Be.x,Be.y,Be.width,Be.height),{data:o}=r;for(let t=0,i=o.length;t<i;t+=4)s=.299*o[t]+.587*o[t+1]+.114*o[t+2],(e=o[t+3])&&(o[t+3]=255===e?s:e*(s/255));i.putImageData(r,Be.x,Be.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,i){s&&(this.blendMode=s),this.fillStyle=e,this.setTempPixelBounds(t,i),this.fillRect(Be.x,Be.y,Be.width,Be.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s,i){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempPixelBounds(t,i),this.strokeRect(Be.x,Be.y,Be.width,Be.height),s&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Be.x,Be.y,Be.width,Be.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Be.x,Be.y,Be.width,Be.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,s){this.copyToPixelBounds(Be,t,e,s)}setTempPixelBounds2(t,e,s){this.copyToPixelBounds(ke,t,e,s)}copyToPixelBounds(t,e,s,i){t.set(e),i&&t.intersect(this.bounds),t.scale(this.pixelRatio),s&&t.ceil()}isSameSize(t){return this.width===t.width&&this.height===t.height&&(!t.pixelRatio||this.pixelRatio===t.pixelRatio)}getSameCanvas(t,e){const{size:s,pixelSnap:i}=this,r=this.manager?this.manager.get(s):re.canvas(Object.assign({},s));return r.save(),t&&(xe(r.worldTransform,this.worldTransform),r.useWorldTransform()),e&&(r.smooth=this.smooth),r.pixelSnap!==i&&(r.pixelSnap=i),r}recycle(t){this.recycled||(this.restore(),t?this.clearWorld(t):this.clear(),this.manager?this.manager.recycle(this):this.destroy())}updateRender(t){}unrealCanvas(){}destroy(){this.manager=this.view=this.parentView=null}}const Te={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Pe={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Le=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},Pe),Ie={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},Ee={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},Oe=Object.assign(Object.assign({},Ee),Pe),Ae=Le,Me={};for(let t in Ae)Me[Ae[t]]=t;const We={};for(let t in Ae)We[Ae[t]]=Ie[t];const De={drawRoundRect(t,e,s,i,r,o){const n=M.fourNumber(o,Math.min(i/2,r/2)),a=e+i,h=s+r;n[0]?t.moveTo(e+n[0],s):t.moveTo(e,s),n[1]?t.arcTo(a,s,a,h,n[1]):t.lineTo(a,s),n[2]?t.arcTo(a,h,e,h,n[2]):t.lineTo(a,h),n[3]?t.arcTo(e,h,e,s,n[3]):t.lineTo(e,h),n[0]?t.arcTo(e,s,a,s,n[0]):t.lineTo(e,s)}},{sin:Fe,cos:Ue,hypot:Ne,atan2:ze,ceil:Ye,abs:Xe,PI:He,sqrt:Ge,pow:je}=Math,{setPoint:Ve,addPoint:qe}=gt,{set:Qe,toNumberPoints:Je}=at,{M:$e,L:Ze,C:Ke,Q:ts,Z:es}=Le,ss={},is={points(t,e,s,i){let r=Je(e);if(t.push($e,r[0],r[1]),s&&r.length>5){let e,o,n,a,h,l,d,c,u,_,p,f,g,y=r.length;const m=!0===s?.5:s;i&&(r=[r[y-2],r[y-1],...r,r[0],r[1],r[2],r[3]],y=r.length);for(let s=2;s<y-2;s+=2)e=r[s-2],o=r[s-1],n=r[s],a=r[s+1],h=r[s+2],l=r[s+3],p=Ge(je(n-e,2)+je(a-o,2)),f=Ge(je(h-n,2)+je(l-a,2)),(p||f)&&(g=p+f,p=m*p/g,f=m*f/g,h-=e,l-=o,d=n-p*h,c=a-p*l,2===s?i||t.push(ts,d,c,n,a):t.push(Ke,u,_,d,c,n,a),u=n+f*h,_=a+f*l);i||t.push(ts,u,_,r[y-2],r[y-1])}else for(let e=2,s=r.length;e<s;e+=2)t.push(Ze,r[e],r[e+1]);i&&t.push(es)},rect(t,e,s,i,r){Te.creator.path=t,Te.creator.moveTo(e,s).lineTo(e+i,s).lineTo(e+i,s+r).lineTo(e,s+r).lineTo(e,s)},roundRect(t,e,s,i,r,o){Te.creator.path=[],De.drawRoundRect(Te.creator,e,s,i,r,o),t.push(...Te.convertToCanvasData(Te.creator.path,!0))},arcTo(t,e,s,i,r,o,n,a,h,l,d){const c=i-e,u=r-s,_=o-i,p=n-r;let f=ze(u,c),g=ze(p,_);const y=Ne(c,u),m=Ne(_,p);let x=g-f;if(x<0&&(x+=F),y<1e-12||m<1e-12||x<1e-12||Xe(x-He)<1e-12)return t&&t.push(Ze,i,r),h&&(Ve(h,e,s),qe(h,i,r)),d&&Qe(d,e,s),void(l&&Qe(l,i,r));const w=c*p-_*u<0,v=w?-1:1,b=a/Ue(x/2),B=i+b*Ue(f+x/2+U*v),k=r+b*Fe(f+x/2+U*v);return f-=U*v,g-=U*v,ns(t,B,k,a,a,0,f/D,g/D,w,h,l,d)},arc:(t,e,s,i,r,o,n,a,h,l)=>ns(t,e,s,i,i,0,r,o,n,a,h,l),ellipse(t,e,s,i,r,o,n,a,h,l,d,c){const u=o*D,_=Fe(u),p=Ue(u);let f=n*D,g=a*D;f>He&&(f-=F),g<0&&(g+=F);let y=g-f;y<0?y+=F:y>F&&(y-=F),h&&(y-=F);const m=Ye(Xe(y/U)),x=y/m,w=Fe(x/4),v=8/3*w*w/Fe(x/2);g=f+x;let b,B,k,S,R,C,T,P,L=Ue(f),I=Fe(f),E=k=p*i*L-_*r*I,O=S=_*i*L+p*r*I,A=e+k,M=s+S;t&&t.push(t.length?Ze:$e,A,M),l&&Ve(l,A,M),c&&Qe(c,A,M);for(let o=0;o<m;o++)b=Ue(g),B=Fe(g),k=p*i*b-_*r*B,S=_*i*b+p*r*B,R=e+E-v*(p*i*I+_*r*L),C=s+O-v*(_*i*I-p*r*L),T=e+k+v*(p*i*B+_*r*b),P=s+S+v*(_*i*B-p*r*b),t&&t.push(Ke,R,C,T,P,e+k,s+S),l&&os(e+E,s+O,R,C,T,P,e+k,s+S,l,!0),E=k,O=S,L=b,I=B,f=g,g+=x;d&&Qe(d,e+k,s+S)},quadraticCurveTo(t,e,s,i,r,o,n){t.push(Ke,(e+2*i)/3,(s+2*r)/3,(o+2*i)/3,(n+2*r)/3,o,n)},toTwoPointBoundsByQuadraticCurve(t,e,s,i,r,o,n,a){os(t,e,(t+2*s)/3,(e+2*i)/3,(r+2*s)/3,(o+2*i)/3,r,o,n,a)},toTwoPointBounds(t,e,s,i,r,o,n,a,h,l){const d=[];let c,u,_,p,f,g,y,m,x=t,w=s,v=r,b=n;for(let t=0;t<2;++t)if(1==t&&(x=e,w=i,v=o,b=a),c=-3*x+9*w-9*v+3*b,u=6*x-12*w+6*v,_=3*w-3*x,Math.abs(c)<1e-12){if(Math.abs(u)<1e-12)continue;p=-_/u,0<p&&p<1&&d.push(p)}else y=u*u-4*_*c,m=Math.sqrt(y),y<0||(f=(-u+m)/(2*c),0<f&&f<1&&d.push(f),g=(-u-m)/(2*c),0<g&&g<1&&d.push(g));l?qe(h,t,e):Ve(h,t,e),qe(h,n,a);for(let l=0,c=d.length;l<c;l++)rs(d[l],t,e,s,i,r,o,n,a,ss),qe(h,ss.x,ss.y)},getPointAndSet(t,e,s,i,r,o,n,a,h,l){const d=1-t,c=d*d*d,u=3*d*d*t,_=3*d*t*t,p=t*t*t;l.x=c*e+u*i+_*o+p*a,l.y=c*s+u*r+_*n+p*h},getPoint(t,e,s,i,r,o,n,a,h){const l={};return rs(t,e,s,i,r,o,n,a,h,l),l},getDerivative(t,e,s,i,r){const o=1-t;return 3*o*o*(s-e)+6*o*t*(i-s)+3*t*t*(r-i)}},{getPointAndSet:rs,toTwoPointBounds:os,ellipse:ns}=is,{sin:as,cos:hs,sqrt:ls,atan2:ds}=Math,{ellipse:cs}=is,us={ellipticalArc(t,e,s,i,r,o,n,a,h,l,d){const c=(h-e)/2,u=(l-s)/2,_=o*D,p=as(_),f=hs(_),y=-f*c-p*u,m=-f*u+p*c,x=i*i,w=r*r,v=m*m,b=y*y,B=x*w-x*v-w*b;let k=0;if(B<0){const t=ls(1-B/(x*w));i*=t,r*=t}else k=(n===a?-1:1)*ls(B/(x*v+w*b));const S=k*i*m/r,R=-k*r*y/i,C=ds((m-R)/r,(y-S)/i),T=ds((-m-R)/r,(-y-S)/i);let P=T-C;0===a&&P>0?P-=F:1===a&&P<0&&(P+=F);const L=e+c+f*S-p*R,I=s+u+p*S+f*R,E=P<0?1:0;d||g.ellipseToCurve?cs(t,L,I,i,r,o,C/D,T/D,E):i!==r||o?t.push(Le.G,L,I,i,r,o,C/D,T/D,E):t.push(Le.O,L,I,i,C/D,T/D,E)}},_s={toCommand:t=>[],toNode:t=>[]},{M:ps,m:fs,L:gs,l:ys,H:ms,h:xs,V:ws,v:vs,C:bs,c:Bs,S:ks,s:Ss,Q:Rs,q:Cs,T:Ts,t:Ps,A:Ls,a:Is,Z:Es,z:Os,N:As,D:Ms,X:Ws,G:Ds,F:Fs,O:Us,P:Ns,U:zs}=Le,{rect:Ys,roundRect:Xs,arcTo:Hs,arc:Gs,ellipse:js,quadraticCurveTo:Vs}=is,{ellipticalArc:qs}=us,Qs=Jt.get("PathConvert"),Js={},$s={current:{dot:0},stringify(t,e){let s,i,r,o=0,n=t.length,a="";for(;o<n;){i=t[o],s=We[i],a+=i===r?" ":Me[i];for(let i=1;i<s;i++)a+=M.float(t[o+i],e),i===s-1||(a+=" ");r=i,o+=s}return a},parse(t,e){let s,i,r,o="";const n=[],a=e?Oe:Ee;for(let e=0,h=t.length;e<h;e++)i=t[e],qt[i]?("."===i&&(Zs.dot&&(Ks(n,o),o=""),Zs.dot++),"0"===o&&"."!==i&&(Ks(n,o),o=""),o+=i):Le[i]?(o&&(Ks(n,o),o=""),Zs.name=Le[i],Zs.length=Ie[i],Zs.index=0,Ks(n,Zs.name),!s&&a[i]&&(s=!0)):"-"===i||"+"===i?"e"===r||"E"===r?o+=i:(o&&Ks(n,o),o=i):o&&(Ks(n,o),o=""),r=i;return o&&Ks(n,o),s?$s.toCanvasData(n,e):n},toCanvasData(t,e){let s,i,r,o,n,a=0,h=0,l=0,d=0,c=0,u=t.length;const _=[];for(;c<u;){switch(r=t[c],r){case fs:t[c+1]+=a,t[c+2]+=h;case ps:a=t[c+1],h=t[c+2],_.push(ps,a,h),c+=3;break;case xs:t[c+1]+=a;case ms:a=t[c+1],_.push(gs,a,h),c+=2;break;case vs:t[c+1]+=h;case ws:h=t[c+1],_.push(gs,a,h),c+=2;break;case ys:t[c+1]+=a,t[c+2]+=h;case gs:a=t[c+1],h=t[c+2],_.push(gs,a,h),c+=3;break;case Ss:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=ks;case ks:n=o===bs||o===ks,l=n?2*a-s:t[c+1],d=n?2*h-i:t[c+2],s=t[c+1],i=t[c+2],a=t[c+3],h=t[c+4],_.push(bs,l,d,s,i,a,h),c+=5;break;case Bs:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,t[c+5]+=a,t[c+6]+=h,r=bs;case bs:s=t[c+3],i=t[c+4],a=t[c+5],h=t[c+6],_.push(bs,t[c+1],t[c+2],s,i,a,h),c+=7;break;case Ps:t[c+1]+=a,t[c+2]+=h,r=Ts;case Ts:n=o===Rs||o===Ts,s=n?2*a-s:t[c+1],i=n?2*h-i:t[c+2],e?Vs(_,a,h,s,i,t[c+1],t[c+2]):_.push(Rs,s,i,t[c+1],t[c+2]),a=t[c+1],h=t[c+2],c+=3;break;case Cs:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Rs;case Rs:s=t[c+1],i=t[c+2],e?Vs(_,a,h,s,i,t[c+3],t[c+4]):_.push(Rs,s,i,t[c+3],t[c+4]),a=t[c+3],h=t[c+4],c+=5;break;case Is:t[c+6]+=a,t[c+7]+=h;case Ls:qs(_,a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],e),a=t[c+6],h=t[c+7],c+=8;break;case Os:case Es:_.push(Es),c++;break;case As:a=t[c+1],h=t[c+2],e?Ys(_,a,h,t[c+3],t[c+4]):ti(_,t,c,5),c+=5;break;case Ms:a=t[c+1],h=t[c+2],e?Xs(_,a,h,t[c+3],t[c+4],[t[c+5],t[c+6],t[c+7],t[c+8]]):ti(_,t,c,9),c+=9;break;case Ws:a=t[c+1],h=t[c+2],e?Xs(_,a,h,t[c+3],t[c+4],t[c+5]):ti(_,t,c,6),c+=6;break;case Ds:js(e?_:ti(_,t,c,9),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],t[c+7],t[c+8],null,Js),a=Js.x,h=Js.y,c+=9;break;case Fs:e?js(_,t[c+1],t[c+2],t[c+3],t[c+4],0,0,360,!1):ti(_,t,c,5),a=t[c+1]+t[c+3],h=t[c+2],c+=5;break;case Us:Gs(e?_:ti(_,t,c,7),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],null,Js),a=Js.x,h=Js.y,c+=7;break;case Ns:e?Gs(_,t[c+1],t[c+2],t[c+3],0,360,!1):ti(_,t,c,4),a=t[c+1]+t[c+3],h=t[c+2],c+=4;break;case zs:Hs(e?_:ti(_,t,c,6),a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],null,Js),a=Js.x,h=Js.y,c+=6;break;default:return Qs.error(`command: ${r} [index:${c}]`,t),_}o=r}return _},objectToCanvasData(t){if(t[0].name.length>1)return _s.toCommand(t);{const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(ps,t.x,t.y);break;case"L":e.push(gs,t.x,t.y);break;case"C":e.push(bs,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Rs,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(Es)}}),e}},copyData(t,e,s,i){for(let r=s,o=s+i;r<o;r++)t.push(e[r])},pushData(t,e){Zs.index===Zs.length&&(Zs.index=1,t.push(Zs.name)),t.push(Number(e)),Zs.index++,Zs.dot=0}},{current:Zs,pushData:Ks,copyData:ti}=$s,{M:ei,L:si,C:ii,Q:ri,Z:oi,N:ni,D:ai,X:hi,G:li,F:di,O:ci,P:ui,U:_i}=Le,{getMinDistanceFrom:pi,getRadianFrom:fi}=at,{tan:gi,min:yi,abs:mi}=Math,xi={},wi={beginPath(t){t.length=0},moveTo(t,e,s){t.push(ei,e,s)},lineTo(t,e,s){t.push(si,e,s)},bezierCurveTo(t,e,s,i,r,o,n){t.push(ii,e,s,i,r,o,n)},quadraticCurveTo(t,e,s,i,r){t.push(ri,e,s,i,r)},closePath(t){t.push(oi)},rect(t,e,s,i,r){t.push(ni,e,s,i,r)},roundRect(t,e,s,i,r,o){if(n(o))t.push(hi,e,s,i,r,o);else{const n=M.fourNumber(o);n?t.push(ai,e,s,i,r,...n):t.push(ni,e,s,i,r)}},ellipse(t,e,s,r,o,n,a,h,l){i(n)?t.push(di,e,s,r,o):(i(a)&&(a=0),i(h)&&(h=360),t.push(li,e,s,r,o,n,a,h,l?1:0))},arc(t,e,s,r,o,n,a){i(o)?t.push(ui,e,s,r):(i(n)&&(n=360),t.push(ci,e,s,r,o,n,a?1:0))},arcTo(t,e,i,r,o,n,a,h){if(!s(a)){const t=pi(a,h,e,i,r,o);n=yi(n,yi(t/2,t/2*mi(gi(fi(a,h,e,i,r,o)/2))))}t.push(_i,e,i,r,o,n)},drawEllipse(t,e,s,r,o,n,a,h,l){is.ellipse(null,e,s,r,o,i(n)?0:n,i(a)?0:a,i(h)?360:h,l,null,null,xi),t.push(ei,xi.x,xi.y),vi(t,e,s,r,o,n,a,h,l)},drawArc(t,e,s,r,o,n,a){is.arc(null,e,s,r,i(o)?0:o,i(n)?360:n,a,null,null,xi),t.push(ei,xi.x,xi.y),bi(t,e,s,r,o,n,a)},drawPoints(t,e,s,i){is.points(t,e,s,i)}},{ellipse:vi,arc:bi}=wi,{moveTo:Bi,lineTo:ki,quadraticCurveTo:Si,bezierCurveTo:Ri,closePath:Ci,beginPath:Ti,rect:Pi,roundRect:Li,ellipse:Ii,arc:Ei,arcTo:Oi,drawEllipse:Ai,drawArc:Mi,drawPoints:Wi}=wi;class Di{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?r(t)?Te.parse(t):t:[],this}beginPath(){return Ti(this.__path),this.paint(),this}moveTo(t,e){return Bi(this.__path,t,e),this.paint(),this}lineTo(t,e){return ki(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,i,r,o){return Ri(this.__path,t,e,s,i,r,o),this.paint(),this}quadraticCurveTo(t,e,s,i){return Si(this.__path,t,e,s,i),this.paint(),this}closePath(){return Ci(this.__path),this.paint(),this}rect(t,e,s,i){return Pi(this.__path,t,e,s,i),this.paint(),this}roundRect(t,e,s,i,r){return Li(this.__path,t,e,s,i,r),this.paint(),this}ellipse(t,e,s,i,r,o,n,a){return Ii(this.__path,t,e,s,i,r,o,n,a),this.paint(),this}arc(t,e,s,i,r,o){return Ei(this.__path,t,e,s,i,r,o),this.paint(),this}arcTo(t,e,s,i,r){return Oi(this.__path,t,e,s,i,r),this.paint(),this}drawEllipse(t,e,s,i,r,o,n,a){return Ai(this.__path,t,e,s,i,r,o,n,a),this.paint(),this}drawArc(t,e,s,i,r,o){return Mi(this.__path,t,e,s,i,r,o),this.paint(),this}drawPoints(t,e,s){return Wi(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:Fi,L:Ui,C:Ni,Q:zi,Z:Yi,N:Xi,D:Hi,X:Gi,G:ji,F:Vi,O:qi,P:Qi,U:Ji}=Le,$i=Jt.get("PathDrawer"),Zi={drawPathByData(t,e){if(!e)return;let s,i=0,r=e.length;for(;i<r;)switch(s=e[i],s){case Fi:t.moveTo(e[i+1],e[i+2]),i+=3;break;case Ui:t.lineTo(e[i+1],e[i+2]),i+=3;break;case Ni:t.bezierCurveTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5],e[i+6]),i+=7;break;case zi:t.quadraticCurveTo(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Yi:t.closePath(),i+=1;break;case Xi:t.rect(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Hi:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],[e[i+5],e[i+6],e[i+7],e[i+8]]),i+=9;break;case Gi:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;case ji:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]*D,e[i+6]*D,e[i+7]*D,e[i+8]),i+=9;break;case Vi:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],0,0,F,!1),i+=5;break;case qi:t.arc(e[i+1],e[i+2],e[i+3],e[i+4]*D,e[i+5]*D,e[i+6]),i+=7;break;case Qi:t.arc(e[i+1],e[i+2],e[i+3],0,F,!1),i+=4;break;case Ji:t.arcTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;default:return void $i.error(`command: ${s} [index:${i}]`,e)}}},{M:Ki,L:tr,C:er,Q:sr,Z:ir,N:rr,D:or,X:nr,G:ar,F:hr,O:lr,P:dr,U:cr}=Le,{toTwoPointBounds:ur,toTwoPointBoundsByQuadraticCurve:_r,arcTo:pr,arc:fr,ellipse:gr}=is,{addPointBounds:yr,copy:mr,addPoint:xr,setPoint:wr,addBounds:vr,toBounds:br}=gt,Br=Jt.get("PathBounds");let kr,Sr,Rr;const Cr={},Tr={},Pr={},Lr={toBounds(t,e){Lr.toTwoPointBounds(t,Tr),br(Tr,e)},toTwoPointBounds(t,e){if(!t||!t.length)return wr(e,0,0);let s,i,r,o,n,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(n=t[a],0===a&&(n===ir||n===er||n===sr?wr(e,h,l):wr(e,t[a+1],t[a+2])),n){case Ki:case tr:h=t[a+1],l=t[a+2],xr(e,h,l),a+=3;break;case er:r=t[a+5],o=t[a+6],ur(h,l,t[a+1],t[a+2],t[a+3],t[a+4],r,o,Cr),yr(e,Cr),h=r,l=o,a+=7;break;case sr:s=t[a+1],i=t[a+2],r=t[a+3],o=t[a+4],_r(h,l,s,i,r,o,Cr),yr(e,Cr),h=r,l=o,a+=5;break;case ir:a+=1;break;case rr:h=t[a+1],l=t[a+2],vr(e,h,l,t[a+3],t[a+4]),a+=5;break;case or:case nr:h=t[a+1],l=t[a+2],vr(e,h,l,t[a+3],t[a+4]),a+=n===or?9:6;break;case ar:gr(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],Cr,Pr),0===a?mr(e,Cr):yr(e,Cr),h=Pr.x,l=Pr.y,a+=9;break;case hr:h=t[a+1],l=t[a+2],Sr=t[a+3],Rr=t[a+4],vr(e,h-Sr,l-Rr,2*Sr,2*Rr),h+=Sr,a+=5;break;case lr:fr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Cr,Pr),0===a?mr(e,Cr):yr(e,Cr),h=Pr.x,l=Pr.y,a+=7;break;case dr:h=t[a+1],l=t[a+2],kr=t[a+3],vr(e,h-kr,l-kr,2*kr,2*kr),h+=kr,a+=4;break;case cr:pr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Cr,Pr),0===a?mr(e,Cr):yr(e,Cr),h=Pr.x,l=Pr.y,a+=6;break;default:return void Br.error(`command: ${n} [index:${a}]`,t)}}},{M:Ir,L:Er,Z:Or}=Le,{getCenterX:Ar,getCenterY:Mr}=at,{arcTo:Wr}=wi,Dr={smooth(t,e,s){let i,r,o,n=0,a=0,h=0,l=0,d=0,c=0,u=0,_=0,p=0;const f=t.length,g=[];for(;n<f;){switch(i=t[n],i){case Ir:l=_=t[n+1],d=p=t[n+2],n+=3,t[n]===Er?(c=t[n+1],u=t[n+2],g.push(Ir,Ar(l,c),Mr(d,u))):g.push(Ir,l,d);break;case Er:switch(a=t[n+1],h=t[n+2],n+=3,t[n]){case Er:Wr(g,a,h,t[n+1],t[n+2],e,_,p);break;case Or:Wr(g,a,h,l,d,e,_,p);break;default:g.push(Er,a,h)}_=a,p=h;break;case Or:r!==Or&&(Wr(g,l,d,c,u,e,_,p),g.push(Or)),n+=1;break;default:o=We[i];for(let e=0;e<o;e++)g.push(t[n+e]);n+=o}r=i}return i!==Or&&(g[1]=l,g[2]=d),g}};function Fr(t){return new Di(t)}const Ur=Fr();Te.creator=Fr(),Te.parse=$s.parse,Te.convertToCanvasData=$s.toCanvasData;const{drawRoundRect:Nr}=De;function zr(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,i,r){Nr(this,t,e,s,i,r)})}(t)}const Yr={alphaPixelTypes:["png","webp","svg"],upperCaseTypeMap:{},mineType:t=>!t||t.startsWith("image")?t:("jpg"===t&&(t="jpeg"),"image/"+t),fileType(t){const e=t.split(".");return e[e.length-1]},isOpaqueImage(t){const e=Xr.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{}}}},Xr=Yr;Xr.alphaPixelTypes.forEach(t=>Xr.upperCaseTypeMap[t]=t.toUpperCase());const Hr=Jt.get("TaskProcessor");class Gr{constructor(t){this.parallel=!0,this.time=1,this.id=m.create(m.TASK),this.task=t}run(){return _e(this,void 0,void 0,function*(){try{if(this.isComplete)return;if(this.canUse&&!this.canUse())return this.cancel();this.task&&this.parent.running&&(yield this.task())}catch(t){Hr.error(t)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}}class jr{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,s=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(s+=this.list[i].time,i===this.finishedIndex&&(e=s)):e+=this.list[i].time;return this.isComplete?1:s/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&c.assign(this.config,t),this.empty()}add(t,e,i){let r,o,a,h;const l=new Gr(t);return l.parent=this,n(e)?h=e:e&&(o=e.parallel,r=e.start,a=e.time,h=e.delay,i||(i=e.canUse)),a&&(l.time=a),!1===o&&(l.parallel=!1),i&&(l.canUse=i),s(h)?this.push(l,r):(this.delayNumber++,setTimeout(()=>{this.delayNumber&&(this.delayNumber--,this.push(l,r))},h)),this.isComplete=!1,l}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++,t.isCancel?this.runTask():this.nextTask()}).catch(t=>{this.onError(t)}):this.timer=setTimeout(()=>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;const{config:e,list:s,index:i}=this;this.parallelList=[],this.parallelSuccessNumber=0;let r=i+e.parallel;if(r>s.length&&(r=s.length),e.parallel>1)for(let e=i;e<r&&(t=s[e],t.parallel);e++)this.parallelList.push(t)}fillParallelTask(){let t;const e=this.parallelList;this.parallelSuccessNumber++,e.pop();const s=e.length,i=this.finishedIndex+s;if(e.length){if(!this.running)return;i<this.total&&(t=this.list[i],t&&t.parallel&&(e.push(t),this.runParallelTask(t)))}else this.index+=this.parallelSuccessNumber,this.parallelSuccessNumber=0,this.nextTask()}onComplete(){this.stop(),this.config.onComplete&&this.config.onComplete()}onTask(t){t.complete(),this.config.onTask&&this.config.onTask()}onParallelError(t){this.parallelList.forEach(t=>{t.parallel=!1}),this.parallelList.length=0,this.parallelSuccessNumber=0,this.onError(t)}onError(t){this.pause(),this.config.onError&&this.config.onError(t)}destroy(){this.stop()}}const Vr=Jt.get("Resource"),qr={tasker:new jr,map:{},get isComplete(){return Qr.tasker.isComplete},set(t,e){Qr.map[t]&&Vr.repeat(t),Qr.map[t]=e},get:t=>Qr.map[t],remove(t){const e=Qr.map[t];e&&(e.destroy&&e.destroy(),delete Qr.map[t])},loadImage(t,e){return new Promise((s,i)=>{const r=this.setImage(t,t,e);r.load(()=>s(r),t=>i(t))})},setImage(t,e,s){let i;return r(e)?i={url:e}:e.url||(i={url:t,view:e}),i&&(s&&(i.format=s),e=re.image(i)),Qr.set(t,e),e},destroy(){Qr.map={}}},Qr=qr,Jr={maxRecycled:10,recycledList:[],patternTasker:new jr,get(t){let e=qr.get(t.url);return e||qr.set(t.url,e=re.image(t)),e.use++,e},recycle(t){t.use--,setTimeout(()=>{t.use||$r.recycledList.push(t)})},clearRecycled(){const t=$r.recycledList;t.length>$r.maxRecycled&&(t.forEach(t=>!t.use&&t.url&&qr.remove(t.url)),t.length=0)},hasAlphaPixel:t=>Yr.alphaPixelTypes.some(e=>$r.isFormat(e,t)),isFormat(t,e){if(e.format)return e.format===t;const{url:s}=e;if(s.startsWith("data:")){if(s.startsWith("data:"+Yr.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+Yr.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){$r.recycledList=[]}},$r=Jr,{IMAGE:Zr,create:Kr}=m;class to{get url(){return this.config.url}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=Kr(Zr),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}Jr.isFormat("svg",t)&&(this.isSVG=!0),Jr.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e){if(!this.loading){this.loading=!0;const{crossOrigin:t}=this.config;qr.tasker.add(()=>_e(this,void 0,void 0,function*(){return yield g.origin.loadImage(this.url,s(t)?g.image.crossOrigin:t,this).then(t=>this.setView(t)).catch(t=>{this.error=t,this.onComplete(!1)})}))}return this.waitComplete.push(t,e),this.waitComplete.length-2}unload(t,e){const s=this.waitComplete;if(e){const e=s[t+1];e&&e({type:"stop"})}s[t]=s[t+1]=void 0}setView(t){this.ready=!0,this.width=t.naturalWidth||t.width,this.height=t.naturalHeight||t.height,this.view=t,this.onComplete(!0)}onComplete(t){let e;this.waitComplete.forEach((s,i)=>{e=i%2,s&&(t?e||s(this):e&&s(this.error))}),this.waitComplete.length=0,this.loading=!1}getFull(t){return this.view}getCanvas(t,e,s,i,r,o,n){if(t||(t=this.width),e||(e=this.height),this.cache){let{params:t,data:e}=this.cache;for(let s in t)if(t[s]!==arguments[s]){e=null;break}if(e)return e}const a=g.image.resize(this.view,t,e,r,o,void 0,n,s,i);return this.cache=this.use>1?{data:a,params:arguments}:null,a}getPattern(t,e,s,i){const r=g.canvas.createPattern(t,e);return g.image.setPatternTransform(r,s,i),r}destroy(){this.config={url:""},this.cache=null,this.waitComplete.length=0}}function eo(t,e,s,i){i||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function so(t,e){return Object.getOwnPropertyDescriptor(t,e)}function io(t,e){const s="_"+t;return{get(){const t=this[s];return null==t?e:t},set(t){this[s]=t}}}function ro(t,e){return(s,i)=>no(s,i,t,e&&e(i))}function oo(t){return t}function no(t,e,s,i){const r={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};eo(t,e,Object.assign(r,i||{})),Mo(t,e,s)}function ao(t){return ro(t)}function ho(t,e){return ro(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function lo(t,e){return ro(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function co(t){return ro(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),go(this))}}))}function uo(t,e){return ro(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function _o(t,e){return ro(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function po(t,e){return ro(t,t=>({set(s){this.__setAttr(t,s,e)&&go(this)}}))}function fo(t){return ro(t,t=>({set(e){this.__setAttr(t,e)&&(go(this),this.__.__removeNaturalSize())}}))}function go(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function yo(t){return ro(t,t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),go(this)}}))}const mo=po;function xo(t,e){return ro(t,t=>({set(s){this.__setAttr(t,s)&&(wo(this),e&&(this.__.__useStroke=!0))}}))}function wo(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&go(t)}const vo=xo;function bo(t){return ro(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Bo(t){return ro(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function ko(t){return ro(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;c.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip),this.__layout.surfaceChange()}}}))}function So(t){return ro(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&Co(this)}}))}function Ro(t){return ro(t,t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>To(this,t,e,s))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");To(this,t,e,s),this.mask&&Co(this)}}))}function Co(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function To(t,e,s,i){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==i&&0!==s||go(t))}function Po(t){return ro(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChange(),this.waitParent(()=>{this.parent.__layout.childrenSortChange()}))}}))}function Lo(t){return ro(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}function Io(t){return ro(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}function Eo(t){return ro(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,"hit"===Jt.showBounds&&this.__layout.surfaceChange(),this.leafer&&this.leafer.updateCursor())}}))}function Oo(t){return ro(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function Ao(t){return(e,s)=>{eo(e,"__DataProcessor",{get:()=>t})}}function Mo(t,e,i){const r=t.__DataProcessor.prototype,o="_"+e,n=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=io(e,i);if(s(i))a.get=function(){return this[o]};else if("function"==typeof i)a.get=function(){const t=this[o];return null==t?i(this.__leaf):t};else if(l(i)){const t=d(i);a.get=function(){const e=this[o];return null==e?this[o]=t?{}:c.clone(i):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[o];if(null==t){const t=this,e=t.__naturalWidth,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&s.children.length?s.boxBounds.width:i}return t}:"height"===e&&(a.get=function(){const t=this[o];if(null==t){const t=this,e=t.__naturalHeight,s=t.__leaf;return!i||s.pathInputed?s.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&s.children.length?s.boxBounds.height:i}return t});let u,_=r;for(;!u&&_;)u=so(_,e),_=_.__proto__;u&&u.set&&(a.set=u.set),r[n]&&(a.set=r[n],delete r[n]),eo(r,e,a)}const Wo=new Jt("rewrite"),Do=[],Fo=["destroy","constructor"];function Uo(t){return(e,s)=>{Do.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function No(){return t=>{zo()}}function zo(t){Do.length&&(Do.forEach(e=>{t&&Wo.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),Do.length=0)}function Yo(t,e){return s=>{var i;(t.prototype?(i=t.prototype,Object.getOwnPropertyNames(i)):Object.keys(t)).forEach(i=>{if(!(Fo.includes(i)||e&&e.includes(i)))if(t.prototype){so(t.prototype,i).writable&&(s.prototype[i]=t.prototype[i])}else s.prototype[i]=t[i]})}}function Xo(){return t=>{ne.register(t)}}setTimeout(()=>zo(!0));const{copy:Ho,toInnerPoint:Go,toOuterPoint:jo,scaleOfOuter:Vo,rotateOfOuter:qo,skewOfOuter:Qo,multiplyParent:Jo,divideParent:$o,getLayout:Zo}=J,Ko={},{round:tn}=Math,en={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),on(t,e,s),t.isBranch){const{children:i}=t;for(let t=0,r=i.length;t<r;t++)rn(i[t],e,s)}},updateMatrix(t,e,s){const i=t.__layout;e?s&&(i.waitAutoLayout=!0,t.__hasAutoLayout&&(i.matrixChanged=!1)):i.waitAutoLayout&&(i.waitAutoLayout=!1),i.matrixChanged&&t.__updateLocalMatrix(),i.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)nn(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&nn(t),t.__updateChange()},updateAllChange(t){if(hn(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)an(e[t])}},worldHittable(t){for(;t;){if(!t.__.hittable)return!1;t=t.parent}return!0},draggable:t=>(t.draggable||t.editable)&&t.hitSelf&&!t.locked,copyCanvasByWorld(t,e,s,i,r,o){i||(i=t.__nowWorld),t.__worldFlipped||g.fullImageShadow?e.copyWorldByReset(s,i,t.__nowWorld,r,o):e.copyWorldToInner(s,i,t.__layout.renderBounds,r)},moveWorld(t,e,s=0,i,r){const o=l(e)?Object.assign({},e):{x:e,y:s};i?jo(t.localTransform,o,o,!0):t.parent&&Go(t.parent.scrollWorldTransform,o,o,!0),sn.moveLocal(t,o.x,o.y,r)},moveLocal(t,e,s=0,i){l(e)&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=tn(e),s=tn(s)),i?t.animate({x:e,y:s},i):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,i,r,o){sn.zoomOfLocal(t,ln(t,e),s,i,r,o)},zoomOfLocal(t,e,s,i=s,r,o){const a=t.__localMatrix;if(n(i)||(i&&(o=i),i=s),Ho(Ko,a),Vo(Ko,e,s,i),sn.hasHighPosition(t))sn.setTransform(t,Ko,r,o);else{const e=t.x+Ko.e-a.e,n=t.y+Ko.f-a.f;o&&!r?t.animate({x:e,y:n,scaleX:t.scaleX*s,scaleY:t.scaleY*i},o):(t.x=e,t.y=n,t.scaleResize(s,i,!0!==r))}},rotateOfWorld(t,e,s,i){sn.rotateOfLocal(t,ln(t,e),s,i)},rotateOfLocal(t,e,s,i){const r=t.__localMatrix;Ho(Ko,r),qo(Ko,e,s),sn.hasHighPosition(t)?sn.setTransform(t,Ko,!1,i):t.set({x:t.x+Ko.e-r.e,y:t.y+Ko.f-r.f,rotation:M.formatRotation(t.rotation+s)},i)},skewOfWorld(t,e,s,i,r,o){sn.skewOfLocal(t,ln(t,e),s,i,r,o)},skewOfLocal(t,e,s,i=0,r,o){Ho(Ko,t.__localMatrix),Qo(Ko,e,s,i),sn.setTransform(t,Ko,r,o)},transformWorld(t,e,s,i){Ho(Ko,t.worldTransform),Jo(Ko,e),t.parent&&$o(Ko,t.parent.scrollWorldTransform),sn.setTransform(t,Ko,s,i)},transform(t,e,s,i){Ho(Ko,t.localTransform),Jo(Ko,e),sn.setTransform(t,Ko,s,i)},setTransform(t,e,s,i){const r=t.__,o=r.origin&&sn.getInnerOrigin(t,r.origin),n=Zo(e,o,r.around&&sn.getInnerOrigin(t,r.around));if(sn.hasOffset(t)&&(n.x-=r.offsetX,n.y-=r.offsetY),s){const e=n.scaleX/t.scaleX,s=n.scaleY/t.scaleY;if(delete n.scaleX,delete n.scaleY,o){zt.scale(t.boxBounds,Math.abs(e),Math.abs(s));const i=sn.getInnerOrigin(t,r.origin);at.move(n,o.x-i.x,o.y-i.y)}t.set(n),t.scaleResize(e,s,!1)}else t.set(n,i)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},i="x"===e?1:-1;return Vo(s,sn.getLocalOrigin(t,"center"),-1*i,1*i),s},getLocalOrigin:(t,e)=>at.tempToOuterOf(sn.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return vt.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(Ho(Ko,t.worldTransform),$o(Ko,e.scrollWorldTransform),s?Ko:Object.assign({},Ko)),drop(t,e,s,i){t.setTransform(sn.getRelativeWorld(t,e,!0),i),e.add(t,s)},hasHighPosition:t=>t.origin||t.around||sn.hasOffset(t),hasOffset:t=>t.offsetX||t.offsetY,hasParent(t,e){if(!e)return!1;for(;t;){if(e===t)return!0;t=t.parent}},animateMove(t,e,s=.3){if(e.x||e.y)if(Math.abs(e.x)<1&&Math.abs(e.y)<1)t.move(e);else{const i=e.x*s,r=e.y*s;e.x-=i,e.y-=r,t.move(i,r),g.requestRender(()=>sn.animateMove(t,e,s))}}},sn=en,{updateAllMatrix:rn,updateMatrix:on,updateAllWorldOpacity:nn,updateAllChange:an,updateChange:hn}=sn;function ln(t,e){return t.updateLayout(),t.parent?at.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const dn={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localRenderBounds,maskLocalBoxBounds:(t,e)=>un(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>un(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds:(t,e)=>un(t,e)&&t.__layout.localRenderBounds,excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};let cn;function un(t,e){return e||(cn=0),t.__.mask&&(cn=1),cn<0?null:(cn&&(cn=-1),!0)}const{updateBounds:_n}=en,pn={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:s}=t;for(let i=0,r=s.length;i<r;i++)(t=s[i]).isBranch&&(t.__tempNumber=1,e.add(t),fn(t,e))}},pushAllParent(t,e){const{keys:i}=e;if(i)for(;t.parent&&s(i[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let s=e.length;const{children:i}=t;for(let t=0,s=i.length;t<s;t++)i[t].isBranch&&e.push(i[t]);for(let t=s,i=e.length;t<i;t++)gn(e[t],e)},updateBounds(t,e){const s=[t];gn(t,s),yn(s,e)},updateBoundsByBranchStack(t,e){let s,i;for(let r=t.length-1;r>-1;r--){s=t[r],i=s.children;for(let t=0,e=i.length;t<e;t++)_n(i[t]);e&&e===s||_n(s)}}},{pushAllChildBranch:fn,pushAllBranchStack:gn,updateBoundsByBranchStack:yn}=pn,mn={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:xn,updateBounds:wn}=en,{toOuterOf:vn,getPoints:bn,copy:Bn}=zt,kn="_localContentBounds",Sn="_worldContentBounds",Rn="_worldBoxBounds",Cn="_worldStrokeBounds";class Tn{get contentBounds(){return this._contentBounds||this.boxBounds}set contentBounds(t){this._contentBounds=t}get strokeBounds(){return this._strokeBounds||this.boxBounds}get renderBounds(){return this._renderBounds||this.boxBounds}set renderBounds(t){this._renderBounds=t}get localContentBounds(){return vn(this.contentBounds,this.leaf.__localMatrix,this[kn]||(this[kn]={})),this[kn]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return vn(this.contentBounds,this.leaf.__world,this[Sn]||(this[Sn]={})),this[Sn]}get worldBoxBounds(){return vn(this.boxBounds,this.leaf.__world,this[Rn]||(this[Rn]={})),this[Rn]}get worldStrokeBounds(){return vn(this.strokeBounds,this.leaf.__world,this[Cn]||(this[Cn]={})),this[Cn]}get a(){return 1}get b(){return 0}get c(){return 0}get d(){return 1}get e(){return this.leaf.__.x}get f(){return this.leaf.__.y}get x(){return this.e+this.boxBounds.x}get y(){return this.f+this.boxBounds.y}get width(){return this.boxBounds.width}get height(){return this.boxBounds.height}constructor(t){this.leaf=t,this.leaf.__local&&(this._localRenderBounds=this._localStrokeBounds=this.leaf.__local),t.__world&&(this.boxBounds={x:0,y:0,width:0,height:0},this.boxChange(),this.matrixChange())}createLocal(){const t=this.leaf.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0};this._localStrokeBounds||(this._localStrokeBounds=t),this._localRenderBounds||(this._localRenderBounds=t)}update(){const{leaf:t}=this,{leafer:e}=t;if(t.isApp)return wn(t);if(e)e.ready?e.watcher.changed&&e.layouter.layout():e.start();else{let e=t;for(;e.parent&&!e.parent.leafer;)e=e.parent;const s=e;if(s.__fullLayouting)return;s.__fullLayouting=!0,g.layout(s),delete s.__fullLayouting}}getTransform(t="world"){this.update();const{leaf:e}=this;switch(t){case"world":return e.__world;case"local":return e.__localMatrix;case"inner":return J.defaultMatrix;case"page":t=e.zoomLayer;default:return xn(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 Gt(this.getInnerBounds(t)).toOuterOf(this.getTransform(e))}}getInnerBounds(t="box"){switch(t){case"render":return this.renderBounds;case"content":if(this.contentBounds)return this.contentBounds;case"box":return this.boxBounds;case"stroke":return this.strokeBounds}}getLocalBounds(t="box"){switch(t){case"render":return this.localRenderBounds;case"stroke":return this.localStrokeBounds;case"content":if(this.contentBounds)return this.localContentBounds;case"box":return this.leaf.__localBoxBounds}}getWorldBounds(t="box"){switch(t){case"render":return this.leaf.__world;case"stroke":return this.worldStrokeBounds;case"content":if(this.contentBounds)return this.worldContentBounds;case"box":return this.worldBoxBounds}}getLayoutBounds(t,e="world",s){const{leaf:i}=this;let r,o,n,a=this.getInnerBounds(t);switch(e){case"world":r=i.getWorldPoint(a),o=i.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=i.__;n={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},r=i.getLocalPointByInner(a);break;case"inner":r=a,o=J.defaultMatrix;break;case"page":e=i.zoomLayer;default:r=i.getWorldPoint(a,e),o=xn(i,e,!0)}if(n||(n=J.getLayout(o)),Bn(n,a),at.copy(n,r),s){const{scaleX:t,scaleY:e}=n,s=Math.abs(t),i=Math.abs(e);1===s&&1===i||(n.scaleX/=s,n.scaleY/=i,n.width*=s,n.height*=i)}return n}getLayoutPoints(t,e="world"){const{leaf:i}=this,r=bn(this.getInnerBounds(t));let o;switch(e){case"world":o=null;break;case"local":o=i.parent;break;case"inner":break;case"page":e=i.zoomLayer;default:o=e}return s(o)||r.forEach(t=>i.innerToWorld(t,null,!1,o)),r}shrinkContent(){const{x:t,y:e,width:s,height:i}=this.boxBounds;this._contentBounds={x:t,y:e,width:s,height:i}}spreadStroke(){const{x:t,y:e,width:s,height:i}=this.strokeBounds;this._strokeBounds={x:t,y:e,width:s,height:i},this._localStrokeBounds={x:t,y:e,width:s,height:i},this.renderSpread||this.spreadRenderCancel()}spreadRender(){const{x:t,y:e,width:s,height:i}=this.renderBounds;this._renderBounds={x:t,y:e,width:s,height:i},this._localRenderBounds={x:t,y:e,width:s,height:i}}shrinkContentCancel(){this._contentBounds=void 0}spreadStrokeCancel(){const t=this.renderBounds===this.strokeBounds;this._strokeBounds=this.boxBounds,this._localStrokeBounds=this.leaf.__localBoxBounds,t&&this.spreadRenderCancel()}spreadRenderCancel(){this._renderBounds=this._strokeBounds,this._localRenderBounds=this._localStrokeBounds}boxChange(){this.boxChanged=!0,this.localBoxChanged?this.boundsChanged||(this.boundsChanged=!0):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.boundsChanged||(this.boundsChanged=!0):this.localBoxChange()}surfaceChange(){this.surfaceChanged=!0}opacityChange(){this.opacityChanged=!0,this.surfaceChanged||this.surfaceChange()}childrenSortChange(){this.childrenSortChanged||(this.childrenSortChanged=this.affectChildrenSort=!0,this.leaf.forceUpdate("surface"))}destroy(){}}class Pn{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&g.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&g.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&g.event.stop(this.origin)}}class Ln extends Pn{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}Ln.ADD="child.add",Ln.REMOVE="child.remove",Ln.CREATED="created",Ln.MOUNTED="mounted",Ln.UNMOUNTED="unmounted",Ln.DESTROY="destroy";const In="property.scroll";class En extends Pn{constructor(t,e,s,i,r){super(t,e),this.attrName=s,this.oldValue=i,this.newValue=r}}En.CHANGE="property.change",En.LEAFER_CHANGE="property.leafer_change",En.SCROLL=In;const On={scrollX:In,scrollY:In};class An extends Pn{constructor(t,e){super(t),Object.assign(this,e)}}An.LOAD="image.load",An.LOADED="image.loaded",An.ERROR="image.error";class Mn extends Pn{static checkHas(t,e,s){"on"===s?e===Un?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Wn)||t.hasEvent(Dn)||t.hasEvent(Fn),t.__hasWorldEvent=t.hasEvent(Un))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Wn,t),"inner"===e&&t.emit(Dn,t)),t.emit(Fn,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Un,this)}}Mn.RESIZE="bounds.resize",Mn.INNER="bounds.inner",Mn.LOCAL="bounds.local",Mn.WORLD="bounds.world";const{RESIZE:Wn,INNER:Dn,LOCAL:Fn,WORLD:Un}=Mn,Nn={};[Wn,Dn,Fn,Un].forEach(t=>Nn[t]=1);class zn extends Pn{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){l(t)?(super(zn.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!s(this.resizingKeys[t.innerId])}}zn.RESIZE="resize";class Yn extends Pn{constructor(t,e){super(t),this.data=e}}Yn.REQUEST="watch.request",Yn.DATA="watch.data";class Xn extends Pn{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}Xn.REQUEST="layout.request",Xn.START="layout.start",Xn.BEFORE="layout.before",Xn.LAYOUT="layout",Xn.AFTER="layout.after",Xn.AGAIN="layout.again",Xn.END="layout.end";class Hn extends Pn{constructor(t,e,s,i){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=i)}}Hn.REQUEST="render.request",Hn.CHILD_START="render.child_start",Hn.CHILD_END="render.child_end",Hn.START="render.start",Hn.BEFORE="render.before",Hn.RENDER="render",Hn.AFTER="render.after",Hn.AGAIN="render.again",Hn.END="render.end",Hn.NEXT="render.next";class Gn extends Pn{}Gn.START="leafer.start",Gn.BEFORE_READY="leafer.before_ready",Gn.READY="leafer.ready",Gn.AFTER_READY="leafer.after_ready",Gn.VIEW_READY="leafer.view_ready",Gn.VIEW_COMPLETED="leafer.view_completed",Gn.STOP="leafer.stop",Gn.RESTART="leafer.restart",Gn.END="leafer.end",Gn.UPDATE_MODE="leafer.update_mode",Gn.TRANSFORM="leafer.transform",Gn.MOVE="leafer.move",Gn.SCALE="leafer.scale",Gn.ROTATE="leafer.rotate",Gn.SKEW="leafer.skew";const{MOVE:jn,SCALE:Vn,ROTATE:qn,SKEW:Qn}=Gn,Jn={x:jn,y:jn,scaleX:Vn,scaleY:Vn,rotation:qn,skewX:Qn,skewY:Qn},$n={};class Zn{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(h(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let s in t)h(e=t[s])?this.on(s,e[0],e[1]):this.on(s,e);return}let i,o,n;s&&("once"===s?o=!0:"boolean"==typeof s?i=s:(i=s.capture,o=s.once));const a=Kn(this,i,!0),l=r(t)?t.split(" "):t,d=o?{listener:e,once:o}:{listener:e};l.forEach(t=>{t&&(n=a[t],n?-1===n.findIndex(t=>t.listener===e)&&n.push(d):a[t]=[d],Nn[t]&&Mn.checkHas(this,t,"on"))})}off(t,e,s){if(t){const i=r(t)?t.split(" "):t;if(e){let t,r,o;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const n=Kn(this,t);i.forEach(t=>{t&&(r=n[t],r&&(o=r.findIndex(t=>t.listener===e),o>-1&&r.splice(o,1),r.length||delete n[t],Nn[t]&&Mn.checkHas(this,t,"off")))})}else{const{__bubbleMap:t,__captureMap:e}=this;i.forEach(s=>{t&&delete t[s],e&&delete e[s]})}}else this.__bubbleMap=this.__captureMap=void 0}on_(t,e,s,i){return e?this.on(t,s?e=e.bind(s):e,i):h(t)&&t.forEach(t=>this.on(t[0],t[2]?t[1]=t[1].bind(t[2]):t[1],t[3])),{type:t,current:this,listener:e,options:i}}off_(t){if(!t)return;const e=h(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):h(t.type)&&t.type.forEach(e=>t.current.off(e[0],e[1],e[3])))}),e.length=0}once(t,e,s,i){if(!e)return h(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));l(s)?e=e.bind(s):i=s,this.on(t,e,{once:!0,capture:i})}emit(t,e,s){!e&&le.has(t)&&(e=le.get(t,{type:t,target:this,current:this}));const i=Kn(this,s)[t];if(i){let r;for(let o=0,n=i.length;o<n&&!((r=i[o])&&(r.listener(e),r.once&&(this.off(t,r.listener,s),o--,n--),e&&e.isStopNow));o++);}this.syncEventer&&this.syncEventer.emitEvent(e,s)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:i,__captureMap:r}=this,o=i&&i[t],n=r&&r[t];return!!(s(e)?o||n:e?n:o)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function Kn(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:$n)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:$n)}}const{on:ta,on_:ea,off:sa,off_:ia,once:ra,emit:oa,emitEvent:na,hasEvent:aa,destroy:ha}=Zn.prototype,la={on:ta,on_:ea,off:sa,off_:ia,once:ra,emit:oa,emitEvent:na,hasEvent:aa,destroyEventer:ha},da=Jt.get("setAttr"),ca={__setAttr(t,e,i){if(this.leaferIsCreated){const r=this.__.__getInput(t);if(!i||o(e)||s(e)||(da.warn(this.innerName,t,e),e=void 0),l(e)||r!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new En(En.LEAFER_CHANGE,this,t,r,e));const s=Jn[t];s&&(this.emitEvent(new Gn(s,this)),this.emitEvent(new Gn(Gn.TRANSFORM,this)))}this.emitPropertyEvent(En.CHANGE,t,r,e);const s=On[t];return s&&this.emitPropertyEvent(s,t,r,e),!0}return!1}return this.__realSetAttr(t,e),!0},emitPropertyEvent(t,e,s,i){const r=new En(t,this,e,s,i);this.isLeafer||this.hasEvent(t)&&this.emitEvent(r),this.leafer.emitEvent(r)},__realSetAttr(t,e){const i=this.__;i[t]=e,this.__proxyData&&this.setProxyAttr(t,e),i.normalStyle&&(this.lockNormalStyle||s(i.normalStyle[t])||(i.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:ua,multiplyParent:_a,translateInner:pa,defaultWorld:fa}=J,{toPoint:ga,tempPoint:ya}=vt,ma={__updateWorldMatrix(){const{parent:t,__layout:e,__world:s,__scrollWorld:i,__:r}=this;_a(this.__local||e,t?t.__scrollWorld||t.__world:fa,s,!!e.affectScaleOrRotation,r),i&&pa(Object.assign(i,s),r.scrollX,r.scrollY)},__updateLocalMatrix(){if(this.__local){const t=this.__layout,e=this.__local,s=this.__;t.affectScaleOrRotation&&(t.scaleChanged&&(t.resized||(t.resized="scale"))||t.rotationChanged)&&(ua(e,s,null,null,t.affectRotation),t.scaleChanged=t.rotationChanged=void 0),e.e=s.x+s.offsetX,e.f=s.y+s.offsetY,(s.around||s.origin)&&(ga(s.around||s.origin,t.boxBounds,ya),pa(e,-ya.x,-ya.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:xa,updateAllMatrix:wa}=en,{updateBounds:va}=pn,{toOuterOf:ba,copyAndSpread:Ba,copy:ka}=zt,{toBounds:Sa}=Lr,Ra={__updateWorldBounds(){const{__layout:t,__world:e}=this;ba(t.renderBounds,e,e),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&Mn.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&Mn.emitWorld(this)},__updateLocalBounds(){const t=this.__layout;t.boxChanged&&(this.__.__pathInputed||this.__updatePath(),this.__updateRenderPath(),this.__updateBoxBounds(),t.resized="inner"),t.localBoxChanged&&(this.__local&&this.__updateLocalBoxBounds(),t.localBoxChanged=void 0,t.strokeSpread&&(t.strokeChanged=!0),t.renderSpread&&(t.renderChanged=!0),this.parent&&this.parent.__layout.boxChange()),t.boxChanged=void 0,t.strokeChanged&&(t.strokeSpread=this.__updateStrokeSpread(),t.strokeSpread?(t.strokeBounds===t.boxBounds&&t.spreadStroke(),this.__updateStrokeBounds(),this.__updateLocalStrokeBounds()):t.spreadStrokeCancel(),t.strokeChanged=void 0,(t.renderSpread||t.strokeSpread!==t.strokeBoxSpread)&&(t.renderChanged=!0),this.parent&&this.parent.__layout.strokeChange(),t.resized="inner"),t.renderChanged&&(t.renderSpread=this.__updateRenderSpread(),t.renderSpread?(t.renderBounds!==t.boxBounds&&t.renderBounds!==t.strokeBounds||t.spreadRender(),this.__updateRenderBounds(),this.__updateLocalRenderBounds()):t.spreadRenderCancel(),t.renderChanged=void 0,this.parent&&this.parent.__layout.renderChange()),t.resized||(t.resized="local"),t.boundsChanged=void 0},__updateLocalBoxBounds(){this.__hasMotionPath&&this.__updateMotionPath(),this.__hasAutoLayout&&this.__updateAutoLayout(),ba(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){ba(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){ba(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const s=this.__layout.boxBounds,i=this.__;i.__usePathBox?Sa(i.path,s):(s.x=0,s.y=0,s.width=i.width,s.height=i.height)},__updateAutoLayout(){this.__layout.matrixChanged=!0,this.isBranch?(this.__extraUpdate(),this.__.flow?(this.__layout.boxChanged&&this.__updateFlowLayout(),wa(this),va(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(wa(this),va(this,this))):xa(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;Ba(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:s}=e;n(s)&&s<=0?ka(e.renderBounds,e.strokeBounds):Ba(e.renderBounds,e.boxBounds,s)}},Ca={__render(t,e){if(e.shape)return this.__renderShape(t,e);if(this.__worldOpacity){const s=this.__;if(s.bright&&!e.topRendering)return e.topList.add(this);if(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),t.opacity=e.dimOpacity&&!s.dimskip?s.opacity*e.dimOpacity:s.opacity,this.__.__single){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!0,!0);this.__draw(i,e,t),en.copyCanvasByWorld(this,t,i,this.__nowWorld,s.__blendMode,!0),i.recycle(this.__nowWorld)}else this.__draw(t,e);Jt.showBounds&&Jt.drawBounds(this,t,e)}},__renderShape(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawShape(t,e))},__clip(t,e){this.__worldOpacity&&(t.setWorld(this.__nowWorld=this.__getNowWorld(e)),this.__drawRenderPath(t),t.clipUI(this))},__updateWorldOpacity(){this.__worldOpacity=this.__.visible?this.parent?this.parent.__worldOpacity*this.__.opacity:this.__.opacity:0,this.__layout.opacityChanged&&(this.__layout.opacityChanged=!1)}},{excludeRenderBounds:Ta}=dn,Pa={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){if(this.__nowWorld=this.__getNowWorld(e),this.__worldOpacity){const s=this.__;if(s.__useDim)if(s.dim)e.dimOpacity=!0===s.dim?.2:s.dim;else{if(s.bright&&!e.topRendering)return e.topList.add(this);s.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(s.__single&&!this.isBranchLeaf){if("path"===s.eraser)return this.__renderEraser(t,e);const i=t.getSameCanvas(!1,!0);this.__renderBranch(i,e);const r=this.__nowWorld;t.opacity=e.dimOpacity?s.opacity*e.dimOpacity:s.opacity,t.copyWorldByReset(i,r,r,s.__blendMode,!0),i.recycle(r)}else this.__renderBranch(t,e)}},__renderBranch(t,e){if(this.__hasMask)this.__renderMask(t,e);else{const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Ta(s[i],e)||s[i].__render(t,e)}},__clip(t,e){if(this.__worldOpacity){const{children:s}=this;for(let i=0,r=s.length;i<r;i++)Ta(s[i],e)||s[i].__clip(t,e)}}},La={},{LEAF:Ia,create:Ea}=m,{stintSet:Oa}=c,{toInnerPoint:Aa,toOuterPoint:Ma,multiplyParent:Wa}=J,{toOuterOf:Da}=zt,{copy:Fa,move:Ua}=at,{moveLocal:Na,zoomOfLocal:za,rotateOfLocal:Ya,skewOfLocal:Xa,moveWorld:Ha,zoomOfWorld:Ga,rotateOfWorld:ja,skewOfWorld:Va,transform:qa,transformWorld:Qa,setTransform:Ja,getFlipTransform:$a,getLocalOrigin:Za,getRelativeWorld:Ka,drop:th}=en;t.Leaf=class{get tag(){return this.__tag}set tag(t){}get __tag(){return"Leaf"}get innerName(){return this.__.name||this.tag+this.innerId}get __DataProcessor(){return _}get __LayoutProcessor(){return Tn}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 scrollWorldTransform(){return this.updateLayout(),this.__scrollWorld||this.__world}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.updateLayout(),this.__worldOpacity}get __worldFlipped(){return this.__world.scaleX<0||this.__world.scaleY<0}get __onlyHitMask(){return this.__hasMask&&!this.__.hitChildren}get __ignoreHitWorld(){return(this.__hasMask||this.__hasEraser)&&this.__.hitChildren}get __inLazyBounds(){return this.leaferIsCreated&&this.leafer.lazyBounds.hit(this.__world)}get pathInputed(){return this.__.__pathInputed}set event(t){this.on(t)}constructor(t){this.innerId=Ea(Ia),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(Ln.CREATED)}reset(t){this.leafer&&this.leafer.forceRender(this.__world),0!==t&&(this.__world={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0,scaleX:1,scaleY:1},null!==t&&(this.__local={a:1,b:0,c:0,d:1,e:0,f:0,x:0,y:0,width:0,height:0})),this.__worldOpacity=1,this.__=new this.__DataProcessor(this),this.__layout=new this.__LayoutProcessor(this),this.__level&&this.resetCustom(),t&&(t.__&&(t=t.toJSON()),t.children?this.set(t):Object.assign(this,t))}resetCustom(){this.__hasMask=this.__hasEraser=null,this.forceUpdate()}waitParent(t,e){e&&(t=t.bind(e)),this.parent?t():this.on(Ln.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(Ln.MOUNTED,t,"once")}nextRender(t,e,s){this.leafer?this.leafer.nextRender(t,e,s):this.waitLeafer(()=>this.leafer.nextRender(t,e,s))}removeNextRender(t){this.nextRender(t,null,"off")}__bindLeafer(t){if(this.isLeafer&&null!==t&&(t=this),this.leafer&&!t&&this.leafer.leafs--,this.leafer=t,t?(t.leafs++,this.__level=this.parent?this.parent.__level+1:1,this.animation&&this.__runAnimation("in"),this.__bubbleMap&&this.__emitLifeEvent(Ln.MOUNTED)):this.__emitLifeEvent(Ln.UNMOUNTED),this.isBranch){const{children:e}=this;for(let s=0,i=e.length;s<i;s++)e[s].__bindLeafer(t)}}set(t,e){}get(t){}setAttr(t,e){this[t]=e}getAttr(t){return this[t]}getComputedAttr(t){return this.__[t]}toJSON(t){return t&&this.__layout.update(),this.__.__getInputData(null,t)}toString(t){return JSON.stringify(this.toJSON(t))}toSVG(){}__SVG(t){}toHTML(){}__setAttr(t,e){return!0}__getAttr(t){}setProxyAttr(t,e){}getProxyAttr(t){}find(t,e){}findTag(t){}findOne(t,e){}findId(t){}focus(t){}updateState(){}updateLayout(){this.__layout.update()}forceUpdate(t){s(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=s(e)?null:void 0,this[t]=e}forceRender(t,e){this.forceUpdate("surface")}__extraUpdate(){this.leaferIsReady&&this.leafer.layouter.addExtra(this)}__updateWorldMatrix(){}__updateLocalMatrix(){}__updateWorldBounds(){}__updateLocalBounds(){}__updateLocalBoxBounds(){}__updateLocalStrokeBounds(){}__updateLocalRenderBounds(){}__updateBoxBounds(t,e){}__updateContentBounds(){}__updateStrokeBounds(t){}__updateRenderBounds(t){}__updateAutoLayout(){}__updateFlowLayout(){}__updateNaturalSize(){}__updateStrokeSpread(){return 0}__updateRenderSpread(){return 0}__onUpdateSize(){}__updateEraser(t){this.__hasEraser=!!t||this.children.some(t=>t.__.eraser)}__renderEraser(t,e){t.save(),this.__clip(t,e);const{renderBounds:s}=this.__layout;t.clearRect(s.x,s.y,s.width,s.height),t.restore()}__updateMask(t){this.__hasMask=this.children.some(t=>t.__.mask&&t.__.visible&&t.__.opacity)}__renderMask(t,e){}__getNowWorld(t){if(t.matrix){this.__cameraWorld||(this.__cameraWorld={});const e=this.__cameraWorld,s=this.__world;return Wa(s,t.matrix,e,void 0,s),Da(this.__layout.renderBounds,e,e),Oa(e,"half",s.half),Oa(e,"ignorePixelSnap",s.ignorePixelSnap),e}return this.__world}getClampRenderScale(){let{scaleX:t}=this.__nowWorld||this.__world;return t<0&&(t=-t),t>1?t:1}getRenderScaleData(t,e){let{scaleX:s,scaleY:i}=Jr.patternLocked?this.__world:this.__nowWorld;return t&&(s<0&&(s=-s),i<0&&(i=-i)),(!0===e||"zoom-in"===e&&s>1&&i>1)&&(s=i=1),La.scaleX=s,La.scaleY=i,La}getTransform(t){return this.__layout.getTransform(t||"local")}getBounds(t,e){return this.__layout.getBounds(t,e)}getLayoutBounds(t,e,s){return this.__layout.getLayoutBounds(t,e,s)}getLayoutPoints(t,e){return this.__layout.getLayoutPoints(t,e)}getWorldBounds(t,e,s){const i=e?Ka(this,e):this.worldTransform,r=s?t:{};return Da(t,i,r),r}worldToLocal(t,e,s,i){this.parent?this.parent.worldToInner(t,e,s,i):e&&Fa(e,t)}localToWorld(t,e,s,i){this.parent?this.parent.innerToWorld(t,e,s,i):e&&Fa(e,t)}worldToInner(t,e,s,i){i&&(i.innerToWorld(t,e,s),t=e||t),Aa(this.scrollWorldTransform,t,e,s)}innerToWorld(t,e,s,i){Ma(this.scrollWorldTransform,t,e,s),i&&i.worldToInner(e||t,null,s)}getBoxPoint(t,e,s,i){return this.getBoxPointByInner(this.getInnerPoint(t,e,s,i),null,null,!0)}getBoxPointByInner(t,e,s,i){const r=i?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return Ua(r,-o,-n),r}getInnerPoint(t,e,s,i){const r=i?t:{};return this.worldToInner(t,r,s,e),r}getInnerPointByBox(t,e,s,i){const r=i?t:Object.assign({},t),{x:o,y:n}=this.boxBounds;return Ua(r,o,n),r}getInnerPointByLocal(t,e,s,i){return this.getInnerPoint(t,this.parent,s,i)}getLocalPoint(t,e,s,i){const r=i?t:{};return this.worldToLocal(t,r,s,e),r}getLocalPointByInner(t,e,s,i){return this.getWorldPoint(t,this.parent,s,i)}getPagePoint(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getInnerPoint(t,e,s,i)}getWorldPoint(t,e,s,i){const r=i?t:{};return this.innerToWorld(t,r,s,e),r}getWorldPointByBox(t,e,s,i){return this.getWorldPoint(this.getInnerPointByBox(t,null,null,i),e,s,!0)}getWorldPointByLocal(t,e,s,i){const r=i?t:{};return this.localToWorld(t,r,s,e),r}getWorldPointByPage(t,e,s,i){return(this.leafer?this.leafer.zoomLayer:this).getWorldPoint(t,e,s,i)}setTransform(t,e,s){Ja(this,t,e,s)}transform(t,e,s){qa(this,t,e,s)}move(t,e,s){Na(this,t,e,s)}moveInner(t,e,s){Ha(this,t,e,!0,s)}scaleOf(t,e,s,i,r){za(this,Za(this,t),e,s,i,r)}rotateOf(t,e,s){Ya(this,Za(this,t),e,s)}skewOf(t,e,s,i,r){Xa(this,Za(this,t),e,s,i,r)}transformWorld(t,e,s){Qa(this,t,e,s)}moveWorld(t,e,s){Ha(this,t,e,!1,s)}scaleOfWorld(t,e,s,i,r){Ga(this,t,e,s,i,r)}rotateOfWorld(t,e){ja(this,t,e)}skewOfWorld(t,e,s,i,r){Va(this,t,e,s,i,r)}flip(t,e){qa(this,$a(this,t),!1,e)}scaleResize(t,e=t,s){this.scaleX*=t,this.scaleY*=e}__scaleResize(t,e){}resizeWidth(t){}resizeHeight(t){}hit(t,e){return!0}__hitWorld(t){return!0}__hit(t){return!0}__hitFill(t){return!0}__hitStroke(t,e){return!0}__hitPixel(t){return!0}__drawHitPath(t){}__updateHitCanvas(){}__render(t,e){}__drawFast(t,e){}__draw(t,e,s){}__clip(t,e){}__renderShape(t,e){}__drawShape(t,e){}__updateWorldOpacity(){}__updateChange(){}__drawPath(t){}__drawRenderPath(t){}__updatePath(){}__updateRenderPath(){}getMotionPathData(){return ie.need("path")}getMotionPoint(t){return ie.need("path")}getMotionTotal(){return 0}__updateMotionPath(){}__runAnimation(t,e){}__updateSortChildren(){}add(t,e){}remove(t,e){this.parent&&this.parent.remove(this,e)}dropTo(t,e,s){th(this,t,e,s)}on(t,e,s){}off(t,e,s){}on_(t,e,s,i){}off_(t){}once(t,e,s,i){}emit(t,e,s){}emitEvent(t,e){}hasEvent(t,e){return!1}static changeAttr(t,e,s){s?this.addAttr(t,e,s):Mo(this.prototype,t,e)}static addAttr(t,e,s,i){s||(s=po),s(e,i)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new Ln(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(Ln.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}},t.Leaf=ue([Yo(ca),Yo(ma),Yo(Ra),Yo(la),Yo(Ca)],t.Leaf);const{setListWithFn:eh}=zt,{sort:sh}=pn,{localBoxBounds:ih,localStrokeBounds:rh,localRenderBounds:oh,maskLocalBoxBounds:nh,maskLocalStrokeBounds:ah,maskLocalRenderBounds:hh}=dn,lh=new Jt("Branch");t.Branch=class extends t.Leaf{__updateStrokeSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.strokeSpread)return 1;return 0}__updateRenderSpread(){const{children:t}=this;for(let e=0,s=t.length;e<s;e++)if(t[e].__layout.renderSpread)return 1;return 0}__updateBoxBounds(t,e){eh(e||this.__layout.boxBounds,this.children,this.__hasMask?nh:ih)}__updateStrokeBounds(t){eh(t||this.__layout.strokeBounds,this.children,this.__hasMask?ah:rh)}__updateRenderBounds(t){eh(t||this.__layout.renderBounds,this.children,this.__hasMask?hh:oh)}__updateSortChildren(){let t;const{children:e}=this;if(e.length>1){for(let s=0,i=e.length;s<i;s++)e[s].__tempNumber=s,e[s].__.zIndex&&(t=!0);e.sort(sh),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return lh.warn("add self or destroyed");const i=s(e);if(!t.__){if(h(t))return t.forEach(t=>{this.add(t,e),i||e++});t=ne.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,i?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(Ln.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(Ln.ADD,t)),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}addMany(...t){this.add(t)}remove(t,e){t?t.__?t.animationOut?t.__runAnimation("out",()=>this.__remove(t,e)):this.__remove(t,e):this.find(t).forEach(t=>this.remove(t,e)):s(t)&&super.remove(null,e)}removeAll(t){const{children:e}=this;e.length&&(this.children=[],this.__preRemove(),this.__.__childBranchNumber=0,e.forEach(e=>{this.__realRemoveChild(e),t&&e.destroy()}))}clear(){this.removeAll(!0)}__remove(t,e){const s=this.children.indexOf(t);s>-1&&(this.children.splice(s,1),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||1)-1),this.__preRemove(),this.__realRemoveChild(t),e&&t.destroy())}__preRemove(){this.__hasMask&&this.__updateMask(),this.__hasEraser&&this.__updateEraser(),this.__layout.boxChange(),this.__layout.affectChildrenSort&&this.__layout.childrenSortChange()}__realRemoveChild(t){t.__emitLifeEvent(Ln.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(Ln.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new Ln(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}},t.Branch=ue([Yo(Pa)],t.Branch);class dh{get length(){return this.list.length}constructor(t){this.reset(),t&&(h(t)?this.addList(t):this.add(t))}has(t){return t&&!s(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return s(e)?-1:e}add(t){const{list:e,keys:i}=this;s(i[t.innerId])&&(e.push(t),i[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:i}=this;if(s(i[t.innerId])){const{list:s}=this;for(let t=e,r=s.length;t<r;t++)i[s[t].innerId]++;0===e?s.unshift(t):(e>s.length&&(e=s.length),s.splice(e,0,t)),i[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let i;for(let r=0,o=e.length;r<o;r++)s(i)?e[r].innerId===t.innerId&&(i=r,delete this.keys[t.innerId]):this.keys[e[r].innerId]=r-1;s(i)||e.splice(i,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 dh;return t.list=[...this.list],t.keys=Object.assign({},this.keys),t}update(){this.keys={};const{list:t,keys:e}=this;for(let s=0,i=t.length;s<i;s++)e[t[s].innerId]=s}reset(){this.list=[],this.keys={}}destroy(){this.reset()}}class ch{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(h(t)?this.addList(t):this.add(t))}has(t){return!s(this.keys[t.innerId])}without(t){return s(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:s}=this;e[t.innerId]||(e[t.innerId]=1,s[t.__level]?s[t.__level].push(t):(s[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(s=>{e=this.levelMap[s];for(let s=0,i=e.length;s<i;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}class uh extends Ce{get allowBackgroundColor(){return!0}init(){this.__createView(),this.__createContext(),this.resize(this.config)}__createView(){this.view=g.origin.createCanvas(1,1)}updateViewSize(){const{width:t,height:e,pixelRatio:s}=this;this.view.width=Math.ceil(t*s),this.view.height=Math.ceil(e*s),this.clientBounds=this.bounds}}zr(OffscreenCanvasRenderingContext2D.prototype),zr(Path2D.prototype);const{mineType:_h}=Yr;function ph(t,e){g.origin={createCanvas:(t,e)=>new OffscreenCanvas(t,e),canvasToDataURL:(t,e,s)=>new Promise((i,r)=>{t.convertToBlob({type:_h(e),quality:s}).then(t=>{var e=new FileReader;e.onload=t=>i(t.target.result),e.onerror=t=>r(t),e.readAsDataURL(t)}).catch(t=>{r(t)})}),canvasToBolb:(t,e,s)=>t.convertToBlob({type:_h(e),quality:s}),canvasSaveAs:(t,e,s)=>new Promise(t=>t()),download(t,e){},loadImage:t=>new Promise((e,s)=>{let i=new XMLHttpRequest;i.open("GET",g.image.getRealURL(t),!0),i.responseType="blob",i.onload=()=>{createImageBitmap(i.response).then(t=>{e(t)}).catch(t=>{s(t)})},i.onerror=t=>s(t),i.send()})},g.canvas=re.canvas(),g.conicGradientSupport=!!g.canvas.context.createConicGradient}Object.assign(re,{canvas:(t,e)=>new uh(t,e),image:t=>new to(t)}),g.name="web",g.isWorker=!0,g.backgrounder=!0,g.requestRender=function(t){requestAnimationFrame(t)},eo(g,"devicePixelRatio",{get:()=>1});const{userAgent:fh}=navigator;fh.indexOf("Firefox")>-1?(g.conicGradientRotate90=!0,g.intWheelDeltaY=!0):(/iPhone|iPad|iPod/.test(navigator.userAgent)||/Macintosh/.test(navigator.userAgent)&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent))&&(g.fullImageShadow=!0),fh.indexOf("Windows")>-1?(g.os="Windows",g.intWheelDeltaY=!0):fh.indexOf("Mac")>-1?g.os="Mac":fh.indexOf("Linux")>-1&&(g.os="Linux");class gh{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove){const t=new dh;return this.__updatedList.list.forEach(e=>{e.leafer&&t.add(e)}),t}return this.__updatedList}constructor(t,e){this.totalTimes=0,this.config={},this.__updatedList=new dh,this.target=t,e&&(this.config=c.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(Hn.REQUEST)}__onAttrChange(t){this.__updatedList.add(t.target),this.update()}__onChildEvent(t){t.type===Ln.ADD?(this.hasAdd=!0,this.__pushChild(t.child)):(this.hasRemove=!0,this.__updatedList.add(t.parent)),this.update()}__pushChild(t){this.__updatedList.add(t),t.isBranch&&this.__loopChildren(t)}__loopChildren(t){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)this.__pushChild(e[t])}__onRquestData(){this.target.emitEvent(new Yn(Yn.DATA,{updatedList:this.updatedList})),this.__updatedList=new dh,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[En.CHANGE,this.__onAttrChange,this],[[Ln.ADD,Ln.REMOVE],this.__onChildEvent,this],[Yn.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:yh,updateBounds:mh,updateChange:xh}=en,{pushAllChildBranch:wh,pushAllParent:vh}=pn;const{worldBounds:bh}=dn;class Bh{constructor(t){this.updatedBounds=new Gt,this.beforeBounds=new Gt,this.afterBounds=new Gt,h(t)&&(t=new dh(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,bh)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,bh),this.updatedBounds.setList([this.beforeBounds,this.afterBounds])}merge(t){this.updatedList.addList(t.updatedList.list),this.beforeBounds.add(t.beforeBounds),this.afterBounds.add(t.afterBounds),this.updatedBounds.add(t.updatedBounds)}destroy(){this.updatedList=null}}const{updateAllMatrix:kh,updateAllChange:Sh}=en,Rh=Jt.get("Layouter");class Ch{constructor(t,e){this.totalTimes=0,this.config={},this.__levelList=new ch,this.target=t,e&&(this.config=c.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(Xn.START),this.layoutOnce(),t.emitEvent(new Xn(Xn.END,this.layoutedBlocks,this.times))}catch(t){Rh.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?Rh.warn("layouting"):this.times>3?Rh.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(Yn.REQUEST),this.totalTimes>1?this.partLayout():this.fullLayout(),this.layouting=!1,void(this.waitAgain&&(this.waitAgain=!1,this.layoutOnce())))}partLayout(){var t;if(!(null===(t=this.__updatedList)||void 0===t?void 0:t.length))return;const e=te.start("PartLayout"),{target:s,__updatedList:i}=this,{BEFORE:r,LAYOUT:o,AFTER:n}=Xn,a=this.getBlocks(i);a.forEach(t=>t.setBefore()),s.emitEvent(new Xn(r,a,this.times)),this.extraBlock=null,i.sort(),function(t,e){let s;t.list.forEach(t=>{s=t.__layout,e.without(t)&&!s.proxyZoom&&(s.matrixChanged?(yh(t,!0),e.add(t),t.isBranch&&wh(t,e),vh(t,e)):s.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),vh(t,e)))})}(i,this.__levelList),function(t){let e,s,i;t.sort(!0),t.levels.forEach(r=>{e=t.levelMap[r];for(let t=0,r=e.length;t<r;t++){if(s=e[t],s.isBranch&&s.__tempNumber){i=s.children;for(let t=0,e=i.length;t<e;t++)i[t].isBranch||mh(i[t])}mh(s)}})}(this.__levelList),function(t){t.list.forEach(xh)}(i),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),s.emitEvent(new Xn(o,a,this.times)),s.emitEvent(new Xn(n,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,te.end(e)}fullLayout(){const t=te.start("FullLayout"),{target:e}=this,{BEFORE:s,LAYOUT:i,AFTER:r}=Xn,o=this.getBlocks(new dh(e));e.emitEvent(new Xn(s,o,this.times)),Ch.fullLayout(e),o.forEach(t=>{t.setAfter()}),e.emitEvent(new Xn(i,o,this.times)),e.emitEvent(new Xn(r,o,this.times)),this.addBlocks(o),te.end(t)}static fullLayout(t){kh(t,!0),t.isBranch?pn.updateBounds(t):en.updateBounds(t),Sh(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:s}=this.extraBlock||(this.extraBlock=new Bh([]));e.length?s.add(t.__world):s.set(t.__world),e.add(t)}}createBlock(t){return new Bh(t)}getBlocks(t){return[this.createBlock(t)]}addBlocks(t){this.layoutedBlocks?this.layoutedBlocks.push(...t):this.layoutedBlocks=t}__onReceiveWatchData(t){this.__updatedList=t.data.updatedList}__listenEvents(){this.__eventIds=[this.target.on_([[Xn.REQUEST,this.layout,this],[Xn.AGAIN,this.layoutAgain,this],[Yn.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const Th=Jt.get("Renderer");class Ph{get needFill(){return!(this.canvas.allowBackgroundColor||!this.config.fill)}constructor(t,e,s){this.FPS=60,this.totalTimes=0,this.times=0,this.config={usePartRender:!0,maxFPS:120},this.frames=[],this.target=t,this.canvas=e,s&&(this.config=c.default(s,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.__requestRender()}requestLayout(){this.target.emit(Xn.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(Hn.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(Hn.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(Hn.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Gt,Th.log(e.innerName,"---\x3e");try{this.emitRender(Hn.START),this.renderOnce(t),this.emitRender(Hn.END,this.totalBounds),Jr.clearRecycled()}catch(t){this.rendering=!1,Th.error(t)}Th.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return Th.warn("rendering");if(this.times>3)return Th.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Gt,this.renderOptions={},t)this.emitRender(Hn.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(Hn.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(Hn.RENDER,this.renderBounds,this.renderOptions),this.emitRender(Hn.AFTER,this.renderBounds,this.renderOptions),this.updateBlocks=null,this.rendering=!1,this.waitAgain&&(this.waitAgain=!1,this.renderOnce())}partRender(){const{canvas:t,updateBlocks:e}=this;e&&(this.mergeBlocks(),e.forEach(e=>{t.bounds.hit(e)&&!e.isEmpty()&&this.clipRender(e)}))}clipRender(t){const e=te.start("PartRender"),{canvas:s}=this,i=t.getIntersect(s.bounds),r=new Gt(i);s.save(),i.spread(Ph.clipSpread).ceil(),s.clearWorld(i),s.clipWorld(i),this.__render(i,r),s.restore(),te.end(e)}fullRender(){const t=te.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),te.end(t)}__render(t,e){const{canvas:s}=this,i=t.includes(this.target.__world),r=i?{includes:i}:{bounds:t,includes:i};this.needFill&&s.fillWorld(t,this.config.fill),Jt.showRepaint&&Jt.drawRepaint(s,t),g.render(this.target,s,r),this.renderBounds=e=e||t,this.renderOptions=r,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),s.updateRender(e)}addBlock(t){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Gt;e.setList(t),t.length=0,t.push(e)}}__requestRender(){const t=this.target;if(this.requestTime||!t)return;if(t.parentApp)return t.parentApp.requestRender(!1);this.requestTime=this.frameTime||Date.now();const e=()=>{const t=1e3/((this.frameTime=Date.now())-this.requestTime),{maxFPS:s}=this.config;if(s&&t>s)return g.requestRender(e);const{frames:i}=this;i.length>30&&i.shift(),i.push(t),this.FPS=Math.round(i.reduce((t,e)=>t+e,0)/i.length),this.requestTime=0,this.checkRender()};g.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:s}=t.old;if(!new Gt(0,0,e,s).includes(this.target.__world)||this.needFill||!t.samePixelRatio)return this.addBlock(this.canvas.bounds),void this.target.forceUpdate("surface")}this.addBlock(new Gt(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;t.updatedList&&t.updatedList.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||Th.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds)})}emitRender(t,e,s){this.target.emitEvent(new Hn(t,this.times,e,s))}__listenEvents(){this.__eventIds=[this.target.on_([[Hn.REQUEST,this.update,this],[Xn.END,this.__onLayoutEnd,this],[Hn.AGAIN,this.renderAgain,this],[zn.RESIZE,this.__onResize,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.config={},this.target=this.canvas=null)}}function Lh(t){return ro(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Ih(t){return ro(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function Eh(){return(t,e)=>{const s="_"+e;eo(t,e,{set(t){this.isLeafer&&(this[s]=t)},get(){return this.isApp?this.tree.zoomLayer:this.isLeafer?this[s]||this:this.leafer&&this.leafer.zoomLayer}})}}Ph.clipSpread=10,Object.assign(re,{watcher:(t,e)=>new gh(t,e),layouter:(t,e)=>new Ch(t,e),renderer:(t,e,s)=>new Ph(t,e,s),selector:(t,e)=>{},interaction:(t,e,s,i)=>{}}),g.layout=Ch.fullLayout,g.render=function(t,e,s){const i=Object.assign(Object.assign({},s),{topRendering:!0});s.topList=new dh,t.__render(e,s),s.topList.length&&s.topList.forEach(t=>t.__render(e,i))};const Oh={},Ah={hasTransparent:function(t){if(!t||7===t.length||4===t.length)return!1;if("transparent"===t)return!0;const e=t[0];if("#"===e)switch(t.length){case 5:return"f"!==t[4]&&"F"!==t[4];case 9:return"f"!==t[7]&&"F"!==t[7]||"f"!==t[8]&&"F"!==t[8]}else if(("r"===e||"h"===e)&&"a"===t[3]){const e=t.lastIndexOf(",");if(e>-1)return parseFloat(t.slice(e+1))<1}return!1}},Mh={number:(t,e)=>l(t)?"percent"===t.type?t.value*e:t.value:t},Wh={},Dh={},Fh={},Uh={},Nh={},zh={apply(){ie.need("filter")}},Yh={},Xh={setStyleName:()=>ie.need("state"),set:()=>ie.need("state")},Hh={list:{},register(t,e){Hh.list[t]=e},get:t=>Hh.list[t]},{parse:Gh,objectToCanvasData:jh}=$s,{stintSet:Vh}=c,{hasTransparent:qh}=Ah,Qh={originPaint:{}},Jh=Jt.get("UIData");class $h extends _{get scale(){const{scaleX:t,scaleY:e}=this;return t!==e?{x:t,y:e}:t}get __strokeWidth(){return this.__getRealStrokeWidth()}get __maxStrokeWidth(){const t=this;return t.__hasMultiStrokeStyle?Math.max(t.__hasMultiStrokeStyle,t.strokeWidth):t.strokeWidth}get __hasMultiPaint(){const t=this;return t.fill&&this.__useStroke||t.__isFills&&t.fill.length>1||t.__isStrokes&&t.stroke.length>1||t.__useEffect}get __clipAfterFill(){const t=this;return t.cornerRadius||t.innerShadow||t.__pathInputed}get __hasSurface(){return this.fill||this.stroke}get __autoWidth(){return!this._width}get __autoHeight(){return!this._height}get __autoSide(){return!this._width||!this._height}get __autoSize(){return!this._width&&!this._height}setVisible(t){this._visible=t;const{leafer:e}=this.__leaf;e&&(e.watcher.hasVisible=!0)}setWidth(t){t<0?(this._width=-t,this.__leaf.scaleX*=-1,Jh.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,Jh.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),r(t)||!t?(Vh(this,"__isTransparentFill",qh(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):l(t)&&this.__setPaint("fill",t)}setStroke(t){r(t)||!t?(Vh(this,"__isTransparentStroke",qh(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):l(t)&&this.__setPaint("stroke",t)}setPath(t){const e=r(t);e||t&&l(t[0])?(this.__setInput("path",t),this._path=e?Gh(t):jh(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){Zh(this,"shadow",t)}setInnerShadow(t){Zh(this,"innerShadow",t)}setFilter(t){Zh(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&Dh.compute("fill",this.__leaf),e&&Dh.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:i}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),s(t.strokeWidthFixed)||(i=t.strokeWidthFixed)),i){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const s=this.__leaf.__layout;s.boxChanged||s.boxChange(),h(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=Qh)):(this.__isStrokes=!0,this._stroke||(this._stroke=Qh))}__removePaint(t,e){e&&this.__removeInput(t),Fh.recycleImage(t,this),"fill"===t?(Vh(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(Vh(this,"__isAlphaPixelStroke",void 0),Vh(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function Zh(t,e,s){t.__setInput(e,s),h(s)?(s.some(t=>!1===t.visible)&&(s=s.filter(t=>!1!==t.visible)),s.length||(s=void 0)):s=s&&!1!==s.visible?[s]:void 0,t["_"+e]=s}class Kh extends $h{}class tl extends Kh{get __boxStroke(){return!this.__pathInputed}get __drawAfterFill(){return this.__single||this.__clipAfterFill}get __clipAfterFill(){const t=this;return"show"!==t.overflow&&t.__leaf.children.length&&(t.__leaf.isOverflow||super.__clipAfterFill)}}class el extends Kh{__getInputData(t,e){const s=super.__getInputData(t,e);return Re.forEach(t=>delete s[t]),s}}class sl extends tl{}class il extends $h{get __usePathBox(){return this.points||this.__pathInputed}}class rl extends $h{get __boxStroke(){return!this.__pathInputed}}class ol extends $h{get __boxStroke(){return!this.__pathInputed}}class nl extends il{}class al extends $h{}class hl extends $h{get __pathInputed(){return 2}}class ll extends Kh{}const dl={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class cl extends $h{get __useNaturalRatio(){return!1}setFontWeight(t){r(t)?(this.__setInput("fontWeight",t),t=dl[t]||400):this.__input&&this.__removeInput("fontWeight"),this._fontWeight=t}setBoxStyle(t){let e=this.__leaf,s=e.__box;if(t){const{boxStyle:i}=this;if(s)for(let t in i)s[t]=void 0;else s=e.__box=ne.get("Rect",0);const r=e.__layout,o=s.__layout;i||(s.parent=e,s.__world=e.__world,o.boxBounds=r.boxBounds),s.set(t),o.strokeChanged&&r.strokeChange()}else s&&(e.__box=s.parent=null,s.destroy());this._boxStyle=t}}class ul extends rl{setUrl(t){this.__setImageFill(t),this._url=t}__setImageFill(t){this.fill=t?{type:"image",mode:"stretch",url:t}:void 0}__getData(){const t=super.__getData();return t.url&&delete t.fill,t}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url&&delete s.fill,s}}class _l extends rl{get __isCanvas(){return!0}get __drawAfterFill(){return!0}__getInputData(t,e){const s=super.__getInputData(t,e);return s.url=this.__leaf.canvas.toDataURL("image/png"),s}}const{max:pl,add:fl}=S,gl={__updateStrokeSpread(){let t=0,e=0;const s=this.__,{strokeAlign:i,__maxStrokeWidth:r}=s,o=this.__box;if((s.stroke||"all"===s.hitStroke)&&r&&"inside"!==i&&(e=t="center"===i?r/2:r,!s.__boxStroke)){const e=s.__isLinePath?0:10*t,i="none"===s.strokeCap?0:r;t+=Math.max(e,i)}return s.__useArrow&&(t+=5*r),o&&(t=pl(t,o.__layout.strokeSpread=o.__updateStrokeSpread()),e=Math.max(e,o.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:i,backgroundBlur:r,filter:o,renderSpread:n}=this.__,{strokeSpread:a}=this.__layout,h=this.__box;e&&(t=Nh.getShadowRenderSpread(this,e)),i&&(t=pl(t,i)),o&&(t=fl(t,zh.getSpread(o))),n&&(t=fl(t,n)),a&&(t=fl(t,a));let l=t;return s&&(l=pl(l,Nh.getInnerShadowSpread(this,s))),r&&(l=pl(l,r)),this.__layout.renderShapeSpread=l,h?pl(h.__updateRenderSpread(),t):t}},{stintSet:yl}=c,ml={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);yl(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),yl(t,"__fillAfterStroke",e&&"outside"===t.strokeAlign&&t.fill&&!t.__isTransparentFill)}if(t.__useEffect){const{shadow:e,fill:s,stroke:i}=t,r=t.innerShadow||t.blur||t.backgroundBlur||t.filter;yl(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&!Nh.isTransformShadow(e[0])&&s&&!t.__isTransparentFill&&!(h(s)&&s.length>1)&&(this.useFastShadow||!i||i&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),yl(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){xl(this,t,e)},__draw(t,e,s){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:r,stroke:o,__drawAfterFill:n,__fillAfterStroke:a,__isFastShadow:h}=i;if(this.__drawRenderPath(t),i.__useEffect&&!h){const h=Dh.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=i;l&&Nh.shadow(this,t,h),a&&(i.__isStrokes?Dh.strokes(o,this,t,e):Dh.stroke(o,this,t,e)),r&&(i.__isFills?Dh.fills(r,this,t,e):Dh.fill(r,this,t,e)),n&&this.__drawAfterFill(t,e),d&&Nh.innerShadow(this,t,h),o&&!a&&(i.__isStrokes?Dh.strokes(o,this,t,e):Dh.stroke(o,this,t,e)),c&&zh.apply(c,this,this.__nowWorld,t,s,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(i.__isStrokes?Dh.strokes(o,this,t,e):Dh.stroke(o,this,t,e)),h){const e=i.shadow[0],{scaleX:s,scaleY:r}=this.getRenderScaleData(!0,e.scaleFixed);t.save(),t.setWorldShadow(e.x*s,e.y*r,e.blur*s,Ah.string(e.color))}r&&(i.__isFills?Dh.fills(r,this,t,e):Dh.fill(r,this,t,e)),h&&t.restore(),n&&this.__drawAfterFill(t,e),o&&!a&&(i.__isStrokes?Dh.strokes(o,this,t,e):Dh.stroke(o,this,t,e))}}else i.__pathInputed?xl(this,t,e):this.__drawFast(t,e)},__drawShape(t,e){this.__drawRenderPath(t);const s=this.__,{fill:i,stroke:r}=s;i&&!e.ignoreFill&&(s.__isAlphaPixelFill?Dh.fills(i,this,t,e):Dh.fill("#000000",this,t,e)),s.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(s.__isAlphaPixelStroke?Dh.strokes(r,this,t,e):Dh.stroke("#000000",this,t,e))},__drawAfterFill(t,e){this.__.__clipAfterFill?(t.save(),t.clipUI(this),this.__drawContent(t,e),t.restore()):this.__drawContent(t,e)}};function xl(t,e,s){const{fill:i,stroke:r,__drawAfterFill:o,__fillAfterStroke:n}=t.__;t.__drawRenderPath(e),n&&Dh.stroke(r,t,e,s),i&&Dh.fill(i,t,e,s),o&&t.__drawAfterFill(e,s),r&&!n&&Dh.stroke(r,t,e,s)}const wl={__drawFast(t,e){let{x:s,y:i,width:r,height:o}=this.__layout.boxBounds;const{fill:n,stroke:a,__drawAfterFill:h}=this.__;if(n&&(t.fillStyle=n,t.fillRect(s,i,r,o)),h&&this.__drawAfterFill(t,e),a){const{strokeAlign:n,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(a,h,this.__);const l=h/2;switch(n){case"center":t.strokeRect(0,0,r,o);break;case"inside":r-=h,o-=h,r<0||o<0?(t.save(),this.__clip(t,e),t.strokeRect(s+l,i+l,r,o),t.restore()):t.strokeRect(s+l,i+l,r,o);break;case"outside":t.strokeRect(s-l,i-l,r+h,o+h)}}}};var vl,bl;t.UI=vl=class extends t.Leaf{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){M.assignScale(this,t)}get scale(){return this.__.scale}get isAutoWidth(){const t=this.__;return t.__autoWidth||t.autoWidth}get isAutoHeight(){const t=this.__;return t.__autoHeight||t.autoHeight}get pen(){const{path:t}=this.__;return Ur.set(this.path=t||[]),t||this.__drawPathByBox(Ur),Ur}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return r(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return ie.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return ie.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let s=e?this.__.__pathForRender:this.__.path;return s||(Ur.set(s=[]),this.__drawPathByBox(Ur)),t?$s.toCanvasData(s,!0):s}getPathString(t,e,s){return $s.stringify(this.getPath(t,e),s)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||Yh.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?Dr.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&Wh.addArrows(this)):t.__pathForRender&&(t.__pathForRender=void 0)}__drawRenderPath(t){t.beginPath(),this.__drawPathByData(t,this.__.__pathForRender)}__drawPath(t){t.beginPath(),this.__drawPathByData(t,this.__.path)}__drawPathByData(t,e){e?Zi.drawPathByData(t,e):this.__drawPathByBox(t)}__drawPathByBox(t){const{x:e,y:s,width:i,height:r}=this.__layout.boxBounds;if(this.__.cornerRadius){const{cornerRadius:o}=this.__;t.roundRect(e,s,i,r,n(o)?[o]:o)}else t.rect(e,s,i,r)}drawImagePlaceholder(t,e,s){Dh.fill(this.__.placeholderColor,this,e,s)}animate(t,e,s,i){return this.set(t),ie.need("animate")}killAnimate(t,e){}export(t,e){return ie.need("export")}syncExport(t,e){return ie.need("export")}clone(t){const e=c.clone(this.toJSON());return t&&Object.assign(e,t),vl.one(e)}static one(t,e,s,i,r){return ne.get(t.tag||this.prototype.__tag,t,e,s,i,r)}static registerUI(){Xo()(this)}static registerData(t){Ao(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}},ue([Ao($h)],t.UI.prototype,"__",void 0),ue([Eh()],t.UI.prototype,"zoomLayer",void 0),ue([ao("")],t.UI.prototype,"id",void 0),ue([ao("")],t.UI.prototype,"name",void 0),ue([ao("")],t.UI.prototype,"className",void 0),ue([Bo("pass-through")],t.UI.prototype,"blendMode",void 0),ue([So(1)],t.UI.prototype,"opacity",void 0),ue([Ro(!0)],t.UI.prototype,"visible",void 0),ue([Bo(!1)],t.UI.prototype,"locked",void 0),ue([ko(!1)],t.UI.prototype,"dim",void 0),ue([ko(!1)],t.UI.prototype,"dimskip",void 0),ue([Po(0)],t.UI.prototype,"zIndex",void 0),ue([Lo(!1)],t.UI.prototype,"mask",void 0),ue([Io(!1)],t.UI.prototype,"eraser",void 0),ue([ho(0,!0)],t.UI.prototype,"x",void 0),ue([ho(0,!0)],t.UI.prototype,"y",void 0),ue([po(100,!0)],t.UI.prototype,"width",void 0),ue([po(100,!0)],t.UI.prototype,"height",void 0),ue([uo(1,!0)],t.UI.prototype,"scaleX",void 0),ue([uo(1,!0)],t.UI.prototype,"scaleY",void 0),ue([_o(0,!0)],t.UI.prototype,"rotation",void 0),ue([_o(0,!0)],t.UI.prototype,"skewX",void 0),ue([_o(0,!0)],t.UI.prototype,"skewY",void 0),ue([ho(0,!0)],t.UI.prototype,"offsetX",void 0),ue([ho(0,!0)],t.UI.prototype,"offsetY",void 0),ue([lo(0,!0)],t.UI.prototype,"scrollX",void 0),ue([lo(0,!0)],t.UI.prototype,"scrollY",void 0),ue([co()],t.UI.prototype,"origin",void 0),ue([co()],t.UI.prototype,"around",void 0),ue([ao(!1)],t.UI.prototype,"lazy",void 0),ue([fo(1)],t.UI.prototype,"pixelRatio",void 0),ue([bo(0)],t.UI.prototype,"renderSpread",void 0),ue([yo()],t.UI.prototype,"path",void 0),ue([mo()],t.UI.prototype,"windingRule",void 0),ue([mo(!0)],t.UI.prototype,"closed",void 0),ue([po(0)],t.UI.prototype,"padding",void 0),ue([po(!1)],t.UI.prototype,"lockRatio",void 0),ue([po()],t.UI.prototype,"widthRange",void 0),ue([po()],t.UI.prototype,"heightRange",void 0),ue([ao(!1)],t.UI.prototype,"draggable",void 0),ue([ao()],t.UI.prototype,"dragBounds",void 0),ue([ao("auto")],t.UI.prototype,"dragBoundsType",void 0),ue([ao(!1)],t.UI.prototype,"editable",void 0),ue([Eo(!0)],t.UI.prototype,"hittable",void 0),ue([Eo("path")],t.UI.prototype,"hitFill",void 0),ue([vo("path")],t.UI.prototype,"hitStroke",void 0),ue([Eo(!1)],t.UI.prototype,"hitBox",void 0),ue([Eo(!0)],t.UI.prototype,"hitChildren",void 0),ue([Eo(!0)],t.UI.prototype,"hitSelf",void 0),ue([Eo()],t.UI.prototype,"hitRadius",void 0),ue([Oo("")],t.UI.prototype,"cursor",void 0),ue([Bo()],t.UI.prototype,"fill",void 0),ue([vo(void 0,!0)],t.UI.prototype,"stroke",void 0),ue([vo("inside")],t.UI.prototype,"strokeAlign",void 0),ue([vo(1,!0)],t.UI.prototype,"strokeWidth",void 0),ue([vo(!1)],t.UI.prototype,"strokeWidthFixed",void 0),ue([vo("none")],t.UI.prototype,"strokeCap",void 0),ue([vo("miter")],t.UI.prototype,"strokeJoin",void 0),ue([vo()],t.UI.prototype,"dashPattern",void 0),ue([vo(0)],t.UI.prototype,"dashOffset",void 0),ue([vo(10)],t.UI.prototype,"miterLimit",void 0),ue([mo(0)],t.UI.prototype,"cornerRadius",void 0),ue([mo()],t.UI.prototype,"cornerSmoothing",void 0),ue([Lh()],t.UI.prototype,"shadow",void 0),ue([Lh()],t.UI.prototype,"innerShadow",void 0),ue([Lh()],t.UI.prototype,"blur",void 0),ue([Lh()],t.UI.prototype,"backgroundBlur",void 0),ue([Lh()],t.UI.prototype,"grayscale",void 0),ue([Lh()],t.UI.prototype,"filter",void 0),ue([Bo()],t.UI.prototype,"placeholderColor",void 0),ue([ao(100)],t.UI.prototype,"placeholderDelay",void 0),ue([ao({})],t.UI.prototype,"data",void 0),ue([Uo(t.Leaf.prototype.reset)],t.UI.prototype,"reset",null),t.UI=vl=ue([Yo(gl),Yo(ml),No()],t.UI),t.Group=class extends t.UI{get __tag(){return"Group"}get isBranch(){return!0}reset(t){this.__setBranch(),super.reset(t)}__setBranch(){this.children||(this.children=[])}set(t,e){if(t)if(t.children){const{children:s}=t;delete t.children,this.children?this.clear():this.__setBranch(),super.set(t,e),s.forEach(t=>this.add(t)),t.children=s}else super.set(t,e)}toJSON(t){const e=super.toJSON(t);return this.childlessJSON||(e.children=this.children.map(e=>e.toJSON(t))),e}pick(t,e){}addAt(t,e){this.add(t,e)}addAfter(t,e){this.add(t,this.children.indexOf(e)+1)}addBefore(t,e){this.add(t,this.children.indexOf(e))}add(t,e){}addMany(...t){}remove(t,e){}removeAll(t){}clear(){}},ue([Ao(Kh)],t.Group.prototype,"__",void 0),ue([po(0)],t.Group.prototype,"width",void 0),ue([po(0)],t.Group.prototype,"height",void 0),t.Group=ue([Yo(t.Branch),Xo()],t.Group);const Bl=Jt.get("Leafer");t.Leafer=bl=class extends t.Group{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&qr.isComplete}get layoutLocked(){return!this.layouter.running}get FPS(){return this.renderer?this.renderer.FPS:60}get cursorPoint(){return this.interaction&&this.interaction.hoverData||{x:this.width/2,y:this.height/2}}get clientBounds(){return this.canvas&&this.canvas.getClientBounds(!0)||{x:0,y:0,width:0,height:0}}constructor(t,e){super(e),this.config={start:!0,hittable:!0,smooth:!0,lazySpeard:100},this.leafs=0,this.__eventIds=[],this.__controllers=[],this.__readyWait=[],this.__viewReadyWait=[],this.__viewCompletedWait=[],this.__nextRenderWait=[],this.userConfig=t,t&&(t.view||t.width)&&this.init(t),bl.list.add(this)}init(t,e){if(this.canvas)return;let s;const{config:i}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),s=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,c.assign(i,t));const r=this.canvas=re.canvas(i);this.__controllers.push(this.renderer=re.renderer(this,r,i),this.watcher=re.watcher(this,i),this.layouter=re.layouter(this,i)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),this.view=r.view,e||(this.selector=re.selector(this),this.interaction=re.interaction(this,r,this.selector,i),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=re.hitCanvasManager()),this.canvasManager=new ce,s=i.start),this.hittable=i.hittable,this.fill=i.fill,this.canvasManager.add(r),this.__listenEvents(),s&&(this.__startTimer=setTimeout(this.start.bind(this))),mn.run(this.__initWait),this.onInit()}onInit(){}initType(t){}set(t,e){this.waitInit(()=>{super.set(t,e)})}start(){clearTimeout(this.__startTimer),!this.running&&this.canvas&&(this.running=!0,this.ready?this.emitLeafer(Gn.RESTART):this.emitLeafer(Gn.START),this.__controllers.forEach(t=>t.start()),this.isApp||this.renderer.render())}stop(){clearTimeout(this.__startTimer),this.running&&this.canvas&&(this.__controllers.forEach(t=>t.stop()),this.running=!1,this.emitLeafer(Gn.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=c.copyAttrs({},t,Re);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:s}=this;s&&(s.addBlock(t?new Gt(t):this.canvas.bounds),this.viewReady&&(e?s.render():s.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const s=c.copyAttrs({},this.canvas,Re);e.resize(t),this.updateLazyBounds(),this.__onResize(new zn(t,s))}__onResize(t){this.emitEvent(t),c.copyAttrs(this.__,t,Re),setTimeout(()=>{this.canvasManager&&this.canvasManager.clearRecycled()},0)}__setApp(){}__bindApp(t){this.selector=t.selector,this.interaction=t.interaction,this.canvasManager=t.canvasManager,this.hitCanvasManager=t.hitCanvasManager}__setLeafer(t){this.leafer=t,this.__level=1}__checkAutoLayout(){const{config:t,parentApp:e}=this;e||(t.width&&t.height||(this.autoLayout=new Vt(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Re.includes(t)?this.__changeCanvasSize(t,e):"fill"===t?this.__changeFill(e):"hittable"===t?this.parent||(this.canvas.hittable=e):"zIndex"===t?(this.canvas.zIndex=e,setTimeout(()=>this.parent&&this.parent.__updateSortChildren())):"mode"===t&&this.emit(Gn.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Re.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:s,canvas:i}=this,r=c.copyAttrs({},i,Re);r[t]=s[t]=e,s.width&&s.height?i.stopAutoLayout():this.__checkAutoLayout(),this.__doResize(r)}__changeFill(t){this.config.fill=t,this.canvas.allowBackgroundColor?this.canvas.backgroundColor=t:this.forceRender()}__onCreated(){this.created=!0}__onReady(){this.ready=!0,this.emitLeafer(Gn.BEFORE_READY),this.emitLeafer(Gn.READY),this.emitLeafer(Gn.AFTER_READY),mn.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(Gn.VIEW_READY),mn.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:s}=this.config;if(t){let{width:i,height:r,pixelRatio:o}=this;const n="box"===t?this.worldBoxBounds:this.__world;e||(i=Math.max(1,n.x+n.width)),s||(r=Math.max(1,n.y+n.height)),this.__doResize({width:i,height:r,pixelRatio:o})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){mn.run(this.__nextRenderWait);const{imageReady:t}=this;t&&!this.viewCompleted&&this.__checkViewCompleted(),t||(this.viewCompleted=!1,this.requestRender())}else this.requestRender()}__checkViewCompleted(t=!0){this.nextRender(()=>{this.imageReady&&(t&&this.emitLeafer(Gn.VIEW_COMPLETED),mn.run(this.__viewCompletedWait),this.viewCompleted=!0)})}__onWatchData(){this.watcher.childrenChanged&&this.interaction&&this.nextRender(()=>this.interaction.updateCursor())}waitInit(t,e){e&&(t=t.bind(e)),this.__initWait||(this.__initWait=[]),this.canvas?t():this.__initWait.push(t)}waitReady(t,e){e&&(t=t.bind(e)),this.ready?t():this.__readyWait.push(t)}waitViewReady(t,e){e&&(t=t.bind(e)),this.viewReady?t():this.__viewReadyWait.push(t)}waitViewCompleted(t,e){e&&(t=t.bind(e)),this.__viewCompletedWait.push(t),this.viewCompleted?this.__checkViewCompleted(!1):this.running||this.start()}nextRender(t,e,s){e&&(t=t.bind(e));const i=this.__nextRenderWait;if(s){for(let e=0;e<i.length;e++)if(i[e]===t){i.splice(e,1);break}}else i.push(t);this.requestRender()}zoom(t,e,s,i){return ie.need("view")}getValidMove(t,e,s){return{x:t,y:e}}getValidScale(t){return t}getWorldPointByClient(t,e){return this.interaction&&this.interaction.getLocal(t,e)}getPagePointByClient(t,e){return this.getPagePoint(this.getWorldPointByClient(t,e))}getClientPointByWorld(t){const{x:e,y:s}=this.clientBounds;return{x:e+t.x,y:s+t.y}}updateClientBounds(){this.canvas&&this.canvas.updateClientBounds()}receiveEvent(t){}emitLeafer(t){this.emitEvent(new Gn(t,this))}__listenEvents(){const t=te.start("FirstCreate "+this.innerName);this.once([[Gn.START,()=>te.end(t)],[Xn.START,this.updateLazyBounds,this],[Hn.START,this.__onCreated,this],[Hn.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[Yn.DATA,this.__onWatchData,this],[Xn.END,this.__onLayoutEnd,this],[Hn.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){bl.list.remove(this);try{this.stop(),this.emitLeafer(Gn.END),this.__removeListenEvents(),this.__controllers.forEach(t=>!(this.parent&&t===this.interaction)&&t.destroy()),this.__controllers.length=0,this.parent||(this.selector&&this.selector.destroy(),this.hitCanvasManager&&this.hitCanvasManager.destroy(),this.canvasManager&&this.canvasManager.destroy()),this.canvas&&this.canvas.destroy(),this.config.view=this.view=this.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{Jr.clearRecycled()},100)}catch(t){Bl.error(t)}}};t?e():setTimeout(e)}},t.Leafer.list=new dh,ue([Ao(el)],t.Leafer.prototype,"__",void 0),ue([po()],t.Leafer.prototype,"pixelRatio",void 0),ue([ao("normal")],t.Leafer.prototype,"mode",void 0),t.Leafer=bl=ue([Xo()],t.Leafer),t.Rect=class extends t.UI{get __tag(){return"Rect"}},ue([Ao(rl)],t.Rect.prototype,"__",void 0),t.Rect=ue([Yo(wl),No(),Xo()],t.Rect);const{add:kl,includes:Sl,scroll:Rl}=zt,Cl=t.Rect.prototype,Tl=t.Group.prototype;t.Box=class extends t.Group{get __tag(){return"Box"}get isBranchLeaf(){return!0}constructor(t){super(t),this.__layout.renderChanged||this.__layout.renderChange()}__updateStrokeSpread(){return 0}__updateRectRenderSpread(){return 0}__updateRenderSpread(){return this.__updateRectRenderSpread()||-1}__updateRectBoxBounds(){}__updateBoxBounds(t){if(this.children.length&&!this.pathInputed){const t=this.__;if(t.__autoSide){t.__hasSurface&&this.__extraUpdate(),super.__updateBoxBounds();const{boxBounds:e}=this.__layout;t.__autoSize||(t.__autoWidth?(e.width+=e.x,e.x=0,e.height=t.height,e.y=0):(e.height+=e.y,e.y=0,e.width=t.width,e.x=0)),this.__updateNaturalSize()}else this.__updateRectBoxBounds()}else this.__updateRectBoxBounds()}__updateStrokeBounds(){}__updateRenderBounds(){let t,e;if(this.children.length){const s=this.__,i=this.__layout,{renderBounds:r,boxBounds:o}=i,{overflow:n}=s,a=i.childrenRenderBounds||(i.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=n&&n.includes("scroll"))&&(kl(a,o),Rl(a,s)),this.__updateRectRenderBounds(),t=!Sl(o,a),t&&"show"===n&&kl(r,a)}else this.__updateRectRenderBounds();c.stintSet(this,"isOverflow",t),this.__checkScroll(e)}__updateRectRenderBounds(){}__checkScroll(t){}__updateRectChange(){}__updateChange(){super.__updateChange(),this.__updateRectChange()}__renderRect(t,e){}__renderGroup(t,e){}__render(t,e){this.__.__drawAfterFill?this.__renderRect(t,e):(this.__renderRect(t,e),this.children.length&&this.__renderGroup(t,e)),this.hasScroller&&this.scroller.__render(t,e)}__drawContent(t,e){this.__renderGroup(t,e),(this.__.__useStroke||this.__.__useEffect)&&(t.setWorld(this.__nowWorld),this.__drawRenderPath(t))}},ue([Ao(tl)],t.Box.prototype,"__",void 0),ue([po(100)],t.Box.prototype,"width",void 0),ue([po(100)],t.Box.prototype,"height",void 0),ue([ao(!1)],t.Box.prototype,"resizeChildren",void 0),ue([bo("show")],t.Box.prototype,"overflow",void 0),ue([Uo(Cl.__updateStrokeSpread)],t.Box.prototype,"__updateStrokeSpread",null),ue([Uo(Cl.__updateRenderSpread)],t.Box.prototype,"__updateRectRenderSpread",null),ue([Uo(Cl.__updateBoxBounds)],t.Box.prototype,"__updateRectBoxBounds",null),ue([Uo(Cl.__updateStrokeBounds)],t.Box.prototype,"__updateStrokeBounds",null),ue([Uo(Cl.__updateRenderBounds)],t.Box.prototype,"__updateRectRenderBounds",null),ue([Uo(Cl.__updateChange)],t.Box.prototype,"__updateRectChange",null),ue([Uo(Cl.__render)],t.Box.prototype,"__renderRect",null),ue([Uo(Tl.__render)],t.Box.prototype,"__renderGroup",null),t.Box=ue([No(),Xo()],t.Box),t.Frame=class extends t.Box{get __tag(){return"Frame"}get isFrame(){return!0}},ue([Ao(sl)],t.Frame.prototype,"__",void 0),ue([Bo("#FFFFFF")],t.Frame.prototype,"fill",void 0),ue([bo("hide")],t.Frame.prototype,"overflow",void 0),t.Frame=ue([Xo()],t.Frame);const{moveTo:Pl,closePath:Ll,ellipse:Il}=wi;t.Ellipse=class extends t.UI{get __tag(){return"Ellipse"}__updatePath(){const{width:t,height:e,innerRadius:s,startAngle:i,endAngle:r}=this.__,o=t/2,n=e/2,a=this.__.path=[];s?(i||r?(s<1&&Il(a,o,n,o*s,n*s,0,i,r,!1),Il(a,o,n,o,n,0,r,i,!0),s<1&&Ll(a)):(s<1&&(Il(a,o,n,o*s,n*s),Pl(a,t,n)),Il(a,o,n,o,n,0,360,0,!0)),g.ellipseToCurve&&(this.__.path=this.getPath(!0))):i||r?(Pl(a,o,n),Il(a,o,n,o,n,0,i,r,!1),Ll(a)):Il(a,o,n,o,n)}},ue([Ao(ol)],t.Ellipse.prototype,"__",void 0),ue([mo(0)],t.Ellipse.prototype,"innerRadius",void 0),ue([mo(0)],t.Ellipse.prototype,"startAngle",void 0),ue([mo(0)],t.Ellipse.prototype,"endAngle",void 0),t.Ellipse=ue([Xo()],t.Ellipse);const{sin:El,cos:Ol,PI:Al}=Math,{moveTo:Ml,lineTo:Wl,closePath:Dl,drawPoints:Fl}=wi;t.Polygon=class extends t.UI{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)Fl(e,t.points,t.curve,!0);else{const{width:s,height:i,sides:r}=t,o=s/2,n=i/2;Ml(e,o,0);for(let t=1;t<r;t++)Wl(e,o+o*El(2*t*Al/r),n-n*Ol(2*t*Al/r));Dl(e)}}},ue([Ao(nl)],t.Polygon.prototype,"__",void 0),ue([mo(3)],t.Polygon.prototype,"sides",void 0),ue([mo()],t.Polygon.prototype,"points",void 0),ue([mo(0)],t.Polygon.prototype,"curve",void 0),t.Polygon=ue([No(),Xo()],t.Polygon);const{sin:Ul,cos:Nl,PI:zl}=Math,{moveTo:Yl,lineTo:Xl,closePath:Hl}=wi;t.Star=class extends t.UI{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:s,innerRadius:i}=this.__,r=t/2,o=e/2,n=this.__.path=[];Yl(n,r,0);for(let t=1;t<2*s;t++)Xl(n,r+(t%2==0?r:r*i)*Ul(t*zl/s),o-(t%2==0?o:o*i)*Nl(t*zl/s));Hl(n)}},ue([Ao(al)],t.Star.prototype,"__",void 0),ue([mo(5)],t.Star.prototype,"corners",void 0),ue([mo(.382)],t.Star.prototype,"innerRadius",void 0),t.Star=ue([Xo()],t.Star);const{moveTo:Gl,lineTo:jl,drawPoints:Vl}=wi,{rotate:ql,getAngle:Ql,getDistance:Jl,defaultPoint:$l}=at;t.Line=class extends t.UI{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,s={x:0,y:0};return t&&(s.x=t),e&&ql(s,e),s}set toPoint(t){this.width=Jl($l,t),this.rotation=Ql($l,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?Vl(e,t.points,t.curve,t.closed):(Gl(e,0,0),jl(e,this.width,0))}},ue([Ao(il)],t.Line.prototype,"__",void 0),ue([xo("center")],t.Line.prototype,"strokeAlign",void 0),ue([po(0)],t.Line.prototype,"height",void 0),ue([mo()],t.Line.prototype,"points",void 0),ue([mo(0)],t.Line.prototype,"curve",void 0),ue([mo(!1)],t.Line.prototype,"closed",void 0),t.Line=ue([Xo()],t.Line),t.Image=class extends t.Rect{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return h(t)&&t[0].image}},ue([Ao(ul)],t.Image.prototype,"__",void 0),ue([po("")],t.Image.prototype,"url",void 0),t.Image=ue([Xo()],t.Image);const Zl=t.Image;t.Canvas=class extends t.Rect{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=re.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new to({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new An(An.LOADED,{image:t}))})}draw(t,e,s,i){const r=new pt(t.worldTransform).invert(),o=new pt;e&&o.translate(e.x,e.y),s&&(n(s)?o.scale(s):o.scale(s.x,s.y)),i&&o.rotate(i),r.multiplyParent(o),t.__render(this.canvas,{matrix:r.withScale()}),this.paint()}paint(){this.forceRender()}__drawContent(t,e){const{width:s,height:i}=this.__,{view:r}=this.canvas;t.drawImage(r,0,0,r.width,r.height,0,0,s,i)}__updateSize(){const{canvas:t}=this;if(t){const{smooth:e,safeResize:s}=this.__;t.resize(this.__,s),t.smooth!==e&&(t.smooth=e)}}destroy(){this.canvas&&(this.canvas.destroy(),this.canvas=null),super.destroy()}},ue([Ao(_l)],t.Canvas.prototype,"__",void 0),ue([Ih(100)],t.Canvas.prototype,"width",void 0),ue([Ih(100)],t.Canvas.prototype,"height",void 0),ue([Ih(1)],t.Canvas.prototype,"pixelRatio",void 0),ue([Ih(!0)],t.Canvas.prototype,"smooth",void 0),ue([ao(!1)],t.Canvas.prototype,"safeResize",void 0),ue([Ih()],t.Canvas.prototype,"contextSettings",void 0),t.Canvas=ue([Xo()],t.Canvas);const{copyAndSpread:Kl,includes:td,spread:ed,setList:sd}=zt,{stintSet:id}=c;function rd(t,e,s){t.__.__font?Dh.fillText(t,e,s):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function od(t,e,s,i,r){const o=s.__;l(t)?Dh.drawStrokesStyle(t,e,!1,s,i,r):(i.setStroke(t,o.__strokeWidth*e,o),i.stroke()),o.__useArrow&&Dh.strokeArrow(t,s,i,r)}function nd(t,e,s,i,r){const o=s.__;l(t)?Dh.drawStrokesStyle(t,e,!0,s,i,r):(i.setStroke(t,o.__strokeWidth*e,o),Dh.drawTextStroke(s,i,r))}function ad(t,e,s,i,r){const o=i.getSameCanvas(!0,!0);o.font=s.__.__font,nd(t,2,s,o,r),o.blendMode="outside"===e?"destination-out":"destination-in",Dh.fillText(s,o,r),o.blendMode="normal",en.copyCanvasByWorld(s,i,o),o.recycle(s.__nowWorld)}t.Text=class extends t.UI{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:s,fontFamily:i,fontSize:r,fontWeight:o,italic:n,textCase:a,textOverflow:h,padding:l,width:d,height:c}=t;t.__lineHeight=Mh.number(e,r),t.__letterSpacing=Mh.number(s,r),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${n?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==o?o+" ":""}${r||12}px ${i||"caption"}`,id(t,"__padding",l&&M.fourNumber(l)),id(t,"__clipText","show"!==h&&!t.__autoSize),id(t,"__isCharMode",d||c||t.__letterSpacing||"none"!==a),t.__textDrawData=Oh.getDrawData((t.__isPlacehold=t.placeholder&&""===t.text)?t.placeholder:t.text,this.__)}__updateBoxBounds(){const t=this.__,e=this.__layout,{fontSize:s,italic:i,padding:r,__autoWidth:o,__autoHeight:n}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<s&&ed(a,s/2),o||n){if(h.x=o?a.x:0,h.y=n?a.y:0,h.width=o?a.width:t.width,h.height=n?a.height:t.height,r){const[e,s,i,r]=t.__padding;o&&(h.x-=r,h.width+=s+r),n&&(h.y-=e,h.height+=i+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();i&&(h.width+=.16*s),c.stintSet(this,"isOverflow",!td(h,a)),this.isOverflow?(sd(t.__textBoxBounds={},[h,a]),e.renderChanged=!0):t.__textBoxBounds=h}__updateRenderSpread(){let t=super.__updateRenderSpread();return t||(t=this.isOverflow?1:0),t}__updateRenderBounds(){const{renderBounds:t,renderSpread:e}=this.__layout;Kl(t,this.__.__textBoxBounds,e),this.__box&&(this.__box.__layout.renderBounds=t)}__updateChange(){super.__updateChange();const t=this.__box;t&&(t.__onUpdateSize(),t.__updateChange())}__drawRenderPath(t){t.font=this.__.__font}__draw(t,e,s){const i=this.__box;i&&(i.__nowWorld=this.__nowWorld,i.__draw(t,e,s)),this.textEditing&&!e.exporting||super.__draw(t,e,s)}__drawShape(t,e){e.shape&&this.__box&&this.__box.__drawShape(t,e),super.__drawShape(t,e)}destroy(){this.boxStyle&&(this.boxStyle=null),super.destroy()}},ue([Ao(cl)],t.Text.prototype,"__",void 0),ue([po(0)],t.Text.prototype,"width",void 0),ue([po(0)],t.Text.prototype,"height",void 0),ue([Bo()],t.Text.prototype,"boxStyle",void 0),ue([ao(!1)],t.Text.prototype,"resizeFontSize",void 0),ue([Bo("#000000")],t.Text.prototype,"fill",void 0),ue([xo("outside")],t.Text.prototype,"strokeAlign",void 0),ue([Eo("all")],t.Text.prototype,"hitFill",void 0),ue([po("")],t.Text.prototype,"text",void 0),ue([po("")],t.Text.prototype,"placeholder",void 0),ue([po("caption")],t.Text.prototype,"fontFamily",void 0),ue([po(12)],t.Text.prototype,"fontSize",void 0),ue([po("normal")],t.Text.prototype,"fontWeight",void 0),ue([po(!1)],t.Text.prototype,"italic",void 0),ue([po("none")],t.Text.prototype,"textCase",void 0),ue([po("none")],t.Text.prototype,"textDecoration",void 0),ue([po(0)],t.Text.prototype,"letterSpacing",void 0),ue([po({type:"percent",value:1.5})],t.Text.prototype,"lineHeight",void 0),ue([po(0)],t.Text.prototype,"paraIndent",void 0),ue([po(0)],t.Text.prototype,"paraSpacing",void 0),ue([po("x")],t.Text.prototype,"writingMode",void 0),ue([po("left")],t.Text.prototype,"textAlign",void 0),ue([po("top")],t.Text.prototype,"verticalAlign",void 0),ue([po(!0)],t.Text.prototype,"autoSizeAlign",void 0),ue([po("normal")],t.Text.prototype,"textWrap",void 0),ue([po("show")],t.Text.prototype,"textOverflow",void 0),ue([Bo(!1)],t.Text.prototype,"textEditing",void 0),t.Text=ue([Xo()],t.Text),t.Path=class extends t.UI{get __tag(){return"Path"}},ue([Ao(hl)],t.Path.prototype,"__",void 0),ue([xo("center")],t.Path.prototype,"strokeAlign",void 0),t.Path=ue([Xo()],t.Path),t.Pen=class extends t.Group{get __tag(){return"Pen"}setStyle(e){const s=this.pathElement=new t.Path(e);return this.pathStyle=e,this.__path=s.path||(s.path=[]),this.add(s),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,s,i,r,o){return this}quadraticCurveTo(t,e,s,i){return this}closePath(){return this}rect(t,e,s,i){return this}roundRect(t,e,s,i,r){return this}ellipse(t,e,s,i,r,o,n,a){return this}arc(t,e,s,i,r,o){return this}arcTo(t,e,s,i,r){return this}drawEllipse(t,e,s,i,r,o,n,a){return this}drawArc(t,e,s,i,r,o){return this}drawPoints(t,e,s){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}},ue([Ao(ll)],t.Pen.prototype,"__",void 0),ue([(t,e)=>{eo(t,e,{get(){return this.__path}})}],t.Pen.prototype,"path",void 0),t.Pen=ue([Yo(Di,["set","path","paint"]),Xo()],t.Pen);const{getSpread:hd,copyAndSpread:ld,toOuterOf:dd,getOuterOf:cd,getByMove:ud,move:_d,getIntersectData:pd}=zt,fd={};let gd;const{stintSet:yd}=c,{hasTransparent:md}=Ah;function xd(t,e,i){if(!l(e)||!1===e.visible||0===e.opacity)return;let o;const{boxBounds:n}=i.__layout;switch(e.type){case"image":o=Fh.image(i,t,e,n,!gd||!gd[e.url]);break;case"linear":o=Uh.linearGradient(e,n);break;case"radial":o=Uh.radialGradient(e,n);break;case"angular":o=Uh.conicGradient(e,n);break;case"solid":const{type:r,color:a,opacity:h}=e;o={type:r,style:Ah.string(a,h)};break;default:s(e.r)||(o={type:"solid",style:Ah.string(e)})}if(o&&(o.originPaint=e,r(o.style)&&md(o.style)&&(o.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;o.strokeStyle=e.style}return o}const wd={compute:function(t,e){const s=e.__,i=[];let r,o,n,a=s.__input[t];h(a)||(a=[a]),gd=Fh.recycleImage(t,s);for(let s,r=0,o=a.length;r<o;r++)(s=xd(t,a[r],e))&&(i.push(s),s.strokeStyle&&(n||(n=1),s.strokeStyle.strokeWidth&&(n=Math.max(n,s.strokeStyle.strokeWidth))));s["_"+t]=i.length?i:void 0,i.length?(i.every(t=>t.isTransparent)&&(i.some(t=>t.image)&&(r=!0),o=!0),"fill"===t?(yd(s,"__isAlphaPixelFill",r),yd(s,"__isTransparentFill",o)):(yd(s,"__isAlphaPixelStroke",r),yd(s,"__isTransparentStroke",o),yd(s,"__hasMultiStrokeStyle",n))):s.__removePaint(t,!1)},fill:function(t,e,s,i){s.fillStyle=t,rd(e,s,i)},fills:function(t,e,s,i){let r,o,n;for(let a=0,h=t.length;a<h;a++){if(r=t[a],o=r.originPaint,r.image){if(n?n++:n=1,Fh.checkImage(r,!e.__.__font,e,s,i))continue;if(!r.style){1===n&&r.image.isPlacehold&&e.drawImagePlaceholder(r,s,i);continue}}if(s.fillStyle=r.style,r.transform||o.scaleFixed){if(s.save(),r.transform&&s.transform(r.transform),o.scaleFixed){const{scaleX:t,scaleY:i}=e.getRenderScaleData(!0);(!0===o.scaleFixed||"zoom-in"===o.scaleFixed&&t>1&&i>1)&&s.scale(1/t,1/i)}o.blendMode&&(s.blendMode=o.blendMode),rd(e,s,i),s.restore()}else o.blendMode?(s.saveBlendMode(o.blendMode),rd(e,s,i),s.restoreBlendMode()):rd(e,s,i)}},fillPathOrText:rd,fillText:function(t,e,s){const i=t.__,{rows:r,decorationY:o}=i.__textDrawData;let n;i.__isPlacehold&&i.placeholderColor&&(e.fillStyle=i.placeholderColor);for(let t=0,s=r.length;t<s;t++)n=r[t],n.text?e.fillText(n.text,n.x,n.y):n.data&&n.data.forEach(t=>{e.fillText(t.char,t.x,n.y)});if(o){const{decorationColor:t,decorationHeight:s}=i.__textDrawData;t&&(e.fillStyle=t),r.forEach(t=>o.forEach(i=>e.fillRect(t.x,t.y+i,t.width,s)))}},stroke:function(t,e,s,i){const r=e.__;if(r.__strokeWidth)if(r.__font)Dh.strokeText(t,e,s,i);else switch(r.strokeAlign){case"center":od(t,1,e,s,i);break;case"inside":!function(t,e,s,i){s.save(),s.clipUI(e),od(t,2,e,s,i),s.restore()}(t,e,s,i);break;case"outside":!function(t,e,s,i){const r=e.__;if(r.__fillAfterStroke)od(t,2,e,s,i);else{const{renderBounds:o}=e.__layout,n=s.getSameCanvas(!0,!0);e.__drawRenderPath(n),od(t,2,e,n,i),n.clipUI(r),n.clearWorld(o),en.copyCanvasByWorld(e,s,n),n.recycle(e.__nowWorld)}}(t,e,s,i)}},strokes:function(t,e,s,i){Dh.stroke(t,e,s,i)},strokeText:function(t,e,s,i){switch(e.__.strokeAlign){case"center":nd(t,1,e,s,i);break;case"inside":ad(t,"inside",e,s,i);break;case"outside":e.__.__fillAfterStroke?nd(t,2,e,s,i):ad(t,"outside",e,s,i)}},drawTextStroke:function(t,e,s){let i,r=t.__.__textDrawData;const{rows:o,decorationY:n}=r;for(let t=0,s=o.length;t<s;t++)i=o[t],i.text?e.strokeText(i.text,i.x,i.y):i.data&&i.data.forEach(t=>{e.strokeText(t.char,t.x,i.y)});if(n){const{decorationHeight:t}=r;o.forEach(s=>n.forEach(i=>e.strokeRect(s.x,s.y+i,s.width,t)))}},drawStrokesStyle:function(t,e,s,i,r,o){let n;const a=i.__,{__hasMultiStrokeStyle:h}=a;h||r.setStroke(void 0,a.__strokeWidth*e,a);for(let l=0,d=t.length;l<d;l++)if(n=t[l],(!n.image||!Fh.checkImage(n,!1,i,r,o))&&n.style){if(h){const{strokeStyle:t}=n;t?r.setStroke(n.style,a.__getRealStrokeWidth(t)*e,a,t):r.setStroke(n.style,a.__strokeWidth*e,a)}else r.strokeStyle=n.style;n.originPaint.blendMode?(r.saveBlendMode(n.originPaint.blendMode),s?Dh.drawTextStroke(i,r,o):r.stroke(),r.restoreBlendMode()):s?Dh.drawTextStroke(i,r,o):r.stroke()}},shape:function(t,e,s){const i=e.getSameCanvas(),r=e.bounds,o=t.__nowWorld,n=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let h,l,d,c,u,_;dd(n.strokeSpread?(ld(fd,n.boxBounds,n.strokeSpread),fd):n.boxBounds,o,a);let{scaleX:p,scaleY:f}=t.getRenderScaleData(!0);if(r.includes(a))_=i,h=u=a,l=o;else{let i;if(g.fullImageShadow)i=a;else{const t=n.renderShapeSpread?hd(r,S.swapAndScale(n.renderShapeSpread,p,f)):r;i=pd(t,a)}c=r.getFitMatrix(i);let{a:y,d:m}=c;c.a<1&&(_=e.getSameCanvas(),t.__renderShape(_,s),p*=y,f*=m),u=cd(a,c),h=ud(u,-c.e,-c.f),l=cd(o,c),_d(l,-c.e,-c.f);const x=s.matrix;x?(d=new pt(c),d.multiply(x),y*=x.scaleX,m*=x.scaleY):d=c,d.withScale(y,m),s=Object.assign(Object.assign({},s),{matrix:d})}return t.__renderShape(i,s),{canvas:i,matrix:d,fitMatrix:c,bounds:h,renderBounds:l,worldCanvas:_,shapeBounds:u,scaleX:p,scaleY:f}}};let vd,bd=new Gt;const{isSame:Bd}=zt;function kd(t,e,s,i,r,o){if("fill"===e&&!t.__.__naturalWidth){const e=t.__;if(e.__naturalWidth=i.width/e.pixelRatio,e.__naturalHeight=i.height/e.pixelRatio,e.__autoSide)return t.forceUpdate("width"),t.__proxyData&&(t.setProxyAttr("width",e.width),t.setProxyAttr("height",e.height)),!1}return r.data||Fh.createData(r,i,s,o),!0}function Sd(t,e){Td(t,An.LOAD,e)}function Rd(t,e){Td(t,An.LOADED,e)}function Cd(t,e,s){e.error=s,t.forceUpdate("surface"),Td(t,An.ERROR,e)}function Td(t,e,s){t.hasEvent(e)&&t.emitEvent(new An(e,s))}function Pd(t,e){const{leafer:s}=t;s&&s.viewReady&&(s.renderer.ignore=e)}const{get:Ld,translate:Id}=J,Ed=new Gt,Od={},Ad={};function Md(t,e,s,i){const o=r(t)||i?(i?s-i*e:s%e)/((i||Math.floor(s/e))-1):t;return"auto"===t&&o<0?0:o}let Wd={},Dd={a:1,b:0,c:0,d:1,e:0,f:0};const{get:Fd,set:Ud,rotateOfOuter:Nd,translate:zd,scaleOfOuter:Yd,multiplyParent:Xd,scale:Hd,rotate:Gd,skew:jd}=J;function Vd(t,e,s,i,r,o,n,a){n&&Gd(t,n),a&&jd(t,a.x,a.y),r&&Hd(t,r,o),zd(t,e.x+s,e.y+i)}const{get:qd,scale:Qd,copy:Jd}=J,{getFloorScale:$d}=M,{abs:Zd}=Math;const Kd={image:function(t,e,s,i,r){let o,n;const a=Jr.get(s);return vd&&s===vd.paint&&Bd(i,vd.boxBounds)?o=vd.leafPaint:(o={type:s.type,image:a},a.hasAlphaPixel&&(o.isTransparent=!0),vd=a.use>1?{leafPaint:o,paint:s,boxBounds:bd.set(i)}:null),(r||a.loading)&&(n={image:a,attrName:e,attrValue:s}),a.ready?(kd(t,e,s,a,o,i),r&&(Sd(t,n),Rd(t,n))):a.error?r&&Cd(t,n,a.error):(r&&(Pd(t,!0),Sd(t,n)),o.loadId=a.load(()=>{Pd(t,!1),t.destroyed||(kd(t,e,s,a,o,i)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),Rd(t,n)),o.loadId=void 0},e=>{Pd(t,!1),Cd(t,n,e),o.loadId=void 0}),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),o},checkImage:function(t,e,s,i,r){const{scaleX:o,scaleY:n}=Fh.getImageRenderScaleData(t,s,i,r),{image:a,data:h,originPaint:l}=t,{exporting:d}=r;return!(!h||t.patternId===o+"-"+n&&!d)&&(e&&(h.repeat?e=!1:l.changeful||"miniapp"===g.name&&zn.isResizing(s)||d||(e=g.image.isLarge(a,o,n))),e?(s.__.__isFastShadow&&(i.fillStyle=t.style||"#000",i.fill()),Fh.drawImage(t,o,n,s,i,r),!0):(!t.style||l.sync||d?Fh.createPattern(t,s,i,r):Fh.createPatternTask(t,s,i,r),!1))},drawImage:function(t,e,s,i,r,o){const{data:n,image:a}=t,{blendMode:h}=t.originPaint,{opacity:l,transform:d}=n,c=a.getFull(n.filters),u=i.__;let _,{width:p,height:f}=a;(_=d&&!d.onlyScale||u.path||u.cornerRadius)||l||h?(r.save(),_&&r.clipUI(i),h&&(r.blendMode=h),l&&(r.opacity*=l),d&&r.transform(d),r.drawImage(c,0,0,p,f),r.restore()):(n.scaleX&&(p*=n.scaleX,f*=n.scaleY),r.drawImage(c,0,0,p,f))},getImageRenderScaleData:function(t,e,s,i){const r=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:o}=t;if(s){const{pixelRatio:t}=s;r.scaleX*=t,r.scaleY*=t}return o&&o.scaleX&&(r.scaleX*=Math.abs(o.scaleX),r.scaleY*=Math.abs(o.scaleY)),r},recycleImage:function(t,e){const s=e["_"+t];if(h(s)){let i,r,o,n,a;for(let l=0,d=s.length;l<d;l++)i=s[l],r=i.image,a=r&&r.url,a&&(o||(o={}),o[a]=!0,Jr.recycle(r),r.loading&&(n||(n=e.__input&&e.__input[t]||[],h(n)||(n=[n])),r.unload(s[l].loadId,!n.some(t=>t.url===a))));return o}return null},createPatternTask:function(t,e,s,i){t.patternTask||(t.patternTask=Jr.patternTasker.add(()=>_e(this,void 0,void 0,function*(){t.patternTask=null,s.bounds.hit(e.__nowWorld)&&Fh.createPattern(t,e,s,i),e.forceUpdate("surface")}),300))},createPattern:function(t,e,s,i){let{scaleX:r,scaleY:o}=Fh.getImageRenderScaleData(t,e,s,i),n=r+"-"+o;if(t.patternId!==n&&!e.destroyed&&(!g.image.isLarge(t.image,r,o)||t.data.repeat)){const{image:s,data:i}=t,{transform:a,gap:h}=i,l=Fh.getPatternFixScale(t,r,o);let d,c,u,{width:_,height:p}=s;l&&(r*=l,o*=l),_*=r,p*=o,h&&(c=h.x*r/Zd(i.scaleX||1),u=h.y*o/Zd(i.scaleY||1)),(a||1!==r||1!==o)&&(r*=$d(_+(c||0)),o*=$d(p+(u||0)),d=qd(),a&&Jd(d,a),Qd(d,1/r,1/o));const f=s.getCanvas(_,p,i.opacity,i.filters,c,u,e.leafer&&e.leafer.config.smooth),y=s.getPattern(f,i.repeat||g.origin.noRepeat||"no-repeat",d,t);t.style=y,t.patternId=n}},getPatternFixScale:function(t,e,s){const{image:i}=t;let r,o=g.image.maxPatternSize,n=i.width*i.height;return i.isSVG?e>1&&(r=Math.ceil(e)/e):o>n&&(o=n),(n*=e*s)>o&&(r=Math.sqrt(o/n)),r},createData:function(t,e,s,i){t.data=Fh.getPatternData(s,i,e)},getPatternData:function(t,e,s){t.padding&&(e=Ed.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:i,height:o}=s,{opacity:n,mode:a,align:h,offset:d,scale:c,size:u,rotation:_,skew:p,clipSize:f,repeat:g,gap:y,filters:m}=t,x=e.width===i&&e.height===o,w={mode:a},v="center"!==h&&(_||0)%180==90;let b,B;switch(zt.set(Ad,0,0,v?o:i,v?i:o),a&&"cover"!==a&&"fit"!==a?((c||u)&&(M.getScaleData(c,u,s,Od),b=Od.scaleX,B=Od.scaleY),(h||y||g)&&(b&&zt.scale(Ad,b,B,!0),h&&kt.toPoint(h,Ad,e,Ad,!0,!0))):x&&!_||(b=B=zt.getFitScale(e,Ad,"fit"!==a),zt.put(e,s,h,b,!1,Ad),zt.scale(Ad,b,B,!0)),d&&at.move(Ad,d),a){case"stretch":x?b&&(b=B=void 0):(b=e.width/i,B=e.height/o,Fh.stretchMode(w,e,b,B));break;case"normal":case"clip":if(Ad.x||Ad.y||b||f||_||p){let t,s;f&&(t=e.width/f.width,s=e.height/f.height),Fh.clipMode(w,e,Ad.x,Ad.y,b,B,_,p,t,s),t&&(b=b?b*t:t,B=B?B*s:s)}break;case"repeat":(!x||b||_||p)&&Fh.repeatMode(w,e,i,o,Ad.x,Ad.y,b,B,_,p,h,t.freeTransform),g||(w.repeat="repeat");const s=l(g);(y||s)&&(w.gap=function(t,e,s,i,r){let o,n;l(t)?(o=t.x,n=t.y):o=n=t;return{x:Md(o,s,r.width,e&&e.x),y:Md(n,i,r.height,e&&e.y)}}(y,s&&g,Ad.width,Ad.height,e));break;default:b&&Fh.fillOrFitMode(w,e,Ad.x,Ad.y,b,B,_)}return w.transform||(e.x||e.y)&&Id(w.transform=Ld(),e.x,e.y),b&&(w.scaleX=b,w.scaleY=B),n&&n<1&&(w.opacity=n),m&&(w.filters=m),g&&(w.repeat=r(g)?"x"===g?"repeat-x":"repeat-y":"repeat"),w},stretchMode:function(t,e,s,i){const r=Fd(),{x:o,y:n}=e;o||n?zd(r,o,n):r.onlyScale=!0,Hd(r,s,i),t.transform=r},fillOrFitMode:function(t,e,s,i,r,o,n){const a=Fd();zd(a,e.x+s,e.y+i),Hd(a,r,o),n&&Nd(a,{x:e.x+e.width/2,y:e.y+e.height/2},n),t.transform=a},clipMode:function(t,e,s,i,r,o,n,a,h,l){const d=Fd();Vd(d,e,s,i,r,o,n,a),h&&(n||a?(Ud(Dd),Yd(Dd,e,h,l),Xd(d,Dd)):Yd(d,e,h,l)),t.transform=d},repeatMode:function(t,e,s,i,r,o,n,a,h,l,d,c){const u=Fd();if(c)Vd(u,e,r,o,n,a,h,l);else{if(h)if("center"===d)Nd(u,{x:s/2,y:i/2},h);else switch(Gd(u,h),h){case 90:zd(u,i,0);break;case 180:zd(u,s,i);break;case 270:zd(u,0,s)}Wd.x=e.x+r,Wd.y=e.y+o,zd(u,Wd.x,Wd.y),n&&Yd(u,Wd,n,a)}t.transform=u}},{toPoint:tc}=vt,{hasTransparent:ec}=Ah,sc={},ic={};function rc(t,e,s,i){if(s){let o,n,a,h;for(let t=0,l=s.length;t<l;t++)o=s[t],r(o)?(a=t/(l-1),n=Ah.string(o,i)):(a=o.offset,n=Ah.string(o.color,i)),e.addColorStop(a,n),!h&&ec(n)&&(h=!0);h&&(t.isTransparent=!0)}}const{getAngle:oc,getDistance:nc}=at,{get:ac,rotateOfOuter:hc,scaleOfOuter:lc}=J,{toPoint:dc}=vt,cc={},uc={};function _c(t,e,s,i,r){let o;const{width:n,height:a}=t;if(n!==a||i){const t=oc(e,s);o=ac(),r?(lc(o,e,n/a*(i||1),1),hc(o,e,t+90)):(lc(o,e,1,n/a*(i||1)),hc(o,e,t))}return o}const{getDistance:pc}=at,{toPoint:fc}=vt,gc={},yc={};const mc={linearGradient:function(t,e){let{from:s,to:i,type:r,opacity:o}=t;tc(s||"top",e,sc),tc(i||"bottom",e,ic);const n=g.canvas.createLinearGradient(sc.x,sc.y,ic.x,ic.y),a={type:r,style:n};return rc(a,n,t.stops,o),a},radialGradient:function(t,e){let{from:s,to:i,type:r,opacity:o,stretch:n}=t;dc(s||"center",e,cc),dc(i||"bottom",e,uc);const a=g.canvas.createRadialGradient(cc.x,cc.y,0,cc.x,cc.y,nc(cc,uc)),h={type:r,style:a};rc(h,a,t.stops,o);const l=_c(e,cc,uc,n,!0);return l&&(h.transform=l),h},conicGradient:function(t,e){let{from:s,to:i,type:r,opacity:o,stretch:n}=t;fc(s||"center",e,gc),fc(i||"bottom",e,yc);const a=g.conicGradientSupport?g.canvas.createConicGradient(0,gc.x,gc.y):g.canvas.createRadialGradient(gc.x,gc.y,0,gc.x,gc.y,pc(gc,yc)),h={type:r,style:a};rc(h,a,t.stops,o);const l=_c(e,gc,yc,n||1,g.conicGradientRotate90);return l&&(h.transform=l),h},getTransform:_c},{copy:xc,move:wc,toOffsetOutBounds:vc}=zt,{max:bc,abs:Bc}=Math,kc={},Sc=new pt,Rc={};function Cc(t,e){let s,i,r,o,n=0,a=0,h=0,l=0;return e.forEach(t=>{s=t.x||0,i=t.y||0,o=1.5*(t.blur||0),r=Bc(t.spread||0),n=bc(n,r+o-i),a=bc(a,r+o+s),h=bc(h,r+o+i),l=bc(l,r+o-s)}),n===a&&a===h&&h===l?n:[n,a,h,l]}function Tc(t,e,s){const{shapeBounds:i}=s;let r,o;g.fullImageShadow?(xc(kc,t.bounds),wc(kc,e.x-i.x,e.y-i.y),r=t.bounds,o=kc):(r=i,o=e),t.copyWorld(s.canvas,r,o)}const{toOffsetOutBounds:Pc}=zt,Lc={};const Ic=Cc;const Ec={shadow:function(t,e,s){let i,r;const{__nowWorld:o}=t,{shadow:n}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=n.length-1;vc(h,Rc,l),n.forEach((n,f)=>{let g=1;if(n.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(g=1/t)}_.setWorldShadow(Rc.offsetX+(n.x||0)*c*g,Rc.offsetY+(n.y||0)*u*g,(n.blur||0)*c*g,Ah.string(n.color)),r=Nh.getShadowTransform(t,_,s,n,Rc,g),r&&_.setTransform(r),Tc(_,Rc,s),r&&_.resetTransform(),i=l,n.box&&(_.restore(),_.save(),a&&(_.copyWorld(_,l,o,"copy"),i=o),a?_.copyWorld(a,o,o,"destination-out"):_.copyWorld(s.canvas,d,h,"destination-out")),en.copyCanvasByWorld(t,e,_,i,n.blendMode),p&&f<p&&_.clearWorld(i)}),_.recycle(i)},innerShadow:function(t,e,s){let i,r;const{__nowWorld:o}=t,{innerShadow:n}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=n.length-1;Pc(h,Lc,l),n.forEach((n,f)=>{let g=1;if(n.scaleFixed){const t=Math.abs(o.scaleX);t>1&&(g=1/t)}_.save(),_.setWorldShadow(Lc.offsetX+(n.x||0)*c*g,Lc.offsetY+(n.y||0)*u*g,(n.blur||0)*c*g),r=Nh.getShadowTransform(t,_,s,n,Lc,g,!0),r&&_.setTransform(r),Tc(_,Lc,s),_.restore(),a?(_.copyWorld(_,l,o,"copy"),_.copyWorld(a,o,o,"source-out"),i=o):(_.copyWorld(s.canvas,d,h,"source-out"),i=l),_.fillWorld(i,Ah.string(n.color),"source-in"),en.copyCanvasByWorld(t,e,_,i,n.blendMode),p&&f<p&&_.clearWorld(i)}),_.recycle(i)},blur:function(t,e,s){const{blur:i}=t.__;s.setWorldBlur(i*t.__nowWorld.a),s.copyWorldToInner(e,t.__nowWorld,t.__layout.renderBounds),s.filter="none"},backgroundBlur:function(t,e,s){},getShadowRenderSpread:Cc,getShadowTransform:function(t,e,s,i,r,o,n){if(i.spread){const s=2*i.spread*o*(n?-1:1),{width:a,height:h}=t.__layout.strokeBounds;return Sc.set().scaleOfOuter({x:(r.x+r.width/2)*e.pixelRatio,y:(r.y+r.height/2)*e.pixelRatio},1+s/a,1+s/h),Sc}},isTransformShadow(t){},getInnerShadowSpread:Ic},{excludeRenderBounds:Oc}=dn;let Ac;function Mc(t,e,s,i,r,o,n,a){switch(e){case"grayscale":Ac||(Ac=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,s,i,r,o){const n=t.__nowWorld;s.resetTransform(),s.opacity=1,s.useMask(i,n),o&&i.recycle(n);Dc(t,e,s,1,r,o)}(t,s,i,r,n,a);break;case"opacity-path":Dc(t,s,i,o,n,a);break;case"path":a&&s.restore()}}function Wc(t){return t.getSameCanvas(!1,!0)}function Dc(t,e,s,i,r,o){const n=t.__nowWorld;e.resetTransform(),e.opacity=i,e.copyWorld(s,n,void 0,r),o?s.recycle(n):s.clearWorld(n)}t.Group.prototype.__renderMask=function(t,e){let s,i,r,o,n,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++){if(s=h[l],a=s.__.mask,a){n&&(Mc(this,n,t,r,i,o,void 0,!0),i=r=null),"clipping"!==a&&"clipping-path"!==a||Oc(s,e)||s.__render(t,e),o=s.__.opacity,Ac=!1,"path"===a||"clipping-path"===a?(o<1?(n="opacity-path",r||(r=Wc(t))):(n="path",t.save()),s.__clip(r||t,e)):(n="grayscale"===a?"grayscale":"alpha",i||(i=Wc(t)),r||(r=Wc(t)),s.__render(i,e));continue}const d=1===o&&s.__.__blendMode;d&&Mc(this,n,t,r,i,o,void 0,!1),Oc(s,e)||s.__render(r||t,e),d&&Mc(this,n,t,r,i,o,d,!1)}Mc(this,n,t,r,i,o,void 0,!0)};const Fc=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",Uc=Fc+"_#~&*+\\=|≮≯≈≠=…",Nc=new RegExp([[19968,40959],[13312,19903],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[196608,201551],[201552,205743],[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12736,12783],[12800,13055],[13056,13311],[63744,64255],[65072,65103],[127488,127743],[194560,195103]].map(([t,e])=>`[\\u${t.toString(16)}-\\u${e.toString(16)}]`).join("|"));function zc(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}const Yc=zc("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),Xc=zc("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),Hc=zc(Fc),Gc=zc(Uc),jc=zc("- —/~|┆·");var Vc;!function(t){t[t.Letter=0]="Letter",t[t.Single=1]="Single",t[t.Before=2]="Before",t[t.After=3]="After",t[t.Symbol=4]="Symbol",t[t.Break=5]="Break"}(Vc||(Vc={}));const{Letter:qc,Single:Qc,Before:Jc,After:$c,Symbol:Zc,Break:Kc}=Vc;function tu(t){return Yc[t]?qc:jc[t]?Kc:Xc[t]?Jc:Hc[t]?$c:Gc[t]?Zc:Nc.test(t)?Qc:qc}const eu={trimRight(t){const{words:e}=t;let s,i=0,r=e.length;for(let o=r-1;o>-1&&(s=e[o].data[0]," "===s.char);o--)i++,t.width-=s.width;i&&e.splice(r-i,i)}};function su(t,e,s){switch(e){case"title":return s?t.toUpperCase():t;case"upper":return t.toUpperCase();case"lower":return t.toLowerCase();default:return t}}const{trimRight:iu}=eu,{Letter:ru,Single:ou,Before:nu,After:au,Symbol:hu,Break:lu}=Vc;let du,cu,uu,_u,pu,fu,gu,yu,mu,xu,wu,vu,bu,Bu,ku,Su,Ru,Cu=[];function Tu(t,e){mu&&!yu&&(yu=mu),du.data.push({char:t,width:e}),uu+=e}function Pu(){_u+=uu,du.width=uu,cu.words.push(du),du={data:[]},uu=0}function Lu(){Bu&&(ku.paraNumber++,cu.paraStart=!0,Bu=!1),mu&&(cu.startCharSize=yu,cu.endCharSize=mu,yu=0),cu.width=_u,Su.width?iu(cu):Ru&&Iu(),Cu.push(cu),cu={words:[]},_u=0}function Iu(){_u>(ku.maxWidth||0)&&(ku.maxWidth=_u)}const{top:Eu,right:Ou,bottom:Au,left:Mu}=t.Direction4;function Wu(t,e,s){const{bounds:i,rows:r}=t;i[e]+=s;for(let t=0;t<r.length;t++)r[t][e]+=s}const Du={getDrawData:function(t,e){r(t)||(t=String(t));let s=0,i=0,o=e.__getInput("width")||0,n=e.__getInput("height")||0;const{__padding:a}=e;a&&(o?(s=a[Mu],o-=a[Ou]+a[Mu],!o&&(o=.01)):e.autoSizeAlign||(s=a[Mu]),n?(i=a[Eu],n-=a[Eu]+a[Au],!n&&(n=.01)):e.autoSizeAlign||(i=a[Eu]));const h={bounds:{x:s,y:i,width:o,height:n},rows:[],paraNumber:0,font:g.canvas.font=e.__font};return function(t,e,s){ku=t,Cu=t.rows,Su=t.bounds,Ru=!Su.width&&!s.autoSizeAlign;const{__letterSpacing:i,paraIndent:r,textCase:o}=s,{canvas:n}=g,{width:a}=Su;if(s.__isCharMode){const t="none"!==s.textWrap,h="break"===s.textWrap;Bu=!0,wu=null,yu=gu=mu=uu=_u=0,du={data:[]},cu={words:[]},i&&(e=[...e]);for(let s=0,l=e.length;s<l;s++)fu=e[s],"\n"===fu?(uu&&Pu(),cu.paraEnd=!0,Lu(),Bu=!0):(xu=tu(fu),xu===ru&&"none"!==o&&(fu=su(fu,o,!uu)),gu=n.measureText(fu).width,i&&(i<0&&(mu=gu),gu+=i),vu=xu===ou&&(wu===ou||wu===ru)||wu===ou&&xu!==au,bu=!(xu!==nu&&xu!==ou||wu!==hu&&wu!==au),pu=Bu&&r?a-r:a,t&&a&&_u+uu+gu>pu&&(h?(uu&&Pu(),_u&&Lu()):(bu||(bu=xu===ru&&wu==au),vu||bu||xu===lu||xu===nu||xu===ou||uu+gu>pu?(uu&&Pu(),_u&&Lu()):_u&&Lu()))," "===fu&&!0!==Bu&&_u+uu===0||(xu===lu?(" "===fu&&uu&&Pu(),Tu(fu,gu),Pu()):vu||bu?(uu&&Pu(),Tu(fu,gu)):Tu(fu,gu)),wu=xu);uu&&Pu(),_u&&Lu(),Cu.length>0&&(Cu[Cu.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{ku.paraNumber++,_u=n.measureText(t).width,Cu.push({x:r||0,text:t,width:_u,paraStart:!0}),Ru&&Iu()})}(h,t,e),a&&function(t,e,s,i,r){if(!i&&s.autoSizeAlign)switch(s.textAlign){case"left":Wu(e,"x",t[Mu]);break;case"right":Wu(e,"x",-t[Ou])}if(!r&&s.autoSizeAlign)switch(s.verticalAlign){case"top":Wu(e,"y",t[Eu]);break;case"bottom":Wu(e,"y",-t[Au])}}(a,h,e,o,n),function(t,e){const{rows:s,bounds:i}=t,r=s.length,{__lineHeight:o,__baseLine:n,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:f,height:g}=i,y=o*r+(c?c*(t.paraNumber-1):0),m=n;if(h&&y>g)y=Math.max(g,o),r>1&&(t.overflow=r);else if(g||u)switch(d){case"middle":p+=(g-y)/2;break;case"bottom":p+=g-y}m+=p;let x,w,v,b=f||u?f:t.maxWidth;for(let n=0,d=r;n<d;n++){if(x=s[n],x.x=_,x.width<f||x.width>f&&!h)switch(l){case"center":x.x+=(b-x.width)/2;break;case"right":x.x+=b-x.width}x.paraStart&&c&&n>0&&(m+=c),x.y=m,m+=o,t.overflow>n&&m>y&&(x.isOverflow=!0,t.overflow=n+1),w=x.x,v=x.width,a<0&&(x.width<0?(v=-x.width+e.fontSize+a,w-=v,v+=e.fontSize):v-=a),w<i.x&&(i.x=w),v>i.width&&(i.width=v),h&&f&&f<v&&(x.isOverflow=!0,t.overflow||(t.overflow=s.length))}i.y=p,i.height=y}(h,e),e.__isCharMode&&function(t,e,s){const{rows:i}=t,{textAlign:r,paraIndent:o,letterSpacing:n}=e,a=s&&r.includes("both"),h=a||s&&r.includes("justify"),l=h&&r.includes("letter");let d,c,u,_,p,f,g,y,m,x;i.forEach(t=>{t.words&&(p=o&&t.paraStart?o:0,y=t.words.length,h&&(x=!t.paraEnd||a,c=s-t.width-p,l?_=c/(t.words.reduce((t,e)=>t+e.data.length,0)-1):u=y>1?c/(y-1):0),f=n||t.isOverflow||l?0:u?1:2,t.isOverflow&&!n&&(t.textMode=!0),2===f?(t.x+=p,function(t){t.text="",t.words.forEach(e=>{e.data.forEach(e=>{t.text+=e.char})})}(t)):(t.x+=p,d=t.x,t.data=[],t.words.forEach((e,s)=>{1===f?(g={char:"",x:d},d=function(t,e,s){return t.forEach(t=>{s.char+=t.char,e+=t.width}),e}(e.data,d,g),(t.isOverflow||" "!==g.char)&&t.data.push(g)):d=function(t,e,s,i,r){return t.forEach(t=>{(i||" "!==t.char)&&(t.x=e,s.push(t)),e+=t.width,r&&(e+=r)}),e}(e.data,d,t.data,t.isOverflow,x&&_),x&&(m=s===y-1,u?m||(d+=u,t.width+=u):_&&(t.width+=_*(e.data.length-(m?1:0))))})),t.words=null)})}(h,e,o),h.overflow&&function(t,e,s,i){if(!i)return;const{rows:r,overflow:o}=t;let{textOverflow:n}=e;if(r.splice(o),n&&"show"!==n){let t,a;"hide"===n?n="":"ellipsis"===n&&(n="...");const h=n?g.canvas.measureText(n).width:0,l=s+i-h;("none"===e.textWrap?r:[r[o-1]]).forEach(e=>{if(e.isOverflow&&e.data){let s=e.data.length-1;for(let i=s;i>-1&&(t=e.data[i],a=t.x+t.width,!(i===s&&a<l));i--){if(a<l&&" "!==t.char||!i){e.data.splice(i+1),e.width-=t.width;break}e.width-=t.width}e.width+=h,e.data.push({char:n,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(h,e,s,o),"none"!==e.textDecoration&&function(t,e){let s,i=0;const{fontSize:r,textDecoration:o}=e;switch(t.decorationHeight=r/11,l(o)?(s=o.type,o.color&&(t.decorationColor=Ah.string(o.color)),o.offset&&(i=Math.min(.3*r,Math.max(o.offset,.15*-r)))):s=o,s){case"under":t.decorationY=[.15*r+i];break;case"delete":t.decorationY=[.35*-r];break;case"under-delete":t.decorationY=[.15*r+i,.35*-r]}}(h,e),h}};const Fu={string:function(t,e){if(!t)return"#000";const i=n(e)&&e<1;if(r(t)){if(!i||!Ah.object)return t;t=Ah.object(t)}let o=s(t.a)?1:t.a;i&&(o*=e);const a=t.r+","+t.g+","+t.b;return 1===o?"rgb("+a+")":"rgba("+a+","+o+")"}};return Object.assign(Oh,Du),Object.assign(Ah,Fu),Object.assign(Dh,wd),Object.assign(Fh,Kd),Object.assign(Uh,mc),Object.assign(Nh,Ec),ph(),t.AlignHelper=kt,t.AroundHelper=vt,t.AutoBounds=Vt,t.BezierHelper=is,t.Bounds=Gt,t.BoundsEvent=Mn,t.BoundsHelper=zt,t.BoxData=tl,t.BranchHelper=pn,t.BranchRender=Pa,t.CanvasData=_l,t.CanvasManager=ce,t.ChildEvent=Ln,t.ColorConvert=Ah,t.Creator=re,t.DataHelper=c,t.Debug=Jt,t.Effect=Nh,t.EllipseData=ol,t.EllipseHelper=us,t.Event=Pn,t.EventCreator=le,t.Eventer=Zn,t.Export=Yh,t.FileHelper=Yr,t.Filter=zh,t.FourNumberHelper=S,t.FrameData=sl,t.GroupData=Kh,t.ImageData=ul,t.ImageEvent=An,t.ImageManager=Jr,t.IncrementId=m,t.LayoutEvent=Xn,t.Layouter=Ch,t.LeafBounds=Ra,t.LeafBoundsHelper=dn,t.LeafData=_,t.LeafDataProxy=ca,t.LeafEventer=la,t.LeafHelper=en,t.LeafLayout=Tn,t.LeafLevelList=ch,t.LeafList=dh,t.LeafMatrix=ma,t.LeafRender=Ca,t.LeaferCanvas=uh,t.LeaferCanvasBase=Ce,t.LeaferData=el,t.LeaferEvent=Gn,t.LeaferImage=to,t.LineData=il,t.MathHelper=M,t.Matrix=pt,t.MatrixHelper=J,t.MyImage=Zl,t.NeedConvertToCanvasCommandMap=Ee,t.OneRadian=D,t.PI2=F,t.PI_2=U,t.Paint=Dh,t.PaintGradient=Uh,t.PaintImage=Fh,t.PathArrow=Wh,t.PathBounds=Lr,t.PathCommandDataHelper=wi,t.PathCommandMap=Le,t.PathCommandNodeHelper=_s,t.PathConvert=$s,t.PathCorner=Dr,t.PathCreator=Di,t.PathData=hl,t.PathDrawer=Zi,t.PathHelper=Te,t.PathNumberCommandLengthMap=We,t.PathNumberCommandMap=Me,t.PenData=ll,t.Platform=g,t.Plugin=ie,t.Point=ut,t.PointHelper=at,t.PolygonData=nl,t.PropertyEvent=En,t.RectData=rl,t.RectHelper=De,t.RectRender=wl,t.RenderEvent=Hn,t.Renderer=Ph,t.ResizeEvent=zn,t.Resource=qr,t.Run=te,t.StarData=al,t.State=Xh,t.StringNumberMap=qt,t.TaskItem=Gr,t.TaskProcessor=jr,t.TextConvert=Oh,t.TextData=cl,t.Transition=Hh,t.TwoPointBoundsHelper=gt,t.UIBounds=gl,t.UICreator=ne,t.UIData=$h,t.UIRender=ml,t.UnitConvert=Mh,t.WaitHelper=mn,t.WatchEvent=Yn,t.Watcher=gh,t.affectRenderBoundsType=bo,t.affectStrokeBoundsType=xo,t.attr=oo,t.autoLayoutType=co,t.boundsType=po,t.canvasPatch=zr,t.canvasSizeAttrs=Re,t.createAttr=function(t){return(e,s)=>{eo(e,s,io(s,t))}},t.createDescriptor=io,t.cursorType=Oo,t.dataProcessor=Ao,t.dataType=ao,t.decorateLeafAttr=ro,t.defineDataProcessor=Mo,t.defineKey=eo,t.defineLeafAttr=no,t.dimType=ko,t.doBoundsType=go,t.doStrokeType=wo,t.effectType=Lh,t.emptyData={},t.eraserType=Io,t.extraPropertyEventMap=On,t.getBoundsData=z,t.getDescriptor=so,t.getMatrixData=Y,t.getPointData=N,t.hitType=Eo,t.isArray=h,t.isData=function(t){return l(t)&&!h(t)},t.isEmptyData=d,t.isFinite=o,t.isNull=i,t.isNumber=n,t.isObject=l,t.isString=r,t.isUndefined=s,t.layoutProcessor=function(t){return(e,s)=>{eo(e,"__LayoutProcessor",{get:()=>t})}},t.leaferTransformAttrMap=Jn,t.maskType=Lo,t.naturalBoundsType=fo,t.opacityType=So,t.path=Fr,t.pathInputType=yo,t.pathType=mo,t.pen=Ur,t.positionType=ho,t.registerUI=Xo,t.registerUIEvent=function(){return t=>{le.register(t)}},t.resizeType=Ih,t.rewrite=Uo,t.rewriteAble=No,t.rotationType=_o,t.scaleType=uo,t.scrollType=lo,t.sortType=Po,t.strokeType=vo,t.surfaceType=Bo,t.tempBounds=jt,t.tempMatrix=ft,t.tempPoint=_t,t.tryToNumber=function(t){return"string"==typeof t&&a.test(t)?+t:t},t.useCanvas=ph,t.useModule=Yo,t.version="1.11.1",t.visibleType=Ro,t.zoomLayerType=Eh,t}({});function Leafer(t){return new LeaferUI.Leafer(t)}Object.setPrototypeOf(Leafer,LeaferUI),Leafer.prototype=LeaferUI.Leafer.prototype;
|
|
2
2
|
//# sourceMappingURL=worker.min.js.map
|