@leafer-draw/miniapp 1.12.3 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- var t,e;!function(t){t[t.none=1]="none",t[t.free=2]="free",t[t.mirrorAngle=3]="mirrorAngle",t[t.mirror=4]="mirror"}(t||(t={})),function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(e||(e={}));const s={};function i(t){return void 0===t}function r(t){return null==t}function n(t){return"string"==typeof t}const{isFinite:o}=Number;function a(t){return"number"==typeof t}const h=/^-?\d+(?:\.\d+)?$/;function l(t){return"string"==typeof t&&h.test(t)?+t:t}const{isArray:d}=Array;function c(t){return t&&"object"==typeof t}function u(t){return c(t)&&!d(t)}function _(t){return"{}"===JSON.stringify(t)}const p={default:(t,e)=>(g(e,t),g(t,e),t),assign(t,e,s){let i;Object.keys(e).forEach(r=>{var n,o;if(i=e[r],(null==i?void 0:i.constructor)===Object&&(null===(n=t[r])||void 0===n?void 0:n.constructor)===Object)return g(t[r],e[r],s&&s[r]);s&&r in s?(null===(o=s[r])||void 0===o?void 0:o.constructor)===Object&&g(t[r]={},e[r],s[r]):t[r]=e[r]})},copyAttrs:(t,e,s)=>(s.forEach(s=>{i(e[s])||(t[s]=e[s])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,i=t.length;s<i;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:g}=p;class f{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(!i(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let s;for(let r in this)"_"!==r[0]&&(s=e?e[r]:void 0,t[r]=i(s)?this[r]:s);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!i(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!i(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const s={};if(t)if(d(t))for(let e of t)s[e]=this.__getInput(e);else for(let e in t)s[e]=this.__getInput(e);else{let t,e,{__input:r}=this;s.tag=this.__leaf.tag;for(let n in this)if("_"!==n[0]&&(t=this["_"+n],!i(t))){if("path"===n&&!this.__pathInputed)continue;e=r?r[n]:void 0,s[n]=i(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:i,d:r,e:n,f:o}=this.__leaf.__localMatrix;s.matrix={a:t,b:e,c:i,d:r,e:n,f:o}}return s}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null}}const{floor:y,max:m}=Math,x={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||w.maxCacheSize),isSuperLarge:(t,e,s)=>w.isLarge(t,e,s,w.maxPatternSize),getRealURL(t){const{prefix:e,suffix:s}=x.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,n,o,a,h){const l=x.origin.createCanvas(m(y(e+(i||0)),1),m(y(s+(r||0)),1)),d=l.getContext("2d");if(a&&(d.globalAlpha=a),d.imageSmoothingEnabled=!1!==o,n){const i=e/n.width,r=s/n.height;d.setTransform(i,0,0,r,-n.x*i,-n.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&&p.stintSet(s,"transform",e)}}},{image:w}=x,v={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=b;return e[t]?e[t]++:(e[t]=1,0)}},b=v;let S,k,B;const{max:R}=Math,C=[0,0,0,0],P={zero:[...C],tempFour:C,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)=>T(C,t,e,s,i),toTempAB(t,e,s){B=s?a(t)?e:t:[],a(t)?(S=O(t),k=e):a(e)?(S=t,k=O(e)):(S=t,k=e),4!==S.length&&(S=L(S)),4!==k.length&&(k=L(k))},get(t,e){let s;if(!a(t))switch(t.length){case 4:s=i(e)?t:[...t];break;case 2:s=[t[0],t[1],t[0],t[1]];break;case 3:s=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(s||(s=[t,t,t,t]),!i(e))for(let t=0;t<4;t++)s[t]>e&&(s[t]=e);return s},max:(t,e,s)=>a(t)&&a(e)?R(t,e):(E(t,e,s),T(B,R(S[0],k[0]),R(S[1],k[1]),R(S[2],k[2]),R(S[3],k[3]))),add:(t,e,s)=>a(t)&&a(e)?t+e:(E(t,e,s),T(B,S[0]+k[0],S[1]+k[1],S[2]+k[2],S[3]+k[3])),swapAndScale(t,e,s,i){if(a(t))return e===s?t*e:[t*s,t*e];const r=i?t:[],[n,o,h,l]=4===t.length?t:L(t);return T(r,h*s,l*e,n*s,o*e)}},{set:T,get:L,setTemp:O,toTempAB:E}=P,{round:A,pow:I,max:W,floor:M,PI:D}=Math,F={within:(t,e,s)=>(c(e)&&(s=e.max,e=e.min),!i(e)&&t<e&&(t=e),!i(s)&&t>s&&(t=s),t),fourNumber:P.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),F.float(t)),getGapRotation(t,e,s=0){let i=t+s;if(e>1){const t=Math.abs(i%e);(t<1||t>e-1)&&(i=Math.round(i/e)*e)}return i-s},float(t,e){const s=i(e)?1e12:I(10,e);return-0===(t=A(t*s)/s)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,s,i){if(i||(i={}),e){const t=(a(e)?e:e.width||0)/s.width,r=(a(e)?e:e.height||0)/s.height;i.scaleX=t||r||1,i.scaleY=r||t||1}else t&&F.assignScale(i,t);return i},assignScale(t,e){a(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>W(M(t),e)/t,randInt:z,randColor:t=>`rgba(${z(255)},${z(255)},${z(255)},${t||1})`};function z(t){return Math.round(Math.random()*t)}const N=D/180,Y=2*D,X=D/2;function U(){return{x:0,y:0}}function j(){return{x:0,y:0,width:0,height:0}}function V(){return{a:1,b:0,c:0,d:1,e:0,f:0}}const{sin:G,cos:H,acos:q,sqrt:Q}=Math,{float:J}=F,$={};function Z(){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 K={defaultMatrix:{a:1,b:0,c:0,d:1,e:0,f:0},defaultWorld:Z(),tempMatrix:{},set(t,e=1,s=0,i=0,r=1,n=0,o=0){t.a=e,t.b=s,t.c=i,t.d=r,t.e=n,t.f=o},get:V,getWorld:Z,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){tt.toInnerPoint(t,e,$),tt.scaleOfInner(t,$,s,i)},scaleOfInner(t,e,s,i=s){tt.translateInner(t,e.x,e.y),tt.scale(t,s,i),tt.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:i,c:r,d:n}=t,o=H(e*=N),a=G(e);t.a=s*o-i*a,t.b=s*a+i*o,t.c=r*o-n*a,t.d=r*a+n*o},rotateOfOuter(t,e,s){tt.toInnerPoint(t,e,$),tt.rotateOfInner(t,$,s)},rotateOfInner(t,e,s){tt.translateInner(t,e.x,e.y),tt.rotate(t,s),tt.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:i,b:r,c:n,d:o}=t;s&&(s*=N,t.a=i+n*s,t.b=r+o*s),e&&(e*=N,t.c=n+i*e,t.d=o+r*e)},skewOfOuter(t,e,s,i){tt.toInnerPoint(t,e,$),tt.skewOfInner(t,$,s,i)},skewOfInner(t,e,s,i=0){tt.translateInner(t,e.x,e.y),tt.skew(t,s,i),tt.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:i,c:r,d:n,e:o,f:a}=t;t.a=e.a*s+e.b*r,t.b=e.a*i+e.b*n,t.c=e.c*s+e.d*r,t.d=e.c*i+e.d*n,t.e=e.e*s+e.f*r+o,t.f=e.e*i+e.f*n+a},multiplyParent(t,e,s,r,n){const{e:o,f:a}=t;if(s||(s=t),i(r)&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:i,b:r,c:o,d:a}=t;s.a=i*e.a+r*e.c,s.b=i*e.b+r*e.d,s.c=o*e.a+a*e.c,s.d=o*e.b+a*e.d,n&&(s.scaleX=e.scaleX*n.scaleX,s.scaleY=e.scaleY*n.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,n&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=o*e.a+a*e.c+e.e,s.f=o*e.b+a*e.d+e.f},divide(t,e){tt.multiply(t,tt.tempInvert(e))},divideParent(t,e){tt.multiplyParent(t,tt.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=tt;return tt.copy(e,t),tt.invert(e),e},invert(t){const{a:e,b:s,c:i,d:r,e:n,f:o}=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=-(n*r-o*i)*a,t.f=-(o*e-n*s)*a}else if(1===e&&1===r)t.e=-n,t.f=-o;else{const s=1/(e*r);t.a=r*s,t.d=e*s,t.e=-n*r*s,t.f=-o*e*s}},toOuterPoint(t,e,s,i){const{x:r,y:n}=e;s||(s=e),s.x=r*t.a+n*t.c,s.y=r*t.b+n*t.d,i||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,i){const{a:r,b:n,c:o,d:a}=t,h=1/(r*a-n*o),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*o)*h,s.y=(d*r-l*n)*h,!i){const{e:e,f:i}=t;s.x-=(e*a-i*o)*h,s.y-=(i*r-e*n)*h}},setLayout(t,e,s,r,n){const{x:o,y:a,scaleX:h,scaleY:l}=e;if(i(n)&&(n=e.rotation||e.skewX||e.skewY),n){const{rotation:s,skewX:i,skewY:r}=e,n=s*N,o=H(n),a=G(n);if(i||r){const e=i*N,s=r*N;t.a=(o+s*-a)*h,t.b=(a+s*o)*h,t.c=(e*o-a)*l,t.d=(o+e*a)*l}else t.a=o*h,t.b=a*h,t.c=-a*l,t.d=o*l}else t.a=h,t.b=0,t.c=0,t.d=l;t.e=o,t.f=a,(s=s||r)&&tt.translateInner(t,-s.x,-s.y,!r)},getLayout(t,e,s,i){const{a:r,b:n,c:o,d:a,e:h,f:l}=t;let d,c,u,_,p,g=h,f=l;if(n||o){const t=r*a-n*o;if(o&&!i){d=Q(r*r+n*n),c=t/d;const e=r/d;u=n>0?q(e):-q(e)}else{c=Q(o*o+a*a),d=t/c;const e=o/c;u=X-(a>0?q(-e):-q(e))}const e=J(H(u)),s=G(u);d=J(d),c=J(c),_=e?J((o/c+s)/e/N,9):0,p=e?J((n/d-s)/e/N,9):0,u=J(u/N)}else d=r,c=a,u=_=p=0;return(e=s||e)&&(g+=e.x*r+e.y*o,f+=e.x*n+e.y*a,s||(g-=e.x,f-=e.y)),{x:g,y:f,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:n,d:o}=t;r||n?s=(i*o-r*n)/(e=Q(i*i+r*r)):(e=i,s=o)}return i.scaleX=e,i.scaleY=s,i},reset(t){tt.set(t)}},tt=K,{float:et}=F,{toInnerPoint:st,toOuterPoint:it}=K,{sin:rt,cos:nt,abs:ot,sqrt:at,atan2:ht,min:lt,round:dt}=Math,ct={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,s){t.radiusX=e,t.radiusY=i(s)?e:s},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,s){t.x=e,t.y=s},round(t,e){t.x=e?dt(t.x-.5)+.5:dt(t.x),t.y=e?dt(t.y-.5)+.5:dt(t.y)},move(t,e,s){c(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=ut.defaultPoint);const i=nt(e*=N),r=rt(e),n=t.x-s.x,o=t.y-s.y;t.x=s.x+n*i-o*r,t.y=s.y+n*r+o*i},tempToInnerOf(t,e){const{tempPoint:s}=ut;return pt(s,t),st(e,s,s),s},tempToOuterOf(t,e){const{tempPoint:s}=ut;return pt(s,t),it(e,s,s),s},tempToInnerRadiusPointOf(t,e){const{tempRadiusPoint:s}=ut;return pt(s,t),ut.toInnerRadiusPointOf(t,e,s),s},copyRadiusPoint:(t,e,s,i)=>(pt(t,e),gt(t,s,i),t),toInnerRadiusPointOf(t,e,s){s||(s=t),st(e,t,s),s.radiusX=Math.abs(t.radiusX/e.scaleX),s.radiusY=Math.abs(t.radiusY/e.scaleY)},toInnerOf(t,e,s){st(e,t,s)},toOuterOf(t,e,s){it(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)=>_t(t.x,t.y,e.x,e.y),getDistanceFrom(t,e,s,i){const r=ot(s-t),n=ot(i-e);return at(r*r+n*n)},getMinDistanceFrom:(t,e,s,i,r,n)=>lt(_t(t,e,s,i),_t(s,i,r,n)),getAngle:(t,e)=>ft(t,e)/N,getRotation:(t,e,s,i)=>(i||(i=e),ut.getRadianFrom(t.x,t.y,e.x,e.y,s.x,s.y,i.x,i.y)/N),getRadianFrom(t,e,s,r,n,o,a,h){i(a)&&(a=s,h=r);const l=t-s,d=e-r,c=n-a,u=o-h;return Math.atan2(l*u-d*c,l*c+d*u)},getAtan2:(t,e)=>ht(e.y-t.y,e.x-t.x),getDistancePoint(t,e,s,i,r){const n=ft(t,e);return r&&(t=e),i||(e={}),e.x=t.x+nt(n)*s,e.y=t.y+rt(n)*s,e},toNumberPoints(t){let e=t;return c(t[0])&&(e=[],t.forEach(t=>e.push(t.x,t.y))),e},isSame:(t,e)=>et(t.x)===et(e.x)&&et(t.y)===et(e.y),reset(t){ut.reset(t)}},ut=ct,{getDistanceFrom:_t,copy:pt,setRadius:gt,getAtan2:ft}=ut;class yt{constructor(t,e){this.set(t,e)}set(t,e){return c(t)?ct.copy(this,t):ct.set(this,t,e),this}get(){const{x:t,y:e}=this;return{x:t,y:e}}clone(){return new yt(this)}move(t,e){return ct.move(this,t,e),this}scale(t,e){return ct.scale(this,t,e),this}scaleOf(t,e,s){return ct.scaleOf(this,t,e,s),this}rotate(t,e){return ct.rotate(this,t,e),this}rotateOf(t,e){return ct.rotate(this,e,t),this}getRotation(t,e,s){return ct.getRotation(this,t,e,s)}toInnerOf(t,e){return ct.toInnerOf(this,t,e),this}toOuterOf(t,e){return ct.toOuterOf(this,t,e),this}getCenter(t){return new yt(ct.getCenter(this,t))}getDistance(t){return ct.getDistance(this,t)}getDistancePoint(t,e,s,i){return new yt(ct.getDistancePoint(this,t,e,s,i))}getAngle(t){return ct.getAngle(this,t)}getAtan2(t){return ct.getAtan2(this,t)}isSame(t){return ct.isSame(this,t)}reset(){return ct.reset(this),this}}const mt=new yt;class xt{constructor(t,e,s,i,r,n){this.set(t,e,s,i,r,n)}set(t,e,s,i,r,n){return c(t)?K.copy(this,t):K.set(this,t,e,s,i,r,n),this}setWith(t){return K.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:n}=this;return{a:t,b:e,c:s,d:i,e:r,f:n}}clone(){return new xt(this)}translate(t,e){return K.translate(this,t,e),this}translateInner(t,e){return K.translateInner(this,t,e),this}scale(t,e){return K.scale(this,t,e),this}scaleWith(t,e){return K.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return K.pixelScale(this,t),this}scaleOfOuter(t,e,s){return K.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return K.scaleOfInner(this,t,e,s),this}rotate(t){return K.rotate(this,t),this}rotateOfOuter(t,e){return K.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return K.rotateOfInner(this,t,e),this}skew(t,e){return K.skew(this,t,e),this}skewOfOuter(t,e,s){return K.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return K.skewOfInner(this,t,e,s),this}multiply(t){return K.multiply(this,t),this}multiplyParent(t){return K.multiplyParent(this,t),this}divide(t){return K.divide(this,t),this}divideParent(t){return K.divideParent(this,t),this}invert(){return K.invert(this),this}invertWith(){return K.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){K.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){K.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return K.setLayout(this,t,e,s),this}getLayout(t,e,s){return K.getLayout(this,t,e,s)}withScale(t,e){return K.withScale(this,t,e)}reset(){K.reset(this)}}const wt=new xt,vt={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){bt(t,e,s),bt(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:bt}=vt;var St,kt;!function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"}(St||(St={})),function(t){t[t.topLeft=0]="topLeft",t[t.top=1]="top",t[t.topRight=2]="topRight",t[t.right=3]="right",t[t.bottomRight=4]="bottomRight",t[t.bottom=5]="bottom",t[t.bottomLeft=6]="bottomLeft",t[t.left=7]="left",t[t.center=8]="center",t[t["top-left"]=0]="top-left",t[t["top-right"]=2]="top-right",t[t["bottom-right"]=4]="bottom-right",t[t["bottom-left"]=6]="bottom-left"}(kt||(kt={}));const Bt=[{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}];Bt.forEach(t=>t.type="percent");const Rt={directionData:Bt,tempPoint:{},get:Ct,toPoint(t,e,s,i,r,n){const o=Ct(t);s.x=o.x,s.y=o.y,"percent"===o.type&&(s.x*=e.width,s.y*=e.height,r&&(n||(s.x-=r.x,s.y-=r.y),o.x&&(s.x-=1===o.x?r.width:.5===o.x?o.x*r.width:0),o.y&&(s.y-=1===o.y?r.height:.5===o.y?o.y*r.height:0))),i||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s)=>(s||(s={}),Rt.toPoint(t,e,s,!0),s)};function Ct(t){return n(t)?Bt[kt[t]]:t}const{toPoint:Pt}=Rt,Tt={toPoint(t,e,s,i,r,n){Pt(t,s,i,r,e,n)}},{tempPointBounds:Lt,setPoint:Ot,addPoint:Et,toBounds:At}=vt,{toOuterPoint:It}=K,{float:Wt,fourNumber:Mt}=F,{floor:Dt,ceil:Ft}=Math;let zt,Nt,Yt,Xt;const Ut={},jt={},Vt={},Gt={tempBounds:Vt,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:n,y:o,width:a,height:h}=e;if(d(s)){const e=Mt(s);i?Ht.set(t,n+e[3],o+e[0],a-e[1]-e[3],h-e[2]-e[0]):Ht.set(t,n-e[3],o-e[0],a+e[1]+e[3],h+e[2]+e[0])}else i&&(s=-s),Ht.set(t,n-s,o-s,a+2*s,h+2*s);r&&("width"===r?(t.y=o,t.height=h):(t.x=n,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),Ht.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?Qt(e,t):e=t,s||(s=t),e.offsetX=Ht.maxX(s),e.offsetY=Ht.maxY(s),Ht.move(e,-e.offsetX,-e.offsetY)},scale(t,e,s=e,i){i||ct.scale(t,e,s),t.width*=e,t.height*=s},scaleOf(t,e,s,i=s){ct.scaleOf(t,e,s,i),t.width*=s,t.height*=i},tempToOuterOf:(t,e)=>(Ht.copy(Vt,t),Ht.toOuterOf(Vt,e),Vt),getOuterOf:(t,e)=>(t=Object.assign({},t),Ht.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:i,d:r,e:n,f:o}=e;i>0?(s.width=t.width*i,s.x=n+t.x*i):(s.width=t.width*-i,s.x=n+t.x*i-s.width),r>0?(s.height=t.height*r,s.y=o+t.y*r):(s.height=t.height*-r,s.y=o+t.y*r-s.height)}else Ut.x=t.x,Ut.y=t.y,It(e,Ut,jt),Ot(Lt,jt.x,jt.y),Ut.x=t.x+t.width,It(e,Ut,jt),Et(Lt,jt.x,jt.y),Ut.y=t.y+t.height,It(e,Ut,jt),Et(Lt,jt.x,jt.y),Ut.x=t.x,It(e,Ut,jt),Et(Lt,jt.x,jt.y),At(Lt,s)},toInnerOf(t,e,s){s||(s=t),Ht.move(s,-e.e,-e.f),Ht.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const i=Math.min(s,Ht.getFitScale(t,e));return new xt(i,0,0,i,-e.x*i,-e.y*i)},getFitScale(t,e,s){const i=t.width/e.width,r=t.height/e.height;return s?Math.max(i,r):Math.min(i,r)},put(t,e,s="center",i=1,r=!0,o){o||(o=e),n(i)&&(i=Ht.getFitScale(t,e,"cover"===i)),Vt.width=r?e.width*=i:e.width*i,Vt.height=r?e.height*=i:e.height*i,Tt.toPoint(s,Vt,t,o,!0,!0)},getSpread(t,e,s){const i={};return Ht.copyAndSpread(i,t,e,!1,s),i},spread(t,e,s){Ht.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){Ht.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=Dt(t.x),t.y=Dt(t.y),t.width=e>t.x?Ft(t.width+e-t.x):Ft(t.width),t.height=s>t.y?Ft(t.height+s-t.y):Ft(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=Wt(t.x,e),t.y=Wt(t.y,e),t.width=Wt(t.width,e),t.height=Wt(t.height,e)},add(t,e,s){zt=t.x+t.width,Nt=t.y+t.height,Yt=e.x,Xt=e.y,s||(Yt+=e.width,Xt+=e.height),zt=zt>Yt?zt:Yt,Nt=Nt>Xt?Nt:Xt,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=zt-t.x,t.height=Nt-t.y},addList(t,e){Ht.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){Ht.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){Ht.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,i=!1){let r,n=!0;for(let o=0,a=e.length;o<a;o++)r=s?s(e[o],o):e[o],r&&(r.width||r.height)&&(n?(n=!1,i||Qt(t,r)):qt(t,r));n&&Ht.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Ot(Lt,t.x,t.y):Et(Lt,t.x,t.y)),At(Lt,t)},setPoint(t,e){Ht.set(t,e.x,e.y)},addPoint(t,e){qt(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=ct.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=ct.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=Ht.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=Ht.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=Ht.tempToOuterOf(e,s)),!Ht.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:i,y:r,width:n,height:o}=e;return zt=i+n,Nt=r+o,Yt=t.x+t.width,Xt=t.y+t.height,i=i>t.x?i:t.x,r=r>t.y?r:t.y,zt=zt<Yt?zt:Yt,Nt=Nt<Xt?Nt:Xt,n=zt-i,o=Nt-r,{x:i,y:r,width:n,height:o}},intersect(t,e,s){Ht.copy(t,Ht.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){Ht.set(t)}},Ht=Gt,{add:qt,copy:Qt}=Ht;class Jt{get minX(){return Gt.minX(this)}get minY(){return Gt.minY(this)}get maxX(){return Gt.maxX(this)}get maxY(){return Gt.maxY(this)}constructor(t,e,s,i){this.set(t,e,s,i)}set(t,e,s,i){return c(t)?Gt.copy(this,t):Gt.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 Jt(this)}move(t,e){return Gt.move(this,t,e),this}scale(t,e,s){return Gt.scale(this,t,e,s),this}scaleOf(t,e,s){return Gt.scaleOf(this,t,e,s),this}toOuterOf(t,e){return Gt.toOuterOf(this,t,e),this}toInnerOf(t,e){return Gt.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Gt.getFitMatrix(this,t,e)}put(t,e,s){Gt.put(this,t,e,s)}spread(t,e){return Gt.spread(this,t,e),this}shrink(t,e){return Gt.shrink(this,t,e),this}ceil(){return Gt.ceil(this),this}unsign(){return Gt.unsign(this),this}float(t){return Gt.float(this,t),this}add(t){return Gt.add(this,t),this}addList(t){return Gt.setList(this,t,!0),this}setList(t){return Gt.setList(this,t),this}addListWithFn(t,e){return Gt.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Gt.setListWithFn(this,t,e),this}setPoint(t){return Gt.setPoint(this,t),this}setPoints(t){return Gt.setPoints(this,t),this}addPoint(t){return Gt.addPoint(this,t),this}getPoints(){return Gt.getPoints(this)}hitPoint(t,e){return Gt.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Gt.hitRadiusPoint(this,t,e)}hit(t,e){return Gt.hit(this,t,e)}includes(t,e){return Gt.includes(this,t,e)}intersect(t,e){return Gt.intersect(this,t,e),this}getIntersect(t,e){return new Jt(Gt.getIntersectData(this,t,e))}isSame(t){return Gt.isSame(this,t)}isEmpty(){return Gt.isEmpty(this)}reset(){Gt.reset(this)}}const $t=new Jt;class Zt{constructor(t,e,s,i,r,n){c(t)?this.copy(t):this.set(t,e,s,i,r,n)}set(t=0,e=0,s=0,i=0,r=0,n=0){this.top=t,this.right=e,this.bottom=s,this.left=i,this.width=r,this.height=n}copy(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=t;this.set(e,s,i,r,n,o)}getBoundsFrom(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=this;return new Jt(r,e,n||t.width-r-s,o||t.height-e-i)}}const Kt={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:te}=F;class ee{constructor(t){this.repeatMap={},this.name=t}static get(t){return new ee(t)}static set filter(t){this.filterList=se(t)}static set exclude(t){this.excludeList=se(t)}static drawRepaint(t,e){const s=te();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const i="hit"===ee.showBounds,r=t.__nowWorld,n=te();i&&(e.setWorld(r),t.__drawHitPath(e),e.fillStyle=n.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(n,2),i?e.stroke():e.strokeWorld(r,n)}log(...t){if(ie.enable){if(ie.filterList.length&&ie.filterList.every(t=>t!==this.name))return;if(ie.excludeList.length&&ie.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){ie.enable&&this.warn(...t)}warn(...t){ie.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 se(t){return t?n(t)&&(t=[t]):t=[],t}ee.filterList=[],ee.excludeList=[],ee.showWarn=!0;const ie=ee,re=ee.get("RunTime"),ne={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const s=v.create(v.RUNTIME);return oe.currentId=oe.idMap[s]=e?performance.now():Date.now(),oe.currentName=oe.nameMap[s]=t,oe.nameToIdMap[t]=s,s},end(t,e){const s=oe.idMap[t],i=oe.nameMap[t],r=e?(performance.now()-s)/1e3:Date.now()-s;oe.idMap[t]=oe.nameMap[t]=oe.nameToIdMap[i]=void 0,re.log(i,r,"ms")},endOfName(t,e){const s=oe.nameToIdMap[t];i(s)||oe.end(s,e)}},oe=ne,ae=[],he={list:{},add(t,...e){this.list[t]=!0,ae.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(()=>ae.forEach(t=>he.has(t,!0)));const le={editor:t=>he.need("editor")},de=ee.get("UICreator"),ce={list:{},register(t){const{__tag:e}=t.prototype;ue[e]&&de.repeat(e),ue[e]=t},get(t,e,s,r,n,o){ue[t]||de.error("not register "+t);const a=new ue[t](e);return i(s)||(a.x=s,r&&(a.y=r),n&&(a.width=n),o&&(a.height=o)),a}},{list:ue}=ce,_e=ee.get("EventCreator"),pe={nameList:{},register(t){let e;Object.keys(t).forEach(s=>{e=t[s],n(e)&&(ge[e]&&_e.repeat(e),ge[e]=t)})},changeName(t,e){const s=ge[t];if(s){const i=Object.keys(s).find(e=>s[e]===t);i&&(s[i]=e,ge[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new ge[t](...e)},{nameList:ge}=pe;class fe{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=le.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 ye(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o}function me(t,e,s,i){return new(s||(s=Promise))(function(r,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(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(o,a)}h((i=i.apply(t,e||[])).next())})}function xe(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 we=[];function ve(){return(t,e)=>{we.push(e)}}const be=[];let Se=class{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||be)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;we.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,s,i,r,n){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,i,r,n){c(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,i,r,n)}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,n,o,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/i*a;i+=e,e=0,n+=t,a-=t}if(s<0){const t=-s/r*h;r+=s,s=0,o+=t,h-=t}this.context.drawImage(t,e,s,i,r,n,o,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,n){}quadraticCurveTo(t,e,s,i){}closePath(){}arc(t,e,s,i,r,n){}arcTo(t,e,s,i,r){}ellipse(t,e,s,i,r,n,o,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,n){}fillText(t,e,s,i){}measureText(t){}strokeText(t,e,s,i){}destroy(){this.context=null}};ye([xe("imageSmoothingEnabled")],Se.prototype,"smooth",void 0),ye([xe("imageSmoothingQuality")],Se.prototype,"smoothLevel",void 0),ye([xe("globalAlpha")],Se.prototype,"opacity",void 0),ye([xe()],Se.prototype,"fillStyle",void 0),ye([xe()],Se.prototype,"strokeStyle",void 0),ye([xe("lineWidth")],Se.prototype,"strokeWidth",void 0),ye([xe("lineCap")],Se.prototype,"strokeCap",void 0),ye([xe("lineJoin")],Se.prototype,"strokeJoin",void 0),ye([xe("lineDashOffset")],Se.prototype,"dashOffset",void 0),ye([xe()],Se.prototype,"miterLimit",void 0),ye([xe()],Se.prototype,"shadowBlur",void 0),ye([xe()],Se.prototype,"shadowColor",void 0),ye([xe()],Se.prototype,"shadowOffsetX",void 0),ye([xe()],Se.prototype,"shadowOffsetY",void 0),ye([xe()],Se.prototype,"filter",void 0),ye([xe()],Se.prototype,"font",void 0),ye([xe()],Se.prototype,"fontKerning",void 0),ye([xe()],Se.prototype,"fontStretch",void 0),ye([xe()],Se.prototype,"fontVariantCaps",void 0),ye([xe()],Se.prototype,"textAlign",void 0),ye([xe()],Se.prototype,"textBaseline",void 0),ye([xe()],Se.prototype,"textRendering",void 0),ye([xe()],Se.prototype,"wordSpacing",void 0),ye([xe()],Se.prototype,"letterSpacing",void 0),ye([xe()],Se.prototype,"direction",void 0),ye([ve()],Se.prototype,"setTransform",null),ye([ve()],Se.prototype,"resetTransform",null),ye([ve()],Se.prototype,"getTransform",null),ye([ve()],Se.prototype,"save",null),ye([ve()],Se.prototype,"restore",null),ye([ve()],Se.prototype,"translate",null),ye([ve()],Se.prototype,"scale",null),ye([ve()],Se.prototype,"rotate",null),ye([ve()],Se.prototype,"fill",null),ye([ve()],Se.prototype,"stroke",null),ye([ve()],Se.prototype,"clip",null),ye([ve()],Se.prototype,"fillRect",null),ye([ve()],Se.prototype,"strokeRect",null),ye([ve()],Se.prototype,"clearRect",null),ye([ve()],Se.prototype,"beginPath",null),ye([ve()],Se.prototype,"moveTo",null),ye([ve()],Se.prototype,"lineTo",null),ye([ve()],Se.prototype,"bezierCurveTo",null),ye([ve()],Se.prototype,"quadraticCurveTo",null),ye([ve()],Se.prototype,"closePath",null),ye([ve()],Se.prototype,"arc",null),ye([ve()],Se.prototype,"arcTo",null),ye([ve()],Se.prototype,"ellipse",null),ye([ve()],Se.prototype,"rect",null),ye([ve()],Se.prototype,"roundRect",null),ye([ve()],Se.prototype,"createConicGradient",null),ye([ve()],Se.prototype,"createLinearGradient",null),ye([ve()],Se.prototype,"createPattern",null),ye([ve()],Se.prototype,"createRadialGradient",null),ye([ve()],Se.prototype,"fillText",null),ye([ve()],Se.prototype,"measureText",null),ye([ve()],Se.prototype,"strokeText",null);const{copy:ke,multiplyParent:Be,pixelScale:Re}=K,{round:Ce}=Math,Pe=new Jt,Te=new Jt,Le={width:1,height:1,pixelRatio:1},Oe=["width","height","pixelRatio"];class Ee extends Se{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=Le),this.manager=e,this.innerId=v.create(v.CNAVAS);const{width:s,height:i,pixelRatio:r}=t;this.autoLayout=!s||!i,this.size.pixelRatio=r||x.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let s;this.context&&!this.unreal&&e&&this.width&&(s=this.getSameCanvas(),s.copyWorld(this));const i=this.size;p.copyAttrs(i,t,Oe),Oe.forEach(t=>i[t]||(i[t]=1)),this.bounds=new Jt(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&&Be(t,e,r),Re(t,s,r),i&&!t.ignorePixelSnap&&(t.half&&t.half*s%2?(r.e=Ce(r.e-.5)+.5,r.f=Ce(r.f-.5)+.5):(r.e=Ce(r.e),r.f=Ce(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,s,i){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,i)}setStrokeOptions(t,e){let{strokeCap:s,strokeJoin:r,dashPattern:n,dashOffset:o,miterLimit:a}=t;e&&(e.strokeCap&&(s=e.strokeCap),e.strokeJoin&&(r=e.strokeJoin),i(e.dashPattern)||(n=e.dashPattern),i(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=s,this.strokeJoin=r,this.dashPattern=n,this.dashOffset=o,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){i&&(this.blendMode=i),e?(this.setTempPixelBounds(e,r),s?(this.setTempPixelBounds2(s,r),s=Te):s=Pe,this.drawImage(t.view,Pe.x,Pe.y,Pe.width,Pe.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){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Gt.tempToOuterOf(s,e),i,r),this.restore()):(i&&(this.blendMode=i),this.setTempPixelBounds(e,r),this.drawImage(t.view,Pe.x,Pe.y,Pe.width,Pe.height,s.x,s.y,s.width,s.height),i&&(this.blendMode="source-over"))}copyWorldByReset(t,e,s,i,r,n){this.resetTransform(),this.copyWorld(t,e,s,i,n),r||this.useWorldTransform()}useGrayscaleAlpha(t){let e,s;this.setTempPixelBounds(t,!0,!0);const{context:i}=this,r=i.getImageData(Pe.x,Pe.y,Pe.width,Pe.height),{data:n}=r;for(let t=0,i=n.length;t<i;t+=4)s=.299*n[t]+.587*n[t+1]+.114*n[t+2],(e=n[t+3])&&(n[t+3]=255===e?s:e*(s/255));i.putImageData(r,Pe.x,Pe.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(Pe.x,Pe.y,Pe.width,Pe.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s,i){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempPixelBounds(t,i),this.strokeRect(Pe.x,Pe.y,Pe.width,Pe.height),s&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Pe.x,Pe.y,Pe.width,Pe.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Pe.x,Pe.y,Pe.width,Pe.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,s){this.copyToPixelBounds(Pe,t,e,s)}setTempPixelBounds2(t,e,s){this.copyToPixelBounds(Te,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):le.canvas(Object.assign({},s));return r.save(),t&&(ke(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 Ae={creator:{},parse(t,e){},convertToCanvasData(t,e){}},Ie={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},We=Object.assign({M:1,m:10,L:2,l:20,H:3,h:30,V:4,v:40,C:5,c:50,S:6,s:60,Q:7,q:70,T:8,t:80,A:9,a:90,Z:11,z:11,R:12},Ie),Me={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},De={m:10,l:20,H:3,h:30,V:4,v:40,c:50,S:6,s:60,q:70,T:8,t:80,A:9,a:90},Fe=Object.assign(Object.assign({},De),Ie),ze=We,Ne={};for(let t in ze)Ne[ze[t]]=t;const Ye={};for(let t in ze)Ye[ze[t]]=Me[t];const Xe={drawRoundRect(t,e,s,i,r,n){const o=F.fourNumber(n,Math.min(i/2,r/2)),a=e+i,h=s+r;o[0]?t.moveTo(e+o[0],s):t.moveTo(e,s),o[1]?t.arcTo(a,s,a,h,o[1]):t.lineTo(a,s),o[2]?t.arcTo(a,h,e,h,o[2]):t.lineTo(a,h),o[3]?t.arcTo(e,h,e,s,o[3]):t.lineTo(e,h),o[0]?t.arcTo(e,s,a,s,o[0]):t.lineTo(e,s)}},{sin:Ue,cos:je,hypot:Ve,atan2:Ge,ceil:He,abs:qe,PI:Qe,sqrt:Je,pow:$e}=Math,{setPoint:Ze,addPoint:Ke}=vt,{set:ts,toNumberPoints:es}=ct,{M:ss,L:is,C:rs,Q:ns,Z:os}=We,as={},hs={points(t,e,s,i){let r=es(e);if(t.push(ss,r[0],r[1]),s&&r.length>5){let e,n,o,a,h,l,d,c,u,_,p,g,f,y,m,x=r.length;const w=!0===s?.5:s;i&&(r=[r[x-2],r[x-1],...r,r[0],r[1],r[2],r[3]],x=r.length);for(let s=2;s<x-2;s+=2)e=r[s-2],n=r[s-1],o=r[s],a=r[s+1],h=r[s+2],l=r[s+3],p=o-e,g=a-n,f=Je($e(p,2)+$e(g,2)),y=Je($e(h-o,2)+$e(l-a,2)),(f||y)&&(m=f+y,f=w*f/m,y=w*y/m,h-=e,l-=n,d=o-f*h,c=a-f*l,2===s?i||t.push(ns,d,c,o,a):(p||g)&&t.push(rs,u,_,d,c,o,a),u=o+y*h,_=a+y*l);i||t.push(ns,u,_,r[x-2],r[x-1])}else for(let e=2,s=r.length;e<s;e+=2)t.push(is,r[e],r[e+1]);i&&t.push(os)},rect(t,e,s,i,r){Ae.creator.path=t,Ae.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,n){Ae.creator.path=[],Xe.drawRoundRect(Ae.creator,e,s,i,r,n),t.push(...Ae.convertToCanvasData(Ae.creator.path,!0))},arcTo(t,e,s,i,r,n,o,a,h,l,d){const c=i-e,u=r-s,_=n-i,p=o-r;let g=Ge(u,c),f=Ge(p,_);const y=Ve(c,u),m=Ve(_,p);let x=f-g;if(x<0&&(x+=Y),y<1e-12||m<1e-12||x<1e-12||qe(x-Qe)<1e-12)return t&&t.push(is,i,r),h&&(Ze(h,e,s),Ke(h,i,r)),d&&ts(d,e,s),void(l&&ts(l,i,r));const w=c*p-_*u<0,v=w?-1:1,b=a/je(x/2),S=i+b*je(g+x/2+X*v),k=r+b*Ue(g+x/2+X*v);return g-=X*v,f-=X*v,cs(t,S,k,a,a,0,g/N,f/N,w,h,l,d)},arc:(t,e,s,i,r,n,o,a,h,l)=>cs(t,e,s,i,i,0,r,n,o,a,h,l),ellipse(t,e,s,i,r,n,o,a,h,l,d,c){const u=n*N,_=Ue(u),p=je(u);let g=o*N,f=a*N;g>Qe&&(g-=Y),f<0&&(f+=Y);let y=f-g;y<0?y+=Y:y>Y&&(y-=Y),h&&(y-=Y);const m=He(qe(y/X)),x=y/m,w=Ue(x/4),v=8/3*w*w/Ue(x/2);f=g+x;let b,S,k,B,R,C,P,T,L=je(g),O=Ue(g),E=k=p*i*L-_*r*O,A=B=_*i*L+p*r*O,I=e+k,W=s+B;t&&t.push(t.length?is:ss,I,W),l&&Ze(l,I,W),c&&ts(c,I,W);for(let n=0;n<m;n++)b=je(f),S=Ue(f),k=p*i*b-_*r*S,B=_*i*b+p*r*S,R=e+E-v*(p*i*O+_*r*L),C=s+A-v*(_*i*O-p*r*L),P=e+k+v*(p*i*S+_*r*b),T=s+B+v*(_*i*S-p*r*b),t&&t.push(rs,R,C,P,T,e+k,s+B),l&&ds(e+E,s+A,R,C,P,T,e+k,s+B,l,!0),E=k,A=B,L=b,O=S,g=f,f+=x;d&&ts(d,e+k,s+B)},quadraticCurveTo(t,e,s,i,r,n,o){t.push(rs,(e+2*i)/3,(s+2*r)/3,(n+2*i)/3,(o+2*r)/3,n,o)},toTwoPointBoundsByQuadraticCurve(t,e,s,i,r,n,o,a){ds(t,e,(t+2*s)/3,(e+2*i)/3,(r+2*s)/3,(n+2*i)/3,r,n,o,a)},toTwoPointBounds(t,e,s,i,r,n,o,a,h,l){const d=[];let c,u,_,p,g,f,y,m,x=t,w=s,v=r,b=o;for(let t=0;t<2;++t)if(1==t&&(x=e,w=i,v=n,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||(g=(-u+m)/(2*c),0<g&&g<1&&d.push(g),f=(-u-m)/(2*c),0<f&&f<1&&d.push(f));l?Ke(h,t,e):Ze(h,t,e),Ke(h,o,a);for(let l=0,c=d.length;l<c;l++)ls(d[l],t,e,s,i,r,n,o,a,as),Ke(h,as.x,as.y)},getPointAndSet(t,e,s,i,r,n,o,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+_*n+p*a,l.y=c*s+u*r+_*o+p*h},getPoint(t,e,s,i,r,n,o,a,h){const l={};return ls(t,e,s,i,r,n,o,a,h,l),l},getDerivative(t,e,s,i,r){const n=1-t;return 3*n*n*(s-e)+6*n*t*(i-s)+3*t*t*(r-i)}},{getPointAndSet:ls,toTwoPointBounds:ds,ellipse:cs}=hs,{sin:us,cos:_s,sqrt:ps,atan2:gs}=Math,{ellipse:fs}=hs,ys={ellipticalArc(t,e,s,i,r,n,o,a,h,l,d){const c=(h-e)/2,u=(l-s)/2,_=n*N,p=us(_),g=_s(_),f=-g*c-p*u,y=-g*u+p*c,m=i*i,w=r*r,v=y*y,b=f*f,S=m*w-m*v-w*b;let k=0;if(S<0){const t=ps(1-S/(m*w));i*=t,r*=t}else k=(o===a?-1:1)*ps(S/(m*v+w*b));const B=k*i*y/r,R=-k*r*f/i,C=gs((y-R)/r,(f-B)/i),P=gs((-y-R)/r,(-f-B)/i);let T=P-C;0===a&&T>0?T-=Y:1===a&&T<0&&(T+=Y);const L=e+c+g*B-p*R,O=s+u+p*B+g*R,E=T<0?1:0;d||x.ellipseToCurve?fs(t,L,O,i,r,n,C/N,P/N,E):i!==r||n?t.push(We.G,L,O,i,r,n,C/N,P/N,E):t.push(We.O,L,O,i,C/N,P/N,E)}},ms={toCommand:t=>[],toNode:t=>[]},{M:xs,m:ws,L:vs,l:bs,H:Ss,h:ks,V:Bs,v:Rs,C:Cs,c:Ps,S:Ts,s:Ls,Q:Os,q:Es,T:As,t:Is,A:Ws,a:Ms,Z:Ds,z:Fs,N:zs,D:Ns,X:Ys,G:Xs,F:Us,O:js,P:Vs,U:Gs}=We,{rect:Hs,roundRect:qs,arcTo:Qs,arc:Js,ellipse:$s,quadraticCurveTo:Zs}=hs,{ellipticalArc:Ks}=ys,ti=ee.get("PathConvert"),ei={},si={current:{dot:0},stringify(t,e){let s,i,r,n=0,o=t.length,a="";for(;n<o;){i=t[n],s=Ye[i],a+=i===r?" ":Ne[i];for(let i=1;i<s;i++)a+=F.float(t[n+i],e),i===s-1||(a+=" ");r=i,n+=s}return a},parse(t,e){let s,i,r,n="";const o=[],a=e?Fe:De;for(let e=0,h=t.length;e<h;e++)i=t[e],Kt[i]?("."===i&&(ii.dot&&(ri(o,n),n=""),ii.dot++),"0"===n&&"."!==i&&(ri(o,n),n=""),n+=i):We[i]?(n&&(ri(o,n),n=""),ii.name=We[i],ii.length=Me[i],ii.index=0,ri(o,ii.name),!s&&a[i]&&(s=!0)):"-"===i||"+"===i?"e"===r||"E"===r?n+=i:(n&&ri(o,n),n=i):n&&(ri(o,n),n=""),r=i;return n&&ri(o,n),s?si.toCanvasData(o,e):o},toCanvasData(t,e){let s,i,r,n,o,a=0,h=0,l=0,d=0,c=0,u=t.length;const _=[];for(;c<u;){switch(r=t[c],r){case ws:t[c+1]+=a,t[c+2]+=h;case xs:a=t[c+1],h=t[c+2],_.push(xs,a,h),c+=3;break;case ks:t[c+1]+=a;case Ss:a=t[c+1],_.push(vs,a,h),c+=2;break;case Rs:t[c+1]+=h;case Bs:h=t[c+1],_.push(vs,a,h),c+=2;break;case bs:t[c+1]+=a,t[c+2]+=h;case vs:a=t[c+1],h=t[c+2],_.push(vs,a,h),c+=3;break;case Ls:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Ts;case Ts:o=n===Cs||n===Ts,l=o?2*a-s:t[c+1],d=o?2*h-i:t[c+2],s=t[c+1],i=t[c+2],a=t[c+3],h=t[c+4],_.push(Cs,l,d,s,i,a,h),c+=5;break;case Ps: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=Cs;case Cs:s=t[c+3],i=t[c+4],a=t[c+5],h=t[c+6],_.push(Cs,t[c+1],t[c+2],s,i,a,h),c+=7;break;case Is:t[c+1]+=a,t[c+2]+=h,r=As;case As:o=n===Os||n===As,s=o?2*a-s:t[c+1],i=o?2*h-i:t[c+2],e?Zs(_,a,h,s,i,t[c+1],t[c+2]):_.push(Os,s,i,t[c+1],t[c+2]),a=t[c+1],h=t[c+2],c+=3;break;case Es:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Os;case Os:s=t[c+1],i=t[c+2],e?Zs(_,a,h,s,i,t[c+3],t[c+4]):_.push(Os,s,i,t[c+3],t[c+4]),a=t[c+3],h=t[c+4],c+=5;break;case Ms:t[c+6]+=a,t[c+7]+=h;case Ws:Ks(_,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 Fs:case Ds:_.push(Ds),c++;break;case zs:a=t[c+1],h=t[c+2],e?Hs(_,a,h,t[c+3],t[c+4]):ni(_,t,c,5),c+=5;break;case Ns:a=t[c+1],h=t[c+2],e?qs(_,a,h,t[c+3],t[c+4],[t[c+5],t[c+6],t[c+7],t[c+8]]):ni(_,t,c,9),c+=9;break;case Ys:a=t[c+1],h=t[c+2],e?qs(_,a,h,t[c+3],t[c+4],t[c+5]):ni(_,t,c,6),c+=6;break;case Xs:$s(e?_:ni(_,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,ei),a=ei.x,h=ei.y,c+=9;break;case Us:e?$s(_,t[c+1],t[c+2],t[c+3],t[c+4],0,0,360,!1):ni(_,t,c,5),a=t[c+1]+t[c+3],h=t[c+2],c+=5;break;case js:Js(e?_:ni(_,t,c,7),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],null,ei),a=ei.x,h=ei.y,c+=7;break;case Vs:e?Js(_,t[c+1],t[c+2],t[c+3],0,360,!1):ni(_,t,c,4),a=t[c+1]+t[c+3],h=t[c+2],c+=4;break;case Gs:Qs(e?_:ni(_,t,c,6),a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],null,ei),a=ei.x,h=ei.y,c+=6;break;default:return ti.error(`command: ${r} [index:${c}]`,t),_}n=r}return _},objectToCanvasData(t){if(t[0].name.length>1)return ms.toCommand(t);{const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(xs,t.x,t.y);break;case"L":e.push(vs,t.x,t.y);break;case"C":e.push(Cs,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Os,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(Ds)}}),e}},copyData(t,e,s,i){for(let r=s,n=s+i;r<n;r++)t.push(e[r])},pushData(t,e){ii.index===ii.length&&(ii.index=1,t.push(ii.name)),t.push(Number(e)),ii.index++,ii.dot=0}},{current:ii,pushData:ri,copyData:ni}=si,{M:oi,L:ai,C:hi,Q:li,Z:di,N:ci,D:ui,X:_i,G:pi,F:gi,O:fi,P:yi,U:mi}=We,{getMinDistanceFrom:xi,getRadianFrom:wi}=ct,{tan:vi,min:bi,abs:Si}=Math,ki={},Bi={beginPath(t){t.length=0},moveTo(t,e,s){t.push(oi,e,s)},lineTo(t,e,s){t.push(ai,e,s)},bezierCurveTo(t,e,s,i,r,n,o){t.push(hi,e,s,i,r,n,o)},quadraticCurveTo(t,e,s,i,r){t.push(li,e,s,i,r)},closePath(t){t.push(di)},rect(t,e,s,i,r){t.push(ci,e,s,i,r)},roundRect(t,e,s,i,r,n){if(a(n))t.push(_i,e,s,i,r,n);else{const o=F.fourNumber(n);o?t.push(ui,e,s,i,r,...o):t.push(ci,e,s,i,r)}},ellipse(t,e,s,i,n,o,a,h,l){if(i===n)return Ci(t,e,s,i,a,h,l);r(o)?t.push(gi,e,s,i,n):(r(a)&&(a=0),r(h)&&(h=360),t.push(pi,e,s,i,n,o,a,h,l?1:0))},arc(t,e,s,i,n,o,a){r(n)?t.push(yi,e,s,i):(r(n)&&(n=0),r(o)&&(o=360),t.push(fi,e,s,i,n,o,a?1:0))},arcTo(t,e,s,r,n,o,a,h){if(!i(a)){const t=xi(a,h,e,s,r,n);o=bi(o,bi(t/2,t/2*Si(vi(wi(a,h,e,s,r,n)/2))))}t.push(mi,e,s,r,n,o)},drawEllipse(t,e,s,i,n,o,a,h,l){hs.ellipse(null,e,s,i,n,r(o)?0:o,r(a)?0:a,r(h)?360:h,l,null,null,ki),t.push(oi,ki.x,ki.y),Ri(t,e,s,i,n,o,a,h,l)},drawArc(t,e,s,i,n,o,a){hs.arc(null,e,s,i,r(n)?0:n,r(o)?360:o,a,null,null,ki),t.push(oi,ki.x,ki.y),Ci(t,e,s,i,n,o,a)},drawPoints(t,e,s,i){hs.points(t,e,s,i)}},{ellipse:Ri,arc:Ci}=Bi,{moveTo:Pi,lineTo:Ti,quadraticCurveTo:Li,bezierCurveTo:Oi,closePath:Ei,beginPath:Ai,rect:Ii,roundRect:Wi,ellipse:Mi,arc:Di,arcTo:Fi,drawEllipse:zi,drawArc:Ni,drawPoints:Yi}=Bi;class Xi{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?n(t)?Ae.parse(t):t:[],this}beginPath(){return Ai(this.__path),this.paint(),this}moveTo(t,e){return Pi(this.__path,t,e),this.paint(),this}lineTo(t,e){return Ti(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,i,r,n){return Oi(this.__path,t,e,s,i,r,n),this.paint(),this}quadraticCurveTo(t,e,s,i){return Li(this.__path,t,e,s,i),this.paint(),this}closePath(){return Ei(this.__path),this.paint(),this}rect(t,e,s,i){return Ii(this.__path,t,e,s,i),this.paint(),this}roundRect(t,e,s,i,r){return Wi(this.__path,t,e,s,i,r),this.paint(),this}ellipse(t,e,s,i,r,n,o,a){return Mi(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}arc(t,e,s,i,r,n){return Di(this.__path,t,e,s,i,r,n),this.paint(),this}arcTo(t,e,s,i,r){return Fi(this.__path,t,e,s,i,r),this.paint(),this}drawEllipse(t,e,s,i,r,n,o,a){return zi(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}drawArc(t,e,s,i,r,n){return Ni(this.__path,t,e,s,i,r,n),this.paint(),this}drawPoints(t,e,s){return Yi(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:Ui,L:ji,C:Vi,Q:Gi,Z:Hi,N:qi,D:Qi,X:Ji,G:$i,F:Zi,O:Ki,P:tr,U:er}=We,sr=ee.get("PathDrawer"),ir={drawPathByData(t,e){if(!e)return;let s,i=0,r=e.length;for(;i<r;)switch(s=e[i],s){case Ui:t.moveTo(e[i+1],e[i+2]),i+=3;break;case ji:t.lineTo(e[i+1],e[i+2]),i+=3;break;case Vi:t.bezierCurveTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5],e[i+6]),i+=7;break;case Gi:t.quadraticCurveTo(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Hi:t.closePath(),i+=1;break;case qi:t.rect(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Qi: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 Ji:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;case $i:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]*N,e[i+6]*N,e[i+7]*N,e[i+8]),i+=9;break;case Zi:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],0,0,Y,!1),i+=5;break;case Ki:t.arc(e[i+1],e[i+2],e[i+3],e[i+4]*N,e[i+5]*N,e[i+6]),i+=7;break;case tr:t.arc(e[i+1],e[i+2],e[i+3],0,Y,!1),i+=4;break;case er:t.arcTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;default:return void sr.error(`command: ${s} [index:${i}]`,e)}}},{M:rr,L:nr,C:or,Q:ar,Z:hr,N:lr,D:dr,X:cr,G:ur,F:_r,O:pr,P:gr,U:fr}=We,{toTwoPointBounds:yr,toTwoPointBoundsByQuadraticCurve:mr,arcTo:xr,arc:wr,ellipse:vr}=hs,{addPointBounds:br,copy:Sr,addPoint:kr,setPoint:Br,addBounds:Rr,toBounds:Cr}=vt,Pr=ee.get("PathBounds");let Tr,Lr,Or;const Er={},Ar={},Ir={},Wr={toBounds(t,e){Wr.toTwoPointBounds(t,Ar),Cr(Ar,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Br(e,0,0);let s,i,r,n,o,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(o=t[a],0===a&&(o===hr||o===or||o===ar?Br(e,h,l):Br(e,t[a+1],t[a+2])),o){case rr:case nr:h=t[a+1],l=t[a+2],kr(e,h,l),a+=3;break;case or:r=t[a+5],n=t[a+6],yr(h,l,t[a+1],t[a+2],t[a+3],t[a+4],r,n,Er),br(e,Er),h=r,l=n,a+=7;break;case ar:s=t[a+1],i=t[a+2],r=t[a+3],n=t[a+4],mr(h,l,s,i,r,n,Er),br(e,Er),h=r,l=n,a+=5;break;case hr:a+=1;break;case lr:h=t[a+1],l=t[a+2],Rr(e,h,l,t[a+3],t[a+4]),a+=5;break;case dr:case cr:h=t[a+1],l=t[a+2],Rr(e,h,l,t[a+3],t[a+4]),a+=o===dr?9:6;break;case ur:vr(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],Er,Ir),0===a?Sr(e,Er):br(e,Er),h=Ir.x,l=Ir.y,a+=9;break;case _r:h=t[a+1],l=t[a+2],Lr=t[a+3],Or=t[a+4],Rr(e,h-Lr,l-Or,2*Lr,2*Or),h+=Lr,a+=5;break;case pr:wr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Er,Ir),0===a?Sr(e,Er):br(e,Er),h=Ir.x,l=Ir.y,a+=7;break;case gr:h=t[a+1],l=t[a+2],Tr=t[a+3],Rr(e,h-Tr,l-Tr,2*Tr,2*Tr),h+=Tr,a+=4;break;case fr:xr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Er,Ir),0===a?Sr(e,Er):br(e,Er),h=Ir.x,l=Ir.y,a+=6;break;default:return void Pr.error(`command: ${o} [index:${a}]`,t)}}},{M:Mr,L:Dr,Z:Fr}=We,{getCenterX:zr,getCenterY:Nr}=ct,{arcTo:Yr}=Bi,Xr={smooth(t,e,s){let i,r,n,o=0,a=0,h=0,l=0,c=0,u=0,_=0,p=0,g=0;d(e)&&(e=e[0]||0);const f=t.length,y=[];for(;o<f;){switch(i=t[o],i){case Mr:l=p=t[o+1],c=g=t[o+2],o+=3,t[o]===Dr?(u=t[o+1],_=t[o+2],y.push(Mr,zr(l,u),Nr(c,_))):y.push(Mr,l,c);break;case Dr:switch(a=t[o+1],h=t[o+2],o+=3,t[o]){case Dr:Yr(y,a,h,t[o+1],t[o+2],e,p,g);break;case Fr:Yr(y,a,h,l,c,e,p,g);break;default:y.push(Dr,a,h)}p=a,g=h;break;case Fr:r!==Fr&&(Yr(y,l,c,u,_,e,p,g),y.push(Fr)),o+=1;break;default:n=Ye[i];for(let e=0;e<n;e++)y.push(t[o+e]);o+=n}r=i}return i!==Fr&&(y[1]=l,y[2]=c),y}};function Ur(t){return new Xi(t)}const jr=Ur();Ae.creator=Ur(),Ae.parse=si.parse,Ae.convertToCanvasData=si.toCanvasData;const{drawRoundRect:Vr}=Xe;function Gr(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,i,r){Vr(this,t,e,s,i,r)})}(t)}const Hr={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=qr.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{}}}},qr=Hr;qr.alphaPixelTypes.forEach(t=>qr.upperCaseTypeMap[t]=t.toUpperCase());const Qr=ee.get("TaskProcessor");class Jr{constructor(t){this.parallel=!0,this.time=1,this.id=v.create(v.TASK),this.task=t}run(){return me(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){Qr.error(t)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}}class $r{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,s=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(s+=this.list[i].time,i===this.finishedIndex&&(e=s)):e+=this.list[i].time;return this.isComplete?1:s/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&p.assign(this.config,t),this.empty()}add(t,e,s){let r,n,o,h;const l=new Jr(t);return l.parent=this,a(e)?h=e:e&&(n=e.parallel,r=e.start,o=e.time,h=e.delay,s||(s=e.canUse)),o&&(l.time=o),!1===n&&(l.parallel=!1),s&&(l.canUse=s),i(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 Zr=ee.get("Resource"),Kr={tasker:new $r,map:{},get isComplete(){return tn.tasker.isComplete},set(t,e){tn.map[t]&&Zr.repeat(t),tn.map[t]=e},get:t=>tn.map[t],remove(t){const e=tn.map[t];e&&(e.destroy&&e.destroy(),delete tn.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 n(e)?i={url:e}:e.url||(i={url:t,view:e}),i&&(s&&(i.format=s),e=le.image(i)),tn.set(t,e),e},destroy(){tn.map={}}},tn=Kr,en={maxRecycled:10,recycledList:[],patternTasker:new $r({parallel:1}),get(t){let e=Kr.get(t.url);return e||Kr.set(t.url,e=le.image(t)),e.use++,e},recycle(t){t.use--,setTimeout(()=>{t.use||(x.image.isLarge(t)?t.url&&Kr.remove(t.url):(t.clearLevels(),sn.recycledList.push(t)))})},recyclePaint(t){sn.recycle(t.image)},clearRecycled(t){const e=sn.recycledList;(e.length>sn.maxRecycled||t)&&(e.forEach(e=>(!e.use||t)&&e.url&&Kr.remove(e.url)),e.length=0)},clearLevels(){},hasAlphaPixel:t=>Hr.alphaPixelTypes.some(e=>sn.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:"+Hr.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+Hr.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){this.clearRecycled(!0)}},sn=en,{IMAGE:rn,create:nn}=v;class on{get url(){return this.config.url}get crossOrigin(){const{crossOrigin:t}=this.config;return i(t)?x.image.crossOrigin:t}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=nn(rn),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}en.isFormat("svg",t)&&(this.isSVG=!0),en.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e,s){return this.loading||(this.loading=!0,Kr.tasker.add(()=>me(this,void 0,void 0,function*(){return yield x.origin.loadImage(this.getLoadUrl(s),this.crossOrigin,this).then(t=>{s&&this.setThumbView(t),this.setView(t)}).catch(t=>{this.error=t,this.onComplete(!1)})}))),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||(this.width=t.width,this.height=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,n,o){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=x.image.resize(this.view,t,e,r,n,void 0,o,s,i);return this.cache=this.use>1?{data:a,params:arguments}:null,a}getPattern(t,e,s,i){const r=x.canvas.createPattern(t,e);return x.image.setPatternTransform(r,s,i),r}getLoadUrl(t){return this.url}setThumbView(t){}getThumbSize(){}getMinLevel(){}getLevelData(t){}clearLevels(t){}destroy(){this.clearLevels();const{view:t}=this;t&&t.close&&t.close(),this.config={url:""},this.cache=this.view=null,this.waitComplete.length=0}}function an(t,e,s,i){i||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function hn(t,e){return Object.getOwnPropertyDescriptor(t,e)}function ln(t,e){const s="_"+t;return{get(){const t=this[s];return null==t?e:t},set(t){this[s]=t}}}function dn(t,e){return(s,i)=>un(s,i,t,e&&e(i))}function cn(t){return t}function un(t,e,s,i){const r={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};an(t,e,Object.assign(r,i||{})),Yn(t,e,s)}function _n(t){return dn(t)}function pn(t,e){return dn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function gn(t,e){return dn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function fn(t){return dn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),vn(this))}}))}function yn(t,e){return dn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function mn(t,e){return dn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function xn(t,e){return dn(t,t=>({set(s){this.__setAttr(t,s,e)&&vn(this)}}))}function wn(t){return dn(t,t=>({set(e){this.__setAttr(t,e)&&(vn(this),this.__.__removeNaturalSize())}}))}function vn(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function bn(t){return dn(t,t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),vn(this)}}))}const Sn=xn;function kn(t,e){return dn(t,t=>({set(s){this.__setAttr(t,s)&&(Bn(this),e&&(this.__.__useStroke=!0))}}))}function Bn(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&vn(t)}const Rn=kn;function Cn(t){return dn(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Pn(t){return dn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function Tn(t){return dn(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;p.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip),this.__layout.surfaceChange()}}}))}function Ln(t){return dn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&En(this)}}))}function On(t){return dn(t,t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>An(this,t,e,s))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");An(this,t,e,s),this.mask&&En(this)}}))}function En(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function An(t,e,s,i){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==i&&0!==s||vn(t))}function In(t){return dn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChange(),this.waitParent(()=>{this.parent.__layout.childrenSortChange()}))}}))}function Wn(t){return dn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}function Mn(t){return dn(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}function Dn(t){return dn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,"hit"===ee.showBounds&&this.__layout.surfaceChange(),this.leafer&&this.leafer.updateCursor())}}))}function Fn(t){return dn(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function zn(t){return(e,s)=>{an(e,"__DataProcessor",{get:()=>t})}}function Nn(t){return(e,s)=>{an(e,"__LayoutProcessor",{get:()=>t})}}function Yn(t,e,s){const r=t.__DataProcessor.prototype,n="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=ln(e,s);if(i(s))a.get=function(){return this[n]};else if("function"==typeof s)a.get=function(){const t=this[n];return null==t?s(this.__leaf):t};else if(c(s)){const t=_(s);a.get=function(){const e=this[n];return null==e?this[n]=t?{}:p.clone(s):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalWidth,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&i.children.length?i.boxBounds.width:s}return t}:"height"===e&&(a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalHeight,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&i.children.length?i.boxBounds.height:s}return t});let l,d=r;for(;!l&&d;)l=hn(d,e),d=d.__proto__;l&&l.set&&(a.set=l.set),r[o]&&(a.set=r[o],delete r[o]),an(r,e,a)}const Xn=new ee("rewrite"),Un=[],jn=["destroy","constructor"];function Vn(t){return(e,s)=>{Un.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function Gn(){return t=>{Hn()}}function Hn(t){Un.length&&(Un.forEach(e=>{t&&Xn.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),Un.length=0)}function qn(t,e){return s=>{var i;(t.prototype?(i=t.prototype,Object.getOwnPropertyNames(i)):Object.keys(t)).forEach(i=>{if(!(jn.includes(i)||e&&e.includes(i)))if(t.prototype){hn(t.prototype,i).writable&&(s.prototype[i]=t.prototype[i])}else s.prototype[i]=t[i]})}}function Qn(){return t=>{ce.register(t)}}function Jn(){return t=>{pe.register(t)}}setTimeout(()=>Hn(!0));const{copy:$n,toInnerPoint:Zn,toOuterPoint:Kn,scaleOfOuter:to,rotateOfOuter:eo,skewOfOuter:so,multiplyParent:io,divideParent:ro,getLayout:no}=K,oo={},{round:ao}=Math,ho={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),uo(t,e,s),t.isBranch){const{children:i}=t;for(let t=0,r=i.length;t<r;t++)co(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++)_o(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&_o(t),t.__updateChange()},updateAllChange(t){if(go(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)po(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,n){i||(i=t.__nowWorld),t.__worldFlipped||x.fullImageShadow?e.copyWorldByReset(s,i,t.__nowWorld,r,n):e.copyWorldToInner(s,i,t.__layout.renderBounds,r)},moveWorld(t,e,s=0,i,r){const n=c(e)?Object.assign({},e):{x:e,y:s};i?Kn(t.localTransform,n,n,!0):t.parent&&Zn(t.parent.scrollWorldTransform,n,n,!0),lo.moveLocal(t,n.x,n.y,r)},moveLocal(t,e,s=0,i){c(e)&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=ao(e),s=ao(s)),i?t.animate({x:e,y:s},i):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,i,r,n){lo.zoomOfLocal(t,fo(t,e),s,i,r,n)},zoomOfLocal(t,e,s,i=s,r,n){const o=t.__localMatrix;if(a(i)||(i&&(n=i),i=s),$n(oo,o),to(oo,e,s,i),lo.hasHighPosition(t))lo.setTransform(t,oo,r,n);else{const e=t.x+oo.e-o.e,a=t.y+oo.f-o.f;n&&!r?t.animate({x:e,y:a,scaleX:t.scaleX*s,scaleY:t.scaleY*i},n):(t.x=e,t.y=a,t.scaleResize(s,i,!0!==r))}},rotateOfWorld(t,e,s,i){lo.rotateOfLocal(t,fo(t,e),s,i)},rotateOfLocal(t,e,s,i){const r=t.__localMatrix;$n(oo,r),eo(oo,e,s),lo.hasHighPosition(t)?lo.setTransform(t,oo,!1,i):t.set({x:t.x+oo.e-r.e,y:t.y+oo.f-r.f,rotation:F.formatRotation(t.rotation+s)},i)},skewOfWorld(t,e,s,i,r,n){lo.skewOfLocal(t,fo(t,e),s,i,r,n)},skewOfLocal(t,e,s,i=0,r,n){$n(oo,t.__localMatrix),so(oo,e,s,i),lo.setTransform(t,oo,r,n)},transformWorld(t,e,s,i){$n(oo,t.worldTransform),io(oo,e),t.parent&&ro(oo,t.parent.scrollWorldTransform),lo.setTransform(t,oo,s,i)},transform(t,e,s,i){$n(oo,t.localTransform),io(oo,e),lo.setTransform(t,oo,s,i)},setTransform(t,e,s,i){const r=t.__,n=r.origin&&lo.getInnerOrigin(t,r.origin),o=no(e,n,r.around&&lo.getInnerOrigin(t,r.around));if(lo.hasOffset(t)&&(o.x-=r.offsetX,o.y-=r.offsetY),s){const e=o.scaleX/t.scaleX,s=o.scaleY/t.scaleY;if(delete o.scaleX,delete o.scaleY,n){Gt.scale(t.boxBounds,Math.abs(e),Math.abs(s));const i=lo.getInnerOrigin(t,r.origin);ct.move(o,n.x-i.x,n.y-i.y)}t.set(o),t.scaleResize(e,s,!1)}else t.set(o,i)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},i="x"===e?1:-1;return to(s,lo.getLocalOrigin(t,"center"),-1*i,1*i),s},getLocalOrigin:(t,e)=>ct.tempToOuterOf(lo.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return Rt.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>($n(oo,t.worldTransform),ro(oo,e.scrollWorldTransform),s?oo:Object.assign({},oo)),drop(t,e,s,i){t.setTransform(lo.getRelativeWorld(t,e,!0),i),e.add(t,s)},hasHighPosition:t=>t.origin||t.around||lo.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),x.requestRender(()=>lo.animateMove(t,e,s))}}},lo=ho,{updateAllMatrix:co,updateMatrix:uo,updateAllWorldOpacity:_o,updateAllChange:po,updateChange:go}=lo;function fo(t,e){return t.updateLayout(),t.parent?ct.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const yo={worldBounds:t=>t.__world,localBoxBounds:t=>t.__.eraser||0===t.__.visible?null:t.__local||t.__layout,localStrokeBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localStrokeBounds,localRenderBounds:t=>t.__.eraser||0===t.__.visible?null:t.__layout.localRenderBounds,maskLocalBoxBounds:(t,e)=>xo(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>xo(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds:(t,e)=>xo(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 mo;function xo(t,e){return e||(mo=0),t.__.mask&&(mo=1),mo<0?null:(mo&&(mo=-1),!0)}const{updateBounds:wo}=ho,vo={sort:(t,e)=>t.__.zIndex===e.__.zIndex?t.__tempNumber-e.__tempNumber:t.__.zIndex-e.__.zIndex,pushAllChildBranch(t,e){if(t.__tempNumber=1,t.__.__childBranchNumber){const{children:s}=t;for(let i=0,r=s.length;i<r;i++)(t=s[i]).isBranch&&(t.__tempNumber=1,e.add(t),bo(t,e))}},pushAllParent(t,e){const{keys:s}=e;if(s)for(;t.parent&&i(s[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let s=e.length;const{children:i}=t;for(let t=0,s=i.length;t<s;t++)i[t].isBranch&&e.push(i[t]);for(let t=s,i=e.length;t<i;t++)So(e[t],e)},updateBounds(t,e){const s=[t];So(t,s),ko(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++)wo(i[t]);e&&e===s||wo(s)}},move(t,e,s){let i;const{children:r}=t;for(let n=0,o=r.length;n<o;n++)i=(t=r[n]).__world,i.e+=e,i.f+=s,i.x+=e,i.y+=s,t.isBranch&&Bo(t,e,s)},scale(t,e,s,i,r,n,o){let a;const{children:h}=t,l=i-1,d=r-1;for(let c=0,u=h.length;c<u;c++)a=(t=h[c]).__world,a.a*=i,a.d*=r,(a.b||a.c)&&(a.b*=i,a.c*=r),a.e===a.x&&a.f===a.y?(a.x=a.e+=(a.e-n)*l+e,a.y=a.f+=(a.f-o)*d+s):(a.e+=(a.e-n)*l+e,a.f+=(a.f-o)*d+s,a.x+=(a.x-n)*l+e,a.y+=(a.y-o)*d+s),a.width*=i,a.height*=r,a.scaleX*=i,a.scaleY*=r,t.isBranch&&Ro(t,e,s,i,r,n,o)}},{pushAllChildBranch:bo,pushAllBranchStack:So,updateBoundsByBranchStack:ko,move:Bo,scale:Ro}=vo,Co={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:Po,updateBounds:To}=ho,{toOuterOf:Lo,getPoints:Oo,copy:Eo}=Gt,Ao="_localContentBounds",Io="_worldContentBounds",Wo="_worldBoxBounds",Mo="_worldStrokeBounds";class Do{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 Lo(this.contentBounds,this.leaf.__localMatrix,this[Ao]||(this[Ao]={})),this[Ao]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return Lo(this.contentBounds,this.leaf.__world,this[Io]||(this[Io]={})),this[Io]}get worldBoxBounds(){return Lo(this.boxBounds,this.leaf.__world,this[Wo]||(this[Wo]={})),this[Wo]}get worldStrokeBounds(){return Lo(this.strokeBounds,this.leaf.__world,this[Mo]||(this[Mo]={})),this[Mo]}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 To(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,x.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 K.defaultMatrix;case"page":t=e.zoomLayer;default:return Po(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 Jt(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,n,o,a=this.getInnerBounds(t);switch(e){case"world":r=i.getWorldPoint(a),n=i.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=i.__;o={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},r=i.getLocalPointByInner(a);break;case"inner":r=a,n=K.defaultMatrix;break;case"page":e=i.zoomLayer;default:r=i.getWorldPoint(a,e),n=Po(i,e,!0)}if(o||(o=K.getLayout(n)),Eo(o,a),ct.copy(o,r),s){const{scaleX:t,scaleY:e}=o,s=Math.abs(t),i=Math.abs(e);1===s&&1===i||(o.scaleX/=s,o.scaleY/=i,o.width*=s,o.height*=i)}return o}getLayoutPoints(t,e="world"){const{leaf:s}=this,r=Oo(this.getInnerBounds(t));let n;switch(e){case"world":n=null;break;case"local":n=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:n=e}return i(n)||r.forEach(t=>s.innerToWorld(t,null,!1,n)),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 Fo{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&x.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&x.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&x.event.stop(this.origin)}}class zo extends Fo{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}zo.ADD="child.add",zo.REMOVE="child.remove",zo.CREATED="created",zo.MOUNTED="mounted",zo.UNMOUNTED="unmounted",zo.DESTROY="destroy";const No="property.scroll";class Yo extends Fo{constructor(t,e,s,i,r){super(t,e),this.attrName=s,this.oldValue=i,this.newValue=r}}Yo.CHANGE="property.change",Yo.LEAFER_CHANGE="property.leafer_change",Yo.SCROLL=No;const Xo={scrollX:No,scrollY:No};class Uo extends Fo{constructor(t,e){super(t),Object.assign(this,e)}}Uo.LOAD="image.load",Uo.LOADED="image.loaded",Uo.ERROR="image.error";class jo extends Fo{static checkHas(t,e,s){"on"===s?e===qo?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Vo)||t.hasEvent(Go)||t.hasEvent(Ho),t.__hasWorldEvent=t.hasEvent(qo))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Vo,t),"inner"===e&&t.emit(Go,t)),t.emit(Ho,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(qo,this)}}jo.RESIZE="bounds.resize",jo.INNER="bounds.inner",jo.LOCAL="bounds.local",jo.WORLD="bounds.world";const{RESIZE:Vo,INNER:Go,LOCAL:Ho,WORLD:qo}=jo,Qo={};[Vo,Go,Ho,qo].forEach(t=>Qo[t]=1);class Jo extends Fo{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){c(t)?(super(Jo.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!i(this.resizingKeys[t.innerId])}}Jo.RESIZE="resize";class $o extends Fo{constructor(t,e){super(t),this.data=e}}$o.REQUEST="watch.request",$o.DATA="watch.data";class Zo extends Fo{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}Zo.REQUEST="layout.request",Zo.START="layout.start",Zo.BEFORE="layout.before",Zo.LAYOUT="layout",Zo.AFTER="layout.after",Zo.AGAIN="layout.again",Zo.END="layout.end";class Ko extends Fo{constructor(t,e,s,i){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=i)}}Ko.REQUEST="render.request",Ko.CHILD_START="render.child_start",Ko.CHILD_END="render.child_end",Ko.START="render.start",Ko.BEFORE="render.before",Ko.RENDER="render",Ko.AFTER="render.after",Ko.AGAIN="render.again",Ko.END="render.end",Ko.NEXT="render.next";class ta extends Fo{}ta.START="leafer.start",ta.BEFORE_READY="leafer.before_ready",ta.READY="leafer.ready",ta.AFTER_READY="leafer.after_ready",ta.VIEW_READY="leafer.view_ready",ta.VIEW_COMPLETED="leafer.view_completed",ta.STOP="leafer.stop",ta.RESTART="leafer.restart",ta.END="leafer.end",ta.UPDATE_MODE="leafer.update_mode",ta.TRANSFORM="leafer.transform",ta.MOVE="leafer.move",ta.SCALE="leafer.scale",ta.ROTATE="leafer.rotate",ta.SKEW="leafer.skew";const{MOVE:ea,SCALE:sa,ROTATE:ia,SKEW:ra}=ta,na={x:ea,y:ea,scaleX:sa,scaleY:sa,rotation:ia,skewX:ra,skewY:ra},oa={};class aa{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(d(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let s in t)d(e=t[s])?this.on(s,e[0],e[1]):this.on(s,e);return}let i,r,o;s&&("once"===s?r=!0:"boolean"==typeof s?i=s:(i=s.capture,r=s.once));const a=ha(this,i,!0),h=n(t)?t.split(" "):t,l=r?{listener:e,once:r}:{listener:e};h.forEach(t=>{t&&(o=a[t],o?-1===o.findIndex(t=>t.listener===e)&&o.push(l):a[t]=[l],Qo[t]&&jo.checkHas(this,t,"on"))})}off(t,e,s){if(t){const i=n(t)?t.split(" "):t;if(e){let t,r,n;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const o=ha(this,t);i.forEach(t=>{t&&(r=o[t],r&&(n=r.findIndex(t=>t.listener===e),n>-1&&r.splice(n,1),r.length||delete o[t],Qo[t]&&jo.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):d(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=d(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):d(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 d(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));c(s)?e=e.bind(s):i=s,this.on(t,e,{once:!0,capture:i})}emit(t,e,s){!e&&pe.has(t)&&(e=pe.get(t,{type:t,target:this,current:this}));const i=ha(this,s)[t];if(i){let r;for(let n=0,o=i.length;n<o&&!((r=i[n])&&(r.listener(e),r.once&&(this.off(t,r.listener,s),n--,o--),e&&e.isStopNow));n++);}this.syncEventer&&this.syncEventer.emitEvent(e,s)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:s,__captureMap:r}=this,n=s&&s[t],o=r&&r[t];return!!(i(e)?n||o:e?o:n)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function ha(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:oa)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:oa)}}const{on:la,on_:da,off:ca,off_:ua,once:_a,emit:pa,emitEvent:ga,hasEvent:fa,destroy:ya}=aa.prototype,ma={on:la,on_:da,off:ca,off_:ua,once:_a,emit:pa,emitEvent:ga,hasEvent:fa,destroyEventer:ya},xa=ee.get("setAttr"),wa={__setAttr(t,e,s){if(this.leaferIsCreated){const r=this.__.__getInput(t);if(!s||o(e)||i(e)||(xa.warn(this.innerName,t,e),e=void 0),c(e)||r!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new Yo(Yo.LEAFER_CHANGE,this,t,r,e));const s=na[t];s&&(this.emitEvent(new ta(s,this)),this.emitEvent(new ta(ta.TRANSFORM,this)))}this.emitPropertyEvent(Yo.CHANGE,t,r,e);const s=Xo[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 Yo(t,this,e,s,i);this.isLeafer||this.hasEvent(t)&&this.emitEvent(r),this.leafer.emitEvent(r)},__realSetAttr(t,e){const s=this.__;s[t]=e,this.__proxyData&&this.setProxyAttr(t,e),s.normalStyle&&(this.lockNormalStyle||i(s.normalStyle[t])||(s.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:va,multiplyParent:ba,translateInner:Sa,defaultWorld:ka}=K,{toPoint:Ba,tempPoint:Ra}=Rt,Ca={__updateWorldMatrix(){const{parent:t,__layout:e,__world:s,__scrollWorld:i,__:r}=this;ba(this.__local||e,t?t.__scrollWorld||t.__world:ka,s,!!e.affectScaleOrRotation,r),i&&Sa(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)&&(va(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)&&(Ba(s.around||s.origin,t.boxBounds,Ra),Sa(e,-Ra.x,-Ra.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:Pa,updateAllMatrix:Ta}=ho,{updateBounds:La}=vo,{toOuterOf:Oa,copyAndSpread:Ea,copy:Aa}=Gt,{toBounds:Ia}=Wr,Wa={__updateWorldBounds(){const{__layout:t,__world:e}=this;Oa(t.renderBounds,e,e),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&jo.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&jo.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(),Oa(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Oa(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Oa(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const s=this.__layout.boxBounds,i=this.__;i.__usePathBox?Ia(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(),Ta(this),La(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(Ta(this),La(this,this))):Pa(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;Ea(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:s}=e;a(s)&&s<=0?Aa(e.renderBounds,e.strokeBounds):Ea(e.renderBounds,e.boxBounds,s)}},Ma={__render(t,e){if(e.shape)return this.__renderShape(t,e);if((!e.cellList||e.cellList.has(this))&&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),ho.copyCanvasByWorld(this,t,i,this.__nowWorld,s.__blendMode,!0),i.recycle(this.__nowWorld)}else this.__draw(t,e);ee.showBounds&&ee.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:Da}=yo,Fa={__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++)Da(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++)Da(s[i],e)||s[i].__clip(t,e)}}},za={},{LEAF:Na,create:Ya}=v,{stintSet:Xa}=p,{toInnerPoint:Ua,toOuterPoint:ja,multiplyParent:Va}=K,{toOuterOf:Ga}=Gt,{copy:Ha,move:qa}=ct,{moveLocal:Qa,zoomOfLocal:Ja,rotateOfLocal:$a,skewOfLocal:Za,moveWorld:Ka,zoomOfWorld:th,rotateOfWorld:eh,skewOfWorld:sh,transform:ih,transformWorld:rh,setTransform:nh,getFlipTransform:oh,getLocalOrigin:ah,getRelativeWorld:hh,drop:lh}=ho;let dh=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 f}get __LayoutProcessor(){return Do}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=Ya(Na),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(zo.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(zo.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(zo.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(zo.MOUNTED)):this.__emitLifeEvent(zo.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){i(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=i(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 Va(s,t.matrix,e,void 0,s),Ga(this.__layout.renderBounds,e,e),Xa(e,"half",s.half),Xa(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}=en.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),za.scaleX=s,za.scaleY=i,za}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?hh(this,e):this.worldTransform,r=s?t:{};return Ga(t,i,r),r}worldToLocal(t,e,s,i){this.parent?this.parent.worldToInner(t,e,s,i):e&&Ha(e,t)}localToWorld(t,e,s,i){this.parent?this.parent.innerToWorld(t,e,s,i):e&&Ha(e,t)}worldToInner(t,e,s,i){i&&(i.innerToWorld(t,e,s),t=e||t),Ua(this.scrollWorldTransform,t,e,s)}innerToWorld(t,e,s,i){ja(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:n,y:o}=this.boxBounds;return qa(r,-n,-o),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:n,y:o}=this.boxBounds;return qa(r,n,o),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){nh(this,t,e,s)}transform(t,e,s){ih(this,t,e,s)}move(t,e,s){Qa(this,t,e,s)}moveInner(t,e,s){Ka(this,t,e,!0,s)}scaleOf(t,e,s,i,r){Ja(this,ah(this,t),e,s,i,r)}rotateOf(t,e,s){$a(this,ah(this,t),e,s)}skewOf(t,e,s,i,r){Za(this,ah(this,t),e,s,i,r)}transformWorld(t,e,s){rh(this,t,e,s)}moveWorld(t,e,s){Ka(this,t,e,!1,s)}scaleOfWorld(t,e,s,i,r){th(this,t,e,s,i,r)}rotateOfWorld(t,e){eh(this,t,e)}skewOfWorld(t,e,s,i,r){sh(this,t,e,s,i,r)}flip(t,e){ih(this,oh(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,e){return!0}__hit(t,e){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 he.need("path")}getMotionPoint(t){return he.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){lh(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):Yn(this.prototype,t,e)}static addAttr(t,e,s,i){s||(s=xn),s(e,i)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new zo(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(zo.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};dh=ye([qn(wa),qn(Ca),qn(Wa),qn(ma),qn(Ma)],dh);const{setListWithFn:ch}=Gt,{sort:uh}=vo,{localBoxBounds:_h,localStrokeBounds:ph,localRenderBounds:gh,maskLocalBoxBounds:fh,maskLocalStrokeBounds:yh,maskLocalRenderBounds:mh}=yo,xh=new ee("Branch");let wh=class extends dh{__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){ch(e||this.__layout.boxBounds,this.children,this.__hasMask?fh:_h)}__updateStrokeBounds(t){ch(t||this.__layout.strokeBounds,this.children,this.__hasMask?yh:ph)}__updateRenderBounds(t){ch(t||this.__layout.renderBounds,this.children,this.__hasMask?mh:gh)}__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(uh),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return xh.warn("add self or destroyed");const s=i(e);if(!t.__){if(d(t))return t.forEach(t=>{this.add(t,e),s||e++});t=ce.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,s?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const r=t.__layout;r.boxChanged||r.boxChange(),r.matrixChanged||r.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(zo.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(zo.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)):i(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(zo.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(zo.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new zo(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}};wh=ye([qn(Fa)],wh);class vh{get length(){return this.list.length}constructor(t){this.reset(),t&&(d(t)?this.addList(t):this.add(t))}has(t){return t&&!i(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return i(e)?-1:e}add(t){const{list:e,keys:s}=this;i(s[t.innerId])&&(e.push(t),s[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:s}=this;if(i(s[t.innerId])){const{list:i}=this;for(let t=e,r=i.length;t<r;t++)s[i[t].innerId]++;0===e?i.unshift(t):(e>i.length&&(e=i.length),i.splice(e,0,t)),s[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let s;for(let r=0,n=e.length;r<n;r++)i(s)?e[r].innerId===t.innerId&&(s=r,delete this.keys[t.innerId]):this.keys[e[r].innerId]=r-1;i(s)||e.splice(s,1)}sort(t){const{list:e}=this;t?e.sort((t,e)=>e.__level-t.__level):e.sort((t,e)=>t.__level-e.__level)}forEach(t){this.list.forEach(t)}clone(){const t=new vh;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 bh{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(d(t)?this.addList(t):this.add(t))}has(t){return!i(this.keys[t.innerId])}without(t){return i(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:s}=this;e[t.innerId]||(e[t.innerId]=1,s[t.__level]?s[t.__level].push(t):(s[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(s=>{e=this.levelMap[s];for(let s=0,i=e.length;s<i;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const Sh="1.12.3";class kh extends Ee{get allowBackgroundColor(){return!1}init(){const{config:t}=this;let e=t.view||t.canvas;e?(n(e)?("#"!==e[0]&&(e="#"+e),this.viewSelect=x.miniapp.select(e)):e.fields?this.viewSelect=e:this.initView(e),this.viewSelect&&x.miniapp.getSizeView(this.viewSelect).then(t=>{this.initView(t)})):this.initView()}initView(t){t?this.view=t.view||t:(t={},this.__createView()),this.view.getContext?this.__createContext():this.unrealCanvas();const{width:e,height:s,pixelRatio:i}=this.config,r={width:e||t.width,height:s||t.height,pixelRatio:i};this.resize(r),this.context&&(this.viewSelect&&(x.renderCanvas=this),this.context.roundRect&&(this.roundRect=function(t,e,s,i,r){this.context.roundRect(t,e,s,i,a(r)?[r]:r)}),Gr(this.context.__proto__))}__createView(){this.view=x.origin.createCanvas(1,1)}updateViewSize(){if(this.unreal)return;const{width:t,height:e,pixelRatio:s}=this;this.view.width=Math.ceil(t*s),this.view.height=Math.ceil(e*s)}updateClientBounds(t){this.viewSelect&&x.miniapp.getBounds(this.viewSelect).then(e=>{this.clientBounds=e,t&&t()})}startAutoLayout(t,e){this.resizeListener||(this.resizeListener=e,t&&(this.checkSize=this.checkSize.bind(this),x.miniapp.onWindowResize(this.checkSize)))}checkSize(){this.viewSelect&&setTimeout(()=>{this.updateClientBounds(()=>{const{width:t,height:e}=this.clientBounds,{pixelRatio:s}=this,i={width:t,height:e,pixelRatio:s};this.isSameSize(i)||this.emitResize(i)})},500)}stopAutoLayout(){this.autoLayout=!1,this.resizeListener=null,x.miniapp.offWindowResize(this.checkSize)}unrealCanvas(){this.unreal=!0}emitResize(t){const e={};p.copyAttrs(e,this,Oe),this.resize(t),i(this.width)||this.resizeListener(new Jo(t,e))}}const{mineType:Bh,fileType:Rh}=Hr;function Ch(t,e){x.origin={createCanvas:(t,s,i)=>{const r={type:"2d",width:t,height:s};return e.createOffscreenCanvas?e.createOffscreenCanvas(r):e.createOffScreenCanvas(r)},canvasToDataURL:(t,e,s)=>t.toDataURL(Bh(e),s),canvasToBolb:(t,e,s)=>t.toBuffer(e,{quality:s}),canvasSaveAs:(t,e,s)=>{let i=t.toDataURL(Bh(Rh(e)),s);return i=i.substring(i.indexOf("64,")+3),x.origin.download(i,e)},download:(t,s)=>new Promise((i,r)=>{let n;s.includes("/")||(s=`${e.env.USER_DATA_PATH}/`+s,n=!0);const o=e.getFileSystemManager();o.writeFile({filePath:s,data:t,encoding:"base64",success(){n?x.miniapp.saveToAlbum(s).then(()=>{o.unlink({filePath:s}),i()}):i()},fail(t){r(t)}})}),loadImage:t=>new Promise((e,s)=>{const i=x.canvas.view.createImage();i.onload=()=>{e(i)},i.onerror=t=>{s(t)},i.src=x.image.getRealURL(t)}),noRepeat:"repeat-x"},x.miniapp={select:t=>e.createSelectorQuery().select(t),getBounds:t=>new Promise(e=>{t.boundingClientRect().exec(t=>{const s=t[1];e({x:s.top,y:s.left,width:s.width,height:s.height})})}),getSizeView:t=>new Promise(e=>{t.fields({node:!0,size:!0}).exec(t=>{const s=t[0];e({view:s.node,width:s.width,height:s.height})})}),saveToAlbum:t=>new Promise(s=>{e.getSetting({success:i=>{i.authSetting["scope.writePhotosAlbum"]?e.saveImageToPhotosAlbum({filePath:t,success(){s(!0)}}):e.authorize({scope:"scope.writePhotosAlbum",success:()=>{e.saveImageToPhotosAlbum({filePath:t,success(){s(!0)}})},fail:()=>{}})}})}),onWindowResize(t){e.onWindowResize(t)},offWindowResize(t){e.offWindowResize(t)}},x.event={stopDefault(t){},stopNow(t){},stop(t){}},x.canvas=le.canvas(),x.conicGradientSupport=!!x.canvas.context.createConicGradient}Object.assign(le,{canvas:(t,e)=>new kh(t,e),image:t=>new on(t)}),x.name="miniapp",x.requestRender=function(t){const{view:e}=x.renderCanvas||x.canvas;e.requestAnimationFrame?e.requestAnimationFrame(t):setTimeout(t,16)},an(x,"devicePixelRatio",{get:()=>Math.max(1,wx.getWindowInfo?wx.getWindowInfo().pixelRatio:wx.getSystemInfoSync().pixelRatio)});class Ph{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove&&this.config.usePartLayout){const t=new vh;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 vh,this.target=t,e&&(this.config=p.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(Ko.REQUEST)}__onAttrChange(t){this.config.usePartLayout&&this.__updatedList.add(t.target),this.update()}__onChildEvent(t){this.config.usePartLayout&&(t.type===zo.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 $o($o.DATA,{updatedList:this.updatedList})),this.__updatedList=new vh,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[Yo.CHANGE,this.__onAttrChange,this],[[zo.ADD,zo.REMOVE],this.__onChildEvent,this],[$o.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:Th,updateBounds:Lh,updateChange:Oh}=ho,{pushAllChildBranch:Eh,pushAllParent:Ah}=vo;const{worldBounds:Ih}=yo;class Wh{constructor(t){this.updatedBounds=new Jt,this.beforeBounds=new Jt,this.afterBounds=new Jt,d(t)&&(t=new vh(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,Ih)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,Ih),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:Mh,updateAllChange:Dh}=ho,Fh=ee.get("Layouter");class zh{constructor(t,e){this.totalTimes=0,this.config={usePartLayout:!0},this.__levelList=new bh,this.target=t,e&&(this.config=p.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(Zo.START),this.layoutOnce(),t.emitEvent(new Zo(Zo.END,this.layoutedBlocks,this.times))}catch(t){Fh.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?Fh.warn("layouting"):this.times>3?Fh.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit($o.REQUEST),this.totalTimes>1&&this.config.usePartLayout?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=ne.start("PartLayout"),{target:s,__updatedList:i}=this,{BEFORE:r,LAYOUT:n,AFTER:o}=Zo,a=this.getBlocks(i);a.forEach(t=>t.setBefore()),s.emitEvent(new Zo(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?(Th(t,!0),e.add(t),t.isBranch&&Eh(t,e),Ah(t,e)):s.boundsChanged&&(e.add(t),t.isBranch&&(t.__tempNumber=0),Ah(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||Lh(i[t])}Lh(s)}})}(this.__levelList),function(t){t.list.forEach(Oh)}(i),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),s.emitEvent(new Zo(n,a,this.times)),s.emitEvent(new Zo(o,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,ne.end(e)}fullLayout(){const t=ne.start("FullLayout"),{target:e}=this,{BEFORE:s,LAYOUT:i,AFTER:r}=Zo,n=this.getBlocks(new vh(e));e.emitEvent(new Zo(s,n,this.times)),zh.fullLayout(e),n.forEach(t=>{t.setAfter()}),e.emitEvent(new Zo(i,n,this.times)),e.emitEvent(new Zo(r,n,this.times)),this.addBlocks(n),ne.end(t)}static fullLayout(t){Mh(t,!0),t.isBranch?vo.updateBounds(t):ho.updateBounds(t),Dh(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:s}=this.extraBlock||(this.extraBlock=new Wh([]));e.length?s.add(t.__world):s.set(t.__world),e.add(t)}}createBlock(t){return new Wh(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_([[Zo.REQUEST,this.layout,this],[Zo.AGAIN,this.layoutAgain,this],[$o.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const Nh=ee.get("Renderer");class Yh{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=p.default(s,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.requestTime||this.__requestRender()}requestLayout(){this.target.emit(Zo.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(Ko.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(Ko.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(Ko.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Jt,Nh.log(e.innerName,"---\x3e");try{this.emitRender(Ko.START),this.renderOnce(t),this.emitRender(Ko.END,this.totalBounds),en.clearRecycled()}catch(t){this.rendering=!1,Nh.error(t)}Nh.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return Nh.warn("rendering");if(this.times>3)return Nh.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Jt,this.renderOptions={},t)this.emitRender(Ko.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(Ko.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(Ko.RENDER,this.renderBounds,this.renderOptions),this.emitRender(Ko.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=ne.start("PartRender"),{canvas:s}=this,i=t.getIntersect(s.bounds),r=new Jt(i);s.save(),i.spread(Yh.clipSpread).ceil(),s.clearWorld(i),s.clipWorld(i),this.__render(i,r),s.restore(),ne.end(e)}fullRender(){const t=ne.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),ne.end(t)}__render(t,e){const{canvas:s,target:i}=this,r=t.includes(i.__world),n=r?{includes:r}:{bounds:t,includes:r};this.needFill&&s.fillWorld(t,this.config.fill),ee.showRepaint&&ee.drawRepaint(s,t),this.config.useCellRender&&(n.cellList=this.getCellList()),x.render(i,s,n),this.renderBounds=e=e||t,this.renderOptions=n,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),s.updateRender(e)}getCellList(){}addBlock(t){this.updateBlocks||(this.updateBlocks=[]),this.updateBlocks.push(t)}mergeBlocks(){const{updateBlocks:t}=this;if(t){const e=new Jt;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 x.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()};x.requestRender(e)}__onResize(t){if(!this.canvas.unreal){if(t.bigger||!t.samePixelRatio){const{width:e,height:s}=t.old;if(!new Jt(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 Jt(0,0,1,1)),this.update()}}__onLayoutEnd(t){t.data&&t.data.map(t=>{let e;t.updatedList&&t.updatedList.list.some(t=>(e=!t.__world.width||!t.__world.height,e&&(t.isLeafer||Nh.tip(t.innerName,": empty"),e=!t.isBranch||t.isBranchLeaf),e)),this.addBlock(e?this.canvas.bounds:t.updatedBounds)})}emitRender(t,e,s){this.target.emitEvent(new Ko(t,this.times,e,s))}__listenEvents(){this.__eventIds=[this.target.on_([[Ko.REQUEST,this.update,this],[Zo.END,this.__onLayoutEnd,this],[Ko.AGAIN,this.renderAgain,this],[Jo.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 Xh(t){return dn(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Uh(t){return dn(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function jh(){return(t,e)=>{const s="_"+e;an(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}})}}function Vh(t){return(e,s)=>{an(e,s,ln(s,t))}}Yh.clipSpread=10,Object.assign(le,{watcher:(t,e)=>new Ph(t,e),layouter:(t,e)=>new zh(t,e),renderer:(t,e,s)=>new Yh(t,e,s),selector:(t,e)=>{},interaction:(t,e,s,i)=>{}}),x.layout=zh.fullLayout,x.render=function(t,e,s){const i=Object.assign(Object.assign({},s),{topRendering:!0});s.topList=new vh,t.__render(e,s),s.topList.length&&s.topList.forEach(t=>t.__render(e,i))};const Gh={},Hh={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}},qh={number:(t,e)=>c(t)?"percent"===t.type?t.value*e:t.value:t},Qh={},Jh={},$h={},Zh={},Kh={},tl={apply(){he.need("filter")}},el={},sl={setStyleName:()=>he.need("state"),set:()=>he.need("state")},il={list:{},register(t,e){il.list[t]=e},get:t=>il.list[t]},{parse:rl,objectToCanvasData:nl}=si,{stintSet:ol}=p,{hasTransparent:al}=Hh,hl={originPaint:{}},ll=ee.get("UIData");class dl extends f{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,ll.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,ll.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),n(t)||!t?(ol(this,"__isTransparentFill",al(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):c(t)&&this.__setPaint("fill",t)}setStroke(t){n(t)||!t?(ol(this,"__isTransparentStroke",al(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):c(t)&&this.__setPaint("stroke",t)}setPath(t){const e=n(t);e||t&&c(t[0])?(this.__setInput("path",t),this._path=e?rl(t):nl(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){cl(this,"shadow",t)}setInnerShadow(t){cl(this,"innerShadow",t)}setFilter(t){cl(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&Jh.compute("fill",this.__leaf),e&&Jh.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:s}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),i(t.strokeWidthFixed)||(s=t.strokeWidthFixed)),s){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const s=this.__leaf.__layout;s.boxChanged||s.boxChange(),d(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=hl)):(this.__isStrokes=!0,this._stroke||(this._stroke=hl))}__removePaint(t,e){e&&this.__removeInput(t),$h.recycleImage(t,this),"fill"===t?(ol(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(ol(this,"__isAlphaPixelStroke",void 0),ol(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function cl(t,e,s){t.__setInput(e,s),d(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 ul extends dl{}class _l extends ul{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 pl extends ul{__getInputData(t,e){const s=super.__getInputData(t,e);return Oe.forEach(t=>delete s[t]),s}}class gl extends _l{}class fl extends dl{get __usePathBox(){return this.points||this.__pathInputed}}class yl extends dl{get __boxStroke(){return!this.__pathInputed}}class ml extends dl{get __boxStroke(){return!this.__pathInputed}}class xl extends fl{}class wl extends dl{}class vl extends dl{get __pathInputed(){return 2}}class bl extends ul{}const Sl={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class kl extends dl{get __useNaturalRatio(){return!1}setFontWeight(t){n(t)?(this.__setInput("fontWeight",t),t=Sl[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=ce.get("Rect",0);const r=e.__layout,n=s.__layout;i||(s.parent=e,s.__world=e.__world,n.boxBounds=r.boxBounds),s.set(t),n.strokeChanged&&r.strokeChange()}else s&&(e.__box=s.parent=null,s.destroy());this._boxStyle=t}__getInputData(t,e){const s=super.__getInputData(t,e);return s.textEditing&&delete s.textEditing,s}}class Bl extends yl{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 Rl extends yl{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:Cl,add:Pl}=P,Tl={__updateStrokeSpread(){let t=0,e=0;const s=this.__,{strokeAlign:i,__maxStrokeWidth:r}=s,n=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),n&&(t=Cl(t,n.__layout.strokeSpread=n.__updateStrokeSpread()),e=Math.max(e,n.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:i,backgroundBlur:r,filter:n,renderSpread:o}=this.__,{strokeSpread:a}=this.__layout,h=this.__box;e&&(t=Kh.getShadowRenderSpread(this,e)),i&&(t=Cl(t,i)),n&&(t=Pl(t,tl.getSpread(n))),o&&(t=Pl(t,o)),a&&(t=Pl(t,a));let l=t;return s&&(l=Cl(l,Kh.getInnerShadowSpread(this,s))),r&&(l=Cl(l,r)),this.__layout.renderShapeSpread=l,h?Cl(h.__updateRenderSpread(),t):t}},{stintSet:Ll}=p,Ol={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);Ll(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),Ll(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;Ll(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&!Kh.isTransformShadow(e[0])&&s&&!t.__isTransparentFill&&!(d(s)&&s.length>1)&&(this.useFastShadow||!i||i&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),Ll(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){El(this,t,e)},__draw(t,e,s){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:r,stroke:n,__drawAfterFill:o,__fillAfterStroke:a,__isFastShadow:h}=i;if(this.__drawRenderPath(t),i.__useEffect&&!h){const h=Jh.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=i;l&&Kh.shadow(this,t,h),a&&(i.__isStrokes?Jh.strokes(n,this,t,e):Jh.stroke(n,this,t,e)),r&&(i.__isFills?Jh.fills(r,this,t,e):Jh.fill(r,this,t,e)),o&&this.__drawAfterFill(t,e),d&&Kh.innerShadow(this,t,h),n&&!a&&(i.__isStrokes?Jh.strokes(n,this,t,e):Jh.stroke(n,this,t,e)),c&&tl.apply(c,this,this.__nowWorld,t,s,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(i.__isStrokes?Jh.strokes(n,this,t,e):Jh.stroke(n,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,Hh.string(e.color))}r&&(i.__isFills?Jh.fills(r,this,t,e):Jh.fill(r,this,t,e)),h&&t.restore(),o&&this.__drawAfterFill(t,e),n&&!a&&(i.__isStrokes?Jh.strokes(n,this,t,e):Jh.stroke(n,this,t,e))}}else i.__pathForRender?El(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?Jh.fills(i,this,t,e):Jh.fill("#000000",this,t,e)),s.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(s.__isAlphaPixelStroke?Jh.strokes(r,this,t,e):Jh.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 El(t,e,s){const{fill:i,stroke:r,__drawAfterFill:n,__fillAfterStroke:o}=t.__;t.__drawRenderPath(e),o&&Jh.stroke(r,t,e,s),i&&Jh.fill(i,t,e,s),n&&t.__drawAfterFill(e,s),r&&!o&&Jh.stroke(r,t,e,s)}const Al={__drawFast(t,e){let{x:s,y:i,width:r,height:n}=this.__layout.boxBounds;const{fill:o,stroke:a,__drawAfterFill:h}=this.__;if(o&&(t.fillStyle=o,t.fillRect(s,i,r,n)),h&&this.__drawAfterFill(t,e),a){const{strokeAlign:o,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(a,h,this.__);const l=h/2;switch(o){case"center":t.strokeRect(0,0,r,n);break;case"inside":r-=h,n-=h,r<0||n<0?(t.save(),this.__clip(t,e),t.strokeRect(s+l,i+l,r,n),t.restore()):t.strokeRect(s+l,i+l,r,n);break;case"outside":t.strokeRect(s-l,i-l,r+h,n+h)}}}};var Il;let Wl=Il=class extends dh{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){F.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 jr.set(this.path=t||[]),t||this.__drawPathByBox(jr),jr}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return n(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return he.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return he.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let s=e?this.__.__pathForRender:this.__.path;return s||(jr.set(s=[]),this.__drawPathByBox(jr,!e)),t?si.toCanvasData(s,!0):s}getPathString(t,e,s){return si.stringify(this.getPath(t,e),s)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||el.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?Xr.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&Qh.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,!0)}__drawPathByData(t,e,s){e?ir.drawPathByData(t,e):this.__drawPathByBox(t,s)}__drawPathByBox(t,e){const{x:s,y:i,width:r,height:n}=this.__layout.boxBounds;if(this.__.cornerRadius&&!e){const{cornerRadius:e}=this.__;t.roundRect(s,i,r,n,a(e)?[e]:e)}else t.rect(s,i,r,n);t.closePath()}drawImagePlaceholder(t,e,s){Jh.fill(this.__.placeholderColor,this,e,s)}animate(t,e,s,i){return this.set(t),he.need("animate")}killAnimate(t,e){}export(t,e){return he.need("export")}syncExport(t,e){return he.need("export")}clone(t){const e=p.clone(this.toJSON());return t&&Object.assign(e,t),Il.one(e)}static one(t,e,s,i,r){return ce.get(t.tag||this.prototype.__tag,t,e,s,i,r)}static registerUI(){Qn()(this)}static registerData(t){zn(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};ye([zn(dl)],Wl.prototype,"__",void 0),ye([jh()],Wl.prototype,"zoomLayer",void 0),ye([_n("")],Wl.prototype,"id",void 0),ye([_n("")],Wl.prototype,"name",void 0),ye([_n("")],Wl.prototype,"className",void 0),ye([Pn("pass-through")],Wl.prototype,"blendMode",void 0),ye([Ln(1)],Wl.prototype,"opacity",void 0),ye([On(!0)],Wl.prototype,"visible",void 0),ye([Pn(!1)],Wl.prototype,"locked",void 0),ye([Tn(!1)],Wl.prototype,"dim",void 0),ye([Tn(!1)],Wl.prototype,"dimskip",void 0),ye([In(0)],Wl.prototype,"zIndex",void 0),ye([Wn(!1)],Wl.prototype,"mask",void 0),ye([Mn(!1)],Wl.prototype,"eraser",void 0),ye([pn(0,!0)],Wl.prototype,"x",void 0),ye([pn(0,!0)],Wl.prototype,"y",void 0),ye([xn(100,!0)],Wl.prototype,"width",void 0),ye([xn(100,!0)],Wl.prototype,"height",void 0),ye([yn(1,!0)],Wl.prototype,"scaleX",void 0),ye([yn(1,!0)],Wl.prototype,"scaleY",void 0),ye([mn(0,!0)],Wl.prototype,"rotation",void 0),ye([mn(0,!0)],Wl.prototype,"skewX",void 0),ye([mn(0,!0)],Wl.prototype,"skewY",void 0),ye([pn(0,!0)],Wl.prototype,"offsetX",void 0),ye([pn(0,!0)],Wl.prototype,"offsetY",void 0),ye([gn(0,!0)],Wl.prototype,"scrollX",void 0),ye([gn(0,!0)],Wl.prototype,"scrollY",void 0),ye([fn()],Wl.prototype,"origin",void 0),ye([fn()],Wl.prototype,"around",void 0),ye([_n(!1)],Wl.prototype,"lazy",void 0),ye([wn(1)],Wl.prototype,"pixelRatio",void 0),ye([Cn(0)],Wl.prototype,"renderSpread",void 0),ye([bn()],Wl.prototype,"path",void 0),ye([Sn()],Wl.prototype,"windingRule",void 0),ye([Sn(!0)],Wl.prototype,"closed",void 0),ye([xn(0)],Wl.prototype,"padding",void 0),ye([xn(!1)],Wl.prototype,"lockRatio",void 0),ye([xn()],Wl.prototype,"widthRange",void 0),ye([xn()],Wl.prototype,"heightRange",void 0),ye([_n(!1)],Wl.prototype,"draggable",void 0),ye([_n()],Wl.prototype,"dragBounds",void 0),ye([_n("auto")],Wl.prototype,"dragBoundsType",void 0),ye([_n(!1)],Wl.prototype,"editable",void 0),ye([Dn(!0)],Wl.prototype,"hittable",void 0),ye([Dn("path")],Wl.prototype,"hitFill",void 0),ye([Rn("path")],Wl.prototype,"hitStroke",void 0),ye([Dn(!1)],Wl.prototype,"hitBox",void 0),ye([Dn(!0)],Wl.prototype,"hitChildren",void 0),ye([Dn(!0)],Wl.prototype,"hitSelf",void 0),ye([Dn()],Wl.prototype,"hitRadius",void 0),ye([Fn("")],Wl.prototype,"cursor",void 0),ye([Pn()],Wl.prototype,"fill",void 0),ye([Rn(void 0,!0)],Wl.prototype,"stroke",void 0),ye([Rn("inside")],Wl.prototype,"strokeAlign",void 0),ye([Rn(1,!0)],Wl.prototype,"strokeWidth",void 0),ye([Rn(!1)],Wl.prototype,"strokeWidthFixed",void 0),ye([Rn("none")],Wl.prototype,"strokeCap",void 0),ye([Rn("miter")],Wl.prototype,"strokeJoin",void 0),ye([Rn()],Wl.prototype,"dashPattern",void 0),ye([Rn(0)],Wl.prototype,"dashOffset",void 0),ye([Rn(10)],Wl.prototype,"miterLimit",void 0),ye([Sn(0)],Wl.prototype,"cornerRadius",void 0),ye([Sn()],Wl.prototype,"cornerSmoothing",void 0),ye([Xh()],Wl.prototype,"shadow",void 0),ye([Xh()],Wl.prototype,"innerShadow",void 0),ye([Xh()],Wl.prototype,"blur",void 0),ye([Xh()],Wl.prototype,"backgroundBlur",void 0),ye([Xh()],Wl.prototype,"grayscale",void 0),ye([Xh()],Wl.prototype,"filter",void 0),ye([Pn()],Wl.prototype,"placeholderColor",void 0),ye([_n(100)],Wl.prototype,"placeholderDelay",void 0),ye([_n({})],Wl.prototype,"data",void 0),ye([Vn(dh.prototype.reset)],Wl.prototype,"reset",null),Wl=Il=ye([qn(Tl),qn(Ol),Gn()],Wl);let Ml=class extends Wl{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(){}};var Dl;ye([zn(ul)],Ml.prototype,"__",void 0),ye([xn(0)],Ml.prototype,"width",void 0),ye([xn(0)],Ml.prototype,"height",void 0),Ml=ye([qn(wh),Qn()],Ml);const Fl=ee.get("Leafer");let zl=Dl=class extends Ml{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&Kr.isComplete}get layoutLocked(){return!this.layouter.running}get view(){return this.canvas&&this.canvas.view}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),Dl.list.add(this)}init(t,e){if(this.canvas)return;let s;const{config:i}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),s=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,p.assign(i,t));const r=this.canvas=le.canvas(i);this.__controllers.push(this.renderer=le.renderer(this,r,i),this.watcher=le.watcher(this,i),this.layouter=le.layouter(this,i)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),e||(this.selector=le.selector(this),this.interaction=le.interaction(this,r,this.selector,i),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=le.hitCanvasManager()),this.canvasManager=new fe,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))),Co.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(ta.RESTART):this.emitLeafer(ta.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(ta.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=p.copyAttrs({},t,Oe);Object.keys(e).forEach(t=>this[t]=e[t])}forceRender(t,e){const{renderer:s}=this;s&&(s.addBlock(t?new Jt(t):this.canvas.bounds),this.viewReady&&(e?s.render():s.update()))}requestRender(t=!1){this.renderer&&this.renderer.update(t)}updateCursor(t){const e=this.interaction;e&&(t?e.setCursor(t):e.updateCursor())}updateLazyBounds(){this.lazyBounds=this.canvas.bounds.clone().spread(this.config.lazySpeard)}__doResize(t){const{canvas:e}=this;if(!e||e.isSameSize(t))return;const s=p.copyAttrs({},this.canvas,Oe);e.resize(t),this.updateLazyBounds(),this.__onResize(new Jo(t,s))}__onResize(t){this.emitEvent(t),p.copyAttrs(this.__,t,Oe),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 Zt(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Oe.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(ta.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Oe.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:s,canvas:i}=this,r=p.copyAttrs({},i,Oe);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(ta.BEFORE_READY),this.emitLeafer(ta.READY),this.emitLeafer(ta.AFTER_READY),Co.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(ta.VIEW_READY),Co.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:s}=this.config;if(t){let{width:i,height:r,pixelRatio:n}=this;const o="box"===t?this.worldBoxBounds:this.__world;e||(i=Math.max(1,o.x+o.width)),s||(r=Math.max(1,o.y+o.height)),this.__doResize({width:i,height:r,pixelRatio:n})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){Co.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(ta.VIEW_COMPLETED),Co.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 he.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 ta(t,this))}__listenEvents(){const t=ne.start("FirstCreate "+this.innerName);this.once([[ta.START,()=>ne.end(t)],[Zo.START,this.updateLazyBounds,this],[Ko.START,this.__onCreated,this],[Ko.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[$o.DATA,this.__onWatchData,this],[Zo.END,this.__onLayoutEnd,this],[Ko.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){Dl.list.remove(this);try{this.stop(),this.emitLeafer(ta.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.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{en.clearRecycled()},100)}catch(t){Fl.error(t)}}};t?e():setTimeout(e)}};zl.list=new vh,ye([zn(pl)],zl.prototype,"__",void 0),ye([xn()],zl.prototype,"pixelRatio",void 0),ye([_n("normal")],zl.prototype,"mode",void 0),zl=Dl=ye([Qn()],zl);let Nl=class extends Wl{get __tag(){return"Rect"}};ye([zn(yl)],Nl.prototype,"__",void 0),Nl=ye([qn(Al),Gn(),Qn()],Nl);const{add:Yl,includes:Xl,scroll:Ul}=Gt,jl=Nl.prototype,Vl=Ml.prototype;let Gl=class extends Ml{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:n}=i,{overflow:o}=s,a=i.childrenRenderBounds||(i.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=o&&o.includes("scroll"))&&(Yl(a,n),Ul(a,s)),this.__updateRectRenderBounds(),t=!Xl(n,a),t&&"show"===o&&Yl(r,a)}else this.__updateRectRenderBounds();p.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))}};ye([zn(_l)],Gl.prototype,"__",void 0),ye([xn(100)],Gl.prototype,"width",void 0),ye([xn(100)],Gl.prototype,"height",void 0),ye([_n(!1)],Gl.prototype,"resizeChildren",void 0),ye([Cn("show")],Gl.prototype,"overflow",void 0),ye([Vn(jl.__updateStrokeSpread)],Gl.prototype,"__updateStrokeSpread",null),ye([Vn(jl.__updateRenderSpread)],Gl.prototype,"__updateRectRenderSpread",null),ye([Vn(jl.__updateBoxBounds)],Gl.prototype,"__updateRectBoxBounds",null),ye([Vn(jl.__updateStrokeBounds)],Gl.prototype,"__updateStrokeBounds",null),ye([Vn(jl.__updateRenderBounds)],Gl.prototype,"__updateRectRenderBounds",null),ye([Vn(jl.__updateChange)],Gl.prototype,"__updateRectChange",null),ye([Vn(jl.__render)],Gl.prototype,"__renderRect",null),ye([Vn(Vl.__render)],Gl.prototype,"__renderGroup",null),Gl=ye([Gn(),Qn()],Gl);let Hl=class extends Gl{get __tag(){return"Frame"}get isFrame(){return!0}};ye([zn(gl)],Hl.prototype,"__",void 0),ye([Pn("#FFFFFF")],Hl.prototype,"fill",void 0),ye([Cn("hide")],Hl.prototype,"overflow",void 0),Hl=ye([Qn()],Hl);const{moveTo:ql,closePath:Ql,ellipse:Jl}=Bi;let $l=class extends Wl{get __tag(){return"Ellipse"}__updatePath(){const{width:t,height:e,innerRadius:s,startAngle:i,endAngle:r}=this.__,n=t/2,o=e/2,a=this.__.path=[];s?i||r?(s<1&&Jl(a,n,o,n*s,o*s,0,i,r,!1),Jl(a,n,o,n,o,0,r,i,!0)):(s<1&&(Jl(a,n,o,n*s,o*s),ql(a,t,o)),Jl(a,n,o,n,o,0,360,0,!0)):i||r?(ql(a,n,o),Jl(a,n,o,n,o,0,i,r,!1)):Jl(a,n,o,n,o),Ql(a),x.ellipseToCurve&&(this.__.path=this.getPath(!0))}};ye([zn(ml)],$l.prototype,"__",void 0),ye([Sn(0)],$l.prototype,"innerRadius",void 0),ye([Sn(0)],$l.prototype,"startAngle",void 0),ye([Sn(0)],$l.prototype,"endAngle",void 0),$l=ye([Qn()],$l);const{sin:Zl,cos:Kl,PI:td}=Math,{moveTo:ed,lineTo:sd,closePath:id,drawPoints:rd}=Bi;let nd=class extends Wl{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)rd(e,t.points,t.curve,!0);else{const{width:s,height:i,sides:r}=t,n=s/2,o=i/2;ed(e,n,0);for(let t=1;t<r;t++)sd(e,n+n*Zl(2*t*td/r),o-o*Kl(2*t*td/r));id(e)}}};ye([zn(xl)],nd.prototype,"__",void 0),ye([Sn(3)],nd.prototype,"sides",void 0),ye([Sn()],nd.prototype,"points",void 0),ye([Sn(0)],nd.prototype,"curve",void 0),nd=ye([Gn(),Qn()],nd);const{sin:od,cos:ad,PI:hd}=Math,{moveTo:ld,lineTo:dd,closePath:cd}=Bi;let ud=class extends Wl{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:s,innerRadius:i}=this.__,r=t/2,n=e/2,o=this.__.path=[];ld(o,r,0);for(let t=1;t<2*s;t++)dd(o,r+(t%2==0?r:r*i)*od(t*hd/s),n-(t%2==0?n:n*i)*ad(t*hd/s));cd(o)}};ye([zn(wl)],ud.prototype,"__",void 0),ye([Sn(5)],ud.prototype,"corners",void 0),ye([Sn(.382)],ud.prototype,"innerRadius",void 0),ud=ye([Qn()],ud);const{moveTo:_d,lineTo:pd,drawPoints:gd}=Bi,{rotate:fd,getAngle:yd,getDistance:md,defaultPoint:xd}=ct;let wd=class extends Wl{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,s={x:0,y:0};return t&&(s.x=t),e&&fd(s,e),s}set toPoint(t){this.width=md(xd,t),this.rotation=yd(xd,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?gd(e,t.points,t.curve,t.closed):(_d(e,0,0),pd(e,this.width,0))}};ye([zn(fl)],wd.prototype,"__",void 0),ye([kn("center")],wd.prototype,"strokeAlign",void 0),ye([xn(0)],wd.prototype,"height",void 0),ye([Sn()],wd.prototype,"points",void 0),ye([Sn(0)],wd.prototype,"curve",void 0),ye([Sn(!1)],wd.prototype,"closed",void 0),wd=ye([Qn()],wd);let vd=class extends Nl{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return d(t)&&t[0].image}};ye([zn(Bl)],vd.prototype,"__",void 0),ye([xn("")],vd.prototype,"url",void 0),vd=ye([Qn()],vd);const bd=vd;let Sd=class extends Nl{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=le.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new on({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new Uo(Uo.LOADED,{image:t}))})}draw(t,e,s,i){const r=new xt(t.worldTransform).invert(),n=new xt;e&&n.translate(e.x,e.y),s&&(a(s)?n.scale(s):n.scale(s.x,s.y)),i&&n.rotate(i),r.multiplyParent(n),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()}};ye([zn(Rl)],Sd.prototype,"__",void 0),ye([Uh(100)],Sd.prototype,"width",void 0),ye([Uh(100)],Sd.prototype,"height",void 0),ye([Uh(1)],Sd.prototype,"pixelRatio",void 0),ye([Uh(!0)],Sd.prototype,"smooth",void 0),ye([_n(!1)],Sd.prototype,"safeResize",void 0),ye([Uh()],Sd.prototype,"contextSettings",void 0),Sd=ye([Qn()],Sd);const{copyAndSpread:kd,includes:Bd,spread:Rd,setList:Cd}=Gt,{stintSet:Pd}=p;let Td=class extends Wl{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:s,fontFamily:i,fontSize:r,fontWeight:n,italic:o,textCase:a,textOverflow:h,padding:l,width:d,height:c}=t;t.__lineHeight=qh.number(e,r),t.__letterSpacing=qh.number(s,r),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${o?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==n?n+" ":""}${r||12}px ${i||"caption"}`,Pd(t,"__padding",l&&F.fourNumber(l)),Pd(t,"__clipText","show"!==h&&!t.__autoSize),Pd(t,"__isCharMode",d||c||t.__letterSpacing||"none"!==a),t.__textDrawData=Gh.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:n,__autoHeight:o}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<s&&Rd(a,s/2),n||o){if(h.x=n?a.x:0,h.y=o?a.y:0,h.width=n?a.width:t.width,h.height=o?a.height:t.height,r){const[e,s,i,r]=t.__padding;n&&(h.x-=r,h.width+=s+r),o&&(h.y-=e,h.height+=i+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();i&&(h.width+=.16*s),p.stintSet(this,"isOverflow",!Bd(h,a)),this.isOverflow?(Cd(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;kd(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()}};ye([zn(kl)],Td.prototype,"__",void 0),ye([xn(0)],Td.prototype,"width",void 0),ye([xn(0)],Td.prototype,"height",void 0),ye([Pn()],Td.prototype,"boxStyle",void 0),ye([_n(!1)],Td.prototype,"resizeFontSize",void 0),ye([Pn("#000000")],Td.prototype,"fill",void 0),ye([kn("outside")],Td.prototype,"strokeAlign",void 0),ye([Dn("all")],Td.prototype,"hitFill",void 0),ye([xn("")],Td.prototype,"text",void 0),ye([xn("")],Td.prototype,"placeholder",void 0),ye([xn("caption")],Td.prototype,"fontFamily",void 0),ye([xn(12)],Td.prototype,"fontSize",void 0),ye([xn("normal")],Td.prototype,"fontWeight",void 0),ye([xn(!1)],Td.prototype,"italic",void 0),ye([xn("none")],Td.prototype,"textCase",void 0),ye([xn("none")],Td.prototype,"textDecoration",void 0),ye([xn(0)],Td.prototype,"letterSpacing",void 0),ye([xn({type:"percent",value:1.5})],Td.prototype,"lineHeight",void 0),ye([xn(0)],Td.prototype,"paraIndent",void 0),ye([xn(0)],Td.prototype,"paraSpacing",void 0),ye([xn("x")],Td.prototype,"writingMode",void 0),ye([xn("left")],Td.prototype,"textAlign",void 0),ye([xn("top")],Td.prototype,"verticalAlign",void 0),ye([xn(!0)],Td.prototype,"autoSizeAlign",void 0),ye([xn("normal")],Td.prototype,"textWrap",void 0),ye([xn("show")],Td.prototype,"textOverflow",void 0),ye([Pn(!1)],Td.prototype,"textEditing",void 0),Td=ye([Qn()],Td);let Ld=class extends Wl{get __tag(){return"Path"}};ye([zn(vl)],Ld.prototype,"__",void 0),ye([kn("center")],Ld.prototype,"strokeAlign",void 0),Ld=ye([Qn()],Ld);let Od=class extends Ml{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new Ld(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,s,i,r,n){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,n,o,a){return this}arc(t,e,s,i,r,n){return this}arcTo(t,e,s,i,r){return this}drawEllipse(t,e,s,i,r,n,o,a){return this}drawArc(t,e,s,i,r,n){return this}drawPoints(t,e,s){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}};function Ed(t,e,s){t.__.__font?Jh.fillText(t,e,s):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function Ad(t,e,s,i,r){const n=s.__;c(t)?Jh.drawStrokesStyle(t,e,!1,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),i.stroke()),n.__useArrow&&Jh.strokeArrow(t,s,i,r)}function Id(t,e,s,i,r){const n=s.__;c(t)?Jh.drawStrokesStyle(t,e,!0,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),Jh.drawTextStroke(s,i,r))}function Wd(t,e,s,i,r){const n=i.getSameCanvas(!0,!0);n.font=s.__.__font,Id(t,2,s,n,r),n.blendMode="outside"===e?"destination-out":"destination-in",Jh.fillText(s,n,r),n.blendMode="normal",ho.copyCanvasByWorld(s,i,n),n.recycle(s.__nowWorld)}ye([zn(bl)],Od.prototype,"__",void 0),ye([(t,e)=>{an(t,e,{get(){return this.__path}})}],Od.prototype,"path",void 0),Od=ye([qn(Xi,["set","path","paint"]),Qn()],Od);const{getSpread:Md,copyAndSpread:Dd,toOuterOf:Fd,getOuterOf:zd,getByMove:Nd,move:Yd,getIntersectData:Xd}=Gt,Ud={};let jd;const{stintSet:Vd}=p,{hasTransparent:Gd}=Hh;function Hd(t,e,s){if(!c(e)||!1===e.visible||0===e.opacity)return;let r;const{boxBounds:o}=s.__layout;switch(e.type){case"image":if(!e.url)return;r=$h.image(s,t,e,o,!jd||!jd[e.url]);break;case"linear":r=Zh.linearGradient(e,o);break;case"radial":r=Zh.radialGradient(e,o);break;case"angular":r=Zh.conicGradient(e,o);break;case"solid":const{type:n,color:a,opacity:h}=e;r={type:n,style:Hh.string(a,h)};break;default:i(e.r)||(r={type:"solid",style:Hh.string(e)})}if(r&&(r.originPaint=e,n(r.style)&&Gd(r.style)&&(r.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;r.strokeStyle=e.style}return r}const qd={compute:function(t,e){const s=e.__,i=[];let r,n,o,a=s.__input[t];d(a)||(a=[a]),jd=$h.recycleImage(t,s);for(let s,r=0,n=a.length;r<n;r++)(s=Hd(t,a[r],e))&&(i.push(s),s.strokeStyle&&(o||(o=1),s.strokeStyle.strokeWidth&&(o=Math.max(o,s.strokeStyle.strokeWidth))));s["_"+t]=i.length?i:void 0,i.length?(i.every(t=>t.isTransparent)&&(i.some(t=>t.image)&&(r=!0),n=!0),"fill"===t?(Vd(s,"__isAlphaPixelFill",r),Vd(s,"__isTransparentFill",n)):(Vd(s,"__isAlphaPixelStroke",r),Vd(s,"__isTransparentStroke",n),Vd(s,"__hasMultiStrokeStyle",o))):s.__removePaint(t,!1)},fill:function(t,e,s,i){s.fillStyle=t,Ed(e,s,i)},fills:function(t,e,s,i){let r,n,o;for(let a=0,h=t.length;a<h;a++){if(r=t[a],n=r.originPaint,r.image){if(o?o++:o=1,$h.checkImage(r,!e.__.__font,e,s,i))continue;if(!r.style){1===o&&r.image.isPlacehold&&e.drawImagePlaceholder(r,s,i);continue}}if(s.fillStyle=r.style,r.transform||n.scaleFixed){if(s.save(),r.transform&&s.transform(r.transform),n.scaleFixed){const{scaleX:t,scaleY:i}=e.getRenderScaleData(!0);(!0===n.scaleFixed||"zoom-in"===n.scaleFixed&&t>1&&i>1)&&s.scale(1/t,1/i)}n.blendMode&&(s.blendMode=n.blendMode),Ed(e,s,i),s.restore()}else n.blendMode?(s.saveBlendMode(n.blendMode),Ed(e,s,i),s.restoreBlendMode()):Ed(e,s,i)}},fillPathOrText:Ed,fillText:function(t,e,s){const i=t.__,{rows:r,decorationY:n}=i.__textDrawData;let o;i.__isPlacehold&&i.placeholderColor&&(e.fillStyle=i.placeholderColor);for(let t=0,s=r.length;t<s;t++)o=r[t],o.text?e.fillText(o.text,o.x,o.y):o.data&&o.data.forEach(t=>{e.fillText(t.char,t.x,o.y)});if(n){const{decorationColor:t,decorationHeight:s}=i.__textDrawData;t&&(e.fillStyle=t),r.forEach(t=>n.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)Jh.strokeText(t,e,s,i);else switch(r.strokeAlign){case"center":Ad(t,1,e,s,i);break;case"inside":!function(t,e,s,i){s.save(),s.clipUI(e),Ad(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)Ad(t,2,e,s,i);else{const{renderBounds:n}=e.__layout,o=s.getSameCanvas(!0,!0);e.__drawRenderPath(o),Ad(t,2,e,o,i),o.clipUI(r),o.clearWorld(n),ho.copyCanvasByWorld(e,s,o),o.recycle(e.__nowWorld)}}(t,e,s,i)}},strokes:function(t,e,s,i){Jh.stroke(t,e,s,i)},strokeText:function(t,e,s,i){switch(e.__.strokeAlign){case"center":Id(t,1,e,s,i);break;case"inside":Wd(t,"inside",e,s,i);break;case"outside":e.__.__fillAfterStroke?Id(t,2,e,s,i):Wd(t,"outside",e,s,i)}},drawTextStroke:function(t,e,s){let i,r=t.__.__textDrawData;const{rows:n,decorationY:o}=r;for(let t=0,s=n.length;t<s;t++)i=n[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(o){const{decorationHeight:t}=r;n.forEach(s=>o.forEach(i=>e.strokeRect(s.x,s.y+i,s.width,t)))}},drawStrokesStyle:function(t,e,s,i,r,n){let o;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(o=t[l],(!o.image||!$h.checkImage(o,!1,i,r,n))&&o.style){if(h){const{strokeStyle:t}=o;t?r.setStroke(o.style,a.__getRealStrokeWidth(t)*e,a,t):r.setStroke(o.style,a.__strokeWidth*e,a)}else r.strokeStyle=o.style;o.originPaint.blendMode?(r.saveBlendMode(o.originPaint.blendMode),s?Jh.drawTextStroke(i,r,n):r.stroke(),r.restoreBlendMode()):s?Jh.drawTextStroke(i,r,n):r.stroke()}},shape:function(t,e,s){const i=e.getSameCanvas(),r=e.bounds,n=t.__nowWorld,o=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let h,l,d,c,u,_;Fd(o.strokeSpread?(Dd(Ud,o.boxBounds,o.strokeSpread),Ud):o.boxBounds,n,a);let{scaleX:p,scaleY:g}=t.getRenderScaleData(!0);if(r.includes(a))_=i,h=u=a,l=n;else{let i;if(x.fullImageShadow)i=a;else{const t=o.renderShapeSpread?Md(r,P.swapAndScale(o.renderShapeSpread,p,g)):r;i=Xd(t,a)}c=r.getFitMatrix(i);let{a:f,d:y}=c;c.a<1&&(_=e.getSameCanvas(),t.__renderShape(_,s),p*=f,g*=y),u=zd(a,c),h=Nd(u,-c.e,-c.f),l=zd(n,c),Yd(l,-c.e,-c.f);const m=s.matrix;m?(d=new xt(c),d.multiply(m),f*=m.scaleX,y*=m.scaleY):d=c,d.withScale(f,y),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:g}}};let Qd,Jd=new Jt;const{isSame:$d}=Gt;function Zd(t,e,s,i,r,n){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||$h.createData(r,i,s,n),!0}function Kd(t,e){sc(t,Uo.LOAD,e)}function tc(t,e){sc(t,Uo.LOADED,e)}function ec(t,e,s){e.error=s,t.forceUpdate("surface"),sc(t,Uo.ERROR,e)}function sc(t,e,s){t.hasEvent(e)&&t.emitEvent(new Uo(e,s))}function ic(t,e){const{leafer:s}=t;s&&s.viewReady&&(s.renderer.ignore=e)}const{get:rc,translate:nc}=K,oc=new Jt,ac={},hc={};function lc(t,e,s,i){const r=n(t)||i?(i?s-i*e:s%e)/((i||Math.floor(s/e))-1):t;return"auto"===t&&r<0?0:r}let dc={},cc={a:1,b:0,c:0,d:1,e:0,f:0};const{get:uc,set:_c,rotateOfOuter:pc,translate:gc,scaleOfOuter:fc,multiplyParent:yc,scale:mc,rotate:xc,skew:wc}=K;function vc(t,e,s,i,r,n,o,a){o&&xc(t,o),a&&wc(t,a.x,a.y),r&&mc(t,r,n),gc(t,e.x+s,e.y+i)}const{get:bc,scale:Sc,copy:kc}=K,{getFloorScale:Bc}=F,{abs:Rc}=Math;const Cc={image:function(t,e,s,i,r){let n,o;const a=en.get(s);return Qd&&s===Qd.paint&&$d(i,Qd.boxBounds)?n=Qd.leafPaint:(n={type:s.type,image:a},a.hasAlphaPixel&&(n.isTransparent=!0),Qd=a.use>1?{leafPaint:n,paint:s,boxBounds:Jd.set(i)}:null),(r||a.loading)&&(o={image:a,attrName:e,attrValue:s}),a.ready?(Zd(t,e,s,a,n,i),r&&(Kd(t,o),tc(t,o))):a.error?r&&ec(t,o,a.error):(r&&(ic(t,!0),Kd(t,o)),n.loadId=a.load(()=>{ic(t,!1),t.destroyed||(Zd(t,e,s,a,n,i)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),tc(t,o)),n.loadId=void 0},e=>{ic(t,!1),ec(t,o,e),n.loadId=void 0},s.lod&&a.getThumbSize()),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),n},checkImage:function(t,e,s,i,r){const{scaleX:n,scaleY:o}=$h.getImageRenderScaleData(t,s,i,r),{image:a,data:h,originPaint:l}=t,{exporting:d}=r;return!(!h||t.patternId===n+"-"+o&&!d)&&(e&&(h.repeat?e=!1:l.changeful||"miniapp"===x.name&&Jo.isResizing(s)||d||(e=x.image.isLarge(a,n,o)||a.width*n>8096||a.height*o>8096)),e?(s.__.__isFastShadow&&(i.fillStyle=t.style||"#000",i.fill()),$h.drawImage(t,n,o,s,i,r),!0):(!t.style||l.sync||d?$h.createPattern(t,s,i,r):$h.createPatternTask(t,s,i,r),!1))},drawImage:function(t,e,s,i,r,n){const{data:o,image:a}=t,{blendMode:h}=t.originPaint,{opacity:l,transform:d}=o,c=a.getFull(o.filters),u=i.__;let _,{width:p,height:g}=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,g),r.restore()):(o.scaleX&&(p*=o.scaleX,g*=o.scaleY),r.drawImage(c,0,0,p,g))},getImageRenderScaleData:function(t,e,s,i){const r=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:n}=t;if(s){const{pixelRatio:t}=s;r.scaleX*=t,r.scaleY*=t}return n&&n.scaleX&&(r.scaleX*=Math.abs(n.scaleX),r.scaleY*=Math.abs(n.scaleY)),r},recycleImage:function(t,e){const s=e["_"+t];if(d(s)){let i,r,n,o,a;for(let h=0,l=s.length;h<l;h++)i=s[h],r=i.image,a=r&&r.url,a&&(n||(n={}),n[a]=!0,en.recyclePaint(i),r.loading&&(o||(o=e.__input&&e.__input[t]||[],d(o)||(o=[o])),r.unload(s[h].loadId,!o.some(t=>t.url===a))));return n}return null},createPatternTask:function(t,e,s,i){t.patternTask||(t.patternTask=en.patternTasker.add(()=>me(this,void 0,void 0,function*(){$h.createPattern(t,e,s,i),e.forceUpdate("surface")}),0,()=>(t.patternTask=null,s.bounds.hit(e.__nowWorld))))},createPattern:function(t,e,s,i){let{scaleX:r,scaleY:n}=$h.getImageRenderScaleData(t,e,s,i),o=r+"-"+n;if(t.patternId!==o&&!e.destroyed&&(!x.image.isLarge(t.image,r,n)||t.data.repeat)){const{image:s,data:i}=t,{transform:a,gap:h}=i,l=$h.getPatternFixScale(t,r,n);let d,c,u,{width:_,height:p}=s;l&&(r*=l,n*=l),_*=r,p*=n,h&&(c=h.x*r/Rc(i.scaleX||1),u=h.y*n/Rc(i.scaleY||1)),(a||1!==r||1!==n)&&(r*=Bc(_+(c||0)),n*=Bc(p+(u||0)),d=bc(),a&&kc(d,a),Sc(d,1/r,1/n));const g=s.getCanvas(_,p,i.opacity,i.filters,c,u,e.leafer&&e.leafer.config.smooth),f=s.getPattern(g,i.repeat||x.origin.noRepeat||"no-repeat",d,t);t.style=f,t.patternId=o}},getPatternFixScale:function(t,e,s){const{image:i}=t;let r,n=x.image.maxPatternSize,o=i.width*i.height;return i.isSVG?e>1&&(r=Math.ceil(e)/e):n>o&&(n=o),(o*=e*s)>n&&(r=Math.sqrt(n/o)),r},createData:function(t,e,s,i){t.data=$h.getPatternData(s,i,e)},getPatternData:function(t,e,s){t.padding&&(e=oc.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:i,height:r}=s,{opacity:o,mode:a,align:h,offset:l,scale:d,size:u,rotation:_,skew:p,clipSize:g,repeat:f,gap:y,filters:m}=t,x=e.width===i&&e.height===r,w={mode:a},v="center"!==h&&(_||0)%180==90;let b,S;switch(Gt.set(hc,0,0,v?r:i,v?i:r),a&&"cover"!==a&&"fit"!==a?((d||u)&&(F.getScaleData(d,u,s,ac),b=ac.scaleX,S=ac.scaleY),(h||y||f)&&(b&&Gt.scale(hc,b,S,!0),h&&Tt.toPoint(h,hc,e,hc,!0,!0))):x&&!_||(b=S=Gt.getFitScale(e,hc,"fit"!==a),Gt.put(e,s,h,b,!1,hc),Gt.scale(hc,b,S,!0)),l&&ct.move(hc,l),a){case"stretch":x?b&&(b=S=void 0):(b=e.width/i,S=e.height/r,$h.stretchMode(w,e,b,S));break;case"normal":case"clip":if(hc.x||hc.y||b||g||_||p){let t,s;g&&(t=e.width/g.width,s=e.height/g.height),$h.clipMode(w,e,hc.x,hc.y,b,S,_,p,t,s),t&&(b=b?b*t:t,S=S?S*s:s)}break;case"repeat":(!x||b||_||p)&&$h.repeatMode(w,e,i,r,hc.x,hc.y,b,S,_,p,h,t.freeTransform),f||(w.repeat="repeat");const s=c(f);(y||s)&&(w.gap=function(t,e,s,i,r){let n,o;c(t)?(n=t.x,o=t.y):n=o=t;return{x:lc(n,s,r.width,e&&e.x),y:lc(o,i,r.height,e&&e.y)}}(y,s&&f,hc.width,hc.height,e));break;default:b&&$h.fillOrFitMode(w,e,hc.x,hc.y,b,S,_)}return w.transform||(e.x||e.y)&&nc(w.transform=rc(),e.x,e.y),b&&(w.scaleX=b,w.scaleY=S),o&&o<1&&(w.opacity=o),m&&(w.filters=m),f&&(w.repeat=n(f)?"x"===f?"repeat-x":"repeat-y":"repeat"),w},stretchMode:function(t,e,s,i){const r=uc(),{x:n,y:o}=e;n||o?gc(r,n,o):r.onlyScale=!0,mc(r,s,i),t.transform=r},fillOrFitMode:function(t,e,s,i,r,n,o){const a=uc();gc(a,e.x+s,e.y+i),mc(a,r,n),o&&pc(a,{x:e.x+e.width/2,y:e.y+e.height/2},o),t.transform=a},clipMode:function(t,e,s,i,r,n,o,a,h,l){const d=uc();vc(d,e,s,i,r,n,o,a),h&&(o||a?(_c(cc),fc(cc,e,h,l),yc(d,cc)):fc(d,e,h,l)),t.transform=d},repeatMode:function(t,e,s,i,r,n,o,a,h,l,d,c){const u=uc();if(c)vc(u,e,r,n,o,a,h,l);else{if(h)if("center"===d)pc(u,{x:s/2,y:i/2},h);else switch(xc(u,h),h){case 90:gc(u,i,0);break;case 180:gc(u,s,i);break;case 270:gc(u,0,s)}dc.x=e.x+r,dc.y=e.y+n,gc(u,dc.x,dc.y),o&&fc(u,dc,o,a)}t.transform=u}},{toPoint:Pc}=Rt,{hasTransparent:Tc}=Hh,Lc={},Oc={};function Ec(t,e,s,i){if(s){let r,o,a,h;for(let t=0,l=s.length;t<l;t++)r=s[t],n(r)?(a=t/(l-1),o=Hh.string(r,i)):(a=r.offset,o=Hh.string(r.color,i)),e.addColorStop(a,o),!h&&Tc(o)&&(h=!0);h&&(t.isTransparent=!0)}}const{getAngle:Ac,getDistance:Ic}=ct,{get:Wc,rotateOfOuter:Mc,scaleOfOuter:Dc}=K,{toPoint:Fc}=Rt,zc={},Nc={};function Yc(t,e,s,i,r){let n;const{width:o,height:a}=t;if(o!==a||i){const t=Ac(e,s);n=Wc(),r?(Dc(n,e,o/a*(i||1),1),Mc(n,e,t+90)):(Dc(n,e,1,o/a*(i||1)),Mc(n,e,t))}return n}const{getDistance:Xc}=ct,{toPoint:Uc}=Rt,jc={},Vc={};const Gc={linearGradient:function(t,e){let{from:s,to:i,type:r,opacity:n}=t;Pc(s||"top",e,Lc),Pc(i||"bottom",e,Oc);const o=x.canvas.createLinearGradient(Lc.x,Lc.y,Oc.x,Oc.y),a={type:r,style:o};return Ec(a,o,t.stops,n),a},radialGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,stretch:o}=t;Fc(s||"center",e,zc),Fc(i||"bottom",e,Nc);const a=x.canvas.createRadialGradient(zc.x,zc.y,0,zc.x,zc.y,Ic(zc,Nc)),h={type:r,style:a};Ec(h,a,t.stops,n);const l=Yc(e,zc,Nc,o,!0);return l&&(h.transform=l),h},conicGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,stretch:o}=t;Uc(s||"center",e,jc),Uc(i||"bottom",e,Vc);const a=x.conicGradientSupport?x.canvas.createConicGradient(0,jc.x,jc.y):x.canvas.createRadialGradient(jc.x,jc.y,0,jc.x,jc.y,Xc(jc,Vc)),h={type:r,style:a};Ec(h,a,t.stops,n);const l=Yc(e,jc,Vc,o||1,x.conicGradientRotate90);return l&&(h.transform=l),h},getTransform:Yc},{copy:Hc,move:qc,toOffsetOutBounds:Qc}=Gt,{max:Jc,abs:$c}=Math,Zc={},Kc=new xt,tu={};function eu(t,e){let s,i,r,n,o=0,a=0,h=0,l=0;return e.forEach(t=>{s=t.x||0,i=t.y||0,n=1.5*(t.blur||0),r=$c(t.spread||0),o=Jc(o,r+n-i),a=Jc(a,r+n+s),h=Jc(h,r+n+i),l=Jc(l,r+n-s)}),o===a&&a===h&&h===l?o:[o,a,h,l]}function su(t,e,s){const{shapeBounds:i}=s;let r,n;x.fullImageShadow?(Hc(Zc,t.bounds),qc(Zc,e.x-i.x,e.y-i.y),r=t.bounds,n=Zc):(r=i,n=e),t.copyWorld(s.canvas,r,n)}const{toOffsetOutBounds:iu}=Gt,ru={};const nu=eu;const ou={shadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{shadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;Qc(h,tu,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.setWorldShadow(tu.offsetX+(o.x||0)*c*f,tu.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f,Hh.string(o.color)),r=Kh.getShadowTransform(t,_,s,o,tu,f),r&&_.setTransform(r),su(_,tu,s),r&&_.resetTransform(),i=l,o.box&&(_.restore(),_.save(),a&&(_.copyWorld(_,l,n,"copy"),i=n),a?_.copyWorld(a,n,n,"destination-out"):_.copyWorld(s.canvas,d,h,"destination-out")),ho.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<p&&_.clearWorld(i)}),_.recycle(i)},innerShadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{innerShadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;iu(h,ru,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.save(),_.setWorldShadow(ru.offsetX+(o.x||0)*c*f,ru.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f),r=Kh.getShadowTransform(t,_,s,o,ru,f,!0),r&&_.setTransform(r),su(_,ru,s),_.restore(),a?(_.copyWorld(_,l,n,"copy"),_.copyWorld(a,n,n,"source-out"),i=n):(_.copyWorld(s.canvas,d,h,"source-out"),i=l),_.fillWorld(i,Hh.string(o.color),"source-in"),ho.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<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:eu,getShadowTransform:function(t,e,s,i,r,n,o){if(i.spread){const s=2*i.spread*n*(o?-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:nu},{excludeRenderBounds:au}=yo;let hu;function lu(t,e,s,i,r,n,o,a){switch(e){case"grayscale":hu||(hu=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,s,i,r,n){const o=t.__nowWorld;s.resetTransform(),s.opacity=1,s.useMask(i,o),n&&i.recycle(o);cu(t,e,s,1,r,n)}(t,s,i,r,o,a);break;case"opacity-path":cu(t,s,i,n,o,a);break;case"path":a&&s.restore()}}function du(t){return t.getSameCanvas(!1,!0)}function cu(t,e,s,i,r,n){const o=t.__nowWorld;e.resetTransform(),e.opacity=i,e.copyWorld(s,o,void 0,r),n?s.recycle(o):s.clearWorld(o)}Ml.prototype.__renderMask=function(t,e){let s,i,r,n,o,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++){if(s=h[l],a=s.__.mask,a){o&&(lu(this,o,t,r,i,n,void 0,!0),i=r=null),"clipping"!==a&&"clipping-path"!==a||au(s,e)||s.__render(t,e),n=s.__.opacity,hu=!1,"path"===a||"clipping-path"===a?(n<1?(o="opacity-path",r||(r=du(t))):(o="path",t.save()),s.__clip(r||t,e)):(o="grayscale"===a?"grayscale":"alpha",i||(i=du(t)),r||(r=du(t)),s.__render(i,e));continue}const d=1===n&&s.__.__blendMode;d&&lu(this,o,t,r,i,n,void 0,!1),au(s,e)||s.__render(r||t,e),d&&lu(this,o,t,r,i,n,d,!1)}lu(this,o,t,r,i,n,void 0,!0)};const uu=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",_u=uu+"_#~&*+\\=|≮≯≈≠=…",pu=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 gu(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}const fu=gu("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),yu=gu("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),mu=gu(uu),xu=gu(_u),wu=gu("- —/~|┆·");var vu;!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"}(vu||(vu={}));const{Letter:bu,Single:Su,Before:ku,After:Bu,Symbol:Ru,Break:Cu}=vu;function Pu(t){return fu[t]?bu:wu[t]?Cu:yu[t]?ku:mu[t]?Bu:xu[t]?Ru:pu.test(t)?Su:bu}const Tu={trimRight(t){const{words:e}=t;let s,i=0,r=e.length;for(let n=r-1;n>-1&&(s=e[n].data[0]," "===s.char);n--)i++,t.width-=s.width;i&&e.splice(r-i,i)}};function Lu(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:Ou}=Tu,{Letter:Eu,Single:Au,Before:Iu,After:Wu,Symbol:Mu,Break:Du}=vu;let Fu,zu,Nu,Yu,Xu,Uu,ju,Vu,Gu,Hu,qu,Qu,Ju,$u,Zu,Ku,t_,e_=[];function s_(t,e){Gu&&!Vu&&(Vu=Gu),Fu.data.push({char:t,width:e}),Nu+=e}function i_(){Yu+=Nu,Fu.width=Nu,zu.words.push(Fu),Fu={data:[]},Nu=0}function r_(){$u&&(Zu.paraNumber++,zu.paraStart=!0,$u=!1),Gu&&(zu.startCharSize=Vu,zu.endCharSize=Gu,Vu=0),zu.width=Yu,Ku.width?Ou(zu):t_&&n_(),e_.push(zu),zu={words:[]},Yu=0}function n_(){Yu>(Zu.maxWidth||0)&&(Zu.maxWidth=Yu)}const{top:o_,right:a_,bottom:h_,left:l_}=St;function d_(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 c_={getDrawData:function(t,e){n(t)||(t=String(t));let s=0,i=0,r=e.__getInput("width")||0,o=e.__getInput("height")||0;const{__padding:a}=e;a&&(r?(s=a[l_],r-=a[a_]+a[l_],!r&&(r=.01)):e.autoSizeAlign||(s=a[l_]),o?(i=a[o_],o-=a[o_]+a[h_],!o&&(o=.01)):e.autoSizeAlign||(i=a[o_]));const h={bounds:{x:s,y:i,width:r,height:o},rows:[],paraNumber:0,font:x.canvas.font=e.__font};return function(t,e,s){Zu=t,e_=t.rows,Ku=t.bounds,t_=!Ku.width&&!s.autoSizeAlign;const{__letterSpacing:i,paraIndent:r,textCase:n}=s,{canvas:o}=x,{width:a}=Ku;if(s.__isCharMode){const t="none"!==s.textWrap,h="break"===s.textWrap;$u=!0,qu=null,Vu=ju=Gu=Nu=Yu=0,Fu={data:[]},zu={words:[]},i&&(e=[...e]);for(let s=0,l=e.length;s<l;s++)Uu=e[s],"\n"===Uu?(Nu&&i_(),zu.paraEnd=!0,r_(),$u=!0):(Hu=Pu(Uu),Hu===Eu&&"none"!==n&&(Uu=Lu(Uu,n,!Nu)),ju=o.measureText(Uu).width,i&&(i<0&&(Gu=ju),ju+=i),Qu=Hu===Au&&(qu===Au||qu===Eu)||qu===Au&&Hu!==Wu,Ju=!(Hu!==Iu&&Hu!==Au||qu!==Mu&&qu!==Wu),Xu=$u&&r?a-r:a,t&&a&&Yu+Nu+ju>Xu&&(h?(Nu&&i_(),Yu&&r_()):(Ju||(Ju=Hu===Eu&&qu==Wu),Qu||Ju||Hu===Du||Hu===Iu||Hu===Au||Nu+ju>Xu?(Nu&&i_(),Yu&&r_()):Yu&&r_()))," "===Uu&&!0!==$u&&Yu+Nu===0||(Hu===Du?(" "===Uu&&Nu&&i_(),s_(Uu,ju),i_()):Qu||Ju?(Nu&&i_(),s_(Uu,ju)):s_(Uu,ju)),qu=Hu);Nu&&i_(),Yu&&r_(),e_.length>0&&(e_[e_.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{Zu.paraNumber++,Yu=o.measureText(t).width,e_.push({x:r||0,text:t,width:Yu,paraStart:!0}),t_&&n_()})}(h,t,e),a&&function(t,e,s,i,r){if(!i&&s.autoSizeAlign)switch(s.textAlign){case"left":d_(e,"x",t[l_]);break;case"right":d_(e,"x",-t[a_])}if(!r&&s.autoSizeAlign)switch(s.verticalAlign){case"top":d_(e,"y",t[o_]);break;case"bottom":d_(e,"y",-t[h_])}}(a,h,e,r,o),function(t,e){const{rows:s,bounds:i}=t,r=s.length,{__lineHeight:n,__baseLine:o,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:g,height:f}=i,y=n*r+(c?c*(t.paraNumber-1):0),m=o;if(h&&y>f)y=Math.max(f,n),r>1&&(t.overflow=r);else if(f||u)switch(d){case"middle":p+=(f-y)/2;break;case"bottom":p+=f-y}m+=p;let x,w,v,b=g||u?g:t.maxWidth;for(let o=0,d=r;o<d;o++){if(x=s[o],x.x=_,x.width<g||x.width>g&&!h)switch(l){case"center":x.x+=(b-x.width)/2;break;case"right":x.x+=b-x.width}x.paraStart&&c&&o>0&&(m+=c),x.y=m,m+=n,t.overflow>o&&m>y&&(x.isOverflow=!0,t.overflow=o+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&&g&&g<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:n,letterSpacing:o}=e,a=s&&r.includes("both"),h=a||s&&r.includes("justify"),l=h&&r.includes("letter");let d,c,u,_,p,g,f,y,m,x;i.forEach(t=>{t.words&&(p=n&&t.paraStart?n: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),g=o||t.isOverflow||l?0:u?1:2,t.isOverflow&&!o&&(t.textMode=!0),2===g?(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===g?(f={char:"",x:d},d=function(t,e,s){return t.forEach(t=>{s.char+=t.char,e+=t.width}),e}(e.data,d,f),(t.isOverflow||" "!==f.char)&&t.data.push(f)):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,r),h.overflow&&function(t,e,s,i){if(!i)return;const{rows:r,overflow:n}=t;let{textOverflow:o}=e;if(r.splice(n),o&&"show"!==o){let t,a;"hide"===o?o="":"ellipsis"===o&&(o="...");const h=o?x.canvas.measureText(o).width:0,l=s+i-h;("none"===e.textWrap?r:[r[n-1]]).forEach(e=>{if(e.isOverflow&&e.data){let s=e.data.length-1;for(let i=s;i>-1&&(t=e.data[i],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:o,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(h,e,s,r),"none"!==e.textDecoration&&function(t,e){let s,i=0;const{fontSize:r,textDecoration:n}=e;switch(t.decorationHeight=r/11,c(n)?(s=n.type,n.color&&(t.decorationColor=Hh.string(n.color)),n.offset&&(i=Math.min(.3*r,Math.max(n.offset,.15*-r)))):s=n,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 u_={string:function(t,e){if(!t)return"#000";const s=a(e)&&e<1;if(n(t)){if(!s||!Hh.object)return t;t=Hh.object(t)}let r=i(t.a)?1:t.a;s&&(r*=e);const o=t.r+","+t.g+","+t.b;return 1===r?"rgb("+o+")":"rgba("+o+","+r+")"}};Object.assign(Gh,c_),Object.assign(Hh,u_),Object.assign(Jh,qd),Object.assign($h,Cc),Object.assign(Zh,Gc),Object.assign(Kh,ou);try{wx&&Ch(0,wx)}catch(t){}export{Tt as AlignHelper,e as Answer,Rt as AroundHelper,Zt as AutoBounds,hs as BezierHelper,Jt as Bounds,jo as BoundsEvent,Gt as BoundsHelper,Gl as Box,_l as BoxData,wh as Branch,vo as BranchHelper,Fa as BranchRender,Sd as Canvas,Rl as CanvasData,fe as CanvasManager,zo as ChildEvent,Hh as ColorConvert,le as Creator,p as DataHelper,ee as Debug,St as Direction4,kt as Direction9,Kh as Effect,$l as Ellipse,ml as EllipseData,ys as EllipseHelper,Fo as Event,pe as EventCreator,aa as Eventer,el as Export,Hr as FileHelper,tl as Filter,P as FourNumberHelper,Hl as Frame,gl as FrameData,Ml as Group,ul as GroupData,vd as Image,Bl as ImageData,Uo as ImageEvent,en as ImageManager,v as IncrementId,Zo as LayoutEvent,zh as Layouter,dh as Leaf,Wa as LeafBounds,yo as LeafBoundsHelper,f as LeafData,wa as LeafDataProxy,ma as LeafEventer,ho as LeafHelper,Do as LeafLayout,bh as LeafLevelList,vh as LeafList,Ca as LeafMatrix,Ma as LeafRender,zl as Leafer,kh as LeaferCanvas,Ee as LeaferCanvasBase,pl as LeaferData,ta as LeaferEvent,on as LeaferImage,wd as Line,fl as LineData,F as MathHelper,xt as Matrix,K as MatrixHelper,bd as MyImage,De as NeedConvertToCanvasCommandMap,N as OneRadian,Y as PI2,X as PI_2,Jh as Paint,Zh as PaintGradient,$h as PaintImage,Ld as Path,Qh as PathArrow,Wr as PathBounds,Bi as PathCommandDataHelper,We as PathCommandMap,ms as PathCommandNodeHelper,si as PathConvert,Xr as PathCorner,Xi as PathCreator,vl as PathData,ir as PathDrawer,Ae as PathHelper,t as PathNodeHandleType,Ye as PathNumberCommandLengthMap,Ne as PathNumberCommandMap,Od as Pen,bl as PenData,x as Platform,he as Plugin,yt as Point,ct as PointHelper,nd as Polygon,xl as PolygonData,Yo as PropertyEvent,Nl as Rect,yl as RectData,Xe as RectHelper,Al as RectRender,Ko as RenderEvent,Yh as Renderer,Jo as ResizeEvent,Kr as Resource,ne as Run,ud as Star,wl as StarData,sl as State,Kt as StringNumberMap,Jr as TaskItem,$r as TaskProcessor,Td as Text,Gh as TextConvert,kl as TextData,il as Transition,vt as TwoPointBoundsHelper,Wl as UI,Tl as UIBounds,ce as UICreator,dl as UIData,Ol as UIRender,qh as UnitConvert,Co as WaitHelper,$o as WatchEvent,Ph as Watcher,Cn as affectRenderBoundsType,kn as affectStrokeBoundsType,cn as attr,fn as autoLayoutType,xn as boundsType,Gr as canvasPatch,Oe as canvasSizeAttrs,Vh as createAttr,ln as createDescriptor,Fn as cursorType,zn as dataProcessor,_n as dataType,dn as decorateLeafAttr,Yn as defineDataProcessor,an as defineKey,un as defineLeafAttr,Tn as dimType,vn as doBoundsType,Bn as doStrokeType,Xh as effectType,s as emptyData,Mn as eraserType,Xo as extraPropertyEventMap,j as getBoundsData,hn as getDescriptor,V as getMatrixData,U as getPointData,Dn as hitType,d as isArray,u as isData,_ as isEmptyData,o as isFinite,r as isNull,a as isNumber,c as isObject,n as isString,i as isUndefined,Nn as layoutProcessor,na as leaferTransformAttrMap,Wn as maskType,wn as naturalBoundsType,Ln as opacityType,Ur as path,bn as pathInputType,Sn as pathType,jr as pen,pn as positionType,Qn as registerUI,Jn as registerUIEvent,Uh as resizeType,Vn as rewrite,Gn as rewriteAble,mn as rotationType,yn as scaleType,gn as scrollType,In as sortType,Rn as strokeType,Pn as surfaceType,$t as tempBounds,wt as tempMatrix,mt as tempPoint,l as tryToNumber,Ch as useCanvas,qn as useModule,Sh as version,On as visibleType,jh as zoomLayerType};
1
+ var t,e;!function(t){t[t.none=1]="none",t[t.free=2]="free",t[t.mirrorAngle=3]="mirrorAngle",t[t.mirror=4]="mirror"}(t||(t={})),function(t){t[t.No=0]="No",t[t.Yes=1]="Yes",t[t.NoAndSkip=2]="NoAndSkip",t[t.YesAndSkip=3]="YesAndSkip"}(e||(e={}));const s={};function i(t){return void 0===t}function r(t){return null==t}function n(t){return"string"==typeof t}const{isFinite:o}=Number;function a(t){return"number"==typeof t}const h=/^-?\d+(?:\.\d+)?$/;function l(t){return"string"==typeof t&&h.test(t)?+t:t}const{isArray:d}=Array;function c(t){return t&&"object"==typeof t}function u(t){return c(t)&&!d(t)}function _(t){return"{}"===JSON.stringify(t)}const p={default:(t,e)=>(g(e,t),g(t,e),t),assign(t,e,s){let i;Object.keys(e).forEach(r=>{var n,o;if(i=e[r],(null==i?void 0:i.constructor)===Object&&(null===(n=t[r])||void 0===n?void 0:n.constructor)===Object)return g(t[r],e[r],s&&s[r]);s&&r in s?(null===(o=s[r])||void 0===o?void 0:o.constructor)===Object&&g(t[r]={},e[r],s[r]):t[r]=e[r]})},copyAttrs:(t,e,s)=>(s.forEach(s=>{i(e[s])||(t[s]=e[s])}),t),clone:t=>JSON.parse(JSON.stringify(t)),toMap(t){const e={};for(let s=0,i=t.length;s<i;s++)e[t[s]]=!0;return e},stintSet(t,e,s){s||(s=void 0),t[e]!==s&&(t[e]=s)}},{assign:g}=p;class f{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(!i(e))return e}return this[t]}__getData(){const t={tag:this.__leaf.tag},{__input:e}=this;let s;for(let r in this)"_"!==r[0]&&(s=e?e[r]:void 0,t[r]=i(s)?this[r]:s);return t}__setInput(t,e){this.__input||(this.__input={}),this.__input[t]=e}__getInput(t){if(this.__input){const e=this.__input[t];if(!i(e))return e}if("path"!==t||this.__pathInputed)return this["_"+t]}__removeInput(t){this.__input&&!i(this.__input[t])&&(this.__input[t]=void 0)}__getInputData(t,e){const s={};if(t)if(d(t))for(let e of t)s[e]=this.__getInput(e);else for(let e in t)s[e]=this.__getInput(e);else{let t,e,{__input:r}=this;s.tag=this.__leaf.tag;for(let n in this)if("_"!==n[0]&&(t=this["_"+n],!i(t))){if("path"===n&&!this.__pathInputed)continue;e=r?r[n]:void 0,s[n]=i(e)?t:e}}if(e&&e.matrix){const{a:t,b:e,c:i,d:r,e:n,f:o}=this.__leaf.__localMatrix;s.matrix={a:t,b:e,c:i,d:r,e:n,f:o}}return s}__setMiddle(t,e){this.__middle||(this.__middle={}),this.__middle[t]=e}__getMiddle(t){return this.__middle&&this.__middle[t]}__checkSingle(){const t=this;if("pass-through"===t.blendMode){const e=this.__leaf;t.opacity<1&&(e.isBranch||t.__hasMultiPaint)||e.__hasEraser||t.eraser||t.filter?t.__single=!0:t.__single&&(t.__single=!1)}else t.__single=!0}__removeNaturalSize(){this.__naturalWidth=this.__naturalHeight=void 0}destroy(){this.__input=this.__middle=null}}const y={RUNTIME:"runtime",LEAF:"leaf",TASK:"task",CNAVAS:"canvas",IMAGE:"image",types:{},create(t){const{types:e}=m;return e[t]?e[t]++:(e[t]=1,0)}},m=y;let x,w,v;const{max:b}=Math,S=[0,0,0,0],k={zero:[...S],tempFour:S,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)=>B(S,t,e,s,i),toTempAB(t,e,s){v=s?a(t)?e:t:[],a(t)?(x=C(t),w=e):a(e)?(x=t,w=C(e)):(x=t,w=e),4!==x.length&&(x=R(x)),4!==w.length&&(w=R(w))},get(t,e){let s;if(!a(t))switch(t.length){case 4:s=i(e)?t:[...t];break;case 2:s=[t[0],t[1],t[0],t[1]];break;case 3:s=[t[0],t[1],t[2],t[1]];break;case 1:t=t[0];break;default:t=0}if(s||(s=[t,t,t,t]),!i(e))for(let t=0;t<4;t++)s[t]>e&&(s[t]=e);return s},max:(t,e,s)=>a(t)&&a(e)?b(t,e):(P(t,e,s),B(v,b(x[0],w[0]),b(x[1],w[1]),b(x[2],w[2]),b(x[3],w[3]))),add:(t,e,s)=>a(t)&&a(e)?t+e:(P(t,e,s),B(v,x[0]+w[0],x[1]+w[1],x[2]+w[2],x[3]+w[3])),swapAndScale(t,e,s,i){if(a(t))return e===s?t*e:[t*s,t*e];const r=i?t:[],[n,o,h,l]=4===t.length?t:R(t);return B(r,h*s,l*e,n*s,o*e)}},{set:B,get:R,setTemp:C,toTempAB:P}=k,{round:T,pow:L,max:O,floor:E,PI:A}=Math,I={within:(t,e,s)=>(c(e)&&(s=e.max,e=e.min),!i(e)&&t<e&&(t=e),!i(s)&&t>s&&(t=s),t),fourNumber:k.get,formatRotation:(t,e)=>(t%=360,e?t<0&&(t+=360):(t>180&&(t-=360),t<-180&&(t+=360)),I.float(t)),getGapRotation(t,e,s=0){let i=t+s;if(e>1){const t=Math.abs(i%e);(t<1||t>e-1)&&(i=Math.round(i/e)*e)}return i-s},float(t,e){const s=i(e)?1e12:L(10,e);return-0===(t=T(t*s)/s)?0:t},sign:t=>t<0?-1:1,getScaleData(t,e,s,i){if(i||(i={}),e){const t=(a(e)?e:e.width||0)/s.width,r=(a(e)?e:e.height||0)/s.height;i.scaleX=t||r||1,i.scaleY=r||t||1}else t&&I.assignScale(i,t);return i},assignScale(t,e){a(e)?t.scaleX=t.scaleY=e:(t.scaleX=e.x,t.scaleY=e.y)},getFloorScale:(t,e=1)=>O(E(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 M=A/180,D=2*A,F=A/2;function z(){return{x:0,y:0}}function N(){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:U,acos:j,sqrt:V}=Math,{float:G}=I,H={};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 Q={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,n=0,o=0){t.a=e,t.b=s,t.c=i,t.d=r,t.e=n,t.f=o},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){J.toInnerPoint(t,e,H),J.scaleOfInner(t,H,s,i)},scaleOfInner(t,e,s,i=s){J.translateInner(t,e.x,e.y),J.scale(t,s,i),J.translateInner(t,-e.x,-e.y)},rotate(t,e){const{a:s,b:i,c:r,d:n}=t,o=U(e*=M),a=X(e);t.a=s*o-i*a,t.b=s*a+i*o,t.c=r*o-n*a,t.d=r*a+n*o},rotateOfOuter(t,e,s){J.toInnerPoint(t,e,H),J.rotateOfInner(t,H,s)},rotateOfInner(t,e,s){J.translateInner(t,e.x,e.y),J.rotate(t,s),J.translateInner(t,-e.x,-e.y)},skew(t,e,s){const{a:i,b:r,c:n,d:o}=t;s&&(s*=M,t.a=i+n*s,t.b=r+o*s),e&&(e*=M,t.c=n+i*e,t.d=o+r*e)},skewOfOuter(t,e,s,i){J.toInnerPoint(t,e,H),J.skewOfInner(t,H,s,i)},skewOfInner(t,e,s,i=0){J.translateInner(t,e.x,e.y),J.skew(t,s,i),J.translateInner(t,-e.x,-e.y)},multiply(t,e){const{a:s,b:i,c:r,d:n,e:o,f:a}=t;t.a=e.a*s+e.b*r,t.b=e.a*i+e.b*n,t.c=e.c*s+e.d*r,t.d=e.c*i+e.d*n,t.e=e.e*s+e.f*r+o,t.f=e.e*i+e.f*n+a},multiplyParent(t,e,s,r,n){const{e:o,f:a}=t;if(s||(s=t),i(r)&&(r=1!==t.a||t.b||t.c||1!==t.d),r){const{a:i,b:r,c:o,d:a}=t;s.a=i*e.a+r*e.c,s.b=i*e.b+r*e.d,s.c=o*e.a+a*e.c,s.d=o*e.b+a*e.d,n&&(s.scaleX=e.scaleX*n.scaleX,s.scaleY=e.scaleY*n.scaleY)}else s.a=e.a,s.b=e.b,s.c=e.c,s.d=e.d,n&&(s.scaleX=e.scaleX,s.scaleY=e.scaleY);s.e=o*e.a+a*e.c+e.e,s.f=o*e.b+a*e.d+e.f},divide(t,e){J.multiply(t,J.tempInvert(e))},divideParent(t,e){J.multiplyParent(t,J.tempInvert(e))},tempInvert(t){const{tempMatrix:e}=J;return J.copy(e,t),J.invert(e),e},invert(t){const{a:e,b:s,c:i,d:r,e:n,f:o}=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=-(n*r-o*i)*a,t.f=-(o*e-n*s)*a}else if(1===e&&1===r)t.e=-n,t.f=-o;else{const s=1/(e*r);t.a=r*s,t.d=e*s,t.e=-n*r*s,t.f=-o*e*s}},toOuterPoint(t,e,s,i){const{x:r,y:n}=e;s||(s=e),s.x=r*t.a+n*t.c,s.y=r*t.b+n*t.d,i||(s.x+=t.e,s.y+=t.f)},toInnerPoint(t,e,s,i){const{a:r,b:n,c:o,d:a}=t,h=1/(r*a-n*o),{x:l,y:d}=e;if(s||(s=e),s.x=(l*a-d*o)*h,s.y=(d*r-l*n)*h,!i){const{e:e,f:i}=t;s.x-=(e*a-i*o)*h,s.y-=(i*r-e*n)*h}},setLayout(t,e,s,r,n){const{x:o,y:a,scaleX:h,scaleY:l}=e;if(i(n)&&(n=e.rotation||e.skewX||e.skewY),n){const{rotation:s,skewX:i,skewY:r}=e,n=s*M,o=U(n),a=X(n);if(i||r){const e=i*M,s=r*M;t.a=(o+s*-a)*h,t.b=(a+s*o)*h,t.c=(e*o-a)*l,t.d=(o+e*a)*l}else t.a=o*h,t.b=a*h,t.c=-a*l,t.d=o*l}else t.a=h,t.b=0,t.c=0,t.d=l;t.e=o,t.f=a,(s=s||r)&&J.translateInner(t,-s.x,-s.y,!r)},getLayout(t,e,s,i){const{a:r,b:n,c:o,d:a,e:h,f:l}=t;let d,c,u,_,p,g=h,f=l;if(n||o){const t=r*a-n*o;if(o&&!i){d=V(r*r+n*n),c=t/d;const e=r/d;u=n>0?j(e):-j(e)}else{c=V(o*o+a*a),d=t/c;const e=o/c;u=F-(a>0?j(-e):-j(e))}const e=G(U(u)),s=X(u);d=G(d),c=G(c),_=e?G((o/c+s)/e/M,9):0,p=e?G((n/d-s)/e/M,9):0,u=G(u/M)}else d=r,c=a,u=_=p=0;return(e=s||e)&&(g+=e.x*r+e.y*o,f+=e.x*n+e.y*a,s||(g-=e.x,f-=e.y)),{x:g,y:f,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:n,d:o}=t;r||n?s=(i*o-r*n)/(e=V(i*i+r*r)):(e=i,s=o)}return i.scaleX=e,i.scaleY=s,i},reset(t){J.set(t)}},J=Q,{float:$}=I,{toInnerPoint:Z,toOuterPoint:K}=Q,{sin:tt,cos:et,abs:st,sqrt:it,atan2:rt,min:nt,round:ot}=Math,at={defaultPoint:{x:0,y:0},tempPoint:{},tempRadiusPoint:{},set(t,e=0,s=0){t.x=e,t.y=s},setRadius(t,e,s){t.radiusX=e,t.radiusY=i(s)?e:s},copy(t,e){t.x=e.x,t.y=e.y},copyFrom(t,e,s){t.x=e,t.y=s},round(t,e){t.x=e?ot(t.x-.5)+.5:ot(t.x),t.y=e?ot(t.y-.5)+.5:ot(t.y)},move(t,e,s){c(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*=M),r=tt(e),n=t.x-s.x,o=t.y-s.y;t.x=s.x+n*i-o*r,t.y=s.y+n*r+o*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},copyRadiusPoint:(t,e,s,i)=>(dt(t,e),ct(t,s,i),t),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),n=st(i-e);return it(r*r+n*n)},getMinDistanceFrom:(t,e,s,i,r,n)=>nt(lt(t,e,s,i),lt(s,i,r,n)),getAngle:(t,e)=>ut(t,e)/M,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)/M),getRadianFrom(t,e,s,r,n,o,a,h){i(a)&&(a=s,h=r);const l=t-s,d=e-r,c=n-a,u=o-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 n=ut(t,e);return r&&(t=e),i||(e={}),e.x=t.x+et(n)*s,e.y=t.y+tt(n)*s,e},toNumberPoints(t){let e=t;return c(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,setRadius:ct,getAtan2:ut}=ht;class _t{constructor(t,e){this.set(t,e)}set(t,e){return c(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 _t(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 _t(at.getCenter(this,t))}getDistance(t){return at.getDistance(this,t)}getDistancePoint(t,e,s,i){return new _t(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 pt=new _t;class gt{constructor(t,e,s,i,r,n){this.set(t,e,s,i,r,n)}set(t,e,s,i,r,n){return c(t)?Q.copy(this,t):Q.set(this,t,e,s,i,r,n),this}setWith(t){return Q.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:n}=this;return{a:t,b:e,c:s,d:i,e:r,f:n}}clone(){return new gt(this)}translate(t,e){return Q.translate(this,t,e),this}translateInner(t,e){return Q.translateInner(this,t,e),this}scale(t,e){return Q.scale(this,t,e),this}scaleWith(t,e){return Q.scale(this,t,e),this.scaleX*=t,this.scaleY*=e||t,this}pixelScale(t){return Q.pixelScale(this,t),this}scaleOfOuter(t,e,s){return Q.scaleOfOuter(this,t,e,s),this}scaleOfInner(t,e,s){return Q.scaleOfInner(this,t,e,s),this}rotate(t){return Q.rotate(this,t),this}rotateOfOuter(t,e){return Q.rotateOfOuter(this,t,e),this}rotateOfInner(t,e){return Q.rotateOfInner(this,t,e),this}skew(t,e){return Q.skew(this,t,e),this}skewOfOuter(t,e,s){return Q.skewOfOuter(this,t,e,s),this}skewOfInner(t,e,s){return Q.skewOfInner(this,t,e,s),this}multiply(t){return Q.multiply(this,t),this}multiplyParent(t){return Q.multiplyParent(this,t),this}divide(t){return Q.divide(this,t),this}divideParent(t){return Q.divideParent(this,t),this}invert(){return Q.invert(this),this}invertWith(){return Q.invert(this),this.scaleX=1/this.scaleX,this.scaleY=1/this.scaleY,this}toOuterPoint(t,e,s){Q.toOuterPoint(this,t,e,s)}toInnerPoint(t,e,s){Q.toInnerPoint(this,t,e,s)}setLayout(t,e,s){return Q.setLayout(this,t,e,s),this}getLayout(t,e,s){return Q.getLayout(this,t,e,s)}withScale(t,e){return Q.withScale(this,t,e)}reset(){Q.reset(this)}}const ft=new gt,yt={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){mt(t,e,s),mt(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:mt}=yt;var xt,wt;!function(t){t[t.top=0]="top",t[t.right=1]="right",t[t.bottom=2]="bottom",t[t.left=3]="left"}(xt||(xt={})),function(t){t[t.topLeft=0]="topLeft",t[t.top=1]="top",t[t.topRight=2]="topRight",t[t.right=3]="right",t[t.bottomRight=4]="bottomRight",t[t.bottom=5]="bottom",t[t.bottomLeft=6]="bottomLeft",t[t.left=7]="left",t[t.center=8]="center",t[t["top-left"]=0]="top-left",t[t["top-right"]=2]="top-right",t[t["bottom-right"]=4]="bottom-right",t[t["bottom-left"]=6]="bottom-left"}(wt||(wt={}));const vt=[{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}];vt.forEach(t=>t.type="percent");const bt={directionData:vt,tempPoint:{},get:St,toPoint(t,e,s,i,r,n){const o=St(t);s.x=o.x,s.y=o.y,"percent"===o.type&&(s.x*=e.width,s.y*=e.height,r&&(n||(s.x-=r.x,s.y-=r.y),o.x&&(s.x-=1===o.x?r.width:.5===o.x?o.x*r.width:0),o.y&&(s.y-=1===o.y?r.height:.5===o.y?o.y*r.height:0))),i||(s.x+=e.x,s.y+=e.y)},getPoint:(t,e,s)=>(s||(s={}),bt.toPoint(t,e,s,!0),s)};function St(t){return n(t)?vt[wt[t]]:t}const{toPoint:kt}=bt,Bt={toPoint(t,e,s,i,r,n){kt(t,s,i,r,e,n)}},{tempPointBounds:Rt,setPoint:Ct,addPoint:Pt,toBounds:Tt}=yt,{toOuterPoint:Lt}=Q,{float:Ot,fourNumber:Et}=I,{floor:At,ceil:It}=Math;let Wt,Mt,Dt,Ft;const zt={},Nt={},Yt={},Xt={tempBounds:Yt,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:n,y:o,width:a,height:h}=e;if(d(s)){const e=Et(s);i?Ut.set(t,n+e[3],o+e[0],a-e[1]-e[3],h-e[2]-e[0]):Ut.set(t,n-e[3],o-e[0],a+e[1]+e[3],h+e[2]+e[0])}else i&&(s=-s),Ut.set(t,n-s,o-s,a+2*s,h+2*s);r&&("width"===r?(t.y=o,t.height=h):(t.x=n,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),Ut.move(t,e,s),t),toOffsetOutBounds(t,e,s){e?Vt(e,t):e=t,s||(s=t),e.offsetX=Ut.maxX(s),e.offsetY=Ut.maxY(s),Ut.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)=>(Ut.copy(Yt,t),Ut.toOuterOf(Yt,e),Yt),getOuterOf:(t,e)=>(t=Object.assign({},t),Ut.toOuterOf(t,e),t),toOuterOf(t,e,s){if(s||(s=t),0===e.b&&0===e.c){const{a:i,d:r,e:n,f:o}=e;i>0?(s.width=t.width*i,s.x=n+t.x*i):(s.width=t.width*-i,s.x=n+t.x*i-s.width),r>0?(s.height=t.height*r,s.y=o+t.y*r):(s.height=t.height*-r,s.y=o+t.y*r-s.height)}else zt.x=t.x,zt.y=t.y,Lt(e,zt,Nt),Ct(Rt,Nt.x,Nt.y),zt.x=t.x+t.width,Lt(e,zt,Nt),Pt(Rt,Nt.x,Nt.y),zt.y=t.y+t.height,Lt(e,zt,Nt),Pt(Rt,Nt.x,Nt.y),zt.x=t.x,Lt(e,zt,Nt),Pt(Rt,Nt.x,Nt.y),Tt(Rt,s)},toInnerOf(t,e,s){s||(s=t),Ut.move(s,-e.e,-e.f),Ut.scale(s,1/e.a,1/e.d)},getFitMatrix(t,e,s=1){const i=Math.min(s,Ut.getFitScale(t,e));return new gt(i,0,0,i,-e.x*i,-e.y*i)},getFitScale(t,e,s){const i=t.width/e.width,r=t.height/e.height;return s?Math.max(i,r):Math.min(i,r)},put(t,e,s="center",i=1,r=!0,o){o||(o=e),n(i)&&(i=Ut.getFitScale(t,e,"cover"===i)),Yt.width=r?e.width*=i:e.width*i,Yt.height=r?e.height*=i:e.height*i,Bt.toPoint(s,Yt,t,o,!0,!0)},getSpread(t,e,s){const i={};return Ut.copyAndSpread(i,t,e,!1,s),i},spread(t,e,s){Ut.copyAndSpread(t,t,e,!1,s)},shrink(t,e,s){Ut.copyAndSpread(t,t,e,!0,s)},ceil(t){const{x:e,y:s}=t;t.x=At(t.x),t.y=At(t.y),t.width=e>t.x?It(t.width+e-t.x):It(t.width),t.height=s>t.y?It(t.height+s-t.y):It(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=Ot(t.x,e),t.y=Ot(t.y,e),t.width=Ot(t.width,e),t.height=Ot(t.height,e)},add(t,e,s){Wt=t.x+t.width,Mt=t.y+t.height,Dt=e.x,Ft=e.y,s||(Dt+=e.width,Ft+=e.height),Wt=Wt>Dt?Wt:Dt,Mt=Mt>Ft?Mt:Ft,t.x=t.x<e.x?t.x:e.x,t.y=t.y<e.y?t.y:e.y,t.width=Wt-t.x,t.height=Mt-t.y},addList(t,e){Ut.setListWithFn(t,e,void 0,!0)},setList(t,e,s=!1){Ut.setListWithFn(t,e,void 0,s)},addListWithFn(t,e,s){Ut.setListWithFn(t,e,s,!0)},setListWithFn(t,e,s,i=!1){let r,n=!0;for(let o=0,a=e.length;o<a;o++)r=s?s(e[o],o):e[o],r&&(r.width||r.height)&&(n?(n=!1,i||Vt(t,r)):jt(t,r));n&&Ut.reset(t)},setPoints(t,e){e.forEach((t,e)=>0===e?Ct(Rt,t.x,t.y):Pt(Rt,t.x,t.y)),Tt(Rt,t)},setPoint(t,e){Ut.set(t,e.x,e.y)},addPoint(t,e){jt(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=Ut.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=Ut.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=Ut.tempToOuterOf(e,s)),!Ut.hit(t,e))return{x:0,y:0,width:0,height:0};let{x:i,y:r,width:n,height:o}=e;return Wt=i+n,Mt=r+o,Dt=t.x+t.width,Ft=t.y+t.height,i=i>t.x?i:t.x,r=r>t.y?r:t.y,Wt=Wt<Dt?Wt:Dt,Mt=Mt<Ft?Mt:Ft,n=Wt-i,o=Mt-r,{x:i,y:r,width:n,height:o}},intersect(t,e,s){Ut.copy(t,Ut.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,hasSize:t=>t.width&&t.height,reset(t){Ut.set(t)}},Ut=Xt,{add:jt,copy:Vt}=Ut;class Gt{get minX(){return Xt.minX(this)}get minY(){return Xt.minY(this)}get maxX(){return Xt.maxX(this)}get maxY(){return Xt.maxY(this)}constructor(t,e,s,i){this.set(t,e,s,i)}set(t,e,s,i){return c(t)?Xt.copy(this,t):Xt.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 Xt.move(this,t,e),this}scale(t,e,s){return Xt.scale(this,t,e,s),this}scaleOf(t,e,s){return Xt.scaleOf(this,t,e,s),this}toOuterOf(t,e){return Xt.toOuterOf(this,t,e),this}toInnerOf(t,e){return Xt.toInnerOf(this,t,e),this}getFitMatrix(t,e){return Xt.getFitMatrix(this,t,e)}put(t,e,s){Xt.put(this,t,e,s)}spread(t,e){return Xt.spread(this,t,e),this}shrink(t,e){return Xt.shrink(this,t,e),this}ceil(){return Xt.ceil(this),this}unsign(){return Xt.unsign(this),this}float(t){return Xt.float(this,t),this}add(t){return Xt.add(this,t),this}addList(t){return Xt.setList(this,t,!0),this}setList(t){return Xt.setList(this,t),this}addListWithFn(t,e){return Xt.setListWithFn(this,t,e,!0),this}setListWithFn(t,e){return Xt.setListWithFn(this,t,e),this}setPoint(t){return Xt.setPoint(this,t),this}setPoints(t){return Xt.setPoints(this,t),this}addPoint(t){return Xt.addPoint(this,t),this}getPoints(){return Xt.getPoints(this)}hitPoint(t,e){return Xt.hitPoint(this,t,e)}hitRadiusPoint(t,e){return Xt.hitRadiusPoint(this,t,e)}hit(t,e){return Xt.hit(this,t,e)}includes(t,e){return Xt.includes(this,t,e)}intersect(t,e){return Xt.intersect(this,t,e),this}getIntersect(t,e){return new Gt(Xt.getIntersectData(this,t,e))}isSame(t){return Xt.isSame(this,t)}isEmpty(){return Xt.isEmpty(this)}reset(){Xt.reset(this)}}const Ht=new Gt;class qt{constructor(t,e,s,i,r,n){c(t)?this.copy(t):this.set(t,e,s,i,r,n)}set(t=0,e=0,s=0,i=0,r=0,n=0){this.top=t,this.right=e,this.bottom=s,this.left=i,this.width=r,this.height=n}copy(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=t;this.set(e,s,i,r,n,o)}getBoundsFrom(t){const{top:e,right:s,bottom:i,left:r,width:n,height:o}=this;return new Gt(r,e,n||t.width-r-s,o||t.height-e-i)}}const Qt={number:(t,e)=>c(t)?"percent"===t.type?t.value*e:t.value:t},Jt={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},{floor:$t,max:Zt}=Math,Kt={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||te.maxCacheSize),isSuperLarge:(t,e,s)=>te.isLarge(t,e,s,te.maxPatternSize),getRealURL(t){const{prefix:e,suffix:s}=te;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,n,o,a,h,l){const d=Zt($t(e+(i||0)),1),c=Zt($t(s+(r||0)),1);let u,_,p;l&&(p=Qt.number(l.offset,(u="x"===l.type)?e:s))&&(u||(_=!0));const g=Kt.origin.createCanvas(_?2*d:d,u?2*c:c),f=g.getContext("2d");if(a&&(f.globalAlpha=a),f.imageSmoothingEnabled=!1!==o,te.canUse(t)){if(n){const i=e/n.width,r=s/n.height;f.setTransform(i,0,0,r,-n.x*i,-n.y*r),f.drawImage(t,0,0,t.width,t.height)}else f.drawImage(t,0,0,e,s);p&&(f.drawImage(g,0,0,d,c,u?p-d:d,u?c:p-c,d,c),f.drawImage(g,0,0,d,c,u?p:d,u?c:p,d,c))}return g},canUse:t=>t&&t.width&&!t.__closed,setPatternTransform(t,e,s){try{e&&t.setTransform&&(t.setTransform(e),e=void 0)}catch(t){}s&&p.stintSet(s,"transform",e)}}},{image:te}=Kt,{randColor:ee}=I;class se{constructor(t){this.repeatMap={},this.name=t}static get(t){return new se(t)}static set filter(t){this.filterList=ie(t)}static set exclude(t){this.excludeList=ie(t)}static drawRepaint(t,e){const s=ee();t.fillWorld(e,s.replace("1)",".1)")),t.strokeWorld(e,s)}static drawBounds(t,e,s){const i="hit"===se.showBounds,r=t.__nowWorld,n=ee();i&&(e.setWorld(r),t.__drawHitPath(e),e.fillStyle=n.replace("1)",".2)"),e.fill()),e.resetTransform(),e.setStroke(n,2),i?e.stroke():e.strokeWorld(r,n)}log(...t){if(re.enable){if(re.filterList.length&&re.filterList.every(t=>t!==this.name))return;if(re.excludeList.length&&re.excludeList.some(t=>t===this.name))return;console.log("%c"+this.name,"color:#21ae62",...t)}}tip(...t){re.enable&&this.warn(...t)}warn(...t){re.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 ie(t){return t?n(t)&&(t=[t]):t=[],t}se.filterList=[],se.excludeList=[],se.showWarn=!0;const re=se,ne=se.get("RunTime"),oe={currentId:0,currentName:"",idMap:{},nameMap:{},nameToIdMap:{},start(t,e){const s=y.create(y.RUNTIME);return ae.currentId=ae.idMap[s]=e?performance.now():Date.now(),ae.currentName=ae.nameMap[s]=t,ae.nameToIdMap[t]=s,s},end(t,e){const s=ae.idMap[t],i=ae.nameMap[t],r=e?(performance.now()-s)/1e3:Date.now()-s;ae.idMap[t]=ae.nameMap[t]=ae.nameToIdMap[i]=void 0,ne.log(i,r,"ms")},endOfName(t,e){const s=ae.nameToIdMap[t];i(s)||ae.end(s,e)}},ae=oe,he=[],le={list:{},add(t,...e){this.list[t]=!0,he.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(()=>he.forEach(t=>le.has(t,!0)));const de={editor:t=>le.need("editor")},ce=se.get("UICreator"),ue={list:{},register(t){const{__tag:e}=t.prototype;_e[e]&&ce.repeat(e),_e[e]=t},get(t,e,s,r,n,o){_e[t]||ce.error("not register "+t);const a=new _e[t](e);return i(s)||(a.x=s,r&&(a.y=r),n&&(a.width=n),o&&(a.height=o)),a}},{list:_e}=ue,pe=se.get("EventCreator"),ge={nameList:{},register(t){let e;Object.keys(t).forEach(s=>{e=t[s],n(e)&&(fe[e]&&pe.repeat(e),fe[e]=t)})},changeName(t,e){const s=fe[t];if(s){const i=Object.keys(s).find(e=>s[e]===t);i&&(s[i]=e,fe[e]=s)}},has(t){return!!this.nameList[t]},get:(t,...e)=>new fe[t](...e)},{nameList:fe}=ge;class ye{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=de.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 me(t,e,s,i){var r,n=arguments.length,o=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(t,e,s,i);else for(var a=t.length-1;a>=0;a--)(r=t[a])&&(o=(n<3?r(o):n>3?r(e,s,o):r(e,s))||o);return n>3&&o&&Object.defineProperty(e,s,o),o}function xe(t,e,s,i){return new(s||(s=Promise))(function(r,n){function o(t){try{h(i.next(t))}catch(t){n(t)}}function a(t){try{h(i.throw(t))}catch(t){n(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(o,a)}h((i=i.apply(t,e||[])).next())})}function we(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 ve=[];function be(){return(t,e)=>{ve.push(e)}}const Se=[];let ke=class{set blendMode(t){"normal"===t&&(t="source-over"),this.context.globalCompositeOperation=t}get blendMode(){return this.context.globalCompositeOperation}set dashPattern(t){this.context.setLineDash(t||Se)}get dashPattern(){return this.context.getLineDash()}__bindContext(){let t;ve.forEach(e=>{t=this.context[e],t&&(this[e]=t.bind(this.context))}),this.textBaseline="alphabetic"}setTransform(t,e,s,i,r,n){}resetTransform(){}getTransform(){}save(){}restore(){}transform(t,e,s,i,r,n){c(t)?this.context.transform(t.a,t.b,t.c,t.d,t.e,t.f):this.context.transform(t,e,s,i,r,n)}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,n,o,a,h){switch(arguments.length){case 9:if(e<0){const t=-e/i*a;i+=e,e=0,n+=t,a-=t}if(s<0){const t=-s/r*h;r+=s,s=0,o+=t,h-=t}this.context.drawImage(t,e,s,i,r,n,o,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,n){}quadraticCurveTo(t,e,s,i){}closePath(){}arc(t,e,s,i,r,n){}arcTo(t,e,s,i,r){}ellipse(t,e,s,i,r,n,o,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,n){}fillText(t,e,s,i){}measureText(t){}strokeText(t,e,s,i){}destroy(){this.context=null}};me([we("imageSmoothingEnabled")],ke.prototype,"smooth",void 0),me([we("imageSmoothingQuality")],ke.prototype,"smoothLevel",void 0),me([we("globalAlpha")],ke.prototype,"opacity",void 0),me([we()],ke.prototype,"fillStyle",void 0),me([we()],ke.prototype,"strokeStyle",void 0),me([we("lineWidth")],ke.prototype,"strokeWidth",void 0),me([we("lineCap")],ke.prototype,"strokeCap",void 0),me([we("lineJoin")],ke.prototype,"strokeJoin",void 0),me([we("lineDashOffset")],ke.prototype,"dashOffset",void 0),me([we()],ke.prototype,"miterLimit",void 0),me([we()],ke.prototype,"shadowBlur",void 0),me([we()],ke.prototype,"shadowColor",void 0),me([we()],ke.prototype,"shadowOffsetX",void 0),me([we()],ke.prototype,"shadowOffsetY",void 0),me([we()],ke.prototype,"filter",void 0),me([we()],ke.prototype,"font",void 0),me([we()],ke.prototype,"fontKerning",void 0),me([we()],ke.prototype,"fontStretch",void 0),me([we()],ke.prototype,"fontVariantCaps",void 0),me([we()],ke.prototype,"textAlign",void 0),me([we()],ke.prototype,"textBaseline",void 0),me([we()],ke.prototype,"textRendering",void 0),me([we()],ke.prototype,"wordSpacing",void 0),me([we()],ke.prototype,"letterSpacing",void 0),me([we()],ke.prototype,"direction",void 0),me([be()],ke.prototype,"setTransform",null),me([be()],ke.prototype,"resetTransform",null),me([be()],ke.prototype,"getTransform",null),me([be()],ke.prototype,"save",null),me([be()],ke.prototype,"restore",null),me([be()],ke.prototype,"translate",null),me([be()],ke.prototype,"scale",null),me([be()],ke.prototype,"rotate",null),me([be()],ke.prototype,"fill",null),me([be()],ke.prototype,"stroke",null),me([be()],ke.prototype,"clip",null),me([be()],ke.prototype,"fillRect",null),me([be()],ke.prototype,"strokeRect",null),me([be()],ke.prototype,"clearRect",null),me([be()],ke.prototype,"beginPath",null),me([be()],ke.prototype,"moveTo",null),me([be()],ke.prototype,"lineTo",null),me([be()],ke.prototype,"bezierCurveTo",null),me([be()],ke.prototype,"quadraticCurveTo",null),me([be()],ke.prototype,"closePath",null),me([be()],ke.prototype,"arc",null),me([be()],ke.prototype,"arcTo",null),me([be()],ke.prototype,"ellipse",null),me([be()],ke.prototype,"rect",null),me([be()],ke.prototype,"roundRect",null),me([be()],ke.prototype,"createConicGradient",null),me([be()],ke.prototype,"createLinearGradient",null),me([be()],ke.prototype,"createPattern",null),me([be()],ke.prototype,"createRadialGradient",null),me([be()],ke.prototype,"fillText",null),me([be()],ke.prototype,"measureText",null),me([be()],ke.prototype,"strokeText",null);const{copy:Be,multiplyParent:Re,pixelScale:Ce}=Q,{round:Pe}=Math,Te=new Gt,Le=new Gt,Oe={width:1,height:1,pixelRatio:1},Ee=["width","height","pixelRatio"];class Ae extends ke{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=Oe),this.manager=e,this.innerId=y.create(y.CNAVAS);const{width:s,height:i,pixelRatio:r}=t;this.autoLayout=!s||!i,this.size.pixelRatio=r||Kt.devicePixelRatio,this.config=t,this.init()}init(){}__createContext(){const{view:t}=this,{contextSettings:e}=this.config;this.context=e?t.getContext("2d",e):t.getContext("2d"),this.__bindContext()}export(t,e){}toBlob(t,e){}toDataURL(t,e){}saveAs(t,e){}resize(t,e=!0){if(this.isSameSize(t))return;let s;this.context&&!this.unreal&&e&&this.width&&(s=this.getSameCanvas(),s.copyWorld(this));const i=this.size;p.copyAttrs(i,t,Ee),Ee.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&&Re(t,e,r),Ce(t,s,r),i&&!t.ignorePixelSnap&&(t.half&&t.half*s%2?(r.e=Pe(r.e-.5)+.5,r.f=Pe(r.f-.5)+.5):(r.e=Pe(r.e),r.f=Pe(r.f))),this.setTransform(r.a,r.b,r.c,r.d,r.e,r.f)}useWorldTransform(t){t&&(this.worldTransform=t);const e=this.worldTransform;e&&this.setTransform(e.a,e.b,e.c,e.d,e.e,e.f)}setStroke(t,e,s,i){e&&(this.strokeWidth=e),t&&(this.strokeStyle=t),s&&this.setStrokeOptions(s,i)}setStrokeOptions(t,e){let{strokeCap:s,strokeJoin:r,dashPattern:n,dashOffset:o,miterLimit:a}=t;e&&(e.strokeCap&&(s=e.strokeCap),e.strokeJoin&&(r=e.strokeJoin),i(e.dashPattern)||(n=e.dashPattern),i(e.dashOffset)||(o=e.dashOffset),e.miterLimit&&(a=e.miterLimit)),this.strokeCap=s,this.strokeJoin=r,this.dashPattern=n,this.dashOffset=o,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){i&&(this.blendMode=i),e?(this.setTempPixelBounds(e,r),s?(this.setTempPixelBounds2(s,r),s=Le):s=Te,this.drawImage(t.view,Te.x,Te.y,Te.width,Te.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){e.b||e.c?(this.save(),this.resetTransform(),this.copyWorld(t,e,Xt.tempToOuterOf(s,e),i,r),this.restore()):(i&&(this.blendMode=i),this.setTempPixelBounds(e,r),this.drawImage(t.view,Te.x,Te.y,Te.width,Te.height,s.x,s.y,s.width,s.height),i&&(this.blendMode="source-over"))}copyWorldByReset(t,e,s,i,r,n){this.resetTransform(),this.copyWorld(t,e,s,i,n),r||this.useWorldTransform()}useGrayscaleAlpha(t){let e,s;this.setTempPixelBounds(t,!0,!0);const{context:i}=this,r=i.getImageData(Te.x,Te.y,Te.width,Te.height),{data:n}=r;for(let t=0,i=n.length;t<i;t+=4)s=.299*n[t]+.587*n[t+1]+.114*n[t+2],(e=n[t+3])&&(n[t+3]=255===e?s:e*(s/255));i.putImageData(r,Te.x,Te.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(Te.x,Te.y,Te.width,Te.height),s&&(this.blendMode="source-over")}strokeWorld(t,e,s,i){s&&(this.blendMode=s),this.strokeStyle=e,this.setTempPixelBounds(t,i),this.strokeRect(Te.x,Te.y,Te.width,Te.height),s&&(this.blendMode="source-over")}clipWorld(t,e=!0){this.beginPath(),this.setTempPixelBounds(t,e),this.rect(Te.x,Te.y,Te.width,Te.height),this.clip()}clipUI(t){t.windingRule?this.clip(t.windingRule):this.clip()}clearWorld(t,e=!0){this.setTempPixelBounds(t,e),this.clearRect(Te.x,Te.y,Te.width,Te.height)}clear(){const{pixelRatio:t}=this;this.clearRect(0,0,this.width*t+2,this.height*t+2)}setTempPixelBounds(t,e,s){this.copyToPixelBounds(Te,t,e,s)}setTempPixelBounds2(t,e,s){this.copyToPixelBounds(Le,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):de.canvas(Object.assign({},s));return r.save(),t&&(Be(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 Ie={creator:{},parse(t,e){},convertToCanvasData(t,e){}},We={N:21,D:22,X:23,G:24,F:25,O:26,P:27,U:28},Me=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},We),De={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},Fe={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},ze=Object.assign(Object.assign({},Fe),We),Ne=Me,Ye={};for(let t in Ne)Ye[Ne[t]]=t;const Xe={};for(let t in Ne)Xe[Ne[t]]=De[t];const Ue={drawRoundRect(t,e,s,i,r,n){const o=I.fourNumber(n,Math.min(i/2,r/2)),a=e+i,h=s+r;o[0]?t.moveTo(e+o[0],s):t.moveTo(e,s),o[1]?t.arcTo(a,s,a,h,o[1]):t.lineTo(a,s),o[2]?t.arcTo(a,h,e,h,o[2]):t.lineTo(a,h),o[3]?t.arcTo(e,h,e,s,o[3]):t.lineTo(e,h),o[0]?t.arcTo(e,s,a,s,o[0]):t.lineTo(e,s)}},{sin:je,cos:Ve,hypot:Ge,atan2:He,ceil:qe,abs:Qe,PI:Je,sqrt:$e,pow:Ze}=Math,{setPoint:Ke,addPoint:ts}=yt,{set:es,toNumberPoints:ss}=at,{M:is,L:rs,C:ns,Q:os,Z:as}=Me,hs={},ls={points(t,e,s,i){let r=ss(e);if(t.push(is,r[0],r[1]),s&&r.length>5){let e,n,o,a,h,l,d,c,u,_,p,g,f,y,m,x=r.length;const w=!0===s?.5:s;i&&(r=[r[x-2],r[x-1],...r,r[0],r[1],r[2],r[3]],x=r.length);for(let s=2;s<x-2;s+=2)e=r[s-2],n=r[s-1],o=r[s],a=r[s+1],h=r[s+2],l=r[s+3],p=o-e,g=a-n,f=$e(Ze(p,2)+Ze(g,2)),y=$e(Ze(h-o,2)+Ze(l-a,2)),(f||y)&&(m=f+y,f=w*f/m,y=w*y/m,h-=e,l-=n,d=o-f*h,c=a-f*l,2===s?i||t.push(os,d,c,o,a):(p||g)&&t.push(ns,u,_,d,c,o,a),u=o+y*h,_=a+y*l);i||t.push(os,u,_,r[x-2],r[x-1])}else for(let e=2,s=r.length;e<s;e+=2)t.push(rs,r[e],r[e+1]);i&&t.push(as)},rect(t,e,s,i,r){Ie.creator.path=t,Ie.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,n){Ie.creator.path=[],Ue.drawRoundRect(Ie.creator,e,s,i,r,n),t.push(...Ie.convertToCanvasData(Ie.creator.path,!0))},arcTo(t,e,s,i,r,n,o,a,h,l,d){const c=i-e,u=r-s,_=n-i,p=o-r;let g=He(u,c),f=He(p,_);const y=Ge(c,u),m=Ge(_,p);let x=f-g;if(x<0&&(x+=D),y<1e-12||m<1e-12||x<1e-12||Qe(x-Je)<1e-12)return t&&t.push(rs,i,r),h&&(Ke(h,e,s),ts(h,i,r)),d&&es(d,e,s),void(l&&es(l,i,r));const w=c*p-_*u<0,v=w?-1:1,b=a/Ve(x/2),S=i+b*Ve(g+x/2+F*v),k=r+b*je(g+x/2+F*v);return g-=F*v,f-=F*v,us(t,S,k,a,a,0,g/M,f/M,w,h,l,d)},arc:(t,e,s,i,r,n,o,a,h,l)=>us(t,e,s,i,i,0,r,n,o,a,h,l),ellipse(t,e,s,i,r,n,o,a,h,l,d,c){const u=n*M,_=je(u),p=Ve(u);let g=o*M,f=a*M;g>Je&&(g-=D),f<0&&(f+=D);let y=f-g;y<0?y+=D:y>D&&(y-=D),h&&(y-=D);const m=qe(Qe(y/F)),x=y/m,w=je(x/4),v=8/3*w*w/je(x/2);f=g+x;let b,S,k,B,R,C,P,T,L=Ve(g),O=je(g),E=k=p*i*L-_*r*O,A=B=_*i*L+p*r*O,I=e+k,W=s+B;t&&t.push(t.length?rs:is,I,W),l&&Ke(l,I,W),c&&es(c,I,W);for(let n=0;n<m;n++)b=Ve(f),S=je(f),k=p*i*b-_*r*S,B=_*i*b+p*r*S,R=e+E-v*(p*i*O+_*r*L),C=s+A-v*(_*i*O-p*r*L),P=e+k+v*(p*i*S+_*r*b),T=s+B+v*(_*i*S-p*r*b),t&&t.push(ns,R,C,P,T,e+k,s+B),l&&cs(e+E,s+A,R,C,P,T,e+k,s+B,l,!0),E=k,A=B,L=b,O=S,g=f,f+=x;d&&es(d,e+k,s+B)},quadraticCurveTo(t,e,s,i,r,n,o){t.push(ns,(e+2*i)/3,(s+2*r)/3,(n+2*i)/3,(o+2*r)/3,n,o)},toTwoPointBoundsByQuadraticCurve(t,e,s,i,r,n,o,a){cs(t,e,(t+2*s)/3,(e+2*i)/3,(r+2*s)/3,(n+2*i)/3,r,n,o,a)},toTwoPointBounds(t,e,s,i,r,n,o,a,h,l){const d=[];let c,u,_,p,g,f,y,m,x=t,w=s,v=r,b=o;for(let t=0;t<2;++t)if(1==t&&(x=e,w=i,v=n,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||(g=(-u+m)/(2*c),0<g&&g<1&&d.push(g),f=(-u-m)/(2*c),0<f&&f<1&&d.push(f));l?ts(h,t,e):Ke(h,t,e),ts(h,o,a);for(let l=0,c=d.length;l<c;l++)ds(d[l],t,e,s,i,r,n,o,a,hs),ts(h,hs.x,hs.y)},getPointAndSet(t,e,s,i,r,n,o,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+_*n+p*a,l.y=c*s+u*r+_*o+p*h},getPoint(t,e,s,i,r,n,o,a,h){const l={};return ds(t,e,s,i,r,n,o,a,h,l),l},getDerivative(t,e,s,i,r){const n=1-t;return 3*n*n*(s-e)+6*n*t*(i-s)+3*t*t*(r-i)}},{getPointAndSet:ds,toTwoPointBounds:cs,ellipse:us}=ls,{sin:_s,cos:ps,sqrt:gs,atan2:fs}=Math,{ellipse:ys}=ls,ms={ellipticalArc(t,e,s,i,r,n,o,a,h,l,d){const c=(h-e)/2,u=(l-s)/2,_=n*M,p=_s(_),g=ps(_),f=-g*c-p*u,y=-g*u+p*c,m=i*i,x=r*r,w=y*y,v=f*f,b=m*x-m*w-x*v;let S=0;if(b<0){const t=gs(1-b/(m*x));i*=t,r*=t}else S=(o===a?-1:1)*gs(b/(m*w+x*v));const k=S*i*y/r,B=-S*r*f/i,R=fs((y-B)/r,(f-k)/i),C=fs((-y-B)/r,(-f-k)/i);let P=C-R;0===a&&P>0?P-=D:1===a&&P<0&&(P+=D);const T=e+c+g*k-p*B,L=s+u+p*k+g*B,O=P<0?1:0;d||Kt.ellipseToCurve?ys(t,T,L,i,r,n,R/M,C/M,O):i!==r||n?t.push(Me.G,T,L,i,r,n,R/M,C/M,O):t.push(Me.O,T,L,i,R/M,C/M,O)}},xs={toCommand:t=>[],toNode:t=>[]},{M:ws,m:vs,L:bs,l:Ss,H:ks,h:Bs,V:Rs,v:Cs,C:Ps,c:Ts,S:Ls,s:Os,Q:Es,q:As,T:Is,t:Ws,A:Ms,a:Ds,Z:Fs,z:zs,N:Ns,D:Ys,X:Xs,G:Us,F:js,O:Vs,P:Gs,U:Hs}=Me,{rect:qs,roundRect:Qs,arcTo:Js,arc:$s,ellipse:Zs,quadraticCurveTo:Ks}=ls,{ellipticalArc:ti}=ms,ei=se.get("PathConvert"),si={},ii={current:{dot:0},stringify(t,e){let s,i,r,n=0,o=t.length,a="";for(;n<o;){i=t[n],s=Xe[i],a+=i===r?" ":Ye[i];for(let i=1;i<s;i++)a+=I.float(t[n+i],e),i===s-1||(a+=" ");r=i,n+=s}return a},parse(t,e){let s,i,r,n="";const o=[],a=e?ze:Fe;for(let e=0,h=t.length;e<h;e++)i=t[e],Jt[i]?("."===i&&(ri.dot&&(ni(o,n),n=""),ri.dot++),"0"===n&&"."!==i&&(ni(o,n),n=""),n+=i):Me[i]?(n&&(ni(o,n),n=""),ri.name=Me[i],ri.length=De[i],ri.index=0,ni(o,ri.name),!s&&a[i]&&(s=!0)):"-"===i||"+"===i?"e"===r||"E"===r?n+=i:(n&&ni(o,n),n=i):n&&(ni(o,n),n=""),r=i;return n&&ni(o,n),s?ii.toCanvasData(o,e):o},toCanvasData(t,e){let s,i,r,n,o,a=0,h=0,l=0,d=0,c=0,u=t.length;const _=[];for(;c<u;){switch(r=t[c],r){case vs:t[c+1]+=a,t[c+2]+=h;case ws:a=t[c+1],h=t[c+2],_.push(ws,a,h),c+=3;break;case Bs:t[c+1]+=a;case ks:a=t[c+1],_.push(bs,a,h),c+=2;break;case Cs:t[c+1]+=h;case Rs:h=t[c+1],_.push(bs,a,h),c+=2;break;case Ss:t[c+1]+=a,t[c+2]+=h;case bs:a=t[c+1],h=t[c+2],_.push(bs,a,h),c+=3;break;case Os:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Ls;case Ls:o=n===Ps||n===Ls,l=o?2*a-s:t[c+1],d=o?2*h-i:t[c+2],s=t[c+1],i=t[c+2],a=t[c+3],h=t[c+4],_.push(Ps,l,d,s,i,a,h),c+=5;break;case Ts: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=Ps;case Ps:s=t[c+3],i=t[c+4],a=t[c+5],h=t[c+6],_.push(Ps,t[c+1],t[c+2],s,i,a,h),c+=7;break;case Ws:t[c+1]+=a,t[c+2]+=h,r=Is;case Is:o=n===Es||n===Is,s=o?2*a-s:t[c+1],i=o?2*h-i:t[c+2],e?Ks(_,a,h,s,i,t[c+1],t[c+2]):_.push(Es,s,i,t[c+1],t[c+2]),a=t[c+1],h=t[c+2],c+=3;break;case As:t[c+1]+=a,t[c+2]+=h,t[c+3]+=a,t[c+4]+=h,r=Es;case Es:s=t[c+1],i=t[c+2],e?Ks(_,a,h,s,i,t[c+3],t[c+4]):_.push(Es,s,i,t[c+3],t[c+4]),a=t[c+3],h=t[c+4],c+=5;break;case Ds:t[c+6]+=a,t[c+7]+=h;case Ms:ti(_,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 zs:case Fs:_.push(Fs),c++;break;case Ns:a=t[c+1],h=t[c+2],e?qs(_,a,h,t[c+3],t[c+4]):oi(_,t,c,5),c+=5;break;case Ys:a=t[c+1],h=t[c+2],e?Qs(_,a,h,t[c+3],t[c+4],[t[c+5],t[c+6],t[c+7],t[c+8]]):oi(_,t,c,9),c+=9;break;case Xs:a=t[c+1],h=t[c+2],e?Qs(_,a,h,t[c+3],t[c+4],t[c+5]):oi(_,t,c,6),c+=6;break;case Us:Zs(e?_:oi(_,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,si),a=si.x,h=si.y,c+=9;break;case js:e?Zs(_,t[c+1],t[c+2],t[c+3],t[c+4],0,0,360,!1):oi(_,t,c,5),a=t[c+1]+t[c+3],h=t[c+2],c+=5;break;case Vs:$s(e?_:oi(_,t,c,7),t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],t[c+6],null,si),a=si.x,h=si.y,c+=7;break;case Gs:e?$s(_,t[c+1],t[c+2],t[c+3],0,360,!1):oi(_,t,c,4),a=t[c+1]+t[c+3],h=t[c+2],c+=4;break;case Hs:Js(e?_:oi(_,t,c,6),a,h,t[c+1],t[c+2],t[c+3],t[c+4],t[c+5],null,si),a=si.x,h=si.y,c+=6;break;default:return ei.error(`command: ${r} [index:${c}]`,t),_}n=r}return _},objectToCanvasData(t){if(t[0].name.length>1)return xs.toCommand(t);{const e=[];return t.forEach(t=>{switch(t.name){case"M":e.push(ws,t.x,t.y);break;case"L":e.push(bs,t.x,t.y);break;case"C":e.push(Ps,t.x1,t.y1,t.x2,t.y2,t.x,t.y);break;case"Q":e.push(Es,t.x1,t.y1,t.x,t.y);break;case"Z":e.push(Fs)}}),e}},copyData(t,e,s,i){for(let r=s,n=s+i;r<n;r++)t.push(e[r])},pushData(t,e){ri.index===ri.length&&(ri.index=1,t.push(ri.name)),t.push(Number(e)),ri.index++,ri.dot=0}},{current:ri,pushData:ni,copyData:oi}=ii,{M:ai,L:hi,C:li,Q:di,Z:ci,N:ui,D:_i,X:pi,G:gi,F:fi,O:yi,P:mi,U:xi}=Me,{getMinDistanceFrom:wi,getRadianFrom:vi}=at,{tan:bi,min:Si,abs:ki}=Math,Bi={},Ri={beginPath(t){t.length=0},moveTo(t,e,s){t.push(ai,e,s)},lineTo(t,e,s){t.push(hi,e,s)},bezierCurveTo(t,e,s,i,r,n,o){t.push(li,e,s,i,r,n,o)},quadraticCurveTo(t,e,s,i,r){t.push(di,e,s,i,r)},closePath(t){t.push(ci)},rect(t,e,s,i,r){t.push(ui,e,s,i,r)},roundRect(t,e,s,i,r,n){if(a(n))t.push(pi,e,s,i,r,n);else{const o=I.fourNumber(n);o?t.push(_i,e,s,i,r,...o):t.push(ui,e,s,i,r)}},ellipse(t,e,s,i,n,o,a,h,l){if(i===n)return Pi(t,e,s,i,a,h,l);r(o)?t.push(fi,e,s,i,n):(r(a)&&(a=0),r(h)&&(h=360),t.push(gi,e,s,i,n,o,a,h,l?1:0))},arc(t,e,s,i,n,o,a){r(n)?t.push(mi,e,s,i):(r(n)&&(n=0),r(o)&&(o=360),t.push(yi,e,s,i,n,o,a?1:0))},arcTo(t,e,s,r,n,o,a,h){if(!i(a)){const t=wi(a,h,e,s,r,n);o=Si(o,Si(t/2,t/2*ki(bi(vi(a,h,e,s,r,n)/2))))}t.push(xi,e,s,r,n,o)},drawEllipse(t,e,s,i,n,o,a,h,l){ls.ellipse(null,e,s,i,n,r(o)?0:o,r(a)?0:a,r(h)?360:h,l,null,null,Bi),t.push(ai,Bi.x,Bi.y),Ci(t,e,s,i,n,o,a,h,l)},drawArc(t,e,s,i,n,o,a){ls.arc(null,e,s,i,r(n)?0:n,r(o)?360:o,a,null,null,Bi),t.push(ai,Bi.x,Bi.y),Pi(t,e,s,i,n,o,a)},drawPoints(t,e,s,i){ls.points(t,e,s,i)}},{ellipse:Ci,arc:Pi}=Ri,{moveTo:Ti,lineTo:Li,quadraticCurveTo:Oi,bezierCurveTo:Ei,closePath:Ai,beginPath:Ii,rect:Wi,roundRect:Mi,ellipse:Di,arc:Fi,arcTo:zi,drawEllipse:Ni,drawArc:Yi,drawPoints:Xi}=Ri;class Ui{set path(t){this.__path=t}get path(){return this.__path}constructor(t){this.set(t)}set(t){return this.__path=t?n(t)?Ie.parse(t):t:[],this}beginPath(){return Ii(this.__path),this.paint(),this}moveTo(t,e){return Ti(this.__path,t,e),this.paint(),this}lineTo(t,e){return Li(this.__path,t,e),this.paint(),this}bezierCurveTo(t,e,s,i,r,n){return Ei(this.__path,t,e,s,i,r,n),this.paint(),this}quadraticCurveTo(t,e,s,i){return Oi(this.__path,t,e,s,i),this.paint(),this}closePath(){return Ai(this.__path),this.paint(),this}rect(t,e,s,i){return Wi(this.__path,t,e,s,i),this.paint(),this}roundRect(t,e,s,i,r){return Mi(this.__path,t,e,s,i,r),this.paint(),this}ellipse(t,e,s,i,r,n,o,a){return Di(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}arc(t,e,s,i,r,n){return Fi(this.__path,t,e,s,i,r,n),this.paint(),this}arcTo(t,e,s,i,r){return zi(this.__path,t,e,s,i,r),this.paint(),this}drawEllipse(t,e,s,i,r,n,o,a){return Ni(this.__path,t,e,s,i,r,n,o,a),this.paint(),this}drawArc(t,e,s,i,r,n){return Yi(this.__path,t,e,s,i,r,n),this.paint(),this}drawPoints(t,e,s){return Xi(this.__path,t,e,s),this.paint(),this}clearPath(){return this.beginPath()}paint(){}}const{M:ji,L:Vi,C:Gi,Q:Hi,Z:qi,N:Qi,D:Ji,X:$i,G:Zi,F:Ki,O:tr,P:er,U:sr}=Me,ir=se.get("PathDrawer"),rr={drawPathByData(t,e){if(!e)return;let s,i=0,r=e.length;for(;i<r;)switch(s=e[i],s){case ji:t.moveTo(e[i+1],e[i+2]),i+=3;break;case Vi:t.lineTo(e[i+1],e[i+2]),i+=3;break;case Gi:t.bezierCurveTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5],e[i+6]),i+=7;break;case Hi:t.quadraticCurveTo(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case qi:t.closePath(),i+=1;break;case Qi:t.rect(e[i+1],e[i+2],e[i+3],e[i+4]),i+=5;break;case Ji: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 $i:t.roundRect(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;case Zi:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]*M,e[i+6]*M,e[i+7]*M,e[i+8]),i+=9;break;case Ki:t.ellipse(e[i+1],e[i+2],e[i+3],e[i+4],0,0,D,!1),i+=5;break;case tr:t.arc(e[i+1],e[i+2],e[i+3],e[i+4]*M,e[i+5]*M,e[i+6]),i+=7;break;case er:t.arc(e[i+1],e[i+2],e[i+3],0,D,!1),i+=4;break;case sr:t.arcTo(e[i+1],e[i+2],e[i+3],e[i+4],e[i+5]),i+=6;break;default:return void ir.error(`command: ${s} [index:${i}]`,e)}}},{M:nr,L:or,C:ar,Q:hr,Z:lr,N:dr,D:cr,X:ur,G:_r,F:pr,O:gr,P:fr,U:yr}=Me,{toTwoPointBounds:mr,toTwoPointBoundsByQuadraticCurve:xr,arcTo:wr,arc:vr,ellipse:br}=ls,{addPointBounds:Sr,copy:kr,addPoint:Br,setPoint:Rr,addBounds:Cr,toBounds:Pr}=yt,Tr=se.get("PathBounds");let Lr,Or,Er;const Ar={},Ir={},Wr={},Mr={toBounds(t,e){Mr.toTwoPointBounds(t,Ir),Pr(Ir,e)},toTwoPointBounds(t,e){if(!t||!t.length)return Rr(e,0,0);let s,i,r,n,o,a=0,h=0,l=0;const d=t.length;for(;a<d;)switch(o=t[a],0===a&&(o===lr||o===ar||o===hr?Rr(e,h,l):Rr(e,t[a+1],t[a+2])),o){case nr:case or:h=t[a+1],l=t[a+2],Br(e,h,l),a+=3;break;case ar:r=t[a+5],n=t[a+6],mr(h,l,t[a+1],t[a+2],t[a+3],t[a+4],r,n,Ar),Sr(e,Ar),h=r,l=n,a+=7;break;case hr:s=t[a+1],i=t[a+2],r=t[a+3],n=t[a+4],xr(h,l,s,i,r,n,Ar),Sr(e,Ar),h=r,l=n,a+=5;break;case lr:a+=1;break;case dr:h=t[a+1],l=t[a+2],Cr(e,h,l,t[a+3],t[a+4]),a+=5;break;case cr:case ur:h=t[a+1],l=t[a+2],Cr(e,h,l,t[a+3],t[a+4]),a+=o===cr?9:6;break;case _r:br(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],t[a+7],t[a+8],Ar,Wr),0===a?kr(e,Ar):Sr(e,Ar),h=Wr.x,l=Wr.y,a+=9;break;case pr:h=t[a+1],l=t[a+2],Or=t[a+3],Er=t[a+4],Cr(e,h-Or,l-Er,2*Or,2*Er),h+=Or,a+=5;break;case gr:vr(null,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],t[a+6],Ar,Wr),0===a?kr(e,Ar):Sr(e,Ar),h=Wr.x,l=Wr.y,a+=7;break;case fr:h=t[a+1],l=t[a+2],Lr=t[a+3],Cr(e,h-Lr,l-Lr,2*Lr,2*Lr),h+=Lr,a+=4;break;case yr:wr(null,h,l,t[a+1],t[a+2],t[a+3],t[a+4],t[a+5],Ar,Wr),0===a?kr(e,Ar):Sr(e,Ar),h=Wr.x,l=Wr.y,a+=6;break;default:return void Tr.error(`command: ${o} [index:${a}]`,t)}}},{M:Dr,L:Fr,Z:zr}=Me,{getCenterX:Nr,getCenterY:Yr}=at,{arcTo:Xr}=Ri,Ur={smooth(t,e,s){let i,r,n,o=0,a=0,h=0,l=0,c=0,u=0,_=0,p=0,g=0;d(e)&&(e=e[0]||0);const f=t.length,y=[];for(;o<f;){switch(i=t[o],i){case Dr:l=p=t[o+1],c=g=t[o+2],o+=3,t[o]===Fr?(u=t[o+1],_=t[o+2],y.push(Dr,Nr(l,u),Yr(c,_))):y.push(Dr,l,c);break;case Fr:switch(a=t[o+1],h=t[o+2],o+=3,t[o]){case Fr:Xr(y,a,h,t[o+1],t[o+2],e,p,g);break;case zr:Xr(y,a,h,l,c,e,p,g);break;default:y.push(Fr,a,h)}p=a,g=h;break;case zr:r!==zr&&(Xr(y,l,c,u,_,e,p,g),y.push(zr)),o+=1;break;default:n=Xe[i];for(let e=0;e<n;e++)y.push(t[o+e]);o+=n}r=i}return i!==zr&&(y[1]=l,y[2]=c),y}};function jr(t){return new Ui(t)}const Vr=jr();Ie.creator=jr(),Ie.parse=ii.parse,Ie.convertToCanvasData=ii.toCanvasData;const{drawRoundRect:Gr}=Ue;function Hr(t){!function(t){t&&!t.roundRect&&(t.roundRect=function(t,e,s,i,r){Gr(this,t,e,s,i,r)})}(t)}const qr={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=Qr.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{}}}},Qr=qr;Qr.alphaPixelTypes.forEach(t=>Qr.upperCaseTypeMap[t]=t.toUpperCase());const Jr=se.get("TaskProcessor");class $r{constructor(t){this.parallel=!0,this.time=1,this.id=y.create(y.TASK),this.task=t}run(){return xe(this,void 0,void 0,function*(){try{if(this.isComplete||this.runing)return;if(this.runing=!0,this.canUse&&!this.canUse())return this.cancel();this.task&&(yield this.task())}catch(t){Jr.error(t)}})}complete(){this.isComplete=!0,this.parent=this.task=this.canUse=null}cancel(){this.isCancel=!0,this.complete()}}class Zr{get total(){return this.list.length+this.delayNumber}get finishedIndex(){return this.isComplete?0:this.index+this.parallelSuccessNumber}get remain(){return this.isComplete?this.total:this.total-this.finishedIndex}get percent(){const{total:t}=this;let e=0,s=0;for(let i=0;i<t;i++)i<=this.finishedIndex?(s+=this.list[i].time,i===this.finishedIndex&&(e=s)):e+=this.list[i].time;return this.isComplete?1:s/e}constructor(t){this.config={parallel:6},this.list=[],this.running=!1,this.isComplete=!0,this.index=0,this.delayNumber=0,t&&p.assign(this.config,t),this.empty()}add(t,e,s){let r,n,o,h;const l=new $r(t);return l.parent=this,a(e)?h=e:e&&(n=e.parallel,r=e.start,o=e.time,h=e.delay,s||(s=e.canUse)),o&&(l.time=o),!1===n&&(l.parallel=!1),s&&(l.canUse=s),i(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.run()}),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 Kr=se.get("Resource"),tn={tasker:new Zr,map:{},get isComplete(){return en.tasker.isComplete},set(t,e){en.map[t]&&Kr.repeat(t),en.map[t]=e},get:t=>en.map[t],remove(t){const e=en.map[t];e&&(e.destroy&&e.destroy(),delete en.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 n(e)?i={url:e}:e.url||(i={url:t,view:e}),i&&(s&&(i.format=s),e=de.image(i)),en.set(t,e),e},destroy(){en.map={}}},en=tn,sn={maxRecycled:10,recycledList:[],patternTasker:new Zr({parallel:1}),get(t){let e=tn.get(t.url);return e||tn.set(t.url,e=de.image(t)),e.use++,e},recycle(t){t.use--,setTimeout(()=>{t.use||(Kt.image.isLarge(t)?t.url&&tn.remove(t.url):(t.clearLevels(),rn.recycledList.push(t)))})},recyclePaint(t){rn.recycle(t.image)},clearRecycled(t){const e=rn.recycledList;(e.length>rn.maxRecycled||t)&&(e.forEach(e=>(!e.use||t)&&e.url&&tn.remove(e.url)),e.length=0)},clearLevels(){},hasAlphaPixel:t=>qr.alphaPixelTypes.some(e=>rn.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:"+qr.mineType(t)))return!0}else{if(s.includes("."+t)||s.includes("."+qr.upperCaseTypeMap[t]))return!0;if("png"===t&&!s.includes("."))return!0}return!1},destroy(){this.clearRecycled(!0)}},rn=sn,{IMAGE:nn,create:on}=y;class an{get url(){return this.config.url}get crossOrigin(){const{crossOrigin:t}=this.config;return i(t)?Kt.image.crossOrigin:t}get completed(){return this.ready||!!this.error}constructor(t){if(this.use=0,this.waitComplete=[],this.innerId=on(nn),this.config=t||(t={url:""}),t.view){const{view:e}=t;this.setView(e.config?e.view:e)}sn.isFormat("svg",t)&&(this.isSVG=!0),sn.hasAlphaPixel(t)&&(this.hasAlphaPixel=!0)}load(t,e,s){return this.loading||(this.loading=!0,tn.tasker.add(()=>xe(this,void 0,void 0,function*(){return yield Kt.origin.loadImage(this.getLoadUrl(s),this.crossOrigin,this).then(t=>{s&&this.setThumbView(t),this.setView(t)}).catch(t=>{this.error=t,this.onComplete(!1)})}))),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||(this.width=t.width,this.height=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,n,o,a){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 h=Kt.image.resize(this.view,t,e,r,n,void 0,o,s,i,a);return this.cache=this.use>1?{data:h,params:arguments}:null,h}getPattern(t,e,s,i){const r=Kt.canvas.createPattern(t,e);return Kt.image.setPatternTransform(r,s,i),r}getLoadUrl(t){return this.url}setThumbView(t){}getThumbSize(t){}getMinLevel(){}getLevelData(t,e,s){}clearLevels(t){}destroy(){this.clearLevels();const{view:t}=this;t&&t.close&&t.close(),this.config={url:""},this.cache=this.view=null,this.waitComplete.length=0}}function hn(t,e,s,i){i||(s.configurable=s.enumerable=!0),Object.defineProperty(t,e,s)}function ln(t,e){return Object.getOwnPropertyDescriptor(t,e)}function dn(t,e){const s="_"+t;return{get(){const t=this[s];return null==t?e:t},set(t){this[s]=t}}}function cn(t,e){return(s,i)=>_n(s,i,t,e&&e(i))}function un(t){return t}function _n(t,e,s,i){const r={get(){return this.__getAttr(e)},set(t){this.__setAttr(e,t)}};hn(t,e,Object.assign(r,i||{})),Xn(t,e,s)}function pn(t){return cn(t)}function gn(t,e){return cn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange())}}))}function fn(t,e){return cn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.matrixChanged||this.__layout.matrixChange(),this.__scrollWorld||(this.__scrollWorld={}))}}))}function yn(t){return cn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__hasAutoLayout=!!(this.origin||this.around||this.flow),this.__local||this.__layout.createLocal(),bn(this))}}))}function mn(t,e){return cn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.scaleChanged||this.__layout.scaleChange())}}))}function xn(t,e){return cn(t,t=>({set(s){this.__setAttr(t,s,e)&&(this.__layout.rotationChanged||this.__layout.rotationChange())}}))}function wn(t,e){return cn(t,t=>({set(s){this.__setAttr(t,s,e)&&bn(this)}}))}function vn(t){return cn(t,t=>({set(e){this.__setAttr(t,e)&&(bn(this),this.__.__removeNaturalSize())}}))}function bn(t){t.__layout.boxChanged||t.__layout.boxChange(),t.__hasAutoLayout&&(t.__layout.matrixChanged||t.__layout.matrixChange())}function Sn(t){return cn(t,t=>({set(e){const s=this.__;2!==s.__pathInputed&&(s.__pathInputed=e?1:0),e||(s.__pathForRender=void 0),this.__setAttr(t,e),bn(this)}}))}const kn=wn;function Bn(t,e){return cn(t,t=>({set(s){this.__setAttr(t,s)&&(Rn(this),e&&(this.__.__useStroke=!0))}}))}function Rn(t){t.__layout.strokeChanged||t.__layout.strokeChange(),t.__.__useArrow&&bn(t)}const Cn=Bn;function Pn(t){return cn(t,t=>({set(e){this.__setAttr(t,e),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Tn(t){return cn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChanged||this.__layout.surfaceChange())}}))}function Ln(t){return cn(t,t=>({set(e){if(this.__setAttr(t,e)){const t=this.__;p.stintSet(t,"__useDim",t.dim||t.bright||t.dimskip),this.__layout.surfaceChange()}}}))}function On(t){return cn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.opacityChanged||this.__layout.opacityChange()),this.mask&&An(this)}}))}function En(t){return cn(t,t=>({set(e){const s=this.visible;if(!0===s&&0===e){if(this.animationOut)return this.__runAnimation("out",()=>In(this,t,e,s))}else 0===s&&!0===e&&this.animation&&this.__runAnimation("in");In(this,t,e,s),this.mask&&An(this)}}))}function An(t){const{parent:e}=t;if(e){const{__hasMask:t}=e;e.__updateMask(),t!==e.__hasMask&&e.forceUpdate()}}function In(t,e,s,i){t.__setAttr(e,s)&&(t.__layout.opacityChanged||t.__layout.opacityChange(),0!==i&&0!==s||bn(t))}function Wn(t){return cn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.surfaceChange(),this.waitParent(()=>{this.parent.__layout.childrenSortChange()}))}}))}function Mn(t){return cn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.boxChanged||this.__layout.boxChange(),this.waitParent(()=>{this.parent.__updateMask(e)}))}}))}function Dn(t){return cn(t,t=>({set(e){this.__setAttr(t,e)&&this.waitParent(()=>{this.parent.__updateEraser(e)})}}))}function Fn(t){return cn(t,t=>({set(e){this.__setAttr(t,e)&&(this.__layout.hitCanvasChanged=!0,"hit"===se.showBounds&&this.__layout.surfaceChange(),this.leafer&&this.leafer.updateCursor())}}))}function zn(t){return cn(t,t=>({set(e){this.__setAttr(t,e),this.leafer&&this.leafer.updateCursor()}}))}function Nn(t){return(e,s)=>{hn(e,"__DataProcessor",{get:()=>t})}}function Yn(t){return(e,s)=>{hn(e,"__LayoutProcessor",{get:()=>t})}}function Xn(t,e,s){const r=t.__DataProcessor.prototype,n="_"+e,o=function(t){return"set"+t.charAt(0).toUpperCase()+t.slice(1)}(e),a=dn(e,s);if(i(s))a.get=function(){return this[n]};else if("function"==typeof s)a.get=function(){const t=this[n];return null==t?s(this.__leaf):t};else if(c(s)){const t=_(s);a.get=function(){const e=this[n];return null==e?this[n]=t?{}:p.clone(s):e}}const h=t.isBranchLeaf;"width"===e?a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalWidth,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.width:e?t._height&&t.__useNaturalRatio?t._height*e/t.__naturalHeight:e:h&&i.children.length?i.boxBounds.width:s}return t}:"height"===e&&(a.get=function(){const t=this[n];if(null==t){const t=this,e=t.__naturalHeight,i=t.__leaf;return!s||i.pathInputed?i.boxBounds.height:e?t._width&&t.__useNaturalRatio?t._width*e/t.__naturalWidth:e:h&&i.children.length?i.boxBounds.height:s}return t});let l,d=r;for(;!l&&d;)l=ln(d,e),d=d.__proto__;l&&l.set&&(a.set=l.set),r[o]&&(a.set=r[o],delete r[o]),hn(r,e,a)}const Un=new se("rewrite"),jn=[],Vn=["destroy","constructor"];function Gn(t){return(e,s)=>{jn.push({name:e.constructor.name+"."+s,run:()=>{e[s]=t}})}}function Hn(){return t=>{qn()}}function qn(t){jn.length&&(jn.forEach(e=>{t&&Un.error(e.name,"需在Class上装饰@rewriteAble()"),e.run()}),jn.length=0)}function Qn(t,e){return s=>{var i;(t.prototype?(i=t.prototype,Object.getOwnPropertyNames(i)):Object.keys(t)).forEach(i=>{if(!(Vn.includes(i)||e&&e.includes(i)))if(t.prototype){ln(t.prototype,i).writable&&(s.prototype[i]=t.prototype[i])}else s.prototype[i]=t[i]})}}function Jn(){return t=>{ue.register(t)}}function $n(){return t=>{ge.register(t)}}setTimeout(()=>qn(!0));const{copy:Zn,toInnerPoint:Kn,toOuterPoint:to,scaleOfOuter:eo,rotateOfOuter:so,skewOfOuter:io,multiplyParent:ro,divideParent:no,getLayout:oo}=Q,ao={},{round:ho}=Math,lo={updateAllMatrix(t,e,s){if(e&&t.__hasAutoLayout&&t.__layout.matrixChanged&&(s=!0),_o(t,e,s),t.isBranch){const{children:i}=t;for(let t=0,r=i.length;t<r;t++)uo(i[t],e,s)}},updateMatrix(t,e,s){const i=t.__layout;e?s&&(i.waitAutoLayout=!0,t.__hasAutoLayout&&(i.matrixChanged=!1)):i.waitAutoLayout&&(i.waitAutoLayout=!1),i.matrixChanged&&t.__updateLocalMatrix(),i.waitAutoLayout||t.__updateWorldMatrix()},updateBounds(t){const e=t.__layout;e.boundsChanged&&t.__updateLocalBounds(),e.waitAutoLayout||t.__updateWorldBounds()},updateAllWorldOpacity(t){if(t.__updateWorldOpacity(),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)po(e[t])}},updateChange(t){const e=t.__layout;e.stateStyleChanged&&t.updateState(),e.opacityChanged&&po(t),t.__updateChange()},updateAllChange(t){if(fo(t),t.isBranch){const{children:e}=t;for(let t=0,s=e.length;t<s;t++)go(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,n){i||(i=t.__nowWorld),t.__worldFlipped||Kt.fullImageShadow?e.copyWorldByReset(s,i,t.__nowWorld,r,n):e.copyWorldToInner(s,i,t.__layout.renderBounds,r)},moveWorld(t,e,s=0,i,r){const n=c(e)?Object.assign({},e):{x:e,y:s};i?to(t.localTransform,n,n,!0):t.parent&&Kn(t.parent.scrollWorldTransform,n,n,!0),co.moveLocal(t,n.x,n.y,r)},moveLocal(t,e,s=0,i){c(e)&&(s=e.y,e=e.x),e+=t.x,s+=t.y,t.leafer&&t.leafer.config.pointSnap&&(e=ho(e),s=ho(s)),i?t.animate({x:e,y:s},i):(t.x=e,t.y=s)},zoomOfWorld(t,e,s,i,r,n){co.zoomOfLocal(t,yo(t,e),s,i,r,n)},zoomOfLocal(t,e,s,i=s,r,n){const o=t.__localMatrix;if(a(i)||(i&&(n=i),i=s),Zn(ao,o),eo(ao,e,s,i),co.hasHighPosition(t))co.setTransform(t,ao,r,n);else{const e=t.x+ao.e-o.e,a=t.y+ao.f-o.f;n&&!r?t.animate({x:e,y:a,scaleX:t.scaleX*s,scaleY:t.scaleY*i},n):(t.x=e,t.y=a,t.scaleResize(s,i,!0!==r))}},rotateOfWorld(t,e,s,i){co.rotateOfLocal(t,yo(t,e),s,i)},rotateOfLocal(t,e,s,i){const r=t.__localMatrix;Zn(ao,r),so(ao,e,s),co.hasHighPosition(t)?co.setTransform(t,ao,!1,i):t.set({x:t.x+ao.e-r.e,y:t.y+ao.f-r.f,rotation:I.formatRotation(t.rotation+s)},i)},skewOfWorld(t,e,s,i,r,n){co.skewOfLocal(t,yo(t,e),s,i,r,n)},skewOfLocal(t,e,s,i=0,r,n){Zn(ao,t.__localMatrix),io(ao,e,s,i),co.setTransform(t,ao,r,n)},transformWorld(t,e,s,i){Zn(ao,t.worldTransform),ro(ao,e),t.parent&&no(ao,t.parent.scrollWorldTransform),co.setTransform(t,ao,s,i)},transform(t,e,s,i){Zn(ao,t.localTransform),ro(ao,e),co.setTransform(t,ao,s,i)},setTransform(t,e,s,i){const r=t.__,n=r.origin&&co.getInnerOrigin(t,r.origin),o=oo(e,n,r.around&&co.getInnerOrigin(t,r.around));if(co.hasOffset(t)&&(o.x-=r.offsetX,o.y-=r.offsetY),s){const e=o.scaleX/t.scaleX,s=o.scaleY/t.scaleY;if(delete o.scaleX,delete o.scaleY,n){Xt.scale(t.boxBounds,Math.abs(e),Math.abs(s));const i=co.getInnerOrigin(t,r.origin);at.move(o,n.x-i.x,n.y-i.y)}t.set(o),t.scaleResize(e,s,!1)}else t.set(o,i)},getFlipTransform(t,e){const s={a:1,b:0,c:0,d:1,e:0,f:0},i="x"===e?1:-1;return eo(s,co.getLocalOrigin(t,"center"),-1*i,1*i),s},getLocalOrigin:(t,e)=>at.tempToOuterOf(co.getInnerOrigin(t,e),t.localTransform),getInnerOrigin(t,e){const s={};return bt.toPoint(e,t.boxBounds,s),s},getRelativeWorld:(t,e,s)=>(Zn(ao,t.worldTransform),no(ao,e.scrollWorldTransform),s?ao:Object.assign({},ao)),drop(t,e,s,i){t.setTransform(co.getRelativeWorld(t,e,!0),i),e.add(t,s)},hasHighPosition:t=>t.origin||t.around||co.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),Kt.requestRender(()=>co.animateMove(t,e,s))}}},co=lo,{updateAllMatrix:uo,updateMatrix:_o,updateAllWorldOpacity:po,updateAllChange:go,updateChange:fo}=co;function yo(t,e){return t.updateLayout(),t.parent?at.tempToInnerOf(e,t.parent.scrollWorldTransform):e}const mo={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)=>wo(t,e)&&t.__localBoxBounds,maskLocalStrokeBounds:(t,e)=>wo(t,e)&&t.__layout.localStrokeBounds,maskLocalRenderBounds:(t,e)=>wo(t,e)&&t.__layout.localRenderBounds,excludeRenderBounds:(t,e)=>!(!e.bounds||e.bounds.hit(t.__world,e.matrix))||!(!e.hideBounds||!e.hideBounds.includes(t.__world,e.matrix))};let xo;function wo(t,e){return e||(xo=0),t.__.mask&&(xo=1),xo<0?null:(xo&&(xo=-1),!0)}const{updateBounds:vo}=lo,bo={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),So(t,e))}},pushAllParent(t,e){const{keys:s}=e;if(s)for(;t.parent&&i(s[t.parent.innerId]);)e.add(t.parent),t=t.parent;else for(;t.parent;)e.add(t.parent),t=t.parent},pushAllBranchStack(t,e){let s=e.length;const{children:i}=t;for(let t=0,s=i.length;t<s;t++)i[t].isBranch&&e.push(i[t]);for(let t=s,i=e.length;t<i;t++)ko(e[t],e)},updateBounds(t,e){const s=[t];ko(t,s),Bo(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++)vo(i[t]);e&&e===s||vo(s)}},move(t,e,s){let i;const{children:r}=t;for(let n=0,o=r.length;n<o;n++)i=(t=r[n]).__world,i.e+=e,i.f+=s,i.x+=e,i.y+=s,t.isBranch&&Ro(t,e,s)},scale(t,e,s,i,r,n,o){let a;const{children:h}=t,l=i-1,d=r-1;for(let c=0,u=h.length;c<u;c++)a=(t=h[c]).__world,a.a*=i,a.d*=r,(a.b||a.c)&&(a.b*=i,a.c*=r),a.e===a.x&&a.f===a.y?(a.x=a.e+=(a.e-n)*l+e,a.y=a.f+=(a.f-o)*d+s):(a.e+=(a.e-n)*l+e,a.f+=(a.f-o)*d+s,a.x+=(a.x-n)*l+e,a.y+=(a.y-o)*d+s),a.width*=i,a.height*=r,a.scaleX*=i,a.scaleY*=r,t.isBranch&&Co(t,e,s,i,r,n,o)}},{pushAllChildBranch:So,pushAllBranchStack:ko,updateBoundsByBranchStack:Bo,move:Ro,scale:Co}=bo,Po={run(t){if(t&&t.length){const e=t.length;for(let s=0;s<e;s++)t[s]();t.length===e?t.length=0:t.splice(0,e)}}},{getRelativeWorld:To,updateBounds:Lo}=lo,{toOuterOf:Oo,getPoints:Eo,copy:Ao}=Xt,Io="_localContentBounds",Wo="_worldContentBounds",Mo="_worldBoxBounds",Do="_worldStrokeBounds";class Fo{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 Oo(this.contentBounds,this.leaf.__localMatrix,this[Io]||(this[Io]={})),this[Io]}get localStrokeBounds(){return this._localStrokeBounds||this}get localRenderBounds(){return this._localRenderBounds||this}get worldContentBounds(){return Oo(this.contentBounds,this.leaf.__world,this[Wo]||(this[Wo]={})),this[Wo]}get worldBoxBounds(){return Oo(this.boxBounds,this.leaf.__world,this[Mo]||(this[Mo]={})),this[Mo]}get worldStrokeBounds(){return Oo(this.strokeBounds,this.leaf.__world,this[Do]||(this[Do]={})),this[Do]}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 Lo(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,Kt.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 Q.defaultMatrix;case"page":t=e.zoomLayer;default:return To(e,t)}}getBounds(t,e="world"){switch(this.update(),e){case"world":return this.getWorldBounds(t);case"local":return this.getLocalBounds(t);case"inner":return this.getInnerBounds(t);case"page":e=this.leaf.zoomLayer;default:return new 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,n,o,a=this.getInnerBounds(t);switch(e){case"world":r=i.getWorldPoint(a),n=i.__world;break;case"local":const{scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d}=i.__;o={scaleX:t,scaleY:s,rotation:h,skewX:l,skewY:d},r=i.getLocalPointByInner(a);break;case"inner":r=a,n=Q.defaultMatrix;break;case"page":e=i.zoomLayer;default:r=i.getWorldPoint(a,e),n=To(i,e,!0)}if(o||(o=Q.getLayout(n)),Ao(o,a),at.copy(o,r),s){const{scaleX:t,scaleY:e}=o,s=Math.abs(t),i=Math.abs(e);1===s&&1===i||(o.scaleX/=s,o.scaleY/=i,o.width*=s,o.height*=i)}return o}getLayoutPoints(t,e="world"){const{leaf:s}=this,r=Eo(this.getInnerBounds(t));let n;switch(e){case"world":n=null;break;case"local":n=s.parent;break;case"inner":break;case"page":e=s.zoomLayer;default:n=e}return i(n)||r.forEach(t=>s.innerToWorld(t,null,!1,n)),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 zo{constructor(t,e){this.bubbles=!1,this.type=t,e&&(this.target=e)}stopDefault(){this.isStopDefault=!0,this.origin&&Kt.event.stopDefault(this.origin)}stopNow(){this.isStopNow=!0,this.isStop=!0,this.origin&&Kt.event.stopNow(this.origin)}stop(){this.isStop=!0,this.origin&&Kt.event.stop(this.origin)}}class No extends zo{constructor(t,e,s){super(t,e),this.parent=s,this.child=e}}No.ADD="child.add",No.REMOVE="child.remove",No.CREATED="created",No.MOUNTED="mounted",No.UNMOUNTED="unmounted",No.DESTROY="destroy";const Yo="property.scroll";class Xo extends zo{constructor(t,e,s,i,r){super(t,e),this.attrName=s,this.oldValue=i,this.newValue=r}}Xo.CHANGE="property.change",Xo.LEAFER_CHANGE="property.leafer_change",Xo.SCROLL=Yo;const Uo={scrollX:Yo,scrollY:Yo};class jo extends zo{constructor(t,e){super(t),Object.assign(this,e)}}jo.LOAD="image.load",jo.LOADED="image.loaded",jo.ERROR="image.error";class Vo extends zo{static checkHas(t,e,s){"on"===s?e===Qo?t.__hasWorldEvent=!0:t.__hasLocalEvent=!0:(t.__hasLocalEvent=t.hasEvent(Go)||t.hasEvent(Ho)||t.hasEvent(qo),t.__hasWorldEvent=t.hasEvent(Qo))}static emitLocal(t){if(t.leaferIsReady){const{resized:e}=t.__layout;"local"!==e&&(t.emit(Go,t),"inner"===e&&t.emit(Ho,t)),t.emit(qo,t)}}static emitWorld(t){t.leaferIsReady&&t.emit(Qo,this)}}Vo.RESIZE="bounds.resize",Vo.INNER="bounds.inner",Vo.LOCAL="bounds.local",Vo.WORLD="bounds.world";const{RESIZE:Go,INNER:Ho,LOCAL:qo,WORLD:Qo}=Vo,Jo={};[Go,Ho,qo,Qo].forEach(t=>Jo[t]=1);class $o extends zo{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){c(t)?(super($o.RESIZE),Object.assign(this,t)):super(t),this.old=e}static isResizing(t){return this.resizingKeys&&!i(this.resizingKeys[t.innerId])}}$o.RESIZE="resize";class Zo extends zo{constructor(t,e){super(t),this.data=e}}Zo.REQUEST="watch.request",Zo.DATA="watch.data";class Ko extends zo{constructor(t,e,s){super(t),e&&(this.data=e,this.times=s)}}Ko.REQUEST="layout.request",Ko.START="layout.start",Ko.BEFORE="layout.before",Ko.LAYOUT="layout",Ko.AFTER="layout.after",Ko.AGAIN="layout.again",Ko.END="layout.end";class ta extends zo{constructor(t,e,s,i){super(t),e&&(this.times=e),s&&(this.renderBounds=s,this.renderOptions=i)}}ta.REQUEST="render.request",ta.CHILD_START="render.child_start",ta.CHILD_END="render.child_end",ta.START="render.start",ta.BEFORE="render.before",ta.RENDER="render",ta.AFTER="render.after",ta.AGAIN="render.again",ta.END="render.end",ta.NEXT="render.next";class ea extends zo{}ea.START="leafer.start",ea.BEFORE_READY="leafer.before_ready",ea.READY="leafer.ready",ea.AFTER_READY="leafer.after_ready",ea.VIEW_READY="leafer.view_ready",ea.VIEW_COMPLETED="leafer.view_completed",ea.STOP="leafer.stop",ea.RESTART="leafer.restart",ea.END="leafer.end",ea.UPDATE_MODE="leafer.update_mode",ea.TRANSFORM="leafer.transform",ea.MOVE="leafer.move",ea.SCALE="leafer.scale",ea.ROTATE="leafer.rotate",ea.SKEW="leafer.skew";const{MOVE:sa,SCALE:ia,ROTATE:ra,SKEW:na}=ea,oa={x:sa,y:sa,scaleX:ia,scaleY:ia,rotation:ra,skewX:na,skewY:na},aa={};class ha{set event(t){this.on(t)}on(t,e,s){if(!e){let e;if(d(t))t.forEach(t=>this.on(t[0],t[1],t[2]));else for(let s in t)d(e=t[s])?this.on(s,e[0],e[1]):this.on(s,e);return}let i,r,o;s&&("once"===s?r=!0:"boolean"==typeof s?i=s:(i=s.capture,r=s.once));const a=la(this,i,!0),h=n(t)?t.split(" "):t,l=r?{listener:e,once:r}:{listener:e};h.forEach(t=>{t&&(o=a[t],o?-1===o.findIndex(t=>t.listener===e)&&o.push(l):a[t]=[l],Jo[t]&&Vo.checkHas(this,t,"on"))})}off(t,e,s){if(t){const i=n(t)?t.split(" "):t;if(e){let t,r,n;s&&(t="boolean"==typeof s?s:"once"!==s&&s.capture);const o=la(this,t);i.forEach(t=>{t&&(r=o[t],r&&(n=r.findIndex(t=>t.listener===e),n>-1&&r.splice(n,1),r.length||delete o[t],Jo[t]&&Vo.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):d(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=d(t)?t:[t];e.forEach(t=>{t&&(t.listener?t.current.off(t.type,t.listener,t.options):d(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 d(t)&&t.forEach(t=>this.once(t[0],t[1],t[2],t[3]));c(s)?e=e.bind(s):i=s,this.on(t,e,{once:!0,capture:i})}emit(t,e,s){!e&&ge.has(t)&&(e=ge.get(t,{type:t,target:this,current:this}));const i=la(this,s)[t];if(i){let r;for(let n=0,o=i.length;n<o&&!((r=i[n])&&(r.listener(e),r.once&&(this.off(t,r.listener,s),n--,o--),e&&e.isStopNow));n++);}this.syncEventer&&this.syncEventer.emitEvent(e,s)}emitEvent(t,e){t.current=this,this.emit(t.type,t,e)}hasEvent(t,e){if(this.syncEventer&&this.syncEventer.hasEvent(t,e))return!0;const{__bubbleMap:s,__captureMap:r}=this,n=s&&s[t],o=r&&r[t];return!!(i(e)?n||o:e?o:n)}destroy(){this.__captureMap=this.__bubbleMap=this.syncEventer=null}}function la(t,e,s){if(e){const{__captureMap:e}=t;return e||(s?t.__captureMap={}:aa)}{const{__bubbleMap:e}=t;return e||(s?t.__bubbleMap={}:aa)}}const{on:da,on_:ca,off:ua,off_:_a,once:pa,emit:ga,emitEvent:fa,hasEvent:ya,destroy:ma}=ha.prototype,xa={on:da,on_:ca,off:ua,off_:_a,once:pa,emit:ga,emitEvent:fa,hasEvent:ya,destroyEventer:ma},wa=se.get("setAttr"),va={__setAttr(t,e,s){if(this.leaferIsCreated){const r=this.__.__getInput(t);if(!s||o(e)||i(e)||(wa.warn(this.innerName,t,e),e=void 0),c(e)||r!==e){if(this.__realSetAttr(t,e),this.isLeafer){this.emitEvent(new Xo(Xo.LEAFER_CHANGE,this,t,r,e));const s=oa[t];s&&(this.emitEvent(new ea(s,this)),this.emitEvent(new ea(ea.TRANSFORM,this)))}this.emitPropertyEvent(Xo.CHANGE,t,r,e);const s=Uo[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 Xo(t,this,e,s,i);this.isLeafer||this.hasEvent(t)&&this.emitEvent(r),this.leafer.emitEvent(r)},__realSetAttr(t,e){const s=this.__;s[t]=e,this.__proxyData&&this.setProxyAttr(t,e),s.normalStyle&&(this.lockNormalStyle||i(s.normalStyle[t])||(s.normalStyle[t]=e))},__getAttr(t){return this.__proxyData?this.getProxyAttr(t):this.__.__get(t)}},{setLayout:ba,multiplyParent:Sa,translateInner:ka,defaultWorld:Ba}=Q,{toPoint:Ra,tempPoint:Ca}=bt,Pa={__updateWorldMatrix(){const{parent:t,__layout:e,__world:s,__scrollWorld:i,__:r}=this;Sa(this.__local||e,t?t.__scrollWorld||t.__world:Ba,s,!!e.affectScaleOrRotation,r),i&&ka(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)&&(ba(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)&&(Ra(s.around||s.origin,t.boxBounds,Ca),ka(e,-Ca.x,-Ca.y,!s.around))}this.__layout.matrixChanged=void 0}},{updateMatrix:Ta,updateAllMatrix:La}=lo,{updateBounds:Oa}=bo,{toOuterOf:Ea,copyAndSpread:Aa,copy:Ia}=Xt,{toBounds:Wa}=Mr,Ma={__updateWorldBounds(){const{__layout:t,__world:e}=this;Ea(t.renderBounds,e,e),t.resized&&("inner"===t.resized&&this.__onUpdateSize(),this.__hasLocalEvent&&Vo.emitLocal(this),t.resized=void 0),this.__hasWorldEvent&&Vo.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(),Ea(this.__layout.boxBounds,this.__local,this.__local)},__updateLocalStrokeBounds(){Ea(this.__layout.strokeBounds,this.__localMatrix,this.__layout.localStrokeBounds)},__updateLocalRenderBounds(){Ea(this.__layout.renderBounds,this.__localMatrix,this.__layout.localRenderBounds)},__updateBoxBounds(t,e){const s=this.__layout.boxBounds,i=this.__;i.__usePathBox?Wa(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(),La(this),Oa(this,this),this.__.__autoSide&&this.__updateBoxBounds(!0)):(La(this),Oa(this,this))):Ta(this)},__updateNaturalSize(){const{__:t,__layout:e}=this;t.__naturalWidth=e.boxBounds.width,t.__naturalHeight=e.boxBounds.height},__updateStrokeBounds(t){const e=this.__layout;Aa(e.strokeBounds,e.boxBounds,e.strokeBoxSpread)},__updateRenderBounds(t){const e=this.__layout,{renderSpread:s}=e;a(s)&&s<=0?Ia(e.renderBounds,e.strokeBounds):Aa(e.renderBounds,e.boxBounds,s)}},Da={__render(t,e){if(e.shape)return this.__renderShape(t,e);if((!e.cellList||e.cellList.has(this))&&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),lo.copyCanvasByWorld(this,t,i,this.__nowWorld,s.__blendMode,!0),i.recycle(this.__nowWorld)}else this.__draw(t,e);se.showBounds&&se.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:Fa}=mo,{hasSize:za}=Xt,Na={__updateChange(){const{__layout:t}=this;t.childrenSortChanged&&(this.__updateSortChildren(),t.childrenSortChanged=!1),this.__.__checkSingle()},__render(t,e){const s=this.__nowWorld=this.__getNowWorld(e);if(this.__worldOpacity&&za(s)){const i=this.__;if(i.__useDim)if(i.dim)e.dimOpacity=!0===i.dim?.2:i.dim;else{if(i.bright&&!e.topRendering)return e.topList.add(this);i.dimskip&&e.dimOpacity&&(e.dimOpacity=0)}if(i.__single&&!this.isBranchLeaf){if("path"===i.eraser)return this.__renderEraser(t,e);const r=t.getSameCanvas(!1,!0);this.__renderBranch(r,e),t.opacity=e.dimOpacity?i.opacity*e.dimOpacity:i.opacity,t.copyWorldByReset(r,s,s,i.__blendMode,!0),r.recycle(s)}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++)Fa(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++)Fa(s[i],e)||s[i].__clip(t,e)}}},Ya={},{LEAF:Xa,create:Ua}=y,{stintSet:ja}=p,{toInnerPoint:Va,toOuterPoint:Ga,multiplyParent:Ha}=Q,{toOuterOf:qa}=Xt,{copy:Qa,move:Ja}=at,{moveLocal:$a,zoomOfLocal:Za,rotateOfLocal:Ka,skewOfLocal:th,moveWorld:eh,zoomOfWorld:sh,rotateOfWorld:ih,skewOfWorld:rh,transform:nh,transformWorld:oh,setTransform:ah,getFlipTransform:hh,getLocalOrigin:lh,getRelativeWorld:dh,drop:ch}=lo;let uh=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 f}get __LayoutProcessor(){return Fo}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=Ua(Xa),this.reset(t),this.__bubbleMap&&this.__emitLifeEvent(No.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(No.ADD,t,"once")}waitLeafer(t,e){e&&(t=t.bind(e)),this.leafer?t():this.on(No.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(No.MOUNTED)):this.__emitLifeEvent(No.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){i(t)?t="width":"surface"===t&&(t="blendMode");const e=this.__.__getInput(t);this.__[t]=i(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 Ha(s,t.matrix,e,void 0,s),qa(this.__layout.renderBounds,e,e),ja(e,"half",s.half),ja(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}=sn.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),Ya.scaleX=s,Ya.scaleY=i,Ya}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?dh(this,e):this.worldTransform,r=s?t:{};return qa(t,i,r),r}worldToLocal(t,e,s,i){this.parent?this.parent.worldToInner(t,e,s,i):e&&Qa(e,t)}localToWorld(t,e,s,i){this.parent?this.parent.innerToWorld(t,e,s,i):e&&Qa(e,t)}worldToInner(t,e,s,i){i&&(i.innerToWorld(t,e,s),t=e||t),Va(this.scrollWorldTransform,t,e,s)}innerToWorld(t,e,s,i){Ga(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:n,y:o}=this.boxBounds;return Ja(r,-n,-o),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:n,y:o}=this.boxBounds;return Ja(r,n,o),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){ah(this,t,e,s)}transform(t,e,s){nh(this,t,e,s)}move(t,e,s){$a(this,t,e,s)}moveInner(t,e,s){eh(this,t,e,!0,s)}scaleOf(t,e,s,i,r){Za(this,lh(this,t),e,s,i,r)}rotateOf(t,e,s){Ka(this,lh(this,t),e,s)}skewOf(t,e,s,i,r){th(this,lh(this,t),e,s,i,r)}transformWorld(t,e,s){oh(this,t,e,s)}moveWorld(t,e,s){eh(this,t,e,!1,s)}scaleOfWorld(t,e,s,i,r){sh(this,t,e,s,i,r)}rotateOfWorld(t,e){ih(this,t,e)}skewOfWorld(t,e,s,i,r){rh(this,t,e,s,i,r)}flip(t,e){nh(this,hh(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,e){return!0}__hit(t,e){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 le.need("path")}getMotionPoint(t){return le.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){ch(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):Xn(this.prototype,t,e)}static addAttr(t,e,s,i){s||(s=wn),s(e,i)(this.prototype,t)}__emitLifeEvent(t){this.hasEvent(t)&&this.emitEvent(new No(t,this,this.parent))}destroy(){this.destroyed||(this.parent&&this.remove(),this.children&&this.clear(),this.__emitLifeEvent(No.DESTROY),this.__.destroy(),this.__layout.destroy(),this.destroyEventer(),this.destroyed=!0)}};uh=me([Qn(va),Qn(Pa),Qn(Ma),Qn(xa),Qn(Da)],uh);const{setListWithFn:_h}=Xt,{sort:ph}=bo,{localBoxBounds:gh,localStrokeBounds:fh,localRenderBounds:yh,maskLocalBoxBounds:mh,maskLocalStrokeBounds:xh,maskLocalRenderBounds:wh}=mo,vh=new se("Branch");let bh=class extends uh{__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){_h(e||this.__layout.boxBounds,this.children,this.__hasMask?mh:gh)}__updateStrokeBounds(t){_h(t||this.__layout.strokeBounds,this.children,this.__hasMask?xh:fh)}__updateRenderBounds(t){_h(t||this.__layout.renderBounds,this.children,this.__hasMask?wh:yh)}__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(ph),this.__layout.affectChildrenSort=t}}add(t,e){if(t===this||t.destroyed)return vh.warn("add self or destroyed");const s=i(e);if(!t.__){if(d(t))return t.forEach(t=>{this.add(t,e),s||e++});t=ue.get(t.tag,t)}t.parent&&t.parent.remove(t),t.parent=this,s?this.children.push(t):this.children.splice(e,0,t),t.isBranch&&(this.__.__childBranchNumber=(this.__.__childBranchNumber||0)+1);const r=t.__layout;r.boxChanged||r.boxChange(),r.matrixChanged||r.matrixChange(),t.__bubbleMap&&t.__emitLifeEvent(No.ADD),this.leafer&&(t.__bindLeafer(this.leafer),this.leafer.created&&this.__emitChildEvent(No.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)):i(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(No.REMOVE),t.parent=null,this.leafer&&(t.__bindLeafer(null),this.leafer.created&&(this.__emitChildEvent(No.REMOVE,t),this.leafer.hitCanvasManager&&this.leafer.hitCanvasManager.clear()))}__emitChildEvent(t,e){const s=new No(t,e,this);this.hasEvent(t)&&!this.isLeafer&&this.emitEvent(s),this.leafer.emitEvent(s)}};bh=me([Qn(Na)],bh);class Sh{get length(){return this.list.length}constructor(t){this.reset(),t&&(d(t)?this.addList(t):this.add(t))}has(t){return t&&!i(this.keys[t.innerId])}indexAt(t){return this.list[t]}indexOf(t){const e=this.keys[t.innerId];return i(e)?-1:e}add(t){const{list:e,keys:s}=this;i(s[t.innerId])&&(e.push(t),s[t.innerId]=e.length-1)}addAt(t,e=0){const{keys:s}=this;if(i(s[t.innerId])){const{list:i}=this;for(let t=e,r=i.length;t<r;t++)s[i[t].innerId]++;0===e?i.unshift(t):(e>i.length&&(e=i.length),i.splice(e,0,t)),s[t.innerId]=e}}addList(t){for(let e=0;e<t.length;e++)this.add(t[e])}remove(t){const{list:e}=this;let s;for(let r=0,n=e.length;r<n;r++)i(s)?e[r].innerId===t.innerId&&(s=r,delete this.keys[t.innerId]):this.keys[e[r].innerId]=r-1;i(s)||e.splice(s,1)}sort(t){const{list:e}=this;t?e.sort((t,e)=>e.__level-t.__level):e.sort((t,e)=>t.__level-e.__level)}forEach(t){this.list.forEach(t)}clone(){const t=new Sh;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 kh{get length(){return this._length}constructor(t){this._length=0,this.reset(),t&&(d(t)?this.addList(t):this.add(t))}has(t){return!i(this.keys[t.innerId])}without(t){return i(this.keys[t.innerId])}sort(t){const{levels:e}=this;t?e.sort((t,e)=>e-t):e.sort((t,e)=>t-e)}addList(t){t.forEach(t=>{this.add(t)})}add(t){const{keys:e,levelMap:s}=this;e[t.innerId]||(e[t.innerId]=1,s[t.__level]?s[t.__level].push(t):(s[t.__level]=[t],this.levels.push(t.__level)),this._length++)}forEach(t){let e;this.levels.forEach(s=>{e=this.levelMap[s];for(let s=0,i=e.length;s<i;s++)t(e[s])})}reset(){this.levelMap={},this.keys={},this.levels=[],this._length=0}destroy(){this.levelMap=null}}const Bh="2.0.0";class Rh extends Ae{get allowBackgroundColor(){return!1}init(){const{config:t}=this;let e=t.view||t.canvas;e?(n(e)?("#"!==e[0]&&(e="#"+e),this.viewSelect=Kt.miniapp.select(e)):e.fields?this.viewSelect=e:this.initView(e),this.viewSelect&&Kt.miniapp.getSizeView(this.viewSelect).then(t=>{this.initView(t)})):this.initView()}initView(t){t?this.view=t.view||t:(t={},this.__createView()),this.view.getContext?this.__createContext():this.unrealCanvas();const{width:e,height:s,pixelRatio:i}=this.config,r={width:e||t.width,height:s||t.height,pixelRatio:i};this.resize(r),this.context&&(this.viewSelect&&(Kt.renderCanvas=this),this.context.roundRect&&(this.roundRect=function(t,e,s,i,r){this.context.roundRect(t,e,s,i,a(r)?[r]:r)}),Hr(this.context.__proto__))}__createView(){this.view=Kt.origin.createCanvas(1,1)}updateViewSize(){if(this.unreal)return;const{width:t,height:e,pixelRatio:s}=this;this.view.width=Math.ceil(t*s),this.view.height=Math.ceil(e*s)}updateClientBounds(t){this.viewSelect&&Kt.miniapp.getBounds(this.viewSelect).then(e=>{this.clientBounds=e,t&&t()})}startAutoLayout(t,e){this.resizeListener||(this.resizeListener=e,t&&(this.checkSize=this.checkSize.bind(this),Kt.miniapp.onWindowResize(this.checkSize)))}checkSize(){this.viewSelect&&setTimeout(()=>{this.updateClientBounds(()=>{const{width:t,height:e}=this.clientBounds,{pixelRatio:s}=this,i={width:t,height:e,pixelRatio:s};this.isSameSize(i)||this.emitResize(i)})},500)}stopAutoLayout(){this.autoLayout=!1,this.resizeListener=null,Kt.miniapp.offWindowResize(this.checkSize)}unrealCanvas(){this.unreal=!0}emitResize(t){const e={};p.copyAttrs(e,this,Ee),this.resize(t),i(this.width)||this.resizeListener(new $o(t,e))}}const{mineType:Ch,fileType:Ph}=qr;function Th(t,e){Kt.origin={createCanvas:(t,s,i)=>{const r={type:"2d",width:t,height:s};return e.createOffscreenCanvas?e.createOffscreenCanvas(r):e.createOffScreenCanvas(r)},canvasToDataURL:(t,e,s)=>t.toDataURL(Ch(e),s),canvasToBolb:(t,e,s)=>t.toBuffer(e,{quality:s}),canvasSaveAs:(t,e,s)=>{let i=t.toDataURL(Ch(Ph(e)),s);return i=i.substring(i.indexOf("64,")+3),Kt.origin.download(i,e)},download:(t,s)=>new Promise((i,r)=>{let n;s.includes("/")||(s=`${e.env.USER_DATA_PATH}/`+s,n=!0);const o=e.getFileSystemManager();o.writeFile({filePath:s,data:t,encoding:"base64",success(){n?Kt.miniapp.saveToAlbum(s).then(()=>{o.unlink({filePath:s}),i()}):i()},fail(t){r(t)}})}),loadImage:t=>new Promise((e,s)=>{const i=Kt.canvas.view.createImage();i.onload=()=>{e(i)},i.onerror=t=>{s(t)},i.src=Kt.image.getRealURL(t)}),noRepeat:"repeat-x"},Kt.miniapp={select:t=>e.createSelectorQuery().select(t),getBounds:t=>new Promise(e=>{t.boundingClientRect().exec(t=>{const s=t[1];e({x:s.top,y:s.left,width:s.width,height:s.height})})}),getSizeView:t=>new Promise(e=>{t.fields({node:!0,size:!0}).exec(t=>{const s=t[0];e({view:s.node,width:s.width,height:s.height})})}),saveToAlbum:t=>new Promise(s=>{e.getSetting({success:i=>{i.authSetting["scope.writePhotosAlbum"]?e.saveImageToPhotosAlbum({filePath:t,success(){s(!0)}}):e.authorize({scope:"scope.writePhotosAlbum",success:()=>{e.saveImageToPhotosAlbum({filePath:t,success(){s(!0)}})},fail:()=>{}})}})}),onWindowResize(t){e.onWindowResize(t)},offWindowResize(t){e.offWindowResize(t)}},Kt.event={stopDefault(t){},stopNow(t){},stop(t){}},Kt.canvas=de.canvas(),Kt.conicGradientSupport=!!Kt.canvas.context.createConicGradient}Object.assign(de,{canvas:(t,e)=>new Rh(t,e),image:t=>new an(t)}),Kt.name="miniapp",Kt.requestRender=function(t){const{view:e}=Kt.renderCanvas||Kt.canvas;e.requestAnimationFrame?e.requestAnimationFrame(t):setTimeout(t,16)},hn(Kt,"devicePixelRatio",{get:()=>Math.max(1,wx.getWindowInfo?wx.getWindowInfo().pixelRatio:wx.getSystemInfoSync().pixelRatio)});class Lh{get childrenChanged(){return this.hasAdd||this.hasRemove||this.hasVisible}get updatedList(){if(this.hasRemove&&this.config.usePartLayout){const t=new Sh;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 Sh,this.target=t,e&&(this.config=p.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}update(){this.changed=!0,this.running&&this.target.emit(ta.REQUEST)}__onAttrChange(t){this.config.usePartLayout&&this.__updatedList.add(t.target),this.update()}__onChildEvent(t){this.config.usePartLayout&&(t.type===No.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 Zo(Zo.DATA,{updatedList:this.updatedList})),this.__updatedList=new Sh,this.totalTimes++,this.changed=this.hasVisible=this.hasRemove=this.hasAdd=!1}__listenEvents(){this.__eventIds=[this.target.on_([[Xo.CHANGE,this.__onAttrChange,this],[[No.ADD,No.REMOVE],this.__onChildEvent,this],[Zo.REQUEST,this.__onRquestData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.__updatedList=null)}}const{updateAllMatrix:Oh,updateBounds:Eh,updateChange:Ah}=lo,{pushAllChildBranch:Ih,pushAllParent:Wh}=bo;const{worldBounds:Mh}=mo;class Dh{constructor(t){this.updatedBounds=new Gt,this.beforeBounds=new Gt,this.afterBounds=new Gt,d(t)&&(t=new Sh(t)),this.updatedList=t}setBefore(){this.beforeBounds.setListWithFn(this.updatedList.list,Mh)}setAfter(){this.afterBounds.setListWithFn(this.updatedList.list,Mh),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:Fh,updateAllChange:zh}=lo,Nh=se.get("Layouter");class Yh{constructor(t,e){this.totalTimes=0,this.config={usePartLayout:!0},this.__levelList=new kh,this.target=t,e&&(this.config=p.default(e,this.config)),this.__listenEvents()}start(){this.disabled||(this.running=!0)}stop(){this.running=!1}disable(){this.stop(),this.__removeListenEvents(),this.disabled=!0}layout(){if(this.layouting||!this.running)return;const{target:t}=this;this.times=0;try{t.emit(Ko.START),this.layoutOnce(),t.emitEvent(new Ko(Ko.END,this.layoutedBlocks,this.times))}catch(t){Nh.error(t)}this.layoutedBlocks=null}layoutAgain(){this.layouting?this.waitAgain=!0:this.layoutOnce()}layoutOnce(){return this.layouting?Nh.warn("layouting"):this.times>3?Nh.warn("layout max times"):(this.times++,this.totalTimes++,this.layouting=!0,this.target.emit(Zo.REQUEST),this.totalTimes>1&&this.config.usePartLayout?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=oe.start("PartLayout"),{target:s,__updatedList:i}=this,{BEFORE:r,LAYOUT:n,AFTER:o}=Ko,a=this.getBlocks(i);a.forEach(t=>t.setBefore()),s.emitEvent(new Ko(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?(Oh(t,!0),e.add(t),t.isBranch&&Ih(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||Eh(i[t])}Eh(s)}})}(this.__levelList),function(t){t.list.forEach(Ah)}(i),this.extraBlock&&a.push(this.extraBlock),a.forEach(t=>t.setAfter()),s.emitEvent(new Ko(n,a,this.times)),s.emitEvent(new Ko(o,a,this.times)),this.addBlocks(a),this.__levelList.reset(),this.__updatedList=null,oe.end(e)}fullLayout(){const t=oe.start("FullLayout"),{target:e}=this,{BEFORE:s,LAYOUT:i,AFTER:r}=Ko,n=this.getBlocks(new Sh(e));e.emitEvent(new Ko(s,n,this.times)),Yh.fullLayout(e),n.forEach(t=>{t.setAfter()}),e.emitEvent(new Ko(i,n,this.times)),e.emitEvent(new Ko(r,n,this.times)),this.addBlocks(n),oe.end(t)}static fullLayout(t){Fh(t,!0),t.isBranch?bo.updateBounds(t):lo.updateBounds(t),zh(t)}addExtra(t){if(!this.__updatedList.has(t)){const{updatedList:e,beforeBounds:s}=this.extraBlock||(this.extraBlock=new Dh([]));e.length?s.add(t.__world):s.set(t.__world),e.add(t)}}createBlock(t){return new Dh(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_([[Ko.REQUEST,this.layout,this],[Ko.AGAIN,this.layoutAgain,this],[Zo.DATA,this.__onReceiveWatchData,this]])]}__removeListenEvents(){this.target.off_(this.__eventIds)}destroy(){this.target&&(this.stop(),this.__removeListenEvents(),this.target=this.config=null)}}const Xh=se.get("Renderer");class Uh{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,ceilPartPixel:!0,maxFPS:120},this.frames=[],this.target=t,this.canvas=e,s&&(this.config=p.default(s,this.config)),this.__listenEvents()}start(){this.running=!0,this.update(!1)}stop(){this.running=!1}update(t=!0){this.changed||(this.changed=t),this.requestTime||this.__requestRender()}requestLayout(){this.target.emit(Ko.REQUEST)}checkRender(){if(this.running){const{target:t}=this;t.isApp&&(t.emit(ta.CHILD_START,t),t.children.forEach(t=>{t.renderer.FPS=this.FPS,t.renderer.checkRender()}),t.emit(ta.CHILD_END,t)),this.changed&&this.canvas.view&&this.render(),this.target.emit(ta.NEXT)}}render(t){if(!this.running||!this.canvas.view)return this.update();const{target:e}=this;this.times=0,this.totalBounds=new Gt,Xh.log(e.innerName,"---\x3e");try{this.emitRender(ta.START),this.renderOnce(t),this.emitRender(ta.END,this.totalBounds),sn.clearRecycled()}catch(t){this.rendering=!1,Xh.error(t)}Xh.log("-------------|")}renderAgain(){this.rendering?this.waitAgain=!0:this.renderOnce()}renderOnce(t){if(this.rendering)return Xh.warn("rendering");if(this.times>3)return Xh.warn("render max times");if(this.times++,this.totalTimes++,this.rendering=!0,this.changed=!1,this.renderBounds=new Gt,this.renderOptions={},t)this.emitRender(ta.BEFORE),t();else{if(this.requestLayout(),this.ignore)return void(this.ignore=this.rendering=!1);this.emitRender(ta.BEFORE),this.config.usePartRender&&this.totalTimes>1?this.partRender():this.fullRender()}this.emitRender(ta.RENDER,this.renderBounds,this.renderOptions),this.emitRender(ta.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=oe.start("PartRender"),{canvas:s}=this,i=t.getIntersect(s.bounds),r=new Gt(i);s.save(),i.spread(Uh.clipSpread).ceil();const{ceilPartPixel:n}=this.config;s.clipWorld(i,n),s.clearWorld(i,n),this.__render(i,r),s.restore(),oe.end(e)}fullRender(){const t=oe.start("FullRender"),{canvas:e}=this;e.save(),e.clear(),this.__render(e.bounds),e.restore(),oe.end(t)}__render(t,e){const{canvas:s,target:i}=this,r=t.includes(i.__world),n=r?{includes:r}:{bounds:t,includes:r};this.needFill&&s.fillWorld(t,this.config.fill),se.showRepaint&&se.drawRepaint(s,t),this.config.useCellRender&&(n.cellList=this.getCellList()),Kt.render(i,s,n),this.renderBounds=e=e||t,this.renderOptions=n,this.totalBounds.isEmpty()?this.totalBounds=e:this.totalBounds.add(e),s.updateRender(e)}getCellList(){}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 Kt.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()};Kt.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||Xh.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 ta(t,this.times,e,s))}__listenEvents(){this.__eventIds=[this.target.on_([[ta.REQUEST,this.update,this],[Ko.END,this.__onLayoutEnd,this],[ta.AGAIN,this.renderAgain,this],[$o.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 jh(t){return cn(t,t=>({set(e){this.__setAttr(t,e),e&&(this.__.__useEffect=!0),this.__layout.renderChanged||this.__layout.renderChange()}}))}function Vh(t){return cn(t,t=>({set(e){this.__setAttr(t,e),this.__layout.boxChanged||this.__layout.boxChange(),this.__updateSize()}}))}function Gh(){return(t,e)=>{const s="_"+e;hn(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}})}}function Hh(t){return(e,s)=>{hn(e,s,dn(s,t))}}Uh.clipSpread=10,Object.assign(de,{watcher:(t,e)=>new Lh(t,e),layouter:(t,e)=>new Yh(t,e),renderer:(t,e,s)=>new Uh(t,e,s),selector:(t,e)=>{},interaction:(t,e,s,i)=>{}}),Kt.layout=Yh.fullLayout,Kt.render=function(t,e,s){const i=Object.assign(Object.assign({},s),{topRendering:!0});s.topList=new Sh,t.__render(e,s),s.topList.length&&s.topList.forEach(t=>t.__render(e,i))};const qh={},Qh={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}},Jh=Qt,$h={},Zh={},Kh={},tl={},el={},sl={apply(){le.need("filter")}},il={},rl={setStyleName:()=>le.need("state"),set:()=>le.need("state")},nl={list:{},register(t,e){nl.list[t]=e},get:t=>nl.list[t]},{parse:ol,objectToCanvasData:al}=ii,{stintSet:hl}=p,{hasTransparent:ll}=Qh,dl={originPaint:{}},cl=se.get("UIData");class ul extends f{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,cl.warn("width < 0, instead -scaleX ",this)):this._width=t}setHeight(t){t<0?(this._height=-t,this.__leaf.scaleY*=-1,cl.warn("height < 0, instead -scaleY",this)):this._height=t}setFill(t){this.__naturalWidth&&this.__removeNaturalSize(),n(t)||!t?(hl(this,"__isTransparentFill",ll(t)),this.__isFills&&this.__removePaint("fill",!0),this._fill=t):c(t)&&this.__setPaint("fill",t)}setStroke(t){n(t)||!t?(hl(this,"__isTransparentStroke",ll(t)),this.__isStrokes&&this.__removePaint("stroke",!0),this._stroke=t):c(t)&&this.__setPaint("stroke",t)}setPath(t){const e=n(t);e||t&&c(t[0])?(this.__setInput("path",t),this._path=e?ol(t):al(t)):(this.__input&&this.__removeInput("path"),this._path=t)}setShadow(t){_l(this,"shadow",t)}setInnerShadow(t){_l(this,"innerShadow",t)}setFilter(t){_l(this,"filter",t)}__computePaint(){const{fill:t,stroke:e}=this.__input;t&&Zh.compute("fill",this.__leaf),e&&Zh.compute("stroke",this.__leaf),this.__needComputePaint=void 0}__getRealStrokeWidth(t){let{strokeWidth:e,strokeWidthFixed:s}=this;if(t&&(t.strokeWidth&&(e=t.strokeWidth),i(t.strokeWidthFixed)||(s=t.strokeWidthFixed)),s){const t=this.__leaf.getClampRenderScale();return t>1?e/t:e}return e}__setPaint(t,e){this.__setInput(t,e);const s=this.__leaf.__layout;s.boxChanged||s.boxChange(),d(e)&&!e.length?this.__removePaint(t):"fill"===t?(this.__isFills=!0,this._fill||(this._fill=dl)):(this.__isStrokes=!0,this._stroke||(this._stroke=dl))}__removePaint(t,e){e&&this.__removeInput(t),Kh.recycleImage(t,this),"fill"===t?(hl(this,"__isAlphaPixelFill",void 0),this._fill=this.__isFills=void 0):(hl(this,"__isAlphaPixelStroke",void 0),hl(this,"__hasMultiStrokeStyle",void 0),this._stroke=this.__isStrokes=void 0)}}function _l(t,e,s){t.__setInput(e,s),d(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 pl extends ul{}class gl extends pl{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 fl extends pl{__getInputData(t,e){const s=super.__getInputData(t,e);return Ee.forEach(t=>delete s[t]),s}}class yl extends gl{}class ml extends ul{get __usePathBox(){return this.points||this.__pathInputed}}class xl extends ul{get __boxStroke(){return!this.__pathInputed}}class wl extends ul{get __boxStroke(){return!this.__pathInputed}}class vl extends ml{}class bl extends ul{}class Sl extends ul{get __pathInputed(){return 2}}class kl extends pl{}const Bl={thin:100,"extra-light":200,light:300,normal:400,medium:500,"semi-bold":600,bold:700,"extra-bold":800,black:900};class Rl extends ul{get __useNaturalRatio(){return!1}setFontWeight(t){n(t)?(this.__setInput("fontWeight",t),t=Bl[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=ue.get("Rect",0);const r=e.__layout,n=s.__layout;i||(s.parent=e,s.__world=e.__world,n.boxBounds=r.boxBounds),s.set(t),n.strokeChanged&&r.strokeChange()}else s&&(e.__box=s.parent=null,s.destroy());this._boxStyle=t}__getInputData(t,e){const s=super.__getInputData(t,e);return s.textEditing&&delete s.textEditing,s}}class Cl extends xl{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 Pl extends xl{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:Tl,add:Ll}=k,Ol={__updateStrokeSpread(){let t=0,e=0;const s=this.__,{strokeAlign:i,__maxStrokeWidth:r}=s,n=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),n&&(t=Tl(t,n.__layout.strokeSpread=n.__updateStrokeSpread()),e=Math.max(e,n.__layout.strokeBoxSpread)),this.__layout.strokeBoxSpread=e,t},__updateRenderSpread(){let t=0;const{shadow:e,innerShadow:s,blur:i,backgroundBlur:r,filter:n,renderSpread:o}=this.__,{strokeSpread:a}=this.__layout,h=this.__box;e&&(t=el.getShadowRenderSpread(this,e)),i&&(t=Tl(t,i)),n&&(t=Ll(t,sl.getSpread(n))),o&&(t=Ll(t,o)),a&&(t=Ll(t,a));let l=t;return s&&(l=Tl(l,el.getInnerShadowSpread(this,s))),r&&(l=Tl(l,r)),this.__layout.renderShapeSpread=l,h?Tl(h.__updateRenderSpread(),t):t}},{stintSet:El}=p,Al={__updateChange(){const t=this.__;if(t.__useStroke){const e=t.__useStroke=!(!t.stroke||!t.strokeWidth);El(this.__world,"half",e&&"center"===t.strokeAlign&&t.strokeWidth%2),El(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;El(t,"__isFastShadow",e&&!r&&e.length<2&&!e[0].spread&&!el.isTransformShadow(e[0])&&s&&!t.__isTransparentFill&&!(d(s)&&s.length>1)&&(this.useFastShadow||!i||i&&"inside"===t.strokeAlign)),t.__useEffect=!(!e&&!r)}t.__checkSingle(),El(t,"__complex",t.__isFills||t.__isStrokes||t.cornerRadius||t.__useEffect)},__drawFast(t,e){Il(this,t,e)},__draw(t,e,s){const i=this.__;if(i.__complex){i.__needComputePaint&&i.__computePaint();const{fill:r,stroke:n,__drawAfterFill:o,__fillAfterStroke:a,__isFastShadow:h}=i;if(this.__drawRenderPath(t),i.__useEffect&&!h){const h=Zh.shape(this,t,e);this.__nowWorld=this.__getNowWorld(e);const{shadow:l,innerShadow:d,filter:c}=i;l&&el.shadow(this,t,h),a&&(i.__isStrokes?Zh.strokes(n,this,t,e):Zh.stroke(n,this,t,e)),r&&(i.__isFills?Zh.fills(r,this,t,e):Zh.fill(r,this,t,e)),o&&this.__drawAfterFill(t,e),d&&el.innerShadow(this,t,h),n&&!a&&(i.__isStrokes?Zh.strokes(n,this,t,e):Zh.stroke(n,this,t,e)),c&&sl.apply(c,this,this.__nowWorld,t,s,h),h.worldCanvas&&h.worldCanvas.recycle(),h.canvas.recycle()}else{if(a&&(i.__isStrokes?Zh.strokes(n,this,t,e):Zh.stroke(n,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,Qh.string(e.color))}r&&(i.__isFills?Zh.fills(r,this,t,e):Zh.fill(r,this,t,e)),h&&t.restore(),o&&this.__drawAfterFill(t,e),n&&!a&&(i.__isStrokes?Zh.strokes(n,this,t,e):Zh.stroke(n,this,t,e))}}else i.__pathForRender?Il(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?Zh.fills(i,this,t,e):Zh.fill("#000000",this,t,e)),s.__isCanvas&&this.__drawAfterFill(t,e),r&&!e.ignoreStroke&&(s.__isAlphaPixelStroke?Zh.strokes(r,this,t,e):Zh.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 Il(t,e,s){const{fill:i,stroke:r,__drawAfterFill:n,__fillAfterStroke:o}=t.__;t.__drawRenderPath(e),o&&Zh.stroke(r,t,e,s),i&&Zh.fill(i,t,e,s),n&&t.__drawAfterFill(e,s),r&&!o&&Zh.stroke(r,t,e,s)}const Wl={__drawFast(t,e){let{x:s,y:i,width:r,height:n}=this.__layout.boxBounds;const{fill:o,stroke:a,__drawAfterFill:h}=this.__;if(o&&(t.fillStyle=o,t.fillRect(s,i,r,n)),h&&this.__drawAfterFill(t,e),a){const{strokeAlign:o,__strokeWidth:h}=this.__;if(!h)return;t.setStroke(a,h,this.__);const l=h/2;switch(o){case"center":t.strokeRect(0,0,r,n);break;case"inside":r-=h,n-=h,r<0||n<0?(t.save(),this.__clip(t,e),t.strokeRect(s+l,i+l,r,n),t.restore()):t.strokeRect(s+l,i+l,r,n);break;case"outside":t.strokeRect(s-l,i-l,r+h,n+h)}}}};var Ml;let Dl=Ml=class extends uh{get app(){return this.leafer&&this.leafer.app}get isFrame(){return!1}set scale(t){I.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 Vr.set(this.path=t||[]),t||this.__drawPathByBox(Vr),Vr}reset(t){}set(t,e){t&&Object.assign(this,t)}get(t){return n(t)?this.__.__getInput(t):this.__.__getInputData(t)}createProxyData(){}find(t,e){return le.need("find")}findTag(t){return this.find({tag:t})}findOne(t,e){return le.need("find")}findId(t){return this.findOne({id:t})}getPath(t,e){this.__layout.update();let s=e?this.__.__pathForRender:this.__.path;return s||(Vr.set(s=[]),this.__drawPathByBox(Vr,!e)),t?ii.toCanvasData(s,!0):s}getPathString(t,e,s){return ii.stringify(this.getPath(t,e),s)}load(){this.__.__computePaint()}__onUpdateSize(){if(this.__.__input){const t=this.__;!t.lazy||this.__inLazyBounds||il.running?t.__computePaint():t.__needComputePaint=!0}}__updateRenderPath(){const t=this.__;t.path?(t.__pathForRender=t.cornerRadius?Ur.smooth(t.path,t.cornerRadius,t.cornerSmoothing):t.path,t.__useArrow&&$h.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,!0)}__drawPathByData(t,e,s){e?rr.drawPathByData(t,e):this.__drawPathByBox(t,s)}__drawPathByBox(t,e){const{x:s,y:i,width:r,height:n}=this.__layout.boxBounds;if(this.__.cornerRadius&&!e){const{cornerRadius:e}=this.__;t.roundRect(s,i,r,n,a(e)?[e]:e)}else t.rect(s,i,r,n);t.closePath()}drawImagePlaceholder(t,e,s){Zh.fill(this.__.placeholderColor,this,e,s)}animate(t,e,s,i){return this.set(t),le.need("animate")}killAnimate(t,e){}export(t,e){return le.need("export")}syncExport(t,e){return le.need("export")}clone(t){const e=p.clone(this.toJSON());return t&&Object.assign(e,t),Ml.one(e)}static one(t,e,s,i,r){return ue.get(t.tag||this.prototype.__tag,t,e,s,i,r)}static registerUI(){Jn()(this)}static registerData(t){Nn(t)(this.prototype)}static setEditConfig(t){}static setEditOuter(t){}static setEditInner(t){}destroy(){this.fill=this.stroke=null,this.__animate&&this.killAnimate(),super.destroy()}};me([Nn(ul)],Dl.prototype,"__",void 0),me([Gh()],Dl.prototype,"zoomLayer",void 0),me([pn("")],Dl.prototype,"id",void 0),me([pn("")],Dl.prototype,"name",void 0),me([pn("")],Dl.prototype,"className",void 0),me([Tn("pass-through")],Dl.prototype,"blendMode",void 0),me([On(1)],Dl.prototype,"opacity",void 0),me([En(!0)],Dl.prototype,"visible",void 0),me([Tn(!1)],Dl.prototype,"locked",void 0),me([Ln(!1)],Dl.prototype,"dim",void 0),me([Ln(!1)],Dl.prototype,"dimskip",void 0),me([Wn(0)],Dl.prototype,"zIndex",void 0),me([Mn(!1)],Dl.prototype,"mask",void 0),me([Dn(!1)],Dl.prototype,"eraser",void 0),me([gn(0,!0)],Dl.prototype,"x",void 0),me([gn(0,!0)],Dl.prototype,"y",void 0),me([wn(100,!0)],Dl.prototype,"width",void 0),me([wn(100,!0)],Dl.prototype,"height",void 0),me([mn(1,!0)],Dl.prototype,"scaleX",void 0),me([mn(1,!0)],Dl.prototype,"scaleY",void 0),me([xn(0,!0)],Dl.prototype,"rotation",void 0),me([xn(0,!0)],Dl.prototype,"skewX",void 0),me([xn(0,!0)],Dl.prototype,"skewY",void 0),me([gn(0,!0)],Dl.prototype,"offsetX",void 0),me([gn(0,!0)],Dl.prototype,"offsetY",void 0),me([fn(0,!0)],Dl.prototype,"scrollX",void 0),me([fn(0,!0)],Dl.prototype,"scrollY",void 0),me([yn()],Dl.prototype,"origin",void 0),me([yn()],Dl.prototype,"around",void 0),me([pn(!1)],Dl.prototype,"lazy",void 0),me([vn(1)],Dl.prototype,"pixelRatio",void 0),me([Pn(0)],Dl.prototype,"renderSpread",void 0),me([Sn()],Dl.prototype,"path",void 0),me([kn()],Dl.prototype,"windingRule",void 0),me([kn(!0)],Dl.prototype,"closed",void 0),me([wn(0)],Dl.prototype,"padding",void 0),me([wn(!1)],Dl.prototype,"lockRatio",void 0),me([wn()],Dl.prototype,"widthRange",void 0),me([wn()],Dl.prototype,"heightRange",void 0),me([pn(!1)],Dl.prototype,"draggable",void 0),me([pn()],Dl.prototype,"dragBounds",void 0),me([pn("auto")],Dl.prototype,"dragBoundsType",void 0),me([pn(!1)],Dl.prototype,"editable",void 0),me([Fn(!0)],Dl.prototype,"hittable",void 0),me([Fn("path")],Dl.prototype,"hitFill",void 0),me([Cn("path")],Dl.prototype,"hitStroke",void 0),me([Fn(!1)],Dl.prototype,"hitBox",void 0),me([Fn(!0)],Dl.prototype,"hitChildren",void 0),me([Fn(!0)],Dl.prototype,"hitSelf",void 0),me([Fn()],Dl.prototype,"hitRadius",void 0),me([zn("")],Dl.prototype,"cursor",void 0),me([Tn()],Dl.prototype,"fill",void 0),me([Cn(void 0,!0)],Dl.prototype,"stroke",void 0),me([Cn("inside")],Dl.prototype,"strokeAlign",void 0),me([Cn(1,!0)],Dl.prototype,"strokeWidth",void 0),me([Cn(!1)],Dl.prototype,"strokeWidthFixed",void 0),me([Cn("none")],Dl.prototype,"strokeCap",void 0),me([Cn("miter")],Dl.prototype,"strokeJoin",void 0),me([Cn()],Dl.prototype,"dashPattern",void 0),me([Cn(0)],Dl.prototype,"dashOffset",void 0),me([Cn(10)],Dl.prototype,"miterLimit",void 0),me([kn(0)],Dl.prototype,"cornerRadius",void 0),me([kn()],Dl.prototype,"cornerSmoothing",void 0),me([jh()],Dl.prototype,"shadow",void 0),me([jh()],Dl.prototype,"innerShadow",void 0),me([jh()],Dl.prototype,"blur",void 0),me([jh()],Dl.prototype,"backgroundBlur",void 0),me([jh()],Dl.prototype,"grayscale",void 0),me([jh()],Dl.prototype,"filter",void 0),me([Tn()],Dl.prototype,"placeholderColor",void 0),me([pn(100)],Dl.prototype,"placeholderDelay",void 0),me([pn({})],Dl.prototype,"data",void 0),me([Gn(uh.prototype.reset)],Dl.prototype,"reset",null),Dl=Ml=me([Qn(Ol),Qn(Al),Hn()],Dl);let Fl=class extends Dl{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(){}};var zl;me([Nn(pl)],Fl.prototype,"__",void 0),me([wn(0)],Fl.prototype,"width",void 0),me([wn(0)],Fl.prototype,"height",void 0),Fl=me([Qn(bh),Jn()],Fl);const Nl=se.get("Leafer");let Yl=zl=class extends Fl{get __tag(){return"Leafer"}get isApp(){return!1}get app(){return this.parent||this}get isLeafer(){return!0}get imageReady(){return this.viewReady&&tn.isComplete}get layoutLocked(){return!this.layouter.running}get view(){return this.canvas&&this.canvas.view}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),zl.list.add(this)}init(t,e){if(this.canvas)return;let s;const{config:i}=this;this.__setLeafer(this),e&&(this.parentApp=e,this.__bindApp(e),s=e.running),t&&(this.parent=e,this.initType(t.type),this.parent=void 0,p.assign(i,t));const r=this.canvas=de.canvas(i);this.__controllers.push(this.renderer=de.renderer(this,r,i),this.watcher=de.watcher(this,i),this.layouter=de.layouter(this,i)),this.isApp&&this.__setApp(),this.__checkAutoLayout(),e||(this.selector=de.selector(this),this.interaction=de.interaction(this,r,this.selector,i),this.interaction&&(this.__controllers.unshift(this.interaction),this.hitCanvasManager=de.hitCanvasManager()),this.canvasManager=new ye,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))),Po.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(ea.RESTART):this.emitLeafer(ea.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(ea.STOP))}unlockLayout(){this.layouter.start(),this.updateLayout()}lockLayout(){this.updateLayout(),this.layouter.stop()}resize(t){const e=p.copyAttrs({},t,Ee);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=p.copyAttrs({},this.canvas,Ee);e.resize(t),this.updateLazyBounds(),this.__onResize(new $o(t,s))}__onResize(t){this.emitEvent(t),p.copyAttrs(this.__,t,Ee),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 qt(t)),this.canvas.startAutoLayout(this.autoLayout,this.__onResize.bind(this)))}__setAttr(t,e){return this.canvas&&(Ee.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(ea.UPDATE_MODE,{mode:e})),super.__setAttr(t,e)}__getAttr(t){return this.canvas&&Ee.includes(t)?this.canvas[t]:super.__getAttr(t)}__changeCanvasSize(t,e){const{config:s,canvas:i}=this,r=p.copyAttrs({},i,Ee);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(ea.BEFORE_READY),this.emitLeafer(ea.READY),this.emitLeafer(ea.AFTER_READY),Po.run(this.__readyWait)}__onViewReady(){this.viewReady||(this.viewReady=!0,this.emitLeafer(ea.VIEW_READY),Po.run(this.__viewReadyWait))}__onLayoutEnd(){const{grow:t,width:e,height:s}=this.config;if(t){let{width:i,height:r,pixelRatio:n}=this;const o="box"===t?this.worldBoxBounds:this.__world;e||(i=Math.max(1,o.x+o.width)),s||(r=Math.max(1,o.y+o.height)),this.__doResize({width:i,height:r,pixelRatio:n})}this.ready||this.__onReady()}__onNextRender(){if(this.viewReady){Po.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(ea.VIEW_COMPLETED),Po.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 le.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 ea(t,this))}__listenEvents(){const t=oe.start("FirstCreate "+this.innerName);this.once([[ea.START,()=>oe.end(t)],[Ko.START,this.updateLazyBounds,this],[ta.START,this.__onCreated,this],[ta.END,this.__onViewReady,this]]),this.__eventIds.push(this.on_([[Zo.DATA,this.__onWatchData,this],[Ko.END,this.__onLayoutEnd,this],[ta.NEXT,this.__onNextRender,this]]))}__removeListenEvents(){this.off_(this.__eventIds)}destroy(t){const e=()=>{if(!this.destroyed){zl.list.remove(this);try{this.stop(),this.emitLeafer(ea.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.parentApp=null,this.userConfig&&(this.userConfig.view=null),super.destroy(),setTimeout(()=>{sn.clearRecycled()},100)}catch(t){Nl.error(t)}}};t?e():setTimeout(e)}};Yl.list=new Sh,me([Nn(fl)],Yl.prototype,"__",void 0),me([wn()],Yl.prototype,"pixelRatio",void 0),me([pn("normal")],Yl.prototype,"mode",void 0),Yl=zl=me([Jn()],Yl);let Xl=class extends Dl{get __tag(){return"Rect"}};me([Nn(xl)],Xl.prototype,"__",void 0),Xl=me([Qn(Wl),Hn(),Jn()],Xl);const{add:Ul,includes:jl,scroll:Vl}=Xt,Gl=Xl.prototype,Hl=Fl.prototype;let ql=class extends Fl{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:n}=i,{overflow:o}=s,a=i.childrenRenderBounds||(i.childrenRenderBounds={x:0,y:0,width:0,height:0});super.__updateRenderBounds(a),(e=o&&o.includes("scroll"))&&(Ul(a,n),Vl(a,s)),this.__updateRectRenderBounds(),t=!jl(n,a),t&&"show"===o&&Ul(r,a)}else this.__updateRectRenderBounds();p.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))}};me([Nn(gl)],ql.prototype,"__",void 0),me([wn(100)],ql.prototype,"width",void 0),me([wn(100)],ql.prototype,"height",void 0),me([pn(!1)],ql.prototype,"resizeChildren",void 0),me([Pn("show")],ql.prototype,"overflow",void 0),me([Gn(Gl.__updateStrokeSpread)],ql.prototype,"__updateStrokeSpread",null),me([Gn(Gl.__updateRenderSpread)],ql.prototype,"__updateRectRenderSpread",null),me([Gn(Gl.__updateBoxBounds)],ql.prototype,"__updateRectBoxBounds",null),me([Gn(Gl.__updateStrokeBounds)],ql.prototype,"__updateStrokeBounds",null),me([Gn(Gl.__updateRenderBounds)],ql.prototype,"__updateRectRenderBounds",null),me([Gn(Gl.__updateChange)],ql.prototype,"__updateRectChange",null),me([Gn(Gl.__render)],ql.prototype,"__renderRect",null),me([Gn(Hl.__render)],ql.prototype,"__renderGroup",null),ql=me([Hn(),Jn()],ql);let Ql=class extends ql{get __tag(){return"Frame"}get isFrame(){return!0}};me([Nn(yl)],Ql.prototype,"__",void 0),me([Tn("#FFFFFF")],Ql.prototype,"fill",void 0),me([Pn("hide")],Ql.prototype,"overflow",void 0),Ql=me([Jn()],Ql);const{moveTo:Jl,closePath:$l,ellipse:Zl}=Ri;let Kl=class extends Dl{get __tag(){return"Ellipse"}__updatePath(){const{width:t,height:e,innerRadius:s,startAngle:i,endAngle:r}=this.__,n=t/2,o=e/2,a=this.__.path=[];let h;s?i||r?(s<1?Zl(a,n,o,n*s,o*s,0,i,r,!1):h=!0,Zl(a,n,o,n,o,0,r,i,!0)):(s<1&&(Zl(a,n,o,n*s,o*s),Jl(a,t,o)),Zl(a,n,o,n,o,0,360,0,!0)):i||r?(Jl(a,n,o),Zl(a,n,o,n,o,0,i,r,!1)):Zl(a,n,o,n,o),h||$l(a),Kt.ellipseToCurve&&(this.__.path=this.getPath(!0))}};me([Nn(wl)],Kl.prototype,"__",void 0),me([kn(0)],Kl.prototype,"innerRadius",void 0),me([kn(0)],Kl.prototype,"startAngle",void 0),me([kn(0)],Kl.prototype,"endAngle",void 0),Kl=me([Jn()],Kl);const{sin:td,cos:ed,PI:sd}=Math,{moveTo:id,lineTo:rd,closePath:nd,drawPoints:od}=Ri;let ad=class extends Dl{get __tag(){return"Polygon"}__updatePath(){const t=this.__,e=t.path=[];if(t.points)od(e,t.points,t.curve,!0);else{const{width:s,height:i,sides:r}=t,n=s/2,o=i/2;id(e,n,0);for(let t=1;t<r;t++)rd(e,n+n*td(2*t*sd/r),o-o*ed(2*t*sd/r));nd(e)}}};me([Nn(vl)],ad.prototype,"__",void 0),me([kn(3)],ad.prototype,"sides",void 0),me([kn()],ad.prototype,"points",void 0),me([kn(0)],ad.prototype,"curve",void 0),ad=me([Hn(),Jn()],ad);const{sin:hd,cos:ld,PI:dd}=Math,{moveTo:cd,lineTo:ud,closePath:_d}=Ri;let pd=class extends Dl{get __tag(){return"Star"}__updatePath(){const{width:t,height:e,corners:s,innerRadius:i}=this.__,r=t/2,n=e/2,o=this.__.path=[];cd(o,r,0);for(let t=1;t<2*s;t++)ud(o,r+(t%2==0?r:r*i)*hd(t*dd/s),n-(t%2==0?n:n*i)*ld(t*dd/s));_d(o)}};me([Nn(bl)],pd.prototype,"__",void 0),me([kn(5)],pd.prototype,"corners",void 0),me([kn(.382)],pd.prototype,"innerRadius",void 0),pd=me([Jn()],pd);const{moveTo:gd,lineTo:fd,drawPoints:yd}=Ri,{rotate:md,getAngle:xd,getDistance:wd,defaultPoint:vd}=at;let bd=class extends Dl{get __tag(){return"Line"}get toPoint(){const{width:t,rotation:e}=this.__,s={x:0,y:0};return t&&(s.x=t),e&&md(s,e),s}set toPoint(t){this.width=wd(vd,t),this.rotation=xd(vd,t),this.height&&(this.height=0)}__updatePath(){const t=this.__,e=t.path=[];t.points?yd(e,t.points,t.curve,t.closed):(gd(e,0,0),fd(e,this.width,0))}};me([Nn(ml)],bd.prototype,"__",void 0),me([Bn("center")],bd.prototype,"strokeAlign",void 0),me([wn(0)],bd.prototype,"height",void 0),me([kn()],bd.prototype,"points",void 0),me([kn(0)],bd.prototype,"curve",void 0),me([kn(!1)],bd.prototype,"closed",void 0),bd=me([Jn()],bd);let Sd=class extends Xl{get __tag(){return"Image"}get ready(){const{image:t}=this;return t&&t.ready}get image(){const{fill:t}=this.__;return d(t)&&t[0].image}};me([Nn(Cl)],Sd.prototype,"__",void 0),me([wn("")],Sd.prototype,"url",void 0),Sd=me([Jn()],Sd);const kd=Sd;let Bd=class extends Xl{get __tag(){return"Canvas"}get context(){return this.canvas.context}get ready(){return!this.url}constructor(t){super(t),this.canvas=de.canvas(this.__),t&&t.url&&this.drawImage(t.url)}drawImage(t){new an({url:t}).load(t=>{this.context.drawImage(t.view,0,0),this.url=void 0,this.paint(),this.emitEvent(new jo(jo.LOADED,{image:t}))})}draw(t,e,s,i){const r=new gt(t.worldTransform).invert(),n=new gt;e&&n.translate(e.x,e.y),s&&(a(s)?n.scale(s):n.scale(s.x,s.y)),i&&n.rotate(i),r.multiplyParent(n),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()}};me([Nn(Pl)],Bd.prototype,"__",void 0),me([Vh(100)],Bd.prototype,"width",void 0),me([Vh(100)],Bd.prototype,"height",void 0),me([Vh(1)],Bd.prototype,"pixelRatio",void 0),me([Vh(!0)],Bd.prototype,"smooth",void 0),me([pn(!1)],Bd.prototype,"safeResize",void 0),me([Vh()],Bd.prototype,"contextSettings",void 0),Bd=me([Jn()],Bd);const{copyAndSpread:Rd,includes:Cd,spread:Pd,setList:Td}=Xt,{stintSet:Ld}=p;let Od=class extends Dl{get __tag(){return"Text"}get textDrawData(){return this.updateLayout(),this.__.__textDrawData}__updateTextDrawData(){const t=this.__,{lineHeight:e,letterSpacing:s,fontFamily:i,fontSize:r,fontWeight:n,italic:o,textCase:a,textOverflow:h,padding:l,width:d,height:c}=t;t.__lineHeight=Jh.number(e,r),t.__letterSpacing=Jh.number(s,r),t.__baseLine=t.__lineHeight-(t.__lineHeight-.7*r)/2,t.__font=`${o?"italic ":""}${"small-caps"===a?"small-caps ":""}${"normal"!==n?n+" ":""}${r||12}px ${i||"caption"}`,Ld(t,"__padding",l&&I.fourNumber(l)),Ld(t,"__clipText","show"!==h&&!t.__autoSize),Ld(t,"__isCharMode",d||c||t.__letterSpacing||"none"!==a),t.__textDrawData=qh.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:n,__autoHeight:o}=t;this.__updateTextDrawData();const{bounds:a}=t.__textDrawData,h=e.boxBounds;if(e.contentBounds=a,t.__lineHeight<s&&Pd(a,s/2),n||o){if(h.x=n?a.x:0,h.y=o?a.y:0,h.width=n?a.width:t.width,h.height=o?a.height:t.height,r){const[e,s,i,r]=t.__padding;n&&(h.x-=r,h.width+=s+r),o&&(h.y-=e,h.height+=i+e)}this.__updateNaturalSize()}else super.__updateBoxBounds();i&&(h.width+=.16*s),p.stintSet(this,"isOverflow",!Cd(h,a)),this.isOverflow?(Td(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;Rd(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()}};me([Nn(Rl)],Od.prototype,"__",void 0),me([wn(0)],Od.prototype,"width",void 0),me([wn(0)],Od.prototype,"height",void 0),me([Tn()],Od.prototype,"boxStyle",void 0),me([pn(!1)],Od.prototype,"resizeFontSize",void 0),me([Tn("#000000")],Od.prototype,"fill",void 0),me([Bn("outside")],Od.prototype,"strokeAlign",void 0),me([Fn("all")],Od.prototype,"hitFill",void 0),me([wn("")],Od.prototype,"text",void 0),me([wn("")],Od.prototype,"placeholder",void 0),me([wn("caption")],Od.prototype,"fontFamily",void 0),me([wn(12)],Od.prototype,"fontSize",void 0),me([wn("normal")],Od.prototype,"fontWeight",void 0),me([wn(!1)],Od.prototype,"italic",void 0),me([wn("none")],Od.prototype,"textCase",void 0),me([wn("none")],Od.prototype,"textDecoration",void 0),me([wn(0)],Od.prototype,"letterSpacing",void 0),me([wn({type:"percent",value:1.5})],Od.prototype,"lineHeight",void 0),me([wn(0)],Od.prototype,"paraIndent",void 0),me([wn(0)],Od.prototype,"paraSpacing",void 0),me([wn("x")],Od.prototype,"writingMode",void 0),me([wn("left")],Od.prototype,"textAlign",void 0),me([wn("top")],Od.prototype,"verticalAlign",void 0),me([wn(!0)],Od.prototype,"autoSizeAlign",void 0),me([wn("normal")],Od.prototype,"textWrap",void 0),me([wn("show")],Od.prototype,"textOverflow",void 0),me([Tn(!1)],Od.prototype,"textEditing",void 0),Od=me([Jn()],Od);let Ed=class extends Dl{get __tag(){return"Path"}};me([Nn(Sl)],Ed.prototype,"__",void 0),me([Bn("center")],Ed.prototype,"strokeAlign",void 0),Ed=me([Jn()],Ed);let Ad=class extends Fl{get __tag(){return"Pen"}setStyle(t){const e=this.pathElement=new Ed(t);return this.pathStyle=t,this.__path=e.path||(e.path=[]),this.add(e),this}beginPath(){return this}moveTo(t,e){return this}lineTo(t,e){return this}bezierCurveTo(t,e,s,i,r,n){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,n,o,a){return this}arc(t,e,s,i,r,n){return this}arcTo(t,e,s,i,r){return this}drawEllipse(t,e,s,i,r,n,o,a){return this}drawArc(t,e,s,i,r,n){return this}drawPoints(t,e,s){return this}clearPath(){return this}paint(){this.pathElement.__layout.boxChanged||this.pathElement.forceUpdate("path")}};function Id(t,e,s){t.__.__font?Zh.fillText(t,e,s):t.__.windingRule?e.fill(t.__.windingRule):e.fill()}function Wd(t,e,s,i,r){const n=s.__;c(t)?Zh.drawStrokesStyle(t,e,!1,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),i.stroke()),n.__useArrow&&Zh.strokeArrow(t,s,i,r)}function Md(t,e,s,i,r){const n=s.__;c(t)?Zh.drawStrokesStyle(t,e,!0,s,i,r):(i.setStroke(t,n.__strokeWidth*e,n),Zh.drawTextStroke(s,i,r))}function Dd(t,e,s,i,r){const n=i.getSameCanvas(!0,!0);n.font=s.__.__font,Md(t,2,s,n,r),n.blendMode="outside"===e?"destination-out":"destination-in",Zh.fillText(s,n,r),n.blendMode="normal",lo.copyCanvasByWorld(s,i,n),n.recycle(s.__nowWorld)}me([Nn(kl)],Ad.prototype,"__",void 0),me([(t,e)=>{hn(t,e,{get(){return this.__path}})}],Ad.prototype,"path",void 0),Ad=me([Qn(Ui,["set","path","paint"]),Jn()],Ad);const{getSpread:Fd,copyAndSpread:zd,toOuterOf:Nd,getOuterOf:Yd,getByMove:Xd,move:Ud,getIntersectData:jd}=Xt,Vd={};let Gd;const{stintSet:Hd}=p,{hasTransparent:qd}=Qh;function Qd(t,e,s){if(!c(e)||!1===e.visible||0===e.opacity)return;let r;const{boxBounds:o}=s.__layout;switch(e.type){case"image":if(!e.url)return;r=Kh.image(s,t,e,o,!Gd||!Gd[e.url]);break;case"linear":r=tl.linearGradient(e,o);break;case"radial":r=tl.radialGradient(e,o);break;case"angular":r=tl.conicGradient(e,o);break;case"solid":const{type:n,color:a,opacity:h}=e;r={type:n,style:Qh.string(a,h)};break;default:i(e.r)||(r={type:"solid",style:Qh.string(e)})}if(r&&(r.originPaint=e,n(r.style)&&qd(r.style)&&(r.isTransparent=!0),e.style)){if(0===e.style.strokeWidth)return;r.strokeStyle=e.style}return r}const Jd={compute:function(t,e){const s=e.__,i=[];let r,n,o,a=s.__input[t];d(a)||(a=[a]),Gd=Kh.recycleImage(t,s);for(let s,r=0,n=a.length;r<n;r++)(s=Qd(t,a[r],e))&&(i.push(s),s.strokeStyle&&(o||(o=1),s.strokeStyle.strokeWidth&&(o=Math.max(o,s.strokeStyle.strokeWidth))));s["_"+t]=i.length?i:void 0,i.length?(i.every(t=>t.isTransparent)&&(i.some(t=>t.image)&&(r=!0),n=!0),"fill"===t?(Hd(s,"__isAlphaPixelFill",r),Hd(s,"__isTransparentFill",n)):(Hd(s,"__isAlphaPixelStroke",r),Hd(s,"__isTransparentStroke",n),Hd(s,"__hasMultiStrokeStyle",o))):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,n,o;for(let a=0,h=t.length;a<h;a++){if(r=t[a],n=r.originPaint,r.image){if(o?o++:o=1,Kh.checkImage(r,!e.__.__font,e,s,i))continue;if(!r.style){1===o&&r.image.isPlacehold&&e.drawImagePlaceholder(r,s,i);continue}}if(s.fillStyle=r.style,r.transform||n.scaleFixed){if(s.save(),r.transform&&s.transform(r.transform),n.scaleFixed){const{scaleX:t,scaleY:i}=e.getRenderScaleData(!0);(!0===n.scaleFixed||"zoom-in"===n.scaleFixed&&t>1&&i>1)&&s.scale(1/t,1/i)}n.blendMode&&(s.blendMode=n.blendMode),Id(e,s,i),s.restore()}else n.blendMode?(s.saveBlendMode(n.blendMode),Id(e,s,i),s.restoreBlendMode()):Id(e,s,i)}},fillPathOrText:Id,fillText:function(t,e,s){const i=t.__,{rows:r,decorationY:n}=i.__textDrawData;let o;i.__isPlacehold&&i.placeholderColor&&(e.fillStyle=i.placeholderColor);for(let t=0,s=r.length;t<s;t++)o=r[t],o.text?e.fillText(o.text,o.x,o.y):o.data&&o.data.forEach(t=>{e.fillText(t.char,t.x,o.y)});if(n){const{decorationColor:t,decorationHeight:s}=i.__textDrawData;t&&(e.fillStyle=t),r.forEach(t=>n.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)Zh.strokeText(t,e,s,i);else switch(r.strokeAlign){case"center":Wd(t,1,e,s,i);break;case"inside":!function(t,e,s,i){s.save(),s.clipUI(e),Wd(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)Wd(t,2,e,s,i);else{const{renderBounds:n}=e.__layout,o=s.getSameCanvas(!0,!0);e.__drawRenderPath(o),Wd(t,2,e,o,i),o.clipUI(r),o.clearWorld(n),lo.copyCanvasByWorld(e,s,o),o.recycle(e.__nowWorld)}}(t,e,s,i)}},strokes:function(t,e,s,i){Zh.stroke(t,e,s,i)},strokeText:function(t,e,s,i){switch(e.__.strokeAlign){case"center":Md(t,1,e,s,i);break;case"inside":Dd(t,"inside",e,s,i);break;case"outside":e.__.__fillAfterStroke?Md(t,2,e,s,i):Dd(t,"outside",e,s,i)}},drawTextStroke:function(t,e,s){let i,r=t.__.__textDrawData;const{rows:n,decorationY:o}=r;for(let t=0,s=n.length;t<s;t++)i=n[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(o){const{decorationHeight:t}=r;n.forEach(s=>o.forEach(i=>e.strokeRect(s.x,s.y+i,s.width,t)))}},drawStrokesStyle:function(t,e,s,i,r,n){let o;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(o=t[l],(!o.image||!Kh.checkImage(o,!1,i,r,n))&&o.style){if(h){const{strokeStyle:t}=o;t?r.setStroke(o.style,a.__getRealStrokeWidth(t)*e,a,t):r.setStroke(o.style,a.__strokeWidth*e,a)}else r.strokeStyle=o.style;o.originPaint.blendMode?(r.saveBlendMode(o.originPaint.blendMode),s?Zh.drawTextStroke(i,r,n):r.stroke(),r.restoreBlendMode()):s?Zh.drawTextStroke(i,r,n):r.stroke()}},shape:function(t,e,s){const i=e.getSameCanvas(),r=e.bounds,n=t.__nowWorld,o=t.__layout,a=t.__nowWorldShapeBounds||(t.__nowWorldShapeBounds={});let h,l,d,c,u,_;Nd(o.strokeSpread?(zd(Vd,o.boxBounds,o.strokeSpread),Vd):o.boxBounds,n,a);let{scaleX:p,scaleY:g}=t.getRenderScaleData(!0);if(r.includes(a))_=i,h=u=a,l=n;else{let i;if(Kt.fullImageShadow)i=a;else{const t=o.renderShapeSpread?Fd(r,k.swapAndScale(o.renderShapeSpread,p,g)):r;i=jd(t,a)}c=r.getFitMatrix(i);let{a:f,d:y}=c;c.a<1&&(_=e.getSameCanvas(),t.__renderShape(_,s),p*=f,g*=y),u=Yd(a,c),h=Xd(u,-c.e,-c.f),l=Yd(n,c),Ud(l,-c.e,-c.f);const m=s.matrix;m?(d=new gt(c),d.multiply(m),f*=m.scaleX,y*=m.scaleY):d=c,d.withScale(f,y),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:g}}};let $d,Zd=new Gt;const{isSame:Kd}=Xt;function tc(t,e,s,i,r,n){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||Kh.createData(r,i,s,n),!0}function ec(t,e){rc(t,jo.LOAD,e)}function sc(t,e){rc(t,jo.LOADED,e)}function ic(t,e,s){e.error=s,t.forceUpdate("surface"),rc(t,jo.ERROR,e)}function rc(t,e,s){t.hasEvent(e)&&t.emitEvent(new jo(e,s))}function nc(t,e){const{leafer:s}=t;s&&s.viewReady&&(s.renderer.ignore=e)}const{get:oc,translate:ac}=Q,hc=new Gt,lc={},dc={};function cc(t,e,s,i){const r=n(t)||i?(i?s-i*e:s%e)/((i||Math.floor(s/e))-1):t;return"auto"===t&&r<0?0:r}let uc={},_c={a:1,b:0,c:0,d:1,e:0,f:0};const{get:pc,set:gc,rotateOfOuter:fc,translate:yc,scaleOfOuter:mc,multiplyParent:xc,scale:wc,rotate:vc,skew:bc}=Q;function Sc(t,e,s,i,r,n,o,a){o&&vc(t,o),a&&bc(t,a.x,a.y),r&&wc(t,r,n),yc(t,e.x+s,e.y+i)}const{get:kc,scale:Bc,copy:Rc}=Q,{getFloorScale:Cc}=I,{abs:Pc}=Math;const Tc={image:function(t,e,s,i,r){let n,o;const a=sn.get(s);return $d&&s===$d.paint&&Kd(i,$d.boxBounds)?n=$d.leafPaint:(n={type:s.type,image:a},a.hasAlphaPixel&&(n.isTransparent=!0),$d=a.use>1?{leafPaint:n,paint:s,boxBounds:Zd.set(i)}:null),(r||a.loading)&&(o={image:a,attrName:e,attrValue:s}),a.ready?(tc(t,e,s,a,n,i),r&&(ec(t,o),sc(t,o))):a.error?r&&ic(t,o,a.error):(r&&(nc(t,!0),ec(t,o)),n.loadId=a.load(()=>{nc(t,!1),t.destroyed||(tc(t,e,s,a,n,i)&&(a.hasAlphaPixel&&(t.__layout.hitCanvasChanged=!0),t.forceUpdate("surface")),sc(t,o)),n.loadId=void 0},e=>{nc(t,!1),ic(t,o,e),n.loadId=void 0},s.lod&&a.getThumbSize(s.lod)),t.placeholderColor&&(t.placeholderDelay?setTimeout(()=>{a.ready||(a.isPlacehold=!0,t.forceUpdate("surface"))},t.placeholderDelay):a.isPlacehold=!0)),n},checkImage:function(t,e,s,i,r){const{scaleX:n,scaleY:o}=Kh.getImageRenderScaleData(t,s,i,r),{image:a,data:h,originPaint:l}=t,{exporting:d,snapshot:c}=r;return!(!h||t.patternId===n+"-"+o&&!d||c)&&(e&&(h.repeat?e=!1:l.changeful||"miniapp"===Kt.name&&$o.isResizing(s)||d||(e=Kt.image.isLarge(a,n,o)||a.width*n>8096||a.height*o>8096)),e?(s.__.__isFastShadow&&(i.fillStyle=t.style||"#000",i.fill()),Kh.drawImage(t,n,o,s,i,r),!0):(!t.style||l.sync||d?Kh.createPattern(t,s,i,r):Kh.createPatternTask(t,s,i,r),!1))},drawImage:function(t,e,s,i,r,n){const{data:o,image:a}=t,{blendMode:h}=t.originPaint,{opacity:l,transform:d}=o,c=a.getFull(o.filters),u=i.__;let _,{width:p,height:g}=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,g),r.restore()):(o.scaleX&&(p*=o.scaleX,g*=o.scaleY),r.drawImage(c,0,0,p,g))},getImageRenderScaleData:function(t,e,s,i){const r=e.getRenderScaleData(!0,t.originPaint.scaleFixed),{data:n}=t;if(s){const{pixelRatio:t}=s;r.scaleX*=t,r.scaleY*=t}return n&&n.scaleX&&(r.scaleX*=Math.abs(n.scaleX),r.scaleY*=Math.abs(n.scaleY)),r},recycleImage:function(t,e){const s=e["_"+t];if(d(s)){let i,r,n,o,a;for(let h=0,l=s.length;h<l;h++)i=s[h],r=i.image,a=r&&r.url,a&&(n||(n={}),n[a]=!0,sn.recyclePaint(i),r.loading&&(o||(o=e.__input&&e.__input[t]||[],d(o)||(o=[o])),r.unload(s[h].loadId,!o.some(t=>t.url===a))));return n}return null},createPatternTask:function(t,e,s,i){t.patternTask||(t.patternTask=sn.patternTasker.add(()=>xe(this,void 0,void 0,function*(){Kh.createPattern(t,e,s,i),e.forceUpdate("surface")}),0,()=>(t.patternTask=null,s.bounds.hit(e.__nowWorld))))},createPattern:function(t,e,s,i){let{scaleX:r,scaleY:n}=Kh.getImageRenderScaleData(t,e,s,i),o=r+"-"+n;if(t.patternId!==o&&!e.destroyed&&(!Kt.image.isLarge(t.image,r,n)||t.data.repeat)){const{image:s,data:i}=t,{transform:a,gap:h}=i,l=Kh.getPatternFixScale(t,r,n);let d,c,u,{width:_,height:p}=s;l&&(r*=l,n*=l),_*=r,p*=n,h&&(c=h.x*r/Pc(i.scaleX||1),u=h.y*n/Pc(i.scaleY||1)),(a||1!==r||1!==n)&&(r*=Cc(_+(c||0)),n*=Cc(p+(u||0)),d=kc(),a&&Rc(d,a),Bc(d,1/r,1/n));const g=s.getCanvas(_,p,i.opacity,i.filters,c,u,e.leafer&&e.leafer.config.smooth,i.interlace),f=s.getPattern(g,i.repeat||Kt.origin.noRepeat||"no-repeat",d,t);t.style=f,t.patternId=o}},getPatternFixScale:function(t,e,s){const{image:i}=t;let r,n=Kt.image.maxPatternSize,o=i.width*i.height;return i.isSVG?e>1&&(r=Math.ceil(e)/e):n>o&&(n=o),(o*=e*s)>n&&(r=Math.sqrt(n/o)),r},createData:function(t,e,s,i){t.data=Kh.getPatternData(s,i,e)},getPatternData:function(t,e,s){t.padding&&(e=hc.set(e).shrink(t.padding)),"strench"===t.mode&&(t.mode="stretch");const{width:i,height:r}=s,{opacity:o,mode:h,align:l,offset:d,scale:u,size:_,rotation:p,skew:g,clipSize:f,repeat:y,gap:m,filters:x,interlace:w}=t,v=e.width===i&&e.height===r,b={mode:h},S="center"!==l&&(p||0)%180==90;let k,B;switch(Xt.set(dc,0,0,S?r:i,S?i:r),h&&"cover"!==h&&"fit"!==h?((u||_)&&(I.getScaleData(u,_,s,lc),k=lc.scaleX,B=lc.scaleY),(l||m||y)&&(k&&Xt.scale(dc,k,B,!0),l&&Bt.toPoint(l,dc,e,dc,!0,!0))):v&&!p||(k=B=Xt.getFitScale(e,dc,"fit"!==h),Xt.put(e,s,l,k,!1,dc),Xt.scale(dc,k,B,!0)),d&&at.move(dc,d),h){case"stretch":v?k&&(k=B=void 0):(k=e.width/i,B=e.height/r,Kh.stretchMode(b,e,k,B));break;case"normal":case"clip":if(dc.x||dc.y||k||f||p||g){let t,s;f&&(t=e.width/f.width,s=e.height/f.height),Kh.clipMode(b,e,dc.x,dc.y,k,B,p,g,t,s),t&&(k=k?k*t:t,B=B?B*s:s)}break;case"repeat":(!v||k||p||g)&&Kh.repeatMode(b,e,i,r,dc.x,dc.y,k,B,p,g,l,t.freeTransform),y||(b.repeat="repeat");const s=c(y);(m||s)&&(b.gap=function(t,e,s,i,r){let n,o;c(t)?(n=t.x,o=t.y):n=o=t;return{x:cc(n,s,r.width,e&&e.x),y:cc(o,i,r.height,e&&e.y)}}(m,s&&y,dc.width,dc.height,e));break;default:k&&Kh.fillOrFitMode(b,e,dc.x,dc.y,k,B,p)}return b.transform||(e.x||e.y)&&ac(b.transform=oc(),e.x,e.y),k&&(b.scaleX=k,b.scaleY=B),o&&o<1&&(b.opacity=o),x&&(b.filters=x),y&&(b.repeat=n(y)?"x"===y?"repeat-x":"repeat-y":"repeat"),w&&(b.interlace=a(w)||"percent"===w.type?{type:"x",offset:w}:w),b},stretchMode:function(t,e,s,i){const r=pc(),{x:n,y:o}=e;n||o?yc(r,n,o):r.onlyScale=!0,wc(r,s,i),t.transform=r},fillOrFitMode:function(t,e,s,i,r,n,o){const a=pc();yc(a,e.x+s,e.y+i),wc(a,r,n),o&&fc(a,{x:e.x+e.width/2,y:e.y+e.height/2},o),t.transform=a},clipMode:function(t,e,s,i,r,n,o,a,h,l){const d=pc();Sc(d,e,s,i,r,n,o,a),h&&(o||a?(gc(_c),mc(_c,e,h,l),xc(d,_c)):mc(d,e,h,l)),t.transform=d},repeatMode:function(t,e,s,i,r,n,o,a,h,l,d,c){const u=pc();if(c)Sc(u,e,r,n,o,a,h,l);else{if(h)if("center"===d)fc(u,{x:s/2,y:i/2},h);else switch(vc(u,h),h){case 90:yc(u,i,0);break;case 180:yc(u,s,i);break;case 270:yc(u,0,s)}uc.x=e.x+r,uc.y=e.y+n,yc(u,uc.x,uc.y),o&&mc(u,uc,o,a)}t.transform=u}},{toPoint:Lc}=bt,{hasTransparent:Oc}=Qh,Ec={},Ac={};function Ic(t,e,s,i){if(s){let r,o,a,h;for(let t=0,l=s.length;t<l;t++)r=s[t],n(r)?(a=t/(l-1),o=Qh.string(r,i)):(a=r.offset,o=Qh.string(r.color,i)),e.addColorStop(a,o),!h&&Oc(o)&&(h=!0);h&&(t.isTransparent=!0)}}const{getAngle:Wc,getDistance:Mc}=at,{get:Dc,rotateOfOuter:Fc,scaleOfOuter:zc}=Q,{toPoint:Nc}=bt,Yc={},Xc={};function Uc(t,e,s,i,r){let n;const{width:o,height:a}=t;if(o!==a||i){const t=Wc(e,s);n=Dc(),r?(zc(n,e,o/a*(i||1),1),Fc(n,e,t+90)):(zc(n,e,1,o/a*(i||1)),Fc(n,e,t))}return n}const{getDistance:jc}=at,{toPoint:Vc}=bt,Gc={},Hc={};const qc={linearGradient:function(t,e){let{from:s,to:i,type:r,opacity:n}=t;Lc(s||"top",e,Ec),Lc(i||"bottom",e,Ac);const o=Kt.canvas.createLinearGradient(Ec.x,Ec.y,Ac.x,Ac.y),a={type:r,style:o};return Ic(a,o,t.stops,n),a},radialGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,stretch:o}=t;Nc(s||"center",e,Yc),Nc(i||"bottom",e,Xc);const a=Kt.canvas.createRadialGradient(Yc.x,Yc.y,0,Yc.x,Yc.y,Mc(Yc,Xc)),h={type:r,style:a};Ic(h,a,t.stops,n);const l=Uc(e,Yc,Xc,o,!0);return l&&(h.transform=l),h},conicGradient:function(t,e){let{from:s,to:i,type:r,opacity:n,stretch:o}=t;Vc(s||"center",e,Gc),Vc(i||"bottom",e,Hc);const a=Kt.conicGradientSupport?Kt.canvas.createConicGradient(0,Gc.x,Gc.y):Kt.canvas.createRadialGradient(Gc.x,Gc.y,0,Gc.x,Gc.y,jc(Gc,Hc)),h={type:r,style:a};Ic(h,a,t.stops,n);const l=Uc(e,Gc,Hc,o||1,Kt.conicGradientRotate90);return l&&(h.transform=l),h},getTransform:Uc},{copy:Qc,move:Jc,toOffsetOutBounds:$c}=Xt,{max:Zc,abs:Kc}=Math,tu={},eu=new gt,su={};function iu(t,e){let s,i,r,n,o=0,a=0,h=0,l=0;return e.forEach(t=>{s=t.x||0,i=t.y||0,n=1.5*(t.blur||0),r=Kc(t.spread||0),o=Zc(o,r+n-i),a=Zc(a,r+n+s),h=Zc(h,r+n+i),l=Zc(l,r+n-s)}),o===a&&a===h&&h===l?o:[o,a,h,l]}function ru(t,e,s){const{shapeBounds:i}=s;let r,n;Kt.fullImageShadow?(Qc(tu,t.bounds),Jc(tu,e.x-i.x,e.y-i.y),r=t.bounds,n=tu):(r=i,n=e),t.copyWorld(s.canvas,r,n)}const{toOffsetOutBounds:nu}=Xt,ou={};const au=iu;const hu={shadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{shadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;$c(h,su,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.setWorldShadow(su.offsetX+(o.x||0)*c*f,su.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f,Qh.string(o.color)),r=el.getShadowTransform(t,_,s,o,su,f),r&&_.setTransform(r),ru(_,su,s),r&&_.resetTransform(),i=l,o.box&&(_.restore(),_.save(),a&&(_.copyWorld(_,l,n,"copy"),i=n),a?_.copyWorld(a,n,n,"destination-out"):_.copyWorld(s.canvas,d,h,"destination-out")),lo.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<p&&_.clearWorld(i)}),_.recycle(i)},innerShadow:function(t,e,s){let i,r;const{__nowWorld:n}=t,{innerShadow:o}=t.__,{worldCanvas:a,bounds:h,renderBounds:l,shapeBounds:d,scaleX:c,scaleY:u}=s,_=e.getSameCanvas(),p=o.length-1;nu(h,ou,l),o.forEach((o,g)=>{let f=1;if(o.scaleFixed){const t=Math.abs(n.scaleX);t>1&&(f=1/t)}_.save(),_.setWorldShadow(ou.offsetX+(o.x||0)*c*f,ou.offsetY+(o.y||0)*u*f,(o.blur||0)*c*f),r=el.getShadowTransform(t,_,s,o,ou,f,!0),r&&_.setTransform(r),ru(_,ou,s),_.restore(),a?(_.copyWorld(_,l,n,"copy"),_.copyWorld(a,n,n,"source-out"),i=n):(_.copyWorld(s.canvas,d,h,"source-out"),i=l),_.fillWorld(i,Qh.string(o.color),"source-in"),lo.copyCanvasByWorld(t,e,_,i,o.blendMode),p&&g<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:iu,getShadowTransform:function(t,e,s,i,r,n,o){if(i.spread){const s=2*i.spread*n*(o?-1:1),{width:a,height:h}=t.__layout.strokeBounds;return eu.set().scaleOfOuter({x:(r.x+r.width/2)*e.pixelRatio,y:(r.y+r.height/2)*e.pixelRatio},1+s/a,1+s/h),eu}},isTransformShadow(t){},getInnerShadowSpread:au},{excludeRenderBounds:lu}=mo;let du;function cu(t,e,s,i,r,n,o,a){switch(e){case"grayscale":du||(du=!0,r.useGrayscaleAlpha(t.__nowWorld));case"alpha":!function(t,e,s,i,r,n){const o=t.__nowWorld;s.resetTransform(),s.opacity=1,s.useMask(i,o),n&&i.recycle(o);_u(t,e,s,1,r,n)}(t,s,i,r,o,a);break;case"opacity-path":_u(t,s,i,n,o,a);break;case"path":a&&s.restore()}}function uu(t){return t.getSameCanvas(!1,!0)}function _u(t,e,s,i,r,n){const o=t.__nowWorld;e.resetTransform(),e.opacity=i,e.copyWorld(s,o,void 0,r),n?s.recycle(o):s.clearWorld(o)}Fl.prototype.__renderMask=function(t,e){let s,i,r,n,o,a;const{children:h}=this;for(let l=0,d=h.length;l<d;l++){if(s=h[l],a=s.__.mask,a){o&&(cu(this,o,t,r,i,n,void 0,!0),i=r=null),"clipping"!==a&&"clipping-path"!==a||lu(s,e)||s.__render(t,e),n=s.__.opacity,du=!1,"path"===a||"clipping-path"===a?(n<1?(o="opacity-path",r||(r=uu(t))):(o="path",t.save()),s.__clip(r||t,e)):(o="grayscale"===a?"grayscale":"alpha",i||(i=uu(t)),r||(r=uu(t)),s.__render(i,e));continue}const d=1===n&&s.__.__blendMode;d&&cu(this,o,t,r,i,n,void 0,!1),lu(s,e)||s.__render(r||t,e),d&&cu(this,o,t,r,i,n,d,!1)}cu(this,o,t,r,i,n,void 0,!0)};const pu=">)]}%!?,.:;'\"》)」〉』〗】〕}┐>’”!?,、。:;‰",gu=pu+"_#~&*+\\=|≮≯≈≠=…",fu=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 yu(t){const e={};return t.split("").forEach(t=>e[t]=!0),e}const mu=yu("ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz"),xu=yu("{[(<'\"《(「〈『〖【〔{┌<‘“=¥¥$€££¢¢"),wu=yu(pu),vu=yu(gu),bu=yu("- —/~|┆·");var Su;!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"}(Su||(Su={}));const{Letter:ku,Single:Bu,Before:Ru,After:Cu,Symbol:Pu,Break:Tu}=Su;function Lu(t){return mu[t]?ku:bu[t]?Tu:xu[t]?Ru:wu[t]?Cu:vu[t]?Pu:fu.test(t)?Bu:ku}const Ou={trimRight(t){const{words:e}=t;let s,i=0,r=e.length;for(let n=r-1;n>-1&&(s=e[n].data[0]," "===s.char);n--)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:Au}=Ou,{Letter:Iu,Single:Wu,Before:Mu,After:Du,Symbol:Fu,Break:zu}=Su;let Nu,Yu,Xu,Uu,ju,Vu,Gu,Hu,qu,Qu,Ju,$u,Zu,Ku,t_,e_,s_,i_=[];function r_(t,e){qu&&!Hu&&(Hu=qu),Nu.data.push({char:t,width:e}),Xu+=e}function n_(){Uu+=Xu,Nu.width=Xu,Yu.words.push(Nu),Nu={data:[]},Xu=0}function o_(){Ku&&(t_.paraNumber++,Yu.paraStart=!0,Ku=!1),qu&&(Yu.startCharSize=Hu,Yu.endCharSize=qu,Hu=0),Yu.width=Uu,e_.width?Au(Yu):s_&&a_(),i_.push(Yu),Yu={words:[]},Uu=0}function a_(){Uu>(t_.maxWidth||0)&&(t_.maxWidth=Uu)}const{top:h_,right:l_,bottom:d_,left:c_}=xt;function u_(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 __={getDrawData:function(t,e){n(t)||(t=String(t));let s=0,i=0,r=e.__getInput("width")||0,o=e.__getInput("height")||0;const{__padding:a}=e;a&&(r?(s=a[c_],r-=a[l_]+a[c_],!r&&(r=.01)):e.autoSizeAlign||(s=a[c_]),o?(i=a[h_],o-=a[h_]+a[d_],!o&&(o=.01)):e.autoSizeAlign||(i=a[h_]));const h={bounds:{x:s,y:i,width:r,height:o},rows:[],paraNumber:0,font:Kt.canvas.font=e.__font};return function(t,e,s){t_=t,i_=t.rows,e_=t.bounds,s_=!e_.width&&!s.autoSizeAlign;const{__letterSpacing:i,paraIndent:r,textCase:n}=s,{canvas:o}=Kt,{width:a}=e_;if(s.__isCharMode){const t="none"!==s.textWrap,h="break"===s.textWrap;Ku=!0,Ju=null,Hu=Gu=qu=Xu=Uu=0,Nu={data:[]},Yu={words:[]},i&&(e=[...e]);for(let s=0,l=e.length;s<l;s++)Vu=e[s],"\n"===Vu?(Xu&&n_(),Yu.paraEnd=!0,o_(),Ku=!0):(Qu=Lu(Vu),Qu===Iu&&"none"!==n&&(Vu=Eu(Vu,n,!Xu)),Gu=o.measureText(Vu).width,i&&(i<0&&(qu=Gu),Gu+=i),$u=Qu===Wu&&(Ju===Wu||Ju===Iu)||Ju===Wu&&Qu!==Du,Zu=!(Qu!==Mu&&Qu!==Wu||Ju!==Fu&&Ju!==Du),ju=Ku&&r?a-r:a,t&&a&&Uu+Xu+Gu>ju&&(h?(Xu&&n_(),Uu&&o_()):(Zu||(Zu=Qu===Iu&&Ju==Du),$u||Zu||Qu===zu||Qu===Mu||Qu===Wu||Xu+Gu>ju?(Xu&&n_(),Uu&&o_()):Uu&&o_()))," "===Vu&&!0!==Ku&&Uu+Xu===0||(Qu===zu?(" "===Vu&&Xu&&n_(),r_(Vu,Gu),n_()):$u||Zu?(Xu&&n_(),r_(Vu,Gu)):r_(Vu,Gu)),Ju=Qu);Xu&&n_(),Uu&&o_(),i_.length>0&&(i_[i_.length-1].paraEnd=!0)}else e.split("\n").forEach(t=>{t_.paraNumber++,Uu=o.measureText(t).width,i_.push({x:r||0,text:t,width:Uu,paraStart:!0}),s_&&a_()})}(h,t,e),a&&function(t,e,s,i,r){if(!i&&s.autoSizeAlign)switch(s.textAlign){case"left":u_(e,"x",t[c_]);break;case"right":u_(e,"x",-t[l_])}if(!r&&s.autoSizeAlign)switch(s.verticalAlign){case"top":u_(e,"y",t[h_]);break;case"bottom":u_(e,"y",-t[d_])}}(a,h,e,r,o),function(t,e){const{rows:s,bounds:i}=t,r=s.length,{__lineHeight:n,__baseLine:o,__letterSpacing:a,__clipText:h,textAlign:l,verticalAlign:d,paraSpacing:c,autoSizeAlign:u}=e;let{x:_,y:p,width:g,height:f}=i,y=n*r+(c?c*(t.paraNumber-1):0),m=o;if(h&&y>f)y=Math.max(f,n),r>1&&(t.overflow=r);else if(f||u)switch(d){case"middle":p+=(f-y)/2;break;case"bottom":p+=f-y}m+=p;let x,w,v,b=g||u?g:t.maxWidth;for(let o=0,d=r;o<d;o++){if(x=s[o],x.x=_,x.width<g||x.width>g&&!h)switch(l){case"center":x.x+=(b-x.width)/2;break;case"right":x.x+=b-x.width}x.paraStart&&c&&o>0&&(m+=c),x.y=m,m+=n,t.overflow>o&&m>y&&(x.isOverflow=!0,t.overflow=o+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&&g&&g<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:n,__letterSpacing:o}=e,a=s&&r.includes("both"),h=a||s&&r.includes("justify"),l=h&&r.includes("letter");let d,c,u,_,p,g,f,y,m,x;i.forEach(t=>{t.words&&(p=n&&t.paraStart?n: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),g=o||t.isOverflow||l?0:u?1:2,t.isOverflow&&!o&&(t.textMode=!0),2===g?(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===g?(f={char:"",x:d},d=function(t,e,s){return t.forEach(t=>{s.char+=t.char,e+=t.width}),e}(e.data,d,f),(t.isOverflow||" "!==f.char)&&t.data.push(f)):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,r),h.overflow&&function(t,e,s,i){if(!i)return;const{rows:r,overflow:n}=t;let{textOverflow:o}=e;if(r.splice(n),o&&"show"!==o){let t,a;"hide"===o?o="":"ellipsis"===o&&(o="...");const h=o?Kt.canvas.measureText(o).width:0,l=s+i-h;("none"===e.textWrap?r:[r[n-1]]).forEach(e=>{if(e.isOverflow&&e.data){let s=e.data.length-1;for(let i=s;i>-1&&(t=e.data[i],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:o,x:a}),e.textMode&&function(t){t.text="",t.data.forEach(e=>{t.text+=e.char}),t.data=null}(e)}})}}(h,e,s,r),"none"!==e.textDecoration&&function(t,e){let s,i=0;const{fontSize:r,textDecoration:n}=e;switch(t.decorationHeight=r/11,c(n)?(s=n.type,n.color&&(t.decorationColor=Qh.string(n.color)),n.offset&&(i=Math.min(.3*r,Math.max(n.offset,.15*-r)))):s=n,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 p_={string:function(t,e){if(!t)return"#000";const s=a(e)&&e<1;if(n(t)){if(!s||!Qh.object)return t;t=Qh.object(t)}let r=i(t.a)?1:t.a;s&&(r*=e);const o=t.r+","+t.g+","+t.b;return 1===r?"rgb("+o+")":"rgba("+o+","+r+")"}};Object.assign(qh,__),Object.assign(Qh,p_),Object.assign(Zh,Jd),Object.assign(Kh,Tc),Object.assign(tl,qc),Object.assign(el,hu);try{wx&&Th(0,wx)}catch(t){}export{Bt as AlignHelper,e as Answer,bt as AroundHelper,qt as AutoBounds,ls as BezierHelper,Gt as Bounds,Vo as BoundsEvent,Xt as BoundsHelper,ql as Box,gl as BoxData,bh as Branch,bo as BranchHelper,Na as BranchRender,Bd as Canvas,Pl as CanvasData,ye as CanvasManager,No as ChildEvent,Qh as ColorConvert,de as Creator,p as DataHelper,se as Debug,xt as Direction4,wt as Direction9,el as Effect,Kl as Ellipse,wl as EllipseData,ms as EllipseHelper,zo as Event,ge as EventCreator,ha as Eventer,il as Export,qr as FileHelper,sl as Filter,k as FourNumberHelper,Ql as Frame,yl as FrameData,Fl as Group,pl as GroupData,Sd as Image,Cl as ImageData,jo as ImageEvent,sn as ImageManager,y as IncrementId,Ko as LayoutEvent,Yh as Layouter,uh as Leaf,Ma as LeafBounds,mo as LeafBoundsHelper,f as LeafData,va as LeafDataProxy,xa as LeafEventer,lo as LeafHelper,Fo as LeafLayout,kh as LeafLevelList,Sh as LeafList,Pa as LeafMatrix,Da as LeafRender,Yl as Leafer,Rh as LeaferCanvas,Ae as LeaferCanvasBase,fl as LeaferData,ea as LeaferEvent,an as LeaferImage,bd as Line,ml as LineData,I as MathHelper,gt as Matrix,Q as MatrixHelper,kd as MyImage,Fe as NeedConvertToCanvasCommandMap,M as OneRadian,D as PI2,F as PI_2,Zh as Paint,tl as PaintGradient,Kh as PaintImage,Ed as Path,$h as PathArrow,Mr as PathBounds,Ri as PathCommandDataHelper,Me as PathCommandMap,xs as PathCommandNodeHelper,ii as PathConvert,Ur as PathCorner,Ui as PathCreator,Sl as PathData,rr as PathDrawer,Ie as PathHelper,t as PathNodeHandleType,Xe as PathNumberCommandLengthMap,Ye as PathNumberCommandMap,Ad as Pen,kl as PenData,Kt as Platform,le as Plugin,_t as Point,at as PointHelper,ad as Polygon,vl as PolygonData,Xo as PropertyEvent,Xl as Rect,xl as RectData,Ue as RectHelper,Wl as RectRender,ta as RenderEvent,Uh as Renderer,$o as ResizeEvent,tn as Resource,oe as Run,pd as Star,bl as StarData,rl as State,Jt as StringNumberMap,$r as TaskItem,Zr as TaskProcessor,Od as Text,qh as TextConvert,Rl as TextData,nl as Transition,yt as TwoPointBoundsHelper,Dl as UI,Ol as UIBounds,ue as UICreator,ul as UIData,Al as UIRender,Jh as UnitConvert,Qt as UnitConvertHelper,Po as WaitHelper,Zo as WatchEvent,Lh as Watcher,Pn as affectRenderBoundsType,Bn as affectStrokeBoundsType,un as attr,yn as autoLayoutType,wn as boundsType,Hr as canvasPatch,Ee as canvasSizeAttrs,Hh as createAttr,dn as createDescriptor,zn as cursorType,Nn as dataProcessor,pn as dataType,cn as decorateLeafAttr,Xn as defineDataProcessor,hn as defineKey,_n as defineLeafAttr,Ln as dimType,bn as doBoundsType,Rn as doStrokeType,jh as effectType,s as emptyData,Dn as eraserType,Uo as extraPropertyEventMap,N as getBoundsData,ln as getDescriptor,Y as getMatrixData,z as getPointData,Fn as hitType,d as isArray,u as isData,_ as isEmptyData,o as isFinite,r as isNull,a as isNumber,c as isObject,n as isString,i as isUndefined,Yn as layoutProcessor,oa as leaferTransformAttrMap,Mn as maskType,vn as naturalBoundsType,On as opacityType,jr as path,Sn as pathInputType,kn as pathType,Vr as pen,gn as positionType,Jn as registerUI,$n as registerUIEvent,Vh as resizeType,Gn as rewrite,Hn as rewriteAble,xn as rotationType,mn as scaleType,fn as scrollType,Wn as sortType,Cn as strokeType,Tn as surfaceType,Ht as tempBounds,ft as tempMatrix,pt as tempPoint,l as tryToNumber,Th as useCanvas,Qn as useModule,Bh as version,En as visibleType,Gh as zoomLayerType};
2
2
  //# sourceMappingURL=miniapp.module.min.js.map