@omnimedia/omnitool
Version:
open source video processing tools
1 lines • 54.9 kB
JavaScript
import{a as vt}from"./chunk-UYPHPFEQ.js";import{a as ce}from"./chunk-2B6UHEI4.js";import{a as he,n as le,o as ue}from"./chunk-LFJVYUTB.js";import{D as H,E as ae,a as is,c as ns,d as F,e as qt,f as ee,g as B,j as W,k as L,l as U,m as se,n as re,o as j,p as $,r as Z,s as z,t as gt,u as ie,v as ne,x as oe}from"./chunk-ERLCDDYH.js";var Le=is((Yr,Ge)=>{Ge.exports=Ss;var Ft={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},Ms=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function Ss(o){var t=[];return o.replace(Ms,function(e,s,i){var r=s.toLowerCase();for(i=Ts(i),r=="m"&&i.length>2&&(t.push([s].concat(i.splice(0,2))),r="l",s=s=="m"?"l":"L");;){if(i.length==Ft[r])return i.unshift(s),t.push(i);if(i.length<Ft[r])throw new Error("malformed path data");t.push([s].concat(i.splice(0,Ft[r])))}}),t}var ks=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function Ts(o){var t=o.match(ks);return t?t.map(Number):[]}});function de(o){let t=o.length;if(t<6)return 1;let e=0;for(let s=0,i=o[t-2],r=o[t-1];s<t;s+=2){let n=o[s],a=o[s+1];e+=(n-i)*(a+r),i=n,r=a}return e<0?-1:1}function fe(o,t,e,s,i,r,n,a){let h=o-e*i,l=t-s*i,c=o+e*r,u=t+s*r,f,d;n?(f=s,d=-e):(f=-s,d=e);let p=h+f,m=l+d,g=c+f,b=u+d;return a.push(p,m),a.push(g,b),2}function J(o,t,e,s,i,r,n,a){let h=e-o,l=s-t,c=Math.atan2(h,l),u=Math.atan2(i-o,r-t);a&&c<u?c+=Math.PI*2:!a&&c>u&&(u+=Math.PI*2);let f=c,d=u-c,p=Math.abs(d),m=Math.sqrt(h*h+l*l),g=(15*p*Math.sqrt(m)/Math.PI>>0)+1,b=d/g;if(f+=b,a){n.push(o,t),n.push(e,s);for(let y=1,T=f;y<g;y++,T+=b)n.push(o,t),n.push(o+Math.sin(T)*m,t+Math.cos(T)*m);n.push(o,t),n.push(i,r)}else{n.push(e,s),n.push(o,t);for(let y=1,T=f;y<g;y++,T+=b)n.push(o+Math.sin(T)*m,t+Math.cos(T)*m),n.push(o,t);n.push(i,r),n.push(o,t)}return g*2}function pe(o,t,e,s,i,r){let n=1e-4;if(o.length===0)return;let a=t,h=a.alignment;if(t.alignment!==.5){let q=de(o);e&&(q*=-1),h=(h-.5)*q+.5}let l=new W(o[0],o[1]),c=new W(o[o.length-2],o[o.length-1]),u=s,f=Math.abs(l.x-c.x)<n&&Math.abs(l.y-c.y)<n;if(u){o=o.slice(),f&&(o.pop(),o.pop(),c.set(o[o.length-2],o[o.length-1]));let q=(l.x+c.x)*.5,N=(c.y+l.y)*.5;o.unshift(q,N),o.push(q,N)}let d=i,p=o.length/2,m=o.length,g=d.length/2,b=a.width/2,y=b*b,T=a.miterLimit*a.miterLimit,_=o[0],w=o[1],x=o[2],P=o[3],I=0,A=0,M=-(w-P),S=_-x,R=0,v=0,D=Math.sqrt(M*M+S*S);M/=D,S/=D,M*=b,S*=b;let et=h,k=(1-et)*2,C=et*2;u||(a.cap==="round"?m+=J(_-M*(k-C)*.5,w-S*(k-C)*.5,_-M*k,w-S*k,_+M*C,w+S*C,d,!0)+2:a.cap==="square"&&(m+=fe(_,w,M,S,k,C,!0,d))),d.push(_-M*k,w-S*k),d.push(_+M*C,w+S*C);for(let q=1;q<p-1;++q){_=o[(q-1)*2],w=o[(q-1)*2+1],x=o[q*2],P=o[q*2+1],I=o[(q+1)*2],A=o[(q+1)*2+1],M=-(w-P),S=_-x,D=Math.sqrt(M*M+S*S),M/=D,S/=D,M*=b,S*=b,R=-(P-A),v=x-I,D=Math.sqrt(R*R+v*v),R/=D,v/=D,R*=b,v*=b;let N=x-_,ht=w-P,ct=x-I,lt=A-P,Kt=N*ct+ht*lt,pt=ht*ct-lt*N,ut=pt<0;if(Math.abs(pt)<.001*Math.abs(Kt)){d.push(x-M*k,P-S*k),d.push(x+M*C,P+S*C),Kt>=0&&(a.join==="round"?m+=J(x,P,x-M*k,P-S*k,x-R*k,P-v*k,d,!1)+4:m+=2,d.push(x-R*C,P-v*C),d.push(x+R*k,P+v*k));continue}let Zt=(-M+_)*(-S+P)-(-M+x)*(-S+w),Jt=(-R+I)*(-v+P)-(-R+x)*(-v+A),mt=(N*Jt-ct*Zt)/pt,yt=(lt*Zt-ht*Jt)/pt,It=(mt-x)*(mt-x)+(yt-P)*(yt-P),Y=x+(mt-x)*k,Q=P+(yt-P)*k,O=x-(mt-x)*C,K=P-(yt-P)*C,ss=Math.min(N*N+ht*ht,ct*ct+lt*lt),te=ut?k:C,rs=ss+te*te*y;It<=rs?a.join==="bevel"||It/y>T?(ut?(d.push(Y,Q),d.push(x+M*C,P+S*C),d.push(Y,Q),d.push(x+R*C,P+v*C)):(d.push(x-M*k,P-S*k),d.push(O,K),d.push(x-R*k,P-v*k),d.push(O,K)),m+=2):a.join==="round"?ut?(d.push(Y,Q),d.push(x+M*C,P+S*C),m+=J(x,P,x+M*C,P+S*C,x+R*C,P+v*C,d,!0)+4,d.push(Y,Q),d.push(x+R*C,P+v*C)):(d.push(x-M*k,P-S*k),d.push(O,K),m+=J(x,P,x-M*k,P-S*k,x-R*k,P-v*k,d,!1)+4,d.push(x-R*k,P-v*k),d.push(O,K)):(d.push(Y,Q),d.push(O,K)):(d.push(x-M*k,P-S*k),d.push(x+M*C,P+S*C),a.join==="round"?ut?m+=J(x,P,x+M*C,P+S*C,x+R*C,P+v*C,d,!0)+2:m+=J(x,P,x-M*k,P-S*k,x-R*k,P-v*k,d,!1)+2:a.join==="miter"&&It/y<=T&&(ut?(d.push(O,K),d.push(O,K)):(d.push(Y,Q),d.push(Y,Q)),m+=2),d.push(x-R*k,P-v*k),d.push(x+R*C,P+v*C),m+=2)}_=o[(p-2)*2],w=o[(p-2)*2+1],x=o[(p-1)*2],P=o[(p-1)*2+1],M=-(w-P),S=_-x,D=Math.sqrt(M*M+S*S),M/=D,S/=D,M*=b,S*=b,d.push(x-M*k,P-S*k),d.push(x+M*C,P+S*C),u||(a.cap==="round"?m+=J(x-M*(k-C)*.5,P-S*(k-C)*.5,x-M*k,P-S*k,x+M*C,P+S*C,d,!1)+2:a.cap==="square"&&(m+=fe(x,P,M,S,k,C,!1,d)));let at=1e-4*1e-4;for(let q=g;q<m+g-2;++q)_=d[q*2],w=d[q*2+1],x=d[(q+1)*2],P=d[(q+1)*2+1],I=d[(q+2)*2],A=d[(q+2)*2+1],!(Math.abs(_*(P-A)+x*(A-w)+I*(w-P))<at)&&r.push(q,q+1,q+2)}var me=[{offset:0,color:"white"},{offset:1,color:"black"}],Gt=class Dt{constructor(...t){this.uid=U("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let e=hs(t);e={...e.type==="radial"?Dt.defaultRadialOptions:Dt.defaultLinearOptions,...oe(e)},this._textureSize=e.textureSize,this._wrapMode=e.wrapMode,e.type==="radial"?(this.center=e.center,this.outerCenter=e.outerCenter??this.center,this.innerRadius=e.innerRadius,this.outerRadius=e.outerRadius,this.scale=e.scale,this.rotation=e.rotation):(this.start=e.start,this.end=e.end),this.textureSpace=e.textureSpace,this.type=e.type,e.colorStops.forEach(i=>{this.addColorStop(i.offset,i.color)})}addColorStop(t,e){return this.colorStops.push({offset:t,color:B.shared.setValue(e).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:e}=this.start,{x:s,y:i}=this.end,r=s-t,n=i-e,a=r<0||n<0;if(this._wrapMode==="clamp-to-edge"){if(r<0){let g=t;t=s,s=g,r*=-1}if(n<0){let g=e;e=i,i=g,n*=-1}}let h=this.colorStops.length?this.colorStops:me,l=this._textureSize,{canvas:c,context:u}=ge(l,1),f=a?u.createLinearGradient(this._textureSize,0,0,0):u.createLinearGradient(0,0,this._textureSize,0);ye(f,h),u.fillStyle=f,u.fillRect(0,0,l,1),this.texture=new H({source:new vt({resource:c,addressMode:this._wrapMode})});let d=Math.sqrt(r*r+n*n),p=Math.atan2(n,r),m=new L;m.scale(d/l,1),m.rotate(p),m.translate(t,e),this.textureSpace==="local"&&m.scale(l,l),this.transform=m}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;let t=this.colorStops.length?this.colorStops:me,e=this._textureSize,{canvas:s,context:i}=ge(e,e),{x:r,y:n}=this.center,{x:a,y:h}=this.outerCenter,l=this.innerRadius,c=this.outerRadius,u=a-c,f=h-c,d=e/(c*2),p=(r-u)*d,m=(n-f)*d,g=i.createRadialGradient(p,m,l*d,(a-u)*d,(h-f)*d,c*d);ye(g,t),i.fillStyle=t[t.length-1].color,i.fillRect(0,0,e,e),i.fillStyle=g,i.translate(p,m),i.rotate(this.rotation),i.scale(1,this.scale),i.translate(-p,-m),i.fillRect(0,0,e,e),this.texture=new H({source:new vt({resource:s,addressMode:this._wrapMode})});let b=new L;b.scale(1/d,1/d),b.translate(u,f),this.textureSpace==="local"&&b.scale(e,e),this.transform=b}destroy(){this.texture?.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};Gt.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};Gt.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};var X=Gt;function ye(o,t){for(let e=0;e<t.length;e++){let s=t[e];o.addColorStop(s.offset,s.color)}}function ge(o,t){let e=ae.get().createCanvas(o,t),s=e.getContext("2d");return{canvas:e,context:s}}function hs(o){let t=o[0]??{};return(typeof t=="number"||o[1])&&(j("8.5.2","use options object instead"),t={type:"linear",start:{x:o[0],y:o[1]},end:{x:o[2],y:o[3]},textureSpace:o[4],textureSize:o[5]??X.defaultLinearOptions.textureSize}),t}var xe={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}},xt=class{constructor(t,e){this.uid=U("fillPattern"),this._tick=0,this.transform=new L,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),e&&(t.source.style.addressModeU=xe[e].addressModeU,t.source.style.addressModeV=xe[e].addressModeV)}setTransform(t){let e=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/e.frame.width,1/e.frame.height),this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}};var cs=new L,ls=new z;function be(o,t,e,s){let i=t.matrix?o.copyFrom(t.matrix).invert():o.identity();if(t.textureSpace==="local"){let n=e.getBounds(ls);t.width&&n.pad(t.width);let{x:a,y:h}=n,l=1/n.width,c=1/n.height,u=-a*l,f=-h*c,d=i.a,p=i.b,m=i.c,g=i.d;i.a*=l,i.b*=l,i.c*=c,i.d*=c,i.tx=u*d+f*m+i.tx,i.ty=u*p+f*g+i.ty}else i.translate(t.texture.frame.x,t.texture.frame.y),i.scale(1/t.texture.source.width,1/t.texture.source.height);let r=t.texture.source.style;return!(t.fill instanceof X)&&r.addressMode==="clamp-to-edge"&&(r.addressMode="repeat",r.update()),s&&i.append(cs.copyFrom(s).invert()),i}function Pe(o,t,e,s,i,r,n,a=null){let h=0;e*=t,i*=r;let l=a.a,c=a.b,u=a.c,f=a.d,d=a.tx,p=a.ty;for(;h<n;){let m=o[e],g=o[e+1];s[i]=l*m+u*g+d,s[i+1]=c*m+f*g+p,i+=r,e+=t,h++}}function _e(o,t,e,s){let i=0;for(t*=e;i<s;)o[t]=0,o[t+1]=0,t+=e,i++}function Lt(o,t,e,s,i){let r=t.a,n=t.b,a=t.c,h=t.d,l=t.tx,c=t.ty;e||(e=0),s||(s=2),i||(i=o.length/s-e);let u=e*s;for(let f=0;f<i;f++){let d=o[u],p=o[u+1];o[u]=r*d+a*p+l,o[u+1]=n*d+h*p+c,u+=s}}var us=new L,dt=class{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){let t=this.baseColor,e=t>>16|t&65280|(t&255)<<16,s=this.renderable;return s?ie(e,s.groupColor)+(this.alpha*s.groupAlpha*255<<24):e+(this.alpha*255<<24)}get transform(){return this.renderable?.groupTransform||us}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}};var st={extension:{type:F.ShapeBuilder,name:"circle"},build(o,t){let e,s,i,r,n,a;if(o.type==="circle"){let _=o;if(n=a=_.radius,n<=0)return!1;e=_.x,s=_.y,i=r=0}else if(o.type==="ellipse"){let _=o;if(n=_.halfWidth,a=_.halfHeight,n<=0||a<=0)return!1;e=_.x,s=_.y,i=r=0}else{let _=o,w=_.width/2,x=_.height/2;e=_.x+w,s=_.y+x,n=a=Math.max(0,Math.min(_.radius,Math.min(w,x))),i=w-n,r=x-a}if(i<0||r<0)return!1;let h=Math.ceil(2.3*Math.sqrt(n+a)),l=h*8+(i?4:0)+(r?4:0);if(l===0)return!1;if(h===0)return t[0]=t[6]=e+i,t[1]=t[3]=s+r,t[2]=t[4]=e-i,t[5]=t[7]=s-r,!0;let c=0,u=h*4+(i?2:0)+2,f=u,d=l,p=i+n,m=r,g=e+p,b=e-p,y=s+m;if(t[c++]=g,t[c++]=y,t[--u]=y,t[--u]=b,r){let _=s-m;t[f++]=b,t[f++]=_,t[--d]=_,t[--d]=g}for(let _=1;_<h;_++){let w=Math.PI/2*(_/h),x=i+Math.cos(w)*n,P=r+Math.sin(w)*a,I=e+x,A=e-x,M=s+P,S=s-P;t[c++]=I,t[c++]=M,t[--u]=M,t[--u]=A,t[f++]=A,t[f++]=S,t[--d]=S,t[--d]=I}p=i,m=r+a,g=e+p,b=e-p,y=s+m;let T=s-m;return t[c++]=g,t[c++]=y,t[--d]=T,t[--d]=g,i&&(t[c++]=b,t[c++]=y,t[--d]=T,t[--d]=b),!0},triangulate(o,t,e,s,i,r){if(o.length===0)return;let n=0,a=0;for(let c=0;c<o.length;c+=2)n+=o[c],a+=o[c+1];n/=o.length/2,a/=o.length/2;let h=s;t[h*e]=n,t[h*e+1]=a;let l=h++;for(let c=0;c<o.length;c+=2)t[h*e]=o[c],t[h*e+1]=o[c+1],c>0&&(i[r++]=h,i[r++]=l,i[r++]=h-1),h++;i[r++]=l+1,i[r++]=l,i[r++]=h-1}},Me={...st,extension:{...st.extension,name:"ellipse"}},Se={...st,extension:{...st.extension,name:"roundedRectangle"}};function ke(o,t,e,s){let i=1e-4;if(o.length===0)return;let r=o[0],n=o[1],a=o[o.length-2],h=o[o.length-1],l=t||Math.abs(r-a)<i&&Math.abs(n-h)<i,c=e,u=o.length/2,f=c.length/2;for(let d=0;d<u;d++)c.push(o[d*2]),c.push(o[d*2+1]);for(let d=0;d<u-1;d++)s.push(f+d,f+d+1);l&&s.push(f+u-1,f)}function bt(o,t,e,s,i,r,n){let a=he(o,t,2);if(!a)return;for(let l=0;l<a.length;l+=3)r[n++]=a[l]+i,r[n++]=a[l+1]+i,r[n++]=a[l+2]+i;let h=i*s;for(let l=0;l<o.length;l+=2)e[h]=o[l],e[h+1]=o[l+1],h+=s}var ds=[],Te={extension:{type:F.ShapeBuilder,name:"polygon"},build(o,t){for(let e=0;e<o.points.length;e++)t[e]=o.points[e];return!0},triangulate(o,t,e,s,i,r){bt(o,ds,t,e,s,i,r)}};var we={extension:{type:F.ShapeBuilder,name:"rectangle"},build(o,t){let e=o,s=e.x,i=e.y,r=e.width,n=e.height;return r>0&&n>0?(t[0]=s,t[1]=i,t[2]=s+r,t[3]=i,t[4]=s+r,t[5]=i+n,t[6]=s,t[7]=i+n,!0):!1},triangulate(o,t,e,s,i,r){let n=0;s*=e,t[s+n]=o[0],t[s+n+1]=o[1],n+=e,t[s+n]=o[2],t[s+n+1]=o[3],n+=e,t[s+n]=o[6],t[s+n+1]=o[7],n+=e,t[s+n]=o[4],t[s+n+1]=o[5],n+=e;let a=s/e;i[r++]=a,i[r++]=a+1,i[r++]=a+2,i[r++]=a+1,i[r++]=a+3,i[r++]=a+2}};var Ce={extension:{type:F.ShapeBuilder,name:"triangle"},build(o,t){return t[0]=o.x,t[1]=o.y,t[2]=o.x2,t[3]=o.y2,t[4]=o.x3,t[5]=o.y3,!0},triangulate(o,t,e,s,i,r){let n=0;s*=e,t[s+n]=o[0],t[s+n+1]=o[1],n+=e,t[s+n]=o[2],t[s+n+1]=o[3],n+=e,t[s+n]=o[4],t[s+n+1]=o[5];let a=s/e;i[r++]=a,i[r++]=a+1,i[r++]=a+2}};var Pt={};qt.handleByMap(F.ShapeBuilder,Pt);qt.add(we,Te,Ce,st,Me,Se);var fs=new z,ps=new L;function Ae(o,t){let{geometryData:e,batches:s}=t;s.length=0,e.indices.length=0,e.vertices.length=0,e.uvs.length=0;for(let i=0;i<o.instructions.length;i++){let r=o.instructions[i];if(r.action==="texture")ms(r.data,s,e);else if(r.action==="fill"||r.action==="stroke"){let n=r.action==="stroke",a=r.data.path.shapePath,h=r.data.style,l=r.data.hole;n&&l&&Re(l.shapePath,h,!0,s,e),l&&(a.shapePrimitives[a.shapePrimitives.length-1].holes=l.shapePath.shapePrimitives),Re(a,h,n,s,e)}}}function ms(o,t,e){let s=[],i=Pt.rectangle,r=fs;r.x=o.dx,r.y=o.dy,r.width=o.dw,r.height=o.dh;let n=o.transform;if(!i.build(r,s))return;let{vertices:a,uvs:h,indices:l}=e,c=l.length,u=a.length/2;n&&Lt(s,n),i.triangulate(s,a,2,u,l,c);let f=o.image,d=f.uvs;h.push(d.x0,d.y0,d.x1,d.y1,d.x3,d.y3,d.x2,d.y2);let p=Z.get(dt);p.indexOffset=c,p.indexSize=l.length-c,p.attributeOffset=u,p.attributeSize=a.length/2-u,p.baseColor=o.style,p.alpha=o.alpha,p.texture=f,p.geometryData=e,t.push(p)}function Re(o,t,e,s,i){let{vertices:r,uvs:n,indices:a}=i;o.shapePrimitives.forEach(({shape:h,transform:l,holes:c})=>{let u=[],f=Pt[h.type];if(!f.build(h,u))return;let d=a.length,p=r.length/2,m="triangle-list";if(l&&Lt(u,l),e){let T=h.closePath??!0,_=t;_.pixelLine?(ke(u,T,r,a),m="line-list"):pe(u,_,!1,T,r,a)}else if(c){let T=[],_=u.slice();ys(c).forEach(x=>{T.push(_.length/2),_.push(...x)}),bt(_,T,r,2,p,a,d)}else f.triangulate(u,r,2,p,a,d);let g=n.length/2,b=t.texture;if(b!==H.WHITE){let T=be(ps,t,h,l);Pe(r,2,p,n,g,2,r.length/2-p,T)}else _e(n,g,2,r.length/2-p);let y=Z.get(dt);y.indexOffset=d,y.indexSize=a.length-d,y.attributeOffset=p,y.attributeSize=r.length/2-p,y.baseColor=t.color,y.alpha=t.alpha,y.texture=b,y.geometryData=i,y.topology=m,s.push(y)})}function ys(o){let t=[];for(let e=0;e<o.length;e++){let s=o[e].shape,i=[];Pt[s.type].build(s,i)&&t.push(i)}return t}function gs(o){return B.isColorLike(o)}function Ie(o){return o instanceof xt}function qe(o){return o instanceof X}function xs(o){return o instanceof H}function bs(o,t,e){let s=B.shared.setValue(t??0);return o.color=s.toNumber(),o.alpha=s.alpha===1?e.alpha:s.alpha,o.texture=H.WHITE,{...e,...o}}function Ps(o,t,e){return o.texture=t,{...e,...o}}function ve(o,t,e){return o.fill=t,o.color=16777215,o.texture=t.texture,o.matrix=t.transform,{...e,...o}}function De(o,t,e){return t.buildGradient(),o.fill=t,o.color=16777215,o.texture=t.texture,o.matrix=t.transform,o.textureSpace=t.textureSpace,{...e,...o}}function _s(o,t){let e={...t,...o},s=B.shared.setValue(e.color);return e.alpha*=s.alpha,e.color=s.toNumber(),e}function rt(o,t){if(o==null)return null;let e={},s=o;return gs(o)?bs(e,o,t):xs(o)?Ps(e,o,t):Ie(o)?ve(e,o,t):qe(o)?De(e,o,t):s.fill&&Ie(s.fill)?ve(s,s.fill,t):s.fill&&qe(s.fill)?De(s,s.fill,t):_s(s,t)}function zt(o,t){let{width:e,alignment:s,miterLimit:i,cap:r,join:n,pixelLine:a,...h}=t,l=rt(o,h);return l?{width:e,alignment:s,miterLimit:i,cap:r,join:n,pixelLine:a,...l}:null}var ze=ns(Le(),1);function Fe(o,t){let e=(0,ze.default)(o),s=[],i=null,r=0,n=0;for(let a=0;a<e.length;a++){let h=e[a],l=h[0],c=h;switch(l){case"M":r=c[1],n=c[2],t.moveTo(r,n);break;case"m":r+=c[1],n+=c[2],t.moveTo(r,n);break;case"H":r=c[1],t.lineTo(r,n);break;case"h":r+=c[1],t.lineTo(r,n);break;case"V":n=c[1],t.lineTo(r,n);break;case"v":n+=c[1],t.lineTo(r,n);break;case"L":r=c[1],n=c[2],t.lineTo(r,n);break;case"l":r+=c[1],n+=c[2],t.lineTo(r,n);break;case"C":r=c[5],n=c[6],t.bezierCurveTo(c[1],c[2],c[3],c[4],r,n);break;case"c":t.bezierCurveTo(r+c[1],n+c[2],r+c[3],n+c[4],r+c[5],n+c[6]),r+=c[5],n+=c[6];break;case"S":r=c[3],n=c[4],t.bezierCurveToShort(c[1],c[2],r,n);break;case"s":t.bezierCurveToShort(r+c[1],n+c[2],r+c[3],n+c[4]),r+=c[3],n+=c[4];break;case"Q":r=c[3],n=c[4],t.quadraticCurveTo(c[1],c[2],r,n);break;case"q":t.quadraticCurveTo(r+c[1],n+c[2],r+c[3],n+c[4]),r+=c[3],n+=c[4];break;case"T":r=c[1],n=c[2],t.quadraticCurveToShort(r,n);break;case"t":r+=c[1],n+=c[2],t.quadraticCurveToShort(r,n);break;case"A":r=c[6],n=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],r,n);break;case"a":r+=c[6],n+=c[7],t.arcToSvg(c[1],c[2],c[3],c[4],c[5],r,n);break;case"Z":case"z":t.closePath(),s.length>0&&(i=s.pop(),i?(r=i.startX,n=i.startY):(r=0,n=0)),i=null;break;default:$(`Unknown SVG path command: ${l}`)}l!=="Z"&&l!=="z"&&i===null&&(i={startX:r,startY:n},s.push(i))}return t}var _t=class o{constructor(t=0,e=0,s=0){this.type="circle",this.x=t,this.y=e,this.radius=s}clone(){return new o(this.x,this.y,this.radius)}contains(t,e){if(this.radius<=0)return!1;let s=this.radius*this.radius,i=this.x-t,r=this.y-e;return i*=i,r*=r,i+r<=s}strokeContains(t,e,s,i=.5){if(this.radius===0)return!1;let r=this.x-t,n=this.y-e,a=this.radius,h=(1-i)*s,l=Math.sqrt(r*r+n*n);return l<=a+h&&l>a-(s-h)}getBounds(t){return t||(t=new z),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}};var Mt=class o{constructor(t=0,e=0,s=0,i=0){this.type="ellipse",this.x=t,this.y=e,this.halfWidth=s,this.halfHeight=i}clone(){return new o(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,e){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let s=(t-this.x)/this.halfWidth,i=(e-this.y)/this.halfHeight;return s*=s,i*=i,s+i<=1}strokeContains(t,e,s,i=.5){let{halfWidth:r,halfHeight:n}=this;if(r<=0||n<=0)return!1;let a=s*(1-i),h=s-a,l=r-h,c=n-h,u=r+a,f=n+a,d=t-this.x,p=e-this.y,m=d*d/(l*l)+p*p/(c*c),g=d*d/(u*u)+p*p/(f*f);return m>1&&g<=1}getBounds(t){return t||(t=new z),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}};function Be(o,t,e,s,i,r){let n=o-e,a=t-s,h=i-e,l=r-s,c=n*h+a*l,u=h*h+l*l,f=-1;u!==0&&(f=c/u);let d,p;f<0?(d=e,p=s):f>1?(d=i,p=r):(d=e+f*h,p=s+f*l);let m=o-d,g=t-p;return m*m+g*g}var ws,Cs,it=class o{constructor(...t){this.type="polygon";let e=Array.isArray(t[0])?t[0]:t;if(typeof e[0]!="number"){let s=[];for(let i=0,r=e.length;i<r;i++)s.push(e[i].x,e[i].y);e=s}this.points=e,this.closePath=!0}isClockwise(){let t=0,e=this.points,s=e.length;for(let i=0;i<s;i+=2){let r=e[i],n=e[i+1],a=e[(i+2)%s],h=e[(i+3)%s];t+=(a-r)*(h+n)}return t<0}containsPolygon(t){let e=this.getBounds(ws),s=t.getBounds(Cs);if(!e.containsRect(s))return!1;let i=t.points;for(let r=0;r<i.length;r+=2){let n=i[r],a=i[r+1];if(!this.contains(n,a))return!1}return!0}clone(){let t=this.points.slice(),e=new o(t);return e.closePath=this.closePath,e}contains(t,e){let s=!1,i=this.points.length/2;for(let r=0,n=i-1;r<i;n=r++){let a=this.points[r*2],h=this.points[r*2+1],l=this.points[n*2],c=this.points[n*2+1];h>e!=c>e&&t<(l-a)*((e-h)/(c-h))+a&&(s=!s)}return s}strokeContains(t,e,s,i=.5){let r=s*s,n=r*(1-i),a=r-n,{points:h}=this,l=h.length-(this.closePath?0:2);for(let c=0;c<l;c+=2){let u=h[c],f=h[c+1],d=h[(c+2)%h.length],p=h[(c+3)%h.length],m=Be(t,e,u,f,d,p),g=Math.sign((d-u)*(e-f)-(p-f)*(t-u));if(m<=(g<0?a:n))return!0}return!1}getBounds(t){t||(t=new z);let e=this.points,s=1/0,i=-1/0,r=1/0,n=-1/0;for(let a=0,h=e.length;a<h;a+=2){let l=e[a],c=e[a+1];s=l<s?l:s,i=l>i?l:i,r=c<r?c:r,n=c>n?c:n}return t.x=s,t.width=i-s,t.y=r,t.height=n-r,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,e)=>`${t}, ${e}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return j("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return j("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}};var St=(o,t,e,s,i,r,n)=>{let a=o-e,h=t-s,l=Math.sqrt(a*a+h*h);return l>=i-r&&l<=i+n},kt=class o{constructor(t=0,e=0,s=0,i=0,r=20){this.type="roundedRectangle",this.x=t,this.y=e,this.width=s,this.height=i,this.radius=r}getBounds(t){return t||(t=new z),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new o(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,e){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&e>=this.y&&e<=this.y+this.height){let s=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(e>=this.y+s&&e<=this.y+this.height-s||t>=this.x+s&&t<=this.x+this.width-s)return!0;let i=t-(this.x+s),r=e-(this.y+s),n=s*s;if(i*i+r*r<=n||(i=t-(this.x+this.width-s),i*i+r*r<=n)||(r=e-(this.y+this.height-s),i*i+r*r<=n)||(i=t-(this.x+s),i*i+r*r<=n))return!0}return!1}strokeContains(t,e,s,i=.5){let{x:r,y:n,width:a,height:h,radius:l}=this,c=s*(1-i),u=s-c,f=r+l,d=n+l,p=a-l*2,m=h-l*2,g=r+a,b=n+h;return(t>=r-c&&t<=r+u||t>=g-u&&t<=g+c)&&e>=d&&e<=d+m||(e>=n-c&&e<=n+u||e>=b-u&&e<=b+c)&&t>=f&&t<=f+p?!0:t<f&&e<d&&St(t,e,f,d,l,u,c)||t>g-l&&e<d&&St(t,e,g-l,d,l,u,c)||t>g-l&&e>b-l&&St(t,e,g-l,b-l,l,u,c)||t<f&&e>b-l&&St(t,e,f,b-l,l,u,c)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}};var Bt=class{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(t=>{Z.return(t)}),this.graphicsData&&Z.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}},Et=class{constructor(){this.instructions=new ne}init(t){let e=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(e):this.batcher=new le({maxTextures:e}),this.instructions.reset()}get geometry(){return j(re,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}},Vt=class Ht{constructor(t){this._renderer=t,this._managedContexts=new ue({renderer:t,type:"resource",name:"graphicsContext"})}init(t){Ht.defaultOptions.bezierSmoothness=t?.bezierSmoothness??Ht.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){let e=!!t._gpuData[this._renderer.uid],s=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!e){e&&s.reset(),Ae(t,s);let i=t.batchMode;t.customShader||i==="no-batch"?s.isBatchable=!1:i==="auto"?s.isBatchable=s.geometryData.vertices.length<400:s.isBatchable=!0,t.dirty=!1}return s}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){let e=Z.get(Et,{maxTextures:this._renderer.limits.maxBatchableTextures}),s=t._gpuData[this._renderer.uid],{batches:i,geometryData:r}=s;s.graphicsData=e;let n=r.vertices.length,a=r.indices.length;for(let u=0;u<i.length;u++)i[u].applyTransform=!1;let h=e.batcher;h.ensureAttributeBuffer(n),h.ensureIndexBuffer(a),h.begin();for(let u=0;u<i.length;u++){let f=i[u];h.add(f)}h.finish(e.instructions);let l=h.geometry;l.indexBuffer.setDataWithSize(h.indexBuffer,h.indexSize,!0),l.buffers[0].setDataWithSize(h.attributeBuffer.float32View,h.attributeSize,!0);let c=h.batches;for(let u=0;u<c.length;u++){let f=c[u];f.bindGroup=ce(f.textures.textures,f.textures.count,this._renderer.limits.maxBatchableTextures)}return e}_initContext(t){let e=new Bt;return e.context=t,t._gpuData[this._renderer.uid]=e,this._managedContexts.add(t),e}destroy(){this._managedContexts.destroy(),this._renderer=null}};Vt.extension={type:[F.WebGLSystem,F.WebGPUSystem],name:"graphicsContext"};Vt.defaultOptions={bezierSmoothness:.5};var Tt=Vt;var Rs=8,wt=11920929e-14,As=1,Wt=.01,nt=0,tt=0;function Ct(o,t,e,s,i,r,n,a,h,l){let u=Math.min(.99,Math.max(0,l??Tt.defaultOptions.bezierSmoothness)),f=(As-u)/1;return f*=f,Is(t,e,s,i,r,n,a,h,o,f),o}function Is(o,t,e,s,i,r,n,a,h,l){jt(o,t,e,s,i,r,n,a,h,l,0),h.push(n,a)}function jt(o,t,e,s,i,r,n,a,h,l,c){if(c>Rs)return;let u=Math.PI,f=(o+e)/2,d=(t+s)/2,p=(e+i)/2,m=(s+r)/2,g=(i+n)/2,b=(r+a)/2,y=(f+p)/2,T=(d+m)/2,_=(p+g)/2,w=(m+b)/2,x=(y+_)/2,P=(T+w)/2;if(c>0){let I=n-o,A=a-t,M=Math.abs((e-n)*A-(s-a)*I),S=Math.abs((i-n)*A-(r-a)*I),R,v;if(M>wt&&S>wt){if((M+S)*(M+S)<=l*(I*I+A*A)){if(nt<Wt){h.push(x,P);return}let D=Math.atan2(r-s,i-e);if(R=Math.abs(D-Math.atan2(s-t,e-o)),v=Math.abs(Math.atan2(a-r,n-i)-D),R>=u&&(R=2*u-R),v>=u&&(v=2*u-v),R+v<nt){h.push(x,P);return}if(tt!==0){if(R>tt){h.push(e,s);return}if(v>tt){h.push(i,r);return}}}}else if(M>wt){if(M*M<=l*(I*I+A*A)){if(nt<Wt){h.push(x,P);return}if(R=Math.abs(Math.atan2(r-s,i-e)-Math.atan2(s-t,e-o)),R>=u&&(R=2*u-R),R<nt){h.push(e,s),h.push(i,r);return}if(tt!==0&&R>tt){h.push(e,s);return}}}else if(S>wt){if(S*S<=l*(I*I+A*A)){if(nt<Wt){h.push(x,P);return}if(R=Math.abs(Math.atan2(a-r,n-i)-Math.atan2(r-s,i-e)),R>=u&&(R=2*u-R),R<nt){h.push(e,s),h.push(i,r);return}if(tt!==0&&R>tt){h.push(i,r);return}}}else if(I=x-(o+n)/2,A=P-(t+a)/2,I*I+A*A<=l){h.push(x,P);return}}jt(o,t,f,d,y,T,x,P,h,l,c+1),jt(x,P,_,w,g,b,n,a,h,l,c+1)}var qs=8,vs=11920929e-14,Ds=1,Gs=.01,Ee=0;function He(o,t,e,s,i,r,n,a){let l=Math.min(.99,Math.max(0,a??Tt.defaultOptions.bezierSmoothness)),c=(Ds-l)/1;return c*=c,Ls(t,e,s,i,r,n,o,c),o}function Ls(o,t,e,s,i,r,n,a){Nt(n,o,t,e,s,i,r,a,0),n.push(i,r)}function Nt(o,t,e,s,i,r,n,a,h){if(h>qs)return;let l=Math.PI,c=(t+s)/2,u=(e+i)/2,f=(s+r)/2,d=(i+n)/2,p=(c+f)/2,m=(u+d)/2,g=r-t,b=n-e,y=Math.abs((s-r)*b-(i-n)*g);if(y>vs){if(y*y<=a*(g*g+b*b)){if(Ee<Gs){o.push(p,m);return}let T=Math.abs(Math.atan2(n-i,r-s)-Math.atan2(i-e,s-t));if(T>=l&&(T=2*l-T),T<Ee){o.push(p,m);return}}}else if(g=p-(t+r)/2,b=m-(e+n)/2,g*g+b*b<=a){o.push(p,m);return}Nt(o,t,e,c,u,p,m,a,h+1),Nt(o,p,m,f,d,r,n,a,h+1)}function Rt(o,t,e,s,i,r,n,a){let h=Math.abs(i-r);(!n&&i>r||n&&r>i)&&(h=2*Math.PI-h),a||(a=Math.max(6,Math.floor(6*Math.pow(s,1/3)*(h/Math.PI)))),a=Math.max(a,3);let l=h/a,c=i;l*=n?-1:1;for(let u=0;u<a+1;u++){let f=Math.cos(c),d=Math.sin(c),p=t+f*s,m=e+d*s;o.push(p,m),c+=l}}function Ve(o,t,e,s,i,r){let n=o[o.length-2],h=o[o.length-1]-e,l=n-t,c=i-e,u=s-t,f=Math.abs(h*u-l*c);if(f<1e-8||r===0){(o[o.length-2]!==t||o[o.length-1]!==e)&&o.push(t,e);return}let d=h*h+l*l,p=c*c+u*u,m=h*c+l*u,g=r*Math.sqrt(d)/f,b=r*Math.sqrt(p)/f,y=g*m/d,T=b*m/p,_=g*u+b*l,w=g*c+b*h,x=l*(b+y),P=h*(b+y),I=u*(g+T),A=c*(g+T),M=Math.atan2(P-w,x-_),S=Math.atan2(A-w,I-_);Rt(o,_+t,w+e,r,M,S,l*c>u*h)}var ft=Math.PI*2,Ut={centerX:0,centerY:0,ang1:0,ang2:0},$t=({x:o,y:t},e,s,i,r,n,a,h)=>{o*=e,t*=s;let l=i*o-r*t,c=r*o+i*t;return h.x=l+n,h.y=c+a,h};function zs(o,t){let e=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),s=t===1.5707963267948966?.551915024494:e,i=Math.cos(o),r=Math.sin(o),n=Math.cos(o+t),a=Math.sin(o+t);return[{x:i-r*s,y:r+i*s},{x:n+a*s,y:a-n*s},{x:n,y:a}]}var We=(o,t,e,s)=>{let i=o*s-t*e<0?-1:1,r=o*e+t*s;return r>1&&(r=1),r<-1&&(r=-1),i*Math.acos(r)},Fs=(o,t,e,s,i,r,n,a,h,l,c,u,f)=>{let d=Math.pow(i,2),p=Math.pow(r,2),m=Math.pow(c,2),g=Math.pow(u,2),b=d*p-d*g-p*m;b<0&&(b=0),b/=d*g+p*m,b=Math.sqrt(b)*(n===a?-1:1);let y=b*i/r*u,T=b*-r/i*c,_=l*y-h*T+(o+e)/2,w=h*y+l*T+(t+s)/2,x=(c-y)/i,P=(u-T)/r,I=(-c-y)/i,A=(-u-T)/r,M=We(1,0,x,P),S=We(x,P,I,A);a===0&&S>0&&(S-=ft),a===1&&S<0&&(S+=ft),f.centerX=_,f.centerY=w,f.ang1=M,f.ang2=S};function je(o,t,e,s,i,r,n,a=0,h=0,l=0){if(r===0||n===0)return;let c=Math.sin(a*ft/360),u=Math.cos(a*ft/360),f=u*(t-s)/2+c*(e-i)/2,d=-c*(t-s)/2+u*(e-i)/2;if(f===0&&d===0)return;r=Math.abs(r),n=Math.abs(n);let p=Math.pow(f,2)/Math.pow(r,2)+Math.pow(d,2)/Math.pow(n,2);p>1&&(r*=Math.sqrt(p),n*=Math.sqrt(p)),Fs(t,e,s,i,r,n,h,l,c,u,f,d,Ut);let{ang1:m,ang2:g}=Ut,{centerX:b,centerY:y}=Ut,T=Math.abs(g)/(ft/4);Math.abs(1-T)<1e-7&&(T=1);let _=Math.max(Math.ceil(T),1);g/=_;let w=o[o.length-2],x=o[o.length-1],P={x:0,y:0};for(let I=0;I<_;I++){let A=zs(m,g),{x:M,y:S}=$t(A[0],r,n,u,c,b,y,P),{x:R,y:v}=$t(A[1],r,n,u,c,b,y,P),{x:D,y:et}=$t(A[2],r,n,u,c,b,y,P);Ct(o,w,x,M,S,R,v,D,et),w=D,x=et,m+=g}}function Ne(o,t,e){let s=(n,a)=>{let h=a.x-n.x,l=a.y-n.y,c=Math.sqrt(h*h+l*l),u=h/c,f=l/c;return{len:c,nx:u,ny:f}},i=(n,a)=>{n===0?o.moveTo(a.x,a.y):o.lineTo(a.x,a.y)},r=t[t.length-1];for(let n=0;n<t.length;n++){let a=t[n%t.length],h=a.radius??e;if(h<=0){i(n,a),r=a;continue}let l=t[(n+1)%t.length],c=s(a,r),u=s(a,l);if(c.len<1e-4||u.len<1e-4){i(n,a),r=a;continue}let f=Math.asin(c.nx*u.ny-c.ny*u.nx),d=1,p=!1;c.nx*u.nx-c.ny*-u.ny<0?f<0?f=Math.PI+f:(f=Math.PI-f,d=-1,p=!0):f>0&&(d=-1,p=!0);let m=f/2,g,b=Math.abs(Math.cos(m)*h/Math.sin(m));b>Math.min(c.len/2,u.len/2)?(b=Math.min(c.len/2,u.len/2),g=Math.abs(b*Math.sin(m)/Math.cos(m))):g=h;let y=a.x+u.nx*b+-u.ny*g*d,T=a.y+u.ny*b+u.nx*g*d,_=Math.atan2(c.ny,c.nx)+Math.PI/2*d,w=Math.atan2(u.ny,u.nx)-Math.PI/2*d;n===0&&o.moveTo(y+Math.cos(_)*g,T+Math.sin(_)*g),o.arc(y,T,g,_,w,p),r=a}}function Ue(o,t,e,s){let i=(a,h)=>Math.sqrt((a.x-h.x)**2+(a.y-h.y)**2),r=(a,h,l)=>({x:a.x+(h.x-a.x)*l,y:a.y+(h.y-a.y)*l}),n=t.length;for(let a=0;a<n;a++){let h=t[(a+1)%n],l=h.radius??e;if(l<=0){a===0?o.moveTo(h.x,h.y):o.lineTo(h.x,h.y);continue}let c=t[a],u=t[(a+2)%n],f=i(c,h),d;if(f<1e-4)d=h;else{let g=Math.min(f/2,l);d=r(h,c,g/f)}let p=i(u,h),m;if(p<1e-4)m=h;else{let g=Math.min(p/2,l);m=r(h,u,g/p)}a===0?o.moveTo(d.x,d.y):o.lineTo(d.x,d.y),o.quadraticCurveTo(h.x,h.y,m.x,m.y,s)}}var Bs=new z,At=class{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new gt,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,e){return this.startPoly(t,e),this}lineTo(t,e){this._ensurePoly();let s=this._currentPoly.points,i=s[s.length-2],r=s[s.length-1];return(i!==t||r!==e)&&s.push(t,e),this}arc(t,e,s,i,r,n){this._ensurePoly(!1);let a=this._currentPoly.points;return Rt(a,t,e,s,i,r,n),this}arcTo(t,e,s,i,r){this._ensurePoly();let n=this._currentPoly.points;return Ve(n,t,e,s,i,r),this}arcToSvg(t,e,s,i,r,n,a){let h=this._currentPoly.points;return je(h,this._currentPoly.lastX,this._currentPoly.lastY,n,a,t,e,s,i,r),this}bezierCurveTo(t,e,s,i,r,n,a){this._ensurePoly();let h=this._currentPoly;return Ct(this._currentPoly.points,h.lastX,h.lastY,t,e,s,i,r,n,a),this}quadraticCurveTo(t,e,s,i,r){this._ensurePoly();let n=this._currentPoly;return He(this._currentPoly.points,n.lastX,n.lastY,t,e,s,i,r),this}closePath(){return this.endPoly(!0),this}addPath(t,e){this.endPoly(),e&&!e.isIdentity()&&(t=t.clone(!0),t.transform(e));let s=this.shapePrimitives,i=s.length;for(let r=0;r<t.instructions.length;r++){let n=t.instructions[r];this[n.action](...n.data)}if(t.checkForHoles&&s.length-i>1){let r=null;for(let n=i;n<s.length;n++){let a=s[n];if(a.shape.type==="polygon"){let h=a.shape,l=r?.shape;l&&l.containsPolygon(h)?(r.holes||(r.holes=[]),r.holes.push(a),s.copyWithin(n,n+1),s.length--,n--):r=a}}}return this}finish(t=!1){this.endPoly(t)}rect(t,e,s,i,r){return this.drawShape(new z(t,e,s,i),r),this}circle(t,e,s,i){return this.drawShape(new _t(t,e,s),i),this}poly(t,e,s){let i=new it(t);return i.closePath=e,this.drawShape(i,s),this}regularPoly(t,e,s,i,r=0,n){i=Math.max(i|0,3);let a=-1*Math.PI/2+r,h=Math.PI*2/i,l=[];for(let c=0;c<i;c++){let u=a-c*h;l.push(t+s*Math.cos(u),e+s*Math.sin(u))}return this.poly(l,!0,n),this}roundPoly(t,e,s,i,r,n=0,a){if(i=Math.max(i|0,3),r<=0)return this.regularPoly(t,e,s,i,n);let h=s*Math.sin(Math.PI/i)-.001;r=Math.min(r,h);let l=-1*Math.PI/2+n,c=Math.PI*2/i,u=(i-2)*Math.PI/i/2;for(let f=0;f<i;f++){let d=f*c+l,p=t+s*Math.cos(d),m=e+s*Math.sin(d),g=d+Math.PI+u,b=d-Math.PI-u,y=p+r*Math.cos(g),T=m+r*Math.sin(g),_=p+r*Math.cos(b),w=m+r*Math.sin(b);f===0?this.moveTo(y,T):this.lineTo(y,T),this.quadraticCurveTo(p,m,_,w,a)}return this.closePath()}roundShape(t,e,s=!1,i){return t.length<3?this:(s?Ue(this,t,e,i):Ne(this,t,e),this.closePath())}filletRect(t,e,s,i,r){if(r===0)return this.rect(t,e,s,i);let n=Math.min(s,i)/2,a=Math.min(n,Math.max(-n,r)),h=t+s,l=e+i,c=a<0?-a:0,u=Math.abs(a);return this.moveTo(t,e+u).arcTo(t+c,e+c,t+u,e,u).lineTo(h-u,e).arcTo(h-c,e+c,h,e+u,u).lineTo(h,l-u).arcTo(h-c,l-c,t+s-u,l,u).lineTo(t+u,l).arcTo(t+c,l-c,t,l-u,u).closePath()}chamferRect(t,e,s,i,r,n){if(r<=0)return this.rect(t,e,s,i);let a=Math.min(r,Math.min(s,i)/2),h=t+s,l=e+i,c=[t+a,e,h-a,e,h,e+a,h,l-a,h-a,l,t+a,l,t,l-a,t,e+a];for(let u=c.length-1;u>=2;u-=2)c[u]===c[u-2]&&c[u-1]===c[u-3]&&c.splice(u-1,2);return this.poly(c,!0,n)}ellipse(t,e,s,i,r){return this.drawShape(new Mt(t,e,s,i),r),this}roundRect(t,e,s,i,r,n){return this.drawShape(new kt(t,e,s,i,r),n),this}drawShape(t,e){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:e}),this}startPoly(t,e){let s=this._currentPoly;return s&&this.endPoly(),s=new it,s.points.push(t,e),this._currentPoly=s,this}endPoly(t=!1){let e=this._currentPoly;return e&&e.points.length>2&&(e.closePath=t,this.shapePrimitives.push({shape:e})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new it,t)){let e=this.shapePrimitives[this.shapePrimitives.length-1];if(e){let s=e.shape.x,i=e.shape.y;if(e.transform&&!e.transform.isIdentity()){let r=e.transform,n=s;s=r.a*s+r.c*i+r.tx,i=r.b*n+r.d*i+r.ty}this._currentPoly.points.push(s,i)}else this._currentPoly.points.push(0,0)}}buildPath(){let t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let e=0;e<t.instructions.length;e++){let s=t.instructions[e];this[s.action](...s.data)}this.finish()}get bounds(){let t=this._bounds;t.clear();let e=this.shapePrimitives;for(let s=0;s<e.length;s++){let i=e[s],r=i.shape.getBounds(Bs);i.transform?t.addRect(r,i.transform):t.addRect(r)}return t}};var E=class o{constructor(t,e=!1){this.instructions=[],this.uid=U("graphicsPath"),this._dirty=!0,this.checkForHoles=e,typeof t=="string"?Fe(t,this):this.instructions=t?.slice()??[]}get shapePath(){return this._shapePath||(this._shapePath=new At(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,e){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,e]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,e,s,i,r){let n=this.instructions[this.instructions.length-1],a=this.getLastPoint(W.shared),h=0,l=0;if(!n||n.action!=="bezierCurveTo")h=a.x,l=a.y;else{h=n.data[2],l=n.data[3];let c=a.x,u=a.y;h=c+(c-h),l=u+(u-l)}return this.instructions.push({action:"bezierCurveTo",data:[h,l,t,e,s,i,r]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,e,s){let i=this.instructions[this.instructions.length-1],r=this.getLastPoint(W.shared),n=0,a=0;if(!i||i.action!=="quadraticCurveTo")n=r.x,a=r.y;else{n=i.data[0],a=i.data[1];let h=r.x,l=r.y;n=h+(h-n),a=l+(l-a)}return this.instructions.push({action:"quadraticCurveTo",data:[n,a,t,e,s]}),this._dirty=!0,this}rect(t,e,s,i,r){return this.instructions.push({action:"rect",data:[t,e,s,i,r]}),this._dirty=!0,this}circle(t,e,s,i){return this.instructions.push({action:"circle",data:[t,e,s,i]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,e,s,i,r,n,a){r||(r=i/2);let h=-1*Math.PI/2+n,l=s*2,c=Math.PI*2/l,u=[];for(let f=0;f<l;f++){let d=f%2?r:i,p=f*c+h;u.push(t+d*Math.cos(p),e+d*Math.sin(p))}return this.poly(u,!0,a),this}clone(t=!1){let e=new o;if(e.checkForHoles=this.checkForHoles,!t)e.instructions=this.instructions.slice();else for(let s=0;s<this.instructions.length;s++){let i=this.instructions[s];e.instructions.push({action:i.action,data:i.data.slice()})}return e}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;let e=t.a,s=t.b,i=t.c,r=t.d,n=t.tx,a=t.ty,h=0,l=0,c=0,u=0,f=0,d=0,p=0,m=0;for(let g=0;g<this.instructions.length;g++){let b=this.instructions[g],y=b.data;switch(b.action){case"moveTo":case"lineTo":h=y[0],l=y[1],y[0]=e*h+i*l+n,y[1]=s*h+r*l+a;break;case"bezierCurveTo":c=y[0],u=y[1],f=y[2],d=y[3],h=y[4],l=y[5],y[0]=e*c+i*u+n,y[1]=s*c+r*u+a,y[2]=e*f+i*d+n,y[3]=s*f+r*d+a,y[4]=e*h+i*l+n,y[5]=s*h+r*l+a;break;case"quadraticCurveTo":c=y[0],u=y[1],h=y[2],l=y[3],y[0]=e*c+i*u+n,y[1]=s*c+r*u+a,y[2]=e*h+i*l+n,y[3]=s*h+r*l+a;break;case"arcToSvg":h=y[5],l=y[6],p=y[0],m=y[1],y[0]=e*p+i*m,y[1]=s*p+r*m,y[5]=e*h+i*l+n,y[6]=s*h+r*l+a;break;case"circle":y[4]=ot(y[3],t);break;case"rect":y[4]=ot(y[4],t);break;case"ellipse":y[8]=ot(y[8],t);break;case"roundRect":y[5]=ot(y[5],t);break;case"addPath":y[0].transform(t);break;case"poly":y[2]=ot(y[2],t);break;case"regularPoly":case"chamferRect":y[5]=ot(y[5],t);break;case"closePath":break;default:$("unknown transform action",b.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let e=this.instructions.length-1,s=this.instructions[e];if(!s)return t.x=0,t.y=0,t;for(;s.action==="closePath";){if(e--,e<0)return t.x=0,t.y=0,t;s=this.instructions[e]}switch(s.action){case"moveTo":case"lineTo":t.x=s.data[0],t.y=s.data[1];break;case"quadraticCurveTo":t.x=s.data[2],t.y=s.data[3];break;case"bezierCurveTo":t.x=s.data[4],t.y=s.data[5];break;case"arc":case"arcToSvg":t.x=s.data[5],t.y=s.data[6];break;case"addPath":s.data[0].getLastPoint(t);break}return t}};function ot(o,t){return o?o.prepend(t):t.clone()}function G(o,t,e){let s=o.getAttribute(t);return s?Number(s):e}function $e(o,t){let e=o.querySelectorAll("defs");for(let s=0;s<e.length;s++){let i=e[s];for(let r=0;r<i.children.length;r++){let n=i.children[r];switch(n.nodeName.toLowerCase()){case"lineargradient":t.defs[n.id]=Es(n);break;case"radialgradient":t.defs[n.id]=Hs(n);break;default:break}}}}function Es(o){let t=G(o,"x1",0),e=G(o,"y1",0),s=G(o,"x2",1),i=G(o,"y2",0),r=o.getAttribute("gradientUnits")||"objectBoundingBox",n=new X(t,e,s,i,r==="objectBoundingBox"?"local":"global");for(let a=0;a<o.children.length;a++){let h=o.children[a],l=G(h,"offset",0),c=B.shared.setValue(h.getAttribute("stop-color")).toNumber();n.addColorStop(l,c)}return n}function Hs(o){return $("[SVG Parser] Radial gradients are not yet supported"),new X(0,0,1,0)}function Xt(o){let t=o.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}var Xe={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};function Yt(o,t){let e=o.getAttribute("style"),s={},i={},r={strokeStyle:s,fillStyle:i,useFill:!1,useStroke:!1};for(let n in Xe){let a=o.getAttribute(n);a&&Ye(t,r,n,a.trim())}if(e){let n=e.split(";");for(let a=0;a<n.length;a++){let h=n[a].trim(),[l,c]=h.split(":");Xe[l]&&Ye(t,r,l,c.trim())}}return{strokeStyle:r.useStroke?s:null,fillStyle:r.useFill?i:null,useFill:r.useFill,useStroke:r.useStroke}}function Ye(o,t,e,s){switch(e){case"stroke":if(s!=="none"){if(s.startsWith("url(")){let i=Xt(s);t.strokeStyle.fill=o.defs[i]}else t.strokeStyle.color=B.shared.setValue(s).toNumber();t.useStroke=!0}break;case"stroke-width":t.strokeStyle.width=Number(s);break;case"fill":if(s!=="none"){if(s.startsWith("url(")){let i=Xt(s);t.fillStyle.fill=o.defs[i]}else t.fillStyle.color=B.shared.setValue(s).toNumber();t.useFill=!0}break;case"fill-opacity":t.fillStyle.alpha=Number(s);break;case"stroke-opacity":t.strokeStyle.alpha=Number(s);break;case"opacity":t.fillStyle.alpha=Number(s),t.strokeStyle.alpha=Number(s);break}}function Qe(o){if(o.length<=2)return!0;let t=o.map(a=>a.area).sort((a,h)=>h-a),[e,s]=t,i=t[t.length-1],r=e/s,n=s/i;return!(r>3&&n<2)}function Oe(o){return o.split(/(?=[Mm])/).filter(s=>s.trim().length>0)}function Ke(o){let t=o.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;let e=t.map(Number),s=[],i=[];for(let c=0;c<e.length;c+=2)c+1<e.length&&(s.push(e[c]),i.push(e[c+1]));if(s.length===0||i.length===0)return 0;let r=Math.min(...s),n=Math.max(...s),a=Math.min(...i),h=Math.max(...i);return(n-r)*(h-a)}function Qt(o,t){let e=new E(o,!1);for(let s of e.instructions)t.instructions.push(s)}function Ze(o,t){if(typeof o=="string"){let n=document.createElement("div");n.innerHTML=o.trim(),o=n.querySelector("svg")}let e={context:t,defs:{},path:new E};$e(o,e);let s=o.children,{fillStyle:i,strokeStyle:r}=Yt(o,e);for(let n=0;n<s.length;n++){let a=s[n];a.nodeName.toLowerCase()!=="defs"&&Je(a,e,i,r)}return t}function Je(o,t,e,s){let i=o.children,{fillStyle:r,strokeStyle:n}=Yt(o,t);r&&e?e={...e,...r}:r&&(e=r),n&&s?s={...s,...n}:n&&(s=n);let a=!e&&!s;a&&(e={color:0});let h,l,c,u,f,d,p,m,g,b,y,T,_,w,x,P,I;switch(o.nodeName.toLowerCase()){case"path":{w=o.getAttribute("d");let A=o.getAttribute("fill-rule"),M=Oe(w),S=A==="evenodd",R=M.length>1;if(S&&R){let D=M.map(k=>({path:k,area:Ke(k)}));if(D.sort((k,C)=>C.area-k.area),M.length>3||!Qe(D))for(let k=0;k<D.length;k++){let C=D[k],at=k===0;t.context.beginPath();let q=new E(void 0,!0);Qt(C.path,q),t.context.path(q),at?(e&&t.context.fill(e),s&&t.context.stroke(s)):t.context.cut()}else for(let k=0;k<D.length;k++){let C=D[k],at=k%2===1;t.context.beginPath();let q=new E(void 0,!0);Qt(C.path,q),t.context.path(q),at?t.context.cut():(e&&t.context.fill(e),s&&t.context.stroke(s))}}else{let D=A?A==="evenodd":!0;x=new E(w,D),t.context.path(x),e&&t.context.fill(e),s&&t.context.stroke(s)}break}case"circle":p=G(o,"cx",0),m=G(o,"cy",0),g=G(o,"r",0),t.context.ellipse(p,m,g,g),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"rect":h=G(o,"x",0),l=G(o,"y",0),P=G(o,"width",0),I=G(o,"height",0),b=G(o,"rx",0),y=G(o,"ry",0),b||y?t.context.roundRect(h,l,P,I,b||y):t.context.rect(h,l,P,I),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"ellipse":p=G(o,"cx",0),m=G(o,"cy",0),b=G(o,"rx",0),y=G(o,"ry",0),t.context.beginPath(),t.context.ellipse(p,m,b,y),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"line":c=G(o,"x1",0),u=G(o,"y1",0),f=G(o,"x2",0),d=G(o,"y2",0),t.context.beginPath(),t.context.moveTo(c,u),t.context.lineTo(f,d),s&&t.context.stroke(s);break;case"polygon":_=o.getAttribute("points"),T=_.match(/-?\d+/g).map(A=>parseInt(A,10)),t.context.poly(T,!0),e&&t.context.fill(e),s&&t.context.stroke(s);break;case"polyline":_=o.getAttribute("points"),T=_.match(/-?\d+/g).map(A=>parseInt(A,10)),t.context.poly(T,!1),s&&t.context.stroke(s);break;case"g":case"svg":break;default:{$(`[SVG parser] <${o.nodeName}> elements unsupported`);break}}a&&(e=null);for(let A=0;A<i.length;A++)Je(i[A],t,e,s)}function ts(o,t){let e=1,s=o.shapePath.shapePrimitives;for(let i=0;i<s.length;i++){let r=s[i].shape;if(r.type!=="polygon")continue;let n=r.points,a=n.length;if(a<6)continue;let h=r.closePath;for(let l=0;l<a;l+=2){if(!h&&(l===0||l===a-2))continue;let c=(l-2+a)%a,u=(l+2)%a,f=n[c],d=n[c+1],p=n[l],m=n[l+1],g=n[u],b=n[u+1],y=f-p,T=d-m,_=g-p,w=b-m,x=y*y+T*T,P=_*_+w*w;if(x<1e-12||P<1e-12)continue;let M=(y*_+T*w)/Math.sqrt(x*P);M<-1?M=-1:M>1&&(M=1);let S=Math.sqrt((1-M)*.5);if(S<1e-6)continue;let R=Math.min(1/S,t);R>e&&(e=R)}}return e}var Vs=new W,es=new L,Ot=class V extends ee{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=U("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new E,this._transform=new L,this._fillStyle={...V.defaultFillStyle},this._strokeStyle={...V.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new gt,this._boundsDirty=!0}clone(){let t=new V;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=rt(t,V.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=zt(t,V.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=rt(t,V.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=rt(t,V.defaultStrokeStyle),this}texture(t,e,s,i,r,n){return this.instructions.push({action:"texture",data:{image:t,dx:s||0,dy:i||0,dw:r||t.frame.width,dh:n||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:e||e===0?B.shared.setValue(e).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new E,this}fill(t,e){let s,i=this.instructions[this.instructions.length-1];return this._tick===0&&i?.action==="stroke"?s=i.data.path:s=this._activePath.clone(),s?(t!=null&&(e!==void 0&&typeof t=="number"&&(j(se,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:e}),this._fillStyle=rt(t,V.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:s}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){let{x:t,y:e}=this._activePath.getLastPoint(W.shared);this._activePath.clear(),this._activePath.moveTo(t,e)}stroke(t){let e,s=this.instructions[this.instructions.length-1];return this._tick===0&&s?.action==="fill"?e=s.data.path:e=this._activePath.clone(),e?(t!=null&&(this._strokeStyle=zt(t,V.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:e}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){let e=this.instructions[this.instructions.length-1-t],s=this._activePath.clone();if(e&&(e.action==="stroke"||e.action==="fill"))if(e.data.hole)e.data.hole.addPath(s);else{e.data.hole=s;break}}return this._initNextPathLocation(),this}arc(t,e,s,i,r,n){this._tick++;let a=this._transform;return this._activePath.arc(a.a*t+a.c*e+a.tx,a.b*t+a.d*e+a.ty,s,i,r,n),this}arcTo(t,e,s,i,r){this._tick++;let n=this._transform;return this._activePath.arcTo(n.a*t+n.c*e+n.tx,n.b*t+n.d*e+n.ty,n.a*s+n.c*i+n.tx,n.b*s+n.d*i+n.ty,r),this}arcToSvg(t,e,s,i,r,n,a){this._tick++;let h=this._transform;return this._activePath.arcToSvg(t,e,s,i,r,h.a*n+h.c*a+h.tx,h.b*n+h.d*a+h.ty),this}bezierCurveTo(t,e,s,i,r,n,a){this._tick++;let h=this._transform;return this._activePath.bezierCurveTo(h.a*t+h.c*e+h.tx,h.b*t+h.d*e+h.ty,h.a*s+h.c*i+h.tx,h.b*s+h.d*i+h.ty,h.a*r+h.c*n+h.tx,h.b*r+h.d*n+h.ty,a),this}closePath(){return this._tick++,this._activePath?.closePath(),this}ellipse(t,e,s,i){return this._tick++,this._activePath.ellipse(t,e,s,i,this._transform.clone()),this}circle(t,e,s){return this._tick++,this._activePath.circle(t,e,s,this._transform.clone()),this}path(t){retu