@antv/g 5.13.1 → 5.13.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.umd.js +139 -1066
- package/dist/index.umd.min.js +2 -2
- package/package.json +8 -8
package/dist/index.umd.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";function e(t,e,r,o,a){n(t,e,r||0,o||t.length-1,a||i)}function n(t,e,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=e-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(0>u-s/2?-1:1);n(t,e,Math.max(i,Math.floor(e-u*l/s+h)),Math.min(o,Math.floor(e+(s-u)*l/s+h)),a)}var f=t[e],p=i,d=o;for(r(t,i,e),a(t[o],f)>0&&r(t,i,o);d>p;){for(r(t,p,d),p++,d--;0>a(t[p],f);)p++;for(;a(t[d],f)>0;)d--}0===a(t[i],f)?r(t,i,d):r(t,++d,o),d>e||(i=d+1),e>d||(o=d-1)}}function r(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function i(t,e){return e>t?-1:t>e?1:0}class o{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!m(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;e.children.length>o;o++){const a=e.children[o],s=e.leaf?r(a):a;m(t,s)&&(e.leaf?n.push(a):v(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n}collides(t){let e=this.data;if(!m(t,e))return!1;const n=[];for(;e;){for(let r=0;e.children.length>r;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(m(t,o)){if(e.leaf||v(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(let e=0;t.length>e;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(e.height>this.data.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=y([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let s,u,c;for(;n||i.length;){if(n||(n=i.pop(),u=i[i.length-1],s=o.pop(),c=!0),n.leaf){const r=a(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}c||n.leaf||!v(n,r)?u?(s++,n=u.children[s],c=!1):n=null:(i.push(n),o.push(s),s=0,u=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,a=this._maxEntries;if(a>=i)return o=y(t.slice(e,n+1)),s(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,r-1))),o=y([]),o.leaf=!1,o.height=r;const u=Math.ceil(i/a),c=u*Math.ceil(Math.sqrt(a));g(t,e,n,c,this.compareMinX);for(let i=e;n>=i;i+=c){const e=Math.min(i+c-1,n);g(t,i,e,u,this.compareMinY);for(let n=i;e>=n;n+=u){const i=Math.min(n+u-1,e);o.children.push(this._build(t,n,i,r-1))}}return s(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let s=0;e.children.length>s;s++){const u=e.children[s],c=f(u),l=(i=t,o=u,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-c);a>l?(a=l,r=r>c?c:r,n=u):l===a&&r>c&&(r=c,n=u)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),c(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=y(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,s(n,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let a=e;n-e>=a;a++){const e=u(t,0,a,this.toBBox),s=u(t,a,n,this.toBBox),c=d(e,s),l=f(e)+f(s);i>c?(i=c,r=a,o=o>l?l:o):c===i&&o>l&&(o=l,r=a)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:h,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=u(t,0,e,i),a=u(t,n-e,n,i);let s=p(o)+p(a);for(let r=e;n-e>r;r++){const e=t.children[r];c(o,t.leaf?i(e):e),s+=p(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];c(a,t.leaf?i(e):e),s+=p(a)}return s}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)c(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():s(t[n],this.toBBox)}}function a(t,e,n){if(!n)return e.indexOf(t);for(let r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function s(t,e){u(t,0,t.children.length,e,t)}function u(t,e,n,r,i){i||(i=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;n>o;o++){const e=t.children[o];c(i,t.leaf?r(e):e)}return i}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function h(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function v(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function m(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,n,r,i,o){const a=[n,r];for(;a.length;){if(i>=(r=a.pop())-(n=a.pop()))continue;const s=n+Math.ceil((r-n)/i/2)*i;e(t,s,n,r,o),a.push(n,s,s,r)}}var x=1e-6,E="undefined"!=typeof Float32Array?Float32Array:Array;function T(){var t=new E(9);return E!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function b(){var t=new E(16);return E!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function w(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function k(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,v,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=f,t[12]=p,t[13]=d,t[14]=v,t[15]=m,t}function M(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function P(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function S(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],v=e[13],m=e[14],y=e[15],g=n*s-r*a,x=n*u-i*a,E=n*c-o*a,T=r*u-i*s,b=r*c-o*s,w=i*c-o*u,k=l*v-h*d,M=l*m-f*d,P=l*y-p*d,S=h*m-f*v,N=h*y-p*v,C=f*y-p*m,A=g*C-x*N+E*S+T*P-b*M+w*k;return A?(t[0]=(s*C-u*N+c*S)*(A=1/A),t[1]=(i*N-r*C-o*S)*A,t[2]=(v*w-m*b+y*T)*A,t[3]=(f*b-h*w-p*T)*A,t[4]=(u*P-a*C-c*M)*A,t[5]=(n*C-i*P+o*M)*A,t[6]=(m*E-d*w-y*x)*A,t[7]=(l*w-f*E+p*x)*A,t[8]=(a*N-s*P+c*k)*A,t[9]=(r*P-n*N-o*k)*A,t[10]=(d*b-v*E+y*g)*A,t[11]=(h*E-l*b-p*g)*A,t[12]=(s*M-a*S-u*k)*A,t[13]=(n*S-r*M+i*k)*A,t[14]=(v*x-d*T-m*g)*A,t[15]=(l*T-h*x+f*g)*A,t):null}function N(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],p=t[12],d=t[13],v=t[14],m=t[15];return(e*a-n*o)*(h*m-f*v)-(e*s-r*o)*(l*m-f*d)+(e*u-i*o)*(l*v-h*d)+(n*s-r*a)*(c*m-f*p)-(n*u-i*a)*(c*v-h*p)+(r*u-i*s)*(c*d-l*p)}function C(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],v=e[12],m=e[13],y=e[14],g=e[15],x=n[0],E=n[1],T=n[2],b=n[3];return t[0]=x*r+E*s+T*h+b*v,t[1]=x*i+E*u+T*f+b*m,t[2]=x*o+E*c+T*p+b*y,t[3]=x*a+E*l+T*d+b*g,t[4]=(x=n[4])*r+(E=n[5])*s+(T=n[6])*h+(b=n[7])*v,t[5]=x*i+E*u+T*f+b*m,t[6]=x*o+E*c+T*p+b*y,t[7]=x*a+E*l+T*d+b*g,t[8]=(x=n[8])*r+(E=n[9])*s+(T=n[10])*h+(b=n[11])*v,t[9]=x*i+E*u+T*f+b*m,t[10]=x*o+E*c+T*p+b*y,t[11]=x*a+E*l+T*d+b*g,t[12]=(x=n[12])*r+(E=n[13])*s+(T=n[14])*h+(b=n[15])*v,t[13]=x*i+E*u+T*f+b*m,t[14]=x*o+E*c+T*p+b*y,t[15]=x*a+E*l+T*d+b*g,t}function A(t,e,n){var r,i,o,a,s,u,c,l,h,f,p,d,v=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*y+e[12],t[13]=e[1]*v+e[5]*m+e[9]*y+e[13],t[14]=e[2]*v+e[6]*m+e[10]*y+e[14],t[15]=e[3]*v+e[7]*m+e[11]*y+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=r*v+s*m+h*y+e[12],t[13]=i*v+u*m+f*y+e[13],t[14]=o*v+c*m+p*y+e[14],t[15]=a*v+l*m+d*y+e[15]),t}function O(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function _(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function L(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function R(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function I(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,f=r*c,p=i*u,d=i*c,v=o*c,m=a*s,y=a*u,g=a*c;return t[0]=1-(p+v),t[1]=h+g,t[2]=f-y,t[3]=0,t[4]=h-g,t[5]=1-(l+v),t[6]=d+m,t[7]=0,t[8]=f+y,t[9]=d-m,t[10]=1-(l+p),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function D(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function F(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function G(t,e){var n=new E(3);F(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,c=e[4]*r,l=e[5]*i,h=e[6]*o,f=e[8]*r,p=e[9]*i,d=e[10]*o,v=a+l+d,m=0;return v>0?(m=2*Math.sqrt(v+1),t[3]=.25*m,t[0]=(h-p)/m,t[1]=(f-u)/m,t[2]=(s-c)/m):a>l&&a>d?(m=2*Math.sqrt(1+a-l-d),t[3]=(h-p)/m,t[0]=.25*m,t[1]=(s+c)/m,t[2]=(f+u)/m):l>d?(m=2*Math.sqrt(1+l-a-d),t[3]=(f-u)/m,t[0]=(s+c)/m,t[1]=.25*m,t[2]=(h+p)/m):(m=2*Math.sqrt(1+d-a-l),t[3]=(s-c)/m,t[0]=(f+u)/m,t[1]=(h+p)/m,t[2]=.25*m),t}function U(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,f=o*c,p=o*l,d=o*h,v=a*l,m=a*h,y=s*h,g=u*c,x=u*l,E=u*h,T=r[0],b=r[1],w=r[2],k=i[0],M=i[1],P=i[2],S=(1-(v+y))*T,N=(p+E)*T,C=(d-x)*T,A=(p-E)*b,O=(1-(f+y))*b,_=(m+g)*b,L=(d+x)*w,R=(m-g)*w,I=(1-(f+v))*w;return t[0]=S,t[1]=N,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=_,t[7]=0,t[8]=L,t[9]=R,t[10]=I,t[11]=0,t[12]=n[0]+k-(S*k+A*M+L*P),t[13]=n[1]+M-(N*k+O*M+R*P),t[14]=n[2]+P-(C*k+_*M+I*P),t[15]=1,t}function B(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,f=i*a,p=i*s,d=i*u,v=o*a,m=o*s,y=o*u;return t[0]=1-h-d,t[1]=l+y,t[2]=f-m,t[3]=0,t[4]=l-y,t[5]=1-c-d,t[6]=p+v,t[7]=0,t[8]=f+m,t[9]=p-v,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function V(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function H(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var z=H;function j(t,e,n,r){var i,o,a,s,u,c,l,h,f,p,d=e[0],v=e[1],m=e[2],y=r[0],g=r[1],E=r[2],T=n[0],b=n[1],w=n[2];return Math.abs(d-T)<x&&Math.abs(v-b)<x&&Math.abs(m-w)<x?M(t):(l=d-T,h=v-b,f=m-w,i=g*(f*=p=1/Math.hypot(l,h,f))-E*(h*=p),o=E*(l*=p)-y*f,a=y*h-g*l,(p=Math.hypot(i,o,a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),s=h*a-f*o,u=f*i-l*a,c=l*o-h*i,(p=Math.hypot(s,u,c))?(s*=p=1/p,u*=p,c*=p):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=c,t[10]=f,t[11]=0,t[12]=-(i*d+o*v+a*m),t[13]=-(s*d+u*v+c*m),t[14]=-(l*d+h*v+f*m),t[15]=1,t)}function Y(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var W=Object.freeze({__proto__:null,create:b,clone:function(t){var e=new E(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},copy:w,fromValues:function(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,v){var m=new E(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=a,m[7]=s,m[8]=u,m[9]=c,m[10]=l,m[11]=h,m[12]=f,m[13]=p,m[14]=d,m[15]=v,m},set:k,identity:M,transpose:P,invert:S,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],v=e[13],m=e[14],y=e[15];return t[0]=s*(f*y-p*m)-h*(u*y-c*m)+v*(u*p-c*f),t[1]=-(r*(f*y-p*m)-h*(i*y-o*m)+v*(i*p-o*f)),t[2]=r*(u*y-c*m)-s*(i*y-o*m)+v*(i*c-o*u),t[3]=-(r*(u*p-c*f)-s*(i*p-o*f)+h*(i*c-o*u)),t[4]=-(a*(f*y-p*m)-l*(u*y-c*m)+d*(u*p-c*f)),t[5]=n*(f*y-p*m)-l*(i*y-o*m)+d*(i*p-o*f),t[6]=-(n*(u*y-c*m)-a*(i*y-o*m)+d*(i*c-o*u)),t[7]=n*(u*p-c*f)-a*(i*p-o*f)+l*(i*c-o*u),t[8]=a*(h*y-p*v)-l*(s*y-c*v)+d*(s*p-c*h),t[9]=-(n*(h*y-p*v)-l*(r*y-o*v)+d*(r*p-o*h)),t[10]=n*(s*y-c*v)-a*(r*y-o*v)+d*(r*c-o*s),t[11]=-(n*(s*p-c*h)-a*(r*p-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*m-f*v)-l*(s*m-u*v)+d*(s*f-u*h)),t[13]=n*(h*m-f*v)-l*(r*m-i*v)+d*(r*f-i*h),t[14]=-(n*(s*m-u*v)-a*(r*m-i*v)+d*(r*u-i*s)),t[15]=n*(s*f-u*h)-a*(r*f-i*h)+l*(r*u-i*s),t},determinant:N,multiply:C,translate:A,scale:O,rotate:function(t,e,n,r){var i,o,a,s,u,c,l,h,f,p,d,v,m,y,g,E,T,b,w,k,M,P,S,N,C=r[0],A=r[1],O=r[2],_=Math.hypot(C,A,O);return x>_?null:(C*=_=1/_,A*=_,O*=_,i=Math.sin(n),o=Math.cos(n),u=e[1],c=e[2],l=e[3],f=e[5],p=e[6],d=e[7],m=e[9],y=e[10],g=e[11],w=C*A*(a=1-o)-O*i,k=A*A*a+o,M=O*A*a+C*i,P=C*O*a+A*i,S=A*O*a-C*i,N=O*O*a+o,t[0]=(s=e[0])*(E=C*C*a+o)+(h=e[4])*(T=A*C*a+O*i)+(v=e[8])*(b=O*C*a-A*i),t[1]=u*E+f*T+m*b,t[2]=c*E+p*T+y*b,t[3]=l*E+d*T+g*b,t[4]=s*w+h*k+v*M,t[5]=u*w+f*k+m*M,t[6]=c*w+p*k+y*M,t[7]=l*w+d*k+g*M,t[8]=s*P+h*S+v*N,t[9]=u*P+f*S+m*N,t[10]=c*P+p*S+y*N,t[11]=l*P+d*S+g*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:_,rotateY:L,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:R,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],c=Math.hypot(a,s,u);return x>c?null:(a*=c=1/c,s*=c,u*=c,r=Math.sin(e),i=Math.cos(e),t[0]=a*a*(o=1-i)+i,t[1]=s*a*o+u*r,t[2]=u*a*o-s*r,t[3]=0,t[4]=a*s*o-u*r,t[5]=s*s*o+i,t[6]=u*s*o+a*r,t[7]=0,t[8]=a*u*o+s*r,t[9]=s*u*o-a*r,t[10]=u*u*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:I,fromQuat2:function(t,e){var n=new E(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(s*a+l*r+u*o-c*i)/h,n[1]=2*(u*a+l*i+c*r-s*o)/h,n[2]=2*(c*a+l*o+s*i-u*r)/h):(n[0]=2*(s*a+l*r+u*o-c*i),n[1]=2*(u*a+l*i+c*r-s*o),n[2]=2*(c*a+l*o+s*i-u*r)),I(t,e,n),t},getTranslation:D,getScaling:F,getRotation:G,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,f=i*c,p=i*l,d=o*c,v=o*l,m=a*l,y=s*u,g=s*c,x=s*l,E=r[0],T=r[1],b=r[2];return t[0]=(1-(d+m))*E,t[1]=(f+x)*E,t[2]=(p-g)*E,t[3]=0,t[4]=(f-x)*T,t[5]=(1-(h+m))*T,t[6]=(v+y)*T,t[7]=0,t[8]=(p+g)*b,t[9]=(v-y)*b,t[10]=(1-(h+d))*b,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:U,fromQuat:B,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t},perspectiveNO:V,perspective:V,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:H,ortho:z,orthoZO:function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t},lookAt:j,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],f=a-n[2],p=l*l+h*h+f*f;p>0&&(l*=p=1/Math.sqrt(p),h*=p,f*=p);var d=u*f-c*h,v=c*l-s*f,m=s*h-u*l;return(p=d*d+v*v+m*m)>0&&(d*=p=1/Math.sqrt(p),v*=p,m*=p),t[0]=d,t[1]=v,t[2]=m,t[3]=0,t[4]=h*m-f*v,t[5]=f*d-l*m,t[6]=l*v-h*d,t[7]=0,t[8]=l,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:Y,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],f=t[10],p=t[11],d=t[12],v=t[13],m=t[14],y=t[15],g=e[0],E=e[1],T=e[2],b=e[3],w=e[4],k=e[5],M=e[6],P=e[7],S=e[8],N=e[9],C=e[10],A=e[11],O=e[12],_=e[13],L=e[14],R=e[15];return!(Math.abs(n-g)>x*Math.max(1,Math.abs(n),Math.abs(g))||Math.abs(r-E)>x*Math.max(1,Math.abs(r),Math.abs(E))||Math.abs(i-T)>x*Math.max(1,Math.abs(i),Math.abs(T))||Math.abs(o-b)>x*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(a-w)>x*Math.max(1,Math.abs(a),Math.abs(w))||Math.abs(s-k)>x*Math.max(1,Math.abs(s),Math.abs(k))||Math.abs(u-M)>x*Math.max(1,Math.abs(u),Math.abs(M))||Math.abs(c-P)>x*Math.max(1,Math.abs(c),Math.abs(P))||Math.abs(l-S)>x*Math.max(1,Math.abs(l),Math.abs(S))||Math.abs(h-N)>x*Math.max(1,Math.abs(h),Math.abs(N))||Math.abs(f-C)>x*Math.max(1,Math.abs(f),Math.abs(C))||Math.abs(p-A)>x*Math.max(1,Math.abs(p),Math.abs(A))||Math.abs(d-O)>x*Math.max(1,Math.abs(d),Math.abs(O))||Math.abs(v-_)>x*Math.max(1,Math.abs(v),Math.abs(_))||Math.abs(m-L)>x*Math.max(1,Math.abs(m),Math.abs(L))||Math.abs(y-R)>x*Math.max(1,Math.abs(y),Math.abs(R)))},mul:C,sub:Y});function X(){var t=new E(3);return E!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function q(t){return Math.hypot(t[0],t[1],t[2])}function K(t,e,n){var r=new E(3);return r[0]=t,r[1]=e,r[2]=n,r}function Z(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Q(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function J(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function $(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function tt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function et(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function nt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function rt(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function it(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function ot(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=x*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=x*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=x*Math.max(1,Math.abs(i),Math.abs(s))}var at,st=$,ut=q;at=X();function ct(){var t=new E(4);return E!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function lt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}!function(){var t=ct()}();function ht(){var t=new E(4);return E!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function ft(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function pt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function dt(t,e,n,r){var i,o,a,s,u,c=e[0],l=e[1],h=e[2],f=e[3],p=n[0],d=n[1],v=n[2],m=n[3];return 0>(o=c*p+l*d+h*v+f*m)&&(o=-o,p=-p,d=-d,v=-v,m=-m),1-o>x?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*c+u*p,t[1]=s*l+u*d,t[2]=s*h+u*v,t[3]=s*f+u*m,t}function vt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function mt(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}var yt,gt,xt,Et,Tt,bt,wt=function(t,e,n,r){var i=new E(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},kt=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Mt=pt,Pt=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};yt=X(),gt=K(1,0,0),xt=K(0,1,0),Et=ht(),Tt=ht(),bt=T();function St(t,e){var n=new E(2);return n[0]=t,n[1]=e,n}!function(){var t,e=(t=new E(2),E!=Float32Array&&(t[0]=0,t[1]=0),t)}();function Nt(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var Ct=function(){return Ct=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Ct.apply(this,arguments)},At={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function Ot(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var _t={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Lt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return _t[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Rt(t){return Lt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function It(t){return Rt(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Dt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=_t[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,_t[n]))),_t[n]););}function Ft(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Gt(t){return t>=48&&57>=t||43===t||45===t||46===t}function Ut(t){return t>=48&&57>=t}function Bt(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,c=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),Ut(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&Ut(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&Ut(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;Ut(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!Ut(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&Ut(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function Vt(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Ht(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=_t[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Vt(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?Bt(t):Ft(t),t.err.length)return;t.data.push(t.param),Vt(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Vt(t))}if(t.index>=t.max)break;if(!Gt(n.charCodeAt(t.index)))break}Dt(t)}else Dt(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var zt=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function jt(t){if(Rt(t))return Nt(t);var e=function(t){if(Lt(t))return Nt(t);var e=new zt(t);for(Vt(e);e.max>e.index&&!e.err.length;)Ht(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var c=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(a);var l=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[l-2],r=e[l-1],"M"===u&&(i=n,o=r)}return e}))}function Yt(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var c=2*r-o,l=2*i-a;e.x1=c,e.y1=l,u=["C",c,l].concat(s)}else if("T"===n){var h=2*r-e.qx,f=2*i-e.qy;e.qx=h,e.qy=f,u=["Q",h,f].concat(s)}else if("Q"===n){var p=s[1];e.qx=s[0],e.qy=p}return u}function Wt(t){if(It(t))return Nt(t);for(var e=jt(t),n=Ct({},At),r=0;e.length>r;r+=1){e[r]=Yt(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function Xt(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function qt(t,e,n,r,i,o,a,s,u,c){var l,h,f,p,d,v=t,m=e,y=n,g=r,x=s,E=u,T=120*Math.PI/180,b=Math.PI/180*(+i||0),w=[];if(c)h=c[0],f=c[1],p=c[2],d=c[3];else{m=(l=Xt(v,m,-b)).y;var k=((v=l.x)-(x=(l=Xt(x,E,-b)).x))/2,M=(m-(E=l.y))/2,P=k*k/(y*y)+M*M/(g*g);P>1&&(y*=P=Math.sqrt(P),g*=P);var S=y*y,N=g*g,C=(o===a?-1:1)*Math.sqrt(Math.abs((S*N-S*M*M-N*k*k)/(S*M*M+N*k*k)));p=C*y*M/g+(v+x)/2,d=C*-g*k/y+(m+E)/2,h=Math.asin(((m-d)/g*Math.pow(10,9)>>0)/Math.pow(10,9)),f=Math.asin(((E-d)/g*Math.pow(10,9)>>0)/Math.pow(10,9)),h=p>v?Math.PI-h:h,f=p>x?Math.PI-f:f,0>h&&(h=2*Math.PI+h),0>f&&(f=2*Math.PI+f),a&&h>f&&(h-=2*Math.PI),!a&&f>h&&(f-=2*Math.PI)}var A=f-h;if(Math.abs(A)>T){var O=f,_=x,L=E;f=h+T*(a&&f>h?1:-1),w=qt(x=p+y*Math.cos(f),E=d+g*Math.sin(f),y,g,i,0,a,_,L,[f,O,p,d])}A=f-h;var R=Math.cos(h),I=Math.sin(h),D=Math.cos(f),F=Math.sin(f),G=Math.tan(A/4),U=4/3*y*G,B=4/3*g*G,V=[v,m],H=[v+U*I,m-B*R],z=[x+U*F,E-B*D],j=[x,E];if(H[0]=2*V[0]-H[0],H[1]=2*V[1]-H[1],c)return H.concat(z,j,w);for(var Y=[],W=0,X=(w=H.concat(z,j,w)).length;X>W;W+=1)Y[W]=W%2?Xt(w[W-1],w[W],b).y:Xt(w[W],w[W+1],b).x;return Y}function Kt(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function Zt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Qt(t,e,n,r,i){var o=Zt([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=Kt([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Jt(t,e,n,r){var i=.5,o=[t,e],a=[n,r],s=Kt(o,a,i),u=Kt(a,s,i),c=Kt(s,u,i),l=Kt(u,c,i),h=Kt(c,l,i),f=Qt(o[0],o[1],s[0],s[1],c[0]).point,p=Qt(h[0],h[1],l[0],l[1],u[0]).point;return[f.x,f.y,p.x,p.y,n,r]}function $t(t,e){var n,r,i,o,a,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],f=l[1],p=e.x1,d=e.y1,v=e.x,m=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=f,t;case"A":return n=[p,d].concat(l),["C"].concat(qt(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=f,n=[p,d].concat(l),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(Jt(p,d,h,f));case"Z":return p===v&&d===m?["C",p,d,v,m,v,m]:["C"].concat(Jt(p,d,v,m))}return t}function te(t,e){if(void 0===e&&(e=!1),function(t){return It(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=Nt(t);return e?[n,[]]:n}for(var r,i,o=Wt(t),a=Ct({},At),s=[],u="",c=o.length,l=[],h=0;c>h;h+=1){o[h]&&(u=o[h][0]),s[h]=u;var f=$t(o[h],a);o[h]=f,Ot(o,s,h),c=o.length,"Z"===u&&l.push(h),a.x1=+(r=o[h])[(i=r.length)-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,l]:o}function ee(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(0>n*o-r*i?-1:1)*Math.acos(a/s)}function ne(t,e,n,r,i,o,a,s,u,c){var l=Math.abs,h=Math.sin,f=Math.cos,p=Math.sqrt,d=Math.PI,v=l(n),m=l(r),y=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===v||0===m)return Qt(t,e,s,u,c).point;var g=(t-s)/2,x=(e-u)/2,E={x:f(y)*g+h(y)*x,y:-h(y)*g+f(y)*x},T=Math.pow(E.x,2)/Math.pow(v,2)+Math.pow(E.y,2)/Math.pow(m,2);T>1&&(v*=p(T),m*=p(T));var b=(Math.pow(v,2)*Math.pow(m,2)-Math.pow(v,2)*Math.pow(E.y,2)-Math.pow(m,2)*Math.pow(E.x,2))/(Math.pow(v,2)*Math.pow(E.y,2)+Math.pow(m,2)*Math.pow(E.x,2)),w=(o!==a?1:-1)*p(b=0>b?0:b),k=w*(v*E.y/m),M=w*(-m*E.x/v),P=f(y)*k-h(y)*M+(t+s)/2,S=h(y)*k+f(y)*M+(e+u)/2,N={x:(E.x-k)/v,y:(E.y-M)/m},C=ee({x:1,y:0},N),A=ee(N,{x:(-E.x-k)/v,y:(-E.y-M)/m});!a&&A>0?A-=2*d:a&&0>A&&(A+=2*d);var O=C+(A%=2*d)*c,_=v*f(O),L=m*h(O);return{x:f(y)*_-h(y)*L+P,y:h(y)*_+f(y)*L+S}}function re(t,e,n,r,i,o,a,s,u,c,l){var h,f=l.bbox,p=void 0===f||f,d=l.length,v=void 0===d||d,m=l.sampleSize,y=void 0===m?30:m,g="number"==typeof c,x=t,E=e,T=0,b=[x,E,T],w=[x,E],k={x:0,y:0},M=[{x:x,y:E}];g&&0>=c&&(k={x:x,y:E});for(var P=0;y>=P;P+=1){if(x=(h=ne(t,e,n,r,i,o,a,s,u,P/y)).x,E=h.y,p&&M.push({x:x,y:E}),v&&(T+=Zt(w,[x,E])),w=[x,E],g&&T>=c&&c>b[2]){var S=(T-c)/(T-b[2]);k={x:w[0]*(1-S)+b[0]*S,y:w[1]*(1-S)+b[1]*S}}b=[x,E,T]}return g&&c>=T&&(k={x:s,y:u}),{length:T,point:k,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function ie(t,e,n,r,i,o,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*o+Math.pow(u,3)*s}}function oe(t,e,n,r,i,o,a,s,u,c){var l,h=c.bbox,f=void 0===h||h,p=c.length,d=void 0===p||p,v=c.sampleSize,m=void 0===v?10:v,y="number"==typeof u,g=t,x=e,E=0,T=[g,x,E],b=[g,x],w={x:0,y:0},k=[{x:g,y:x}];y&&0>=u&&(w={x:g,y:x});for(var M=0;m>=M;M+=1){if(g=(l=ie(t,e,n,r,i,o,a,s,M/m)).x,x=l.y,f&&k.push({x:g,y:x}),d&&(E+=Zt(b,[g,x])),b=[g,x],y&&E>=u&&u>T[2]){var P=(E-u)/(E-T[2]);w={x:b[0]*(1-P)+T[0]*P,y:b[1]*(1-P)+T[1]*P}}T=[g,x,E]}return y&&u>=E&&(w={x:a,y:s}),{length:E,point:w,min:{x:Math.min.apply(null,k.map((function(t){return t.x}))),y:Math.min.apply(null,k.map((function(t){return t.y})))},max:{x:Math.max.apply(null,k.map((function(t){return t.x}))),y:Math.max.apply(null,k.map((function(t){return t.y})))}}}function ae(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function se(t,e,n,r,i,o,a,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,f=void 0===h||h,p=s.sampleSize,d=void 0===p?10:p,v="number"==typeof a,m=t,y=e,g=0,x=[m,y,g],E=[m,y],T={x:0,y:0},b=[{x:m,y:y}];v&&0>=a&&(T={x:m,y:y});for(var w=0;d>=w;w+=1){if(m=(u=ae(t,e,n,r,i,o,w/d)).x,y=u.y,l&&b.push({x:m,y:y}),f&&(g+=Zt(E,[m,y])),E=[m,y],v&&g>=a&&a>x[2]){var k=(g-a)/(g-x[2]);T={x:E[0]*(1-k)+x[0]*k,y:E[1]*(1-k)+x[1]*k}}x=[m,y,g]}return v&&a>=g&&(T={x:i,y:o}),{length:g,point:T,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,b.map((function(t){return t.x}))),y:Math.max.apply(null,b.map((function(t){return t.y})))}}}function ue(t,e,n){for(var r,i,o,a,s,u,c,l,h,f=Wt(t),p="number"==typeof e,d=[],v=0,m=0,y=0,g=0,x=[],E=[],T=0,b={x:0,y:0},w=b,k=b,M=b,P=0,S=0,N=f.length;N>S;S+=1)d=(c="M"===(l=(h=f[S])[0]))?d:[v,m].concat(h.slice(1)),c?(w=b={x:y=h[1],y:g=h[2]},T=0,p&&.001>e&&(M=b)):"L"===l?(T=(r=Qt(d[0],d[1],d[2],d[3],(e||0)-P)).length,b=r.min,w=r.max,k=r.point):"A"===l?(T=(i=re(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-P,n||{})).length,b=i.min,w=i.max,k=i.point):"C"===l?(T=(o=oe(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-P,n||{})).length,b=o.min,w=o.max,k=o.point):"Q"===l?(T=(a=se(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-P,n||{})).length,b=a.min,w=a.max,k=a.point):"Z"===l&&(T=(s=Qt((d=[v,m,y,g])[0],d[1],d[2],d[3],(e||0)-P)).length,b=s.min,w=s.max,k=s.point),p&&e>P&&P+T>=e&&(M=k),E.push(w),x.push(b),P+=T,v=(u="Z"!==l?h.slice(-2):[y,g])[0],m=u[1];return p&&e>=P&&(M={x:v,y:m}),{length:P,point:M,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function ce(t){return function(t){var e=0,n=0,r=0;return te(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,c,l,h,f,p=t.slice(1);return r=3*(((f=p[5])-(a=n))*((s=p[0])+(c=p[2]))-((h=p[4])-(o=e))*((u=p[1])+(l=p[3]))+u*(o-c)-s*(a-l)+f*(c+o/3)-h*(l+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function le(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?oe(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=Kt(n,r,e),s=Kt(r,i,e),u=Kt(i,o,e),c=Kt(a,s,e),l=Kt(s,u,e),h=Kt(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function he(t,e,n){var r=le(t),i=le(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),f=[c,l],p=[h-o,h-a],d=0,v=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return p[e]-=(d=n&&p[e]&&t.l>=f[e])?1:0,d?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:he(v[0],v[1],h)}var fe=function(t){return null==t},pe={}.toString,de=function(t,e){return pe.call(t)==="[object "+e+"]"},ve=function(t){return Array.isArray?Array.isArray(t):de(t,"Array")},me=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},ye=function(t){if(ve(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},ge=function(t){if(ve(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},xe=function(t){return de(t,"String")},Ee=function(t,e,n){return e>t?e:t>n?n:t},Te=function(t){return de(t,"Number")};var be=function(t){return de(t,"Boolean")},we=function(t){return void 0===t},ke=function(t,e){if("function"!=typeof t)throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n};function Me(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Pe(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Se(){}var Ne=.7,Ce=1/Ne,Ae="\\s*([+-]?\\d+)\\s*",Oe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",_e="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Le=/^#([0-9a-f]{3,8})$/,Re=new RegExp("^rgb\\("+[Ae,Ae,Ae]+"\\)$"),Ie=new RegExp("^rgb\\("+[_e,_e,_e]+"\\)$"),De=new RegExp("^rgba\\("+[Ae,Ae,Ae,Oe]+"\\)$"),Fe=new RegExp("^rgba\\("+[_e,_e,_e,Oe]+"\\)$"),Ge=new RegExp("^hsl\\("+[Oe,_e,_e]+"\\)$"),Ue=new RegExp("^hsla\\("+[Oe,_e,_e,Oe]+"\\)$"),Be={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ve(){return this.rgb().formatHex()}function He(){return this.rgb().formatRgb()}function ze(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Le.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?je(e):3===n?new Xe(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ye(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ye(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Re.exec(t))?new Xe(e[1],e[2],e[3],1):(e=Ie.exec(t))?new Xe(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=De.exec(t))?Ye(e[1],e[2],e[3],e[4]):(e=Fe.exec(t))?Ye(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Ge.exec(t))?Qe(e[1],e[2]/100,e[3]/100,1):(e=Ue.exec(t))?Qe(e[1],e[2]/100,e[3]/100,e[4]):Be.hasOwnProperty(t)?je(Be[t]):"transparent"===t?new Xe(NaN,NaN,NaN,0):null}function je(t){return new Xe(t>>16&255,t>>8&255,255&t,1)}function Ye(t,e,n,r){return r>0||(t=e=n=NaN),new Xe(t,e,n,r)}function We(t){return t instanceof Se||(t=ze(t)),t?new Xe((t=t.rgb()).r,t.g,t.b,t.opacity):new Xe}function Xe(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function qe(){return"#"+Ze(this.r)+Ze(this.g)+Ze(this.b)}function Ke(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ze(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Qe(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new $e(t,e,n,r)}function Je(t){if(t instanceof $e)return new $e(t.h,t.s,t.l,t.opacity);if(t instanceof Se||(t=ze(t)),!t)return new $e;if(t instanceof $e)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new $e(a,s,u,t.opacity)}function $e(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function tn(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}function en(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function nn(t,e){return.001>Math.abs(t-e)}function rn(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}Me(Se,ze,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ve,formatHex:Ve,formatHsl:function(){return Je(this).formatHsl()},formatRgb:He,toString:He}),Me(Xe,(function(t,e,n,r){return 1===arguments.length?We(t):new Xe(t,e,n,null==r?1:r)}),Pe(Se,{brighter:function(t){return t=null==t?Ce:Math.pow(Ce,t),new Xe(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Ne:Math.pow(Ne,t),new Xe(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:qe,formatHex:qe,formatRgb:Ke,toString:Ke})),Me($e,(function(t,e,n,r){return 1===arguments.length?Je(t):new $e(t,e,n,null==r?1:r)}),Pe(Se,{brighter:function(t){return t=null==t?Ce:Math.pow(Ce,t),new $e(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Ne:Math.pow(Ne,t),new $e(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(.5>n?n:1-n)*e,i=2*n-r;return new Xe(tn(240>t?t+120:t-240,i,r),tn(t,i,r),tn(120>t?t+240:t-120,i,r),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var on={box:function(t,e,n,r){return rn([t,n],[e,r])},length:function(t,e,n,r){return en(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var a=(n-t)*(i-t)+(r-e)*(o-e);return 0>a?en(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?en(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function an(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function sn(t,e,n){var r=t+n-2*e;if(nn(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}var un=function(t,e,n,r,i,o){var a=sn(t,n,i)[0],s=sn(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(an(t,n,i,a)),void 0!==s&&c.push(an(e,r,o,s)),rn(u,c)};function cn(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function ln(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(nn(s,0))nn(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;nn(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}var hn=function(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=ln(t,n,i,a),h=ln(e,r,o,s),f=0;l.length>f;f++)u.push(cn(t,n,i,a,l[f]));for(var p=0;h.length>p;p++)c.push(cn(e,r,o,s,h[p]));return rn(u,c)};function fn(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function pn(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}var dn=function(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,c=-1/0,l=[o,a],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;a>o?f>o&&a>f&&l.push(f):f>a&&o>f&&l.push(f)}for(var p=0;l.length>p;p++){var d=fn(t,0,n,r,i,l[p]);u>d&&(u=d),d>c&&(c=d)}for(var v=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),m=1/0,y=-1/0,g=[o,a],x=2*-Math.PI;x<=2*Math.PI;x+=Math.PI){var E=v+x;a>o?E>o&&a>E&&g.push(E):E>a&&o>E&&g.push(E)}for(var T=0;g.length>T;T++){var b=pn(0,e,n,r,i,g[T]);m>b&&(m=b),b>y&&(y=b)}return{x:u,y:m,width:c-u,height:y-m}};var vn=function(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=en(r[0],r[1],i[0],i[1])}return e}(t)};var mn=function(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=new Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,a),!0}for(c=1,u=new Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,p=l.length;for(c=0;p>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(f=1,u=new Array(h-1);h>f;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}));let yn=1;const gn="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},xn=Date.now();let En={},Tn=Date.now();const bn=t=>{if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=Date.now(),n=e-Tn,r=n>16?0:16-n,i=yn++;return En[i]=t,Object.keys(En).length>1||setTimeout((()=>{Tn=e;const t=En;En={},Object.keys(t).forEach((e=>t[e](gn.performance&&"function"==typeof gn.performance.now?gn.performance.now():Date.now()-xn)))}),r),i},wn=t=>{delete En[t]},kn=t=>"string"!=typeof t?bn:""===t?gn.requestAnimationFrame:gn[t+"RequestAnimationFrame"],Mn=((t,e)=>{let n=0;for(;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}})(["","webkit","moz","ms","o"],(t=>!!kn(t))),Pn=kn(Mn),Sn="string"!=typeof(Nn=Mn)?wn:""===Nn?gn.cancelAnimationFrame:gn[Nn+"CancelAnimationFrame"]||gn[Nn+"CancelRequestAnimationFrame"];var Nn,Cn;gn.requestAnimationFrame=Pn,gn.cancelAnimationFrame=Sn,"undefined"!=typeof module&&module.exports&&(module.exports={requestAnimationFrame:Pn,cancelAnimationFrame:Sn}),(Cn=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",Cn.COLOR="<color>",Cn.PAINT="<paint>",Cn.NUMBER="<number>",Cn.ANGLE="<angle>",Cn.OPACITY_VALUE="<opacity-value>",Cn.SHADOW_BLUR="<shadow-blur>",Cn.LENGTH="<length>",Cn.PERCENTAGE="<percentage>",Cn.LENGTH_PERCENTAGE="<length> | <percentage>",Cn.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",Cn.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",Cn.LIST_OF_POINTS="<list-of-points>",Cn.PATH="<path>",Cn.FILTER="<filter>",Cn.Z_INDEX="<z-index>",Cn.OFFSET_DISTANCE="<offset-distance>",Cn.DEFINED_PATH="<defined-path>",Cn.MARKER="<marker>",Cn.TRANSFORM="<transform>",Cn.TRANSFORM_ORIGIN="<transform-origin>",Cn.TEXT="<text>",Cn.TEXT_TRANSFORM="<text-transform>";var An,On=function(){function t(t,e){void 0===t&&(t=[0,0,0]),void 0===e&&(e=[0,0,0]),this.center=X(),this.halfExtents=X(),this.min=X(),this.max=X(),this.update(t,e)}t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var e=t.prototype;return e.update=function(t,e){Z(this.center,t),Z(this.halfExtents,e),st(this.min,this.center,this.halfExtents),J(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){J(this.center,e,t),tt(this.center,this.center,.5),st(this.halfExtents,e,t),tt(this.halfExtents,this.halfExtents,.5),Z(this.min,t),Z(this.max,e)},e.getMin=function(){return this.min},e.getMax=function(){return this.max},e.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,f=i-u,p=i+u,d=o-c,v=o+c,m=e.center,y=m[0],g=m[1],x=m[2],E=e.halfExtents,T=E[0],b=E[1],w=E[2],k=y-T,M=y+T,P=g-b,S=g+b,N=x-w,C=x+w;l>k&&(l=k),M>h&&(h=M),f>P&&(f=P),S>p&&(p=S),d>N&&(d=N),C>v&&(v=C),n[0]=.5*(l+h),n[1]=.5*(f+p),n[2]=.5*(d+v),a[0]=.5*(h-l),a[1]=.5*(p-f),a[2]=.5*(v-d),this.min[0]=l,this.min[1]=f,this.min[2]=d,this.max[0]=h,this.max[1]=p,this.max[2]=v}},e.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],f=e[2],p=e[6],d=e[10],v=Math.abs(a),m=Math.abs(s),y=Math.abs(u),g=Math.abs(c),x=Math.abs(l),E=Math.abs(h),T=Math.abs(f),b=Math.abs(p),w=Math.abs(d);Q(n,e[12]+a*i[0]+s*i[1]+u*i[2],e[13]+c*i[0]+l*i[1]+h*i[2],e[14]+f*i[0]+p*i[1]+d*i[2]),Q(r,v*o[0]+m*o[1]+y*o[2],g*o[0]+x*o[1]+E*o[2],T*o[0]+b*o[1]+w*o[2]),this.min=st(this.min,n,r),this.max=J(this.max,n,r)},e.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])},e.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=X(),r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}(X(),this.getMax(),e.getMax());return o.setMinMax(a,s),o},e.containsPoint=function(t){var e=this.getMin(),n=this.getMax();return!(e[0]>t[0]||t[0]>n[0]||e[1]>t[1]||t[1]>n[1]||e[2]>t[2]||t[2]>n[2])},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?Z(X(),this.min):272===t.pnVertexFlag?K(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?K(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?K(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?K(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?K(this.max[0],this.min[1],this.max[2]):K(this.max[0],this.max[1],1===t.pnVertexFlag?this.min[2]:this.max[2])},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?Z(X(),this.max):272===t.pnVertexFlag?K(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?K(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?K(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?K(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?K(this.min[0],this.max[1],this.min[2]):K(this.min[0],this.min[1],1===t.pnVertexFlag?this.max[2]:this.min[2])},t}(),_n=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||K(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},e.distanceToPoint=function(t){return nt(t,this.normal)-this.distance},e.normalize=function(){var t=1/ut(this.normal);tt(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&function(t,e,n,r){var i=e[0],o=e[1],a=e[2];t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a)}(n,t,e,i),o},t}();(An=t.Mask||(t.Mask={}))[An.OUTSIDE=4294967295]="OUTSIDE",An[An.INSIDE=0]="INSIDE",An[An.INDETERMINATE=2147483647]="INDETERMINATE";var Ln,Rn=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new _n)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],p=t[12],d=t[13],v=t[14],m=t[15];Q(this.planes[0].normal,i-e,u-o,f-c),this.planes[0].distance=m-p,Q(this.planes[1].normal,i+e,u+o,f+c),this.planes[1].distance=m+p,Q(this.planes[2].normal,i+n,u+a,f+l),this.planes[2].distance=m+d,Q(this.planes[3].normal,i-n,u-a,f-l),this.planes[3].distance=m-d,Q(this.planes[4].normal,i-r,u-s,f-h),this.planes[4].distance=m-v,Q(this.planes[5].normal,i+r,u+s,f+h),this.planes[5].distance=m+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),In=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Dn=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}();(Ln=t.Shape||(t.Shape={})).GROUP="g",Ln.CIRCLE="circle",Ln.ELLIPSE="ellipse",Ln.IMAGE="image",Ln.RECT="rect",Ln.LINE="line",Ln.POLYLINE="polyline",Ln.POLYGON="polygon",Ln.TEXT="text",Ln.PATH="path",Ln.HTML="html",Ln.MESH="mesh";var Fn=ke((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}));function Gn(t){if(!t)throw new Error}function Un(t,e){if(t===e)throw new Error}function Bn(t){return"function"==typeof t}var Vn={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Hn=ke((function(t){var e=Fn(t),n=Vn[e];return e=(null==n?void 0:n.alias)||e})),zn={},jn=0;var Yn="undefined"!=typeof window&&void 0!==window.document;function Wn(t,e){var n=Number(t.style.zIndex),r=Number(e.style.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function Xn(t){var e=t;do{var n;if(null===(n=e.style)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function qn(t,e){if(Yn)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var Kn,Zn,Qn,Jn,$n,tr="Method not implemented.",er="Use document.documentElement instead.",nr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function rr(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */rr=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new w(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return M()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),i}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function p(){}var d={};s(d,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(k([])));m&&m!==e&&n.call(m,i)&&(d=m);var y=p.prototype=h.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function E(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return f.prototype=p,s(y,"constructor",p),s(p,"constructor",f),f.displayName=s(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(x.prototype),s(x.prototype,o,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),s(y,a,"Generator"),s(y,i,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),b(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;b(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function ir(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function or(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){ir(o,r,i,a,s,"next",t)}function s(t){ir(o,r,i,a,s,"throw",t)}a(void 0)}))}}function ar(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function sr(t,e,n){return e&&ar(t.prototype,e),n&&ar(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ur(){return ur=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ur.apply(this,arguments)}function cr(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,lr(t,e)}function lr(t,e){return lr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},lr(t,e)}function hr(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;o.length>r;r++)0>e.indexOf(n=o[r])&&(i[n]=t[n]);return i}function fr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function pr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);e>n;n++)r[n]=t[n];return r}function dr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return pr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?pr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(Kn=t.UnitType||(t.UnitType={}))[Kn.kUnknown=0]="kUnknown",Kn[Kn.kNumber=1]="kNumber",Kn[Kn.kPercentage=2]="kPercentage",Kn[Kn.kEms=3]="kEms",Kn[Kn.kPixels=4]="kPixels",Kn[Kn.kRems=5]="kRems",Kn[Kn.kDegrees=6]="kDegrees",Kn[Kn.kRadians=7]="kRadians",Kn[Kn.kGradians=8]="kGradians",Kn[Kn.kTurns=9]="kTurns",Kn[Kn.kMilliseconds=10]="kMilliseconds",Kn[Kn.kSeconds=11]="kSeconds",Kn[Kn.kInteger=12]="kInteger",function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(Zn||(Zn={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(Qn||(Qn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(Jn||(Jn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}($n||($n={}));var vr,mr=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(vr||(vr={}));var yr,gr=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return mr.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},xr=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},Er=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},Tr=function(){function e(){}e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds};var n=e.prototype;return n.toString=function(){return this.buildCSSText(Jn.kNo,$n.kNo,"")},n.isNumericValue=function(){return this.getType()>=vr.kUnitType&&this.getType()<=vr.kClampType},e}(),br=function(t){function e(e){var n;return(n=t.call(this)||this).colorSpace=void 0,n.colorSpace=e,n}cr(e,t);var n=e.prototype;return n.getType=function(){return vr.kColorType},n.to=function(t){return this},e}(Tr);(yr=t.GradientType||(t.GradientType={}))[yr.Constant=0]="Constant",yr[yr.LinearGradient=1]="LinearGradient",yr[yr.RadialGradient=2]="RadialGradient";var wr,kr,Mr=function(t){function e(e,n){var r;return(r=t.call(this)||this).type=void 0,r.value=void 0,r.type=e,r.value=n,r}cr(e,t);var n=e.prototype;return n.clone=function(){return new e(this.type,this.value)},n.buildCSSText=function(t,e,n){return n},n.getType=function(){return vr.kColorType},e}(Tr),Pr=function(t){function e(e){var n;return(n=t.call(this)||this).value=void 0,n.value=e,n}cr(e,t);var n=e.prototype;return n.clone=function(){return new e(this.value)},n.getType=function(){return vr.kKeywordType},n.buildCSSText=function(t,e,n){return n+this.value},e}(Tr);!function(t){t.kAdd="+",t.kSubtract="-",t.kMultiply="*",t.kDivide="/",t.kMin="min",t.kMax="max",t.kClamp="clamp",t.kInvalid=""}(wr||(wr={})),function(t){t[t.kLength=0]="kLength",t[t.kAngle=1]="kAngle",t[t.kTime=2]="kTime",t[t.kFrequency=3]="kFrequency",t[t.kResolution=4]="kResolution",t[t.kFlex=5]="kFlex",t[t.kPercent=6]="kPercent",t[t.kNumBaseTypes=7]="kNumBaseTypes"}(kr||(kr={}));var Sr=function(){function e(e,n){void 0===e&&(e=t.UnitType.kNumber),void 0===n&&(n=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=kr.kPercent,this.hasPercentHint=!1,this.exponents=new Array(kr.kNumBaseTypes).fill(0),e!==t.UnitType.kNumber&&this.setExponent(function(e){switch(Un(e,t.UnitType.kNumber),e){case t.UnitType.kEms:case t.UnitType.kPixels:case t.UnitType.kRems:return kr.kLength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return kr.kTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return kr.kAngle;case t.UnitType.kPercentage:return kr.kPercent;default:return kr.kLength}}(e),n)}var n=e.prototype;return n.applyPercentHint=function(t){Un(t,kr.kPercent),this.setExponent(t,this.exponent(t)+this.exponent(kr.kPercent)),this.setExponent(kr.kPercent,0),this.percentHint=t,this.hasPercentHint=!0},n.hasNonZeroEntries=function(){return this.numNonZeroEntries>0},n.isOnlyNonZeroEntry=function(t,e){return Un(e,0),1===this.numNonZeroEntries&&this.exponent(t)===e},n.exponent=function(t){return this.exponents[t]},n.setExponent=function(t,e){var n=this.exponents[t];0==n&&0!==e?this.numNonZeroEntries++:0!==n&&0==e&&this.numNonZeroEntries--,this.exponents[t]=e},e.negateExponents=function(t){return t.exponents.forEach((function(t){return-1*t})),t},n.matchesBaseType=function(t){return Un(t,kr.kPercent),this.isOnlyNonZeroEntry(t,1)&&!this.hasPercentHint},n.matchesPercentage=function(){return this.isOnlyNonZeroEntry(kr.kPercent,1)},n.matchesBaseTypePercentage=function(t){return Un(t,kr.kPercent),this.isOnlyNonZeroEntry(t,1)||this.isOnlyNonZeroEntry(kr.kPercent,1)},n.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},n.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(kr.kPercent,1)},e.add=function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint),function(t,e){if(t!==e)throw new Error}(t.percentHint,e.percentHint);for(var r=0;kr.kNumBaseTypes>r;++r){var i=r;if(t.exponents[r]!==e.exponents[r]&&(i!==kr.kPercent&&(t.applyPercentHint(i),e.applyPercentHint(i)),t.exponents[r]!==e.exponents[r]))return t}return t},e.multiply=function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint);for(var r=0;kr.kNumBaseTypes>r;++r){var i=r;t.setExponent(i,t.exponent(i)+e.exponent(i))}return t},e}(),Nr=function(e){return"number"==typeof e?new Dr(e,t.UnitType.kNumber):e},Cr=function(e){function n(t){var n;return(n=e.call(this)||this).type_=void 0,n.type_=t,n}cr(n,e);var r=n.prototype;return r.getType=function(){return vr.kUnknownType},r.equals=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Ar(n);return i.every((function(e){return t.equals(e)}))},r.add=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ar(e);Or(vr.kSumType,r,this);var i=Lr(r,wr.kAdd);return i||jr.create(r)},r.sub=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ar(e);r=r.map((function(t){return t.negate()})),Or(vr.kSumType,r,this);var i=Lr(r,wr.kAdd);return i||jr.create(r)},r.mul=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ar(e);Or(vr.kProductType,r,this);var i=Rr(r);return i||Yr.create(r)},r.div=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ar(e);r=r.map((function(t){return t.invert()})),Or(vr.kProductType,r,this);var i=Rr(r);return i||Yr.create(r)},r.min=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ar(e);Or(vr.kMinType,r,this);var i=Lr(r,wr.kMin);return i||Hr.create(r)},r.max=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ar(e);Or(vr.kMaxType,r,this);var i=Lr(r,wr.kMax);return i||zr.create(r)},r.to=function(t){var e=this.sumValue();if(0===e.length||1!==e.length)return null;var n,r=_r(e[0]);return r?(n="string"==typeof t?gr(t):t,r.convertTo(n)):null},r.toSum=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];for(var i=0,o=e;o.length>i;i++){var a=o[i];if(!n.isValidUnit(gr(a)))return null}var s=this.sumValue();if(!s.length)return null;for(var u,c=[],l=dr(s);!(u=l()).done;){var h=u.value,f=_r(h);if(!f)return null;c.push(f)}if(0===e.length){c.sort((function(t,e){return t.unit-e.unit}));var p=jr.create(c);return Gn(!!p),p}for(var d=[],v=function(){var t=gr(y[m]);Gn(n.isValidUnit(t));var e=c.reduce((function(e,n,r){if(n){var i=n.convertTo(t);i&&(e+=i.value,c[r]=null)}return e}),0);d.push(new Dr(e,t))},m=0,y=e;y.length>m;m++)v();if(c.some((function(t){return!!t})))throw new Error("There were leftover terms that were not converted");return jr.create(d)},r.type=function(){var t={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},e=this.type_.exponent(kr.kLength);return e&&(t.length=e),(e=this.type_.exponent(kr.kAngle))&&(t.angle=e),(e=this.type_.exponent(kr.kTime))&&(t.time=e),(e=this.type_.exponent(kr.kFrequency))&&(t.frequency=e),(e=this.type_.exponent(kr.kResolution))&&(t.resolution=e),(e=this.type_.exponent(kr.kFlex))&&(t.flex=e),(e=this.type_.exponent(kr.kPercent))&&(t.percent=e),this.type_.hasPercentHint&&(t.percentHint=function(t){switch(t){case kr.kLength:return"length";case kr.kAngle:return"angle";case kr.kTime:return"time";case kr.kFrequency:return"frequency";case kr.kResolution:return"resolution";case kr.kFlex:return"flex";case kr.kPercent:return"percent"}return""}(this.type_.percentHint)),t},n.isValidUnit=function(e){return!!(e===t.UnitType.kNumber||e==t.UnitType.kPercentage||this.isLength(e)||this.isAngle(e)||this.isTime(e))},r.negate=function(){return Ur.create(this)},r.invert=function(){return Gr.create(this)},n}(Tr);function Ar(t){return t.map(Nr)}function Or(t,e,n){Gn(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function _r(t){return 0===Object.keys(t.units).length?new Dr(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new Dr(t.value,Number(Object.keys(t.units)[0])):null}function Lr(t,e){Gn(!!t.length);var n=t[0]instanceof Dr?t[0]:null;if(!n)return null;for(var r=n.value,i=1;t.length>i;i++){var o=t[i]instanceof Dr?t[i]:null;if(!o||o.unit!==n.unit)return null;e===wr.kAdd?r+=o.value:e===wr.kMax?r=Math.max(r,o.value):e===wr.kMin&&(r=Math.min(r,o.value))}return new Dr(r,n.unit)}function Rr(e){Gn(!!e.length);for(var n=t.UnitType.kNumber,r=1,i=0;e.length>i;i++){var o=e[i]instanceof Dr?e[i]:null;if(!o)return null;if(o.unit!==t.UnitType.kNumber){if(n!==t.UnitType.kNumber)return null;n=o.unit}r*=o.value}return new Dr(r,n)}var Ir=function(e){return function(e){switch(e){case Zn.kUNumber:return t.UnitType.kNumber;case Zn.kULength:return t.UnitType.kPixels;case Zn.kUPercent:return t.UnitType.kPercentage;case Zn.kUTime:return t.UnitType.kSeconds;case Zn.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return Zn.kUNumber;case t.UnitType.kPercentage:return Zn.kUPercent;case t.UnitType.kPixels:return Zn.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return Zn.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return Zn.kUAngle;default:return Zn.kUOther}}(e))},Dr=function(e){function n(n,r){var i,o;return void 0===r&&(r=t.UnitType.kNumber),o="string"==typeof r?gr(r):r,(i=e.call(this,new Sr(o))||this).unit=void 0,i.value=void 0,i.unit=o,i.value=n,i}cr(n,e);var r=n.prototype;return r.clone=function(){return new n(this.value,this.unit)},r.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=Ir(this.unit);if(r!==Ir(e)||r===t.UnitType.kUnknown)return null;var i=xr(this.unit)/xr(e);return new n(this.value*i,e)},r.equals=function(t){return this.value===t.value&&this.unit===t.unit},r.getType=function(){return vr.kUnitType},r.sumValue=function(){var e,n,r=[],i={};return this.unit!==t.UnitType.kNumber&&(i[(e=this.unit,n=Ir(e),n===t.UnitType.kUnknown?e:n)]=1),r.push({value:this.value*xr(this.unit),units:i}),r},r.negate=function(){return new n(-this.value,this.unit)},r.invert=function(){return this.unit===t.UnitType.kNumber?0===this.value?null:new n(1/this.value,this.unit):Gr.create(this)},r.buildCSSText=function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var o=this.value,a=Er(this.unit);if(-999999>o||o>999999){var s=Er(this.unit);i=!Number.isFinite(o)||Number.isNaN(o)?function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(Gn(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e}(o,s):o+(s||"")}else i=""+o+a}return r+=i},n}(Cr),Fr=function(t){function e(){return t.apply(this,arguments)||this}return cr(e,t),e.prototype.isUnitValue=function(){return!1},e}(Cr),Gr=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).value=void 0,r.operator="invert",r.value=e,r}cr(e,t),e.create=function(t){return new e(t,Sr.negateExponents(t.type_))};var n=e.prototype;return n.clone=function(){return new e(this.value,this.type_)},n.getType=function(){return vr.kInvertType},n.equals=function(t){return t.getType()===vr.kInvertType&&this.value.equals(t.value)},n.sumValue=function(){var t=this.value.sumValue();return 0===t.length||1!==t.length||0===t[0].value?null:(Object.keys(t[0].units).forEach((function(e){t[0].units[e]*=-1})),t[0].value=1/t[0].value,t)},n.buildCSSText=function(t,e,n){return e==$n.kNo&&(n+=t===Jn.kYes?"(":"calc("),n=this.value.buildCSSText(Jn.kYes,$n.kNo,n+="1 / "),e===$n.kNo&&(n+=")"),n},e}(Fr),Ur=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).value=void 0,r.operator="negate",r.value=e,r}cr(e,t),e.create=function(t){return new e(t,t.type_)};var n=e.prototype;return n.clone=function(){return new e(this.value,this.type_)},n.getType=function(){return vr.kNegateType},n.equals=function(t){return t.getType()===vr.kNegateType&&this.value.equals(t.value)},n.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach((function(t){t.value*=-1})),t)},n.buildCSSText=function(t,e,n){return e==$n.kNo&&(n+=t===Jn.kYes?"(":"calc("),n=this.value.buildCSSText(Jn.kYes,$n.kNo,n+="-"),e===$n.kNo&&(n+=")"),n},e}(Fr);function Br(t,e,n){for(var r=t[0].type_,i=1;t.length>i;i++)r=e(r,t[i].type_,false);return r}var Vr=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).values=void 0,r.values=e,r}cr(e,t);var n=e.prototype;return n.numericValues=function(){return this.values},n.equals=function(t){return this.getType()===t.getType()&&this.values.every((function(e,n){return e.equals(t.values[n])}))},e}(Fr),Hr=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).operator="min",e}cr(e,t),e.create=function(t){return new e(t,Br(t,Sr.add))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return vr.kMinType},n.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=dr(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},n.buildCSSText=function(t,e,n){n+="min(";for(var r,i=!0,o=dr(this.numericValues());!(r=o()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(Jn.kYes,$n.kYes,n)}return n+=")"},e}(Vr),zr=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).operator="max",e}cr(e,t),e.create=function(t){return new e(t,Br(t,Sr.add))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return vr.kMaxType},n.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=dr(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},n.buildCSSText=function(t,e,n){n+="max(";for(var r,i=!0,o=dr(this.numericValues());!(r=o()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(Jn.kYes,$n.kYes,n)}return n+=")"},e}(Vr),jr=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).operator="sum",e}cr(e,t),e.create=function(t){return new e(t,Br(t,Sr.add))},e.numericTypeFromUnitMap=function(t){var e=new Sr;return Object.keys(t).forEach((function(n){var r=t[n];e=Sr.multiply(e,new Sr(Number(n),r),false),Gn(!0)})),e},e.canCreateNumericTypeFromSumValue=function(t){var e=this;Gn(!!t.length);var n=this.numericTypeFromUnitMap(t[0].units);return t.every((function(t){return Sr.add(n,e.numericTypeFromUnitMap(t.units),false),!0}))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return vr.kSumType},n.sumValue=function(){var t=[];return this.numericValues().forEach((function(e){var n=e.sumValue();if(!n.length)return null;n.forEach((function(e){var n=t.findIndex((function(t){return JSON.stringify(t.units)===JSON.stringify(e.units)}));-1===n?t.push(ur({},e)):t[n].value+=e.value}))})),e.canCreateNumericTypeFromSumValue(t)?t:null},n.buildCSSText=function(t,e,n){e==$n.kNo&&(n+=t===Jn.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(Jn.kYes,$n.kNo,n);for(var i=1;r.length>i;i++){var o=r[i];n=o.getType()===vr.kNegateType?o.value.buildCSSText(Jn.kYes,$n.kNo,n+=" - "):o.buildCSSText(Jn.kYes,$n.kNo,n+=" + ")}return e===$n.kNo&&(n+=")"),n},e}(Vr),Yr=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).operator="product",e}cr(e,t),e.create=function(t){return new e(t,Br(t,Sr.multiply))},e.multiplyUnitMaps=function(t,e){return Object.keys(e).forEach((function(n){Un(e[n].value,0);var r=n in t?t[n].value:0;r+e[n].value===0?delete t[n]:t[n]=r+e[n].value})),t};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return vr.kProductType},n.sumValue=function(){var t=[{value:1,units:{}}];return this.numericValues().forEach((function(n){var r=n.sumValue();if(!r.length)return null;var i=[];t.forEach((function(t){r.forEach((function(n){i.push({value:t.value*n.value,units:e.multiplyUnitMaps(t.units,n.units)})}))})),t=i})),t},n.buildCSSText=function(t,e,n){e==$n.kNo&&(n+=t===Jn.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(Jn.kYes,$n.kNo,n);for(var i=1;r.length>i;i++){var o=r[i];n=o.getType()===vr.kInvertType?o.value.buildCSSText(Jn.kYes,$n.kNo,n+=" / "):o.buildCSSText(Jn.kYes,$n.kNo,n+=" * ")}return e===$n.kNo&&(n+=")"),n},e}(Vr),Wr=new Dr(0,"px"),Xr=(new Dr(1,"px"),new Dr(0,"deg")),qr=function(t){function e(e,n,r,i,o){var a;return void 0===i&&(i=1),void 0===o&&(o=!1),(a=t.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}cr(e,t);var n=e.prototype;return n.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},n.buildCSSText=function(t,e,n){return n+"rgba("+this.r+","+this.g+","+this.b+","+this.alpha+")"},e}(br),Kr={number:function(t){return new Dr(t)},percent:function(t){return new Dr(t,"%")},px:function(t){return new Dr(t,"px")},em:function(t){return new Dr(t,"em")},rem:function(t){return new Dr(t,"rem")},deg:function(t){return new Dr(t,"deg")},grad:function(t){return new Dr(t,"grad")},rad:function(t){return new Dr(t,"rad")},turn:function(t){return new Dr(t,"turn")},s:function(t){return new Dr(t,"s")},ms:function(t){return new Dr(t,"ms")},registerProperty:function(t){Zs.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){Zs.layoutRegistry.registerLayout(t,e)}},Zr=new Pr("unset"),Qr=new Pr("initial"),Jr=new Pr("inherit"),$r={"":Zr,unset:Zr,initial:Qr,inherit:Jr},ti=function(t){return $r[t]||($r[t]=new Pr(t)),$r[t]},ei=new qr(0,0,0,0,!0),ni=new qr(0,0,0,0),ri=ke((function(t,e,n,r){return new qr(t,e,n,r)}),(function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"})),ii=ke((function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new Dr(e,n)}),(function(e,n){return void 0===n&&(n=t.UnitType.kNumber),""+e+n})),oi=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,ai=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,si=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ui=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var ci={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},li=ke((function(t){var e;return e="angular"===t.type?Number(t.value):ci[t.value]||0,ii(e,"deg")})),hi=ke((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:ii(e,r),cy:ii(n,i)}})),fi=ke((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Io(e).map((function(e){var n=e.type,r=e.orientation,i=e.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,o=Number(t[0].length.value),a=1;r>a;a++){var s,u=null===(s=t[a].length)||void 0===s?void 0:s.value;if(!fe(u)&&!fe(o)){for(var c=1;a-i>c;c++)t[i+c].length={type:"%",value:""+(o+(Number(u)-o)*c/(a-i))};i=a,o=Number(u)}}}(i);var o=i.map((function(t){return{offset:ii(t.length.value,"%"),color:Ro(t)}}));if("linear-gradient"===n)return new Mr(t.GradientType.LinearGradient,{angle:r?li(r):Xr,steps:o});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var a,s=hi(r[0].at),u=s.cx,c=s.cy;if(r[0].style){var l=r[0].style,h=l.type,f=l.value;a="extent-keyword"===h?ti(f):ii(f,h)}return new Mr(t.GradientType.RadialGradient,{cx:u,cy:c,size:a,steps:o})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=oi.exec(e);if(r){var i,o=(null===(i=r[2].match(ui))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new Mr(t.GradientType.LinearGradient,{angle:ii(parseFloat(r[1]),"deg"),steps:o.map((function(t){var e=t[1];return{offset:ii(100*Number(t[0]),"%"),color:e}}))})]}}else if("r"===n){var a=function(t){var e=ai.exec(t);if(e){var n,r=(null===(n=e[4].match(ui))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:ii(50,"%"),cy:ii(50,"%"),steps:r.map((function(t){var e=t[1];return{offset:ii(100*Number(t[0]),"%"),color:e}}))}}return null}(e);if(a){if(!xe(a))return[new Mr(t.GradientType.RadialGradient,a)];e=a}}else if("p"===n)return function(t){var e=si.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(e)}));function pi(t){return me(t)&&!!t.image}var di=ke((function(t){if(pi(t))return ur({repetition:"repeat"},t);if(fe(t)&&(t=""),"transparent"===t)return ni;"currentColor"===t&&(t="black");var e=fi(t);if(e)return e;var n=ze(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),ri.apply(void 0,r)}));function vi(t,e){if(t instanceof qr&&e instanceof qr)return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(Ee(e[n],0,255));return e[3]=Ee(e[3],0,1),"rgba("+e.join(",")+")"}]}function mi(t,e){if(fe(e))return ii(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return ii(Number(e),"px");if("deg".search(t)>=0)return ii(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return ii(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var yi=ke((function(t){return mi(new RegExp("px","g"),t)})),gi=(ke((function(t){return mi(new RegExp("%","g"),t)})),ke((function(t){return Te(t)||isFinite(Number(t))?ii(Number(t),"px"):mi(new RegExp("px|%|em|rem","g"),t)}))),xi=ke((function(t){return mi(new RegExp("deg|rad|grad|turn","g"),t)}));function Ei(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=Ir(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=Er(t.unit)):(Dr.isLength(t.unit)||Dr.isLength(e.unit))&&(a=wi(t,i,n),s=wi(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Ti(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=wo(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=ko(Number(e.value))),n}function bi(t){return xe(t)?t.split(" ").map((function(t){return gi(t)})):t.map((function(t){return gi(t.toString())}))}function wi(e,n,r){if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.getGeometryBounds(),o=0;return On.isEmpty(i)||(o=2*i.halfExtents[n]),Number(e.value)/100*o}return 0}var ki=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Mi(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,ki.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return mi(/deg|rad|grad|turn|px|%/g,t)||di(t)}))}),n.lastIndex===t.length)return r}return[]}function Pi(t){return t.toString()}var Si=ke((function(t){return"number"==typeof t?ii(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?ii(Number(t)):ii(0)}));ke((function(t){return xe(t)?t.split(" ").map(Si):t.map(Si)}));function Ni(t,e){return[t,e,Pi]}function Ci(t,e){return function(n,r){return[n,r,function(n){return Pi(Ee(n,t,e))}]}}function Ai(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var Oi=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,zCommandIndexes:[],rect:{x:0,y:0,width:0,height:0}};var e;try{e=Wt(t)}catch(n){e=Wt(""),console.error("[g]: Invalid SVG Path definition: "+t)}var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}r.length>0&&n.push(r);return{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=te(e,!0),s=a[0],u=a[1],c=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=zo(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&Fo(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var p=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[p[0]-n[0],p[1]-n[1]],l.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===c){var d=[u[1],u[2]];l.startTangent=[p[0]-d[0],p[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]}else if("T"===c){var v=e[s-1],m=Uo(v.currentPoint,p);"Q"===v.command?(l.command="Q",l.startTangent=[p[0]-m[0],p[1]-m[1]],l.endTangent=[n[0]-m[0],n[1]-m[1]]):(l.command="TL",l.startTangent=[p[0]-n[0],p[1]-n[1]],l.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===c){var y=[u[1],u[2]],g=[u[3],u[4]];l.startTangent=[p[0]-y[0],p[1]-y[1]],l.endTangent=[n[0]-g[0],n[1]-g[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[y[0]-g[0],y[1]-g[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[g[0]-y[0],g[1]-y[1]])}else if("S"===c){var x=e[s-1],E=Uo(x.currentPoint,p),T=[u[1],u[2]];"C"===x.command?(l.command="C",l.startTangent=[p[0]-E[0],p[1]-E[1]],l.endTangent=[n[0]-T[0],n[1]-T[1]]):(l.command="SQ",l.startTangent=[p[0]-T[0],p[1]-T[1]],l.endTangent=[n[0]-T[0],n[1]-T[1]])}else if("A"===c){var b=.001,w=l.arcParams||{},k=w.cx,M=void 0===k?0:k,P=w.cy,S=void 0===P?0:P,N=w.rx,C=void 0===N?0:N,A=w.ry,O=void 0===A?0:A,_=w.sweepFlag,L=w.startAngle,R=void 0===L?0:L,I=w.endAngle,D=void 0===I?0:I;0===(void 0===_?0:_)&&(b*=-1);var F=C*Math.cos(R-b)+M,G=O*Math.sin(R-b)+S;l.startTangent=[F-i[0],G-i[1]];var U=C*Math.cos(R+D+b)+M,B=O*Math.sin(R+D-b)+S;l.endTangent=[p[0]-U,p[1]-B]}e.push(l)}return e}(e),l=function(t,e){for(var n=[],r=[],i=[],o=0;t.length>o;o++){var a=t[o],s=a.currentPoint,u=a.params,c=a.prePoint,l=void 0;switch(a.command){case"Q":l=un(c[0],c[1],u[1],u[2],u[3],u[4]);break;case"C":l=hn(c[0],c[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=a.arcParams;l=dn(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}l&&(a.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===a.command||"M"===a.command)&&a.prePoint&&a.nextPoint&&i.push(a)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=ge(n),p=ge(r),d=ye(n),v=ye(r);if(0===i.length)return{x:f,y:p,width:d-f,height:v-p};for(var m=0;i.length>m;m++){var y=i[m],g=y.currentPoint;g[0]===f?f-=Go(y,e).xExtra:g[0]===d&&(d+=Go(y,e).xExtra),g[1]===p?p-=Go(y,e).yExtra:g[1]===v&&(v+=Go(y,e).yExtra)}return{x:f,y:p,width:d-f,height:v-p}}(c,0),h=l.x,f=l.y,p=l.width,d=l.height;return{absolutePath:e,hasArc:n,segments:c,polygons:i,polylines:o,curve:s,totalLength:0,zCommandIndexes:u,rect:{x:Number.isFinite(h)?h:0,y:Number.isFinite(f)?f:0,width:Number.isFinite(p)?p:0,height:Number.isFinite(d)?d:0}}},_i=ke(Oi);function Li(t,e){var n=xe(t)?_i(t):Oi(t);return e&&(e.parsedStyle.defX=n.rect.x,e.parsedStyle.defY=n.rect.y),n}function Ri(t,e,n){var r=t.curve,i=e.curve,o=[r,i];r.length!==i.length&&(o=he(r,i));var a,s,u,c,l,h,f,p,d=ce(o[0])!==ce(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):Nt(o[0]);return[d,(u=o[1],c=d,l=u.length-1,h=[],f=0,p=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(u),p.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=Zt(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=f,f=0})),p[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Ii(t,e){var n;n=xe(t)?t.split(" ").map((function(t){var e=t.split(","),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,o=[],a=0,s=vn(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=on.length(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))}));var u=Math.min.apply(Math,n.map((function(t){return t[0]}))),c=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:o}}var Di=null;function Fi(t){return function(e){var n=0;return t.map((function(t){return t===Di?e[n++]:t}))}}function Gi(t){return t}var Ui={matrix:["NNNNNN",[Di,Di,0,0,Di,Di,0,0,0,0,1,0,Di,Di,0,1],Gi],matrix3d:["NNNNNNNNNNNNNNNN",Gi],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Fi([Di,Di,new Dr(1)]),Gi],scalex:["N",Fi([Di,new Dr(1),new Dr(1)]),Fi([Di,new Dr(1)])],scaley:["N",Fi([new Dr(1),Di,new Dr(1)]),Fi([new Dr(1),Di])],scalez:["N",Fi([new Dr(1),new Dr(1),Di])],scale3d:["NNN",Gi],skew:["Aa",null,Gi],skewx:["A",null,Fi([Di,Xr])],skewy:["A",null,Fi([Xr,Di])],translate:["Tt",Fi([Di,Di,Wr]),Gi],translatex:["T",Fi([Di,Wr,Wr]),Fi([Di,Wr])],translatey:["T",Fi([Wr,Di,Wr]),Fi([Wr,Di])],translatez:["L",Fi([Wr,Wr,Di])],translate3d:["TTL",Gi]};function Bi(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=Ui[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],f=u[l],p=void 0;if(void 0===(p=h?{A:function(t){return"0"===t.trim()?Xr:xi(t)},N:Si,T:gi,L:yi}[f.toUpperCase()](h):{a:Xr,n:c[0],t:Wr}[f]))return[];c.push(p)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function Vi(t){var e,n,r,i;switch(t.t){case"rotatex":return i=bo(Ti(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=bo(Ti(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=bo(Ti(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=bo(Ti(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var l=bo(Ti(t.d[0])),h=bo(Ti(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=bo(Ti(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=bo(Ti(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=wi(t.d[0],0,null)||0,n=wi(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=wi(t.d[0],0,null)||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=wi(t.d[0],0,null)||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=wi(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=wi(t.d[0],0,null)||0,n=wi(t.d[1],0,null)||0,r=wi(t.d[2],0,null)||0,1];case"perspective":var f=wi(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,f?-1/f:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function Hi(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function zi(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(No,t))return!1;if(w(Co,No),Co[3]=0,Co[7]=0,Co[11]=0,Co[15]=1,1e-8>Math.abs(N(Co)))return!1;var a=No[3],s=No[7],u=No[11],c=No[12],l=No[13],h=No[14],f=No[15];if(0!==a||0!==s||0!==u){if(Ao[0]=a,Ao[1]=s,Ao[2]=u,Ao[3]=f,!S(Co,Co))return!1;P(Co,Co),lt(i,Ao,Co)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=c,e[1]=l,e[2]=h,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(Oo,No),n[0]=q(Oo[0]),et(Oo[0],Oo[0]),r[0]=nt(Oo[0],Oo[1]),Lo(Oo[1],Oo[1],Oo[0],1,-r[0]),n[1]=q(Oo[1]),et(Oo[1],Oo[1]),r[0]/=n[1],r[1]=nt(Oo[0],Oo[2]),Lo(Oo[2],Oo[2],Oo[0],1,-r[1]),r[2]=nt(Oo[1],Oo[2]),Lo(Oo[2],Oo[2],Oo[1],1,-r[2]),n[2]=q(Oo[2]),et(Oo[2],Oo[2]),r[1]/=n[2],r[2]/=n[2],rt(_o,Oo[1],Oo[2]),0>nt(Oo[0],_o))for(var p=0;3>p;p++)n[p]*=-1,Oo[p][0]*=-1,Oo[p][1]*=-1,Oo[p][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+Oo[0][0]-Oo[1][1]-Oo[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-Oo[0][0]+Oo[1][1]-Oo[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-Oo[0][0]-Oo[1][1]+Oo[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+Oo[0][0]+Oo[1][1]+Oo[2][2],0)),Oo[2][1]>Oo[1][2]&&(o[0]=-o[0]);Oo[0][2]>Oo[2][0]&&(o[1]=-o[1]);Oo[1][0]>Oo[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Vi).reduce(Hi)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var ji=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(var u=0;3>u;u++)for(var c=0;3>c;c++)a[3][u]+=e[c]*a[c][u];var l=i[0],h=i[1],f=i[2],p=i[3],d=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];d[0][0]=1-2*(h*h+f*f),d[0][1]=2*(l*h-f*p),d[0][2]=2*(l*f+h*p),d[1][0]=2*(l*h+f*p),d[1][1]=1-2*(l*l+f*f),d[1][2]=2*(h*f-l*p),d[2][0]=2*(l*f-h*p),d[2][1]=2*(h*f+l*p),d[2][2]=1-2*(l*l+h*h),a=t(a,d);var v,m=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(m[2][1]=r[2],a=t(a,m)),r[1]&&(m[2][1]=0,m[2][0]=r[0],a=t(a,m)),r[0]&&(m[2][0]=0,m[1][0]=r[0],a=t(a,m));for(var y=0;3>y;y++)for(var g=0;3>g;g++)a[y][g]*=n[y];return 0==(v=a)[0][2]&&0==v[0][3]&&0==v[1][2]&&0==v[1][3]&&0==v[2][0]&&0==v[2][1]&&1==v[2][2]&&0==v[2][3]&&0==v[3][2]&&1==v[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function Yi(t){return t.toFixed(6).replace(".000000","")}function Wi(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=zi(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=zi(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=Ee(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return ji(t[0],t[1],t[2],e,t[4]).map(Yi).join(",")}])}function Xi(t){return t.replace(/[xy]/,"")}function qi(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function Ki(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?ii(a):ii(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length){var h=Wi(t,e);u=[h[0]],c=[h[1]],l=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var p=t[f].t,d=e[f].t,v=t[f].d,m=e[f].d,y=Ui[p],g=Ui[d],x=void 0;if(s=d,"perspective"===(a=p)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var E=Wi([t[f]],[e[f]]);u.push(E[0]),c.push(E[1]),l.push(["matrix",[E[2]]])}else{if(p===d)x=p;else if(y[2]&&g[2]&&Xi(p)===Xi(d))x=Xi(p),v=y[2](v),m=g[2](m);else{if(!y[1]||!g[1]||qi(p)!==qi(d)){var T=Wi(t,e);u=[T[0]],c=[T[1]],l=[["matrix",[T[2]]]];break}x=qi(p),v=y[1](v),m=g[1](m)}for(var b=[],w=[],k=[],M=0;v.length>M;M++){var P=Ei(v[M],m[M],n,!1,M);b[M]=P[0],w[M]=P[1],k.push(P[2])}u.push(b),c.push(w),l.push([x,k])}}if(r){var S=u;u=c,c=S}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var Zi=ke((function(t){if(xe(t)){if("text-anchor"===t)return[ii(0,"px"),ii(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[gi(Qi(e[0])),gi(Qi(e[1]))]}return[ii(t[0]||0,"px"),ii(t[1]||0,"px")]}));function Qi(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var Ji=function(){function t(){this.parser=xi,this.mixer=Ni}return t.prototype.calculator=function(t,e,n,r){return Ti(n)},t}(),$i=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Pr&&(n=null),Zs.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&Zs.sceneGraphService.dirtifyToRoot(t)})),n},t}(),to=function(){function t(){this.parser=di,this.mixer=vi}return t.prototype.calculator=function(t,e,n,r){return n instanceof Pr?"none"===n.value?ei:ni:n},t}(),eo=function(){function t(){this.parser=Mi}return t.prototype.calculator=function(t,e,n){return n instanceof Pr?[]:n},t}();function no(t){var e=t.parsedStyle.fontSize;return fe(e)?null:e}var ro=function(){function e(){this.parser=gi,this.mixer=Ni}return e.prototype.calculator=function(e,n,r,i,o){if(!Dr.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){var a=no(i.parentNode);if(a)return a*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=no(i.ownerDocument.documentElement);if(u)return u*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}},e}(),io=function(){function t(){this.mixer=Ai}var e=t.prototype;return e.parser=function(t){var e=bi(Te(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),oo=function(){function t(){this.mixer=Ai}var e=t.prototype;return e.parser=function(t){var e=bi(Te(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),ao=function(e){function n(){return e.apply(this,arguments)||this}return cr(n,e),n.prototype.postProcessor=function(e){var n,r,i;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var o=e.parsedStyle,a=o.cx,s=o.cy;fe(a)||(n=a),fe(s)||(r=s);break;case t.Shape.LINE:var u=e.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1,u.x2),r=Math.min(c,l),i=0;break;case t.Shape.RECT:case t.Shape.IMAGE:case t.Shape.GROUP:case t.Shape.HTML:case t.Shape.TEXT:case t.Shape.MESH:fe(e.parsedStyle.x)||(n=e.parsedStyle.x),fe(e.parsedStyle.y)||(r=e.parsedStyle.y)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=n||0,e.parsedStyle.defY=r||0),!fe(n)||!fe(r)||!fe(i)){var h=e.getLocalPosition(),f=h[0],p=h[1],d=h[2];e.setLocalPosition(fe(n)?f:n,fe(r)?p:r,fe(i)?d:i)}},n}(ro),so=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i;n instanceof Pr&&(n=null);var o=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return o&&(o.style.isMarker=!0),o},t}(),uo=function(){function t(){this.mixer=Ni,this.parser=Si}return t.prototype.calculator=function(t,e,n){return n.value},t}(),co=function(){function e(){this.parser=Si,this.mixer=Ci(0,1)}var n=e.prototype;return n.calculator=function(t,e,n){return n.value},n.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath;if(r){var i=r.nodeName;if(i===t.Shape.LINE||i===t.Shape.PATH||i===t.Shape.POLYLINE){var o=r.getPoint(n.offsetDistance);o&&(e.parsedStyle.defX=o.x,e.parsedStyle.defY=o.y,e.setLocalPosition(o.x,o.y))}}},e}(),lo=function(){function t(){this.parser=Si,this.mixer=Ci(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),ho=function(){function e(){this.parser=Li,this.mixer=Ri}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof Pr&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:[],totalLength:0,zCommandIndexes:[],rect:new Dn(0,0,0,0)}:n},n.postProcessor=function(e){if(e.nodeName===t.Shape.PATH){var n=e.parsedStyle,r=n.defX,i=n.defY;e.setLocalPosition(void 0===r?0:r,void 0===i?0:i)}},e}(),fo=function(){function e(){this.parser=Ii}return e.prototype.postProcessor=function(e){if(e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE){var n=e.parsedStyle;e.setLocalPosition(n.defX,n.defY)}},e}(),po=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).mixer=Ci(0,1/0),e}return cr(e,t),e}(ro),vo=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Pr?"unset"===n.value?"":n.value:n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),mo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),yo=function(){function t(){this.tmpMat4=b(),this.parser=Bi,this.mixer=Ki}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Pr?[]:n},e.postProcessor=function(t){var e=this,n=t.parsedStyle,r=n.transform,i=n.defX,o=n.defY;r&&r.length&&(t.resetLocalTransform(),t.setLocalPosition(i,o),r.forEach((function(n){var r=n.t,a=n.d;if("scale"===r){var s=(null==a?void 0:a.map((function(t){return t.value})))||[1,1];t.scaleLocal(s[0],s[1],1)}else if("scalex"===r){var u=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(u[0],1,1)}else if("scaley"===r){var c=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(1,c[0],1)}else if("scalez"===r){var l=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(1,1,l[0])}else if("scale3d"===r){var h=(null==a?void 0:a.map((function(t){return t.value})))||[1,1,1];t.scaleLocal(h[0],h[1],h[2])}else if("translate"===r){var f=a||[Wr,Wr];t.translateLocal(f[0].value,f[1].value,0)}else if("translatex"===r){t.translateLocal((a||[Wr])[0].value,0,0)}else if("translatey"===r){t.translateLocal(0,(a||[Wr])[0].value,0)}else if("translatez"===r){t.translateLocal(0,0,(a||[Wr])[0].value)}else if("translate3d"===r){var p=a||[Wr,Wr,Wr];t.translateLocal(p[0].value,p[1].value,p[2].value)}else if("rotate"===r){t.rotateLocal(0,0,(a||[Xr])[0].value)}else if("rotatex"===r){t.rotateLocal((a||[Xr])[0].value,0,0)}else if("rotatey"===r){t.rotateLocal(0,(a||[Xr])[0].value,0)}else if("rotatez"===r){t.rotateLocal(0,0,(a||[Xr])[0].value)}else if("rotate3d"===r);else if("skew"===r){var d=(null==a?void 0:a.map((function(t){return t.value})))||[0,0];t.setLocalSkew(bo(d[0]),bo(d[1]))}else if("skewx"===r){var v=(null==a?void 0:a.map((function(t){return t.value})))||[0];t.setLocalSkew(bo(v[0]),t.getLocalSkew()[1])}else if("skewy"===r){var m=(null==a?void 0:a.map((function(t){return t.value})))||[0];t.setLocalSkew(t.getLocalSkew()[0],bo(m[0]))}else if("matrix"===r){var y=a.map((function(t){return t.value}));t.setLocalTransform(k(e.tmpMat4,y[0],y[1],0,0,y[2],y[3],0,0,0,0,1,0,y[4]+i,y[5]+o,0,1))}else"matrix3d"===r&&(k.apply(W,[e.tmpMat4].concat(a.map((function(t){return t.value})))),e.tmpMat4[12]+=i,e.tmpMat4[13]+=o,t.setLocalTransform(e.tmpMat4))})))},t}(),go=function(){this.parser=Zi},xo=function(){function t(){this.parser=Si}var e=t.prototype;return e.calculator=function(t,e,n,r){return n.value},e.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0)}},t}();function Eo(t){return void 0===t?0:t>360||-360>t?t%360:t}function To(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Te(t)?K(t,e,n):Array.isArray(t)&&3===t.length?(r=t,(i=new E(3))[0]=r[0],i[1]=r[1],i[2]=r[2],i):K(t[0],t[1]||e,t[2]||n);var r,i}function bo(t){return t*(Math.PI/180)}function wo(t){return t*(180/Math.PI)}function ko(t){return 360*t}function Mo(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=F(X(),e),a=o[0],s=o[1],u=o[2],c=Math.asin(-e[2]/a);return i>c?c>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function Po(t,e,n,r,i){var o,a,s,u,c,l,h,f,p,d,v=Math.cos(t),m=Math.sin(t);return o=r*v,a=i*m,s=0,u=-r*m,c=i*v,l=0,h=e,f=n,p=1,(d=new E(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=c,d[5]=l,d[6]=h,d[7]=f,d[8]=p,d}function So(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=wo(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var No=b(),Co=b(),Ao=ct(),Oo=[X(),X(),X()],_o=X();function Lo(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}function Ro(t){var e=t.type,n=t.value;return"hex"===e?"#"+n:"literal"===e?n:"rgb"===e?"rgb("+n.join(",")+")":"rgba("+n.join(",")+")"}var Io=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,f=/^\(/,p=/^\)/,d=/^,/,v=/^\#([0-9a-fA-F]+)/,m=/^([a-zA-Z]+)/,y=/^rgb/i,g=/^rgba/i,x=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,E="";function T(t){throw new Error(E+": "+t)}function b(){var t=_(w);return E.length>0&&T("Invalid input not EOF"),t}function w(){return k("linear-gradient",t,P)||k("repeating-linear-gradient",e,P)||k("radial-gradient",n,S)||k("repeating-radial-gradient",r,S)||k("conic-gradient",i,S)}function k(t,e,n){return M(e,(function(e){var r=n();return r&&(G(d)||T("Missing comma before color stops")),{type:t,orientation:r,colorStops:_(L)}}))}function M(t,e){var n=G(t);if(n){G(f)||T("Missing (");var r=e(n);return G(p)||T("Missing )"),r}}function P(){return F("directional",o,1)||F("angular",h,1)}function S(){var t,e,n=N();return n&&((t=[]).push(n),e=E,G(d)&&((n=N())?t.push(n):E=e)),t}function N(){var t=function(){var t=F("shape",/^(circle)/i,0);t&&(t.style=D()||C());return t}()||function(){var t=F("shape",/^(ellipse)/i,0);t&&(t.style=I()||C());return t}();if(t)t.at=A();else{var e=C();if(e){t=e;var n=A();n&&(t.at=n)}else{var r=O();r&&(t={type:"default-radial",at:r})}}return t}function C(){return F("extent-keyword",a,1)}function A(){if(F("position",/^at/,0)){var t=O();return t||T("Missing positioning value"),t}}function O(){var t={x:I(),y:I()};if(t.x||t.y)return{type:"position",value:t}}function _(t){var e=t(),n=[];if(e)for(n.push(e);G(d);)(e=t())?n.push(e):T("One extra comma");return n}function L(){var t=F("hex",v,1)||M(g,(function(){return{type:"rgba",value:_(R)}}))||M(y,(function(){return{type:"rgb",value:_(R)}}))||F("literal",m,0);return t||T("Expected color definition"),t.length=I(),t}function R(){return G(x)[1]}function I(){return F("%",c,1)||F("position-keyword",s,1)||D()}function D(){return F("px",u,1)||F("em",l,1)}function F(t,e,n){var r=G(e);if(r)return{type:t,value:r[n]}}function G(t){var e=/^[\n\r\t\s]+/.exec(E);e&&U(e[0].length);var n=t.exec(E);return n&&U(n[0].length),n}function U(t){E=E.substring(t)}return function(t){return E=t,b()}}();function Do(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=ue(t.parsedStyle.path.absolutePath,void 0,Ct(Ct({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Fo(t,e){return t[0]===e[0]&&t[1]===e[1]}function Go(t,e){var n,r=t.prePoint,i=t.currentPoint,o=t.nextPoint,a=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2),u=Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2),c=Math.acos((a+s-u)/(2*Math.sqrt(a)*Math.sqrt(s)));if(!c||0===Math.sin(c)||(void 0===n&&(n=1e-5),Math.abs(c-0)<n))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(o[1]-i[1],o[0]-i[0])),h=Math.abs(Math.atan2(o[0]-i[0],o[1]-i[1]));return l=l>Math.PI/2?Math.PI-l:l,h=h>Math.PI/2?Math.PI-h:h,{xExtra:Math.cos(c/2-l)*(e/2*(1/Math.sin(c/2)))-e/2||0,yExtra:Math.cos(h-c/2)*(e/2*(1/Math.sin(c/2)))-e/2||0}}function Uo(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}function Bo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Vo(t,e){return Bo(t)*Bo(e)?(t[0]*e[0]+t[1]*e[1])/(Bo(t)*Bo(e)):1}function Ho(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Vo(t,e))}function zo(t,e){var n,r,i=e[1],o=e[2],a=(n=bo(e[3]),r=2*Math.PI,(n%r+r)%r),s=e[4],u=e[5],c=t[0],l=t[1],h=e[6],f=e[7],p=Math.cos(a)*(c-h)/2+Math.sin(a)*(l-f)/2,d=-1*Math.sin(a)*(c-h)/2+Math.cos(a)*(l-f)/2,v=p*p/(i*i)+d*d/(o*o);v>1&&(i*=Math.sqrt(v),o*=Math.sqrt(v));var m=i*i*(d*d)+o*o*(p*p),y=m?Math.sqrt((i*i*(o*o)-m)/m):1;s===u&&(y*=-1),isNaN(y)&&(y=0);var g=o?y*i*d/o:0,x=i?y*-o*p/i:0,E=(c+h)/2+Math.cos(a)*g-Math.sin(a)*x,T=(l+f)/2+Math.sin(a)*g+Math.cos(a)*x,b=[(p-g)/i,(d-x)/o],w=[(-1*p-g)/i,(-1*d-x)/o],k=Ho([1,0],b),M=Ho(b,w);return Vo(b,w)>-1||(M=Math.PI),1>Vo(b,w)||(M=0),0===u&&M>0&&(M-=2*Math.PI),1===u&&0>M&&(M+=2*Math.PI),{cx:E,cy:T,rx:Fo(t,[h,f])?0:i,ry:Fo(t,[h,f])?0:o,startAngle:k,endAngle:k+M,xRotation:a,arcFlag:s,sweepFlag:u}}function jo(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}var Yo=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},Wo=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},Xo=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},qo=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=Yo,this.call=Yo,this._callAsync=Wo,this.callAsync=Wo,this._promise=Xo,this.promise=Xo,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw new Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw new Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e,n=dr(this.interceptors);!(e=n()).done;){var r=e.value;if(r.register){var i=r.register(t);void 0!==i&&(t=i)}}return t},e.withOptions=function(t){var e=this,n=function(e){return Object.assign({},t,"string"==typeof e?{name:e}:e)};return{name:this.name,tap:function(t,r){return e.tap(n(t),r)},tapAsync:function(t,r){return e.tapAsync(n(t),r)},tapPromise:function(t,r){return e.tapPromise(n(t),r)},isUsed:function(){return e.isUsed()},withOptions:function(t){return e.withOptions(n(t))}}},e.isUsed=function(){return this.taps.length>0||this.interceptors.length>0},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){var e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var r=this.taps.length;r>0;){r--;var i=this.taps[r];this.taps[r+1]=i;var o=i.stage||0;if(e){if(e.has(i.name)){e.delete(i.name);continue}if(e.size>0)continue}if(n>=o){r++;break}}this.taps[r]=t},t}(),Ko=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=new Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),i="";i+='"use strict";\n',i+=this.header(),i+="return new Promise((function(_resolve, _reject) {\n",n&&(i+="var _sync = true;\n",i+="function _error(_err) {\n",i+="if(_sync)\n",i+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",i+="else\n",i+="_reject(_err);\n",i+="};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",e=new Function(this.args(),i)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map((function(t){return t.fn}))},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var e=this;if(this.options.interceptors.length>0){for(var n=t.onError,r=t.onResult,i=t.onDone,o="",a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.call&&(o+=this.getInterceptor(a)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.content(Object.assign(t,{onError:n&&function(t){for(var r="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].error&&(r+=e.getInterceptor(i)+".error("+t+");\n")}return r+=n(t)},onResult:r&&function(t){for(var n="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].result&&(n+=e.getInterceptor(i)+".result("+t+");\n")}return n+=r(t)},onDone:i&&function(){for(var t="",n=0;e.options.interceptors.length>n;n++){e.options.interceptors[n].done&&(t+=e.getInterceptor(n)+".done();\n")}return t+=i()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=dr(this.options.taps);!(t=e()).done;){if(t.value.context)return!0}return!1},e.callTap=function(t,e){for(var n=e.onError,r=e.onResult,i=e.onDone,o=e.rethrowIfPossible,a="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(a+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),a+=this.getInterceptor(u)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}a+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var l=this.options.taps[t];switch(l.type){case"sync":o||(a+="var _hasError"+t+" = false;\n",a+="try {\n"),a+=r?"var _result"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",o||(a+="} catch(_err) {\n",a+="_hasError"+t+" = true;\n",a+=n("_err"),a+="}\n",a+="if(!_hasError"+t+") {\n"),r&&(a+=r("_result"+t)),i&&(a+=i()),o||(a+="}\n");break;case"async":var h="";h+=r?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n",h+="if(_err"+t+") {\n",h+=n("_err"+t),h+="} else {\n",r&&(h+=r("_result"+t)),i&&(h+=i()),h+="}\n",a+="_fn"+t+"("+this.args({before:l.context?"_context":void 0,after:h+="})"})+");\n";break;case"promise":a+="var _hasResult"+t+" = false;\n",a+="var _promise"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",a+="if (!_promise"+t+" || !_promise"+t+".then)\n",a+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n",a+="_promise"+t+".then((function(_result"+t+") {\n",a+="_hasResult"+t+" = true;\n",r&&(a+=r("_result"+t)),i&&(a+=i()),a+="}), function(_err"+t+") {\n",a+="if(_hasResult"+t+") throw _err"+t+";\n",a+=n("_err"+t),a+="});\n"}return a},e.callTapsSeries=function(t){var e=this,n=t.onError,r=t.onResult,i=t.resultReturns,o=t.onDone,a=t.doneReturns,s=t.rethrowIfPossible;if(0===this.options.taps.length)return o();for(var u=this.options.taps.findIndex((function(t){return"sync"!==t.type})),c=i||a,l="",h=o,f=0,p=function(t){var i=t;h!==o&&("sync"!==e.options.taps[i].type||f++>20)&&(f=0,l+="function _next"+i+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+i+"();\n"});var a=h,p=function(t){return t?"":o()},d=e.callTap(i,{onError:function(t){return n(i,t,a,p)},onResult:r&&function(t){return r(i,t,a,p)},onDone:!r&&a,rethrowIfPossible:s&&(0>u||u>i)});h=function(){return d}},d=this.options.taps.length-1;d>=0;d--)p(d);return l+=h()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,r=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var i=this.options.taps.every((function(t){return"sync"===t.type})),o="";i||(o+="var _looper = (function() {\n",o+="var _loopAsync = false;\n"),o+="var _loop;\n",o+="do {\n",o+="_loop = false;\n";for(var a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.loop&&(o+=this.getInterceptor(a)+".loop("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.callTapsSeries({onError:e,onResult:function(t,e,n,r){var o="";return o+="if("+e+" !== undefined) {\n",o+="_loop = true;\n",i||(o+="if(_loopAsync) _looper();\n"),o+=r(!0),o+="} else {\n",o+=n(),o+="}\n"},onDone:n&&function(){var t="";return t+="if(!_loop) {\n",t+=n(),t+="}\n"},rethrowIfPossible:r&&i}),o+="} while(_loop);\n",i||(o+="_loopAsync = true;\n",o+="});\n",o+="_looper();\n"),o},e.callTapsParallel=function(t){var e=this,n=t.onError,r=t.onResult,i=t.onDone,o=t.rethrowIfPossible,a=t.onTap,s=void 0===a?function(t,e){return e()}:a;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:r,onDone:i,rethrowIfPossible:o});var u="";u+="do {\n",u+="var _counter = "+this.options.taps.length+";\n",i&&(u+="var _done = (function() {\n",u+=i(),u+="});\n");for(var c=function(t){var a=function(){return i?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(t){return t||!i?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(t,(function(){return e.callTap(t,{onError:function(e){var r="";return r+="if(_counter > 0) {\n",r+=n(t,e,a,c),r+="}\n"},onResult:r&&function(e){var n="";return n+="if(_counter > 0) {\n",n+=r(t,e,a,c),n+="}\n"},onDone:!r&&function(){return a()},rethrowIfPossible:o})}),a,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"},e.args=function(t){var e=void 0===t?{}:t,n=e.before,r=e.after,i=this._args;return n&&(i=[n].concat(i)),r&&(i=i.concat(r)),0===i.length?"":i.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),Zo=function(t){function e(){return t.apply(this,arguments)||this}return cr(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsParallel({onError:function(t,n,r,i){return e(n)+i(!0)},onDone:t.onDone})},e}(Ko),Qo=new Zo,Jo=function(t){return Qo.setup(this,t),Qo.create(t)},$o=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=Jo,r._call=void 0,r.call=void 0,r}return cr(e,t),e}(qo),ta=function(t){function e(){return t.apply(this,arguments)||this}return cr(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e,r,i){return n(e)+i(!0)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])}})},e}(Ko),ea=new ta,na=function(t){return ea.setup(this,t),ea.create(t)},ra=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=na,r._call=void 0,r.call=void 0,r}return cr(e,t),e}(qo),ia=function(t){function e(){return t.apply(this,arguments)||this}return cr(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsSeries({onError:function(t,n){return e(n)},onDone:t.onDone,rethrowIfPossible:t.rethrowIfPossible})},e}(Ko),oa=new ia,aa=function(){throw new Error("tapAsync is not supported on a SyncHook")},sa=function(){throw new Error("tapPromise is not supported on a SyncHook")},ua=function(t){return oa.setup(this,t),oa.create(t)},ca=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=aa,r.tapPromise=sa,r.compile=ua,r}return cr(e,t),e}(qo),la=function(t){function e(){return t.apply(this,arguments)||this}return cr(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])},doneReturns:t.resultReturns,rethrowIfPossible:t.rethrowIfPossible})},e}(Ko),ha=new la,fa=function(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")},pa=function(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")},da=function(t){return ha.setup(this,t),ha.create(t)},va=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=fa,r.tapPromise=pa,r.compile=da,r}return cr(e,t),e}(ca),ma=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ya=/([\"\'])[^\'\"]+\1/;var ga=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"center":e===t.Shape.TEXT?"text-anchor":"left top"},l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:t.PropertySyntax.PATH,p:50},{n:"points",l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],xa={},Ea=new WeakMap,Ta={},ba=ke((function(t){return t.sort((function(t,e){return Ta[t]-Ta[e]}))})),wa=X(),ka=X(),Ma=X(),Pa=function(){function e(){var t=this;ga.forEach((function(e){t.registerMetadata(e)}))}var n=e.prototype;return n.registerMetadata=function(t){[t.n].concat(t.a||[]).forEach((function(e){xa[e]=t,Ta[e]=t.p||0}))},n.unregisterMetadata=function(t){delete xa[t]},n.getPropertySyntax=function(t){return Zs.CSSPropertySyntaxFactory[t]},n.processProperties=function(t,e,n){var r=this;void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]});var i=n.skipUpdateAttribute,o=n.skipParse,a=n.usedAttributes,s=n.forceUpdateGeometry,u=Object.keys(e);u.forEach((function(n){var r,o=Hn(n);i||(t.attributes[o]=e[n]),!s&&(null===(r=xa[o])||void 0===r?void 0:r.l)&&(s=!0)})),o||u.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)})),(u=ba((null==a?void 0:a.length)?Array.from(new Set(u.concat(a))):u)).forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t))})),s&&this.updateGeometry(t),u.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t)})),t.children.length&&u.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},n.parseProperty=function(t,e,n){var r=xa[t],i=e;if((""===e||fe(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=ti(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=ti(e):s&&s.parser&&(i=s.parser(e,n))}return i},n.computeProperty=function(t,e,n){var r=xa[t],i=e;if(r){var o=r.syntax,a=r.d;if(e instanceof Pr){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)fe(a)||(e=this.parseProperty(t,Bn(a)?a(n.nodeName):a,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return fe(u)?void this.addUnresolveProperty(n,t):u}}var c=o&&this.getPropertySyntax(o);if(c&&c.calculator)i=c.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof Pr?e.value:e}return i},n.postProcessProperty=function(t,e){var n=xa[t];if(n&&n.syntax){var r=n.syntax&&this.getPropertySyntax(n.syntax);r&&r.postProcessor&&r.postProcessor(e)}},n.addUnresolveProperty=function(t,e){var n=Ea.get(t);n||(Ea.set(t,[]),n=Ea.get(t)),-1===n.indexOf(e)&&n.push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=Ea.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},n.recalc=function(t){var e=Ea.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Ea.delete(t)}},n.updateGeometry=function(e){var n=Zs.geometryUpdaterFactory[e.nodeName];if(n){var r=e.geometry;r.contentBounds||(r.contentBounds=new On),r.renderBounds||(r.renderBounds=new On);var i=e.parsedStyle,o=n.update(i,e),a=o.width,s=o.height,u=o.depth,c=void 0===u?0:u,l=o.offsetX,h=void 0===l?0:l,f=o.offsetY,p=void 0===f?0:f,d=o.offsetZ,v=void 0===d?0:d,m=0>a,y=0>s,g=Q(wa,Math.abs(a)/2,Math.abs(s)/2,c/2),x=i.stroke,E=i.lineWidth,T=i.increasedLineWidthForHitTesting,b=i.shadowType,w=i.shadowColor,k=i.filter,M=void 0===k?[]:k,P=i.transformOrigin,S=i.anchor;e.nodeName===t.Shape.TEXT&&delete i.anchor;var N=Q(ka,(1-2*(S&&S[0]||0))*a/2+h,(1-2*(S&&S[1]||0))*s/2+p,(1-2*(S&&S[2]||0))*g[2]+v);r.contentBounds.update(N,g);var C=e.nodeName===t.Shape.POLYLINE||e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.PATH?Math.SQRT2:.5;if(x&&!x.isNone){var A=((E||0)+(T||0))*C;J(g,g,Q(Ma,A,A,0))}if(r.renderBounds.update(N,g),w&&b&&"inner"!==b){var O=r.renderBounds,_=O.min,L=O.max,R=i.shadowBlur||0,I=i.shadowOffsetX||0,D=i.shadowOffsetY||0,F=L[0]+R+I,G=_[1]-R+D,U=L[1]+R+D;_[0]=Math.min(_[0],_[0]-R+I),L[0]=Math.max(L[0],F),_[1]=Math.min(_[1],G),L[1]=Math.max(L[1],U),r.renderBounds.setMinMax(_,L)}M.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,J(r.renderBounds.halfExtents,r.renderBounds.halfExtents,K(i,i,0)))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=r.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,f=c[1]-s+a,p=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],f),l[1]=Math.max(l[1],p),r.renderBounds.setMinMax(c,l)}})),S=i.anchor;var B=(m?-1:1)*wi(P[0],0,e),V=(y?-1:1)*wi(P[1],1,e);e.setOrigin(B-=(m?-1:1)*(S&&S[0]||0)*r.contentBounds.halfExtents[0]*2,V-=(y?-1:1)*(S&&S[1]||0)*r.contentBounds.halfExtents[1]*2),Zs.sceneGraphService.dirtifyToRoot(e)}},n.isPropertyInheritable=function(t){var e=xa[t];return!!e&&e.inh},e}(),Sa=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,$a),this.define(t.Shape.ELLIPSE,as),this.define(t.Shape.RECT,bs),this.define(t.Shape.IMAGE,fs),this.define(t.Shape.LINE,ds),this.define(t.Shape.GROUP,us),this.define(t.Shape.PATH,ms),this.define(t.Shape.POLYGON,gs),this.define(t.Shape.POLYLINE,Es),this.define(t.Shape.TEXT,ks),this.define(t.Shape.HTML,ls)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}(),Na=function(){function t(e){this.type=void 0,this.eventPhase=t.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new In,this.page=new In,this.canvas=new In,this.viewport=new In,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}var e=t.prototype;return e.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},e.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.stopPropagation=function(){this.propagationStopped=!0},e.initEvent=function(){},e.initUIEvent=function(){},e.clone=function(){throw new Error(tr)},sr(t,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),t}(),Ca=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(fr(r),n),r}return cr(e,t),e}(Na),Aa=function(){function t(){this.emitter=new mn.EventEmitter}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var r=be(n)&&n||me(n)&&n.capture,i=me(n)&&n.once,o=Bn(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var u=t.split(":");t=u[1],s=u[0],a=!0}if(t=r?t+"capture":t,e=Bn(e)?e:e.handleEvent,a){var c=e;e=function(){for(var t,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&c.apply(void 0,n)}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var r,i=be(n)&&n||me(n)&&n.capture,o=Bn(e)?void 0:e;return t=i?t+"capture":t,e=Bn(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent,this.emitter.off(t,e,o),this},e.emit=function(t,e){this.dispatchEvent(new Ca(t,e))},e.dispatchEvent=function(t,e){if(void 0===e&&(e=!1),!(t instanceof Na))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var n;if(this.document)n=this;else if(this.defaultView)n=this.defaultView;else{var r;n=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}if(n){var i;if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(i=t.manager)||void 0===i||i.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),Oa=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}cr(n,e),n.isNode=function(t){return!!t.childNodes};var r=n.prototype;return r.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},r.hasChildNodes=function(){return this.childNodes.length>0},r.isDefaultNamespace=function(t){throw new Error(tr)},r.lookupNamespaceURI=function(t){throw new Error(tr)},r.lookupPrefix=function(t){throw new Error(tr)},r.normalize=function(){throw new Error(tr)},r.isEqualNode=function(t){return this===t},r.isSameNode=function(t){return this.isEqualNode(t)},r.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof n))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var e=t,r=this,i=[e],o=[r];null!==(a=e.parentNode)&&void 0!==a?a:r.parentNode;){var a;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,r=r.parentNode?(o.push(r.parentNode),r.parentNode):r}if(e!==r)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,u=s===i?o:i;if(s[s.length-u.length]===u[0])return s===i?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],f=s[c+l];if(f!==h){var p=h.parentNode.childNodes;return p.indexOf(h)<p.indexOf(f)?u===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},r.contain=function(t){return this.contains(t)},r.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},r.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},r.forEach=function(t){t(this)||this.childNodes.forEach((function(e){e.forEach(t)}))},sr(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=dr(this.childNodes);!(n=r()).done;){var i=n.value;e+=i.nodeName===t.Shape.TEXT?i.nodeValue:i.textContent}return e},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t)})),this.nodeName===t.Shape.TEXT&&(this.style.text=""+e)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}}]),n}(Aa);Oa.DOCUMENT_POSITION_DISCONNECTED=1,Oa.DOCUMENT_POSITION_PRECEDING=2,Oa.DOCUMENT_POSITION_FOLLOWING=4,Oa.DOCUMENT_POSITION_CONTAINS=8,Oa.DOCUMENT_POSITION_CONTAINED_BY=16,Oa.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var _a,La,Ra=function(e){function n(){var n;(n=e.call(this)||this).defaultView=null,n.documentElement=void 0,n.timeline=void 0,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new Zs.AnimationTimeline(fr(n))}catch(t){}var r={};return ga.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=Bn(n)?n(t.Shape.GROUP):n)})),n.documentElement=new us({id:"g-root",style:r}),n.documentElement.ownerDocument=fr(n),n.documentElement.parentNode=fr(n),n.childNodes=[n.documentElement],n}cr(n,e);var r=n.prototype;return r.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?ks:us);var r=new n(e);return r.ownerDocument=this,r},r.createElementNS=function(t,e,n){return this.createElement(e,n)},r.cloneNode=function(t){throw new Error(tr)},r.destroy=function(){try{this.documentElement.destroy(),this.timeline.destroy()}catch(t){}},r.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=Zs.displayObjectPool.getByEntity(t.id),n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},r.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement},r.elementFromPoint=function(){var t=or(rr().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c},r.elementsFromPoint=function(){var t=or(rr().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.appendChild=function(t,e){throw new Error(er)},r.insertBefore=function(t,e){throw new Error(er)},r.removeChild=function(t,e){throw new Error(er)},r.replaceChild=function(t,e,n){throw new Error(er)},r.append=function(){throw new Error(er)},r.prepend=function(){throw new Error(er)},r.getElementById=function(t){return this.documentElement.getElementById(t)},r.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},r.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},r.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},r.querySelector=function(t){return this.documentElement.querySelector(t)},r.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},r.find=function(t){return this.documentElement.find(t)},r.findAll=function(t){return this.documentElement.findAll(t)},sr(n,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}}]),n}(Oa);(_a=t.Strategy||(t.Strategy={}))[_a.Standard=0]="Standard",(La=t.ElementEvent||(t.ElementEvent={})).DESTROY="destroy",La.ATTR_MODIFIED="DOMAttrModified",La.INSERTED="DOMNodeInserted",La.REMOVED="removed",La.MOUNTED="DOMNodeInsertedIntoDocument",La.UNMOUNTED="DOMNodeRemovedFromDocument",La.BOUNDS_CHANGED="bounds-changed",La.RENDER_ORDER_CHANGED="render-order-changed",La.CULLED="culled";var Ia=function(t){function e(e,n,r,i,o,a,s,u){var c;return(c=t.call(this,null)||this).relatedNode=void 0,c.prevValue=void 0,c.newValue=void 0,c.attrName=void 0,c.attrChange=void 0,c.prevParsedValue=void 0,c.newParsedValue=void 0,c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return cr(e,t),e}(Na);Ia.ADDITION=2,Ia.MODIFICATION=1,Ia.REMOVAL=3;var Da=0;var Fa,Ga,Ua,Ba=new Ia(t.ElementEvent.INSERTED,null,"","","",0,"",""),Va=new Ia(t.ElementEvent.REMOVED,null,"","","",0,"",""),Ha=new Ca(t.ElementEvent.DESTROY),za=function(e){function n(){for(var n,r=arguments.length,i=new Array(r),o=0;r>o;o++)i[o]=arguments[o];return(n=e.call.apply(e,[this].concat(i))||this).entity=Da++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},n.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:K(0,0,0),localRotation:wt(0,0,0,1),localScale:K(1,1,1),localTransform:b(),localSkew:St(0,0),position:K(0,0,0),rotation:wt(0,0,0,1),scaling:K(1,1,1),worldTransform:b(),origin:K(0,0,0)},n.sortable={dirty:!1,sorted:void 0,lastSortedIndex:void 0,renderOrder:0},n.geometry={contentBounds:void 0,renderBounds:void 0},n.rBushNode={aabb:void 0},n.id=void 0,n.name=void 0,n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle={anchor:Zr,opacity:Zr,fillOpacity:Zr,strokeOpacity:Zr,fill:Zr,stroke:Zr,transform:Zr,transformOrigin:Zr,visibility:Zr,pointerEvents:Zr,lineWidth:Zr,lineCap:Zr,lineJoin:Zr,increasedLineWidthForHitTesting:Zr,fontSize:Zr,fontFamily:Zr,fontStyle:Zr,fontWeight:Zr,fontVariant:Zr,textAlign:Zr,textBaseline:Zr,textTransform:Zr,zIndex:Zr,filter:Zr,shadowType:Zr},n.parsedStyle={},n.attributes={},n}cr(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw new Error(tr)},r.appendChild=function(t,e){var n;return Zs.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),Ba.relatedNode=this,t.dispatchEvent(Ba),t},r.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},r.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},r.removeChild=function(t){var e;return Va.relatedNode=this,t.dispatchEvent(Va),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),Zs.sceneGraphService.detach(t),t},r.removeChildren=function(){var t=this;this.childNodes.slice().forEach((function(e){t.removeChild(e),e.destroy()}))},r.matches=function(t){return Zs.sceneGraphService.matches(t,this)},r.getElementById=function(t){return Zs.sceneGraphService.querySelector("#"+t,this)},r.getElementsByName=function(t){return Zs.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},r.getElementsByClassName=function(t){return Zs.sceneGraphService.querySelectorAll("."+t,this)},r.getElementsByTagName=function(t){return Zs.sceneGraphService.querySelectorAll(t,this)},r.querySelector=function(t){return Zs.sceneGraphService.querySelector(t,this)},r.querySelectorAll=function(t){return Zs.sceneGraphService.querySelectorAll(t,this)},r.closest=function(t){var e=this;do{if(Zs.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},r.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},r.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},r.after=function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}},r.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,o)}},r.replaceWith=function(){this.after.apply(this,arguments),this.remove()},r.append=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))},r.prepend=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))},r.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},r.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},r.destroy=function(){this.dispatchEvent(Ha),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},r.getGeometryBounds=function(){return Zs.sceneGraphService.getGeometryBounds(this)},r.getRenderBounds=function(){return Zs.sceneGraphService.getBounds(this,!0)},r.getBounds=function(){return Zs.sceneGraphService.getBounds(this)},r.getLocalBounds=function(){return Zs.sceneGraphService.getLocalBounds(this)},r.getBoundingClientRect=function(){return Zs.sceneGraphService.getBoundingClientRect(this)},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},r.getAttributeNames=function(){return Object.keys(this.attributes)},r.getAttribute=function(t){var e=this.attributes[t];if(void 0===e){var n=Hn(t);return fe(e=this.attributes[n])?null:e}return e},r.hasAttribute=function(t){return this.getAttributeNames().includes(t)},r.hasAttributes=function(){return!!this.getAttributeNames().length},r.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},r.setAttribute=function(t,e,n){this.attributes[t]=e},r.getAttributeNS=function(t,e){throw new Error(tr)},r.getAttributeNode=function(t){throw new Error(tr)},r.getAttributeNodeNS=function(t,e){throw new Error(tr)},r.hasAttributeNS=function(t,e){throw new Error(tr)},r.removeAttributeNS=function(t,e){throw new Error(tr)},r.removeAttributeNode=function(t){throw new Error(tr)},r.setAttributeNS=function(t,e,n){throw new Error(tr)},r.setAttributeNode=function(t){throw new Error(tr)},r.setAttributeNodeNS=function(t){throw new Error(tr)},r.toggleAttribute=function(t,e){throw new Error(tr)},sr(n,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}}]),n}(Oa),ja=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).altKey=void 0,e.button=void 0,e.buttons=void 0,e.ctrlKey=void 0,e.metaKey=void 0,e.relatedTarget=void 0,e.shiftKey=void 0,e.client=new In,e.movement=new In,e.offset=new In,e.global=new In,e.screen=new In,e}cr(e,t);var n=e.prototype;return n.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},n.initMouseEvent=function(){throw new Error(tr)},sr(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}}]),e}(Na),Ya=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).pointerId=void 0,e.width=0,e.height=0,e.isPrimary=!1,e.pointerType=void 0,e.pressure=void 0,e.tangentialPressure=void 0,e.tiltX=void 0,e.tiltY=void 0,e.twist=void 0,e}cr(e,t);var n=e.prototype;return n.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},n.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},n.clone=function(){return this.manager.clonePointerEvent(this)},e}(ja),Wa=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).deltaMode=void 0,e.deltaX=void 0,e.deltaY=void 0,e.deltaZ=void 0,e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return cr(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(ja),Xa=new Ia(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,Ia.MODIFICATION,null,null),qa={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},Ka={anchor:[0,0],fill:ei,stroke:ei,transform:[],zIndex:0,filter:[],shadowType:"outer"},Za=["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting","fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],Qa=function(e){function n(n){var r,i;return(i=e.call(this)||this).config=void 0,i.isCustomElement=!1,i.isMutationObserved=!1,i.activeAnimations=[],i.getClip=function(){return this.style.clipPath||null},i.config=n,i.config.interactive=null!==(r=i.config.capture)&&void 0!==r?r:i.config.interactive,i.id=i.config.id||"",i.name=i.config.name||"",(i.config.className||i.config.class)&&(i.className=i.config.className||i.config.class),i.nodeName=i.config.type||t.Shape.GROUP,i.config.style=ur({},i.config.style,i.config.attrs),null!=i.config.visible&&(i.config.style.visibility=!1===i.config.visible?"hidden":"visible"),null!=i.config.interactive&&(i.config.style.pointerEvents=!1===i.config.interactive?"none":"auto"),Object.assign(i.parsedStyle,Ka,i.config.initialParsedStyle),Object.assign(i.attributes,qa),i.initAttributes(i.config.style),i.style=new Proxy({setProperty:function(t,e){i.setAttribute(t,e)},getPropertyValue:function(t){return i.getAttribute(t)},removeProperty:function(t){i.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:i.getAttribute(e)},set:function(t,e,n){return i.setAttribute(e,n),!0}}),Zs.displayObjectPool.add(i.entity,fr(i)),i}cr(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),Zs.displayObjectPool.remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t,e){var r=ur({},this.attributes);for(var i in r){var o=r[i];o instanceof n&&"clipPath"!==i&&"offsetPath"!==i&&"textPath"!==i&&(r[i]=o.cloneNode(t)),e&&(r[i]=e(i,o))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a},r.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable;Zs.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0,usedAttributes:Za}),e.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=Hn(t);we(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),e.prototype.setAttribute.call(this,i,n))},r.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];Zs.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(Xa.relatedNode=this,Xa.prevValue=o,Xa.newValue=e,Xa.attrName=t,Xa.prevParsedValue=a,Xa.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(Xa):(Xa.target=this,this.ownerDocument.defaultView.dispatchEvent(Xa,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},r.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],r=e[1],i=t.getMax();return new Dn(n,r,i[0]-n,i[1]-r)},r.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Zs.sceneGraphService.setOrigin(this,To(t,e,n)),this},r.getOrigin=function(){return Zs.sceneGraphService.getOrigin(this)},r.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Zs.sceneGraphService.setPosition(this,To(t,e,n)),this},r.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Zs.sceneGraphService.setLocalPosition(this,To(t,e,n)),this},r.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Zs.sceneGraphService.translate(this,To(t,e,n)),this},r.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Zs.sceneGraphService.translateLocal(this,To(t,e,n)),this},r.getPosition=function(){return Zs.sceneGraphService.getPosition(this)},r.getLocalPosition=function(){return Zs.sceneGraphService.getLocalPosition(this)},r.scale=function(t,e,n){return this.scaleLocal(t,e,n)},r.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=To(t,e=e||t,n=n||t)),Zs.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=To(t,e=e||t,n=n||t)),Zs.sceneGraphService.setLocalScale(this,t),this},r.getLocalScale=function(){return Zs.sceneGraphService.getLocalScale(this)},r.getScale=function(){return Zs.sceneGraphService.getScale(this)},r.getEulerAngles=function(){return wo(Mo(X(),Zs.sceneGraphService.getWorldTransform(this))[2])},r.getLocalEulerAngles=function(){return wo(Mo(X(),Zs.sceneGraphService.getLocalRotation(this))[2])},r.setEulerAngles=function(t){return Zs.sceneGraphService.setEulerAngles(this,0,0,t),this},r.setLocalEulerAngles=function(t){return Zs.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},r.rotateLocal=function(t,e,n){return fe(e)&&fe(n)?Zs.sceneGraphService.rotateLocal(this,0,0,t):Zs.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return fe(e)&&fe(n)?Zs.sceneGraphService.rotate(this,0,0,t):Zs.sceneGraphService.rotate(this,t,e,n),this},r.setRotation=function(t,e,n,r){return Zs.sceneGraphService.setRotation(this,t,e,n,r),this},r.setLocalRotation=function(t,e,n,r){return Zs.sceneGraphService.setLocalRotation(this,t,e,n,r),this},r.setLocalSkew=function(t,e){return Zs.sceneGraphService.setLocalSkew(this,t,e),this},r.getRotation=function(){return Zs.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return Zs.sceneGraphService.getLocalRotation(this)},r.getLocalSkew=function(){return Zs.sceneGraphService.getLocalSkew(this)},r.getLocalTransform=function(){return Zs.sceneGraphService.getLocalTransform(this)},r.getWorldTransform=function(){return Zs.sceneGraphService.getWorldTransform(this)},r.setLocalTransform=function(t){return Zs.sceneGraphService.setLocalTransform(this,t),this},r.resetLocalTransform=function(){Zs.sceneGraphService.resetLocalTransform(this)},r.getAnimations=function(){return this.activeAnimations},r.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},r.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},r.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},r.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},r.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))+1),this},r.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))-1),this},r.getConfig=function(){return this.config},r.attr=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n[1];return i?me(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},r.getMatrix=function(t){var e=t||this.getWorldTransform(),n=D(X(),e),r=n[0],i=n[1],o=F(X(),e),a=o[0],s=o[1],u=G(ht(),e),c=Mo(X(),u);return Po(c[0]||c[2],r,i,a,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=So(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},r.setLocalMatrix=function(t){var e=So(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},r.show=function(){this.style.visibility="visible"},r.hide=function(){this.style.visibility="hidden"},r.getCount=function(){return this.childElementCount},r.getParent=function(){return this.parentElement},r.getChildren=function(){return this.children},r.getFirst=function(){return this.firstElementChild},r.getLast=function(){return this.lastElementChild},r.getChildByIndex=function(t){return this.children[t]||null},r.add=function(t,e){return this.appendChild(t,e)},r.setClip=function(t){this.style.clipPath=t},r.set=function(t,e){this.config[t]=e},r.get=function(t){return this.config[t]},r.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.setZIndex=function(t){return this.style.zIndex=t,this},sr(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(za),Ja=["style"],$a=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=hr(r,Ja);return e.call(this,ur({type:t.Shape.CIRCLE,style:ur({cx:"",cy:"",r:""},i),initialParsedStyle:{anchor:[.5,.5]}},o))||this}return cr(n,e),n}(Qa),ts=["style"],es=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,o=hr(r,ts);return(n=t.call(this,ur({style:ur({x:"",y:""},i)},o))||this).isCustomElement=!0,n}return cr(e,t),e}(Qa),ns={},rs=[],is=function(){function e(){}var n=e.prototype;return n.getByEntity=function(t){return ns[t]},n.getAll=function(){return Object.keys(ns).map((function(t){return ns[t]}))},n.add=function(e,n){ns[e]=n,n.nodeName===t.Shape.HTML&&rs.push(n)},n.remove=function(e){var n=ns[e];if(n&&(delete ns[e],n.nodeName===t.Shape.HTML)){var r=rs.indexOf(n);rs.splice(r,1)}},n.getHTMLs=function(){return rs},e}(),os=["style"],as=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=hr(r,os);return e.call(this,ur({type:t.Shape.ELLIPSE,style:ur({cx:"",cy:"",rx:"",ry:""},i),initialParsedStyle:{anchor:[.5,.5]}},o))||this}return cr(n,e),n}(Qa),ss=["style"],us=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=hr(r,ss);return e.call(this,ur({type:t.Shape.GROUP,style:ur({x:"",y:"",width:"",height:""},i)},o))||this}return cr(n,e),n}(Qa),cs=["style"],ls=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=hr(i,cs);return(r=e.call(this,ur({type:t.Shape.HTML,style:ur({x:"",y:"",width:"auto",height:"auto",innerHTML:""},o)},a))||this).cullable.enable=!1,r}cr(n,e);var r=n.prototype;return r.getDomElement=function(){return this.parsedStyle.$el},r.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(t=this.ownerDocument)||void 0===t||null===(e=t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,o=n.top-r.top,a=new On;return a.setMinMax(K(i,o,0),K(i+n.width,o+n.height,0)),a}return null},r.getLocalBounds=function(){if(this.parentNode){var t=S(b(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!On.isEmpty(e)){var n=new On;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(Qa),hs=["style"],fs=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=hr(r,hs);return e.call(this,ur({type:t.Shape.IMAGE,style:ur({x:"",y:"",img:"",width:"",height:""},i)},o))||this}return cr(n,e),n}(Qa),ps=["style"],ds=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=hr(i,ps);(r=e.call(this,ur({type:t.Shape.LINE,style:ur({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0;var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd;return u&&u instanceof Qa&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),c&&c instanceof Qa&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}cr(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof Qa&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Qa&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&r instanceof Qa&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Qa&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},r.transformMarker=function(t){var e=this.parsedStyle,n=e.x1,r=e.x2,i=e.y1,o=e.y2,a=e.defX,s=e.defY,u=t?e.markerStart:e.markerEnd;if(u&&u instanceof Qa){var c,l,h,f,p,d,v;t?(f=n-a,p=i-s,l=r-n,h=o-i,d=e.markerStartOffset||0,v=this.markerStartAngle):(f=r-a,p=o-s,l=n-r,h=i-o,d=e.markerEndOffset||0,v=this.markerEndAngle),c=Math.atan2(h,l),u.setLocalEulerAngles(180*c/Math.PI+v),u.setLocalPosition(f+Math.cos(c)*d,p+Math.sin(c)*d)}},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=on.pointAt(n.x1,n.y1,n.x2,n.y2,t),a=o.x,s=o.y,u=it(X(),K(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new In(u[0],u[1])},r.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},r.getTotalLength=function(){var t=this.parsedStyle;return on.length(t.x1,t.y1,t.x2,t.y2)},n}(Qa),vs=["style"],ms=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=hr(i,vs);(r=e.call(this,ur({type:t.Shape.PATH,style:ur({path:"",miterLimit:""},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&u instanceof Qa&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&l instanceof Qa&&r.placeMarkerMid(l),c&&c instanceof Qa&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}cr(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof Qa&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Qa&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof Qa&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Qa&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,o=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&a instanceof Qa){var s,u,c,l,h,f,p;if(t){var d=this.getStartTangent(),v=d[0],m=d[1];l=m[0]-i,h=m[1]-o,u=v[0]-m[0],c=v[1]-m[1],f=n||0,p=this.markerStartAngle}else{var y=this.getEndTangent(),g=y[0],x=y[1];l=x[0]-i,h=x[1]-o,u=g[0]-x[0],c=g[1]-x[1],f=r||0,p=this.markerEndAngle}s=Math.atan2(c,u),a.setLocalEulerAngles(180*s/Math.PI+p),a.setLocalPosition(l+Math.cos(s)*f,h+Math.sin(s)*f)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&t instanceof Qa)for(var o=1;n.length-1>o;o++){var a=n[o].currentPoint,s=a[0],u=a[1],c=1===o?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(s-r,u-i)}},r.getTotalLength=function(){return Do(this)},r.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=function(t,e,n){return ue(t,e,Ct(Ct({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),a=o.x,s=o.y,u=it(X(),K(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new In(u[0],u[1])},r.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Do(this),e)},r.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},r.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},n}(Qa),ys=["style"],gs=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=hr(i,ys);(r=e.call(this,ur({type:t.Shape.POLYGON,style:ur({points:"",miterLimit:"",isClosed:!0},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&u instanceof Qa&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&l instanceof Qa&&r.placeMarkerMid(l),c&&c instanceof Qa&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}cr(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof Qa&&(this.markerStartAngle=0,r.remove()),i&&i instanceof Qa&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof Qa&&(this.markerEndAngle=0,r.remove()),i&&i instanceof Qa&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY,o=t?e.markerStart:e.markerEnd;if(o&&o instanceof Qa){var a,s,u,c,l,h,f;if(c=n[0][0]-r,l=n[0][1]-i,t)s=n[1][0]-n[0][0],u=n[1][1]-n[0][1],h=e.markerStartOffset||0,f=this.markerStartAngle;else{var p=n.length;this.style.isClosed?(s=n[p-1][0]-n[0][0],u=n[p-1][1]-n[0][1]):(c=n[p-1][0]-r,l=n[p-1][1]-i,s=n[p-2][0]-n[p-1][0],u=n[p-2][1]-n[p-1][1]),h=e.markerEndOffset||0,f=this.markerEndAngle}a=Math.atan2(u,s),o.setLocalEulerAngles(180*a/Math.PI+f),o.setLocalPosition(c+Math.cos(a)*h,l+Math.sin(a)*h)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&t instanceof Qa)for(var o=1;(this.style.isClosed?n.length:n.length-1)>o;o++){var a=n[o][0]-r,s=n[o][1]-i,u=1===o?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(a,s)}},n}(Qa),xs=["style"],Es=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=hr(r,xs);return e.call(this,ur({type:t.Shape.POLYLINE,style:ur({points:"",miterLimit:"",isClosed:!1},i)},o))||this}cr(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.points.totalLength},r.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=n.points,a=o.points,s=0,u=0;o.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var c=on.pointAt(a[u][0],a[u][1],a[u+1][0],a[u+1][1],s),l=c.x,h=c.y,f=it(X(),K(l-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new In(f[0],f[1])},r.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},r.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(gs),Ts=["style"],bs=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=hr(r,Ts);return e.call(this,ur({type:t.Shape.RECT,style:ur({x:"",y:"",width:"",height:"",radius:""},i)},o))||this}return cr(n,e),n}(Qa),ws=["style"],ks=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=hr(r,ws);return e.call(this,ur({type:t.Shape.TEXT,style:ur({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},i)},o))||this}cr(n,e);var r=n.prototype;return r.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},r.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},r.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},n}(Qa);(Fa=t.CameraType||(t.CameraType={}))[Fa.ORBITING=0]="ORBITING",Fa[Fa.EXPLORING=1]="EXPLORING",Fa[Fa.TRACKING=2]="TRACKING",(Ga=t.CameraTrackingMode||(t.CameraTrackingMode={}))[Ga.DEFAULT=0]="DEFAULT",Ga[Ga.ROTATIONAL=1]="ROTATIONAL",Ga[Ga.TRANSLATIONAL=2]="TRANSLATIONAL",Ga[Ga.CINEMATIC=3]="CINEMATIC",(Ua=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Ua.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Ua[Ua.PERSPECTIVE=1]="PERSPECTIVE";var Ms,Ps={UPDATED:"updated"},Ss=2e-4,Ns=function(){function e(){this.canvas=void 0,this.eventEmitter=new mn.EventEmitter,this.matrix=b(),this.right=K(1,0,0),this.up=K(0,1,0),this.forward=K(0,0,1),this.position=K(0,0,1),this.focalPoint=K(0,0,0),this.distanceVector=K(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.projectionMatrix=b(),this.projectionMatrixInverse=b(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new Rn,this.orthoMatrix=b()}var n=e.prototype;return n.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},n.getProjectionMode=function(){return this.projectionMode},n.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},n.getPerspectiveInverse=function(){return this.projectionMatrixInverse},n.getFrustum=function(){return this.frustum},n.getPosition=function(){return this.position},n.getFocalPoint=function(){return this.focalPoint},n.getDollyingStep=function(){return this.dollyingStep},n.getNear=function(){return this.near},n.getFar=function(){return this.far},n.getZoom=function(){return this.zoom},n.getOrthoMatrix=function(){return this.orthoMatrix},n.getView=function(){return this.view},n.setEnableUpdate=function(t){this.enableUpdate=t},n.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},n.setProjectionMode=function(t){return this.projectionMode=t,this},n.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},n.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},n.getViewTransform=function(){return S(b(),this.matrix)},n.getWorldTransform=function(){return this.matrix},n.jitterProjectionMatrix=function(t,e){var n=R(b(),[t,e,0]);this.jitteredProjectionMatrix=C(b(),n,this.projectionMatrix)},n.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},n.setMatrix=function(t){return this.matrix=t,this._update(),this},n.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},n.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},n.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},n.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},n.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},n.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},n.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},n.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=K(a.x-r,a.y-i,0),u=nt(s,this.right)/q(this.right),c=nt(s,this.up)/q(this.up);return this.pan(-u,-c),this},n.setPerspective=function(e,n,r,i){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(bo(.5*this.fov))/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return function(t,e,n,r,i,o,a){var s=2*o/(r-i),u=(n+e)/(n-e),c=(r+i)/(r-i),l=-(a+o)/(a-o),h=-2*a*o/(a-o);t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=l,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0}(this.projectionMatrix,c,c+u,a,a-s,e,this.far),O(this.projectionMatrix,this.projectionMatrix,K(1,-1,1)),S(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},n.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,f=l-u,p=l+u,d=h+c,v=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var m=(this.rright-this.left)/this.view.fullWidth/this.zoom,y=(this.top-this.bottom)/this.view.fullHeight/this.zoom;p=(f+=m*this.view.offsetX)+m*this.view.width,v=(d-=y*this.view.offsetY)-y*this.view.height}return z(this.projectionMatrix,f,p,v,d,o,a),O(this.projectionMatrix,this.projectionMatrix,K(1,-1,1)),S(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},n.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=To(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},n.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i=K(0,1,0);if(this.focalPoint=To(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var o=$(X(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var a=q(o),s=wo(Math.asin(n/a)),u=90+wo(Math.atan2(r,e)),c=b();L(c,c,bo(u)),_(c,c,bo(s)),i=it(X(),[0,1,0],c)}return S(this.matrix,j(b(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},n.getDistance=function(){return this.distance},n.getDistanceVector=function(){return this.distanceVector},n.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,Ss>this.distance&&(this.distance=Ss),this.dollyingStep=this.distance/100;var e=X(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},n.setMaxDistance=function(t){return this.maxDistance=t,this},n.setMinDistance=function(t){return this.minDistance=t,this},n.setAzimuth=function(e){return this.azimuth=Eo(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getAzimuth=function(){return this.azimuth},n.setElevation=function(e){return this.elevation=Eo(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getElevation=function(){return this.elevation},n.setRoll=function(e){return this.roll=Eo(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getRoll=function(){return this.roll},n._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},n.computeMatrix=function(){var e=ft(ht(),[0,0,1],bo(this.roll));M(this.matrix);var n=ft(ht(),[1,0,0],bo((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=ft(ht(),[0,1,0],bo((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=pt(ht(),r,n);i=pt(ht(),i,e);var o=B(b(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(A(this.matrix,this.matrix,this.focalPoint),C(this.matrix,this.matrix,o),A(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(A(this.matrix,this.matrix,this.position),C(this.matrix,this.matrix,o))},n._setPosition=function(t,e,n){this.position=To(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},n._getAxes=function(){Z(this.right,To(lt(ct(),[1,0,0,0],this.matrix))),Z(this.up,To(lt(ct(),[0,1,0,0],this.matrix))),Z(this.forward,To(lt(ct(),[0,0,1,0],this.matrix))),et(this.right,this.right),et(this.up,this.up),et(this.forward,this.forward)},n._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=q(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=wo(Math.asin(n/i)),this.azimuth=wo(Math.atan2(-e,-r))):(this.elevation=-wo(Math.asin(n/i)),this.azimuth=-wo(Math.atan2(-e,-r)))},n._getPosition=function(){Z(this.position,To(lt(ct(),[0,0,0,1],this.matrix))),this._getDistance()},n._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=T(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),J(this.focalPoint,this.position,this.distanceVector),this._getDistance()},n._getDistance=function(){this.distanceVector=$(X(),this.focalPoint,this.position),this.distance=q(this.distanceVector),this.dollyingStep=this.distance/100},n._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=ft(ht(),[0,0,1],-this.roll*Math.PI/180);U(this.orthoMatrix,n,K((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),K(this.zoom,this.zoom,1),e)}},n.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=C(b(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Ps.UPDATED)}},n.rotate=function(t,e,n){throw new Error(tr)},n.pan=function(t,e){throw new Error(tr)},n.dolly=function(t){throw new Error(tr)},n.createLandmark=function(t,e){throw new Error(tr)},n.gotoLandmark=function(t,e){throw new Error(tr)},e}(),Cs=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),As=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),Os=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),_s=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Ls=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,e.map((function(t){return t[0]}))),r=Math.max.apply(Math,e.map((function(t){return t[0]}))),i=Math.min.apply(Math,e.map((function(t){return t[1]})));return{width:r-n,height:Math.max.apply(Math,e.map((function(t){return t[1]})))-i}},t}(),Rs=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,o=void 0===r?0:r,a=void 0===i?0:i;return n&&!xe(n)&&(o||(t.width=o=n.width),a||(t.height=a=n.height)),{width:o,height:a}},t}(),Is=function(){function t(t){this.globalRuntime=void 0,this.globalRuntime=t}var e=t.prototype;return e.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!fe(t.lineWidth)},e.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,c=t.dy,l=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(r=n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.globalRuntime.textService.measureText(i,t,l);t.metrics=h;var f=[h.width/2,h.height/2,0],p=[0,1],d=0;"center"===o||"middle"===o?(d=a/2,p=[.5,1]):"right"!==o&&"end"!==o||(d=a,p=[1,1]);var v=0;return"middle"===s?v=f[1]:"top"===s||"hanging"===s?v=2*f[1]:"alphabetic"===s?v=h.lineHeight-h.fontProperties.ascent:"bottom"!==s&&"ideographic"!==s||(v=0),u&&(d+=u),c&&(v+=c),t.anchor=[p[0],p[1],0],{width:2*f[0],height:2*f[1],offsetX:d,offsetY:v}},t}(),Ds=function(){function t(t,e){var n=this;this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new mn.EventEmitter,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=b(),this.tmpVec3=X(),this.onPointerDown=function(){var t=or(rr().mark((function t(e){var r;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Ya){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,n.createPointerEvent(e);case 4:n.dispatchEvent(r=t.sent,"pointerdown"),"touch"===r.pointerType?n.dispatchEvent(r,"touchstart"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||n.dispatchEvent(r,2===r.button?"rightdown":"mousedown"),n.trackingData(e.pointerId).pressTargetsByButton[e.button]=r.composedPath(),n.freeEvent(r);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUp=function(){var t=or(rr().mark((function t(e){var r,i,o,a,s,u,c,l,h;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Ya){t.next=2;break}return t.abrupt("return");case 2:return r=performance.now(),t.next=5,n.createPointerEvent(e);case 5:if(n.dispatchEvent(i=t.sent,"pointerup"),"touch"===i.pointerType?n.dispatchEvent(i,"touchend"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.dispatchEvent(i,2===i.button?"rightup":"mouseup"),o=n.trackingData(e.pointerId),a=n.findMountedTarget(o.pressTargetsByButton[e.button]),s=a,a&&!i.composedPath().includes(a)){for(u=a;u&&!i.composedPath().includes(u);)i.currentTarget=u,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?n.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Oa.isNode(u)&&(u=u.parentNode);delete o.pressTargetsByButton[e.button],s=u}s&&((l=n.clonePointerEvent(i,"click")).target=s,l.path=[],o.clicksByButton[e.button]||(o.clicksByButton[e.button]={clickCount:0,target:l.target,timeStamp:r}),(h=o.clicksByButton[e.button]).target===l.target&&200>r-h.timeStamp?++h.clickCount:h.clickCount=1,h.target=l.target,h.timeStamp=r,l.detail=h.clickCount,(null===(c=i.detail)||void 0===c?void 0:c.preventClick)||("mouse"!==l.pointerType&&"touch"!==l.pointerType||n.dispatchEvent(l,"click"),n.dispatchEvent(l,"pointertap")),n.freeEvent(l)),n.freeEvent(i);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerMove=function(){var t=or(rr().mark((function t(e){var r,i,o,a,s,u,c,l,h,f;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Ya){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,n.createPointerEvent(e);case 4:if(i="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,o=n.trackingData(e.pointerId),a=n.findMountedTarget(o.overTargets),!o.overTargets||a===r.target){t.next=23;break}return s="mousemove"===e.type?"mouseout":"pointerout",t.next=12,n.createPointerEvent(e,s,a||void 0);case 12:if(n.dispatchEvent(u=t.sent,"pointerout"),i&&n.dispatchEvent(u,"mouseout"),r.composedPath().includes(a)){t.next=22;break}return t.next=18,n.createPointerEvent(e,"pointerleave",a||void 0);case 18:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!r.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),i&&n.notifyTarget(c,"mouseleave"),Oa.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c);case 22:n.freeEvent(u);case 23:if(a===r.target){t.next=38;break}l=n.clonePointerEvent(r,"mousemove"===e.type?"mouseover":"pointerover"),n.dispatchEvent(l,"pointerover"),i&&n.dispatchEvent(l,"mouseover"),h=a&&Oa.isNode(a)&&a.parentNode;case 29:if(!h||h===(Oa.isNode(n.rootTarget)&&n.rootTarget.parentNode)){t.next=35;break}if(h!==r.target){t.next=32;break}return t.abrupt("break",35);case 32:h=h.parentNode,t.next=29;break;case 35:if(!h||h===(Oa.isNode(n.rootTarget)&&n.rootTarget.parentNode)){for((f=n.clonePointerEvent(r,"pointerenter")).eventPhase=f.AT_TARGET;f.target&&f.target!==a&&f.target!==(Oa.isNode(n.rootTarget)&&n.rootTarget.parentNode);)f.currentTarget=f.target,n.notifyTarget(f),i&&n.notifyTarget(f,"mouseenter"),Oa.isNode(f.target)&&(f.target=f.target.parentNode);n.freeEvent(f)}n.freeEvent(l);case 38:n.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&n.dispatchEvent(r,"touchmove"),i&&(n.dispatchEvent(r,"mousemove"),n.cursor=n.getCursor(r.target)),o.overTargets=r.composedPath(),n.freeEvent(r);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOut=function(){var t=or(rr().mark((function t(e){var r,i,o,a,s;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Ya){t.next=2;break}return t.abrupt("return");case 2:if(!(r=n.trackingData(e.pointerId)).overTargets){t.next=19;break}return i="mouse"===e.pointerType||"pen"===e.pointerType,o=n.findMountedTarget(r.overTargets),t.next=8,n.createPointerEvent(e,"pointerout",o||void 0);case 8:return n.dispatchEvent(a=t.sent),i&&n.dispatchEvent(a,"mouseout"),t.next=13,n.createPointerEvent(e,"pointerleave",o||void 0);case 13:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(Oa.isNode(n.rootTarget)&&n.rootTarget.parentNode);)s.currentTarget=s.target,n.notifyTarget(s),i&&n.notifyTarget(s,"mouseleave"),Oa.isNode(s.target)&&(s.target=s.target.parentNode);r.overTargets=null,n.freeEvent(a),n.freeEvent(s);case 19:n.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOver=function(){var t=or(rr().mark((function t(e){var r,i,o,a;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Ya){t.next=2;break}return t.abrupt("return");case 2:return r=n.trackingData(e.pointerId),t.next=5,n.createPointerEvent(e);case 5:for(o="mouse"===(i=t.sent).pointerType||"pen"===i.pointerType,n.dispatchEvent(i,"pointerover"),o&&n.dispatchEvent(i,"mouseover"),"mouse"===i.pointerType&&(n.cursor=n.getCursor(i.target)),(a=n.clonePointerEvent(i,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(Oa.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),o&&n.notifyTarget(a,"mouseenter"),Oa.isNode(a.target)&&(a.target=a.target.parentNode);r.overTargets=i.composedPath(),n.freeEvent(i),n.freeEvent(a);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUpOutside=function(){var t=or(rr().mark((function t(e){var r,i,o,a;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Ya){t.next=2;break}return t.abrupt("return");case 2:return r=n.trackingData(e.pointerId),i=n.findMountedTarget(r.pressTargetsByButton[e.button]),t.next=6,n.createPointerEvent(e);case 6:if(o=t.sent,i){for(a=i;a;)o.currentTarget=a,n.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType||"mouse"!==o.pointerType&&"pen"!==o.pointerType||n.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),Oa.isNode(a)&&(a=a.parentNode);delete r.pressTargetsByButton[e.button]}n.freeEvent(o);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onWheel=function(){var t=or(rr().mark((function t(e){var r;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof Wa){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,n.createWheelEvent(e);case 4:n.dispatchEvent(r=t.sent),n.freeEvent(r);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.globalRuntime=t,this.context=e}var e=t.prototype;return e.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},e.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new In(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new In(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=C(this.tmpMatrix,u,s),l=Q(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return it(l,l,c),new In(l[0],l[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=C(this.tmpMatrix,n,r),o=Q(this.tmpVec3,t.x,t.y,0);it(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new In((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},e.setPickHandler=function(t){this.pickHandler=t},e.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},e.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},e.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e));this.emitter.emit(e||t.type,t)},e.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=i+1;n.length>o;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},e.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Oa.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},e.hitTest=function(){var t=or(rr().mark((function t(e){var n,r,i,o,a;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.viewportY,o=(i=this.context.config).width,a=i.height,!(0>(n=e.viewportX)||0>r||n>o||r>a)){t.next=4;break}return t.abrupt("return",null);case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.isNativeEventFromCanvas=function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},e.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=dr(this.globalRuntime.displayObjectPool.getHTMLs());!(e=n()).done;){var r=e.value;if(t.nativeEvent.composedPath().indexOf(r)>-1)return r}return null},e.pickTarget=function(){var t=or(rr().mark((function t(e){return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.createPointerEvent=function(){var t=or(rr().mark((function t(e,n,r){var i,o;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.allocateEvent(Ya),this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.nativeEvent=e.nativeEvent,i.originalEvent=e,o=this.getExistedHTML(i),null==r){t.next=11;break}t.t0=r,t.next=20;break;case 11:if(t.t1=o,t.t1){t.next=19;break}if(t.t2=this.isNativeEventFromCanvas(i),!t.t2){t.next=18;break}return t.next=17,this.pickTarget(i);case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return i.target=t.t0,"string"==typeof n&&(i.type=n),t.abrupt("return",i);case 23:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.createWheelEvent=function(){var t=or(rr().mark((function t(e){var n,r;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(Wa),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,r=this.getExistedHTML(n),t.t0=r,t.t0){t.next=15;break}if(t.t1=this.isNativeEventFromCanvas(n),!t.t1){t.next=14;break}return t.next=13,this.pickTarget(n);case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.cloneWheelEvent=function(t){var e=this.allocateEvent(Wa);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=e.type,e},e.clonePointerEvent=function(t,e){var n=this.allocateEvent(Ya);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},e.copyPointerData=function(t,e){t instanceof Ya&&e instanceof Ya&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)},e.copyMouseData=function(t,e){t instanceof ja&&e instanceof ja&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset))},e.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},e.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},e.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},e.notifyTarget=function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},e.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},e.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Oa.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.getCursor=function(t){for(var e=t;e;){var n=za.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=Oa.isNode(e)&&e.parentNode}},t}(),Fs=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t){return this.context||this.getOrCreateCanvas(t),this.context},t}();(Ms=t.RenderReason||(t.RenderReason={}))[Ms.CAMERA_CHANGED=0]="CAMERA_CHANGED",Ms[Ms.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Ms[Ms.NONE=2]="NONE";var Gs,Us,Bs,Vs=function(){function e(e,n){this.globalRuntime=void 0,this.context=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.renderOrderChangedEvent=new Ca(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new $o,dirtycheck:new va(["object"]),cull:new va(["object","camera"]),beginFrame:new ca([]),beforeRender:new ca(["objectToRender"]),render:new ca(["objectToRender"]),afterRender:new ca(["objectToRender"]),endFrame:new ca([]),destroy:new ca([]),pick:new ra(["result"]),pickSync:new va(["result"]),pointerDown:new ca(["event"]),pointerUp:new ca(["event"]),pointerMove:new ca(["event"]),pointerOut:new ca(["event"]),pointerOver:new ca(["event"]),pointerWheel:new ca(["event"]),pointerCancel:new ca(["event"])},this.globalRuntime=e,this.context=n}var n=e.prototype;return n.init=function(){var t=or(rr().mark((function t(){var e;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=ur({},this.globalRuntime,this.context),this.context.renderingPlugins.forEach((function(t){t.apply(e)})),t.next=4,this.hooks.init.promise();case 4:this.inited=!0;case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getStats=function(){return this.stats},n.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)},n.render=function(t){var e=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var n=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(n.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),n.renderReasons.size&&this.inited&&(this.renderDisplayObject(n.root,t,n),this.hooks.beginFrame.call(),n.renderListCurrentFrame.forEach((function(t){e.hooks.beforeRender.call(t),e.hooks.render.call(t),e.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),n.renderListCurrentFrame=[],n.renderReasons.clear())},n.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.styleValueRegistry.recalc(t);var s=o?this.hooks.dirtycheck.call(t):t;if(s){var u=a?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=t.sortable,l=!1;c.dirty&&(c.sorted=t.childNodes.slice().sort(Wn),l=!0,c.dirty=!1),(c.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)})),l&&t.forEach((function(t){r.renderOrderChangedEvent.target=t,r.renderOrderChangedEvent.detail={renderOrder:t.sortable.renderOrder},t.ownerDocument.defaultView.dispatchEvent(r.renderOrderChangedEvent,!0)}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call()},n.dirtify=function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),Hs=/\[\s*(.*)=(.*)\s*\]/,zs=function(){function t(){}var e=t.prototype;return e.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},e.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},e.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var e=t.match(Hs),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},e.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return fe(n)?"":n.toString?n.toString():""},t}(),js=function(){function e(e){var n,r,i,o,a,s,u,c,l=this;this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new Ca(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(n=ht(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=K(e,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=ht();mt(a,e[0],e[1],e[2]);var s=l.getRotation(t),u=l.getRotation(t.parentNode);kt(n,u),vt(n,n),pt(a,n,a),pt(o.localRotation,a,s),Pt(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,e)}),this.rotateLocal=(r=ht(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=K(e,n,i));var o=t.transformable;mt(r,e[0],e[1],e[2]),Mt(o.localRotation,o.localRotation,r),l.dirtifyLocal(t,o)}),this.setEulerAngles=(i=ht(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=K(e,n,r));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){mt(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);kt(i,vt(ht(),a)),Mt(o.localRotation,o.localRotation,i),l.dirtifyLocal(t,o)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=K(e,n,r));var i=t.transformable;ot(e,X())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,f=i*h-o*l,p=o*c-r*h,d=r*l-i*c,v=2*n[3];l*=v,h*=v,p*=2,d*=2,t[0]=a+(c*=v)+(f*=2),t[1]=s+l+p,t[2]=u+h+d}(e,e,i.localRotation),J(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(o=b(),a=X(),function(t,e){var n=t.transformable;a[0]=e[0],a[1]=e[1],a[2]=e[2]||0,ot(l.getPosition(t),a)||(Z(n.position,a),null!==t.parentNode&&t.parentNode.transformable?(w(o,t.parentNode.transformable.worldTransform),S(o,o),it(n.localPosition,a,o)):Z(n.localPosition,a),l.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=X();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,ot(r.localPosition,t)||(Z(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(s=X(),u=X(),c=X(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Q(u,e,n,r)),ot(e,s)||(J(c,l.getPosition(t),e),l.setPosition(t,c))}),this.setRotation=function(){var t=ht();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=wt(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);kt(t,s),vt(t,t),pt(a.localRotation,t,n),Pt(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=b(),e=X(),n=wt(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(U(r.localTransform,r.localRotation,r.localPosition,K(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=M(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),C(r.localTransform,r.localTransform,i)}var o=U(t,n,e,r.localScale,r.origin);C(r.localTransform,r.localTransform,o)}else U(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}(),this.runtime=e}var n=e.prototype;return n.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},n.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},n.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},n.attach=function(t,e,n){var r,i;t.parentNode&&this.detach(t),t.parentNode=e,fe(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var o=e.sortable;((null==o||null===(r=o.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(o.dirty=!0);var a=t.transformable;a&&this.dirtifyWorld(t,a),a.frozen&&this.unfreezeParentToRoot(t)},n.detach=function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;((null==i||null===(e=i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(i.dirty=!0);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},n.getOrigin=function(t){return t.transformable.origin},n.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=K(e,n,r));var i=t.transformable;if(!ot(e,i.origin)){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},n.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=K(e,n,r));var i=t.transformable;mt(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},n.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=K(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,o)},n.setLocalScale=function(t,e){var n=t.transformable,r=K(e[0],e[1],e[2]||n.localScale[2]);ot(r,n.localScale)||(Z(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=wt(e,n,r,i));var o=t.transformable;kt(o.localRotation,e),this.dirtifyLocal(t,o)},n.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=St(e,n));var r,i,o=t.transformable;(r=o.localSkew)[0]=(i=e)[0],r[1]=i[1],this.dirtifyLocal(t,o)},n.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},n.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},n.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=t[0],r=t[1];r.affectChildren?e.forEach((function(t){n(t,r)})):n(e,r)})),this.pendingEvents=[],e.clear()},n.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;){var r=n.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0),n=n.parentNode}this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},n.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},n.informDependentDisplayObjects=function(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach((function(e){r[e].forEach((function(r){n.dirtifyToRoot(r),r.dispatchEvent(new Ia(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,Ia.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},n.getPosition=function(t){var e=t.transformable;return D(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return G(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return F(e.scaling,this.getWorldTransform(t,e))},n.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},n.getLocalPosition=function(t){return t.transformable.localPosition},n.getLocalRotation=function(t){return t.transformable.localRotation},n.getLocalScale=function(t){return t.transformable.localScale},n.getLocalSkew=function(t){return t.transformable.localSkew},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=D(X(),e),r=G(ht(),e),i=F(X(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},n.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},n.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(On.isEmpty(r))return null;var i=n||new On;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new On},n.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new On).update(r.center,r.halfExtents))})),e){var a=Xn(t);if(a){var s=a.style.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new On),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},n.getLocalBounds=function(t){if(t.parentNode){var e=b();t.parentNode.transformable&&(e=S(b(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!On.isEmpty(n)){var r=new On;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);On.isEmpty(i)||(r=new On).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=r.getMin(),s=a[0],u=a[1],c=r.getMax();return new Dn(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new Dn((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},n.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},n.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}},n.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?C(e.worldTransform,r.worldTransform,e.localTransform):w(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},n.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),Ys={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},Ws=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,Xs=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),qs=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),Ks=function(){function t(t){var e=this;this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!qs.exec(n)&&!Xs.exec(t))},this.trimByKinsokuShorui=function(t){var e=[].concat(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=t}var e=t.prototype;return e.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvas.getOrCreateCanvas(e),i=this.runtime.offscreenCanvas.getOrCreateContext(e);i.font=t;var o=Ys.MetricsString+Ys.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText(Ys.BaselineSymbol).width),u=Ys.HeightMultiplier*s;s=s*Ys.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,f=0,p=0,d=!1;for(f=0;s>f;++f){for(var v=0;h>v;v+=4)if(255!==c[p+v]){d=!0;break}if(d)break;p+=h}for(n.ascent=s-f,p=l-h,d=!1,f=u;f>s;--f){for(var m=0;h>m;m+=4)if(255!==c[p+m]){d=!0;break}if(d)break;p-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},e.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,o=e.lineHeight,a=e.lineWidth,s=e.textBaseline,u=e.textAlign,c=e.letterSpacing,l=e.textPath,h=e.leading,f=void 0===h?0:h,p=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=Te(e)&&e+"px"||"16px",s=xe(n)?n.split(","):[n],u=s.length-1;u>=0;u--){var c=s[u].trim();!ya.test(c)&&0>ma.indexOf(c)&&(c='"'+c+'"'),s[u]=c}return r+" "+i+" "+o+" "+a+" "+s.join(",")}(e),d=this.measureFont(p,n);0===d.fontSize&&(d.fontSize=r,d.ascent=r);var v=this.runtime.offscreenCanvas.getOrCreateContext(n);v.font=p,e.isOverflowing=!1;var m=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(m.length),g=0;if(!l){for(var x=0;m.length>x;x++){var E=v.measureText(m[x]).width+(m[x].length-1)*c;y[x]=E,g=Math.max(g,E)}var T=g+a,b=o||d.fontSize+a,w=Math.max(b,d.fontSize+a)+(m.length-1)*(b+f),k=0;return"middle"===s?k=-w/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?k=-w:"top"!==s&&"hanging"!==s||(k=0),{font:p,width:T,height:w,lines:m,lineWidths:y,lineHeight:b+=f,maxLineWidth:g,fontProperties:d,lineMetrics:y.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new Dn(n-a/2,k+e*b,t+a,b)}))}}l.getTotalLength(),l.getPoint(0);for(var M=0;m.length>M;M++)v.measureText(m[M])},e.setGraphemeOnPath=function(){},e.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,c=e.textOverflow,l=this.runtime.offscreenCanvas.getOrCreateContext(n),h=o+a,f="";"ellipsis"===c?f="...":c&&"clip"!==c&&(f=c);for(var p=[],d=0,v=0,m={},y=function(t){return r.getFromCache(t,a,m,l)},g=Array.from(f).reduce((function(t,e){return t+y(e)}),0),x=Array.from(t),E=0;x.length>E;E++){var T=x[E],b=t[E-1],w=t[E+1],k=y(T);if(this.isNewline(T))v=0,p[++d]="";else{if(v>0&&v+k>h){if(d+1>=u){if(e.isOverflowing=!0,g>0&&h>=g){for(var M=0,P=0,S=0;p[d].length>S;S++){var N=y(p[d][S]);if(M+N+g>h){P=S;break}M+=N}p[d]=(p[d]||"").slice(0,P)+f}break}if(v=0,p[++d]="",this.isBreakingSpace(T))continue;this.canBreakInLastChar(T)||(p=this.trimToBreakable(p),v=this.sumTextWidthByCache(p[d]||"",m)),this.shouldBreakByKinsokuShorui(T,w)&&(p=this.trimByKinsokuShorui(p),v+=y(b||""))}v+=k,p[d]=(p[d]||"")+T}}return p.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&Ys.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&Ys.Newlines.indexOf(t.charCodeAt(0))>=0},e.trimToBreakable=function(t){var e=[].concat(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},e.canBreakInLastChar=function(t){return!t||!Ws.test(t)},e.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},e.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!Ws.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),Zs={},Qs=(Us=new Rs,Bs=new Ls,(Gs={})[t.Shape.CIRCLE]=new Cs,Gs[t.Shape.ELLIPSE]=new As,Gs[t.Shape.RECT]=Us,Gs[t.Shape.IMAGE]=Us,Gs[t.Shape.GROUP]=Us,Gs[t.Shape.LINE]=new Os,Gs[t.Shape.TEXT]=new Is(Zs),Gs[t.Shape.POLYLINE]=Bs,Gs[t.Shape.POLYGON]=Bs,Gs[t.Shape.PATH]=new _s,Gs[t.Shape.HTML]=null,Gs[t.Shape.MESH]=null,Gs),Js=function(){var e,n=new to,r=new ro;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new uo,e[t.PropertySyntax.ANGLE]=new Ji,e[t.PropertySyntax.DEFINED_PATH]=new $i,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new eo,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new io,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new oo,e[t.PropertySyntax.COORDINATE]=new ao,e[t.PropertySyntax.OFFSET_DISTANCE]=new co,e[t.PropertySyntax.OPACITY_VALUE]=new lo,e[t.PropertySyntax.PATH]=new ho,e[t.PropertySyntax.LIST_OF_POINTS]=new fo,e[t.PropertySyntax.SHADOW_BLUR]=new po,e[t.PropertySyntax.TEXT]=new vo,e[t.PropertySyntax.TEXT_TRANSFORM]=new mo,e[t.PropertySyntax.TRANSFORM]=new yo,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new go,e[t.PropertySyntax.Z_INDEX]=new xo,e[t.PropertySyntax.MARKER]=new so,e}();Zs.CameraContribution=Ns,Zs.AnimationTimeline=null,Zs.EasingFunction=null,Zs.offscreenCanvas=new Fs,Zs.displayObjectPool=new is,Zs.sceneGraphSelector=new zs,Zs.sceneGraphService=new js(Zs),Zs.textService=new Ks(Zs),Zs.geometryUpdaterFactory=Qs,Zs.CSSPropertySyntaxFactory=Js,Zs.styleValueRegistry=new Pa,Zs.layoutRegistry=null;var $s=function(){function t(){this.context=void 0,this.plugins=[]}var e=t.prototype;return e.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))},t}(),tu=function(){function t(t){this.plugins=[],this.config=void 0,this.config=ur({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)},e.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}(),eu=function(){function e(t){this.strategies=void 0,this.strategies=t}return e.prototype.apply=function(n){var r=n.camera,i=n.renderingService,o=n.renderingContext,a=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===a.length?o.unculledEntities.indexOf(e.entity)>-1:a.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new Ca(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}();eu.tag="Culling";var nu=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService;n.hooks.dirtycheck.tap(t.tag,(function(t){return t?t.renderable.dirty||n.disableDirtyRectangleRendering()?t:null:t}))},t}();nu.tag="DirtyCheck";var ru=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Ya(null),this.rootWheelEvent=new Wa(null),this.context=void 0,this.onPointerMove=function(e){var n,r,i=null===(n=t.context.renderingContext.root)||void 0===n||null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView;if(!i.supportsTouchEvents||"touch"!==e.pointerType){for(var o,a=dr(t.normalizeToPointerEvent(e,i));!(o=a()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,o.value,i);t.context.eventService.mapEvent(s)}t.setCursor(t.context.eventService.cursor)}}}var e=t.prototype;return e.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(){var t=or(rr().mark((function t(e){return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.context.renderingService.hooks.pick.promise({position:e,picked:[],topmost:!0});case 2:return t.abrupt("return",t.sent.picked[0]||null);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r,o=dr(e);!(r=o()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,r.value,i);n.context.eventService.mapEvent(a)}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){for(var e,r=n.context.contextService.getDomElement(),o=r&&t.target&&t.target!==r&&r.contains&&!r.contains(t.target)?"outside":"",a=dr(n.normalizeToPointerEvent(t,i));!(e=a()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,e.value,i);s.type+=o,n.context.eventService.mapEvent(s)}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove)},e.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||fe(r)||fe(i)){var s=this.context.eventService.client2Viewport(new In(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},e.bootstrapEvent=function(t,e,n){t.view=n,t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var r=this.getViewportXY(e),i=r.y;t.viewport.x=r.x,t.viewport.y=i;var o=this.context.eventService.viewport2Canvas(t.viewport),a=o.y;return t.canvas.x=o.x,t.canvas.y=a,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=nr[t.type]||t.type),t},e.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.getViewportXY(t),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},e.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},e.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},e.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];we(i.button)&&(i.button=0),we(i.buttons)&&(i.buttons=1),we(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),we(i.width)&&(i.width=i.radiusX||1),we(i.height)&&(i.height=i.radiusY||1),we(i.tiltX)&&(i.tiltX=0),we(i.tiltY)&&(i.tiltY=0),we(i.pointerType)&&(i.pointerType="touch"),we(i.pointerId)&&(i.pointerId=i.identifier||0),we(i.pressure)&&(i.pressure=i.force||.5),we(i.twist)&&(i.twist=0),we(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;we(o.isPrimary)&&(o.isPrimary=!0),we(o.width)&&(o.width=1),we(o.height)&&(o.height=1),we(o.tiltX)&&(o.tiltX=0),we(o.tiltY)&&(o.tiltY=0),we(o.pointerType)&&(o.pointerType="mouse"),we(o.pointerId)&&(o.pointerId=1),we(o.pressure)&&(o.pressure=.5),we(o.twist)&&(o.twist=0),we(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t}();ru.tag="Event";var iu,ou=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],au=function(){function e(){}var n=e.prototype;return n.isVisible=function(e,n){var r,i,o=n.cullable;if(!o.enable)return!0;var a=n.getRenderBounds();if(On.isEmpty(a))return!1;var s=e.getFrustum(),u=null===(r=n.parentNode)||void 0===r||null===(i=r.cullable)||void 0===i?void 0:i.visibilityPlaneMask;return o.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,a,u||t.Mask.INDETERMINATE,s.planes),o.visible=o.visibilityPlaneMask!==t.Mask.OUTSIDE,o.visible},n.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var o=t.Mask.INSIDE,a=ou.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,f=l.distance;if(0>nt(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>nt(h,n.getNegativeFarPoint(i[s]))+f&&(o|=c)}}return o},e}(),su=function(){function e(){this.rBush=void 0,this.toSync=new Set}var n=e.prototype;return n.apply=function(n){var r=this,i=n.renderingService,o=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var a=function(t){t.target.renderable.dirty=!0,i.dirtify()},s=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){r.toSync.add(t)}));for(var n=e;n;)n.renderable&&r.toSync.add(n),n=n.parentElement;i.dirtify()},u=function(t){var e=t.target;Zs.styleValueRegistry.recalc(e),Zs.sceneGraphService.dirtifyToRoot(e),i.dirtify()},c=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),Zs.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tapPromise(e.tag,or(rr().mark((function e(){return rr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o.addEventListener(t.ElementEvent.MOUNTED,u),o.addEventListener(t.ElementEvent.UNMOUNTED,c),o.addEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.addEventListener(t.ElementEvent.BOUNDS_CHANGED,s);case 4:case"end":return e.stop()}}),e)})))),i.hooks.destroy.tap(e.tag,(function(){o.removeEventListener(t.ElementEvent.MOUNTED,u),o.removeEventListener(t.ElementEvent.UNMOUNTED,c),o.removeEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,s)})),i.hooks.endFrame.tap(e.tag,(function(){r.syncRTree()}))},n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],s=o[1],u=i.getMax(),c=u[0],l=u[1];r.aabb||(r.aabb={}),r.aabb.id=n.entity,r.aabb.minX=a,r.aabb.minY=s,r.aabb.maxX=c,r.aabb.maxY=l}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},e}();su.tag="Prepare",(iu=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",iu.BEFORE_RENDER="beforerender",iu.AFTER_RENDER="afterrender",iu.BEFORE_DESTROY="beforedestroy",iu.AFTER_DESTROY="afterdestroy",iu.RESIZE="resize",iu.DIRTY_RECTANGLE="dirtyrectangle";var uu=new Ca(t.ElementEvent.MOUNTED),cu=new Ca(t.ElementEvent.UNMOUNTED),lu=new Ca(t.CanvasEvent.BEFORE_RENDER),hu=new Ca(t.CanvasEvent.AFTER_RENDER),fu=function(e){function n(n){var r;(r=e.call(this)||this).document=void 0,r.customElements=void 0,r.requestAnimationFrame=void 0,r.cancelAnimationFrame=void 0,r.devicePixelRatio=void 0,r.supportsPointerEvents=void 0,r.supportsTouchEvents=void 0,r.isTouchEvent=void 0,r.isMouseEvent=void 0,r.Element=Qa,r.frameId=void 0,r.inited=!1,r.readyPromise=void 0,r.resolveReadyPromise=void 0,r.context={},r.document=new Ra,r.document.defaultView=fr(r),r.customElements=new Sa;var i=n.container,o=n.canvas,a=n.offscreenCanvas,s=n.width,u=n.height,c=n.devicePixelRatio,l=n.renderer,h=n.background,f=n.cursor,p=n.document,d=n.requestAnimationFrame,v=n.cancelAnimationFrame,m=n.createImage,y=n.supportsPointerEvents,g=n.supportsTouchEvents,x=n.supportsCSSTransform,E=n.isTouchEvent,T=n.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||jn++;zn[n]&&zn[n].destroy(),zn[n]=e}}(i,fr(r));var b=s,w=u,k=c;return o&&(k=1>(k=c||Yn&&window.devicePixelRatio||1)?1:Math.ceil(k),b=s||function(t){var e=qn(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(o)||o.width/k,w=u||function(t){var e=qn(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(o)||o.height/k),r.devicePixelRatio=k,r.requestAnimationFrame=null!=d?d:Pn.bind(globalThis),r.cancelAnimationFrame=null!=v?v:Sn.bind(globalThis),r.supportsTouchEvents=null!=g?g:"ontouchstart"in globalThis,r.supportsPointerEvents=null!=y?y:!!globalThis.PointerEvent,r.isTouchEvent=null!=E?E:function(t){return r.supportsTouchEvents&&t instanceof globalThis.TouchEvent},r.isMouseEvent=null!=T?T:function(t){return!globalThis.MouseEvent||t instanceof globalThis.MouseEvent&&(!r.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:o,width:b,height:w,renderer:l,offscreenCanvas:a,devicePixelRatio:k,cursor:f||"default",background:h||"transparent",createImage:m,document:p,supportsCSSTransform:x}),r.initDefaultCamera(b,w),or(rr().mark((function e(){return rr().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.initRenderer(l);case 2:r.dispatchEvent(new Ca(t.CanvasEvent.READY)),r.readyPromise&&r.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),r}cr(n,e);var r=n.prototype;return r.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},r.initDefaultCamera=function(e,n){var r=this,i=new Zs.CameraContribution;i.setType(t.CameraType.EXPLORING,t.CameraTrackingMode.DEFAULT).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(Ps.UPDATED,(function(){r.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.context.camera=i},r.getConfig=function(){return this.context.config},r.getRoot=function(){return this.document.documentElement},r.getCamera=function(){return this.context.camera},r.getContextService=function(){return this.context.contextService},r.getEventService=function(){return this.context.eventService},r.getRenderingService=function(){return this.context.renderingService},r.getRenderingContext=function(){return this.context.renderingContext},r.getStats=function(){return this.getRenderingService().getStats()},r.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new Ca(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),n||this.dispatchEvent(new Ca(t.CanvasEvent.AFTER_DESTROY))},r.changeSize=function(t,e){this.resize(t,e)},r.resize=function(e,n){var r=this.context.config;r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.context.camera,o=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new Ca(t.CanvasEvent.RESIZE,{width:e,height:n}))},r.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},r.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},r.removeChild=function(t){return this.document.documentElement.removeChild(t)},r.removeChildren=function(){this.document.documentElement.removeChildren()},r.render=function(){this.dispatchEvent(lu),this.getRenderingService().render(this.getConfig()),this.dispatchEvent(hu)},r.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},r.initRenderer=function(){var t=or(rr().mark((function t(e){return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw new Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new o,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ru,new su,new nu,new eu([new au])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(ur({},Zs,this.context)),this.context.renderingService=new Vs(Zs,this.context),this.context.eventService=new Ds(Zs,this.context),this.context.eventService.init(),t.next=14,this.context.contextService.init();case 14:return t.next=16,this.context.renderingService.init();case 16:this.inited=!0,this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),e.getConfig().enableAutoRendering&&this.run();case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),r.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init()}))},r.setRenderer=function(){var t=or(rr().mark((function t(e){var n,r;return rr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer!==e){t.next=3;break}return t.abrupt("return");case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy()})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),r.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},r.unmountChildren=function(t){var e=this;if(this.inited){var n=[];t.forEach((function(t){t.isConnected&&n.push(t)})),n.reverse().forEach((function(t){t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback(),t.isMutationObserved?t.dispatchEvent(cu):(cu.target=t,e.dispatchEvent(cu,!0)),t!==e.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1}))}},r.mountChildren=function(t){var e=this;this.inited?t.forEach((function(t){t.isConnected||(t.ownerDocument=e.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(uu):(uu.target=t,e.dispatchEvent(uu,!0)),t.isCustomElement&&t.connectedCallback&&t.connectedCallback())})):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName)},r.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},r.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},r.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},r.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},r.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},r.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},sr(n,[{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),n}(Aa),pu={}.toString,du=function(t,e){return pu.call(t)==="[object "+e+"]"},vu=function(t){return null==t},mu=function(t,e,n){return e>t?e:t>n?n:t};function yu(t,e){return yu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},yu(t,e)}var gu="undefined"!=typeof Float32Array?Float32Array:Array;function xu(t,e,n){var r,i,o,a,s,u,c,l,h,f,p,d,v=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*y+e[12],t[13]=e[1]*v+e[5]*m+e[9]*y+e[13],t[14]=e[2]*v+e[6]*m+e[10]*y+e[14],t[15]=e[3]*v+e[7]*m+e[11]*y+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=r*v+s*m+h*y+e[12],t[13]=i*v+u*m+f*y+e[13],t[14]=o*v+c*m+p*y+e[14],t[15]=a*v+l*m+d*y+e[15]),t}function Eu(){var t=new gu(3);return gu!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function Tu(t){var e=new gu(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function bu(t,e,n){var r=new gu(3);return r[0]=t,r[1]=e,r[2]=n,r}function wu(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function ku(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function Mu(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Pu(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function Su(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Nu=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},Cu=function(t){return Math.hypot(t[0],t[1],t[2])};!function(){var t=Eu()}();!function(){var t,e=(t=new gu(4),gu!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t)}();function Au(){var t=new gu(4);return gu!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Ou(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function _u(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function Lu(t,e,n,r){var i,o,a,s,u,c=e[0],l=e[1],h=e[2],f=e[3],p=n[0],d=n[1],v=n[2],m=n[3];return 0>(o=c*p+l*d+h*v+f*m)&&(o=-o,p=-p,d=-d,v=-v,m=-m),1-o>1e-6?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*c+u*p,t[1]=s*l+u*d,t[2]=s*h+u*v,t[3]=s*f+u*m,t}var Ru=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t},Iu=(function(){var t=Eu(),e=bu(1,0,0),n=bu(0,1,0)}(),function(){var t=Au(),e=Au()}(),function(){var t,e=(t=new gu(9),gu!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t)}(),function(e){var n,r;function i(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).landmarks=[],t.landmarkAnimationID=void 0,t}r=e,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,yu(n,r);var o=i.prototype;return o.rotate=function(e,n,r){if(this.relElevation=Eo(n),this.relAzimuth=Eo(e),this.relRoll=Eo(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=Ou(Au(),[1,0,0],bo((this.rotateWorld?1:-1)*this.relElevation)),o=Ou(Au(),[0,1,0],bo((this.rotateWorld?1:-1)*this.relAzimuth)),a=Ou(Au(),[0,0,1],bo(this.relRoll)),s=_u(Au(),o,i);s=_u(Au(),s,a);var u=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,f=i*a,p=i*s,d=i*u,v=o*a,m=o*s,y=o*u;return t[0]=1-h-d,t[1]=l+y,t[2]=f-m,t[3]=0,t[4]=l-y,t[5]=1-c-d,t[6]=p+v,t[7]=0,t[8]=f+m,t[9]=p-v,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}((c=new gu(16),gu!=Float32Array&&(c[1]=0,c[2]=0,c[3]=0,c[4]=0,c[6]=0,c[7]=0,c[8]=0,c[9]=0,c[11]=0,c[12]=0,c[13]=0,c[14]=0),c[0]=1,c[5]=1,c[10]=1,c[15]=1,c),s);xu(this.matrix,this.matrix,[0,0,-this.distance]),function(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],v=e[12],m=e[13],y=e[14],g=e[15],x=n[0],E=n[1],T=n[2],b=n[3];t[0]=x*r+E*s+T*h+b*v,t[1]=x*i+E*u+T*f+b*m,t[2]=x*o+E*c+T*p+b*y,t[3]=x*a+E*l+T*d+b*g,t[4]=(x=n[4])*r+(E=n[5])*s+(T=n[6])*h+(b=n[7])*v,t[5]=x*i+E*u+T*f+b*m,t[6]=x*o+E*c+T*p+b*y,t[7]=x*a+E*l+T*d+b*g,t[8]=(x=n[8])*r+(E=n[9])*s+(T=n[10])*h+(b=n[11])*v,t[9]=x*i+E*u+T*f+b*m,t[10]=x*o+E*c+T*p+b*y,t[11]=x*a+E*l+T*d+b*g,t[12]=(x=n[12])*r+(E=n[13])*s+(T=n[14])*h+(b=n[15])*v,t[13]=x*i+E*u+T*f+b*m,t[14]=x*o+E*c+T*p+b*y,t[15]=x*a+E*l+T*d+b*g}(this.matrix,this.matrix,u),xu(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}var c;return this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},o.pan=function(t,e){var n=To(t,e,0),r=Tu(this.position);return ku(r,r,Mu(Eu(),this.right,n[0])),ku(r,r,Mu(Eu(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},o.dolly=function(e){var n,r=this.forward,i=Tu(this.position);return n=Math.max(Math.min(this.distance+e*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance,i[0]+=n*r[0],i[1]+=n*r[1],i[2]+=n*r[2],this._setPosition(i),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getDistance():this.type===t.CameraType.TRACKING&&ku(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},o.createLandmark=function(t,e){void 0===e&&(e={});var n=e.position,r=void 0===n?this.position:n,i=e.focalPoint,o=void 0===i?this.focalPoint:i,a=e.roll,s=e.zoom,u=new Zs.CameraContribution;u.setType(this.type,void 0),u.setPosition(r[0],r[1]||this.position[1],r[2]||this.position[2]),u.setFocalPoint(o[0],o[1]||this.focalPoint[1],o[2]||this.focalPoint[2]),u.setRoll(a||this.roll),u.setZoom(s||this.zoom);var c,l,h={name:t,matrix:(c=u.getWorldTransform(),l=new gu(16),l[0]=c[0],l[1]=c[1],l[2]=c[2],l[3]=c[3],l[4]=c[4],l[5]=c[5],l[6]=c[6],l[7]=c[7],l[8]=c[8],l[9]=c[9],l[10]=c[10],l[11]=c[11],l[12]=c[12],l[13]=c[13],l[14]=c[14],l[15]=c[15],l),right:Tu(u.right),up:Tu(u.up),forward:Tu(u.forward),position:Tu(u.getPosition()),focalPoint:Tu(u.getFocalPoint()),distanceVector:Tu(u.getDistanceVector()),distance:u.getDistance(),dollyingStep:u.getDollyingStep(),azimuth:u.getAzimuth(),elevation:u.getElevation(),roll:u.getRoll(),relAzimuth:u.relAzimuth,relElevation:u.relElevation,relRoll:u.relRoll,zoom:u.getZoom()};return this.landmarks.push(h),h},o.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=function(t){return du(t,"String")}(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=du(e,"Number")?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,u=void 0===s?100:s,c=i.easingFunction,l=void 0===c?void 0:c,h=i.onfinish,f=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(r),void(f&&f());void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID);var p,d=r.position,v=r.focalPoint,m=r.zoom,y=r.roll,g=l||Zs.EasingFunction(a),x=function(){n.setFocalPoint(v),n.setPosition(d),n.setRoll(y),n.setZoom(m),n.computeMatrix(),n.triggerUpdate(),f&&f()};this.canvas.requestAnimationFrame((function t(e){void 0===p&&(p=e);var r=e-p;if(u<r)x();else{var i,o,a=g(r/u),s=Eu(),c=Eu();Su(s,n.focalPoint,v,a),Su(c,n.position,d,a),o=n.roll*(1-a)+y*a,i=n.zoom*(1-a)+m*a,n.setFocalPoint(s),n.setPosition(c),n.setRoll(o),n.setZoom(i),Nu(s,v)+Nu(c,d)>.01?(n.computeMatrix(),n.triggerUpdate(),u>r&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(t))):x()}}))}},o.syncFromLandmark=function(t){var e,n;this.matrix=((e=this.matrix)[0]=(n=t.matrix)[0],e[1]=n[1],e[2]=n[2],e[3]=n[3],e[4]=n[4],e[5]=n[5],e[6]=n[6],e[7]=n[7],e[8]=n[8],e[9]=n[9],e[10]=n[10],e[11]=n[11],e[12]=n[12],e[13]=n[13],e[14]=n[14],e[15]=n[15],e),this.right=wu(this.right,t.right),this.up=wu(this.up,t.up),this.forward=wu(this.forward,t.forward),this.position=wu(this.position,t.position),this.focalPoint=wu(this.focalPoint,t.focalPoint),this.distanceVector=wu(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},i}(Ns));Zs.CameraContribution=Iu;var Du,Fu,Gu,Uu,Bu=function(t,e,n){this._layoutContext=void 0,this._node=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.node=void 0,this.childFragments=void 0,this.data=void 0,this._layoutContext=t,this._node=e,this.options=n,this.layoutContext=t,this.inlineSize=null==n?void 0:n.inlineSize,this.blockSize=null==n?void 0:n.blockSize,this.childFragments=null==n?void 0:n.childFragments,this.data=n.data,this.node=e};function Vu(){
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).G={})}(this,(function(t){"use strict";function e(t,e,r,o,a){n(t,e,r||0,o||t.length-1,a||i)}function n(t,e,i,o,a){for(;o>i;){if(o-i>600){var s=o-i+1,u=e-i+1,c=Math.log(s),l=.5*Math.exp(2*c/3),h=.5*Math.sqrt(c*l*(s-l)/s)*(0>u-s/2?-1:1);n(t,e,Math.max(i,Math.floor(e-u*l/s+h)),Math.min(o,Math.floor(e+(s-u)*l/s+h)),a)}var f=t[e],p=i,d=o;for(r(t,i,e),a(t[o],f)>0&&r(t,i,o);d>p;){for(r(t,p,d),p++,d--;0>a(t[p],f);)p++;for(;a(t[d],f)>0;)d--}0===a(t[i],f)?r(t,i,d):r(t,++d,o),d>e||(i=d+1),e>d||(o=d-1)}}function r(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function i(t,e){return e>t?-1:t>e?1:0}class o{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!m(t,e))return n;const r=this.toBBox,i=[];for(;e;){for(let o=0;e.children.length>o;o++){const a=e.children[o],s=e.leaf?r(a):a;m(t,s)&&(e.leaf?n.push(a):v(t,s)?this._all(a,n):i.push(a))}e=i.pop()}return n}collides(t){let e=this.data;if(!m(t,e))return!1;const n=[];for(;e;){for(let r=0;e.children.length>r;r++){const i=e.children[r],o=e.leaf?this.toBBox(i):i;if(m(t,o)){if(e.leaf||v(t,o))return!0;n.push(i)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(let e=0;t.length>e;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(e.height>this.data.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=y([]),this}remove(t,e){if(!t)return this;let n=this.data;const r=this.toBBox(t),i=[],o=[];let s,u,c;for(;n||i.length;){if(n||(n=i.pop(),u=i[i.length-1],s=o.pop(),c=!0),n.leaf){const r=a(t,n.children,e);if(-1!==r)return n.children.splice(r,1),i.push(n),this._condense(i),this}c||n.leaf||!v(n,r)?u?(s++,n=u.children[s],c=!1):n=null:(i.push(n),o.push(s),s=0,u=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,r){const i=n-e+1;let o,a=this._maxEntries;if(a>=i)return o=y(t.slice(e,n+1)),s(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/Math.pow(a,r-1))),o=y([]),o.leaf=!1,o.height=r;const u=Math.ceil(i/a),c=u*Math.ceil(Math.sqrt(a));g(t,e,n,c,this.compareMinX);for(let i=e;n>=i;i+=c){const e=Math.min(i+c-1,n);g(t,i,e,u,this.compareMinY);for(let n=i;e>=n;n+=u){const i=Math.min(n+u-1,e);o.children.push(this._build(t,n,i,r-1))}}return s(o,this.toBBox),o}_chooseSubtree(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){let n,r=1/0,a=1/0;for(let s=0;e.children.length>s;s++){const u=e.children[s],c=f(u),l=(i=t,o=u,(Math.max(o.maxX,i.maxX)-Math.min(o.minX,i.minX))*(Math.max(o.maxY,i.maxY)-Math.min(o.minY,i.minY))-c);a>l?(a=l,r=r>c?c:r,n=u):l===a&&r>c&&(r=c,n=u)}e=n||e.children[0]}var i,o;return e}_insert(t,e,n){const r=n?t:this.toBBox(t),i=[],o=this._chooseSubtree(r,this.data,e,i);for(o.children.push(t),c(o,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)}_split(t,e){const n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);const o=this._chooseSplitIndex(n,i,r),a=y(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,s(n,this.toBBox),s(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=y([t,e]),this.data.height=t.height+1,this.data.leaf=!1,s(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let r,i=1/0,o=1/0;for(let a=e;n-e>=a;a++){const e=u(t,0,a,this.toBBox),s=u(t,a,n,this.toBBox),c=d(e,s),l=f(e)+f(s);i>c?(i=c,r=a,o=o>l?l:o):c===i&&o>l&&(o=l,r=a)}return r||n-e}_chooseSplitAxis(t,e,n){const r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:h,o=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>o&&t.children.sort(r)}_allDistMargin(t,e,n,r){t.children.sort(r);const i=this.toBBox,o=u(t,0,e,i),a=u(t,n-e,n,i);let s=p(o)+p(a);for(let r=e;n-e>r;r++){const e=t.children[r];c(o,t.leaf?i(e):e),s+=p(o)}for(let r=n-e-1;r>=e;r--){const e=t.children[r];c(a,t.leaf?i(e):e),s+=p(a)}return s}_adjustParentBBoxes(t,e,n){for(let r=n;r>=0;r--)c(e[r],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():s(t[n],this.toBBox)}}function a(t,e,n){if(!n)return e.indexOf(t);for(let r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function s(t,e){u(t,0,t.children.length,e,t)}function u(t,e,n,r,i){i||(i=y(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let o=e;n>o;o++){const e=t.children[o];c(i,t.leaf?r(e):e)}return i}function c(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function l(t,e){return t.minX-e.minX}function h(t,e){return t.minY-e.minY}function f(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function p(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){const n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),o=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,o-r)}function v(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function m(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function y(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(t,n,r,i,o){const a=[n,r];for(;a.length;){if(i>=(r=a.pop())-(n=a.pop()))continue;const s=n+Math.ceil((r-n)/i/2)*i;e(t,s,n,r,o),a.push(n,s,s,r)}}var x=1e-6,E="undefined"!=typeof Float32Array?Float32Array:Array;function T(){var t=new E(9);return E!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function b(){var t=new E(16);return E!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function w(t){var e=new E(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function k(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function M(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,v,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=o,t[5]=a,t[6]=s,t[7]=u,t[8]=c,t[9]=l,t[10]=h,t[11]=f,t[12]=p,t[13]=d,t[14]=v,t[15]=m,t}function P(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function S(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],o=e[6],a=e[7],s=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[6]=e[9],t[7]=e[13],t[8]=r,t[9]=o,t[11]=e[14],t[12]=i,t[13]=a,t[14]=s}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function N(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],v=e[13],m=e[14],y=e[15],g=n*s-r*a,x=n*u-i*a,E=n*c-o*a,T=r*u-i*s,b=r*c-o*s,w=i*c-o*u,k=l*v-h*d,M=l*m-f*d,P=l*y-p*d,S=h*m-f*v,N=h*y-p*v,C=f*y-p*m,A=g*C-x*N+E*S+T*P-b*M+w*k;return A?(t[0]=(s*C-u*N+c*S)*(A=1/A),t[1]=(i*N-r*C-o*S)*A,t[2]=(v*w-m*b+y*T)*A,t[3]=(f*b-h*w-p*T)*A,t[4]=(u*P-a*C-c*M)*A,t[5]=(n*C-i*P+o*M)*A,t[6]=(m*E-d*w-y*x)*A,t[7]=(l*w-f*E+p*x)*A,t[8]=(a*N-s*P+c*k)*A,t[9]=(r*P-n*N-o*k)*A,t[10]=(d*b-v*E+y*g)*A,t[11]=(h*E-l*b-p*g)*A,t[12]=(s*M-a*S-u*k)*A,t[13]=(n*S-r*M+i*k)*A,t[14]=(v*x-d*T-m*g)*A,t[15]=(l*T-h*x+f*g)*A,t):null}function C(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],p=t[12],d=t[13],v=t[14],m=t[15];return(e*a-n*o)*(h*m-f*v)-(e*s-r*o)*(l*m-f*d)+(e*u-i*o)*(l*v-h*d)+(n*s-r*a)*(c*m-f*p)-(n*u-i*a)*(c*v-h*p)+(r*u-i*s)*(c*d-l*p)}function A(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],v=e[12],m=e[13],y=e[14],g=e[15],x=n[0],E=n[1],T=n[2],b=n[3];return t[0]=x*r+E*s+T*h+b*v,t[1]=x*i+E*u+T*f+b*m,t[2]=x*o+E*c+T*p+b*y,t[3]=x*a+E*l+T*d+b*g,t[4]=(x=n[4])*r+(E=n[5])*s+(T=n[6])*h+(b=n[7])*v,t[5]=x*i+E*u+T*f+b*m,t[6]=x*o+E*c+T*p+b*y,t[7]=x*a+E*l+T*d+b*g,t[8]=(x=n[8])*r+(E=n[9])*s+(T=n[10])*h+(b=n[11])*v,t[9]=x*i+E*u+T*f+b*m,t[10]=x*o+E*c+T*p+b*y,t[11]=x*a+E*l+T*d+b*g,t[12]=(x=n[12])*r+(E=n[13])*s+(T=n[14])*h+(b=n[15])*v,t[13]=x*i+E*u+T*f+b*m,t[14]=x*o+E*c+T*p+b*y,t[15]=x*a+E*l+T*d+b*g,t}function O(t,e,n){var r,i,o,a,s,u,c,l,h,f,p,d,v=n[0],m=n[1],y=n[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*y+e[12],t[13]=e[1]*v+e[5]*m+e[9]*y+e[13],t[14]=e[2]*v+e[6]*m+e[10]*y+e[14],t[15]=e[3]*v+e[7]*m+e[11]*y+e[15]):(i=e[1],o=e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=e[8],f=e[9],p=e[10],d=e[11],t[0]=r=e[0],t[1]=i,t[2]=o,t[3]=a,t[4]=s,t[5]=u,t[6]=c,t[7]=l,t[8]=h,t[9]=f,t[10]=p,t[11]=d,t[12]=r*v+s*m+h*y+e[12],t[13]=i*v+u*m+f*y+e[13],t[14]=o*v+c*m+p*y+e[14],t[15]=a*v+l*m+d*y+e[15]),t}function _(t,e,n){var r=n[0],i=n[1],o=n[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*i,t[5]=e[5]*i,t[6]=e[6]*i,t[7]=e[7]*i,t[8]=e[8]*o,t[9]=e[9]*o,t[10]=e[10]*o,t[11]=e[11]*o,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function L(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[4],a=e[5],s=e[6],u=e[7],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*i+c*r,t[5]=a*i+l*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=c*i-o*r,t[9]=l*i-a*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function R(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[8],l=e[9],h=e[10],f=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i-c*r,t[1]=a*i-l*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=o*r+c*i,t[9]=a*r+l*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function I(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function D(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=r+r,u=i+i,c=o+o,l=r*s,h=r*u,f=r*c,p=i*u,d=i*c,v=o*c,m=a*s,y=a*u,g=a*c;return t[0]=1-(p+v),t[1]=h+g,t[2]=f-y,t[3]=0,t[4]=h-g,t[5]=1-(l+v),t[6]=d+m,t[7]=0,t[8]=f+y,t[9]=d-m,t[10]=1-(l+p),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function F(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function G(t,e){var n=e[4],r=e[5],i=e[6],o=e[8],a=e[9],s=e[10];return t[0]=Math.hypot(e[0],e[1],e[2]),t[1]=Math.hypot(n,r,i),t[2]=Math.hypot(o,a,s),t}function U(t,e){var n=new E(3);G(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],a=e[0]*r,s=e[1]*i,u=e[2]*o,c=e[4]*r,l=e[5]*i,h=e[6]*o,f=e[8]*r,p=e[9]*i,d=e[10]*o,v=a+l+d,m=0;return v>0?(m=2*Math.sqrt(v+1),t[3]=.25*m,t[0]=(h-p)/m,t[1]=(f-u)/m,t[2]=(s-c)/m):a>l&&a>d?(m=2*Math.sqrt(1+a-l-d),t[3]=(h-p)/m,t[0]=.25*m,t[1]=(s+c)/m,t[2]=(f+u)/m):l>d?(m=2*Math.sqrt(1+l-a-d),t[3]=(f-u)/m,t[0]=(s+c)/m,t[1]=.25*m,t[2]=(h+p)/m):(m=2*Math.sqrt(1+d-a-l),t[3]=(s-c)/m,t[0]=(f+u)/m,t[1]=(h+p)/m,t[2]=.25*m),t}function B(t,e,n,r,i){var o=e[0],a=e[1],s=e[2],u=e[3],c=o+o,l=a+a,h=s+s,f=o*c,p=o*l,d=o*h,v=a*l,m=a*h,y=s*h,g=u*c,x=u*l,E=u*h,T=r[0],b=r[1],w=r[2],k=i[0],M=i[1],P=i[2],S=(1-(v+y))*T,N=(p+E)*T,C=(d-x)*T,A=(p-E)*b,O=(1-(f+y))*b,_=(m+g)*b,L=(d+x)*w,R=(m-g)*w,I=(1-(f+v))*w;return t[0]=S,t[1]=N,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=_,t[7]=0,t[8]=L,t[9]=R,t[10]=I,t[11]=0,t[12]=n[0]+k-(S*k+A*M+L*P),t[13]=n[1]+M-(N*k+O*M+R*P),t[14]=n[2]+P-(C*k+_*M+I*P),t[15]=1,t}function V(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n+n,s=r+r,u=i+i,c=n*a,l=r*a,h=r*s,f=i*a,p=i*s,d=i*u,v=o*a,m=o*s,y=o*u;return t[0]=1-h-d,t[1]=l+y,t[2]=f-m,t[3]=0,t[4]=l-y,t[5]=1-c-d,t[6]=p+v,t[7]=0,t[8]=f+m,t[9]=p-v,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function H(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=(i+r)*(o=1/(r-i)),t[14]=2*i*r*o):(t[10]=-1,t[14]=-2*r),t}function z(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(a+o)*c,t[15]=1,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var j=z;function Y(t,e,n,r){var i,o,a,s,u,c,l,h,f,p,d=e[0],v=e[1],m=e[2],y=r[0],g=r[1],E=r[2],T=n[0],b=n[1],w=n[2];return Math.abs(d-T)<x&&Math.abs(v-b)<x&&Math.abs(m-w)<x?P(t):(l=d-T,h=v-b,f=m-w,i=g*(f*=p=1/Math.hypot(l,h,f))-E*(h*=p),o=E*(l*=p)-y*f,a=y*h-g*l,(p=Math.hypot(i,o,a))?(i*=p=1/p,o*=p,a*=p):(i=0,o=0,a=0),s=h*a-f*o,u=f*i-l*a,c=l*o-h*i,(p=Math.hypot(s,u,c))?(s*=p=1/p,u*=p,c*=p):(s=0,u=0,c=0),t[0]=i,t[1]=s,t[2]=l,t[3]=0,t[4]=o,t[5]=u,t[6]=h,t[7]=0,t[8]=a,t[9]=c,t[10]=f,t[11]=0,t[12]=-(i*d+o*v+a*m),t[13]=-(s*d+u*v+c*m),t[14]=-(l*d+h*v+f*m),t[15]=1,t)}function W(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t[3]=e[3]-n[3],t[4]=e[4]-n[4],t[5]=e[5]-n[5],t[6]=e[6]-n[6],t[7]=e[7]-n[7],t[8]=e[8]-n[8],t[9]=e[9]-n[9],t[10]=e[10]-n[10],t[11]=e[11]-n[11],t[12]=e[12]-n[12],t[13]=e[13]-n[13],t[14]=e[14]-n[14],t[15]=e[15]-n[15],t}var X=Object.freeze({__proto__:null,create:b,clone:w,copy:k,fromValues:function(t,e,n,r,i,o,a,s,u,c,l,h,f,p,d,v){var m=new E(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=a,m[7]=s,m[8]=u,m[9]=c,m[10]=l,m[11]=h,m[12]=f,m[13]=p,m[14]=d,m[15]=v,m},set:M,identity:P,transpose:S,invert:N,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=e[4],s=e[5],u=e[6],c=e[7],l=e[8],h=e[9],f=e[10],p=e[11],d=e[12],v=e[13],m=e[14],y=e[15];return t[0]=s*(f*y-p*m)-h*(u*y-c*m)+v*(u*p-c*f),t[1]=-(r*(f*y-p*m)-h*(i*y-o*m)+v*(i*p-o*f)),t[2]=r*(u*y-c*m)-s*(i*y-o*m)+v*(i*c-o*u),t[3]=-(r*(u*p-c*f)-s*(i*p-o*f)+h*(i*c-o*u)),t[4]=-(a*(f*y-p*m)-l*(u*y-c*m)+d*(u*p-c*f)),t[5]=n*(f*y-p*m)-l*(i*y-o*m)+d*(i*p-o*f),t[6]=-(n*(u*y-c*m)-a*(i*y-o*m)+d*(i*c-o*u)),t[7]=n*(u*p-c*f)-a*(i*p-o*f)+l*(i*c-o*u),t[8]=a*(h*y-p*v)-l*(s*y-c*v)+d*(s*p-c*h),t[9]=-(n*(h*y-p*v)-l*(r*y-o*v)+d*(r*p-o*h)),t[10]=n*(s*y-c*v)-a*(r*y-o*v)+d*(r*c-o*s),t[11]=-(n*(s*p-c*h)-a*(r*p-o*h)+l*(r*c-o*s)),t[12]=-(a*(h*m-f*v)-l*(s*m-u*v)+d*(s*f-u*h)),t[13]=n*(h*m-f*v)-l*(r*m-i*v)+d*(r*f-i*h),t[14]=-(n*(s*m-u*v)-a*(r*m-i*v)+d*(r*u-i*s)),t[15]=n*(s*f-u*h)-a*(r*f-i*h)+l*(r*u-i*s),t},determinant:C,multiply:A,translate:O,scale:_,rotate:function(t,e,n,r){var i,o,a,s,u,c,l,h,f,p,d,v,m,y,g,E,T,b,w,k,M,P,S,N,C=r[0],A=r[1],O=r[2],_=Math.hypot(C,A,O);return x>_?null:(C*=_=1/_,A*=_,O*=_,i=Math.sin(n),o=Math.cos(n),u=e[1],c=e[2],l=e[3],f=e[5],p=e[6],d=e[7],m=e[9],y=e[10],g=e[11],w=C*A*(a=1-o)-O*i,k=A*A*a+o,M=O*A*a+C*i,P=C*O*a+A*i,S=A*O*a-C*i,N=O*O*a+o,t[0]=(s=e[0])*(E=C*C*a+o)+(h=e[4])*(T=A*C*a+O*i)+(v=e[8])*(b=O*C*a-A*i),t[1]=u*E+f*T+m*b,t[2]=c*E+p*T+y*b,t[3]=l*E+d*T+g*b,t[4]=s*w+h*k+v*M,t[5]=u*w+f*k+m*M,t[6]=c*w+p*k+y*M,t[7]=l*w+d*k+g*M,t[8]=s*P+h*S+v*N,t[9]=u*P+f*S+m*N,t[10]=c*P+p*S+y*N,t[11]=l*P+d*S+g*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:L,rotateY:R,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),o=e[0],a=e[1],s=e[2],u=e[3],c=e[4],l=e[5],h=e[6],f=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=o*i+c*r,t[1]=a*i+l*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=c*i-o*r,t[5]=l*i-a*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:I,fromScaling:function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotation:function(t,e,n){var r,i,o,a=n[0],s=n[1],u=n[2],c=Math.hypot(a,s,u);return x>c?null:(a*=c=1/c,s*=c,u*=c,r=Math.sin(e),i=Math.cos(e),t[0]=a*a*(o=1-i)+i,t[1]=s*a*o+u*r,t[2]=u*a*o-s*r,t[3]=0,t[4]=a*s*o-u*r,t[5]=s*s*o+i,t[6]=u*s*o+a*r,t[7]=0,t[8]=a*u*o+s*r,t[9]=s*u*o-a*r,t[10]=u*u*o+i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)},fromXRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=r,t[6]=n,t[7]=0,t[8]=0,t[9]=-n,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromYRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=0,t[2]=-n,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=n,t[9]=0,t[10]=r,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromZRotation:function(t,e){var n=Math.sin(e),r=Math.cos(e);return t[0]=r,t[1]=n,t[2]=0,t[3]=0,t[4]=-n,t[5]=r,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},fromRotationTranslation:D,fromQuat2:function(t,e){var n=new E(3),r=-e[0],i=-e[1],o=-e[2],a=e[3],s=e[4],u=e[5],c=e[6],l=e[7],h=r*r+i*i+o*o+a*a;return h>0?(n[0]=2*(s*a+l*r+u*o-c*i)/h,n[1]=2*(u*a+l*i+c*r-s*o)/h,n[2]=2*(c*a+l*o+s*i-u*r)/h):(n[0]=2*(s*a+l*r+u*o-c*i),n[1]=2*(u*a+l*i+c*r-s*o),n[2]=2*(c*a+l*o+s*i-u*r)),D(t,e,n),t},getTranslation:F,getScaling:G,getRotation:U,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=e[3],u=i+i,c=o+o,l=a+a,h=i*u,f=i*c,p=i*l,d=o*c,v=o*l,m=a*l,y=s*u,g=s*c,x=s*l,E=r[0],T=r[1],b=r[2];return t[0]=(1-(d+m))*E,t[1]=(f+x)*E,t[2]=(p-g)*E,t[3]=0,t[4]=(f-x)*T,t[5]=(1-(h+m))*T,t[6]=(v+y)*T,t[7]=0,t[8]=(p+g)*b,t[9]=(v-y)*b,t[10]=(1-(h+d))*b,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:B,fromQuat:V,frustum:function(t,e,n,r,i,o,a){var s=1/(n-e),u=1/(i-r),c=1/(o-a);return t[0]=2*o*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*o*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(a+o)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=a*o*2*c,t[15]=0,t},perspectiveNO:H,perspective:H,perspectiveZO:function(t,e,n,r,i){var o,a=1/Math.tan(e/2);return t[0]=a/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=i&&i!==1/0?(t[10]=i*(o=1/(r-i)),t[14]=i*r*o):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),o=Math.tan(e.downDegrees*Math.PI/180),a=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(a+s),c=2/(i+o);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-(a-s)*u*.5,t[9]=(i-o)*c*.5,t[10]=r/(n-r),t[11]=-1,t[12]=0,t[13]=0,t[14]=r*n/(n-r),t[15]=0,t},orthoNO:z,ortho:j,orthoZO:function(t,e,n,r,i,o,a){var s=1/(e-n),u=1/(r-i),c=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=o*c,t[15]=1,t},lookAt:Y,targetTo:function(t,e,n,r){var i=e[0],o=e[1],a=e[2],s=r[0],u=r[1],c=r[2],l=i-n[0],h=o-n[1],f=a-n[2],p=l*l+h*h+f*f;p>0&&(l*=p=1/Math.sqrt(p),h*=p,f*=p);var d=u*f-c*h,v=c*l-s*f,m=s*h-u*l;return(p=d*d+v*v+m*m)>0&&(d*=p=1/Math.sqrt(p),v*=p,m*=p),t[0]=d,t[1]=v,t[2]=m,t[3]=0,t[4]=h*m-f*v,t[5]=f*d-l*m,t[6]=l*v-h*d,t[7]=0,t[8]=l,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=o,t[14]=a,t[15]=1,t},str:function(t){return"mat4("+t[0]+", "+t[1]+", "+t[2]+", "+t[3]+", "+t[4]+", "+t[5]+", "+t[6]+", "+t[7]+", "+t[8]+", "+t[9]+", "+t[10]+", "+t[11]+", "+t[12]+", "+t[13]+", "+t[14]+", "+t[15]+")"},frob:function(t){return Math.hypot(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])},add:function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t[3]=e[3]+n[3],t[4]=e[4]+n[4],t[5]=e[5]+n[5],t[6]=e[6]+n[6],t[7]=e[7]+n[7],t[8]=e[8]+n[8],t[9]=e[9]+n[9],t[10]=e[10]+n[10],t[11]=e[11]+n[11],t[12]=e[12]+n[12],t[13]=e[13]+n[13],t[14]=e[14]+n[14],t[15]=e[15]+n[15],t},subtract:W,multiplyScalar:function(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*n,t[9]=e[9]*n,t[10]=e[10]*n,t[11]=e[11]*n,t[12]=e[12]*n,t[13]=e[13]*n,t[14]=e[14]*n,t[15]=e[15]*n,t},multiplyScalarAndAdd:function(t,e,n,r){return t[0]=e[0]+n[0]*r,t[1]=e[1]+n[1]*r,t[2]=e[2]+n[2]*r,t[3]=e[3]+n[3]*r,t[4]=e[4]+n[4]*r,t[5]=e[5]+n[5]*r,t[6]=e[6]+n[6]*r,t[7]=e[7]+n[7]*r,t[8]=e[8]+n[8]*r,t[9]=e[9]+n[9]*r,t[10]=e[10]+n[10]*r,t[11]=e[11]+n[11]*r,t[12]=e[12]+n[12]*r,t[13]=e[13]+n[13]*r,t[14]=e[14]+n[14]*r,t[15]=e[15]+n[15]*r,t},exactEquals:function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},equals:function(t,e){var n=t[0],r=t[1],i=t[2],o=t[3],a=t[4],s=t[5],u=t[6],c=t[7],l=t[8],h=t[9],f=t[10],p=t[11],d=t[12],v=t[13],m=t[14],y=t[15],g=e[0],E=e[1],T=e[2],b=e[3],w=e[4],k=e[5],M=e[6],P=e[7],S=e[8],N=e[9],C=e[10],A=e[11],O=e[12],_=e[13],L=e[14],R=e[15];return!(Math.abs(n-g)>x*Math.max(1,Math.abs(n),Math.abs(g))||Math.abs(r-E)>x*Math.max(1,Math.abs(r),Math.abs(E))||Math.abs(i-T)>x*Math.max(1,Math.abs(i),Math.abs(T))||Math.abs(o-b)>x*Math.max(1,Math.abs(o),Math.abs(b))||Math.abs(a-w)>x*Math.max(1,Math.abs(a),Math.abs(w))||Math.abs(s-k)>x*Math.max(1,Math.abs(s),Math.abs(k))||Math.abs(u-M)>x*Math.max(1,Math.abs(u),Math.abs(M))||Math.abs(c-P)>x*Math.max(1,Math.abs(c),Math.abs(P))||Math.abs(l-S)>x*Math.max(1,Math.abs(l),Math.abs(S))||Math.abs(h-N)>x*Math.max(1,Math.abs(h),Math.abs(N))||Math.abs(f-C)>x*Math.max(1,Math.abs(f),Math.abs(C))||Math.abs(p-A)>x*Math.max(1,Math.abs(p),Math.abs(A))||Math.abs(d-O)>x*Math.max(1,Math.abs(d),Math.abs(O))||Math.abs(v-_)>x*Math.max(1,Math.abs(v),Math.abs(_))||Math.abs(m-L)>x*Math.max(1,Math.abs(m),Math.abs(L))||Math.abs(y-R)>x*Math.max(1,Math.abs(y),Math.abs(R)))},mul:A,sub:W});function q(){var t=new E(3);return E!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function K(t){var e=new E(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function Z(t){return Math.hypot(t[0],t[1],t[2])}function Q(t,e,n){var r=new E(3);return r[0]=t,r[1]=e,r[2]=n,r}function J(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function $(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function tt(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function et(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function nt(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function rt(t,e){var n=e[0],r=e[1],i=e[2],o=n*n+r*r+i*i;return o>0&&(o=1/Math.sqrt(o)),t[0]=e[0]*o,t[1]=e[1]*o,t[2]=e[2]*o,t}function it(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ot(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[0],s=n[1],u=n[2];return t[0]=i*u-o*s,t[1]=o*a-r*u,t[2]=r*s-i*a,t}function at(t,e,n,r){var i=e[0],o=e[1],a=e[2];return t[0]=i+r*(n[0]-i),t[1]=o+r*(n[1]-o),t[2]=a+r*(n[2]-a),t}function st(t,e,n){var r=e[0],i=e[1],o=e[2],a=n[3]*r+n[7]*i+n[11]*o+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*o+n[12])/(a=a||1),t[1]=(n[1]*r+n[5]*i+n[9]*o+n[13])/a,t[2]=(n[2]*r+n[6]*i+n[10]*o+n[14])/a,t}function ut(t,e){var n=t[0],r=t[1],i=t[2],o=e[0],a=e[1],s=e[2];return Math.abs(n-o)<=x*Math.max(1,Math.abs(n),Math.abs(o))&&Math.abs(r-a)<=x*Math.max(1,Math.abs(r),Math.abs(a))&&Math.abs(i-s)<=x*Math.max(1,Math.abs(i),Math.abs(s))}var ct,lt=et,ht=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},ft=Z;ct=q();function pt(){var t=new E(4);return E!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function dt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*o+n[12]*a,t[1]=n[1]*r+n[5]*i+n[9]*o+n[13]*a,t[2]=n[2]*r+n[6]*i+n[10]*o+n[14]*a,t[3]=n[3]*r+n[7]*i+n[11]*o+n[15]*a,t}!function(){var t=pt()}();function vt(){var t=new E(4);return E!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function mt(t,e,n){n*=.5;var r=Math.sin(n);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function yt(t,e,n){var r=e[0],i=e[1],o=e[2],a=e[3],s=n[0],u=n[1],c=n[2],l=n[3];return t[0]=r*l+a*s+i*c-o*u,t[1]=i*l+a*u+o*s-r*c,t[2]=o*l+a*c+r*u-i*s,t[3]=a*l-r*s-i*u-o*c,t}function gt(t,e,n,r){var i,o,a,s,u,c=e[0],l=e[1],h=e[2],f=e[3],p=n[0],d=n[1],v=n[2],m=n[3];return 0>(o=c*p+l*d+h*v+f*m)&&(o=-o,p=-p,d=-d,v=-v,m=-m),1-o>x?(i=Math.acos(o),a=Math.sin(i),s=Math.sin((1-r)*i)/a,u=Math.sin(r*i)/a):(s=1-r,u=r),t[0]=s*c+u*p,t[1]=s*l+u*d,t[2]=s*h+u*v,t[3]=s*f+u*m,t}function xt(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o,s=a?1/a:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=o*s,t}function Et(t,e,n,r){var i=.5*Math.PI/180;e*=i,n*=i,r*=i;var o=Math.sin(e),a=Math.cos(e),s=Math.sin(n),u=Math.cos(n),c=Math.sin(r),l=Math.cos(r);return t[0]=o*u*l-a*s*c,t[1]=a*s*l+o*u*c,t[2]=a*u*c-o*s*l,t[3]=a*u*l+o*s*c,t}var Tt,bt,wt,kt,Mt,Pt,St=function(t,e,n,r){var i=new E(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},Nt=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},Ct=yt,At=function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=n*n+r*r+i*i+o*o;return a>0&&(a=1/Math.sqrt(a)),t[0]=n*a,t[1]=r*a,t[2]=i*a,t[3]=o*a,t};Tt=q(),bt=Q(1,0,0),wt=Q(0,1,0),kt=vt(),Mt=vt(),Pt=T();function Ot(t,e){var n=new E(2);return n[0]=t,n[1]=e,n}!function(){var t,e=(t=new E(2),E!=Float32Array&&(t[0]=0,t[1]=0),t)}();function _t(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var Lt=function(){return Lt=Object.assign||function(t){for(var e,n=1,r=arguments.length;r>n;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Lt.apply(this,arguments)},Rt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function It(t,e,n){if(t[n].length>7){t[n].shift();for(var r=t[n],i=n;r.length;)e[n]="A",t.splice(i+=1,0,["C"].concat(r.splice(0,6)));t.splice(n,1)}}var Dt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function Ft(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return Dt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Gt(t){return Ft(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Ut(t){return Gt(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Bt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=Dt[n]&&("m"===n&&r.length>2?(t.segments.push([e].concat(r.splice(0,2))),n="l",e="m"===e?"l":"L"):t.segments.push([e].concat(r.splice(0,Dt[n]))),Dt[n]););}function Vt(t){var e=t.index,n=t.pathValue,r=n.charCodeAt(e);return 48===r?(t.param=0,void(t.index+=1)):49===r?(t.param=1,void(t.index+=1)):void(t.err='[path-util]: invalid Arc flag "'+n[e]+'", expecting 0 or 1 at index '+e)}function Ht(t){return t>=48&&57>=t||43===t||45===t||46===t}function zt(t){return t>=48&&57>=t}function jt(t){var e,n=t.max,r=t.pathValue,i=t.index,o=i,a=!1,s=!1,u=!1,c=!1;if(n>o)if(43!==(e=r.charCodeAt(o))&&45!==e||(e=r.charCodeAt(o+=1)),zt(e)||46===e){if(46!==e){if(a=48===e,e=r.charCodeAt(o+=1),a&&n>o&&e&&zt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>o&&zt(r.charCodeAt(o));)o+=1,s=!0;e=r.charCodeAt(o)}if(46===e){for(c=!0,o+=1;zt(r.charCodeAt(o));)o+=1,u=!0;e=r.charCodeAt(o)}if(101===e||69===e){if(c&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid float exponent');if(43!==(e=r.charCodeAt(o+=1))&&45!==e||(o+=1),o>=n||!zt(r.charCodeAt(o)))return void(t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" invalid integer exponent');for(;n>o&&zt(r.charCodeAt(o));)o+=1}t.index=o,t.param=+t.pathValue.slice(i,o)}else t.err="[path-util]: Invalid path value at index "+o+', "'+r[o]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+o+', "pathValue" is missing param'}function Yt(t){for(var e,n=t.pathValue,r=t.max;r>t.index&&(10===(e=n.charCodeAt(t.index))||13===e||8232===e||8233===e||32===e||9===e||11===e||12===e||160===e||e>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(e));)t.index+=1}function Wt(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),o=Dt[n[r].toLowerCase()];if(t.segmentStart=r,function(t){switch(32|t){case 109:case 122:case 108:case 104:case 118:case 99:case 115:case 113:case 116:case 97:return!0;default:return!1}}(i))if(t.index+=1,Yt(t),t.data=[],o){for(;;){for(var a=o;a>0;a-=1){if(97!=(32|i)||3!==a&&4!==a?jt(t):Vt(t),t.err.length)return;t.data.push(t.param),Yt(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Yt(t))}if(t.index>=t.max)break;if(!Ht(n.charCodeAt(t.index)))break}Bt(t)}else Bt(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Xt=function(t){this.pathValue=t,this.segments=[],this.max=t.length,this.index=0,this.param=0,this.segmentStart=0,this.data=[],this.err=""};function qt(t){if(Gt(t))return _t(t);var e=function(t){if(Ft(t))return _t(t);var e=new Xt(t);for(Yt(e);e.max>e.index&&!e.err.length;)Wt(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,o=0;return e.map((function(t){var e,a=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=a[0],o=r=a[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,a[0],a[1],a[2],a[3],a[4],a[5]+n,a[6]+r];break;case"V":e=[u,a[0]+r];break;case"H":e=[u,a[0]+n];break;default:var c=a.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(c)}else e=[u].concat(a);var l=e.length;switch(u){case"Z":n=i,r=o;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[l-2],r=e[l-1],"M"===u&&(i=n,o=r)}return e}))}function Kt(t,e){var n=t[0],r=e.x1,i=e.y1,o=e.x2,a=e.y2,s=t.slice(1).map(Number),u=t;if("TQ".includes(n)||(e.qx=null,e.qy=null),"H"===n)u=["L",t[1],i];else if("V"===n)u=["L",r,t[1]];else if("S"===n){var c=2*r-o,l=2*i-a;e.x1=c,e.y1=l,u=["C",c,l].concat(s)}else if("T"===n){var h=2*r-e.qx,f=2*i-e.qy;e.qx=h,e.qy=f,u=["Q",h,f].concat(s)}else if("Q"===n){var p=s[1];e.qx=s[0],e.qy=p}return u}function Zt(t){if(Ut(t))return _t(t);for(var e=qt(t),n=Lt({},Rt),r=0;e.length>r;r+=1){e[r]=Kt(e[r],n);var i=e[r],o=i.length;n.x1=+i[o-2],n.y1=+i[o-1],n.x2=+i[o-4]||n.x1,n.y2=+i[o-3]||n.y1}return e}function Qt(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function Jt(t,e,n,r,i,o,a,s,u,c){var l,h,f,p,d,v=t,m=e,y=n,g=r,x=s,E=u,T=120*Math.PI/180,b=Math.PI/180*(+i||0),w=[];if(c)h=c[0],f=c[1],p=c[2],d=c[3];else{m=(l=Qt(v,m,-b)).y;var k=((v=l.x)-(x=(l=Qt(x,E,-b)).x))/2,M=(m-(E=l.y))/2,P=k*k/(y*y)+M*M/(g*g);P>1&&(y*=P=Math.sqrt(P),g*=P);var S=y*y,N=g*g,C=(o===a?-1:1)*Math.sqrt(Math.abs((S*N-S*M*M-N*k*k)/(S*M*M+N*k*k)));p=C*y*M/g+(v+x)/2,d=C*-g*k/y+(m+E)/2,h=Math.asin(((m-d)/g*Math.pow(10,9)>>0)/Math.pow(10,9)),f=Math.asin(((E-d)/g*Math.pow(10,9)>>0)/Math.pow(10,9)),h=p>v?Math.PI-h:h,f=p>x?Math.PI-f:f,0>h&&(h=2*Math.PI+h),0>f&&(f=2*Math.PI+f),a&&h>f&&(h-=2*Math.PI),!a&&f>h&&(f-=2*Math.PI)}var A=f-h;if(Math.abs(A)>T){var O=f,_=x,L=E;f=h+T*(a&&f>h?1:-1),w=Jt(x=p+y*Math.cos(f),E=d+g*Math.sin(f),y,g,i,0,a,_,L,[f,O,p,d])}A=f-h;var R=Math.cos(h),I=Math.sin(h),D=Math.cos(f),F=Math.sin(f),G=Math.tan(A/4),U=4/3*y*G,B=4/3*g*G,V=[v,m],H=[v+U*I,m-B*R],z=[x+U*F,E-B*D],j=[x,E];if(H[0]=2*V[0]-H[0],H[1]=2*V[1]-H[1],c)return H.concat(z,j,w);for(var Y=[],W=0,X=(w=H.concat(z,j,w)).length;X>W;W+=1)Y[W]=W%2?Qt(w[W-1],w[W],b).y:Qt(w[W],w[W+1],b).x;return Y}function $t(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function te(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function ee(t,e,n,r,i){var o=te([t,e],[n,r]),a={x:0,y:0};if("number"==typeof i)if(0<i)if(i<o){var s=$t([t,e],[n,r],i/o);a={x:s[0],y:s[1]}}else a={x:n,y:r};else a={x:t,y:e};return{length:o,point:a,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function ne(t,e,n,r){var i=.5,o=[t,e],a=[n,r],s=$t(o,a,i),u=$t(a,s,i),c=$t(s,u,i),l=$t(u,c,i),h=$t(c,l,i),f=ee(o[0],o[1],s[0],s[1],c[0]).point,p=ee(h[0],h[1],l[0],l[1],u[0]).point;return[f.x,f.y,p.x,p.y,n,r]}function re(t,e){var n,r,i,o,a,s,u,c=t[0],l=t.slice(1).map(Number),h=l[0],f=l[1],p=e.x1,d=e.y1,v=e.x,m=e.y;switch("TQ".includes(c)||(e.qx=null,e.qy=null),c){case"M":return e.x=h,e.y=f,t;case"A":return n=[p,d].concat(l),["C"].concat(Jt(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8],n[9]));case"Q":return e.qx=h,e.qy=f,n=[p,d].concat(l),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(o=n[4])+u*r,s*(a=n[5])+u*i,o,a]);case"L":return["C"].concat(ne(p,d,h,f));case"Z":return p===v&&d===m?["C",p,d,v,m,v,m]:["C"].concat(ne(p,d,v,m))}return t}function ie(t,e){if(void 0===e&&(e=!1),function(t){return Ut(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=_t(t);return e?[n,[]]:n}for(var r,i,o=Zt(t),a=Lt({},Rt),s=[],u="",c=o.length,l=[],h=0;c>h;h+=1){o[h]&&(u=o[h][0]),s[h]=u;var f=re(o[h],a);o[h]=f,It(o,s,h),c=o.length,"Z"===u&&l.push(h),a.x1=+(r=o[h])[(i=r.length)-2],a.y1=+r[i-1],a.x2=+r[i-4]||a.x1,a.y2=+r[i-3]||a.y1}return e?[o,l]:o}function oe(t,e){var n=t.x,r=t.y,i=e.x,o=e.y,a=n*i+r*o,s=Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(o,2)));return(0>n*o-r*i?-1:1)*Math.acos(a/s)}function ae(t,e,n,r,i,o,a,s,u,c){var l=Math.abs,h=Math.sin,f=Math.cos,p=Math.sqrt,d=Math.PI,v=l(n),m=l(r),y=(i%360+360)%360*(d/180);if(t===s&&e===u)return{x:t,y:e};if(0===v||0===m)return ee(t,e,s,u,c).point;var g=(t-s)/2,x=(e-u)/2,E={x:f(y)*g+h(y)*x,y:-h(y)*g+f(y)*x},T=Math.pow(E.x,2)/Math.pow(v,2)+Math.pow(E.y,2)/Math.pow(m,2);T>1&&(v*=p(T),m*=p(T));var b=(Math.pow(v,2)*Math.pow(m,2)-Math.pow(v,2)*Math.pow(E.y,2)-Math.pow(m,2)*Math.pow(E.x,2))/(Math.pow(v,2)*Math.pow(E.y,2)+Math.pow(m,2)*Math.pow(E.x,2)),w=(o!==a?1:-1)*p(b=0>b?0:b),k=w*(v*E.y/m),M=w*(-m*E.x/v),P=f(y)*k-h(y)*M+(t+s)/2,S=h(y)*k+f(y)*M+(e+u)/2,N={x:(E.x-k)/v,y:(E.y-M)/m},C=oe({x:1,y:0},N),A=oe(N,{x:(-E.x-k)/v,y:(-E.y-M)/m});!a&&A>0?A-=2*d:a&&0>A&&(A+=2*d);var O=C+(A%=2*d)*c,_=v*f(O),L=m*h(O);return{x:f(y)*_-h(y)*L+P,y:h(y)*_+f(y)*L+S}}function se(t,e,n,r,i,o,a,s,u,c,l){var h,f=l.bbox,p=void 0===f||f,d=l.length,v=void 0===d||d,m=l.sampleSize,y=void 0===m?30:m,g="number"==typeof c,x=t,E=e,T=0,b=[x,E,T],w=[x,E],k={x:0,y:0},M=[{x:x,y:E}];g&&0>=c&&(k={x:x,y:E});for(var P=0;y>=P;P+=1){if(x=(h=ae(t,e,n,r,i,o,a,s,u,P/y)).x,E=h.y,p&&M.push({x:x,y:E}),v&&(T+=te(w,[x,E])),w=[x,E],g&&T>=c&&c>b[2]){var S=(T-c)/(T-b[2]);k={x:w[0]*(1-S)+b[0]*S,y:w[1]*(1-S)+b[1]*S}}b=[x,E,T]}return g&&c>=T&&(k={x:s,y:u}),{length:T,point:k,min:{x:Math.min.apply(null,M.map((function(t){return t.x}))),y:Math.min.apply(null,M.map((function(t){return t.y})))},max:{x:Math.max.apply(null,M.map((function(t){return t.x}))),y:Math.max.apply(null,M.map((function(t){return t.y})))}}}function ue(t,e,n,r,i,o,a,s,u){var c=1-u;return{x:Math.pow(c,3)*t+3*Math.pow(c,2)*u*n+3*c*Math.pow(u,2)*i+Math.pow(u,3)*a,y:Math.pow(c,3)*e+3*Math.pow(c,2)*u*r+3*c*Math.pow(u,2)*o+Math.pow(u,3)*s}}function ce(t,e,n,r,i,o,a,s,u,c){var l,h=c.bbox,f=void 0===h||h,p=c.length,d=void 0===p||p,v=c.sampleSize,m=void 0===v?10:v,y="number"==typeof u,g=t,x=e,E=0,T=[g,x,E],b=[g,x],w={x:0,y:0},k=[{x:g,y:x}];y&&0>=u&&(w={x:g,y:x});for(var M=0;m>=M;M+=1){if(g=(l=ue(t,e,n,r,i,o,a,s,M/m)).x,x=l.y,f&&k.push({x:g,y:x}),d&&(E+=te(b,[g,x])),b=[g,x],y&&E>=u&&u>T[2]){var P=(E-u)/(E-T[2]);w={x:b[0]*(1-P)+T[0]*P,y:b[1]*(1-P)+T[1]*P}}T=[g,x,E]}return y&&u>=E&&(w={x:a,y:s}),{length:E,point:w,min:{x:Math.min.apply(null,k.map((function(t){return t.x}))),y:Math.min.apply(null,k.map((function(t){return t.y})))},max:{x:Math.max.apply(null,k.map((function(t){return t.x}))),y:Math.max.apply(null,k.map((function(t){return t.y})))}}}function le(t,e,n,r,i,o,a){var s=1-a;return{x:Math.pow(s,2)*t+2*s*a*n+Math.pow(a,2)*i,y:Math.pow(s,2)*e+2*s*a*r+Math.pow(a,2)*o}}function he(t,e,n,r,i,o,a,s){var u,c=s.bbox,l=void 0===c||c,h=s.length,f=void 0===h||h,p=s.sampleSize,d=void 0===p?10:p,v="number"==typeof a,m=t,y=e,g=0,x=[m,y,g],E=[m,y],T={x:0,y:0},b=[{x:m,y:y}];v&&0>=a&&(T={x:m,y:y});for(var w=0;d>=w;w+=1){if(m=(u=le(t,e,n,r,i,o,w/d)).x,y=u.y,l&&b.push({x:m,y:y}),f&&(g+=te(E,[m,y])),E=[m,y],v&&g>=a&&a>x[2]){var k=(g-a)/(g-x[2]);T={x:E[0]*(1-k)+x[0]*k,y:E[1]*(1-k)+x[1]*k}}x=[m,y,g]}return v&&a>=g&&(T={x:i,y:o}),{length:g,point:T,min:{x:Math.min.apply(null,b.map((function(t){return t.x}))),y:Math.min.apply(null,b.map((function(t){return t.y})))},max:{x:Math.max.apply(null,b.map((function(t){return t.x}))),y:Math.max.apply(null,b.map((function(t){return t.y})))}}}function fe(t,e,n){for(var r,i,o,a,s,u,c,l,h,f=Zt(t),p="number"==typeof e,d=[],v=0,m=0,y=0,g=0,x=[],E=[],T=0,b={x:0,y:0},w=b,k=b,M=b,P=0,S=0,N=f.length;N>S;S+=1)d=(c="M"===(l=(h=f[S])[0]))?d:[v,m].concat(h.slice(1)),c?(w=b={x:y=h[1],y:g=h[2]},T=0,p&&.001>e&&(M=b)):"L"===l?(T=(r=ee(d[0],d[1],d[2],d[3],(e||0)-P)).length,b=r.min,w=r.max,k=r.point):"A"===l?(T=(i=se(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8],(e||0)-P,n||{})).length,b=i.min,w=i.max,k=i.point):"C"===l?(T=(o=ce(d[0],d[1],d[2],d[3],d[4],d[5],d[6],d[7],(e||0)-P,n||{})).length,b=o.min,w=o.max,k=o.point):"Q"===l?(T=(a=he(d[0],d[1],d[2],d[3],d[4],d[5],(e||0)-P,n||{})).length,b=a.min,w=a.max,k=a.point):"Z"===l&&(T=(s=ee((d=[v,m,y,g])[0],d[1],d[2],d[3],(e||0)-P)).length,b=s.min,w=s.max,k=s.point),p&&e>P&&P+T>=e&&(M=k),E.push(w),x.push(b),P+=T,v=(u="Z"!==l?h.slice(-2):[y,g])[0],m=u[1];return p&&e>=P&&(M={x:v,y:m}),{length:P,point:M,min:{x:Math.min.apply(null,x.map((function(t){return t.x}))),y:Math.min.apply(null,x.map((function(t){return t.y})))},max:{x:Math.max.apply(null,E.map((function(t){return t.x}))),y:Math.max.apply(null,E.map((function(t){return t.y})))}}}function pe(t){return function(t){var e=0,n=0,r=0;return ie(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var o,a,s,u,c,l,h,f,p=t.slice(1);return r=3*(((f=p[5])-(a=n))*((s=p[0])+(c=p[2]))-((h=p[4])-(o=e))*((u=p[1])+(l=p[3]))+u*(o-c)-s*(a-l)+f*(c+o/3)-h*(l+a/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function de(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?ce(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],r[8],{bbox:!1}).length:0;return{s:t,ss:e?i?function(t,e){void 0===e&&(e=.5);var n=t.slice(0,2),r=t.slice(2,4),i=t.slice(4,6),o=t.slice(6,8),a=$t(n,r,e),s=$t(r,i,e),u=$t(i,o,e),c=$t(a,s,e),l=$t(s,u,e),h=$t(c,l,e);return[["C"].concat(a,c,h),["C"].concat(l,u,o)]}(r):[t,t]:[t],l:i}}))}function ve(t,e,n){var r=de(t),i=de(e),o=r.length,a=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,c=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,l=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(o,a),f=[c,l],p=[h-o,h-a],d=0,v=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return p[e]-=(d=n&&p[e]&&t.l>=f[e])?1:0,d?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:ve(v[0],v[1],h)}var me={}.toString,ye=function(t,e){return me.call(t)==="[object "+e+"]"},ge=function(t){return null==t},xe=function(t){return Array.isArray?Array.isArray(t):ye(t,"Array")},Ee=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},Te=function(t){if(xe(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},be=function(t){if(xe(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},we=function(t){return ye(t,"String")},ke=function(t,e,n){return e>t?e:t>n?n:t},Me=function(t){return ye(t,"Number")};var Pe=function(t,e){return(t%e+e)%e},Se=function(t){return ye(t,"Boolean")},Ne=function(t){return void 0===t},Ce=function(t,e){if(!ye(t,"Function"))throw new TypeError("Expected a function");var n=function(){for(var r=[],i=0;arguments.length>i;i++)r[i]=arguments[i];var o=e?e.apply(this,r):r[0],a=n.cache;if(a.has(o))return a.get(o);var s=t.apply(this,r);return a.set(o,s),s};return n.cache=new Map,n};function Ae(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Oe(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function _e(){}var Le=.7,Re=1/Le,Ie="\\s*([+-]?\\d+)\\s*",De="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",Fe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ge=/^#([0-9a-f]{3,8})$/,Ue=new RegExp("^rgb\\("+[Ie,Ie,Ie]+"\\)$"),Be=new RegExp("^rgb\\("+[Fe,Fe,Fe]+"\\)$"),Ve=new RegExp("^rgba\\("+[Ie,Ie,Ie,De]+"\\)$"),He=new RegExp("^rgba\\("+[Fe,Fe,Fe,De]+"\\)$"),ze=new RegExp("^hsl\\("+[De,Fe,Fe]+"\\)$"),je=new RegExp("^hsla\\("+[De,Fe,Fe,De]+"\\)$"),Ye={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function We(){return this.rgb().formatHex()}function Xe(){return this.rgb().formatRgb()}function qe(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ge.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Ke(e):3===n?new Je(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Ze(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Ze(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=Ue.exec(t))?new Je(e[1],e[2],e[3],1):(e=Be.exec(t))?new Je(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Ve.exec(t))?Ze(e[1],e[2],e[3],e[4]):(e=He.exec(t))?Ze(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ze.exec(t))?nn(e[1],e[2]/100,e[3]/100,1):(e=je.exec(t))?nn(e[1],e[2]/100,e[3]/100,e[4]):Ye.hasOwnProperty(t)?Ke(Ye[t]):"transparent"===t?new Je(NaN,NaN,NaN,0):null}function Ke(t){return new Je(t>>16&255,t>>8&255,255&t,1)}function Ze(t,e,n,r){return r>0||(t=e=n=NaN),new Je(t,e,n,r)}function Qe(t){return t instanceof _e||(t=qe(t)),t?new Je((t=t.rgb()).r,t.g,t.b,t.opacity):new Je}function Je(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function $e(){return"#"+en(this.r)+en(this.g)+en(this.b)}function tn(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function en(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function nn(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new on(t,e,n,r)}function rn(t){if(t instanceof on)return new on(t.h,t.s,t.l,t.opacity);if(t instanceof _e||(t=qe(t)),!t)return new on;if(t instanceof on)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(r>n):n===o?(r-e)/s+2:(e-n)/s+4,s/=.5>u?o+i:2-o-i,a*=60):s=u>0&&1>u?0:a,new on(a,s,u,t.opacity)}function on(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function an(t,e,n){return 255*(60>t?e+(n-e)*t/60:180>t?n:240>t?e+(n-e)*(240-t)/60:e)}function sn(t,e,n,r){var i=t-n,o=e-r;return Math.sqrt(i*i+o*o)}function un(t,e){return.001>Math.abs(t-e)}function cn(t,e){var n=Math.min.apply(Math,t),r=Math.min.apply(Math,e);return{x:n,y:r,width:Math.max.apply(Math,t)-n,height:Math.max.apply(Math,e)-r}}Ae(_e,qe,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:We,formatHex:We,formatHsl:function(){return rn(this).formatHsl()},formatRgb:Xe,toString:Xe}),Ae(Je,(function(t,e,n,r){return 1===arguments.length?Qe(t):new Je(t,e,n,null==r?1:r)}),Oe(_e,{brighter:function(t){return t=null==t?Re:Math.pow(Re,t),new Je(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?Le:Math.pow(Le,t),new Je(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return this.r>=-.5&&255.5>this.r&&this.g>=-.5&&255.5>this.g&&this.b>=-.5&&255.5>this.b&&this.opacity>=0&&1>=this.opacity},hex:$e,formatHex:$e,formatRgb:tn,toString:tn})),Ae(on,(function(t,e,n,r){return 1===arguments.length?rn(t):new on(t,e,n,null==r?1:r)}),Oe(_e,{brighter:function(t){return t=null==t?Re:Math.pow(Re,t),new on(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?Le:Math.pow(Le,t),new on(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(.5>n?n:1-n)*e,i=2*n-r;return new Je(an(240>t?t+120:t-240,i,r),an(t,i,r),an(120>t?t+240:t-120,i,r),this.opacity)},displayable:function(){return(this.s>=0&&1>=this.s||isNaN(this.s))&&this.l>=0&&1>=this.l&&this.opacity>=0&&1>=this.opacity},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var ln={box:function(t,e,n,r){return cn([t,n],[e,r])},length:function(t,e,n,r){return sn(t,e,n,r)},pointAt:function(t,e,n,r,i){return{x:(1-i)*t+i*n,y:(1-i)*e+i*r}},pointDistance:function(t,e,n,r,i,o){var a=(n-t)*(i-t)+(r-e)*(o-e);return 0>a?sn(t,e,i,o):a>(n-t)*(n-t)+(r-e)*(r-e)?sn(n,r,i,o):this.pointToLine(t,e,n,r,i,o)},pointToLine:function(t,e,n,r,i,o){var a=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(a,[0,0]))return Math.sqrt((i-t)*(i-t)+(o-e)*(o-e));var s=[-a[1],a[0]];return function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i)),t[0]=e[0]*i,t[1]=e[1]*i}(s,s),Math.abs(function(t,e){return t[0]*e[0]+t[1]*e[1]}([i-t,o-e],s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function hn(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function fn(t,e,n){var r=t+n-2*e;if(un(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}var pn=function(t,e,n,r,i,o){var a=fn(t,n,i)[0],s=fn(e,r,o)[0],u=[t,i],c=[e,o];return void 0!==a&&u.push(hn(t,n,i,a)),void 0!==s&&c.push(hn(e,r,o,s)),cn(u,c)};function dn(t,e,n,r,i){var o=1-i;return o*o*o*t+3*e*i*o*o+3*n*i*i*o+r*i*i*i}function vn(t,e,n,r){var i,o,a,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,c=3*e-3*t,l=[];if(un(s,0))un(u,0)||0>(i=-c/u)||i>1||l.push(i);else{var h=u*u-4*s*c;un(h,0)?l.push(-u/(2*s)):h>0&&(o=(-u-(a=Math.sqrt(h)))/(2*s),0>(i=(-u+a)/(2*s))||i>1||l.push(i),0>o||o>1||l.push(o))}return l}var mn=function(t,e,n,r,i,o,a,s){for(var u=[t,a],c=[e,s],l=vn(t,n,i,a),h=vn(e,r,o,s),f=0;l.length>f;f++)u.push(dn(t,n,i,a,l[f]));for(var p=0;h.length>p;p++)c.push(dn(e,r,o,s,h[p]));return cn(u,c)};function yn(t,e,n,r,i,o){return n*Math.cos(i)*Math.cos(o)-r*Math.sin(i)*Math.sin(o)+t}function gn(t,e,n,r,i,o){return n*Math.sin(i)*Math.cos(o)+r*Math.cos(i)*Math.sin(o)+e}var xn=function(t,e,n,r,i,o,a){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,c=-1/0,l=[o,a],h=2*-Math.PI;h<=2*Math.PI;h+=Math.PI){var f=s+h;a>o?f>o&&a>f&&l.push(f):f>a&&o>f&&l.push(f)}for(var p=0;l.length>p;p++){var d=yn(t,0,n,r,i,l[p]);u>d&&(u=d),d>c&&(c=d)}for(var v=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),m=1/0,y=-1/0,g=[o,a],x=2*-Math.PI;x<=2*Math.PI;x+=Math.PI){var E=v+x;a>o?E>o&&a>E&&g.push(E):E>a&&o>E&&g.push(E)}for(var T=0;g.length>T;T++){var b=gn(0,e,n,r,i,g[T]);m>b&&(m=b),b>y&&(y=b)}return{x:u,y:m,width:c-u,height:y-m}};var En=function(t){return function(t){if(2>t.length)return 0;for(var e=0,n=0;t.length-1>n;n++){var r=t[n],i=t[n+1];e+=sn(r[0],r[1],i[0],i[1])}return e}(t)};var Tn=function(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}((function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}function i(t,e,n){this.fn=t,this.context=e,this.once=n||!1}function o(t,e,r,o,a){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,o||t,a),u=n?n+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],s]:t._events[u].push(s):(t._events[u]=s,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new r:delete t._events[e]}function s(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),(new r).__proto__||(n=!1)),s.prototype.eventNames=function(){var t,r,i=[];if(0===this._eventsCount)return i;for(r in t=this._events)e.call(t,r)&&i.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},s.prototype.listeners=function(t){var e=this._events[n?n+t:t];if(!e)return[];if(e.fn)return[e.fn];for(var r=0,i=e.length,o=new Array(i);i>r;r++)o[r]=e[r].fn;return o},s.prototype.listenerCount=function(t){var e=this._events[n?n+t:t];return e?e.fn?1:e.length:0},s.prototype.emit=function(t,e,r,i,o,a){var s=n?n+t:t;if(!this._events[s])return!1;var u,c,l=this._events[s],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,e),!0;case 3:return l.fn.call(l.context,e,r),!0;case 4:return l.fn.call(l.context,e,r,i),!0;case 5:return l.fn.call(l.context,e,r,i,o),!0;case 6:return l.fn.call(l.context,e,r,i,o,a),!0}for(c=1,u=new Array(h-1);h>c;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var f,p=l.length;for(c=0;p>c;c++)switch(l[c].once&&this.removeListener(t,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,e);break;case 3:l[c].fn.call(l[c].context,e,r);break;case 4:l[c].fn.call(l[c].context,e,r,i);break;default:if(!u)for(f=1,u=new Array(h-1);h>f;f++)u[f-1]=arguments[f];l[c].fn.apply(l[c].context,u)}}return!0},s.prototype.on=function(t,e,n){return o(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return o(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var o=n?n+t:t;if(!this._events[o])return this;if(!e)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||a(this,o);else{for(var u=0,c=[],l=s.length;l>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&c.push(s[u]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&a(this,e):(this._events=new r,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=n,s.EventEmitter=s,t.exports=s}));let bn=1;const wn="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},kn=Date.now();let Mn={},Pn=Date.now();const Sn=t=>{if("function"!=typeof t)throw new TypeError(t+" is not a function");const e=Date.now(),n=e-Pn,r=n>16?0:16-n,i=bn++;return Mn[i]=t,Object.keys(Mn).length>1||setTimeout((()=>{Pn=e;const t=Mn;Mn={},Object.keys(t).forEach((e=>t[e](wn.performance&&"function"==typeof wn.performance.now?wn.performance.now():Date.now()-kn)))}),r),i},Nn=t=>{delete Mn[t]},Cn=t=>"string"!=typeof t?Sn:""===t?wn.requestAnimationFrame:wn[t+"RequestAnimationFrame"],An=((t,e)=>{let n=0;for(;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}})(["","webkit","moz","ms","o"],(t=>!!Cn(t))),On=Cn(An),_n="string"!=typeof(Ln=An)?Nn:""===Ln?wn.cancelAnimationFrame:wn[Ln+"CancelAnimationFrame"]||wn[Ln+"CancelRequestAnimationFrame"];var Ln,Rn;wn.requestAnimationFrame=On,wn.cancelAnimationFrame=_n,"undefined"!=typeof module&&module.exports&&(module.exports={requestAnimationFrame:On,cancelAnimationFrame:_n}),(Rn=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",Rn.COLOR="<color>",Rn.PAINT="<paint>",Rn.NUMBER="<number>",Rn.ANGLE="<angle>",Rn.OPACITY_VALUE="<opacity-value>",Rn.SHADOW_BLUR="<shadow-blur>",Rn.LENGTH="<length>",Rn.PERCENTAGE="<percentage>",Rn.LENGTH_PERCENTAGE="<length> | <percentage>",Rn.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",Rn.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",Rn.LIST_OF_POINTS="<list-of-points>",Rn.PATH="<path>",Rn.FILTER="<filter>",Rn.Z_INDEX="<z-index>",Rn.OFFSET_DISTANCE="<offset-distance>",Rn.DEFINED_PATH="<defined-path>",Rn.MARKER="<marker>",Rn.TRANSFORM="<transform>",Rn.TRANSFORM_ORIGIN="<transform-origin>",Rn.TEXT="<text>",Rn.TEXT_TRANSFORM="<text-transform>";var In,Dn=function(){function t(t,e){void 0===t&&(t=[0,0,0]),void 0===e&&(e=[0,0,0]),this.center=q(),this.halfExtents=q(),this.min=q(),this.max=q(),this.update(t,e)}t.isEmpty=function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]};var e=t.prototype;return e.update=function(t,e){J(this.center,t),J(this.halfExtents,e),lt(this.min,this.center,this.halfExtents),tt(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){tt(this.center,e,t),nt(this.center,this.center,.5),lt(this.halfExtents,e,t),nt(this.halfExtents,this.halfExtents,.5),J(this.min,t),J(this.max,e)},e.getMin=function(){return this.min},e.getMax=function(){return this.max},e.add=function(e){if(!t.isEmpty(e))if(t.isEmpty(this))this.setMinMax(e.getMin(),e.getMax());else{var n=this.center,r=n[0],i=n[1],o=n[2],a=this.halfExtents,s=a[0],u=a[1],c=a[2],l=r-s,h=r+s,f=i-u,p=i+u,d=o-c,v=o+c,m=e.center,y=m[0],g=m[1],x=m[2],E=e.halfExtents,T=E[0],b=E[1],w=E[2],k=y-T,M=y+T,P=g-b,S=g+b,N=x-w,C=x+w;l>k&&(l=k),M>h&&(h=M),f>P&&(f=P),S>p&&(p=S),d>N&&(d=N),C>v&&(v=C),n[0]=.5*(l+h),n[1]=.5*(f+p),n[2]=.5*(d+v),a[0]=.5*(h-l),a[1]=.5*(p-f),a[2]=.5*(v-d),this.min[0]=l,this.min[1]=f,this.min[2]=d,this.max[0]=h,this.max[1]=p,this.max[2]=v}},e.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,o=t.halfExtents,a=e[0],s=e[4],u=e[8],c=e[1],l=e[5],h=e[9],f=e[2],p=e[6],d=e[10],v=Math.abs(a),m=Math.abs(s),y=Math.abs(u),g=Math.abs(c),x=Math.abs(l),E=Math.abs(h),T=Math.abs(f),b=Math.abs(p),w=Math.abs(d);$(n,e[12]+a*i[0]+s*i[1]+u*i[2],e[13]+c*i[0]+l*i[1]+h*i[2],e[14]+f*i[0]+p*i[1]+d*i[2]),$(r,v*o[0]+m*o[1]+y*o[2],g*o[0]+x*o[1]+E*o[2],T*o[0]+b*o[1]+w*o[2]),this.min=lt(this.min,n,r),this.max=tt(this.max,n,r)},e.intersects=function(t){var e=this.getMax(),n=this.getMin(),r=t.getMax(),i=t.getMin();return!(n[0]>r[0]||i[0]>e[0]||n[1]>r[1]||i[1]>e[1]||n[2]>r[2]||i[2]>e[2])},e.intersection=function(e){if(!this.intersects(e))return null;var n,r,i,o=new t,a=(n=q(),r=this.getMin(),i=e.getMin(),n[0]=Math.max(r[0],i[0]),n[1]=Math.max(r[1],i[1]),n[2]=Math.max(r[2],i[2]),n),s=function(t,e,n){return t[0]=Math.min(e[0],n[0]),t[1]=Math.min(e[1],n[1]),t[2]=Math.min(e[2],n[2]),t}(q(),this.getMax(),e.getMax());return o.setMinMax(a,s),o},e.containsPoint=function(t){var e=this.getMin(),n=this.getMax();return!(e[0]>t[0]||t[0]>n[0]||e[1]>t[1]||t[1]>n[1]||e[2]>t[2]||t[2]>n[2])},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?J(q(),this.min):272===t.pnVertexFlag?Q(this.min[0],this.min[1],this.max[2]):257===t.pnVertexFlag?Q(this.min[0],this.max[1],this.min[2]):256===t.pnVertexFlag?Q(this.min[0],this.max[1],this.max[2]):17===t.pnVertexFlag?Q(this.max[0],this.min[1],this.min[2]):16===t.pnVertexFlag?Q(this.max[0],this.min[1],this.max[2]):Q(this.max[0],this.max[1],1===t.pnVertexFlag?this.min[2]:this.max[2])},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?J(q(),this.max):272===t.pnVertexFlag?Q(this.max[0],this.max[1],this.min[2]):257===t.pnVertexFlag?Q(this.max[0],this.min[1],this.max[2]):256===t.pnVertexFlag?Q(this.max[0],this.min[1],this.min[2]):17===t.pnVertexFlag?Q(this.min[0],this.max[1],this.max[2]):16===t.pnVertexFlag?Q(this.min[0],this.max[1],this.min[2]):Q(this.min[0],this.min[1],1===t.pnVertexFlag?this.max[2]:this.min[2])},t}(),Fn=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||Q(0,1,0),this.updatePNVertexFlag()}var e=t.prototype;return e.updatePNVertexFlag=function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)},e.distanceToPoint=function(t){return it(t,this.normal)-this.distance},e.normalize=function(){var t=1/ft(this.normal);nt(this.normal,this.normal,t),this.distance*=t},e.intersectsLine=function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),o=i>=0&&1>=i;return o&&n&&at(n,t,e,i),o},t}();(In=t.Mask||(t.Mask={}))[In.OUTSIDE=4294967295]="OUTSIDE",In[In.INSIDE=0]="INSIDE",In[In.INDETERMINATE=2147483647]="INDETERMINATE";var Gn,Un=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new Fn)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],o=t[4],a=t[5],s=t[6],u=t[7],c=t[8],l=t[9],h=t[10],f=t[11],p=t[12],d=t[13],v=t[14],m=t[15];$(this.planes[0].normal,i-e,u-o,f-c),this.planes[0].distance=m-p,$(this.planes[1].normal,i+e,u+o,f+c),this.planes[1].distance=m+p,$(this.planes[2].normal,i+n,u+a,f+l),this.planes[2].distance=m+d,$(this.planes[3].normal,i-n,u-a,f-l),this.planes[3].distance=m-d,$(this.planes[4].normal,i-r,u-s,f-h),this.planes[4].distance=m-v,$(this.planes[5].normal,i+r,u+s,f+h),this.planes[5].distance=m+v,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))},t}(),Bn=function(){function t(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=0,this.y=0,this.x=t,this.y=e}var e=t.prototype;return e.clone=function(){return new t(this.x,this.y)},e.copyFrom=function(t){this.x=t.x,this.y=t.y},t}(),Vn=function(){function t(t,e,n,r){this.x=void 0,this.y=void 0,this.width=void 0,this.height=void 0,this.left=void 0,this.right=void 0,this.top=void 0,this.bottom=void 0,this.x=t,this.y=e,this.width=n,this.height=r,this.left=t,this.right=t+n,this.top=e,this.bottom=e+r}return t.prototype.toJSON=function(){},t}();(Gn=t.Shape||(t.Shape={})).GROUP="g",Gn.CIRCLE="circle",Gn.ELLIPSE="ellipse",Gn.IMAGE="image",Gn.RECT="rect",Gn.LINE="line",Gn.POLYLINE="polyline",Gn.POLYGON="polygon",Gn.TEXT="text",Gn.PATH="path",Gn.HTML="html",Gn.MESH="mesh";var Hn=Ce((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))}));function zn(t){if(!t)throw new Error}function jn(t,e){if(t===e)throw new Error}function Yn(t){return"function"==typeof t}var Wn={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Xn=Ce((function(t){var e=Hn(t),n=Wn[e];return e=(null==n?void 0:n.alias)||e})),qn={},Kn=0;var Zn="undefined"!=typeof window&&void 0!==window.document;function Qn(t,e){var n=Number(t.style.zIndex),r=Number(e.style.zIndex);if(n===r){var i=t.parentNode;if(i){var o=i.childNodes||[];return o.indexOf(t)-o.indexOf(e)}}return n-r}function Jn(t){var e=t;do{var n;if(null===(n=e.style)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function $n(t,e){if(Zn)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var tr,er,nr,rr,ir,or="Method not implemented.",ar="Use document.documentElement instead.",sr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function ur(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ur=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new w(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return M()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),i}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function p(){}var d={};s(d,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(k([])));m&&m!==e&&n.call(m,i)&&(d=m);var y=p.prototype=h.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function E(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return f.prototype=p,s(y,"constructor",p),s(p,"constructor",f),f.displayName=s(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(x.prototype),s(x.prototype,o,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),s(y,a,"Generator"),s(y,i,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),b(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;b(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function cr(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function lr(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){cr(o,r,i,a,s,"next",t)}function s(t){cr(o,r,i,a,s,"throw",t)}a(void 0)}))}}function hr(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function fr(t,e,n){return e&&hr(t.prototype,e),n&&hr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function pr(){return pr=Object.assign?Object.assign.bind():function(t){for(var e=1;arguments.length>e;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},pr.apply(this,arguments)}function dr(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,vr(t,e)}function vr(t,e){return vr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},vr(t,e)}function mr(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;o.length>r;r++)0>e.indexOf(n=o[r])&&(i[n]=t[n]);return i}function yr(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function gr(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);e>n;n++)r[n]=t[n];return r}function xr(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return gr(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0;return function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(tr=t.UnitType||(t.UnitType={}))[tr.kUnknown=0]="kUnknown",tr[tr.kNumber=1]="kNumber",tr[tr.kPercentage=2]="kPercentage",tr[tr.kEms=3]="kEms",tr[tr.kPixels=4]="kPixels",tr[tr.kRems=5]="kRems",tr[tr.kDegrees=6]="kDegrees",tr[tr.kRadians=7]="kRadians",tr[tr.kGradians=8]="kGradians",tr[tr.kTurns=9]="kTurns",tr[tr.kMilliseconds=10]="kMilliseconds",tr[tr.kSeconds=11]="kSeconds",tr[tr.kInteger=12]="kInteger",function(t){t[t.kUNumber=0]="kUNumber",t[t.kUPercent=1]="kUPercent",t[t.kULength=2]="kULength",t[t.kUAngle=3]="kUAngle",t[t.kUTime=4]="kUTime",t[t.kUOther=5]="kUOther"}(er||(er={})),function(t){t[t.kAll=0]="kAll",t[t.kNonNegative=1]="kNonNegative",t[t.kInteger=2]="kInteger",t[t.kNonNegativeInteger=3]="kNonNegativeInteger",t[t.kPositiveInteger=4]="kPositiveInteger"}(nr||(nr={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(rr||(rr={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(ir||(ir={}));var Er,Tr=[{name:"em",unit_type:t.UnitType.kEms},{name:"px",unit_type:t.UnitType.kPixels},{name:"deg",unit_type:t.UnitType.kDegrees},{name:"rad",unit_type:t.UnitType.kRadians},{name:"grad",unit_type:t.UnitType.kGradians},{name:"ms",unit_type:t.UnitType.kMilliseconds},{name:"s",unit_type:t.UnitType.kSeconds},{name:"rem",unit_type:t.UnitType.kRems},{name:"turn",unit_type:t.UnitType.kTurns}];!function(t){t[t.kUnknownType=0]="kUnknownType",t[t.kUnparsedType=1]="kUnparsedType",t[t.kKeywordType=2]="kKeywordType",t[t.kUnitType=3]="kUnitType",t[t.kSumType=4]="kSumType",t[t.kProductType=5]="kProductType",t[t.kNegateType=6]="kNegateType",t[t.kInvertType=7]="kInvertType",t[t.kMinType=8]="kMinType",t[t.kMaxType=9]="kMaxType",t[t.kClampType=10]="kClampType",t[t.kTransformType=11]="kTransformType",t[t.kPositionType=12]="kPositionType",t[t.kURLImageType=13]="kURLImageType",t[t.kColorType=14]="kColorType",t[t.kUnsupportedColorType=15]="kUnsupportedColorType"}(Er||(Er={}));var br,wr=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return Tr.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},kr=function(e){var n=1;switch(e){case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kSeconds:break;case t.UnitType.kMilliseconds:n=.001;break;case t.UnitType.kRadians:n=180/Math.PI;break;case t.UnitType.kGradians:n=.9;break;case t.UnitType.kTurns:n=360}return n},Mr=function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return"";case t.UnitType.kPercentage:return"%";case t.UnitType.kEms:return"em";case t.UnitType.kRems:return"rem";case t.UnitType.kPixels:return"px";case t.UnitType.kDegrees:return"deg";case t.UnitType.kRadians:return"rad";case t.UnitType.kGradians:return"grad";case t.UnitType.kMilliseconds:return"ms";case t.UnitType.kSeconds:return"s";case t.UnitType.kTurns:return"turn"}return""},Pr=function(){function e(){}e.isAngle=function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns},e.isLength=function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e},e.isRelativeUnit=function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems},e.isTime=function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds};var n=e.prototype;return n.toString=function(){return this.buildCSSText(rr.kNo,ir.kNo,"")},n.isNumericValue=function(){return this.getType()>=Er.kUnitType&&this.getType()<=Er.kClampType},e}(),Sr=function(t){function e(e){var n;return(n=t.call(this)||this).colorSpace=void 0,n.colorSpace=e,n}dr(e,t);var n=e.prototype;return n.getType=function(){return Er.kColorType},n.to=function(t){return this},e}(Pr);(br=t.GradientType||(t.GradientType={}))[br.Constant=0]="Constant",br[br.LinearGradient=1]="LinearGradient",br[br.RadialGradient=2]="RadialGradient";var Nr,Cr,Ar=function(t){function e(e,n){var r;return(r=t.call(this)||this).type=void 0,r.value=void 0,r.type=e,r.value=n,r}dr(e,t);var n=e.prototype;return n.clone=function(){return new e(this.type,this.value)},n.buildCSSText=function(t,e,n){return n},n.getType=function(){return Er.kColorType},e}(Pr),Or=function(t){function e(e){var n;return(n=t.call(this)||this).value=void 0,n.value=e,n}dr(e,t);var n=e.prototype;return n.clone=function(){return new e(this.value)},n.getType=function(){return Er.kKeywordType},n.buildCSSText=function(t,e,n){return n+this.value},e}(Pr);!function(t){t.kAdd="+",t.kSubtract="-",t.kMultiply="*",t.kDivide="/",t.kMin="min",t.kMax="max",t.kClamp="clamp",t.kInvalid=""}(Nr||(Nr={})),function(t){t[t.kLength=0]="kLength",t[t.kAngle=1]="kAngle",t[t.kTime=2]="kTime",t[t.kFrequency=3]="kFrequency",t[t.kResolution=4]="kResolution",t[t.kFlex=5]="kFlex",t[t.kPercent=6]="kPercent",t[t.kNumBaseTypes=7]="kNumBaseTypes"}(Cr||(Cr={}));var _r=function(){function e(e,n){void 0===e&&(e=t.UnitType.kNumber),void 0===n&&(n=1),this.exponents=[],this.numNonZeroEntries=0,this.percentHint=Cr.kPercent,this.hasPercentHint=!1,this.exponents=new Array(Cr.kNumBaseTypes).fill(0),e!==t.UnitType.kNumber&&this.setExponent(function(e){switch(jn(e,t.UnitType.kNumber),e){case t.UnitType.kEms:case t.UnitType.kPixels:case t.UnitType.kRems:return Cr.kLength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return Cr.kTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return Cr.kAngle;case t.UnitType.kPercentage:return Cr.kPercent;default:return Cr.kLength}}(e),n)}var n=e.prototype;return n.applyPercentHint=function(t){jn(t,Cr.kPercent),this.setExponent(t,this.exponent(t)+this.exponent(Cr.kPercent)),this.setExponent(Cr.kPercent,0),this.percentHint=t,this.hasPercentHint=!0},n.hasNonZeroEntries=function(){return this.numNonZeroEntries>0},n.isOnlyNonZeroEntry=function(t,e){return jn(e,0),1===this.numNonZeroEntries&&this.exponent(t)===e},n.exponent=function(t){return this.exponents[t]},n.setExponent=function(t,e){var n=this.exponents[t];0==n&&0!==e?this.numNonZeroEntries++:0!==n&&0==e&&this.numNonZeroEntries--,this.exponents[t]=e},e.negateExponents=function(t){return t.exponents.forEach((function(t){return-1*t})),t},n.matchesBaseType=function(t){return jn(t,Cr.kPercent),this.isOnlyNonZeroEntry(t,1)&&!this.hasPercentHint},n.matchesPercentage=function(){return this.isOnlyNonZeroEntry(Cr.kPercent,1)},n.matchesBaseTypePercentage=function(t){return jn(t,Cr.kPercent),this.isOnlyNonZeroEntry(t,1)||this.isOnlyNonZeroEntry(Cr.kPercent,1)},n.matchesNumber=function(){return!this.hasNonZeroEntries()&&!this.hasPercentHint},n.matchesNumberPercentage=function(){return!this.hasNonZeroEntries()||this.isOnlyNonZeroEntry(Cr.kPercent,1)},e.add=function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint),function(t,e){if(t!==e)throw new Error}(t.percentHint,e.percentHint);for(var r=0;Cr.kNumBaseTypes>r;++r){var i=r;if(t.exponents[r]!==e.exponents[r]&&(i!==Cr.kPercent&&(t.applyPercentHint(i),e.applyPercentHint(i)),t.exponents[r]!==e.exponents[r]))return t}return t},e.multiply=function(t,e,n){if(t.hasPercentHint&&e.hasPercentHint&&t.percentHint!=e.percentHint)return t;t.hasPercentHint?e.applyPercentHint(t.percentHint):e.hasPercentHint&&t.applyPercentHint(e.percentHint);for(var r=0;Cr.kNumBaseTypes>r;++r){var i=r;t.setExponent(i,t.exponent(i)+e.exponent(i))}return t},e}(),Lr=function(e){return"number"==typeof e?new Vr(e,t.UnitType.kNumber):e},Rr=function(e){function n(t){var n;return(n=e.call(this)||this).type_=void 0,n.type_=t,n}dr(n,e);var r=n.prototype;return r.getType=function(){return Er.kUnknownType},r.equals=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=Ir(n);return i.every((function(e){return t.equals(e)}))},r.add=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ir(e);Dr(Er.kSumType,r,this);var i=Gr(r,Nr.kAdd);return i||Kr.create(r)},r.sub=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ir(e);r=r.map((function(t){return t.negate()})),Dr(Er.kSumType,r,this);var i=Gr(r,Nr.kAdd);return i||Kr.create(r)},r.mul=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ir(e);Dr(Er.kProductType,r,this);var i=Ur(r);return i||Zr.create(r)},r.div=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ir(e);r=r.map((function(t){return t.invert()})),Dr(Er.kProductType,r,this);var i=Ur(r);return i||Zr.create(r)},r.min=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ir(e);Dr(Er.kMinType,r,this);var i=Gr(r,Nr.kMin);return i||Xr.create(r)},r.max=function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];var r=Ir(e);Dr(Er.kMaxType,r,this);var i=Gr(r,Nr.kMax);return i||qr.create(r)},r.to=function(t){var e=this.sumValue();if(0===e.length||1!==e.length)return null;var n,r=Fr(e[0]);return r?(n="string"==typeof t?wr(t):t,r.convertTo(n)):null},r.toSum=function(){for(var t=arguments.length,e=new Array(t),r=0;t>r;r++)e[r]=arguments[r];for(var i=0,o=e;o.length>i;i++){var a=o[i];if(!n.isValidUnit(wr(a)))return null}var s=this.sumValue();if(!s.length)return null;for(var u,c=[],l=xr(s);!(u=l()).done;){var h=u.value,f=Fr(h);if(!f)return null;c.push(f)}if(0===e.length){c.sort((function(t,e){return t.unit-e.unit}));var p=Kr.create(c);return zn(!!p),p}for(var d=[],v=function(){var t=wr(y[m]);zn(n.isValidUnit(t));var e=c.reduce((function(e,n,r){if(n){var i=n.convertTo(t);i&&(e+=i.value,c[r]=null)}return e}),0);d.push(new Vr(e,t))},m=0,y=e;y.length>m;m++)v();if(c.some((function(t){return!!t})))throw new Error("There were leftover terms that were not converted");return Kr.create(d)},r.type=function(){var t={length:0,angle:0,time:0,frequency:0,resolution:0,flex:0,percent:0,percentHint:"length"},e=this.type_.exponent(Cr.kLength);return e&&(t.length=e),(e=this.type_.exponent(Cr.kAngle))&&(t.angle=e),(e=this.type_.exponent(Cr.kTime))&&(t.time=e),(e=this.type_.exponent(Cr.kFrequency))&&(t.frequency=e),(e=this.type_.exponent(Cr.kResolution))&&(t.resolution=e),(e=this.type_.exponent(Cr.kFlex))&&(t.flex=e),(e=this.type_.exponent(Cr.kPercent))&&(t.percent=e),this.type_.hasPercentHint&&(t.percentHint=function(t){switch(t){case Cr.kLength:return"length";case Cr.kAngle:return"angle";case Cr.kTime:return"time";case Cr.kFrequency:return"frequency";case Cr.kResolution:return"resolution";case Cr.kFlex:return"flex";case Cr.kPercent:return"percent"}return""}(this.type_.percentHint)),t},n.isValidUnit=function(e){return!!(e===t.UnitType.kNumber||e==t.UnitType.kPercentage||this.isLength(e)||this.isAngle(e)||this.isTime(e))},r.negate=function(){return jr.create(this)},r.invert=function(){return zr.create(this)},n}(Pr);function Ir(t){return t.map(Lr)}function Dr(t,e,n){zn(!!n),n.getType()===t?e.unshift.apply(e,n.numericValues()):e.unshift(n)}function Fr(t){return 0===Object.keys(t.units).length?new Vr(t.value):1===Object.keys(t.units).length&&1===t.units[Object.keys(t.units)[0]]?new Vr(t.value,Number(Object.keys(t.units)[0])):null}function Gr(t,e){zn(!!t.length);var n=t[0]instanceof Vr?t[0]:null;if(!n)return null;for(var r=n.value,i=1;t.length>i;i++){var o=t[i]instanceof Vr?t[i]:null;if(!o||o.unit!==n.unit)return null;e===Nr.kAdd?r+=o.value:e===Nr.kMax?r=Math.max(r,o.value):e===Nr.kMin&&(r=Math.min(r,o.value))}return new Vr(r,n.unit)}function Ur(e){zn(!!e.length);for(var n=t.UnitType.kNumber,r=1,i=0;e.length>i;i++){var o=e[i]instanceof Vr?e[i]:null;if(!o)return null;if(o.unit!==t.UnitType.kNumber){if(n!==t.UnitType.kNumber)return null;n=o.unit}r*=o.value}return new Vr(r,n)}var Br=function(e){return function(e){switch(e){case er.kUNumber:return t.UnitType.kNumber;case er.kULength:return t.UnitType.kPixels;case er.kUPercent:return t.UnitType.kPercentage;case er.kUTime:return t.UnitType.kSeconds;case er.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return er.kUNumber;case t.UnitType.kPercentage:return er.kUPercent;case t.UnitType.kPixels:return er.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return er.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return er.kUAngle;default:return er.kUOther}}(e))},Vr=function(e){function n(n,r){var i,o;return void 0===r&&(r=t.UnitType.kNumber),o="string"==typeof r?wr(r):r,(i=e.call(this,new _r(o))||this).unit=void 0,i.value=void 0,i.unit=o,i.value=n,i}dr(n,e);var r=n.prototype;return r.clone=function(){return new n(this.value,this.unit)},r.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=Br(this.unit);if(r!==Br(e)||r===t.UnitType.kUnknown)return null;var i=kr(this.unit)/kr(e);return new n(this.value*i,e)},r.equals=function(t){return this.value===t.value&&this.unit===t.unit},r.getType=function(){return Er.kUnitType},r.sumValue=function(){var e,n,r=[],i={};return this.unit!==t.UnitType.kNumber&&(i[(e=this.unit,n=Br(e),n===t.UnitType.kUnknown?e:n)]=1),r.push({value:this.value*kr(this.unit),units:i}),r},r.negate=function(){return new n(-this.value,this.unit)},r.invert=function(){return this.unit===t.UnitType.kNumber?0===this.value?null:new n(1/this.value,this.unit):zr.create(this)},r.buildCSSText=function(e,n,r){var i;switch(this.unit){case t.UnitType.kUnknown:break;case t.UnitType.kInteger:i=Number(this.value).toFixed(0);break;case t.UnitType.kNumber:case t.UnitType.kPercentage:case t.UnitType.kEms:case t.UnitType.kRems:case t.UnitType.kPixels:case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:case t.UnitType.kTurns:var o=this.value,a=Mr(this.unit);if(-999999>o||o>999999){var s=Mr(this.unit);i=!Number.isFinite(o)||Number.isNaN(o)?function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(zn(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e}(o,s):o+(s||"")}else i=""+o+a}return r+=i},n}(Rr),Hr=function(t){function e(){return t.apply(this,arguments)||this}return dr(e,t),e.prototype.isUnitValue=function(){return!1},e}(Rr),zr=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).value=void 0,r.operator="invert",r.value=e,r}dr(e,t),e.create=function(t){return new e(t,_r.negateExponents(t.type_))};var n=e.prototype;return n.clone=function(){return new e(this.value,this.type_)},n.getType=function(){return Er.kInvertType},n.equals=function(t){return t.getType()===Er.kInvertType&&this.value.equals(t.value)},n.sumValue=function(){var t=this.value.sumValue();return 0===t.length||1!==t.length||0===t[0].value?null:(Object.keys(t[0].units).forEach((function(e){t[0].units[e]*=-1})),t[0].value=1/t[0].value,t)},n.buildCSSText=function(t,e,n){return e==ir.kNo&&(n+=t===rr.kYes?"(":"calc("),n=this.value.buildCSSText(rr.kYes,ir.kNo,n+="1 / "),e===ir.kNo&&(n+=")"),n},e}(Hr),jr=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).value=void 0,r.operator="negate",r.value=e,r}dr(e,t),e.create=function(t){return new e(t,t.type_)};var n=e.prototype;return n.clone=function(){return new e(this.value,this.type_)},n.getType=function(){return Er.kNegateType},n.equals=function(t){return t.getType()===Er.kNegateType&&this.value.equals(t.value)},n.sumValue=function(){var t=this.value.sumValue();return 0===t.length?null:(t.forEach((function(t){t.value*=-1})),t)},n.buildCSSText=function(t,e,n){return e==ir.kNo&&(n+=t===rr.kYes?"(":"calc("),n=this.value.buildCSSText(rr.kYes,ir.kNo,n+="-"),e===ir.kNo&&(n+=")"),n},e}(Hr);function Yr(t,e,n){for(var r=t[0].type_,i=1;t.length>i;i++)r=e(r,t[i].type_,false);return r}var Wr=function(t){function e(e,n){var r;return(r=t.call(this,n)||this).values=void 0,r.values=e,r}dr(e,t);var n=e.prototype;return n.numericValues=function(){return this.values},n.equals=function(t){return this.getType()===t.getType()&&this.values.every((function(e,n){return e.equals(t.values[n])}))},e}(Hr),Xr=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).operator="min",e}dr(e,t),e.create=function(t){return new e(t,Yr(t,_r.add))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return Er.kMinType},n.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=xr(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},n.buildCSSText=function(t,e,n){n+="min(";for(var r,i=!0,o=xr(this.numericValues());!(r=o()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(rr.kYes,ir.kYes,n)}return n+=")"},e}(Wr),qr=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).operator="max",e}dr(e,t),e.create=function(t){return new e(t,Yr(t,_r.add))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return Er.kMaxType},n.sumValue=function(){var t=this.numericValues()[0].sumValue();if(!t.length)return null;for(var e,n=xr(this.numericValues());!(e=n()).done;){var r=e.value.sumValue();if(!r.length||JSON.stringify(r[0].units)!==JSON.stringify(t[0].units))return null;t[0].value>r[0].value&&(t=r)}return t},n.buildCSSText=function(t,e,n){n+="max(";for(var r,i=!0,o=xr(this.numericValues());!(r=o()).done;){i||(n+=", "),i=!1,n=r.value.buildCSSText(rr.kYes,ir.kYes,n)}return n+=")"},e}(Wr),Kr=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).operator="sum",e}dr(e,t),e.create=function(t){return new e(t,Yr(t,_r.add))},e.numericTypeFromUnitMap=function(t){var e=new _r;return Object.keys(t).forEach((function(n){var r=t[n];e=_r.multiply(e,new _r(Number(n),r),false),zn(!0)})),e},e.canCreateNumericTypeFromSumValue=function(t){var e=this;zn(!!t.length);var n=this.numericTypeFromUnitMap(t[0].units);return t.every((function(t){return _r.add(n,e.numericTypeFromUnitMap(t.units),false),!0}))};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return Er.kSumType},n.sumValue=function(){var t=[];return this.numericValues().forEach((function(e){var n=e.sumValue();if(!n.length)return null;n.forEach((function(e){var n=t.findIndex((function(t){return JSON.stringify(t.units)===JSON.stringify(e.units)}));-1===n?t.push(pr({},e)):t[n].value+=e.value}))})),e.canCreateNumericTypeFromSumValue(t)?t:null},n.buildCSSText=function(t,e,n){e==ir.kNo&&(n+=t===rr.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(rr.kYes,ir.kNo,n);for(var i=1;r.length>i;i++){var o=r[i];n=o.getType()===Er.kNegateType?o.value.buildCSSText(rr.kYes,ir.kNo,n+=" - "):o.buildCSSText(rr.kYes,ir.kNo,n+=" + ")}return e===ir.kNo&&(n+=")"),n},e}(Wr),Zr=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).operator="product",e}dr(e,t),e.create=function(t){return new e(t,Yr(t,_r.multiply))},e.multiplyUnitMaps=function(t,e){return Object.keys(e).forEach((function(n){jn(e[n].value,0);var r=n in t?t[n].value:0;r+e[n].value===0?delete t[n]:t[n]=r+e[n].value})),t};var n=e.prototype;return n.clone=function(){return new e(this.values,this.type_)},n.getType=function(){return Er.kProductType},n.sumValue=function(){var t=[{value:1,units:{}}];return this.numericValues().forEach((function(n){var r=n.sumValue();if(!r.length)return null;var i=[];t.forEach((function(t){r.forEach((function(n){i.push({value:t.value*n.value,units:e.multiplyUnitMaps(t.units,n.units)})}))})),t=i})),t},n.buildCSSText=function(t,e,n){e==ir.kNo&&(n+=t===rr.kYes?"(":"calc(");var r=this.numericValues();n=r[0].buildCSSText(rr.kYes,ir.kNo,n);for(var i=1;r.length>i;i++){var o=r[i];n=o.getType()===Er.kInvertType?o.value.buildCSSText(rr.kYes,ir.kNo,n+=" / "):o.buildCSSText(rr.kYes,ir.kNo,n+=" * ")}return e===ir.kNo&&(n+=")"),n},e}(Wr),Qr=new Vr(0,"px"),Jr=(new Vr(1,"px"),new Vr(0,"deg")),$r=function(t){function e(e,n,r,i,o){var a;return void 0===i&&(i=1),void 0===o&&(o=!1),(a=t.call(this,"rgb")||this).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=e,a.g=n,a.b=r,a.alpha=i,a.isNone=o,a}dr(e,t);var n=e.prototype;return n.clone=function(){return new e(this.r,this.g,this.b,this.alpha)},n.buildCSSText=function(t,e,n){return n+"rgba("+this.r+","+this.g+","+this.b+","+this.alpha+")"},e}(Sr),ti={number:function(t){return new Vr(t)},percent:function(t){return new Vr(t,"%")},px:function(t){return new Vr(t,"px")},em:function(t){return new Vr(t,"em")},rem:function(t){return new Vr(t,"rem")},deg:function(t){return new Vr(t,"deg")},grad:function(t){return new Vr(t,"grad")},rad:function(t){return new Vr(t,"rad")},turn:function(t){return new Vr(t,"turn")},s:function(t){return new Vr(t,"s")},ms:function(t){return new Vr(t,"ms")},registerProperty:function(t){iu.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){iu.layoutRegistry.registerLayout(t,e)}},ei=new Or("unset"),ni=new Or("initial"),ri=new Or("inherit"),ii={"":ei,unset:ei,initial:ni,inherit:ri},oi=function(t){return ii[t]||(ii[t]=new Or(t)),ii[t]},ai=new $r(0,0,0,0,!0),si=new $r(0,0,0,0),ui=Ce((function(t,e,n,r){return new $r(t,e,n,r)}),(function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"})),ci=Ce((function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new Vr(e,n)}),(function(e,n){return void 0===n&&(n=t.UnitType.kNumber),""+e+n})),li=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,hi=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,fi=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,pi=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var di={left:180,top:-90,bottom:90,right:0,"left top":225,"top left":225,"left bottom":135,"bottom left":135,"right top":-45,"top right":-45,"right bottom":45,"bottom right":45},vi=Ce((function(t){var e;return e="angular"===t.type?Number(t.value):di[t.value]||0,ci(e,"deg")})),mi=Ce((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var o=t.value,a=o.x,s=o.y;"position-keyword"===(null==a?void 0:a.type)&&("left"===a.value?e=0:"center"===a.value?e=50:"right"===a.value?e=100:"top"===a.value?n=0:"bottom"===a.value&&(n=100)),"position-keyword"===(null==s?void 0:s.type)&&("left"===s.value?e=0:"center"===s.value?n=50:"right"===s.value?e=100:"top"===s.value?n=0:"bottom"===s.value&&(n=100)),"px"!==(null==a?void 0:a.type)&&"%"!==(null==a?void 0:a.type)&&"em"!==(null==a?void 0:a.type)||(r=null==a?void 0:a.type,e=Number(a.value)),"px"!==(null==s?void 0:s.type)&&"%"!==(null==s?void 0:s.type)&&"em"!==(null==s?void 0:s.type)||(i=null==s?void 0:s.type,n=Number(s.value))}return{cx:ci(e,r),cy:ci(n,i)}})),yi=Ce((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Bo(e).map((function(e){var n=e.type,r=e.orientation,i=e.colorStops;!function(t){var e,n,r=t.length;t[r-1].length=null!==(e=t[r-1].length)&&void 0!==e?e:{type:"%",value:"100"},r>1&&(t[0].length=null!==(n=t[0].length)&&void 0!==n?n:{type:"%",value:"0"});for(var i=0,o=Number(t[0].length.value),a=1;r>a;a++){var s,u=null===(s=t[a].length)||void 0===s?void 0:s.value;if(!ge(u)&&!ge(o)){for(var c=1;a-i>c;c++)t[i+c].length={type:"%",value:""+(o+(Number(u)-o)*c/(a-i))};i=a,o=Number(u)}}}(i);var o=i.map((function(t){return{offset:ci(t.length.value,"%"),color:Uo(t)}}));if("linear-gradient"===n)return new Ar(t.GradientType.LinearGradient,{angle:r?vi(r):Jr,steps:o});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var a,s=mi(r[0].at),u=s.cx,c=s.cy;if(r[0].style){var l=r[0].style,h=l.type,f=l.value;a="extent-keyword"===h?oi(f):ci(f,h)}return new Ar(t.GradientType.RadialGradient,{cx:u,cy:c,size:a,steps:o})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=li.exec(e);if(r){var i,o=(null===(i=r[2].match(pi))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new Ar(t.GradientType.LinearGradient,{angle:ci(parseFloat(r[1]),"deg"),steps:o.map((function(t){var e=t[1];return{offset:ci(100*Number(t[0]),"%"),color:e}}))})]}}else if("r"===n){var a=function(t){var e=hi.exec(t);if(e){var n,r=(null===(n=e[4].match(pi))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:ci(50,"%"),cy:ci(50,"%"),steps:r.map((function(t){var e=t[1];return{offset:ci(100*Number(t[0]),"%"),color:e}}))}}return null}(e);if(a){if(!we(a))return[new Ar(t.GradientType.RadialGradient,a)];e=a}}else if("p"===n)return function(t){var e=fi.exec(t);if(e){var n=e[1],r=e[2];switch(n){case"a":n="repeat";break;case"x":n="repeat-x";break;case"y":n="repeat-y";break;default:n="no-repeat"}return{image:r,repetition:n}}return null}(e)}));function gi(t){return Ee(t)&&!!t.image}var xi=Ce((function(t){if(gi(t))return pr({repetition:"repeat"},t);if(ge(t)&&(t=""),"transparent"===t)return si;"currentColor"===t&&(t="black");var e=yi(t);if(e)return e;var n=qe(t),r=[0,0,0,0];return null!==n&&(r[0]=n.r||0,r[1]=n.g||0,r[2]=n.b||0,r[3]=n.opacity),ui.apply(void 0,r)}));function Ei(t,e){if(t instanceof $r&&e instanceof $r)return[[Number(t.r),Number(t.g),Number(t.b),Number(t.alpha)],[Number(e.r),Number(e.g),Number(e.b),Number(e.alpha)],function(t){var e=t.slice();if(e[3])for(var n=0;3>n;n++)e[n]=Math.round(ke(e[n],0,255));return e[3]=ke(e[3],0,1),"rgba("+e.join(",")+")"}]}function Ti(t,e){if(ge(e))return ci(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return ci(Number(e),"px");if("deg".search(t)>=0)return ci(Number(e),"deg")}var n=[];e=e.replace(t,(function(t){return n.push(t),"U"+t}));var r="U("+t.source+")";return n.map((function(t){return ci(Number(e.replace(new RegExp("U"+t,"g"),"").replace(new RegExp(r,"g"),"*0")),t)}))[0]}var bi=Ce((function(t){return Ti(new RegExp("px","g"),t)})),wi=(Ce((function(t){return Ti(new RegExp("%","g"),t)})),Ce((function(t){return Me(t)||isFinite(Number(t))?ci(Number(t),"px"):Ti(new RegExp("px|%|em|rem","g"),t)}))),ki=Ce((function(t){return Ti(new RegExp("deg|rad|grad|turn","g"),t)}));function Mi(t,e,n,r,i){void 0===i&&(i=0);var o="",a=t.value||0,s=e.value||0,u=Br(t.unit),c=t.convertTo(u),l=e.convertTo(u);return c&&l?(a=c.value,s=l.value,o=Mr(t.unit)):(Vr.isLength(t.unit)||Vr.isLength(e.unit))&&(a=Ni(t,i,n),s=Ni(e,i,n),o="px"),[a,s,function(t){return r&&(t=Math.max(t,0)),t+o}]}function Pi(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=No(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=Co(Number(e.value))),n}function Si(t){return we(t)?t.split(" ").map((function(t){return wi(t)})):t.map((function(t){return wi(t.toString())}))}function Ni(e,n,r){if(e.unit===t.UnitType.kPixels)return Number(e.value);if(e.unit===t.UnitType.kPercentage&&r){var i=r.nodeName===t.Shape.GROUP?r.getLocalBounds():r.getGeometryBounds(),o=0;return Dn.isEmpty(i)||(o=2*i.halfExtents[n]),Number(e.value)/100*o}return 0}var Ci=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ai(t){if(void 0===t&&(t=""),"none"===(t=t.toLowerCase().trim()))return[];for(var e,n=/\s*([\w-]+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];if(i=e.index+e[0].length,Ci.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Ti(/deg|rad|grad|turn|px|%/g,t)||xi(t)}))}),n.lastIndex===t.length)return r}return[]}function Oi(t){return t.toString()}var _i=Ce((function(t){return"number"==typeof t?ci(t):/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?ci(Number(t)):ci(0)}));Ce((function(t){return we(t)?t.split(" ").map(_i):t.map(_i)}));function Li(t,e){return[t,e,Oi]}function Ri(t,e){return function(n,r){return[n,r,function(n){return Oi(ke(n,t,e))}]}}function Ii(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var Di=function(t){if(""===t||Array.isArray(t)&&0===t.length)return{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:{x:0,y:0,width:0,height:0}};var e;try{e=Zt(t)}catch(n){e=Zt(""),console.error("[g]: Invalid SVG Path definition: "+t)}var n=function(t){for(var e=!1,n=t.length,r=0;n>r;r++){var i=t[r][0];if("C"===i||"A"===i||"Q"===i){e=!0;break}}return e}(e),r=function(t){for(var e=[],n=[],r=[],i=0;t.length>i;i++){var o=t[i],a=o[0];"M"===a?(r.length&&(n.push(r),r=[]),r.push([o[1],o[2]])):"Z"===a?r.length&&(e.push(r),r=[]):r.push([o[1],o[2]])}r.length>0&&n.push(r);return{polygons:e,polylines:n}}(e),i=r.polygons,o=r.polylines,a=function(t){for(var e=[],n=null,r=null,i=null,o=0,a=t.length,s=0;a>s;s++){var u=t[s];r=t[s+1];var c=u[0],l={command:c,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null};switch(c){case"M":i=[u[1],u[2]],o=s;break;case"A":var h=Qo(n,u);l.arcParams=h}if("Z"===c)n=i,r=t[o+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[o],e[o]&&(e[o].prePoint=n)),l.currentPoint=n,e[o]&&Ho(n,e[o].currentPoint)&&(e[o].prePoint=l.prePoint),l.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var p=l.prePoint;if(["L","H","V"].includes(c))l.startTangent=[p[0]-n[0],p[1]-n[1]],l.endTangent=[n[0]-p[0],n[1]-p[1]];else if("Q"===c){var d=[u[1],u[2]];l.startTangent=[p[0]-d[0],p[1]-d[1]],l.endTangent=[n[0]-d[0],n[1]-d[1]]}else if("T"===c){var v=e[s-1],m=jo(v.currentPoint,p);"Q"===v.command?(l.command="Q",l.startTangent=[p[0]-m[0],p[1]-m[1]],l.endTangent=[n[0]-m[0],n[1]-m[1]]):(l.command="TL",l.startTangent=[p[0]-n[0],p[1]-n[1]],l.endTangent=[n[0]-p[0],n[1]-p[1]])}else if("C"===c){var y=[u[1],u[2]],g=[u[3],u[4]];l.startTangent=[p[0]-y[0],p[1]-y[1]],l.endTangent=[n[0]-g[0],n[1]-g[1]],0===l.startTangent[0]&&0===l.startTangent[1]&&(l.startTangent=[y[0]-g[0],y[1]-g[1]]),0===l.endTangent[0]&&0===l.endTangent[1]&&(l.endTangent=[g[0]-y[0],g[1]-y[1]])}else if("S"===c){var x=e[s-1],E=jo(x.currentPoint,p),T=[u[1],u[2]];"C"===x.command?(l.command="C",l.startTangent=[p[0]-E[0],p[1]-E[1]],l.endTangent=[n[0]-T[0],n[1]-T[1]]):(l.command="SQ",l.startTangent=[p[0]-T[0],p[1]-T[1]],l.endTangent=[n[0]-T[0],n[1]-T[1]])}else if("A"===c){var b=Xo(l,0),w=b.x,k=b.y,M=Xo(l,1,!1),P=M.x,S=M.y;l.startTangent=[w,k],l.endTangent=[P,S]}e.push(l)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],o=0;t.length>o;o++){var a=t[o],s=a.currentPoint,u=a.params,c=a.prePoint,l=void 0;switch(a.command){case"Q":l=pn(c[0],c[1],u[1],u[2],u[3],u[4]);break;case"C":l=mn(c[0],c[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=a.arcParams;l=xn(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}l&&(a.box=l,n.push(l.x,l.x+l.width),r.push(l.y,l.y+l.height)),e&&("L"===a.command||"M"===a.command)&&a.prePoint&&a.nextPoint&&i.push(a)}n=n.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0})),r=r.filter((function(t){return!Number.isNaN(t)&&t!==1/0&&t!==-1/0}));var f=be(n),p=be(r),d=Te(n),v=Te(r);if(0===i.length)return{x:f,y:p,width:d-f,height:v-p};for(var m=0;i.length>m;m++){var y=i[m],g=y.currentPoint;g[0]===f?f-=zo(y,e).xExtra:g[0]===d&&(d+=zo(y,e).xExtra),g[1]===p?p-=zo(y,e).yExtra:g[1]===v&&(v+=zo(y,e).yExtra)}return{x:f,y:p,width:d-f,height:v-p}}(a,0),u=s.x,c=s.y,l=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:a,polygons:i,polylines:o,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(c)?c:0,width:Number.isFinite(l)?l:0,height:Number.isFinite(h)?h:0}}},Fi=Ce(Di);function Gi(t,e){var n=we(t)?Fi(t):Di(t);return e&&(e.parsedStyle.defX=n.rect.x,e.parsedStyle.defY=n.rect.y),n}function Ui(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=ie(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=ie(e.absolutePath,!1),e.curve=i);var o=[r,i];r.length!==i.length&&(o=ve(r,i));var a,s,u,c,l,h,f,p,d=pe(o[0])!==pe(o[1])?(s=(a=o[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):a[0].slice(1).concat(t.slice(1))})).map((function(t){return t.map((function(e,n){return t[t.length-n-2*(1-n%2)]}))})).reverse(),[["M"].concat(s[0].slice(0,2))].concat(s.map((function(t){return["C"].concat(t.slice(2))})))):_t(o[0]);return[d,(u=o[1],c=d,l=u.length-1,h=[],f=0,p=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,o){var a=i+o;return 0===o||t[a]&&"M"===t[a][0]?["M"].concat(t[a].slice(-2)):(e>a||(a-=n),t[a])}))}))}(u),p.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=te(u[(e+n)%l].slice(-2),c[n%l].slice(-2))})),h[e]=f,f=0})),p[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Bi(t,e){var n;n=we(t)?t.split(" ").map((function(t){var e=t.split(","),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,o=[],a=0,s=En(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=a/s,i=ln.length(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(a+=i)/s,o.push(r))}));var u=Math.min.apply(Math,n.map((function(t){return t[0]}))),c=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=c),{points:n,totalLength:s,segments:o}}var Vi=null;function Hi(t){return function(e){var n=0;return t.map((function(t){return t===Vi?e[n++]:t}))}}function zi(t){return t}var ji={matrix:["NNNNNN",[Vi,Vi,0,0,Vi,Vi,0,0,0,0,1,0,Vi,Vi,0,1],zi],matrix3d:["NNNNNNNNNNNNNNNN",zi],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",Hi([Vi,Vi,new Vr(1)]),zi],scalex:["N",Hi([Vi,new Vr(1),new Vr(1)]),Hi([Vi,new Vr(1)])],scaley:["N",Hi([new Vr(1),Vi,new Vr(1)]),Hi([new Vr(1),Vi])],scalez:["N",Hi([new Vr(1),new Vr(1),Vi])],scale3d:["NNN",zi],skew:["Aa",null,zi],skewx:["A",null,Hi([Vi,Jr])],skewy:["A",null,Hi([Jr,Vi])],translate:["Tt",Hi([Vi,Vi,Qr]),zi],translatex:["T",Hi([Vi,Qr,Qr]),Hi([Vi,Qr])],translatey:["T",Hi([Qr,Vi,Qr]),Hi([Qr,Vi])],translatez:["L",Hi([Qr,Qr,Vi])],translate3d:["TTL",zi]};function Yi(t){if("none"===(t=(t||"none").toLowerCase().trim()))return[];for(var e,n=/\s*(\w+)\(([^)]*)\)/g,r=[],i=0;e=n.exec(t);){if(e.index!==i)return[];i=e.index+e[0].length;var o=e[1],a=ji[o];if(!a)return[];var s=e[2].split(","),u=a[0];if(s.length>u.length)return[];for(var c=[],l=0;u.length>l;l++){var h=s[l],f=u[l],p=void 0;if(void 0===(p=h?{A:function(t){return"0"===t.trim()?Jr:ki(t)},N:_i,T:wi,L:bi}[f.toUpperCase()](h):{a:Jr,n:c[0],t:Qr}[f]))return[];c.push(p)}if(r.push({t:o,d:c}),n.lastIndex===t.length)return r}return[]}function Wi(t){var e,n,r,i;switch(t.t){case"rotatex":return i=So(Pi(t.d[0])),[1,0,0,0,0,Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1];case"rotatey":return i=So(Pi(t.d[0])),[Math.cos(i),0,-Math.sin(i),0,0,1,0,0,Math.sin(i),0,Math.cos(i),0,0,0,0,1];case"rotate":case"rotatez":return i=So(Pi(t.d[0])),[Math.cos(i),Math.sin(i),0,0,-Math.sin(i),Math.cos(i),0,0,0,0,1,0,0,0,0,1];case"rotate3d":e=t.d[0].value,n=t.d[1].value,r=t.d[2].value,i=So(Pi(t.d[3]));var o=e*e+n*n+r*r;if(0===o)e=1,n=0,r=0;else if(1!==o){var a=Math.sqrt(o);e/=a,n/=a,r/=a}var s=Math.sin(i/2),u=s*Math.cos(i/2),c=s*s;return[1-2*(n*n+r*r)*c,2*(e*n*c+r*u),2*(e*r*c-n*u),0,2*(e*n*c-r*u),1-2*(e*e+r*r)*c,2*(n*r*c+e*u),0,2*(e*r*c+n*u),2*(n*r*c-e*u),1-2*(e*e+n*n)*c,0,0,0,0,1];case"scale":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,1,0,0,0,0,1];case"scalex":return[t.d[0].value,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"scaley":return[1,0,0,0,0,t.d[0].value,0,0,0,0,1,0,0,0,0,1];case"scalez":return[1,0,0,0,0,1,0,0,0,0,t.d[0].value,0,0,0,0,1];case"scale3d":return[t.d[0].value,0,0,0,0,t.d[1].value,0,0,0,0,t.d[2].value,0,0,0,0,1];case"skew":var l=So(Pi(t.d[0])),h=So(Pi(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(l),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=So(Pi(t.d[0])),[1,0,0,0,Math.tan(i),1,0,0,0,0,1,0,0,0,0,1];case"skewy":return i=So(Pi(t.d[0])),[1,Math.tan(i),0,0,0,1,0,0,0,0,1,0,0,0,0,1];case"translate":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Ni(t.d[0],0,null)||0,n=Ni(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Ni(t.d[0],0,null)||0,0,0,1];case"translatey":return[1,0,0,0,0,1,0,0,0,0,1,0,0,n=Ni(t.d[0],0,null)||0,0,1];case"translatez":return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,r=Ni(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Ni(t.d[0],0,null)||0,n=Ni(t.d[1],0,null)||0,r=Ni(t.d[2],0,null)||0,1];case"perspective":var f=Ni(t.d[0],0,null)||0;return[1,0,0,0,0,1,0,0,0,0,1,f?-1/f:0,0,0,0,1];case"matrix":return[t.d[0].value,t.d[1].value,0,0,t.d[2].value,t.d[3].value,0,0,0,0,1,0,t.d[4].value,t.d[5].value,0,1];case"matrix3d":return t.d.map((function(t){return t.value}))}}function Xi(t,e){return[t[0]*e[0]+t[4]*e[1]+t[8]*e[2]+t[12]*e[3],t[1]*e[0]+t[5]*e[1]+t[9]*e[2]+t[13]*e[3],t[2]*e[0]+t[6]*e[1]+t[10]*e[2]+t[14]*e[3],t[3]*e[0]+t[7]*e[1]+t[11]*e[2]+t[15]*e[3],t[0]*e[4]+t[4]*e[5]+t[8]*e[6]+t[12]*e[7],t[1]*e[4]+t[5]*e[5]+t[9]*e[6]+t[13]*e[7],t[2]*e[4]+t[6]*e[5]+t[10]*e[6]+t[14]*e[7],t[3]*e[4]+t[7]*e[5]+t[11]*e[6]+t[15]*e[7],t[0]*e[8]+t[4]*e[9]+t[8]*e[10]+t[12]*e[11],t[1]*e[8]+t[5]*e[9]+t[9]*e[10]+t[13]*e[11],t[2]*e[8]+t[6]*e[9]+t[10]*e[10]+t[14]*e[11],t[3]*e[8]+t[7]*e[9]+t[11]*e[10]+t[15]*e[11],t[0]*e[12]+t[4]*e[13]+t[8]*e[14]+t[12]*e[15],t[1]*e[12]+t[5]*e[13]+t[9]*e[14]+t[13]*e[15],t[2]*e[12]+t[6]*e[13]+t[10]*e[14]+t[14]*e[15],t[3]*e[12]+t[7]*e[13]+t[11]*e[14]+t[15]*e[15]]}function qi(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],o=[0,0,0,1];return function(t,e,n,r,i,o){if(!function(t,e){var n=e[15];if(0===n)return!1;for(var r=1/n,i=0;16>i;i++)t[i]=e[i]*r;return!0}(Lo,t))return!1;if(k(Ro,Lo),Ro[3]=0,Ro[7]=0,Ro[11]=0,Ro[15]=1,1e-8>Math.abs(C(Ro)))return!1;var a=Lo[3],s=Lo[7],u=Lo[11],c=Lo[12],l=Lo[13],h=Lo[14],f=Lo[15];if(0!==a||0!==s||0!==u){if(Io[0]=a,Io[1]=s,Io[2]=u,Io[3]=f,!N(Ro,Ro))return!1;S(Ro,Ro),dt(i,Io,Ro)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=c,e[1]=l,e[2]=h,function(t,e){t[0][0]=e[0],t[0][1]=e[1],t[0][2]=e[2],t[1][0]=e[4],t[1][1]=e[5],t[1][2]=e[6],t[2][0]=e[8],t[2][1]=e[9],t[2][2]=e[10]}(Do,Lo),n[0]=Z(Do[0]),rt(Do[0],Do[0]),r[0]=it(Do[0],Do[1]),Go(Do[1],Do[1],Do[0],1,-r[0]),n[1]=Z(Do[1]),rt(Do[1],Do[1]),r[0]/=n[1],r[1]=it(Do[0],Do[2]),Go(Do[2],Do[2],Do[0],1,-r[1]),r[2]=it(Do[1],Do[2]),Go(Do[2],Do[2],Do[1],1,-r[2]),n[2]=Z(Do[2]),rt(Do[2],Do[2]),r[1]/=n[2],r[2]/=n[2],ot(Fo,Do[1],Do[2]),0>it(Do[0],Fo))for(var p=0;3>p;p++)n[p]*=-1,Do[p][0]*=-1,Do[p][1]*=-1,Do[p][2]*=-1;o[0]=.5*Math.sqrt(Math.max(1+Do[0][0]-Do[1][1]-Do[2][2],0)),o[1]=.5*Math.sqrt(Math.max(1-Do[0][0]+Do[1][1]-Do[2][2],0)),o[2]=.5*Math.sqrt(Math.max(1-Do[0][0]-Do[1][1]+Do[2][2],0)),o[3]=.5*Math.sqrt(Math.max(1+Do[0][0]+Do[1][1]+Do[2][2],0)),Do[2][1]>Do[1][2]&&(o[0]=-o[0]);Do[0][2]>Do[2][0]&&(o[1]=-o[1]);Do[1][0]>Do[0][1]&&(o[2]=-o[2])}(function(t){return 0===t.length?[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]:t.map(Wi).reduce(Xi)}(t),e,n,r,i,o),[[e,n,r,o,i]]}var Ki=function(){function t(t,e){for(var n=[[0,0,0,0],[0,0,0,0],[0,0,0,0],[0,0,0,0]],r=0;4>r;r++)for(var i=0;4>i;i++)for(var o=0;4>o;o++)n[r][i]+=e[r][o]*t[o][i];return n}return function(e,n,r,i,o){for(var a=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)a[s][3]=o[s];for(var u=0;3>u;u++)for(var c=0;3>c;c++)a[3][u]+=e[c]*a[c][u];var l=i[0],h=i[1],f=i[2],p=i[3],d=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];d[0][0]=1-2*(h*h+f*f),d[0][1]=2*(l*h-f*p),d[0][2]=2*(l*f+h*p),d[1][0]=2*(l*h+f*p),d[1][1]=1-2*(l*l+f*f),d[1][2]=2*(h*f-l*p),d[2][0]=2*(l*f-h*p),d[2][1]=2*(h*f+l*p),d[2][2]=1-2*(l*l+h*h),a=t(a,d);var v,m=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(m[2][1]=r[2],a=t(a,m)),r[1]&&(m[2][1]=0,m[2][0]=r[0],a=t(a,m)),r[0]&&(m[2][0]=0,m[1][0]=r[0],a=t(a,m));for(var y=0;3>y;y++)for(var g=0;3>g;g++)a[y][g]*=n[y];return 0==(v=a)[0][2]&&0==v[0][3]&&0==v[1][2]&&0==v[1][3]&&0==v[2][0]&&0==v[2][1]&&1==v[2][2]&&0==v[2][3]&&0==v[3][2]&&1==v[3][3]?[a[0][0],a[0][1],a[1][0],a[1][1],a[3][0],a[3][1]]:a[0].concat(a[1],a[2],a[3])}}();function Zi(t){return t.toFixed(6).replace(".000000","")}function Qi(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=qi(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=qi(e)),null===n[0]||null===r[0]?[[!1],[!0],function(n){return n?e[0].d:t[0].d}]:(n[0].push(0),r[0].push(1),[n,r,function(t){var e=function(t,e,n){var r=function(t,e){for(var n=0,r=0;t.length>r;r++)n+=t[r]*e[r];return n}(t,e);r=ke(r,-1,1);var i=[];if(1===r)i=t;else for(var o=Math.acos(r),a=1*Math.sin(n*o)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*o)-r*a)+e[s]*a);return i}(n[0][3],r[0][3],t[5]);return Ki(t[0],t[1],t[2],e,t[4]).map(Zi).join(",")}])}function Ji(t){return t.replace(/[xy]/,"")}function $i(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function to(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(n){var r=t[n],i=r.t,o=r.d,a="scale"===i.substring(0,5)?1:0;e.push({t:i,d:o.map((function(t){return"number"==typeof t?ci(a):ci(a,t.unit)}))})},o=0;t.length>o;o++)i(o)}var a,s,u=[],c=[],l=[];if(t.length!==e.length){var h=Qi(t,e);u=[h[0]],c=[h[1]],l=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var p=t[f].t,d=e[f].t,v=t[f].d,m=e[f].d,y=ji[p],g=ji[d],x=void 0;if(s=d,"perspective"===(a=p)&&"perspective"===s||!("matrix"!==a&&"matrix3d"!==a||"matrix"!==s&&"matrix3d"!==s)){var E=Qi([t[f]],[e[f]]);u.push(E[0]),c.push(E[1]),l.push(["matrix",[E[2]]])}else{if(p===d)x=p;else if(y[2]&&g[2]&&Ji(p)===Ji(d))x=Ji(p),v=y[2](v),m=g[2](m);else{if(!y[1]||!g[1]||$i(p)!==$i(d)){var T=Qi(t,e);u=[T[0]],c=[T[1]],l=[["matrix",[T[2]]]];break}x=$i(p),v=y[1](v),m=g[1](m)}for(var b=[],w=[],k=[],M=0;v.length>M;M++){var P=Mi(v[M],m[M],n,!1,M);b[M]=P[0],w[M]=P[1],k.push(P[2])}u.push(b),c.push(w),l.push([x,k])}}if(r){var S=u;u=c,c=S}return[u,c,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return l[e][1][n](t)})).join(",");return"matrix"===l[e][0]&&16===n.split(",").length&&(l[e][0]="matrix3d"),"matrix3d"===l[e][0]&&6===n.split(",").length&&(l[e][0]="matrix"),l[e][0]+"("+n+")"})).join(" ")}]}var eo=Ce((function(t){if(we(t)){if("text-anchor"===t)return[ci(0,"px"),ci(0,"px")];var e=t.split(" ");return 1===e.length&&("top"===e[0]||"bottom"===e[0]?(e[1]=e[0],e[0]="center"):e[1]="center"),2!==e.length?null:[wi(no(e[0])),wi(no(e[1]))]}return[ci(t[0]||0,"px"),ci(t[1]||0,"px")]}));function no(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var ro=function(){function t(){this.parser=ki,this.mixer=Li}return t.prototype.calculator=function(t,e,n,r){return Pi(n)},t}(),io=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof Or&&(n=null),iu.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&iu.sceneGraphService.dirtifyToRoot(t)})),n},t}(),oo=function(){function t(){this.parser=xi,this.mixer=Ei}return t.prototype.calculator=function(t,e,n,r){return n instanceof Or?"none"===n.value?ai:si:n},t}(),ao=function(){function t(){this.parser=Ai}return t.prototype.calculator=function(t,e,n){return n instanceof Or?[]:n},t}();function so(t){var e=t.parsedStyle.fontSize;return ge(e)?null:e}var uo=function(){function e(){this.parser=wi,this.mixer=Li}return e.prototype.calculator=function(e,n,r,i,o){if(!Vr.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){var a=so(i.parentNode);if(a)return a*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}if(r.unit===t.UnitType.kRems){var s;if(null==i||null===(s=i.ownerDocument)||void 0===s?void 0:s.documentElement){var u=so(i.ownerDocument.documentElement);if(u)return u*=r.value;o.addUnresolveProperty(i,e)}else o.addUnresolveProperty(i,e);return 0}},e}(),co=function(){function t(){this.mixer=Ii}var e=t.prototype;return e.parser=function(t){var e=Si(Me(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),lo=function(){function t(){this.mixer=Ii}var e=t.prototype;return e.parser=function(t){var e=Si(Me(t)?[t]:t);return 1===e.length?[e[0],e[0],e[0],e[0]]:2===e.length?[e[0],e[1],e[0],e[1]]:3===e.length?[e[0],e[1],e[2],e[1]]:[e[0],e[1],e[2],e[3]]},e.calculator=function(t,e,n){return n.map((function(t){return t.value}))},t}(),ho=function(e){function n(){return e.apply(this,arguments)||this}return dr(n,e),n.prototype.postProcessor=function(e){var n,r,i;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var o=e.parsedStyle,a=o.cx,s=o.cy;ge(a)||(n=a),ge(s)||(r=s);break;case t.Shape.LINE:var u=e.parsedStyle,c=u.y1,l=u.y2;n=Math.min(u.x1,u.x2),r=Math.min(c,l),i=0;break;case t.Shape.RECT:case t.Shape.IMAGE:case t.Shape.GROUP:case t.Shape.HTML:case t.Shape.TEXT:case t.Shape.MESH:ge(e.parsedStyle.x)||(n=e.parsedStyle.x),ge(e.parsedStyle.y)||(r=e.parsedStyle.y)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=n||0,e.parsedStyle.defY=r||0),!ge(n)||!ge(r)||!ge(i)){var h=e.getLocalPosition(),f=h[0],p=h[1],d=h[2];e.setLocalPosition(ge(n)?f:n,ge(r)?p:r,ge(i)?d:i)}},n}(uo),fo=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i;n instanceof Or&&(n=null);var o=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return o&&(o.style.isMarker=!0),o},t}(),po=function(){function t(){this.mixer=Li,this.parser=_i}return t.prototype.calculator=function(t,e,n){return n.value},t}(),vo=function(){function e(){this.parser=_i,this.mixer=Ri(0,1)}var n=e.prototype;return n.calculator=function(t,e,n){return n.value},n.postProcessor=function(e){var n=e.parsedStyle,r=n.offsetPath;if(r){var i=r.nodeName;if(i===t.Shape.LINE||i===t.Shape.PATH||i===t.Shape.POLYLINE){var o=r.getPoint(n.offsetDistance);o&&(e.parsedStyle.defX=o.x,e.parsedStyle.defY=o.y,e.setLocalPosition(o.x,o.y))}}},e}(),mo=function(){function t(){this.parser=_i,this.mixer=Ri(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),yo=function(){function e(){this.parser=Gi,this.mixer=Ui}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof Or&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Vn(0,0,0,0)}:n},n.postProcessor=function(e){if(e.nodeName===t.Shape.PATH){var n=e.parsedStyle,r=n.defX,i=n.defY;e.setLocalPosition(void 0===r?0:r,void 0===i?0:i)}},e}(),go=function(){function e(){this.parser=Bi}return e.prototype.postProcessor=function(e){if(e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE){var n=e.parsedStyle;e.setLocalPosition(n.defX,n.defY)}},e}(),xo=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).mixer=Ri(0,1/0),e}return dr(e,t),e}(uo),Eo=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Or?"unset"===n.value?"":n.value:n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),To=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var o=i;"capitalize"===n.value?o=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?o=i.toLowerCase():"uppercase"===n.value&&(o=i.toUpperCase()),r.parsedStyle.text=o}return n.value},t}(),bo=function(){function t(){this.tmpMat4=b(),this.parser=Yi,this.mixer=to}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof Or?[]:n},e.postProcessor=function(t){var e=this,n=t.parsedStyle,r=n.transform,i=n.defX,o=n.defY;r&&r.length&&(t.resetLocalTransform(),t.setLocalPosition(i,o),r.forEach((function(n){var r=n.t,a=n.d;if("scale"===r){var s=(null==a?void 0:a.map((function(t){return t.value})))||[1,1];t.scaleLocal(s[0],s[1],1)}else if("scalex"===r){var u=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(u[0],1,1)}else if("scaley"===r){var c=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(1,c[0],1)}else if("scalez"===r){var l=(null==a?void 0:a.map((function(t){return t.value})))||[1];t.scaleLocal(1,1,l[0])}else if("scale3d"===r){var h=(null==a?void 0:a.map((function(t){return t.value})))||[1,1,1];t.scaleLocal(h[0],h[1],h[2])}else if("translate"===r){var f=a||[Qr,Qr];t.translateLocal(f[0].value,f[1].value,0)}else if("translatex"===r){t.translateLocal((a||[Qr])[0].value,0,0)}else if("translatey"===r){t.translateLocal(0,(a||[Qr])[0].value,0)}else if("translatez"===r){t.translateLocal(0,0,(a||[Qr])[0].value)}else if("translate3d"===r){var p=a||[Qr,Qr,Qr];t.translateLocal(p[0].value,p[1].value,p[2].value)}else if("rotate"===r){t.rotateLocal(0,0,(a||[Jr])[0].value)}else if("rotatex"===r){t.rotateLocal((a||[Jr])[0].value,0,0)}else if("rotatey"===r){t.rotateLocal(0,(a||[Jr])[0].value,0)}else if("rotatez"===r){t.rotateLocal(0,0,(a||[Jr])[0].value)}else if("rotate3d"===r);else if("skew"===r){var d=(null==a?void 0:a.map((function(t){return t.value})))||[0,0];t.setLocalSkew(So(d[0]),So(d[1]))}else if("skewx"===r){var v=(null==a?void 0:a.map((function(t){return t.value})))||[0];t.setLocalSkew(So(v[0]),t.getLocalSkew()[1])}else if("skewy"===r){var m=(null==a?void 0:a.map((function(t){return t.value})))||[0];t.setLocalSkew(t.getLocalSkew()[0],So(m[0]))}else if("matrix"===r){var y=a.map((function(t){return t.value}));t.setLocalTransform(M(e.tmpMat4,y[0],y[1],0,0,y[2],y[3],0,0,0,0,1,0,y[4]+i,y[5]+o,0,1))}else"matrix3d"===r&&(M.apply(X,[e.tmpMat4].concat(a.map((function(t){return t.value})))),e.tmpMat4[12]+=i,e.tmpMat4[13]+=o,t.setLocalTransform(e.tmpMat4))})))},t}(),wo=function(){this.parser=eo},ko=function(){function t(){this.parser=_i}var e=t.prototype;return e.calculator=function(t,e,n,r){return n.value},e.postProcessor=function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0)}},t}();function Mo(t){return void 0===t?0:t>360||-360>t?t%360:t}function Po(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Me(t)?Q(t,e,n):Array.isArray(t)&&3===t.length?K(t):Q(t[0],t[1]||e,t[2]||n)}function So(t){return t*(Math.PI/180)}function No(t){return t*(180/Math.PI)}function Co(t){return 360*t}function Ao(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,o=G(q(),e),a=o[0],s=o[1],u=o[2],c=Math.asin(-e[2]/a);return i>c?c>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/a,e[0]/a)):(r=0,n=-Math.atan2(e[4]/s,e[5]/s)):(r=0,n=Math.atan2(e[4]/s,e[5]/s)),t[0]=n,t[1]=c,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],o=e[3],a=r*r,s=i*i,u=o*o,c=n*n+a+s+u,l=n*o-r*i;return l>.499995*c?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*c>l?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-o*r)),t[1]=Math.atan2(2*(n*o+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*o),1-2*(a+s))),t}(t,e)}function Oo(t,e,n,r,i){var o,a,s,u,c,l,h,f,p,d,v=Math.cos(t),m=Math.sin(t);return o=r*v,a=i*m,s=0,u=-r*m,c=i*v,l=0,h=e,f=n,p=1,(d=new E(9))[0]=o,d[1]=a,d[2]=s,d[3]=u,d[4]=c,d[5]=l,d[6]=h,d[7]=f,d[8]=p,d}function _o(t){var e=t[0],n=t[1],r=t[3],i=t[4],o=Math.sqrt(e*e+n*n),a=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?o=-o:a=-a),o&&(e*=1/o,n*=1/o),a&&(r*=1/a,i*=1/a);var s=No(Math.atan2(n,e));return[t[6],t[7],o,a,s]}var Lo=b(),Ro=b(),Io=pt(),Do=[q(),q(),q()],Fo=q();function Go(t,e,n,r,i){t[0]=e[0]*r+n[0]*i,t[1]=e[1]*r+n[1]*i,t[2]=e[2]*r+n[2]*i}function Uo(t){var e=t.type,n=t.value;return"hex"===e?"#"+n:"literal"===e?n:"rgb"===e?"rgb("+n.join(",")+")":"rgba("+n.join(",")+")"}var Bo=function(){var t=/^(linear\-gradient)/i,e=/^(repeating\-linear\-gradient)/i,n=/^(radial\-gradient)/i,r=/^(repeating\-radial\-gradient)/i,i=/^(conic\-gradient)/i,o=/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,a=/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,s=/^(left|center|right|top|bottom)/i,u=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,c=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,l=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,h=/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,f=/^\(/,p=/^\)/,d=/^,/,v=/^\#([0-9a-fA-F]+)/,m=/^([a-zA-Z]+)/,y=/^rgb/i,g=/^rgba/i,x=/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/,E="";function T(t){throw new Error(E+": "+t)}function b(){var t=_(w);return E.length>0&&T("Invalid input not EOF"),t}function w(){return k("linear-gradient",t,P)||k("repeating-linear-gradient",e,P)||k("radial-gradient",n,S)||k("repeating-radial-gradient",r,S)||k("conic-gradient",i,S)}function k(t,e,n){return M(e,(function(e){var r=n();return r&&(G(d)||T("Missing comma before color stops")),{type:t,orientation:r,colorStops:_(L)}}))}function M(t,e){var n=G(t);if(n){G(f)||T("Missing (");var r=e(n);return G(p)||T("Missing )"),r}}function P(){return F("directional",o,1)||F("angular",h,1)}function S(){var t,e,n=N();return n&&((t=[]).push(n),e=E,G(d)&&((n=N())?t.push(n):E=e)),t}function N(){var t=function(){var t=F("shape",/^(circle)/i,0);t&&(t.style=D()||C());return t}()||function(){var t=F("shape",/^(ellipse)/i,0);t&&(t.style=I()||C());return t}();if(t)t.at=A();else{var e=C();if(e){t=e;var n=A();n&&(t.at=n)}else{var r=O();r&&(t={type:"default-radial",at:r})}}return t}function C(){return F("extent-keyword",a,1)}function A(){if(F("position",/^at/,0)){var t=O();return t||T("Missing positioning value"),t}}function O(){var t={x:I(),y:I()};if(t.x||t.y)return{type:"position",value:t}}function _(t){var e=t(),n=[];if(e)for(n.push(e);G(d);)(e=t())?n.push(e):T("One extra comma");return n}function L(){var t=F("hex",v,1)||M(g,(function(){return{type:"rgba",value:_(R)}}))||M(y,(function(){return{type:"rgb",value:_(R)}}))||F("literal",m,0);return t||T("Expected color definition"),t.length=I(),t}function R(){return G(x)[1]}function I(){return F("%",c,1)||F("position-keyword",s,1)||D()}function D(){return F("px",u,1)||F("em",l,1)}function F(t,e,n){var r=G(e);if(r)return{type:t,value:r[n]}}function G(t){var e=/^[\n\r\t\s]+/.exec(E);e&&U(e[0].length);var n=t.exec(E);return n&&U(n[0].length),n}function U(t){E=E.substring(t)}return function(t){return E=t,b()}}();function Vo(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=fe(t.parsedStyle.path.absolutePath,void 0,Lt(Lt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Ho(t,e){return t[0]===e[0]&&t[1]===e[1]}function zo(t,e){var n,r=t.prePoint,i=t.currentPoint,o=t.nextPoint,a=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.pow(i[0]-o[0],2)+Math.pow(i[1]-o[1],2),u=Math.pow(r[0]-o[0],2)+Math.pow(r[1]-o[1],2),c=Math.acos((a+s-u)/(2*Math.sqrt(a)*Math.sqrt(s)));if(!c||0===Math.sin(c)||(void 0===n&&(n=1e-5),Math.abs(c-0)<n))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(o[1]-i[1],o[0]-i[0])),h=Math.abs(Math.atan2(o[0]-i[0],o[1]-i[1]));return l=l>Math.PI/2?Math.PI-l:l,h=h>Math.PI/2?Math.PI-h:h,{xExtra:Math.cos(c/2-l)*(e/2*(1/Math.sin(c/2)))-e/2||0,yExtra:Math.cos(h-c/2)*(e/2*(1/Math.sin(c/2)))-e/2||0}}function jo(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}var Yo=function(t,e){var n=t.x*e.x+t.y*e.y,r=Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2)));return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos(n/r)},Wo=function(t,e,n,r,i,o,a,s){e=Math.abs(e),n=Math.abs(n);var u=So(r=Pe(r,360));if(t.x===a.x&&t.y===a.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var c=(t.x-a.x)/2,l=(t.y-a.y)/2,h={x:Math.cos(u)*c+Math.sin(u)*l,y:-Math.sin(u)*c+Math.cos(u)*l},f=Math.pow(h.x,2)/Math.pow(e,2)+Math.pow(h.y,2)/Math.pow(n,2);f>1&&(e=Math.sqrt(f)*e,n=Math.sqrt(f)*n);var p=(Math.pow(e,2)*Math.pow(n,2)-Math.pow(e,2)*Math.pow(h.y,2)-Math.pow(n,2)*Math.pow(h.x,2))/(Math.pow(e,2)*Math.pow(h.y,2)+Math.pow(n,2)*Math.pow(h.x,2));p=0>p?0:p;var d=(i!==o?1:-1)*Math.sqrt(p),v=d*(e*h.y/n),m=d*(-n*h.x/e),y={x:Math.cos(u)*v-Math.sin(u)*m+(t.x+a.x)/2,y:Math.sin(u)*v+Math.cos(u)*m+(t.y+a.y)/2},g={x:(h.x-v)/e,y:(h.y-m)/n},x=Yo({x:1,y:0},g),E=Yo(g,{x:(-h.x-v)/e,y:(-h.y-m)/n});!o&&E>0?E-=2*Math.PI:o&&0>E&&(E+=2*Math.PI);var T=x+(E%=2*Math.PI)*s,b=e*Math.cos(T),w=n*Math.sin(T);return{x:Math.cos(u)*b-Math.sin(u)*w+y.x,y:Math.sin(u)*b+Math.cos(u)*w+y.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+E,ellipticalArcAngle:T,ellipticalArcCenter:y,resultantRx:e,resultantRy:n}};function Xo(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,o=void 0===i?0:i,a=r.ry,s=void 0===a?0:a,u=r.xRotation,c=r.arcFlag,l=r.sweepFlag,h=Wo({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Wo({x:t.prePoint[0],y:t.prePoint[1]},o,s,u,!!c,!!l,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),p=f.x-h.x,d=f.y-h.y,v=Math.sqrt(p*p+d*d);return{x:-p/v,y:-d/v}}function qo(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Ko(t,e){return qo(t)*qo(e)?(t[0]*e[0]+t[1]*e[1])/(qo(t)*qo(e)):1}function Zo(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Ko(t,e))}function Qo(t,e){var n=e[1],r=e[2],i=Pe(So(e[3]),2*Math.PI),o=e[4],a=e[5],s=t[0],u=t[1],c=e[6],l=e[7],h=Math.cos(i)*(s-c)/2+Math.sin(i)*(u-l)/2,f=-1*Math.sin(i)*(s-c)/2+Math.cos(i)*(u-l)/2,p=h*h/(n*n)+f*f/(r*r);p>1&&(n*=Math.sqrt(p),r*=Math.sqrt(p));var d=n*n*(f*f)+r*r*(h*h),v=d?Math.sqrt((n*n*(r*r)-d)/d):1;o===a&&(v*=-1),isNaN(v)&&(v=0);var m=r?v*n*f/r:0,y=n?v*-r*h/n:0,g=(s+c)/2+Math.cos(i)*m-Math.sin(i)*y,x=(u+l)/2+Math.sin(i)*m+Math.cos(i)*y,E=[(h-m)/n,(f-y)/r],T=[(-1*h-m)/n,(-1*f-y)/r],b=Zo([1,0],E),w=Zo(E,T);return Ko(E,T)>-1||(w=Math.PI),1>Ko(E,T)||(w=0),0===a&&w>0&&(w-=2*Math.PI),1===a&&0>w&&(w+=2*Math.PI),{cx:g,cy:x,rx:Ho(t,[c,l])?0:n,ry:Ho(t,[c,l])?0:r,startAngle:b,endAngle:b+w,xRotation:i,arcFlag:o,sweepFlag:a}}function Jo(t,e,n,r){var i=(-1+Math.sqrt(2))/3*4,o=t*i,a=e*i,s=n-t,u=n+t,c=r-e,l=r+e;return[["M",s,r],["C",s,r-a,n-o,c,n,c],["C",n+o,c,u,r-a,u,r],["C",u,r+a,n+o,l,n,l],["C",n-o,l,s,r+a,s,r],["Z"]]}var $o=function(){return this.call=this._createCall("sync"),this.call.apply(this,arguments)},ta=function(){return this.callAsync=this._createCall("async"),this.callAsync.apply(this,arguments)},ea=function(){return this.promise=this._createCall("promise"),this.promise.apply(this,arguments)},na=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=void 0),this.name=void 0,this.taps=void 0,this.promise=void 0,this._promise=void 0,this._args=t,this.name=e,this.taps=[],this.interceptors=[],this._call=$o,this.call=$o,this._callAsync=ta,this.callAsync=ta,this._promise=ea,this.promise=ea,this._x=void 0}var e=t.prototype;return e.compile=function(t){throw new Error("Abstract: should be overridden")},e._createCall=function(t){return this.compile({taps:this.taps,interceptors:this.interceptors,args:this._args,type:t})},e._tap=function(t,e,n){if("string"==typeof e)e={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof e.name||""===e.name)throw new Error("Missing name for tap");e=Object.assign({type:t,fn:n},e),e=this._runRegisterInterceptors(e),this._insert(e)},e.tap=function(t,e){this._tap("sync",t,e)},e.tapAsync=function(t,e){this._tap("async",t,e)},e.tapPromise=function(t,e){this._tap("promise",t,e)},e._runRegisterInterceptors=function(t){for(var e,n=xr(this.interceptors);!(e=n()).done;){var r=e.value;if(r.register){var i=r.register(t);void 0!==i&&(t=i)}}return t},e.withOptions=function(t){var e=this,n=function(e){return Object.assign({},t,"string"==typeof e?{name:e}:e)};return{name:this.name,tap:function(t,r){return e.tap(n(t),r)},tapAsync:function(t,r){return e.tapAsync(n(t),r)},tapPromise:function(t,r){return e.tapPromise(n(t),r)},isUsed:function(){return e.isUsed()},withOptions:function(t){return e.withOptions(n(t))}}},e.isUsed=function(){return this.taps.length>0||this.interceptors.length>0},e._resetCompilation=function(){this.call=this._call,this.callAsync=this._callAsync,this.promise=this._promise},e._insert=function(t){var e;this._resetCompilation(),"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));var n=0;"number"==typeof t.stage&&(n=t.stage);for(var r=this.taps.length;r>0;){r--;var i=this.taps[r];this.taps[r+1]=i;var o=i.stage||0;if(e){if(e.has(i.name)){e.delete(i.name);continue}if(e.size>0)continue}if(n>=o){r++;break}}this.taps[r]=t},t}(),ra=function(){function t(t){this.config=t,this.options=void 0,this._args=void 0}var e=t.prototype;return e.create=function(t){var e;switch(this.init(t),this.options.type){case"sync":e=new Function(this.args(),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"throw "+t+";\n"},onResult:function(t){return"return "+t+";\n"},resultReturns:!0,onDone:function(){return""},rethrowIfPossible:!0}));break;case"async":e=new Function(this.args({after:"_callback"}),'"use strict";\n'+this.header()+this.contentWithInterceptors({onError:function(t){return"_callback("+t+");\n"},onResult:function(t){return"_callback(null, "+t+");\n"},onDone:function(){return"_callback();\n"}}));break;case"promise":var n=!1,r=this.contentWithInterceptors({onError:function(t){return n=!0,"_error("+t+");\n"},onResult:function(t){return"_resolve("+t+");\n"},onDone:function(){return"_resolve();\n"}}),i="";i+='"use strict";\n',i+=this.header(),i+="return new Promise((function(_resolve, _reject) {\n",n&&(i+="var _sync = true;\n",i+="function _error(_err) {\n",i+="if(_sync)\n",i+="_resolve(Promise.resolve().then((function() { throw _err; })));\n",i+="else\n",i+="_reject(_err);\n",i+="};\n"),i+=r,n&&(i+="_sync = false;\n"),i+="}));\n",e=new Function(this.args(),i)}return this.deinit(),e},e.setup=function(t,e){t._x=e.taps.map((function(t){return t.fn}))},e.init=function(t){this.options=t,this._args=t.args.slice()},e.deinit=function(){this.options=void 0,this._args=void 0},e.contentWithInterceptors=function(t){var e=this;if(this.options.interceptors.length>0){for(var n=t.onError,r=t.onResult,i=t.onDone,o="",a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.call&&(o+=this.getInterceptor(a)+".call("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.content(Object.assign(t,{onError:n&&function(t){for(var r="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].error&&(r+=e.getInterceptor(i)+".error("+t+");\n")}return r+=n(t)},onResult:r&&function(t){for(var n="",i=0;e.options.interceptors.length>i;i++){e.options.interceptors[i].result&&(n+=e.getInterceptor(i)+".result("+t+");\n")}return n+=r(t)},onDone:i&&function(){for(var t="",n=0;e.options.interceptors.length>n;n++){e.options.interceptors[n].done&&(t+=e.getInterceptor(n)+".done();\n")}return t+=i()}}))}return this.content(t)},e.header=function(){var t="";return this.needContext()?t+="var _context = {};\n":t+="var _context;\n",t+="var _x = this._x;\n",this.options.interceptors.length>0&&(t+="var _taps = this.taps;\n",t+="var _interceptors = this.interceptors;\n"),t},e.needContext=function(){for(var t,e=xr(this.options.taps);!(t=e()).done;){if(t.value.context)return!0}return!1},e.callTap=function(t,e){for(var n=e.onError,r=e.onResult,i=e.onDone,o=e.rethrowIfPossible,a="",s=!1,u=0;this.options.interceptors.length>u;u++){var c=this.options.interceptors[u];c.tap&&(s||(a+="var _tap"+t+" = "+this.getTap(t)+";\n",s=!0),a+=this.getInterceptor(u)+".tap("+(c.context?"_context, ":"")+"_tap"+t+");\n")}a+="var _fn"+t+" = "+this.getTapFn(t)+";\n";var l=this.options.taps[t];switch(l.type){case"sync":o||(a+="var _hasError"+t+" = false;\n",a+="try {\n"),a+=r?"var _result"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n":"_fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",o||(a+="} catch(_err) {\n",a+="_hasError"+t+" = true;\n",a+=n("_err"),a+="}\n",a+="if(!_hasError"+t+") {\n"),r&&(a+=r("_result"+t)),i&&(a+=i()),o||(a+="}\n");break;case"async":var h="";h+=r?"(function(_err"+t+", _result"+t+") {\n":"(function(_err"+t+") {\n",h+="if(_err"+t+") {\n",h+=n("_err"+t),h+="} else {\n",r&&(h+=r("_result"+t)),i&&(h+=i()),h+="}\n",a+="_fn"+t+"("+this.args({before:l.context?"_context":void 0,after:h+="})"})+");\n";break;case"promise":a+="var _hasResult"+t+" = false;\n",a+="var _promise"+t+" = _fn"+t+"("+this.args({before:l.context?"_context":void 0})+");\n",a+="if (!_promise"+t+" || !_promise"+t+".then)\n",a+=" throw new Error('Tap function (tapPromise) did not return promise (returned ' + _promise"+t+" + ')');\n",a+="_promise"+t+".then((function(_result"+t+") {\n",a+="_hasResult"+t+" = true;\n",r&&(a+=r("_result"+t)),i&&(a+=i()),a+="}), function(_err"+t+") {\n",a+="if(_hasResult"+t+") throw _err"+t+";\n",a+=n("_err"+t),a+="});\n"}return a},e.callTapsSeries=function(t){var e=this,n=t.onError,r=t.onResult,i=t.resultReturns,o=t.onDone,a=t.doneReturns,s=t.rethrowIfPossible;if(0===this.options.taps.length)return o();for(var u=this.options.taps.findIndex((function(t){return"sync"!==t.type})),c=i||a,l="",h=o,f=0,p=function(t){var i=t;h!==o&&("sync"!==e.options.taps[i].type||f++>20)&&(f=0,l+="function _next"+i+"() {\n",l+=h(),l+="}\n",h=function(){return(c?"return ":"")+"_next"+i+"();\n"});var a=h,p=function(t){return t?"":o()},d=e.callTap(i,{onError:function(t){return n(i,t,a,p)},onResult:r&&function(t){return r(i,t,a,p)},onDone:!r&&a,rethrowIfPossible:s&&(0>u||u>i)});h=function(){return d}},d=this.options.taps.length-1;d>=0;d--)p(d);return l+=h()},e.callTapsLooping=function(t){var e=t.onError,n=t.onDone,r=t.rethrowIfPossible;if(0===this.options.taps.length)return n();var i=this.options.taps.every((function(t){return"sync"===t.type})),o="";i||(o+="var _looper = (function() {\n",o+="var _loopAsync = false;\n"),o+="var _loop;\n",o+="do {\n",o+="_loop = false;\n";for(var a=0;this.options.interceptors.length>a;a++){var s=this.options.interceptors[a];s.loop&&(o+=this.getInterceptor(a)+".loop("+this.args({before:s.context?"_context":void 0})+");\n")}return o+=this.callTapsSeries({onError:e,onResult:function(t,e,n,r){var o="";return o+="if("+e+" !== undefined) {\n",o+="_loop = true;\n",i||(o+="if(_loopAsync) _looper();\n"),o+=r(!0),o+="} else {\n",o+=n(),o+="}\n"},onDone:n&&function(){var t="";return t+="if(!_loop) {\n",t+=n(),t+="}\n"},rethrowIfPossible:r&&i}),o+="} while(_loop);\n",i||(o+="_loopAsync = true;\n",o+="});\n",o+="_looper();\n"),o},e.callTapsParallel=function(t){var e=this,n=t.onError,r=t.onResult,i=t.onDone,o=t.rethrowIfPossible,a=t.onTap,s=void 0===a?function(t,e){return e()}:a;if(1>=this.options.taps.length)return this.callTapsSeries({onError:n,onResult:r,onDone:i,rethrowIfPossible:o});var u="";u+="do {\n",u+="var _counter = "+this.options.taps.length+";\n",i&&(u+="var _done = (function() {\n",u+=i(),u+="});\n");for(var c=function(t){var a=function(){return i?"if(--_counter === 0) _done();\n":"--_counter;"},c=function(t){return t||!i?"_counter = 0;\n":"_counter = 0;\n_done();\n"};u+="if(_counter <= 0) break;\n",u+=s(t,(function(){return e.callTap(t,{onError:function(e){var r="";return r+="if(_counter > 0) {\n",r+=n(t,e,a,c),r+="}\n"},onResult:r&&function(e){var n="";return n+="if(_counter > 0) {\n",n+=r(t,e,a,c),n+="}\n"},onDone:!r&&function(){return a()},rethrowIfPossible:o})}),a,c)},l=0;this.options.taps.length>l;l++)c(l);return u+="} while(false);\n"},e.args=function(t){var e=void 0===t?{}:t,n=e.before,r=e.after,i=this._args;return n&&(i=[n].concat(i)),r&&(i=i.concat(r)),0===i.length?"":i.join(", ")},e.getTapFn=function(t){return"_x["+t+"]"},e.getTap=function(t){return"_taps["+t+"]"},e.getInterceptor=function(t){return"_interceptors["+t+"]"},t}(),ia=function(t){function e(){return t.apply(this,arguments)||this}return dr(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsParallel({onError:function(t,n,r,i){return e(n)+i(!0)},onDone:t.onDone})},e}(ra),oa=new ia,aa=function(t){return oa.setup(this,t),oa.create(t)},sa=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=aa,r._call=void 0,r.call=void 0,r}return dr(e,t),e}(na),ua=function(t){function e(){return t.apply(this,arguments)||this}return dr(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e,r,i){return n(e)+i(!0)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])}})},e}(ra),ca=new ua,la=function(t){return ca.setup(this,t),ca.create(t)},ha=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).compile=la,r._call=void 0,r.call=void 0,r}return dr(e,t),e}(na),fa=function(t){function e(){return t.apply(this,arguments)||this}return dr(e,t),e.prototype.content=function(t){var e=t.onError;return this.callTapsSeries({onError:function(t,n){return e(n)},onDone:t.onDone,rethrowIfPossible:t.rethrowIfPossible})},e}(ra),pa=new fa,da=function(){throw new Error("tapAsync is not supported on a SyncHook")},va=function(){throw new Error("tapPromise is not supported on a SyncHook")},ma=function(t){return pa.setup(this,t),pa.create(t)},ya=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=da,r.tapPromise=va,r.compile=ma,r}return dr(e,t),e}(na),ga=function(t){function e(){return t.apply(this,arguments)||this}return dr(e,t),e.prototype.content=function(t){var e=this,n=t.onError,r=t.onResult;return this.callTapsSeries({onError:function(t,e){return n(e)},onResult:function(t,n,r){var i="";return i+="if("+n+" !== undefined) {\n",i+=e._args[0]+" = "+n+";\n",i+="}\n",i+=r()},onDone:function(){return r(e._args[0])},doneReturns:t.resultReturns,rethrowIfPossible:t.rethrowIfPossible})},e}(ra),xa=new ga,Ea=function(){throw new Error("tapAsync is not supported on a SyncWaterfallHook")},Ta=function(){throw new Error("tapPromise is not supported on a SyncWaterfallHook")},ba=function(t){return xa.setup(this,t),xa.create(t)},wa=function(t){function e(e,n){var r;return void 0===e&&(e=[]),void 0===n&&(n=void 0),(r=t.call(this,e,n)||this).tapAsync=Ea,r.tapPromise=Ta,r.compile=ba,r}return dr(e,t),e}(ya),ka=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Ma=/([\"\'])[^\'\"]+\1/;var Pa=[{n:"display",k:["none"]},{n:"opacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fillOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"strokeOpacity",int:!0,inh:!0,d:"1",syntax:t.PropertySyntax.OPACITY_VALUE},{n:"fill",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"fillRule",k:["nonzero","evenodd"],d:"nonzero"},{n:"stroke",int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.PAINT},{n:"shadowType",k:["inner","outer","both"],d:"outer",l:!0},{n:"shadowColor",int:!0,syntax:t.PropertySyntax.COLOR},{n:"shadowOffsetX",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowOffsetY",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"shadowBlur",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.SHADOW_BLUR},{n:"lineWidth",int:!0,inh:!0,d:"1",l:!0,a:["strokeWidth"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"increasedLineWidthForHitTesting",inh:!0,d:"0",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"lineJoin",inh:!0,l:!0,a:["strokeLinejoin"],k:["miter","bevel","round"],d:"miter"},{n:"lineCap",inh:!0,l:!0,a:["strokeLinecap"],k:["butt","round","square"],d:"butt"},{n:"lineDash",int:!0,inh:!0,k:["none"],a:["strokeDasharray"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"lineDashOffset",int:!0,inh:!0,d:"0",a:["strokeDashoffset"],syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"offsetPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"offsetDistance",int:!0,syntax:t.PropertySyntax.OFFSET_DISTANCE},{n:"dx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"dy",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"zIndex",ind:!0,int:!0,d:"0",k:["auto"],syntax:t.PropertySyntax.Z_INDEX},{n:"visibility",k:["visible","hidden"],ind:!0,inh:!0,d:"visible"},{n:"pointerEvents",inh:!0,k:["none","auto","stroke","fill","painted","visible","visiblestroke","visiblefill","visiblepainted","all"],d:"auto"},{n:"filter",ind:!0,l:!0,k:["none"],d:"none",syntax:t.PropertySyntax.FILTER},{n:"clipPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPath",syntax:t.PropertySyntax.DEFINED_PATH},{n:"textPathSide",k:["left","right"],d:"left"},{n:"textPathStartOffset",l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"transform",p:100,int:!0,k:["none"],d:"none",syntax:t.PropertySyntax.TRANSFORM},{n:"transformOrigin",p:100,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"center":e===t.Shape.TEXT?"text-anchor":"left top"},l:!0,syntax:t.PropertySyntax.TRANSFORM_ORIGIN},{n:"anchor",p:99,d:function(e){return e===t.Shape.CIRCLE||e===t.Shape.ELLIPSE?"0.5 0.5":"0 0"},l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE_12},{n:"cx",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"cy",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"r",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"rx",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"ry",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"x",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"y",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"z",int:!0,d:"0",syntax:t.PropertySyntax.COORDINATE},{n:"width",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"height",int:!0,l:!0,k:["auto","fit-content","min-content","max-content"],d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"radius",int:!0,l:!0,d:"0",syntax:t.PropertySyntax.LENGTH_PERCENTAGE_14},{n:"x1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z1",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"x2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"y2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"z2",int:!0,l:!0,syntax:t.PropertySyntax.COORDINATE},{n:"path",int:!0,l:!0,d:"",a:["d"],syntax:t.PropertySyntax.PATH,p:50},{n:"points",l:!0,syntax:t.PropertySyntax.LIST_OF_POINTS,p:50},{n:"text",l:!0,d:"",syntax:t.PropertySyntax.TEXT,p:50},{n:"textTransform",l:!0,inh:!0,k:["capitalize","uppercase","lowercase","none"],d:"none",syntax:t.PropertySyntax.TEXT_TRANSFORM,p:51},{n:"font",l:!0},{n:"fontSize",int:!0,inh:!0,d:"16px",l:!0,syntax:t.PropertySyntax.LENGTH_PERCENTAGE},{n:"fontFamily",l:!0,inh:!0,d:"sans-serif"},{n:"fontStyle",l:!0,inh:!0,k:["normal","italic","oblique"],d:"normal"},{n:"fontWeight",l:!0,inh:!0,k:["normal","bold","bolder","lighter"],d:"normal"},{n:"fontVariant",l:!0,inh:!0,k:["normal","small-caps"],d:"normal"},{n:"lineHeight",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"letterSpacing",l:!0,syntax:t.PropertySyntax.LENGTH,int:!0,d:"0"},{n:"miterLimit",l:!0,syntax:t.PropertySyntax.NUMBER,d:function(e){return e===t.Shape.PATH||e===t.Shape.POLYGON||e===t.Shape.POLYLINE?"4":"10"}},{n:"wordWrap",l:!0},{n:"wordWrapWidth",l:!0},{n:"maxLines",l:!0},{n:"textOverflow",l:!0,d:"clip"},{n:"leading",l:!0},{n:"textBaseline",l:!0,inh:!0,k:["top","hanging","middle","alphabetic","ideographic","bottom"],d:"alphabetic"},{n:"textAlign",l:!0,inh:!0,k:["start","center","middle","end","left","right"],d:"start"},{n:"markerStart",syntax:t.PropertySyntax.MARKER},{n:"markerEnd",syntax:t.PropertySyntax.MARKER},{n:"markerMid",syntax:t.PropertySyntax.MARKER},{n:"markerStartOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"},{n:"markerEndOffset",syntax:t.PropertySyntax.LENGTH,l:!0,int:!0,d:"0"}],Sa={},Na=new WeakMap,Ca={},Aa=Ce((function(t){return t.sort((function(t,e){return Ca[t]-Ca[e]}))})),Oa=q(),_a=q(),La=q(),Ra=function(){function e(){var t=this;Pa.forEach((function(e){t.registerMetadata(e)}))}var n=e.prototype;return n.registerMetadata=function(t){[t.n].concat(t.a||[]).forEach((function(e){Sa[e]=t,Ca[e]=t.p||0}))},n.unregisterMetadata=function(t){delete Sa[t]},n.getPropertySyntax=function(t){return iu.CSSPropertySyntaxFactory[t]},n.processProperties=function(t,e,n){var r=this;void 0===n&&(n={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]});var i=n.skipUpdateAttribute,o=n.skipParse,a=n.usedAttributes,s=n.forceUpdateGeometry,u=Object.keys(e);u.forEach((function(n){var r,o=Xn(n);i||(t.attributes[o]=e[n]),!s&&(null===(r=Sa[o])||void 0===r?void 0:r.l)&&(s=!0)})),o||u.forEach((function(e){t.computedStyle[e]=r.parseProperty(e,t.attributes[e],t)})),(u=Aa((null==a?void 0:a.length)?Array.from(new Set(u.concat(a))):u)).forEach((function(e){e in t.computedStyle&&(t.parsedStyle[e]=r.computeProperty(e,t.computedStyle[e],t))})),s&&this.updateGeometry(t),u.forEach((function(e){e in t.parsedStyle&&r.postProcessProperty(e,t)})),t.children.length&&u.forEach((function(e){e in t.parsedStyle&&r.isPropertyInheritable(e)&&t.children.forEach((function(t){t.internalSetAttribute(e,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},n.parseProperty=function(t,e,n){var r=Sa[t],i=e;if((""===e||ge(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=oi(e);else if(r){var o=r.k,a=r.syntax,s=a&&this.getPropertySyntax(a);o&&o.indexOf(e)>-1?i=oi(e):s&&s.parser&&(i=s.parser(e,n))}return i},n.computeProperty=function(t,e,n){var r=Sa[t],i=e;if(r){var o=r.syntax,a=r.d;if(e instanceof Or){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)ge(a)||(e=this.parseProperty(t,Yn(a)?a(n.nodeName):a,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return ge(u)?void this.addUnresolveProperty(n,t):u}}var c=o&&this.getPropertySyntax(o);if(c&&c.calculator)i=c.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof Or?e.value:e}return i},n.postProcessProperty=function(t,e){var n=Sa[t];if(n&&n.syntax){var r=n.syntax&&this.getPropertySyntax(n.syntax);r&&r.postProcessor&&r.postProcessor(e)}},n.addUnresolveProperty=function(t,e){var n=Na.get(t);n||(Na.set(t,[]),n=Na.get(t)),-1===n.indexOf(e)&&n.push(e)},n.tryToResolveProperty=function(t,e,n){if(void 0===n&&(n={}),n.inherited&&t.parentElement&&function(t,e){var n=Na.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var r=t.parentElement.parsedStyle[e];if("unset"===r||"initial"===r||"inherit"===r)return;return r}},n.recalc=function(t){var e=Na.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Na.delete(t)}},n.updateGeometry=function(e){var n=iu.geometryUpdaterFactory[e.nodeName];if(n){var r=e.geometry;r.contentBounds||(r.contentBounds=new Dn),r.renderBounds||(r.renderBounds=new Dn);var i=e.parsedStyle,o=n.update(i,e),a=o.width,s=o.height,u=o.depth,c=void 0===u?0:u,l=o.offsetX,h=void 0===l?0:l,f=o.offsetY,p=void 0===f?0:f,d=o.offsetZ,v=void 0===d?0:d,m=0>a,y=0>s,g=$(Oa,Math.abs(a)/2,Math.abs(s)/2,c/2),x=i.stroke,E=i.lineWidth,T=i.increasedLineWidthForHitTesting,b=i.shadowType,w=i.shadowColor,k=i.filter,M=void 0===k?[]:k,P=i.transformOrigin,S=i.anchor;e.nodeName===t.Shape.TEXT&&delete i.anchor;var N=$(_a,(1-2*(S&&S[0]||0))*a/2+h,(1-2*(S&&S[1]||0))*s/2+p,(1-2*(S&&S[2]||0))*g[2]+v);r.contentBounds.update(N,g);var C=e.nodeName===t.Shape.POLYLINE||e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.PATH?Math.SQRT2:.5;if(x&&!x.isNone){var A=((E||0)+(T||0))*C;tt(g,g,$(La,A,A,0))}if(r.renderBounds.update(N,g),w&&b&&"inner"!==b){var O=r.renderBounds,_=O.min,L=O.max,R=i.shadowBlur||0,I=i.shadowOffsetX||0,D=i.shadowOffsetY||0,F=L[0]+R+I,G=_[1]-R+D,U=L[1]+R+D;_[0]=Math.min(_[0],_[0]-R+I),L[0]=Math.max(L[0],F),_[1]=Math.min(_[1],G),L[1]=Math.max(L[1],U),r.renderBounds.setMinMax(_,L)}M.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var i=n[0].value;r.renderBounds.update(r.renderBounds.center,tt(r.renderBounds.halfExtents,r.renderBounds.halfExtents,Q(i,i,0)))}else if("drop-shadow"===e){var o=n[0].value,a=n[1].value,s=n[2].value,u=r.renderBounds,c=u.min,l=u.max,h=l[0]+s+o,f=c[1]-s+a,p=l[1]+s+a;c[0]=Math.min(c[0],c[0]-s+o),l[0]=Math.max(l[0],h),c[1]=Math.min(c[1],f),l[1]=Math.max(l[1],p),r.renderBounds.setMinMax(c,l)}})),S=i.anchor;var B=(m?-1:1)*Ni(P[0],0,e),V=(y?-1:1)*Ni(P[1],1,e);e.setOrigin(B-=(m?-1:1)*(S&&S[0]||0)*r.contentBounds.halfExtents[0]*2,V-=(y?-1:1)*(S&&S[1]||0)*r.contentBounds.halfExtents[1]*2),iu.sceneGraphService.dirtifyToRoot(e)}},n.isPropertyInheritable=function(t){var e=Sa[t];return!!e&&e.inh},e}(),Ia=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,ss),this.define(t.Shape.ELLIPSE,ds),this.define(t.Shape.RECT,As),this.define(t.Shape.IMAGE,Es),this.define(t.Shape.LINE,bs),this.define(t.Shape.GROUP,ms),this.define(t.Shape.PATH,ks),this.define(t.Shape.POLYGON,Ps),this.define(t.Shape.POLYLINE,Ns),this.define(t.Shape.TEXT,_s),this.define(t.Shape.HTML,gs)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}(),Da=function(){function t(e){this.type=void 0,this.eventPhase=t.prototype.NONE,this.target=void 0,this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.currentTarget=void 0,this.defaultPrevented=!1,this.timeStamp=void 0,this.nativeEvent=void 0,this.originalEvent=void 0,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.manager=void 0,this.detail=void 0,this.layer=new Bn,this.page=new Bn,this.canvas=new Bn,this.viewport=new Bn,this.path=void 0,this.view=void 0,this.which=void 0,this.returnValue=void 0,this.srcElement=void 0,this.composed=!1,this.isTrusted=void 0,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}var e=t.prototype;return e.composedPath=function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path},e.preventDefault=function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0},e.stopImmediatePropagation=function(){this.propagationImmediatelyStopped=!0},e.stopPropagation=function(){this.propagationStopped=!0},e.initEvent=function(){},e.initUIEvent=function(){},e.clone=function(){throw new Error(or)},fr(t,[{key:"name",get:function(){return this.type}},{key:"layerX",get:function(){return this.layer.x}},{key:"layerY",get:function(){return this.layer.y}},{key:"pageX",get:function(){return this.page.x}},{key:"pageY",get:function(){return this.page.y}},{key:"x",get:function(){return this.canvas.x}},{key:"y",get:function(){return this.canvas.y}},{key:"canvasX",get:function(){return this.canvas.x}},{key:"canvasY",get:function(){return this.canvas.y}},{key:"viewportX",get:function(){return this.viewport.x}},{key:"viewportY",get:function(){return this.viewport.y}},{key:"propagationPath",get:function(){return this.composedPath()}}]),t}(),Fa=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(yr(r),n),r}return dr(e,t),e}(Da),Ga=function(){function t(){this.emitter=new Tn.EventEmitter}var e=t.prototype;return e.on=function(t,e,n){return this.addEventListener(t,e,n),this},e.addEventListener=function(t,e,n){var r=Se(n)&&n||Ee(n)&&n.capture,i=Ee(n)&&n.once,o=Yn(e)?void 0:e,a=!1,s="";if(t.indexOf(":")>-1){var u=t.split(":");t=u[1],s=u[0],a=!0}if(t=r?t+"capture":t,e=Yn(e)?e:e.handleEvent,a){var c=e;e=function(){for(var t,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&c.apply(void 0,n)}}return i?this.emitter.once(t,e,o):this.emitter.on(t,e,o),this},e.off=function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this},e.removeAllEventListeners=function(){this.emitter.removeAllListeners()},e.removeEventListener=function(t,e,n){var r,i=Se(n)&&n||Ee(n)&&n.capture,o=Yn(e)?void 0:e;return t=i?t+"capture":t,e=Yn(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent,this.emitter.off(t,e,o),this},e.emit=function(t,e){this.dispatchEvent(new Fa(t,e))},e.dispatchEvent=function(t,e){if(void 0===e&&(e=!1),!(t instanceof Da))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");var n;if(this.document)n=this;else if(this.defaultView)n=this.defaultView;else{var r;n=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}if(n){var i;if(t.manager=n.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],e||(t.target=this),null===(i=t.manager)||void 0===i||i.dispatchEvent(t,t.type,e)}return!t.defaultPrevented},t}(),Ua=function(e){function n(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}dr(n,e),n.isNode=function(t){return!!t.childNodes};var r=n.prototype;return r.getRootNode=function(t){return void 0===t&&(t={}),this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this},r.hasChildNodes=function(){return this.childNodes.length>0},r.isDefaultNamespace=function(t){throw new Error(or)},r.lookupNamespaceURI=function(t){throw new Error(or)},r.lookupPrefix=function(t){throw new Error(or)},r.normalize=function(){throw new Error(or)},r.isEqualNode=function(t){return this===t},r.isSameNode=function(t){return this.isEqualNode(t)},r.compareDocumentPosition=function(t){if(t===this)return 0;if(!(t instanceof n))throw new TypeError("Node.compareDocumentPosition: Argument 1 does not implement interface Node.");for(var e=t,r=this,i=[e],o=[r];null!==(a=e.parentNode)&&void 0!==a?a:r.parentNode;){var a;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,r=r.parentNode?(o.push(r.parentNode),r.parentNode):r}if(e!==r)return n.DOCUMENT_POSITION_DISCONNECTED|n.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|n.DOCUMENT_POSITION_PRECEDING;var s=i.length>o.length?i:o,u=s===i?o:i;if(s[s.length-u.length]===u[0])return s===i?n.DOCUMENT_POSITION_CONTAINED_BY|n.DOCUMENT_POSITION_FOLLOWING:n.DOCUMENT_POSITION_CONTAINS|n.DOCUMENT_POSITION_PRECEDING;for(var c=s.length-u.length,l=u.length-1;l>=0;l--){var h=u[l],f=s[c+l];if(f!==h){var p=h.parentNode.childNodes;return p.indexOf(h)<p.indexOf(f)?u===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING:s===i?n.DOCUMENT_POSITION_PRECEDING:n.DOCUMENT_POSITION_FOLLOWING}}return n.DOCUMENT_POSITION_FOLLOWING},r.contain=function(t){return this.contains(t)},r.contains=function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e},r.getAncestor=function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e},r.forEach=function(t){t(this)||this.childNodes.forEach((function(e){e.forEach(t)}))},fr(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=xr(this.childNodes);!(n=r()).done;){var i=n.value;e+=i.nodeName===t.Shape.TEXT?i.nodeValue:i.textContent}return e},set:function(e){var n=this;this.childNodes.slice().forEach((function(t){n.removeChild(t)})),this.nodeName===t.Shape.TEXT&&(this.style.text=""+e)}},{key:"parent",get:function(){return this.parentNode}},{key:"parentElement",get:function(){return null}},{key:"nextSibling",get:function(){return null}},{key:"previousSibling",get:function(){return null}},{key:"firstChild",get:function(){return this.childNodes.length>0?this.childNodes[0]:null}},{key:"lastChild",get:function(){return this.childNodes.length>0?this.childNodes[this.childNodes.length-1]:null}}]),n}(Ga);Ua.DOCUMENT_POSITION_DISCONNECTED=1,Ua.DOCUMENT_POSITION_PRECEDING=2,Ua.DOCUMENT_POSITION_FOLLOWING=4,Ua.DOCUMENT_POSITION_CONTAINS=8,Ua.DOCUMENT_POSITION_CONTAINED_BY=16,Ua.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Ba,Va,Ha=function(e){function n(){var n;(n=e.call(this)||this).defaultView=null,n.documentElement=void 0,n.timeline=void 0,n.ownerDocument=null,n.nodeName="document";try{n.timeline=new iu.AnimationTimeline(yr(n))}catch(t){}var r={};return Pa.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=Yn(n)?n(t.Shape.GROUP):n)})),n.documentElement=new ms({id:"g-root",style:r}),n.documentElement.ownerDocument=yr(n),n.documentElement.parentNode=yr(n),n.childNodes=[n.documentElement],n}dr(n,e);var r=n.prototype;return r.createElement=function(t,e){if("svg"===t)return this.documentElement;var n=this.defaultView.customElements.get(t);n||(console.warn("Unsupported tagName: ",t),n="tspan"===t?_s:ms);var r=new n(e);return r.ownerDocument=this,r},r.createElementNS=function(t,e,n){return this.createElement(e,n)},r.cloneNode=function(t){throw new Error(or)},r.destroy=function(){try{this.documentElement.destroy(),this.timeline.destroy()}catch(t){}},r.elementsFromBBox=function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),o=[];return i.forEach((function(t){var e=iu.displayObjectPool.getByEntity(t.id),n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&o.push(e)})),o.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),o},r.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return null;var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c&&c[0]||this.documentElement},r.elementFromPoint=function(){var t=lr(ur().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",null);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return t.abrupt("return",(f=t.sent.picked)&&f[0]||this.documentElement);case 10:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.elementsFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,o=this.defaultView.getConfig();if(0>r||0>i||r>o.width||i>o.height)return[];var a=this.defaultView.viewport2Client({x:r,y:i}),s=a.x,u=a.y,c=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return c[c.length-1]!==this.documentElement&&c.push(this.documentElement),c},r.elementsFromPoint=function(){var t=lr(ur().mark((function t(e,n){var r,i,o,a,s,u,c,l,h,f;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,o=r.y,a=this.defaultView.getConfig(),s=a.width,u=a.height,!(0>i||0>o||i>s||o>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return c=this.defaultView.viewport2Client({x:i,y:o}),l=c.x,h=c.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:o,clientX:l,clientY:h},picked:[]});case 7:return(f=t.sent.picked)[f.length-1]!==this.documentElement&&f.push(this.documentElement),t.abrupt("return",f);case 11:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),r.appendChild=function(t,e){throw new Error(ar)},r.insertBefore=function(t,e){throw new Error(ar)},r.removeChild=function(t,e){throw new Error(ar)},r.replaceChild=function(t,e,n){throw new Error(ar)},r.append=function(){throw new Error(ar)},r.prepend=function(){throw new Error(ar)},r.getElementById=function(t){return this.documentElement.getElementById(t)},r.getElementsByName=function(t){return this.documentElement.getElementsByName(t)},r.getElementsByTagName=function(t){return this.documentElement.getElementsByTagName(t)},r.getElementsByClassName=function(t){return this.documentElement.getElementsByClassName(t)},r.querySelector=function(t){return this.documentElement.querySelector(t)},r.querySelectorAll=function(t){return this.documentElement.querySelectorAll(t)},r.find=function(t){return this.documentElement.find(t)},r.findAll=function(t){return this.documentElement.findAll(t)},fr(n,[{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}}]),n}(Ua);(Ba=t.Strategy||(t.Strategy={}))[Ba.Standard=0]="Standard",(Va=t.ElementEvent||(t.ElementEvent={})).DESTROY="destroy",Va.ATTR_MODIFIED="DOMAttrModified",Va.INSERTED="DOMNodeInserted",Va.REMOVED="removed",Va.MOUNTED="DOMNodeInsertedIntoDocument",Va.UNMOUNTED="DOMNodeRemovedFromDocument",Va.BOUNDS_CHANGED="bounds-changed",Va.RENDER_ORDER_CHANGED="render-order-changed",Va.CULLED="culled";var za=function(t){function e(e,n,r,i,o,a,s,u){var c;return(c=t.call(this,null)||this).relatedNode=void 0,c.prevValue=void 0,c.newValue=void 0,c.attrName=void 0,c.attrChange=void 0,c.prevParsedValue=void 0,c.newParsedValue=void 0,c.relatedNode=n,c.prevValue=r,c.newValue=i,c.attrName=o,c.attrChange=a,c.prevParsedValue=s,c.newParsedValue=u,c.type=e,c}return dr(e,t),e}(Da);za.ADDITION=2,za.MODIFICATION=1,za.REMOVAL=3;var ja=0;var Ya,Wa,Xa,qa=new za(t.ElementEvent.INSERTED,null,"","","",0,"",""),Ka=new za(t.ElementEvent.REMOVED,null,"","","",0,"",""),Za=new Fa(t.ElementEvent.DESTROY),Qa=function(e){function n(){for(var n,r=arguments.length,i=new Array(r),o=0;r>o;o++)i[o]=arguments[o];return(n=e.call.apply(e,[this].concat(i))||this).entity=ja++,n.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},n.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},n.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:Q(0,0,0),localRotation:St(0,0,0,1),localScale:Q(1,1,1),localTransform:b(),localSkew:Ot(0,0),position:Q(0,0,0),rotation:St(0,0,0,1),scaling:Q(1,1,1),worldTransform:b(),origin:Q(0,0,0)},n.sortable={dirty:!1,sorted:void 0,lastSortedIndex:void 0,renderOrder:0},n.geometry={contentBounds:void 0,renderBounds:void 0},n.rBushNode={aabb:void 0},n.id=void 0,n.name=void 0,n.namespaceURI="g",n.scrollLeft=0,n.scrollTop=0,n.clientTop=0,n.clientLeft=0,n.destroyed=!1,n.style={},n.computedStyle={anchor:ei,opacity:ei,fillOpacity:ei,strokeOpacity:ei,fill:ei,stroke:ei,transform:ei,transformOrigin:ei,visibility:ei,pointerEvents:ei,lineWidth:ei,lineCap:ei,lineJoin:ei,increasedLineWidthForHitTesting:ei,fontSize:ei,fontFamily:ei,fontStyle:ei,fontWeight:ei,fontVariant:ei,textAlign:ei,textBaseline:ei,textTransform:ei,zIndex:ei,filter:ei,shadowType:ei},n.parsedStyle={},n.attributes={},n}dr(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw new Error(or)},r.appendChild=function(t,e){var n;if(t.destroyed)throw new Error("Cannot append a destroyed element.");return iu.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),qa.relatedNode=this,t.dispatchEvent(qa),t},r.insertBefore=function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t},r.replaceChild=function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e},r.removeChild=function(t){var e;return Ka.relatedNode=this,t.dispatchEvent(Ka),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),iu.sceneGraphService.detach(t),t},r.removeChildren=function(){var t=this;this.childNodes.slice().forEach((function(e){t.removeChild(e)}))},r.destroyChildren=function(){this.childNodes.slice().forEach((function(t){t.destroyChildren(),t.destroy()}))},r.matches=function(t){return iu.sceneGraphService.matches(t,this)},r.getElementById=function(t){return iu.sceneGraphService.querySelector("#"+t,this)},r.getElementsByName=function(t){return iu.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},r.getElementsByClassName=function(t){return iu.sceneGraphService.querySelectorAll("."+t,this)},r.getElementsByTagName=function(t){return iu.sceneGraphService.querySelectorAll(t,this)},r.querySelector=function(t){return iu.sceneGraphService.querySelector(t,this)},r.querySelectorAll=function(t){return iu.sceneGraphService.querySelectorAll(t,this)},r.closest=function(t){var e=this;do{if(iu.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null},r.find=function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n},r.findAll=function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n},r.after=function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];r.forEach((function(n,r){var i;return null===(i=t.parentNode)||void 0===i?void 0:i.appendChild(n,e+r+1)}))}},r.before=function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,o)}},r.replaceWith=function(){this.after.apply(this,arguments),this.remove()},r.append=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))},r.prepend=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))},r.replaceChildren=function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)},r.remove=function(){return this.parentNode?this.parentNode.removeChild(this):this},r.destroy=function(){this.dispatchEvent(Za),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},r.getGeometryBounds=function(){return iu.sceneGraphService.getGeometryBounds(this)},r.getRenderBounds=function(){return iu.sceneGraphService.getBounds(this,!0)},r.getBounds=function(){return iu.sceneGraphService.getBounds(this)},r.getLocalBounds=function(){return iu.sceneGraphService.getLocalBounds(this)},r.getBoundingClientRect=function(){return iu.sceneGraphService.getBoundingClientRect(this)},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.computedStyleMap=function(){return new Map(Object.entries(this.computedStyle))},r.getAttributeNames=function(){return Object.keys(this.attributes)},r.getAttribute=function(t){var e=this.attributes[t];if(void 0===e){var n=Xn(t);return ge(e=this.attributes[n])?null:e}return e},r.hasAttribute=function(t){return this.getAttributeNames().includes(t)},r.hasAttributes=function(){return!!this.getAttributeNames().length},r.removeAttribute=function(t){this.setAttribute(t,null),delete this.attributes[t]},r.setAttribute=function(t,e,n){this.attributes[t]=e},r.getAttributeNS=function(t,e){throw new Error(or)},r.getAttributeNode=function(t){throw new Error(or)},r.getAttributeNodeNS=function(t,e){throw new Error(or)},r.hasAttributeNS=function(t,e){throw new Error(or)},r.removeAttributeNS=function(t,e){throw new Error(or)},r.removeAttributeNode=function(t){throw new Error(or)},r.setAttributeNS=function(t,e,n){throw new Error(or)},r.setAttributeNode=function(t){throw new Error(or)},r.setAttributeNodeNS=function(t){throw new Error(or)},r.toggleAttribute=function(t,e){throw new Error(or)},fr(n,[{key:"className",get:function(){return this.getAttribute("class")||""},set:function(t){this.setAttribute("class",t)}},{key:"classList",get:function(){return this.className.split(" ").filter((function(t){return""!==t}))}},{key:"tagName",get:function(){return this.nodeName}},{key:"children",get:function(){return this.childNodes}},{key:"childElementCount",get:function(){return this.childNodes.length}},{key:"firstElementChild",get:function(){return this.firstChild}},{key:"lastElementChild",get:function(){return this.lastChild}},{key:"parentElement",get:function(){return this.parentNode}},{key:"nextSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t+1]||null}return null}},{key:"previousSibling",get:function(){if(this.parentNode){var t=this.parentNode.childNodes.indexOf(this);return this.parentNode.childNodes[t-1]||null}return null}}]),n}(Ua),Ja=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).altKey=void 0,e.button=void 0,e.buttons=void 0,e.ctrlKey=void 0,e.metaKey=void 0,e.relatedTarget=void 0,e.shiftKey=void 0,e.client=new Bn,e.movement=new Bn,e.offset=new Bn,e.global=new Bn,e.screen=new Bn,e}dr(e,t);var n=e.prototype;return n.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},n.initMouseEvent=function(){throw new Error(or)},fr(e,[{key:"clientX",get:function(){return this.client.x}},{key:"clientY",get:function(){return this.client.y}},{key:"movementX",get:function(){return this.movement.x}},{key:"movementY",get:function(){return this.movement.y}},{key:"offsetX",get:function(){return this.offset.x}},{key:"offsetY",get:function(){return this.offset.y}},{key:"globalX",get:function(){return this.global.x}},{key:"globalY",get:function(){return this.global.y}},{key:"screenX",get:function(){return this.screen.x}},{key:"screenY",get:function(){return this.screen.y}}]),e}(Da),$a=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).pointerId=void 0,e.width=0,e.height=0,e.isPrimary=!1,e.pointerType=void 0,e.pressure=void 0,e.tangentialPressure=void 0,e.tiltX=void 0,e.tiltY=void 0,e.twist=void 0,e}dr(e,t);var n=e.prototype;return n.getCoalescedEvents=function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]},n.getPredictedEvents=function(){throw new Error("getPredictedEvents is not supported!")},n.clone=function(){return this.manager.clonePointerEvent(this)},e}(Ja),ts=function(t){function e(){for(var e,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).deltaMode=void 0,e.deltaX=void 0,e.deltaY=void 0,e.deltaZ=void 0,e.DOM_DELTA_LINE=0,e.DOM_DELTA_PAGE=1,e.DOM_DELTA_PIXEL=2,e}return dr(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Ja),es=new za(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,za.MODIFICATION,null,null),ns={anchor:"",opacity:"",fillOpacity:"",strokeOpacity:"",fill:"",stroke:"",transform:"",transformOrigin:"",visibility:"",pointerEvents:"",lineWidth:"",lineCap:"",lineJoin:"",increasedLineWidthForHitTesting:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",zIndex:"",filter:"",shadowType:""},rs={anchor:[0,0],fill:ai,stroke:ai,transform:[],zIndex:0,filter:[],shadowType:"outer"},is=["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting","fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"],os=function(e){function n(n){var r,i;return(i=e.call(this)||this).config=void 0,i.isCustomElement=!1,i.isMutationObserved=!1,i.activeAnimations=[],i.getClip=function(){return this.style.clipPath||null},i.config=n,i.config.interactive=null!==(r=i.config.capture)&&void 0!==r?r:i.config.interactive,i.id=i.config.id||"",i.name=i.config.name||"",(i.config.className||i.config.class)&&(i.className=i.config.className||i.config.class),i.nodeName=i.config.type||t.Shape.GROUP,i.config.style=pr({},i.config.style,i.config.attrs),null!=i.config.visible&&(i.config.style.visibility=!1===i.config.visible?"hidden":"visible"),null!=i.config.interactive&&(i.config.style.pointerEvents=!1===i.config.interactive?"none":"auto"),Object.assign(i.parsedStyle,rs,i.config.initialParsedStyle),Object.assign(i.attributes,ns),i.initAttributes(i.config.style),i.style=new Proxy({setProperty:function(t,e){i.setAttribute(t,e)},getPropertyValue:function(t){return i.getAttribute(t)},removeProperty:function(t){i.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:i.getAttribute(e)},set:function(t,e,n){return i.setAttribute(e,n),!0}}),iu.displayObjectPool.add(i.entity,yr(i)),i}dr(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),iu.displayObjectPool.remove(this.entity),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t,e){var r=pr({},this.attributes);for(var i in r){var o=r[i];o instanceof n&&"clipPath"!==i&&"offsetPath"!==i&&"textPath"!==i&&(r[i]=o.cloneNode(t)),e&&(r[i]=e(i,o))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:r});return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a},r.initAttributes=function(t){void 0===t&&(t={});var e=this.renderable;iu.styleValueRegistry.processProperties(this,t,{forceUpdateGeometry:!0,usedAttributes:is}),e.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=Xn(t);Ne(n)||(r||n!==this.attributes[i])&&(this.internalSetAttribute(i,n),e.prototype.setAttribute.call(this,i,n))},r.internalSetAttribute=function(t,e,n){var r;void 0===n&&(n={});var i=this.renderable,o=this.attributes[t],a=this.parsedStyle[t];iu.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&(es.relatedNode=this,es.prevValue=o,es.newValue=e,es.attrName=t,es.prevParsedValue=a,es.newParsedValue=s,this.isMutationObserved?this.dispatchEvent(es):(es.target=this,this.ownerDocument.defaultView.dispatchEvent(es,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,o,e,a,s)},r.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],r=e[1],i=t.getMax();return new Vn(n,r,i[0]-n,i[1]-r)},r.setOrigin=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),iu.sceneGraphService.setOrigin(this,Po(t,e,n)),this},r.getOrigin=function(){return iu.sceneGraphService.getOrigin(this)},r.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),iu.sceneGraphService.setPosition(this,Po(t,e,n)),this},r.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),iu.sceneGraphService.setLocalPosition(this,Po(t,e,n)),this},r.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),iu.sceneGraphService.translate(this,Po(t,e,n)),this},r.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),iu.sceneGraphService.translateLocal(this,Po(t,e,n)),this},r.getPosition=function(){return iu.sceneGraphService.getPosition(this)},r.getLocalPosition=function(){return iu.sceneGraphService.getLocalPosition(this)},r.scale=function(t,e,n){return this.scaleLocal(t,e,n)},r.scaleLocal=function(t,e,n){return"number"==typeof t&&(t=Po(t,e=e||t,n=n||t)),iu.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=Po(t,e=e||t,n=n||t)),iu.sceneGraphService.setLocalScale(this,t),this},r.getLocalScale=function(){return iu.sceneGraphService.getLocalScale(this)},r.getScale=function(){return iu.sceneGraphService.getScale(this)},r.getEulerAngles=function(){return No(Ao(q(),iu.sceneGraphService.getWorldTransform(this))[2])},r.getLocalEulerAngles=function(){return No(Ao(q(),iu.sceneGraphService.getLocalRotation(this))[2])},r.setEulerAngles=function(t){return iu.sceneGraphService.setEulerAngles(this,0,0,t),this},r.setLocalEulerAngles=function(t){return iu.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},r.rotateLocal=function(t,e,n){return ge(e)&&ge(n)?iu.sceneGraphService.rotateLocal(this,0,0,t):iu.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return ge(e)&&ge(n)?iu.sceneGraphService.rotate(this,0,0,t):iu.sceneGraphService.rotate(this,t,e,n),this},r.setRotation=function(t,e,n,r){return iu.sceneGraphService.setRotation(this,t,e,n,r),this},r.setLocalRotation=function(t,e,n,r){return iu.sceneGraphService.setLocalRotation(this,t,e,n,r),this},r.setLocalSkew=function(t,e){return iu.sceneGraphService.setLocalSkew(this,t,e),this},r.getRotation=function(){return iu.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return iu.sceneGraphService.getLocalRotation(this)},r.getLocalSkew=function(){return iu.sceneGraphService.getLocalSkew(this)},r.getLocalTransform=function(){return iu.sceneGraphService.getLocalTransform(this)},r.getWorldTransform=function(){return iu.sceneGraphService.getWorldTransform(this)},r.setLocalTransform=function(t){return iu.sceneGraphService.setLocalTransform(this,t),this},r.resetLocalTransform=function(){iu.sceneGraphService.resetLocalTransform(this)},r.getAnimations=function(){return this.activeAnimations},r.animate=function(t,e){var n,r=null===(n=this.ownerDocument)||void 0===n?void 0:n.timeline;return r?r.play(this,t,e):null},r.isVisible=function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)},r.isInteractive=function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)},r.isCulled=function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)},r.toFront=function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))+1),this},r.toBack=function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,this.parentNode.children.map((function(t){return Number(t.style.zIndex)})))-1),this},r.getConfig=function(){return this.config},r.attr=function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],o=n[1];return i?Ee(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,o),this):this.attributes[i]:this.attributes},r.getMatrix=function(t){var e=t||this.getWorldTransform(),n=F(q(),e),r=n[0],i=n[1],o=G(q(),e),a=o[0],s=o[1],u=U(vt(),e),c=Ao(q(),u);return Oo(c[0]||c[2],r,i,a,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=_o(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,o)},r.setLocalMatrix=function(t){var e=_o(t),n=e[0],r=e[1],i=e[2],o=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,o)},r.show=function(){this.style.visibility="visible"},r.hide=function(){this.style.visibility="hidden"},r.getCount=function(){return this.childElementCount},r.getParent=function(){return this.parentElement},r.getChildren=function(){return this.children},r.getFirst=function(){return this.firstElementChild},r.getLast=function(){return this.lastElementChild},r.getChildByIndex=function(t){return this.children[t]||null},r.add=function(t,e){return this.appendChild(t,e)},r.setClip=function(t){this.style.clipPath=t},r.set=function(t,e){this.config[t]=e},r.get=function(t){return this.config[t]},r.moveTo=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.move=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),this.setPosition(t,e,n),this},r.setZIndex=function(t){return this.style.zIndex=t,this},fr(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(Qa),as=["style"],ss=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=mr(r,as);return e.call(this,pr({type:t.Shape.CIRCLE,style:pr({cx:"",cy:"",r:""},i),initialParsedStyle:{anchor:[.5,.5]}},o))||this}return dr(n,e),n}(os),us=["style"],cs=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,o=mr(r,us);return(n=t.call(this,pr({style:pr({x:"",y:""},i)},o))||this).isCustomElement=!0,n}return dr(e,t),e}(os),ls={},hs=[],fs=function(){function e(){}var n=e.prototype;return n.getByEntity=function(t){return ls[t]},n.getAll=function(){return Object.keys(ls).map((function(t){return ls[t]}))},n.add=function(e,n){ls[e]=n,n.nodeName===t.Shape.HTML&&hs.push(n)},n.remove=function(e){var n=ls[e];if(n&&(delete ls[e],n.nodeName===t.Shape.HTML)){var r=hs.indexOf(n);hs.splice(r,1)}},n.getHTMLs=function(){return hs},e}(),ps=["style"],ds=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=mr(r,ps);return e.call(this,pr({type:t.Shape.ELLIPSE,style:pr({cx:"",cy:"",rx:"",ry:""},i),initialParsedStyle:{anchor:[.5,.5]}},o))||this}return dr(n,e),n}(os),vs=["style"],ms=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=mr(r,vs);return e.call(this,pr({type:t.Shape.GROUP,style:pr({x:"",y:"",width:"",height:""},i)},o))||this}return dr(n,e),n}(os),ys=["style"],gs=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=mr(i,ys);return(r=e.call(this,pr({type:t.Shape.HTML,style:pr({x:"",y:"",width:"auto",height:"auto",innerHTML:""},o)},a))||this).cullable.enable=!1,r}dr(n,e);var r=n.prototype;return r.getDomElement=function(){return this.parsedStyle.$el},r.getBoundingClientRect=function(){return this.parsedStyle.$el.getBoundingClientRect()},r.getClientRects=function(){return[this.getBoundingClientRect()]},r.getBounds=function(){var t,e,n=this.getBoundingClientRect(),r=null===(t=this.ownerDocument)||void 0===t||null===(e=t.defaultView)||void 0===e?void 0:e.getContextService().getBoundingClientRect();if(r){var i=n.left-r.left,o=n.top-r.top,a=new Dn;return a.setMinMax(Q(i,o,0),Q(i+n.width,o+n.height,0)),a}return null},r.getLocalBounds=function(){if(this.parentNode){var t=N(b(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Dn.isEmpty(e)){var n=new Dn;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(os),xs=["style"],Es=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=mr(r,xs);return e.call(this,pr({type:t.Shape.IMAGE,style:pr({x:"",y:"",img:"",width:"",height:""},i)},o))||this}return dr(n,e),n}(os),Ts=["style"],bs=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=mr(i,Ts);(r=e.call(this,pr({type:t.Shape.LINE,style:pr({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0;var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd;return u&&u instanceof os&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),c&&c instanceof os&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}dr(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"x1"===t||"y1"===t||"x2"===t||"y2"===t||"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof os&&(this.markerStartAngle=0,r.remove()),i&&i instanceof os&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&r instanceof os&&(this.markerEndAngle=0,r.remove()),i&&i instanceof os&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},r.transformMarker=function(t){var e=this.parsedStyle,n=e.x1,r=e.x2,i=e.y1,o=e.y2,a=e.defX,s=e.defY,u=t?e.markerStart:e.markerEnd;if(u&&u instanceof os){var c,l,h,f,p,d,v;t?(f=n-a,p=i-s,l=r-n,h=o-i,d=e.markerStartOffset||0,v=this.markerStartAngle):(f=r-a,p=o-s,l=n-r,h=i-o,d=e.markerEndOffset||0,v=this.markerEndAngle),c=Math.atan2(h,l),u.setLocalEulerAngles(180*c/Math.PI+v),u.setLocalPosition(f+Math.cos(c)*d,p+Math.sin(c)*d)}},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=ln.pointAt(n.x1,n.y1,n.x2,n.y2,t),a=o.x,s=o.y,u=st(q(),Q(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Bn(u[0],u[1])},r.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},r.getTotalLength=function(){var t=this.parsedStyle;return ln.length(t.x1,t.y1,t.x2,t.y2)},n}(os),ws=["style"],ks=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=mr(i,ws);(r=e.call(this,pr({type:t.Shape.PATH,style:pr({path:"",miterLimit:""},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&u instanceof os&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&l instanceof os&&r.placeMarkerMid(l),c&&c instanceof os&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}dr(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"path"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof os&&(this.markerStartAngle=0,r.remove()),i&&i instanceof os&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof os&&(this.markerEndAngle=0,r.remove()),i&&i instanceof os&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,o=e.defY,a=t?e.markerStart:e.markerEnd;if(a&&a instanceof os){var s,u,c,l,h,f,p;if(t){var d=this.getStartTangent(),v=d[0],m=d[1];l=m[0]-i,h=m[1]-o,u=v[0]-m[0],c=v[1]-m[1],f=n||0,p=this.markerStartAngle}else{var y=this.getEndTangent(),g=y[0],x=y[1];l=x[0]-i,h=x[1]-o,u=g[0]-x[0],c=g[1]-x[1],f=r||0,p=this.markerEndAngle}s=Math.atan2(c,u),a.setLocalEulerAngles(180*s/Math.PI+p),a.setLocalPosition(l+Math.cos(s)*f,h+Math.sin(s)*f)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.path.segments,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),t&&t instanceof os)for(var o=1;n.length-1>o;o++){var a=n[o].currentPoint,s=a[0],u=a[1],c=1===o?t:t.cloneNode(!0);this.markerMidList.push(c),this.appendChild(c),c.setLocalPosition(s-r,u-i)}},r.getTotalLength=function(){return Vo(this)},r.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=function(t,e,n){return fe(t,e,Lt(Lt({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),a=o.x,s=o.y,u=st(q(),Q(a-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Bn(u[0],u[1])},r.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Vo(this),e)},r.getStartTangent=function(){var t=this.parsedStyle.path.segments,e=[];if(t.length>1){var n=t[0].currentPoint,r=t[1].currentPoint,i=t[1].startTangent;e=[],i?(e.push([n[0]-i[0],n[1]-i[1]]),e.push([n[0],n[1]])):(e.push([r[0],r[1]]),e.push([n[0],n[1]]))}return e},r.getEndTangent=function(){var t=this.parsedStyle.path.segments,e=t.length,n=[];if(e>1){var r=t[e-2].currentPoint,i=t[e-1].currentPoint,o=t[e-1].endTangent;n=[],o?(n.push([i[0]-o[0],i[1]-o[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},n}(os),Ms=["style"],Ps=function(e){function n(n){var r,i=void 0===n?{}:n,o=i.style,a=mr(i,Ms);(r=e.call(this,pr({type:t.Shape.POLYGON,style:pr({points:"",miterLimit:"",isClosed:!0},o)},a))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,c=s.markerEnd,l=s.markerMid;return u&&u instanceof os&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&l instanceof os&&r.placeMarkerMid(l),c&&c instanceof os&&(r.markerEndAngle=c.getLocalEulerAngles(),r.appendChild(c)),r.transformMarker(!0),r.transformMarker(!1),r}dr(n,e);var r=n.prototype;return r.attributeChangedCallback=function(t,e,n,r,i){"points"===t?(this.transformMarker(!0),this.transformMarker(!1),this.placeMarkerMid(this.parsedStyle.markerMid)):"markerStartOffset"===t||"markerEndOffset"===t?(this.transformMarker(!0),this.transformMarker(!1)):"markerStart"===t?(r&&r instanceof os&&(this.markerStartAngle=0,r.remove()),i&&i instanceof os&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&r instanceof os&&(this.markerEndAngle=0,r.remove()),i&&i instanceof os&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)},r.transformMarker=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY,o=t?e.markerStart:e.markerEnd;if(o&&o instanceof os){var a,s,u,c,l,h,f;if(c=n[0][0]-r,l=n[0][1]-i,t)s=n[1][0]-n[0][0],u=n[1][1]-n[0][1],h=e.markerStartOffset||0,f=this.markerStartAngle;else{var p=n.length;this.style.isClosed?(s=n[p-1][0]-n[0][0],u=n[p-1][1]-n[0][1]):(c=n[p-1][0]-r,l=n[p-1][1]-i,s=n[p-2][0]-n[p-1][0],u=n[p-2][1]-n[p-1][1]),h=e.markerEndOffset||0,f=this.markerEndAngle}a=Math.atan2(u,s),o.setLocalEulerAngles(180*a/Math.PI+f),o.setLocalPosition(c+Math.cos(a)*h,l+Math.sin(a)*h)}},r.placeMarkerMid=function(t){var e=this.parsedStyle,n=e.points.points,r=e.defX,i=e.defY;if(this.markerMidList.forEach((function(t){t.remove()})),this.markerMidList=[],t&&t instanceof os)for(var o=1;(this.style.isClosed?n.length:n.length-1)>o;o++){var a=n[o][0]-r,s=n[o][1]-i,u=1===o?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(a,s)}},n}(os),Ss=["style"],Ns=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=mr(r,Ss);return e.call(this,pr({type:t.Shape.POLYLINE,style:pr({points:"",miterLimit:"",isClosed:!1},i)},o))||this}dr(n,e);var r=n.prototype;return r.getTotalLength=function(){return this.parsedStyle.points.totalLength},r.getPointAtLength=function(t,e){return void 0===e&&(e=!1),this.getPoint(t/this.getTotalLength(),e)},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,o=n.points,a=o.points,s=0,u=0;o.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var c=ln.pointAt(a[u][0],a[u][1],a[u+1][0],a[u+1][1],s),l=c.x,h=c.y,f=st(q(),Q(l-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Bn(f[0],f[1])},r.getStartTangent=function(){var t=this.parsedStyle.points.points,e=[];return e.push([t[1][0],t[1][1]]),e.push([t[0][0],t[0][1]]),e},r.getEndTangent=function(){var t=this.parsedStyle.points.points,e=t.length-1,n=[];return n.push([t[e-1][0],t[e-1][1]]),n.push([t[e][0],t[e][1]]),n},n}(Ps),Cs=["style"],As=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=mr(r,Cs);return e.call(this,pr({type:t.Shape.RECT,style:pr({x:"",y:"",width:"",height:"",radius:""},i)},o))||this}return dr(n,e),n}(os),Os=["style"],_s=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,o=mr(r,Os);return e.call(this,pr({type:t.Shape.TEXT,style:pr({x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:""},i)},o))||this}dr(n,e);var r=n.prototype;return r.getComputedTextLength=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0},r.getLineBoundingRects=function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]},r.isOverflowing=function(){return!!this.parsedStyle.isOverflowing},n}(os);(Ya=t.CameraType||(t.CameraType={}))[Ya.ORBITING=0]="ORBITING",Ya[Ya.EXPLORING=1]="EXPLORING",Ya[Ya.TRACKING=2]="TRACKING",(Wa=t.CameraTrackingMode||(t.CameraTrackingMode={}))[Wa.DEFAULT=0]="DEFAULT",Wa[Wa.ROTATIONAL=1]="ROTATIONAL",Wa[Wa.TRANSLATIONAL=2]="TRANSLATIONAL",Wa[Wa.CINEMATIC=3]="CINEMATIC",(Xa=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Xa.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Xa[Xa.PERSPECTIVE=1]="PERSPECTIVE";var Ls,Rs={UPDATED:"updated"},Is=2e-4,Ds=function(){function e(){this.canvas=void 0,this.eventEmitter=new Tn.EventEmitter,this.matrix=b(),this.right=Q(1,0,0),this.up=Q(0,1,0),this.forward=Q(0,0,1),this.position=Q(0,0,1),this.focalPoint=Q(0,0,0),this.distanceVector=Q(0,0,-1),this.distance=1,this.azimuth=0,this.elevation=0,this.roll=0,this.relAzimuth=0,this.relElevation=0,this.relRoll=0,this.dollyingStep=0,this.maxDistance=1/0,this.minDistance=-1/0,this.zoom=1,this.rotateWorld=!1,this.fov=30,this.near=.1,this.far=1e3,this.aspect=1,this.left=void 0,this.rright=void 0,this.top=void 0,this.bottom=void 0,this.projectionMatrix=b(),this.projectionMatrixInverse=b(),this.jitteredProjectionMatrix=void 0,this.view=void 0,this.enableUpdate=!0,this.type=t.CameraType.EXPLORING,this.trackingMode=t.CameraTrackingMode.DEFAULT,this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.frustum=new Un,this.orthoMatrix=b()}var n=e.prototype;return n.isOrtho=function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC},n.getProjectionMode=function(){return this.projectionMode},n.getPerspective=function(){return this.jitteredProjectionMatrix||this.projectionMatrix},n.getPerspectiveInverse=function(){return this.projectionMatrixInverse},n.getFrustum=function(){return this.frustum},n.getPosition=function(){return this.position},n.getFocalPoint=function(){return this.focalPoint},n.getDollyingStep=function(){return this.dollyingStep},n.getNear=function(){return this.near},n.getFar=function(){return this.far},n.getZoom=function(){return this.zoom},n.getOrthoMatrix=function(){return this.orthoMatrix},n.getView=function(){return this.view},n.setEnableUpdate=function(t){this.enableUpdate=t},n.setType=function(e,n){return this.type=e,this.setWorldRotation(this.type===t.CameraType.EXPLORING),this._getAngles(),this.type===t.CameraType.TRACKING&&void 0!==n&&this.setTrackingMode(n),this},n.setProjectionMode=function(t){return this.projectionMode=t,this},n.setTrackingMode=function(e){if(this.type!==t.CameraType.TRACKING)throw new Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this},n.setWorldRotation=function(t){return this.rotateWorld=t,this._getAngles(),this},n.getViewTransform=function(){return N(b(),this.matrix)},n.getWorldTransform=function(){return this.matrix},n.jitterProjectionMatrix=function(t,e){var n=I(b(),[t,e,0]);this.jitteredProjectionMatrix=A(b(),n,this.projectionMatrix)},n.clearJitterProjectionMatrix=function(){this.jitteredProjectionMatrix=void 0},n.setMatrix=function(t){return this.matrix=t,this._update(),this},n.setFov=function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this},n.setAspect=function(t){return this.setPerspective(this.near,this.far,this.fov,t),this},n.setNear=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(e,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,e,this.far),this},n.setFar=function(e){return this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,e,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,e),this},n.setViewOffset=function(e,n,r,i,o,a){return this.aspect=e/n,void 0===this.view&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=r,this.view.offsetY=i,this.view.width=o,this.view.height=a,this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},n.clearViewOffset=function(){return void 0!==this.view&&(this.view.enabled=!1),this.projectionMode===t.CameraProjectionMode.PERSPECTIVE?this.setPerspective(this.near,this.far,this.fov,this.aspect):this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far),this},n.setZoom=function(e){return this.zoom=e,this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC?this.setOrthographic(this.left,this.rright,this.top,this.bottom,this.near,this.far):this.projectionMode===t.CameraProjectionMode.PERSPECTIVE&&this.setPerspective(this.near,this.far,this.fov,this.aspect),this},n.setZoomByViewportPoint=function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,o=this.roll;this.rotate(0,0,-o),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,o);var a=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=Q(a.x-r,a.y-i,0),u=it(s,this.right)/Z(this.right),c=it(s,this.up)/Z(this.up);return this.pan(-u,-c),this},n.setPerspective=function(e,n,r,i){var o;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var a=this.near*Math.tan(So(.5*this.fov))/this.zoom,s=2*a,u=this.aspect*s,c=-.5*u;if(null===(o=this.view)||void 0===o?void 0:o.enabled){var l=this.view.fullWidth,h=this.view.fullHeight;c+=this.view.offsetX*u/l,a-=this.view.offsetY*s/h,u*=this.view.width/l,s*=this.view.height/h}return function(t,e,n,r,i,o,a){var s=2*o/(r-i),u=(n+e)/(n-e),c=(r+i)/(r-i),l=-(a+o)/(a-o),h=-2*a*o/(a-o);t[0]=2*o/(n-e),t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=u,t[9]=c,t[10]=l,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0}(this.projectionMatrix,c,c+u,a,a-s,e,this.far),_(this.projectionMatrix,this.projectionMatrix,Q(1,-1,1)),N(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},n.setOrthographic=function(e,n,r,i,o,a){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=o,this.far=a;var u=(this.rright-this.left)/(2*this.zoom),c=(this.top-this.bottom)/(2*this.zoom),l=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,f=l-u,p=l+u,d=h+c,v=h-c;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var m=(this.rright-this.left)/this.view.fullWidth/this.zoom,y=(this.top-this.bottom)/this.view.fullHeight/this.zoom;p=(f+=m*this.view.offsetX)+m*this.view.width,v=(d-=y*this.view.offsetY)-y*this.view.height}return j(this.projectionMatrix,f,p,v,d,o,a),_(this.projectionMatrix,this.projectionMatrix,Q(1,-1,1)),N(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this},n.setPosition=function(t,e,n){void 0===e&&(e=this.position[1]),void 0===n&&(n=this.position[2]);var r=Po(t,e,n);return this._setPosition(r),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this},n.setFocalPoint=function(e,n,r){void 0===n&&(n=this.focalPoint[1]),void 0===r&&(r=this.focalPoint[2]);var i=Q(0,1,0);if(this.focalPoint=Po(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var o=et(q(),this.focalPoint,this.position);e=o[0],n=o[1],r=o[2];var a=Z(o),s=No(Math.asin(n/a)),u=90+No(Math.atan2(r,e)),c=b();R(c,c,So(u)),L(c,c,So(s)),i=st(q(),[0,1,0],c)}return N(this.matrix,Y(b(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this},n.getDistance=function(){return this.distance},n.getDistanceVector=function(){return this.distanceVector},n.setDistance=function(t){if(this.distance===t||0>t)return this;this.distance=t,Is>this.distance&&(this.distance=Is),this.dollyingStep=this.distance/100;var e=q(),n=this.forward,r=this.focalPoint;return e[0]=(t=this.distance)*n[0]+r[0],e[1]=t*n[1]+r[1],e[2]=t*n[2]+r[2],this._setPosition(e),this.triggerUpdate(),this},n.setMaxDistance=function(t){return this.maxDistance=t,this},n.setMinDistance=function(t){return this.minDistance=t,this},n.setAzimuth=function(e){return this.azimuth=Mo(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getAzimuth=function(){return this.azimuth},n.setElevation=function(e){return this.elevation=Mo(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getElevation=function(){return this.elevation},n.setRoll=function(e){return this.roll=Mo(e),this.computeMatrix(),this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this.triggerUpdate(),this},n.getRoll=function(){return this.roll},n._update=function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()},n.computeMatrix=function(){var e=mt(vt(),[0,0,1],So(this.roll));P(this.matrix);var n=mt(vt(),[1,0,0],So((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=mt(vt(),[0,1,0],So((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=yt(vt(),r,n);i=yt(vt(),i,e);var o=V(b(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(O(this.matrix,this.matrix,this.focalPoint),A(this.matrix,this.matrix,o),O(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(O(this.matrix,this.matrix,this.position),A(this.matrix,this.matrix,o))},n._setPosition=function(t,e,n){this.position=Po(t,e,n);var r=this.matrix;r[12]=this.position[0],r[13]=this.position[1],r[14]=this.position[2],r[15]=1,this._getOrthoMatrix()},n._getAxes=function(){J(this.right,Po(dt(pt(),[1,0,0,0],this.matrix))),J(this.up,Po(dt(pt(),[0,1,0,0],this.matrix))),J(this.forward,Po(dt(pt(),[0,0,1,0],this.matrix))),rt(this.right,this.right),rt(this.up,this.up),rt(this.forward,this.forward)},n._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=Z(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=No(Math.asin(n/i)),this.azimuth=No(Math.atan2(-e,-r))):(this.elevation=-No(Math.asin(n/i)),this.azimuth=-No(Math.atan2(-e,-r)))},n._getPosition=function(){J(this.position,Po(dt(pt(),[0,0,0,1],this.matrix))),this._getDistance()},n._getFocalPoint=function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],o=e[2];t[0]=r*n[0]+i*n[3]+o*n[6],t[1]=r*n[1]+i*n[4]+o*n[7],t[2]=r*n[2]+i*n[5]+o*n[8]}(this.distanceVector,[0,0,-this.distance],(t=T(),e=this.matrix,t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t)),tt(this.focalPoint,this.position,this.distanceVector),this._getDistance()},n._getDistance=function(){this.distanceVector=et(q(),this.focalPoint,this.position),this.distance=Z(this.distanceVector),this.dollyingStep=this.distance/100},n._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=mt(vt(),[0,0,1],-this.roll*Math.PI/180);B(this.orthoMatrix,n,Q((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),Q(this.zoom,this.zoom,1),e)}},n.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=A(b(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Rs.UPDATED)}},n.rotate=function(t,e,n){throw new Error(or)},n.pan=function(t,e){throw new Error(or)},n.dolly=function(t){throw new Error(or)},n.createLandmark=function(t,e){throw new Error(or)},n.gotoLandmark=function(t,e){throw new Error(or)},e}(),Fs=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),Gs=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),Us=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,o=Math.min(e,r),a=Math.max(e,r),s=Math.min(n,i);return{width:a-o,height:Math.max(n,i)-s}},t}(),Bs=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),Vs=function(){function t(){}return t.prototype.update=function(t){var e=t.points.points,n=Math.min.apply(Math,e.map((function(t){return t[0]}))),r=Math.max.apply(Math,e.map((function(t){return t[0]}))),i=Math.min.apply(Math,e.map((function(t){return t[1]})));return{width:r-n,height:Math.max.apply(Math,e.map((function(t){return t[1]})))-i}},t}(),Hs=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,o=void 0===r?0:r,a=void 0===i?0:i;return n&&!we(n)&&(o||(t.width=o=n.width),a||(t.height=a=n.height)),{width:o,height:a}},t}(),zs=function(){function t(t){this.globalRuntime=void 0,this.globalRuntime=t}var e=t.prototype;return e.isReadyToMeasure=function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!ge(t.lineWidth)},e.update=function(t,e){var n,r,i=t.text,o=t.textAlign,a=t.lineWidth,s=t.textBaseline,u=t.dx,c=t.dy,l=((null==e||null===(n=e.ownerDocument)||void 0===n||null===(r=n.defaultView)||void 0===r?void 0:r.getConfig())||{}).offscreenCanvas;if(!this.isReadyToMeasure(t,e))return t.metrics={font:"",width:0,height:0,lines:[],lineWidths:[],lineHeight:0,maxLineWidth:0,fontProperties:{ascent:0,descent:0,fontSize:0},lineMetrics:[]},{width:0,height:0,x:0,y:0,offsetX:0,offsetY:0};var h=this.globalRuntime.textService.measureText(i,t,l);t.metrics=h;var f=[h.width/2,h.height/2,0],p=[0,1],d=0;"center"===o||"middle"===o?(d=a/2,p=[.5,1]):"right"!==o&&"end"!==o||(d=a,p=[1,1]);var v=0;return"middle"===s?v=f[1]:"top"===s||"hanging"===s?v=2*f[1]:"alphabetic"===s?v=h.lineHeight-h.fontProperties.ascent:"bottom"!==s&&"ideographic"!==s||(v=0),u&&(d+=u),c&&(v+=c),t.anchor=[p[0],p[1],0],{width:2*f[0],height:2*f[1],offsetX:d,offsetY:v}},t}(),js=function(){function t(t,e){var n=this;this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new Tn.EventEmitter,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=b(),this.tmpVec3=q(),this.onPointerDown=function(){var t=lr(ur().mark((function t(e){var r;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof $a){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,n.createPointerEvent(e);case 4:n.dispatchEvent(r=t.sent,"pointerdown"),"touch"===r.pointerType?n.dispatchEvent(r,"touchstart"):"mouse"!==r.pointerType&&"pen"!==r.pointerType||n.dispatchEvent(r,2===r.button?"rightdown":"mousedown"),n.trackingData(e.pointerId).pressTargetsByButton[e.button]=r.composedPath(),n.freeEvent(r);case 10:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUp=function(){var t=lr(ur().mark((function t(e){var r,i,o,a,s,u,c,l,h;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof $a){t.next=2;break}return t.abrupt("return");case 2:return r=performance.now(),t.next=5,n.createPointerEvent(e);case 5:if(n.dispatchEvent(i=t.sent,"pointerup"),"touch"===i.pointerType?n.dispatchEvent(i,"touchend"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.dispatchEvent(i,2===i.button?"rightup":"mouseup"),o=n.trackingData(e.pointerId),a=n.findMountedTarget(o.pressTargetsByButton[e.button]),s=a,a&&!i.composedPath().includes(a)){for(u=a;u&&!i.composedPath().includes(u);)i.currentTarget=u,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType?n.notifyTarget(i,"touchendoutside"):"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Ua.isNode(u)&&(u=u.parentNode);delete o.pressTargetsByButton[e.button],s=u}s&&((l=n.clonePointerEvent(i,"click")).target=s,l.path=[],o.clicksByButton[e.button]||(o.clicksByButton[e.button]={clickCount:0,target:l.target,timeStamp:r}),(h=o.clicksByButton[e.button]).target===l.target&&200>r-h.timeStamp?++h.clickCount:h.clickCount=1,h.target=l.target,h.timeStamp=r,l.detail=h.clickCount,(null===(c=i.detail)||void 0===c?void 0:c.preventClick)||("mouse"!==l.pointerType&&"touch"!==l.pointerType||n.dispatchEvent(l,"click"),n.dispatchEvent(l,"pointertap")),n.freeEvent(l)),n.freeEvent(i);case 14:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerMove=function(){var t=lr(ur().mark((function t(e){var r,i,o,a,s,u,c,l,h,f;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof $a){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,n.createPointerEvent(e);case 4:if(i="mouse"===(r=t.sent).pointerType||"pen"===r.pointerType,o=n.trackingData(e.pointerId),a=n.findMountedTarget(o.overTargets),!o.overTargets||a===r.target){t.next=23;break}return s="mousemove"===e.type?"mouseout":"pointerout",t.next=12,n.createPointerEvent(e,s,a||void 0);case 12:if(n.dispatchEvent(u=t.sent,"pointerout"),i&&n.dispatchEvent(u,"mouseout"),r.composedPath().includes(a)){t.next=22;break}return t.next=18,n.createPointerEvent(e,"pointerleave",a||void 0);case 18:for((c=t.sent).eventPhase=c.AT_TARGET;c.target&&!r.composedPath().includes(c.target);)c.currentTarget=c.target,n.notifyTarget(c),i&&n.notifyTarget(c,"mouseleave"),Ua.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c);case 22:n.freeEvent(u);case 23:if(a===r.target){t.next=38;break}l=n.clonePointerEvent(r,"mousemove"===e.type?"mouseover":"pointerover"),n.dispatchEvent(l,"pointerover"),i&&n.dispatchEvent(l,"mouseover"),h=a&&Ua.isNode(a)&&a.parentNode;case 29:if(!h||h===(Ua.isNode(n.rootTarget)&&n.rootTarget.parentNode)){t.next=35;break}if(h!==r.target){t.next=32;break}return t.abrupt("break",35);case 32:h=h.parentNode,t.next=29;break;case 35:if(!h||h===(Ua.isNode(n.rootTarget)&&n.rootTarget.parentNode)){for((f=n.clonePointerEvent(r,"pointerenter")).eventPhase=f.AT_TARGET;f.target&&f.target!==a&&f.target!==(Ua.isNode(n.rootTarget)&&n.rootTarget.parentNode);)f.currentTarget=f.target,n.notifyTarget(f),i&&n.notifyTarget(f,"mouseenter"),Ua.isNode(f.target)&&(f.target=f.target.parentNode);n.freeEvent(f)}n.freeEvent(l);case 38:n.dispatchEvent(r,"pointermove"),"touch"===r.pointerType&&n.dispatchEvent(r,"touchmove"),i&&(n.dispatchEvent(r,"mousemove"),n.cursor=n.getCursor(r.target)),o.overTargets=r.composedPath(),n.freeEvent(r);case 43:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOut=function(){var t=lr(ur().mark((function t(e){var r,i,o,a,s;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof $a){t.next=2;break}return t.abrupt("return");case 2:if(!(r=n.trackingData(e.pointerId)).overTargets){t.next=19;break}return i="mouse"===e.pointerType||"pen"===e.pointerType,o=n.findMountedTarget(r.overTargets),t.next=8,n.createPointerEvent(e,"pointerout",o||void 0);case 8:return n.dispatchEvent(a=t.sent),i&&n.dispatchEvent(a,"mouseout"),t.next=13,n.createPointerEvent(e,"pointerleave",o||void 0);case 13:for((s=t.sent).eventPhase=s.AT_TARGET;s.target&&s.target!==(Ua.isNode(n.rootTarget)&&n.rootTarget.parentNode);)s.currentTarget=s.target,n.notifyTarget(s),i&&n.notifyTarget(s,"mouseleave"),Ua.isNode(s.target)&&(s.target=s.target.parentNode);r.overTargets=null,n.freeEvent(a),n.freeEvent(s);case 19:n.cursor=null;case 20:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerOver=function(){var t=lr(ur().mark((function t(e){var r,i,o,a;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof $a){t.next=2;break}return t.abrupt("return");case 2:return r=n.trackingData(e.pointerId),t.next=5,n.createPointerEvent(e);case 5:for(o="mouse"===(i=t.sent).pointerType||"pen"===i.pointerType,n.dispatchEvent(i,"pointerover"),o&&n.dispatchEvent(i,"mouseover"),"mouse"===i.pointerType&&(n.cursor=n.getCursor(i.target)),(a=n.clonePointerEvent(i,"pointerenter")).eventPhase=a.AT_TARGET;a.target&&a.target!==(Ua.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),o&&n.notifyTarget(a,"mouseenter"),Ua.isNode(a.target)&&(a.target=a.target.parentNode);r.overTargets=i.composedPath(),n.freeEvent(i),n.freeEvent(a);case 16:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onPointerUpOutside=function(){var t=lr(ur().mark((function t(e){var r,i,o,a;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof $a){t.next=2;break}return t.abrupt("return");case 2:return r=n.trackingData(e.pointerId),i=n.findMountedTarget(r.pressTargetsByButton[e.button]),t.next=6,n.createPointerEvent(e);case 6:if(o=t.sent,i){for(a=i;a;)o.currentTarget=a,n.notifyTarget(o,"pointerupoutside"),"touch"===o.pointerType||"mouse"!==o.pointerType&&"pen"!==o.pointerType||n.notifyTarget(o,2===o.button?"rightupoutside":"mouseupoutside"),Ua.isNode(a)&&(a=a.parentNode);delete r.pressTargetsByButton[e.button]}n.freeEvent(o);case 9:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.onWheel=function(){var t=lr(ur().mark((function t(e){var r;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e instanceof ts){t.next=2;break}return t.abrupt("return");case 2:return t.next=4,n.createWheelEvent(e);case 4:n.dispatchEvent(r=t.sent),n.freeEvent(r);case 7:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),this.globalRuntime=t,this.context=e}var e=t.prototype;return e.init=function(){this.rootTarget=this.context.renderingContext.root.parentNode,this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)},e.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Bn(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))},e.viewport2Client=function(t){var e=this.context.contextService.getBoundingClientRect();return new Bn(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))},e.viewport2Canvas=function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,o=i.width,a=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),c=A(this.tmpMatrix,u,s),l=$(this.tmpVec3,e/o*2-1,2*(1-n/a)-1,0);return st(l,l,c),new Bn(l[0],l[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=A(this.tmpMatrix,n,r),o=$(this.tmpVec3,t.x,t.y,0);st(this.tmpVec3,this.tmpVec3,i);var a=this.context.config;return new Bn((o[0]+1)/2*a.width,(1-(o[1]+1)/2)*a.height)},e.setPickHandler=function(t){this.pickHandler=t},e.addEventMapping=function(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort((function(t,e){return t.priority-e.priority}))},e.mapEvent=function(t){if(this.rootTarget){var e=this.mappingTable[t.type];if(e)for(var n=0,r=e.length;r>n;n++)e[n].fn(t);else console.warn("[EventService]: Event mapping not defined for "+t.type)}},e.dispatchEvent=function(t,e,n){n?(t.eventPhase=t.AT_TARGET,t.currentTarget=this.rootTarget.defaultView||null,this.notifyListeners(t,e)):(t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e));this.emitter.emit(e||t.type,t)},e.propagate=function(t,e){if(t.target){var n=t.composedPath();t.eventPhase=t.CAPTURING_PHASE;for(var r=n.length-1;r>=1;r--)if(t.currentTarget=n[r],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return;if(t.eventPhase=t.AT_TARGET,t.currentTarget=t.target,this.notifyTarget(t,e),!t.propagationStopped&&!t.propagationImmediatelyStopped){var i=n.indexOf(t.currentTarget);t.eventPhase=t.BUBBLING_PHASE;for(var o=i+1;n.length>o;o++)if(t.currentTarget=n[o],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}},e.propagationPath=function(t){var e=[t],n=this.rootTarget.defaultView||null;if(n&&n===t)return e.unshift(n.document),e;for(var r=0;2048>r&&t!==this.rootTarget;r++)Ua.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},e.hitTest=function(){var t=lr(ur().mark((function t(e){var n,r,i,o,a;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.viewportY,o=(i=this.context.config).width,a=i.height,!(0>(n=e.viewportX)||0>r||n>o||r>a)){t.next=4;break}return t.abrupt("return",null);case 4:return t.next=6,this.pickHandler(e);case 6:if(t.t1=t.sent,t.t1){t.next=9;break}t.t1=this.rootTarget;case 9:if(t.t0=t.t1,t.t0){t.next=12;break}t.t0=null;case 12:return t.abrupt("return",t.t0);case 13:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.isNativeEventFromCanvas=function(t){var e,n=this.context.contextService.getDomElement(),r=null===(e=t.nativeEvent)||void 0===e?void 0:e.target;if(r){if(r===n)return!0;if(n&&n.contains)return n.contains(r)}return!!t.nativeEvent.composedPath&&t.nativeEvent.composedPath().indexOf(n)>-1},e.getExistedHTML=function(t){if(t.nativeEvent.composedPath)for(var e,n=xr(this.globalRuntime.displayObjectPool.getHTMLs());!(e=n()).done;){var r=e.value;if(t.nativeEvent.composedPath().indexOf(r)>-1)return r}return null},e.pickTarget=function(){var t=lr(ur().mark((function t(e){return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",this.hitTest({clientX:e.clientX,clientY:e.clientY,viewportX:e.viewportX,viewportY:e.viewportY,x:e.canvasX,y:e.canvasY}));case 1:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.createPointerEvent=function(){var t=lr(ur().mark((function t(e,n,r){var i,o;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=this.allocateEvent($a),this.copyPointerData(e,i),this.copyMouseData(e,i),this.copyData(e,i),i.nativeEvent=e.nativeEvent,i.originalEvent=e,o=this.getExistedHTML(i),null==r){t.next=11;break}t.t0=r,t.next=20;break;case 11:if(t.t1=o,t.t1){t.next=19;break}if(t.t2=this.isNativeEventFromCanvas(i),!t.t2){t.next=18;break}return t.next=17,this.pickTarget(i);case 17:t.t2=t.sent;case 18:t.t1=t.t2;case 19:t.t0=t.t1;case 20:return i.target=t.t0,"string"==typeof n&&(i.type=n),t.abrupt("return",i);case 23:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),e.createWheelEvent=function(){var t=lr(ur().mark((function t(e){var n,r;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=this.allocateEvent(ts),this.copyWheelData(e,n),this.copyMouseData(e,n),this.copyData(e,n),n.nativeEvent=e.nativeEvent,n.originalEvent=e,r=this.getExistedHTML(n),t.t0=r,t.t0){t.next=15;break}if(t.t1=this.isNativeEventFromCanvas(n),!t.t1){t.next=14;break}return t.next=13,this.pickTarget(n);case 13:t.t1=t.sent;case 14:t.t0=t.t1;case 15:return n.target=t.t0,t.abrupt("return",n);case 17:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),e.trackingData=function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]},e.cloneWheelEvent=function(t){var e=this.allocateEvent(ts);return e.nativeEvent=t.nativeEvent,e.originalEvent=t.originalEvent,this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.target=t.target,e.path=t.composedPath().slice(),e.type=e.type,e},e.clonePointerEvent=function(t,e){var n=this.allocateEvent($a);return n.nativeEvent=t.nativeEvent,n.originalEvent=t.originalEvent,this.copyPointerData(t,n),this.copyMouseData(t,n),this.copyData(t,n),n.target=t.target,n.path=t.composedPath().slice(),n.type=null!=e?e:n.type,n},e.copyPointerData=function(t,e){t instanceof $a&&e instanceof $a&&(e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist)},e.copyMouseData=function(t,e){t instanceof Ja&&e instanceof Ja&&(e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.shiftKey=t.shiftKey,e.client.copyFrom(t.client),e.movement.copyFrom(t.movement),e.canvas.copyFrom(t.canvas),e.screen.copyFrom(t.screen),e.global.copyFrom(t.global),e.offset.copyFrom(t.offset))},e.copyWheelData=function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ},e.copyData=function(t,e){e.isTrusted=t.isTrusted,e.timeStamp=performance.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.page.copyFrom(t.page),e.viewport.copyFrom(t.viewport)},e.allocateEvent=function(t){this.eventPool.has(t)||this.eventPool.set(t,[]);var e=this.eventPool.get(t).pop()||new t(this);return e.eventPhase=e.NONE,e.currentTarget=null,e.path=[],e.target=null,e},e.freeEvent=function(t){if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");var e=t.constructor;this.eventPool.has(e)||this.eventPool.set(e,[]),this.eventPool.get(e).push(t)},e.notifyTarget=function(t,e){var n;e=null!==(n=e)&&void 0!==n?n:t.type,this.notifyListeners(t,t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?e+"capture":e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)},e.notifyListeners=function(t,e){var n=t.currentTarget.emitter,r=n._events[e];if(r)if("fn"in r)r.once&&n.removeListener(e,r.fn,void 0,!0),r.fn.call(t.currentTarget||r.context,t);else for(var i=0;r.length>i&&!t.propagationImmediatelyStopped;i++)r[i].once&&n.removeListener(e,r[i].fn,void 0,!0),r[i].fn.call(t.currentTarget||r[i].context,t)},e.findMountedTarget=function(t){if(!t)return null;for(var e=t[t.length-1],n=t.length-2;n>=0;n--){var r=t[n];if(!(r===this.rootTarget||Ua.isNode(r)&&r.parentNode===e))break;e=t[n]}return e},e.getCursor=function(t){for(var e=t;e;){var n=Qa.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=Ua.isNode(e)&&e.parentNode}},t}(),Ys=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d");else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d"),this.context&&this.context.measureText||(this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"))}catch(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d")}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t){return this.context||this.getOrCreateCanvas(t),this.context},t}();(Ls=t.RenderReason||(t.RenderReason={}))[Ls.CAMERA_CHANGED=0]="CAMERA_CHANGED",Ls[Ls.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Ls[Ls.NONE=2]="NONE";var Ws,Xs,qs,Ks=function(){function e(e,n){this.globalRuntime=void 0,this.context=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.renderOrderChangedEvent=new Fa(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new sa,dirtycheck:new wa(["object"]),cull:new wa(["object","camera"]),beginFrame:new ya([]),beforeRender:new ya(["objectToRender"]),render:new ya(["objectToRender"]),afterRender:new ya(["objectToRender"]),endFrame:new ya([]),destroy:new ya([]),pick:new ha(["result"]),pickSync:new wa(["result"]),pointerDown:new ya(["event"]),pointerUp:new ya(["event"]),pointerMove:new ya(["event"]),pointerOut:new ya(["event"]),pointerOver:new ya(["event"]),pointerWheel:new ya(["event"]),pointerCancel:new ya(["event"])},this.globalRuntime=e,this.context=n}var n=e.prototype;return n.init=function(){var t=lr(ur().mark((function t(){var e;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=pr({},this.globalRuntime,this.context),this.context.renderingPlugins.forEach((function(t){t.apply(e)})),t.next=4,this.hooks.init.promise();case 4:this.inited=!0;case 5:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.getStats=function(){return this.stats},n.disableDirtyRectangleRendering=function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)},n.render=function(t){var e=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var n=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(n.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),n.renderReasons.size&&this.inited&&(this.renderDisplayObject(n.root,t,n),this.hooks.beginFrame.call(),n.renderListCurrentFrame.forEach((function(t){e.hooks.beforeRender.call(t),e.hooks.render.call(t),e.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),n.renderListCurrentFrame=[],n.renderReasons.clear())},n.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),o=i.enableDirtyCheck,a=i.enableCulling;this.globalRuntime.styleValueRegistry.recalc(t);var s=o?this.hooks.dirtycheck.call(t):t;if(s){var u=a?this.hooks.cull.call(s,this.context.camera):s;u&&(this.stats.rendered++,n.renderListCurrentFrame.push(u))}t.renderable.dirty=!1,t.sortable.renderOrder=this.zIndexCounter++,this.stats.total++;var c=t.sortable,l=!1;c.dirty&&(c.sorted=t.childNodes.slice().sort(Qn),l=!0,c.dirty=!1),(c.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)})),l&&t.forEach((function(t){r.renderOrderChangedEvent.target=t,r.renderOrderChangedEvent.detail={renderOrder:t.sortable.renderOrder},t.ownerDocument.defaultView.dispatchEvent(r.renderOrderChangedEvent,!0)}))},n.destroy=function(){this.inited=!1,this.hooks.destroy.call()},n.dirtify=function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),Zs=/\[\s*(.*)=(.*)\s*\]/,Qs=function(){function t(){}var e=t.prototype;return e.selectOne=function(t,e){var n=this;if(t.startsWith("."))return e.find((function(e){return((null==e?void 0:e.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.find((function(e){return e.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))},e.selectAll=function(t,e){var n=this;if(t.startsWith("."))return e.findAll((function(r){return e!==r&&((null==r?void 0:r.classList)||[]).indexOf(n.getIdOrClassname(t))>-1}));if(t.startsWith("#"))return e.findAll((function(r){return e!==r&&r.id===n.getIdOrClassname(t)}));if(t.startsWith("[")){var r=this.getAttribute(t),i=r.name,o=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===o:n.attributeToString(t,i)===o)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))},e.is=function(t,e){if(t.startsWith("."))return e.className===this.getIdOrClassname(t);if(t.startsWith("#"))return e.id===this.getIdOrClassname(t);if(t.startsWith("[")){var n=this.getAttribute(t),r=n.name,i=n.value;return"name"===r?e.name===i:this.attributeToString(e,r)===i}return e.nodeName===t},e.getIdOrClassname=function(t){return t.substring(1)},e.getAttribute=function(t){var e=t.match(Zs),n="",r="";return e&&e.length>2&&(n=e[1].replace(/"/g,""),r=e[2].replace(/"/g,"")),{name:n,value:r}},e.attributeToString=function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return ge(n)?"":n.toString?n.toString():""},t}(),Js=function(){function e(e){var n,r,i,o,a,s,u,c,l=this;this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new Fa(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(n=vt(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=Q(e,r,i));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var a=vt();Et(a,e[0],e[1],e[2]);var s=l.getRotation(t),u=l.getRotation(t.parentNode);Nt(n,u),xt(n,n),yt(a,n,a),yt(o.localRotation,a,s),At(o.localRotation,o.localRotation),l.dirtifyLocal(t,o)}else l.rotateLocal(t,e)}),this.rotateLocal=(r=vt(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=Q(e,n,i));var o=t.transformable;Et(r,e[0],e[1],e[2]),Ct(o.localRotation,o.localRotation,r),l.dirtifyLocal(t,o)}),this.setEulerAngles=(i=vt(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Q(e,n,r));var o=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){Et(o.localRotation,e[0],e[1],e[2]);var a=l.getRotation(t.parentNode);Nt(i,xt(vt(),a)),Ct(o.localRotation,o.localRotation,i),l.dirtifyLocal(t,o)}else l.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Q(e,n,r));var i=t.transformable;ut(e,q())||(function(t,e,n){var r=n[0],i=n[1],o=n[2],a=e[0],s=e[1],u=e[2],c=i*u-o*s,l=o*a-r*u,h=r*s-i*a,f=i*h-o*l,p=o*c-r*h,d=r*l-i*c,v=2*n[3];l*=v,h*=v,p*=2,d*=2,t[0]=a+(c*=v)+(f*=2),t[1]=s+l+p,t[2]=u+h+d}(e,e,i.localRotation),tt(i.localPosition,i.localPosition,e),l.dirtifyLocal(t,i))},this.setPosition=(o=b(),a=q(),function(t,e){var n=t.transformable;a[0]=e[0],a[1]=e[1],a[2]=e[2]||0,ut(l.getPosition(t),a)||(J(n.position,a),null!==t.parentNode&&t.parentNode.transformable?(k(o,t.parentNode.transformable.worldTransform),N(o,o),st(n.localPosition,a,o)):J(n.localPosition,a),l.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=q();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,ut(r.localPosition,t)||(J(r.localPosition,t),l.dirtifyLocal(e,r))}}(),this.translate=(s=q(),u=q(),c=q(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=$(u,e,n,r)),ut(e,s)||(tt(c,l.getPosition(t),e),l.setPosition(t,c))}),this.setRotation=function(){var t=vt();return function(e,n,r,i,o){var a=e.transformable;if("number"==typeof n&&(n=St(n,r,i,o)),null!==e.parentNode&&e.parentNode.transformable){var s=l.getRotation(e.parentNode);Nt(t,s),xt(t,t),yt(a.localRotation,t,n),At(a.localRotation,a.localRotation),l.dirtifyLocal(e,a)}else l.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=b(),e=q(),n=St(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(B(r.localTransform,r.localRotation,r.localPosition,Q(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=P(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),A(r.localTransform,r.localTransform,i)}var o=B(t,n,e,r.localScale,r.origin);A(r.localTransform,r.localTransform,o)}else B(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}(),this.runtime=e}var n=e.prototype;return n.matches=function(t,e){return this.runtime.sceneGraphSelector.is(t,e)},n.querySelector=function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)},n.querySelectorAll=function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)},n.attach=function(t,e,n){var r,i;t.parentNode&&this.detach(t),t.parentNode=e,ge(n)?t.parentNode.childNodes.push(t):t.parentNode.childNodes.splice(n,0,t);var o=e.sortable;((null==o||null===(r=o.sorted)||void 0===r?void 0:r.length)||(null===(i=t.style)||void 0===i?void 0:i.zIndex))&&(o.dirty=!0);var a=t.transformable;a&&this.dirtifyWorld(t,a),a.frozen&&this.unfreezeParentToRoot(t)},n.detach=function(t){if(t.parentNode){var e,n,r=t.transformable,i=t.parentNode.sortable;((null==i||null===(e=i.sorted)||void 0===e?void 0:e.length)||(null===(n=t.style)||void 0===n?void 0:n.zIndex))&&(i.dirty=!0);var o=t.parentNode.childNodes.indexOf(t);o>-1&&t.parentNode.childNodes.splice(o,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}},n.getOrigin=function(t){return t.transformable.origin},n.setOrigin=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Q(e,n,r));var i=t.transformable;if(!ut(e,i.origin)){var o=i.origin;o[0]=e[0],o[1]=e[1],o[2]=e[2]||0,this.dirtifyLocal(t,i)}},n.setLocalEulerAngles=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=Q(e,n,r));var i=t.transformable;Et(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},n.scaleLocal=function(t,e){var n,r,i,o=t.transformable;n=o.localScale,r=o.localScale,i=Q(e[0],e[1],e[2]||1),n[0]=r[0]*i[0],n[1]=r[1]*i[1],n[2]=r[2]*i[2],this.dirtifyLocal(t,o)},n.setLocalScale=function(t,e){var n=t.transformable,r=Q(e[0],e[1],e[2]||n.localScale[2]);ut(r,n.localScale)||(J(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=St(e,n,r,i));var o=t.transformable;Nt(o.localRotation,e),this.dirtifyLocal(t,o)},n.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=Ot(e,n));var r,i,o=t.transformable;(r=o.localSkew)[0]=(i=e)[0],r[1]=i[1],this.dirtifyLocal(t,o)},n.dirtifyLocal=function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))},n.dirtifyWorld=function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)},n.triggerPendingEvents=function(){var t=this,e=new Set,n=function(n,r){n.isConnected&&!e.has(n.entity)&&(t.boundsChangedEvent.detail=r,t.boundsChangedEvent.target=n,n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=t[0],r=t[1];r.affectChildren?e.forEach((function(t){n(t,r)})):n(e,r)})),this.pendingEvents=[],e.clear()},n.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;){var r=n.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0),n=n.parentNode}this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])},n.updateDisplayObjectDependency=function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var o=i[t].indexOf(r);i[t].splice(o,1)}}if(n){var a=this.displayObjectDependencyMap.get(n);a||(this.displayObjectDependencyMap.set(n,{}),a=this.displayObjectDependencyMap.get(n)),a[t]||(a[t]=[]),a[t].push(r)}},n.informDependentDisplayObjects=function(e){var n=this,r=this.displayObjectDependencyMap.get(e);r&&Object.keys(r).forEach((function(e){r[e].forEach((function(r){n.dirtifyToRoot(r),r.dispatchEvent(new za(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,za.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},n.getPosition=function(t){var e=t.transformable;return F(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return U(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return G(e.scaling,this.getWorldTransform(t,e))},n.getWorldTransform=function(t,e){return void 0===e&&(e=t.transformable),e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform},n.getLocalPosition=function(t){return t.transformable.localPosition},n.getLocalRotation=function(t){return t.transformable.localRotation},n.getLocalScale=function(t){return t.transformable.localScale},n.getLocalSkew=function(t){return t.transformable.localSkew},n.getLocalTransform=function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform},n.setLocalTransform=function(t,e){var n=F(q(),e),r=U(vt(),e),i=G(q(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)},n.resetLocalTransform=function(t){this.setLocalScale(t,[1,1,1]),this.setLocalPosition(t,[0,0,0]),this.setLocalEulerAngles(t,[0,0,0]),this.setLocalSkew(t,[0,0])},n.getTransformedGeometryBounds=function(t,e,n){void 0===e&&(e=!1);var r=this.getGeometryBounds(t,e);if(Dn.isEmpty(r))return null;var i=n||new Dn;return i.setFromTransformedAABB(r,this.getWorldTransform(t)),i},n.getGeometryBounds=function(t,e){void 0===e&&(e=!1);var n=t.geometry;return(e?n.renderBounds:n.contentBounds||null)||new Dn},n.getBounds=function(t,e){var n=this;void 0===e&&(e=!1);var r=t.renderable;if(!r.boundsDirty&&!e&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&e&&r.renderBounds)return r.renderBounds;var i=e?r.renderBounds:r.bounds,o=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(o?o.add(r):(o=i||new Dn).update(r.center,r.halfExtents))})),e){var a=Jn(t);if(a){var s=a.style.clipPath.getBounds(e);o?s&&(o=s.intersection(o)):o=s}}return o||(o=new Dn),o&&(e?r.renderBounds=o:r.bounds=o),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,o},n.getLocalBounds=function(t){if(t.parentNode){var e=b();t.parentNode.transformable&&(e=N(b(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Dn.isEmpty(n)){var r=new Dn;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);Dn.isEmpty(i)||(r=new Dn).setFromTransformedAABB(i,this.getWorldTransform(t));var o=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var a=r.getMin(),s=a[0],u=a[1],c=r.getMax();return new Vn(s+((null==o?void 0:o.left)||0),u+((null==o?void 0:o.top)||0),c[0]-s,c[1]-u)}return new Vn((null==o?void 0:o.left)||0,(null==o?void 0:o.top)||0,0,0)},n.dirtifyWorldInternal=function(t,e){var n=this;if(!e.dirtyFlag){e.dirtyFlag=!0,e.frozen=!1,t.childNodes.forEach((function(t){var e=t.transformable;e.dirtyFlag||n.dirtifyWorldInternal(t,e)}));var r=t.renderable;r&&(r.renderBoundsDirty=!0,r.boundsDirty=!0,r.dirty=!0)}},n.syncHierarchy=function(t){var e=t.transformable;if(!e.frozen){e.frozen=!0,(e.localDirtyFlag||e.dirtyFlag)&&this.sync(t,e);for(var n=t.childNodes,r=0;n.length>r;r++)this.syncHierarchy(n[r])}},n.sync=function(t,e){if(e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.dirtyFlag){var n=t.parentNode,r=n&&n.transformable;null!==n&&r?A(e.worldTransform,r.worldTransform,e.localTransform):k(e.worldTransform,e.localTransform),e.dirtyFlag=!1}},n.unfreezeParentToRoot=function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}},e}(),$s={MetricsString:"|ÉqÅ",BaselineSymbol:"M",BaselineMultiplier:1.4,HeightMultiplier:2,Newlines:[10,13],BreakingSpaces:[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288]},tu=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,eu=new RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),nu=new RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),ru=function(){function t(t){var e=this;this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!nu.exec(n)&&!eu.exec(t))},this.trimByKinsokuShorui=function(t){var e=[].concat(t),n=e[e.length-2];if(!n)return t;var r=n[n.length-1];return e[e.length-2]=n.slice(0,-1),e[e.length-1]=r+e[e.length-1],e},this.runtime=t}var e=t.prototype;return e.measureFont=function(t,e){if(this.fontMetricsCache[t])return this.fontMetricsCache[t];var n={ascent:0,descent:0,fontSize:0},r=this.runtime.offscreenCanvas.getOrCreateCanvas(e),i=this.runtime.offscreenCanvas.getOrCreateContext(e);i.font=t;var o=$s.MetricsString+$s.BaselineSymbol,a=Math.ceil(i.measureText(o).width),s=Math.ceil(i.measureText($s.BaselineSymbol).width),u=$s.HeightMultiplier*s;s=s*$s.BaselineMultiplier|0,r.width=a,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,a,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(o,0,s);var c=i.getImageData(0,0,a||1,u||1).data,l=c.length,h=4*a,f=0,p=0,d=!1;for(f=0;s>f;++f){for(var v=0;h>v;v+=4)if(255!==c[p+v]){d=!0;break}if(d)break;p+=h}for(n.ascent=s-f,p=l-h,d=!1,f=u;f>s;--f){for(var m=0;h>m;m+=4)if(255!==c[p+m]){d=!0;break}if(d)break;p-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n},e.measureText=function(t,e,n){var r=e.fontSize,i=e.wordWrap,o=e.lineHeight,a=e.lineWidth,s=e.textBaseline,u=e.textAlign,c=e.letterSpacing,l=e.textPath,h=e.leading,f=void 0===h?0:h,p=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,o=t.fontWeight,a=Me(e)&&e+"px"||"16px",s=we(n)?n.split(","):[n],u=s.length-1;u>=0;u--){var c=s[u].trim();!Ma.test(c)&&0>ka.indexOf(c)&&(c='"'+c+'"'),s[u]=c}return r+" "+i+" "+o+" "+a+" "+s.join(",")}(e),d=this.measureFont(p,n);0===d.fontSize&&(d.fontSize=r,d.ascent=r);var v=this.runtime.offscreenCanvas.getOrCreateContext(n);v.font=p,e.isOverflowing=!1;var m=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),y=new Array(m.length),g=0;if(!l){for(var x=0;m.length>x;x++){var E=v.measureText(m[x]).width+(m[x].length-1)*c;y[x]=E,g=Math.max(g,E)}var T=g+a,b=o||d.fontSize+a,w=Math.max(b,d.fontSize+a)+(m.length-1)*(b+f),k=0;return"middle"===s?k=-w/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?k=-w:"top"!==s&&"hanging"!==s||(k=0),{font:p,width:T,height:w,lines:m,lineWidths:y,lineHeight:b+=f,maxLineWidth:g,fontProperties:d,lineMetrics:y.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new Vn(n-a/2,k+e*b,t+a,b)}))}}l.getTotalLength(),l.getPoint(0);for(var M=0;m.length>M;M++)v.measureText(m[M])},e.setGraphemeOnPath=function(){},e.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,o=void 0===i?0:i,a=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,c=e.textOverflow,l=this.runtime.offscreenCanvas.getOrCreateContext(n),h=o+a,f="";"ellipsis"===c?f="...":c&&"clip"!==c&&(f=c);for(var p=[],d=0,v=0,m={},y=function(t){return r.getFromCache(t,a,m,l)},g=Array.from(f).reduce((function(t,e){return t+y(e)}),0),x=Array.from(t),E=0;x.length>E;E++){var T=x[E],b=t[E-1],w=t[E+1],k=y(T);if(this.isNewline(T))v=0,p[++d]="";else{if(v>0&&v+k>h){if(d+1>=u){if(e.isOverflowing=!0,g>0&&h>=g){for(var M=0,P=0,S=0;p[d].length>S;S++){var N=y(p[d][S]);if(M+N+g>h){P=S;break}M+=N}p[d]=(p[d]||"").slice(0,P)+f}break}if(v=0,p[++d]="",this.isBreakingSpace(T))continue;this.canBreakInLastChar(T)||(p=this.trimToBreakable(p),v=this.sumTextWidthByCache(p[d]||"",m)),this.shouldBreakByKinsokuShorui(T,w)&&(p=this.trimByKinsokuShorui(p),v+=y(b||""))}v+=k,p[d]=(p[d]||"")+T}}return p.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&$s.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&$s.Newlines.indexOf(t.charCodeAt(0))>=0},e.trimToBreakable=function(t){var e=[].concat(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),o=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,o),e},e.canBreakInLastChar=function(t){return!t||!tu.test(t)},e.sumTextWidthByCache=function(t,e){return t.split("").reduce((function(t,n){if(!e[n])throw Error("cannot count the word without cache");return t+e[n]}),0)},e.findBreakableIndex=function(t){for(var e=t.length-1;e>=0;e--)if(!tu.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var o=t.length*e;i=r.measureText(t).width+o,n[t]=i}return i},t}(),iu={},ou=(Xs=new Hs,qs=new Vs,(Ws={})[t.Shape.CIRCLE]=new Fs,Ws[t.Shape.ELLIPSE]=new Gs,Ws[t.Shape.RECT]=Xs,Ws[t.Shape.IMAGE]=Xs,Ws[t.Shape.GROUP]=Xs,Ws[t.Shape.LINE]=new Us,Ws[t.Shape.TEXT]=new zs(iu),Ws[t.Shape.POLYLINE]=qs,Ws[t.Shape.POLYGON]=qs,Ws[t.Shape.PATH]=new Bs,Ws[t.Shape.HTML]=null,Ws[t.Shape.MESH]=null,Ws),au=function(){var e,n=new oo,r=new uo;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new po,e[t.PropertySyntax.ANGLE]=new ro,e[t.PropertySyntax.DEFINED_PATH]=new io,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new ao,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new co,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new lo,e[t.PropertySyntax.COORDINATE]=new ho,e[t.PropertySyntax.OFFSET_DISTANCE]=new vo,e[t.PropertySyntax.OPACITY_VALUE]=new mo,e[t.PropertySyntax.PATH]=new yo,e[t.PropertySyntax.LIST_OF_POINTS]=new go,e[t.PropertySyntax.SHADOW_BLUR]=new xo,e[t.PropertySyntax.TEXT]=new Eo,e[t.PropertySyntax.TEXT_TRANSFORM]=new To,e[t.PropertySyntax.TRANSFORM]=new bo,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new wo,e[t.PropertySyntax.Z_INDEX]=new ko,e[t.PropertySyntax.MARKER]=new fo,e}();iu.CameraContribution=Ds,iu.AnimationTimeline=null,iu.EasingFunction=null,iu.offscreenCanvas=new Ys,iu.displayObjectPool=new fs,iu.sceneGraphSelector=new Qs,iu.sceneGraphService=new Js(iu),iu.textService=new ru(iu),iu.geometryUpdaterFactory=ou,iu.CSSPropertySyntaxFactory=au,iu.styleValueRegistry=new Ra,iu.layoutRegistry=null;var su=function(){function t(){this.context=void 0,this.plugins=[]}var e=t.prototype;return e.addRenderingPlugin=function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)},e.removeAllRenderingPlugins=function(){var t=this;this.plugins.forEach((function(e){var n=t.context.renderingPlugins.indexOf(e);0>n||t.context.renderingPlugins.splice(n,1)}))},t}(),uu=function(){function t(t){this.plugins=[],this.config=void 0,this.config=pr({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},t)}var e=t.prototype;return e.registerPlugin=function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)},e.unregisterPlugin=function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)},e.getPlugins=function(){return this.plugins},e.getPlugin=function(t){return this.plugins.find((function(e){return e.name===t}))},e.getConfig=function(){return this.config},e.setConfig=function(t){Object.assign(this.config,t)},t}(),cu=function(){function e(t){this.strategies=void 0,this.strategies=t}return e.prototype.apply=function(n){var r=n.camera,i=n.renderingService,o=n.renderingContext,a=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===a.length?o.unculledEntities.indexOf(e.entity)>-1:a.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new Fa(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}();cu.tag="Culling";var lu=function(){function t(){}return t.prototype.apply=function(e){var n=e.renderingService;n.hooks.dirtycheck.tap(t.tag,(function(t){return t?t.renderable.dirty||n.disableDirtyRectangleRendering()?t:null:t}))},t}();lu.tag="DirtyCheck";var hu=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new $a(null),this.rootWheelEvent=new ts(null),this.context=void 0,this.onPointerMove=function(e){var n,r,i=null===(n=t.context.renderingContext.root)||void 0===n||null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView;if(!i.supportsTouchEvents||"touch"!==e.pointerType){for(var o,a=xr(t.normalizeToPointerEvent(e,i));!(o=a()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,o.value,i);t.context.eventService.mapEvent(s)}t.setCursor(t.context.eventService.cursor)}}}var e=t.prototype;return e.apply=function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler(function(){var t=lr(ur().mark((function t(e){return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,n.context.renderingService.hooks.pick.promise({position:e,picked:[],topmost:!0});case 2:return t.abrupt("return",t.sent.picked[0]||null);case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),r.hooks.pointerWheel.tap(t.tag,(function(t){var e=n.normalizeWheelEvent(t);n.context.eventService.mapEvent(e)})),r.hooks.pointerDown.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.normalizeToPointerEvent(t,i);if(n.autoPreventDefault&&e[0].isNormalized)(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(var r,o=xr(e);!(r=o()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,r.value,i);n.context.eventService.mapEvent(a)}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){for(var e,r=n.context.contextService.getDomElement(),o=r&&t.target&&t.target!==r&&r.contains&&!r.contains(t.target)?"outside":"",a=xr(n.normalizeToPointerEvent(t,i));!(e=a()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,e.value,i);s.type+=o,n.context.eventService.mapEvent(s)}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerMove.tap(t.tag,this.onPointerMove),r.hooks.pointerOver.tap(t.tag,this.onPointerMove),r.hooks.pointerOut.tap(t.tag,this.onPointerMove)},e.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,o=t.clientX,a=t.clientY;if(!this.context.config.supportsCSSTransform||ge(r)||ge(i)){var s=this.context.eventService.client2Viewport(new Bn(o,a));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},e.bootstrapEvent=function(t,e,n){t.view=n,t.originalEvent=null,t.nativeEvent=e,t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist,this.transferMouseData(t,e);var r=this.getViewportXY(e),i=r.y;t.viewport.x=r.x,t.viewport.y=i;var o=this.context.eventService.viewport2Canvas(t.viewport),a=o.y;return t.canvas.x=o.x,t.canvas.y=a,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=e.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=sr[t.type]||t.type),t},e.normalizeWheelEvent=function(t){var e=this.rootWheelEvent;this.transferMouseData(e,t),e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ;var n=this.getViewportXY(t),r=n.y;e.viewport.x=n.x,e.viewport.y=r;var i=this.context.eventService.viewport2Canvas(e.viewport),o=i.y;return e.canvas.x=i.x,e.canvas.y=o,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e},e.transferMouseData=function(t,e){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.altKey=e.altKey,t.metaKey=e.metaKey,t.shiftKey=e.shiftKey,t.ctrlKey=e.ctrlKey,t.button=e.button,t.buttons=e.buttons,t.client.x=e.clientX,t.client.y=e.clientY,t.movement.x=e.movementX,t.movement.y=e.movementY,t.page.x=e.pageX,t.page.y=e.pageY,t.screen.x=e.screenX,t.screen.y=e.screenY,t.relatedTarget=null},e.setCursor=function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")},e.normalizeToPointerEvent=function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];Ne(i.button)&&(i.button=0),Ne(i.buttons)&&(i.buttons=1),Ne(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),Ne(i.width)&&(i.width=i.radiusX||1),Ne(i.height)&&(i.height=i.radiusY||1),Ne(i.tiltX)&&(i.tiltX=0),Ne(i.tiltY)&&(i.tiltY=0),Ne(i.pointerType)&&(i.pointerType="touch"),Ne(i.pointerId)&&(i.pointerId=i.identifier||0),Ne(i.pressure)&&(i.pressure=i.force||.5),Ne(i.twist)&&(i.twist=0),Ne(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var o=t;Ne(o.isPrimary)&&(o.isPrimary=!0),Ne(o.width)&&(o.width=1),Ne(o.height)&&(o.height=1),Ne(o.tiltX)&&(o.tiltX=0),Ne(o.tiltY)&&(o.tiltY=0),Ne(o.pointerType)&&(o.pointerType="mouse"),Ne(o.pointerId)&&(o.pointerId=1),Ne(o.pressure)&&(o.pressure=.5),Ne(o.twist)&&(o.twist=0),Ne(o.tangentialPressure)&&(o.tangentialPressure=0),o.isNormalized=!0,n.push(o)}else n.push(t);return n},t}();hu.tag="Event";var fu,pu=[t.Shape.CIRCLE,t.Shape.ELLIPSE,t.Shape.IMAGE,t.Shape.RECT,t.Shape.LINE,t.Shape.POLYLINE,t.Shape.POLYGON,t.Shape.TEXT,t.Shape.PATH,t.Shape.HTML],du=function(){function e(){}var n=e.prototype;return n.isVisible=function(e,n){var r,i,o=n.cullable;if(!o.enable)return!0;var a=n.getRenderBounds();if(Dn.isEmpty(a))return!1;var s=e.getFrustum(),u=null===(r=n.parentNode)||void 0===r||null===(i=r.cullable)||void 0===i?void 0:i.visibilityPlaneMask;return o.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,a,u||t.Mask.INDETERMINATE,s.planes),o.visible=o.visibilityPlaneMask!==t.Mask.OUTSIDE,o.visible},n.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var o=t.Mask.INSIDE,a=pu.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var c=1<<s;if(0!=(r&c)&&(!a||4!==s&&5!==s)){var l=i[s],h=l.normal,f=l.distance;if(0>it(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>it(h,n.getNegativeFarPoint(i[s]))+f&&(o|=c)}}return o},e}(),vu=function(){function e(){this.rBush=void 0,this.toSync=new Set}var n=e.prototype;return n.apply=function(n){var r=this,i=n.renderingService,o=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var a=function(t){t.target.renderable.dirty=!0,i.dirtify()},s=function(t){var e=t.target;t.detail.affectChildren&&e.forEach((function(t){r.toSync.add(t)}));for(var n=e;n;)n.renderable&&r.toSync.add(n),n=n.parentElement;i.dirtify()},u=function(t){var e=t.target;iu.styleValueRegistry.recalc(e),iu.sceneGraphService.dirtifyToRoot(e),i.dirtify()},c=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),iu.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tapPromise(e.tag,lr(ur().mark((function e(){return ur().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o.addEventListener(t.ElementEvent.MOUNTED,u),o.addEventListener(t.ElementEvent.UNMOUNTED,c),o.addEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.addEventListener(t.ElementEvent.BOUNDS_CHANGED,s);case 4:case"end":return e.stop()}}),e)})))),i.hooks.destroy.tap(e.tag,(function(){o.removeEventListener(t.ElementEvent.MOUNTED,u),o.removeEventListener(t.ElementEvent.UNMOUNTED,c),o.removeEventListener(t.ElementEvent.ATTR_MODIFIED,a),o.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,s)})),i.hooks.endFrame.tap(e.tag,(function(){r.syncRTree()}))},n.syncRTree=function(){var t=this,e=[];Array.from(this.toSync).filter((function(t){return t.isConnected})).forEach((function(n){var r=n.rBushNode;r&&r.aabb&&t.rBush.remove(r.aabb);var i=n.getRenderBounds();if(i){var o=i.getMin(),a=o[0],s=o[1],u=i.getMax(),c=u[0],l=u[1];r.aabb||(r.aabb={}),r.aabb.id=n.entity,r.aabb.minX=a,r.aabb.minY=s,r.aabb.maxX=c,r.aabb.maxY=l}r.aabb&&(isNaN(r.aabb.maxX)||isNaN(r.aabb.maxX)||isNaN(r.aabb.minX)||isNaN(r.aabb.minY)||e.push(r.aabb))})),this.rBush.load(e),e.length=0,this.toSync.clear()},e}();vu.tag="Prepare",(fu=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",fu.BEFORE_RENDER="beforerender",fu.AFTER_RENDER="afterrender",fu.BEFORE_DESTROY="beforedestroy",fu.AFTER_DESTROY="afterdestroy",fu.RESIZE="resize",fu.DIRTY_RECTANGLE="dirtyrectangle";var mu=new Fa(t.ElementEvent.MOUNTED),yu=new Fa(t.ElementEvent.UNMOUNTED),gu=new Fa(t.CanvasEvent.BEFORE_RENDER),xu=new Fa(t.CanvasEvent.AFTER_RENDER),Eu=function(e){function n(n){var r;(r=e.call(this)||this).document=void 0,r.customElements=void 0,r.requestAnimationFrame=void 0,r.cancelAnimationFrame=void 0,r.devicePixelRatio=void 0,r.supportsPointerEvents=void 0,r.supportsTouchEvents=void 0,r.isTouchEvent=void 0,r.isMouseEvent=void 0,r.Element=os,r.frameId=void 0,r.inited=!1,r.readyPromise=void 0,r.resolveReadyPromise=void 0,r.context={},r.document=new Ha,r.document.defaultView=yr(r),r.customElements=new Ia;var i=n.container,o=n.canvas,a=n.offscreenCanvas,s=n.width,u=n.height,c=n.devicePixelRatio,l=n.renderer,h=n.background,f=n.cursor,p=n.document,d=n.requestAnimationFrame,v=n.cancelAnimationFrame,m=n.createImage,y=n.supportsPointerEvents,g=n.supportsTouchEvents,x=n.supportsCSSTransform,E=n.isTouchEvent,T=n.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||Kn++;qn[n]&&qn[n].destroy(),qn[n]=e}}(i,yr(r));var b=s,w=u,k=c;return o&&(k=1>(k=c||Zn&&window.devicePixelRatio||1)?1:Math.ceil(k),b=s||function(t){var e=$n(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(o)||o.width/k,w=u||function(t){var e=$n(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(o)||o.height/k),r.devicePixelRatio=k,r.requestAnimationFrame=null!=d?d:On.bind(globalThis),r.cancelAnimationFrame=null!=v?v:_n.bind(globalThis),r.supportsTouchEvents=null!=g?g:"ontouchstart"in globalThis,r.supportsPointerEvents=null!=y?y:!!globalThis.PointerEvent,r.isTouchEvent=null!=E?E:function(t){return r.supportsTouchEvents&&t instanceof globalThis.TouchEvent},r.isMouseEvent=null!=T?T:function(t){return!globalThis.MouseEvent||t instanceof globalThis.MouseEvent&&(!r.supportsPointerEvents||!(t instanceof globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:o,width:b,height:w,renderer:l,offscreenCanvas:a,devicePixelRatio:k,cursor:f||"default",background:h||"transparent",createImage:m,document:p,supportsCSSTransform:x}),r.initDefaultCamera(b,w),lr(ur().mark((function e(){return ur().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.initRenderer(l);case 2:r.dispatchEvent(new Fa(t.CanvasEvent.READY)),r.readyPromise&&r.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),r}dr(n,e);var r=n.prototype;return r.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},r.initDefaultCamera=function(e,n){var r=this,i=new iu.CameraContribution;i.setType(t.CameraType.EXPLORING,t.CameraTrackingMode.DEFAULT).setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0).setOrthographic(e/-2,e/2,n/2,n/-2,.1,1e3),i.canvas=this,i.eventEmitter.on(Rs.UPDATED,(function(){r.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.context.camera=i},r.getConfig=function(){return this.context.config},r.getRoot=function(){return this.document.documentElement},r.getCamera=function(){return this.context.camera},r.getContextService=function(){return this.context.contextService},r.getEventService=function(){return this.context.eventService},r.getRenderingService=function(){return this.context.renderingService},r.getRenderingContext=function(){return this.context.renderingContext},r.getStats=function(){return this.getRenderingService().getStats()},r.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new Fa(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&this.document.destroy(),this.getContextService().destroy(),this.getRenderingService().destroy(),n||this.dispatchEvent(new Fa(t.CanvasEvent.AFTER_DESTROY))},r.changeSize=function(t,e){this.resize(t,e)},r.resize=function(e,n){var r=this.context.config;r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.context.camera,o=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),o===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new Fa(t.CanvasEvent.RESIZE,{width:e,height:n}))},r.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},r.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},r.removeChild=function(t){return this.document.documentElement.removeChild(t)},r.removeChildren=function(){this.document.documentElement.removeChildren()},r.destroyChildren=function(){this.document.documentElement.destroyChildren()},r.render=function(){this.dispatchEvent(gu),this.getRenderingService().render(this.getConfig()),this.dispatchEvent(xu)},r.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},r.initRenderer=function(){var t=lr(ur().mark((function t(e){return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw new Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new o,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new hu,new vu,new lu,new cu([new du])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(pr({},iu,this.context)),this.context.renderingService=new Ks(iu,this.context),this.context.eventService=new js(iu,this.context),this.context.eventService.init(),t.next=14,this.context.contextService.init();case 14:return t.next=16,this.context.renderingService.init();case 16:this.inited=!0,this.getRoot().forEach((function(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0,e.dirty=!0)})),this.mountChildren(this.getRoot()),e.getConfig().enableAutoRendering&&this.run();case 20:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),r.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init()}))},r.setRenderer=function(){var t=lr(ur().mark((function t(e){var n,r;return ur().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if((n=this.getConfig()).renderer!==e){t.next=3;break}return t.abrupt("return");case 3:return r=n.renderer,n.renderer=e,this.destroy(!1,!0),[].concat(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy()})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),r.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},r.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(yu):(yu.target=t,this.dispatchEvent(yu,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},r.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(mu):(mu.target=t,this.dispatchEvent(mu,!0))):console.warn("[g]: You are trying to call `canvas.appendChild` before canvas' initialization finished. You can either await `canvas.ready` or listen to `CanvasEvent.READY` manually.","appended child: ",t.nodeName),t.childNodes.forEach((function(t){e.mountChildren(t)})),t.isCustomElement&&t.connectedCallback&&t.connectedCallback()},r.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},r.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},r.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},r.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},r.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},r.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},fr(n,[{key:"ready",get:function(){var t=this;return this.readyPromise||(this.readyPromise=new Promise((function(e){t.resolveReadyPromise=function(){e(t)}})),this.inited&&this.resolveReadyPromise()),this.readyPromise}}]),n}(Ga);function Tu(t,e){return Tu=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Tu(t,e)}var bu=function(e){var n,r;function i(){for(var t,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return(t=e.call.apply(e,[this].concat(r))||this).landmarks=[],t.landmarkAnimationID=void 0,t}r=e,(n=i).prototype=Object.create(r.prototype),n.prototype.constructor=n,Tu(n,r);var o=i.prototype;return o.rotate=function(e,n,r){if(this.relElevation=Mo(n),this.relAzimuth=Mo(e),this.relRoll=Mo(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=mt(vt(),[1,0,0],So((this.rotateWorld?1:-1)*this.relElevation)),o=mt(vt(),[0,1,0],So((this.rotateWorld?1:-1)*this.relAzimuth)),a=mt(vt(),[0,0,1],So(this.relRoll)),s=yt(vt(),o,i);s=yt(vt(),s,a);var u=V(b(),s);O(this.matrix,this.matrix,[0,0,-this.distance]),A(this.matrix,this.matrix,u),O(this.matrix,this.matrix,[0,0,this.distance])}else{if(Math.abs(this.elevation)>90)return this;this.computeMatrix()}return this._getAxes(),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getPosition():this.type===t.CameraType.TRACKING&&this._getFocalPoint(),this._update(),this},o.pan=function(t,e){var n=Po(t,e,0),r=K(this.position);return tt(r,r,nt(q(),this.right,n[0])),tt(r,r,nt(q(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},o.dolly=function(e){var n,r=this.forward,i=K(this.position);return n=Math.max(Math.min(this.distance+e*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance,i[0]+=n*r[0],i[1]+=n*r[1],i[2]+=n*r[2],this._setPosition(i),this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?this._getDistance():this.type===t.CameraType.TRACKING&&tt(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},o.createLandmark=function(t,e){void 0===e&&(e={});var n=e.position,r=void 0===n?this.position:n,i=e.focalPoint,o=void 0===i?this.focalPoint:i,a=e.roll,s=e.zoom,u=new iu.CameraContribution;u.setType(this.type,void 0),u.setPosition(r[0],r[1]||this.position[1],r[2]||this.position[2]),u.setFocalPoint(o[0],o[1]||this.focalPoint[1],o[2]||this.focalPoint[2]),u.setRoll(a||this.roll),u.setZoom(s||this.zoom);var c={name:t,matrix:w(u.getWorldTransform()),right:K(u.right),up:K(u.up),forward:K(u.forward),position:K(u.getPosition()),focalPoint:K(u.getFocalPoint()),distanceVector:K(u.getDistanceVector()),distance:u.getDistance(),dollyingStep:u.getDollyingStep(),azimuth:u.getAzimuth(),elevation:u.getElevation(),roll:u.getRoll(),relAzimuth:u.relAzimuth,relElevation:u.relElevation,relRoll:u.relRoll,zoom:u.getZoom()};return this.landmarks.push(c),c},o.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=we(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=Me(e)?{duration:e}:e,o=i.easing,a=void 0===o?"linear":o,s=i.duration,u=void 0===s?100:s,c=i.easingFunction,l=void 0===c?void 0:c,h=i.onfinish,f=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(r),void(f&&f());void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID);var p,d=r.position,v=r.focalPoint,m=r.zoom,y=r.roll,g=l||iu.EasingFunction(a),x=function(){n.setFocalPoint(v),n.setPosition(d),n.setRoll(y),n.setZoom(m),n.computeMatrix(),n.triggerUpdate(),f&&f()};this.canvas.requestAnimationFrame((function t(e){void 0===p&&(p=e);var r=e-p;if(u<r)x();else{var i,o,a=g(r/u),s=q(),c=q();at(s,n.focalPoint,v,a),at(c,n.position,d,a),o=n.roll*(1-a)+y*a,i=n.zoom*(1-a)+m*a,n.setFocalPoint(s),n.setPosition(c),n.setRoll(o),n.setZoom(i),ht(s,v)+ht(c,d)>.01?(n.computeMatrix(),n.triggerUpdate(),u>r&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(t))):x()}}))}},o.syncFromLandmark=function(t){this.matrix=k(this.matrix,t.matrix),this.right=J(this.right,t.right),this.up=J(this.up,t.up),this.forward=J(this.forward,t.forward),this.position=J(this.position,t.position),this.focalPoint=J(this.focalPoint,t.focalPoint),this.distanceVector=J(this.distanceVector,t.distanceVector),this.azimuth=t.azimuth,this.elevation=t.elevation,this.roll=t.roll,this.relAzimuth=t.relAzimuth,this.relElevation=t.relElevation,this.relRoll=t.relRoll,this.dollyingStep=t.dollyingStep,this.distance=t.distance,this.zoom=t.zoom},i}(Ds);iu.CameraContribution=bu;var wu,ku,Mu,Pu,Su=function(t,e,n){this._layoutContext=void 0,this._node=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.node=void 0,this.childFragments=void 0,this.data=void 0,this._layoutContext=t,this._node=e,this.options=n,this.layoutContext=t,this.inlineSize=null==n?void 0:n.inlineSize,this.blockSize=null==n?void 0:n.blockSize,this.childFragments=null==n?void 0:n.childFragments,this.data=n.data,this.node=e};function Nu(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
3
|
-
Vu=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new w(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return M()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),i}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function p(){}var d={};s(d,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(k([])));m&&m!==e&&n.call(m,i)&&(d=m);var y=p.prototype=h.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function E(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return f.prototype=p,s(y,"constructor",p),s(p,"constructor",f),f.displayName=s(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(x.prototype),s(x.prototype,o,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),s(y,a,"Generator"),s(y,i,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),b(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;b(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function Hu(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function zu(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Hu(o,r,i,a,s,"next",t)}function s(t){Hu(o,r,i,a,s,"throw",t)}a(void 0)}))}}function ju(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Yu(t,e,n){return e&&ju(t.prototype,e),n&&ju(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(Du=t.LayoutTaskType||(t.LayoutTaskType={})).Layout="layout",Du.IntrinsicSizes="intrinsic-sizes",function(t){t[t.block=0]="block",t[t.normal=1]="normal"}(Fu||(Fu={})),function(t){t[t["block-like"]=0]="block-like",t[t.manual=1]="manual"}(Gu||(Gu={})),(Uu=t.PropertyName||(t.PropertyName={})).LAYOUT="display",Uu.LEFT="left",Uu.TOP="top",Uu.BOTTOM="bottom",Uu.RIGHT="right",Uu.WIDTH="width",Uu.HEIGHT="height",Uu.MIN_WIDTH="minWidth",Uu.MAX_WIDTH="maxWidth",Uu.MIN_HEIGHT="minHeight",Uu.MAX_HEIGHT="maxHeight",Uu.BOX_SIZING="boxSizing",Uu.PADDING="padding",Uu.PADDING_TOP="paddingTop",Uu.PADDING_BOTTOM="paddingBottom",Uu.PADDING_START="paddingLeft",Uu.PADDING_END="paddingRight",Uu.MARGIN="margin",Uu.MARGIN_TOP="marginTop",Uu.MARGIN_BOTTOM="marginBottom",Uu.MARGIN_START="marginLeft",Uu.MARGIN_END="marginRight",Uu.BORDER="border",Uu.BORDER_TOP="borderTop",Uu.BORDER_BOTTOM="borderBottom",Uu.BORDER_START="borderLeft",Uu.BORDER_END="borderRight",Uu.FLEX_DIRECTION="flexDirection",Uu.FLEX_WRAP="flexWrap",Uu.FLEX_FLOW="flexFlow",Uu.ALIGN_ITEMS="alignItems",Uu.ALIGN_CONTENT="alignContent",Uu.JUSTIFY_CONTENT="justifyContent",Uu.FLEX="flex",Uu.ALIGN_SELF="alignSelf",Uu.FLEX_SHRINK="flexShrink",Uu.FLEX_BASIS="flexBasis",Uu.FLEX_GROW="flexGrow",Uu.OFFSET_WIDTH="offsetWidth",Uu.OFFSET_HEIGHT="offsetHeight",Uu.ORDER="order";var Wu=function(t){if(t.isRejected||t.isFulfilled)return t;var e,n=!0,r=!1,i=!1,o=t.then((function(t){return i=!0,n=!1,e=t,t}),(function(t){throw r=!0,n=!1,t}));return o.isFulfilled=function(){return i},o.isPending=function(){return n},o.isRejected=function(){return r},o.getFullFilledValue=function(){return e},o},Xu=function(){var t=this;this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},qu=function(){function e(t,e){this._layoutContext=void 0,this.options=void 0,this.node=void 0,this.styleMap=void 0,this.layoutContext=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.node=e.node,this.styleMap=e.node.getAllStyle()}var n=e.prototype;return n.intrinsicSizes=function(){var e=new Xu;return this.layoutContext.appendWorkTask({layoutChild:this,taskType:t.LayoutTaskType.IntrinsicSizes,deferred:e}),e.promise},n.layoutNextFragment=function(e){if(this.layoutContext.mode===t.LayoutTaskType.IntrinsicSizes)throw new Error("Not Supported: cant call layoutNextFragment in intrinsicSizes");var n=new Xu;return this.layoutContext.appendWorkTask({layoutConstraints:e,layoutChild:this,taskType:t.LayoutTaskType.Layout,deferred:n}),n.promise},e}(),Ku=0,Zu=function(){function t(t){this.options=void 0,this.contextId=void 0,this.workQueue=[],this.mode=void 0,this.layoutChildrenFactory=void 0,this.fragmentResultFactory=void 0,this.layoutFragmentFactory=void 0,this.options=t,this.contextId=""+Ku++,this.mode=t.mode,this.layoutChildrenFactory=t.layoutChildrenFactory,this.fragmentResultFactory=t.fragmentResultFactory,this.layoutFragmentFactory=t.layoutFragmentFactory}var e=t.prototype;return e.appendWorkTask=function(t){this.workQueue.push(t)},e.clearWorkQueue=function(){this.workQueue=[]},t}(),Qu=function(){};Qu.inputProperties=void 0,Qu.childrenInputProperties=void 0,Qu.layoutOptions=void 0;var Ju=[0,0,0,0],$u=function(t){return void 0===t&&(t=0),new Promise((function(e){setTimeout((function(){e()}),t)}))},tc=function(){function e(t,e,n){this._layoutRegistry=void 0,this._layoutContextFactory=void 0,this._layoutEdgesFactory=void 0,this.layoutRegistry=void 0,this.layoutContextFactory=void 0,this.layoutEdgesFactory=void 0,this._layoutRegistry=t,this._layoutContextFactory=e,this._layoutEdgesFactory=n,this.layoutRegistry=t,this.layoutContextFactory=e,this.layoutEdgesFactory=n}var n=e.prototype;return n.computeLayout=function(){var t=zu(Vu().mark((function t(e,n){return Vu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.determineIntrinsicSizes(e,e.children);case 2:return t.next=4,this.calculateLayout(e,e.children,n);case 4:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.determineAllIntrinsicSizes=function(){var t=zu(Vu().mark((function t(e){return Vu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),n.getLayoutDefinitionName=function(e){var n=e.getAllStyle().get(t.PropertyName.LAYOUT);if(!n)throw new Error("layout property not found");return n.value},n.determineIntrinsicSizes=function(){var t=zu(Vu().mark((function t(e,n){var r;return Vu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getLayoutDefinitionName(e),t.next=3,this.invokeIntrinsicSizesCallback(r,e,n);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.invokeIntrinsicSizesCallback=function(){var e=zu(Vu().mark((function e(n,r,i){var o,a,s,u,c,l,h,f,p,d,v;return Vu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.layoutRegistry.getLayout(n),a=new o,s=this.layoutContextFactory({mode:t.LayoutTaskType.IntrinsicSizes}),c=void 0===(u=o.inputProperties)?[]:u,l=[],i.forEach((function(t){var e=s.layoutChildrenFactory({node:t});l.push(e)})),h=this.layoutEdgesFactory({node:r}),f=r.getStyle.apply(r,c),p=a.intrinsicSizes(l,h,f),(d=this.runWorkQueue(p,s.workQueue)).next(),e.next=13,$u();case 13:v=d.next().value,s.clearWorkQueue(),r.setIntrisicSizes(v);case 16:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),n.calculateLayout=function(){var t=zu(Vu().mark((function t(e,n,r){var i;return Vu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.getLayoutDefinitionName(e),t.next=3,this.invokeLayoutCallback(i,e,n,r);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),n.invokeLayoutCallback=function(){var e=zu(Vu().mark((function e(n,r,i,o){var a,s,u,c,l,h,f,p,d,v,m,y,g;return Vu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.layoutRegistry.getLayout(n),s=new a,u=this.layoutContextFactory({mode:t.LayoutTaskType.Layout}),l=void 0===(c=a.inputProperties)?[]:c,h=[],i.forEach((function(t){var e=u.layoutChildrenFactory({node:t});h.push(e)})),f=this.layoutEdgesFactory({node:r}),p=r.getStyle.apply(r,l),d=s.layout(h,f,o,p),(v=this.runWorkQueue(d,u.workQueue)).next(),e.next=13,$u();case 13:m=v.next().value,u.clearWorkQueue(),y=m instanceof Bu?m:u.fragmentResultFactory(m),g=u.layoutFragmentFactory({inlineSize:y.inlineSize,blockSize:y.blockSize,data:y.data}),r.setComputedLayout(g),i.forEach((function(t,e){t.setComputedLayout(y.childFragments[e])}));case 19:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}(),n.runWorkQueue=Vu().mark((function e(n,r){var i,o=this;return Vu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Wu(n),r.length>0&&i.isPending()&&r.forEach((function(e){e.taskType===t.LayoutTaskType.IntrinsicSizes&&e.deferred.resolve(o.getNodeIntrisicSizes(e.layoutChild.node));if(e.taskType===t.LayoutTaskType.Layout){var n=e.layoutChild,r=e.deferred,i=n.layoutContext,a=o.getNodeFragment(n.node,e.layoutConstraints);r.resolve(i.layoutFragmentFactory(a))}})),void(e.next=4);case 4:if(i.isFulfilled()){e.next=6;break}throw new Error("promise not fullfilled!");case 6:return e.abrupt("return",i.getFullFilledValue());case 7:case"end":return e.stop()}}),e)})),n.getNodeIntrisicSizes=function(e){var n,r,i,o,a,s,u,c,l,h,f,p,d=e.getAllStyle();return{minContentInlineSize:(null===(n=d.get(t.PropertyName.MIN_WIDTH))||void 0===n?void 0:n.value)||(null===(r=e.intrisicSizes)||void 0===r?void 0:r.minContentInlineSize)||(null===(i=d.get(t.PropertyName.WIDTH))||void 0===i?void 0:i.value)||0,maxContentInlineSize:(null===(o=d.get(t.PropertyName.MAX_WIDTH))||void 0===o?void 0:o.value)||(null===(a=e.intrisicSizes)||void 0===a?void 0:a.maxContentInlineSize)||(null===(s=d.get(t.PropertyName.WIDTH))||void 0===s?void 0:s.value)||0,minContentBlockSize:(null===(u=d.get(t.PropertyName.MIN_HEIGHT))||void 0===u?void 0:u.value)||(null===(c=e.intrisicSizes)||void 0===c?void 0:c.minContentBlockSize)||(null===(l=d.get(t.PropertyName.HEIGHT))||void 0===l?void 0:l.value)||0,maxContentBlockSize:(null===(h=d.get(t.PropertyName.MAX_HEIGHT))||void 0===h?void 0:h.value)||(null===(f=e.intrisicSizes)||void 0===f?void 0:f.maxContentBlockSize)||(null===(p=d.get(t.PropertyName.HEIGHT))||void 0===p?void 0:p.value)||0}},n.getNodeFragment=function(e,n){var r,i,o,a,s,u;return{inlineSize:(null===(r=e.getComputedLayout())||void 0===r?void 0:r.inlineSize)||(null===(i=e.getAllStyle().get(t.PropertyName.MIN_WIDTH))||void 0===i?void 0:i.value)||(null===(o=e.getAllStyle().get(t.PropertyName.WIDTH))||void 0===o?void 0:o.value)||0,blockSize:(null===(a=e.getComputedLayout())||void 0===a?void 0:a.blockSize)||(null===(s=e.getAllStyle().get(t.PropertyName.MIN_HEIGHT))||void 0===s?void 0:s.value)||(null===(u=e.getAllStyle().get(t.PropertyName.HEIGHT))||void 0===u?void 0:u.value)||0,data:n.data}},e}(),ec=1,nc=function(){function e(t){void 0===t&&(t=new Map),this.id=void 0,this.style=void 0,this.dirty=void 0,this.parent=void 0,this.children=void 0,this.internalIntrisicSizes=void 0,this.computedLayout=void 0,this.measureFn=void 0,this.id=ec++,this.style=t,this.parent=void 0,this.children=[],this.dirty=!1}var n=e.prototype;return n.setMeasure=function(t){this.measureFn=t},n.setIntrisicSizes=function(t){this.internalIntrisicSizes=t},n.addChild=function(t){var e;null===(e=this.children)||void 0===e||e.push(t)},n.insertChild=function(t,e){this.children.splice(t,0,e)},n.removeChild=function(t){var e,n=null===(e=this.children)||void 0===e?void 0:e.findIndex((function(e){return e.id===t.id}));this.removeChildAtIndex(n)},n.removeChildAtIndex=function(t){this.children.splice(t,1)},n.replaceChildAtIndex=function(t,e){this.children.splice(t,1,e)},n.setStyle=function(t,e){this.style.set(t,e)},n.getStyle=function(){for(var t=this,e=new Map,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(n){var r=t.style.get(n);r&&e.set(n,r)})),e},n.getAllStyle=function(){return this.style},n.markDirty=function(){this.dirty=!0},n.idDirty=function(){return this.dirty},n.getSize=function(){var e,n,r,i;return{width:null!==(e=null===(n=this.style.get(t.PropertyName.WIDTH))||void 0===n?void 0:n.value)&&void 0!==e?e:0,height:null!==(r=null===(i=this.style.get(t.PropertyName.HEIGHT))||void 0===i?void 0:i.value)&&void 0!==r?r:0}},n.computeLayout=function(){var t=zu(Vu().mark((function t(){var e;return Vu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getSize(),t.next=3,ac.computeLayout(this,{availableInlineSize:e.width,availableBlockSize:e.height,fixedInlineSize:e.width,fixedBlockSize:e.height,percentageInlineSize:e.width,percentageBlockSize:e.height,data:void 0});case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.setComputedLayout=function(t){this.computedLayout=t},n.getComputedLayout=function(){return this.computedLayout},n.getAllComputedLayout=function(){},n.toString=function(){return"LayoutObject "+this.id},Yu(e,[{key:"intrisicSizes",get:function(){return this.internalIntrisicSizes}},{key:"childCount",get:function(){return this.children.length}}]),e}(),rc=function(){function t(){this.registry=new Map}var e=t.prototype;return e.hasLayout=function(t){return this.registry.has(t)},e.getLayout=function(t){if(void 0===t&&(t="absolute"),!this.hasLayout(t))throw new Error("invalid layout property: "+t);return this.registry.get(t)},e.updateLayout=function(t,e){this.registry.set(t,e)},e.registerLayout=function(e,n){if(""===e)throw new TypeError("layout name cant't be empty");if(t.reservedLayout.includes(e))throw new Error("layout name '"+e+"' is a system reserved layout name, please use another name");if(this.hasLayout(e))throw new Error("layout '"+e+"' already exist.");this.registry.set(e,n)},e.deleteLayout=function(t){this.registry.delete(t)},Yu(t,[{key:"size",get:function(){return this.registry.size}}]),t}();rc.reservedLayout=[];var ic,oc,ac=null,sc=function(){function t(t,e){this.type=void 0,this.target=void 0,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=e}return t.copy=function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n},t}(),uc=0,cc=new WeakMap,lc=function(){function e(t,e,n){this.observer=void 0,this.target=void 0,this.options=void 0,this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=n}var n=e.prototype;return n.enqueue=function(t){var e=this.observer.records,n=e.length;if(e.length>0){var r=function(t,e){return t===e?t:oc&&function(t){return t===oc||t===ic}(t)?oc:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else vc.push(this.observer),dc||(dc=!0,"undefined"!=typeof globalThis?globalThis.setTimeout(mc):mc());e[n]=t},n.addListeners=function(){this.addListeners_(this.target)},n.addListeners_=function(e){var n=this.options;n.attributes&&e.addEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.addEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.addEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeListeners=function(){this.removeListeners_(this.target)},n.removeListeners_=function(e){var n=this.options;n.attributes&&e.removeEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.removeEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.removeEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=cc.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}}),this)},n.handleEvent=function(e){var n,r;switch(e.stopImmediatePropagation(),e.type){case t.ElementEvent.ATTR_MODIFIED:var i=e.attrName,o=e.relatedNode.namespaceURI;(n=fc("attributes",r=e.target)).attributeName=i,n.attributeNamespace=o;var a=e.attrChange===Ia.ADDITION?null:e.prevValue;pc(r,(function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(o)))return t.attributeOldValue?function(t){return oc||((oc=sc.copy(ic)).oldValue=t,oc)}(a):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s,u,c=e.target;e.type===t.ElementEvent.INSERTED?(s=[c],u=[]):(s=[],u=[c]);var l=c.previousSibling,h=c.nextSibling;(n=fc("childList",r=e.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=l,n.nextSibling=h,pc(r,(function(t){if(t.childList)return n}))}ic=oc=void 0},e}(),hc=function(){function t(t){this.callback=void 0,this.nodes=[],this.records=[],this.uid=uc++,this.callback=t}var e=t.prototype;return e.observe=function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=cc.get(t);r||cc.set(t,r=[]);for(var i=0;r.length>i;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=e;break}n||(n=new lc(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()},e.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=cc.get(e),r=0;n.length>r;r++){var i=n[r];if(i.observer===t){i.removeListeners(),n.splice(r,1);break}}}),this),this.records=[]},e.takeRecords=function(){var t=this.records;return this.records=[],t},t}();function fc(t,e){return ic=new sc(t,e)}function pc(t,e){for(var n=t;n;n=n.parentNode){var r=cc.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}var dc=!1,vc=[];function mc(){dc=!1;var t=vc;vc=[],t.sort((function(t,e){return t.uid-e.uid}));var e=!1;t.forEach((function(t){var n=t.takeRecords();!function(t){t.nodes.forEach((function(e){var n=cc.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&mc()}function yc(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function gc(t,e,n){return e&&yc(t.prototype,e),n&&yc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function xc(t,e){return xc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},xc(t,e)}var Ec=function(t){var e,n;function r(e,n,r,i){var o;return(o=t.call(this,e)||this).currentTime=void 0,o.timelineTime=void 0,o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,xc(e,n),r}(Na),Tc=0,bc=function(){function t(t,e){var n;this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._totalDuration=void 0,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,this.effect=t,t.animation=this,this.timeline=e,this.id=""+Tc++,this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(n=this.effect)||void 0===n?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(this.playbackRate<0){if(this._totalDuration>=1/0)throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}else this.currentTime=0},e.persist=function(){throw new Error(tr)},e.addEventListener=function(t,e,n){throw new Error(tr)},e.removeEventListener=function(t,e,n){throw new Error(tr)},e.dispatchEvent=function(t){throw new Error(tr)},e.commitStyles=function(){throw new Error(tr)},e.ensureAlive=function(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new Ec(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new Ec(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},gc(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}(),wc=.1,kc="function"==typeof Float32Array,Mc=function(t,e){return 1-3*e+3*t},Pc=function(t,e){return 3*e-6*t},Sc=function(t){return 3*t},Nc=function(t,e,n){return((Mc(e,n)*t+Pc(e,n))*t+Sc(e))*t},Cc=function(t,e,n){return 3*Mc(e,n)*t*t+2*Pc(e,n)*t+Sc(e)},Ac=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=kc?new Float32Array(11):new Array(11),o=0;11>o;++o)i[o]=Nc(o*wc,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=wc;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*wc,s=Cc(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=Nc(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,r,r+wc,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=Cc(e,n,r);if(0===o)return e;e-=(Nc(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:Nc(a(t),e,r)}},Oc=function(t){return Math.pow(t,2)},_c=function(t){return Math.pow(t,3)},Lc=function(t){return Math.pow(t,4)},Rc=function(t){return Math.pow(t,5)},Ic=function(t){return Math.pow(t,6)},Dc=function(t){return 1-Math.cos(t*Math.PI/2)},Fc=function(t){return 1-Math.sqrt(1-t*t)},Gc=function(t){return t*t*(3*t-2)},Uc=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},Bc=function(t,e){void 0===e&&(e=[]);var n=e[0],r=e[1],i=void 0===r?.5:r,o=mu(Number(void 0===n?1:n),1,10),a=mu(Number(i),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin((t-1-a/(2*Math.PI)*Math.asin(1/o))*(2*Math.PI)/a)},Vc=function(t,e,n){void 0===e&&(e=[]);var r=e[0],i=void 0===r?1:r,o=e[1],a=void 0===o?100:o,s=e[2],u=void 0===s?10:s,c=e[3],l=void 0===c?0:c;i=mu(i,.1,1e3),a=mu(a,.1,1e3),u=mu(u,.1,1e3),l=mu(l,.1,1e3);var h=Math.sqrt(a/i),f=u/(2*Math.sqrt(a*i)),p=1>f?h*Math.sqrt(1-f*f):0,d=1>f?(f*h-l)/p:-l+h,v=n?n*t/1e3:t;return v=1>f?Math.exp(-v*f*h)*(1*Math.cos(p*v)+d*Math.sin(p*v)):(1+d*v)*Math.exp(-v*h),0===t||1===t?t:1-v},Hc=function(t,e){void 0===e&&(e=[]);var n=e[0],r=void 0===n?10:n;return("start"==e[1]?Math.ceil:Math.floor)(mu(t,0,1)*r)/r},zc=function(t,e){void 0===e&&(e=[]);return Ac(e[0],e[1],e[2],e[3])(t)},jc=Ac(.42,0,1,1),Yc=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Wc=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},Xc=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},qc={steps:Hc,"step-start":function(t){return Hc(t,[1,"start"])},"step-end":function(t){return Hc(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":zc,ease:function(t){return zc(t,[.25,.1,.25,1])},in:jc,out:Yc(jc),"in-out":Wc(jc),"out-in":Xc(jc),"in-quad":Oc,"out-quad":Yc(Oc),"in-out-quad":Wc(Oc),"out-in-quad":Xc(Oc),"in-cubic":_c,"out-cubic":Yc(_c),"in-out-cubic":Wc(_c),"out-in-cubic":Xc(_c),"in-quart":Lc,"out-quart":Yc(Lc),"in-out-quart":Wc(Lc),"out-in-quart":Xc(Lc),"in-quint":Rc,"out-quint":Yc(Rc),"in-out-quint":Wc(Rc),"out-in-quint":Xc(Rc),"in-expo":Ic,"out-expo":Yc(Ic),"in-out-expo":Wc(Ic),"out-in-expo":Xc(Ic),"in-sine":Dc,"out-sine":Yc(Dc),"in-out-sine":Wc(Dc),"out-in-sine":Xc(Dc),"in-circ":Fc,"out-circ":Yc(Fc),"in-out-circ":Wc(Fc),"out-in-circ":Xc(Fc),"in-back":Gc,"out-back":Yc(Gc),"in-out-back":Wc(Gc),"out-in-back":Xc(Gc),"in-bounce":Uc,"out-bounce":Yc(Uc),"in-out-bounce":Wc(Uc),"out-in-bounce":Xc(Uc),"in-elastic":Bc,"out-elastic":Yc(Bc),"in-out-elastic":Wc(Bc),"out-in-elastic":Xc(Bc),spring:Vc,"spring-in":Vc,"spring-out":Yc(Vc),"spring-in-out":Wc(Vc),"spring-out-in":Xc(Vc)},Kc=function(t){return t};function Zc(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Qc="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Jc=new RegExp("cubic-bezier\\("+Qc+","+Qc+","+Qc+","+Qc+"\\)"),$c=/steps\(\s*(\d+)\s*\)/,tl=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function el(t){var e=Jc.exec(t);if(e)return Ac.apply(void 0,e.slice(1).map(Number));var n=$c.exec(t);if(n)return Zc(Number(n[1]),0);var r=tl.exec(t);return r?Zc(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):qc[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||qc.linear}function nl(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function rl(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e<Math.min(n.delay+t+n.endDelay,r)?3:2}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}function il(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(ol(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:el(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;i.length-1>o;o++){var a=o,s=o+1,u=i[a].computedOffset,c=i[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:sl(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((e-n.startOffset)/r);t.style[n.property]=n.interpolation(i)}));else for(var n in r)ol(n)&&(t.style[n]=null)}}function ol(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var al=function(t,e,n){return function(r){return n(ul(t,e,r))}};function sl(t,e,n,r){var i=xa[t];if(i&&i.syntax&&i.int){var o=Zs.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=Zs.styleValueRegistry.parseProperty(t,e,r),s=Zs.styleValueRegistry.parseProperty(t,n,r),u=Zs.styleValueRegistry.computeProperty(t,a,r),c=Zs.styleValueRegistry.computeProperty(t,s,r),l=o.mixer(u,c,r);if(l){var h=al.apply(void 0,l);return function(t){return 0===t?e:1===t?n:h(t)}}}}return al(!1,!0,(function(t){return t?n:e}))}function ul(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){for(var r=[],i=0;t.length>i;i++)r.push(ul(t[i],e[i],n));return r}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var cl=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Kc,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return gc(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=el(t),this._easing=t}}]),t}();function ll(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;i>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error(i+" compositing is not supported");n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if(vu(a))r=!1;else{if(i>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;r>a;a++){var s=n[a].computedOffset;if(!vu(s)&&!vu(o)){for(var u=1;a-i>u;u++)n[i+u].computedOffset=o+(Number(s)-o)*u/(a-i);i=a,o=Number(s)}}}(),n}var hl="backwards|forwards|both|none".split("|"),fl="reverse|alternate|alternate-reverse".split("|");function pl(t,e){var n=new cl;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===hl.indexOf(t[e]))return;if("direction"===e&&-1===fl.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function dl(t,e){var n;return pl(t=vl(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function vl(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var ml=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=dl(n,!1),this.timing.effect=this,this.timing.activeDuration=nl(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=ll(e,this.timing),this.interpolations=il(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}})}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=rl(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=ll(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing=t[n]}))},t}();function yl(t,e){return Number(t.id)-Number(e.id)}var gl=function(){function t(t){var e=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(yl),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t,e,n){var r=new ml(t,e,n),i=new bc(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},e.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(yl),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},e.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],u=[],c=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):c.push(n)})),(r=this.pendingEffects).push.apply(r,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,c]},t}();Zs.EasingFunction=el,Zs.AnimationTimeline=gl,t.AABB=On,t.AbstractLayoutDefinition=Qu,t.AbstractRenderer=tu,t.AbstractRendererPlugin=$s,t.AdvancedCamera=Iu,t.Animation=bc,t.AnimationEvent=Ec,t.AnimationTimeline=gl,t.BUILT_IN_PROPERTIES=ga,t.CSS=Kr,t.CSSGradientValue=Mr,t.CSSKeywordValue=Pr,t.CSSRGB=qr,t.CSSStyleValue=Tr,t.CSSUnitValue=Dr,t.Camera=Ns,t.CameraEvent=Ps,t.Canvas=fu,t.Circle=$a,t.CircleUpdater=Cs,t.CustomElement=es,t.CustomElementRegistry=Sa,t.CustomEvent=Ca,t.DefaultLayoutRegistry=rc,t.DefaultSceneGraphSelector=zs,t.DefaultSceneGraphService=js,t.DisplayObject=Qa,t.DisplayObjectPool=is,t.Document=Ra,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=tr,t.Element=za,t.Ellipse=as,t.EllipseUpdater=As,t.EventService=Ds,t.EventTarget=Aa,t.FederatedEvent=Na,t.FederatedMouseEvent=ja,t.FederatedPointerEvent=Ya,t.FederatedWheelEvent=Wa,t.FragmentResult=Bu,t.Frustum=Rn,t.Group=us,t.HTML=ls,t.Image=fs,t.KeyframeEffect=ml,t.LayoutChildren=qu,t.LayoutContext=Zu,t.LayoutEdges=function(e){var n,r,i,o,a,s,u,c,l,h,f,p,d,v,m,y;this.options=void 0,this.inlineStart=void 0,this.inlineEnd=void 0,this.blockStart=void 0,this.blockEnd=void 0,this.inline=void 0,this.block=void 0,this.options=e;var g=e.node.getAllStyle(),x=null!==(n=null===(r=g.get(t.PropertyName.PADDING_TOP))||void 0===r?void 0:r.value)&&void 0!==n?n:0,E=null!==(i=null===(o=g.get(t.PropertyName.PADDING_END))||void 0===o?void 0:o.value)&&void 0!==i?i:0,T=null!==(a=null===(s=g.get(t.PropertyName.PADDING_BOTTOM))||void 0===s?void 0:s.value)&&void 0!==a?a:0,b=null!==(u=null===(c=g.get(t.PropertyName.PADDING_START))||void 0===c?void 0:c.value)&&void 0!==u?u:0,w=null!==(l=null===(h=g.get(t.PropertyName.PADDING_TOP))||void 0===h?void 0:h.value)&&void 0!==l?l:0,k=null!==(f=null===(p=g.get(t.PropertyName.PADDING_END))||void 0===p?void 0:p.value)&&void 0!==f?f:0,M=null!==(d=null===(v=g.get(t.PropertyName.PADDING_BOTTOM))||void 0===v?void 0:v.value)&&void 0!==d?d:0,P=null!==(m=null===(y=g.get(t.PropertyName.PADDING_START))||void 0===y?void 0:y.value)&&void 0!==m?m:0;this.blockStart=x+Ju[0]+w,this.inlineStart=E+Ju[1]+k,this.blockEnd=T+Ju[2]+M,this.inlineEnd=b+Ju[3]+P,this.block=this.blockStart+this.blockEnd,this.inline=this.inlineStart+this.inlineEnd},t.LayoutEngine=tc,t.LayoutFragment=function(t,e){this._layoutContext=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.inlineOffset=void 0,this.blockOffset=void 0,this.data=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.inlineSize=e.inlineSize,this.blockSize=e.blockSize,this.inlineOffset=0,this.blockOffset=0,this.data=e.data},t.LayoutObject=nc,t.Line=ds,t.LineUpdater=Os,t.MutationEvent=Ia,t.MutationObserver=hc,t.MutationRecord=sc,t.Node=Oa,t.OffscreenCanvasCreator=Fs,t.Path=ms,t.PathUpdater=_s,t.Plane=_n,t.Point=In,t.Polygon=gs,t.Polyline=Es,t.PolylineUpdater=Ls,t.RBush=o,t.Rect=bs,t.RectUpdater=Rs,t.Rectangle=Dn,t.Registration=lc,t.RenderingService=Vs,t.Text=ks,t.TextService=Ks,t.TextUpdater=Is,t.compareAnimations=yl,t.computeLinearGradient=function(t,e,n){var r=bo(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}},t.computeRadialGradient=function(e,n,r,i,o){var a=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(a=r.value/100*e),i.unit===t.UnitType.kPercentage&&(s=i.value/100*n);var u=Math.max(Zt([0,0],[a,s]),Zt([0,n],[a,s]),Zt([e,n],[a,s]),Zt([e,0],[a,s]));return o&&(o instanceof Dr?u=o.value:o instanceof Pr&&("closest-side"===o.value?u=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?u=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(u=Math.min(Zt([0,0],[a,s]),Zt([0,n],[a,s]),Zt([e,n],[a,s]),Zt([e,0],[a,s]))))),{x:a,y:s,r:u}},t.convertToPath=function(e,n){void 0===n&&(n=e.getLocalTransform());var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(i.x1,i.y1,i.x2,i.y2);break;case t.Shape.CIRCLE:var o=e.parsedStyle,a=o.r;r=jo(a,a,o.cx,o.cy);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=jo(s.rx,s.ry,s.cx,s.cy);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var u=e.parsedStyle,c=u.width,l=u.height,h=u.x,f=u.y,p=u.radius,d=p&&p.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var o=i[0],a=i[1],s=i[2],u=i[3],c=t>0?1:-1,l=e>0?1:-1,h=c+l!==0?1:0;return[["M",c*o+n,r],["L",t-c*a+n,r],a?["A",a,a,0,0,h,t+n,l*a+r]:null,["L",t+n,e-l*s+r],s?["A",s,s,0,0,h,t+n-c*s,e+r]:null,["L",n+c*u,e+r],u?["A",u,u,0,0,h,n,e+r-l*u]:null,["L",n,l*o+r],o?["A",o,o,0,0,h,c*o+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(c,l,h,f,d&&p.map((function(t){return Ee(t,0,Math.min(Math.abs(c)/2,Math.abs(l)/2))})));break;case t.Shape.PATH:var v=e.parsedStyle.path,m=v.zCommandIndexes;r=[].concat(v.curve),m.forEach((function(t,e){r.splice(t+e+1,0,["Z"])}))}if(r.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,o=void 0===i?0:i,a=r.defY,s=void 0===a?0:a;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=K(e[1]-o,e[2]-s,0);n&&it(i,i,n),r=""+e[0]+i[0]+","+i[1]}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=K(e[1]-o,e[2]-s,0),u=K(e[3]-o,e[4]-s,0),c=K(e[5]-o,e[6]-s,0);n&&(it(a,a,n),it(u,u,n),it(c,c,n)),r=""+e[0]+a[0]+","+a[1]+","+u[0]+","+u[1]+","+c[0]+","+c[1]}else if("A"===e[0]){var l=K(e[6]-o,e[7]-s,0);n&&it(l,l,n),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+l[0]+","+l[1]}return t+r}),"")}(r,e,n)},t.createVec3=To,t.decompose=So,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==t[1]})))},t.deg2rad=bo,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=Xn,t.fromRotationTranslationScale=Po,t.getAngle=Eo,t.getEuler=Mo,t.getOrCalculatePathTotalLength=Do,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=Yn,t.isFillOrStrokeAffected=function(t,e,n){var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=pi,t.layoutEngine=ac,t.makeTiming=pl,t.mergeColors=vi,t.normalizeKeyframes=ll,t.normalizeTimingInput=dl,t.numericTimingToObject=vl,t.parseColor=di,t.parseLength=yi,t.parsePath=Li,t.propertyMetadataCache=xa,t.rad2deg=wo,t.resetEntityCounter=function(){Da=0},t.runtime=Zs,t.setDOMSize=function(t,e,n){Yn&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n,r,i,o,a){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0);var s=t.map((function(s,u){var c="Z"===t[t.length-1][0],l=u===t.length-(c?2:1)?o:0,h=u===t.length-(c?2:1)?a:0;switch(s[0]){case"M":return"M "+(s[1]-e+r)+","+(s[2]-n+i);case"L":return"L "+(s[1]-e+l)+","+(s[2]-n+h);case"Q":return"Q "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e+l)+" "+(s[4]-n+h);case"C":return"C "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+","+(s[5]-e+l)+" "+(s[6]-n+h);case"A":return"A "+s[1]+" "+s[2]+" "+s[3]+" "+s[4]+" "+s[5]+" "+(s[6]-e+l)+" "+(s[7]-n+h);case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=ko,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
3
|
+
Nu=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function u(t,e,n,r){var i=Object.create((e&&e.prototype instanceof h?e:h).prototype),o=new w(r||[]);return i._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return M()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=E(a,n);if(s){if(s===l)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var u=c(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(t,n,o),i}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var l={};function h(){}function f(){}function p(){}var d={};s(d,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(k([])));m&&m!==e&&n.call(m,i)&&(d=m);var y=p.prototype=h.prototype=Object.create(d);function g(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function r(i,o,a,s){var u=c(t[i],t,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(h).then((function(t){l.value=t,a(l)}),(function(t){return r("throw",t,a,s)}))}s(u.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function E(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method))return l;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,l;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,l):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,l)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function b(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function w(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:void 0,done:!0}}return f.prototype=p,s(y,"constructor",p),s(p,"constructor",f),f.displayName=s(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===f||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},g(x.prototype),s(x.prototype,o,(function(){return this})),t.AsyncIterator=x,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new x(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},g(y),s(y,a,"Generator"),s(y,i,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=k,w.prototype={constructor:w,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(b),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(this.prev>=o.tryLoc){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(o.catchLoc>this.prev)return r(o.catchLoc,!0);if(o.finallyLoc>this.prev)return r(o.finallyLoc)}else if(s){if(o.catchLoc>this.prev)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(o.finallyLoc>this.prev)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(this.prev>=i.tryLoc&&n.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var o=i;break}}o&&("break"===t||"continue"===t)&&e>=o.tryLoc&&o.finallyLoc>=e&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,l):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),l},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),b(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;b(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}function Cu(t,e,n,r,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function Au(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){Cu(o,r,i,a,s,"next",t)}function s(t){Cu(o,r,i,a,s,"throw",t)}a(void 0)}))}}function Ou(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _u(t,e,n){return e&&Ou(t.prototype,e),n&&Ou(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(wu=t.LayoutTaskType||(t.LayoutTaskType={})).Layout="layout",wu.IntrinsicSizes="intrinsic-sizes",function(t){t[t.block=0]="block",t[t.normal=1]="normal"}(ku||(ku={})),function(t){t[t["block-like"]=0]="block-like",t[t.manual=1]="manual"}(Mu||(Mu={})),(Pu=t.PropertyName||(t.PropertyName={})).LAYOUT="display",Pu.LEFT="left",Pu.TOP="top",Pu.BOTTOM="bottom",Pu.RIGHT="right",Pu.WIDTH="width",Pu.HEIGHT="height",Pu.MIN_WIDTH="minWidth",Pu.MAX_WIDTH="maxWidth",Pu.MIN_HEIGHT="minHeight",Pu.MAX_HEIGHT="maxHeight",Pu.BOX_SIZING="boxSizing",Pu.PADDING="padding",Pu.PADDING_TOP="paddingTop",Pu.PADDING_BOTTOM="paddingBottom",Pu.PADDING_START="paddingLeft",Pu.PADDING_END="paddingRight",Pu.MARGIN="margin",Pu.MARGIN_TOP="marginTop",Pu.MARGIN_BOTTOM="marginBottom",Pu.MARGIN_START="marginLeft",Pu.MARGIN_END="marginRight",Pu.BORDER="border",Pu.BORDER_TOP="borderTop",Pu.BORDER_BOTTOM="borderBottom",Pu.BORDER_START="borderLeft",Pu.BORDER_END="borderRight",Pu.FLEX_DIRECTION="flexDirection",Pu.FLEX_WRAP="flexWrap",Pu.FLEX_FLOW="flexFlow",Pu.ALIGN_ITEMS="alignItems",Pu.ALIGN_CONTENT="alignContent",Pu.JUSTIFY_CONTENT="justifyContent",Pu.FLEX="flex",Pu.ALIGN_SELF="alignSelf",Pu.FLEX_SHRINK="flexShrink",Pu.FLEX_BASIS="flexBasis",Pu.FLEX_GROW="flexGrow",Pu.OFFSET_WIDTH="offsetWidth",Pu.OFFSET_HEIGHT="offsetHeight",Pu.ORDER="order";var Lu=function(t){if(t.isRejected||t.isFulfilled)return t;var e,n=!0,r=!1,i=!1,o=t.then((function(t){return i=!0,n=!1,e=t,t}),(function(t){throw r=!0,n=!1,t}));return o.isFulfilled=function(){return i},o.isPending=function(){return n},o.isRejected=function(){return r},o.getFullFilledValue=function(){return e},o},Ru=function(){var t=this;this.resolve=void 0,this.reject=void 0,this.promise=new Promise((function(e,n){t.resolve=e,t.reject=n}))},Iu=function(){function e(t,e){this._layoutContext=void 0,this.options=void 0,this.node=void 0,this.styleMap=void 0,this.layoutContext=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.node=e.node,this.styleMap=e.node.getAllStyle()}var n=e.prototype;return n.intrinsicSizes=function(){var e=new Ru;return this.layoutContext.appendWorkTask({layoutChild:this,taskType:t.LayoutTaskType.IntrinsicSizes,deferred:e}),e.promise},n.layoutNextFragment=function(e){if(this.layoutContext.mode===t.LayoutTaskType.IntrinsicSizes)throw new Error("Not Supported: cant call layoutNextFragment in intrinsicSizes");var n=new Ru;return this.layoutContext.appendWorkTask({layoutConstraints:e,layoutChild:this,taskType:t.LayoutTaskType.Layout,deferred:n}),n.promise},e}(),Du=0,Fu=function(){function t(t){this.options=void 0,this.contextId=void 0,this.workQueue=[],this.mode=void 0,this.layoutChildrenFactory=void 0,this.fragmentResultFactory=void 0,this.layoutFragmentFactory=void 0,this.options=t,this.contextId=""+Du++,this.mode=t.mode,this.layoutChildrenFactory=t.layoutChildrenFactory,this.fragmentResultFactory=t.fragmentResultFactory,this.layoutFragmentFactory=t.layoutFragmentFactory}var e=t.prototype;return e.appendWorkTask=function(t){this.workQueue.push(t)},e.clearWorkQueue=function(){this.workQueue=[]},t}(),Gu=function(){};Gu.inputProperties=void 0,Gu.childrenInputProperties=void 0,Gu.layoutOptions=void 0;var Uu=[0,0,0,0],Bu=function(t){return void 0===t&&(t=0),new Promise((function(e){setTimeout((function(){e()}),t)}))},Vu=function(){function e(t,e,n){this._layoutRegistry=void 0,this._layoutContextFactory=void 0,this._layoutEdgesFactory=void 0,this.layoutRegistry=void 0,this.layoutContextFactory=void 0,this.layoutEdgesFactory=void 0,this._layoutRegistry=t,this._layoutContextFactory=e,this._layoutEdgesFactory=n,this.layoutRegistry=t,this.layoutContextFactory=e,this.layoutEdgesFactory=n}var n=e.prototype;return n.computeLayout=function(){var t=Au(Nu().mark((function t(e,n){return Nu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.determineIntrinsicSizes(e,e.children);case 2:return t.next=4,this.calculateLayout(e,e.children,n);case 4:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.determineAllIntrinsicSizes=function(){var t=Au(Nu().mark((function t(e){return Nu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),n.getLayoutDefinitionName=function(e){var n=e.getAllStyle().get(t.PropertyName.LAYOUT);if(!n)throw new Error("layout property not found");return n.value},n.determineIntrinsicSizes=function(){var t=Au(Nu().mark((function t(e,n){var r;return Nu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.getLayoutDefinitionName(e),t.next=3,this.invokeIntrinsicSizesCallback(r,e,n);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n){return t.apply(this,arguments)}}(),n.invokeIntrinsicSizesCallback=function(){var e=Au(Nu().mark((function e(n,r,i){var o,a,s,u,c,l,h,f,p,d,v;return Nu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=this.layoutRegistry.getLayout(n),a=new o,s=this.layoutContextFactory({mode:t.LayoutTaskType.IntrinsicSizes}),c=void 0===(u=o.inputProperties)?[]:u,l=[],i.forEach((function(t){var e=s.layoutChildrenFactory({node:t});l.push(e)})),h=this.layoutEdgesFactory({node:r}),f=r.getStyle.apply(r,c),p=a.intrinsicSizes(l,h,f),(d=this.runWorkQueue(p,s.workQueue)).next(),e.next=13,Bu();case 13:v=d.next().value,s.clearWorkQueue(),r.setIntrisicSizes(v);case 16:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}(),n.calculateLayout=function(){var t=Au(Nu().mark((function t(e,n,r){var i;return Nu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=this.getLayoutDefinitionName(e),t.next=3,this.invokeLayoutCallback(i,e,n,r);case 3:case"end":return t.stop()}}),t,this)})));return function(e,n,r){return t.apply(this,arguments)}}(),n.invokeLayoutCallback=function(){var e=Au(Nu().mark((function e(n,r,i,o){var a,s,u,c,l,h,f,p,d,v,m,y,g;return Nu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.layoutRegistry.getLayout(n),s=new a,u=this.layoutContextFactory({mode:t.LayoutTaskType.Layout}),l=void 0===(c=a.inputProperties)?[]:c,h=[],i.forEach((function(t){var e=u.layoutChildrenFactory({node:t});h.push(e)})),f=this.layoutEdgesFactory({node:r}),p=r.getStyle.apply(r,l),d=s.layout(h,f,o,p),(v=this.runWorkQueue(d,u.workQueue)).next(),e.next=13,Bu();case 13:m=v.next().value,u.clearWorkQueue(),y=m instanceof Su?m:u.fragmentResultFactory(m),g=u.layoutFragmentFactory({inlineSize:y.inlineSize,blockSize:y.blockSize,data:y.data}),r.setComputedLayout(g),i.forEach((function(t,e){t.setComputedLayout(y.childFragments[e])}));case 19:case"end":return e.stop()}}),e,this)})));return function(t,n,r,i){return e.apply(this,arguments)}}(),n.runWorkQueue=Nu().mark((function e(n,r){var i,o=this;return Nu().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=Lu(n),r.length>0&&i.isPending()&&r.forEach((function(e){e.taskType===t.LayoutTaskType.IntrinsicSizes&&e.deferred.resolve(o.getNodeIntrisicSizes(e.layoutChild.node));if(e.taskType===t.LayoutTaskType.Layout){var n=e.layoutChild,r=e.deferred,i=n.layoutContext,a=o.getNodeFragment(n.node,e.layoutConstraints);r.resolve(i.layoutFragmentFactory(a))}})),void(e.next=4);case 4:if(i.isFulfilled()){e.next=6;break}throw new Error("promise not fullfilled!");case 6:return e.abrupt("return",i.getFullFilledValue());case 7:case"end":return e.stop()}}),e)})),n.getNodeIntrisicSizes=function(e){var n,r,i,o,a,s,u,c,l,h,f,p,d=e.getAllStyle();return{minContentInlineSize:(null===(n=d.get(t.PropertyName.MIN_WIDTH))||void 0===n?void 0:n.value)||(null===(r=e.intrisicSizes)||void 0===r?void 0:r.minContentInlineSize)||(null===(i=d.get(t.PropertyName.WIDTH))||void 0===i?void 0:i.value)||0,maxContentInlineSize:(null===(o=d.get(t.PropertyName.MAX_WIDTH))||void 0===o?void 0:o.value)||(null===(a=e.intrisicSizes)||void 0===a?void 0:a.maxContentInlineSize)||(null===(s=d.get(t.PropertyName.WIDTH))||void 0===s?void 0:s.value)||0,minContentBlockSize:(null===(u=d.get(t.PropertyName.MIN_HEIGHT))||void 0===u?void 0:u.value)||(null===(c=e.intrisicSizes)||void 0===c?void 0:c.minContentBlockSize)||(null===(l=d.get(t.PropertyName.HEIGHT))||void 0===l?void 0:l.value)||0,maxContentBlockSize:(null===(h=d.get(t.PropertyName.MAX_HEIGHT))||void 0===h?void 0:h.value)||(null===(f=e.intrisicSizes)||void 0===f?void 0:f.maxContentBlockSize)||(null===(p=d.get(t.PropertyName.HEIGHT))||void 0===p?void 0:p.value)||0}},n.getNodeFragment=function(e,n){var r,i,o,a,s,u;return{inlineSize:(null===(r=e.getComputedLayout())||void 0===r?void 0:r.inlineSize)||(null===(i=e.getAllStyle().get(t.PropertyName.MIN_WIDTH))||void 0===i?void 0:i.value)||(null===(o=e.getAllStyle().get(t.PropertyName.WIDTH))||void 0===o?void 0:o.value)||0,blockSize:(null===(a=e.getComputedLayout())||void 0===a?void 0:a.blockSize)||(null===(s=e.getAllStyle().get(t.PropertyName.MIN_HEIGHT))||void 0===s?void 0:s.value)||(null===(u=e.getAllStyle().get(t.PropertyName.HEIGHT))||void 0===u?void 0:u.value)||0,data:n.data}},e}(),Hu=1,zu=function(){function e(t){void 0===t&&(t=new Map),this.id=void 0,this.style=void 0,this.dirty=void 0,this.parent=void 0,this.children=void 0,this.internalIntrisicSizes=void 0,this.computedLayout=void 0,this.measureFn=void 0,this.id=Hu++,this.style=t,this.parent=void 0,this.children=[],this.dirty=!1}var n=e.prototype;return n.setMeasure=function(t){this.measureFn=t},n.setIntrisicSizes=function(t){this.internalIntrisicSizes=t},n.addChild=function(t){var e;null===(e=this.children)||void 0===e||e.push(t)},n.insertChild=function(t,e){this.children.splice(t,0,e)},n.removeChild=function(t){var e,n=null===(e=this.children)||void 0===e?void 0:e.findIndex((function(e){return e.id===t.id}));this.removeChildAtIndex(n)},n.removeChildAtIndex=function(t){this.children.splice(t,1)},n.replaceChildAtIndex=function(t,e){this.children.splice(t,1,e)},n.setStyle=function(t,e){this.style.set(t,e)},n.getStyle=function(){for(var t=this,e=new Map,n=arguments.length,r=new Array(n),i=0;n>i;i++)r[i]=arguments[i];return r.forEach((function(n){var r=t.style.get(n);r&&e.set(n,r)})),e},n.getAllStyle=function(){return this.style},n.markDirty=function(){this.dirty=!0},n.idDirty=function(){return this.dirty},n.getSize=function(){var e,n,r,i;return{width:null!==(e=null===(n=this.style.get(t.PropertyName.WIDTH))||void 0===n?void 0:n.value)&&void 0!==e?e:0,height:null!==(r=null===(i=this.style.get(t.PropertyName.HEIGHT))||void 0===i?void 0:i.value)&&void 0!==r?r:0}},n.computeLayout=function(){var t=Au(Nu().mark((function t(){var e;return Nu().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=this.getSize(),t.next=3,Xu.computeLayout(this,{availableInlineSize:e.width,availableBlockSize:e.height,fixedInlineSize:e.width,fixedBlockSize:e.height,percentageInlineSize:e.width,percentageBlockSize:e.height,data:void 0});case 3:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),n.setComputedLayout=function(t){this.computedLayout=t},n.getComputedLayout=function(){return this.computedLayout},n.getAllComputedLayout=function(){},n.toString=function(){return"LayoutObject "+this.id},_u(e,[{key:"intrisicSizes",get:function(){return this.internalIntrisicSizes}},{key:"childCount",get:function(){return this.children.length}}]),e}(),ju=function(){function t(){this.registry=new Map}var e=t.prototype;return e.hasLayout=function(t){return this.registry.has(t)},e.getLayout=function(t){if(void 0===t&&(t="absolute"),!this.hasLayout(t))throw new Error("invalid layout property: "+t);return this.registry.get(t)},e.updateLayout=function(t,e){this.registry.set(t,e)},e.registerLayout=function(e,n){if(""===e)throw new TypeError("layout name cant't be empty");if(t.reservedLayout.includes(e))throw new Error("layout name '"+e+"' is a system reserved layout name, please use another name");if(this.hasLayout(e))throw new Error("layout '"+e+"' already exist.");this.registry.set(e,n)},e.deleteLayout=function(t){this.registry.delete(t)},_u(t,[{key:"size",get:function(){return this.registry.size}}]),t}();ju.reservedLayout=[];var Yu,Wu,Xu=null,qu=function(){function t(t,e){this.type=void 0,this.target=void 0,this.addedNodes=[],this.attributeName=null,this.attributeNamespace=null,this.nextSibling=null,this.oldValue=null,this.previousSibling=null,this.removedNodes=[],this.type=t,this.target=e}return t.copy=function(e){var n=new t(e.type,e.target);return n.addedNodes=e.addedNodes.slice(),n.removedNodes=e.removedNodes.slice(),n.previousSibling=e.previousSibling,n.nextSibling=e.nextSibling,n.attributeName=e.attributeName,n.attributeNamespace=e.attributeNamespace,n.oldValue=e.oldValue,n},t}(),Ku=0,Zu=new WeakMap,Qu=function(){function e(t,e,n){this.observer=void 0,this.target=void 0,this.options=void 0,this.transientObservedNodes=[],this.observer=t,this.target=e,this.options=n}var n=e.prototype;return n.enqueue=function(t){var e=this.observer.records,n=e.length;if(e.length>0){var r=function(t,e){return t===e?t:Wu&&function(t){return t===Wu||t===Yu}(t)?Wu:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else nc.push(this.observer),ec||(ec=!0,"undefined"!=typeof globalThis?globalThis.setTimeout(rc):rc());e[n]=t},n.addListeners=function(){this.addListeners_(this.target)},n.addListeners_=function(e){var n=this.options;n.attributes&&e.addEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.addEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.addEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeListeners=function(){this.removeListeners_(this.target)},n.removeListeners_=function(e){var n=this.options;n.attributes&&e.removeEventListener(t.ElementEvent.ATTR_MODIFIED,this,!0),n.childList&&e.removeEventListener(t.ElementEvent.INSERTED,this,!0),(n.childList||n.subtree)&&e.removeEventListener(t.ElementEvent.REMOVED,this,!0)},n.removeTransientObservers=function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=Zu.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}}),this)},n.handleEvent=function(e){var n,r;switch(e.stopImmediatePropagation(),e.type){case t.ElementEvent.ATTR_MODIFIED:var i=e.attrName,o=e.relatedNode.namespaceURI;(n=$u("attributes",r=e.target)).attributeName=i,n.attributeNamespace=o;var a=e.attrChange===za.ADDITION?null:e.prevValue;tc(r,(function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(o)))return t.attributeOldValue?function(t){return Wu||((Wu=qu.copy(Yu)).oldValue=t,Wu)}(a):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s,u,c=e.target;e.type===t.ElementEvent.INSERTED?(s=[c],u=[]):(s=[],u=[c]);var l=c.previousSibling,h=c.nextSibling;(n=$u("childList",r=e.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=l,n.nextSibling=h,tc(r,(function(t){if(t.childList)return n}))}Yu=Wu=void 0},e}(),Ju=function(){function t(t){this.callback=void 0,this.nodes=[],this.records=[],this.uid=Ku++,this.callback=t}var e=t.prototype;return e.observe=function(t,e){if(!e.childList&&!e.attributes&&!e.characterData||e.attributeOldValue&&!e.attributes||e.attributeFilter&&e.attributeFilter.length&&!e.attributes||e.characterDataOldValue&&!e.characterData)throw new SyntaxError;var n,r=Zu.get(t);r||Zu.set(t,r=[]);for(var i=0;r.length>i;i++)if(r[i].observer===this){(n=r[i]).removeListeners(),n.options=e;break}n||(n=new Qu(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()},e.disconnect=function(){var t=this;this.nodes.forEach((function(e){for(var n=Zu.get(e),r=0;n.length>r;r++){var i=n[r];if(i.observer===t){i.removeListeners(),n.splice(r,1);break}}}),this),this.records=[]},e.takeRecords=function(){var t=this.records;return this.records=[],t},t}();function $u(t,e){return Yu=new qu(t,e)}function tc(t,e){for(var n=t;n;n=n.parentNode){var r=Zu.get(n);if(r)for(var i=0;r.length>i;i++){var o=r[i],a=o.options;if(n===t||a.subtree){var s=e(a);s&&o.enqueue(s)}}}}var ec=!1,nc=[];function rc(){ec=!1;var t=nc;nc=[],t.sort((function(t,e){return t.uid-e.uid}));var e=!1;t.forEach((function(t){var n=t.takeRecords();!function(t){t.nodes.forEach((function(e){var n=Zu.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&rc()}function ic(t,e){for(var n=0;e.length>n;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function oc(t,e,n){return e&&ic(t.prototype,e),n&&ic(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function ac(t,e){return ac=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ac(t,e)}var sc=function(t){var e,n;function r(e,n,r,i){var o;return(o=t.call(this,e)||this).currentTime=void 0,o.timelineTime=void 0,o.currentTime=r,o.timelineTime=i,o.target=n,o.type="finish",o.bubbles=!1,o.currentTarget=n,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=r,o.timelineTime=i,o}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,ac(e,n),r}(Da),uc=0,cc=function(){function t(t,e){var n;this.effect=void 0,this.timeline=void 0,this.id=void 0,this.currentTimePending=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this.oldPlayState=void 0,this._holdTime=void 0,this.readyPromise=void 0,this.finishedPromise=void 0,this.resolveReadyPromise=void 0,this.rejectReadyPromise=void 0,this.resolveFinishedPromise=void 0,this.rejectFinishedPromise=void 0,this.onfinish=void 0,this.oncancel=void 0,this.onframe=void 0,this._currentTime=0,this._startTime=void 0,this._playbackRate=1,this._totalDuration=void 0,this._inEffect=void 0,this._inTimeline=!0,this.onremove=void 0,this.effect=t,t.animation=this,this.timeline=e,this.id=""+uc++,this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(n=this.effect)||void 0===n?void 0:n.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}var e=t.prototype;return e.updatePromises=function(){var t=this.oldPlayState,e=this.pending?"pending":this.playState;return this.readyPromise&&e!==t&&("idle"===e?(this.rejectReadyPromise(),this.readyPromise=void 0):"pending"===t?this.resolveReadyPromise():"pending"===e&&(this.readyPromise=void 0)),this.finishedPromise&&e!==t&&("idle"===e?(this.rejectFinishedPromise(),this.finishedPromise=void 0):"finished"===e?this.resolveFinishedPromise():"finished"===t&&(this.finishedPromise=void 0)),this.oldPlayState=e,this.readyPromise||this.finishedPromise},e.play=function(){this.updatePromises(),this._paused=!1,(this._isFinished||this._idle)&&(this.rewind(),this._startTime=null),this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this),-1===this.timeline.animations.indexOf(this)&&this.timeline.animations.push(this),this.updatePromises()},e.pause=function(){this.updatePromises(),this.currentTime&&(this._holdTime=this.currentTime),this._isFinished||this._paused||this._idle?this._idle&&(this.rewind(),this._idle=!1):this.currentTimePending=!0,this._startTime=null,this._paused=!0,this.updatePromises()},e.finish=function(){this.updatePromises(),this._idle||(this.currentTime=this._playbackRate>0?this._totalDuration:0,this._startTime=this._totalDuration-this.currentTime,this.currentTimePending=!1,this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.cancel=function(){this.updatePromises(),this._inEffect&&(this._inEffect=!1,this._idle=!0,this._paused=!1,this._finishedFlag=!0,this._currentTime=0,this._startTime=null,this.effect.update(null),this.timeline.applyDirtiedAnimation(this),this.updatePromises())},e.reverse=function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()},e.updatePlaybackRate=function(t){this.playbackRate=t},e.targetAnimations=function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()},e.markTarget=function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)},e.unmarkTarget=function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)},e.tick=function(t,e){this._idle||this._paused||(null===this._startTime?e&&(this.startTime=t-this._currentTime/this.playbackRate):this._isFinished||this.tickCurrentTime((t-this._startTime)*this.playbackRate)),e&&(this.currentTimePending=!1,this.fireEvents(t))},e.rewind=function(){if(this.playbackRate<0){if(this._totalDuration>=1/0)throw new Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}else this.currentTime=0},e.persist=function(){throw new Error(or)},e.addEventListener=function(t,e,n){throw new Error(or)},e.removeEventListener=function(t,e,n){throw new Error(or)},e.dispatchEvent=function(t){throw new Error(or)},e.commitStyles=function(){throw new Error(or)},e.ensureAlive=function(){var t,e;0>this.playbackRate&&0===this.currentTime?this._inEffect=!!(null===(t=this.effect)||void 0===t?void 0:t.update(-1)):this._inEffect=!!(null===(e=this.effect)||void 0===e?void 0:e.update(this.currentTime));this._inTimeline||!this._inEffect&&this._finishedFlag||(this._inTimeline=!0,this.timeline.animations.push(this))},e.tickCurrentTime=function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())},e.fireEvents=function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new sc(null,this,this.currentTime,t);setTimeout((function(){e.onfinish&&e.onfinish(n)}))}this._finishedFlag=!0}}else{if(this.onframe&&"running"===this.playState){var r=new sc(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},oc(t,[{key:"pending",get:function(){return null===this._startTime&&!this._paused&&0!==this.playbackRate||this.currentTimePending}},{key:"playState",get:function(){return this._idle?"idle":this._isFinished?"finished":this._paused?"paused":"running"}},{key:"ready",get:function(){var t=this;return this.readyPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.readyPromise=new Promise((function(e,n){t.resolveReadyPromise=function(){e(t)},t.rejectReadyPromise=function(){n(new Error)}})),this.pending||this.resolveReadyPromise()),this.readyPromise}},{key:"finished",get:function(){var t=this;return this.finishedPromise||(-1===this.timeline.animationsWithPromises.indexOf(this)&&this.timeline.animationsWithPromises.push(this),this.finishedPromise=new Promise((function(e,n){t.resolveFinishedPromise=function(){e(t)},t.rejectFinishedPromise=function(){n(new Error)}})),"finished"===this.playState&&this.resolveFinishedPromise()),this.finishedPromise}},{key:"currentTime",get:function(){return this.updatePromises(),this._idle||this.currentTimePending?null:this._currentTime},set:function(t){if(t=Number(t),!isNaN(t)){var e;if(this.timeline.restart(),!this._paused&&null!==this._startTime)this._startTime=Number(null===(e=this.timeline)||void 0===e?void 0:e.currentTime)-t/this.playbackRate;this.currentTimePending=!1,this._currentTime!==t&&(this._idle&&(this._idle=!1,this._paused=!0),this.tickCurrentTime(t,!0),this.timeline.applyDirtiedAnimation(this))}}},{key:"startTime",get:function(){return this._startTime},set:function(t){if(null!==t){if(this.updatePromises(),t=Number(t),isNaN(t))return;if(this._paused||this._idle)return;this._startTime=t,this.tickCurrentTime((Number(this.timeline.currentTime)-this._startTime)*this.playbackRate),this.timeline.applyDirtiedAnimation(this),this.updatePromises()}}},{key:"playbackRate",get:function(){return this._playbackRate},set:function(t){if(t!==this._playbackRate){this.updatePromises();var e=this.currentTime;this._playbackRate=t,this.startTime=null,"paused"!==this.playState&&"idle"!==this.playState&&(this._finishedFlag=!1,this._idle=!1,this.ensureAlive(),this.timeline.applyDirtiedAnimation(this)),null!==e&&(this.currentTime=e),this.updatePromises()}}},{key:"_isFinished",get:function(){return!this._idle&&(this._playbackRate>0&&Number(this._currentTime)>=this._totalDuration||0>this._playbackRate&&0>=Number(this._currentTime))}},{key:"totalDuration",get:function(){return this._totalDuration}},{key:"_needsTick",get:function(){return this.pending||"running"===this.playState||!this._finishedFlag}}]),t}(),lc=.1,hc="function"==typeof Float32Array,fc=function(t,e){return 1-3*e+3*t},pc=function(t,e){return 3*e-6*t},dc=function(t){return 3*t},vc=function(t,e,n){return((fc(e,n)*t+pc(e,n))*t+dc(e))*t},mc=function(t,e,n){return 3*fc(e,n)*t*t+2*pc(e,n)*t+dc(e)},yc=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw new Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=hc?new Float32Array(11):new Array(11),o=0;11>o;++o)i[o]=vc(o*lc,t,n);var a=function(e){for(var r=0,o=1;10!==o&&e>=i[o];++o)r+=lc;--o;var a=r+(e-i[o])/(i[o+1]-i[o])*lc,s=mc(a,t,n);return.001>s?0===s?a:function(t,e,n,r,i){var o,a,s=0;do{(o=vc(a=e+(n-e)/2,r,i)-t)>0?n=a:e=a}while(Math.abs(o)>1e-7&&10>++s);return a}(e,r,r+lc,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var o=mc(e,n,r);if(0===o)return e;e-=(vc(e,n,r)-t)/o}return e}(e,a,t,n)};return function(t){return 0===t||1===t?t:vc(a(t),e,r)}},gc=function(t){return Math.pow(t,2)},xc=function(t){return Math.pow(t,3)},Ec=function(t){return Math.pow(t,4)},Tc=function(t){return Math.pow(t,5)},bc=function(t){return Math.pow(t,6)},wc=function(t){return 1-Math.cos(t*Math.PI/2)},kc=function(t){return 1-Math.sqrt(1-t*t)},Mc=function(t){return t*t*(3*t-2)},Pc=function(t){for(var e,n=4;t<((e=Math.pow(2,--n))-1)/11;);return 1/Math.pow(4,3-n)-7.5625*Math.pow((3*e-2)/22-t,2)},Sc=function(t,e){void 0===e&&(e=[]);var n=e[0],r=e[1],i=void 0===r?.5:r,o=ke(Number(void 0===n?1:n),1,10),a=ke(Number(i),.1,2);return 0===t||1===t?t:-o*Math.pow(2,10*(t-1))*Math.sin((t-1-a/(2*Math.PI)*Math.asin(1/o))*(2*Math.PI)/a)},Nc=function(t,e,n){void 0===e&&(e=[]);var r=e[0],i=void 0===r?1:r,o=e[1],a=void 0===o?100:o,s=e[2],u=void 0===s?10:s,c=e[3],l=void 0===c?0:c;i=ke(i,.1,1e3),a=ke(a,.1,1e3),u=ke(u,.1,1e3),l=ke(l,.1,1e3);var h=Math.sqrt(a/i),f=u/(2*Math.sqrt(a*i)),p=1>f?h*Math.sqrt(1-f*f):0,d=1>f?(f*h-l)/p:-l+h,v=n?n*t/1e3:t;return v=1>f?Math.exp(-v*f*h)*(1*Math.cos(p*v)+d*Math.sin(p*v)):(1+d*v)*Math.exp(-v*h),0===t||1===t?t:1-v},Cc=function(t,e){void 0===e&&(e=[]);var n=e[0],r=void 0===n?10:n;return("start"==e[1]?Math.ceil:Math.floor)(ke(t,0,1)*r)/r},Ac=function(t,e){void 0===e&&(e=[]);return yc(e[0],e[1],e[2],e[3])(t)},Oc=yc(.42,0,1,1),_c=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},Lc=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},Rc=function(t){return function(e,n,r){return void 0===n&&(n=[]),.5>e?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},Ic={steps:Cc,"step-start":function(t){return Cc(t,[1,"start"])},"step-end":function(t){return Cc(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Ac,ease:function(t){return Ac(t,[.25,.1,.25,1])},in:Oc,out:_c(Oc),"in-out":Lc(Oc),"out-in":Rc(Oc),"in-quad":gc,"out-quad":_c(gc),"in-out-quad":Lc(gc),"out-in-quad":Rc(gc),"in-cubic":xc,"out-cubic":_c(xc),"in-out-cubic":Lc(xc),"out-in-cubic":Rc(xc),"in-quart":Ec,"out-quart":_c(Ec),"in-out-quart":Lc(Ec),"out-in-quart":Rc(Ec),"in-quint":Tc,"out-quint":_c(Tc),"in-out-quint":Lc(Tc),"out-in-quint":Rc(Tc),"in-expo":bc,"out-expo":_c(bc),"in-out-expo":Lc(bc),"out-in-expo":Rc(bc),"in-sine":wc,"out-sine":_c(wc),"in-out-sine":Lc(wc),"out-in-sine":Rc(wc),"in-circ":kc,"out-circ":_c(kc),"in-out-circ":Lc(kc),"out-in-circ":Rc(kc),"in-back":Mc,"out-back":_c(Mc),"in-out-back":Lc(Mc),"out-in-back":Rc(Mc),"in-bounce":Pc,"out-bounce":_c(Pc),"in-out-bounce":Lc(Pc),"out-in-bounce":Rc(Pc),"in-elastic":Sc,"out-elastic":_c(Sc),"in-out-elastic":Lc(Sc),"out-in-elastic":Rc(Sc),spring:Nc,"spring-in":Nc,"spring-out":_c(Nc),"spring-in-out":Lc(Nc),"spring-out-in":Rc(Nc)},Dc=function(t){return t};function Fc(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Gc="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",Uc=new RegExp("cubic-bezier\\("+Gc+","+Gc+","+Gc+","+Gc+"\\)"),Bc=/steps\(\s*(\d+)\s*\)/,Vc=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Hc(t){var e=Uc.exec(t);if(e)return yc.apply(void 0,e.slice(1).map(Number));var n=Bc.exec(t);if(n)return Fc(Number(n[1]),0);var r=Vc.exec(t);return r?Fc(Number(r[1]),{start:1,middle:.5,end:0}[r[2]]):Ic[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-"+t.toLowerCase()}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||Ic.linear}function zc(t){return Math.abs(function(t){var e;if(0===t.duration||0===t.iterations)return 0;return("auto"===t.duration?0:Number(t.duration))*(null!==(e=t.iterations)&&void 0!==e?e:1)}(t)/(t.playbackRate||1))}function jc(t,e,n){var r=function(t,e,n){if(null===e)return 0;var r=n.endTime;return e<Math.min(n.delay,r)?1:e<Math.min(n.delay+t+n.endDelay,r)?3:2}(t,e,n),i=function(t,e,n,r,i){switch(r){case 1:return"backwards"===e||"both"===e?0:null;case 3:return n-i;case 2:return"forwards"===e||"both"===e?t:null;case 0:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var o="auto"===n.duration?0:n.duration,a=function(t,e,n,r,i){var o=i;return 0===t?1!==e&&(o+=n):o+=r/t,o}(o,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,o){var a=t===1/0?e%1:t%1;return 0!==a||2!==n||0===r||0===i&&0!==o||(a=1),a}(a,n.iterationStart,r,n.iterations,i,o),u=function(t,e,n,r){return 2===t&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,a),c=function(t,e,n){var r=t;if("normal"!==t&&"reverse"!==t){var i=e;"alternate-reverse"===t&&(i+=1),r="normal",i!==1/0&&i%2!=0&&(r="reverse")}return"normal"===r?n:1-n}(n.direction,u,s);return n.currentIteration=u,n.progress=c,n.easingFunction(c)}function Yc(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(Wc(i)){var o={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Hc(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(o)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],o=0;i.length-1>o;o++){var a=o,s=o+1,u=i[a].computedOffset,c=i[s].computedOffset,l=u,h=c;0===o&&(l=-1/0,0===c&&(s=a)),o===i.length-2&&(h=1/0,1===u&&(a=s)),n.push({applyFrom:l,applyTo:h,startOffset:i[a].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[a].easingFunction,property:r,interpolation:qc(r,i[a].value,i[s].value,e)})}return n.sort((function(t,e){return t.startOffset-e.startOffset})),n}(r,n);return function(t,e){if(null!==e)i.filter((function(t){return e>=t.applyFrom&&t.applyTo>e})).forEach((function(n){var r=n.endOffset-n.startOffset,i=0===r?0:n.easingFunction((e-n.startOffset)/r);t.style[n.property]=n.interpolation(i)}));else for(var n in r)Wc(n)&&(t.style[n]=null)}}function Wc(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Xc=function(t,e,n){return function(r){return n(Kc(t,e,r))}};function qc(t,e,n,r){var i=Sa[t];if(i&&i.syntax&&i.int){var o=iu.styleValueRegistry.getPropertySyntax(i.syntax);if(o){var a=iu.styleValueRegistry.parseProperty(t,e,r),s=iu.styleValueRegistry.parseProperty(t,n,r),u=iu.styleValueRegistry.computeProperty(t,a,r),c=iu.styleValueRegistry.computeProperty(t,s,r),l=o.mixer(u,c,r);if(l){var h=Xc.apply(void 0,l);return function(t){return 0===t?e:1===t?n:h(t)}}}}return Xc(!1,!0,(function(t){return t?n:e}))}function Kc(t,e,n){if("number"==typeof t&&"number"==typeof e)return t*(1-n)+e*n;if("boolean"==typeof t&&"boolean"==typeof e||"string"==typeof t&&"string"==typeof e)return.5>n?t:e;if(Array.isArray(t)&&Array.isArray(e)&&t.length===e.length){for(var r=[],i=0;t.length>i;i++)r.push(Kc(t[i],e[i],n));return r}throw new Error("Mismatched interpolation arguments "+t+":"+e)}var Zc=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Dc,this.endDelay=0,this.fill="auto",this.iterationStart=0,this.iterations=1,this.playbackRate=void 0,this.effect=void 0,this.composite=void 0,this.activeDuration=void 0,this.endTime=void 0,this.currentIteration=null,this.progress=null}return oc(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Hc(t),this._easing=t}}]),t}();function Qc(t,e){if(null===t)return[];Array.isArray(t)||(t=function(t){var e=[];for(var n in t)if(!(n in["easing","offset","composite"])){var r=t[n];Array.isArray(r)||(r=[r]);for(var i=r.length,o=0;i>o;o++){if(!e[o]){var a={};"offset"in t&&(a.offset=Number(t.offset)),"easing"in t&&(a.easing=t.easing),"composite"in t&&(a.composite=t.composite),e[o]=a}null!=r[o]&&(e[o][n]=r[o])}}return e.sort((function(t,e){return(t.computedOffset||0)-(e.computedOffset||0)})),e}(t));for(var n=t.map((function(t){var n={};for(var r in(null==e?void 0:e.composite)&&(n.composite="auto"),t){var i=t[r];if("offset"===r){if(null!==i){if(i=Number(i),!isFinite(i))throw new Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw new Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw new Error(i+" compositing is not supported");n[r]=i}return void 0===n.offset&&(n.offset=null),void 0===n.easing&&(n.easing=(null==e?void 0:e.easing)||"linear"),void 0===n.composite&&(n.composite="auto"),n})),r=!0,i=-1/0,o=0;n.length>o;o++){var a=n[o].offset;if(ge(a))r=!1;else{if(i>a)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=a}}return n=n.filter((function(t){return Number(t.offset)>=0&&1>=Number(t.offset)})),r||function(){var t,e,r=n.length;n[r-1].computedOffset=Number(null!==(t=n[r-1].offset)&&void 0!==t?t:1),r>1&&(n[0].computedOffset=Number(null!==(e=n[0].offset)&&void 0!==e?e:0));for(var i=0,o=Number(n[0].computedOffset),a=1;r>a;a++){var s=n[a].computedOffset;if(!ge(s)&&!ge(o)){for(var u=1;a-i>u;u++)n[i+u].computedOffset=o+(Number(s)-o)*u/(a-i);i=a,o=Number(s)}}}(),n}var Jc="backwards|forwards|both|none".split("|"),$c="reverse|alternate|alternate-reverse".split("|");function tl(t,e){var n=new Zc;return e&&(n.fill="both",n.duration="auto"),"number"!=typeof t||isNaN(t)?void 0!==t&&Object.keys(t).forEach((function(e){if(null!=t[e]&&"auto"!==t[e]){if(("number"==typeof n[e]||"duration"===e)&&("number"!=typeof t[e]||isNaN(t[e])))return;if("fill"===e&&-1===Jc.indexOf(t[e]))return;if("direction"===e&&-1===$c.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function el(t,e){var n;return tl(t=nl(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function nl(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var rl=function(){function t(t,e,n){var r=this;this.composite="replace",this.iterationComposite="replace",this.target=void 0,this.animation=void 0,this.timing=void 0,this.computedTiming=void 0,this.normalizedKeyframes=void 0,this.timeFraction=void 0,this.interpolations=void 0,this.target=t,this.timing=el(n,!1),this.timing.effect=this,this.timing.activeDuration=zc(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=Qc(e,this.timing),this.interpolations=Yc(this.normalizedKeyframes,this.timing,this.target),this.computedTiming=new Proxy(this.timing,{get:function(t,e){return"duration"===e?"auto"===t.duration?0:t.duration:"fill"===e?"auto"===t.fill?"none":t.fill:"localTime"===e?r.animation&&r.animation.currentTime||null:"currentIteration"===e?r.animation&&"running"===r.animation.playState?t.currentIteration||0:null:"progress"===e?r.animation&&"running"===r.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}})}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=jc(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=Qc(t)},e.getComputedTiming=function(){return this.computedTiming},e.getTiming=function(){return this.timing},e.updateTiming=function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing=t[n]}))},t}();function il(t,e){return Number(t.id)-Number(e.id)}var ol=function(){function t(t){var e=this;this.document=void 0,this.animations=[],this.ticking=!1,this.timelineTicking=!1,this.hasRestartedThisFrame=!1,this.animationsWithPromises=[],this.inTick=!1,this.pendingEffects=[],this.currentTime=null,this.rafId=0,this.rafCallbacks=[],this.frameId=void 0,this.webAnimationsNextTick=function(t){e.currentTime=t,e.discardAnimations(),0===e.animations.length?e.timelineTicking=!1:e.requestAnimationFrame(e.webAnimationsNextTick)},this.processRafCallbacks=function(t){var n=e.rafCallbacks;e.rafCallbacks=[],t<Number(e.currentTime)&&(t=Number(e.currentTime)),e.animations.sort(il),e.animations=e.tick(t,!0,e.animations)[0],n.forEach((function(e){e[1](t)})),e.applyPendingEffects()},this.document=t}var e=t.prototype;return e.getAnimations=function(){return this.discardAnimations(),this.animations.slice()},e.isTicking=function(){return this.inTick},e.play=function(t,e,n){var r=new rl(t,e,n),i=new cc(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i},e.applyDirtiedAnimation=function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(il),this.tick(Number(this.currentTime),!1,n.slice())[1].forEach((function(t){var n=e.animations.indexOf(t);-1!==n&&e.animations.splice(n,1)})),this.applyPendingEffects()}},e.restart=function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame},e.destroy=function(){this.document.defaultView.cancelAnimationFrame(this.frameId)},e.applyPendingEffects=function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]},e.updateAnimationsPromises=function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))},e.discardAnimations=function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))},e.restartWebAnimationsNextTick=function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))},e.rAF=function(t){var e=this.rafId++;return 0===this.rafCallbacks.length&&(this.frameId=this.document.defaultView.requestAnimationFrame(this.processRafCallbacks)),this.rafCallbacks.push([e,t]),e},e.requestAnimationFrame=function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))},e.tick=function(t,e,n){var r,i,o=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var a=[],s=[],u=[],c=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(a.push(n.effect),n.unmarkTarget()),n._needsTick&&(o.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):c.push(n)})),(r=this.pendingEffects).push.apply(r,a),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,c]},t}();iu.EasingFunction=Hc,iu.AnimationTimeline=ol,t.AABB=Dn,t.AbstractLayoutDefinition=Gu,t.AbstractRenderer=uu,t.AbstractRendererPlugin=su,t.AdvancedCamera=bu,t.Animation=cc,t.AnimationEvent=sc,t.AnimationTimeline=ol,t.BUILT_IN_PROPERTIES=Pa,t.CSS=ti,t.CSSGradientValue=Ar,t.CSSKeywordValue=Or,t.CSSRGB=$r,t.CSSStyleValue=Pr,t.CSSUnitValue=Vr,t.Camera=Ds,t.CameraEvent=Rs,t.Canvas=Eu,t.Circle=ss,t.CircleUpdater=Fs,t.CustomElement=cs,t.CustomElementRegistry=Ia,t.CustomEvent=Fa,t.DefaultLayoutRegistry=ju,t.DefaultSceneGraphSelector=Qs,t.DefaultSceneGraphService=Js,t.DisplayObject=os,t.DisplayObjectPool=fs,t.Document=Ha,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=or,t.Element=Qa,t.Ellipse=ds,t.EllipseUpdater=Gs,t.EventService=js,t.EventTarget=Ga,t.FederatedEvent=Da,t.FederatedMouseEvent=Ja,t.FederatedPointerEvent=$a,t.FederatedWheelEvent=ts,t.FragmentResult=Su,t.Frustum=Un,t.Group=ms,t.HTML=gs,t.Image=Es,t.KeyframeEffect=rl,t.LayoutChildren=Iu,t.LayoutContext=Fu,t.LayoutEdges=function(e){var n,r,i,o,a,s,u,c,l,h,f,p,d,v,m,y;this.options=void 0,this.inlineStart=void 0,this.inlineEnd=void 0,this.blockStart=void 0,this.blockEnd=void 0,this.inline=void 0,this.block=void 0,this.options=e;var g=e.node.getAllStyle(),x=null!==(n=null===(r=g.get(t.PropertyName.PADDING_TOP))||void 0===r?void 0:r.value)&&void 0!==n?n:0,E=null!==(i=null===(o=g.get(t.PropertyName.PADDING_END))||void 0===o?void 0:o.value)&&void 0!==i?i:0,T=null!==(a=null===(s=g.get(t.PropertyName.PADDING_BOTTOM))||void 0===s?void 0:s.value)&&void 0!==a?a:0,b=null!==(u=null===(c=g.get(t.PropertyName.PADDING_START))||void 0===c?void 0:c.value)&&void 0!==u?u:0,w=null!==(l=null===(h=g.get(t.PropertyName.PADDING_TOP))||void 0===h?void 0:h.value)&&void 0!==l?l:0,k=null!==(f=null===(p=g.get(t.PropertyName.PADDING_END))||void 0===p?void 0:p.value)&&void 0!==f?f:0,M=null!==(d=null===(v=g.get(t.PropertyName.PADDING_BOTTOM))||void 0===v?void 0:v.value)&&void 0!==d?d:0,P=null!==(m=null===(y=g.get(t.PropertyName.PADDING_START))||void 0===y?void 0:y.value)&&void 0!==m?m:0;this.blockStart=x+Uu[0]+w,this.inlineStart=E+Uu[1]+k,this.blockEnd=T+Uu[2]+M,this.inlineEnd=b+Uu[3]+P,this.block=this.blockStart+this.blockEnd,this.inline=this.inlineStart+this.inlineEnd},t.LayoutEngine=Vu,t.LayoutFragment=function(t,e){this._layoutContext=void 0,this.options=void 0,this.layoutContext=void 0,this.inlineSize=void 0,this.blockSize=void 0,this.inlineOffset=void 0,this.blockOffset=void 0,this.data=void 0,this._layoutContext=t,this.options=e,this.layoutContext=t,this.inlineSize=e.inlineSize,this.blockSize=e.blockSize,this.inlineOffset=0,this.blockOffset=0,this.data=e.data},t.LayoutObject=zu,t.Line=bs,t.LineUpdater=Us,t.MutationEvent=za,t.MutationObserver=Ju,t.MutationRecord=qu,t.Node=Ua,t.OffscreenCanvasCreator=Ys,t.Path=ks,t.PathUpdater=Bs,t.Plane=Fn,t.Point=Bn,t.Polygon=Ps,t.Polyline=Ns,t.PolylineUpdater=Vs,t.RBush=o,t.Rect=As,t.RectUpdater=Hs,t.Rectangle=Vn,t.Registration=Qu,t.RenderingService=Ks,t.Text=_s,t.TextService=ru,t.TextUpdater=zs,t.compareAnimations=il,t.computeLinearGradient=function(t,e,n){var r=So(n.value),i=0+t/2,o=0+e/2,a=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*a/2,y1:o-Math.sin(r)*a/2,x2:i+Math.cos(r)*a/2,y2:o+Math.sin(r)*a/2}},t.computeRadialGradient=function(e,n,r,i,o){var a=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(a=r.value/100*e),i.unit===t.UnitType.kPercentage&&(s=i.value/100*n);var u=Math.max(te([0,0],[a,s]),te([0,n],[a,s]),te([e,n],[a,s]),te([e,0],[a,s]));return o&&(o instanceof Vr?u=o.value:o instanceof Or&&("closest-side"===o.value?u=Math.min(a,e-a,s,n-s):"farthest-side"===o.value?u=Math.max(a,e-a,s,n-s):"closest-corner"===o.value&&(u=Math.min(te([0,0],[a,s]),te([0,n],[a,s]),te([e,n],[a,s]),te([e,0],[a,s]))))),{x:a,y:s,r:u}},t.convertToPath=function(e,n){void 0===n&&(n=e.getLocalTransform());var r=[];switch(e.nodeName){case t.Shape.LINE:var i=e.parsedStyle;r=function(t,e,n,r){return[["M",t,e],["L",n,r]]}(i.x1,i.y1,i.x2,i.y2);break;case t.Shape.CIRCLE:var o=e.parsedStyle,a=o.r;r=Jo(a,a,o.cx,o.cy);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=Jo(s.rx,s.ry,s.cx,s.cy);break;case t.Shape.POLYLINE:case t.Shape.POLYGON:r=function(t,e){var n=t.map((function(t,e){return[0===e?"M":"L",t[0],t[1]]}));return e&&n.push(["Z"]),n}(e.parsedStyle.points.points,e.nodeName===t.Shape.POLYGON);break;case t.Shape.RECT:var u=e.parsedStyle,c=u.width,l=u.height,h=u.x,f=u.y,p=u.radius,d=p&&p.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var o=i[0],a=i[1],s=i[2],u=i[3],c=t>0?1:-1,l=e>0?1:-1,h=c+l!==0?1:0;return[["M",c*o+n,r],["L",t-c*a+n,r],a?["A",a,a,0,0,h,t+n,l*a+r]:null,["L",t+n,e-l*s+r],s?["A",s,s,0,0,h,t+n-c*s,e+r]:null,["L",n+c*u,e+r],u?["A",u,u,0,0,h,n,e+r-l*u]:null,["L",n,l*o+r],o?["A",o,o,0,0,h,c*o+n,r]:null,["Z"]].filter((function(t){return t}))}return[["M",n,r],["L",n+t,r],["L",n+t,r+e],["L",n,r+e],["Z"]]}(c,l,h,f,d&&p.map((function(t){return ke(t,0,Math.min(Math.abs(c)/2,Math.abs(l)/2))})));break;case t.Shape.PATH:r=[].concat(e.parsedStyle.path.absolutePath)}if(r.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,o=void 0===i?0:i,a=r.defY,s=void 0===a?0:a;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=Q(e[1]-o,e[2]-s,0);n&&st(i,i,n),r=""+e[0]+i[0]+","+i[1]}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var a=Q(e[1]-o,e[2]-s,0),u=Q(e[3]-o,e[4]-s,0),c=Q(e[5]-o,e[6]-s,0);n&&(st(a,a,n),st(u,u,n),st(c,c,n)),r=""+e[0]+a[0]+","+a[1]+","+u[0]+","+u[1]+","+c[0]+","+c[1]}else if("A"===e[0]){var l=Q(e[6]-o,e[7]-s,0);n&&st(l,l,n),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+l[0]+","+l[1]}else if("Q"===e[0]){var h=Q(e[1]-o,e[2]-s,0),f=Q(e[3]-o,e[4]-s,0);n&&(st(h,h,n),st(f,f,n)),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+"}"}return t+r}),"")}(r,e,n)},t.createVec3=Po,t.decompose=_o,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==t[1]})))},t.deg2rad=So,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=Jn,t.fromRotationTranslationScale=Oo,t.getAngle=Mo,t.getEuler=Ao,t.getOrCalculatePathTotalLength=Vo,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=Zn,t.isFillOrStrokeAffected=function(t,e,n){var r=!1,i=!1;return"visiblepainted"===t||"painted"===t||"auto"===t?(r=!!e&&!e.isNone,i=!!n&&!n.isNone):"visiblefill"===t||"fill"===t?r=!0:"visiblestroke"===t||"stroke"===t?i=!0:"visible"!==t&&"all"!==t||(r=!0,i=!0),[r,i]},t.isPattern=gi,t.layoutEngine=Xu,t.makeTiming=tl,t.mergeColors=Ei,t.normalizeKeyframes=Qc,t.normalizeTimingInput=el,t.numericTimingToObject=nl,t.parseColor=xi,t.parseLength=bi,t.parsePath=Gi,t.propertyMetadataCache=Sa,t.rad2deg=No,t.resetEntityCounter=function(){ja=0},t.runtime=iu,t.setDOMSize=function(t,e,n){Zn&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n,r,i,o,a){void 0===r&&(r=0),void 0===i&&(i=0),void 0===o&&(o=0),void 0===a&&(a=0);var s=t.map((function(s,u){var c=t[u+1],l=0===u&&0!==r&&0!==i,h=(u===t.length-1||c&&("M"===c[0]||"Z"===c[0]))&&0!==o&&0!==a;switch(s[0]){case"M":return l?"M "+(s[1]-e+r)+","+(s[2]-n+i)+" L "+(s[1]-e)+","+(s[2]-n):"M "+(s[1]-e)+","+(s[2]-n);case"L":return"L "+(s[1]-e+(h?o:0))+","+(s[2]-n+(h?a:0));case"Q":return"Q "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+(h?" L "+(s[3]-e+o)+","+(s[4]-n+a):"");case"C":return"C "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+","+(s[5]-e)+" "+(s[6]-n)+(h?" L "+(s[5]-e+o)+","+(s[6]-n+a):"");case"A":return"A "+s[1]+" "+s[2]+" "+s[3]+" "+s[4]+" "+s[5]+" "+(s[6]-e)+" "+(s[7]-n)+(h?" L "+(s[6]-e+o)+","+(s[7]-n+a):"");case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=Co,Object.defineProperty(t,"__esModule",{value:!0})}));
|