@antv/g 5.16.25 → 5.16.26
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 +12161 -12592
- package/dist/index.umd.min.js +1 -1
- package/package.json +8 -8
package/dist/index.umd.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(t)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var r=n((function(t,e){t.exports=function(){function t(t,n,i,a,o){e(t,n,i||0,a||t.length-1,o||r)}function e(t,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(a,Math.floor(r+(s-u)*c/s+h)),o)}var f=t[r],d=i,v=a;for(n(t,i,r),o(t[a],f)>0&&n(t,i,a);v>d;){for(n(t,d,v),d++,v--;0>o(t[d],f);)d++;for(;o(t[v],f)>0;)v--}0===o(t[i],f)?n(t,i,v):n(t,++v,a),v>r||(i=v+1),r>v||(a=v-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=m(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;n>a;a++){var o=t.children[a];u(i,t.leaf?r(o):o)}return i}function u(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 c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function v(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function p(t,e){return!(t.minX>e.minX||t.minY>e.minY||e.maxX>t.maxX||e.maxY>t.maxY)}function y(t,e){return!(e.minX>t.maxX||e.minY>t.maxY||t.minX>e.maxX||t.minY>e.maxY)}function m(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function g(e,n,r,i,a){for(var o=[n,r];o.length;)if((r=o.pop())-(n=o.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,a),o.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!y(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var a=0;e.children.length>a;a++){var o=e.children[a],s=e.leaf?r(o):o;y(t,s)&&(e.leaf?n.push(o):p(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!y(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(y(t,a)){if(e.leaf||p(t,a))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),u=[],l=[];o||u.length;){if(o||(o=u.pop(),r=u[u.length-1],n=l.pop(),i=!0),o.leaf){var c=a(t,o.children,e);if(-1!==c)return o.children.splice(c,1),u.push(o),this._condense(u),this}i||o.leaf||!p(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(u.push(o),l.push(n),n=0,r=o,o=o.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(s>=a)return o(i=m(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(a/Math.pow(s,(r=Math.ceil(Math.log(a)/Math.log(s)))-1))),(i=m([])).leaf=!1,i.height=r;var u=Math.ceil(a/s),l=u*Math.ceil(Math.sqrt(s));g(t,e,n,l,this.compareMinX);for(var c=e;n>=c;c+=l){var h=Math.min(c+l-1,n);g(t,c,h,u,this.compareMinY);for(var f=c;h>=f;f+=u)i.children.push(this._build(t,f,Math.min(f+u-1,h),r-1))}return o(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,a=1/0,o=void 0,s=0;e.children.length>s;s++){var u=e.children[s],l=h(u),c=d(t,u)-l;a>c?(a=c,i=i>l?l:i,o=u):c===a&&i>l&&(i=l,o=u)}e=o||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],a=this._chooseSubtree(r,this.data,e,i);for(a.children.push(t),u(a,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=m(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=m([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,a=1/0,o=e;n-e>=o;o++){var u=s(t,0,o,this.toBBox),l=s(t,o,n,this.toBBox),c=v(u,l),f=h(u)+h(l);i>c?(i=c,r=o,a=a>f?f:a):c===i&&a>f&&(a=f,r=o)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:c,a=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>a&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=s(t,0,e,i),o=s(t,n-e,n,i),l=f(a)+f(o),c=e;n-e>c;c++){var h=t.children[c];u(a,t.leaf?i(h):h),l+=f(a)}for(var d=n-e-1;d>=e;d--){var v=t.children[d];u(o,t.leaf?i(v):v),l+=f(o)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()})),i=1e-6,a="undefined"!=typeof Float32Array?Float32Array:Array;function o(){var t=new a(9);return a!=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 s(){var t=new a(16);return a!=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 u(t){var e=new a(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 l(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 c(t,e,n,r,i,a,o,s,u,l,c,h,f,d,v,p,y){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=v,t[14]=p,t[15]=y,t}function h(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 f(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],o=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]=a,t[11]=e[14],t[12]=i,t[13]=o,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 d(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],y=e[14],m=e[15],g=n*s-r*o,k=n*u-i*o,x=n*l-a*o,b=r*u-i*s,E=r*l-a*s,T=i*l-a*u,S=c*p-h*v,P=c*y-f*v,M=c*m-d*v,w=h*y-f*p,N=h*m-d*p,C=f*m-d*y,A=g*C-k*N+x*w+b*M-E*P+T*S;return A?(t[0]=(s*C-u*N+l*w)*(A=1/A),t[1]=(i*N-r*C-a*w)*A,t[2]=(p*T-y*E+m*b)*A,t[3]=(f*E-h*T-d*b)*A,t[4]=(u*M-o*C-l*P)*A,t[5]=(n*C-i*M+a*P)*A,t[6]=(y*x-v*T-m*k)*A,t[7]=(c*T-f*x+d*k)*A,t[8]=(o*N-s*M+l*S)*A,t[9]=(r*M-n*N-a*S)*A,t[10]=(v*E-p*x+m*g)*A,t[11]=(h*x-c*E-d*g)*A,t[12]=(s*P-o*w-u*S)*A,t[13]=(n*w-r*P+i*S)*A,t[14]=(p*k-v*b-y*g)*A,t[15]=(c*b-h*k+f*g)*A,t):null}function v(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],f=t[11],d=t[12],v=t[13],p=t[14],y=t[15];return(e*o-n*a)*(h*y-f*p)-(e*s-r*a)*(c*y-f*v)+(e*u-i*a)*(c*p-h*v)+(n*s-r*o)*(l*y-f*d)-(n*u-i*o)*(l*p-h*d)+(r*u-i*s)*(l*v-c*d)}function p(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],v=e[11],p=e[12],y=e[13],m=e[14],g=e[15],k=n[0],x=n[1],b=n[2],E=n[3];return t[0]=k*r+x*s+b*h+E*p,t[1]=k*i+x*u+b*f+E*y,t[2]=k*a+x*l+b*d+E*m,t[3]=k*o+x*c+b*v+E*g,t[4]=(k=n[4])*r+(x=n[5])*s+(b=n[6])*h+(E=n[7])*p,t[5]=k*i+x*u+b*f+E*y,t[6]=k*a+x*l+b*d+E*m,t[7]=k*o+x*c+b*v+E*g,t[8]=(k=n[8])*r+(x=n[9])*s+(b=n[10])*h+(E=n[11])*p,t[9]=k*i+x*u+b*f+E*y,t[10]=k*a+x*l+b*d+E*m,t[11]=k*o+x*c+b*v+E*g,t[12]=(k=n[12])*r+(x=n[13])*s+(b=n[14])*h+(E=n[15])*p,t[13]=k*i+x*u+b*f+E*y,t[14]=k*a+x*l+b*d+E*m,t[15]=k*o+x*c+b*v+E*g,t}function y(t,e,n){var r,i,a,o,s,u,l,c,h,f,d,v,p=n[0],y=n[1],m=n[2];return e===t?(t[12]=e[0]*p+e[4]*y+e[8]*m+e[12],t[13]=e[1]*p+e[5]*y+e[9]*m+e[13],t[14]=e[2]*p+e[6]*y+e[10]*m+e[14],t[15]=e[3]*p+e[7]*y+e[11]*m+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],v=e[11],t[0]=r=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=v,t[12]=r*p+s*y+h*m+e[12],t[13]=i*p+u*y+f*m+e[13],t[14]=a*p+l*y+d*m+e[14],t[15]=o*p+c*y+v*m+e[15]),t}function m(t,e,n){var r=n[0],i=n[1],a=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]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function g(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=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]=a*i+l*r,t[5]=o*i+c*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=l*i-a*r,t[9]=c*i-o*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function k(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[8],c=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]=a*i-l*r,t[1]=o*i-c*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=a*r+l*i,t[9]=o*r+c*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function x(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 b(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,u=i+i,l=a+a,c=r*s,h=r*u,f=r*l,d=i*u,v=i*l,p=a*l,y=o*s,m=o*u,g=o*l;return t[0]=1-(d+p),t[1]=h+g,t[2]=f-m,t[3]=0,t[4]=h-g,t[5]=1-(c+p),t[6]=v+y,t[7]=0,t[8]=f+m,t[9]=v-y,t[10]=1-(c+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function E(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function T(t,e){var n=e[4],r=e[5],i=e[6],a=e[8],o=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(a,o,s),t}function S(t,e){var n=new a(3);T(n,e);var r=1/n[0],i=1/n[1],o=1/n[2],s=e[0]*r,u=e[1]*i,l=e[2]*o,c=e[4]*r,h=e[5]*i,f=e[6]*o,d=e[8]*r,v=e[9]*i,p=e[10]*o,y=s+h+p,m=0;return y>0?(t[3]=.25*(m=2*Math.sqrt(y+1)),t[0]=(f-v)/m,t[1]=(d-l)/m,t[2]=(u-c)/m):s>h&&s>p?(t[3]=(f-v)/(m=2*Math.sqrt(1+s-h-p)),t[0]=.25*m,t[1]=(u+c)/m,t[2]=(d+l)/m):h>p?(t[3]=(d-l)/(m=2*Math.sqrt(1+h-s-p)),t[0]=(u+c)/m,t[1]=.25*m,t[2]=(f+v)/m):(t[3]=(u-c)/(m=2*Math.sqrt(1+p-s-h)),t[0]=(d+l)/m,t[1]=(f+v)/m,t[2]=.25*m),t}function P(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],u=e[3],l=a+a,c=o+o,h=s+s,f=a*l,d=a*c,v=a*h,p=o*c,y=o*h,m=s*h,g=u*l,k=u*c,x=u*h,b=r[0],E=r[1],T=r[2],S=i[0],P=i[1],M=i[2],w=(1-(p+m))*b,N=(d+x)*b,C=(v-k)*b,A=(d-x)*E,O=(1-(f+m))*E,R=(y+g)*E,L=(v+k)*T,I=(y-g)*T,_=(1-(f+p))*T;return t[0]=w,t[1]=N,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=I,t[10]=_,t[11]=0,t[12]=n[0]+S-(w*S+A*P+L*M),t[13]=n[1]+P-(N*S+O*P+I*M),t[14]=n[2]+M-(C*S+R*P+_*M),t[15]=1,t}function M(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,u=i+i,l=n*o,c=r*o,h=r*s,f=i*o,d=i*s,v=i*u,p=a*o,y=a*s,m=a*u;return t[0]=1-h-v,t[1]=c+m,t[2]=f-y,t[3]=0,t[4]=c-m,t[5]=1-l-v,t[6]=d+p,t[7]=0,t[8]=f+y,t[9]=d-p,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function w(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,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)*(a=1/(r-i)),t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t}function N(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);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*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(o+a)*l,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 C=N;function A(t,e,n,r){var a,o,s,u,l,c,f,d,v,p,y=e[0],m=e[1],g=e[2],k=r[0],x=r[1],b=r[2],E=n[0],T=n[1],S=n[2];return i>Math.abs(y-E)&&i>Math.abs(m-T)&&i>Math.abs(g-S)?h(t):(p=1/Math.hypot(f=y-E,d=m-T,v=g-S),(p=Math.hypot(a=x*(v*=p)-b*(d*=p),o=b*(f*=p)-k*v,s=k*d-x*f))?(a*=p=1/p,o*=p,s*=p):(a=0,o=0,s=0),(p=Math.hypot(u=d*s-v*o,l=v*a-f*s,c=f*o-d*a))?(u*=p=1/p,l*=p,c*=p):(u=0,l=0,c=0),t[0]=a,t[1]=u,t[2]=f,t[3]=0,t[4]=o,t[5]=l,t[6]=d,t[7]=0,t[8]=s,t[9]=c,t[10]=v,t[11]=0,t[12]=-(a*y+o*m+s*g),t[13]=-(u*y+l*m+c*g),t[14]=-(f*y+d*m+v*g),t[15]=1,t)}function O(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 R=Object.freeze({__proto__:null,create:s,clone:u,copy:l,fromValues:function(t,e,n,r,i,o,s,u,l,c,h,f,d,v,p,y){var m=new a(16);return m[0]=t,m[1]=e,m[2]=n,m[3]=r,m[4]=i,m[5]=o,m[6]=s,m[7]=u,m[8]=l,m[9]=c,m[10]=h,m[11]=f,m[12]=d,m[13]=v,m[14]=p,m[15]=y,m},set:c,identity:h,transpose:f,invert:d,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],y=e[14],m=e[15];return t[0]=s*(f*m-d*y)-h*(u*m-l*y)+p*(u*d-l*f),t[1]=-(r*(f*m-d*y)-h*(i*m-a*y)+p*(i*d-a*f)),t[2]=r*(u*m-l*y)-s*(i*m-a*y)+p*(i*l-a*u),t[3]=-(r*(u*d-l*f)-s*(i*d-a*f)+h*(i*l-a*u)),t[4]=-(o*(f*m-d*y)-c*(u*m-l*y)+v*(u*d-l*f)),t[5]=n*(f*m-d*y)-c*(i*m-a*y)+v*(i*d-a*f),t[6]=-(n*(u*m-l*y)-o*(i*m-a*y)+v*(i*l-a*u)),t[7]=n*(u*d-l*f)-o*(i*d-a*f)+c*(i*l-a*u),t[8]=o*(h*m-d*p)-c*(s*m-l*p)+v*(s*d-l*h),t[9]=-(n*(h*m-d*p)-c*(r*m-a*p)+v*(r*d-a*h)),t[10]=n*(s*m-l*p)-o*(r*m-a*p)+v*(r*l-a*s),t[11]=-(n*(s*d-l*h)-o*(r*d-a*h)+c*(r*l-a*s)),t[12]=-(o*(h*y-f*p)-c*(s*y-u*p)+v*(s*f-u*h)),t[13]=n*(h*y-f*p)-c*(r*y-i*p)+v*(r*f-i*h),t[14]=-(n*(s*y-u*p)-o*(r*y-i*p)+v*(r*u-i*s)),t[15]=n*(s*f-u*h)-o*(r*f-i*h)+c*(r*u-i*s),t},determinant:v,multiply:p,translate:y,scale:m,rotate:function(t,e,n,r){var a,o,s,u,l,c,h,f,d,v,p,y,m,g,k,x,b,E,T,S,P,M,w,N,C=r[0],A=r[1],O=r[2],R=Math.hypot(C,A,O);return i>R?null:(C*=R=1/R,A*=R,O*=R,a=Math.sin(n),l=e[1],c=e[2],h=e[3],d=e[5],v=e[6],p=e[7],m=e[9],g=e[10],k=e[11],T=C*A*(s=1-(o=Math.cos(n)))-O*a,S=A*A*s+o,P=O*A*s+C*a,M=C*O*s+A*a,w=A*O*s-C*a,N=O*O*s+o,t[0]=(u=e[0])*(x=C*C*s+o)+(f=e[4])*(b=A*C*s+O*a)+(y=e[8])*(E=O*C*s-A*a),t[1]=l*x+d*b+m*E,t[2]=c*x+v*b+g*E,t[3]=h*x+p*b+k*E,t[4]=u*T+f*S+y*P,t[5]=l*T+d*S+m*P,t[6]=c*T+v*S+g*P,t[7]=h*T+p*S+k*P,t[8]=u*M+f*w+y*N,t[9]=l*M+d*w+m*N,t[10]=c*M+v*w+g*N,t[11]=h*M+p*w+k*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:g,rotateY:k,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],c=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]=a*i+l*r,t[1]=o*i+c*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=l*i-a*r,t[5]=c*i-o*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:x,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,a,o,s=n[0],u=n[1],l=n[2],c=Math.hypot(s,u,l);return i>c?null:(s*=c=1/c,u*=c,l*=c,r=Math.sin(e),t[0]=s*s*(o=1-(a=Math.cos(e)))+a,t[1]=u*s*o+l*r,t[2]=l*s*o-u*r,t[3]=0,t[4]=s*u*o-l*r,t[5]=u*u*o+a,t[6]=l*u*o+s*r,t[7]=0,t[8]=s*l*o+u*r,t[9]=u*l*o-s*r,t[10]=l*l*o+a,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:b,fromQuat2:function(t,e){var n=new a(3),r=-e[0],i=-e[1],o=-e[2],s=e[3],u=e[4],l=e[5],c=e[6],h=e[7],f=r*r+i*i+o*o+s*s;return f>0?(n[0]=2*(u*s+h*r+l*o-c*i)/f,n[1]=2*(l*s+h*i+c*r-u*o)/f,n[2]=2*(c*s+h*o+u*i-l*r)/f):(n[0]=2*(u*s+h*r+l*o-c*i),n[1]=2*(l*s+h*i+c*r-u*o),n[2]=2*(c*s+h*o+u*i-l*r)),b(t,e,n),t},getTranslation:E,getScaling:T,getRotation:S,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],u=i+i,l=a+a,c=o+o,h=i*u,f=i*l,d=i*c,v=a*l,p=a*c,y=o*c,m=s*u,g=s*l,k=s*c,x=r[0],b=r[1],E=r[2];return t[0]=(1-(v+y))*x,t[1]=(f+k)*x,t[2]=(d-g)*x,t[3]=0,t[4]=(f-k)*b,t[5]=(1-(h+y))*b,t[6]=(p+m)*b,t[7]=0,t[8]=(d+g)*E,t[9]=(p-m)*E,t[10]=(1-(h+v))*E,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:P,fromQuat:M,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),u=1/(i-r),l=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t},perspectiveNO:w,perspective:w,perspectiveZO:function(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,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*(a=1/(r-i)),t[14]=i*r*a):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+s),l=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-s)*u*.5,t[9]=(i-a)*l*.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:N,ortho:C,orthoZO:function(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);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]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=a*l,t[15]=1,t},lookAt:A,targetTo:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=r[0],u=r[1],l=r[2],c=i-n[0],h=a-n[1],f=o-n[2],d=c*c+h*h+f*f;d>0&&(c*=d=1/Math.sqrt(d),h*=d,f*=d);var v=u*f-l*h,p=l*c-s*f,y=s*h-u*c;return(d=v*v+p*p+y*y)>0&&(v*=d=1/Math.sqrt(d),p*=d,y*=d),t[0]=v,t[1]=p,t[2]=y,t[3]=0,t[4]=h*y-f*p,t[5]=f*v-c*y,t[6]=c*p-h*v,t[7]=0,t[8]=c,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=a,t[14]=o,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:O,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],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],c=t[7],h=t[8],f=t[9],d=t[10],v=t[11],p=t[12],y=t[13],m=t[14],g=t[15],k=e[0],x=e[1],b=e[2],E=e[3],T=e[4],S=e[5],P=e[6],M=e[7],w=e[8],N=e[9],C=e[10],A=e[11],O=e[12],R=e[13],L=e[14],I=e[15];return!(Math.abs(n-k)>i*Math.max(1,Math.abs(n),Math.abs(k))||Math.abs(r-x)>i*Math.max(1,Math.abs(r),Math.abs(x))||Math.abs(a-b)>i*Math.max(1,Math.abs(a),Math.abs(b))||Math.abs(o-E)>i*Math.max(1,Math.abs(o),Math.abs(E))||Math.abs(s-T)>i*Math.max(1,Math.abs(s),Math.abs(T))||Math.abs(u-S)>i*Math.max(1,Math.abs(u),Math.abs(S))||Math.abs(l-P)>i*Math.max(1,Math.abs(l),Math.abs(P))||Math.abs(c-M)>i*Math.max(1,Math.abs(c),Math.abs(M))||Math.abs(h-w)>i*Math.max(1,Math.abs(h),Math.abs(w))||Math.abs(f-N)>i*Math.max(1,Math.abs(f),Math.abs(N))||Math.abs(d-C)>i*Math.max(1,Math.abs(d),Math.abs(C))||Math.abs(v-A)>i*Math.max(1,Math.abs(v),Math.abs(A))||Math.abs(p-O)>i*Math.max(1,Math.abs(p),Math.abs(O))||Math.abs(y-R)>i*Math.max(1,Math.abs(y),Math.abs(R))||Math.abs(m-L)>i*Math.max(1,Math.abs(m),Math.abs(L))||Math.abs(g-I)>i*Math.max(1,Math.abs(g),Math.abs(I)))},mul:p,sub:O});function L(){var t=new a(3);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function I(t){var e=new a(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function _(t){return Math.hypot(t[0],t[1],t[2])}function D(t,e,n){var r=new a(3);return r[0]=t,r[1]=e,r[2]=n,r}function F(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function G(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function U(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function B(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function j(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function V(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function Y(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function z(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],u=n[2];return t[0]=i*u-a*s,t[1]=a*o-r*u,t[2]=r*s-i*o,t}function X(t,e,n,r){var i=e[0],a=e[1],o=e[2];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t}function W(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/(o=o||1),t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function H(t,e){var n=t[0],r=t[1],a=t[2],o=e[0],s=e[1],u=e[2];return i*Math.max(1,Math.abs(n),Math.abs(o))>=Math.abs(n-o)&&i*Math.max(1,Math.abs(r),Math.abs(s))>=Math.abs(r-s)&&i*Math.max(1,Math.abs(a),Math.abs(u))>=Math.abs(a-u)}var q,K=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},Z=_;q=L();function Q(){var t=new a(4);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function $(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t}!function(){var t=Q()}();function J(){var t=new a(4);return a!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function tt(t,e,n){var r=Math.sin(n*=.5);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function et(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+o*s+i*l-a*u,t[1]=i*c+o*u+a*s-r*l,t[2]=a*c+o*l+r*u-i*s,t[3]=o*c-r*s-i*u-a*l,t}function nt(t,e,n,r){var a,o,s,u,l,c=e[0],h=e[1],f=e[2],d=e[3],v=n[0],p=n[1],y=n[2],m=n[3];return 0>(o=c*v+h*p+f*y+d*m)&&(o=-o,v=-v,p=-p,y=-y,m=-m),1-o>i?(s=Math.sin(a=Math.acos(o)),u=Math.sin((1-r)*a)/s,l=Math.sin(r*a)/s):(u=1-r,l=r),t[0]=u*c+l*v,t[1]=u*h+l*p,t[2]=u*f+l*y,t[3]=u*d+l*m,t}function rt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t}function it(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var a=Math.sin(e*=i),o=Math.cos(e),s=Math.sin(n),u=Math.cos(n),l=Math.sin(r),c=Math.cos(r);return t[0]=a*u*c-o*s*l,t[1]=o*s*c+a*u*l,t[2]=o*u*l-a*s*c,t[3]=o*u*c+a*s*l,t}var at,ot,st,ut,lt,ct,ht=function(t,e,n,r){var i=new a(4);return i[0]=t,i[1]=e,i[2]=n,i[3]=r,i},ft=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},dt=et,vt=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o,t};at=L(),ot=D(1,0,0),st=D(0,1,0),ut=J(),lt=J(),ct=o();!function(){var t,e=(t=new a(2),a!=Float32Array&&(t[0]=0,t[1]=0),t)}();function pt(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var yt=function(){return yt=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},yt.apply(this,arguments)},mt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function gt(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 kt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function xt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return kt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function bt(t){return xt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function Et(t){return bt(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Tt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=kt[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,kt[n]))),kt[n]););}function St(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 Pt(t){return t>=48&&57>=t||43===t||45===t||46===t}function Mt(t){return t>=48&&57>=t}function wt(t){var e,n=t.max,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,u=!1,l=!1;if(n>a)if(43!==(e=r.charCodeAt(a))&&45!==e||(e=r.charCodeAt(a+=1)),Mt(e)||46===e){if(46!==e){if(o=48===e,e=r.charCodeAt(a+=1),o&&n>a&&e&&Mt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>a&&Mt(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(l=!0,a+=1;Mt(r.charCodeAt(a));)a+=1,u=!0;e=r.charCodeAt(a)}if(101===e||69===e){if(l&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" invalid float exponent');if(43!==(e=r.charCodeAt(a+=1))&&45!==e||(a+=1),a>=n||!Mt(r.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" invalid integer exponent');for(;n>a&&Mt(r.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(i,a)}else t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+a+', "pathValue" is missing param'}function Nt(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 Ct(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),a=kt[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,Nt(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(97!=(32|i)||3!==o&&4!==o?wt(t):St(t),t.err.length)return;t.data.push(t.param),Nt(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,Nt(t))}if(t.index>=t.max)break;if(!Pt(n.charCodeAt(t.index)))break}Tt(t)}else Tt(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var At=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 Ot(t){if(bt(t))return pt(t);var e=function(t){if(xt(t))return pt(t);var e=new At(t);for(Nt(e);e.max>e.index&&!e.err.length;)Ct(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,a=0;return e.map((function(t){var e,o=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=o[0],a=r=o[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+r];break;case"V":e=[u,o[0]+r];break;case"H":e=[u,o[0]+n];break;default:var l=o.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(l)}else e=[u].concat(o);var c=e.length;switch(u){case"Z":n=i,r=a;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[c-2],r=e[c-1],"M"===u&&(i=n,a=r)}return e}))}function Rt(t,e){var n=t[0],r=e.x1,i=e.y1,a=e.x2,o=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 l=2*r-a,c=2*i-o;e.x1=l,e.y1=c,u=["C",l,c].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 d=s[1];e.qx=s[0],e.qy=d}return u}function Lt(t){if(Et(t))return pt(t);for(var e=Ot(t),n=yt({},mt),r=0;e.length>r;r+=1){e[r]=Rt(e[r],n);var i=e[r],a=i.length;n.x1=+i[a-2],n.y1=+i[a-1],n.x2=+i[a-4]||n.x1,n.y2=+i[a-3]||n.y1}return e}function It(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function _t(t,e,n,r,i,a,o,s,u,l){var c,h,f,d,v,p=t,y=e,m=n,g=r,k=s,x=u,b=120*Math.PI/180,E=Math.PI/180*(+i||0),T=[];if(l)h=l[0],f=l[1],d=l[2],v=l[3];else{y=(c=It(p,y,-E)).y;var S=((p=c.x)-(k=(c=It(k,x,-E)).x))/2,P=(y-(x=c.y))/2,M=S*S/(m*m)+P*P/(g*g);M>1&&(m*=M=Math.sqrt(M),g*=M);var w=m*m,N=g*g,C=(a===o?-1:1)*Math.sqrt(Math.abs((w*N-w*P*P-N*S*S)/(w*P*P+N*S*S)));d=C*m*P/g+(p+k)/2,h=Math.asin(((y-(v=C*-g*S/m+(y+x)/2))/g*1e9>>0)/1e9),f=Math.asin(((x-v)/g*1e9>>0)/1e9),0>(h=d>p?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=d>k?Math.PI-f:f)&&(f=2*Math.PI+f),o&&h>f&&(h-=2*Math.PI),!o&&f>h&&(f-=2*Math.PI)}var A=f-h;if(Math.abs(A)>b){var O=f,R=k,L=x;T=_t(k=d+m*Math.cos(f=h+b*(o&&f>h?1:-1)),x=v+g*Math.sin(f),m,g,i,0,o,R,L,[f,O,d,v])}A=f-h;var I=Math.cos(h),_=Math.sin(h),D=Math.cos(f),F=Math.sin(f),G=Math.tan(A/4),U=4/3*m*G,B=4/3*g*G,j=[p,y],V=[p+U*_,y-B*I],Y=[k+U*F,x-B*D],z=[k,x];if(V[0]=2*j[0]-V[0],V[1]=2*j[1]-V[1],l)return V.concat(Y,z,T);for(var X=[],W=0,H=(T=V.concat(Y,z,T)).length;H>W;W+=1)X[W]=W%2?It(T[W-1],T[W],E).y:It(T[W],T[W+1],E).x;return X}function Dt(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function Ft(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Gt(t,e,n,r,i){var a=Ft([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(0<i)if(i<a){var s=Dt([t,e],[n,r],i/a);o={x:s[0],y:s[1]}}else o={x:n,y:r};else o={x:t,y:e};return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Ut(t,e,n,r){var i=.5,a=[t,e],o=[n,r],s=Dt(a,o,i),u=Dt(o,s,i),l=Dt(s,u,i),c=Dt(u,l,i),h=Dt(l,c,i),f=Gt(a[0],a[1],s[0],s[1],l[0]).point,d=Gt(h[0],h[1],c[0],c[1],u[0]).point;return[f.x,f.y,d.x,d.y,n,r]}function Bt(t,e){var n,r,i,a,o,s,u,l=t[0],c=t.slice(1).map(Number),h=c[0],f=c[1],d=e.x1,v=e.y1,p=e.x,y=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=h,e.y=f,t;case"A":return n=[d,v].concat(c),["C"].concat(_t(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=[d,v].concat(c),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(a=n[4])+u*r,s*(o=n[5])+u*i,a,o]);case"L":return["C"].concat(Ut(d,v,h,f));case"Z":return d===p&&v===y?["C",d,v,p,y,p,y]:["C"].concat(Ut(d,v,p,y))}return t}function jt(t,e){if(void 0===e&&(e=!1),function(t){return Et(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=pt(t);return e?[n,[]]:n}for(var r,i,a=Lt(t),o=yt({},mt),s=[],u="",l=a.length,c=[],h=0;l>h;h+=1){a[h]&&(u=a[h][0]),s[h]=u;var f=Bt(a[h],o);a[h]=f,gt(a,s,h),l=a.length,"Z"===u&&c.push(h),o.x1=+(r=a[h])[(i=r.length)-2],o.y1=+r[i-1],o.x2=+r[i-4]||o.x1,o.y2=+r[i-3]||o.y1}return e?[a,c]:a}function Vt(t,e){var n=t.x,r=t.y,i=e.x,a=e.y;return(0>n*a-r*i?-1:1)*Math.acos((n*i+r*a)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))))}function Yt(t,e,n,r,i,a,o,s,u,l){var c=Math.abs,h=Math.sin,f=Math.cos,d=Math.sqrt,v=Math.PI,p=c(n),y=c(r),m=(i%360+360)%360*(v/180);if(t===s&&e===u)return{x:t,y:e};if(0===p||0===y)return Gt(t,e,s,u,l).point;var g=(t-s)/2,k=(e-u)/2,x={x:f(m)*g+h(m)*k,y:-h(m)*g+f(m)*k},b=Math.pow(x.x,2)/Math.pow(p,2)+Math.pow(x.y,2)/Math.pow(y,2);b>1&&(p*=d(b),y*=d(b));var E=(Math.pow(p,2)*Math.pow(y,2)-Math.pow(p,2)*Math.pow(x.y,2)-Math.pow(y,2)*Math.pow(x.x,2))/(Math.pow(p,2)*Math.pow(x.y,2)+Math.pow(y,2)*Math.pow(x.x,2)),T=(a!==o?1:-1)*d(E=0>E?0:E),S=T*(p*x.y/y),P=T*(-y*x.x/p),M=f(m)*S-h(m)*P+(t+s)/2,w=h(m)*S+f(m)*P+(e+u)/2,N={x:(x.x-S)/p,y:(x.y-P)/y},C=Vt({x:1,y:0},N),A=Vt(N,{x:(-x.x-S)/p,y:(-x.y-P)/y});!o&&A>0?A-=2*v:o&&0>A&&(A+=2*v);var O=C+(A%=2*v)*l,R=p*f(O),L=y*h(O);return{x:f(m)*R-h(m)*L+M,y:h(m)*R+f(m)*L+w}}function zt(t,e,n,r,i,a,o,s,u,l,c){var h,f=c.bbox,d=void 0===f||f,v=c.length,p=void 0===v||v,y=c.sampleSize,m=void 0===y?30:y,g="number"==typeof l,k=t,x=e,b=0,E=[k,x,b],T=[k,x],S={x:0,y:0},P=[{x:k,y:x}];g&&0>=l&&(S={x:k,y:x});for(var M=0;m>=M;M+=1){if(k=(h=Yt(t,e,n,r,i,a,o,s,u,M/m)).x,x=h.y,d&&P.push({x:k,y:x}),p&&(b+=Ft(T,[k,x])),T=[k,x],g&&b>=l&&l>E[2]){var w=(b-l)/(b-E[2]);S={x:T[0]*(1-w)+E[0]*w,y:T[1]*(1-w)+E[1]*w}}E=[k,x,b]}return g&&l>=b&&(S={x:s,y:u}),{length:b,point:S,min:{x:Math.min.apply(null,P.map((function(t){return t.x}))),y:Math.min.apply(null,P.map((function(t){return t.y})))},max:{x:Math.max.apply(null,P.map((function(t){return t.x}))),y:Math.max.apply(null,P.map((function(t){return t.y})))}}}function Xt(t,e,n,r,i,a,o,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*i+Math.pow(u,3)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*a+Math.pow(u,3)*s}}function Wt(t,e,n,r,i,a,o,s,u,l){var c,h=l.bbox,f=void 0===h||h,d=l.length,v=void 0===d||d,p=l.sampleSize,y=void 0===p?10:p,m="number"==typeof u,g=t,k=e,x=0,b=[g,k,x],E=[g,k],T={x:0,y:0},S=[{x:g,y:k}];m&&0>=u&&(T={x:g,y:k});for(var P=0;y>=P;P+=1){if(g=(c=Xt(t,e,n,r,i,a,o,s,P/y)).x,k=c.y,f&&S.push({x:g,y:k}),v&&(x+=Ft(E,[g,k])),E=[g,k],m&&x>=u&&u>b[2]){var M=(x-u)/(x-b[2]);T={x:E[0]*(1-M)+b[0]*M,y:E[1]*(1-M)+b[1]*M}}b=[g,k,x]}return m&&u>=x&&(T={x:o,y:s}),{length:x,point:T,min:{x:Math.min.apply(null,S.map((function(t){return t.x}))),y:Math.min.apply(null,S.map((function(t){return t.y})))},max:{x:Math.max.apply(null,S.map((function(t){return t.x}))),y:Math.max.apply(null,S.map((function(t){return t.y})))}}}function Ht(t,e,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function qt(t,e,n,r,i,a,o,s){var u,l=s.bbox,c=void 0===l||l,h=s.length,f=void 0===h||h,d=s.sampleSize,v=void 0===d?10:d,p="number"==typeof o,y=t,m=e,g=0,k=[y,m,g],x=[y,m],b={x:0,y:0},E=[{x:y,y:m}];p&&0>=o&&(b={x:y,y:m});for(var T=0;v>=T;T+=1){if(y=(u=Ht(t,e,n,r,i,a,T/v)).x,m=u.y,c&&E.push({x:y,y:m}),f&&(g+=Ft(x,[y,m])),x=[y,m],p&&g>=o&&o>k[2]){var S=(g-o)/(g-k[2]);b={x:x[0]*(1-S)+k[0]*S,y:x[1]*(1-S)+k[1]*S}}k=[y,m,g]}return p&&o>=g&&(b={x:i,y:a}),{length:g,point:b,min:{x:Math.min.apply(null,E.map((function(t){return t.x}))),y:Math.min.apply(null,E.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 Kt(t,e,n){for(var r,i,a,o,s,u,l,c,h,f=Lt(t),d="number"==typeof e,v=[],p=0,y=0,m=0,g=0,k=[],x=[],b=0,E={x:0,y:0},T=E,S=E,P=E,M=0,w=0,N=f.length;N>w;w+=1)v=(l="M"===(c=(h=f[w])[0]))?v:[p,y].concat(h.slice(1)),l?(T=E={x:m=h[1],y:g=h[2]},b=0,d&&.001>e&&(P=E)):"L"===c?(b=(r=Gt(v[0],v[1],v[2],v[3],(e||0)-M)).length,E=r.min,T=r.max,S=r.point):"A"===c?(b=(i=zt(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],(e||0)-M,n||{})).length,E=i.min,T=i.max,S=i.point):"C"===c?(b=(a=Wt(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],(e||0)-M,n||{})).length,E=a.min,T=a.max,S=a.point):"Q"===c?(b=(o=qt(v[0],v[1],v[2],v[3],v[4],v[5],(e||0)-M,n||{})).length,E=o.min,T=o.max,S=o.point):"Z"===c&&(b=(s=Gt((v=[p,y,m,g])[0],v[1],v[2],v[3],(e||0)-M)).length,E=s.min,T=s.max,S=s.point),d&&e>M&&M+b>=e&&(P=S),x.push(T),k.push(E),M+=b,p=(u="Z"!==c?h.slice(-2):[m,g])[0],y=u[1];return d&&e>=M&&(P={x:p,y:y}),{length:M,point:P,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,x.map((function(t){return t.x}))),y:Math.max.apply(null,x.map((function(t){return t.y})))}}}function Zt(t){return function(t){var e=0,n=0,r=0;return jt(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var a,o,s,u,l,c,h,f,d=t.slice(1);return r=3*(((f=d[5])-(o=n))*((s=d[0])+(l=d[2]))-((h=d[4])-(a=e))*((u=d[1])+(c=d[3]))+u*(a-l)-s*(o-c)+f*(l+a/3)-h*(c+o/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function Qt(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Wt(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),a=t.slice(6,8),o=Dt(n,r,e),s=Dt(r,i,e),u=Dt(i,a,e),l=Dt(o,s,e),c=Dt(s,u,e),h=Dt(l,c,e);return[["C"].concat(o,l,h),["C"].concat(c,u,a)]}(r):[t,t]:[t],l:i}}))}function $t(t,e,n){var r=Qt(t),i=Qt(e),a=r.length,o=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(a,o),f=[l,c],d=[h-a,h-o],v=0,p=[r,i].map((function(t,e){return t.l===h?t.map((function(t){return t.s})):t.map((function(t,n){return d[e]-=(v=n&&d[e]&&t.l>=f[e])?1:0,v?t.ss:[t.s]})).flat()}));return p[0].length===p[1].length?p:$t(p[0],p[1],h)}var Jt=function(t){return null==t},te={}.toString,ee=function(t,e){return te.call(t)==="[object "+e+"]"},ne=function(t){return Array.isArray?Array.isArray(t):ee(t,"Array")},re=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},ie=function(t){if(ne(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},ae=function(t){if(ne(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},oe=function(t){return ee(t,"String")},se=function(t,e,n){return e>t?e:t>n?n:t},ue=function(t){return ee(t,"Number")},le=1e-5;var ce=function(t,e){return(t%e+e)%e},he=function(t){return ee(t,"Boolean")},fe=function(t){return void 0===t};function de(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function ve(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function pe(){}var ye=.7,me=1/ye,ge="\\s*([+-]?\\d+)\\s*",ke="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",xe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",be=/^#([0-9a-f]{3,8})$/,Ee=RegExp("^rgb\\("+[ge,ge,ge]+"\\)$"),Te=RegExp("^rgb\\("+[xe,xe,xe]+"\\)$"),Se=RegExp("^rgba\\("+[ge,ge,ge,ke]+"\\)$"),Pe=RegExp("^rgba\\("+[xe,xe,xe,ke]+"\\)$"),Me=RegExp("^hsl\\("+[ke,xe,xe]+"\\)$"),we=RegExp("^hsla\\("+[ke,xe,xe,ke]+"\\)$"),Ne={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 Ce(){return this.rgb().formatHex()}function Ae(){return this.rgb().formatRgb()}function Oe(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=be.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Re(e):3===n?new Ie(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Le(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Le(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=Ee.exec(t))?new Ie(e[1],e[2],e[3],1):(e=Te.exec(t))?new Ie(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Se.exec(t))?Le(e[1],e[2],e[3],e[4]):(e=Pe.exec(t))?Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Me.exec(t))?Ge(e[1],e[2]/100,e[3]/100,1):(e=we.exec(t))?Ge(e[1],e[2]/100,e[3]/100,e[4]):Ne.hasOwnProperty(t)?Re(Ne[t]):"transparent"===t?new Ie(NaN,NaN,NaN,0):null}function Re(t){return new Ie(t>>16&255,t>>8&255,255&t,1)}function Le(t,e,n,r){return r>0||(t=e=n=NaN),new Ie(t,e,n,r)}function Ie(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function _e(){return"#"+Fe(this.r)+Fe(this.g)+Fe(this.b)}function De(){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 Fe(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Ge(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Be(t,e,n,r)}function Ue(t){if(t instanceof Be)return new Be(t.h,t.s,t.l,t.opacity);if(t instanceof pe||(t=Oe(t)),!t)return new Be;if(t instanceof Be)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(r>n):n===a?(r-e)/s+2:(e-n)/s+4,s/=.5>u?a+i:2-a-i,o*=60):s=u>0&&1>u?0:o,new Be(o,s,u,t.opacity)}function Be(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function je(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 Ve(t){return function(t){if(Array.isArray(t))return ze(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Ye(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ye(t,e){if(t){if("string"==typeof t)return ze(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)?ze(t,e):void 0}}function ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function Xe(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function We(t,e){return.001>Math.abs(t-e)}function He(t,e){var n=Math.min.apply(Math,Ve(t)),r=Math.min.apply(Math,Ve(e));return{x:n,y:r,width:Math.max.apply(Math,Ve(t))-n,height:Math.max.apply(Math,Ve(e))-r}}de(pe,Oe,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ce,formatHex:Ce,formatHsl:function(){return Ue(this).formatHsl()},formatRgb:Ae,toString:Ae}),de(Ie,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof pe||(i=Oe(i)),i?new Ie((i=i.rgb()).r,i.g,i.b,i.opacity):new Ie):new Ie(t,e,n,null==r?1:r);var i}),ve(pe,{brighter:function(t){return new Ie(this.r*(t=null==t?me:Math.pow(me,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Ie(this.r*(t=null==t?ye:Math.pow(ye,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:De,toString:De})),de(Be,(function(t,e,n,r){return 1===arguments.length?Ue(t):new Be(t,e,n,null==r?1:r)}),ve(pe,{brighter:function(t){return new Be(this.h,this.s,this.l*(t=null==t?me:Math.pow(me,t)),this.opacity)},darker:function(t){return new Be(this.h,this.s,this.l*(t=null==t?ye:Math.pow(ye,t)),this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new Ie(je(240>t?t+120:t-240,r,n),je(t,r,n),je(120>t?t+240:t-120,r,n),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 qe={box:function(t,e,n,r){return He([t,n],[e,r])},length:function(t,e,n,r){return Xe(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,a){var o=(n-t)*(i-t)+(r-e)*(a-e);return 0>o?Xe(t,e,i,a):o>(n-t)*(n-t)+(r-e)*(r-e)?Xe(n,r,i,a):this.pointToLine(t,e,n,r,i,a)},pointToLine:function(t,e,n,r,i,a){var o=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(o,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-e)*(a-e));var s=[-o[1],o[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,a-e],s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function Ke(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function Ze(t,e,n){var r=t+n-2*e;if(We(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}var Qe=function(t,e,n,r,i,a){var o=Ze(t,n,i)[0],s=Ze(e,r,a)[0],u=[t,i],l=[e,a];return void 0!==o&&u.push(Ke(t,n,i,o)),void 0!==s&&l.push(Ke(e,r,a,s)),He(u,l)};function $e(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function Je(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(We(s,0))We(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;We(h,0)?c.push(-u/(2*s)):h>0&&(a=(-u-(o=Math.sqrt(h)))/(2*s),0>(i=(-u+o)/(2*s))||i>1||c.push(i),0>a||a>1||c.push(a))}return c}var tn=function(t,e,n,r,i,a,o,s){for(var u=[t,o],l=[e,s],c=Je(t,n,i,o),h=Je(e,r,a,s),f=0;c.length>f;f++)u.push($e(t,n,i,o,c[f]));for(var d=0;h.length>d;d++)l.push($e(e,r,a,s,h[d]));return He(u,l)};function en(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function nn(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}var rn=function(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,l=-1/0,c=[a,o],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;o>a?f>a&&o>f&&c.push(f):f>o&&a>f&&c.push(f)}for(var d=0;c.length>d;d++){var v=en(t,0,n,r,i,c[d]);u>v&&(u=v),v>l&&(l=v)}for(var p=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),y=1/0,m=-1/0,g=[a,o],k=2*-Math.PI;2*Math.PI>=k;k+=Math.PI){var x=p+k;o>a?x>a&&o>x&&g.push(x):x>o&&a>x&&g.push(x)}for(var b=0;g.length>b;b++){var E=nn(0,e,n,r,i,g[b]);y>E&&(y=E),E>m&&(m=E)}return{x:u,y:y,width:l-u,height:m-y}};var an,on,sn,un,ln,cn,hn=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+=Xe(r[0],r[1],i[0],i[1])}return e}(t)},fn=n((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 a(t,e,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||t,o),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 o(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,a=Array(i);i>r;r++)a[r]=e[r].fn;return a},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,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,a),!0;case 6:return c.fn.call(c.context,e,r,i,a,o),!0}for(l=1,u=Array(h-1);h>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var f,d=c.length;for(l=0;d>l;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,r);break;case 4:c[l].fn.call(c[l].context,e,r,i);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var u=0,l=[],c=s.length;c>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&l.push(s[u]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&o(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}));function dn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function vn(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?dn(Object(n),!0).forEach((function(e){En(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):dn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function pn(){pn=function(){return t};var t={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},a="function"==typeof Symbol?Symbol:{},o=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var a=Object.create((e&&e.prototype instanceof d?e:d).prototype),o=new M(r||[]);return i(a,"_invoke",{value:E(t,n,o)}),a}function h(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function d(){}function v(){}function p(){}var y={};l(y,o,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(w([])));g&&g!==n&&r.call(g,o)&&(y=g);var k=p.prototype=d.prototype=Object.create(y);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,n){function a(i,o,s,u){var l=h(t[i],t,o);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==e(f)&&r.call(f,"__await")?n.resolve(f.__await).then((function(t){a("next",t,s,u)}),(function(t){a("throw",t,s,u)})):n.resolve(f).then((function(t){c.value=t,s(c)}),(function(t){return a("throw",t,s,u)}))}u(l.arg)}var o;i(this,"_invoke",{value:function(t,e){function r(){return new n((function(n,r){a(t,e,n,r)}))}return o=o?o.then(r,r):r()}})}function E(t,e,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return N()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=T(o,n);if(s){if(s===f)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=h(t,e,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function T(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,T(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var i=h(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,f;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(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 P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function w(t){if(t){var e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,i=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return i.next=i}}return{next:N}}function N(){return{value:void 0,done:!0}}return v.prototype=p,i(k,"constructor",{value:p,configurable:!0}),i(p,"constructor",{value:v,configurable:!0}),v.displayName=l(p,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,l(t,u,"GeneratorFunction")),t.prototype=Object.create(k),t},t.awrap=function(t){return{__await:t}},x(b.prototype),l(b.prototype,s,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new b(c(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},x(k),l(k,u,"Generator"),l(k,o,(function(){return this})),l(k,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=w,M.prototype={constructor:M,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(P),!t)for(var e in this)"t"===e.charAt(0)&&r.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 n(n,r){return o.type="throw",o.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 a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return n("end");if(this.prev>=a.tryLoc){var s=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(s&&u){if(a.catchLoc>this.prev)return n(a.catchLoc,!0);if(a.finallyLoc>this.prev)return n(a.finallyLoc)}else if(s){if(a.catchLoc>this.prev)return n(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(a.finallyLoc>this.prev)return n(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(this.prev>=i.tryLoc&&r.call(i,"finallyLoc")&&i.finallyLoc>this.prev){var a=i;break}}a&&("break"===t||"continue"===t)&&e>=a.tryLoc&&a.finallyLoc>=e&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(o)},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),f},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),P(n),f}},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;P(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:w(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function yn(t){return yn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yn(t)}function mn(t,e,n,r,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function gn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){mn(a,r,i,o,s,"next",t)}function s(t){mn(a,r,i,o,s,"throw",t)}o(void 0)}))}}function kn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function xn(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,_n(r.key),r)}}function bn(t,e,n){return e&&xn(t.prototype,e),n&&xn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function En(t,e,n){return(e=_n(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tn(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Pn(t,e)}function Sn(t){return Sn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Sn(t)}function Pn(t,e){return Pn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Pn(t,e)}function Mn(t,e){if(null==t)return{};var n,r,i=function(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;a.length>r;r++)0>e.indexOf(n=a[r])&&(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;a.length>r;r++)0>e.indexOf(n=a[r])&&Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function wn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Nn(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,i=Sn(t);if(n){var a=Sn(this).constructor;r=Reflect.construct(i,arguments,a)}else r=i.apply(this,arguments);return function(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return wn(t)}(this,r)}}function Cn(){return Cn="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var r=function(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=Sn(t)););return t}(t,e);if(r){var i=Object.getOwnPropertyDescriptor(r,e);return i.get?i.get.call(3>arguments.length?t:n):i.value}},Cn.apply(this,arguments)}function An(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],u=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||Rn(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function On(t){return function(t){if(Array.isArray(t))return Ln(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||Rn(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Rn(t,e){if(t){if("string"==typeof t)return Ln(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)?Ln(t,e):void 0}}function Ln(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function In(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=Rn(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,i=function(){};return{s:i,n:function(){return t.length>r?{done:!1,value:t[r++]}:{done:!0}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return o=t.done,t},e:function(t){s=!0,a=t},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function _n(t){var n=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"===e(n)?n:n+""}(an=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",an.COLOR="<color>",an.PAINT="<paint>",an.NUMBER="<number>",an.ANGLE="<angle>",an.OPACITY_VALUE="<opacity-value>",an.SHADOW_BLUR="<shadow-blur>",an.LENGTH="<length>",an.PERCENTAGE="<percentage>",an.LENGTH_PERCENTAGE="<length> | <percentage>",an.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",an.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",an.LIST_OF_POINTS="<list-of-points>",an.PATH="<path>",an.FILTER="<filter>",an.Z_INDEX="<z-index>",an.OFFSET_DISTANCE="<offset-distance>",an.DEFINED_PATH="<defined-path>",an.MARKER="<marker>",an.TRANSFORM="<transform>",an.TRANSFORM_ORIGIN="<transform-origin>",an.TEXT="<text>",an.TEXT_TRANSFORM="<text-transform>",(on=t.UnitType||(t.UnitType={}))[on.kUnknown=0]="kUnknown",on[on.kNumber=1]="kNumber",on[on.kPercentage=2]="kPercentage",on[on.kEms=3]="kEms",on[on.kPixels=4]="kPixels",on[on.kRems=5]="kRems",on[on.kDegrees=6]="kDegrees",on[on.kRadians=7]="kRadians",on[on.kGradians=8]="kGradians",on[on.kTurns=9]="kTurns",on[on.kMilliseconds=10]="kMilliseconds",on[on.kSeconds=11]="kSeconds",on[on.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"}(sn||(sn={})),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"}(un||(un={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(ln||(ln={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(cn||(cn={}));var Dn,Fn=[{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"}(Dn||(Dn={}));var Gn,Un=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return Fn.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},Bn=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},jn=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""},Vn=function(){function e(){kn(this,e)}return bn(e,[{key:"toString",value:function(){return this.buildCSSText(ln.kNo,cn.kNo,"")}},{key:"isNumericValue",value:function(){return this.getType()>=Dn.kUnitType&&this.getType()<=Dn.kClampType}}],[{key:"isAngle",value:function(e){return e===t.UnitType.kDegrees||e===t.UnitType.kRadians||e===t.UnitType.kGradians||e===t.UnitType.kTurns}},{key:"isLength",value:function(e){return e>=t.UnitType.kEms&&t.UnitType.kDegrees>e}},{key:"isRelativeUnit",value:function(e){return e===t.UnitType.kPercentage||e===t.UnitType.kEms||e===t.UnitType.kRems}},{key:"isTime",value:function(e){return e===t.UnitType.kSeconds||e===t.UnitType.kMilliseconds}}]),e}(),Yn=function(t){Tn(n,t);var e=Nn(n);function n(t){var r;return kn(this,n),(r=e.call(this)).colorSpace=void 0,r.colorSpace=t,r}return bn(n,[{key:"getType",value:function(){return Dn.kColorType}},{key:"to",value:function(t){return this}}]),n}(Vn);(Gn=t.GradientType||(t.GradientType={}))[Gn.Constant=0]="Constant",Gn[Gn.LinearGradient=1]="LinearGradient",Gn[Gn.RadialGradient=2]="RadialGradient";var zn=function(t){Tn(n,t);var e=Nn(n);function n(t,r){var i;return kn(this,n),(i=e.call(this)).type=void 0,i.value=void 0,i.type=t,i.value=r,i}return bn(n,[{key:"clone",value:function(){return new n(this.type,this.value)}},{key:"buildCSSText",value:function(t,e,n){return n}},{key:"getType",value:function(){return Dn.kColorType}}]),n}(Vn),Xn=function(t){Tn(n,t);var e=Nn(n);function n(t){var r;return kn(this,n),(r=e.call(this)).value=void 0,r.value=t,r}return bn(n,[{key:"clone",value:function(){return new n(this.value)}},{key:"getType",value:function(){return Dn.kKeywordType}},{key:"buildCSSText",value:function(t,e,n){return n+this.value}}]),n}(Vn);function Wn(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var u=t.apply(this,i);return n.cache=s.set(o,u)||s,u};return n.cache=new(Wn.Cache||Map),n}Wn.Cache=Map;var Hn=Wn((function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),qn=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?"".concat(0!==e?"-":"").concat(t.toLowerCase()):t})).join("")};function Kn(t){return"function"==typeof t}var Zn={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Qn=Wn((function(t){var e=Hn(t),n=Zn[e];return e=(null==n?void 0:n.alias)||e})),$n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},Jn=function(e){return function(e){switch(e){case sn.kUNumber:return t.UnitType.kNumber;case sn.kULength:return t.UnitType.kPixels;case sn.kUPercent:return t.UnitType.kPercentage;case sn.kUTime:return t.UnitType.kSeconds;case sn.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return sn.kUNumber;case t.UnitType.kPercentage:return sn.kUPercent;case t.UnitType.kPixels:return sn.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return sn.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return sn.kUAngle;default:return sn.kUOther}}(e))},tr=function(e){Tn(r,e);var n=Nn(r);function r(e){var i,a,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.UnitType.kNumber;return kn(this,r),(i=n.call(this)).unit=void 0,i.value=void 0,a="string"==typeof o?Un(o):o,i.unit=a,i.value=e,i}return bn(r,[{key:"clone",value:function(){return new r(this.value,this.unit)}},{key:"equals",value:function(t){return this.value===t.value&&this.unit===t.unit}},{key:"getType",value:function(){return Dn.kUnitType}},{key:"convertTo",value:function(e){if(this.unit===e)return new r(this.value,this.unit);var n=Jn(this.unit);if(n!==Jn(e)||n===t.UnitType.kUnknown)return null;var i=Bn(this.unit)/Bn(e);return new r(this.value*i,e)}},{key:"buildCSSText",value: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 a=this.value,o=jn(this.unit);if(-999999>a||a>999999){var s=jn(this.unit);i=!Number.isFinite(a)||Number.isNaN(a)?$n(a,s):a+(s||"")}else i="".concat(a).concat(o)}return r+=i}}]),r}(Vn),er=new tr(0,"px"),nr=(new tr(1,"px"),new tr(0,"deg")),rr=function(t){Tn(n,t);var e=Nn(n);function n(t,r,i){var a,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return kn(this,n),(a=e.call(this,"rgb")).r=void 0,a.g=void 0,a.b=void 0,a.alpha=void 0,a.isNone=void 0,a.r=t,a.g=r,a.b=i,a.alpha=o,a.isNone=s,a}return bn(n,[{key:"clone",value:function(){return new n(this.r,this.g,this.b,this.alpha)}},{key:"buildCSSText",value:function(t,e,n){return n+"rgba(".concat(this.r,",").concat(this.g,",").concat(this.b,",").concat(this.alpha,")")}}]),n}(Yn),ir={number:function(t){return new tr(t)},percent:function(t){return new tr(t,"%")},px:function(t){return new tr(t,"px")},em:function(t){return new tr(t,"em")},rem:function(t){return new tr(t,"rem")},deg:function(t){return new tr(t,"deg")},grad:function(t){return new tr(t,"grad")},rad:function(t){return new tr(t,"rad")},turn:function(t){return new tr(t,"turn")},s:function(t){return new tr(t,"s")},ms:function(t){return new tr(t,"ms")},registerProperty:function(t){Ss.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){Ss.layoutRegistry.registerLayout(t,e)}},ar=new Xn("unset"),or=new Xn("initial"),sr=new Xn("inherit"),ur={"":ar,unset:ar,initial:or,inherit:sr},lr=function(t){return ur[t]||(ur[t]=new Xn(t)),ur[t]},cr=new rr(0,0,0,0,!0),hr=new rr(0,0,0,0),fr=Wn((function(t,e,n,r){return new rr(t,e,n,r)}),(function(t,e,n,r){return"rgba(".concat(t,",").concat(e,",").concat(n,",").concat(r,")")})),dr=function(e){return new tr(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.UnitType.kNumber)},vr=new tr(50,"%"),pr={},yr=0;var mr="undefined"!=typeof window&&void 0!==window.document;function gr(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function kr(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function xr(t,e){if(mr)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var br="Method not implemented.",Er="Use document.documentElement instead.",Tr={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function Sr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Pr(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function Mr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function wr(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function Nr(t){return void 0===t?0:t>360||-360>t?t%360:t}function Cr(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Array.isArray(t)&&3===t.length?I(t):ue(t)?D(t,e,n):D(t[0],t[1]||e,t[2]||n)}function Ar(t){return t*(Math.PI/180)}function Or(t){return t*(180/Math.PI)}function Rr(t){return 360*t}function Lr(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,a=An(T(L(),e),3),o=a[0],s=a[1],u=a[2],l=Math.asin(-e[2]/o);return i>l?l>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/o,e[0]/o)):(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]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=r*r,s=i*i,u=a*a,l=n*n+o+s+u,c=n*a-r*i;return c>.499995*l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*l>c?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(o+s))),t}(t,e)}function Ir(t,e,n,r,i){var o,s,u,l,c,h,f,d,v,p,y=Math.cos(t),m=Math.sin(t);return o=r*y,s=i*m,u=0,l=-r*m,c=i*y,h=0,f=e,d=n,v=1,(p=new a(9))[0]=o,p[1]=s,p[2]=u,p[3]=l,p[4]=c,p[5]=h,p[6]=f,p[7]=d,p[8]=v,p}function _r(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?a=-a:o=-o),a&&(e*=1/a,n*=1/a),o&&(r*=1/o,i*=1/o);var s=Or(Math.atan2(n,e));return[t[6],t[7],a,o,s]}var Dr=s(),Fr=s(),Gr=Q(),Ur=[L(),L(),L()],Br=L();function jr(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}var Vr=s();function Yr(t,e){if(t&&t.length){var n=0,r=0;e?(n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0,e.resetLocalTransform(),e.setLocalPosition(n,r)):e=new xo({}),t.forEach((function(t){var i=t.t,a=t.d;if("scale"===i){var o=(null==a?void 0:a.map((function(t){return t.value})))||[1,1];e.scaleLocal(o[0],o[1],1)}else if("scalex"===i){var s=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(s[0],1,1)}else if("scaley"===i){var u=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(1,u[0],1)}else if("scalez"===i){var l=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,l[0])}else if("scale3d"===i){var h=(null==a?void 0:a.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(h[0],h[1],h[2])}else if("translate"===i){var f=a||[er,er];e.translateLocal(f[0].value,f[1].value,0)}else if("translatex"===i){e.translateLocal((a||[er])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(a||[er])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(a||[er])[0].value)}else if("translate3d"===i){var d=a||[er,er,er];e.translateLocal(d[0].value,d[1].value,d[2].value)}else if("rotate"===i){e.rotateLocal(0,0,Ui((a||[nr])[0]))}else if("rotatex"===i){e.rotateLocal(Ui((a||[nr])[0]),0,0)}else if("rotatey"===i){e.rotateLocal(0,Ui((a||[nr])[0]),0)}else if("rotatez"===i){e.rotateLocal(0,0,Ui((a||[nr])[0]))}else if("rotate3d"===i);else if("skew"===i){var v=(null==a?void 0:a.map((function(t){return t.value})))||[0,0];e.setLocalSkew(Ar(v[0]),Ar(v[1]))}else if("skewx"===i){var p=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(Ar(p[0]),e.getLocalSkew()[1])}else if("skewy"===i){var y=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],Ar(y[0]))}else if("matrix"===i){var m=An(a.map((function(t){return t.value})),6);e.setLocalTransform(c(Vr,m[0],m[1],0,0,m[2],m[3],0,0,0,0,1,0,m[4]+n,m[5]+r,0,1))}else"matrix3d"===i&&(c.apply(R,[Vr].concat(On(a.map((function(t){return t.value}))))),Vr[12]+=n,Vr[13]+=r,e.setLocalTransform(Vr))}))}return e.getLocalTransform()}function zr(t){var e=t.type,n=t.value;return"hex"===e?"#".concat(n):"literal"===e?n:"rgb"===e?"rgb(".concat(n.join(","),")"):"rgba(".concat(n.join(","),")")}var Xr,Wr=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw Error(e+": "+t)}function r(){var t=d(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return a("linear-gradient",t.linearGradient,s)||a("repeating-linear-gradient",t.repeatingLinearGradient,s)||a("radial-gradient",t.radialGradient,u)||a("repeating-radial-gradient",t.repeatingRadialGradient,u)||a("conic-gradient",t.conicGradient,u)}function a(e,r,i){return o(r,(function(r){var a=i();return a&&(k(t.comma)||n("Missing comma before color stops")),{type:e,orientation:a,colorStops:d(v)}}))}function o(e,r){var i=k(e);if(i){k(t.startCall)||n("Missing (");var a=r(i);return k(t.endCall)||n("Missing )"),a}}function s(){return g("directional",t.sideOrCorner,1)||g("angular",t.angleValue,1)}function u(){var n,r,i=l();return i&&((n=[]).push(i),r=e,k(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=g("shape",/^(circle)/i,0);t&&(t.style=m()||c());return t}()||function(){var t=g("shape",/^(ellipse)/i,0);t&&(t.style=y()||c());return t}();if(t)t.at=h();else{var e=c();if(e){t=e;var n=h();n&&(t.at=n)}else{var r=f();r&&(t={type:"default-radial",at:r})}}return t}function c(){return g("extent-keyword",t.extentKeywords,1)}function h(){if(g("position",/^at/,0)){var t=f();return t||n("Missing positioning value"),t}}function f(){var t={x:y(),y:y()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var r=e(),i=[];if(r)for(i.push(r);k(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function v(){var e=g("hex",t.hexColor,1)||o(t.rgbaColor,(function(){return{type:"rgba",value:d(p)}}))||o(t.rgbColor,(function(){return{type:"rgb",value:d(p)}}))||g("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=y(),e}function p(){return k(t.number)[1]}function y(){return g("%",t.percentageValue,1)||g("position-keyword",t.positionKeywords,1)||m()}function m(){return g("px",t.pixelValue,1)||g("em",t.emValue,1)}function g(t,e,n){var r=k(e);if(r)return{type:t,value:r[n]}}function k(t){var n=/^[\n\r\t\s]+/.exec(e);n&&x(n[0].length);var r=t.exec(e);return r&&x(r[0].length),r}function x(t){e=e.substring(t)}return function(t){return e=t,r()}}();function Hr(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=Kt(t.parsedStyle.path.absolutePath,void 0,yt(yt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function qr(t,e){return t[0]===e[0]&&t[1]===e[1]}function Kr(t,e){var n,r=t.prePoint,i=t.currentPoint,a=t.nextPoint,o=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2),u=Math.acos((o+s-(Math.pow(r[0]-a[0],2)+Math.pow(r[1]-a[1],2)))/(2*Math.sqrt(o)*Math.sqrt(s)));if(!u||0===Math.sin(u)||(void 0===n&&(n=le),n>Math.abs(u-0)))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(a[1]-i[1],a[0]-i[0])),c=Math.abs(Math.atan2(a[0]-i[0],a[1]-i[1]));return c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(u/2-(l=l>Math.PI/2?Math.PI-l:l))*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(c-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}function Zr(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}(Xr=t.Shape||(t.Shape={})).GROUP="g",Xr.CIRCLE="circle",Xr.ELLIPSE="ellipse",Xr.IMAGE="image",Xr.RECT="rect",Xr.LINE="line",Xr.POLYLINE="polyline",Xr.POLYGON="polygon",Xr.TEXT="text",Xr.PATH="path",Xr.HTML="html",Xr.MESH="mesh";var Qr=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},$r=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=Ar(r=ce(r,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-o.x)/2,c=(t.y-o.y)/2,h={x:Math.cos(u)*l+Math.sin(u)*c,y:-Math.sin(u)*l+Math.cos(u)*c},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),n*=Math.sqrt(f));var d=(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)),v=(i!==a?1:-1)*Math.sqrt(d=0>d?0:d),p=v*(e*h.y/n),y=v*(-n*h.x/e),m={x:Math.cos(u)*p-Math.sin(u)*y+(t.x+o.x)/2,y:Math.sin(u)*p+Math.cos(u)*y+(t.y+o.y)/2},g={x:(h.x-p)/e,y:(h.y-y)/n},k=Qr({x:1,y:0},g),x=Qr(g,{x:(-h.x-p)/e,y:(-h.y-y)/n});!a&&x>0?x-=2*Math.PI:a&&0>x&&(x+=2*Math.PI);var b=k+(x%=2*Math.PI)*s,E=e*Math.cos(b),T=n*Math.sin(b);return{x:Math.cos(u)*E-Math.sin(u)*T+m.x,y:Math.sin(u)*E+Math.cos(u)*T+m.y,ellipticalArcStartAngle:k,ellipticalArcEndAngle:k+x,ellipticalArcAngle:b,ellipticalArcCenter:m,resultantRx:e,resultantRy:n}};function Jr(t,e){var n=2>=arguments.length||void 0===arguments[2]||arguments[2],r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,u=r.xRotation,l=r.arcFlag,c=r.sweepFlag,h=$r({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=$r({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=f.x-h.x,v=f.y-h.y,p=Math.sqrt(d*d+v*v);return{x:-d/p,y:-v/p}}function ti(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ei(t,e){return ti(t)*ti(e)?(t[0]*e[0]+t[1]*e[1])/(ti(t)*ti(e)):1}function ni(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(ei(t,e))}function ri(t,e){var n=e[1],r=e[2],i=ce(Ar(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],u=t[1],l=e[6],c=e[7],h=Math.cos(i)*(s-l)/2+Math.sin(i)*(u-c)/2,f=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(u-c)/2,d=h*h/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var v=n*n*(f*f)+r*r*(h*h),p=v?Math.sqrt((n*n*(r*r)-v)/v):1;a===o&&(p*=-1),isNaN(p)&&(p=0);var y=r?p*n*f/r:0,m=n?p*-r*h/n:0,g=(s+l)/2+Math.cos(i)*y-Math.sin(i)*m,k=(u+c)/2+Math.sin(i)*y+Math.cos(i)*m,x=[(h-y)/n,(f-m)/r],b=[(-1*h-y)/n,(-1*f-m)/r],E=ni([1,0],x),T=ni(x,b);return ei(x,b)>-1||(T=Math.PI),1>ei(x,b)||(T=0),0===o&&T>0&&(T-=2*Math.PI),1===o&&0>T&&(T+=2*Math.PI),{cx:g,cy:k,rx:qr(t,[l,c])?0:n,ry:qr(t,[l,c])?0:r,startAngle:E,endAngle:E+T,xRotation:i,arcFlag:a,sweepFlag:o}}function ii(t,e,n,r){var i=.5522847498307936,a=t*i,o=e*i,s=n-t,u=n+t,l=r-e,c=r+e;return[["M",s,r],["C",s,r-o,n-a,l,n,l],["C",n+a,l,u,r-o,u,r],["C",u,r+o,n+a,c,n,c],["C",n-a,c,s,r+o,s,r],["Z"]]}var ai=function(){function t(){kn(this,t),this.callbacks=[]}return bn(t,[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map((function(t){return t.apply(void 0,e)})))}}]),t}(),oi=function(){function t(){kn(this,t),this.callbacks=[]}var e;return bn(t,[{key:"tapPromise",value:function(t,e){this.callbacks.push(e)}},{key:"promise",value:(e=gn(pn().mark((function t(){var e,n,r,i,a=arguments;return pn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=14;break}return t.next=3,(e=this.callbacks)[0].apply(e,a);case 3:n=t.sent,r=0;case 5:if(r>=this.callbacks.length-1){t.next=13;break}return i=this.callbacks[r],t.next=9,i(n);case 9:n=t.sent;case 10:r++,t.next=5;break;case 13:return t.abrupt("return",n);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),si=function(){function t(){kn(this,t),this.callbacks=[]}return bn(t,[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];this.callbacks.forEach((function(t){t.apply(void 0,e)}))}}]),t}(),ui=function(){function t(){kn(this,t),this.callbacks=[]}return bn(t,[{key:"tap",value:function(t,e){this.callbacks.push(e)}},{key:"call",value:function(){if(this.callbacks.length){for(var t,e=(t=this.callbacks)[0].apply(t,arguments),n=0;this.callbacks.length-1>n;n++){e=(0,this.callbacks[n])(e)}return e}return null}}]),t}(),li=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],ci=/([\"\'])[^\'\"]+\1/;var hi=1,fi="object"===("undefined"==typeof self?"undefined":yn(self))&&self.self==self?self:"object"===("undefined"==typeof global?"undefined":yn(global))&&global.global==global?global:{},di=Date.now(),vi={},pi=Date.now(),yi=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-pi,r=n>16?0:16-n,i=hi++;return vi[i]=t,Object.keys(vi).length>1||setTimeout((function(){pi=e;var t=vi;vi={},Object.keys(t).forEach((function(e){return t[e](fi.performance&&"function"==typeof fi.performance.now?fi.performance.now():Date.now()-di)}))}),r),i},mi=function(t){delete vi[t]},gi=function(t){return"string"!=typeof t?yi:""===t?fi.requestAnimationFrame:fi[t+"RequestAnimationFrame"]},ki=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!gi(t)})),xi=gi(ki),bi=function(t){return"string"!=typeof t?mi:""===t?fi.cancelAnimationFrame:fi[t+"CancelAnimationFrame"]||fi[t+"CancelRequestAnimationFrame"]}(ki);fi.requestAnimationFrame=xi,fi.cancelAnimationFrame=bi;var Ei=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,Ti=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,Si=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,Pi=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var Mi={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},wi=Wn((function(t){return dr("angular"===t.type?Number(t.value):Mi[t.value]||0,"deg")})),Ni=Wn((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.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==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.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:dr(e,r),cy:dr(n,i)}})),Ci=Wn((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Wr(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,a=Number(t[0].length.value),o=1;r>o;o++){var s,u=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!Jt(u)&&!Jt(a)){for(var l=1;o-i>l;l++)t[i+l].length={type:"%",value:"".concat(a+(Number(u)-a)*l/(o-i))};i=o,a=Number(u)}}}(i);var a=i.map((function(t){return{offset:dr(Number(t.length.value),"%"),color:zr(t)}}));if("linear-gradient"===n)return new zn(t.GradientType.LinearGradient,{angle:r?wi(r):nr,steps:a});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var o,s=Ni(r[0].at),u=s.cx,l=s.cy;if(r[0].style){var c=r[0].style,h=c.type,f=c.value;o="extent-keyword"===h?lr(f):dr(f,h)}return new zn(t.GradientType.RadialGradient,{cx:u,cy:l,size:o,steps:a})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=Ei.exec(e);if(r){var i,a=(null===(i=r[2].match(Pi))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new zn(t.GradientType.LinearGradient,{angle:dr(parseFloat(r[1]),"deg"),steps:a.map((function(t){var e=An(t,2),n=e[1];return{offset:dr(100*Number(e[0]),"%"),color:n}}))})]}}else if("r"===n){var o=function(t){var e=Ti.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:dr(50,"%"),cy:dr(50,"%"),steps:r.map((function(t){var e=An(t,2),n=e[1];return{offset:dr(100*Number(e[0]),"%"),color:n}}))}}return null}(e);if(o){if(!oe(o))return[new zn(t.GradientType.RadialGradient,o)];e=o}}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 Ai(t){return t&&!!t.image}function Oi(t){return t&&!Jt(t.r)&&!Jt(t.g)&&!Jt(t.b)}var Ri=Wn((function(t){if(Ai(t))return vn({repetition:"repeat"},t);if(Jt(t)&&(t=""),"transparent"===t)return hr;"currentColor"===t&&(t="black");var e=Ci(t);if(e)return e;var n=Oe(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),fr.apply(void 0,r)}));function Li(t,e){if(Oi(t)&&Oi(e))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(se(e[n],0,255));return e[3]=se(e[3],0,1),"rgba(".concat(e.join(","),")")}]}function Ii(t,e){if(Jt(e))return dr(0,"px");if(e="".concat(e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return dr(Number(e),"px");if("deg".search(t)>=0)return dr(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 dr(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var _i=Wn((function(t){return Ii(/px/g,t)})),Di=(Wn((function(t){return Ii(RegExp("%","g"),t)})),function(t){return ue(t)||isFinite(Number(t))?dr(Number(t)||0,"px"):Ii(RegExp("px|%|em|rem","g"),t)}),Fi=Wn((function(t){return Ii(/deg|rad|grad|turn/g,t)}));function Gi(t,e,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a="",o=t.value||0,s=e.value||0,u=Jn(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(o=l.value,s=c.value,a=jn(t.unit)):(tr.isLength(t.unit)||tr.isLength(e.unit))&&(o=Vi(t,i,n),s=Vi(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function Ui(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=Or(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=Rr(Number(e.value))),n}function Bi(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):oe(t)?n=t.split(" ").map((function(t){return Number(t)})):ue(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function ji(t){return oe(t)?t.split(" ").map((function(t){return Di(t)})):t.map((function(t){return Di(""+t)}))}function Vi(e,n,r){if(0===e.value)return 0;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.geometry.contentBounds;return e.value/100*i.halfExtents[n]*2}return 0}var Yi=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function zi(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if("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,Yi.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return Ii(/deg|rad|grad|turn|px|%/g,t)||Ri(t)}))}),n.lastIndex===t.length)return r}return[]}function Xi(t){return""+t}var Wi=Wn((function(t){return dr("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)}));Wn((function(t){return oe(t)?t.split(" ").map(Wi):t.map(Wi)}));function Hi(t,e){return[t,e,Xi]}function qi(t,e){return function(n,r){return[n,r,function(n){return Xi(se(n,t,e))}]}}function Ki(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var Zi=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=Lt(t)}catch(n){e=Lt(""),console.error("[g]: Invalid SVG Path definition: ".concat(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 a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;o>s;s++){var u=t[s];r=t[s+1];var l=u[0],c={command:l,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[u[1],u[2]],a=s;break;case"A":var h=ri(n,u);c.arcParams=h}if("Z"===l)n=i,r=t[a+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),c.currentPoint=n,e[a]&&qr(n,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var d=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===l){var v=[u[1],u[2]];c.startTangent=[d[0]-v[0],d[1]-v[1]],c.endTangent=[n[0]-v[0],n[1]-v[1]]}else if("T"===l){var p=e[s-1],y=Zr(p.currentPoint,d);"Q"===p.command?(c.command="Q",c.startTangent=[d[0]-y[0],d[1]-y[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]]):(c.command="TL",c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===l){var m=[u[1],u[2]],g=[u[3],u[4]];c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[n[0]-g[0],n[1]-g[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[m[0]-g[0],m[1]-g[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[g[0]-m[0],g[1]-m[1]])}else if("S"===l){var k=e[s-1],x=Zr(k.currentPoint,d),b=[u[1],u[2]];"C"===k.command?(c.command="C",c.startTangent=[d[0]-x[0],d[1]-x[1]],c.endTangent=[n[0]-b[0],n[1]-b[1]]):(c.command="SQ",c.startTangent=[d[0]-b[0],d[1]-b[1]],c.endTangent=[n[0]-b[0],n[1]-b[1]])}else if("A"===l){var E=Jr(c,0),T=E.x,S=E.y,P=Jr(c,1,!1),M=P.x,w=P.y;c.startTangent=[T,S],c.endTangent=[M,w]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],a=0;t.length>a;a++){var o=t[a],s=o.currentPoint,u=o.params,l=o.prePoint,c=void 0;switch(o.command){case"Q":c=Qe(l[0],l[1],u[1],u[2],u[3],u[4]);break;case"C":c=tn(l[0],l[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;c=rn(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}c&&(o.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}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=ae(n),d=ae(r),v=ie(n),p=ie(r);if(0===i.length)return{x:f,y:d,width:v-f,height:p-d};for(var y=0;i.length>y;y++){var m=i[y],g=m.currentPoint;g[0]===f?f-=Kr(m,e).xExtra:g[0]===v&&(v+=Kr(m,e).xExtra),g[1]===d?d-=Kr(m,e).yExtra:g[1]===p&&(p+=Kr(m,e).yExtra)}return{x:f,y:d,width:v-f,height:p-d}}(o,0),u=s.x,l=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(h)?h:0}}},Qi=Wn(Zi);function $i(t,e){var n=oe(t)?Qi(t):Zi(t);return e&&(e.parsedStyle.defX=n.rect.x,e.parsedStyle.defY=n.rect.y),n}function Ji(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=jt(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=jt(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=$t(r,i));var o,s,u,l,c,h,f,d,v=Zt(a[0])!==Zt(a[1])?(s=(o=a[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[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))})))):pt(a[0]);return[v,(u=a[1],l=v,c=u.length-1,h=[],f=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,a){var o=i+a;return 0===a||t[o]&&"M"===t[o][0]?["M"].concat(t[o].slice(-2)):(e>o||(o-=n),t[o])}))}))}(u),d.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=Ft(u[(e+n)%c].slice(-2),l[n%c].slice(-2))})),h[e]=f,f=0})),d[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function ta(t,e){var n;n=oe(t)?t.split(" ").map((function(t){var e=An(t.split(","),2),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,a=[],o=0,s=hn(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=qe.length(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(o+=i)/s,a.push(r))}));var u=Math.min.apply(Math,On(n.map((function(t){return t[0]})))),l=Math.min.apply(Math,On(n.map((function(t){return t[1]}))));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=l),{points:n,totalLength:s,segments:a}}function ea(t,e){return[t.points,e.points,function(t){return t}]}var na=null;function ra(t){return function(e){var n=0;return t.map((function(t){return t===na?e[n++]:t}))}}function ia(t){return t}var aa={matrix:["NNNNNN",[na,na,0,0,na,na,0,0,0,0,1,0,na,na,0,1],ia],matrix3d:["NNNNNNNNNNNNNNNN",ia],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ra([na,na,new tr(1)]),ia],scalex:["N",ra([na,new tr(1),new tr(1)]),ra([na,new tr(1)])],scaley:["N",ra([new tr(1),na,new tr(1)]),ra([new tr(1),na])],scalez:["N",ra([new tr(1),new tr(1),na])],scale3d:["NNN",ia],skew:["Aa",null,ia],skewx:["A",null,ra([na,nr])],skewy:["A",null,ra([nr,na])],translate:["Tt",ra([na,na,er]),ia],translatex:["T",ra([na,er,er]),ra([na,er])],translatey:["T",ra([er,na,er]),ra([er,na])],translatez:["L",ra([er,er,na])],translate3d:["TTL",ia]};function oa(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 a=e[1],o=aa[a];if(!o)return[];var s=e[2].split(","),u=o[0];if(s.length>u.length)return[];for(var l=[],c=0;u.length>c;c++){var h=s[c],f=u[c],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?nr:Fi(t)},N:Wi,T:Di,L:_i}[f.toUpperCase()](h):{a:nr,n:l[0],t:er}[f]))return[];l.push(d)}if(r.push({t:a,d:l}),n.lastIndex===t.length)return r}return[]}function sa(t){var e,n,r,i;switch(t.t){case"rotatex":return i=Ar(Ui(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=Ar(Ui(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=Ar(Ui(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=Ar(Ui(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),u=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*u),2*(e*r*l-n*u),0,2*(e*n*l-r*u),1-2*(e*e+r*r)*l,2*(n*r*l+e*u),0,2*(e*r*l+n*u),2*(n*r*l-e*u),1-2*(e*e+n*n)*l,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 c=Ar(Ui(t.d[0])),h=Ar(Ui(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=Ar(Ui(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=Ar(Ui(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=Vi(t.d[0],0,null)||0,n=Vi(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Vi(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=Vi(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=Vi(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=Vi(t.d[0],0,null)||0,n=Vi(t.d[1],0,null)||0,r=Vi(t.d[2],0,null)||0,1];case"perspective":var f=Vi(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 ua(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 la(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){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}(Dr,t))return!1;if(l(Fr,Dr),Fr[3]=0,Fr[7]=0,Fr[11]=0,Fr[15]=1,1e-8>Math.abs(v(Fr)))return!1;var o,s,u=Dr[3],c=Dr[7],h=Dr[11],p=Dr[12],y=Dr[13],m=Dr[14],g=Dr[15];if(0!==u||0!==c||0!==h){if(Gr[0]=u,Gr[1]=c,Gr[2]=h,Gr[3]=g,!d(Fr,Fr))return!1;f(Fr,Fr),$(i,Gr,Fr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=p,e[1]=y,e[2]=m,(o=Ur)[0][0]=(s=Dr)[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=_(Ur[0]),V(Ur[0],Ur[0]),r[0]=Y(Ur[0],Ur[1]),jr(Ur[1],Ur[1],Ur[0],1,-r[0]),n[1]=_(Ur[1]),V(Ur[1],Ur[1]),r[0]/=n[1],r[1]=Y(Ur[0],Ur[2]),jr(Ur[2],Ur[2],Ur[0],1,-r[1]),r[2]=Y(Ur[1],Ur[2]),jr(Ur[2],Ur[2],Ur[1],1,-r[2]),n[2]=_(Ur[2]),V(Ur[2],Ur[2]),r[1]/=n[2],r[2]/=n[2],z(Br,Ur[1],Ur[2]),0>Y(Ur[0],Br))for(var k=0;3>k;k++)n[k]*=-1,Ur[k][0]*=-1,Ur[k][1]*=-1,Ur[k][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+Ur[0][0]-Ur[1][1]-Ur[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Ur[0][0]+Ur[1][1]-Ur[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Ur[0][0]-Ur[1][1]+Ur[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Ur[0][0]+Ur[1][1]+Ur[2][2],0)),Ur[2][1]>Ur[1][2]&&(a[0]=-a[0]),Ur[0][2]>Ur[2][0]&&(a[1]=-a[1]),Ur[1][0]>Ur[0][1]&&(a[2]=-a[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(sa).reduce(ua)}(t),e,n,r,i,a),[[e,n,r,a,i]]}var ca=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 a=0;4>a;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)o[s][3]=a[s];for(var u=0;3>u;u++)for(var l=0;3>l;l++)o[3][u]+=e[l]*o[l][u];var c=i[0],h=i[1],f=i[2],d=i[3],v=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];v[0][0]=1-2*(h*h+f*f),v[0][1]=2*(c*h-f*d),v[0][2]=2*(c*f+h*d),v[1][0]=2*(c*h+f*d),v[1][1]=1-2*(c*c+f*f),v[1][2]=2*(h*f-c*d),v[2][0]=2*(c*f-h*d),v[2][1]=2*(h*f+c*d),v[2][2]=1-2*(c*c+h*h),o=t(o,v);var p,y=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];r[2]&&(y[2][1]=r[2],o=t(o,y)),r[1]&&(y[2][1]=0,y[2][0]=r[0],o=t(o,y)),r[0]&&(y[2][0]=0,y[1][0]=r[0],o=t(o,y));for(var m=0;3>m;m++)for(var g=0;3>g;g++)o[m][g]*=n[m];return 0==(p=o)[0][2]&&0==p[0][3]&&0==p[1][2]&&0==p[1][3]&&0==p[2][0]&&0==p[2][1]&&1==p[2][2]&&0==p[2][3]&&0==p[3][2]&&1==p[3][3]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[3])}}();function ha(t){return t.toFixed(6).replace(".000000","")}function fa(t,e){var n,r;return t.decompositionPair!==e&&(t.decompositionPair=e,n=la(t)),e.decompositionPair!==t&&(e.decompositionPair=t,r=la(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=se(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);return i}(n[0][3],r[0][3],t[5]);return ca(t[0],t[1],t[2],e,t[4]).map(ha).join(",")}])}function da(t){return t.replace(/[xy]/,"")}function va(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function pa(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?dr(o):dr(o,t.unit)}))})},a=0;t.length>a;a++)i()}var o,s,u=[],l=[],c=[];if(t.length!==e.length){var h=fa(t,e);u=[h[0]],l=[h[1]],c=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var d=t[f].t,v=e[f].t,p=t[f].d,y=e[f].d,m=aa[d],g=aa[v],k=void 0;if(s=v,"perspective"===(o=d)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var x=fa([t[f]],[e[f]]);u.push(x[0]),l.push(x[1]),c.push(["matrix",[x[2]]])}else{if(d===v)k=d;else if(m[2]&&g[2]&&da(d)===da(v))k=da(d),p=m[2](p),y=g[2](y);else{if(!m[1]||!g[1]||va(d)!==va(v)){var b=fa(t,e);u=[b[0]],l=[b[1]],c=[["matrix",[b[2]]]];break}k=va(d),p=m[1](p),y=g[1](y)}for(var E=[],T=[],S=[],P=0;p.length>P;P++){var M=Gi(p[P],y[P],n,!1,P);E[P]=M[0],T[P]=M[1],S.push(M[2])}u.push(E),l.push(T),c.push([k,S])}}if(r){var w=u;u=l,l=w}return[u,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return c[e][1][n](t)})).join(",");return"matrix"===c[e][0]&&16===n.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===n.split(",").length&&(c[e][0]="matrix"),c[e][0]+"("+n+")"})).join(" ")}]}var ya=Wn((function(t){if(oe(t)){if("text-anchor"===t)return[dr(0,"px"),dr(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:[Di(ma(e[0])),Di(ma(e[1]))]}return[dr(t[0]||0,"px"),dr(t[1]||0,"px")]}));function ma(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var ga=function(){function t(){kn(this,t),this.parser=Fi,this.parserWithCSSDisabled=null,this.mixer=Hi}return bn(t,[{key:"calculator",value:function(t,e,n,r){return Ui(n)}}]),t}(),ka=function(){function t(){kn(this,t)}return bn(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof Xn&&(n=null),Ss.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&Ss.sceneGraphService.dirtifyToRoot(t)})),n}}]),t}(),xa=function(){function t(){kn(this,t),this.parser=Ri,this.parserWithCSSDisabled=Ri,this.mixer=Li}return bn(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof Xn?"none"===n.value?cr:hr:n}}]),t}(),ba=function(){function t(){kn(this,t),this.parser=zi}return bn(t,[{key:"calculator",value:function(t,e,n){return n instanceof Xn?[]:n}}]),t}();function Ea(t){var e=t.parsedStyle.fontSize;return Jt(e)?null:e}var Ta,Sa=function(){function e(){kn(this,e),this.parser=Di,this.parserWithCSSDisabled=null,this.mixer=Hi}return bn(e,[{key:"calculator",value:function(e,n,r,i,a){if(ue(r))return r;if(!tr.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){var o=Ea(i.parentNode);if(o)return o*=r.value;a.addUnresolveProperty(i,e)}else a.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=Ea(i.ownerDocument.documentElement);if(u)return u*=r.value;a.addUnresolveProperty(i,e)}else a.addUnresolveProperty(i,e);return 0}}}]),e}(),Pa=function(){function t(){kn(this,t),this.mixer=Ki}return bn(t,[{key:"parser",value:function(t){var e=ji(ue(t)?[t]:t);return 1===e.length?[e[0],e[0]]:[e[0],e[1]]}},{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}]),t}(),Ma=function(){function t(){kn(this,t),this.mixer=Ki}return bn(t,[{key:"parser",value:function(t){var e=ji(ue(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]]}},{key:"calculator",value:function(t,e,n){return n.map((function(t){return t.value}))}}]),t}(),wa=function(e){Tn(r,e);var n=Nn(r);function r(){return kn(this,r),n.apply(this,arguments)}return bn(r,[{key:"postProcessor",value:function(e,n){var r,i,a;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var o=e.parsedStyle,s=o.cx,u=o.cy,l=o.cz;Jt(s)||(r=s),Jt(u)||(i=u),Jt(l)||(a=l);break;case t.Shape.LINE:var c=e.parsedStyle,h=c.y1,f=c.y2;r=Math.min(c.x1,c.x2),i=Math.min(h,f),a=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:Jt(e.parsedStyle.x)||(r=e.parsedStyle.x),Jt(e.parsedStyle.y)||(i=e.parsedStyle.y),Jt(e.parsedStyle.z)||(a=e.parsedStyle.z)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=r||0,e.parsedStyle.defY=i||0),(!Jt(r)||!Jt(i)||!Jt(a))&&-1===n.indexOf("transform")){var d=e.parsedStyle.transform;if(d&&d.length)Yr(d,e);else{var v=An(e.getLocalPosition(),3),p=v[0],y=v[1],m=v[2];e.setLocalPosition(Jt(r)?p:r,Jt(i)?y:i,Jt(a)?m:a)}}}}]),r}(Sa),Na=function(){function t(){kn(this,t)}return bn(t,[{key:"calculator",value:function(t,e,n,r){var i;n instanceof Xn&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a}}]),t}(),Ca=function(){function t(){kn(this,t),this.mixer=Hi,this.parser=Wi,this.parserWithCSSDisabled=null}return bn(t,[{key:"calculator",value:function(t,e,n){return n.value}}]),t}(),Aa=function(){function e(){kn(this,e),this.parser=Wi,this.parserWithCSSDisabled=null,this.mixer=qi(0,1)}return bn(e,[{key:"calculator",value:function(t,e,n){return n.value}},{key:"postProcessor",value: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 a=r.getPoint(n.offsetDistance);a&&(e.parsedStyle.defX=a.x,e.parsedStyle.defY=a.y,e.setLocalPosition(a.x,a.y))}}}}]),e}(),Oa=function(){function t(){kn(this,t),this.parser=Wi,this.parserWithCSSDisabled=null,this.mixer=qi(0,1)}return bn(t,[{key:"calculator",value:function(t,e,n){return n.value}}]),t}(),Ra=function(){function t(){kn(this,t),this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}return bn(t,[{key:"update",value:function(t,e){Sr(this.center,t),Sr(this.halfExtents,e),Pr(this.min,this.center,this.halfExtents),Mr(this.max,this.center,this.halfExtents)}},{key:"setMinMax",value:function(t,e){Mr(this.center,e,t),wr(this.center,this.center,.5),Pr(this.halfExtents,e,t),wr(this.halfExtents,this.halfExtents,.5),Sr(this.min,t),Sr(this.max,e)}},{key:"getMin",value:function(){return this.min}},{key:"getMax",value:function(){return this.max}},{key:"add",value: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],a=n[2],o=this.halfExtents,s=o[0],u=o[1],l=o[2],c=r-s,h=r+s,f=i-u,d=i+u,v=a-l,p=a+l,y=e.center,m=y[0],g=y[1],k=y[2],x=e.halfExtents,b=x[0],E=x[1],T=x[2],S=m-b,P=m+b,M=g-E,w=g+E,N=k-T,C=k+T;c>S&&(c=S),P>h&&(h=P),f>M&&(f=M),w>d&&(d=w),v>N&&(v=N),C>p&&(p=C),n[0]=.5*(c+h),n[1]=.5*(f+d),n[2]=.5*(v+p),o[0]=.5*(h-c),o[1]=.5*(d-f),o[2]=.5*(p-v),this.min[0]=c,this.min[1]=f,this.min[2]=v,this.max[0]=h,this.max[1]=d,this.max[2]=p}}},{key:"setFromTransformedAABB",value:function(t,e){var n=this.center,r=this.halfExtents,i=t.center,a=t.halfExtents,o=e[0],s=e[4],u=e[8],l=e[1],c=e[5],h=e[9],f=e[2],d=e[6],v=e[10],p=Math.abs(o),y=Math.abs(s),m=Math.abs(u),g=Math.abs(l),k=Math.abs(c),x=Math.abs(h),b=Math.abs(f),E=Math.abs(d),T=Math.abs(v);n[0]=e[12]+o*i[0]+s*i[1]+u*i[2],n[1]=e[13]+l*i[0]+c*i[1]+h*i[2],n[2]=e[14]+f*i[0]+d*i[1]+v*i[2],r[0]=p*a[0]+y*a[1]+m*a[2],r[1]=g*a[0]+k*a[1]+x*a[2],r[2]=b*a[0]+E*a[1]+T*a[2],Pr(this.min,n,r),Mr(this.max,n,r)}},{key:"intersects",value: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])}},{key:"intersection",value:function(e){if(!this.intersects(e))return null;var n,r,i,a=new t,o=(n=[0,0,0],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}([0,0,0],this.getMax(),e.getMax());return a.setMinMax(o,s),a}},{key:"getNegativeFarPoint",value:function(t){return 273===t.pnVertexFlag?Sr([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]}},{key:"getPositiveFarPoint",value:function(t){return 273===t.pnVertexFlag?Sr([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]}}],[{key:"isEmpty",value:function(t){return!t||0===t.halfExtents[0]&&0===t.halfExtents[1]&&0===t.halfExtents[2]}}]),t}(),La=function(){function t(e,n){kn(this,t),this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=e||0,this.normal=n||D(0,1,0),this.updatePNVertexFlag()}return bn(t,[{key:"updatePNVertexFlag",value:function(){this.pnVertexFlag=(Number(this.normal[0]>=0)<<8)+(Number(this.normal[1]>=0)<<4)+Number(this.normal[2]>=0)}},{key:"distanceToPoint",value:function(t){return Y(t,this.normal)-this.distance}},{key:"normalize",value:function(){var t=1/Z(this.normal);j(this.normal,this.normal,t),this.distance*=t}},{key:"intersectsLine",value:function(t,e,n){var r=this.distanceToPoint(t),i=r/(r-this.distanceToPoint(e)),a=i>=0&&1>=i;return a&&n&&X(n,t,e,i),a}}]),t}();(Ta=t.Mask||(t.Mask={}))[Ta.OUTSIDE=4294967295]="OUTSIDE",Ta[Ta.INSIDE=0]="INSIDE",Ta[Ta.INDETERMINATE=2147483647]="INDETERMINATE";var Ia=function(){function t(e){if(kn(this,t),this.planes=[],e)this.planes=e;else for(var n=0;6>n;n++)this.planes.push(new La)}return bn(t,[{key:"extractFromVPMatrix",value:function(t){var e=An(t,16),n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],v=e[12],p=e[13],y=e[14],m=e[15];G(this.planes[0].normal,a-n,l-o,d-c),this.planes[0].distance=m-v,G(this.planes[1].normal,a+n,l+o,d+c),this.planes[1].distance=m+v,G(this.planes[2].normal,a+r,l+s,d+h),this.planes[2].distance=m+p,G(this.planes[3].normal,a-r,l-s,d-h),this.planes[3].distance=m-p,G(this.planes[4].normal,a-i,l-u,d-f),this.planes[4].distance=m-y,G(this.planes[5].normal,a+i,l+u,d+f),this.planes[5].distance=m+y,this.planes.forEach((function(t){t.normalize(),t.updatePNVertexFlag()}))}}]),t}(),_a=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;kn(this,t),this.x=0,this.y=0,this.x=e,this.y=n}return bn(t,[{key:"clone",value:function(){return new t(this.x,this.y)}},{key:"copyFrom",value:function(t){this.x=t.x,this.y=t.y}}]),t}(),Da=function(){function t(e,n,r,i){kn(this,t),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=e,this.y=n,this.width=r,this.height=i,this.left=e,this.right=e+r,this.top=n,this.bottom=n+i}return bn(t,[{key:"toJSON",value:function(){}}]),t}(),Fa=function(){function e(){kn(this,e),this.parser=$i,this.parserWithCSSDisabled=$i,this.mixer=Ji}return bn(e,[{key:"calculator",value:function(t,e,n){return n instanceof Xn&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Da(0,0,0,0)}:n}},{key:"postProcessor",value:function(e,n){if(e.nodeName===t.Shape.PATH&&-1===n.indexOf("transform")){var r=e.parsedStyle,i=r.defX,a=r.defY;e.setLocalPosition(void 0===i?0:i,void 0===a?0:a)}}}]),e}(),Ga=function(){function e(){kn(this,e),this.parser=ta,this.mixer=ea}return bn(e,[{key:"postProcessor",value:function(e,n){if((e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE)&&-1===n.indexOf("transform")){var r=e.parsedStyle;e.setLocalPosition(r.defX,r.defY)}}}]),e}(),Ua=function(t){Tn(n,t);var e=Nn(n);function n(){var t;kn(this,n);for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))).mixer=qi(0,1/0),t}return bn(n)}(Sa),Ba=function(){function t(){kn(this,t)}return bn(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof Xn?"unset"===n.value?"":n.value:"".concat(n)}},{key:"postProcessor",value:function(t){t.nodeValue="".concat(t.parsedStyle.text)||""}}]),t}(),ja=function(){function t(){kn(this,t)}return bn(t,[{key:"calculator",value:function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value}}]),t}(),Va=function(){function t(){kn(this,t),this.parser=oa,this.parserWithCSSDisabled=oa,this.mixer=pa}return bn(t,[{key:"calculator",value:function(t,e,n,r){return n instanceof Xn?[]:n}},{key:"postProcessor",value:function(t){Yr(t.parsedStyle.transform,t)}}]),t}(),Ya=bn((function t(){kn(this,t),this.parser=ya})),za=function(){function t(){kn(this,t),this.parser=Wi}return bn(t,[{key:"calculator",value:function(t,e,n,r){return n.value}},{key:"postProcessor",value:function(t){if(t.parentNode){var e=t.parentNode,n=e.renderable,r=e.sortable;n&&(n.dirty=!0),r&&(r.dirty=!0)}}}]),t}(),Xa=function(){function e(){kn(this,e),this.registry={},this.define(t.Shape.CIRCLE,Eo),this.define(t.Shape.ELLIPSE,Mo),this.define(t.Shape.RECT,Yo),this.define(t.Shape.IMAGE,Ro),this.define(t.Shape.LINE,Io),this.define(t.Shape.GROUP,No),this.define(t.Shape.PATH,Fo),this.define(t.Shape.POLYGON,Uo),this.define(t.Shape.POLYLINE,jo),this.define(t.Shape.TEXT,Xo),this.define(t.Shape.HTML,Ao)}return bn(e,[{key:"define",value:function(t,e){this.registry[t]=e}},{key:"get",value:function(t){return this.registry[t]}}]),e}();function Wa(t){return!!t.type}var Ha=function(){function t(e){kn(this,t),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 _a,this.page=new _a,this.canvas=new _a,this.viewport=new _a,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}return bn(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:"composedPath",value:function(){return!this.manager||this.path&&this.path[0]===this.target||(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}},{key:"propagationPath",get:function(){return this.composedPath()}},{key:"preventDefault",value:function(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}},{key:"stopImmediatePropagation",value:function(){this.propagationImmediatelyStopped=!0}},{key:"stopPropagation",value:function(){this.propagationStopped=!0}},{key:"initEvent",value:function(){}},{key:"initUIEvent",value:function(){}},{key:"clone",value:function(){throw Error(br)}}]),t}(),qa=function(t){Tn(n,t);var e=Nn(n);function n(t,r){var i;return kn(this,n),(i=e.call(this,null)).type=t,i.detail=r,Object.assign(wn(i),r),i}return bn(n)}(Ha),Ka=function(){function t(){kn(this,t),this.emitter=new fn}return bn(t,[{key:"on",value:function(t,e,n){return this.addEventListener(t,e,n),this}},{key:"addEventListener",value:function(t,e,n){var r=he(n)&&n||re(n)&&n.capture,i=re(n)&&n.once,a=Kn(e)?void 0:e,o=!1,s="";if(t.indexOf(":")>-1){var u=An(t.split(":"),2);t=u[1],s=u[0],o=!0}if(t=r?"".concat(t,"capture"):t,e=Kn(e)?e:e.handleEvent,o){var l=e;e=function(){for(var t,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&l.apply(void 0,n)}}return i?this.emitter.once(t,e,a):this.emitter.on(t,e,a),this}},{key:"off",value:function(t,e,n){return t?this.removeEventListener(t,e,n):this.removeAllEventListeners(),this}},{key:"removeAllEventListeners",value:function(){this.emitter.removeAllListeners()}},{key:"removeEventListener",value:function(t,e,n){var r,i=he(n)&&n||re(n)&&n.capture,a=Kn(e)?void 0:e;return t=i?"".concat(t,"capture"):t,e=Kn(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent,this.emitter.off(t,e,a),this}},{key:"emit",value:function(t,e){this.dispatchEvent(new qa(t,e))}},{key:"dispatchEvent",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Wa(t))throw Error("DisplayObject cannot propagate events outside of the Federated Events API");if(this.document)e=this;else if(this.defaultView)e=this.defaultView;else{var r;e=null===(r=this.ownerDocument)||void 0===r?void 0:r.defaultView}if(e){var i;if(t.manager=e.getEventService()||null,!t.manager)return!1;t.defaultPrevented=!1,t.path=[],n||(t.target=this),null===(i=t.manager)||void 0===i||i.dispatchEvent(t,t.type,n)}return!t.defaultPrevented}}]),t}(),Za=function(e){Tn(r,e);var n=Nn(r);function r(){var t;kn(this,r);for(var e=arguments.length,i=Array(e),a=0;e>a;a++)i[a]=arguments[a];return(t=n.call.apply(n,[this].concat(i))).shadow=!1,t.ownerDocument=null,t.isConnected=!1,t.baseURI="",t.childNodes=[],t.nodeType=0,t.nodeName="",t.nodeValue=null,t.parentNode=null,t}return bn(r,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);var n,r=In(this.childNodes);try{for(r.s();!(n=r.n()).done;){var i=n.value;e+=i.nodeName===t.Shape.TEXT?i.nodeValue:i.textContent}}catch(t){r.e(t)}finally{r.f()}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="".concat(e))}},{key:"getRootNode",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.parentNode?this.parentNode.getRootNode(t):t.composed&&this.host?this.host.getRootNode(t):this}},{key:"hasChildNodes",value:function(){return this.childNodes.length>0}},{key:"isDefaultNamespace",value:function(t){throw Error(br)}},{key:"lookupNamespaceURI",value:function(t){throw Error(br)}},{key:"lookupPrefix",value:function(t){throw Error(br)}},{key:"normalize",value:function(){throw Error(br)}},{key:"isEqualNode",value:function(t){return this===t}},{key:"isSameNode",value:function(t){return this.isEqualNode(t)}},{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}},{key:"compareDocumentPosition",value:function(t){if(t===this)return 0;for(var e=t,n=this,i=[e],a=[n];null!==(o=e.parentNode)&&void 0!==o?o:n.parentNode;){var o;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,n=n.parentNode?(a.push(n.parentNode),n.parentNode):n}if(e!==n)return r.DOCUMENT_POSITION_DISCONNECTED|r.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC|r.DOCUMENT_POSITION_PRECEDING;var s=i.length>a.length?i:a,u=s===i?a:i;if(s[s.length-u.length]===u[0])return s===i?r.DOCUMENT_POSITION_CONTAINED_BY|r.DOCUMENT_POSITION_FOLLOWING:r.DOCUMENT_POSITION_CONTAINS|r.DOCUMENT_POSITION_PRECEDING;for(var l=s.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],f=s[l+c];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.indexOf(f)?u===i?r.DOCUMENT_POSITION_PRECEDING:r.DOCUMENT_POSITION_FOLLOWING:s===i?r.DOCUMENT_POSITION_PRECEDING:r.DOCUMENT_POSITION_FOLLOWING}}return r.DOCUMENT_POSITION_FOLLOWING}},{key:"contain",value:function(t){return this.contains(t)}},{key:"contains",value:function(t){for(var e=t;e&&this!==e;)e=e.parentNode;return!!e}},{key:"getAncestor",value:function(t){for(var e=this;t>0&&e;)e=e.parentNode,t--;return e}},{key:"forEach",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))}}],[{key:"isNode",value:function(t){return!!t.childNodes}}]),r}(Ka);Za.DOCUMENT_POSITION_DISCONNECTED=1,Za.DOCUMENT_POSITION_PRECEDING=2,Za.DOCUMENT_POSITION_FOLLOWING=4,Za.DOCUMENT_POSITION_CONTAINS=8,Za.DOCUMENT_POSITION_CONTAINED_BY=16,Za.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Qa,$a,Ja=function(e){Tn(a,e);var n,r,i=Nn(a);function a(){var e;kn(this,a),(e=i.call(this)).defaultView=null,e.documentElement=void 0,e.timeline=void 0,e.ownerDocument=null,e.nodeName="document";try{e.timeline=new Ss.AnimationTimeline(wn(e))}catch(t){}var n={};return Wo.forEach((function(e){var r=e.d;e.inh&&r&&(n[e.n]=Kn(r)?r(t.Shape.GROUP):r)})),e.documentElement=new No({id:"g-root",style:n}),e.documentElement.ownerDocument=wn(e),e.documentElement.parentNode=wn(e),e.childNodes=[e.documentElement],e}return bn(a,[{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:"createElement",value: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?Xo:No);var r=new n(e);return r.ownerDocument=this,r}},{key:"createElementNS",value:function(t,e,n){return this.createElement(e,n)}},{key:"cloneNode",value:function(t){throw Error(br)}},{key:"destroy",value:function(){try{this.documentElement.destroyChildren(),this.timeline.destroy()}catch(t){}}},{key:"elementsFromBBox",value:function(t,e,n,r){var i=this.defaultView.context.rBushRoot.search({minX:t,minY:e,maxX:n,maxY:r}),a=[];return i.forEach((function(t){var e=t.displayObject,n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),a}},{key:"elementFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return null;var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l&&l[0]||this.documentElement}},{key:"elementFromPoint",value:(r=gn(pn().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return pn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,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)}))),function(t,e){return r.apply(this,arguments)})},{key:"elementsFromPointSync",value:function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return[];var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l[l.length-1]!==this.documentElement&&l.push(this.documentElement),l}},{key:"elementsFromPoint",value:(n=gn(pn().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return pn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,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)}))),function(t,e){return n.apply(this,arguments)})},{key:"appendChild",value:function(t,e){throw Error(Er)}},{key:"insertBefore",value:function(t,e){throw Error(Er)}},{key:"removeChild",value:function(t,e){throw Error(Er)}},{key:"replaceChild",value:function(t,e,n){throw Error(Er)}},{key:"append",value:function(){throw Error(Er)}},{key:"prepend",value:function(){throw Error(Er)}},{key:"getElementById",value:function(t){return this.documentElement.getElementById(t)}},{key:"getElementsByName",value:function(t){return this.documentElement.getElementsByName(t)}},{key:"getElementsByTagName",value:function(t){return this.documentElement.getElementsByTagName(t)}},{key:"getElementsByClassName",value:function(t){return this.documentElement.getElementsByClassName(t)}},{key:"querySelector",value:function(t){return this.documentElement.querySelector(t)}},{key:"querySelectorAll",value:function(t){return this.documentElement.querySelectorAll(t)}},{key:"find",value:function(t){return this.documentElement.find(t)}},{key:"findAll",value:function(t){return this.documentElement.findAll(t)}}]),a}(Za);(Qa=t.Strategy||(t.Strategy={}))[Qa.Standard=0]="Standard",($a=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",$a.DESTROY="destroy",$a.ATTR_MODIFIED="DOMAttrModified",$a.INSERTED="DOMNodeInserted",$a.REMOVED="removed",$a.MOUNTED="DOMNodeInsertedIntoDocument",$a.UNMOUNTED="DOMNodeRemovedFromDocument",$a.BOUNDS_CHANGED="bounds-changed",$a.RENDER_ORDER_CHANGED="render-order-changed",$a.CULLED="culled";var to=function(t){Tn(n,t);var e=Nn(n);function n(t,r,i,a,o,s,u,l){var c;return kn(this,n),(c=e.call(this,null)).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=r,c.prevValue=i,c.newValue=a,c.attrName=o,c.attrChange=s,c.prevParsedValue=u,c.newParsedValue=l,c.type=t,c}return bn(n)}(Ha);to.ADDITION=2,to.MODIFICATION=1,to.REMOVAL=3;var eo=0;var no=new to(t.ElementEvent.INSERTED,null,"","","",0,"",""),ro=new to(t.ElementEvent.REMOVED,null,"","","",0,"",""),io=new qa(t.ElementEvent.DESTROY),ao=function(e){Tn(r,e);var n=Nn(r);function r(){var e;kn(this,r);for(var i=arguments.length,a=Array(i),o=0;i>o;o++)a[o]=arguments[o];return(e=n.call.apply(n,[this].concat(a))).entity=eo++,e.renderable={bounds:void 0,boundsDirty:!0,renderBounds:void 0,renderBoundsDirty:!0,dirtyRenderBounds:void 0,dirty:!1,proxyNodeName:void 0},e.cullable={strategy:t.Strategy.Standard,visibilityPlaneMask:-1,visible:!0,enable:!0},e.transformable={dirtyFlag:!1,localDirtyFlag:!1,frozen:!1,localPosition:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[0,0,0]},e.sortable={dirty:!1,sorted:void 0,lastSortedIndex:void 0,renderOrder:0},e.geometry={contentBounds:void 0,renderBounds:void 0},e.rBushNode={aabb:void 0},e.id=void 0,e.name=void 0,e.namespaceURI="g",e.scrollLeft=0,e.scrollTop=0,e.clientTop=0,e.clientLeft=0,e.destroyed=!1,e.style={},e.computedStyle=Ss.enableCSSParsing?{anchor:ar,opacity:ar,fillOpacity:ar,strokeOpacity:ar,fill:ar,stroke:ar,transform:ar,transformOrigin:ar,visibility:ar,pointerEvents:ar,lineWidth:ar,lineCap:ar,lineJoin:ar,increasedLineWidthForHitTesting:ar,fontSize:ar,fontFamily:ar,fontStyle:ar,fontWeight:ar,fontVariant:ar,textAlign:ar,textBaseline:ar,textTransform:ar,zIndex:ar,filter:ar,shadowType:ar}:null,e.parsedStyle={},e.attributes={},e}return bn(r,[{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}},{key:"cloneNode",value:function(t){throw Error(br)}},{key:"appendChild",value:function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return Ss.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),no.relatedNode=this,t.dispatchEvent(no),t}},{key:"insertBefore",value:function(t,e){if(e){var n=this.childNodes.indexOf(e);this.appendChild(t,n-1)}else this.appendChild(t);return t}},{key:"replaceChild",value:function(t,e){var n=this.childNodes.indexOf(e);return this.removeChild(e),this.appendChild(t,n),e}},{key:"removeChild",value:function(t){var e;return ro.relatedNode=this,t.dispatchEvent(ro),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),Ss.sceneGraphService.detach(t),t}},{key:"removeChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}}},{key:"destroyChildren",value:function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}}},{key:"matches",value:function(t){return Ss.sceneGraphService.matches(t,this)}},{key:"getElementById",value:function(t){return Ss.sceneGraphService.querySelector("#".concat(t),this)}},{key:"getElementsByName",value:function(t){return Ss.sceneGraphService.querySelectorAll('[name="'.concat(t,'"]'),this)}},{key:"getElementsByClassName",value:function(t){return Ss.sceneGraphService.querySelectorAll(".".concat(t),this)}},{key:"getElementsByTagName",value:function(t){return Ss.sceneGraphService.querySelectorAll(t,this)}},{key:"querySelector",value:function(t){return Ss.sceneGraphService.querySelector(t,this)}},{key:"querySelectorAll",value:function(t){return Ss.sceneGraphService.querySelectorAll(t,this)}},{key:"closest",value:function(t){var e=this;do{if(Ss.sceneGraphService.matches(t,e))return e;e=e.parentElement}while(null!==e);return null}},{key:"find",value:function(t){var e=this,n=null;return this.forEach((function(r){return!(r===e||!t(r))&&(n=r,!0)})),n}},{key:"findAll",value:function(t){var e=this,n=[];return this.forEach((function(r){r!==e&&t(r)&&n.push(r)})),n}},{key:"after",value:function(){var t=this;if(this.parentNode){for(var e=this.parentNode.childNodes.indexOf(this),n=arguments.length,r=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)}))}}},{key:"before",value:function(){if(this.parentNode){for(var t=this.parentNode.childNodes.indexOf(this),e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,On(a))}}},{key:"replaceWith",value:function(){this.after.apply(this,arguments),this.remove()}},{key:"append",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e){return t.appendChild(e)}))}},{key:"prepend",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];n.forEach((function(e,n){return t.appendChild(e,n)}))}},{key:"replaceChildren",value:function(){for(;this.childNodes.length&&this.firstChild;)this.removeChild(this.firstChild);this.append.apply(this,arguments)}},{key:"remove",value:function(){return this.parentNode?this.parentNode.removeChild(this):this}},{key:"destroy",value:function(){this.dispatchEvent(io),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0}},{key:"getGeometryBounds",value:function(){return Ss.sceneGraphService.getGeometryBounds(this)}},{key:"getRenderBounds",value:function(){return Ss.sceneGraphService.getBounds(this,!0)}},{key:"getBounds",value:function(){return Ss.sceneGraphService.getBounds(this)}},{key:"getLocalBounds",value:function(){return Ss.sceneGraphService.getLocalBounds(this)}},{key:"getBoundingClientRect",value:function(){return Ss.sceneGraphService.getBoundingClientRect(this)}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"computedStyleMap",value:function(){return new Map(Object.entries(this.computedStyle))}},{key:"getAttributeNames",value:function(){return Object.keys(this.attributes)}},{key:"getAttribute",value:function(t){if(function(t){return"symbol"===yn(t)}(t))return Ss.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=Qn(t);return e=this.attributes[n],Ss.enableCSSParsing&&Jt(e)?null:e}return e}},{key:"hasAttribute",value:function(t){return this.getAttributeNames().includes(t)}},{key:"hasAttributes",value:function(){return!!this.getAttributeNames().length}},{key:"removeAttribute",value:function(t){this.setAttribute(t,null),delete this.attributes[t]}},{key:"setAttribute",value:function(t,e){this.attributes[t]=e}},{key:"getAttributeNS",value:function(t,e){throw Error(br)}},{key:"getAttributeNode",value:function(t){throw Error(br)}},{key:"getAttributeNodeNS",value:function(t,e){throw Error(br)}},{key:"hasAttributeNS",value:function(t,e){throw Error(br)}},{key:"removeAttributeNS",value:function(t,e){throw Error(br)}},{key:"removeAttributeNode",value:function(t){throw Error(br)}},{key:"setAttributeNS",value:function(t,e,n){throw Error(br)}},{key:"setAttributeNode",value:function(t){throw Error(br)}},{key:"setAttributeNodeNS",value:function(t){throw Error(br)}},{key:"toggleAttribute",value:function(t,e){throw Error(br)}}],[{key:"isElement",value:function(t){return!!t.getAttribute}}]),r}(Za),oo=function(t){Tn(n,t);var e=Nn(n);function n(){var t;kn(this,n);for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))).altKey=void 0,t.button=void 0,t.buttons=void 0,t.ctrlKey=void 0,t.metaKey=void 0,t.relatedTarget=void 0,t.shiftKey=void 0,t.client=new _a,t.movement=new _a,t.offset=new _a,t.global=new _a,t.screen=new _a,t}return bn(n,[{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}},{key:"getModifierState",value:function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}},{key:"initMouseEvent",value:function(){throw Error(br)}}]),n}(Ha),so=function(t){Tn(n,t);var e=Nn(n);function n(){var t;kn(this,n);for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))).pointerId=void 0,t.width=0,t.height=0,t.isPrimary=!1,t.pointerType=void 0,t.pressure=void 0,t.tangentialPressure=void 0,t.tiltX=void 0,t.tiltY=void 0,t.twist=void 0,t}return bn(n,[{key:"getCoalescedEvents",value:function(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}},{key:"getPredictedEvents",value:function(){throw Error("getPredictedEvents is not supported!")}},{key:"clone",value:function(){return this.manager.clonePointerEvent(this)}}]),n}(oo),uo=function(t){Tn(n,t);var e=Nn(n);function n(){var t;kn(this,n);for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];return(t=e.call.apply(e,[this].concat(i))).deltaMode=void 0,t.deltaX=void 0,t.deltaY=void 0,t.deltaZ=void 0,t.DOM_DELTA_LINE=0,t.DOM_DELTA_PAGE=1,t.DOM_DELTA_PIXEL=2,t}return bn(n,[{key:"clone",value:function(){return this.manager.cloneWheelEvent(this)}}]),n}(oo);function lo(t){return!!(null==t?void 0:t.nodeName)}var co,ho,fo,vo=new to(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,to.MODIFICATION,null,null),po={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:""},yo={anchor:[0,0],fill:cr,stroke:cr,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},mo=vn(vn({},yo),{},{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),go=[].concat(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]),ko="data-",xo=function(e){Tn(r,e);var n=Nn(r);function r(e){var i,a;kn(this,r),(a=n.call(this)).config=void 0,a.isCustomElement=!1,a.isMutationObserved=!1,a.activeAnimations=[],a.dataset=void 0,a.getClip=function(){return this.style.clipPath||null},a.config=e,a.config.interactive=null!==(i=a.config.capture)&&void 0!==i?i:a.config.interactive,a.id=a.config.id||"",a.name=a.config.name||"",(a.config.className||a.config.class)&&(a.className=a.config.className||a.config.class),a.nodeName=a.config.type||t.Shape.GROUP,a.config.style=a.config.style||a.config.attrs||{},Object.assign(a.config.style,a.config.attrs),null!=a.config.visible&&(a.config.style.visibility=!1===a.config.visible?"hidden":"visible"),null!=a.config.interactive&&(a.config.style.pointerEvents=!1===a.config.interactive?"none":"auto"),Object.assign(a.parsedStyle,Ss.enableCSSParsing?yo:mo,a.config.initialParsedStyle),Ss.enableCSSParsing&&Object.assign(a.attributes,po),a.initAttributes(a.config.style);var o=Ss.globalThis.Proxy?Ss.globalThis.Proxy:function(){};return Ss.enableDataset&&(a.dataset=new o({},{get:function(t,e){var n="".concat(ko).concat(qn(e));return void 0!==t[n]?t[n]:a.getAttribute(n)},set:function(t,e,n){return a.setAttribute("".concat(ko).concat(qn(e)),n),!0}})),Ss.enableStyleSyntax&&(a.style=new o({setProperty:function(t,e){a.setAttribute(t,e)},getPropertyValue:function(t){return a.getAttribute(t)},removeProperty:function(t){a.removeAttribute(t)},item:function(){return""}},{get:function(t,e){return void 0!==t[e]?t[e]:a.getAttribute(e)},set:function(t,e,n){return a.setAttribute(e,n),!0}})),a}return bn(r,[{key:"destroy",value:function(){Cn(Sn(r.prototype),"destroy",this).call(this),this.getAnimations().forEach((function(t){t.cancel()}))}},{key:"cloneNode",value:function(t,e){var n=vn({},this.attributes);for(var r in n){var i=n[r];lo(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});return a.setLocalTransform(this.getLocalTransform()),t&&this.children.forEach((function(e){if(!e.style.isMarker){var n=e.cloneNode(t);a.appendChild(n)}})),a}},{key:"initAttributes",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.renderable,n={forceUpdateGeometry:!0};Ss.enableCSSParsing&&(n.usedAttributes=go);var r={};for(var i in t){r[Qn(i)]=t[i]}Ss.styleValueRegistry.processProperties(this,r,n),e.dirty=!0}},{key:"setAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=Qn(t);fe(e)||(n||e!==this.attributes[i])&&(this.internalSetAttribute(i,e),Cn(Sn(r.prototype),"setAttribute",this).call(this,i,e))}},{key:"internalSetAttribute",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.renderable,i=this.attributes[t],a=this.parsedStyle[t];Ss.styleValueRegistry.processProperties(this,En({},t,e),n),r.dirty=!0;var o=this.parsedStyle[t];this.isConnected&&(vo.relatedNode=this,vo.prevValue=i,vo.newValue=e,vo.attrName=t,vo.prevParsedValue=a,vo.newParsedValue=o,this.isMutationObserved?this.dispatchEvent(vo):(vo.target=this,this.ownerDocument.defaultView.dispatchEvent(vo,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,i,e,a,o)}},{key:"getBBox",value:function(){var t=this.getBounds(),e=An(t.getMin(),2),n=e[0],r=e[1],i=An(t.getMax(),2);return new Da(n,r,i[0]-n,i[1]-r)}},{key:"setOrigin",value:function(t){return Ss.sceneGraphService.setOrigin(this,Cr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)),this}},{key:"getOrigin",value:function(){return Ss.sceneGraphService.getOrigin(this)}},{key:"setPosition",value:function(t){return Ss.sceneGraphService.setPosition(this,Cr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)),this}},{key:"setLocalPosition",value:function(t){return Ss.sceneGraphService.setLocalPosition(this,Cr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)),this}},{key:"translate",value:function(t){return Ss.sceneGraphService.translate(this,Cr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)),this}},{key:"translateLocal",value:function(t){return Ss.sceneGraphService.translateLocal(this,Cr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0)),this}},{key:"getPosition",value:function(){return Ss.sceneGraphService.getPosition(this)}},{key:"getLocalPosition",value:function(){return Ss.sceneGraphService.getLocalPosition(this)}},{key:"scale",value:function(t,e,n){return this.scaleLocal(t,e,n)}},{key:"scaleLocal",value:function(t,e,n){return"number"==typeof t&&(t=Cr(t,e=e||t,n=n||t)),Ss.sceneGraphService.scaleLocal(this,t),this}},{key:"setLocalScale",value:function(t,e,n){return"number"==typeof t&&(t=Cr(t,e=e||t,n=n||t)),Ss.sceneGraphService.setLocalScale(this,t),this}},{key:"getLocalScale",value:function(){return Ss.sceneGraphService.getLocalScale(this)}},{key:"getScale",value:function(){return Ss.sceneGraphService.getScale(this)}},{key:"getEulerAngles",value:function(){return Or(An(Lr(L(),Ss.sceneGraphService.getWorldTransform(this)),3)[2])}},{key:"getLocalEulerAngles",value:function(){return Or(An(Lr(L(),Ss.sceneGraphService.getLocalRotation(this)),3)[2])}},{key:"setEulerAngles",value:function(t){return Ss.sceneGraphService.setEulerAngles(this,0,0,t),this}},{key:"setLocalEulerAngles",value:function(t){return Ss.sceneGraphService.setLocalEulerAngles(this,0,0,t),this}},{key:"rotateLocal",value:function(t,e,n){return Jt(e)&&Jt(n)?Ss.sceneGraphService.rotateLocal(this,0,0,t):Ss.sceneGraphService.rotateLocal(this,t,e,n),this}},{key:"rotate",value:function(t,e,n){return Jt(e)&&Jt(n)?Ss.sceneGraphService.rotate(this,0,0,t):Ss.sceneGraphService.rotate(this,t,e,n),this}},{key:"setRotation",value:function(t,e,n,r){return Ss.sceneGraphService.setRotation(this,t,e,n,r),this}},{key:"setLocalRotation",value:function(t,e,n,r){return Ss.sceneGraphService.setLocalRotation(this,t,e,n,r),this}},{key:"setLocalSkew",value:function(t,e){return Ss.sceneGraphService.setLocalSkew(this,t,e),this}},{key:"getRotation",value:function(){return Ss.sceneGraphService.getRotation(this)}},{key:"getLocalRotation",value:function(){return Ss.sceneGraphService.getLocalRotation(this)}},{key:"getLocalSkew",value:function(){return Ss.sceneGraphService.getLocalSkew(this)}},{key:"getLocalTransform",value:function(){return Ss.sceneGraphService.getLocalTransform(this)}},{key:"getWorldTransform",value:function(){return Ss.sceneGraphService.getWorldTransform(this)}},{key:"setLocalTransform",value:function(t){return Ss.sceneGraphService.setLocalTransform(this,t),this}},{key:"resetLocalTransform",value:function(){Ss.sceneGraphService.resetLocalTransform(this)}},{key:"getAnimations",value:function(){return this.activeAnimations}},{key:"animate",value: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}},{key:"isVisible",value:function(){var t;return"visible"===(null===(t=this.parsedStyle)||void 0===t?void 0:t.visibility)}},{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}},{key:"isInteractive",value:function(){var t;return"none"!==(null===(t=this.parsedStyle)||void 0===t?void 0:t.pointerEvents)}},{key:"isCulled",value:function(){return!(!this.cullable||!this.cullable.enable||this.cullable.visible)}},{key:"toFront",value:function(){return this.parentNode&&(this.style.zIndex=Math.max.apply(Math,On(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))+1),this}},{key:"toBack",value:function(){return this.parentNode&&(this.style.zIndex=Math.min.apply(Math,On(this.parentNode.children.map((function(t){return Number(t.style.zIndex)}))))-1),this}},{key:"getConfig",value:function(){return this.config}},{key:"attr",value:function(){for(var t=this,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?re(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes}},{key:"getMatrix",value:function(t){var e=t||this.getWorldTransform(),n=An(E(L(),e),2),r=n[0],i=n[1],a=An(T(L(),e),2),o=a[0],s=a[1],u=S(J(),e),l=An(Lr(L(),u),3);return Ir(l[0]||l[2],r,i,o,s)}},{key:"getLocalMatrix",value:function(){return this.getMatrix(this.getLocalTransform())}},{key:"setMatrix",value:function(t){var e=An(_r(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,a)}},{key:"setLocalMatrix",value:function(t){var e=An(_r(t),5),n=e[0],r=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,a)}},{key:"show",value:function(){Ss.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))}},{key:"hide",value:function(){Ss.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.style.visibility="hidden"}))}},{key:"getCount",value:function(){return this.childElementCount}},{key:"getParent",value:function(){return this.parentElement}},{key:"getChildren",value:function(){return this.children}},{key:"getFirst",value:function(){return this.firstElementChild}},{key:"getLast",value:function(){return this.lastElementChild}},{key:"getChildByIndex",value:function(t){return this.children[t]||null}},{key:"add",value:function(t,e){return this.appendChild(t,e)}},{key:"setClip",value:function(t){this.style.clipPath=t}},{key:"set",value:function(t,e){this.config[t]=e}},{key:"get",value:function(t){return this.config[t]}},{key:"moveTo",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"move",value:function(t){return this.setPosition(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0),this}},{key:"setZIndex",value:function(t){return this.style.zIndex=t,this}}]),r}(ao),bo=["style"],Eo=function(e){Tn(r,e);var n=Nn(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,a=Mn(e,bo);return kn(this,r),n.call(this,vn({type:t.Shape.CIRCLE,style:vn(Ss.enableCSSParsing?{cx:"",cy:"",r:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:Ss.enableCSSParsing?null:[vr,vr]}},a))}return bn(r)}(xo),To=["style"],So=function(t){Tn(n,t);var e=Nn(n);function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=r.style,a=Mn(r,To);return kn(this,n),(t=e.call(this,vn({style:vn(Ss.enableCSSParsing?{x:"",y:""}:{},i)},a))).isCustomElement=!0,t}return bn(n)}(xo),Po=["style"],Mo=function(e){Tn(r,e);var n=Nn(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,a=Mn(e,Po);return kn(this,r),n.call(this,vn({type:t.Shape.ELLIPSE,style:vn(Ss.enableCSSParsing?{cx:"",cy:"",rx:"",ry:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:Ss.enableCSSParsing?null:[vr,vr]}},a))}return bn(r)}(xo),wo=["style"],No=function(e){Tn(r,e);var n=Nn(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,a=Mn(e,wo);return kn(this,r),n.call(this,vn({type:t.Shape.GROUP,style:vn(Ss.enableCSSParsing?{x:"",y:"",width:"",height:""}:{},i)},a))}return bn(r)}(xo),Co=["style"],Ao=function(e){Tn(r,e);var n=Nn(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=i.style,o=Mn(i,Co);return kn(this,r),(e=n.call(this,vn({type:t.Shape.HTML,style:vn(Ss.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},a)},o))).cullable.enable=!1,e}return bn(r,[{key:"getDomElement",value:function(){return this.parsedStyle.$el}},{key:"getBoundingClientRect",value:function(){return this.parsedStyle.$el.getBoundingClientRect()}},{key:"getClientRects",value:function(){return[this.getBoundingClientRect()]}},{key:"getBounds",value: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,a=n.top-r.top,o=new Ra;return o.setMinMax([i,a,0],[i+n.width,a+n.height,0]),o}return null}},{key:"getLocalBounds",value:function(){if(this.parentNode){var t=d(s(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!Ra.isEmpty(e)){var n=new Ra;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()}}]),r}(xo),Oo=["style"],Ro=function(e){Tn(r,e);var n=Nn(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,a=Mn(e,Oo);return kn(this,r),n.call(this,vn({type:t.Shape.IMAGE,style:vn(Ss.enableCSSParsing?{x:"",y:"",img:"",width:"",height:""}:{},i)},a))}return bn(r)}(xo),Lo=["style"],Io=function(e){Tn(r,e);var n=Nn(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=i.style,o=Mn(i,Lo);kn(this,r),(e=n.call(this,vn({type:t.Shape.LINE,style:vn({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},a)},o))).markerStartAngle=0,e.markerEndAngle=0;var s=e.parsedStyle,u=s.markerStart,l=s.markerEnd;return u&&lo(u)&&(e.markerStartAngle=u.getLocalEulerAngles(),e.appendChild(u)),l&&lo(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return bn(r,[{key:"attributeChangedCallback",value: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&&lo(r)&&(this.markerStartAngle=0,r.remove()),i&&lo(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&lo(r)&&(this.markerEndAngle=0,r.remove()),i&&lo(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,a=e.x2,o=e.y1,s=e.y2,u=e.defX,l=e.defY,c=t?e.markerStart:e.markerEnd;if(c&&lo(c)){var h,f,d,v,p,y,m;t?(v=i-u,p=o-l,f=a-i,d=s-o,y=n||0,m=this.markerStartAngle):(v=a-u,p=s-l,f=i-a,d=o-s,y=r||0,m=this.markerEndAngle),c.setLocalEulerAngles(180*(h=Math.atan2(d,f))/Math.PI+m),c.setLocalPosition(v+Math.cos(h)*y,p+Math.sin(h)*y)}}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=n.defX,i=n.defY,a=qe.pointAt(n.x1,n.y1,n.x2,n.y2,t),o=a.x,s=a.y,u=W(L(),D(o-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new _a(u[0],u[1])}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getTotalLength",value:function(){var t=this.parsedStyle;return qe.length(t.x1,t.y1,t.x2,t.y2)}}]),r}(xo),_o=["style"],Do={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new Da(0,0,0,0)},Fo=function(e){Tn(r,e);var n=Nn(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=i.style,o=Mn(i,_o);kn(this,r),(e=n.call(this,vn({type:t.Shape.PATH,style:vn(Ss.enableCSSParsing?{path:"",miterLimit:""}:{},a),initialParsedStyle:Ss.enableCSSParsing?null:{miterLimit:4,path:vn({},Do)}},o))).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var s=e.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&lo(u)&&(e.markerStartAngle=u.getLocalEulerAngles(),e.appendChild(u)),c&&lo(c)&&e.placeMarkerMid(c),l&&lo(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return bn(r,[{key:"attributeChangedCallback",value: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&&lo(r)&&(this.markerStartAngle=0,r.remove()),i&&lo(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&lo(r)&&(this.markerEndAngle=0,r.remove()),i&&lo(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.defX,a=e.defY,o=t?e.markerStart:e.markerEnd;if(o&&lo(o)){var s,u,l,c,h,f,d;if(t){var v=An(this.getStartTangent(),2),p=v[0],y=v[1];c=y[0]-i,h=y[1]-a,u=p[0]-y[0],l=p[1]-y[1],f=n||0,d=this.markerStartAngle}else{var m=An(this.getEndTangent(),2),g=m[0],k=m[1];c=k[0]-i,h=k[1]-a,u=g[0]-k[0],l=g[1]-k[1],f=r||0,d=this.markerEndAngle}o.setLocalEulerAngles(180*(s=Math.atan2(l,u))/Math.PI+d),o.setLocalPosition(c+Math.cos(s)*f,h+Math.sin(s)*f)}}},{key:"placeMarkerMid",value: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&&lo(t))for(var a=1;n.length-1>a;a++){var o=An(n[a].currentPoint,2),s=o[0],u=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,u-i)}}},{key:"getTotalLength",value:function(){return Hr(this)}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=n.defX,i=n.defY,a=function(t,e,n){return Kt(t,e,yt(yt({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),o=a.x,s=a.y,u=W(L(),D(o-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new _a(u[0],u[1])}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPointAtLength(t*Hr(this),e)}},{key:"getStartTangent",value: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}},{key:"getEndTangent",value: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,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n}}]),r}(xo),Go=["style"],Uo=function(e){Tn(r,e);var n=Nn(r);function r(){var e,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=i.style,o=Mn(i,Go);kn(this,r),(e=n.call(this,vn({type:t.Shape.POLYGON,style:vn(Ss.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},a),initialParsedStyle:Ss.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},o))).markerStartAngle=0,e.markerEndAngle=0,e.markerMidList=[];var s=e.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&lo(u)&&(e.markerStartAngle=u.getLocalEulerAngles(),e.appendChild(u)),c&&lo(c)&&e.placeMarkerMid(c),l&&lo(l)&&(e.markerEndAngle=l.getLocalEulerAngles(),e.appendChild(l)),e.transformMarker(!0),e.transformMarker(!1),e}return bn(r,[{key:"attributeChangedCallback",value: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&&lo(r)&&(this.markerStartAngle=0,r.remove()),i&&lo(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&lo(r)&&(this.markerEndAngle=0,r.remove()),i&&lo(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1))):"markerMid"===t&&this.placeMarkerMid(i)}},{key:"transformMarker",value:function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.points.points,a=e.defX,o=e.defY,s=t?e.markerStart:e.markerEnd;if(s&&lo(s)){var u,l,c,h,f,d,v;if(h=i[0][0]-a,f=i[0][1]-o,t)l=i[1][0]-i[0][0],c=i[1][1]-i[0][1],d=n||0,v=this.markerStartAngle;else{var p=i.length;this.parsedStyle.isClosed?(l=i[p-1][0]-i[0][0],c=i[p-1][1]-i[0][1]):(h=i[p-1][0]-a,f=i[p-1][1]-o,l=i[p-2][0]-i[p-1][0],c=i[p-2][1]-i[p-1][1]),d=r||0,v=this.markerEndAngle}s.setLocalEulerAngles(180*(u=Math.atan2(c,l))/Math.PI+v),s.setLocalPosition(h+Math.cos(u)*d,f+Math.sin(u)*d)}}},{key:"placeMarkerMid",value: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&&lo(t))for(var a=1;(this.parsedStyle.isClosed?n.length:n.length-1)>a;a++){var o=n[a][0]-r,s=n[a][1]-i,u=1===a?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(o,s)}}}]),r}(xo),Bo=["style"],jo=function(e){Tn(r,e);var n=Nn(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,a=Mn(e,Bo);return kn(this,r),n.call(this,vn({type:t.Shape.POLYLINE,style:vn(Ss.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},i),initialParsedStyle:Ss.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},a))}return bn(r,[{key:"getTotalLength",value:function(){return this.parsedStyle.points.totalLength}},{key:"getPointAtLength",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.getPoint(t/this.getTotalLength(),e)}},{key:"getPoint",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.parsedStyle,r=n.defX,i=n.defY,a=n.points,o=a.points,s=0,u=0;a.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var l=qe.pointAt(o[u][0],o[u][1],o[u+1][0],o[u+1][1],s),c=l.x,h=l.y,f=W(L(),D(c-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new _a(f[0],f[1])}},{key:"getStartTangent",value: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}},{key:"getEndTangent",value: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}}]),r}(Uo),Vo=["style"],Yo=function(e){Tn(r,e);var n=Nn(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,a=Mn(e,Vo);return kn(this,r),n.call(this,vn({type:t.Shape.RECT,style:vn(Ss.enableCSSParsing?{x:"",y:"",width:"",height:"",radius:""}:{},i)},a))}return bn(r)}(xo),zo=["style"],Xo=function(e){Tn(r,e);var n=Nn(r);function r(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.style,a=Mn(e,zo);return kn(this,r),n.call(this,vn({type:t.Shape.TEXT,style:vn(Ss.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:"",isBillboard:!1,sizeAttenuation:!0}:{fill:"black"},i),initialParsedStyle:Ss.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0,isBillboard:!1,sizeAttenuation:!0}},a))}return bn(r,[{key:"getComputedTextLength",value:function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.maxLineWidth)||0}},{key:"getLineBoundingRects",value:function(){var t;return(null===(t=this.parsedStyle.metrics)||void 0===t?void 0:t.lineMetrics)||[]}},{key:"isOverflowing",value:function(){return!!this.parsedStyle.isOverflowing}}]),r}(xo),Wo=[{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,l:!0},{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,int:!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:"cz",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",int:!0,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"}],Ho=Wo.filter((function(t){return!!t.l})).map((function(t){return t.n})),qo={},Ko=new WeakMap,Zo=function(){function e(){var t=this;kn(this,e),Wo.forEach((function(e){t.registerMetadata(e)}))}return bn(e,[{key:"registerMetadata",value:function(t){[t.n].concat(On(t.a||[])).forEach((function(e){qo[e]=t}))}},{key:"unregisterMetadata",value:function(t){delete qo[t]}},{key:"getPropertySyntax",value:function(t){return Ss.CSSPropertySyntaxFactory[t]}},{key:"processProperties",value:function(e,n){var r=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]};if(!Ss.enableCSSParsing){Object.assign(e.attributes,n);var a=Object.keys(n),o=e.parsedStyle.clipPath,s=e.parsedStyle.offsetPath;e.parsedStyle=Object.assign(e.parsedStyle,n);var u=!!i.forceUpdateGeometry;if(!u)for(var l=0;Ho.length>l;l++)if(Ho[l]in n){u=!0;break}return n.fill&&(e.parsedStyle.fill=Ri(n.fill)),n.stroke&&(e.parsedStyle.stroke=Ri(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=Ri(n.shadowColor)),n.filter&&(e.parsedStyle.filter=zi(n.filter)),Jt(n.radius)||(e.parsedStyle.radius=Bi(n.radius,4)),Jt(n.lineDash)||(e.parsedStyle.lineDash=Bi(n.lineDash,2)),n.points&&(e.parsedStyle.points=ta(n.points,e)),""===n.path&&(e.parsedStyle.path=vn({},Do)),n.path&&(e.parsedStyle.path=$i(n.path,e)),n.textTransform&&Ss.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},e,null),n.clipPath&&Ss.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",o,n.clipPath,e,this),n.offsetPath&&Ss.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,n.offsetPath,e,this),n.anchor&&(e.parsedStyle.anchor=Bi(n.anchor,2)),n.transform&&(e.parsedStyle.transform=oa(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=ya(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=Ss.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=Ss.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=Ss.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),(e.nodeName!==t.Shape.CIRCLE&&e.nodeName!==t.Shape.ELLIPSE||Jt(n.cx)&&Jt(n.cy))&&(e.nodeName!==t.Shape.RECT&&e.nodeName!==t.Shape.IMAGE&&e.nodeName!==t.Shape.GROUP&&e.nodeName!==t.Shape.HTML&&e.nodeName!==t.Shape.TEXT&&e.nodeName!==t.Shape.MESH||Jt(n.x)&&Jt(n.y)&&Jt(n.z))&&(e.nodeName!==t.Shape.LINE||Jt(n.x1)&&Jt(n.y1)&&Jt(n.z1)&&Jt(n.x2)&&Jt(n.y2)&&Jt(n.z2))||Ss.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(e,a),Jt(n.zIndex)||Ss.CSSPropertySyntaxFactory["<z-index>"].postProcessor(e,a),n.path&&Ss.CSSPropertySyntaxFactory["<path>"].postProcessor(e,a),n.points&&Ss.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(e,a),Jt(n.offsetDistance)||Ss.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(e,a),n.transform&&Ss.CSSPropertySyntaxFactory["<transform>"].postProcessor(e,a),void(u&&this.updateGeometry(e))}var c=i.skipUpdateAttribute,h=i.skipParse,f=i.usedAttributes,d=i.forceUpdateGeometry,v=Object.keys(n);v.forEach((function(t){var r;c||(e.attributes[t]=n[t]),!d&&(null===(r=qo[t])||void 0===r?void 0:r.l)&&(d=!0)})),h||v.forEach((function(t){e.computedStyle[t]=r.parseProperty(t,e.attributes[t],e)})),(null==f?void 0:f.length)&&(v=Array.from(new Set(v.concat(f)))),v.forEach((function(t){t in e.computedStyle&&(e.parsedStyle[t]=r.computeProperty(t,e.computedStyle[t],e))})),d&&this.updateGeometry(e),v.forEach((function(t){t in e.parsedStyle&&r.postProcessProperty(t,e,v)})),Ss.enableCSSParsing&&e.children.length&&v.forEach((function(t){t in e.parsedStyle&&r.isPropertyInheritable(t)&&e.children.forEach((function(e){e.internalSetAttribute(t,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))}},{key:"parseProperty",value:function(t,e,n){var r=qo[t],i=e;if((""===e||Jt(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=lr(e);else if(r){var a=r.k,o=r.syntax,s=o&&this.getPropertySyntax(o);a&&a.indexOf(e)>-1?i=lr(e):s&&s.parser&&(i=s.parser(e,n))}return i}},{key:"computeProperty",value:function(t,e,n){var r=qo[t],i=e;if(r){var a=r.syntax,o=r.d;if(e instanceof Xn){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)Jt(o)||(e=this.parseProperty(t,Kn(o)?o(n.nodeName):o,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return Jt(u)?void this.addUnresolveProperty(n,t):u}}var l=a&&this.getPropertySyntax(a);if(l&&l.calculator)i=l.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof Xn?e.value:e}return i}},{key:"postProcessProperty",value:function(t,e,n){var r=qo[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}}},{key:"addUnresolveProperty",value:function(t,e){var n=Ko.get(t);n||(Ko.set(t,[]),n=Ko.get(t)),-1===n.indexOf(e)&&n.push(e)}},{key:"tryToResolveProperty",value:function(t,e){if((arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).inherited&&t.parentElement&&function(t,e){var n=Ko.get(t);return!n||0===n.length||n.includes(e)}(t.parentElement,e)){var n=t.parentElement.parsedStyle[e];if("unset"===n||"initial"===n||"inherit"===n)return;return n}}},{key:"recalc",value:function(t){var e=Ko.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Ko.delete(t)}}},{key:"updateGeometry",value:function(e){var n=e.nodeName,r=Ss.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new Ra),i.renderBounds||(i.renderBounds=new Ra);var a=e.parsedStyle,o=r.update(a,e),s=o.width,u=o.height,l=o.depth,c=void 0===l?0:l,h=o.offsetX,f=void 0===h?0:h,d=o.offsetY,v=void 0===d?0:d,p=o.offsetZ,y=void 0===p?0:p,m=[Math.abs(s)/2,Math.abs(u)/2,c/2],g=a.stroke,k=a.lineWidth,x=a.increasedLineWidthForHitTesting,b=a.shadowType,E=a.shadowColor,T=a.filter,S=void 0===T?[]:T,P=a.transformOrigin,M=a.anchor;n===t.Shape.TEXT?delete a.anchor:n===t.Shape.MESH&&(a.anchor[2]=.5);var w=[(1-2*(M&&M[0]||0))*s/2+f,(1-2*(M&&M[1]||0))*u/2+v,(1-2*(M&&M[2]||0))*m[2]+y];if(i.contentBounds.update(w,m),g&&!g.isNone){var N=((k||0)+(x||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);m[0]+=N,m[1]+=N}if(i.renderBounds.update(w,m),E&&b&&"inner"!==b){var C=i.renderBounds,A=C.min,O=C.max,R=a.shadowBlur||0,L=a.shadowOffsetX||0,I=a.shadowOffsetY||0,_=O[0]+R+L,D=A[1]-R+I,F=O[1]+R+I;A[0]=Math.min(A[0],A[0]-R+L),O[0]=Math.max(O[0],_),A[1]=Math.min(A[1],D),O[1]=Math.max(O[1],F),i.renderBounds.setMinMax(A,O)}S.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,Mr(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=i.renderBounds,l=u.min,c=u.max,h=c[0]+s+a,f=l[1]-s+o,d=c[1]+s+o;l[0]=Math.min(l[0],l[0]-s+a),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),i.renderBounds.setMinMax(l,c)}})),M=a.anchor;var G=0>s,U=0>u,B=(G?-1:1)*(P?Vi(P[0],0,e):0),j=(U?-1:1)*(P?Vi(P[1],1,e):0);e.setOrigin(B-=(G?-1:1)*(M&&M[0]||0)*i.contentBounds.halfExtents[0]*2,j-=(U?-1:1)*(M&&M[1]||0)*i.contentBounds.halfExtents[1]*2),Ss.sceneGraphService.dirtifyToRoot(e)}}},{key:"isPropertyInheritable",value:function(t){var e=qo[t];return!!e&&e.inh}}]),e}();(co=t.CameraType||(t.CameraType={}))[co.ORBITING=0]="ORBITING",co[co.EXPLORING=1]="EXPLORING",co[co.TRACKING=2]="TRACKING",(ho=t.CameraTrackingMode||(t.CameraTrackingMode={}))[ho.DEFAULT=0]="DEFAULT",ho[ho.ROTATIONAL=1]="ROTATIONAL",ho[ho.TRANSLATIONAL=2]="TRANSLATIONAL",ho[ho.CINEMATIC=3]="CINEMATIC",(fo=t.CameraProjectionMode||(t.CameraProjectionMode={}))[fo.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",fo[fo.PERSPECTIVE=1]="PERSPECTIVE";var Qo,$o={UPDATED:"updated"},Jo=2e-4,ts=function(){function e(){kn(this,e),this.canvas=void 0,this.eventEmitter=new fn,this.matrix=s(),this.right=D(1,0,0),this.up=D(0,1,0),this.forward=D(0,0,1),this.position=D(0,0,1),this.focalPoint=D(0,0,0),this.distanceVector=D(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=s(),this.projectionMatrixInverse=s(),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 Ia,this.orthoMatrix=s()}return bn(e,[{key:"isOrtho",value:function(){return this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC}},{key:"getProjectionMode",value:function(){return this.projectionMode}},{key:"getPerspective",value:function(){return this.jitteredProjectionMatrix||this.projectionMatrix}},{key:"getPerspectiveInverse",value:function(){return this.projectionMatrixInverse}},{key:"getFrustum",value:function(){return this.frustum}},{key:"getPosition",value:function(){return this.position}},{key:"getFocalPoint",value:function(){return this.focalPoint}},{key:"getDollyingStep",value:function(){return this.dollyingStep}},{key:"getNear",value:function(){return this.near}},{key:"getFar",value:function(){return this.far}},{key:"getZoom",value:function(){return this.zoom}},{key:"getOrthoMatrix",value:function(){return this.orthoMatrix}},{key:"getView",value:function(){return this.view}},{key:"setEnableUpdate",value:function(t){this.enableUpdate=t}},{key:"setType",value: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}},{key:"setProjectionMode",value:function(t){return this.projectionMode=t,this}},{key:"setTrackingMode",value:function(e){if(this.type!==t.CameraType.TRACKING)throw Error("Impossible to set a tracking mode if the camera is not of tracking type");return this.trackingMode=e,this}},{key:"setWorldRotation",value:function(t){return this.rotateWorld=t,this._getAngles(),this}},{key:"getViewTransform",value:function(){return d(s(),this.matrix)}},{key:"getWorldTransform",value:function(){return this.matrix}},{key:"jitterProjectionMatrix",value:function(t,e){var n=x(s(),[t,e,0]);this.jitteredProjectionMatrix=p(s(),n,this.projectionMatrix)}},{key:"clearJitterProjectionMatrix",value:function(){this.jitteredProjectionMatrix=void 0}},{key:"setMatrix",value:function(t){return this.matrix=t,this._update(),this}},{key:"setFov",value:function(t){return this.setPerspective(this.near,this.far,t,this.aspect),this}},{key:"setAspect",value:function(t){return this.setPerspective(this.near,this.far,this.fov,t),this}},{key:"setNear",value: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}},{key:"setFar",value: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}},{key:"setViewOffset",value:function(e,n,r,i,a,o){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=a,this.view.height=o,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}},{key:"clearViewOffset",value: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}},{key:"setZoom",value: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}},{key:"setZoomByViewportPoint",value:function(t,e){var n=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),r=n.x,i=n.y,a=this.roll;this.rotate(0,0,-a),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=D(o.x-r,o.y-i,0),u=Y(s,this.right)/_(this.right),l=Y(s,this.up)/_(this.up);return this.pan(-u,-l),this}},{key:"setPerspective",value:function(e,n,r,i){var a;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var o=this.near*Math.tan(Ar(.5*this.fov))/this.zoom,s=2*o,u=this.aspect*s,l=-.5*u;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var c=this.view.fullWidth,h=this.view.fullHeight;l+=this.view.offsetX*u/c,o-=this.view.offsetY*s/h,u*=this.view.width/c,s*=this.view.height/h}return function(t,e,n,r,i,a,o){var s=2*a/(r-i),u=(n+e)/(n-e),l=(r+i)/(r-i),c=-(o+a)/(o-a),h=-2*o*a/(o-a);t[0]=2*a/(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]=l,t[10]=c,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0}(this.projectionMatrix,l,l+u,o,o-s,e,this.far),m(this.projectionMatrix,this.projectionMatrix,D(1,-1,1)),d(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this}},{key:"setOrthographic",value:function(e,n,r,i,a,o){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=a,this.far=o;var u=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),c=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,f=c-u,v=c+u,p=h+l,y=h-l;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var g=(this.rright-this.left)/this.view.fullWidth/this.zoom,k=(this.top-this.bottom)/this.view.fullHeight/this.zoom;v=(f+=g*this.view.offsetX)+g*this.view.width,y=(p-=k*this.view.offsetY)-k*this.view.height}return C(this.projectionMatrix,f,v,y,p,a,o),m(this.projectionMatrix,this.projectionMatrix,D(1,-1,1)),d(this.projectionMatrixInverse,this.projectionMatrix),this._getOrthoMatrix(),this.triggerUpdate(),this}},{key:"setPosition",value:function(t){var e=Cr(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position[1],arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.position[2]);return this._setPosition(e),this.setFocalPoint(this.focalPoint),this.triggerUpdate(),this}},{key:"setFocalPoint",value:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.focalPoint[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.focalPoint[2],i=D(0,1,0);if(this.focalPoint=Cr(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var a=B(L(),this.focalPoint,this.position);e=a[0],n=a[1],r=a[2];var o=_(a),u=Or(Math.asin(n/o)),l=90+Or(Math.atan2(r,e)),c=s();k(c,c,Ar(l)),g(c,c,Ar(u)),i=W(L(),[0,1,0],c)}return d(this.matrix,A(s(),this.position,this.focalPoint,i)),this._getAxes(),this._getDistance(),this._getAngles(),this.triggerUpdate(),this}},{key:"getDistance",value:function(){return this.distance}},{key:"getDistanceVector",value:function(){return this.distanceVector}},{key:"setDistance",value:function(t){if(this.distance===t||0>t)return this;this.distance=t,Jo>this.distance&&(this.distance=Jo),this.dollyingStep=this.distance/100;var e=L(),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}},{key:"setMaxDistance",value:function(t){return this.maxDistance=t,this}},{key:"setMinDistance",value:function(t){return this.minDistance=t,this}},{key:"setAzimuth",value:function(e){return this.azimuth=Nr(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}},{key:"getAzimuth",value:function(){return this.azimuth}},{key:"setElevation",value:function(e){return this.elevation=Nr(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}},{key:"getElevation",value:function(){return this.elevation}},{key:"setRoll",value:function(e){return this.roll=Nr(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}},{key:"getRoll",value:function(){return this.roll}},{key:"_update",value:function(){this._getAxes(),this._getPosition(),this._getDistance(),this._getAngles(),this._getOrthoMatrix(),this.triggerUpdate()}},{key:"computeMatrix",value:function(){var e=tt(J(),[0,0,1],Ar(this.roll));h(this.matrix);var n=tt(J(),[1,0,0],Ar((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=tt(J(),[0,1,0],Ar((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=et(J(),r,n);i=et(J(),i,e);var a=M(s(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(y(this.matrix,this.matrix,this.focalPoint),p(this.matrix,this.matrix,a),y(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(y(this.matrix,this.matrix,this.position),p(this.matrix,this.matrix,a))}},{key:"_setPosition",value:function(t,e,n){this.position=Cr(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()}},{key:"_getAxes",value:function(){F(this.right,Cr($(Q(),[1,0,0,0],this.matrix))),F(this.up,Cr($(Q(),[0,1,0,0],this.matrix))),F(this.forward,Cr($(Q(),[0,0,1,0],this.matrix))),V(this.right,this.right),V(this.up,this.up),V(this.forward,this.forward)}},{key:"_getAngles",value:function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=_(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=Or(Math.asin(n/i)),this.azimuth=Or(Math.atan2(-e,-r))):(this.elevation=-Or(Math.asin(n/i)),this.azimuth=-Or(Math.atan2(-e,-r)))}},{key:"_getPosition",value:function(){F(this.position,Cr($(Q(),[0,0,0,1],this.matrix))),this._getDistance()}},{key:"_getFocalPoint",value:function(){var t,e;!function(t,e,n){var r=e[0],i=e[1],a=e[2];t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8]}(this.distanceVector,[0,0,-this.distance],(t=o(),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)),U(this.focalPoint,this.position,this.distanceVector),this._getDistance()}},{key:"_getDistance",value:function(){this.distanceVector=B(L(),this.focalPoint,this.position),this.distance=_(this.distanceVector),this.dollyingStep=this.distance/100}},{key:"_getOrthoMatrix",value:function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=tt(J(),[0,0,1],-this.roll*Math.PI/180);P(this.orthoMatrix,n,D((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),D(this.zoom,this.zoom,1),e)}}},{key:"triggerUpdate",value:function(){if(this.enableUpdate){var t=this.getViewTransform(),e=p(s(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit($o.UPDATED)}}},{key:"rotate",value:function(t,e,n){throw Error(br)}},{key:"pan",value:function(t,e){throw Error(br)}},{key:"dolly",value:function(t){throw Error(br)}},{key:"createLandmark",value:function(t,e){throw Error(br)}},{key:"gotoLandmark",value:function(t,e){throw Error(br)}},{key:"cancelLandmarkAnimation",value:function(){throw Error(br)}}]),e}(),es=function(){function t(){kn(this,t)}return bn(t,[{key:"update",value:function(t,e){var n=t.r;return{width:2*n,height:2*n}}}]),t}(),ns=function(){function t(){kn(this,t)}return bn(t,[{key:"update",value:function(t,e){return{width:2*t.rx,height:2*t.ry}}}]),t}(),rs=function(){function t(){kn(this,t)}return bn(t,[{key:"update",value:function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i);return{width:o-a,height:Math.max(n,i)-s}}}]),t}(),is=function(){function t(){kn(this,t)}return bn(t,[{key:"update",value:function(t){var e=t.path.rect;return{width:e.width,height:e.height}}}]),t}(),as=function(){function t(){kn(this,t)}return bn(t,[{key:"update",value:function(t){var e=t.points.points,n=Math.min.apply(Math,On(e.map((function(t){return t[0]})))),r=Math.max.apply(Math,On(e.map((function(t){return t[0]})))),i=Math.min.apply(Math,On(e.map((function(t){return t[1]}))));return{width:r-n,height:Math.max.apply(Math,On(e.map((function(t){return t[1]}))))-i}}}]),t}(),os=function(){function t(){kn(this,t)}return bn(t,[{key:"update",value:function(t,e){var n=t.img,r=t.width,i=t.height,a=void 0===r?0:r,o=void 0===i?0:i;return n&&!oe(n)&&(a||(t.width=a=n.width),o||(t.height=o=n.height)),{width:a,height:o}}}]),t}(),ss=function(){function t(e){kn(this,t),this.globalRuntime=void 0,this.globalRuntime=e}return bn(t,[{key:"isReadyToMeasure",value:function(t,e){return t.text&&t.fontSize&&t.fontStyle&&t.fontWeight&&t.fontVariant&&t.textAlign&&t.textBaseline&&!Jt(t.lineWidth)}},{key:"update",value:function(t,e){var n,r,i=t.text,a=t.textAlign,o=t.lineWidth,s=t.textBaseline,u=t.dx,l=t.dy,c=((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,c);t.metrics=h;var f=[h.width/2,h.height/2,0],d=[0,1],v=0;"center"===a||"middle"===a?(v=o/2,d=[.5,1]):"right"!==a&&"end"!==a||(v=o,d=[1,1]);var p=0;return"middle"===s?p=f[1]:"top"===s||"hanging"===s?p=2*f[1]:"alphabetic"===s?p=Ss.enableCSSParsing?h.lineHeight-h.fontProperties.ascent:0:"bottom"!==s&&"ideographic"!==s||(p=0),u&&(v+=u),l&&(p+=l),t.anchor=[d[0],d[1],0],{width:2*f[0],height:2*f[1],offsetX:v,offsetY:p}}}]),t}(),us=function(){function t(e,n){var r=this;kn(this,t),this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new fn,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=s(),this.tmpVec3=L(),this.onPointerDown=function(t){var e=r.createPointerEvent(t);if(r.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)r.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){r.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}r.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),r.freeEvent(e)},this.onPointerUp=function(t){var e=performance.now(),n=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);if(r.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)r.dispatchEvent(n,"touchend");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.dispatchEvent(n,2===n.button?"rightup":"mouseup")}var i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.pressTargetsByButton[t.button]),o=a;if(a&&!n.composedPath().includes(a)){for(var s=a;s&&!n.composedPath().includes(s);){if(n.currentTarget=s,r.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)r.notifyTarget(n,"touchendoutside");else if("mouse"===n.pointerType||"pen"===n.pointerType){r.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside")}Za.isNode(s)&&(s=s.parentNode)}delete i.pressTargetsByButton[t.button],o=s}if(o){var u,l=r.clonePointerEvent(n,"click");l.target=o,l.path=[],i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:e});var c=i.clicksByButton[t.button];c.target===l.target&&200>e-c.timeStamp?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=e,l.detail=c.clickCount,(null===(u=n.detail)||void 0===u?void 0:u.preventClick)||(r.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||r.dispatchEvent(l,"click"),r.dispatchEvent(l,"pointertap")),r.freeEvent(l)}r.freeEvent(n)},this.onPointerMove=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0),n="mouse"===e.pointerType||"pen"===e.pointerType,i=r.trackingData(t.pointerId),a=r.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o=r.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",a||void 0);if(r.dispatchEvent(o,"pointerout"),n&&r.dispatchEvent(o,"mouseout"),!e.composedPath().includes(a)){var s=r.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,r.notifyTarget(s),n&&r.notifyTarget(s,"mouseleave"),Za.isNode(s.target)&&(s.target=s.target.parentNode);r.freeEvent(s)}r.freeEvent(o)}if(a!==e.target){var u=r.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");r.dispatchEvent(u,"pointerover"),n&&r.dispatchEvent(u,"mouseover");for(var l=a&&Za.isNode(a)&&a.parentNode;l&&l!==(Za.isNode(r.rootTarget)&&r.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(Za.isNode(r.rootTarget)&&r.rootTarget.parentNode)){var c=r.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==a&&c.target!==(Za.isNode(r.rootTarget)&&r.rootTarget.parentNode);)c.currentTarget=c.target,r.notifyTarget(c),n&&r.notifyTarget(c,"mouseenter"),Za.isNode(c.target)&&(c.target=c.target.parentNode);r.freeEvent(c)}r.freeEvent(u)}r.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&r.dispatchEvent(e,"touchmove"),n&&(r.dispatchEvent(e,"mousemove"),r.cursor=r.getCursor(e.target)),i.overTargets=e.composedPath(),r.freeEvent(e)},this.onPointerOut=function(t){var e=r.trackingData(t.pointerId);if(e.overTargets){var n="mouse"===t.pointerType||"pen"===t.pointerType,i=r.findMountedTarget(e.overTargets),a=r.createPointerEvent(t,"pointerout",i||void 0);r.dispatchEvent(a),n&&r.dispatchEvent(a,"mouseout");var o=r.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(Za.isNode(r.rootTarget)&&r.rootTarget.parentNode);)o.currentTarget=o.target,r.notifyTarget(o),n&&r.notifyTarget(o,"mouseleave"),Za.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,r.freeEvent(a),r.freeEvent(o)}r.cursor=null},this.onPointerOver=function(t){var e=r.trackingData(t.pointerId),n=r.createPointerEvent(t),i="mouse"===n.pointerType||"pen"===n.pointerType;r.dispatchEvent(n,"pointerover"),i&&r.dispatchEvent(n,"mouseover"),"mouse"===n.pointerType&&(r.cursor=r.getCursor(n.target));var a=r.clonePointerEvent(n,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(Za.isNode(r.rootTarget)&&r.rootTarget.parentNode);)a.currentTarget=a.target,r.notifyTarget(a),i&&r.notifyTarget(a,"mouseenter"),Za.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=n.composedPath(),r.freeEvent(n),r.freeEvent(a)},this.onPointerUpOutside=function(t){var e=r.trackingData(t.pointerId),n=r.findMountedTarget(e.pressTargetsByButton[t.button]),i=r.createPointerEvent(t);if(n){for(var a=n;a;)i.currentTarget=a,r.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||r.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),Za.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}r.freeEvent(i)},this.onWheel=function(t){var e=r.createWheelEvent(t);r.dispatchEvent(e),r.freeEvent(e)},this.onClick=function(t){if(r.context.config.useNativeClickEvent){var e=r.createPointerEvent(t);r.dispatchEvent(e),r.freeEvent(e)}},this.onPointerCancel=function(t){var e=r.createPointerEvent(t,void 0,void 0,r.context.config.alwaysTriggerPointerEventOnCanvas?r.rootTarget:void 0);r.dispatchEvent(e),r.freeEvent(e)},this.globalRuntime=e,this.context=n}return bn(t,[{key:"init",value: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("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)}},{key:"destroy",value:function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()}},{key:"client2Viewport",value:function(t){var e=this.context.contextService.getBoundingClientRect();return new _a(t.x-((null==e?void 0:e.left)||0),t.y-((null==e?void 0:e.top)||0))}},{key:"viewport2Client",value:function(t){var e=this.context.contextService.getBoundingClientRect();return new _a(t.x+((null==e?void 0:e.left)||0),t.y+((null==e?void 0:e.top)||0))}},{key:"viewport2Canvas",value:function(t){var e=t.x,n=t.y,r=this.rootTarget.defaultView.getCamera(),i=this.context.config,a=i.width,o=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),l=p(this.tmpMatrix,u,s),c=G(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return W(c,c,l),new _a(c[0],c[1])}},{key:"canvas2Viewport",value:function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=p(this.tmpMatrix,n,r),a=G(this.tmpVec3,t.x,t.y,0);W(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new _a((a[0]+1)/2*o.width,(1-(a[1]+1)/2)*o.height)}},{key:"setPickHandler",value:function(t){this.pickHandler=t}},{key:"addEventMapping",value: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}))}},{key:"mapEvent",value: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 ".concat(t.type))}}},{key:"dispatchEvent",value: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)}},{key:"propagate",value: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 a=i+1;n.length>a;a++)if(t.currentTarget=n[a],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}}},{key:"propagationPath",value: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++)Za.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e}},{key:"hitTest",value:function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:this.pickHandler(t)||this.rootTarget||null}},{key:"isNativeEventFromCanvas",value: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}},{key:"getExistedHTML",value:function(t){if(t.nativeEvent.composedPath){var e,n=In(t.nativeEvent.composedPath());try{for(n.s();!(e=n.n()).done;){var r=Ss.nativeHTMLMap.get(e.value);if(r)return r}}catch(t){n.e(t)}finally{n.f()}}return null}},{key:"pickTarget",value:function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})}},{key:"createPointerEvent",value:function(t,e,n,r){var i=this.allocateEvent(so);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i);return i.target=null!=n?n:a||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i}},{key:"createWheelEvent",value:function(t){var e=this.allocateEvent(uo);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e}},{key:"trackingData",value:function(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}},{key:"cloneWheelEvent",value:function(t){var e=this.allocateEvent(uo);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=t.type,e}},{key:"clonePointerEvent",value:function(t,e){var n=this.allocateEvent(so);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}},{key:"copyPointerData",value:function(t,e){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}},{key:"copyMouseData",value:function(t,e){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)}},{key:"copyWheelData",value:function(t,e){e.deltaMode=t.deltaMode,e.deltaX=t.deltaX,e.deltaY=t.deltaY,e.deltaZ=t.deltaZ}},{key:"copyData",value: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)}},{key:"allocateEvent",value: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}},{key:"freeEvent",value:function(t){if(t.manager!==this)throw 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)}},{key:"notifyTarget",value: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?"".concat(e,"capture"):e),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}},{key:"notifyListeners",value: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)}},{key:"findMountedTarget",value: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||Za.isNode(r)&&r.parentNode===e))break;e=t[n]}return e}},{key:"getCursor",value:function(t){for(var e=t;e;){var n=ao.isElement(e)&&e.getAttribute("cursor");if(n)return n;e=Za.isNode(e)&&e.parentNode}}}]),t}(),ls=function(){function t(){kn(this,t),this.canvas=void 0,this.context=void 0}return bn(t,[{key:"getOrCreateCanvas",value:function(t,e){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",e),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",e)}return this.canvas.width=10,this.canvas.height=10,this.canvas}},{key:"getOrCreateContext",value:function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context}}]),t}();(Qo=t.RenderReason||(t.RenderReason={}))[Qo.CAMERA_CHANGED=0]="CAMERA_CHANGED",Qo[Qo.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Qo[Qo.NONE=2]="NONE";var cs=function(){function e(n,r){kn(this,e),this.globalRuntime=void 0,this.context=void 0,this.inited=!1,this.stats={total:0,rendered:0},this.zIndexCounter=0,this.renderOrderChangedEvent=new qa(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new ai,dirtycheck:new ui,cull:new ui,beginFrame:new si,beforeRender:new si,render:new si,afterRender:new si,endFrame:new si,destroy:new si,pick:new oi,pickSync:new ui,pointerDown:new si,pointerUp:new si,pointerMove:new si,pointerOut:new si,pointerOver:new si,pointerWheel:new si,pointerCancel:new si,click:new si},this.globalRuntime=n,this.context=r}var n;return bn(e,[{key:"init",value:(n=gn(pn().mark((function t(){var e;return pn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=vn(vn({},this.globalRuntime),this.context),this.context.renderingPlugins.forEach((function(t){t.apply(e,Ss)})),t.next=4,this.hooks.init.promise();case 4:this.inited=!0;case 5:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"getStats",value:function(){return this.stats}},{key:"disableDirtyRectangleRendering",value:function(){return!this.context.config.renderer.getConfig().enableDirtyRectangleRendering||this.context.renderingContext.renderReasons.has(t.RenderReason.CAMERA_CHANGED)}},{key:"render",value:function(t,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())}},{key:"renderDisplayObject",value:function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=a?this.hooks.dirtycheck.call(t):t;if(s){var u=o?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 l=t.sortable,c=!1;l.dirty&&(l.sorted=t.childNodes.slice().sort(gr),c=!0,l.dirty=!1),(l.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)})),c&&t.forEach((function(t){r.renderOrderChangedEvent.target=t,r.renderOrderChangedEvent.detail={renderOrder:t.sortable.renderOrder},t.ownerDocument.defaultView.dispatchEvent(r.renderOrderChangedEvent,!0)}))}},{key:"destroy",value:function(){this.inited=!1,this.hooks.destroy.call(),this.globalRuntime.sceneGraphService.clearPendingEvents()}},{key:"dirtify",value:function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)}}]),e}(),hs=/\[\s*(.*)=(.*)\s*\]/,fs=function(){function t(){kn(this,t)}return bn(t,[{key:"selectOne",value: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,a=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):null}return e.find((function(n){return e!==n&&n.nodeName===t}))}},{key:"selectAll",value: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,a=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):[]}return e.findAll((function(n){return e!==n&&n.nodeName===t}))}},{key:"is",value: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}},{key:"getIdOrClassname",value:function(t){return t.substring(1)}},{key:"getAttribute",value: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}}},{key:"attributeToString",value:function(t,e){if(!t.getAttribute)return"";var n=t.getAttribute(e);return Jt(n)?"":n.toString?""+n:""}}]),t}();function ds(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var vs,ps,ys,ms=new to(t.ElementEvent.REPARENT,null,"","","",0,"",""),gs=function(){function e(n){var r,i,a,o,u,c,f,v,y=this;kn(this,e),this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new qa(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(r=J(),function(t,e){"number"==typeof e&&(e=D(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var i=J();it(i,e[0],e[1],e[2]);var a=y.getRotation(t),o=y.getRotation(t.parentNode);ft(r,o),rt(r,r),et(i,r,i),et(n.localRotation,i,a),vt(n.localRotation,n.localRotation),y.dirtifyLocal(t,n)}else y.rotateLocal(t,e)}),this.rotateLocal=(i=J(),function(t,e){"number"==typeof e&&(e=D(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;it(i,e[0],e[1],e[2]),dt(n.localRotation,n.localRotation,i),y.dirtifyLocal(t,n)}),this.setEulerAngles=(a=J(),function(t,e){"number"==typeof e&&(e=D(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){it(n.localRotation,e[0],e[1],e[2]);var r=y.getRotation(t.parentNode);ft(a,rt(J(),r)),dt(n.localRotation,n.localRotation,a),y.dirtifyLocal(t,n)}else y.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e){"number"==typeof e&&(e=D(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;H(e,L())||(function(t,e,n){var r=n[0],i=n[1],a=n[2],o=e[0],s=e[1],u=e[2],l=i*u-a*s,c=a*o-r*u,h=r*s-i*o,f=i*h-a*c,d=a*l-r*h,v=r*c-i*l,p=2*n[3];c*=p,h*=p,d*=2,v*=2,t[0]=o+(l*=p)+(f*=2),t[1]=s+c+d,t[2]=u+h+v}(e,e,n.localRotation),U(n.localPosition,n.localPosition,e),y.dirtifyLocal(t,n))},this.setPosition=(o=s(),u=L(),function(t,e){var n=t.transformable;u[0]=e[0],u[1]=e[1],u[2]=e[2]||0,H(y.getPosition(t),u)||(F(n.position,u),null!==t.parentNode&&t.parentNode.transformable?(l(o,t.parentNode.transformable.worldTransform),d(o,o),W(n.localPosition,u,o)):F(n.localPosition,u),y.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=L();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,H(r.localPosition,t)||(F(r.localPosition,t),y.dirtifyLocal(e,r))}}(),this.translate=(c=L(),f=L(),v=L(),function(t,e){"number"==typeof e&&(e=G(f,e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0)),H(e,c)||(U(v,y.getPosition(t),e),y.setPosition(t,v))}),this.setRotation=function(){var t=J();return function(e,n,r,i,a){var o=e.transformable;if("number"==typeof n&&(n=ht(n,r,i,a)),null!==e.parentNode&&e.parentNode.transformable){var s=y.getRotation(e.parentNode);ft(t,s),rt(t,t),et(o.localRotation,t,n),vt(o.localRotation,o.localRotation),y.dirtifyLocal(e,o)}else y.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=s(),e=L(),n=ht(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(P(r.localTransform,r.localRotation,r.localPosition,D(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=h(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),p(r.localTransform,r.localTransform,i)}var a=P(t,n,e,r.localScale,r.origin);p(r.localTransform,r.localTransform,a)}else P(r.localTransform,r.localRotation,r.localPosition,r.localScale,r.origin)}}(),this.runtime=n}return bn(e,[{key:"matches",value:function(t,e){return this.runtime.sceneGraphSelector.is(t,e)}},{key:"querySelector",value:function(t,e){return this.runtime.sceneGraphSelector.selectOne(t,e)}},{key:"querySelectorAll",value:function(t,e){return this.runtime.sceneGraphSelector.selectAll(t,e)}},{key:"attach",value:function(t,e,n){var r,i,a=!1;t.parentNode&&(a=t.parentNode!==e,this.detach(t)),t.parentNode=e,Jt(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 s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),a&&t.dispatchEvent(ms)}},{key:"detach",value: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 a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,1),r&&this.dirtifyWorld(t,r),t.parentNode=null}}},{key:"getOrigin",value:function(t){return t.transformable.origin}},{key:"setOrigin",value:function(t,e){"number"==typeof e&&(e=[e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0]);var n=t.transformable;if(e[0]!==n.origin[0]||e[1]!==n.origin[1]||e[2]!==n.origin[2]){var r=n.origin;r[0]=e[0],r[1]=e[1],r[2]=e[2]||0,this.dirtifyLocal(t,n)}}},{key:"setLocalEulerAngles",value:function(t,e){"number"==typeof e&&(e=D(e,arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,arguments.length>3&&void 0!==arguments[3]?arguments[3]:0));var n=t.transformable;it(n.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,n)}},{key:"scaleLocal",value:function(t,e){var n,r,i,a=t.transformable;n=a.localScale,r=a.localScale,i=D(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,a)}},{key:"setLocalScale",value:function(t,e){var n=t.transformable,r=D(e[0],e[1],e[2]||n.localScale[2]);H(r,n.localScale)||(F(n.localScale,r),this.dirtifyLocal(t,n))}},{key:"setLocalRotation",value:function(t,e,n,r,i){"number"==typeof e&&(e=ht(e,n,r,i));var a=t.transformable;ft(a.localRotation,e),this.dirtifyLocal(t,a)}},{key:"setLocalSkew",value:function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new a(2);return n[0]=t,n[1]=e,n}(e,n));var r,i,o=t.transformable;(r=o.localSkew)[0]=(i=e)[0],r[1]=i[1],this.dirtifyLocal(t,o)}},{key:"dirtifyLocal",value:function(t,e){e.localDirtyFlag||(e.localDirtyFlag=!0,e.dirtyFlag||this.dirtifyWorld(t,e))}},{key:"dirtifyWorld",value:function(t,e){e.dirtyFlag||this.unfreezeParentToRoot(t),this.dirtifyWorldInternal(t,e),this.dirtifyToRoot(t,!0)}},{key:"triggerPendingEvents",value: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.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):n.ownerDocument.defaultView.dispatchEvent(t.boundsChangedEvent,!0),e.add(n.entity))};this.pendingEvents.forEach((function(t){var e=An(t,2),r=e[0],i=e[1];i.affectChildren?r.forEach((function(t){n(t,i)})):n(r,i)})),this.clearPendingEvents(),e.clear()}},{key:"clearPendingEvents",value:function(){this.pendingEvents=[]}},{key:"dirtifyToRoot",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)ds(n),n=n.parentNode;e&&t.forEach((function(t){ds(t)})),this.informDependentDisplayObjects(t),this.pendingEvents.push([t,{affectChildren:e}])}},{key:"updateDisplayObjectDependency",value:function(t,e,n,r){if(e&&e!==n){var i=this.displayObjectDependencyMap.get(e);if(i&&i[t]){var a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[t].push(r)}}},{key:"informDependentDisplayObjects",value: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,!0),r.dispatchEvent(new to(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,to.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))}},{key:"getPosition",value:function(t){var e=t.transformable;return E(e.position,this.getWorldTransform(t,e))}},{key:"getRotation",value:function(t){var e=t.transformable;return S(e.rotation,this.getWorldTransform(t,e))}},{key:"getScale",value:function(t){var e=t.transformable;return T(e.scaling,this.getWorldTransform(t,e))}},{key:"getWorldTransform",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.transformable;return e.localDirtyFlag||e.dirtyFlag?(t.parentNode&&t.parentNode.transformable&&this.getWorldTransform(t.parentNode),this.sync(t,e),e.worldTransform):e.worldTransform}},{key:"getLocalPosition",value:function(t){return t.transformable.localPosition}},{key:"getLocalRotation",value:function(t){return t.transformable.localRotation}},{key:"getLocalScale",value:function(t){return t.transformable.localScale}},{key:"getLocalSkew",value:function(t){return t.transformable.localSkew}},{key:"getLocalTransform",value:function(t){var e=t.transformable;return e.localDirtyFlag&&(this.calcLocalTransform(e),e.localDirtyFlag=!1),e.localTransform}},{key:"setLocalTransform",value:function(t,e){var n=E(L(),e),r=S(J(),e),i=T(L(),e);this.setLocalScale(t,i),this.setLocalPosition(t,n),this.setLocalRotation(t,r)}},{key:"resetLocalTransform",value: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])}},{key:"getTransformedGeometryBounds",value:function(t){var e=arguments.length>2?arguments[2]:void 0,n=this.getGeometryBounds(t,arguments.length>1&&void 0!==arguments[1]&&arguments[1]);if(Ra.isEmpty(n))return null;var r=e||new Ra;return r.setFromTransformedAABB(n,this.getWorldTransform(t)),r}},{key:"getGeometryBounds",value:function(t){var e=t.geometry;return(arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e.renderBounds:e.contentBounds||null)||new Ra}},{key:"getBounds",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=t.renderable;if(!r.boundsDirty&&!n&&r.bounds)return r.bounds;if(!r.renderBoundsDirty&&n&&r.renderBounds)return r.renderBounds;var i=n?r.renderBounds:r.bounds,a=this.getTransformedGeometryBounds(t,n,i);if(t.childNodes.forEach((function(t){var r=e.getBounds(t,n);r&&(a?a.add(r):(a=i||new Ra).update(r.center,r.halfExtents))})),n){var o=kr(t);if(o){var s=o.parsedStyle.clipPath.getBounds(n);a?s&&(a=s.intersection(a)):a=s}}return a||(a=new Ra),a&&(n?r.renderBounds=a:r.bounds=a),n?r.renderBoundsDirty=!1:r.boundsDirty=!1,a}},{key:"getLocalBounds",value:function(t){if(t.parentNode){var e=s();t.parentNode.transformable&&(e=d(s(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!Ra.isEmpty(n)){var r=new Ra;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)}},{key:"getBoundingClientRect",value:function(t){var e,n,r,i=this.getGeometryBounds(t);Ra.isEmpty(i)||(r=new Ra).setFromTransformedAABB(i,this.getWorldTransform(t));var a=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var o=An(r.getMin(),2),s=o[0],u=o[1],l=An(r.getMax(),2);return new Da(s+((null==a?void 0:a.left)||0),u+((null==a?void 0:a.top)||0),l[0]-s,l[1]-u)}return new Da((null==a?void 0:a.left)||0,(null==a?void 0:a.top)||0,0,0)}},{key:"dirtifyWorldInternal",value: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)}}},{key:"syncHierarchy",value: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])}}},{key:"sync",value: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?p(e.worldTransform,r.worldTransform,e.localTransform):l(e.worldTransform,e.localTransform),e.dirtyFlag=!1}}},{key:"unfreezeParentToRoot",value:function(t){for(var e=t.parentNode;e;){var n=e.transformable;n&&(n.frozen=!1),e=e.parentNode}}}]),e}(),ks={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]},xs=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,bs=RegExp("".concat(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source,"|").concat(/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source,"|").concat(/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source,"|").concat(/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source)),Es=RegExp("".concat(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source,"|").concat(/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source,"|").concat(/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source,"|").concat(/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source)),Ts=function(){function t(e){var n=this;kn(this,t),this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,e){return!n.isBreakingSpace(e)&&!(!t||!Es.exec(e)&&!bs.exec(t))},this.trimByKinsokuShorui=function(t){var e=On(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=e}return bn(t,[{key:"measureFont",value: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 a=ks.MetricsString+ks.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(ks.BaselineSymbol).width),u=ks.HeightMultiplier*s;s=s*ks.BaselineMultiplier|0,r.width=o,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,o,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var l=i.getImageData(0,0,o||1,u||1).data,c=l.length,h=4*o,f=0,d=0,v=!1;for(f=0;s>f;++f){for(var p=0;h>p;p+=4)if(255!==l[d+p]){v=!0;break}if(v)break;d+=h}for(n.ascent=s-f,d=c-h,v=!1,f=u;f>s;--f){for(var y=0;h>y;y+=4)if(255!==l[d+y]){v=!0;break}if(v)break;d-=h}return n.descent=f-s,n.fontSize=n.ascent+n.descent,this.fontMetricsCache[t]=n,n}},{key:"measureText",value:function(t,e,n){var r=e.fontSize,i=e.wordWrap,a=e.lineHeight,o=e.lineWidth,s=e.textBaseline,u=e.textAlign,l=e.letterSpacing,c=e.textPath,h=e.leading,f=void 0===h?0:h,d=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,a=t.fontWeight,o=ue(e)&&"".concat(e,"px")||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var l=s[u].trim();!ci.test(l)&&0>li.indexOf(l)&&(l='"'.concat(l,'"')),s[u]=l}return"".concat(r," ").concat(i," ").concat(a," ").concat(o," ").concat(s.join(","))}(e),v=this.measureFont(d,n);0===v.fontSize&&(v.fontSize=r,v.ascent=r);var p=this.runtime.offscreenCanvas.getOrCreateContext(n);p.font=d,e.isOverflowing=!1;var y=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),m=Array(y.length),g=0;if(!c){for(var k=0;y.length>k;k++){var x=p.measureText(y[k]).width+(y[k].length-1)*l;m[k]=x,g=Math.max(g,x)}var b=g+o,E=a||v.fontSize+o,T=Math.max(E,v.fontSize+o)+(y.length-1)*(E+f),S=0;return"middle"===s?S=-T/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?S=-T:"top"!==s&&"hanging"!==s||(S=0),{font:d,width:b,height:T,lines:y,lineWidths:m,lineHeight:E+=f,maxLineWidth:g,fontProperties:v,lineMetrics:m.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new Da(n-o/2,S+e*E,t+o,E)}))}}c.getTotalLength();for(var P=0;y.length>P;P++)p.measureText(y[P])}},{key:"setGraphemeOnPath",value:function(){}},{key:"wordWrap",value:function(t,e,n){var r=this,i=e.wordWrapWidth,a=void 0===i?0:i,o=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,l=e.textOverflow,c=this.runtime.offscreenCanvas.getOrCreateContext(n),h=a+o,f="";"ellipsis"===l?f="...":l&&"clip"!==l&&(f=l);for(var d=[],v=0,p=0,y={},m=function(t){return r.getFromCache(t,o,y,c)},g=Array.from(f).reduce((function(t,e){return t+m(e)}),0),k=Array.from(t),x=0;k.length>x;x++){var b=k[x],E=t[x-1],T=t[x+1],S=m(b);if(this.isNewline(b)){if(++v>=u){e.isOverflowing=!0;break}p=0,d[v]=""}else{if(p>0&&p+S>h){if(v+1>=u){if(e.isOverflowing=!0,g>0&&h>=g){for(var P=d[v].length,M=0,w=P,N=0;P>N;N++){var C=m(d[v][N]);if(M+C+g>h){w=N;break}M+=C}d[v]=(d[v]||"").slice(0,w)+f}break}if(p=0,d[++v]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(d=this.trimToBreakable(d),p=this.sumTextWidthByCache(d[v]||"",y)),this.shouldBreakByKinsokuShorui(b,T)&&(d=this.trimByKinsokuShorui(d),p+=m(E||""))}p+=S,d[v]=(d[v]||"")+b}}return d.join("\n")}},{key:"isBreakingSpace",value:function(t){return"string"==typeof t&&ks.BreakingSpaces.indexOf(t.charCodeAt(0))>=0}},{key:"isNewline",value:function(t){return"string"==typeof t&&ks.Newlines.indexOf(t.charCodeAt(0))>=0}},{key:"trimToBreakable",value:function(t){var e=On(t),n=e[e.length-2],r=this.findBreakableIndex(n);if(-1===r||!n)return e;var i=n.slice(r,r+1),a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,a),e}},{key:"canBreakInLastChar",value:function(t){return!t||!xs.test(t)}},{key:"sumTextWidthByCache",value: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)}},{key:"findBreakableIndex",value:function(t){for(var e=t.length-1;e>=0;e--)if(!xs.test(t[e]))return e;return-1}},{key:"getFromCache",value:function(t,e,n,r){var i=n[t];if("number"!=typeof i){var a=t.length*e;i=r.measureText(t).width+a,n[t]=i}return i}}]),t}(),Ss={},Ps=(ps=new os,ys=new as,En(vs={},t.Shape.CIRCLE,new es),En(vs,t.Shape.ELLIPSE,new ns),En(vs,t.Shape.RECT,ps),En(vs,t.Shape.IMAGE,ps),En(vs,t.Shape.GROUP,ps),En(vs,t.Shape.LINE,new rs),En(vs,t.Shape.TEXT,new ss(Ss)),En(vs,t.Shape.POLYLINE,ys),En(vs,t.Shape.POLYGON,ys),En(vs,t.Shape.PATH,new is),En(vs,t.Shape.HTML,null),En(vs,t.Shape.MESH,null),vs),Ms=function(){var e,n=new xa,r=new Sa;return En(e={},t.PropertySyntax.PERCENTAGE,null),En(e,t.PropertySyntax.NUMBER,new Ca),En(e,t.PropertySyntax.ANGLE,new ga),En(e,t.PropertySyntax.DEFINED_PATH,new ka),En(e,t.PropertySyntax.PAINT,n),En(e,t.PropertySyntax.COLOR,n),En(e,t.PropertySyntax.FILTER,new ba),En(e,t.PropertySyntax.LENGTH,r),En(e,t.PropertySyntax.LENGTH_PERCENTAGE,r),En(e,t.PropertySyntax.LENGTH_PERCENTAGE_12,new Pa),En(e,t.PropertySyntax.LENGTH_PERCENTAGE_14,new Ma),En(e,t.PropertySyntax.COORDINATE,new wa),En(e,t.PropertySyntax.OFFSET_DISTANCE,new Aa),En(e,t.PropertySyntax.OPACITY_VALUE,new Oa),En(e,t.PropertySyntax.PATH,new Fa),En(e,t.PropertySyntax.LIST_OF_POINTS,new Ga),En(e,t.PropertySyntax.SHADOW_BLUR,new Ua),En(e,t.PropertySyntax.TEXT,new Ba),En(e,t.PropertySyntax.TEXT_TRANSFORM,new ja),En(e,t.PropertySyntax.TRANSFORM,new Va),En(e,t.PropertySyntax.TRANSFORM_ORIGIN,new Ya),En(e,t.PropertySyntax.Z_INDEX,new za),En(e,t.PropertySyntax.MARKER,new Na),e}();Ss.CameraContribution=ts,Ss.AnimationTimeline=null,Ss.EasingFunction=null,Ss.offscreenCanvas=new ls,Ss.nativeHTMLMap=new WeakMap,Ss.sceneGraphSelector=new fs,Ss.sceneGraphService=new gs(Ss),Ss.textService=new Ts(Ss),Ss.geometryUpdaterFactory=Ps,Ss.CSSPropertySyntaxFactory=Ms,Ss.styleValueRegistry=new Zo,Ss.layoutRegistry=null,Ss.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("Unable to locate global `this`")}(),Ss.enableCSSParsing=!0,Ss.enableDataset=!1,Ss.enableStyleSyntax=!0;var ws=function(){function t(){kn(this,t),this.context=void 0,this.plugins=[]}return bn(t,[{key:"addRenderingPlugin",value:function(t){this.plugins.push(t),this.context.renderingPlugins.push(t)}},{key:"removeAllRenderingPlugins",value: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}(),Ns=function(){function t(e){kn(this,t),this.plugins=[],this.config=void 0,this.config=vn({enableDirtyCheck:!0,enableCulling:!1,enableAutoRendering:!0,enableDirtyRectangleRendering:!0,enableDirtyRectangleRenderingDebug:!1},e)}return bn(t,[{key:"registerPlugin",value:function(t){-1===this.plugins.findIndex((function(e){return e===t}))&&this.plugins.push(t)}},{key:"unregisterPlugin",value:function(t){var e=this.plugins.findIndex((function(e){return e===t}));e>-1&&this.plugins.splice(e,1)}},{key:"getPlugins",value:function(){return this.plugins}},{key:"getPlugin",value:function(t){return this.plugins.find((function(e){return e.name===t}))}},{key:"getConfig",value:function(){return this.config}},{key:"setConfig",value:function(t){Object.assign(this.config,t)}}]),t}(),Cs=function(){function e(t){kn(this,e),this.strategies=void 0,this.strategies=t}return bn(e,[{key:"apply",value:function(n){var r=n.camera,i=n.renderingService,a=n.renderingContext,o=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===o.length?a.unculledEntities.indexOf(e.entity)>-1:o.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new qa(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))}}]),e}();Cs.tag="Culling";var As=function(){function t(){kn(this,t)}return bn(t,[{key:"apply",value: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}();As.tag="DirtyCheck";var Os=function(){function t(){var e=this;kn(this,t),this.autoPreventDefault=!1,this.rootPointerEvent=new so(null),this.rootWheelEvent=new uo(null),this.context=void 0,this.onPointerMove=function(t){var n,r,i=null===(n=e.context.renderingContext.root)||void 0===n||null===(r=n.ownerDocument)||void 0===r?void 0:r.defaultView;if(!i.supportsTouchEvents||"touch"!==t.pointerType){var a,o=In(e.normalizeToPointerEvent(t,i));try{for(o.s();!(a=o.n()).done;){var s=e.bootstrapEvent(e.rootPointerEvent,a.value,i,t);e.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}e.setCursor(e.context.eventService.cursor)}}}return bn(t,[{key:"apply",value:function(e){var n=this;this.context=e;var r=e.renderingService,i=this.context.renderingContext.root.ownerDocument.defaultView;this.context.eventService.setPickHandler((function(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),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();var r,a=In(e);try{for(a.s();!(r=a.n()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(o)}}catch(t){a.e(t)}finally{a.f()}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.context.contextService.getDomElement(),r="outside";try{r=e&&t.target&&t.target!==e&&e.contains&&!e.contains(t.target)?"outside":""}catch(t){}var a,o=In(n.normalizeToPointerEvent(t,i));try{for(o.s();!(a=o.n()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,a.value,i,t);s.type+=r,n.context.eventService.mapEvent(s)}}catch(t){o.e(t)}finally{o.f()}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),r.hooks.click.tap(t.tag,this.onPointerMove),r.hooks.pointerCancel.tap(t.tag,(function(t){var e,r=In(n.normalizeToPointerEvent(t,i));try{for(r.s();!(e=r.n()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);n.context.eventService.mapEvent(a)}}catch(t){r.e(t)}finally{r.f()}n.setCursor(n.context.eventService.cursor)}))}},{key:"getViewportXY",value:function(t){var e,n,r=t.offsetX,i=t.offsetY,a=t.clientX,o=t.clientY;if(!this.context.config.supportsCSSTransform||Jt(r)||Jt(i)){var s=this.context.eventService.client2Viewport(new _a(a,o));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}}},{key:"bootstrapEvent",value:function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,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 i=this.getViewportXY(e),a=i.y;t.viewport.x=i.x,t.viewport.y=a;var o=this.context.eventService.viewport2Canvas(t.viewport),s=o.y;return t.canvas.x=o.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=Tr[t.type]||t.type),t}},{key:"normalizeWheelEvent",value: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),a=i.y;return e.canvas.x=i.x,e.canvas.y=a,e.global.copyFrom(e.canvas),e.offset.copyFrom(e.canvas),e.nativeEvent=t,e.type=t.type,e}},{key:"transferMouseData",value: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}},{key:"setCursor",value:function(t){this.context.contextService.applyCursorStyle(t||this.context.config.cursor||"default")}},{key:"normalizeToPointerEvent",value:function(t,e){var n=[];if(e.isTouchEvent(t))for(var r=0;t.changedTouches.length>r;r++){var i=t.changedTouches[r];fe(i.button)&&(i.button=0),fe(i.buttons)&&(i.buttons=1),fe(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),fe(i.width)&&(i.width=i.radiusX||1),fe(i.height)&&(i.height=i.radiusY||1),fe(i.tiltX)&&(i.tiltX=0),fe(i.tiltY)&&(i.tiltY=0),fe(i.pointerType)&&(i.pointerType="touch"),fe(i.pointerId)&&(i.pointerId=i.identifier||0),fe(i.pressure)&&(i.pressure=i.force||.5),fe(i.twist)&&(i.twist=0),fe(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;fe(a.isPrimary)&&(a.isPrimary=!0),fe(a.width)&&(a.width=1),fe(a.height)&&(a.height=1),fe(a.tiltX)&&(a.tiltX=0),fe(a.tiltY)&&(a.tiltY=0),fe(a.pointerType)&&(a.pointerType="mouse"),fe(a.pointerId)&&(a.pointerId=1),fe(a.pressure)&&(a.pressure=.5),fe(a.twist)&&(a.twist=0),fe(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n}}]),t}();Os.tag="Event";var Rs,Ls=[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],Is=function(){function e(){kn(this,e)}return bn(e,[{key:"isVisible",value:function(e,n){var r,i,a=n.cullable;if(!a.enable)return!0;var o=n.getRenderBounds();if(Ra.isEmpty(o))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 a.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,o,u||t.Mask.INDETERMINATE,s.planes),a.visible=a.visibilityPlaneMask!==t.Mask.OUTSIDE,a.visible}},{key:"computeVisibilityWithPlaneMask",value:function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var a=t.Mask.INSIDE,o=Ls.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var l=1<<s;if(0!=(r&l)&&(!o||4!==s&&5!==s)){var c=i[s],h=c.normal,f=c.distance;if(0>Y(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>Y(h,n.getNegativeFarPoint(i[s]))+f&&(a|=l)}}return a}}]),e}(),_s=function(){function e(){kn(this,e),this.rBush=void 0,this.toSync=new Set}return bn(e,[{key:"apply",value:function(n){var r=this,i=n.renderingService,a=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var o=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;Ss.enableCSSParsing&&Ss.styleValueRegistry.recalc(e),Ss.sceneGraphService.dirtifyToRoot(e),i.dirtify()},l=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),Ss.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tapPromise(e.tag,gn(pn().mark((function e(){return pn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.addEventListener(t.ElementEvent.MOUNTED,u),a.addEventListener(t.ElementEvent.UNMOUNTED,l),a.addEventListener(t.ElementEvent.ATTR_MODIFIED,o),a.addEventListener(t.ElementEvent.BOUNDS_CHANGED,s);case 4:case"end":return e.stop()}}),e)})))),i.hooks.destroy.tap(e.tag,(function(){a.removeEventListener(t.ElementEvent.MOUNTED,u),a.removeEventListener(t.ElementEvent.UNMOUNTED,l),a.removeEventListener(t.ElementEvent.ATTR_MODIFIED,o),a.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,s),r.toSync.clear()})),i.hooks.endFrame.tap(e.tag,(function(){r.syncRTree()}))}},{key:"syncRTree",value: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 a=An(i.getMin(),2),o=a[0],s=a[1],u=An(i.getMax(),2),l=u[0],c=u[1];r.aabb||(r.aabb={}),r.aabb.displayObject=n,r.aabb.minX=o,r.aabb.minY=s,r.aabb.maxX=l,r.aabb.maxY=c}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}();_s.tag="Prepare",(Rs=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",Rs.BEFORE_RENDER="beforerender",Rs.RERENDER="rerender",Rs.AFTER_RENDER="afterrender",Rs.BEFORE_DESTROY="beforedestroy",Rs.AFTER_DESTROY="afterdestroy",Rs.RESIZE="resize",Rs.DIRTY_RECTANGLE="dirtyrectangle";var Ds=new qa(t.ElementEvent.MOUNTED),Fs=new qa(t.ElementEvent.UNMOUNTED),Gs=new qa(t.CanvasEvent.BEFORE_RENDER),Us=new qa(t.CanvasEvent.RERENDER),Bs=new qa(t.CanvasEvent.AFTER_RENDER),js=function(e){Tn(o,e);var n,i,a=Nn(o);function o(e){var n;kn(this,o),(n=a.call(this)).document=void 0,n.customElements=void 0,n.requestAnimationFrame=void 0,n.cancelAnimationFrame=void 0,n.devicePixelRatio=void 0,n.supportsPointerEvents=void 0,n.supportsTouchEvents=void 0,n.isTouchEvent=void 0,n.isMouseEvent=void 0,n.Element=xo,n.frameId=void 0,n.inited=!1,n.readyPromise=void 0,n.resolveReadyPromise=void 0,n.context={},n.document=new Ja,n.document.defaultView=wn(n),n.customElements=new Xa;var r=e.container,i=e.canvas,s=e.offscreenCanvas,u=e.width,l=e.height,c=e.devicePixelRatio,h=e.renderer,f=e.background,d=e.cursor,v=e.document,p=e.requestAnimationFrame,y=e.cancelAnimationFrame,m=e.createImage,g=e.supportsPointerEvents,k=e.supportsTouchEvents,x=e.supportsCSSTransform,b=e.useNativeClickEvent,E=e.alwaysTriggerPointerEventOnCanvas,T=e.isTouchEvent,S=e.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||yr++;pr[n]&&pr[n].destroy(),pr[n]=e}}(r,wn(n));var P=u,M=l,w=c;return i&&(w=1>(w=c||mr&&window.devicePixelRatio||1)?1:Math.ceil(w),P=u||function(t){var e=xr(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(i)||i.width/w,M=l||function(t){var e=xr(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(i)||i.height/w),n.devicePixelRatio=w,n.requestAnimationFrame=null!=p?p:xi.bind(Ss.globalThis),n.cancelAnimationFrame=null!=y?y:bi.bind(Ss.globalThis),n.supportsTouchEvents=null!=k?k:"ontouchstart"in Ss.globalThis,n.supportsPointerEvents=null!=g?g:!!Ss.globalThis.PointerEvent,n.isTouchEvent=null!=T?T:function(t){return n.supportsTouchEvents&&t instanceof Ss.globalThis.TouchEvent},n.isMouseEvent=null!=S?S:function(t){return!Ss.globalThis.MouseEvent||t instanceof Ss.globalThis.MouseEvent&&(!n.supportsPointerEvents||!(t instanceof Ss.globalThis.PointerEvent))},n.initRenderingContext({container:r,canvas:i,width:P,height:M,renderer:h,offscreenCanvas:s,devicePixelRatio:w,cursor:d||"default",background:f||"transparent",createImage:m,document:v,supportsCSSTransform:x,useNativeClickEvent:b,alwaysTriggerPointerEventOnCanvas:E}),n.initDefaultCamera(P,M),gn(pn().mark((function e(){return pn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.initRenderer(h);case 2:n.dispatchEvent(new qa(t.CanvasEvent.READY)),n.readyPromise&&n.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),n}return bn(o,[{key:"initRenderingContext",value:function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}}},{key:"initDefaultCamera",value:function(e,n){var r=this,i=new Ss.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($o.UPDATED,(function(){r.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.context.camera=i}},{key:"getConfig",value:function(){return this.context.config}},{key:"getRoot",value:function(){return this.document.documentElement}},{key:"getCamera",value:function(){return this.context.camera}},{key:"getContextService",value:function(){return this.context.contextService}},{key:"getEventService",value:function(){return this.context.eventService}},{key:"getRenderingService",value:function(){return this.context.renderingService}},{key:"getRenderingContext",value:function(){return this.context.renderingContext}},{key:"getStats",value:function(){return this.getRenderingService().getStats()}},{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}},{key:"destroy",value:function(){var e=0>=arguments.length||void 0===arguments[0]||arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(n||this.dispatchEvent(new qa(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),e&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),n||this.dispatchEvent(new qa(t.CanvasEvent.AFTER_DESTROY))}},{key:"changeSize",value:function(t,e){this.resize(t,e)}},{key:"resize",value:function(e,n){var r=this.context.config;r.width=e,r.height=n,this.getContextService().resize(e,n);var i=this.context.camera,a=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),a===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new qa(t.CanvasEvent.RESIZE,{width:e,height:n}))}},{key:"appendChild",value:function(t,e){return this.document.documentElement.appendChild(t,e)}},{key:"insertBefore",value:function(t,e){return this.document.documentElement.insertBefore(t,e)}},{key:"removeChild",value:function(t){return this.document.documentElement.removeChild(t)}},{key:"removeChildren",value:function(){this.document.documentElement.removeChildren()}},{key:"destroyChildren",value:function(){this.document.documentElement.destroyChildren()}},{key:"render",value:function(){var t=this;this.dispatchEvent(Gs),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(Us)})),this.dispatchEvent(Bs)}},{key:"run",value:function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()}},{key:"initRenderer",value:(i=gn(pn().mark((function t(e){return pn().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new r,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new Os,new _s,new As,new Cs([new Is])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(vn(vn({},Ss),this.context)),this.context.renderingService=new cs(Ss,this.context),this.context.eventService=new us(Ss,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)}))),function(t){return i.apply(this,arguments)})},{key:"loadRendererContainerModule",value:function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(Ss)}))}},{key:"setRenderer",value:(n=gn(pn().mark((function t(e){var n,r;return pn().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),On(null==r?void 0:r.getPlugins()).reverse().forEach((function(t){t.destroy(Ss)})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"setCursor",value:function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)}},{key:"unmountChildren",value:function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Fs):(Fs.target=t,this.dispatchEvent(Fs,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()}},{key:"mountChildren",value:function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(Ds):(Ds.target=t,this.dispatchEvent(Ds,!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()}},{key:"client2Viewport",value:function(t){return this.getEventService().client2Viewport(t)}},{key:"viewport2Client",value:function(t){return this.getEventService().viewport2Client(t)}},{key:"viewport2Canvas",value:function(t){return this.getEventService().viewport2Canvas(t)}},{key:"canvas2Viewport",value:function(t){return this.getEventService().canvas2Viewport(t)}},{key:"getPointByClient",value:function(t,e){return this.client2Viewport({x:t,y:e})}},{key:"getClientByPoint",value:function(t,e){return this.viewport2Client({x:t,y:e})}}]),o}(Ka);function Vs(t,n){for(var r=0;n.length>r;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(a=void 0,a=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i.key,"string"),"symbol"===e(a)?a:a+""),i)}var a}function Ys(t){return Ys=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Ys(t)}function zs(t,e){return zs=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},zs(t,e)}function Xs(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Ws(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=Ys(t);if(e){var i=Ys(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return Xs(this,n)}}var Hs=function(e){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&zs(t,e)}(o,e);var n,r,i,a=Ws(o);function o(){var t;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o);for(var e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];return(t=a.call.apply(a,[this].concat(n))).landmarks=[],t.landmarkAnimationID=void 0,t}return n=o,r=[{key:"rotate",value:function(e,n,r){if(this.relElevation=Nr(n),this.relAzimuth=Nr(e),this.relRoll=Nr(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=tt(J(),[1,0,0],Ar((this.rotateWorld?1:-1)*this.relElevation)),a=tt(J(),[0,1,0],Ar((this.rotateWorld?1:-1)*this.relAzimuth)),o=tt(J(),[0,0,1],Ar(this.relRoll)),u=et(J(),a,i);u=et(J(),u,o);var l=M(s(),u);y(this.matrix,this.matrix,[0,0,-this.distance]),p(this.matrix,this.matrix,l),y(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}},{key:"pan",value:function(t,e){var n=Cr(t,e,0),r=I(this.position);return U(r,r,j(L(),this.right,n[0])),U(r,r,j(L(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this}},{key:"dolly",value:function(e){var n,r=this.forward,i=I(this.position);return i[0]+=(n=Math.max(Math.min(this.distance+e*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*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&&U(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this}},{key:"cancelLandmarkAnimation",value:function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)}},{key:"createLandmark",value:function(t){var e,n,r,i,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.position,s=void 0===o?this.position:o,l=a.focalPoint,c=void 0===l?this.focalPoint:l,h=a.roll,f=a.zoom,d=new Ss.CameraContribution;d.setType(this.type,void 0),d.setPosition(s[0],null!==(e=s[1])&&void 0!==e?e:this.position[1],null!==(n=s[2])&&void 0!==n?n:this.position[2]),d.setFocalPoint(c[0],null!==(r=c[1])&&void 0!==r?r:this.focalPoint[1],null!==(i=c[2])&&void 0!==i?i:this.focalPoint[2]),d.setRoll(null!=h?h:this.roll),d.setZoom(null!=f?f:this.zoom);var v={name:t,matrix:u(d.getWorldTransform()),right:I(d.right),up:I(d.up),forward:I(d.forward),position:I(d.getPosition()),focalPoint:I(d.getFocalPoint()),distanceVector:I(d.getDistanceVector()),distance:d.getDistance(),dollyingStep:d.getDollyingStep(),azimuth:d.getAzimuth(),elevation:d.getElevation(),roll:d.getRoll(),relAzimuth:d.relAzimuth,relElevation:d.relElevation,relRoll:d.relRoll,zoom:d.getZoom()};return this.landmarks.push(v),v}},{key:"gotoLandmark",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=oe(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=ue(n)?{duration:n}:n,a=i.easing,o=void 0===a?"linear":a,s=i.duration,u=void 0===s?100:s,l=i.easingFunction,c=void 0===l?void 0:l,h=i.onfinish,f=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(r),void(f&&f());this.cancelLandmarkAnimation();var d,v=r.position,p=r.focalPoint,y=r.zoom,m=r.roll,g=c||Ss.EasingFunction(o),k=function(){e.setFocalPoint(p),e.setPosition(v),e.setRoll(m),e.setZoom(y),e.computeMatrix(),e.triggerUpdate(),f&&f()};this.canvas.requestAnimationFrame((function t(n){void 0===d&&(d=n);var r=n-d;if(r>u)k();else{var i,a,o=g(r/u),s=L(),l=L();X(s,e.focalPoint,p,o),X(l,e.position,v,o),a=e.roll*(1-o)+m*o,i=e.zoom*(1-o)+y*o,e.setFocalPoint(s),e.setPosition(l),e.setRoll(a),e.setZoom(i),K(s,p)+K(l,v)>.01||null!=y||null!=m?(e.computeMatrix(),e.triggerUpdate(),u>r&&(e.landmarkAnimationID=e.canvas.requestAnimationFrame(t))):k()}}))}}},{key:"syncFromLandmark",value:function(t){this.matrix=l(this.matrix,t.matrix),this.right=F(this.right,t.right),this.up=F(this.up,t.up),this.forward=F(this.forward,t.forward),this.position=F(this.position,t.position),this.focalPoint=F(this.focalPoint,t.focalPoint),this.distanceVector=F(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}}],r&&Vs(n.prototype,r),i&&Vs(n,i),Object.defineProperty(n,"prototype",{writable:!1}),o}(ts);function qs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ks(t,n){for(var r=0;n.length>r;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(a=void 0,a=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i.key,"string"),"symbol"===e(a)?a:a+""),i)}var a}function Zs(t,e,n){return e&&Ks(t.prototype,e),n&&Ks(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}Ss.CameraContribution=Hs;var Qs,$s,Js=function(){function t(e,n){qs(this,t),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=e,this.target=n}return Zs(t,null,[{key:"copy",value: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}(),tu=0,eu=new WeakMap,nu=function(){function e(t,n,r){qs(this,e),this.observer=void 0,this.target=void 0,this.options=void 0,this.transientObservedNodes=[],this.observer=t,this.target=n,this.options=r}return Zs(e,[{key:"enqueue",value:function(t){var e=this.observer.records,n=e.length;if(e.length>0){var r=function(t,e){return t===e?t:$s&&function(t){return t===$s||t===Qs}(t)?$s:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else su.push(this.observer),ou||(ou=!0,void 0!==Ss.globalThis?Ss.globalThis.setTimeout(uu):uu());e[n]=t}},{key:"addListeners",value:function(){this.addListeners_(this.target)}},{key:"addListeners_",value: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)}},{key:"removeListeners",value:function(){this.removeListeners_(this.target)}},{key:"removeListeners_",value: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)}},{key:"removeTransientObservers",value:function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach((function(t){this.removeListeners_(t);for(var e=eu.get(t),n=0;e.length>n;n++)if(e[n]===this){e.splice(n,1);break}}),this)}},{key:"handleEvent",value:function(e){var n,r;switch(e.stopImmediatePropagation(),e.type){case t.ElementEvent.ATTR_MODIFIED:var i=e.attrName,a=e.relatedNode.namespaceURI;(n=iu("attributes",r=e.target)).attributeName=i,n.attributeNamespace=a;var o=e.attrChange===to.ADDITION?null:e.prevValue;au(r,(function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(a)))return t.attributeOldValue?function(t){return $s||(($s=Js.copy(Qs)).oldValue=t,$s)}(o):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s,u,l=e.target;e.type===t.ElementEvent.INSERTED?(s=[l],u=[]):(s=[],u=[l]);var c=l.previousSibling,h=l.nextSibling;(n=iu("childList",r=e.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=c,n.nextSibling=h,au(r,(function(t){if(t.childList)return n}))}Qs=$s=void 0}}]),e}(),ru=function(){function t(e){qs(this,t),this.callback=void 0,this.nodes=[],this.records=[],this.uid=tu++,this.callback=e}return Zs(t,[{key:"observe",value: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=eu.get(t);r||eu.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 nu(this,t,e),r.push(n),this.nodes.push(t)),n.addListeners()}},{key:"disconnect",value:function(){var t=this;this.nodes.forEach((function(e){for(var n=eu.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=[]}},{key:"takeRecords",value:function(){var t=this.records;return this.records=[],t}}]),t}();function iu(t,e){return Qs=new Js(t,e)}function au(t,e){for(var n=t;n;n=n.parentNode){var r=eu.get(n);if(r)for(var i=0;r.length>i;i++){var a=r[i],o=a.options;if(n===t||o.subtree){var s=e(o);s&&a.enqueue(s)}}}}var ou=!1,su=[];function uu(){ou=!1;var t=su;su=[],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=eu.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&uu()}function lu(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function cu(t,n){for(var r=0;n.length>r;r++){var i=n[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(a=void 0,a=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,n||"default");if("object"!==e(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(i.key,"string"),"symbol"===e(a)?a:a+""),i)}var a}function hu(t,e,n){return e&&cu(t.prototype,e),n&&cu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function fu(t){return fu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},fu(t)}function du(t,e){return du=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},du(t,e)}function vu(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function pu(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,r=fu(t);if(e){var i=fu(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return vu(this,n)}}function yu(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a,o,s=[],u=!0,l=!1;try{if(a=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=a.call(n)).done)&&(s.push(r.value),s.length!==e);u=!0);}catch(t){l=!0,i=t}finally{try{if(!u&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(t,e)||gu(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mu(t){return function(t){if(Array.isArray(t))return ku(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||gu(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function gu(t,e){if(t){if("string"==typeof t)return ku(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)?ku(t,e):void 0}}function ku(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}var xu=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&du(t,e)}(n,t);var e=pu(n);function n(t,r,i,a){var o;return lu(this,n),(o=e.call(this,t)).currentTime=void 0,o.timelineTime=void 0,o.currentTime=i,o.timelineTime=a,o.target=r,o.type="finish",o.bubbles=!1,o.currentTarget=r,o.defaultPrevented=!1,o.eventPhase=o.AT_TARGET,o.timeStamp=Date.now(),o.currentTime=i,o.timelineTime=a,o}return hu(n)}(Ha),bu=0,Eu=function(){function t(e,n){var r;lu(this,t),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=e,e.animation=this,this.timeline=n,this.id="".concat(bu++),this._inEffect=!!this.effect.update(0),this._totalDuration=Number(null===(r=this.effect)||void 0===r?void 0:r.getComputedTiming().endTime),this._holdTime=0,this._paused=!1,this.oldPlayState="idle",this.updatePromises()}return hu(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(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(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(!isNaN(t=Number(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(),isNaN(t=Number(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}},{key:"updatePromises",value: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}},{key:"play",value: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()}},{key:"pause",value: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()}},{key:"finish",value: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())}},{key:"cancel",value:function(){var t=this;if(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(),this.oncancel)){var e=new xu(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}}},{key:"reverse",value:function(){this.updatePromises();var t=this.currentTime;this.playbackRate*=-1,this.play(),null!==t&&(this.currentTime=t),this.updatePromises()}},{key:"updatePlaybackRate",value:function(t){this.playbackRate=t}},{key:"targetAnimations",value:function(){var t;return(null===(t=this.effect)||void 0===t?void 0:t.target).getAnimations()}},{key:"markTarget",value:function(){var t=this.targetAnimations();-1===t.indexOf(this)&&t.push(this)}},{key:"unmarkTarget",value:function(){var t=this.targetAnimations(),e=t.indexOf(this);-1!==e&&t.splice(e,1)}},{key:"tick",value: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))}},{key:"rewind",value:function(){if(this.playbackRate<0){if(this._totalDuration>=1/0)throw Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}else this.currentTime=0}},{key:"persist",value:function(){throw Error(br)}},{key:"addEventListener",value:function(t,e,n){throw Error(br)}},{key:"removeEventListener",value:function(t,e,n){throw Error(br)}},{key:"dispatchEvent",value:function(t){throw Error(br)}},{key:"commitStyles",value:function(){throw Error(br)}},{key:"ensureAlive",value: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))}},{key:"tickCurrentTime",value:function(t,e){t!==this._currentTime&&(this._currentTime=t,this._isFinished&&!e&&(this._currentTime=this._playbackRate>0?this._totalDuration:0),this.ensureAlive())}},{key:"fireEvents",value:function(t){var e=this;if(this._isFinished){if(!this._finishedFlag){if(this.onfinish){var n=new xu(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 xu(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}}}]),t}(),Tu=.1,Su="function"==typeof Float32Array,Pu=function(t,e){return 1-3*e+3*t},Mu=function(t,e){return 3*e-6*t},wu=function(t){return 3*t},Nu=function(t,e,n){return((Pu(e,n)*t+Mu(e,n))*t+wu(e))*t},Cu=function(t,e,n){return 3*Pu(e,n)*t*t+2*Mu(e,n)*t+wu(e)},Au=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=Su?new Float32Array(11):[,,,,,,,,,,,],a=0;11>a;++a)i[a]=Nu(a*Tu,t,n);var o=function(e){for(var r=0,a=1;10!==a&&e>=i[a];++a)r+=Tu;--a;var o=r+(e-i[a])/(i[a+1]-i[a])*Tu,s=Cu(o,t,n);return.001>s?0===s?o:function(t,e,n,r,i){var a,o,s=0;do{(a=Nu(o=e+(n-e)/2,r,i)-t)>0?n=o:e=o}while(Math.abs(a)>1e-7&&10>++s);return o}(e,r,r+Tu,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var a=Cu(e,n,r);if(0===a)return e;e-=(Nu(e,n,r)-t)/a}return e}(e,o,t,n)};return function(t){return 0===t||1===t?t:Nu(o(t),e,r)}},Ou=function(t){return Math.pow(t,2)},Ru=function(t){return Math.pow(t,3)},Lu=function(t){return Math.pow(t,4)},Iu=function(t){return Math.pow(t,5)},_u=function(t){return Math.pow(t,6)},Du=function(t){return 1-Math.cos(t*Math.PI/2)},Fu=function(t){return 1-Math.sqrt(1-t*t)},Gu=function(t){return t*t*(3*t-2)},Uu=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)},Bu=function(t){var e=yu(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=e[1],i=void 0===r?.5:r,a=se(Number(void 0===n?1:n),1,10),o=se(Number(i),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin(2*Math.PI*(t-1-o/(2*Math.PI)*Math.asin(1/a))/o)},ju=function(t){var e=arguments.length>2?arguments[2]:void 0,n=yu(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4),r=n[0],i=void 0===r?1:r,a=n[1],o=void 0===a?100:a,s=n[2],u=void 0===s?10:s,l=n[3],c=void 0===l?0:l;i=se(i,.1,1e3),o=se(o,.1,1e3),u=se(u,.1,1e3),c=se(c,.1,1e3);var h=Math.sqrt(o/i),f=u/(2*Math.sqrt(o*i)),d=1>f?h*Math.sqrt(1-f*f):0,v=1>f?(f*h-c)/d:-c+h,p=e?e*t/1e3:t;return p=1>f?Math.exp(-p*f*h)*(1*Math.cos(d*p)+v*Math.sin(d*p)):(1+v*p)*Math.exp(-p*h),0===t||1===t?t:1-p},Vu=function(t){var e=yu(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],2),n=e[0],r=void 0===n?10:n;return("start"==e[1]?Math.ceil:Math.floor)(se(t,0,1)*r)/r},Yu=function(t){var e=yu(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],4);return Au(e[0],e[1],e[2],e[3])(t)},zu=Au(.42,0,1,1),Xu=function(t){return function(e){return 1-t(1-e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],arguments.length>2?arguments[2]:void 0)}},Wu=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return.5>e?t(2*e,n,r)/2:1-t(-2*e+2,n,r)/2}},Hu=function(t){return function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return.5>e?(1-t(1-2*e,n,r))/2:(t(2*e-1,n,r)+1)/2}},qu={steps:Vu,"step-start":function(t){return Vu(t,[1,"start"])},"step-end":function(t){return Vu(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":Yu,ease:function(t){return Yu(t,[.25,.1,.25,1])},in:zu,out:Xu(zu),"in-out":Wu(zu),"out-in":Hu(zu),"in-quad":Ou,"out-quad":Xu(Ou),"in-out-quad":Wu(Ou),"out-in-quad":Hu(Ou),"in-cubic":Ru,"out-cubic":Xu(Ru),"in-out-cubic":Wu(Ru),"out-in-cubic":Hu(Ru),"in-quart":Lu,"out-quart":Xu(Lu),"in-out-quart":Wu(Lu),"out-in-quart":Hu(Lu),"in-quint":Iu,"out-quint":Xu(Iu),"in-out-quint":Wu(Iu),"out-in-quint":Hu(Iu),"in-expo":_u,"out-expo":Xu(_u),"in-out-expo":Wu(_u),"out-in-expo":Hu(_u),"in-sine":Du,"out-sine":Xu(Du),"in-out-sine":Wu(Du),"out-in-sine":Hu(Du),"in-circ":Fu,"out-circ":Xu(Fu),"in-out-circ":Wu(Fu),"out-in-circ":Hu(Fu),"in-back":Gu,"out-back":Xu(Gu),"in-out-back":Wu(Gu),"out-in-back":Hu(Gu),"in-bounce":Uu,"out-bounce":Xu(Uu),"in-out-bounce":Wu(Uu),"out-in-bounce":Hu(Uu),"in-elastic":Bu,"out-elastic":Xu(Bu),"in-out-elastic":Wu(Bu),"out-in-elastic":Hu(Bu),spring:ju,"spring-in":ju,"spring-out":Xu(ju),"spring-in-out":Wu(ju),"spring-out-in":Hu(ju)},Ku=function(t){return qu[function(t){return function(t){return"-"===(t=t.replace(/([A-Z])/g,(function(t){return"-".concat(t.toLowerCase())}))).charAt(0)?t.substring(1):t}(t).replace(/^ease-/,"").replace(/(\(|\s).+/,"").toLowerCase().trim()}(t)]||qu.linear},Zu=function(t){return t},Qu=1,$u=.5,Ju=0;function tl(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var el="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",nl=RegExp("cubic-bezier\\("+el+","+el+","+el+","+el+"\\)"),rl=/steps\(\s*(\d+)\s*\)/,il=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function al(t){var e=nl.exec(t);if(e)return Au.apply(void 0,mu(e.slice(1).map(Number)));var n=rl.exec(t);if(n)return tl(Number(n[1]),Ju);var r=il.exec(t);return r?tl(Number(r[1]),{start:Qu,middle:$u,end:Ju}[r[2]]):Ku(t)}function ol(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))}var sl=0,ul=1,ll=2,cl=3;function hl(t,e,n){var r=function(t,e,n){if(null===e)return sl;var r=n.endTime;return Math.min(n.delay,r)>e?ul:Math.min(n.delay+t+n.endDelay,r)>e?cl:ll}(t,e,n),i=function(t,e,n,r,i){switch(r){case ul:return"backwards"===e||"both"===e?0:null;case cl:return n-i;case ll:return"forwards"===e||"both"===e?t:null;case sl:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var a="auto"===n.duration?0:n.duration,o=function(t,e,n,r,i){var a=i;return 0===t?e!==ul&&(a+=n):a+=r/t,a}(a,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,a){var o=t===1/0?e%1:t%1;return 0!==o||n!==ll||0===r||0===i&&0!==a||(o=1),o}(o,n.iterationStart,r,n.iterations,i,a),u=function(t,e,n,r){return t===ll&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,o),l=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=l,n.easingFunction(l)}function fl(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(dl(i)){var a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:al(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(a)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],a=0;i.length-1>a;a++){var o=a,s=a+1,u=i[o].computedOffset,l=i[s].computedOffset,c=u,h=l;0===a&&(c=-1/0,0===l&&(s=o)),a===i.length-2&&(h=1/0,1===u&&(o=s)),n.push({applyFrom:c,applyTo:h,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:r,interpolation:pl(r,i[o].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.setAttribute(n.property,n.interpolation(i))}));else for(var n in r)dl(n)&&t.setAttribute(n,null)}}function dl(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var vl=function(t,e,n){return function(r){var i=yl(t,e,r);return!Ss.enableCSSParsing&&ue(i)?i:n(i)}};function pl(t,e,n,r){var i=qo[t];if(i&&i.syntax&&i.int){var a=Ss.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var o,s;if(Ss.enableCSSParsing){var u=Ss.styleValueRegistry.parseProperty(t,e,r),l=Ss.styleValueRegistry.parseProperty(t,n,r);o=Ss.styleValueRegistry.computeProperty(t,u,r),s=Ss.styleValueRegistry.computeProperty(t,l,r)}else{var c=a.parserWithCSSDisabled;o=c?c(e,r):e,s=c?c(n,r):n}var h=a.mixer(o,s,r);if(h){var f=vl.apply(void 0,mu(h));return function(t){return 0===t?e:1===t?n:f(t)}}}}return vl(!1,!0,(function(t){return t?n:e}))}function yl(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)){for(var r=t.length,i=e.length,a=Math.max(r,i),o=[],s=0;a>s;s++)o.push(yl(t[r>s?s:r-1],e[i>s?s:i-1],n));return o}throw Error("Mismatched interpolation arguments "+t+":"+e)}var ml=function(){function t(){lu(this,t),this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Zu,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 hu(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=al(t),this._easing=t}}]),t}();function gl(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,a=0;i>a;a++){if(!e[a]){var o={};"offset"in t&&(o.offset=Number(t.offset)),"easing"in t&&(o.easing=t.easing),"composite"in t&&(o.composite=t.composite),e[a]=o}null!=r[a]&&(e[a][n]=r[a])}}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(!isFinite(i=Number(i)))throw Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw Error("".concat(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,a=0;n.length>a;a++){var o=n[a].offset;if(Jt(o))r=!1;else{if(i>o)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=o}}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,a=Number(n[0].computedOffset),o=1;r>o;o++){var s=n[o].computedOffset;if(!Jt(s)&&!Jt(a)){for(var u=1;o-i>u;u++)n[i+u].computedOffset=a+(Number(s)-a)*u/(o-i);i=o,a=Number(s)}}}(),n}var kl="backwards|forwards|both|none".split("|"),xl="reverse|alternate|alternate-reverse".split("|");function bl(t,e){var n=new ml;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===kl.indexOf(t[e]))return;if("direction"===e&&-1===xl.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function El(t,e){var n;return bl(t=Tl(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function Tl(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var Sl=function(){function t(e,n,r){var i=this;lu(this,t),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=e,this.timing=El(r,!1),this.timing.effect=this,this.timing.activeDuration=ol(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=gl(n,this.timing),this.interpolations=fl(this.normalizedKeyframes,this.timing,this.target);var a=Ss.globalThis.Proxy;this.computedTiming=a?new a(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?i.animation&&i.animation.currentTime||null:"currentIteration"===e?i.animation&&"running"===i.animation.playState?t.currentIteration||0:null:"progress"===e?i.animation&&"running"===i.animation.playState?t.progress||0:null:t[e]},set:function(){return!0}}):this.timing}return hu(t,[{key:"applyInterpolations",value:function(){this.interpolations(this.target,Number(this.timeFraction))}},{key:"update",value:function(t){return null!==t&&(this.timeFraction=hl(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)}},{key:"getKeyframes",value:function(){return this.normalizedKeyframes}},{key:"setKeyframes",value:function(t){this.normalizedKeyframes=gl(t)}},{key:"getComputedTiming",value:function(){return this.computedTiming}},{key:"getTiming",value:function(){return this.timing}},{key:"updateTiming",value:function(t){var e=this;Object.keys(t||{}).forEach((function(n){e.timing[n]=t[n]}))}}]),t}();function Pl(t,e){return Number(t.id)-Number(e.id)}var Ml=function(){function t(e){var n=this;lu(this,t),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){n.currentTime=t,n.discardAnimations(),0===n.animations.length?n.timelineTicking=!1:n.requestAnimationFrame(n.webAnimationsNextTick)},this.processRafCallbacks=function(t){var e=n.rafCallbacks;n.rafCallbacks=[],Number(n.currentTime)>t&&(t=Number(n.currentTime)),n.animations.sort(Pl),n.animations=n.tick(t,!0,n.animations)[0],e.forEach((function(e){e[1](t)})),n.applyPendingEffects()},this.document=e}return hu(t,[{key:"getAnimations",value:function(){return this.discardAnimations(),this.animations.slice()}},{key:"isTicking",value:function(){return this.inTick}},{key:"play",value:function(t,e,n){var r=new Sl(t,e,n),i=new Eu(r,this);return this.animations.push(i),this.restartWebAnimationsNextTick(),i.updatePromises(),i.play(),i.updatePromises(),i}},{key:"applyDirtiedAnimation",value:function(t){var e=this;if(!this.inTick){t.markTarget();var n=t.targetAnimations();n.sort(Pl),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()}}},{key:"restart",value:function(){return this.ticking||(this.ticking=!0,this.requestAnimationFrame((function(){})),this.hasRestartedThisFrame=!0),this.hasRestartedThisFrame}},{key:"destroy",value:function(){this.document.defaultView.cancelAnimationFrame(this.frameId)}},{key:"applyPendingEffects",value:function(){this.pendingEffects.forEach((function(t){null==t||t.applyInterpolations()})),this.pendingEffects=[]}},{key:"updateAnimationsPromises",value:function(){this.animationsWithPromises=this.animationsWithPromises.filter((function(t){return t.updatePromises()}))}},{key:"discardAnimations",value:function(){this.updateAnimationsPromises(),this.animations=this.animations.filter((function(t){return"finished"!==t.playState&&"idle"!==t.playState}))}},{key:"restartWebAnimationsNextTick",value:function(){this.timelineTicking||(this.timelineTicking=!0,this.requestAnimationFrame(this.webAnimationsNextTick))}},{key:"rAF",value: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}},{key:"requestAnimationFrame",value:function(t){var e=this;return this.rAF((function(n){e.updateAnimationsPromises(),t(n),e.updateAnimationsPromises()}))}},{key:"tick",value:function(t,e,n){var r,i,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var o=[],s=[],u=[],l=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(o.push(n.effect),n.unmarkTarget()),n._needsTick&&(a.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,o),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,l]}}]),t}();Ss.EasingFunction=al,Ss.AnimationTimeline=Ml,t.AABB=Ra,t.AbstractRenderer=Ns,t.AbstractRendererPlugin=ws,t.AdvancedCamera=Hs,t.Animation=Eu,t.AnimationEvent=xu,t.AnimationTimeline=Ml,t.BUILT_IN_PROPERTIES=Wo,t.CSS=ir,t.CSSGradientValue=zn,t.CSSKeywordValue=Xn,t.CSSRGB=rr,t.CSSStyleValue=Vn,t.CSSUnitValue=tr,t.Camera=ts,t.CameraEvent=$o,t.Canvas=js,t.Circle=Eo,t.CircleUpdater=es,t.CustomElement=So,t.CustomElementRegistry=Xa,t.CustomEvent=qa,t.DefaultSceneGraphSelector=fs,t.DefaultSceneGraphService=gs,t.DisplayObject=xo,t.Document=Ja,t.EMPTY_PARSED_PATH=Do,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=br,t.Element=ao,t.Ellipse=Mo,t.EllipseUpdater=ns,t.EventService=us,t.EventTarget=Ka,t.FederatedEvent=Ha,t.FederatedMouseEvent=oo,t.FederatedPointerEvent=so,t.FederatedWheelEvent=uo,t.Frustum=Ia,t.Group=No,t.HTML=Ao,t.Image=Ro,t.KeyframeEffect=Sl,t.Line=Io,t.LineUpdater=rs,t.MutationEvent=to,t.MutationObserver=ru,t.MutationRecord=Js,t.Node=Za,t.OffscreenCanvasCreator=ls,t.Path=Fo,t.PathUpdater=is,t.Plane=La,t.Point=_a,t.Polygon=Uo,t.Polyline=jo,t.PolylineUpdater=as,t.RBush=r,t.Rect=Yo,t.RectUpdater=os,t.Rectangle=Da,t.Registration=nu,t.RenderingService=cs,t.Text=Xo,t.TextService=Ts,t.TextUpdater=ss,t.compareAnimations=Pl,t.computeLinearGradient=function(t,e,n){var r=Ar(n.value),i=0+t/2,a=0+e/2,o=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*o/2,y1:a-Math.sin(r)*o/2,x2:i+Math.cos(r)*o/2,y2:a+Math.sin(r)*o/2}},t.computeRadialGradient=function(e,n,r,i,a){var o=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(o=r.value/100*e),i.unit===t.UnitType.kPercentage&&(s=i.value/100*n);var u=Math.max(Ft([0,0],[o,s]),Ft([0,n],[o,s]),Ft([e,n],[o,s]),Ft([e,0],[o,s]));return a&&(a instanceof tr?u=a.value:a instanceof Xn&&("closest-side"===a.value?u=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?u=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(u=Math.min(Ft([0,0],[o,s]),Ft([0,n],[o,s]),Ft([e,n],[o,s]),Ft([e,0],[o,s]))))),{x:o,y:s,r:u}},t.convertToPath=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e.getLocalTransform(),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 a=e.parsedStyle,o=a.r;r=ii(o,o,a.cx,a.cy);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=ii(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,l=u.width,c=u.height,h=u.x,f=u.y,d=u.radius,v=d&&d.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var a=An(i,4),o=a[0],s=a[1],u=a[2],l=a[3],c=t>0?1:-1,h=e>0?1:-1,f=c+h!==0?1:0;return[["M",c*o+n,r],["L",t-c*s+n,r],s?["A",s,s,0,0,f,t+n,h*s+r]:null,["L",t+n,e-h*u+r],u?["A",u,u,0,0,f,t+n-c*u,e+r]:null,["L",n+c*l,e+r],l?["A",l,l,0,0,f,n,e+r-h*l]:null,["L",n,h*o+r],o?["A",o,o,0,0,f,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"]]}(l,c,h,f,v&&d.map((function(t){return se(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/2))})));break;case t.Shape.PATH:r=On(e.parsedStyle.path.absolutePath)}if(r.length)return function(t,e,n){var r=e.parsedStyle,i=r.defX,a=void 0===i?0:i,o=r.defY,s=void 0===o?0:o;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=D(e[1]-a,e[2]-s,0);n&&W(i,i,n),r="".concat(e[0]).concat(i[0],",").concat(i[1])}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var o=D(e[1]-a,e[2]-s,0),u=D(e[3]-a,e[4]-s,0),l=D(e[5]-a,e[6]-s,0);n&&(W(o,o,n),W(u,u,n),W(l,l,n)),r="".concat(e[0]).concat(o[0],",").concat(o[1],",").concat(u[0],",").concat(u[1],",").concat(l[0],",").concat(l[1])}else if("A"===e[0]){var c=D(e[6]-a,e[7]-s,0);n&&W(c,c,n),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],",").concat(e[5],",").concat(c[0],",").concat(c[1])}else if("Q"===e[0]){var h=D(e[1]-a,e[2]-s,0),f=D(e[3]-a,e[4]-s,0);n&&(W(h,h,n),W(f,f,n)),r="".concat(e[0]).concat(e[1],",").concat(e[2],",").concat(e[3],",").concat(e[4],"}")}return t+r}),"")}(r,e,n)},t.createVec3=Cr,t.decompose=_r,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==An(t,2)[1]})))},t.deg2rad=Ar,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=kr,t.fromRotationTranslationScale=Ir,t.getAngle=Nr,t.getEuler=Lr,t.getOrCalculatePathTotalLength=Hr,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=mr,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=Oi,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=lo,t.isFederatedEvent=Wa,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=Ai,t.makeTiming=bl,t.mergeColors=Li,t.normalizeKeyframes=gl,t.normalizeTimingInput=El,t.numericTimingToObject=Tl,t.parseColor=Ri,t.parseLength=_i,t.parsePath=$i,t.parseTransform=oa,t.parsedTransformToMat4=Yr,t.propertyMetadataCache=qo,t.rad2deg=Or,t.resetEntityCounter=function(){eo=0},t.runtime=Ss,t.setDOMSize=function(t,e,n){mr&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:0,o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:0,s=t.map((function(s,u){var l=t[u+1],c=0===u&&(0!==r||0!==i),h=(u===t.length-1||l&&("M"===l[0]||"Z"===l[0]))&&0!==a&&0!==o;switch(s[0]){case"M":return c?"M ".concat(s[1]-e+r,",").concat(s[2]-n+i," L ").concat(s[1]-e,",").concat(s[2]-n):"M ".concat(s[1]-e,",").concat(s[2]-n);case"L":return"L ".concat(s[1]-e+(h?a:0),",").concat(s[2]-n+(h?o:0));case"Q":return"Q ".concat(s[1]-e," ").concat(s[2]-n,",").concat(s[3]-e," ").concat(s[4]-n)+(h?" L ".concat(s[3]-e+a,",").concat(s[4]-n+o):"");case"C":return"C ".concat(s[1]-e," ").concat(s[2]-n,",").concat(s[3]-e," ").concat(s[4]-n,",").concat(s[5]-e," ").concat(s[6]-n)+(h?" L ".concat(s[5]-e+a,",").concat(s[6]-n+o):"");case"A":return"A ".concat(s[1]," ").concat(s[2]," ").concat(s[3]," ").concat(s[4]," ").concat(s[5]," ").concat(s[6]-e," ").concat(s[7]-n)+(h?" L ".concat(s[6]-e+a,",").concat(s[7]-n+o):"");case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=Rr,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
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";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function e(t,e,n){return t(n={path:e,exports:{},require:function(t,e){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var n=e((function(t,e){t.exports=function(){function t(t,n,i,a,o){e(t,n,i||0,a||t.length-1,o||r)}function e(t,r,i,a,o){for(;a>i;){if(a-i>600){var s=a-i+1,u=r-i+1,l=Math.log(s),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(s-c)/s)*(0>u-s/2?-1:1);e(t,r,Math.max(i,Math.floor(r-u*c/s+h)),Math.min(a,Math.floor(r+(s-u)*c/s+h)),o)}var f=t[r],d=i,p=a;for(n(t,i,r),o(t[a],f)>0&&n(t,i,a);p>d;){for(n(t,d,p),d++,p--;0>o(t[d],f);)d++;for(;o(t[p],f)>0;)p--}0===o(t[i],f)?n(t,i,p):n(t,++p,a),p>r||(i=p+1),r>p||(a=p-1)}}function n(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function r(t,e){return e>t?-1:t>e?1:0}var i=function(t){void 0===t&&(t=9),this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(t,e,n){if(!n)return e.indexOf(t);for(var r=0;e.length>r;r++)if(n(t,e[r]))return r;return-1}function o(t,e){s(t,0,t.children.length,e,t)}function s(t,e,n,r,i){i||(i=g(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(var a=e;n>a;a++){var o=t.children[a];u(i,t.leaf?r(o):o)}return i}function u(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 c(t,e){return t.minY-e.minY}function h(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function f(t){return t.maxX-t.minX+(t.maxY-t.minY)}function d(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function p(t,e){var n=Math.max(t.minX,e.minX),r=Math.max(t.minY,e.minY),i=Math.min(t.maxX,e.maxX),a=Math.min(t.maxY,e.maxY);return Math.max(0,i-n)*Math.max(0,a-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 g(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(e,n,r,i,a){for(var o=[n,r];o.length;)if((r=o.pop())-(n=o.pop())>i){var s=n+Math.ceil((r-n)/i/2)*i;t(e,s,n,r,a),o.push(n,s,s,r)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(t){var e=this.data,n=[];if(!m(t,e))return n;for(var r=this.toBBox,i=[];e;){for(var a=0;e.children.length>a;a++){var o=e.children[a],s=e.leaf?r(o):o;m(t,s)&&(e.leaf?n.push(o):v(t,s)?this._all(o,n):i.push(o))}e=i.pop()}return n},i.prototype.collides=function(t){var e=this.data;if(!m(t,e))return!1;for(var n=[];e;){for(var r=0;e.children.length>r;r++){var i=e.children[r],a=e.leaf?this.toBBox(i):i;if(m(t,a)){if(e.leaf||v(t,a))return!0;n.push(i)}}e=n.pop()}return!1},i.prototype.load=function(t){if(!t||!t.length)return this;if(this._minEntries>t.length){for(var e=0;t.length>e;e++)this.insert(t[e]);return this}var n=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(n.height>this.data.height){var r=this.data;this.data=n,n=r}this._insert(n,this.data.height-n.height-1,!0)}else this.data=n;return this},i.prototype.insert=function(t){return t&&this._insert(t,this.data.height-1),this},i.prototype.clear=function(){return this.data=g([]),this},i.prototype.remove=function(t,e){if(!t)return this;for(var n,r,i,o=this.data,s=this.toBBox(t),u=[],l=[];o||u.length;){if(o||(o=u.pop(),r=u[u.length-1],n=l.pop(),i=!0),o.leaf){var c=a(t,o.children,e);if(-1!==c)return o.children.splice(c,1),u.push(o),this._condense(u),this}i||o.leaf||!v(o,s)?r?(n++,o=r.children[n],i=!1):o=null:(u.push(o),l.push(n),n=0,r=o,o=o.children[0])}return this},i.prototype.toBBox=function(t){return t},i.prototype.compareMinX=function(t,e){return t.minX-e.minX},i.prototype.compareMinY=function(t,e){return t.minY-e.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(t){return this.data=t,this},i.prototype._all=function(t,e){for(var n=[];t;)t.leaf?e.push.apply(e,t.children):n.push.apply(n,t.children),t=n.pop();return e},i.prototype._build=function(t,e,n,r){var i,a=n-e+1,s=this._maxEntries;if(s>=a)return o(i=g(t.slice(e,n+1)),this.toBBox),i;r||(s=Math.ceil(a/Math.pow(s,(r=Math.ceil(Math.log(a)/Math.log(s)))-1))),(i=g([])).leaf=!1,i.height=r;var u=Math.ceil(a/s),l=u*Math.ceil(Math.sqrt(s));y(t,e,n,l,this.compareMinX);for(var c=e;n>=c;c+=l){var h=Math.min(c+l-1,n);y(t,c,h,u,this.compareMinY);for(var f=c;h>=f;f+=u)i.children.push(this._build(t,f,Math.min(f+u-1,h),r-1))}return o(i,this.toBBox),i},i.prototype._chooseSubtree=function(t,e,n,r){for(;r.push(e),!e.leaf&&r.length-1!==n;){for(var i=1/0,a=1/0,o=void 0,s=0;e.children.length>s;s++){var u=e.children[s],l=h(u),c=d(t,u)-l;a>c?(a=c,i=i>l?l:i,o=u):c===a&&i>l&&(i=l,o=u)}e=o||e.children[0]}return e},i.prototype._insert=function(t,e,n){var r=n?t:this.toBBox(t),i=[],a=this._chooseSubtree(r,this.data,e,i);for(a.children.push(t),u(a,r);e>=0&&i[e].children.length>this._maxEntries;)this._split(i,e),e--;this._adjustParentBBoxes(r,i,e)},i.prototype._split=function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var a=this._chooseSplitIndex(n,i,r),s=g(n.children.splice(a,n.children.length-a));s.height=n.height,s.leaf=n.leaf,o(n,this.toBBox),o(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},i.prototype._splitRoot=function(t,e){this.data=g([t,e]),this.data.height=t.height+1,this.data.leaf=!1,o(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(t,e,n){for(var r,i=1/0,a=1/0,o=e;n-e>=o;o++){var u=s(t,0,o,this.toBBox),l=s(t,o,n,this.toBBox),c=p(u,l),f=h(u)+h(l);i>c?(i=c,r=o,a=a>f?f:a):c===i&&a>f&&(a=f,r=o)}return r||n-e},i.prototype._chooseSplitAxis=function(t,e,n){var r=t.leaf?this.compareMinX:l,i=t.leaf?this.compareMinY:c,a=this._allDistMargin(t,e,n,r);this._allDistMargin(t,e,n,i)>a&&t.children.sort(r)},i.prototype._allDistMargin=function(t,e,n,r){t.children.sort(r);for(var i=this.toBBox,a=s(t,0,e,i),o=s(t,n-e,n,i),l=f(a)+f(o),c=e;n-e>c;c++){var h=t.children[c];u(a,t.leaf?i(h):h),l+=f(a)}for(var d=n-e-1;d>=e;d--){var p=t.children[d];u(o,t.leaf?i(p):p),l+=f(o)}return l},i.prototype._adjustParentBBoxes=function(t,e,n){for(var r=n;r>=0;r--)u(e[r],t)},i.prototype._condense=function(t){for(var e=t.length-1,n=void 0;e>=0;e--)0===t[e].children.length?e>0?(n=t[e-1].children).splice(n.indexOf(t[e]),1):this.clear():o(t[e],this.toBBox)},i}()})),r=1e-6,i="undefined"!=typeof Float32Array?Float32Array:Array;function a(){var t=new i(9);return i!=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 o(){var t=new i(16);return i!=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 s(t){var e=new i(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 u(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 l(t,e,n,r,i,a,o,s,u,l,c,h,f,d,p,v,m){return t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=u,t[8]=l,t[9]=c,t[10]=h,t[11]=f,t[12]=d,t[13]=p,t[14]=v,t[15]=m,t}function c(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 h(t,e){if(t===e){var n=e[1],r=e[2],i=e[3],a=e[6],o=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]=a,t[11]=e[14],t[12]=i,t[13]=o,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 f(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15],y=n*s-r*o,x=n*u-i*o,E=n*l-a*o,b=r*u-i*s,T=r*l-a*s,M=i*l-a*u,S=c*v-h*p,P=c*m-f*p,w=c*g-d*p,k=h*m-f*v,N=h*g-d*v,C=f*g-d*m,A=y*C-x*N+E*k+b*w-T*P+M*S;return A?(t[0]=(s*C-u*N+l*k)*(A=1/A),t[1]=(i*N-r*C-a*k)*A,t[2]=(v*M-m*T+g*b)*A,t[3]=(f*T-h*M-d*b)*A,t[4]=(u*w-o*C-l*P)*A,t[5]=(n*C-i*w+a*P)*A,t[6]=(m*E-p*M-g*x)*A,t[7]=(c*M-f*E+d*x)*A,t[8]=(o*N-s*w+l*S)*A,t[9]=(r*w-n*N-a*S)*A,t[10]=(p*T-v*E+g*y)*A,t[11]=(h*E-c*T-d*y)*A,t[12]=(s*P-o*k-u*S)*A,t[13]=(n*k-r*P+i*S)*A,t[14]=(v*x-p*b-m*y)*A,t[15]=(c*b-h*x+f*y)*A,t):null}function d(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],v=t[14],m=t[15];return(e*o-n*a)*(h*m-f*v)-(e*s-r*a)*(c*m-f*p)+(e*u-i*a)*(c*v-h*p)+(n*s-r*o)*(l*m-f*d)-(n*u-i*o)*(l*v-h*d)+(r*u-i*s)*(l*p-c*d)}function p(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],v=e[12],m=e[13],g=e[14],y=e[15],x=n[0],E=n[1],b=n[2],T=n[3];return t[0]=x*r+E*s+b*h+T*v,t[1]=x*i+E*u+b*f+T*m,t[2]=x*a+E*l+b*d+T*g,t[3]=x*o+E*c+b*p+T*y,t[4]=(x=n[4])*r+(E=n[5])*s+(b=n[6])*h+(T=n[7])*v,t[5]=x*i+E*u+b*f+T*m,t[6]=x*a+E*l+b*d+T*g,t[7]=x*o+E*c+b*p+T*y,t[8]=(x=n[8])*r+(E=n[9])*s+(b=n[10])*h+(T=n[11])*v,t[9]=x*i+E*u+b*f+T*m,t[10]=x*a+E*l+b*d+T*g,t[11]=x*o+E*c+b*p+T*y,t[12]=(x=n[12])*r+(E=n[13])*s+(b=n[14])*h+(T=n[15])*v,t[13]=x*i+E*u+b*f+T*m,t[14]=x*a+E*l+b*d+T*g,t[15]=x*o+E*c+b*p+T*y,t}function v(t,e,n){var r,i,a,o,s,u,l,c,h,f,d,p,v=n[0],m=n[1],g=n[2];return e===t?(t[12]=e[0]*v+e[4]*m+e[8]*g+e[12],t[13]=e[1]*v+e[5]*m+e[9]*g+e[13],t[14]=e[2]*v+e[6]*m+e[10]*g+e[14],t[15]=e[3]*v+e[7]*m+e[11]*g+e[15]):(i=e[1],a=e[2],o=e[3],s=e[4],u=e[5],l=e[6],c=e[7],h=e[8],f=e[9],d=e[10],p=e[11],t[0]=r=e[0],t[1]=i,t[2]=a,t[3]=o,t[4]=s,t[5]=u,t[6]=l,t[7]=c,t[8]=h,t[9]=f,t[10]=d,t[11]=p,t[12]=r*v+s*m+h*g+e[12],t[13]=i*v+u*m+f*g+e[13],t[14]=a*v+l*m+d*g+e[14],t[15]=o*v+c*m+p*g+e[15]),t}function m(t,e,n){var r=n[0],i=n[1],a=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]*a,t[9]=e[9]*a,t[10]=e[10]*a,t[11]=e[11]*a,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function g(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[4],o=e[5],s=e[6],u=e[7],l=e[8],c=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]=a*i+l*r,t[5]=o*i+c*r,t[6]=s*i+h*r,t[7]=u*i+f*r,t[8]=l*i-a*r,t[9]=c*i-o*r,t[10]=h*i-s*r,t[11]=f*i-u*r,t}function y(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[8],c=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]=a*i-l*r,t[1]=o*i-c*r,t[2]=s*i-h*r,t[3]=u*i-f*r,t[8]=a*r+l*i,t[9]=o*r+c*i,t[10]=s*r+h*i,t[11]=u*r+f*i,t}function x(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 E(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=r+r,u=i+i,l=a+a,c=r*s,h=r*u,f=r*l,d=i*u,p=i*l,v=a*l,m=o*s,g=o*u,y=o*l;return t[0]=1-(d+v),t[1]=h+y,t[2]=f-g,t[3]=0,t[4]=h-y,t[5]=1-(c+v),t[6]=p+m,t[7]=0,t[8]=f+g,t[9]=p-m,t[10]=1-(c+d),t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t}function b(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function T(t,e){var n=e[4],r=e[5],i=e[6],a=e[8],o=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(a,o,s),t}function M(t,e){var n=new i(3);T(n,e);var r=1/n[0],a=1/n[1],o=1/n[2],s=e[0]*r,u=e[1]*a,l=e[2]*o,c=e[4]*r,h=e[5]*a,f=e[6]*o,d=e[8]*r,p=e[9]*a,v=e[10]*o,m=s+h+v,g=0;return m>0?(t[3]=.25*(g=2*Math.sqrt(m+1)),t[0]=(f-p)/g,t[1]=(d-l)/g,t[2]=(u-c)/g):s>h&&s>v?(t[3]=(f-p)/(g=2*Math.sqrt(1+s-h-v)),t[0]=.25*g,t[1]=(u+c)/g,t[2]=(d+l)/g):h>v?(t[3]=(d-l)/(g=2*Math.sqrt(1+h-s-v)),t[0]=(u+c)/g,t[1]=.25*g,t[2]=(f+p)/g):(t[3]=(u-c)/(g=2*Math.sqrt(1+v-s-h)),t[0]=(d+l)/g,t[1]=(f+p)/g,t[2]=.25*g),t}function S(t,e,n,r,i){var a=e[0],o=e[1],s=e[2],u=e[3],l=a+a,c=o+o,h=s+s,f=a*l,d=a*c,p=a*h,v=o*c,m=o*h,g=s*h,y=u*l,x=u*c,E=u*h,b=r[0],T=r[1],M=r[2],S=i[0],P=i[1],w=i[2],k=(1-(v+g))*b,N=(d+E)*b,C=(p-x)*b,A=(d-E)*T,O=(1-(f+g))*T,R=(m+y)*T,L=(p+x)*M,I=(m-y)*M,_=(1-(f+v))*M;return t[0]=k,t[1]=N,t[2]=C,t[3]=0,t[4]=A,t[5]=O,t[6]=R,t[7]=0,t[8]=L,t[9]=I,t[10]=_,t[11]=0,t[12]=n[0]+S-(k*S+A*P+L*w),t[13]=n[1]+P-(N*S+O*P+I*w),t[14]=n[2]+w-(C*S+R*P+_*w),t[15]=1,t}function P(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n+n,s=r+r,u=i+i,l=n*o,c=r*o,h=r*s,f=i*o,d=i*s,p=i*u,v=a*o,m=a*s,g=a*u;return t[0]=1-h-p,t[1]=c+g,t[2]=f-m,t[3]=0,t[4]=c-g,t[5]=1-l-p,t[6]=d+v,t[7]=0,t[8]=f+m,t[9]=d-v,t[10]=1-l-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function w(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,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)*(a=1/(r-i)),t[14]=2*i*r*a):(t[10]=-1,t[14]=-2*r),t}function k(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);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*l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=(o+a)*l,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 N=k;function C(t,e,n,i){var a,o,s,u,l,h,f,d,p,v,m=e[0],g=e[1],y=e[2],x=i[0],E=i[1],b=i[2],T=n[0],M=n[1],S=n[2];return r>Math.abs(m-T)&&r>Math.abs(g-M)&&r>Math.abs(y-S)?c(t):(v=1/Math.hypot(f=m-T,d=g-M,p=y-S),(v=Math.hypot(a=E*(p*=v)-b*(d*=v),o=b*(f*=v)-x*p,s=x*d-E*f))?(a*=v=1/v,o*=v,s*=v):(a=0,o=0,s=0),(v=Math.hypot(u=d*s-p*o,l=p*a-f*s,h=f*o-d*a))?(u*=v=1/v,l*=v,h*=v):(u=0,l=0,h=0),t[0]=a,t[1]=u,t[2]=f,t[3]=0,t[4]=o,t[5]=l,t[6]=d,t[7]=0,t[8]=s,t[9]=h,t[10]=p,t[11]=0,t[12]=-(a*m+o*g+s*y),t[13]=-(u*m+l*g+h*y),t[14]=-(f*m+d*g+p*y),t[15]=1,t)}function A(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 O=Object.freeze({__proto__:null,create:o,clone:s,copy:u,fromValues:function(t,e,n,r,a,o,s,u,l,c,h,f,d,p,v,m){var g=new i(16);return g[0]=t,g[1]=e,g[2]=n,g[3]=r,g[4]=a,g[5]=o,g[6]=s,g[7]=u,g[8]=l,g[9]=c,g[10]=h,g[11]=f,g[12]=d,g[13]=p,g[14]=v,g[15]=m,g},set:l,identity:c,transpose:h,invert:f,adjoint:function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=e[4],s=e[5],u=e[6],l=e[7],c=e[8],h=e[9],f=e[10],d=e[11],p=e[12],v=e[13],m=e[14],g=e[15];return t[0]=s*(f*g-d*m)-h*(u*g-l*m)+v*(u*d-l*f),t[1]=-(r*(f*g-d*m)-h*(i*g-a*m)+v*(i*d-a*f)),t[2]=r*(u*g-l*m)-s*(i*g-a*m)+v*(i*l-a*u),t[3]=-(r*(u*d-l*f)-s*(i*d-a*f)+h*(i*l-a*u)),t[4]=-(o*(f*g-d*m)-c*(u*g-l*m)+p*(u*d-l*f)),t[5]=n*(f*g-d*m)-c*(i*g-a*m)+p*(i*d-a*f),t[6]=-(n*(u*g-l*m)-o*(i*g-a*m)+p*(i*l-a*u)),t[7]=n*(u*d-l*f)-o*(i*d-a*f)+c*(i*l-a*u),t[8]=o*(h*g-d*v)-c*(s*g-l*v)+p*(s*d-l*h),t[9]=-(n*(h*g-d*v)-c*(r*g-a*v)+p*(r*d-a*h)),t[10]=n*(s*g-l*v)-o*(r*g-a*v)+p*(r*l-a*s),t[11]=-(n*(s*d-l*h)-o*(r*d-a*h)+c*(r*l-a*s)),t[12]=-(o*(h*m-f*v)-c*(s*m-u*v)+p*(s*f-u*h)),t[13]=n*(h*m-f*v)-c*(r*m-i*v)+p*(r*f-i*h),t[14]=-(n*(s*m-u*v)-o*(r*m-i*v)+p*(r*u-i*s)),t[15]=n*(s*f-u*h)-o*(r*f-i*h)+c*(r*u-i*s),t},determinant:d,multiply:p,translate:v,scale:m,rotate:function(t,e,n,i){var a,o,s,u,l,c,h,f,d,p,v,m,g,y,x,E,b,T,M,S,P,w,k,N,C=i[0],A=i[1],O=i[2],R=Math.hypot(C,A,O);return r>R?null:(C*=R=1/R,A*=R,O*=R,a=Math.sin(n),l=e[1],c=e[2],h=e[3],d=e[5],p=e[6],v=e[7],g=e[9],y=e[10],x=e[11],M=C*A*(s=1-(o=Math.cos(n)))-O*a,S=A*A*s+o,P=O*A*s+C*a,w=C*O*s+A*a,k=A*O*s-C*a,N=O*O*s+o,t[0]=(u=e[0])*(E=C*C*s+o)+(f=e[4])*(b=A*C*s+O*a)+(m=e[8])*(T=O*C*s-A*a),t[1]=l*E+d*b+g*T,t[2]=c*E+p*b+y*T,t[3]=h*E+v*b+x*T,t[4]=u*M+f*S+m*P,t[5]=l*M+d*S+g*P,t[6]=c*M+p*S+y*P,t[7]=h*M+v*S+x*P,t[8]=u*w+f*k+m*N,t[9]=l*w+d*k+g*N,t[10]=c*w+p*k+y*N,t[11]=h*w+v*k+x*N,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)},rotateX:g,rotateY:y,rotateZ:function(t,e,n){var r=Math.sin(n),i=Math.cos(n),a=e[0],o=e[1],s=e[2],u=e[3],l=e[4],c=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]=a*i+l*r,t[1]=o*i+c*r,t[2]=s*i+h*r,t[3]=u*i+f*r,t[4]=l*i-a*r,t[5]=c*i-o*r,t[6]=h*i-s*r,t[7]=f*i-u*r,t},fromTranslation:x,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 i,a,o,s=n[0],u=n[1],l=n[2],c=Math.hypot(s,u,l);return r>c?null:(s*=c=1/c,u*=c,l*=c,i=Math.sin(e),t[0]=s*s*(o=1-(a=Math.cos(e)))+a,t[1]=u*s*o+l*i,t[2]=l*s*o-u*i,t[3]=0,t[4]=s*u*o-l*i,t[5]=u*u*o+a,t[6]=l*u*o+s*i,t[7]=0,t[8]=s*l*o+u*i,t[9]=u*l*o-s*i,t[10]=l*l*o+a,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:E,fromQuat2:function(t,e){var n=new i(3),r=-e[0],a=-e[1],o=-e[2],s=e[3],u=e[4],l=e[5],c=e[6],h=e[7],f=r*r+a*a+o*o+s*s;return f>0?(n[0]=2*(u*s+h*r+l*o-c*a)/f,n[1]=2*(l*s+h*a+c*r-u*o)/f,n[2]=2*(c*s+h*o+u*a-l*r)/f):(n[0]=2*(u*s+h*r+l*o-c*a),n[1]=2*(l*s+h*a+c*r-u*o),n[2]=2*(c*s+h*o+u*a-l*r)),E(t,e,n),t},getTranslation:b,getScaling:T,getRotation:M,fromRotationTranslationScale:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=e[3],u=i+i,l=a+a,c=o+o,h=i*u,f=i*l,d=i*c,p=a*l,v=a*c,m=o*c,g=s*u,y=s*l,x=s*c,E=r[0],b=r[1],T=r[2];return t[0]=(1-(p+m))*E,t[1]=(f+x)*E,t[2]=(d-y)*E,t[3]=0,t[4]=(f-x)*b,t[5]=(1-(h+m))*b,t[6]=(v+g)*b,t[7]=0,t[8]=(d+y)*T,t[9]=(v-g)*T,t[10]=(1-(h+p))*T,t[11]=0,t[12]=n[0],t[13]=n[1],t[14]=n[2],t[15]=1,t},fromRotationTranslationScaleOrigin:S,fromQuat:P,frustum:function(t,e,n,r,i,a,o){var s=1/(n-e),u=1/(i-r),l=1/(a-o);return t[0]=2*a*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=2*a*u,t[6]=0,t[7]=0,t[8]=(n+e)*s,t[9]=(i+r)*u,t[10]=(o+a)*l,t[11]=-1,t[12]=0,t[13]=0,t[14]=o*a*2*l,t[15]=0,t},perspectiveNO:w,perspective:w,perspectiveZO:function(t,e,n,r,i){var a,o=1/Math.tan(e/2);return t[0]=o/n,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=o,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*(a=1/(r-i)),t[14]=i*r*a):(t[10]=-1,t[14]=-r),t},perspectiveFromFieldOfView:function(t,e,n,r){var i=Math.tan(e.upDegrees*Math.PI/180),a=Math.tan(e.downDegrees*Math.PI/180),o=Math.tan(e.leftDegrees*Math.PI/180),s=Math.tan(e.rightDegrees*Math.PI/180),u=2/(o+s),l=2/(i+a);return t[0]=u,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=l,t[6]=0,t[7]=0,t[8]=-(o-s)*u*.5,t[9]=(i-a)*l*.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:k,ortho:N,orthoZO:function(t,e,n,r,i,a,o){var s=1/(e-n),u=1/(r-i),l=1/(a-o);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]=l,t[11]=0,t[12]=(e+n)*s,t[13]=(i+r)*u,t[14]=a*l,t[15]=1,t},lookAt:C,targetTo:function(t,e,n,r){var i=e[0],a=e[1],o=e[2],s=r[0],u=r[1],l=r[2],c=i-n[0],h=a-n[1],f=o-n[2],d=c*c+h*h+f*f;d>0&&(c*=d=1/Math.sqrt(d),h*=d,f*=d);var p=u*f-l*h,v=l*c-s*f,m=s*h-u*c;return(d=p*p+v*v+m*m)>0&&(p*=d=1/Math.sqrt(d),v*=d,m*=d),t[0]=p,t[1]=v,t[2]=m,t[3]=0,t[4]=h*m-f*v,t[5]=f*p-c*m,t[6]=c*v-h*p,t[7]=0,t[8]=c,t[9]=h,t[10]=f,t[11]=0,t[12]=i,t[13]=a,t[14]=o,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:A,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],i=t[1],a=t[2],o=t[3],s=t[4],u=t[5],l=t[6],c=t[7],h=t[8],f=t[9],d=t[10],p=t[11],v=t[12],m=t[13],g=t[14],y=t[15],x=e[0],E=e[1],b=e[2],T=e[3],M=e[4],S=e[5],P=e[6],w=e[7],k=e[8],N=e[9],C=e[10],A=e[11],O=e[12],R=e[13],L=e[14],I=e[15];return!(Math.abs(n-x)>r*Math.max(1,Math.abs(n),Math.abs(x))||Math.abs(i-E)>r*Math.max(1,Math.abs(i),Math.abs(E))||Math.abs(a-b)>r*Math.max(1,Math.abs(a),Math.abs(b))||Math.abs(o-T)>r*Math.max(1,Math.abs(o),Math.abs(T))||Math.abs(s-M)>r*Math.max(1,Math.abs(s),Math.abs(M))||Math.abs(u-S)>r*Math.max(1,Math.abs(u),Math.abs(S))||Math.abs(l-P)>r*Math.max(1,Math.abs(l),Math.abs(P))||Math.abs(c-w)>r*Math.max(1,Math.abs(c),Math.abs(w))||Math.abs(h-k)>r*Math.max(1,Math.abs(h),Math.abs(k))||Math.abs(f-N)>r*Math.max(1,Math.abs(f),Math.abs(N))||Math.abs(d-C)>r*Math.max(1,Math.abs(d),Math.abs(C))||Math.abs(p-A)>r*Math.max(1,Math.abs(p),Math.abs(A))||Math.abs(v-O)>r*Math.max(1,Math.abs(v),Math.abs(O))||Math.abs(m-R)>r*Math.max(1,Math.abs(m),Math.abs(R))||Math.abs(g-L)>r*Math.max(1,Math.abs(g),Math.abs(L))||Math.abs(y-I)>r*Math.max(1,Math.abs(y),Math.abs(I)))},mul:p,sub:A});function R(){var t=new i(3);return i!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function L(t){var e=new i(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function I(t){return Math.hypot(t[0],t[1],t[2])}function _(t,e,n){var r=new i(3);return r[0]=t,r[1]=e,r[2]=n,r}function D(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function F(t,e,n,r){return t[0]=e,t[1]=n,t[2]=r,t}function G(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function U(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function B(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function V(t,e){var n=e[0],r=e[1],i=e[2],a=n*n+r*r+i*i;return a>0&&(a=1/Math.sqrt(a)),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a,t}function j(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Y(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[0],s=n[1],u=n[2];return t[0]=i*u-a*s,t[1]=a*o-r*u,t[2]=r*s-i*o,t}function z(t,e,n,r){var i=e[0],a=e[1],o=e[2];return t[0]=i+r*(n[0]-i),t[1]=a+r*(n[1]-a),t[2]=o+r*(n[2]-o),t}function X(t,e,n){var r=e[0],i=e[1],a=e[2],o=n[3]*r+n[7]*i+n[11]*a+n[15];return t[0]=(n[0]*r+n[4]*i+n[8]*a+n[12])/(o=o||1),t[1]=(n[1]*r+n[5]*i+n[9]*a+n[13])/o,t[2]=(n[2]*r+n[6]*i+n[10]*a+n[14])/o,t}function W(t,e){var n=t[0],i=t[1],a=t[2],o=e[0],s=e[1],u=e[2];return r*Math.max(1,Math.abs(n),Math.abs(o))>=Math.abs(n-o)&&r*Math.max(1,Math.abs(i),Math.abs(s))>=Math.abs(i-s)&&r*Math.max(1,Math.abs(a),Math.abs(u))>=Math.abs(a-u)}var H,q=function(t,e){return Math.hypot(e[0]-t[0],e[1]-t[1],e[2]-t[2])},K=I;H=R();function Z(){var t=new i(4);return i!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function Q(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3];return t[0]=n[0]*r+n[4]*i+n[8]*a+n[12]*o,t[1]=n[1]*r+n[5]*i+n[9]*a+n[13]*o,t[2]=n[2]*r+n[6]*i+n[10]*a+n[14]*o,t[3]=n[3]*r+n[7]*i+n[11]*a+n[15]*o,t}!function(){var t=Z()}();function $(){var t=new i(4);return i!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function J(t,e,n){var r=Math.sin(n*=.5);return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=Math.cos(n),t}function tt(t,e,n){var r=e[0],i=e[1],a=e[2],o=e[3],s=n[0],u=n[1],l=n[2],c=n[3];return t[0]=r*c+o*s+i*l-a*u,t[1]=i*c+o*u+a*s-r*l,t[2]=a*c+o*l+r*u-i*s,t[3]=o*c-r*s-i*u-a*l,t}function et(t,e,n,i){var a,o,s,u,l,c=e[0],h=e[1],f=e[2],d=e[3],p=n[0],v=n[1],m=n[2],g=n[3];return 0>(o=c*p+h*v+f*m+d*g)&&(o=-o,p=-p,v=-v,m=-m,g=-g),1-o>r?(s=Math.sin(a=Math.acos(o)),u=Math.sin((1-i)*a)/s,l=Math.sin(i*a)/s):(u=1-i,l=i),t[0]=u*c+l*p,t[1]=u*h+l*v,t[2]=u*f+l*m,t[3]=u*d+l*g,t}function nt(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a,s=o?1/o:0;return t[0]=-n*s,t[1]=-r*s,t[2]=-i*s,t[3]=a*s,t}function rt(t,e,n,r){var i=.5*Math.PI/180;n*=i,r*=i;var a=Math.sin(e*=i),o=Math.cos(e),s=Math.sin(n),u=Math.cos(n),l=Math.sin(r),c=Math.cos(r);return t[0]=a*u*c-o*s*l,t[1]=o*s*c+a*u*l,t[2]=o*u*l-a*s*c,t[3]=o*u*c+a*s*l,t}var it,at,ot,st,ut,lt,ct=function(t,e,n,r){var a=new i(4);return a[0]=t,a[1]=e,a[2]=n,a[3]=r,a},ht=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t},ft=tt,dt=function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=n*n+r*r+i*i+a*a;return o>0&&(o=1/Math.sqrt(o)),t[0]=n*o,t[1]=r*o,t[2]=i*o,t[3]=a*o,t};it=R(),at=_(1,0,0),ot=_(0,1,0),st=$(),ut=$(),lt=a();!function(){var t,e=(t=new i(2),i!=Float32Array&&(t[0]=0,t[1]=0),t)}();function pt(t){return t.map((function(t){return Array.isArray(t)?[].concat(t):t}))}var vt=function(){return vt=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},vt.apply(this,arguments)},mt={x1:0,y1:0,x2:0,y2:0,x:0,y:0,qx:null,qy:null};function gt(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 yt={a:7,c:6,h:1,l:2,m:2,r:4,q:4,s:4,t:2,v:1,z:0};function xt(t){return Array.isArray(t)&&t.every((function(t){var e=t[0].toLowerCase();return yt[e]===t.length-1&&"achlmqstvz".includes(e)}))}function Et(t){return xt(t)&&t.every((function(t){var e=t[0];return e===e.toUpperCase()}))}function bt(t){return Et(t)&&t.every((function(t){return"ACLMQZ".includes(t[0])}))}function Tt(t){for(var e=t.pathValue[t.segmentStart],n=e.toLowerCase(),r=t.data;r.length>=yt[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,yt[n]))),yt[n]););}function Mt(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 St(t){return t>=48&&57>=t||43===t||45===t||46===t}function Pt(t){return t>=48&&57>=t}function wt(t){var e,n=t.max,r=t.pathValue,i=t.index,a=i,o=!1,s=!1,u=!1,l=!1;if(n>a)if(43!==(e=r.charCodeAt(a))&&45!==e||(e=r.charCodeAt(a+=1)),Pt(e)||46===e){if(46!==e){if(o=48===e,e=r.charCodeAt(a+=1),o&&n>a&&e&&Pt(e))return void(t.err="[path-util]: Invalid path value at index "+i+', "'+r[i]+'" illegal number');for(;n>a&&Pt(r.charCodeAt(a));)a+=1,s=!0;e=r.charCodeAt(a)}if(46===e){for(l=!0,a+=1;Pt(r.charCodeAt(a));)a+=1,u=!0;e=r.charCodeAt(a)}if(101===e||69===e){if(l&&!s&&!u)return void(t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" invalid float exponent');if(43!==(e=r.charCodeAt(a+=1))&&45!==e||(a+=1),a>=n||!Pt(r.charCodeAt(a)))return void(t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" invalid integer exponent');for(;n>a&&Pt(r.charCodeAt(a));)a+=1}t.index=a,t.param=+t.pathValue.slice(i,a)}else t.err="[path-util]: Invalid path value at index "+a+', "'+r[a]+'" is not a number';else t.err="[path-util]: Invalid path value at index "+a+', "pathValue" is missing param'}function kt(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 Nt(t){var e=t.max,n=t.pathValue,r=t.index,i=n.charCodeAt(r),a=yt[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,kt(t),t.data=[],a){for(;;){for(var o=a;o>0;o-=1){if(97!=(32|i)||3!==o&&4!==o?wt(t):Mt(t),t.err.length)return;t.data.push(t.param),kt(t),e>t.index&&44===n.charCodeAt(t.index)&&(t.index+=1,kt(t))}if(t.index>=t.max)break;if(!St(n.charCodeAt(t.index)))break}Tt(t)}else Tt(t);else t.err='[path-util]: Invalid path value "'+n[r]+'" is not a path command'}var Ct=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 At(t){if(Et(t))return pt(t);var e=function(t){if(xt(t))return pt(t);var e=new Ct(t);for(kt(e);e.max>e.index&&!e.err.length;)Nt(e);return e.err?e.err:e.segments}(t),n=0,r=0,i=0,a=0;return e.map((function(t){var e,o=t.slice(1).map(Number),s=t[0],u=s.toUpperCase();if("M"===s)return i=n=o[0],a=r=o[1],["M",n,r];if(s!==u)switch(u){case"A":e=[u,o[0],o[1],o[2],o[3],o[4],o[5]+n,o[6]+r];break;case"V":e=[u,o[0]+r];break;case"H":e=[u,o[0]+n];break;default:var l=o.map((function(t,e){return t+(e%2?r:n)}));e=[u].concat(l)}else e=[u].concat(o);var c=e.length;switch(u){case"Z":n=i,r=a;break;case"H":n=e[1];break;case"V":r=e[1];break;default:n=e[c-2],r=e[c-1],"M"===u&&(i=n,a=r)}return e}))}function Ot(t,e){var n=t[0],r=e.x1,i=e.y1,a=e.x2,o=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 l=2*r-a,c=2*i-o;e.x1=l,e.y1=c,u=["C",l,c].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 d=s[1];e.qx=s[0],e.qy=d}return u}function Rt(t){if(bt(t))return pt(t);for(var e=At(t),n=vt({},mt),r=0;e.length>r;r+=1){e[r]=Ot(e[r],n);var i=e[r],a=i.length;n.x1=+i[a-2],n.y1=+i[a-1],n.x2=+i[a-4]||n.x1,n.y2=+i[a-3]||n.y1}return e}function Lt(t,e,n){return{x:t*Math.cos(n)-e*Math.sin(n),y:t*Math.sin(n)+e*Math.cos(n)}}function It(t,e,n,r,i,a,o,s,u,l){var c,h,f,d,p,v=t,m=e,g=n,y=r,x=s,E=u,b=120*Math.PI/180,T=Math.PI/180*(+i||0),M=[];if(l)h=l[0],f=l[1],d=l[2],p=l[3];else{m=(c=Lt(v,m,-T)).y;var S=((v=c.x)-(x=(c=Lt(x,E,-T)).x))/2,P=(m-(E=c.y))/2,w=S*S/(g*g)+P*P/(y*y);w>1&&(g*=w=Math.sqrt(w),y*=w);var k=g*g,N=y*y,C=(a===o?-1:1)*Math.sqrt(Math.abs((k*N-k*P*P-N*S*S)/(k*P*P+N*S*S)));d=C*g*P/y+(v+x)/2,h=Math.asin(((m-(p=C*-y*S/g+(m+E)/2))/y*1e9>>0)/1e9),f=Math.asin(((E-p)/y*1e9>>0)/1e9),0>(h=d>v?Math.PI-h:h)&&(h=2*Math.PI+h),0>(f=d>x?Math.PI-f:f)&&(f=2*Math.PI+f),o&&h>f&&(h-=2*Math.PI),!o&&f>h&&(f-=2*Math.PI)}var A=f-h;if(Math.abs(A)>b){var O=f,R=x,L=E;M=It(x=d+g*Math.cos(f=h+b*(o&&f>h?1:-1)),E=p+y*Math.sin(f),g,y,i,0,o,R,L,[f,O,d,p])}A=f-h;var I=Math.cos(h),_=Math.sin(h),D=Math.cos(f),F=Math.sin(f),G=Math.tan(A/4),U=4/3*g*G,B=4/3*y*G,V=[v,m],j=[v+U*_,m-B*I],Y=[x+U*F,E-B*D],z=[x,E];if(j[0]=2*V[0]-j[0],j[1]=2*V[1]-j[1],l)return j.concat(Y,z,M);for(var X=[],W=0,H=(M=j.concat(Y,z,M)).length;H>W;W+=1)X[W]=W%2?Lt(M[W-1],M[W],T).y:Lt(M[W],M[W+1],T).x;return X}function _t(t,e,n){var r=t[0],i=t[1];return[r+(e[0]-r)*n,i+(e[1]-i)*n]}function Dt(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}function Ft(t,e,n,r,i){var a=Dt([t,e],[n,r]),o={x:0,y:0};if("number"==typeof i)if(0<i)if(i<a){var s=_t([t,e],[n,r],i/a);o={x:s[0],y:s[1]}}else o={x:n,y:r};else o={x:t,y:e};return{length:a,point:o,min:{x:Math.min(t,n),y:Math.min(e,r)},max:{x:Math.max(t,n),y:Math.max(e,r)}}}function Gt(t,e,n,r){var i=.5,a=[t,e],o=[n,r],s=_t(a,o,i),u=_t(o,s,i),l=_t(s,u,i),c=_t(u,l,i),h=_t(l,c,i),f=Ft(a[0],a[1],s[0],s[1],l[0]).point,d=Ft(h[0],h[1],c[0],c[1],u[0]).point;return[f.x,f.y,d.x,d.y,n,r]}function Ut(t,e){var n,r,i,a,o,s,u,l=t[0],c=t.slice(1).map(Number),h=c[0],f=c[1],d=e.x1,p=e.y1,v=e.x,m=e.y;switch("TQ".includes(l)||(e.qx=null,e.qy=null),l){case"M":return e.x=h,e.y=f,t;case"A":return n=[d,p].concat(c),["C"].concat(It(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=[d,p].concat(c),["C"].concat([(s=1/3)*n[0]+(u=2/3)*(r=n[2]),s*n[1]+u*(i=n[3]),s*(a=n[4])+u*r,s*(o=n[5])+u*i,a,o]);case"L":return["C"].concat(Gt(d,p,h,f));case"Z":return d===v&&p===m?["C",d,p,v,m,v,m]:["C"].concat(Gt(d,p,v,m))}return t}function Bt(t,e){if(void 0===e&&(e=!1),function(t){return bt(t)&&t.every((function(t){return"MC".includes(t[0])}))}(t)){var n=pt(t);return e?[n,[]]:n}for(var r,i,a=Rt(t),o=vt({},mt),s=[],u="",l=a.length,c=[],h=0;l>h;h+=1){a[h]&&(u=a[h][0]),s[h]=u;var f=Ut(a[h],o);a[h]=f,gt(a,s,h),l=a.length,"Z"===u&&c.push(h),o.x1=+(r=a[h])[(i=r.length)-2],o.y1=+r[i-1],o.x2=+r[i-4]||o.x1,o.y2=+r[i-3]||o.y1}return e?[a,c]:a}function Vt(t,e){var n=t.x,r=t.y,i=e.x,a=e.y;return(0>n*a-r*i?-1:1)*Math.acos((n*i+r*a)/Math.sqrt((Math.pow(n,2)+Math.pow(r,2))*(Math.pow(i,2)+Math.pow(a,2))))}function jt(t,e,n,r,i,a,o,s,u,l){var c=Math.abs,h=Math.sin,f=Math.cos,d=Math.sqrt,p=Math.PI,v=c(n),m=c(r),g=(i%360+360)%360*(p/180);if(t===s&&e===u)return{x:t,y:e};if(0===v||0===m)return Ft(t,e,s,u,l).point;var y=(t-s)/2,x=(e-u)/2,E={x:f(g)*y+h(g)*x,y:-h(g)*y+f(g)*x},b=Math.pow(E.x,2)/Math.pow(v,2)+Math.pow(E.y,2)/Math.pow(m,2);b>1&&(v*=d(b),m*=d(b));var T=(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)),M=(a!==o?1:-1)*d(T=0>T?0:T),S=M*(v*E.y/m),P=M*(-m*E.x/v),w=f(g)*S-h(g)*P+(t+s)/2,k=h(g)*S+f(g)*P+(e+u)/2,N={x:(E.x-S)/v,y:(E.y-P)/m},C=Vt({x:1,y:0},N),A=Vt(N,{x:(-E.x-S)/v,y:(-E.y-P)/m});!o&&A>0?A-=2*p:o&&0>A&&(A+=2*p);var O=C+(A%=2*p)*l,R=v*f(O),L=m*h(O);return{x:f(g)*R-h(g)*L+w,y:h(g)*R+f(g)*L+k}}function Yt(t,e,n,r,i,a,o,s,u,l,c){var h,f=c.bbox,d=void 0===f||f,p=c.length,v=void 0===p||p,m=c.sampleSize,g=void 0===m?30:m,y="number"==typeof l,x=t,E=e,b=0,T=[x,E,b],M=[x,E],S={x:0,y:0},P=[{x:x,y:E}];y&&0>=l&&(S={x:x,y:E});for(var w=0;g>=w;w+=1){if(x=(h=jt(t,e,n,r,i,a,o,s,u,w/g)).x,E=h.y,d&&P.push({x:x,y:E}),v&&(b+=Dt(M,[x,E])),M=[x,E],y&&b>=l&&l>T[2]){var k=(b-l)/(b-T[2]);S={x:M[0]*(1-k)+T[0]*k,y:M[1]*(1-k)+T[1]*k}}T=[x,E,b]}return y&&l>=b&&(S={x:s,y:u}),{length:b,point:S,min:{x:Math.min.apply(null,P.map((function(t){return t.x}))),y:Math.min.apply(null,P.map((function(t){return t.y})))},max:{x:Math.max.apply(null,P.map((function(t){return t.x}))),y:Math.max.apply(null,P.map((function(t){return t.y})))}}}function zt(t,e,n,r,i,a,o,s,u){var l=1-u;return{x:Math.pow(l,3)*t+3*Math.pow(l,2)*u*n+3*l*Math.pow(u,2)*i+Math.pow(u,3)*o,y:Math.pow(l,3)*e+3*Math.pow(l,2)*u*r+3*l*Math.pow(u,2)*a+Math.pow(u,3)*s}}function Xt(t,e,n,r,i,a,o,s,u,l){var c,h=l.bbox,f=void 0===h||h,d=l.length,p=void 0===d||d,v=l.sampleSize,m=void 0===v?10:v,g="number"==typeof u,y=t,x=e,E=0,b=[y,x,E],T=[y,x],M={x:0,y:0},S=[{x:y,y:x}];g&&0>=u&&(M={x:y,y:x});for(var P=0;m>=P;P+=1){if(y=(c=zt(t,e,n,r,i,a,o,s,P/m)).x,x=c.y,f&&S.push({x:y,y:x}),p&&(E+=Dt(T,[y,x])),T=[y,x],g&&E>=u&&u>b[2]){var w=(E-u)/(E-b[2]);M={x:T[0]*(1-w)+b[0]*w,y:T[1]*(1-w)+b[1]*w}}b=[y,x,E]}return g&&u>=E&&(M={x:o,y:s}),{length:E,point:M,min:{x:Math.min.apply(null,S.map((function(t){return t.x}))),y:Math.min.apply(null,S.map((function(t){return t.y})))},max:{x:Math.max.apply(null,S.map((function(t){return t.x}))),y:Math.max.apply(null,S.map((function(t){return t.y})))}}}function Wt(t,e,n,r,i,a,o){var s=1-o;return{x:Math.pow(s,2)*t+2*s*o*n+Math.pow(o,2)*i,y:Math.pow(s,2)*e+2*s*o*r+Math.pow(o,2)*a}}function Ht(t,e,n,r,i,a,o,s){var u,l=s.bbox,c=void 0===l||l,h=s.length,f=void 0===h||h,d=s.sampleSize,p=void 0===d?10:d,v="number"==typeof o,m=t,g=e,y=0,x=[m,g,y],E=[m,g],b={x:0,y:0},T=[{x:m,y:g}];v&&0>=o&&(b={x:m,y:g});for(var M=0;p>=M;M+=1){if(m=(u=Wt(t,e,n,r,i,a,M/p)).x,g=u.y,c&&T.push({x:m,y:g}),f&&(y+=Dt(E,[m,g])),E=[m,g],v&&y>=o&&o>x[2]){var S=(y-o)/(y-x[2]);b={x:E[0]*(1-S)+x[0]*S,y:E[1]*(1-S)+x[1]*S}}x=[m,g,y]}return v&&o>=y&&(b={x:i,y:a}),{length:y,point:b,min:{x:Math.min.apply(null,T.map((function(t){return t.x}))),y:Math.min.apply(null,T.map((function(t){return t.y})))},max:{x:Math.max.apply(null,T.map((function(t){return t.x}))),y:Math.max.apply(null,T.map((function(t){return t.y})))}}}function qt(t,e,n){for(var r,i,a,o,s,u,l,c,h,f=Rt(t),d="number"==typeof e,p=[],v=0,m=0,g=0,y=0,x=[],E=[],b=0,T={x:0,y:0},M=T,S=T,P=T,w=0,k=0,N=f.length;N>k;k+=1)p=(l="M"===(c=(h=f[k])[0]))?p:[v,m].concat(h.slice(1)),l?(M=T={x:g=h[1],y:y=h[2]},b=0,d&&.001>e&&(P=T)):"L"===c?(b=(r=Ft(p[0],p[1],p[2],p[3],(e||0)-w)).length,T=r.min,M=r.max,S=r.point):"A"===c?(b=(i=Yt(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],p[8],(e||0)-w,n||{})).length,T=i.min,M=i.max,S=i.point):"C"===c?(b=(a=Xt(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],(e||0)-w,n||{})).length,T=a.min,M=a.max,S=a.point):"Q"===c?(b=(o=Ht(p[0],p[1],p[2],p[3],p[4],p[5],(e||0)-w,n||{})).length,T=o.min,M=o.max,S=o.point):"Z"===c&&(b=(s=Ft((p=[v,m,g,y])[0],p[1],p[2],p[3],(e||0)-w)).length,T=s.min,M=s.max,S=s.point),d&&e>w&&w+b>=e&&(P=S),E.push(M),x.push(T),w+=b,v=(u="Z"!==c?h.slice(-2):[g,y])[0],m=u[1];return d&&e>=w&&(P={x:v,y:m}),{length:w,point:P,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 Kt(t){return function(t){var e=0,n=0,r=0;return Bt(t).map((function(t){var i;if("M"===t[0])return e=t[1],n=t[2],0;var a,o,s,u,l,c,h,f,d=t.slice(1);return r=3*(((f=d[5])-(o=n))*((s=d[0])+(l=d[2]))-((h=d[4])-(a=e))*((u=d[1])+(c=d[3]))+u*(a-l)-s*(o-c)+f*(l+a/3)-h*(c+o/3))/20,i=t.slice(-2),e=i[0],n=i[1],r})).reduce((function(t,e){return t+e}),0)}(t)>=0}function Zt(t){return t.map((function(t,e,n){var r=e&&n[e-1].slice(-2).concat(t.slice(1)),i=e?Xt(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),a=t.slice(6,8),o=_t(n,r,e),s=_t(r,i,e),u=_t(i,a,e),l=_t(o,s,e),c=_t(s,u,e),h=_t(l,c,e);return[["C"].concat(o,l,h),["C"].concat(c,u,a)]}(r):[t,t]:[t],l:i}}))}function Qt(t,e,n){var r=Zt(t),i=Zt(e),a=r.length,o=i.length,s=r.filter((function(t){return t.l})).length,u=i.filter((function(t){return t.l})).length,l=r.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/s||0,c=i.filter((function(t){return t.l})).reduce((function(t,e){return t+e.l}),0)/u||0,h=n||Math.max(a,o),f=[l,c],d=[h-a,h-o],p=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 d[e]-=(p=n&&d[e]&&t.l>=f[e])?1:0,p?t.ss:[t.s]})).flat()}));return v[0].length===v[1].length?v:Qt(v[0],v[1],h)}var $t=function(t){return null==t},Jt={}.toString,te=function(t,e){return Jt.call(t)==="[object "+e+"]"},ee=function(t){return Array.isArray?Array.isArray(t):te(t,"Array")},ne=function(t){var e=typeof t;return null!==t&&"object"===e||"function"===e},re=function(t){if(ee(t))return t.reduce((function(t,e){return Math.max(t,e)}),t[0])},ie=function(t){if(ee(t))return t.reduce((function(t,e){return Math.min(t,e)}),t[0])},ae=function(t){return te(t,"String")},oe=function(t,e,n){return e>t?e:t>n?n:t},se=function(t){return te(t,"Number")},ue=1e-5;var le=function(t,e){return(t%e+e)%e},ce=function(t){return te(t,"Boolean")},he=function(t){return void 0===t};function fe(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function de(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function pe(){}var ve=.7,me=1/ve,ge="\\s*([+-]?\\d+)\\s*",ye="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",xe="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ee=/^#([0-9a-f]{3,8})$/,be=RegExp("^rgb\\("+[ge,ge,ge]+"\\)$"),Te=RegExp("^rgb\\("+[xe,xe,xe]+"\\)$"),Me=RegExp("^rgba\\("+[ge,ge,ge,ye]+"\\)$"),Se=RegExp("^rgba\\("+[xe,xe,xe,ye]+"\\)$"),Pe=RegExp("^hsl\\("+[ye,xe,xe]+"\\)$"),we=RegExp("^hsla\\("+[ye,xe,xe,ye]+"\\)$"),ke={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 Ne(){return this.rgb().formatHex()}function Ce(){return this.rgb().formatRgb()}function Ae(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=Ee.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?Oe(e):3===n?new Le(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?Re(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?Re(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=be.exec(t))?new Le(e[1],e[2],e[3],1):(e=Te.exec(t))?new Le(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=Me.exec(t))?Re(e[1],e[2],e[3],e[4]):(e=Se.exec(t))?Re(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=Pe.exec(t))?Fe(e[1],e[2]/100,e[3]/100,1):(e=we.exec(t))?Fe(e[1],e[2]/100,e[3]/100,e[4]):ke.hasOwnProperty(t)?Oe(ke[t]):"transparent"===t?new Le(NaN,NaN,NaN,0):null}function Oe(t){return new Le(t>>16&255,t>>8&255,255&t,1)}function Re(t,e,n,r){return r>0||(t=e=n=NaN),new Le(t,e,n,r)}function Le(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function Ie(){return"#"+De(this.r)+De(this.g)+De(this.b)}function _e(){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 De(t){return(16>(t=Math.max(0,Math.min(255,Math.round(t)||0)))?"0":"")+t.toString(16)}function Fe(t,e,n,r){return r>0?n>0&&1>n?e>0||(t=NaN):t=e=NaN:t=e=n=NaN,new Ue(t,e,n,r)}function Ge(t){if(t instanceof Ue)return new Ue(t.h,t.s,t.l,t.opacity);if(t instanceof pe||(t=Ae(t)),!t)return new Ue;if(t instanceof Ue)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),o=NaN,s=a-i,u=(a+i)/2;return s?(o=e===a?(n-r)/s+6*(r>n):n===a?(r-e)/s+2:(e-n)/s+4,s/=.5>u?a+i:2-a-i,o*=60):s=u>0&&1>u?0:o,new Ue(o,s,u,t.opacity)}function Ue(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Be(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 Ve(t,e,n,r){var i=t-n,a=e-r;return Math.sqrt(i*i+a*a)}function je(t,e){return.001>Math.abs(t-e)}function Ye(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}}fe(pe,Ae,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:Ne,formatHex:Ne,formatHsl:function(){return Ge(this).formatHsl()},formatRgb:Ce,toString:Ce}),fe(Le,(function(t,e,n,r){return 1===arguments.length?((i=t)instanceof pe||(i=Ae(i)),i?new Le((i=i.rgb()).r,i.g,i.b,i.opacity):new Le):new Le(t,e,n,null==r?1:r);var i}),de(pe,{brighter:function(t){return new Le(this.r*(t=null==t?me:Math.pow(me,t)),this.g*t,this.b*t,this.opacity)},darker:function(t){return new Le(this.r*(t=null==t?ve:Math.pow(ve,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:Ie,formatHex:Ie,formatRgb:_e,toString:_e})),fe(Ue,(function(t,e,n,r){return 1===arguments.length?Ge(t):new Ue(t,e,n,null==r?1:r)}),de(pe,{brighter:function(t){return new Ue(this.h,this.s,this.l*(t=null==t?me:Math.pow(me,t)),this.opacity)},darker:function(t){return new Ue(this.h,this.s,this.l*(t=null==t?ve:Math.pow(ve,t)),this.opacity)},rgb:function(){var t=this.h%360+360*(0>this.h),e=this.l,n=e+(.5>e?e:1-e)*(isNaN(t)||isNaN(this.s)?0:this.s),r=2*e-n;return new Le(Be(240>t?t+120:t-240,r,n),Be(t,r,n),Be(120>t?t+240:t-120,r,n),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 ze={box:function(t,e,n,r){return Ye([t,n],[e,r])},length:function(t,e,n,r){return Ve(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,a){var o=(n-t)*(i-t)+(r-e)*(a-e);return 0>o?Ve(t,e,i,a):o>(n-t)*(n-t)+(r-e)*(r-e)?Ve(n,r,i,a):this.pointToLine(t,e,n,r,i,a)},pointToLine:function(t,e,n,r,i,a){var o=[n-t,r-e];if(function(t,e){return t[0]===e[0]&&t[1]===e[1]}(o,[0,0]))return Math.sqrt((i-t)*(i-t)+(a-e)*(a-e));var s=[-o[1],o[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,a-e],s))},tangentAngle:function(t,e,n,r){return Math.atan2(r-e,n-t)}};function Xe(t,e,n,r){var i=1-r;return i*i*t+2*r*i*e+r*r*n}function We(t,e,n){var r=t+n-2*e;if(je(r,0))return[.5];var i=(t-e)/r;return i>1||0>i?[]:[i]}var He=function(t,e,n,r,i,a){var o=We(t,n,i)[0],s=We(e,r,a)[0],u=[t,i],l=[e,a];return void 0!==o&&u.push(Xe(t,n,i,o)),void 0!==s&&l.push(Xe(e,r,a,s)),Ye(u,l)};function qe(t,e,n,r,i){var a=1-i;return a*a*a*t+3*e*i*a*a+3*n*i*i*a+r*i*i*i}function Ke(t,e,n,r){var i,a,o,s=-3*t+9*e-9*n+3*r,u=6*t-12*e+6*n,l=3*e-3*t,c=[];if(je(s,0))je(u,0)||0>(i=-l/u)||i>1||c.push(i);else{var h=u*u-4*s*l;je(h,0)?c.push(-u/(2*s)):h>0&&(a=(-u-(o=Math.sqrt(h)))/(2*s),0>(i=(-u+o)/(2*s))||i>1||c.push(i),0>a||a>1||c.push(a))}return c}var Ze=function(t,e,n,r,i,a,o,s){for(var u=[t,o],l=[e,s],c=Ke(t,n,i,o),h=Ke(e,r,a,s),f=0;c.length>f;f++)u.push(qe(t,n,i,o,c[f]));for(var d=0;h.length>d;d++)l.push(qe(e,r,a,s,h[d]));return Ye(u,l)};function Qe(t,e,n,r,i,a){return n*Math.cos(i)*Math.cos(a)-r*Math.sin(i)*Math.sin(a)+t}function $e(t,e,n,r,i,a){return n*Math.sin(i)*Math.cos(a)+r*Math.cos(i)*Math.sin(a)+e}var Je=function(t,e,n,r,i,a,o){for(var s=function(t,e,n){return Math.atan(-e/t*Math.tan(n))}(n,r,i),u=1/0,l=-1/0,c=[a,o],h=2*-Math.PI;2*Math.PI>=h;h+=Math.PI){var f=s+h;o>a?f>a&&o>f&&c.push(f):f>o&&a>f&&c.push(f)}for(var d=0;c.length>d;d++){var p=Qe(t,0,n,r,i,c[d]);u>p&&(u=p),p>l&&(l=p)}for(var v=function(t,e,n){return Math.atan(e/(t*Math.tan(n)))}(n,r,i),m=1/0,g=-1/0,y=[a,o],x=2*-Math.PI;2*Math.PI>=x;x+=Math.PI){var E=v+x;o>a?E>a&&o>E&&y.push(E):E>o&&a>E&&y.push(E)}for(var b=0;y.length>b;b++){var T=$e(0,e,n,r,i,y[b]);m>T&&(m=T),T>g&&(g=T)}return{x:u,y:m,width:l-u,height:g-m}};var tn,en,nn,rn,an,on,sn=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+=Ve(r[0],r[1],i[0],i[1])}return e}(t)},un=e((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 a(t,e,r,a,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new i(r,a||t,o),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 o(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,a=Array(i);i>r;r++)a[r]=e[r].fn;return a},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,a,o){var s=n?n+t:t;if(!this._events[s])return!1;var u,l,c=this._events[s],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(t,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,r),!0;case 4:return c.fn.call(c.context,e,r,i),!0;case 5:return c.fn.call(c.context,e,r,i,a),!0;case 6:return c.fn.call(c.context,e,r,i,a,o),!0}for(l=1,u=Array(h-1);h>l;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var f,d=c.length;for(l=0;d>l;l++)switch(c[l].once&&this.removeListener(t,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,r);break;case 4:c[l].fn.call(c[l].context,e,r,i);break;default:if(!u)for(f=1,u=Array(h-1);h>f;f++)u[f-1]=arguments[f];c[l].fn.apply(c[l].context,u)}}return!0},s.prototype.on=function(t,e,n){return a(this,t,e,n,!1)},s.prototype.once=function(t,e,n){return a(this,t,e,n,!0)},s.prototype.removeListener=function(t,e,r,i){var a=n?n+t:t;if(!this._events[a])return this;if(!e)return o(this,a),this;var s=this._events[a];if(s.fn)s.fn!==e||i&&!s.once||r&&s.context!==r||o(this,a);else{for(var u=0,l=[],c=s.length;c>u;u++)(s[u].fn!==e||i&&!s[u].once||r&&s[u].context!==r)&&l.push(s[u]);l.length?this._events[a]=1===l.length?l[0]:l:o(this,a)}return this},s.prototype.removeAllListeners=function(t){var e;return t?this._events[e=n?n+t:t]&&o(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}));function ln(){ln=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function l(t,e,n,i){var a=Object.create((e&&e.prototype instanceof f?e:f).prototype),o=new P(i||[]);return r(a,"_invoke",{value:b(t,n,o)}),a}function c(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var h={};function f(){}function d(){}function p(){}var v={};u(v,a,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(w([])));g&&g!==e&&n.call(g,a)&&(v=g);var y=p.prototype=f.prototype=Object.create(v);function x(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function i(r,a,o,s){var u=c(t[r],t,a);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){i("next",t,o,s)}),(function(t){i("throw",t,o,s)})):e.resolve(h).then((function(t){l.value=t,o(l)}),(function(t){return i("throw",t,o,s)}))}s(u.arg)}var a;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){i(t,n,e,r)}))}return a=a?a.then(r,r):r()}})}function b(t,e,n){var r="suspendedStart";return function(i,a){if("executing"===r)throw Error("Generator is already running");if("completed"===r){if("throw"===i)throw a;return k()}for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=T(o,n);if(s){if(s===h)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===h)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}function T(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,T(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h;var i=c(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,h;var a=i.arg;return a?a.done?(e[t.resultName]=a.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function M(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 S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(M,this),this.reset(!0)}function w(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=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 i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=p,r(y,"constructor",{value:p,configurable:!0}),r(p,"constructor",{value:d,configurable:!0}),d.displayName=u(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,u(t,s,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},x(E.prototype),u(E.prototype,o,(function(){return this})),t.AsyncIterator=E,t.async=function(e,n,r,i,a){void 0===a&&(a=Promise);var o=new E(l(e,n,r,i),a);return t.isGeneratorFunction(n)?o:o.next().then((function(t){return t.done?t.value:o.next()}))},x(y),u(y,s,"Generator"),u(y,a,(function(){return this})),u(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},t.values=w,P.prototype={constructor:P,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(S),!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 o.type="throw",o.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 a=this.tryEntries[i],o=a.completion;if("root"===a.tryLoc)return r("end");if(this.prev>=a.tryLoc){var s=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(s&&u){if(a.catchLoc>this.prev)return r(a.catchLoc,!0);if(a.finallyLoc>this.prev)return r(a.finallyLoc)}else if(s){if(a.catchLoc>this.prev)return r(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(a.finallyLoc>this.prev)return r(a.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 a=i;break}}a&&("break"===t||"continue"===t)&&e>=a.tryLoc&&a.finallyLoc>=e&&(a=null);var o=a?a.completion:{};return o.type=t,o.arg=e,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(o)},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),h},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),S(n),h}},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;S(n)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:w(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function cn(t,e,n,r,i,a,o){try{var s=t[a](o),u=s.value}catch(t){return void n(t)}s.done?e(u):Promise.resolve(u).then(r,i)}function hn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){cn(a,r,i,o,s,"next",t)}function s(t){cn(a,r,i,o,s,"throw",t)}o(void 0)}))}}function fn(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,(i=void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r.key,"string"))?i:i+""),r)}var i}function dn(t,e,n){return e&&fn(t.prototype,e),n&&fn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function pn(){return pn=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},pn.apply(this,arguments)}function vn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,mn(t,e)}function mn(t,e){return mn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},mn(t,e)}function gn(t,e){if(null==t)return{};var n,r,i={},a=Object.keys(t);for(r=0;a.length>r;r++)0>e.indexOf(n=a[r])&&(i[n]=t[n]);return i}function yn(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function xn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);e>n;n++)r[n]=t[n];return r}function En(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 xn(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)?xn(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.")}(tn=t.PropertySyntax||(t.PropertySyntax={})).COORDINATE="<coordinate>",tn.COLOR="<color>",tn.PAINT="<paint>",tn.NUMBER="<number>",tn.ANGLE="<angle>",tn.OPACITY_VALUE="<opacity-value>",tn.SHADOW_BLUR="<shadow-blur>",tn.LENGTH="<length>",tn.PERCENTAGE="<percentage>",tn.LENGTH_PERCENTAGE="<length> | <percentage>",tn.LENGTH_PERCENTAGE_12="[<length> | <percentage>]{1,2}",tn.LENGTH_PERCENTAGE_14="[<length> | <percentage>]{1,4}",tn.LIST_OF_POINTS="<list-of-points>",tn.PATH="<path>",tn.FILTER="<filter>",tn.Z_INDEX="<z-index>",tn.OFFSET_DISTANCE="<offset-distance>",tn.DEFINED_PATH="<defined-path>",tn.MARKER="<marker>",tn.TRANSFORM="<transform>",tn.TRANSFORM_ORIGIN="<transform-origin>",tn.TEXT="<text>",tn.TEXT_TRANSFORM="<text-transform>",(en=t.UnitType||(t.UnitType={}))[en.kUnknown=0]="kUnknown",en[en.kNumber=1]="kNumber",en[en.kPercentage=2]="kPercentage",en[en.kEms=3]="kEms",en[en.kPixels=4]="kPixels",en[en.kRems=5]="kRems",en[en.kDegrees=6]="kDegrees",en[en.kRadians=7]="kRadians",en[en.kGradians=8]="kGradians",en[en.kTurns=9]="kTurns",en[en.kMilliseconds=10]="kMilliseconds",en[en.kSeconds=11]="kSeconds",en[en.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"}(nn||(nn={})),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"}(rn||(rn={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(an||(an={})),function(t){t[t.kYes=0]="kYes",t[t.kNo=1]="kNo"}(on||(on={}));var bn,Tn=[{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"}(bn||(bn={}));var Mn,Sn=function(e){return e?"number"===e?t.UnitType.kNumber:"percent"===e||"%"===e?t.UnitType.kPercentage:function(t){return Tn.find((function(e){return e.name===t})).unit_type}(e):t.UnitType.kUnknown},Pn=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},wn=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""},kn=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(an.kNo,on.kNo,"")},n.isNumericValue=function(){return this.getType()>=bn.kUnitType&&this.getType()<=bn.kClampType},e}(),Nn=function(t){function e(e){var n;return(n=t.call(this)||this).colorSpace=void 0,n.colorSpace=e,n}vn(e,t);var n=e.prototype;return n.getType=function(){return bn.kColorType},n.to=function(t){return this},e}(kn);(Mn=t.GradientType||(t.GradientType={}))[Mn.Constant=0]="Constant",Mn[Mn.LinearGradient=1]="LinearGradient",Mn[Mn.RadialGradient=2]="RadialGradient";var Cn=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}vn(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 bn.kColorType},e}(kn),An=function(t){function e(e){var n;return(n=t.call(this)||this).value=void 0,n.value=e,n}vn(e,t);var n=e.prototype;return n.clone=function(){return new e(this.value)},n.getType=function(){return bn.kKeywordType},n.buildCSSText=function(t,e,n){return n+this.value},e}(kn);function On(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var n=function n(){for(var r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];var o=e?e.apply(this,i):i[0],s=n.cache;if(s.has(o))return s.get(o);var u=t.apply(this,i);return n.cache=s.set(o,u)||s,u};return n.cache=new(On.Cache||Map),n}On.Cache=Map;var Rn=On((function(t){return void 0===t&&(t=""),t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))})),Ln=function(t){return t.split("").map((function(t,e){return t.toUpperCase()===t?(0!==e?"-":"")+t.toLowerCase():t})).join("")};function In(t){return"function"==typeof t}var _n={d:{alias:"path"},strokeDasharray:{alias:"lineDash"},strokeWidth:{alias:"lineWidth"},textAnchor:{alias:"textAlign"},src:{alias:"img"}},Dn=On((function(t){var e=Rn(t),n=_n[e];return e=(null==n?void 0:n.alias)||e})),Fn=function(t,e){void 0===e&&(e="");var n="";return Number.isFinite(t)?(!function(t){if(!t)throw Error()}(Number.isNaN(t)),n="NaN"):n=t>0?"infinity":"-infinity",n+e},Gn=function(e){return function(e){switch(e){case nn.kUNumber:return t.UnitType.kNumber;case nn.kULength:return t.UnitType.kPixels;case nn.kUPercent:return t.UnitType.kPercentage;case nn.kUTime:return t.UnitType.kSeconds;case nn.kUAngle:return t.UnitType.kDegrees;default:return t.UnitType.kUnknown}}(function(e){switch(e){case t.UnitType.kNumber:case t.UnitType.kInteger:return nn.kUNumber;case t.UnitType.kPercentage:return nn.kUPercent;case t.UnitType.kPixels:return nn.kULength;case t.UnitType.kMilliseconds:case t.UnitType.kSeconds:return nn.kUTime;case t.UnitType.kDegrees:case t.UnitType.kRadians:case t.UnitType.kGradians:case t.UnitType.kTurns:return nn.kUAngle;default:return nn.kUOther}}(e))},Un=function(e){function n(n,r){var i,a;return void 0===r&&(r=t.UnitType.kNumber),(i=e.call(this)||this).unit=void 0,i.value=void 0,a="string"==typeof r?Sn(r):r,i.unit=a,i.value=n,i}vn(n,e);var r=n.prototype;return r.clone=function(){return new n(this.value,this.unit)},r.equals=function(t){return this.value===t.value&&this.unit===t.unit},r.getType=function(){return bn.kUnitType},r.convertTo=function(e){if(this.unit===e)return new n(this.value,this.unit);var r=Gn(this.unit);if(r!==Gn(e)||r===t.UnitType.kUnknown)return null;var i=Pn(this.unit)/Pn(e);return new n(this.value*i,e)},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 a=this.value,o=wn(this.unit);if(-999999>a||a>999999){var s=wn(this.unit);i=!Number.isFinite(a)||Number.isNaN(a)?Fn(a,s):a+(s||"")}else i=""+a+o}return r+=i},n}(kn),Bn=new Un(0,"px"),Vn=(new Un(1,"px"),new Un(0,"deg")),jn=function(t){function e(e,n,r,i,a){var o;return void 0===i&&(i=1),void 0===a&&(a=!1),(o=t.call(this,"rgb")||this).r=void 0,o.g=void 0,o.b=void 0,o.alpha=void 0,o.isNone=void 0,o.r=e,o.g=n,o.b=r,o.alpha=i,o.isNone=a,o}vn(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}(Nn),Yn={number:function(t){return new Un(t)},percent:function(t){return new Un(t,"%")},px:function(t){return new Un(t,"px")},em:function(t){return new Un(t,"em")},rem:function(t){return new Un(t,"rem")},deg:function(t){return new Un(t,"deg")},grad:function(t){return new Un(t,"grad")},rad:function(t){return new Un(t,"rad")},turn:function(t){return new Un(t,"turn")},s:function(t){return new Un(t,"s")},ms:function(t){return new Un(t,"ms")},registerProperty:function(t){ls.styleValueRegistry.registerMetadata({n:t.name,inh:t.inherits,int:t.interpolable,d:t.initialValue,syntax:t.syntax})},registerLayout:function(t,e){ls.layoutRegistry.registerLayout(t,e)}},zn=new An("unset"),Xn=new An("initial"),Wn=new An("inherit"),Hn={"":zn,unset:zn,initial:Xn,inherit:Wn},qn=function(t){return Hn[t]||(Hn[t]=new An(t)),Hn[t]},Kn=new jn(0,0,0,0,!0),Zn=new jn(0,0,0,0),Qn=On((function(t,e,n,r){return new jn(t,e,n,r)}),(function(t,e,n,r){return"rgba("+t+","+e+","+n+","+r+")"})),$n=function(e,n){return void 0===n&&(n=t.UnitType.kNumber),new Un(e,n)},Jn=new Un(50,"%"),tr={},er=0;var nr="undefined"!=typeof window&&void 0!==window.document;function rr(t,e){var n=Number(t.parsedStyle.zIndex),r=Number(e.parsedStyle.zIndex);if(n===r){var i=t.parentNode;if(i){var a=i.childNodes||[];return a.indexOf(t)-a.indexOf(e)}}return n-r}function ir(t){var e=t;do{var n;if(null===(n=e.parsedStyle)||void 0===n?void 0:n.clipPath)return e;e=e.parentElement}while(null!==e);return null}function ar(t,e){if(nr)return document.defaultView.getComputedStyle(t,null).getPropertyValue(e)}var or="Method not implemented.",sr="Use document.documentElement instead.",ur={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"};function lr(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function cr(t,e,n){return t[0]=e[0]-n[0],t[1]=e[1]-n[1],t[2]=e[2]-n[2],t}function hr(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t[2]=e[2]+n[2],t}function fr(t,e,n){return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t}function dr(t){return void 0===t?0:t>360||-360>t?t%360:t}function pr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),Array.isArray(t)&&3===t.length?L(t):se(t)?_(t,e,n):_(t[0],t[1]||e,t[2]||n)}function vr(t){return t*(Math.PI/180)}function mr(t){return t*(180/Math.PI)}function gr(t){return 360*t}function yr(t,e){return 16===e.length?function(t,e){var n,r,i=.5*Math.PI,a=T(R(),e),o=a[0],s=a[1],u=a[2],l=Math.asin(-e[2]/o);return i>l?l>-i?(n=Math.atan2(e[6]/s,e[10]/u),r=Math.atan2(e[1]/o,e[0]/o)):(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]=l,t[2]=r,t}(t,e):function(t,e){var n=e[0],r=e[1],i=e[2],a=e[3],o=r*r,s=i*i,u=a*a,l=n*n+o+s+u,c=n*a-r*i;return c>.499995*l?(t[0]=Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):-.499995*l>c?(t[0]=-Math.PI/2,t[1]=2*Math.atan2(r,n),t[2]=0):(t[0]=Math.asin(2*(n*i-a*r)),t[1]=Math.atan2(2*(n*a+r*i),1-2*(s+u)),t[2]=Math.atan2(2*(n*r+i*a),1-2*(o+s))),t}(t,e)}function xr(t,e,n,r,a){var o,s,u,l,c,h,f,d,p,v,m=Math.cos(t),g=Math.sin(t);return o=r*m,s=a*g,u=0,l=-r*g,c=a*m,h=0,f=e,d=n,p=1,(v=new i(9))[0]=o,v[1]=s,v[2]=u,v[3]=l,v[4]=c,v[5]=h,v[6]=f,v[7]=d,v[8]=p,v}function Er(t){var e=t[0],n=t[1],r=t[3],i=t[4],a=Math.sqrt(e*e+n*n),o=Math.sqrt(r*r+i*i);0>e*i-n*r&&(i>e?a=-a:o=-o),a&&(e*=1/a,n*=1/a),o&&(r*=1/o,i*=1/o);var s=mr(Math.atan2(n,e));return[t[6],t[7],a,o,s]}var br=o(),Tr=o(),Mr=Z(),Sr=[R(),R(),R()],Pr=R();function wr(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}var kr=o();function Nr(t,e){if(t&&t.length){var n=0,r=0;e?(n=e.parsedStyle.defX||0,r=e.parsedStyle.defY||0,e.resetLocalTransform(),e.setLocalPosition(n,r)):e=new io({}),t.forEach((function(t){var i=t.t,a=t.d;if("scale"===i){var o=(null==a?void 0:a.map((function(t){return t.value})))||[1,1];e.scaleLocal(o[0],o[1],1)}else if("scalex"===i){var s=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(s[0],1,1)}else if("scaley"===i){var u=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(1,u[0],1)}else if("scalez"===i){var c=(null==a?void 0:a.map((function(t){return t.value})))||[1];e.scaleLocal(1,1,c[0])}else if("scale3d"===i){var h=(null==a?void 0:a.map((function(t){return t.value})))||[1,1,1];e.scaleLocal(h[0],h[1],h[2])}else if("translate"===i){var f=a||[Bn,Bn];e.translateLocal(f[0].value,f[1].value,0)}else if("translatex"===i){e.translateLocal((a||[Bn])[0].value,0,0)}else if("translatey"===i){e.translateLocal(0,(a||[Bn])[0].value,0)}else if("translatez"===i){e.translateLocal(0,0,(a||[Bn])[0].value)}else if("translate3d"===i){var d=a||[Bn,Bn,Bn];e.translateLocal(d[0].value,d[1].value,d[2].value)}else if("rotate"===i){e.rotateLocal(0,0,Si((a||[Vn])[0]))}else if("rotatex"===i){e.rotateLocal(Si((a||[Vn])[0]),0,0)}else if("rotatey"===i){e.rotateLocal(0,Si((a||[Vn])[0]),0)}else if("rotatez"===i){e.rotateLocal(0,0,Si((a||[Vn])[0]))}else if("rotate3d"===i);else if("skew"===i){var p=(null==a?void 0:a.map((function(t){return t.value})))||[0,0];e.setLocalSkew(vr(p[0]),vr(p[1]))}else if("skewx"===i){var v=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(vr(v[0]),e.getLocalSkew()[1])}else if("skewy"===i){var m=(null==a?void 0:a.map((function(t){return t.value})))||[0];e.setLocalSkew(e.getLocalSkew()[0],vr(m[0]))}else if("matrix"===i){var g=a.map((function(t){return t.value}));e.setLocalTransform(l(kr,g[0],g[1],0,0,g[2],g[3],0,0,0,0,1,0,g[4]+n,g[5]+r,0,1))}else"matrix3d"===i&&(l.apply(O,[kr].concat(a.map((function(t){return t.value})))),kr[12]+=n,kr[13]+=r,e.setLocalTransform(kr))}))}return e.getLocalTransform()}function Cr(t){var e=t.type,n=t.value;return"hex"===e?"#"+n:"literal"===e?n:"rgb"===e?"rgb("+n.join(",")+")":"rgba("+n.join(",")+")"}var Ar,Or=function(){var t={linearGradient:/^(linear\-gradient)/i,repeatingLinearGradient:/^(repeating\-linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,repeatingRadialGradient:/^(repeating\-radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/^\#([0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^rgb/i,rgbaColor:/^rgba/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/},e="";function n(t){throw Error(e+": "+t)}function r(){var t=d(i);return e.length>0&&n("Invalid input not EOF"),t}function i(){return a("linear-gradient",t.linearGradient,s)||a("repeating-linear-gradient",t.repeatingLinearGradient,s)||a("radial-gradient",t.radialGradient,u)||a("repeating-radial-gradient",t.repeatingRadialGradient,u)||a("conic-gradient",t.conicGradient,u)}function a(e,r,i){return o(r,(function(r){var a=i();return a&&(x(t.comma)||n("Missing comma before color stops")),{type:e,orientation:a,colorStops:d(p)}}))}function o(e,r){var i=x(e);if(i){x(t.startCall)||n("Missing (");var a=r(i);return x(t.endCall)||n("Missing )"),a}}function s(){return y("directional",t.sideOrCorner,1)||y("angular",t.angleValue,1)}function u(){var n,r,i=l();return i&&((n=[]).push(i),r=e,x(t.comma)&&((i=l())?n.push(i):e=r)),n}function l(){var t=function(){var t=y("shape",/^(circle)/i,0);t&&(t.style=g()||c());return t}()||function(){var t=y("shape",/^(ellipse)/i,0);t&&(t.style=m()||c());return t}();if(t)t.at=h();else{var e=c();if(e){t=e;var n=h();n&&(t.at=n)}else{var r=f();r&&(t={type:"default-radial",at:r})}}return t}function c(){return y("extent-keyword",t.extentKeywords,1)}function h(){if(y("position",/^at/,0)){var t=f();return t||n("Missing positioning value"),t}}function f(){var t={x:m(),y:m()};if(t.x||t.y)return{type:"position",value:t}}function d(e){var r=e(),i=[];if(r)for(i.push(r);x(t.comma);)(r=e())?i.push(r):n("One extra comma");return i}function p(){var e=y("hex",t.hexColor,1)||o(t.rgbaColor,(function(){return{type:"rgba",value:d(v)}}))||o(t.rgbColor,(function(){return{type:"rgb",value:d(v)}}))||y("literal",t.literalColor,0);return e||n("Expected color definition"),e.length=m(),e}function v(){return x(t.number)[1]}function m(){return y("%",t.percentageValue,1)||y("position-keyword",t.positionKeywords,1)||g()}function g(){return y("px",t.pixelValue,1)||y("em",t.emValue,1)}function y(t,e,n){var r=x(e);if(r)return{type:t,value:r[n]}}function x(t){var n=/^[\n\r\t\s]+/.exec(e);n&&E(n[0].length);var r=t.exec(e);return r&&E(r[0].length),r}function E(t){e=e.substring(t)}return function(t){return e=t,r()}}();function Rr(t){var e;return 0===t.parsedStyle.path.totalLength&&(t.parsedStyle.path.totalLength=qt(t.parsedStyle.path.absolutePath,void 0,vt(vt({},e),{bbox:!1,length:!0})).length),t.parsedStyle.path.totalLength}function Lr(t,e){return t[0]===e[0]&&t[1]===e[1]}function Ir(t,e){var n,r=t.prePoint,i=t.currentPoint,a=t.nextPoint,o=Math.pow(i[0]-r[0],2)+Math.pow(i[1]-r[1],2),s=Math.pow(i[0]-a[0],2)+Math.pow(i[1]-a[1],2),u=Math.acos((o+s-(Math.pow(r[0]-a[0],2)+Math.pow(r[1]-a[1],2)))/(2*Math.sqrt(o)*Math.sqrt(s)));if(!u||0===Math.sin(u)||(void 0===n&&(n=ue),n>Math.abs(u-0)))return{xExtra:0,yExtra:0};var l=Math.abs(Math.atan2(a[1]-i[1],a[0]-i[0])),c=Math.abs(Math.atan2(a[0]-i[0],a[1]-i[1]));return c=c>Math.PI/2?Math.PI-c:c,{xExtra:Math.cos(u/2-(l=l>Math.PI/2?Math.PI-l:l))*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(c-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}function _r(t,e){return[e[0]+(e[0]-t[0]),e[1]+(e[1]-t[1])]}(Ar=t.Shape||(t.Shape={})).GROUP="g",Ar.CIRCLE="circle",Ar.ELLIPSE="ellipse",Ar.IMAGE="image",Ar.RECT="rect",Ar.LINE="line",Ar.POLYLINE="polyline",Ar.POLYGON="polygon",Ar.TEXT="text",Ar.PATH="path",Ar.HTML="html",Ar.MESH="mesh";var Dr=function(t,e){return(0>t.x*e.y-t.y*e.x?-1:1)*Math.acos((t.x*e.x+t.y*e.y)/Math.sqrt((Math.pow(t.x,2)+Math.pow(t.y,2))*(Math.pow(e.x,2)+Math.pow(e.y,2))))},Fr=function(t,e,n,r,i,a,o,s){e=Math.abs(e),n=Math.abs(n);var u=vr(r=le(r,360));if(t.x===o.x&&t.y===o.y)return{x:t.x,y:t.y,ellipticalArcAngle:0};if(0===e||0===n)return{x:0,y:0,ellipticalArcAngle:0};var l=(t.x-o.x)/2,c=(t.y-o.y)/2,h={x:Math.cos(u)*l+Math.sin(u)*c,y:-Math.sin(u)*l+Math.cos(u)*c},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),n*=Math.sqrt(f));var d=(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=(i!==a?1:-1)*Math.sqrt(d=0>d?0:d),v=p*(e*h.y/n),m=p*(-n*h.x/e),g={x:Math.cos(u)*v-Math.sin(u)*m+(t.x+o.x)/2,y:Math.sin(u)*v+Math.cos(u)*m+(t.y+o.y)/2},y={x:(h.x-v)/e,y:(h.y-m)/n},x=Dr({x:1,y:0},y),E=Dr(y,{x:(-h.x-v)/e,y:(-h.y-m)/n});!a&&E>0?E-=2*Math.PI:a&&0>E&&(E+=2*Math.PI);var b=x+(E%=2*Math.PI)*s,T=e*Math.cos(b),M=n*Math.sin(b);return{x:Math.cos(u)*T-Math.sin(u)*M+g.x,y:Math.sin(u)*T+Math.cos(u)*M+g.y,ellipticalArcStartAngle:x,ellipticalArcEndAngle:x+E,ellipticalArcAngle:b,ellipticalArcCenter:g,resultantRx:e,resultantRy:n}};function Gr(t,e,n){void 0===n&&(n=!0);var r=t.arcParams,i=r.rx,a=void 0===i?0:i,o=r.ry,s=void 0===o?0:o,u=r.xRotation,l=r.arcFlag,c=r.sweepFlag,h=Fr({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},e),f=Fr({x:t.prePoint[0],y:t.prePoint[1]},a,s,u,!!l,!!c,{x:t.currentPoint[0],y:t.currentPoint[1]},n?e+.005:e-.005),d=f.x-h.x,p=f.y-h.y,v=Math.sqrt(d*d+p*p);return{x:-d/v,y:-p/v}}function Ur(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Br(t,e){return Ur(t)*Ur(e)?(t[0]*e[0]+t[1]*e[1])/(Ur(t)*Ur(e)):1}function Vr(t,e){return(t[1]*e[0]>t[0]*e[1]?-1:1)*Math.acos(Br(t,e))}function jr(t,e){var n=e[1],r=e[2],i=le(vr(e[3]),2*Math.PI),a=e[4],o=e[5],s=t[0],u=t[1],l=e[6],c=e[7],h=Math.cos(i)*(s-l)/2+Math.sin(i)*(u-c)/2,f=-1*Math.sin(i)*(s-l)/2+Math.cos(i)*(u-c)/2,d=h*h/(n*n)+f*f/(r*r);d>1&&(n*=Math.sqrt(d),r*=Math.sqrt(d));var p=n*n*(f*f)+r*r*(h*h),v=p?Math.sqrt((n*n*(r*r)-p)/p):1;a===o&&(v*=-1),isNaN(v)&&(v=0);var m=r?v*n*f/r:0,g=n?v*-r*h/n:0,y=(s+l)/2+Math.cos(i)*m-Math.sin(i)*g,x=(u+c)/2+Math.sin(i)*m+Math.cos(i)*g,E=[(h-m)/n,(f-g)/r],b=[(-1*h-m)/n,(-1*f-g)/r],T=Vr([1,0],E),M=Vr(E,b);return Br(E,b)>-1||(M=Math.PI),1>Br(E,b)||(M=0),0===o&&M>0&&(M-=2*Math.PI),1===o&&0>M&&(M+=2*Math.PI),{cx:y,cy:x,rx:Lr(t,[l,c])?0:n,ry:Lr(t,[l,c])?0:r,startAngle:T,endAngle:T+M,xRotation:i,arcFlag:a,sweepFlag:o}}function Yr(t,e,n,r){var i=.5522847498307936,a=t*i,o=e*i,s=n-t,u=n+t,l=r-e,c=r+e;return[["M",s,r],["C",s,r-o,n-a,l,n,l],["C",n+a,l,u,r-o,u,r],["C",u,r+o,n+a,c,n,c],["C",n-a,c,s,r+o,s,r],["Z"]]}var zr=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.tapPromise=function(t,e){this.callbacks.push(e)},e.promise=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];return Promise.all(this.callbacks.map((function(t){return t.apply(void 0,e)})))},t}(),Xr=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.tapPromise=function(t,e){this.callbacks.push(e)},e.promise=function(){var t=hn(ln().mark((function t(){var e,n,r,i,a=arguments;return ln().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.callbacks.length){t.next=14;break}return t.next=3,(e=this.callbacks)[0].apply(e,a);case 3:n=t.sent,r=0;case 5:if(this.callbacks.length-1<=r){t.next=13;break}return i=this.callbacks[r],t.next=9,i(n);case 9:n=t.sent;case 10:r++,t.next=5;break;case 13:return t.abrupt("return",n);case 14:return t.abrupt("return",null);case 15:case"end":return t.stop()}}),t,this)})));return function(){return t.apply(this,arguments)}}(),t}(),Wr=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.tap=function(t,e){this.callbacks.push(e)},e.call=function(){for(var t=arguments.length,e=Array(t),n=0;t>n;n++)e[n]=arguments[n];this.callbacks.forEach((function(t){t.apply(void 0,e)}))},t}(),Hr=function(){function t(){this.callbacks=[]}var e=t.prototype;return e.tap=function(t,e){this.callbacks.push(e)},e.call=function(){if(this.callbacks.length){for(var t,e=(t=this.callbacks)[0].apply(t,arguments),n=0;this.callbacks.length-1>n;n++){e=(0,this.callbacks[n])(e)}return e}return null},t}(),qr=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],Kr=/([\"\'])[^\'\"]+\1/;var Zr=1,Qr="object"==typeof self&&self.self==self?self:"object"==typeof global&&global.global==global?global:{},$r=Date.now(),Jr={},ti=Date.now(),ei=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");var e=Date.now(),n=e-ti,r=n>16?0:16-n,i=Zr++;return Jr[i]=t,Object.keys(Jr).length>1||setTimeout((function(){ti=e;var t=Jr;Jr={},Object.keys(t).forEach((function(e){return t[e](Qr.performance&&"function"==typeof Qr.performance.now?Qr.performance.now():Date.now()-$r)}))}),r),i},ni=function(t){delete Jr[t]},ri=function(t){return"string"!=typeof t?ei:""===t?Qr.requestAnimationFrame:Qr[t+"RequestAnimationFrame"]},ii=function(t,e){for(var n=0;void 0!==t[n];){if(e(t[n]))return t[n];n+=1}}(["","webkit","moz","ms","o"],(function(t){return!!ri(t)})),ai=ri(ii),oi=function(t){return"string"!=typeof t?ni:""===t?Qr.cancelAnimationFrame:Qr[t+"CancelAnimationFrame"]||Qr[t+"CancelRequestAnimationFrame"]}(ii);Qr.requestAnimationFrame=ai,Qr.cancelAnimationFrame=oi;var si=/^l\s*\(\s*([\d.]+)\s*\)\s*(.*)/i,ui=/^r\s*\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)\s*(.*)/i,li=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,ci=/[\d.]+:(#[^\s]+|[^\)]+\))/gi;var hi={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},fi=On((function(t){return $n("angular"===t.type?Number(t.value):hi[t.value]||0,"deg")})),di=On((function(t){var e=50,n=50,r="%",i="%";if("position"===(null==t?void 0:t.type)){var a=t.value,o=a.x,s=a.y;"position-keyword"===(null==o?void 0:o.type)&&("left"===o.value?e=0:"center"===o.value?e=50:"right"===o.value?e=100:"top"===o.value?n=0:"bottom"===o.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==o?void 0:o.type)&&"%"!==(null==o?void 0:o.type)&&"em"!==(null==o?void 0:o.type)||(r=null==o?void 0:o.type,e=Number(o.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:$n(e,r),cy:$n(n,i)}})),pi=On((function(e){if(e.indexOf("linear")>-1||e.indexOf("radial")>-1)return Or(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,a=Number(t[0].length.value),o=1;r>o;o++){var s,u=null===(s=t[o].length)||void 0===s?void 0:s.value;if(!$t(u)&&!$t(a)){for(var l=1;o-i>l;l++)t[i+l].length={type:"%",value:""+(a+(Number(u)-a)*l/(o-i))};i=o,a=Number(u)}}}(i);var a=i.map((function(t){return{offset:$n(Number(t.length.value),"%"),color:Cr(t)}}));if("linear-gradient"===n)return new Cn(t.GradientType.LinearGradient,{angle:r?fi(r):Vn,steps:a});if("radial-gradient"===n&&(r||(r=[{type:"shape",value:"circle"}]),"shape"===r[0].type&&"circle"===r[0].value)){var o,s=di(r[0].at),u=s.cx,l=s.cy;if(r[0].style){var c=r[0].style,h=c.type,f=c.value;o="extent-keyword"===h?qn(f):$n(f,h)}return new Cn(t.GradientType.RadialGradient,{cx:u,cy:l,size:o,steps:a})}}));var n=e[0];if("("===e[1]||"("===e[2])if("l"===n){var r=si.exec(e);if(r){var i,a=(null===(i=r[2].match(ci))||void 0===i?void 0:i.map((function(t){return t.split(":")})))||[];return[new Cn(t.GradientType.LinearGradient,{angle:$n(parseFloat(r[1]),"deg"),steps:a.map((function(t){var e=t[1];return{offset:$n(100*Number(t[0]),"%"),color:e}}))})]}}else if("r"===n){var o=function(t){var e=ui.exec(t);if(e){var n,r=(null===(n=e[4].match(ci))||void 0===n?void 0:n.map((function(t){return t.split(":")})))||[];return{cx:$n(50,"%"),cy:$n(50,"%"),steps:r.map((function(t){var e=t[1];return{offset:$n(100*Number(t[0]),"%"),color:e}}))}}return null}(e);if(o){if(!ae(o))return[new Cn(t.GradientType.RadialGradient,o)];e=o}}else if("p"===n)return function(t){var e=li.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 vi(t){return t&&!!t.image}function mi(t){return t&&!$t(t.r)&&!$t(t.g)&&!$t(t.b)}var gi=On((function(t){if(vi(t))return pn({repetition:"repeat"},t);if($t(t)&&(t=""),"transparent"===t)return Zn;"currentColor"===t&&(t="black");var e=pi(t);if(e)return e;var n=Ae(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),Qn.apply(void 0,r)}));function yi(t,e){if(mi(t)&&mi(e))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(oe(e[n],0,255));return e[3]=oe(e[3],0,1),"rgba("+e.join(",")+")"}]}function xi(t,e){if($t(e))return $n(0,"px");if(e=(""+e).trim().toLowerCase(),isFinite(Number(e))){if("px".search(t)>=0)return $n(Number(e),"px");if("deg".search(t)>=0)return $n(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 $n(Number(e.replace(RegExp("U"+t,"g"),"").replace(RegExp(r,"g"),"*0")),t)}))[0]}var Ei=On((function(t){return xi(/px/g,t)})),bi=(On((function(t){return xi(RegExp("%","g"),t)})),function(t){return se(t)||isFinite(Number(t))?$n(Number(t)||0,"px"):xi(RegExp("px|%|em|rem","g"),t)}),Ti=On((function(t){return xi(/deg|rad|grad|turn/g,t)}));function Mi(t,e,n,r,i){void 0===i&&(i=0);var a="",o=t.value||0,s=e.value||0,u=Gn(t.unit),l=t.convertTo(u),c=e.convertTo(u);return l&&c?(o=l.value,s=c.value,a=wn(t.unit)):(Un.isLength(t.unit)||Un.isLength(e.unit))&&(o=ki(t,i,n),s=ki(e,i,n),a="px"),[o,s,function(t){return r&&(t=Math.max(t,0)),t+a}]}function Si(e){var n=0;return e.unit===t.UnitType.kDegrees?n=e.value:e.unit===t.UnitType.kRadians?n=mr(Number(e.value)):e.unit===t.UnitType.kTurns&&(n=gr(Number(e.value))),n}function Pi(t,e){var n;return Array.isArray(t)?n=t.map((function(t){return Number(t)})):ae(t)?n=t.split(" ").map((function(t){return Number(t)})):se(t)&&(n=[t]),2===e?1===n.length?[n[0],n[0]]:[n[0],n[1]]:1===n.length?[n[0],n[0],n[0],n[0]]:2===n.length?[n[0],n[1],n[0],n[1]]:3===n.length?[n[0],n[1],n[2],n[1]]:[n[0],n[1],n[2],n[3]]}function wi(t){return ae(t)?t.split(" ").map((function(t){return bi(t)})):t.map((function(t){return bi(""+t)}))}function ki(e,n,r){if(0===e.value)return 0;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.geometry.contentBounds;return e.value/100*i.halfExtents[n]*2}return 0}var Ni=["blur","brightness","drop-shadow","contrast","grayscale","sepia","saturate","hue-rotate","invert"];function Ci(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,Ni.indexOf(e[1])>-1&&r.push({name:e[1],params:e[2].split(" ").map((function(t){return xi(/deg|rad|grad|turn|px|%/g,t)||gi(t)}))}),n.lastIndex===t.length)return r}return[]}function Ai(t){return""+t}var Oi=On((function(t){return $n("number"==typeof t?t:/^\s*[-+]?(\d*\.)?\d+\s*$/.test(t)?Number(t):0)}));On((function(t){return ae(t)?t.split(" ").map(Oi):t.map(Oi)}));function Ri(t,e){return[t,e,Ai]}function Li(t,e){return function(n,r){return[n,r,function(n){return Ai(oe(n,t,e))}]}}function Ii(t,e){if(t.length===e.length)return[t,e,function(t){return t}]}var _i=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=Rt(t)}catch(n){e=Rt(""),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 a=t[i],o=a[0];"M"===o?(r.length&&(n.push(r),r=[]),r.push([a[1],a[2]])):"Z"===o?r.length&&(e.push(r),r=[]):r.push([a[1],a[2]])}return r.length>0&&n.push(r),{polygons:e,polylines:n}}(e),i=r.polygons,a=r.polylines,o=function(t){for(var e=[],n=null,r=null,i=null,a=0,o=t.length,s=0;o>s;s++){var u=t[s];r=t[s+1];var l=u[0],c={command:l,prePoint:n,params:u,startTangent:null,endTangent:null,currentPoint:null,nextPoint:null,arcParams:null,box:null,cubicParams:null};switch(l){case"M":i=[u[1],u[2]],a=s;break;case"A":var h=jr(n,u);c.arcParams=h}if("Z"===l)n=i,r=t[a+1];else{var f=u.length;n=[u[f-2],u[f-1]]}r&&"Z"===r[0]&&(r=t[a],e[a]&&(e[a].prePoint=n)),c.currentPoint=n,e[a]&&Lr(n,e[a].currentPoint)&&(e[a].prePoint=c.prePoint),c.nextPoint=r?[r[r.length-2],r[r.length-1]]:null;var d=c.prePoint;if(["L","H","V"].includes(l))c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]];else if("Q"===l){var p=[u[1],u[2]];c.startTangent=[d[0]-p[0],d[1]-p[1]],c.endTangent=[n[0]-p[0],n[1]-p[1]]}else if("T"===l){var v=e[s-1],m=_r(v.currentPoint,d);"Q"===v.command?(c.command="Q",c.startTangent=[d[0]-m[0],d[1]-m[1]],c.endTangent=[n[0]-m[0],n[1]-m[1]]):(c.command="TL",c.startTangent=[d[0]-n[0],d[1]-n[1]],c.endTangent=[n[0]-d[0],n[1]-d[1]])}else if("C"===l){var g=[u[1],u[2]],y=[u[3],u[4]];c.startTangent=[d[0]-g[0],d[1]-g[1]],c.endTangent=[n[0]-y[0],n[1]-y[1]],0===c.startTangent[0]&&0===c.startTangent[1]&&(c.startTangent=[g[0]-y[0],g[1]-y[1]]),0===c.endTangent[0]&&0===c.endTangent[1]&&(c.endTangent=[y[0]-g[0],y[1]-g[1]])}else if("S"===l){var x=e[s-1],E=_r(x.currentPoint,d),b=[u[1],u[2]];"C"===x.command?(c.command="C",c.startTangent=[d[0]-E[0],d[1]-E[1]],c.endTangent=[n[0]-b[0],n[1]-b[1]]):(c.command="SQ",c.startTangent=[d[0]-b[0],d[1]-b[1]],c.endTangent=[n[0]-b[0],n[1]-b[1]])}else if("A"===l){var T=Gr(c,0),M=T.x,S=T.y,P=Gr(c,1,!1),w=P.x,k=P.y;c.startTangent=[M,S],c.endTangent=[w,k]}e.push(c)}return e}(e),s=function(t,e){for(var n=[],r=[],i=[],a=0;t.length>a;a++){var o=t[a],s=o.currentPoint,u=o.params,l=o.prePoint,c=void 0;switch(o.command){case"Q":c=He(l[0],l[1],u[1],u[2],u[3],u[4]);break;case"C":c=Ze(l[0],l[1],u[1],u[2],u[3],u[4],u[5],u[6]);break;case"A":var h=o.arcParams;c=Je(h.cx,h.cy,h.rx,h.ry,h.xRotation,h.startAngle,h.endAngle);break;default:n.push(s[0]),r.push(s[1])}c&&(o.box=c,n.push(c.x,c.x+c.width),r.push(c.y,c.y+c.height)),e&&("L"===o.command||"M"===o.command)&&o.prePoint&&o.nextPoint&&i.push(o)}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=ie(n),d=ie(r),p=re(n),v=re(r);if(0===i.length)return{x:f,y:d,width:p-f,height:v-d};for(var m=0;i.length>m;m++){var g=i[m],y=g.currentPoint;y[0]===f?f-=Ir(g,e).xExtra:y[0]===p&&(p+=Ir(g,e).xExtra),y[1]===d?d-=Ir(g,e).yExtra:y[1]===v&&(v+=Ir(g,e).yExtra)}return{x:f,y:d,width:p-f,height:v-d}}(o,0),u=s.x,l=s.y,c=s.width,h=s.height;return{absolutePath:e,hasArc:n,segments:o,polygons:i,polylines:a,totalLength:0,rect:{x:Number.isFinite(u)?u:0,y:Number.isFinite(l)?l:0,width:Number.isFinite(c)?c:0,height:Number.isFinite(h)?h:0}}},Di=On(_i);function Fi(t,e){var n=ae(t)?Di(t):_i(t);return e&&(e.parsedStyle.defX=n.rect.x,e.parsedStyle.defY=n.rect.y),n}function Gi(t,e,n){var r=t.curve,i=e.curve;r&&0!==r.length||(r=Bt(t.absolutePath,!1),t.curve=r),i&&0!==i.length||(i=Bt(e.absolutePath,!1),e.curve=i);var a=[r,i];r.length!==i.length&&(a=Qt(r,i));var o,s,u,l,c,h,f,d,p=Kt(a[0])!==Kt(a[1])?(s=(o=a[0]).slice(1).map((function(t,e,n){return e?n[e-1].slice(-2).concat(t.slice(1)):o[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))})))):pt(a[0]);return[p,(u=a[1],l=p,c=u.length-1,h=[],f=0,d=function(t){var e=t.length,n=e-1;return t.map((function(r,i){return t.map((function(r,a){var o=i+a;return 0===a||t[o]&&"M"===t[o][0]?["M"].concat(t[o].slice(-2)):(e>o||(o-=n),t[o])}))}))}(u),d.forEach((function(t,e){u.slice(1).forEach((function(t,n){f+=Dt(u[(e+n)%c].slice(-2),l[n%c].slice(-2))})),h[e]=f,f=0})),d[h.indexOf(Math.min.apply(null,h))]),function(t){return t}]}function Ui(t,e){var n;n=ae(t)?t.split(" ").map((function(t){var e=t.split(","),n=e[1];return[Number(e[0]),Number(n)]})):t;var r,i,a=[],o=0,s=sn(n);n.forEach((function(t,e){n[e+1]&&((r=[0,0])[0]=o/s,i=ze.length(t[0],t[1],n[e+1][0],n[e+1][1]),r[1]=(o+=i)/s,a.push(r))}));var u=Math.min.apply(Math,n.map((function(t){return t[0]}))),l=Math.min.apply(Math,n.map((function(t){return t[1]})));return e&&(e.parsedStyle.defX=u,e.parsedStyle.defY=l),{points:n,totalLength:s,segments:a}}function Bi(t,e){return[t.points,e.points,function(t){return t}]}var Vi=null;function ji(t){return function(e){var n=0;return t.map((function(t){return t===Vi?e[n++]:t}))}}function Yi(t){return t}var zi={matrix:["NNNNNN",[Vi,Vi,0,0,Vi,Vi,0,0,0,0,1,0,Vi,Vi,0,1],Yi],matrix3d:["NNNNNNNNNNNNNNNN",Yi],rotate:["A"],rotatex:["A"],rotatey:["A"],rotatez:["A"],rotate3d:["NNNA"],perspective:["L"],scale:["Nn",ji([Vi,Vi,new Un(1)]),Yi],scalex:["N",ji([Vi,new Un(1),new Un(1)]),ji([Vi,new Un(1)])],scaley:["N",ji([new Un(1),Vi,new Un(1)]),ji([new Un(1),Vi])],scalez:["N",ji([new Un(1),new Un(1),Vi])],scale3d:["NNN",Yi],skew:["Aa",null,Yi],skewx:["A",null,ji([Vi,Vn])],skewy:["A",null,ji([Vn,Vi])],translate:["Tt",ji([Vi,Vi,Bn]),Yi],translatex:["T",ji([Vi,Bn,Bn]),ji([Vi,Bn])],translatey:["T",ji([Bn,Vi,Bn]),ji([Bn,Vi])],translatez:["L",ji([Bn,Bn,Vi])],translate3d:["TTL",Yi]};function Xi(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 a=e[1],o=zi[a];if(!o)return[];var s=e[2].split(","),u=o[0];if(s.length>u.length)return[];for(var l=[],c=0;u.length>c;c++){var h=s[c],f=u[c],d=void 0;if(void 0===(d=h?{A:function(t){return"0"===t.trim()?Vn:Ti(t)},N:Oi,T:bi,L:Ei}[f.toUpperCase()](h):{a:Vn,n:l[0],t:Bn}[f]))return[];l.push(d)}if(r.push({t:a,d:l}),n.lastIndex===t.length)return r}return[]}function Wi(t){var e,n,r,i;switch(t.t){case"rotatex":return i=vr(Si(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=vr(Si(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=vr(Si(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=vr(Si(t.d[3]));var a=e*e+n*n+r*r;if(0===a)e=1,n=0,r=0;else if(1!==a){var o=Math.sqrt(a);e/=o,n/=o,r/=o}var s=Math.sin(i/2),u=s*Math.cos(i/2),l=s*s;return[1-2*(n*n+r*r)*l,2*(e*n*l+r*u),2*(e*r*l-n*u),0,2*(e*n*l-r*u),1-2*(e*e+r*r)*l,2*(n*r*l+e*u),0,2*(e*r*l+n*u),2*(n*r*l-e*u),1-2*(e*e+n*n)*l,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 c=vr(Si(t.d[0])),h=vr(Si(t.d[1]));return[1,Math.tan(h),0,0,Math.tan(c),1,0,0,0,0,1,0,0,0,0,1];case"skewx":return i=vr(Si(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=vr(Si(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=ki(t.d[0],0,null)||0,n=ki(t.d[1],0,null)||0,0,1];case"translatex":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ki(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=ki(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=ki(t.d[0],0,null)||0,1];case"translate3d":return[1,0,0,0,0,1,0,0,0,0,1,0,e=ki(t.d[0],0,null)||0,n=ki(t.d[1],0,null)||0,r=ki(t.d[2],0,null)||0,1];case"perspective":var f=ki(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 qi(t){var e=[0,0,0],n=[1,1,1],r=[0,0,0],i=[0,0,0,1],a=[0,0,0,1];return function(t,e,n,r,i,a){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}(br,t))return!1;if(u(Tr,br),Tr[3]=0,Tr[7]=0,Tr[11]=0,Tr[15]=1,1e-8>Math.abs(d(Tr)))return!1;var o,s,l=br[3],c=br[7],p=br[11],v=br[12],m=br[13],g=br[14],y=br[15];if(0!==l||0!==c||0!==p){if(Mr[0]=l,Mr[1]=c,Mr[2]=p,Mr[3]=y,!f(Tr,Tr))return!1;h(Tr,Tr),Q(i,Mr,Tr)}else i[0]=i[1]=i[2]=0,i[3]=1;if(e[0]=v,e[1]=m,e[2]=g,(o=Sr)[0][0]=(s=br)[0],o[0][1]=s[1],o[0][2]=s[2],o[1][0]=s[4],o[1][1]=s[5],o[1][2]=s[6],o[2][0]=s[8],o[2][1]=s[9],o[2][2]=s[10],n[0]=I(Sr[0]),V(Sr[0],Sr[0]),r[0]=j(Sr[0],Sr[1]),wr(Sr[1],Sr[1],Sr[0],1,-r[0]),n[1]=I(Sr[1]),V(Sr[1],Sr[1]),r[0]/=n[1],r[1]=j(Sr[0],Sr[2]),wr(Sr[2],Sr[2],Sr[0],1,-r[1]),r[2]=j(Sr[1],Sr[2]),wr(Sr[2],Sr[2],Sr[1],1,-r[2]),n[2]=I(Sr[2]),V(Sr[2],Sr[2]),r[1]/=n[2],r[2]/=n[2],Y(Pr,Sr[1],Sr[2]),0>j(Sr[0],Pr))for(var x=0;3>x;x++)n[x]*=-1,Sr[x][0]*=-1,Sr[x][1]*=-1,Sr[x][2]*=-1;a[0]=.5*Math.sqrt(Math.max(1+Sr[0][0]-Sr[1][1]-Sr[2][2],0)),a[1]=.5*Math.sqrt(Math.max(1-Sr[0][0]+Sr[1][1]-Sr[2][2],0)),a[2]=.5*Math.sqrt(Math.max(1-Sr[0][0]-Sr[1][1]+Sr[2][2],0)),a[3]=.5*Math.sqrt(Math.max(1+Sr[0][0]+Sr[1][1]+Sr[2][2],0)),Sr[2][1]>Sr[1][2]&&(a[0]=-a[0]),Sr[0][2]>Sr[2][0]&&(a[1]=-a[1]),Sr[1][0]>Sr[0][1]&&(a[2]=-a[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(Hi)}(t),e,n,r,i,a),[[e,n,r,a,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 a=0;4>a;a++)n[r][i]+=e[r][a]*t[a][i];return n}return function(e,n,r,i,a){for(var o=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]],s=0;4>s;s++)o[s][3]=a[s];for(var u=0;3>u;u++)for(var l=0;3>l;l++)o[3][u]+=e[l]*o[l][u];var c=i[0],h=i[1],f=i[2],d=i[3],p=[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]];p[0][0]=1-2*(h*h+f*f),p[0][1]=2*(c*h-f*d),p[0][2]=2*(c*f+h*d),p[1][0]=2*(c*h+f*d),p[1][1]=1-2*(c*c+f*f),p[1][2]=2*(h*f-c*d),p[2][0]=2*(c*f-h*d),p[2][1]=2*(h*f+c*d),p[2][2]=1-2*(c*c+h*h),o=t(o,p);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],o=t(o,m)),r[1]&&(m[2][1]=0,m[2][0]=r[0],o=t(o,m)),r[0]&&(m[2][0]=0,m[1][0]=r[0],o=t(o,m));for(var g=0;3>g;g++)for(var y=0;3>y;y++)o[g][y]*=n[g];return 0==(v=o)[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]?[o[0][0],o[0][1],o[1][0],o[1][1],o[3][0],o[3][1]]:o[0].concat(o[1],o[2],o[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=oe(r,-1,1);var i=[];if(1===r)i=t;else for(var a=Math.acos(r),o=1*Math.sin(n*a)/Math.sqrt(1-r*r),s=0;4>s;s++)i.push(t[s]*(Math.cos(n*a)-r*o)+e[s]*o);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 $i(t){return t.replace(/[xy]/,"")}function Ji(t){return t.replace(/(x|y|z|3d)?$/,"3d")}function ta(t,e,n){var r=!1;if(!t.length||!e.length){t.length||(r=!0,t=e,e=[]);for(var i=function(){var n=t[a],r=n.t,i=n.d,o="scale"===r.substring(0,5)?1:0;e.push({t:r,d:i.map((function(t){return"number"==typeof t?$n(o):$n(o,t.unit)}))})},a=0;t.length>a;a++)i()}var o,s,u=[],l=[],c=[];if(t.length!==e.length){var h=Qi(t,e);u=[h[0]],l=[h[1]],c=[["matrix",[h[2]]]]}else for(var f=0;t.length>f;f++){var d=t[f].t,p=e[f].t,v=t[f].d,m=e[f].d,g=zi[d],y=zi[p],x=void 0;if(s=p,"perspective"===(o=d)&&"perspective"===s||!("matrix"!==o&&"matrix3d"!==o||"matrix"!==s&&"matrix3d"!==s)){var E=Qi([t[f]],[e[f]]);u.push(E[0]),l.push(E[1]),c.push(["matrix",[E[2]]])}else{if(d===p)x=d;else if(g[2]&&y[2]&&$i(d)===$i(p))x=$i(d),v=g[2](v),m=y[2](m);else{if(!g[1]||!y[1]||Ji(d)!==Ji(p)){var b=Qi(t,e);u=[b[0]],l=[b[1]],c=[["matrix",[b[2]]]];break}x=Ji(d),v=g[1](v),m=y[1](m)}for(var T=[],M=[],S=[],P=0;v.length>P;P++){var w=Mi(v[P],m[P],n,!1,P);T[P]=w[0],M[P]=w[1],S.push(w[2])}u.push(T),l.push(M),c.push([x,S])}}if(r){var k=u;u=l,l=k}return[u,l,function(t){return t.map((function(t,e){var n=t.map((function(t,n){return c[e][1][n](t)})).join(",");return"matrix"===c[e][0]&&16===n.split(",").length&&(c[e][0]="matrix3d"),"matrix3d"===c[e][0]&&6===n.split(",").length&&(c[e][0]="matrix"),c[e][0]+"("+n+")"})).join(" ")}]}var ea=On((function(t){if(ae(t)){if("text-anchor"===t)return[$n(0,"px"),$n(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:[bi(na(e[0])),bi(na(e[1]))]}return[$n(t[0]||0,"px"),$n(t[1]||0,"px")]}));function na(t){return"center"===t?"50%":"left"===t||"top"===t?"0":"right"===t||"bottom"===t?"100%":t}var ra=function(){function t(){this.parser=Ti,this.parserWithCSSDisabled=null,this.mixer=Ri}return t.prototype.calculator=function(t,e,n,r){return Si(n)},t}(),ia=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){return n instanceof An&&(n=null),ls.sceneGraphService.updateDisplayObjectDependency(t,e,n,r),"clipPath"===t&&r.forEach((function(t){0===t.childNodes.length&&ls.sceneGraphService.dirtifyToRoot(t)})),n},t}(),aa=function(){function t(){this.parser=gi,this.parserWithCSSDisabled=gi,this.mixer=yi}return t.prototype.calculator=function(t,e,n,r){return n instanceof An?"none"===n.value?Kn:Zn:n},t}(),oa=function(){function t(){this.parser=Ci}return t.prototype.calculator=function(t,e,n){return n instanceof An?[]:n},t}();function sa(t){var e=t.parsedStyle.fontSize;return $t(e)?null:e}var ua,la=function(){function e(){this.parser=bi,this.parserWithCSSDisabled=null,this.mixer=Ri}return e.prototype.calculator=function(e,n,r,i,a){if(se(r))return r;if(!Un.isRelativeUnit(r.unit))return r.value;if(r.unit===t.UnitType.kPercentage)return 0;if(r.unit===t.UnitType.kEms){if(i.parentNode){var o=sa(i.parentNode);if(o)return o*=r.value;a.addUnresolveProperty(i,e)}else a.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=sa(i.ownerDocument.documentElement);if(u)return u*=r.value;a.addUnresolveProperty(i,e)}else a.addUnresolveProperty(i,e);return 0}},e}(),ca=function(){function t(){this.mixer=Ii}var e=t.prototype;return e.parser=function(t){var e=wi(se(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}(),ha=function(){function t(){this.mixer=Ii}var e=t.prototype;return e.parser=function(t){var e=wi(se(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}(),fa=function(e){function n(){return e.apply(this,arguments)||this}return vn(n,e),n.prototype.postProcessor=function(e,n){var r,i,a;switch(e.nodeName){case t.Shape.CIRCLE:case t.Shape.ELLIPSE:var o=e.parsedStyle,s=o.cx,u=o.cy,l=o.cz;$t(s)||(r=s),$t(u)||(i=u),$t(l)||(a=l);break;case t.Shape.LINE:var c=e.parsedStyle,h=c.y1,f=c.y2;r=Math.min(c.x1,c.x2),i=Math.min(h,f),a=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:$t(e.parsedStyle.x)||(r=e.parsedStyle.x),$t(e.parsedStyle.y)||(i=e.parsedStyle.y),$t(e.parsedStyle.z)||(a=e.parsedStyle.z)}if(e.nodeName!==t.Shape.PATH&&e.nodeName!==t.Shape.POLYLINE&&e.nodeName!==t.Shape.POLYGON&&(e.parsedStyle.defX=r||0,e.parsedStyle.defY=i||0),(!$t(r)||!$t(i)||!$t(a))&&-1===n.indexOf("transform")){var d=e.parsedStyle.transform;if(d&&d.length)Nr(d,e);else{var p=e.getLocalPosition(),v=p[0],m=p[1],g=p[2];e.setLocalPosition($t(r)?v:r,$t(i)?m:i,$t(a)?g:a)}}},n}(la),da=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i;n instanceof An&&(n=null);var a=null===(i=n)||void 0===i?void 0:i.cloneNode(!0);return a&&(a.style.isMarker=!0),a},t}(),pa=function(){function t(){this.mixer=Ri,this.parser=Oi,this.parserWithCSSDisabled=null}return t.prototype.calculator=function(t,e,n){return n.value},t}(),va=function(){function e(){this.parser=Oi,this.parserWithCSSDisabled=null,this.mixer=Li(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 a=r.getPoint(n.offsetDistance);a&&(e.parsedStyle.defX=a.x,e.parsedStyle.defY=a.y,e.setLocalPosition(a.x,a.y))}}},e}(),ma=function(){function t(){this.parser=Oi,this.parserWithCSSDisabled=null,this.mixer=Li(0,1)}return t.prototype.calculator=function(t,e,n){return n.value},t}(),ga=function(){function t(){this.center=[0,0,0],this.halfExtents=[0,0,0],this.min=[0,0,0],this.max=[0,0,0]}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){lr(this.center,t),lr(this.halfExtents,e),cr(this.min,this.center,this.halfExtents),hr(this.max,this.center,this.halfExtents)},e.setMinMax=function(t,e){hr(this.center,e,t),fr(this.center,this.center,.5),cr(this.halfExtents,e,t),fr(this.halfExtents,this.halfExtents,.5),lr(this.min,t),lr(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],a=n[2],o=this.halfExtents,s=o[0],u=o[1],l=o[2],c=r-s,h=r+s,f=i-u,d=i+u,p=a-l,v=a+l,m=e.center,g=m[0],y=m[1],x=m[2],E=e.halfExtents,b=E[0],T=E[1],M=E[2],S=g-b,P=g+b,w=y-T,k=y+T,N=x-M,C=x+M;c>S&&(c=S),P>h&&(h=P),f>w&&(f=w),k>d&&(d=k),p>N&&(p=N),C>v&&(v=C),n[0]=.5*(c+h),n[1]=.5*(f+d),n[2]=.5*(p+v),o[0]=.5*(h-c),o[1]=.5*(d-f),o[2]=.5*(v-p),this.min[0]=c,this.min[1]=f,this.min[2]=p,this.max[0]=h,this.max[1]=d,this.max[2]=v}},e.setFromTransformedAABB=function(t,e){var n=this.center,r=this.halfExtents,i=t.center,a=t.halfExtents,o=e[0],s=e[4],u=e[8],l=e[1],c=e[5],h=e[9],f=e[2],d=e[6],p=e[10],v=Math.abs(o),m=Math.abs(s),g=Math.abs(u),y=Math.abs(l),x=Math.abs(c),E=Math.abs(h),b=Math.abs(f),T=Math.abs(d),M=Math.abs(p);n[0]=e[12]+o*i[0]+s*i[1]+u*i[2],n[1]=e[13]+l*i[0]+c*i[1]+h*i[2],n[2]=e[14]+f*i[0]+d*i[1]+p*i[2],r[0]=v*a[0]+m*a[1]+g*a[2],r[1]=y*a[0]+x*a[1]+E*a[2],r[2]=b*a[0]+T*a[1]+M*a[2],cr(this.min,n,r),hr(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,a=new t,o=(n=[0,0,0],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}([0,0,0],this.getMax(),e.getMax());return a.setMinMax(o,s),a},e.getNegativeFarPoint=function(t){return 273===t.pnVertexFlag?lr([0,0,0],this.min):272===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:257===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:256===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:17===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:16===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:1===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:[this.max[0],this.max[1],this.max[2]]},e.getPositiveFarPoint=function(t){return 273===t.pnVertexFlag?lr([0,0,0],this.max):272===t.pnVertexFlag?[this.max[0],this.max[1],this.min[2]]:257===t.pnVertexFlag?[this.max[0],this.min[1],this.max[2]]:256===t.pnVertexFlag?[this.max[0],this.min[1],this.min[2]]:17===t.pnVertexFlag?[this.min[0],this.max[1],this.max[2]]:16===t.pnVertexFlag?[this.min[0],this.max[1],this.min[2]]:1===t.pnVertexFlag?[this.min[0],this.min[1],this.max[2]]:[this.min[0],this.min[1],this.min[2]]},t}(),ya=function(){function t(t,e){this.distance=void 0,this.normal=void 0,this.pnVertexFlag=void 0,this.distance=t||0,this.normal=e||_(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 j(t,this.normal)-this.distance},e.normalize=function(){var t=1/K(this.normal);B(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)),a=i>=0&&1>=i;return a&&n&&z(n,t,e,i),a},t}();(ua=t.Mask||(t.Mask={}))[ua.OUTSIDE=4294967295]="OUTSIDE",ua[ua.INSIDE=0]="INSIDE",ua[ua.INDETERMINATE=2147483647]="INDETERMINATE";var xa=function(){function t(t){if(this.planes=[],t)this.planes=t;else for(var e=0;6>e;e++)this.planes.push(new ya)}return t.prototype.extractFromVPMatrix=function(t){var e=t[0],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],u=t[7],l=t[8],c=t[9],h=t[10],f=t[11],d=t[12],p=t[13],v=t[14],m=t[15];F(this.planes[0].normal,i-e,u-a,f-l),this.planes[0].distance=m-d,F(this.planes[1].normal,i+e,u+a,f+l),this.planes[1].distance=m+d,F(this.planes[2].normal,i+n,u+o,f+c),this.planes[2].distance=m+p,F(this.planes[3].normal,i-n,u-o,f-c),this.planes[3].distance=m-p,F(this.planes[4].normal,i-r,u-s,f-h),this.planes[4].distance=m-v,F(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}(),Ea=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}(),ba=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}(),Ta=function(){function e(){this.parser=Fi,this.parserWithCSSDisabled=Fi,this.mixer=Gi}var n=e.prototype;return n.calculator=function(t,e,n){return n instanceof An&&"unset"===n.value?{absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ba(0,0,0,0)}:n},n.postProcessor=function(e,n){if(e.nodeName===t.Shape.PATH&&-1===n.indexOf("transform")){var r=e.parsedStyle,i=r.defX,a=r.defY;e.setLocalPosition(void 0===i?0:i,void 0===a?0:a)}},e}(),Ma=function(){function e(){this.parser=Ui,this.mixer=Bi}return e.prototype.postProcessor=function(e,n){if((e.nodeName===t.Shape.POLYGON||e.nodeName===t.Shape.POLYLINE)&&-1===n.indexOf("transform")){var r=e.parsedStyle;e.setLocalPosition(r.defX,r.defY)}},e}(),Sa=function(t){function e(){for(var e,n=arguments.length,r=Array(n),i=0;n>i;i++)r[i]=arguments[i];return(e=t.call.apply(t,[this].concat(r))||this).mixer=Li(0,1/0),e}return vn(e,t),e}(la),Pa=function(){function t(){}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof An?"unset"===n.value?"":n.value:""+n},e.postProcessor=function(t){t.nodeValue=""+t.parsedStyle.text||""},t}(),wa=function(){function t(){}return t.prototype.calculator=function(t,e,n,r){var i=r.getAttribute("text");if(i){var a=i;"capitalize"===n.value?a=i.charAt(0).toUpperCase()+i.slice(1):"lowercase"===n.value?a=i.toLowerCase():"uppercase"===n.value&&(a=i.toUpperCase()),r.parsedStyle.text=a}return n.value},t}(),ka=function(){function t(){this.parser=Xi,this.parserWithCSSDisabled=Xi,this.mixer=ta}var e=t.prototype;return e.calculator=function(t,e,n,r){return n instanceof An?[]:n},e.postProcessor=function(t){Nr(t.parsedStyle.transform,t)},t}(),Na=function(){this.parser=ea},Ca=function(){function t(){this.parser=Oi}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}(),Aa=function(){function e(){this.registry={},this.define(t.Shape.CIRCLE,oo),this.define(t.Shape.ELLIPSE,co),this.define(t.Shape.RECT,No),this.define(t.Shape.IMAGE,go),this.define(t.Shape.LINE,xo),this.define(t.Shape.GROUP,fo),this.define(t.Shape.PATH,To),this.define(t.Shape.POLYGON,So),this.define(t.Shape.POLYLINE,wo),this.define(t.Shape.TEXT,Ao),this.define(t.Shape.HTML,vo)}var n=e.prototype;return n.define=function(t,e){this.registry[t]=e},n.get=function(t){return this.registry[t]},e}();function Oa(t){return!!t.type}var Ra=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 Ea,this.page=new Ea,this.canvas=new Ea,this.viewport=new Ea,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 Error(or)},dn(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}(),La=function(t){function e(e,n){var r;return(r=t.call(this,null)||this).type=e,r.detail=n,Object.assign(yn(r),n),r}return vn(e,t),e}(Ra),Ia=function(){function t(){this.emitter=new un}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=ce(n)&&n||ne(n)&&n.capture,i=ne(n)&&n.once,a=In(e)?void 0:e,o=!1,s="";if(t.indexOf(":")>-1){var u=t.split(":");t=u[1],s=u[0],o=!0}if(t=r?t+"capture":t,e=In(e)?e:e.handleEvent,o){var l=e;e=function(){for(var t,e=arguments.length,n=Array(e),r=0;e>r;r++)n[r]=arguments[r];(null===(t=n[0].target)||void 0===t?void 0:t.name)===s&&l.apply(void 0,n)}}return i?this.emitter.once(t,e,a):this.emitter.on(t,e,a),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=ce(n)&&n||ne(n)&&n.capture,a=In(e)?void 0:e;return t=i?t+"capture":t,e=In(e)?e:null===(r=e)||void 0===r?void 0:r.handleEvent,this.emitter.off(t,e,a),this},e.emit=function(t,e){this.dispatchEvent(new La(t,e))},e.dispatchEvent=function(t,e){if(void 0===e&&(e=!1),!Oa(t))throw 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}(),_a=function(e){function n(){for(var t,n=arguments.length,r=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}vn(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 Error(or)},r.lookupNamespaceURI=function(t){throw Error(or)},r.lookupPrefix=function(t){throw Error(or)},r.normalize=function(){throw 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;for(var e=t,r=this,i=[e],a=[r];null!==(o=e.parentNode)&&void 0!==o?o:r.parentNode;){var o;e=e.parentNode?(i.push(e.parentNode),e.parentNode):e,r=r.parentNode?(a.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>a.length?i:a,u=s===i?a: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 l=s.length-u.length,c=u.length-1;c>=0;c--){var h=u[c],f=s[l+c];if(f!==h){var d=h.parentNode.childNodes;return d.indexOf(h)<d.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,e){void 0===e&&(e=!1),t(this)||(e?this.childNodes.slice():this.childNodes).forEach((function(e){e.forEach(t)}))},dn(n,[{key:"textContent",get:function(){var e="";this.nodeName===t.Shape.TEXT&&(e+=this.style.text);for(var n,r=En(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}(Ia);_a.DOCUMENT_POSITION_DISCONNECTED=1,_a.DOCUMENT_POSITION_PRECEDING=2,_a.DOCUMENT_POSITION_FOLLOWING=4,_a.DOCUMENT_POSITION_CONTAINS=8,_a.DOCUMENT_POSITION_CONTAINED_BY=16,_a.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC=32;var Da,Fa,Ga=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 ls.AnimationTimeline(yn(n))}catch(t){}var r={};return Oo.forEach((function(e){var n=e.d;e.inh&&n&&(r[e.n]=In(n)?n(t.Shape.GROUP):n)})),n.documentElement=new fo({id:"g-root",style:r}),n.documentElement.ownerDocument=yn(n),n.documentElement.parentNode=yn(n),n.childNodes=[n.documentElement],n}vn(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?Ao:fo);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 Error(or)},r.destroy=function(){try{this.documentElement.destroyChildren(),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}),a=[];return i.forEach((function(t){var e=t.displayObject,n=["auto","visiblepainted","visiblefill","visiblestroke","visible"].includes(e.parsedStyle.pointerEvents);(!n||n&&e.isVisible())&&!e.isCulled()&&e.isInteractive()&&a.push(e)})),a.sort((function(t,e){return e.sortable.renderOrder-t.sortable.renderOrder})),a},r.elementFromPointSync=function(t,e){var n=this.defaultView.canvas2Viewport({x:t,y:e}),r=n.x,i=n.y,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return null;var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!0,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l&&l[0]||this.documentElement},r.elementFromPoint=function(){var t=hn(ln().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return ln().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",null);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!0,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,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,a=this.defaultView.getConfig();if(0>r||0>i||r>a.width||i>a.height)return[];var o=this.defaultView.viewport2Client({x:r,y:i}),s=o.x,u=o.y,l=this.defaultView.getRenderingService().hooks.pickSync.call({topmost:!1,position:{x:t,y:e,viewportX:r,viewportY:i,clientX:s,clientY:u},picked:[]}).picked;return l[l.length-1]!==this.documentElement&&l.push(this.documentElement),l},r.elementsFromPoint=function(){var t=hn(ln().mark((function t(e,n){var r,i,a,o,s,u,l,c,h,f;return ln().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=this.defaultView.canvas2Viewport({x:e,y:n}),i=r.x,a=r.y,o=this.defaultView.getConfig(),s=o.width,u=o.height,!(0>i||0>a||i>s||a>u)){t.next=4;break}return t.abrupt("return",[]);case 4:return l=this.defaultView.viewport2Client({x:i,y:a}),c=l.x,h=l.y,t.next=7,this.defaultView.getRenderingService().hooks.pick.promise({topmost:!1,position:{x:e,y:n,viewportX:i,viewportY:a,clientX:c,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 Error(sr)},r.insertBefore=function(t,e){throw Error(sr)},r.removeChild=function(t,e){throw Error(sr)},r.replaceChild=function(t,e,n){throw Error(sr)},r.append=function(){throw Error(sr)},r.prepend=function(){throw Error(sr)},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)},dn(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}(_a);(Da=t.Strategy||(t.Strategy={}))[Da.Standard=0]="Standard",(Fa=t.ElementEvent||(t.ElementEvent={})).REPARENT="reparent",Fa.DESTROY="destroy",Fa.ATTR_MODIFIED="DOMAttrModified",Fa.INSERTED="DOMNodeInserted",Fa.REMOVED="removed",Fa.MOUNTED="DOMNodeInsertedIntoDocument",Fa.UNMOUNTED="DOMNodeRemovedFromDocument",Fa.BOUNDS_CHANGED="bounds-changed",Fa.RENDER_ORDER_CHANGED="render-order-changed",Fa.CULLED="culled";var Ua=function(t){function e(e,n,r,i,a,o,s,u){var l;return(l=t.call(this,null)||this).relatedNode=void 0,l.prevValue=void 0,l.newValue=void 0,l.attrName=void 0,l.attrChange=void 0,l.prevParsedValue=void 0,l.newParsedValue=void 0,l.relatedNode=n,l.prevValue=r,l.newValue=i,l.attrName=a,l.attrChange=o,l.prevParsedValue=s,l.newParsedValue=u,l.type=e,l}return vn(e,t),e}(Ra);Ua.ADDITION=2,Ua.MODIFICATION=1,Ua.REMOVAL=3;var Ba=0;var Va=new Ua(t.ElementEvent.INSERTED,null,"","","",0,"",""),ja=new Ua(t.ElementEvent.REMOVED,null,"","","",0,"",""),Ya=new La(t.ElementEvent.DESTROY),za=function(e){function n(){for(var n,r=arguments.length,i=Array(r),a=0;r>a;a++)i[a]=arguments[a];return(n=e.call.apply(e,[this].concat(i))||this).entity=Ba++,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:[0,0,0],localRotation:[0,0,0,1],localScale:[1,1,1],localTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],localSkew:[0,0],position:[0,0,0],rotation:[0,0,0,1],scaling:[1,1,1],worldTransform:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],origin:[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=ls.enableCSSParsing?{anchor:zn,opacity:zn,fillOpacity:zn,strokeOpacity:zn,fill:zn,stroke:zn,transform:zn,transformOrigin:zn,visibility:zn,pointerEvents:zn,lineWidth:zn,lineCap:zn,lineJoin:zn,increasedLineWidthForHitTesting:zn,fontSize:zn,fontFamily:zn,fontStyle:zn,fontWeight:zn,fontVariant:zn,textAlign:zn,textBaseline:zn,textTransform:zn,zIndex:zn,filter:zn,shadowType:zn}:null,n.parsedStyle={},n.attributes={},n}vn(n,e),n.isElement=function(t){return!!t.getAttribute};var r=n.prototype;return r.cloneNode=function(t){throw Error(or)},r.appendChild=function(t,e){var n;if(t.destroyed)throw Error("Cannot append a destroyed element.");return ls.sceneGraphService.attach(t,this,e),(null===(n=this.ownerDocument)||void 0===n?void 0:n.defaultView)&&this.ownerDocument.defaultView.mountChildren(t),Va.relatedNode=this,t.dispatchEvent(Va),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 ja.relatedNode=this,t.dispatchEvent(ja),(null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView)&&t.ownerDocument.defaultView.unmountChildren(t),ls.sceneGraphService.detach(t),t},r.removeChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){this.removeChild(this.childNodes[t])}},r.destroyChildren=function(){for(var t=this.childNodes.length-1;t>=0;t--){var e=this.childNodes[t];e.childNodes.length&&e.destroyChildren(),e.destroy()}},r.matches=function(t){return ls.sceneGraphService.matches(t,this)},r.getElementById=function(t){return ls.sceneGraphService.querySelector("#"+t,this)},r.getElementsByName=function(t){return ls.sceneGraphService.querySelectorAll('[name="'+t+'"]',this)},r.getElementsByClassName=function(t){return ls.sceneGraphService.querySelectorAll("."+t,this)},r.getElementsByTagName=function(t){return ls.sceneGraphService.querySelectorAll(t,this)},r.querySelector=function(t){return ls.sceneGraphService.querySelector(t,this)},r.querySelectorAll=function(t){return ls.sceneGraphService.querySelectorAll(t,this)},r.closest=function(t){var e=this;do{if(ls.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=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=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n.slice(1);this.parentNode.appendChild(i,t),i.after.apply(i,a)}},r.replaceWith=function(){this.after.apply(this,arguments),this.remove()},r.append=function(){for(var t=this,e=arguments.length,n=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=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(Ya),this.remove(),this.emitter.removeAllListeners(),this.destroyed=!0},r.getGeometryBounds=function(){return ls.sceneGraphService.getGeometryBounds(this)},r.getRenderBounds=function(){return ls.sceneGraphService.getBounds(this,!0)},r.getBounds=function(){return ls.sceneGraphService.getBounds(this)},r.getLocalBounds=function(){return ls.sceneGraphService.getLocalBounds(this)},r.getBoundingClientRect=function(){return ls.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){if(function(t){return"symbol"==typeof t}(t))return ls.enableCSSParsing?null:void 0;var e=this.attributes[t];if(void 0===e){var n=Dn(t);return e=this.attributes[n],ls.enableCSSParsing&&$t(e)?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 Error(or)},r.getAttributeNode=function(t){throw Error(or)},r.getAttributeNodeNS=function(t,e){throw Error(or)},r.hasAttributeNS=function(t,e){throw Error(or)},r.removeAttributeNS=function(t,e){throw Error(or)},r.removeAttributeNode=function(t){throw Error(or)},r.setAttributeNS=function(t,e,n){throw Error(or)},r.setAttributeNode=function(t){throw Error(or)},r.setAttributeNodeNS=function(t){throw Error(or)},r.toggleAttribute=function(t,e){throw Error(or)},dn(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}(_a),Xa=function(t){function e(){for(var e,n=arguments.length,r=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 Ea,e.movement=new Ea,e.offset=new Ea,e.global=new Ea,e.screen=new Ea,e}vn(e,t);var n=e.prototype;return n.getModifierState=function(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)},n.initMouseEvent=function(){throw Error(or)},dn(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}(Ra),Wa=function(t){function e(){for(var e,n=arguments.length,r=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}vn(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 Error("getPredictedEvents is not supported!")},n.clone=function(){return this.manager.clonePointerEvent(this)},e}(Xa),Ha=function(t){function e(){for(var e,n=arguments.length,r=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 vn(e,t),e.prototype.clone=function(){return this.manager.cloneWheelEvent(this)},e}(Xa);function qa(t){return!!(null==t?void 0:t.nodeName)}var Ka,Za,Qa,$a=new Ua(t.ElementEvent.ATTR_MODIFIED,null,null,null,null,Ua.MODIFICATION,null,null),Ja={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:""},to={anchor:[0,0],fill:Kn,stroke:Kn,transform:[],zIndex:0,filter:[],shadowType:"outer",miterLimit:10},eo=pn({},to,{opacity:1,fillOpacity:1,strokeOpacity:1,visibility:"visible",pointerEvents:"auto",lineWidth:1,lineCap:"butt",lineJoin:"miter",increasedLineWidthForHitTesting:0,fillRule:"nonzero"}),no=[].concat(["opacity","fillOpacity","strokeOpacity","transformOrigin","visibility","pointerEvents","lineWidth","lineCap","lineJoin","increasedLineWidthForHitTesting"],["fontSize","fontFamily","fontStyle","fontWeight","fontVariant","textAlign","textBaseline","textTransform"]),ro="data-",io=function(e){function n(n){var r,i;(i=e.call(this)||this).config=void 0,i.isCustomElement=!1,i.isMutationObserved=!1,i.activeAnimations=[],i.dataset=void 0,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=i.config.style||i.config.attrs||{},Object.assign(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,ls.enableCSSParsing?to:eo,i.config.initialParsedStyle),ls.enableCSSParsing&&Object.assign(i.attributes,Ja),i.initAttributes(i.config.style);var a=ls.globalThis.Proxy?ls.globalThis.Proxy:function(){};return ls.enableDataset&&(i.dataset=new a({},{get:function(t,e){var n=""+ro+Ln(e);return void 0!==t[n]?t[n]:i.getAttribute(n)},set:function(t,e,n){return i.setAttribute(""+ro+Ln(e),n),!0}})),ls.enableStyleSyntax&&(i.style=new a({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}})),i}vn(n,e);var r=n.prototype;return r.destroy=function(){e.prototype.destroy.call(this),this.getAnimations().forEach((function(t){t.cancel()}))},r.cloneNode=function(t,e){var n=pn({},this.attributes);for(var r in n){var i=n[r];qa(i)&&"clipPath"!==r&&"offsetPath"!==r&&"textPath"!==r&&(n[r]=i.cloneNode(t)),e&&(n[r]=e(r,i))}var a=new this.constructor({id:this.id,name:this.name,className:this.name,interactive:this.interactive,style:n});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,n={forceUpdateGeometry:!0};ls.enableCSSParsing&&(n.usedAttributes=no);var r={};for(var i in t){r[Dn(i)]=t[i]}ls.styleValueRegistry.processProperties(this,r,n),e.dirty=!0},r.setAttribute=function(t,n,r){void 0===r&&(r=!1);var i=Dn(t);he(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,a=this.attributes[t],o=this.parsedStyle[t];ls.styleValueRegistry.processProperties(this,((r={})[t]=e,r),n),i.dirty=!0;var s=this.parsedStyle[t];this.isConnected&&($a.relatedNode=this,$a.prevValue=a,$a.newValue=e,$a.attrName=t,$a.prevParsedValue=o,$a.newParsedValue=s,this.isMutationObserved?this.dispatchEvent($a):($a.target=this,this.ownerDocument.defaultView.dispatchEvent($a,!0))),(this.isCustomElement&&this.isConnected||!this.isCustomElement)&&this.attributeChangedCallback&&this.attributeChangedCallback(t,a,e,o,s)},r.getBBox=function(){var t=this.getBounds(),e=t.getMin(),n=e[0],r=e[1],i=t.getMax();return new ba(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),ls.sceneGraphService.setOrigin(this,pr(t,e,n)),this},r.getOrigin=function(){return ls.sceneGraphService.getOrigin(this)},r.setPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ls.sceneGraphService.setPosition(this,pr(t,e,n)),this},r.setLocalPosition=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ls.sceneGraphService.setLocalPosition(this,pr(t,e,n)),this},r.translate=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ls.sceneGraphService.translate(this,pr(t,e,n)),this},r.translateLocal=function(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=0),ls.sceneGraphService.translateLocal(this,pr(t,e,n)),this},r.getPosition=function(){return ls.sceneGraphService.getPosition(this)},r.getLocalPosition=function(){return ls.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=pr(t,e=e||t,n=n||t)),ls.sceneGraphService.scaleLocal(this,t),this},r.setLocalScale=function(t,e,n){return"number"==typeof t&&(t=pr(t,e=e||t,n=n||t)),ls.sceneGraphService.setLocalScale(this,t),this},r.getLocalScale=function(){return ls.sceneGraphService.getLocalScale(this)},r.getScale=function(){return ls.sceneGraphService.getScale(this)},r.getEulerAngles=function(){return mr(yr(R(),ls.sceneGraphService.getWorldTransform(this))[2])},r.getLocalEulerAngles=function(){return mr(yr(R(),ls.sceneGraphService.getLocalRotation(this))[2])},r.setEulerAngles=function(t){return ls.sceneGraphService.setEulerAngles(this,0,0,t),this},r.setLocalEulerAngles=function(t){return ls.sceneGraphService.setLocalEulerAngles(this,0,0,t),this},r.rotateLocal=function(t,e,n){return $t(e)&&$t(n)?ls.sceneGraphService.rotateLocal(this,0,0,t):ls.sceneGraphService.rotateLocal(this,t,e,n),this},r.rotate=function(t,e,n){return $t(e)&&$t(n)?ls.sceneGraphService.rotate(this,0,0,t):ls.sceneGraphService.rotate(this,t,e,n),this},r.setRotation=function(t,e,n,r){return ls.sceneGraphService.setRotation(this,t,e,n,r),this},r.setLocalRotation=function(t,e,n,r){return ls.sceneGraphService.setLocalRotation(this,t,e,n,r),this},r.setLocalSkew=function(t,e){return ls.sceneGraphService.setLocalSkew(this,t,e),this},r.getRotation=function(){return ls.sceneGraphService.getRotation(this)},r.getLocalRotation=function(){return ls.sceneGraphService.getLocalRotation(this)},r.getLocalSkew=function(){return ls.sceneGraphService.getLocalSkew(this)},r.getLocalTransform=function(){return ls.sceneGraphService.getLocalTransform(this)},r.getWorldTransform=function(){return ls.sceneGraphService.getWorldTransform(this)},r.setLocalTransform=function(t){return ls.sceneGraphService.setLocalTransform(this,t),this},r.resetLocalTransform=function(){ls.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=Array(e),r=0;e>r;r++)n[r]=arguments[r];var i=n[0],a=n[1];return i?ne(i)?(Object.keys(i).forEach((function(e){t.setAttribute(e,i[e])})),this):2===n.length?(this.setAttribute(i,a),this):this.attributes[i]:this.attributes},r.getMatrix=function(t){var e=t||this.getWorldTransform(),n=b(R(),e),r=n[0],i=n[1],a=T(R(),e),o=a[0],s=a[1],u=M($(),e),l=yr(R(),u);return xr(l[0]||l[2],r,i,o,s)},r.getLocalMatrix=function(){return this.getMatrix(this.getLocalTransform())},r.setMatrix=function(t){var e=Er(t),n=e[0],r=e[1],i=e[2],a=e[3];this.setEulerAngles(e[4]).setPosition(n,r).setLocalScale(i,a)},r.setLocalMatrix=function(t){var e=Er(t),n=e[0],r=e[1],i=e[2],a=e[3];this.setLocalEulerAngles(e[4]).setLocalPosition(n,r).setLocalScale(i,a)},r.show=function(){ls.enableCSSParsing?this.style.visibility="visible":this.forEach((function(t){t.style.visibility="visible"}))},r.hide=function(){ls.enableCSSParsing?this.style.visibility="hidden":this.forEach((function(t){t.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},dn(n,[{key:"interactive",get:function(){return this.isInteractive()},set:function(t){this.style.pointerEvents=t?"auto":"none"}}]),n}(za),ao=["style"],oo=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=gn(r,ao);return e.call(this,pn({type:t.Shape.CIRCLE,style:pn(ls.enableCSSParsing?{cx:"",cy:"",r:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:ls.enableCSSParsing?null:[Jn,Jn]}},a))||this}return vn(n,e),n}(io),so=["style"],uo=function(t){function e(e){var n,r=void 0===e?{}:e,i=r.style,a=gn(r,so);return(n=t.call(this,pn({style:pn(ls.enableCSSParsing?{x:"",y:""}:{},i)},a))||this).isCustomElement=!0,n}return vn(e,t),e}(io),lo=["style"],co=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=gn(r,lo);return e.call(this,pn({type:t.Shape.ELLIPSE,style:pn(ls.enableCSSParsing?{cx:"",cy:"",rx:"",ry:""}:{},i),initialParsedStyle:{anchor:[.5,.5],transformOrigin:ls.enableCSSParsing?null:[Jn,Jn]}},a))||this}return vn(n,e),n}(io),ho=["style"],fo=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=gn(r,ho);return e.call(this,pn({type:t.Shape.GROUP,style:pn(ls.enableCSSParsing?{x:"",y:"",width:"",height:""}:{},i)},a))||this}return vn(n,e),n}(io),po=["style"],vo=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=gn(i,po);return(r=e.call(this,pn({type:t.Shape.HTML,style:pn(ls.enableCSSParsing?{x:"",y:"",width:"auto",height:"auto",innerHTML:""}:{},a)},o))||this).cullable.enable=!1,r}vn(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,a=n.top-r.top,o=new ga;return o.setMinMax([i,a,0],[i+n.width,a+n.height,0]),o}return null},r.getLocalBounds=function(){if(this.parentNode){var t=f(o(),this.parentNode.getWorldTransform()),e=this.getBounds();if(!ga.isEmpty(e)){var n=new ga;return n.setFromTransformedAABB(e,t),n}}return this.getBounds()},n}(io),mo=["style"],go=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=gn(r,mo);return e.call(this,pn({type:t.Shape.IMAGE,style:pn(ls.enableCSSParsing?{x:"",y:"",img:"",width:"",height:""}:{},i)},a))||this}return vn(n,e),n}(io),yo=["style"],xo=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=gn(i,yo);(r=e.call(this,pn({type:t.Shape.LINE,style:pn({x1:0,y1:0,x2:0,y2:0,z1:0,z2:0,isBillboard:!1},a)},o))||this).markerStartAngle=0,r.markerEndAngle=0;var s=r.parsedStyle,u=s.markerStart,l=s.markerEnd;return u&&qa(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),l&&qa(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}vn(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&&qa(r)&&(this.markerStartAngle=0,r.remove()),i&&qa(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t&&(r&&qa(r)&&(this.markerEndAngle=0,r.remove()),i&&qa(i)&&(this.markerEndAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!1)))},r.transformMarker=function(t){var e=this.parsedStyle,n=e.markerStartOffset,r=e.markerEndOffset,i=e.x1,a=e.x2,o=e.y1,s=e.y2,u=e.defX,l=e.defY,c=t?e.markerStart:e.markerEnd;if(c&&qa(c)){var h,f,d,p,v,m,g;t?(p=i-u,v=o-l,f=a-i,d=s-o,m=n||0,g=this.markerStartAngle):(p=a-u,v=s-l,f=i-a,d=o-s,m=r||0,g=this.markerEndAngle),c.setLocalEulerAngles(180*(h=Math.atan2(d,f))/Math.PI+g),c.setLocalPosition(p+Math.cos(h)*m,v+Math.sin(h)*m)}},r.getPoint=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,a=ze.pointAt(n.x1,n.y1,n.x2,n.y2,t),o=a.x,s=a.y,u=X(R(),_(o-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Ea(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 ze.length(t.x1,t.y1,t.x2,t.y2)},n}(io),Eo=["style"],bo={absolutePath:[],hasArc:!1,segments:[],polygons:[],polylines:[],curve:null,totalLength:0,rect:new ba(0,0,0,0)},To=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=gn(i,Eo);(r=e.call(this,pn({type:t.Shape.PATH,style:pn(ls.enableCSSParsing?{path:"",miterLimit:""}:{},a),initialParsedStyle:ls.enableCSSParsing?null:{miterLimit:4,path:pn({},bo)}},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&qa(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),c&&qa(c)&&r.placeMarkerMid(c),l&&qa(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}vn(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&&qa(r)&&(this.markerStartAngle=0,r.remove()),i&&qa(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&qa(r)&&(this.markerEndAngle=0,r.remove()),i&&qa(i)&&(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,a=e.defY,o=t?e.markerStart:e.markerEnd;if(o&&qa(o)){var s,u,l,c,h,f,d;if(t){var p=this.getStartTangent(),v=p[0],m=p[1];c=m[0]-i,h=m[1]-a,u=v[0]-m[0],l=v[1]-m[1],f=n||0,d=this.markerStartAngle}else{var g=this.getEndTangent(),y=g[0],x=g[1];c=x[0]-i,h=x[1]-a,u=y[0]-x[0],l=y[1]-x[1],f=r||0,d=this.markerEndAngle}o.setLocalEulerAngles(180*(s=Math.atan2(l,u))/Math.PI+d),o.setLocalPosition(c+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&&qa(t))for(var a=1;n.length-1>a;a++){var o=n[a].currentPoint,s=o[0],u=o[1],l=1===a?t:t.cloneNode(!0);this.markerMidList.push(l),this.appendChild(l),l.setLocalPosition(s-r,u-i)}},r.getTotalLength=function(){return Rr(this)},r.getPointAtLength=function(t,e){void 0===e&&(e=!1);var n=this.parsedStyle,r=n.defX,i=n.defY,a=function(t,e,n){return qt(t,e,vt(vt({},n),{bbox:!1,length:!0})).point}(n.path.absolutePath,t),o=a.x,s=a.y,u=X(R(),_(o-r,s-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Ea(u[0],u[1])},r.getPoint=function(t,e){return void 0===e&&(e=!1),this.getPointAtLength(t*Rr(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,a=t[e-1].endTangent;n=[],a?(n.push([i[0]-a[0],i[1]-a[1]]),n.push([i[0],i[1]])):(n.push([r[0],r[1]]),n.push([i[0],i[1]]))}return n},n}(io),Mo=["style"],So=function(e){function n(n){var r,i=void 0===n?{}:n,a=i.style,o=gn(i,Mo);(r=e.call(this,pn({type:t.Shape.POLYGON,style:pn(ls.enableCSSParsing?{points:"",miterLimit:"",isClosed:!0}:{},a),initialParsedStyle:ls.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!0}},o))||this).markerStartAngle=0,r.markerEndAngle=0,r.markerMidList=[];var s=r.parsedStyle,u=s.markerStart,l=s.markerEnd,c=s.markerMid;return u&&qa(u)&&(r.markerStartAngle=u.getLocalEulerAngles(),r.appendChild(u)),c&&qa(c)&&r.placeMarkerMid(c),l&&qa(l)&&(r.markerEndAngle=l.getLocalEulerAngles(),r.appendChild(l)),r.transformMarker(!0),r.transformMarker(!1),r}vn(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&&qa(r)&&(this.markerStartAngle=0,r.remove()),i&&qa(i)&&(this.markerStartAngle=i.getLocalEulerAngles(),this.appendChild(i),this.transformMarker(!0))):"markerEnd"===t?(r&&qa(r)&&(this.markerEndAngle=0,r.remove()),i&&qa(i)&&(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.points.points,a=e.defX,o=e.defY,s=t?e.markerStart:e.markerEnd;if(s&&qa(s)){var u,l,c,h,f,d,p;if(h=i[0][0]-a,f=i[0][1]-o,t)l=i[1][0]-i[0][0],c=i[1][1]-i[0][1],d=n||0,p=this.markerStartAngle;else{var v=i.length;this.parsedStyle.isClosed?(l=i[v-1][0]-i[0][0],c=i[v-1][1]-i[0][1]):(h=i[v-1][0]-a,f=i[v-1][1]-o,l=i[v-2][0]-i[v-1][0],c=i[v-2][1]-i[v-1][1]),d=r||0,p=this.markerEndAngle}s.setLocalEulerAngles(180*(u=Math.atan2(c,l))/Math.PI+p),s.setLocalPosition(h+Math.cos(u)*d,f+Math.sin(u)*d)}},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&&qa(t))for(var a=1;(this.parsedStyle.isClosed?n.length:n.length-1)>a;a++){var o=n[a][0]-r,s=n[a][1]-i,u=1===a?t:t.cloneNode(!0);this.markerMidList.push(u),this.appendChild(u),u.setLocalPosition(o,s)}},n}(io),Po=["style"],wo=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=gn(r,Po);return e.call(this,pn({type:t.Shape.POLYLINE,style:pn(ls.enableCSSParsing?{points:"",miterLimit:"",isClosed:!1}:{},i),initialParsedStyle:ls.enableCSSParsing?null:{points:{points:[],totalLength:0,segments:[]},miterLimit:4,isClosed:!1}},a))||this}vn(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,a=n.points,o=a.points,s=0,u=0;a.segments.forEach((function(e,n){e[0]>t||t>e[1]||(s=(t-e[0])/(e[1]-e[0]),u=n)}));var l=ze.pointAt(o[u][0],o[u][1],o[u+1][0],o[u+1][1],s),c=l.x,h=l.y,f=X(R(),_(c-r,h-i,0),e?this.getWorldTransform():this.getLocalTransform());return new Ea(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}(So),ko=["style"],No=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=gn(r,ko);return e.call(this,pn({type:t.Shape.RECT,style:pn(ls.enableCSSParsing?{x:"",y:"",width:"",height:"",radius:""}:{},i)},a))||this}return vn(n,e),n}(io),Co=["style"],Ao=function(e){function n(n){var r=void 0===n?{}:n,i=r.style,a=gn(r,Co);return e.call(this,pn({type:t.Shape.TEXT,style:pn(ls.enableCSSParsing?{x:"",y:"",text:"",fontSize:"",fontFamily:"",fontStyle:"",fontWeight:"",fontVariant:"",textAlign:"",textBaseline:"",textTransform:"",fill:"black",letterSpacing:"",lineHeight:"",miterLimit:"",wordWrap:!1,wordWrapWidth:0,leading:0,dx:"",dy:"",isBillboard:!1,sizeAttenuation:!0}:{fill:"black"},i),initialParsedStyle:ls.enableCSSParsing?{}:{x:0,y:0,fontSize:16,fontFamily:"sans-serif",fontStyle:"normal",fontWeight:"normal",fontVariant:"normal",lineHeight:0,letterSpacing:0,textBaseline:"alphabetic",textAlign:"start",wordWrap:!1,wordWrapWidth:0,leading:0,dx:0,dy:0,isBillboard:!1,sizeAttenuation:!0}},a))||this}vn(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}(io),Oo=[{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,l:!0},{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,int:!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:"cz",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",int:!0,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"}],Ro=Oo.filter((function(t){return!!t.l})).map((function(t){return t.n})),Lo={},Io=new WeakMap,_o=function(){function e(){var t=this;Oo.forEach((function(e){t.registerMetadata(e)}))}var n=e.prototype;return n.registerMetadata=function(t){[t.n].concat(t.a||[]).forEach((function(e){Lo[e]=t}))},n.unregisterMetadata=function(t){delete Lo[t]},n.getPropertySyntax=function(t){return ls.CSSPropertySyntaxFactory[t]},n.processProperties=function(e,n,r){var i=this;if(void 0===r&&(r={skipUpdateAttribute:!1,skipParse:!1,forceUpdateGeometry:!1,usedAttributes:[]}),!ls.enableCSSParsing){Object.assign(e.attributes,n);var a=Object.keys(n),o=e.parsedStyle.clipPath,s=e.parsedStyle.offsetPath;e.parsedStyle=Object.assign(e.parsedStyle,n);var u=!!r.forceUpdateGeometry;if(!u)for(var l=0;Ro.length>l;l++)if(Ro[l]in n){u=!0;break}return n.fill&&(e.parsedStyle.fill=gi(n.fill)),n.stroke&&(e.parsedStyle.stroke=gi(n.stroke)),n.shadowColor&&(e.parsedStyle.shadowColor=gi(n.shadowColor)),n.filter&&(e.parsedStyle.filter=Ci(n.filter)),$t(n.radius)||(e.parsedStyle.radius=Pi(n.radius,4)),$t(n.lineDash)||(e.parsedStyle.lineDash=Pi(n.lineDash,2)),n.points&&(e.parsedStyle.points=Ui(n.points,e)),""===n.path&&(e.parsedStyle.path=pn({},bo)),n.path&&(e.parsedStyle.path=Fi(n.path,e)),n.textTransform&&ls.CSSPropertySyntaxFactory["<text-transform>"].calculator(null,null,{value:n.textTransform},e,null),n.clipPath&&ls.CSSPropertySyntaxFactory["<defined-path>"].calculator("clipPath",o,n.clipPath,e,this),n.offsetPath&&ls.CSSPropertySyntaxFactory["<defined-path>"].calculator("offsetPath",s,n.offsetPath,e,this),n.anchor&&(e.parsedStyle.anchor=Pi(n.anchor,2)),n.transform&&(e.parsedStyle.transform=Xi(n.transform)),n.transformOrigin&&(e.parsedStyle.transformOrigin=ea(n.transformOrigin)),n.markerStart&&(e.parsedStyle.markerStart=ls.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerStart,n.markerStart,null,null)),n.markerEnd&&(e.parsedStyle.markerEnd=ls.CSSPropertySyntaxFactory["<marker>"].calculator(null,n.markerEnd,n.markerEnd,null,null)),n.markerMid&&(e.parsedStyle.markerMid=ls.CSSPropertySyntaxFactory["<marker>"].calculator("",n.markerMid,n.markerMid,null,null)),(e.nodeName!==t.Shape.CIRCLE&&e.nodeName!==t.Shape.ELLIPSE||$t(n.cx)&&$t(n.cy))&&(e.nodeName!==t.Shape.RECT&&e.nodeName!==t.Shape.IMAGE&&e.nodeName!==t.Shape.GROUP&&e.nodeName!==t.Shape.HTML&&e.nodeName!==t.Shape.TEXT&&e.nodeName!==t.Shape.MESH||$t(n.x)&&$t(n.y)&&$t(n.z))&&(e.nodeName!==t.Shape.LINE||$t(n.x1)&&$t(n.y1)&&$t(n.z1)&&$t(n.x2)&&$t(n.y2)&&$t(n.z2))||ls.CSSPropertySyntaxFactory["<coordinate>"].postProcessor(e,a),$t(n.zIndex)||ls.CSSPropertySyntaxFactory["<z-index>"].postProcessor(e,a),n.path&&ls.CSSPropertySyntaxFactory["<path>"].postProcessor(e,a),n.points&&ls.CSSPropertySyntaxFactory["<list-of-points>"].postProcessor(e,a),$t(n.offsetDistance)||ls.CSSPropertySyntaxFactory["<offset-distance>"].postProcessor(e,a),n.transform&&ls.CSSPropertySyntaxFactory["<transform>"].postProcessor(e,a),void(u&&this.updateGeometry(e))}var c=r.skipUpdateAttribute,h=r.skipParse,f=r.usedAttributes,d=r.forceUpdateGeometry,p=Object.keys(n);p.forEach((function(t){var r;c||(e.attributes[t]=n[t]),!d&&(null===(r=Lo[t])||void 0===r?void 0:r.l)&&(d=!0)})),h||p.forEach((function(t){e.computedStyle[t]=i.parseProperty(t,e.attributes[t],e)})),(null==f?void 0:f.length)&&(p=Array.from(new Set(p.concat(f)))),p.forEach((function(t){t in e.computedStyle&&(e.parsedStyle[t]=i.computeProperty(t,e.computedStyle[t],e))})),d&&this.updateGeometry(e),p.forEach((function(t){t in e.parsedStyle&&i.postProcessProperty(t,e,p)})),ls.enableCSSParsing&&e.children.length&&p.forEach((function(t){t in e.parsedStyle&&i.isPropertyInheritable(t)&&e.children.forEach((function(e){e.internalSetAttribute(t,null,{skipUpdateAttribute:!0,skipParse:!0})}))}))},n.parseProperty=function(t,e,n){var r=Lo[t],i=e;if((""===e||$t(e))&&(e="unset"),"unset"===e||"initial"===e||"inherit"===e)i=qn(e);else if(r){var a=r.k,o=r.syntax,s=o&&this.getPropertySyntax(o);a&&a.indexOf(e)>-1?i=qn(e):s&&s.parser&&(i=s.parser(e,n))}return i},n.computeProperty=function(t,e,n){var r=Lo[t],i=e;if(r){var a=r.syntax,o=r.d;if(e instanceof An){var s=e.value;if("unset"===s&&(s=r.inh&&!("g-root"===n.id)?"inherit":"initial"),"initial"===s)$t(o)||(e=this.parseProperty(t,In(o)?o(n.nodeName):o,n));else if("inherit"===s){var u=this.tryToResolveProperty(n,t,{inherited:!0});return $t(u)?void this.addUnresolveProperty(n,t):u}}var l=a&&this.getPropertySyntax(a);if(l&&l.calculator)i=l.calculator(t,n.parsedStyle[t],e,n,this);else i=e instanceof An?e.value:e}return i},n.postProcessProperty=function(t,e,n){var r=Lo[t];if(r&&r.syntax){var i=r.syntax&&this.getPropertySyntax(r.syntax);i&&i.postProcessor&&i.postProcessor(e,n)}},n.addUnresolveProperty=function(t,e){var n=Io.get(t);n||(Io.set(t,[]),n=Io.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=Io.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=Io.get(t);if(e&&e.length){var n={};e.forEach((function(e){n[e]=t.attributes[e]})),this.processProperties(t,n),Io.delete(t)}},n.updateGeometry=function(e){var n=e.nodeName,r=ls.geometryUpdaterFactory[n];if(r){var i=e.geometry;i.contentBounds||(i.contentBounds=new ga),i.renderBounds||(i.renderBounds=new ga);var a=e.parsedStyle,o=r.update(a,e),s=o.width,u=o.height,l=o.depth,c=void 0===l?0:l,h=o.offsetX,f=void 0===h?0:h,d=o.offsetY,p=void 0===d?0:d,v=o.offsetZ,m=void 0===v?0:v,g=[Math.abs(s)/2,Math.abs(u)/2,c/2],y=a.stroke,x=a.lineWidth,E=a.increasedLineWidthForHitTesting,b=a.shadowType,T=a.shadowColor,M=a.filter,S=void 0===M?[]:M,P=a.transformOrigin,w=a.anchor;n===t.Shape.TEXT?delete a.anchor:n===t.Shape.MESH&&(a.anchor[2]=.5);var k=[(1-2*(w&&w[0]||0))*s/2+f,(1-2*(w&&w[1]||0))*u/2+p,(1-2*(w&&w[2]||0))*g[2]+m];if(i.contentBounds.update(k,g),y&&!y.isNone){var N=((x||0)+(E||0))*(n===t.Shape.POLYLINE||n===t.Shape.POLYGON||n===t.Shape.PATH?Math.SQRT2:.5);g[0]+=N,g[1]+=N}if(i.renderBounds.update(k,g),T&&b&&"inner"!==b){var C=i.renderBounds,A=C.min,O=C.max,R=a.shadowBlur||0,L=a.shadowOffsetX||0,I=a.shadowOffsetY||0,_=O[0]+R+L,D=A[1]-R+I,F=O[1]+R+I;A[0]=Math.min(A[0],A[0]-R+L),O[0]=Math.max(O[0],_),A[1]=Math.min(A[1],D),O[1]=Math.max(O[1],F),i.renderBounds.setMinMax(A,O)}S.forEach((function(t){var e=t.name,n=t.params;if("blur"===e){var r=n[0].value;i.renderBounds.update(i.renderBounds.center,hr(i.renderBounds.halfExtents,i.renderBounds.halfExtents,[r,r,0]))}else if("drop-shadow"===e){var a=n[0].value,o=n[1].value,s=n[2].value,u=i.renderBounds,l=u.min,c=u.max,h=c[0]+s+a,f=l[1]-s+o,d=c[1]+s+o;l[0]=Math.min(l[0],l[0]-s+a),c[0]=Math.max(c[0],h),l[1]=Math.min(l[1],f),c[1]=Math.max(c[1],d),i.renderBounds.setMinMax(l,c)}})),w=a.anchor;var G=0>s,U=0>u,B=(G?-1:1)*(P?ki(P[0],0,e):0),V=(U?-1:1)*(P?ki(P[1],1,e):0);e.setOrigin(B-=(G?-1:1)*(w&&w[0]||0)*i.contentBounds.halfExtents[0]*2,V-=(U?-1:1)*(w&&w[1]||0)*i.contentBounds.halfExtents[1]*2),ls.sceneGraphService.dirtifyToRoot(e)}},n.isPropertyInheritable=function(t){var e=Lo[t];return!!e&&e.inh},e}();(Ka=t.CameraType||(t.CameraType={}))[Ka.ORBITING=0]="ORBITING",Ka[Ka.EXPLORING=1]="EXPLORING",Ka[Ka.TRACKING=2]="TRACKING",(Za=t.CameraTrackingMode||(t.CameraTrackingMode={}))[Za.DEFAULT=0]="DEFAULT",Za[Za.ROTATIONAL=1]="ROTATIONAL",Za[Za.TRANSLATIONAL=2]="TRANSLATIONAL",Za[Za.CINEMATIC=3]="CINEMATIC",(Qa=t.CameraProjectionMode||(t.CameraProjectionMode={}))[Qa.ORTHOGRAPHIC=0]="ORTHOGRAPHIC",Qa[Qa.PERSPECTIVE=1]="PERSPECTIVE";var Do,Fo={UPDATED:"updated"},Go=2e-4,Uo=function(){function e(){this.canvas=void 0,this.eventEmitter=new un,this.matrix=o(),this.right=_(1,0,0),this.up=_(0,1,0),this.forward=_(0,0,1),this.position=_(0,0,1),this.focalPoint=_(0,0,0),this.distanceVector=_(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=o(),this.projectionMatrixInverse=o(),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 xa,this.orthoMatrix=o()}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 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 f(o(),this.matrix)},n.getWorldTransform=function(){return this.matrix},n.jitterProjectionMatrix=function(t,e){var n=x(o(),[t,e,0]);this.jitteredProjectionMatrix=p(o(),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,a,o){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=a,this.view.height=o,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,a=this.roll;this.rotate(0,0,-a),this.setPosition(r,i),this.setFocalPoint(r,i),this.setZoom(t),this.rotate(0,0,a);var o=this.canvas.viewport2Canvas({x:e[0],y:e[1]}),s=_(o.x-r,o.y-i,0),u=j(s,this.right)/I(this.right),l=j(s,this.up)/I(this.up);return this.pan(-u,-l),this},n.setPerspective=function(e,n,r,i){var a;this.projectionMode=t.CameraProjectionMode.PERSPECTIVE,this.fov=r,this.near=e,this.far=n,this.aspect=i;var o=this.near*Math.tan(vr(.5*this.fov))/this.zoom,s=2*o,u=this.aspect*s,l=-.5*u;if(null===(a=this.view)||void 0===a?void 0:a.enabled){var c=this.view.fullWidth,h=this.view.fullHeight;l+=this.view.offsetX*u/c,o-=this.view.offsetY*s/h,u*=this.view.width/c,s*=this.view.height/h}return function(t,e,n,r,i,a,o){var s=2*a/(r-i),u=(n+e)/(n-e),l=(r+i)/(r-i),c=-(o+a)/(o-a),h=-2*o*a/(o-a);t[0]=2*a/(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]=l,t[10]=c,t[11]=-1,t[12]=0,t[13]=0,t[14]=h,t[15]=0}(this.projectionMatrix,l,l+u,o,o-s,e,this.far),m(this.projectionMatrix,this.projectionMatrix,_(1,-1,1)),f(this.projectionMatrixInverse,this.projectionMatrix),this.triggerUpdate(),this},n.setOrthographic=function(e,n,r,i,a,o){var s;this.projectionMode=t.CameraProjectionMode.ORTHOGRAPHIC,this.rright=n,this.left=e,this.top=r,this.bottom=i,this.near=a,this.far=o;var u=(this.rright-this.left)/(2*this.zoom),l=(this.top-this.bottom)/(2*this.zoom),c=(this.rright+this.left)/2,h=(this.top+this.bottom)/2,d=c-u,p=c+u,v=h+l,g=h-l;if(null===(s=this.view)||void 0===s?void 0:s.enabled){var y=(this.rright-this.left)/this.view.fullWidth/this.zoom,x=(this.top-this.bottom)/this.view.fullHeight/this.zoom;p=(d+=y*this.view.offsetX)+y*this.view.width,g=(v-=x*this.view.offsetY)-x*this.view.height}return N(this.projectionMatrix,d,p,g,v,a,o),m(this.projectionMatrix,this.projectionMatrix,_(1,-1,1)),f(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=pr(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=_(0,1,0);if(this.focalPoint=pr(e,n,r),this.trackingMode===t.CameraTrackingMode.CINEMATIC){var a=U(R(),this.focalPoint,this.position);e=a[0],n=a[1],r=a[2];var s=I(a),u=mr(Math.asin(n/s)),l=90+mr(Math.atan2(r,e)),c=o();y(c,c,vr(l)),g(c,c,vr(u)),i=X(R(),[0,1,0],c)}return f(this.matrix,C(o(),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,Go>this.distance&&(this.distance=Go),this.dollyingStep=this.distance/100;var e=R(),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=dr(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=dr(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=dr(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=J($(),[0,0,1],vr(this.roll));c(this.matrix);var n=J($(),[1,0,0],vr((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.elevation)),r=J($(),[0,1,0],vr((this.rotateWorld&&this.type!==t.CameraType.TRACKING||this.type===t.CameraType.TRACKING?1:-1)*this.azimuth)),i=tt($(),r,n);i=tt($(),i,e);var a=P(o(),i);this.type===t.CameraType.ORBITING||this.type===t.CameraType.EXPLORING?(v(this.matrix,this.matrix,this.focalPoint),p(this.matrix,this.matrix,a),v(this.matrix,this.matrix,[0,0,this.distance])):this.type===t.CameraType.TRACKING&&(v(this.matrix,this.matrix,this.position),p(this.matrix,this.matrix,a))},n._setPosition=function(t,e,n){this.position=pr(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(){D(this.right,pr(Q(Z(),[1,0,0,0],this.matrix))),D(this.up,pr(Q(Z(),[0,1,0,0],this.matrix))),D(this.forward,pr(Q(Z(),[0,0,1,0],this.matrix))),V(this.right,this.right),V(this.up,this.up),V(this.forward,this.forward)},n._getAngles=function(){var e=this.distanceVector[0],n=this.distanceVector[1],r=this.distanceVector[2],i=I(this.distanceVector);if(0===i)return this.elevation=0,void(this.azimuth=0);this.type===t.CameraType.TRACKING||this.rotateWorld?(this.elevation=mr(Math.asin(n/i)),this.azimuth=mr(Math.atan2(-e,-r))):(this.elevation=-mr(Math.asin(n/i)),this.azimuth=-mr(Math.atan2(-e,-r)))},n._getPosition=function(){D(this.position,pr(Q(Z(),[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],a=e[2];t[0]=r*n[0]+i*n[3]+a*n[6],t[1]=r*n[1]+i*n[4]+a*n[7],t[2]=r*n[2]+i*n[5]+a*n[8]}(this.distanceVector,[0,0,-this.distance],(t=a(),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)),G(this.focalPoint,this.position,this.distanceVector),this._getDistance()},n._getDistance=function(){this.distanceVector=U(R(),this.focalPoint,this.position),this.distance=I(this.distanceVector),this.dollyingStep=this.distance/100},n._getOrthoMatrix=function(){if(this.projectionMode===t.CameraProjectionMode.ORTHOGRAPHIC){var e=this.position,n=J($(),[0,0,1],-this.roll*Math.PI/180);S(this.orthoMatrix,n,_((this.rright-this.left)/2-e[0],(this.top-this.bottom)/2-e[1],0),_(this.zoom,this.zoom,1),e)}},n.triggerUpdate=function(){if(this.enableUpdate){var t=this.getViewTransform(),e=p(o(),this.getPerspective(),t);this.getFrustum().extractFromVPMatrix(e),this.eventEmitter.emit(Fo.UPDATED)}},n.rotate=function(t,e,n){throw Error(or)},n.pan=function(t,e){throw Error(or)},n.dolly=function(t){throw Error(or)},n.createLandmark=function(t,e){throw Error(or)},n.gotoLandmark=function(t,e){throw Error(or)},n.cancelLandmarkAnimation=function(){throw Error(or)},e}(),Bo=function(){function t(){}return t.prototype.update=function(t,e){var n=t.r;return{width:2*n,height:2*n}},t}(),Vo=function(){function t(){}return t.prototype.update=function(t,e){return{width:2*t.rx,height:2*t.ry}},t}(),jo=function(){function t(){}return t.prototype.update=function(t){var e=t.x1,n=t.y1,r=t.x2,i=t.y2,a=Math.min(e,r),o=Math.max(e,r),s=Math.min(n,i);return{width:o-a,height:Math.max(n,i)-s}},t}(),Yo=function(){function t(){}return t.prototype.update=function(t){var e=t.path.rect;return{width:e.width,height:e.height}},t}(),zo=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}(),Xo=function(){function t(){}return t.prototype.update=function(t,e){var n=t.img,r=t.width,i=t.height,a=void 0===r?0:r,o=void 0===i?0:i;return n&&!ae(n)&&(a||(t.width=a=n.width),o||(t.height=o=n.height)),{width:a,height:o}},t}(),Wo=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&&!$t(t.lineWidth)},e.update=function(t,e){var n,r,i=t.text,a=t.textAlign,o=t.lineWidth,s=t.textBaseline,u=t.dx,l=t.dy,c=((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,c);t.metrics=h;var f=[h.width/2,h.height/2,0],d=[0,1],p=0;"center"===a||"middle"===a?(p=o/2,d=[.5,1]):"right"!==a&&"end"!==a||(p=o,d=[1,1]);var v=0;return"middle"===s?v=f[1]:"top"===s||"hanging"===s?v=2*f[1]:"alphabetic"===s?v=ls.enableCSSParsing?h.lineHeight-h.fontProperties.ascent:0:"bottom"!==s&&"ideographic"!==s||(v=0),u&&(p+=u),l&&(v+=l),t.anchor=[d[0],d[1],0],{width:2*f[0],height:2*f[1],offsetX:p,offsetY:v}},t}(),Ho=function(){function t(t,e){var n=this;this.globalRuntime=void 0,this.context=void 0,this.rootTarget=void 0,this.emitter=new un,this.cursor="default",this.mappingTable={},this.mappingState={trackingData:{}},this.eventPool=new Map,this.pickHandler=void 0,this.tmpMatrix=o(),this.tmpVec3=R(),this.onPointerDown=function(t){var e=n.createPointerEvent(t);if(n.dispatchEvent(e,"pointerdown"),"touch"===e.pointerType)n.dispatchEvent(e,"touchstart");else if("mouse"===e.pointerType||"pen"===e.pointerType){n.dispatchEvent(e,2===e.button?"rightdown":"mousedown")}n.trackingData(t.pointerId).pressTargetsByButton[t.button]=e.composedPath(),n.freeEvent(e)},this.onPointerUp=function(t){var e=performance.now(),r=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);if(n.dispatchEvent(r,"pointerup"),"touch"===r.pointerType)n.dispatchEvent(r,"touchend");else if("mouse"===r.pointerType||"pen"===r.pointerType){n.dispatchEvent(r,2===r.button?"rightup":"mouseup")}var i=n.trackingData(t.pointerId),a=n.findMountedTarget(i.pressTargetsByButton[t.button]),o=a;if(a&&!r.composedPath().includes(a)){for(var s=a;s&&!r.composedPath().includes(s);){if(r.currentTarget=s,n.notifyTarget(r,"pointerupoutside"),"touch"===r.pointerType)n.notifyTarget(r,"touchendoutside");else if("mouse"===r.pointerType||"pen"===r.pointerType){n.notifyTarget(r,2===r.button?"rightupoutside":"mouseupoutside")}_a.isNode(s)&&(s=s.parentNode)}delete i.pressTargetsByButton[t.button],o=s}if(o){var u,l=n.clonePointerEvent(r,"click");l.target=o,l.path=[],i.clicksByButton[t.button]||(i.clicksByButton[t.button]={clickCount:0,target:l.target,timeStamp:e});var c=i.clicksByButton[t.button];c.target===l.target&&200>e-c.timeStamp?++c.clickCount:c.clickCount=1,c.target=l.target,c.timeStamp=e,l.detail=c.clickCount,(null===(u=r.detail)||void 0===u?void 0:u.preventClick)||(n.context.config.useNativeClickEvent||"mouse"!==l.pointerType&&"touch"!==l.pointerType||n.dispatchEvent(l,"click"),n.dispatchEvent(l,"pointertap")),n.freeEvent(l)}n.freeEvent(r)},this.onPointerMove=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0),r="mouse"===e.pointerType||"pen"===e.pointerType,i=n.trackingData(t.pointerId),a=n.findMountedTarget(i.overTargets);if(i.overTargets&&a!==e.target){var o=n.createPointerEvent(t,"mousemove"===t.type?"mouseout":"pointerout",a||void 0);if(n.dispatchEvent(o,"pointerout"),r&&n.dispatchEvent(o,"mouseout"),!e.composedPath().includes(a)){var s=n.createPointerEvent(t,"pointerleave",a||void 0);for(s.eventPhase=s.AT_TARGET;s.target&&!e.composedPath().includes(s.target);)s.currentTarget=s.target,n.notifyTarget(s),r&&n.notifyTarget(s,"mouseleave"),_a.isNode(s.target)&&(s.target=s.target.parentNode);n.freeEvent(s)}n.freeEvent(o)}if(a!==e.target){var u=n.clonePointerEvent(e,"mousemove"===t.type?"mouseover":"pointerover");n.dispatchEvent(u,"pointerover"),r&&n.dispatchEvent(u,"mouseover");for(var l=a&&_a.isNode(a)&&a.parentNode;l&&l!==(_a.isNode(n.rootTarget)&&n.rootTarget.parentNode)&&l!==e.target;)l=l.parentNode;if(!l||l===(_a.isNode(n.rootTarget)&&n.rootTarget.parentNode)){var c=n.clonePointerEvent(e,"pointerenter");for(c.eventPhase=c.AT_TARGET;c.target&&c.target!==a&&c.target!==(_a.isNode(n.rootTarget)&&n.rootTarget.parentNode);)c.currentTarget=c.target,n.notifyTarget(c),r&&n.notifyTarget(c,"mouseenter"),_a.isNode(c.target)&&(c.target=c.target.parentNode);n.freeEvent(c)}n.freeEvent(u)}n.dispatchEvent(e,"pointermove"),"touch"===e.pointerType&&n.dispatchEvent(e,"touchmove"),r&&(n.dispatchEvent(e,"mousemove"),n.cursor=n.getCursor(e.target)),i.overTargets=e.composedPath(),n.freeEvent(e)},this.onPointerOut=function(t){var e=n.trackingData(t.pointerId);if(e.overTargets){var r="mouse"===t.pointerType||"pen"===t.pointerType,i=n.findMountedTarget(e.overTargets),a=n.createPointerEvent(t,"pointerout",i||void 0);n.dispatchEvent(a),r&&n.dispatchEvent(a,"mouseout");var o=n.createPointerEvent(t,"pointerleave",i||void 0);for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==(_a.isNode(n.rootTarget)&&n.rootTarget.parentNode);)o.currentTarget=o.target,n.notifyTarget(o),r&&n.notifyTarget(o,"mouseleave"),_a.isNode(o.target)&&(o.target=o.target.parentNode);e.overTargets=null,n.freeEvent(a),n.freeEvent(o)}n.cursor=null},this.onPointerOver=function(t){var e=n.trackingData(t.pointerId),r=n.createPointerEvent(t),i="mouse"===r.pointerType||"pen"===r.pointerType;n.dispatchEvent(r,"pointerover"),i&&n.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(n.cursor=n.getCursor(r.target));var a=n.clonePointerEvent(r,"pointerenter");for(a.eventPhase=a.AT_TARGET;a.target&&a.target!==(_a.isNode(n.rootTarget)&&n.rootTarget.parentNode);)a.currentTarget=a.target,n.notifyTarget(a),i&&n.notifyTarget(a,"mouseenter"),_a.isNode(a.target)&&(a.target=a.target.parentNode);e.overTargets=r.composedPath(),n.freeEvent(r),n.freeEvent(a)},this.onPointerUpOutside=function(t){var e=n.trackingData(t.pointerId),r=n.findMountedTarget(e.pressTargetsByButton[t.button]),i=n.createPointerEvent(t);if(r){for(var a=r;a;)i.currentTarget=a,n.notifyTarget(i,"pointerupoutside"),"touch"===i.pointerType||"mouse"!==i.pointerType&&"pen"!==i.pointerType||n.notifyTarget(i,2===i.button?"rightupoutside":"mouseupoutside"),_a.isNode(a)&&(a=a.parentNode);delete e.pressTargetsByButton[t.button]}n.freeEvent(i)},this.onWheel=function(t){var e=n.createWheelEvent(t);n.dispatchEvent(e),n.freeEvent(e)},this.onClick=function(t){if(n.context.config.useNativeClickEvent){var e=n.createPointerEvent(t);n.dispatchEvent(e),n.freeEvent(e)}},this.onPointerCancel=function(t){var e=n.createPointerEvent(t,void 0,void 0,n.context.config.alwaysTriggerPointerEventOnCanvas?n.rootTarget:void 0);n.dispatchEvent(e),n.freeEvent(e)},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("pointercancel",this.onPointerCancel),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel),this.addEventMapping("click",this.onClick)},e.destroy=function(){this.emitter.removeAllListeners(),this.mappingTable={},this.mappingState={},this.eventPool.clear()},e.client2Viewport=function(t){var e=this.context.contextService.getBoundingClientRect();return new Ea(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 Ea(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,a=i.width,o=i.height,s=r.getPerspectiveInverse(),u=r.getWorldTransform(),l=p(this.tmpMatrix,u,s),c=F(this.tmpVec3,e/a*2-1,2*(1-n/o)-1,0);return X(c,c,l),new Ea(c[0],c[1])},e.canvas2Viewport=function(t){var e=this.rootTarget.defaultView.getCamera(),n=e.getPerspective(),r=e.getViewTransform(),i=p(this.tmpMatrix,n,r),a=F(this.tmpVec3,t.x,t.y,0);X(this.tmpVec3,this.tmpVec3,i);var o=this.context.config;return new Ea((a[0]+1)/2*o.width,(1-(a[1]+1)/2)*o.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 a=i+1;n.length>a;a++)if(t.currentTarget=n[a],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++)_a.isNode(t)&&t.parentNode&&(e.push(t.parentNode),t=t.parentNode);return n&&e.push(n),e},e.hitTest=function(t){var e=t.viewportX,n=t.viewportY,r=this.context.config;return 0>e||0>n||e>r.width||n>r.height?null:this.pickHandler(t)||this.rootTarget||null},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=En(t.nativeEvent.composedPath());!(e=n()).done;){var r=ls.nativeHTMLMap.get(e.value);if(r)return r}return null},e.pickTarget=function(t){return this.hitTest({clientX:t.clientX,clientY:t.clientY,viewportX:t.viewportX,viewportY:t.viewportY,x:t.canvasX,y:t.canvasY})},e.createPointerEvent=function(t,e,n,r){var i=this.allocateEvent(Wa);this.copyPointerData(t,i),this.copyMouseData(t,i),this.copyData(t,i),i.nativeEvent=t.nativeEvent,i.originalEvent=t;var a=this.getExistedHTML(i);return i.target=null!=n?n:a||this.isNativeEventFromCanvas(i)&&this.pickTarget(i)||r,"string"==typeof e&&(i.type=e),i},e.createWheelEvent=function(t){var e=this.allocateEvent(Ha);this.copyWheelData(t,e),this.copyMouseData(t,e),this.copyData(t,e),e.nativeEvent=t.nativeEvent,e.originalEvent=t;var n=this.getExistedHTML(e);return e.target=n||this.isNativeEventFromCanvas(e)&&this.pickTarget(e),e},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(Ha);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=t.type,e},e.clonePointerEvent=function(t,e){var n=this.allocateEvent(Wa);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){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){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 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||_a.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=_a.isNode(e)&&e.parentNode}},t}(),qo=function(){function t(){this.canvas=void 0,this.context=void 0}var e=t.prototype;return e.getOrCreateCanvas=function(t,e){if(this.canvas)return this.canvas;if(t)this.canvas=t,this.context=this.canvas.getContext("2d",e);else try{this.canvas=new window.OffscreenCanvas(0,0),this.context=this.canvas.getContext("2d",e),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",e)}return this.canvas.width=10,this.canvas.height=10,this.canvas},e.getOrCreateContext=function(t,e){return this.context||this.getOrCreateCanvas(t,e),this.context},t}();(Do=t.RenderReason||(t.RenderReason={}))[Do.CAMERA_CHANGED=0]="CAMERA_CHANGED",Do[Do.DISPLAY_OBJECT_CHANGED=1]="DISPLAY_OBJECT_CHANGED",Do[Do.NONE=2]="NONE";var Ko=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 La(t.ElementEvent.RENDER_ORDER_CHANGED),this.hooks={init:new zr,dirtycheck:new Hr,cull:new Hr,beginFrame:new Wr,beforeRender:new Wr,render:new Wr,afterRender:new Wr,endFrame:new Wr,destroy:new Wr,pick:new Xr,pickSync:new Hr,pointerDown:new Wr,pointerUp:new Wr,pointerMove:new Wr,pointerOut:new Wr,pointerOver:new Wr,pointerWheel:new Wr,pointerCancel:new Wr,click:new Wr},this.globalRuntime=e,this.context=n}var n=e.prototype;return n.init=function(){var t=hn(ln().mark((function t(){var e;return ln().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=pn({},this.globalRuntime,this.context),this.context.renderingPlugins.forEach((function(t){t.apply(e,ls)})),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,e){var n=this;this.stats.total=0,this.stats.rendered=0,this.zIndexCounter=0;var r=this.context.renderingContext;this.globalRuntime.sceneGraphService.syncHierarchy(r.root),this.globalRuntime.sceneGraphService.triggerPendingEvents(),r.renderReasons.size&&this.inited&&(this.renderDisplayObject(r.root,t,r),this.hooks.beginFrame.call(),r.renderListCurrentFrame.forEach((function(t){n.hooks.beforeRender.call(t),n.hooks.render.call(t),n.hooks.afterRender.call(t)})),this.hooks.endFrame.call(),r.renderListCurrentFrame=[],r.renderReasons.clear(),e())},n.renderDisplayObject=function(t,e,n){var r=this,i=e.renderer.getConfig(),a=i.enableDirtyCheck,o=i.enableCulling;this.globalRuntime.enableCSSParsing&&this.globalRuntime.styleValueRegistry.recalc(t);var s=a?this.hooks.dirtycheck.call(t):t;if(s){var u=o?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 l=t.sortable,c=!1;l.dirty&&(l.sorted=t.childNodes.slice().sort(rr),c=!0,l.dirty=!1),(l.sorted||t.childNodes).forEach((function(t){r.renderDisplayObject(t,e,n)})),c&&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(),this.globalRuntime.sceneGraphService.clearPendingEvents()},n.dirtify=function(){this.context.renderingContext.renderReasons.add(t.RenderReason.DISPLAY_OBJECT_CHANGED)},e}(),Zo=/\[\s*(.*)=(.*)\s*\]/,Qo=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,a=r.value;return i?e.find((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):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,a=r.value;return i?e.findAll((function(t){return e!==t&&("name"===i?t.name===a:n.attributeToString(t,i)===a)})):[]}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(Zo),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 $t(n)?"":n.toString?""+n:""},t}();function $o(t){var e=t.renderable;e&&(e.renderBoundsDirty=!0,e.boundsDirty=!0)}var Jo,ts,es,ns=new Ua(t.ElementEvent.REPARENT,null,"","","",0,"",""),rs=function(){function e(e){var n,r,i,a,s,l,h,d,v=this;this.runtime=void 0,this.pendingEvents=[],this.boundsChangedEvent=new La(t.ElementEvent.BOUNDS_CHANGED),this.rotate=(n=$(),function(t,e,r,i){void 0===r&&(r=0),void 0===i&&(i=0),"number"==typeof e&&(e=_(e,r,i));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){var o=$();rt(o,e[0],e[1],e[2]);var s=v.getRotation(t),u=v.getRotation(t.parentNode);ht(n,u),nt(n,n),tt(o,n,o),tt(a.localRotation,o,s),dt(a.localRotation,a.localRotation),v.dirtifyLocal(t,a)}else v.rotateLocal(t,e)}),this.rotateLocal=(r=$(),function(t,e,n,i){void 0===n&&(n=0),void 0===i&&(i=0),"number"==typeof e&&(e=_(e,n,i));var a=t.transformable;rt(r,e[0],e[1],e[2]),ft(a.localRotation,a.localRotation,r),v.dirtifyLocal(t,a)}),this.setEulerAngles=(i=$(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=_(e,n,r));var a=t.transformable;if(null!==t.parentNode&&t.parentNode.transformable){rt(a.localRotation,e[0],e[1],e[2]);var o=v.getRotation(t.parentNode);ht(i,nt($(),o)),ft(a.localRotation,a.localRotation,i),v.dirtifyLocal(t,a)}else v.setLocalEulerAngles(t,e)}),this.translateLocal=function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=_(e,n,r));var i=t.transformable;W(e,R())||(function(t,e,n){var r=n[0],i=n[1],a=n[2],o=e[0],s=e[1],u=e[2],l=i*u-a*s,c=a*o-r*u,h=r*s-i*o,f=i*h-a*c,d=a*l-r*h,p=r*c-i*l,v=2*n[3];c*=v,h*=v,d*=2,p*=2,t[0]=o+(l*=v)+(f*=2),t[1]=s+c+d,t[2]=u+h+p}(e,e,i.localRotation),G(i.localPosition,i.localPosition,e),v.dirtifyLocal(t,i))},this.setPosition=(a=o(),s=R(),function(t,e){var n=t.transformable;s[0]=e[0],s[1]=e[1],s[2]=e[2]||0,W(v.getPosition(t),s)||(D(n.position,s),null!==t.parentNode&&t.parentNode.transformable?(u(a,t.parentNode.transformable.worldTransform),f(a,a),X(n.localPosition,s,a)):D(n.localPosition,s),v.dirtifyLocal(t,n))}),this.setLocalPosition=function(){var t=R();return function(e,n){var r=e.transformable;t[0]=n[0],t[1]=n[1],t[2]=n[2]||0,W(r.localPosition,t)||(D(r.localPosition,t),v.dirtifyLocal(e,r))}}(),this.translate=(l=R(),h=R(),d=R(),function(t,e,n,r){void 0===n&&(n=0),void 0===r&&(r=0),"number"==typeof e&&(e=F(h,e,n,r)),W(e,l)||(G(d,v.getPosition(t),e),v.setPosition(t,d))}),this.setRotation=function(){var t=$();return function(e,n,r,i,a){var o=e.transformable;if("number"==typeof n&&(n=ct(n,r,i,a)),null!==e.parentNode&&e.parentNode.transformable){var s=v.getRotation(e.parentNode);ht(t,s),nt(t,t),tt(o.localRotation,t,n),dt(o.localRotation,o.localRotation),v.dirtifyLocal(e,o)}else v.setLocalRotation(e,n)}},this.displayObjectDependencyMap=new WeakMap,this.calcLocalTransform=function(){var t=o(),e=R(),n=ct(0,0,0,1);return function(r){if(0!==r.localSkew[0]||0!==r.localSkew[1]){if(S(r.localTransform,r.localRotation,r.localPosition,_(1,1,1),r.origin),0!==r.localSkew[0]||0!==r.localSkew[1]){var i=c(t);i[4]=Math.tan(r.localSkew[0]),i[1]=Math.tan(r.localSkew[1]),p(r.localTransform,r.localTransform,i)}var a=S(t,n,e,r.localScale,r.origin);p(r.localTransform,r.localTransform,a)}else S(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,a=!1;t.parentNode&&(a=t.parentNode!==e,this.detach(t)),t.parentNode=e,$t(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 s=t.transformable;s&&this.dirtifyWorld(t,s),s.frozen&&this.unfreezeParentToRoot(t),a&&t.dispatchEvent(ns)},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 a=t.parentNode.childNodes.indexOf(t);a>-1&&t.parentNode.childNodes.splice(a,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=[e,n,r]);var i=t.transformable;if(e[0]!==i.origin[0]||e[1]!==i.origin[1]||e[2]!==i.origin[2]){var a=i.origin;a[0]=e[0],a[1]=e[1],a[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=_(e,n,r));var i=t.transformable;rt(i.localRotation,e[0],e[1],e[2]),this.dirtifyLocal(t,i)},n.scaleLocal=function(t,e){var n,r,i,a=t.transformable;n=a.localScale,r=a.localScale,i=_(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,a)},n.setLocalScale=function(t,e){var n=t.transformable,r=_(e[0],e[1],e[2]||n.localScale[2]);W(r,n.localScale)||(D(n.localScale,r),this.dirtifyLocal(t,n))},n.setLocalRotation=function(t,e,n,r,i){"number"==typeof e&&(e=ct(e,n,r,i));var a=t.transformable;ht(a.localRotation,e),this.dirtifyLocal(t,a)},n.setLocalSkew=function(t,e,n){"number"==typeof e&&(e=function(t,e){var n=new i(2);return n[0]=t,n[1]=e,n}(e,n));var r,a,o=t.transformable;(r=o.localSkew)[0]=(a=e)[0],r[1]=a[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.isMutationObserved?n.dispatchEvent(t.boundsChangedEvent):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.clearPendingEvents(),e.clear()},n.clearPendingEvents=function(){this.pendingEvents=[]},n.dirtifyToRoot=function(t,e){void 0===e&&(e=!1);var n=t;for(n.renderable&&(n.renderable.dirty=!0);n;)$o(n),n=n.parentNode;e&&t.forEach((function(t){$o(t)})),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 a=i[t].indexOf(r);i[t].splice(a,1)}}if(n){var o=this.displayObjectDependencyMap.get(n);o||(this.displayObjectDependencyMap.set(n,{}),o=this.displayObjectDependencyMap.get(n)),o[t]||(o[t]=[]),o[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,!0),r.dispatchEvent(new Ua(t.ElementEvent.ATTR_MODIFIED,r,n,n,e,Ua.MODIFICATION,n,n)),r.isCustomElement&&r.isConnected&&r.attributeChangedCallback&&r.attributeChangedCallback(e,n,n)}))}))},n.getPosition=function(t){var e=t.transformable;return b(e.position,this.getWorldTransform(t,e))},n.getRotation=function(t){var e=t.transformable;return M(e.rotation,this.getWorldTransform(t,e))},n.getScale=function(t){var e=t.transformable;return T(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=b(R(),e),r=M($(),e),i=T(R(),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(ga.isEmpty(r))return null;var i=n||new ga;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 ga},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,a=this.getTransformedGeometryBounds(t,e,i);if(t.childNodes.forEach((function(t){var r=n.getBounds(t,e);r&&(a?a.add(r):(a=i||new ga).update(r.center,r.halfExtents))})),e){var o=ir(t);if(o){var s=o.parsedStyle.clipPath.getBounds(e);a?s&&(a=s.intersection(a)):a=s}}return a||(a=new ga),a&&(e?r.renderBounds=a:r.bounds=a),e?r.renderBoundsDirty=!1:r.boundsDirty=!1,a},n.getLocalBounds=function(t){if(t.parentNode){var e=o();t.parentNode.transformable&&(e=f(o(),this.getWorldTransform(t.parentNode)));var n=this.getBounds(t);if(!ga.isEmpty(n)){var r=new ga;return r.setFromTransformedAABB(n,e),r}}return this.getBounds(t)},n.getBoundingClientRect=function(t){var e,n,r,i=this.getGeometryBounds(t);ga.isEmpty(i)||(r=new ga).setFromTransformedAABB(i,this.getWorldTransform(t));var a=null===(e=t.ownerDocument)||void 0===e||null===(n=e.defaultView)||void 0===n?void 0:n.getContextService().getBoundingClientRect();if(r){var o=r.getMin(),s=o[0],u=o[1],l=r.getMax();return new ba(s+((null==a?void 0:a.left)||0),u+((null==a?void 0:a.top)||0),l[0]-s,l[1]-u)}return new ba((null==a?void 0:a.left)||0,(null==a?void 0:a.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?p(e.worldTransform,r.worldTransform,e.localTransform):u(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}(),is={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]},as=/[a-zA-Z0-9\u00C0-\u00D6\u00D8-\u00f6\u00f8-\u00ff!"#$%&'()*+,-./:;]/,os=RegExp(/[!%),.:;?\]}¢°·'""†‡›℃∶、。〃〆〕〗〞﹚﹜!"%'),.:;?!]}~]/.source+"|"+/[!),.:;?\]}¢·–—'"•"、。〆〞〕〉》」︰︱︲︳﹐﹑﹒﹔﹕﹖﹘﹚﹜!),.:;?︶︸︺︼︾﹀﹂﹗]|}、]/.source+"|"+/[)\]}〕〉》」』】〙〗〟'"⦆»ヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻‐゠–〜?!‼⁇⁈⁉・、:;,。.]/.source+"|"+/[!%),.:;?\]}¢°'"†‡℃〆〈《「『〕!%),.:;?]}]/.source),ss=RegExp(/[$(£¥·'"〈《「『【〔〖〝﹙﹛$(.[{£¥]/.source+"|"+/[([{£¥'"‵〈《「『〔〝︴﹙﹛({︵︷︹︻︽︿﹁﹃﹏]/.source+"|"+/[([{〔〈《「『【〘〖〝'"⦅«—...‥〳〴〵]/.source+"|"+/[$([{£¥'"々〇〉》」〔$([{⦆¥₩#]/.source),us=function(){function t(t){var e=this;this.runtime=void 0,this.fontMetricsCache={},this.shouldBreakByKinsokuShorui=function(t,n){return!e.isBreakingSpace(n)&&!(!t||!ss.exec(n)&&!os.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 a=is.MetricsString+is.BaselineSymbol,o=Math.ceil(i.measureText(a).width),s=Math.ceil(i.measureText(is.BaselineSymbol).width),u=is.HeightMultiplier*s;s=s*is.BaselineMultiplier|0,r.width=o,r.height=u,i.fillStyle="#f00",i.fillRect(0,0,o,u),i.font=t,i.textBaseline="alphabetic",i.fillStyle="#000",i.fillText(a,0,s);var l=i.getImageData(0,0,o||1,u||1).data,c=l.length,h=4*o,f=0,d=0,p=!1;for(f=0;s>f;++f){for(var v=0;h>v;v+=4)if(255!==l[d+v]){p=!0;break}if(p)break;d+=h}for(n.ascent=s-f,d=c-h,p=!1,f=u;f>s;--f){for(var m=0;h>m;m+=4)if(255!==l[d+m]){p=!0;break}if(p)break;d-=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,a=e.lineHeight,o=e.lineWidth,s=e.textBaseline,u=e.textAlign,l=e.letterSpacing,c=e.textPath,h=e.leading,f=void 0===h?0:h,d=function(t){for(var e=t.fontSize,n=t.fontFamily,r=t.fontStyle,i=t.fontVariant,a=t.fontWeight,o=se(e)&&e+"px"||"16px",s=n.split(","),u=s.length-1;u>=0;u--){var l=s[u].trim();!Kr.test(l)&&0>qr.indexOf(l)&&(l='"'+l+'"'),s[u]=l}return r+" "+i+" "+a+" "+o+" "+s.join(",")}(e),p=this.measureFont(d,n);0===p.fontSize&&(p.fontSize=r,p.ascent=r);var v=this.runtime.offscreenCanvas.getOrCreateContext(n);v.font=d,e.isOverflowing=!1;var m=(i?this.wordWrap(t,e,n):t).split(/(?:\r\n|\r|\n)/),g=Array(m.length),y=0;if(!c){for(var x=0;m.length>x;x++){var E=v.measureText(m[x]).width+(m[x].length-1)*l;g[x]=E,y=Math.max(y,E)}var b=y+o,T=a||p.fontSize+o,M=Math.max(T,p.fontSize+o)+(m.length-1)*(T+f),S=0;return"middle"===s?S=-M/2:"bottom"===s||"alphabetic"===s||"ideographic"===s?S=-M:"top"!==s&&"hanging"!==s||(S=0),{font:d,width:b,height:M,lines:m,lineWidths:g,lineHeight:T+=f,maxLineWidth:y,fontProperties:p,lineMetrics:g.map((function(t,e){var n=0;return"center"===u||"middle"===u?n-=t/2:"right"!==u&&"end"!==u||(n-=t),new ba(n-o/2,S+e*T,t+o,T)}))}}c.getTotalLength();for(var P=0;m.length>P;P++)v.measureText(m[P])},e.setGraphemeOnPath=function(){},e.wordWrap=function(t,e,n){var r=this,i=e.wordWrapWidth,a=void 0===i?0:i,o=e.letterSpacing,s=e.maxLines,u=void 0===s?1/0:s,l=e.textOverflow,c=this.runtime.offscreenCanvas.getOrCreateContext(n),h=a+o,f="";"ellipsis"===l?f="...":l&&"clip"!==l&&(f=l);for(var d=[],p=0,v=0,m={},g=function(t){return r.getFromCache(t,o,m,c)},y=Array.from(f).reduce((function(t,e){return t+g(e)}),0),x=Array.from(t),E=0;x.length>E;E++){var b=x[E],T=t[E-1],M=t[E+1],S=g(b);if(this.isNewline(b)){if(++p>=u){e.isOverflowing=!0;break}v=0,d[p]=""}else{if(v>0&&v+S>h){if(p+1>=u){if(e.isOverflowing=!0,y>0&&h>=y){for(var P=d[p].length,w=0,k=P,N=0;P>N;N++){var C=g(d[p][N]);if(w+C+y>h){k=N;break}w+=C}d[p]=(d[p]||"").slice(0,k)+f}break}if(v=0,d[++p]="",this.isBreakingSpace(b))continue;this.canBreakInLastChar(b)||(d=this.trimToBreakable(d),v=this.sumTextWidthByCache(d[p]||"",m)),this.shouldBreakByKinsokuShorui(b,M)&&(d=this.trimByKinsokuShorui(d),v+=g(T||""))}v+=S,d[p]=(d[p]||"")+b}}return d.join("\n")},e.isBreakingSpace=function(t){return"string"==typeof t&&is.BreakingSpaces.indexOf(t.charCodeAt(0))>=0},e.isNewline=function(t){return"string"==typeof t&&is.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),a=r+(this.isBreakingSpace(i)?0:1);return e[e.length-1]+=n.slice(r+1,n.length),e[e.length-2]=n.slice(0,a),e},e.canBreakInLastChar=function(t){return!t||!as.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(!as.test(t[e]))return e;return-1},e.getFromCache=function(t,e,n,r){var i=n[t];if("number"!=typeof i){var a=t.length*e;i=r.measureText(t).width+a,n[t]=i}return i},t}(),ls={},cs=(ts=new Xo,es=new zo,(Jo={})[t.Shape.CIRCLE]=new Bo,Jo[t.Shape.ELLIPSE]=new Vo,Jo[t.Shape.RECT]=ts,Jo[t.Shape.IMAGE]=ts,Jo[t.Shape.GROUP]=ts,Jo[t.Shape.LINE]=new jo,Jo[t.Shape.TEXT]=new Wo(ls),Jo[t.Shape.POLYLINE]=es,Jo[t.Shape.POLYGON]=es,Jo[t.Shape.PATH]=new Yo,Jo[t.Shape.HTML]=null,Jo[t.Shape.MESH]=null,Jo),hs=function(){var e,n=new aa,r=new la;return(e={})[t.PropertySyntax.PERCENTAGE]=null,e[t.PropertySyntax.NUMBER]=new pa,e[t.PropertySyntax.ANGLE]=new ra,e[t.PropertySyntax.DEFINED_PATH]=new ia,e[t.PropertySyntax.PAINT]=n,e[t.PropertySyntax.COLOR]=n,e[t.PropertySyntax.FILTER]=new oa,e[t.PropertySyntax.LENGTH]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE]=r,e[t.PropertySyntax.LENGTH_PERCENTAGE_12]=new ca,e[t.PropertySyntax.LENGTH_PERCENTAGE_14]=new ha,e[t.PropertySyntax.COORDINATE]=new fa,e[t.PropertySyntax.OFFSET_DISTANCE]=new va,e[t.PropertySyntax.OPACITY_VALUE]=new ma,e[t.PropertySyntax.PATH]=new Ta,e[t.PropertySyntax.LIST_OF_POINTS]=new Ma,e[t.PropertySyntax.SHADOW_BLUR]=new Sa,e[t.PropertySyntax.TEXT]=new Pa,e[t.PropertySyntax.TEXT_TRANSFORM]=new wa,e[t.PropertySyntax.TRANSFORM]=new ka,e[t.PropertySyntax.TRANSFORM_ORIGIN]=new Na,e[t.PropertySyntax.Z_INDEX]=new Ca,e[t.PropertySyntax.MARKER]=new da,e}();ls.CameraContribution=Uo,ls.AnimationTimeline=null,ls.EasingFunction=null,ls.offscreenCanvas=new qo,ls.nativeHTMLMap=new WeakMap,ls.sceneGraphSelector=new Qo,ls.sceneGraphService=new rs(ls),ls.textService=new us(ls),ls.geometryUpdaterFactory=cs,ls.CSSPropertySyntaxFactory=hs,ls.styleValueRegistry=new _o,ls.layoutRegistry=null,ls.globalThis=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("Unable to locate global `this`")}(),ls.enableCSSParsing=!0,ls.enableDataset=!1,ls.enableStyleSyntax=!0;var fs=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}(),ds=function(){function t(t){this.plugins=[],this.config=void 0,this.config=pn({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}(),ps=function(){function e(t){this.strategies=void 0,this.strategies=t}return e.prototype.apply=function(n){var r=n.camera,i=n.renderingService,a=n.renderingContext,o=this.strategies;i.hooks.cull.tap(e.tag,(function(e){if(e){var n=e.cullable;return n.visible=0===o.length?a.unculledEntities.indexOf(e.entity)>-1:o.every((function(t){return t.isVisible(r,e)})),!e.isCulled()&&e.isVisible()?e:(e.dispatchEvent(new La(t.ElementEvent.CULLED)),null)}return e})),i.hooks.afterRender.tap(e.tag,(function(t){t.cullable.visibilityPlaneMask=-1}))},e}();ps.tag="Culling";var vs=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}();vs.tag="DirtyCheck";var ms=function(){function t(){var t=this;this.autoPreventDefault=!1,this.rootPointerEvent=new Wa(null),this.rootWheelEvent=new Ha(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 a,o=En(t.normalizeToPointerEvent(e,i));!(a=o()).done;){var s=t.bootstrapEvent(t.rootPointerEvent,a.value,i,e);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(t){return n.context.renderingService.hooks.pickSync.call({position:t,picked:[],topmost:!0}).picked[0]||null})),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,a=En(e);!(r=a()).done;){var o=n.bootstrapEvent(n.rootPointerEvent,r.value,i,t);n.context.eventService.mapEvent(o)}n.setCursor(n.context.eventService.cursor)}})),r.hooks.pointerUp.tap(t.tag,(function(t){if(!i.supportsTouchEvents||"touch"!==t.pointerType){var e=n.context.contextService.getDomElement(),r="outside";try{r=e&&t.target&&t.target!==e&&e.contains&&!e.contains(t.target)?"outside":""}catch(t){}for(var a,o=En(n.normalizeToPointerEvent(t,i));!(a=o()).done;){var s=n.bootstrapEvent(n.rootPointerEvent,a.value,i,t);s.type+=r,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),r.hooks.click.tap(t.tag,this.onPointerMove),r.hooks.pointerCancel.tap(t.tag,(function(t){for(var e,r=En(n.normalizeToPointerEvent(t,i));!(e=r()).done;){var a=n.bootstrapEvent(n.rootPointerEvent,e.value,i,t);n.context.eventService.mapEvent(a)}n.setCursor(n.context.eventService.cursor)}))},e.getViewportXY=function(t){var e,n,r=t.offsetX,i=t.offsetY,a=t.clientX,o=t.clientY;if(!this.context.config.supportsCSSTransform||$t(r)||$t(i)){var s=this.context.eventService.client2Viewport(new Ea(a,o));e=s.x,n=s.y}else e=r,n=i;return{x:e,y:n}},e.bootstrapEvent=function(t,e,n,r){t.view=n,t.originalEvent=null,t.nativeEvent=r,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 i=this.getViewportXY(e),a=i.y;t.viewport.x=i.x,t.viewport.y=a;var o=this.context.eventService.viewport2Canvas(t.viewport),s=o.y;return t.canvas.x=o.x,t.canvas.y=s,t.global.copyFrom(t.canvas),t.offset.copyFrom(t.canvas),t.isTrusted=r.isTrusted,"pointerleave"===t.type&&(t.type="pointerout"),t.type.startsWith("mouse")&&(t.type=t.type.replace("mouse","pointer")),t.type.startsWith("touch")&&(t.type=ur[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),a=i.y;return e.canvas.x=i.x,e.canvas.y=a,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];he(i.button)&&(i.button=0),he(i.buttons)&&(i.buttons=1),he(i.isPrimary)&&(i.isPrimary=1===t.touches.length&&"touchstart"===t.type),he(i.width)&&(i.width=i.radiusX||1),he(i.height)&&(i.height=i.radiusY||1),he(i.tiltX)&&(i.tiltX=0),he(i.tiltY)&&(i.tiltY=0),he(i.pointerType)&&(i.pointerType="touch"),he(i.pointerId)&&(i.pointerId=i.identifier||0),he(i.pressure)&&(i.pressure=i.force||.5),he(i.twist)&&(i.twist=0),he(i.tangentialPressure)&&(i.tangentialPressure=0),i.isNormalized=!0,i.type=t.type,n.push(i)}else if(e.isMouseEvent(t)){var a=t;he(a.isPrimary)&&(a.isPrimary=!0),he(a.width)&&(a.width=1),he(a.height)&&(a.height=1),he(a.tiltX)&&(a.tiltX=0),he(a.tiltY)&&(a.tiltY=0),he(a.pointerType)&&(a.pointerType="mouse"),he(a.pointerId)&&(a.pointerId=1),he(a.pressure)&&(a.pressure=.5),he(a.twist)&&(a.twist=0),he(a.tangentialPressure)&&(a.tangentialPressure=0),a.isNormalized=!0,n.push(a)}else n.push(t);return n},t}();ms.tag="Event";var gs,ys=[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],xs=function(){function e(){}var n=e.prototype;return n.isVisible=function(e,n){var r,i,a=n.cullable;if(!a.enable)return!0;var o=n.getRenderBounds();if(ga.isEmpty(o))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 a.visibilityPlaneMask=this.computeVisibilityWithPlaneMask(n,o,u||t.Mask.INDETERMINATE,s.planes),a.visible=a.visibilityPlaneMask!==t.Mask.OUTSIDE,a.visible},n.computeVisibilityWithPlaneMask=function(e,n,r,i){if(r===t.Mask.OUTSIDE||r===t.Mask.INSIDE)return r;for(var a=t.Mask.INSIDE,o=ys.indexOf(e.nodeName)>-1,s=0,u=i.length;u>s;++s){var l=1<<s;if(0!=(r&l)&&(!o||4!==s&&5!==s)){var c=i[s],h=c.normal,f=c.distance;if(0>j(h,n.getPositiveFarPoint(i[s]))+f)return t.Mask.OUTSIDE;0>j(h,n.getNegativeFarPoint(i[s]))+f&&(a|=l)}}return a},e}(),Es=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,a=n.renderingContext.root.ownerDocument.defaultView;this.rBush=n.rBushRoot;var o=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;ls.enableCSSParsing&&ls.styleValueRegistry.recalc(e),ls.sceneGraphService.dirtifyToRoot(e),i.dirtify()},l=function(t){var e=t.target,n=e.rBushNode;n.aabb&&r.rBush.remove(n.aabb),r.toSync.delete(e),ls.sceneGraphService.dirtifyToRoot(e),i.dirtify()};i.hooks.init.tapPromise(e.tag,hn(ln().mark((function e(){return ln().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a.addEventListener(t.ElementEvent.MOUNTED,u),a.addEventListener(t.ElementEvent.UNMOUNTED,l),a.addEventListener(t.ElementEvent.ATTR_MODIFIED,o),a.addEventListener(t.ElementEvent.BOUNDS_CHANGED,s);case 4:case"end":return e.stop()}}),e)})))),i.hooks.destroy.tap(e.tag,(function(){a.removeEventListener(t.ElementEvent.MOUNTED,u),a.removeEventListener(t.ElementEvent.UNMOUNTED,l),a.removeEventListener(t.ElementEvent.ATTR_MODIFIED,o),a.removeEventListener(t.ElementEvent.BOUNDS_CHANGED,s),r.toSync.clear()})),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 a=i.getMin(),o=a[0],s=a[1],u=i.getMax(),l=u[0],c=u[1];r.aabb||(r.aabb={}),r.aabb.displayObject=n,r.aabb.minX=o,r.aabb.minY=s,r.aabb.maxX=l,r.aabb.maxY=c}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}();Es.tag="Prepare",(gs=t.CanvasEvent||(t.CanvasEvent={})).READY="ready",gs.BEFORE_RENDER="beforerender",gs.RERENDER="rerender",gs.AFTER_RENDER="afterrender",gs.BEFORE_DESTROY="beforedestroy",gs.AFTER_DESTROY="afterdestroy",gs.RESIZE="resize",gs.DIRTY_RECTANGLE="dirtyrectangle";var bs=new La(t.ElementEvent.MOUNTED),Ts=new La(t.ElementEvent.UNMOUNTED),Ms=new La(t.CanvasEvent.BEFORE_RENDER),Ss=new La(t.CanvasEvent.RERENDER),Ps=new La(t.CanvasEvent.AFTER_RENDER),ws=function(e){function r(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=io,r.frameId=void 0,r.inited=!1,r.readyPromise=void 0,r.resolveReadyPromise=void 0,r.context={},r.document=new Ga,r.document.defaultView=yn(r),r.customElements=new Aa;var i=n.container,a=n.canvas,o=n.offscreenCanvas,s=n.width,u=n.height,l=n.devicePixelRatio,c=n.renderer,h=n.background,f=n.cursor,d=n.document,p=n.requestAnimationFrame,v=n.cancelAnimationFrame,m=n.createImage,g=n.supportsPointerEvents,y=n.supportsTouchEvents,x=n.supportsCSSTransform,E=n.useNativeClickEvent,b=n.alwaysTriggerPointerEventOnCanvas,T=n.isTouchEvent,M=n.isMouseEvent;!function(t,e){if(t){var n="string"==typeof t?t:t.id||er++;tr[n]&&tr[n].destroy(),tr[n]=e}}(i,yn(r));var S=s,P=u,w=l;return a&&(w=1>(w=l||nr&&window.devicePixelRatio||1)?1:Math.ceil(w),S=s||function(t){var e=ar(t,"width");return"auto"===e?t.offsetWidth:parseFloat(e)}(a)||a.width/w,P=u||function(t){var e=ar(t,"height");return"auto"===e?t.offsetHeight:parseFloat(e)}(a)||a.height/w),r.devicePixelRatio=w,r.requestAnimationFrame=null!=p?p:ai.bind(ls.globalThis),r.cancelAnimationFrame=null!=v?v:oi.bind(ls.globalThis),r.supportsTouchEvents=null!=y?y:"ontouchstart"in ls.globalThis,r.supportsPointerEvents=null!=g?g:!!ls.globalThis.PointerEvent,r.isTouchEvent=null!=T?T:function(t){return r.supportsTouchEvents&&t instanceof ls.globalThis.TouchEvent},r.isMouseEvent=null!=M?M:function(t){return!ls.globalThis.MouseEvent||t instanceof ls.globalThis.MouseEvent&&(!r.supportsPointerEvents||!(t instanceof ls.globalThis.PointerEvent))},r.initRenderingContext({container:i,canvas:a,width:S,height:P,renderer:c,offscreenCanvas:o,devicePixelRatio:w,cursor:f||"default",background:h||"transparent",createImage:m,document:d,supportsCSSTransform:x,useNativeClickEvent:E,alwaysTriggerPointerEventOnCanvas:b}),r.initDefaultCamera(S,P),hn(ln().mark((function e(){return ln().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.initRenderer(c);case 2:r.dispatchEvent(new La(t.CanvasEvent.READY)),r.readyPromise&&r.resolveReadyPromise();case 4:case"end":return e.stop()}}),e)})))(),r}vn(r,e);var i=r.prototype;return i.initRenderingContext=function(t){this.context.config=t,this.context.renderingContext={root:this.document.documentElement,renderListCurrentFrame:[],unculledEntities:[],renderReasons:new Set,force:!1,dirty:!1}},i.initDefaultCamera=function(e,n){var r=this,i=new ls.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(Fo.UPDATED,(function(){r.context.renderingContext.renderReasons.add(t.RenderReason.CAMERA_CHANGED)})),this.context.camera=i},i.getConfig=function(){return this.context.config},i.getRoot=function(){return this.document.documentElement},i.getCamera=function(){return this.context.camera},i.getContextService=function(){return this.context.contextService},i.getEventService=function(){return this.context.eventService},i.getRenderingService=function(){return this.context.renderingService},i.getRenderingContext=function(){return this.context.renderingContext},i.getStats=function(){return this.getRenderingService().getStats()},i.destroy=function(e,n){(void 0===e&&(e=!0),void 0===n&&(n=!1),n||this.dispatchEvent(new La(t.CanvasEvent.BEFORE_DESTROY)),this.frameId)&&(this.getConfig().cancelAnimationFrame||cancelAnimationFrame)(this.frameId);var r=this.getRoot();this.unmountChildren(r),e&&(this.document.destroy(),this.getEventService().destroy()),this.getRenderingService().destroy(),this.getContextService().destroy(),e&&this.context.rBushRoot&&(this.context.rBushRoot.clear(),this.context.rBushRoot=null,this.context.renderingContext.root=null),n||this.dispatchEvent(new La(t.CanvasEvent.AFTER_DESTROY))},i.changeSize=function(t,e){this.resize(t,e)},i.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,a=i.getProjectionMode();i.setPosition(e/2,n/2,500).setFocalPoint(e/2,n/2,0),a===t.CameraProjectionMode.ORTHOGRAPHIC?i.setOrthographic(e/-2,e/2,n/2,n/-2,i.getNear(),i.getFar()):i.setAspect(e/n),this.dispatchEvent(new La(t.CanvasEvent.RESIZE,{width:e,height:n}))},i.appendChild=function(t,e){return this.document.documentElement.appendChild(t,e)},i.insertBefore=function(t,e){return this.document.documentElement.insertBefore(t,e)},i.removeChild=function(t){return this.document.documentElement.removeChild(t)},i.removeChildren=function(){this.document.documentElement.removeChildren()},i.destroyChildren=function(){this.document.documentElement.destroyChildren()},i.render=function(){var t=this;this.dispatchEvent(Ms),this.getRenderingService().render(this.getConfig(),(function(){t.dispatchEvent(Ss)})),this.dispatchEvent(Ps)},i.run=function(){var t=this;!function e(){t.render(),t.frameId=requestAnimationFrame(e)}()},i.initRenderer=function(){var t=hn(ln().mark((function t(e){return ln().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}throw Error("Renderer is required.");case 2:return this.inited=!1,this.readyPromise=void 0,this.context.rBushRoot=new n,this.context.renderingPlugins=[],this.context.renderingPlugins.push(new ms,new Es,new vs,new ps([new xs])),this.loadRendererContainerModule(e),this.context.contextService=new this.context.ContextService(pn({},ls,this.context)),this.context.renderingService=new Ko(ls,this.context),this.context.eventService=new Ho(ls,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)}}(),i.loadRendererContainerModule=function(t){var e=this;t.getPlugins().forEach((function(t){t.context=e.context,t.init(ls)}))},i.setRenderer=function(){var t=hn(ln().mark((function t(e){var n,r;return ln().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(ls)})),t.next=9,this.initRenderer(e);case 9:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),i.setCursor=function(t){this.getConfig().cursor=t,this.getContextService().applyCursorStyle(t)},i.unmountChildren=function(t){var e=this;t.childNodes.forEach((function(t){e.unmountChildren(t)})),this.inited&&(t.isMutationObserved?t.dispatchEvent(Ts):(Ts.target=t,this.dispatchEvent(Ts,!0)),t!==this.document.documentElement&&(t.ownerDocument=null),t.isConnected=!1),t.isCustomElement&&t.disconnectedCallback&&t.disconnectedCallback()},i.mountChildren=function(t){var e=this;this.inited?t.isConnected||(t.ownerDocument=this.document,t.isConnected=!0,t.isMutationObserved?t.dispatchEvent(bs):(bs.target=t,this.dispatchEvent(bs,!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()},i.client2Viewport=function(t){return this.getEventService().client2Viewport(t)},i.viewport2Client=function(t){return this.getEventService().viewport2Client(t)},i.viewport2Canvas=function(t){return this.getEventService().viewport2Canvas(t)},i.canvas2Viewport=function(t){return this.getEventService().canvas2Viewport(t)},i.getPointByClient=function(t,e){return this.client2Viewport({x:t,y:e})},i.getClientByPoint=function(t,e){return this.viewport2Client({x:t,y:e})},dn(r,[{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}}]),r}(Ia);function ks(t,e){return ks=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ks(t,e)}var Ns=function(e){var n,r;function i(){for(var t,n=arguments.length,r=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}(n=i).prototype=Object.create((r=e).prototype),n.prototype.constructor=n,ks(n,r);var a=i.prototype;return a.rotate=function(e,n,r){if(this.relElevation=dr(n),this.relAzimuth=dr(e),this.relRoll=dr(r),this.elevation+=this.relElevation,this.azimuth+=this.relAzimuth,this.roll+=this.relRoll,this.type===t.CameraType.EXPLORING){var i=J($(),[1,0,0],vr((this.rotateWorld?1:-1)*this.relElevation)),a=J($(),[0,1,0],vr((this.rotateWorld?1:-1)*this.relAzimuth)),s=J($(),[0,0,1],vr(this.relRoll)),u=tt($(),a,i);u=tt($(),u,s);var l=P(o(),u);v(this.matrix,this.matrix,[0,0,-this.distance]),p(this.matrix,this.matrix,l),v(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},a.pan=function(t,e){var n=pr(t,e,0),r=L(this.position);return G(r,r,B(R(),this.right,n[0])),G(r,r,B(R(),this.up,n[1])),this._setPosition(r),this.triggerUpdate(),this},a.dolly=function(e){var n,r=this.forward,i=L(this.position);return i[0]+=(n=Math.max(Math.min(this.distance+e*this.dollyingStep,this.maxDistance),this.minDistance)-this.distance)*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&&G(this.focalPoint,i,this.distanceVector),this.triggerUpdate(),this},a.cancelLandmarkAnimation=function(){void 0!==this.landmarkAnimationID&&this.canvas.cancelAnimationFrame(this.landmarkAnimationID)},a.createLandmark=function(t,e){var n,r,i,a;void 0===e&&(e={});var o=e.position,u=void 0===o?this.position:o,l=e.focalPoint,c=void 0===l?this.focalPoint:l,h=e.roll,f=e.zoom,d=new ls.CameraContribution;d.setType(this.type,void 0),d.setPosition(u[0],null!==(n=u[1])&&void 0!==n?n:this.position[1],null!==(r=u[2])&&void 0!==r?r:this.position[2]),d.setFocalPoint(c[0],null!==(i=c[1])&&void 0!==i?i:this.focalPoint[1],null!==(a=c[2])&&void 0!==a?a:this.focalPoint[2]),d.setRoll(null!=h?h:this.roll),d.setZoom(null!=f?f:this.zoom);var p={name:t,matrix:s(d.getWorldTransform()),right:L(d.right),up:L(d.up),forward:L(d.forward),position:L(d.getPosition()),focalPoint:L(d.getFocalPoint()),distanceVector:L(d.getDistanceVector()),distance:d.getDistance(),dollyingStep:d.getDollyingStep(),azimuth:d.getAzimuth(),elevation:d.getElevation(),roll:d.getRoll(),relAzimuth:d.relAzimuth,relElevation:d.relElevation,relRoll:d.relRoll,zoom:d.getZoom()};return this.landmarks.push(p),p},a.gotoLandmark=function(t,e){var n=this;void 0===e&&(e={});var r=ae(t)?this.landmarks.find((function(e){return e.name===t})):t;if(r){var i=se(e)?{duration:e}:e,a=i.easing,o=void 0===a?"linear":a,s=i.duration,u=void 0===s?100:s,l=i.easingFunction,c=void 0===l?void 0:l,h=i.onfinish,f=void 0===h?void 0:h;if(0===u)return this.syncFromLandmark(r),void(f&&f());this.cancelLandmarkAnimation();var d,p=r.position,v=r.focalPoint,m=r.zoom,g=r.roll,y=c||ls.EasingFunction(o),x=function(){n.setFocalPoint(v),n.setPosition(p),n.setRoll(g),n.setZoom(m),n.computeMatrix(),n.triggerUpdate(),f&&f()};this.canvas.requestAnimationFrame((function t(e){void 0===d&&(d=e);var r=e-d;if(u<r)x();else{var i,a,o=y(r/u),s=R(),l=R();z(s,n.focalPoint,v,o),z(l,n.position,p,o),a=n.roll*(1-o)+g*o,i=n.zoom*(1-o)+m*o,n.setFocalPoint(s),n.setPosition(l),n.setRoll(a),n.setZoom(i),q(s,v)+q(l,p)>.01||null!=m||null!=g?(n.computeMatrix(),n.triggerUpdate(),u>r&&(n.landmarkAnimationID=n.canvas.requestAnimationFrame(t))):x()}}))}},a.syncFromLandmark=function(t){this.matrix=u(this.matrix,t.matrix),this.right=D(this.right,t.right),this.up=D(this.up,t.up),this.forward=D(this.forward,t.forward),this.position=D(this.position,t.position),this.focalPoint=D(this.focalPoint,t.focalPoint),this.distanceVector=D(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}(Uo);ls.CameraContribution=Ns;var Cs,As,Os=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}(),Rs=0,Ls=new WeakMap,Is=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:As&&function(t){return t===As||t===Cs}(t)?As:null}(e[n-1],t);if(r)return void(e[n-1]=r)}else Us.push(this.observer),Gs||(Gs=!0,void 0!==ls.globalThis?ls.globalThis.setTimeout(Bs):Bs());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=Ls.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,a=e.relatedNode.namespaceURI;(n=Ds("attributes",r=e.target)).attributeName=i,n.attributeNamespace=a;var o=e.attrChange===Ua.ADDITION?null:e.prevValue;Fs(r,(function(t){if(t.attributes&&(!t.attributeFilter||!t.attributeFilter.length||-1!==t.attributeFilter.indexOf(i)||-1!==t.attributeFilter.indexOf(a)))return t.attributeOldValue?function(t){return As||((As=Os.copy(Cs)).oldValue=t,As)}(o):n}));break;case t.ElementEvent.REMOVED:case t.ElementEvent.INSERTED:var s,u,l=e.target;e.type===t.ElementEvent.INSERTED?(s=[l],u=[]):(s=[],u=[l]);var c=l.previousSibling,h=l.nextSibling;(n=Ds("childList",r=e.relatedNode)).addedNodes=s,n.removedNodes=u,n.previousSibling=c,n.nextSibling=h,Fs(r,(function(t){if(t.childList)return n}))}Cs=As=void 0},e}(),_s=function(){function t(t){this.callback=void 0,this.nodes=[],this.records=[],this.uid=Rs++,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=Ls.get(t);r||Ls.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 Is(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=Ls.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 Ds(t,e){return Cs=new Os(t,e)}function Fs(t,e){for(var n=t;n;n=n.parentNode){var r=Ls.get(n);if(r)for(var i=0;r.length>i;i++){var a=r[i],o=a.options;if(n===t||o.subtree){var s=e(o);s&&a.enqueue(s)}}}}var Gs=!1,Us=[];function Bs(){Gs=!1;var t=Us;Us=[],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=Ls.get(e);n&&n.forEach((function(e){e.observer===t&&e.removeTransientObservers()}))}))}(t),n.length&&(t.callback(n,t),e=!0)})),e&&Bs()}function Vs(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,(i=void 0,"symbol"==typeof(i=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r.key,"string"))?i:i+""),r)}var i}function js(t,e,n){return e&&Vs(t.prototype,e),n&&Vs(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ys(t,e){return Ys=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Ys(t,e)}var zs=function(t){var e,n;function r(e,n,r,i){var a;return(a=t.call(this,e)||this).currentTime=void 0,a.timelineTime=void 0,a.currentTime=r,a.timelineTime=i,a.target=n,a.type="finish",a.bubbles=!1,a.currentTarget=n,a.defaultPrevented=!1,a.eventPhase=a.AT_TARGET,a.timeStamp=Date.now(),a.currentTime=r,a.timelineTime=i,a}return(e=r).prototype=Object.create((n=t).prototype),e.prototype.constructor=e,Ys(e,n),r}(Ra),Xs=0,Ws=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=""+Xs++,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(){var t=this;if(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(),this.oncancel)){var e=new zs(null,this,this.currentTime,null);setTimeout((function(){t.oncancel(e)}))}},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 Error("Unable to rewind negative playback rate animation with infinite duration");this.currentTime=this._totalDuration}else this.currentTime=0},e.persist=function(){throw Error(or)},e.addEventListener=function(t,e,n){throw Error(or)},e.removeEventListener=function(t,e,n){throw Error(or)},e.dispatchEvent=function(t){throw Error(or)},e.commitStyles=function(){throw 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 zs(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 zs(null,this,this.currentTime,t);this.onframe(r)}this._finishedFlag=!1}},js(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(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(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(!isNaN(t=Number(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(),isNaN(t=Number(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}(),Hs=.1,qs="function"==typeof Float32Array,Ks=function(t,e){return 1-3*e+3*t},Zs=function(t,e){return 3*e-6*t},Qs=function(t){return 3*t},$s=function(t,e,n){return((Ks(e,n)*t+Zs(e,n))*t+Qs(e))*t},Js=function(t,e,n){return 3*Ks(e,n)*t*t+2*Zs(e,n)*t+Qs(e)},tu=function(t,e,n,r){if(0>t||t>1||0>n||n>1)throw Error("bezier x values must be in [0, 1] range");if(t===e&&n===r)return function(t){return t};for(var i=qs?new Float32Array(11):[,,,,,,,,,,,],a=0;11>a;++a)i[a]=$s(a*Hs,t,n);var o=function(e){for(var r=0,a=1;10!==a&&e>=i[a];++a)r+=Hs;--a;var o=r+(e-i[a])/(i[a+1]-i[a])*Hs,s=Js(o,t,n);return.001>s?0===s?o:function(t,e,n,r,i){var a,o,s=0;do{(a=$s(o=e+(n-e)/2,r,i)-t)>0?n=o:e=o}while(Math.abs(a)>1e-7&&10>++s);return o}(e,r,r+Hs,t,n):function(t,e,n,r){for(var i=0;4>i;++i){var a=Js(e,n,r);if(0===a)return e;e-=($s(e,n,r)-t)/a}return e}(e,o,t,n)};return function(t){return 0===t||1===t?t:$s(o(t),e,r)}},eu=function(t){return Math.pow(t,2)},nu=function(t){return Math.pow(t,3)},ru=function(t){return Math.pow(t,4)},iu=function(t){return Math.pow(t,5)},au=function(t){return Math.pow(t,6)},ou=function(t){return 1-Math.cos(t*Math.PI/2)},su=function(t){return 1-Math.sqrt(1-t*t)},uu=function(t){return t*t*(3*t-2)},lu=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)},cu=function(t,e){void 0===e&&(e=[]);var n=e[0],r=e[1],i=void 0===r?.5:r,a=oe(Number(void 0===n?1:n),1,10),o=oe(Number(i),.1,2);return 0===t||1===t?t:-a*Math.pow(2,10*(t-1))*Math.sin(2*Math.PI*(t-1-o/(2*Math.PI)*Math.asin(1/a))/o)},hu=function(t,e,n){void 0===e&&(e=[]);var r=e[0],i=void 0===r?1:r,a=e[1],o=void 0===a?100:a,s=e[2],u=void 0===s?10:s,l=e[3],c=void 0===l?0:l;i=oe(i,.1,1e3),o=oe(o,.1,1e3),u=oe(u,.1,1e3),c=oe(c,.1,1e3);var h=Math.sqrt(o/i),f=u/(2*Math.sqrt(o*i)),d=1>f?h*Math.sqrt(1-f*f):0,p=1>f?(f*h-c)/d:-c+h,v=n?n*t/1e3:t;return v=1>f?Math.exp(-v*f*h)*(1*Math.cos(d*v)+p*Math.sin(d*v)):(1+p*v)*Math.exp(-v*h),0===t||1===t?t:1-v},fu=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)(oe(t,0,1)*r)/r},du=function(t,e){void 0===e&&(e=[]);return tu(e[0],e[1],e[2],e[3])(t)},pu=tu(.42,0,1,1),vu=function(t){return function(e,n,r){return void 0===n&&(n=[]),1-t(1-e,n,r)}},mu=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}},gu=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}},yu={steps:fu,"step-start":function(t){return fu(t,[1,"start"])},"step-end":function(t){return fu(t,[1,"end"])},linear:function(t){return t},"cubic-bezier":du,ease:function(t){return du(t,[.25,.1,.25,1])},in:pu,out:vu(pu),"in-out":mu(pu),"out-in":gu(pu),"in-quad":eu,"out-quad":vu(eu),"in-out-quad":mu(eu),"out-in-quad":gu(eu),"in-cubic":nu,"out-cubic":vu(nu),"in-out-cubic":mu(nu),"out-in-cubic":gu(nu),"in-quart":ru,"out-quart":vu(ru),"in-out-quart":mu(ru),"out-in-quart":gu(ru),"in-quint":iu,"out-quint":vu(iu),"in-out-quint":mu(iu),"out-in-quint":gu(iu),"in-expo":au,"out-expo":vu(au),"in-out-expo":mu(au),"out-in-expo":gu(au),"in-sine":ou,"out-sine":vu(ou),"in-out-sine":mu(ou),"out-in-sine":gu(ou),"in-circ":su,"out-circ":vu(su),"in-out-circ":mu(su),"out-in-circ":gu(su),"in-back":uu,"out-back":vu(uu),"in-out-back":mu(uu),"out-in-back":gu(uu),"in-bounce":lu,"out-bounce":vu(lu),"in-out-bounce":mu(lu),"out-in-bounce":gu(lu),"in-elastic":cu,"out-elastic":vu(cu),"in-out-elastic":mu(cu),"out-in-elastic":gu(cu),spring:hu,"spring-in":hu,"spring-out":vu(hu),"spring-in-out":mu(hu),"spring-out-in":gu(hu)},xu=function(t){return yu[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)]||yu.linear},Eu=function(t){return t},bu=1,Tu=.5,Mu=0;function Su(t,e){return function(n){if(n>=1)return 1;var r=1/t;return(n+=e*r)-n%r}}var Pu="\\s*(-?\\d+\\.?\\d*|-?\\.\\d+)\\s*",wu=RegExp("cubic-bezier\\("+Pu+","+Pu+","+Pu+","+Pu+"\\)"),ku=/steps\(\s*(\d+)\s*\)/,Nu=/steps\(\s*(\d+)\s*,\s*(start|middle|end)\s*\)/;function Cu(t){var e=wu.exec(t);if(e)return tu.apply(void 0,e.slice(1).map(Number));var n=ku.exec(t);if(n)return Su(Number(n[1]),Mu);var r=Nu.exec(t);return r?Su(Number(r[1]),{start:bu,middle:Tu,end:Mu}[r[2]]):xu(t)}function Au(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))}var Ou=0,Ru=1,Lu=2,Iu=3;function _u(t,e,n){var r=function(t,e,n){if(null===e)return Ou;var r=n.endTime;return Math.min(n.delay,r)>e?Ru:Math.min(n.delay+t+n.endDelay,r)>e?Iu:Lu}(t,e,n),i=function(t,e,n,r,i){switch(r){case Ru:return"backwards"===e||"both"===e?0:null;case Iu:return n-i;case Lu:return"forwards"===e||"both"===e?t:null;case Ou:return null}}(t,n.fill,e,r,n.delay);if(null===i)return null;var a="auto"===n.duration?0:n.duration,o=function(t,e,n,r,i){var a=i;return 0===t?e!==Ru&&(a+=n):a+=r/t,a}(a,r,n.iterations,i,n.iterationStart),s=function(t,e,n,r,i,a){var o=t===1/0?e%1:t%1;return 0!==o||n!==Lu||0===r||0===i&&0!==a||(o=1),o}(o,n.iterationStart,r,n.iterations,i,a),u=function(t,e,n,r){return t===Lu&&e===1/0?1/0:1===n?Math.floor(r)-1:Math.floor(r)}(r,n.iterations,s,o),l=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=l,n.easingFunction(l)}function Du(t,e,n){var r=function(t,e){for(var n={},r=0;t.length>r;r++)for(var i in t[r])if(Fu(i)){var a={offset:t[r].offset,computedOffset:t[r].computedOffset,easing:t[r].easing,easingFunction:Cu(t[r].easing)||e.easingFunction,value:t[r][i]};n[i]=n[i]||[],n[i].push(a)}return n}(t,e),i=function(t,e){var n=[];for(var r in t)for(var i=t[r],a=0;i.length-1>a;a++){var o=a,s=a+1,u=i[o].computedOffset,l=i[s].computedOffset,c=u,h=l;0===a&&(c=-1/0,0===l&&(s=o)),a===i.length-2&&(h=1/0,1===u&&(o=s)),n.push({applyFrom:c,applyTo:h,startOffset:i[o].computedOffset,endOffset:i[s].computedOffset,easingFunction:i[o].easingFunction,property:r,interpolation:Uu(r,i[o].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.setAttribute(n.property,n.interpolation(i))}));else for(var n in r)Fu(n)&&t.setAttribute(n,null)}}function Fu(t){return"offset"!==t&&"easing"!==t&&"composite"!==t&&"computedOffset"!==t}var Gu=function(t,e,n){return function(r){var i=Bu(t,e,r);return!ls.enableCSSParsing&&se(i)?i:n(i)}};function Uu(t,e,n,r){var i=Lo[t];if(i&&i.syntax&&i.int){var a=ls.styleValueRegistry.getPropertySyntax(i.syntax);if(a){var o,s;if(ls.enableCSSParsing){var u=ls.styleValueRegistry.parseProperty(t,e,r),l=ls.styleValueRegistry.parseProperty(t,n,r);o=ls.styleValueRegistry.computeProperty(t,u,r),s=ls.styleValueRegistry.computeProperty(t,l,r)}else{var c=a.parserWithCSSDisabled;o=c?c(e,r):e,s=c?c(n,r):n}var h=a.mixer(o,s,r);if(h){var f=Gu.apply(void 0,h);return function(t){return 0===t?e:1===t?n:f(t)}}}}return Gu(!1,!0,(function(t){return t?n:e}))}function Bu(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)){for(var r=t.length,i=e.length,a=Math.max(r,i),o=[],s=0;a>s;s++)o.push(Bu(t[r>s?s:r-1],e[i>s?s:i-1],n));return o}throw Error("Mismatched interpolation arguments "+t+":"+e)}var Vu=function(){function t(){this.delay=0,this.direction="normal",this.duration="auto",this._easing="linear",this.easingFunction=Eu,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 js(t,[{key:"easing",get:function(){return this._easing},set:function(t){this.easingFunction=Cu(t),this._easing=t}}]),t}();function ju(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,a=0;i>a;a++){if(!e[a]){var o={};"offset"in t&&(o.offset=Number(t.offset)),"easing"in t&&(o.easing=t.easing),"composite"in t&&(o.composite=t.composite),e[a]=o}null!=r[a]&&(e[a][n]=r[a])}}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(!isFinite(i=Number(i)))throw Error("Keyframe offsets must be numbers.");if(0>i||i>1)throw Error("Keyframe offsets must be between 0 and 1.");n.computedOffset=i}}else if("composite"===r&&-1===["replace","add","accumulate","auto"].indexOf(i))throw 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,a=0;n.length>a;a++){var o=n[a].offset;if($t(o))r=!1;else{if(i>o)throw new TypeError("Keyframes are not loosely sorted by offset. Sort or specify offsets.");i=o}}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,a=Number(n[0].computedOffset),o=1;r>o;o++){var s=n[o].computedOffset;if(!$t(s)&&!$t(a)){for(var u=1;o-i>u;u++)n[i+u].computedOffset=a+(Number(s)-a)*u/(o-i);i=o,a=Number(s)}}}(),n}var Yu="backwards|forwards|both|none".split("|"),zu="reverse|alternate|alternate-reverse".split("|");function Xu(t,e){var n=new Vu;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===Yu.indexOf(t[e]))return;if("direction"===e&&-1===zu.indexOf(t[e]))return;n[e]=t[e]}})):n.duration=t,n}function Wu(t,e){var n;return Xu(t=Hu(null!==(n=t)&&void 0!==n?n:{duration:"auto"}),e)}function Hu(t){return"number"==typeof t&&(t=isNaN(t)?{duration:"auto"}:{duration:t}),t}var qu=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=Wu(n,!1),this.timing.effect=this,this.timing.activeDuration=Au(this.timing),this.timing.endTime=Math.max(0,this.timing.delay+this.timing.activeDuration+this.timing.endDelay),this.normalizedKeyframes=ju(e,this.timing),this.interpolations=Du(this.normalizedKeyframes,this.timing,this.target);var i=ls.globalThis.Proxy;this.computedTiming=i?new i(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}}):this.timing}var e=t.prototype;return e.applyInterpolations=function(){this.interpolations(this.target,Number(this.timeFraction))},e.update=function(t){return null!==t&&(this.timeFraction=_u(this.timing.activeDuration,t,this.timing),null!==this.timeFraction)},e.getKeyframes=function(){return this.normalizedKeyframes},e.setKeyframes=function(t){this.normalizedKeyframes=ju(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[n]=t[n]}))},t}();function Ku(t,e){return Number(t.id)-Number(e.id)}var Zu=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=[],Number(e.currentTime)>t&&(t=Number(e.currentTime)),e.animations.sort(Ku),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 qu(t,e,n),i=new Ws(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(Ku),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,a=this;this.inTick=!0,this.hasRestartedThisFrame=!1,this.currentTime=t,this.ticking=!1;var o=[],s=[],u=[],l=[];return n.forEach((function(n){n.tick(t,e),n._inEffect?(s.push(n.effect),n.markTarget()):(o.push(n.effect),n.unmarkTarget()),n._needsTick&&(a.ticking=!0);var r=n._inEffect||n._needsTick;n._inTimeline=r,r?u.push(n):l.push(n)})),(r=this.pendingEffects).push.apply(r,o),(i=this.pendingEffects).push.apply(i,s),this.ticking&&this.requestAnimationFrame((function(){})),this.inTick=!1,[u,l]},t}();ls.EasingFunction=Cu,ls.AnimationTimeline=Zu,t.AABB=ga,t.AbstractRenderer=ds,t.AbstractRendererPlugin=fs,t.AdvancedCamera=Ns,t.Animation=Ws,t.AnimationEvent=zs,t.AnimationTimeline=Zu,t.BUILT_IN_PROPERTIES=Oo,t.CSS=Yn,t.CSSGradientValue=Cn,t.CSSKeywordValue=An,t.CSSRGB=jn,t.CSSStyleValue=kn,t.CSSUnitValue=Un,t.Camera=Uo,t.CameraEvent=Fo,t.Canvas=ws,t.Circle=oo,t.CircleUpdater=Bo,t.CustomElement=uo,t.CustomElementRegistry=Aa,t.CustomEvent=La,t.DefaultSceneGraphSelector=Qo,t.DefaultSceneGraphService=rs,t.DisplayObject=io,t.Document=Ga,t.EMPTY_PARSED_PATH=bo,t.ERROR_MSG_METHOD_NOT_IMPLEMENTED=or,t.Element=za,t.Ellipse=co,t.EllipseUpdater=Vo,t.EventService=Ho,t.EventTarget=Ia,t.FederatedEvent=Ra,t.FederatedMouseEvent=Xa,t.FederatedPointerEvent=Wa,t.FederatedWheelEvent=Ha,t.Frustum=xa,t.Group=fo,t.HTML=vo,t.Image=go,t.KeyframeEffect=qu,t.Line=xo,t.LineUpdater=jo,t.MutationEvent=Ua,t.MutationObserver=_s,t.MutationRecord=Os,t.Node=_a,t.OffscreenCanvasCreator=qo,t.Path=To,t.PathUpdater=Yo,t.Plane=ya,t.Point=Ea,t.Polygon=So,t.Polyline=wo,t.PolylineUpdater=zo,t.RBush=n,t.Rect=No,t.RectUpdater=Xo,t.Rectangle=ba,t.Registration=Is,t.RenderingService=Ko,t.Text=Ao,t.TextService=us,t.TextUpdater=Wo,t.compareAnimations=Ku,t.computeLinearGradient=function(t,e,n){var r=vr(n.value),i=0+t/2,a=0+e/2,o=Math.abs(t*Math.cos(r))+Math.abs(e*Math.sin(r));return{x1:i-Math.cos(r)*o/2,y1:a-Math.sin(r)*o/2,x2:i+Math.cos(r)*o/2,y2:a+Math.sin(r)*o/2}},t.computeRadialGradient=function(e,n,r,i,a){var o=r.value,s=i.value;r.unit===t.UnitType.kPercentage&&(o=r.value/100*e),i.unit===t.UnitType.kPercentage&&(s=i.value/100*n);var u=Math.max(Dt([0,0],[o,s]),Dt([0,n],[o,s]),Dt([e,n],[o,s]),Dt([e,0],[o,s]));return a&&(a instanceof Un?u=a.value:a instanceof An&&("closest-side"===a.value?u=Math.min(o,e-o,s,n-s):"farthest-side"===a.value?u=Math.max(o,e-o,s,n-s):"closest-corner"===a.value&&(u=Math.min(Dt([0,0],[o,s]),Dt([0,n],[o,s]),Dt([e,n],[o,s]),Dt([e,0],[o,s]))))),{x:o,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 a=e.parsedStyle,o=a.r;r=Yr(o,o,a.cx,a.cy);break;case t.Shape.ELLIPSE:var s=e.parsedStyle;r=Yr(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,l=u.width,c=u.height,h=u.x,f=u.y,d=u.radius,p=d&&d.some((function(t){return 0!==t}));r=function(t,e,n,r,i){if(i){var a=i[0],o=i[1],s=i[2],u=i[3],l=t>0?1:-1,c=e>0?1:-1,h=l+c!==0?1:0;return[["M",l*a+n,r],["L",t-l*o+n,r],o?["A",o,o,0,0,h,t+n,c*o+r]:null,["L",t+n,e-c*s+r],s?["A",s,s,0,0,h,t+n-l*s,e+r]:null,["L",n+l*u,e+r],u?["A",u,u,0,0,h,n,e+r-c*u]:null,["L",n,c*a+r],a?["A",a,a,0,0,h,l*a+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"]]}(l,c,h,f,p&&d.map((function(t){return oe(t,0,Math.min(Math.abs(l)/2,Math.abs(c)/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,a=void 0===i?0:i,o=r.defY,s=void 0===o?0:o;return t.reduce((function(t,e){var r="";if("M"===e[0]||"L"===e[0]){var i=_(e[1]-a,e[2]-s,0);n&&X(i,i,n),r=""+e[0]+i[0]+","+i[1]}else if("Z"===e[0])r=e[0];else if("C"===e[0]){var o=_(e[1]-a,e[2]-s,0),u=_(e[3]-a,e[4]-s,0),l=_(e[5]-a,e[6]-s,0);n&&(X(o,o,n),X(u,u,n),X(l,l,n)),r=""+e[0]+o[0]+","+o[1]+","+u[0]+","+u[1]+","+l[0]+","+l[1]}else if("A"===e[0]){var c=_(e[6]-a,e[7]-s,0);n&&X(c,c,n),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+","+e[5]+","+c[0]+","+c[1]}else if("Q"===e[0]){var h=_(e[1]-a,e[2]-s,0),f=_(e[3]-a,e[4]-s,0);n&&(X(h,h,n),X(f,f,n)),r=""+e[0]+e[1]+","+e[2]+","+e[3]+","+e[4]+"}"}return t+r}),"")}(r,e,n)},t.createVec3=pr,t.decompose=Er,t.definedProps=function(t){return Object.fromEntries(Object.entries(t).filter((function(t){return void 0!==t[1]})))},t.deg2rad=vr,t.deg2turn=function(t){return t/360},t.findClosestClipPathTarget=ir,t.fromRotationTranslationScale=xr,t.getAngle=dr,t.getEuler=yr,t.getOrCalculatePathTotalLength=Rr,t.grad2deg=function(t){return 0>(t%=400)&&(t+=400),t/400*360},t.isBrowser=nr,t.isCSSGradientValue=function(t){return!!t.type&&!!t.value},t.isCSSRGB=mi,t.isCanvas=function(t){return!!t.document},t.isDisplayObject=qa,t.isFederatedEvent=Oa,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=vi,t.makeTiming=Xu,t.mergeColors=yi,t.normalizeKeyframes=ju,t.normalizeTimingInput=Wu,t.numericTimingToObject=Hu,t.parseColor=gi,t.parseLength=Ei,t.parsePath=Fi,t.parseTransform=Xi,t.parsedTransformToMat4=Nr,t.propertyMetadataCache=Lo,t.rad2deg=mr,t.resetEntityCounter=function(){Ba=0},t.runtime=ls,t.setDOMSize=function(t,e,n){nr&&t.style&&(t.style.width=e+"px",t.style.height=n+"px")},t.translatePathToString=function(t,e,n,r,i,a,o){void 0===r&&(r=0),void 0===i&&(i=0),void 0===a&&(a=0),void 0===o&&(o=0);var s=t.map((function(s,u){var l=t[u+1],c=0===u&&(0!==r||0!==i),h=(u===t.length-1||l&&("M"===l[0]||"Z"===l[0]))&&0!==a&&0!==o;switch(s[0]){case"M":return c?"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?a:0))+","+(s[2]-n+(h?o:0));case"Q":return"Q "+(s[1]-e)+" "+(s[2]-n)+","+(s[3]-e)+" "+(s[4]-n)+(h?" L "+(s[3]-e+a)+","+(s[4]-n+o):"");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+a)+","+(s[6]-n+o):"");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+a)+","+(s[7]-n+o):"");case"Z":return"Z"}})).join(" ");return~s.indexOf("NaN")?"":s},t.turn2deg=gr,Object.defineProperty(t,"__esModule",{value:!0})}));
|